Summary of MySql common table operation commands
This article introduces the relevant knowledge of "summary of MySql common table operation commands". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1: use the show statement to find out what currently exists on the server:
> SHOW DATABASES
2: create a database MYSQLDATA
Mysql > CREATE DATABASE MYSQLDATA
3: select the database you created
Mysql > USE MYSQLDATA; (if Database changed appears by pressing enter key, the operation is successful!)
4: see what tables exist in the current database
Mysql > SHOW TABLES
5: create a database table
Mysql > CREATE TABLE MYTABLE (name VARCHAR (20), sex CHAR (1))
6: display the structure of the table:
Mysql > DESCRIBE MYTABLE
7: add records to the table
Mysql > insert into MYTABLE values ("hyq", "M")
8: load data into database tables in text (for example, D:/mysql.txt)
Mysql > LOAD DATA LOCAL INFILE "D:/mysql.txt" INTO TABLE MYTABLE
9: import .sql file command (for example, D:/mysql.sql)
Mysql > use database
Mysql > source d:/mysql.sql
10: delete the table
Mysql > drop TABLE MYTABLE
11: clear the table
Mysql > delete from MYTABLE
12: update data in the table
Mysql > update MYTABLE set sex= "f" where name='hyq'
This is the end of the summary of MySql common table operation commands. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!