sql query for student schema

Posted by user1214208 on Stack Overflow See other posts from Stack Overflow or by user1214208
Published on 2012-08-31T15:30:52Z Indexed on 2012/08/31 15:38 UTC
Read the original article Hit count: 139

Filed under:
|
|

I tried solving the below question.I just want to make sure if I am correct.

student(student-name, street, city) offering(department, number, section, time, population) titles(department, number, title) enrollment(student-name, department, number, section)

If I need to find The department, number, section, title, and population for every course section

The SQL query I tried is :

select a.department, a.number, a.section,b.title,population as "students"
from offering a ,titles b ,enrollment c,student d
where a.department=b.department
and a.number=b.number
and a.department=c.department
and a.number=c.number
and a.section=c.section
group by a.section

Please let me know if I am correct.

Thank you for your time and patience.

© Stack Overflow or respective owner

Related posts about sql

Related posts about homework