当前位置:网站首页>MySQL basic commands

MySQL basic commands

2022-06-24 18:38:00 Brother Mengfan

One 、 The basic commands of the database

(1) Create database

create database  if exists  Database name ; --  Created a name  xx  The database of 

(2) Delete a database

drop database  Database name ;

(3) View all current databases

SHOW DATABASES; -- show databases;

(4) View the current database

select database();

(5) choice ( Switch database

use  The name of the database to switch ; --  Such as :use mysql;

Two 、 The basic command of the table

(1) View all tables in other databases

show tables;-- View all tables in the current database 
show tables from  Database name ; --  Such as :show tables mysql;

(2) Under a database View a The structure of the table

desc  A table name ;

(3) Delete a table

drop table  A table name ; --  grammar  drop table  Table name 

原网站

版权声明
本文为[Brother Mengfan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211333166437.html