1 Star 0 Fork 0

Bigben/Java基础

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mysqlstudy.txt 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
Bigben 提交于 2019-10-29 21:09 . java基础
ALTER TABLE person1 ADD sex VARCHAR(10);
SELECT * FROM person1;
ALTER TABLE person1 DROP sex;
ALTER TABLE person1 CHANGE sex sexx INT;
ALTER TABLE person1 MODIFY sexx VARCHAR(20);
ALTER TABLE person1 ALTER sexx SET DEFAULT '性别';
ALTER TABLE person1 ALTER age SET DEFAULT 18;
ALTER TABLE person1 RENAME person2;
SELECT * FROM person2;
ALTER TABLE person2 RENAME person1;
SELECT INDEX FROM person1;
CREATE VIEW personview AS SELECT NAME FROM person1;
SELECT * FROM personview;
CREATE VIEW personview2(stuname,stuno) AS SELECT NAME,id FROM person1;
SELECT * FROM personview2;`person1`
CREATE OR REPLACE VIEW personview2(NAME,noo) AS SELECT NAME,id FROM person1;
CREATE FORCE VIEW view1 AS SELECT * FROM person WITH CHECK OPTION;
CREATE INDEX index1 ON person1(NAME);
SELECT * FROM person1 WHERE NAME='ben';
ALTER TABLE person1 DROP id;
ALTER TABLE person1 ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST,ADD PRIMARY KEY(id);
SELECT DISTINCT age,id FROM person1;
UPDATE person1 SET age=26 WHERE NAME='ben';
SELECT * FROM person1 LIMIT 3,3;
SELECT NAME FROM person UNION SELECT NAME FROM person1 ORDER BY NAME;
EXPLAIN SELECT * FROM person1;
EXPLAIN`person1`SELECT * FROM person WHERE age>20;
SELECT * FROM course;
EXPLAIN SELECT tc.tcdesc FROM teacherCard tc WHERE tc.tcid =
(SELECT t.tcid FROM teacher t WHERE t.tid =
(SELECT c.tid FROM course c WHERE c.cname = 'sql')
);
EXPLAIN SELECT cr.cname FROM ( SELECT * FROM course WHERE tid = 1 UNION SELECT * FROM course WHERE tid = 2 ) cr ;
INSERT INTO teacher VALUES(4,'tz',4) ;
INSERT INTO teacherCard VALUES(4,'tz222');
ALTER TABLE teacher ADD INDEX index_name (tname) ;
EXPLAIN SELECT * FROM teacher WHERE tname = 'tz';
DESC teacher;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Bigbenn/java_foundation.git
git@gitee.com:Bigbenn/java_foundation.git
Bigbenn
java_foundation
Java基础
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385