MySQL 创建数据库
CREATE DATABASE 数据库名;
MySQL 删除数据库
drop database ;
MySQL 选择数据库
use RUNOOB;
MySQL 创建数据表
CREATE TABLE table_name (column_name column_type);
eg:
mysql> CREATE TABLE runoob_tbl(
-> runoob_id INT NOT NULL AUTO_INCREMENT,
-> runoob_title VARCHAR(100) NOT NULL,
-> runoob_author VARCHAR(40) NOT NULL,
-> submission_date DATE,
-> PRIMARY KEY ( runoob_id )
-> )ENGINE=InnoDB DEFAULT CHARSET=utf8;
查看表
show tables
MySQL 删除数据表
DROP TABLE table_name ;
查看表
select * from runoob_tbl;
表中插入数据
INSERT INTO table_name ( field1, field2,…fieldN )
VALUES
( value1, value2,…valueN );
mysql> INSERT INTO runoob_tbl
-> (runoob_title, runoob_author, submission_date)
-> VALUES
-> (“学习 PHP”, “菜鸟教程”, NOW());