Database Concepts (7th Edition)
7th Edition
ISBN: 9780133544626
Author: David M. Kroenke, David J. Auer
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 5, Problem 5.24RQ
Explanation of Solution
Select query in
In DBMS (Database Management System), the SQL “SELECT” query is used to display all the data from the database table which returns this data in the form of a result table.
SQL statement for fetching the data in the database table:
SELECT * FROM Book, Intersection_Table, Author WHERE Book.Book_ID = Intersection_Table.Book_ID AND Intersection_Table.Author_ID = Author...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This question is related to the Database:-
Suppose you are creating a database for a library management system. Explain how you would make a table for the "books" entity and insert some sample data, and then alter the table to add a new column for the "authorID" attribute and update "authorID" with some data. Finally, make a SQL query to retrieve all the books that were published after the year 2000.
Note that this book schema has several columns, including "book_id" as the primary key, "title", "authorN", "publisher", "publication_year", "isbn", "language", and "num_pages". It also includes "available" column that is set to "true" by default and can be used to track the availability of the book.
Please don't use handwriting...
Consider a database with the following relations:
Employee
(Employee ID, Name, salary, startDate)
Department (Department ID, Name, capacity)
Project
(Employee ID, Department ID, name, budget, expectedDuration)
Develop the following query in SQL: Display projects (by name and budget) done
under "Marketing" department and with budget higher 100,000$.
For your answer to question 5.20, code an SQL statement that creates a relation that has all data from all tables.
Chapter 5 Solutions
Database Concepts (7th Edition)
Ch. 5 - Explain how entities are transformed into tables.Ch. 5 - Prob. 5.2RQCh. 5 - Prob. 5.3RQCh. 5 - What is denormalization?Ch. 5 - Prob. 5.5RQCh. 5 - Explain the problems that denormalized tables may...Ch. 5 - Explain how the representation of weak entities...Ch. 5 - Explain how supertype and subtype entities are...Ch. 5 - Prob. 5.9RQCh. 5 - Prob. 5.10RQ
Ch. 5 - Show two different ways to represent the 1:1...Ch. 5 - Prob. 5.12RQCh. 5 - Prob. 5.13RQCh. 5 - Prob. 5.14RQCh. 5 - Prob. 5.15RQCh. 5 - Prob. 5.16RQCh. 5 - For your answer to question 5.15, code an SQL...Ch. 5 - Prob. 5.18RQCh. 5 - Prob. 5.20RQCh. 5 - Prob. 5.21RQCh. 5 - Explain how the terms parent table and child table...Ch. 5 - For your answers to questions 5.20, 5.21, and...Ch. 5 - Prob. 5.24RQCh. 5 - Prob. 5.25RQCh. 5 - Prob. 5.26RQCh. 5 - Prob. 5.27RQCh. 5 - Prob. 5.28RQCh. 5 - Define the three types of recursive binary...Ch. 5 - Prob. 5.30RQCh. 5 - Prob. 5.31RQCh. 5 - Prob. 5.32RQCh. 5 - Prob. 5.33RQCh. 5 - Prob. 5.34RQCh. 5 - Code an SQL statement that creates a table with...
Knowledge Booster
Similar questions
- Consider a database with the following relations: Employee (Employee ID, Name, salary, startDate) Department (Department ID, Name, capacity) Project (Employee ID. Department ID, name, budget, expectedDuration) Develop the following query in SQL: Display employees (by name and salary) working on the "Engine" project and with salary higher than the average salary of all employees.arrow_forwardPLZ help with the following: IN SQL Let R (A, B, C) be a relation schema. What happens if we execute the following query? SELECT* FROM R WHERE A=D; Select one: a. We get an error. b. The query executes successfully but returns no tuples. c. The query returns all the tuples in R.arrow_forwardIn Sql These are some database from a set of tables insert into AccountHolder(AccountID, CustomerID, AccountType)values (55003, 115, 'Savings'),(44001, 101, 'Chequing'),(55006, 109, 'Savings'),(44002, 102, 'Chequing'),(44003, 113, 'Chequing'),(55007, 108, 'Savings'),(44004, 103, 'Chequing'),(44005, 110, 'Chequing'),(55005, 112, 'Savings'),(44006, 114, 'Chequing'),(55001, 111, 'Savings'),(44007, 107, 'Chequing'),(44008, 104, 'Chequing'),(55004, 106, 'Savings'),(44009, 105, 'Chequing'),(44010, 113, 'Chequing'),(55002, 107, 'Savings'),(44011, 110, 'Chequing'),(44012, 104, 'Chequing') select * from AccountHolder insert into Branch(LocationID, BranchName, Address, Type, DepositSum, LoanSum)values (1, 'Boulevard Branch', '3268 Wade Boulevard', 'Rural', 171848.88, 37681.72),(2, 'Avenue Branch', '4814 Dare Avenue', 'Rural', 232707.42, 68324.56),(3, 'Street Branch', '208 Ferry Street', 'Commercial', 375010.75, 44665.08),(4, 'Road Branch', '468 Zulauf Road', 'Commercial', 496001.41,…arrow_forward
- How does the SQL ORDER BY clause work, and why might it be important when using database functions like MAX() or MIN()? Provide a query illustrating its usage.arrow_forwardWrite SQL code for the following design schema of three tables. The tables should have the following properties: sales table has a primary key on SalesNumber and it is set to AUTO-INCREMENT.products table has a primary key on number and it is set to AUTO-INCREMENT, they is an unique index on prodidsalesdetails table has a primary key on number and it is set to AUTO-INCREMENT, they is an index on prodid. They is a one-to-many relationship between the salesdetails.SalesNumber andsales.SalesNumber fields. There is a one-to-many relationship between the products.prodid and salesdetails.prodid fields. There is to be a delete constraint on the product.prodid field a record in the product table should not be allowed to be deleted if they exist a matching prodid in the salesdetails table. Primary and foreign keys should be implemented in the appropriate tables. Referential Integrity should be enforce at the database level, where appropriate for example, if a sales record is deleted all…arrow_forwardSuppose you are creating a database for a library management system. Explain how you would create a table for the "books" entity and insert some sample data, and then alter the table to add a new column for the "authorID" attribute and update "authorID" with some data. Finally, write a SQL query to retrieve all the books that were published after the year 2000. Note that this book schema has several columns, including "book_id" as the primary key, "title", "authorN", "publisher", "publication_year", "isbn", "language", and "num_pages". It also includes "available" column that is set to "true" by default and can be used to track the availability of the book. Answer:arrow_forward
- Write the following queries, based on the database schema Product(maker, model, type)PC(model, speed, ram, hd, price)Laptop(model, speed, ram, hd, screen, price)Printer(model, color, type, price) of Exercise 2.4.1. You should use at least one subquery in each of your answersand write each query in two significantly different ways (e.g., using differentsets of the operators EXISTS, IN, ALL, and ANY). a) Find the makers of PC's with a speed of at least 3.0.b) Find the printers with the highest price.! c) Find the laptops whose speed is slower than that of any PC.! d) Find the model number of the item (PC, laptop, or printer) with thehighest price.! e) Find the maker of the color printer with the lowest price.!! f) Find the maker(s) of the PC(s) with the fastest processor among all thosePC's that have the smallest amount of RAM.arrow_forwardAttributes, rows, and tables all refer to the same thing in relational models:arrow_forwardQUESTION 1 SQL: Consider the following database schema for flight reservation database. A flight can be booked by many passengers, and a passenger can book different flights. For each booking, the date of the flight and price are recorded. The database schema is given below Flight (FID:int, Airline:string(unique), DepartingAirport:string, ArrivalAirport:string, Rating: int (1,2,3,4,5) ) Booking (FlightID: int, PassengerCPR: int, Date: date, Time: time, Price: double) Passenger (CPR:int, FirstName: String, LastName: String, Address:String) Write SQL Code to: Create the Flight Table.List the Departing Airport and Arrival Airport for all flights with rating 4 or 5.arrow_forward
- Question 13 Given the following relation: Book (BookID, Author, ISBN, Title) Write a PL/SQL block of code that performs the following tasks: i. Read a Book id provided by user at run time and store it in a variable. ii. Fetch the Author and title of the book having the entered id and store them inside two variables iii. Display the fetched book author and title.arrow_forwardWrite an SQL statement to list ItemNumber and ItemDescription for all items that cost more that $100 and were produced by an artist with a name ending with the letters son. From Database Management: Chapter 3 Structured Query Language Kroenkearrow_forwardWrite SQL queries DDL Queries to implement the following Relational Model i.e. create the Nurse and Care_Center relations (including primary key and foreign key). Intelligently write data types.arrow_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