SQL(Structured Query Language),结构化查询语言
1. 数据查询——select
2. 数据操纵——create,drop,alter
3. 数据定义——insert,update,delete
4. 数据控制——grant,revoke
列级完整性约束条件:primary key
唯一约束条件:unique
表级完整性约束:primary key Cpno references Course(Cno)
例如
数据类型
若表上建有视图,restrict不能删除表,cascade删除表和视图
选择查询若干列 select Sno from Student;
查询全部列 select * from Student;
查询经过计算的列 select 2004-Sage from Student;
消除取值重复的行 select distinct Sno from SC;
一个汉字要占两个字符的位置,所以匹配字符串后跟两个_