Query 6: Find how many faculty are in each rank. Query 7: List the departments w
ID: 3888609 • Letter: Q
Question
Query 6: Find how many faculty are in each rank.
Query 7: List the departments which have only one faculty member.
Query 8: List all stuids which are enrolled in ART 103A.
Query 9: List all stuids which are enrolled in ART 103A and which are enrolled in MTH 103C.
Query 10: List all stuids which are enrolled in ART 103A and which are not enrolled in MTH 103C.
CLASS CLASSID ART103A FACID F101 SCHED ROOM MWF9 Click to Add ENROLL FACULTY M110 HST205A + MTH101B ± MTH103C MWF11 2 F110 2 MWF11 ENROLL STUID GRADE Click to Add ART103A ART103A ART103A CSC201A CSC201A HST205A MTH101B MTH103C MTH1030 S1001 S1002 S1010 S1002 S1020 S1001 S1020 S1002 S1010 FACULTY FACID FACNAME RANK Click to Add- F101 EE F105 F110 F202 Adams Tanaka Professor Instructor Assistant Associate Professor STUDENT STUID -STUNAME MAJOR , CREDITS Click to Add H) S1002 S1010 S1013 S1015 S1020 Smith, Tom History Chin, Ann Burns, Edward Art McCarthy, Owe Math Jones, Mary Math Rivera, Jane CSCExplanation / Answer
Hi,
query6:
to list all faculty and count them according to rank we can use
select count(*),rank from faculty group by rank;
query7:
select dept from faculty group by dept having count(*)=1;
query8:
select stuid from enroll where classid='ART103A';
query9:
select stuid from enroll where classid='ART103A' and classid='MTH10C'; // using and to group conditions
query10:
select stuid from enroll where classid='ART103A' and classid!='MTH10C'; //notice !
Thumbs up if this was helpful otherwise let me know in comments.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.