简单MySQL 语句
USE spring;

/*
	drop table if exists Employee;
*/

CREATE TABLE Employee (
	id INT  PRIMARY KEY AUTO_INCREMENT,
	email VARCHAR(200),
	dept_id INT
);


SHOW TABLES FROM spring;

SELECT * FROM Employee;

ALTER TABLE Employee ADD NAME VARCHAR(36) AFTER id;


INSERT INTO employee(email,dept_id) VALUE("lucy@gmail.com",2);


UPDATE Employee SET NAME  = "ly" WHERE id = 2;
/*
 *更新多个字段
 */
UPDATE Employee SET NAME="Mary",email="mary@hotmail.com" WHERE id = 3;


UPDATE Employee SET NAME  = "lucy" WHERE email="lucy@gmail.com";

UPDATE Employee SET email = "test@qq.com" WHERE id = 1;


DELETE FROM Employee WHERE id  = 16;


DELETE FROM Employee WHERE id > 4 AND id < 15;


DELETE FROM Employee WHERE NAME = "CC";

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/KinseyGeek/article/details/52349332
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

简单MySQL 语句

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭