Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 3, Problem 32E
Explanation of Solution
Query:
The query for the given scenario:
SELECT distinct teaches.ID, Name FROM takes, teaches, instructor WHERE teaches.course_id = takes.course_id AND instructor.Id = teaches.Id and Grade is not NULL AND teaches.ID not in (SELECT distinct teaches.Id FROM takes, teaches WHERE teaches.course_id = takes.course_id and Grade="A");
Explanation:
- The subquery(inner select query) finds teacher Id's who have given Grade "A" in any course that they teach...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Create an UPDATE query that lowers the daily rental rate of sailboat rentals by 10%.
Note: show me select * from boat showing contents of boat table after you run this update. I should have the before from the beginning of the assignment.
Search for boats for rent under $200 per day, show Boat Unique Identifier, Boat Type, Boat Length, Price per Day to rent the boat and Location (where boat is parked for pickup (please include name of marina, not just the PrimaryKey).
Create a query that shows the rentals that had different pickup and different drop off location, show Boat Unique identifier, Renter unique identifier, Start Date, End Date, Pickup Location and Drop Off Location and drop off fee of the Marina Drop Off Location(please include name of marina, not just the PrimaryKey).
From Renter and Rental table:create a query that shows Renter unique identifier, Renter name, boat unique identifier, boat name, startdate, enddate of a rental and number of days rented (name column…
Create a query that displays each instructor's schedule. Display the instructor name, course title, time slot information, for each course taught by the instructor. Also, display the building and room number where the course is taught. Sort the results in a meaningful timetable way, so that each instructor can easily see their schedules.
Create a query that SELECT all of the EMPLOYEES from the EMPLOYEE TABLE that are Mangers. Include Employee ID first name, Lastname and Salary (Hint: Self Join)
Chapter 3 Solutions
Database System Concepts
Ch. 3 - Prob. 1PECh. 3 - Prob. 2PECh. 3 - Prob. 3PECh. 3 -
Suppose that we have a relation marks(ID, score)...Ch. 3 - Suppose that we have a relation marks(ID, score)...Ch. 3 -
The SQL like operator is case sensitive (in most...Ch. 3 - Prob. 7PECh. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Prob. 10PE
Ch. 3 - Prob. 11ECh. 3 - Prob. 12ECh. 3 - Prob. 13ECh. 3 -
Consider the insurance database of Figure 3.17,...Ch. 3 - Prob. 15ECh. 3 - Prob. 16ECh. 3 - Prob. 17ECh. 3 - Prob. 18ECh. 3 -
List two reasons why null values might be...Ch. 3 - Prob. 20ECh. 3 - Prob. 21ECh. 3 - Prob. 22ECh. 3 - Prob. 23ECh. 3 - Prob. 24ECh. 3 - Prob. 25ECh. 3 - Prob. 26ECh. 3 - Using the university schema, write an SQL query to...Ch. 3 - Prob. 28ECh. 3 - Prob. 29ECh. 3 - Prob. 30ECh. 3 - Prob. 31ECh. 3 - Prob. 32ECh. 3 - Prob. 33ECh. 3 - Prob. 34ECh. 3 - Prob. 35E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Create a query that displays each instructor schedule. Display the instructor name, course title, time slot information, for each course taught by the instructor. Also display the building and room number where the course is taught. Sort the results in a meaningful timetable way, so that each instructor can easily see their schedules.arrow_forwardShow a list of employee id, names, department, years and job of any employee in the staff table who makes a total amount more than their manager or has more years of service than their manager. Make sure to include both salary and commission when calculating the total amount someone makes. Exclude staff in department 10 from the query. Order the results by department then namearrow_forwardWrite a query that uses INNER JOIN TO connect the EMPLOYEE, EMPPROJACT, PROJACT and PROJECT tables. Include the Project number , Department number, Project start and end date and AC STAFF WHERE They belong to department D11 , Salary is more than or equal to 65 percent of $15,000 AND Salary is less than or equal to 130 percent of $40,000arrow_forward
- Write a query to produce the total number of hours and charges for each of the projects represented in the ASSIGNMENT table, sorted by project number.arrow_forwardWhy the following statement is erroneous? SELECT dept_name, ID, avg (salary) FROM instructor GROUP BY dept_name; a) Dept_id should not be used in group by clause b) Group by clause is not valid in this query c) Avg(salary) should not be selected d) Nonearrow_forwardAssuming that the CUSTOMER table contains a CUST_AGE attribute, write the query to update the values in that attribute. (Hint: Use the results of the previous query.)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning