In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to add, delete, modify and check common grammar in mysql, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
SQL statement classification by function (definition, manipulation, control, query)
DDL data definition language, defining tables, libraries, views
DML adds, modifies, and deletes data table records
DCL authorization, transaction control, condition judgment
DQL (not classified by W3C) data table record query
That is, create numbers, delete, modify data base, create numbers, delete, modify tables, etc. (belong to DDL statement)
Add, delete and modify data insert delete update (belongs to DML statement) (truncate deletion) belongs to DDL
Query for data table records (belonging to DQL statement)
1. Creating a database creates a separate database for each software system:
Syntax: create database database name; (the database server default character set is used to create the database)
Complex Writing create database Database name character set character set collate comparison rules
For example: create a database named mydb1. Create database mydb1
Create a mydb2 database using the utf8 character set. Create database mydb2 character set utf8
Create a mydb3 database that uses the utf8 character set with proofing rules. Create database mydb3 character set utf8 collate utf8_bin
Add: each time a database is created, a folder is generated in the data storage directory, and each folder contains db.opt to store the default character set and proofreading rules
2. Query the database
Show databases;-View all databases
Show create database database name;-View data code set
3. Delete the database
Syntax: drop database database name
For example: view all the database show databases in the current database server
View the definition information of the mydb2 database created earlier, show create database mydb2
Delete the mydb1 database drop database mydb1 created earlier
4. Modify the database code set
Syntax: alter database database name character set character set collate comparison rules
For example: change the mydb2 character set to gbk; alter database mydb2 character set gbk
Toggle current usage database: use database name
View the database currently in use: select database ()
Note: all database-related operation statements belong to DDL statements
Thank you for reading this article carefully. I hope the article "adding, deleting, changing and checking Common Grammar in mysql" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.