![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
橙子
这个作者很懒,什么都没留下…
展开
-
保护数据库
完整性 定义 分类:实体完整性、域完整性、用户定义完整性 创建约束(主键、外键) (1) 创建表的同时创建约束 1) 主键primary key 2) 外键foreign key 父关键字在自己表中必须是主键; 父子必须完全一样 3) 唯一unique 4) 默认值default 举例 create table student (sno char(4) primary key, snam...原创 2019-11-08 13:07:34 · 127 阅读 · 0 评论 -
数据库查询
连接查询与子查询 列题: 1. 谁和刘晨同岁 select sage from student where sage = (select sage from student where sname=“刘晨”) and sname <>’刘晨’; 2. 查询各个学生的姓名、所选修课程号及成绩。 select sname,cno,grade from student join sc on ...原创 2019-11-01 16:17:05 · 2307 阅读 · 0 评论