Question: Given the following tables: students (sid,name,age,gpa) courses (cid,deptid, name) professors (ssn,name,address,phone,deptid) enrollment (sid,cid,section,grade, foreign key (sid) references students, foreign key (cid) references courses, foreign key

Given the following tables:

students(sid,name,age,gpa)

courses(cid,deptid, name)

professors(ssn,name,address,phone,deptid)

enrollment(sid,cid,section,grade, foreign key (sid) references students, foreign key (cid) references courses, foreign key (cid,section) references teaches) teaches(cid,section,ssn, foreign key (cid) references courses, foreign key (ssn) references professors)

Where the domain is:

cid is in {198:11,640:151,198:112,...}

deptid is in {cs,math,music,...}

grade is in {A,B,C,...}

section, age, ssn are an integers

address, phone, name are strings

gpa is float

I need the following SQL Query (WHICH MUST WORK IN MYSQL) which will give me the answer to the following question:

Given the following tables: students(sid,name,age,gpa) courses(cid,deptid, name) professors(ssn,name,address,phone,deptid) enrollment(sid,cid,section,grade, foreign key (sid)

students but less than 80, and large sections have at least 80 students. Your result table should have the following rows and columns: deptid |small medium large CS math Each table entry must have the number of sections of a given size offered by each department

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!