//创建表:
CREATE TABLE t_myy
(id BIGINT(8) PRIMARY KEY , NAME CHAR(30) NOT NULL, birth DATE, dept VARCHAR(30),sex VARCHAR(2));
SELECT * FROM t_myy1
//插入表:
INSERT INTO t_myy1 (id, NAME, birth, dept, sex) VALUES ( 2,‘aaa‘, ‘2012-03-01‘, ‘SSS‘, ‘男‘);
//修改表:
UPDATE t_myy1 SET id= 1 WHERE id=2;
//删除表数据:
DELETE FROM t_myy WHERE id=1;
//删除表:
DROP TABLE t_myy
//截断表:
TRUNCATE TABLE t_myy2
//删除表数据:
DELETE FROM t_myy1
//删除表数据:
DELETE
FROM
t_teacher
WHERE id IS NULL ;
//删除表数据:
DELETE FROM t_teacher WHERE NAME LIKE ‘m%‘;
//插入表数据:
INSERT INTO t_teacher VALUES (33, ‘昝清龙‘, ‘女‘);
//插入表数据:
INSERT INTO t_teacher (NAME, sex) VALUES (‘mengyuanyuan‘, ‘女‘);
//插入表数据:
INSERT INTO t_teacher (NAME) VALUE (‘nnn‘);
//表内连接:
SELECT * FROM t_student A JOIN t_teacher B ON a.`name`=b.`name`;
//DUAL叫哑表, 判断真假:
SELECT 0=2 FROM DUAL
//修改表数据:
UPDATE
t_teacher
SET
id = 11
WHERE id = 11 ;
//修改表数据:
UPDATE t_student SET NAME =‘myy‘ WHERE NAME =‘孟园园‘;