除了exists,先執行子查詢,再外查詢函數
exists:相關子查詢,先執行外查詢,再根據子查詢字段進行過濾。spa
limit (page-1)*size,sizecode
substr('helloworld',1,5) helloblog
instr('helloworld','w') 6排序
LPAD(salary,10,'*') ****salaryit
TRIM('H' from 'Helloworld') elloworldtable
insert into tableName( column1,column2,...) values(值1,...)
update student set age=18 where name='hwj'
/* 表數據刪除 */
delete from student where age=18
/* 多表 */
delete from student s1,course c1
where s1.class=c1.class
and s1.name='mm';
# 方式2
truncate 語句
truncate table student
# 建立 create table if not exists student(column1,...) # 修改 字段名 Alter table student change column 舊 新字段 # 修改表名 Alter table student rename to student1 # 修改字段類型和約束 Alter table tablename modify column column_name 約束 # 添加字段 Alter table 表名 Add column 字段; # 刪除字段 Alter table 表名 drop column 字段 # 刪除表 drop table if exists 表名