1.如何才能创建一个库、表
CREATE DATABASE 数据库:
SHOW databases;
USE 数据库;
DROP DATABASE 数据库;
/*数据表操作/
CREATE TABLE teacher(
id int (4) not null primary key auto_increment,
name char(20)not null,
sex char(10) notnull,
addr char(20) not nullI);
SHOW tables;
2.如何对表中的数据进行增删改查
插入数据
INSERT INTO teacher(name.sex.addr) VALUES('Leo’ Male'' hangzhou');
INSERT INTO teacher(name, sex,addr) VALUES('Able' 'Male' 'hangzhou' );
SELECT *FROM teacher;
更新数据
UPDATE teacher SET name ='ivan' WHERE id =1;
SELECT * FROM teacher;
删除数据
DELETE FROM teacher WHERE name=' ivan';
SELECT *FROM teacher;
DROP TABLE teacher;
MySQL的注释
#...
--...
/*...*/
where句子
select你要的信息 from数据表(或多个)where 满足的条件(条件判断)
常见的内置函数
database()
current user
load_file()
?
?