a) Specify the following queries in SQL on the database schema of Figure 1.2. a. Retrieve...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a) Specify the following queries in SQL on the database schema of Figure 1.2. a. Retrieve the name of each course and the instructor who taught that course. If an instructor taught a course more than one time, remove the redundant information. b. For each section of those courses offered by CS department, retrieve the course number, semester, year, and number of students who took the section. c. For each student who took more than 2 sections, retrieve the name, student number, major of the student and the number of sections taken by the student. STUDENT COURSE SECTION Smith Brown Name Course name Intro to Computer Science Data Structures Discrete Mathematics Database GRADE REPORT PREREQUISITE Section identifier Student number 85 92 102 112 119 135 17 8 Course number CS1310 CS3320 MATH2410 CS3380 Course_number MATH2410 CS1310 CS3320 MATH2410 CS1310 CS3300 Student number 17 17 8 8 8 8 Course_number CS3380 CS3380 CS3320 Class 1 2 Credit hours 4 4 3 3 Semester Fall Fall Spring Fall Fall Fall Section identifier 112 119 85 92 Major cs CS 102 135 Figure 1.2 Example of a simple database Year 07 07 08 08 08 08 Prerequisite_number CS3320 MATH2410 CS1310 Department CS CS MATH CS <<< Instructor King Anderson Grade B с A A Knuth Chang Anderson Stone a) Specify the following queries in SQL on the database schema of Figure 1.2. a. Retrieve the name of each course and the instructor who taught that course. If an instructor taught a course more than one time, remove the redundant information. b. For each section of those courses offered by CS department, retrieve the course number, semester, year, and number of students who took the section. c. For each student who took more than 2 sections, retrieve the name, student number, major of the student and the number of sections taken by the student. STUDENT COURSE SECTION Smith Brown Name Course name Intro to Computer Science Data Structures Discrete Mathematics Database GRADE REPORT PREREQUISITE Section identifier Student number 85 92 102 112 119 135 17 8 Course number CS1310 CS3320 MATH2410 CS3380 Course_number MATH2410 CS1310 CS3320 MATH2410 CS1310 CS3300 Student number 17 17 8 8 8 8 Course_number CS3380 CS3380 CS3320 Class 1 2 Credit hours 4 4 3 3 Semester Fall Fall Spring Fall Fall Fall Section identifier 112 119 85 92 Major cs CS 102 135 Figure 1.2 Example of a simple database Year 07 07 08 08 08 08 Prerequisite_number CS3320 MATH2410 CS1310 Department CS CS MATH CS <<< Instructor King Anderson Grade B с A A Knuth Chang Anderson Stone
Expert Answer:
Answer rating: 100% (QA)
Below are the SQL queries for the given tasks a Retrieve the name of each course and the instructor ... View the full answer
Related Book For
Fundamentals of Database Systems
ISBN: 978-0136086208
6th edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these algorithms questions
-
Management of the Krausse Savings and Loan Association is in the process of evaluating the purchase of a new check sorting machine. The model under review will cost $70,00 and will require...
-
Imagine you are a member of your local school board. You wantan answer to the very simple question, Are students learning?What can you recommend to school principals to answer thequestion?
-
Analyze Big Data and its relation to Volume, Velocity and Variety. Assess the importance of Big Data within government organizations. Evaluate two examples of information that the government is...
-
A certain type of concrete mix is designed to withstand 3000 pounds per square inch (psi) of pressure. The strength of concrete is measured by pouring the mix into casting cylinders 6 inches in...
-
Help for Insomniacs A recent study shows that just one session of cognitive behavioral therapy can help people with insomnia. In the study, forty people who had been diagnosed with insomnia were...
-
For each pair of funds listed below, select the fund that would be less risky and briefly explain your answer. a. Growth versus growth-and-income b. Equity-income versus high-grade corporate bonds c....
-
Consider the following system of equations: x-y=2 x+y=4 2x + y = 8 How many solutions exist for the above system of equations? If a solution exists, find one, if not, determine the least squares...
-
The intern has prepared the following trial balance for the month of March. KL Company Inc. Unadjusted Trial Balance March 31, 20Y3 Debit Balances Account Title Cash Accounts Receivable Supplies...
-
The graph below displays the running times (in minutes) for the top 15 domestic grossing movies of all time rated PG-13 (Source: Box Office Mojo). The leaf represents the ones digit. Use the graph to...
-
In January 2022, United Airlines (UAL) had a market capitalization of \($14.3\) billion, debt of \($39.4\) billion, and cash of \($18.4\) billion. United Airlines had revenues of \($24.6\) billion....
-
In 2018, Cabell Mapp passed away in Belle Haven, Virginia. Pursuant to his will, a testamentary trust was established. The trust instrument requires that \(\$ 10,000\) a year be paid to the...
-
At the end of a trading day you find that on the NYSE 2,200 stocks advanced and 1,000 stocks declined. What is the value of the advance-decline line for that day?
-
All bonds are priced according to the present value of their future cash flow streams. The key components of bond valuation are par value, coupon interest rate, term to maturity, and market yield. It...
-
You hear a market analyst on television say that the advance/decline ratio for the session was 1.2. What does that mean?
-
5 By using false weight a trader gains 5 % by 19 claiming to sell at cost price. What weight did he actually use for a kg weight? 1. 950 gms 2. 900 gms 3. 940 gms 4. 960 gms 5. None of these
-
Distinguish between the work performed by public accountants and the work performed by accountants in commerce and industry and in not-for-profit organisations.
-
Consider the following relation for published books: BOOK (Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher) Author_affil referes to the affiliation of the author. Suppose the...
-
Repeat Exercise 21.14 adding a check in T 1 so that Y does not exceed 90. In exercise 21.14 Change transaction T 2 in Figure 21.2b to read: read_item(X); X:= X+M; if X > 90 then exit else...
-
Consider the following EER diagram that describes computer systems at a company. Provide your own attributes and key for each entity type. Supply max cardinality constraints justifying your choice....
-
Wisconsin Tool Company Wisconsin Tool Company (WTC) is a business located in Madison, WI that manufacturers tool and die equipment. WTC executed three sales in Year 23. See Sale Agreements in the...
-
Saenz-Qualified Business Income Javier and Maria Saenz, married filing jointly, have several investments. Their adjusted gross income and taxable income for 2023 is \( \$ \) 300,000 and \( \$ \)...
-
Find the Laplace transform of the following signals and locate the poles and zeros of \(F(s)\). (a) \(f(t)=-10 \mathrm{~d} \delta(t) / d t\) (b) \(f(t)=120 \cos (377 t) u(t)\). (c)...
Study smarter with the SolutionInn App