数据库的基础知识08
1、笛卡尔积--表与表的运算例:select *from student,class
2、外键: 如果一个属性它不是它所在表的主键,但是它是另一个表的主键,它就称为它在表的外键。where 连接条件 and 定语条件
3、例:1.查询班号、班名及其所在系号、系名select classno,classname,class.departno,departnamefrom class,departmentwhere department.departno=class.departno
4、例:2.查询学生的姓名及其所选的课程的名称select stuname,counamefrom student,course,stucouwh髫潋啜缅ere student.stuno=stucou.stuno and course.couno=stucou.couno
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='旅游系'
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:48
阅读量:62
阅读量:54
阅读量:83
阅读量:36