Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1.Write in SQL>>> Select CourseNo , Title , and the number of times tha

ID: 3911935 • Letter: Q

Question

Question 1.Write in SQL>>> Select CourseNo, Title, and the number of times that a course has been offered

[Hint: In this query, you need to retrieve data from two tables – Course and Offering. Since it involves a COUNT(*) function in the SELECT phrase, the SQL should also have a GROUP BY phrase after the WHERE phrase. Remember that CourseNo appears in both Course and Offering tables, you need to have join condition and an alias may be needed to make your statement easy to write].

Offering Custom Custom Group 1 Unassigned Objects OfferNo ? CourseNo ?Semester ?OfferYear ? Classroom ?LectureTime. FacNo LectureDays 10111 10113 10115 10234 22022 33433 43421 43444 43555 43559 ?43560 43566 43666 MKT2500 MKT2500 MKT2500 CIS2600 MKT4100 CIS2600 CIS2600 ACT2300 CIS2640 CIS2640 CIS2640 CIS3640 ACT3880 SUMMER II SUMMER SPRING FALL SUMMER II SUMMER SPRING FALL SPRING SUMMER SUMMERI SPRING SUMMERI SCH3020 SCH3100 SCH1245 SCH3020 SCH3120 SCH3140 SCH3140 SCH1260 SCH1245 SCH1300 SCH2325 SCH3345 SCH2345 10:30:00 AM 210987654 1:30:00 PM 321098765 4:00:00 PM 210987654 10:30:00 AM 098765432 1:30:00 PM 3210987?5 8:30:00 AM 098765432 3:30:00 PM 098765432 9:30:00 AM 987654321 10:15:00 AM 877543110 9:00:00 AM 098765432 10:00:00 AM 098765432 10:00:00 AM 877543110 8:30:00 AM 877543111 Course Enrollment Faculty Offering TR 2018 2018 2

Explanation / Answer

-- Selecting the CourseNo , Title from Course table and counting number of Offerings from Offering table and joining the Offering table in a condition that CourseNo in Course table and Offering table should be same.
-- Grouping the CourseNo and the Title


select c.CourseNo, c.Title, count(o.OfferNo) as NoOfOfferings from Offering o inner join Course c on c.CourseNo=o.CourseNo group by c.CourseNo, c.Title

Please upvote if you like the answer and comment if you need any furtehr information in this regard.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote