Question
The following images are of a database with the tables listed (Faculty, Student, Term, Location, Course, Course Section, Enrollment) Kindly write the following SQL queries
The following images are of a database with the tables listed (Faculty, Student, Term, Location, Course, Course Section, Enrollment)
Kindly write the following SQL queries to retrieve data from the above database:
1. Retrieve the faculty IDs of those advisors along with the number of students they are advising. Can this query be written in two ways? If yes, show the way . If no, explain why not possible?
2. Retrieve the number of course sections scheduled in each location sorted from high to low.
3. Modify the above query to show all location(s) that have more than three (3) course sections scheduled in it.
T ENROLLMENT S_ID ICSEC ID GRADE 789 A 1912 STUDENT OSID 78 OS_LAST A OS_FIRST OS MI A IS ADDRESS A OS CITY A OS STATE A S_ZIP A OS PHONE A IS CLASS A OS DOB OS PIN 789 DFID 78 TIME ENROLLED COURSE COURSE ID 78, CALL_ID A COURSE_NAME A CREDITS COURSE SECTION T DC_SEC_ID COURSE_ID 7891 TERM_ID 789 SEC_NUM OF ID 789 OC SEC DAY A OC_SEC_TIME IC DURATION LOCID 789 MAX_ENRL TERM TERM_ID 789 TERM_DESCA STATUS FACULTY OF_ID OF LAST OF FIRST FIM O LOC_ID OF_PHONE OF_FRANK F_PIN OF IMAGE A A A A A 789 A A A A LOCATION LOC_ID BLDG CODE ROOM CAPACITY TI 7891 A A 789 Northwoods University Database Retrieved from Guide to Oracle 9i, Morrison & Morrison, Thomson FACULTY FID F LAST F FIRST FM LOC ID F PHONE F_RANKE PIN FIMAGE Number String String String Number String String String Binary 1 Kim 9 7155551234 ASSC 1181 cak.jpg 2 Blanchard John R 110 7155559087 FUL 1075 Blanchard.de 3 Williams Jerry F | 12 7155555412 ASS 8531 Williams.jpg 4 Sheng Laura M M 11 7155556409 INST 1990 there.ips 5 Brown Phillip E 13 7155556082 ASSO 9899 brown.ips Cox STUDENT SID S LAST IS. FIRST SMIS ADDRESS 5_CITY Number String String String String String 1 Miller Sarah IM 144 Windridge Blvd. Eau Claire 2 Umatc Brian ID 454 St John's Place Eau Claire 3 Black 1 Daniel 8921 Circle Drive Bloomer 4 4 Mobley Amanda) 1716 Summit St. Eau Claire 5 Sancher Ruben IR R 1780 Surnanthe Court Eau Claire 6 Comoly Michael 5 1818 Silver Street Elk Mound 5 STATES ZIP Strin String WI 54703 W1 54702 WI 54715 WI 54703 WI 54701 w W 54712 STUDENT (continued) S PHONE 5_CLASS S DOB SPINFID TIME ENROLLED String String Date/Time String Number Interval 7159659876 SR 07/14/85 869111 3 YEARS 2 MONTHS 7135552345 SR 09/19/851230 1 4 YEARS 6 MONTHS 7155553907 JR 10710782 1613 1 3 YEARS O MONTHS 7155556902 SO 9/24/86 1841 2 2 YEARS 2 MONTHS 7155598899 SO 11/20/36 4420 4 1 YLAR 11 MONTHS 715-9554944 FR 12/4/8791883 O YEARS 4 MONTHS TERM TERMID TERM_DESC STATUS Number Straig Soring 1 Fai 2005 CLOSED 2 Spring 2006 51 CLOSED 3 Summer 2006 4 fall 2006 CLOSED 5 Spring 2007 CLOSE Summer 2007 OPEN LOCATION LOC_ID BLDG CODE Number String 1 CR 2 CH 3 CR 4 CA 5 BUS 6 BUS 7 BUS B BUS 9 BUS 10 BUS 11 BUS 12 LIB 13 LIB ROOM String 101 202 103 105 105 404 421 211 424 402 433 217 222 CAPACITY Number 150 40 35 35 42 35 35 55 1 1 1 2 1 CLOSED Figure 1-16 Northwoods University database COURSE COURSE CALL_ID COURSE NAME CREDITS NumberStrings Number 1 MIS 101 Intro to Into Systems 2 MIS 301 Systems Anal 3 13 MS 641 Database Management 4 CS 155 Programming in C++ 3 5 MS 451 Web-Based Systems - 1 3 COURSE SECTION CUSIC ID COURSE ID TERM ID SEC_NUM FIDC SIC DAY SEC TIME Number Number Number Number Number String Date/Time 1 4 1 2 MWF 10:00 AM 2 1 4 2 3 29 TR 1930 AM 3 3 17 14 3 MWI 8 00 AM 4 2 14 4 1 14 TR 11:00 AM 5 2 15 12 2 14 4 T TR 2.00 PM 6 3 5 1 11 MWE 1900 AM 7 13 5 11 WWW. 10.00 AM 4 5 1 3 ta 5 TR 8:00 AM 9 5 5 1 2 200PM 10 5 5 2 12 MW 3.00 PM 11 1 6 1 1 MIWRF 8:00 AM 12 2 6 11 2 MTWRE 8:00 AM 13 3 6 3 MTWRF 9:00 AM CSEC DURATION LOCUD Inderve Number 50 MINUTES 1 1 HOUR 15 MINUTES 7 50 MINUTES 2 1 HOUR 15 MINUTES G 1 HOUR 15 MINUTES 6 50 MINUTES S 50 MINUTES 15 1 HOURS NUTES 3 50 MINUTES 5 - 50 MINUTES 5 1 HOUR 30 MINUTES1 1 HOUR 30 MINUTES 5 1 HOUR 30 MINUTES 15 MAXINAL Number 140 35 35 39 35 30 130 135 135 35 150 50 35 35 ENROLLMENT SID CSEC ID GRADE Number No Sem 1 1 A 1 14 1 A 1 16 IF 1 9 3 2 11 C 2 15 B 2 16 TA 2 9 13 8 3 1 3 12 13 4 11 4 12 5 1 B 5 5 C 5 C 5 11 12 5 11 6 12Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started