Question: Answer required in SQL (Need 8-14) 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
Answer required in SQL (Need 8-14)


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) Domain 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 Provide SQL instructions for each of the following questions 1. Create the database schema. 2. Find the name of professors that work for the cs department. 3. Find those students (sid) enrolled in courses in the cs department 4. List ssn and name of professors that work for the cs department, but are not teaching any cs courses 5. List the number of courses offered by each department. Just the number of courses (not sections) 6. List of those departments that offer more than 10 courses 7. Produce a list of the name of those students whose professor's name starts with an M. Your result must have no duplicates
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
