网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

数据库的基础知识08

时间:2024-10-16 11:31:27

1、笛卡尔积--表与表的运算例:select *from student,class

数据库的基础知识08

2、外键: 如果一个属性它不是它所在表的主键,但是它是另一个表的主键,它就称为它在表的外键。where 连接条件 and 定语条件

3、例:1.查询班号、班名及其所在系号、系名select classno,classname,class.departno,departnamefrom class,departmentwhere department.departno=class.departno

数据库的基础知识08

4、例:2.查询学生的姓名及其所选的课程的名称select stuname,counamefrom student,course,stucouwh髫潋啜缅ere student.stuno=stucou.stuno and course.couno=stucou.couno

数据库的基础知识08

5、例:3.查询选修了旅游系开设的课程的学生的姓名, 课程名称、授课教师select stuname,couname,teacherfrom student,course,stucou,departmentwhere student.stuno=stucou.stuno and course.couno=stucou.couno and department.departno=course.departno and departname='旅游系'

数据库的基础知识08
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com