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
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Consider the relational database of Figure 3.19, where the primary keys are underlined. Give an expression in SQL for each of the following queries.a. Find the ID, name, and city of residence of each employee who works for “First Bank Corporation”.b. Find the ID, name, and city of residence of each employee who works for “First Bank Corporation” and earns more than $10000.c. Find the ID of each employee who does not work for “First Bank Corporation”.d. Find the ID of each employee who earns more than every employee of“Small Bank Corporation”.e. Assume that companies may be located in several cities. Find the nameof each company that is located in every city in which “Small Bank Corporation” is located.f. Find the name of the company that has the most employees (or companies, in the case where there is a tie for the most).g. Find the name of each company whose employees earn a higher salary, on average, than the average salary at “First Bank Corporation”.
Consider the employee database of Figure 3.19, where the primary keys areunderlined. Give an expression in SQL for each of the following queries.a. Find ID and name of each employee who lives in the same city as thelocation of the company for which the employee works.b. Find ID and name of each employee who lives in the same city and on thesame street as does her or his manager.c. Find ID and name of each employee who earns more than the averagesalary of all employees of her or his company.d. Find the company that has the smallest payroll.
Consider the insurance database of Figure 3.17, where the primary keys areunderlined. Construct the following SQL queries for this relational database.a. Find the number of accidents involving a car belonging to a person named“John Smith”.b. Update the damage amount for the car with license plate “AABB2000”in the accident with report number “AR2197” to $3000.
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
Similar questions
- Consider the library database of Figure 3.20. Write the following queries in SQL.Find the member number and name of each member who has borrowed at least one book published by “McGraw-Hill”.arrow_forwardConsider the library database of Figure 3.20. Write the following queries in SQL.Find the member number and name of each member who has borrowed every book published by “McGraw-Hill”.arrow_forwardConsider the library database of Figure 3.20. Write the following queries in SQL.For each publisher, find the member number and name of each member who has borrowed more than five books of that publisher.arrow_forward
- Consider the insurance database of Figure 3.17, where the primary keys areunderlined. Construct the following SQL queries for this relational database. Update the damage amount for the car with license plate “AABB2000” in the accident with report number “AR2197” to $3000.arrow_forwardConsider the insurance database of Figure 3.17, where the primary keys areunderlined. Construct the following SQL queries for this relational database.a. Find the total number of people who owned cars that were involved inaccidents in 2017. b. Delete all year-2010 cars belonging to the person whose ID is '12345'.arrow_forwardConsider the bank database of Figure 2.18. Give an expression in the relational algebra for each of the following queries: a. Find each loan number with a loan amount greater than $10000. b. Find the ID of each depositor who has an account with a balance greater than $6000. c. Find the ID of each depositor who has an account with a balance greater than $6000 at the “Uptown” branch.arrow_forward
- Consider the Library database given below. Write the following queries in SQL, assuming that the relations are filled with 8 tuples with complete entries and no null values. member (memno, name, age) book (isbn, title, authors, publisher) borrowed (memno, isbn, date) For each publisher, print the members who have borrowed more than two books of that publisher. i. ii. Display name and member number of those members who have not borrowed any book till now. iii. Find out the book titles, which are borrowed by more than one member.arrow_forwardConsider the relational database of Figure 3.19. Give an expression in SQL for each of the following:a. Modify the database so that the employee whose ID is '12345' now lives in “Newtown”.b. Give each manager of “First Bank Corporation” a 10 percent raise unless the salary becomes greater than $100000; in such cases, give only a 3 percent raise.arrow_forwardQuèstion 13 Given the following relation: Movie (MovielID, Title, Genre, Year) Write a PL/SQL block of code that performs the following tasks: i. Read a movie id provided by user at run time and store it in a variable. ii. Fetch the Genre and title of the movie having the entered id and store them inside two variables ii. Display the fetched movie Genre and title. T TTArial 3 (12pt)arrow_forward
- Consider the employee database of Figure 3.19, where the primary keys areunderlined. Give an expression in SQL for each of the following queries.Find ID and name of each employee who earns more than the average salary of all employees of her or his companyarrow_forwardConsider the employee database of Figure 3.19, where the primary keys areunderlined. Give an expression in SQL for each of the following queries. Find ID and name of each employee who lives in the same city as the location of the company for which the employee works.arrow_forward//Please solve the 5th and 6th ones. Using the relational database given in lab work no. 2, write the following queries in SQL:1) Which course titles were given by at least two different instructors during the past?2) Which departments have at least two instructors and at least ten students?3) Which students took COMP117 from Cem Kalyoncu and COMP124 from Zafer Erenel?4) Which students are advised by Soydan Redif and took at least one course from Ezgi Ulker?5) Which students took multiple courses from Zafer Erenel but not a single course from Vesile Evrim?6) For each department, find out the highest salaried instructor name and the highest total credited student name.You should also present the output of each query. //The database is attachedarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education