由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - 借宝地问个面试中的sql的问题。
相关主题
CS本科入学率13年曲线[zt] (转载)选课疑问
准备100个包子求大神帮下忙 or up to 50刀 (转载)请教嵌入式培训的课程!
求各位大神能从xml schema自动生成c++类的开源软件牛人指点一下,cs课程
请教怎样尽快看明白同事的程序?confusion about course registration
help: questions and answers for faculty phone interview in computer science请问申请cs phd的prerequisites courses
借宝地一问:开机后出现WINDOWS XP几个大字然后黑屏怎么办请帮忙给看看这个CS MS的课程设置的好不好?
借宝地一问:Can not remove an entry in Regedit.哪个大学的数据库比较强,想考个硕士
chem pH.D --> CSmachine learning vs data mining courses
相关话题的讨论汇总
话题: sql话题: student话题: students话题: many话题: am
进入CS版参与讨论
1 (共1页)
s****e
发帖数: 1180
1
借宝地问个面试中的sql的问题。
We have two tables, students (student ID, student name, student age, student
zip) and courses (course name, course time) .
The information in the parentheses are the schema.
We want to get how many students enroll all the classes starting at 11:00 AM?
the interviewer mentioned something like many to many join.
the interviewer mentioned something like "dimensionalize" in SQL. I am
wondering who knows any SQL book on this, and can introduce it me?
Thank you so much for your consideration!
s****e
发帖数: 1180
2
借宝地问个面试中的sql的问题。
We have two tables, students (student ID, student name, student age, student
zip) and courses (course name, course time) .
The information in the parentheses are the schema.
We want to get how many students enroll all the classes starting at 11:00 AM?
the interviewer mentioned something like many to many join.
the interviewer mentioned something like "dimensionalize" in SQL. I am
wondering who knows any SQL book on this, and can introduce it me?
Thank you so much for your consideration!
m***c
发帖数: 257
3
缺个表记录students 和 courses的对应关系(M to N)
enroll(studentID, coursename, enrolltime)
primary key(studentID, course name, enroll time)
foreign key(studentID) references students(studentID)
foreign key(coursename) form students(coursename)
SELECT S.studentID, S.studentname
FROM students AS S INNER JOIN enroll AS E ON S.studentID= E.studentID
GROUP BY S.studentID, S.studentname
HAVING COUNT(*) = (SELECT COUNT(*) FROM courses)
看《数据库系统导论》吧
1 (共1页)
进入CS版参与讨论
相关主题
machine learning vs data mining courseshelp: questions and answers for faculty phone interview in computer science
关于自然语言处理这个方向借宝地一问:开机后出现WINDOWS XP几个大字然后黑屏怎么办
没有正式修过本科cs课,直接读cs master能吃的消吗? (转载)借宝地一问:Can not remove an entry in Regedit.
CS master 课程里面如果有online course的话对找工作有影响么?chem pH.D --> CS
CS本科入学率13年曲线[zt] (转载)选课疑问
准备100个包子求大神帮下忙 or up to 50刀 (转载)请教嵌入式培训的课程!
求各位大神能从xml schema自动生成c++类的开源软件牛人指点一下,cs课程
请教怎样尽快看明白同事的程序?confusion about course registration
相关话题的讨论汇总
话题: sql话题: student话题: students话题: many话题: am