In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Basic knowledge of day02 MySQL database
1. Overview of basic knowledge:
The foundation determines the success or failure of your course! Only after learning these basic knowledge, can you really use it freely. In order to have a deeper understanding of the database, the road will go farther and farther.
Second, basic knowledge:
1, database (database): the database is like a physical document cabinet, a container, summing up our organized data tables, and so on.
Create database command:
Create database database name
2. View the database
Show databases
3. Open the specified database
Use database name
4. Delete the database
Drop database database name
5. Table: a structured list of data of a particular type, in the form of a grid, to put it bluntly.
Commands for creating tables
Create table table name (field name 1, field name 2,)
6. View table data
Show tables
7. View the table structure
Describe table name; or show columns from table name. Database name
8, column: the concept of column is not unfamiliar to everyone, that is, a vertical data in a grid-type table is called a column.
9. Row: a row is a row of data in a table. The data in the table is stored according to the row, and the saved data is in the row.
10. Primary key (primary key): this is a very important knowledge. As we will say later, a row of data can be uniquely locked when querying data through the primary key. There can be only one primary key in a database table, and it is the only primary key.
11. Modify the table structure
Alter table table name add column definition / add column drop column name / delete column add index index name (column name) / add index drop index index name / / delete index modify column definition Meaning / / modify column definition add primary key (column name) / / add primary key drop primary key / / delete primary key rename new table name / / modify table name
12. Insert data
Insert into table name [(column name,.. n)] values (value,...)
13. View the data in the table
Select column name [as alias] [,... n] | * | expression-> from table name [ . n]-> [where conditional expression]-> [order by column name]-> [group by column name]-> [having conditional expression]-> [like Fuzzy query]-> [concat () Joint Multi-column query]-> [limit qualifies the result row Control the number of rows of output]
14. Delete data from the table
Delete from table name [where conditional expression]
15. Modify data in the table
Update table name set column name = value [where conditional expression]
16. Delete table and duplicate name table
Delete table drop table table name; rename: rename table database name 1 to database name 2
III. Concluding remarks
At this point, I have finished talking about the relevant sql sentences, which may not be comprehensive and detailed enough. I will continue to refine and refine them in later study. Thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.