Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL Help: Q1 Use a Join to provide a list of the CS and EE courses Sara Wilber completed in 2019. List (Exactly): Name, Grade,
SQL Help:
Q1
- Use a Join to provide a list of the CS and EE courses Sara Wilber completed in 2019.
- List (Exactly): Name, Grade, Course, Semester, Year
Q2:
- Use a Join to provide a list of transfer students names.
- These students would have credits but no record of enrolling in courses.
Q3:
- Provide the following information for CS-101 SEC 1 Fall 2020:
- Instructor Name, Student Name, Course Title, Course ID, SEC ID, Semester, Year
Q4:
- Two students hacked the database to bump their grade.
- Use an Outer Join to identify the students who were enrolled in courses without an instructor.
- Provide the following: Instructor ID, Student Name, Course ID, SEC ID, Semester, Year, GRADE
Here's what I got for #1, but I'm not sure it's correct:
SELECT name, grade, course_id, semester, year FROM takes JOIN student WHERE name = Sara Wilber AND (course_id LIKE CS% OR course_id LIKE EE%) AND year = 2019;
I am stuck on the last 3. Any help would be appreciated. Refer to the pictures above for the SQL Tables.
1: +-------------- .]> SELECT * FROM classroom; | Tables_in_ :. 21 +-----------+------------------------+ +--------------- -------+ | building room_number | capacity | | classroom +-----------+------------------------+ | course | Buildinga | 215 40 L | department BuildingA | 317 35 | instructor 1 BuildingA | 517 2001 | section | BuildingB | 2125 40 L | student T | BuildingB | 4 15 | | takes T Buildingc | 21 40 L | teaches +------------------------------------+ +------- 6 rows in set (0.00 sec) ]> SELECT * FROM department; 8 rows in set (0.00 sec) +------------------------------------ > SELECT * FROM course; | dept_name building budget | +----------- ----------------------+------------+-------+ +------------ -----------+--------------+ | course id | title | dept_name | units | | Biology BuildingA 5847390.00 | Comp. Sci. | BuildingA 1982740.00 | BIO-101 | Intro to BIO | Biology 21 | Elec. Eng. BuildingB | 5847390.00 | | BIO-413 | Intro | Biology Dology | 21 | History BuildingBL 478593.00 || | CS-101 Intro to Comp. | Comp. Sci. | 2 | Music BuildingA | 347834589.00 | CS-355 | DBMS | Comp. Sci. I 41 | Physics Building | 5738945.00 || | EE-101 | Intro to Elec. Eng. Elec. Eng. | 2 | +------------------------+--------------+ TEE-215 Less Basic EE | Elec. Eng. I 4 . - 1> SELECT * FROM instructor; | EE-455 Advanced EE | Elec. Eng. I 5 1 +-------+----------------------- ----------- | HIS-103 | History Lect. Series | History 11 | ID name dept_name | salary | | HIS-451 | old Stuff | History 4 | +-------+-----------------------+------- ----+ | MU-101 Intro to Music | Music 21 | 01454 | Zhang | Comp. Sci. | 121023.00 || | MU-315 | More Music | Music 41 15436 | Brant History I 80000.00 || | PHY-101 | Intro to Physics | Physics 21 | 28643 | Chavez | Physics | 143021.00 || | PHY-201 | Blame Newton Physics 41 | 37574 | Snow | Music | 103455.00 || +-----------+----------------------+------------+-------+ | 47789 | Tanaka | Biology 1 98000.00 || 13 rows in set (0.00 sec) | 49757 | Tomas | Biology T 98000.00 58113 | Bourikas | Elec. Eng. | 109435.00 | | 61247 | Rick | NULL | 29540.00 || +-------+-----------------------+-----------+ 8 rows in set (0.00 sec) . . . ]> SELECT * FROM section + - -- - - - -- - - - + - - - - -- - + - - - - - - - -- - - - - - - - + -- - - - - - - - - - + -- - - - -- - - - - - - + - - - - - - - -- - - - - | course_id | sec_id | semester 1 year | building D room_number 1 time_slot_id + | BIO-413 11 | Summer | 2020 | BuildingA | 317 | 1900 | CS 101 | Fall | 2020 | Buildinga | 215 | 1000 11 11 | CS-101 | Spring | 2019 | BuildingA | 215 | 0900 | CS 355 - | Spring 2019 | BuildingA | 215 | 1100 | EC-101 - 2020 | Buildinys | 4 | 0000 | Spring | Fall EF-215 | 2020 | Buildings | 4 | 0000 | EE-215 11 12 11 | Fall | 2020 | BuildingB | 2125 | 0900 : ; [. ']> SELECT * FROM student; +-------+------- ---+------------+ ---------+ | ID | name dept_name | tot_cred | +-------+------- -----+------------+----------+ | 14769 | Fred James | Comp. Sci. | 110 | 19810 | Richard Watson | Music 761 | 19811 | Lary Dogart Elec. Eng. 100L | 19812 | Ross Valintina | Physics | 114 | | 19837 | Sam Dolos | Music 921 | 19839 | Tina Dolos | Elec. Eng. | 121 | 45218 | Joe Redwick | Comp. Sci. I 421 | 47471 | Shadwic Bright | Physics 60L 158137 | Sara Wilber Biology 128 | | 66332 | Chad Walright | Physics 16 | | 81746 | Ross Hadwell Comp. Sci. | 90L | 98741 | Jake Drake Biology | 45 || +-------+----------------------------------------+ : . [. 2;> SELECT * FROM takes; +-------+-------------------------------+------+-------+ | ID I course_id | sec_id | semester 1 year | grade | +-------+-------------------------------+------+-------+ | 19837 | BIO-413 | 1 | Summer | 2020 | A | 19837 | PHY-201 | 1 | Spring | 2021 | A | 45218 | PHY-201 | 1 | Spring | 2021 | A- | 47471 | PHY-201 | 1 | Spring | 2021 | D | 58137 | CS-101 | 1 | Fall | 2020 | C+ | 58137 | CS-355 11 | Spring | 2019 | B | 58137 | EE-455 | 1 | Fall | 2020 | A | 58137 | HIS-451 2 | Fall | 2019 | B | 98741 | CS-101 1 | Fall | 2020 | C | 98741 | CS-355 | 1 | Spring | 2019 | B | 98741 | HIS-451 | 2 Fall | 2019 | A +----------------------------------------------+-------+ | EE-455 | Fall | 2020 | BuildingB | 2125 | 1700 THIS-151 | 1 | Fall | 2019 | BuildingB | 1 | 1300 THIS 451 | 2 | Fall | 2019 | BuildingB | 4 | 1500 | PHY-201 | 1 | Fall | 2018 | Buildingc | 21 | 1100 | 1100 | 1400 - - - - - - - - - - + - - - - - - - - - - - - - - | PIIY-201 11 | Spring 2021 | Buildingc | 21 T | PHY-201 12 Fall | 2018 | Buildingc | 21 NL: - 2]> SELECT * FROM teaches; - - - - - - - - + - - - - - - - - + - - - - - + - - - - - - - - - - + - - - - - - + | ID | course id | sec id I semester 1 year + - - - - - - - + - - - - - - - - - - - + - - - - - - - + - - - - - - - - - - + - - - - - - + | 01454 ICS-101 | 1 Fall 2020 | | 01451 | CS-101 | 1 | Spring 2019 | | 15436 | HIS 451 | 1 I Fall | 2019 | | 15436 | HIS 451 | 2 | Full | 2019 | 28643 | PHY-201 11 I Fall | 2018 | | 28643 | PHY-201 | Spring | 2021 | | 28643 IPHY-201 I Fall | 2018 | 149757 | BIO-413 T1 | Summer T 2020 | 59113 | EE 101 | Spring T2020 | 58113 | EE-215 I Fall | 2020 158113 | EE 215 | Full | 2020 1Step 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