Modern Database Management
13th Edition
ISBN: 9780134773650
Author: Hoffer
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 5, Problem 5.59PAE
Add an order to the Order_T table and include a sample value for every attribute.
- First, look at the data in the Customer_T table and enter an order from any one of those customers.
- Enter an order from a new customer. Unless you have also inserted information about the new customer in the Customer_T table, your entry of the order data should be rejected. Referential integrity constraints should prevent you from entering an order if there is no information about the customer.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Considering Vaccination Database, write queries to:
Display the Subject CNIC, Name, Contact, Dose1 Center, and Dose2 Center as shown below:
CNIC
Name
Contact
Dose1 Center
Dose2 Center
22401-6645321-1
Nasir
3409991112
Lachi
Kohat 2
14301-6045321-5
Shahab
3409991112
kohat 3
Dara
The subjects who have been vaccinated different types in Dose1 and Dose2. For instance, subjects who were vaccinated ‘Sinovac’ in the first dose, while Pfizer in the second dose.How many Viles of each type have been consumed so far. How many subjects are vaccinated from expired viles. Suggest the name of Incharge for the best performance award based on the highest number of subjects vaccinated on a single day
The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENACNE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys.
Task 2:
The Driver Relationship team wants to ensure that the all driving license IDs in the active drivers table have the length of 7. Alter the ACTIVE_DRIVERS table created in Chapter 8, Activity 1 to check the length of the DRIVER_DRIVING_LICENSE_ID.
Add a CHECK to the ACTIVE_DRIVERS table to enforce a driver license length of 7.
Test Query:
SELECT DISTINCT(constraint_name)
FROM information_schema.check_constraints
WHERE constraint_schema = 'InstantRide'
AND constraint_name = 'ACTIVE_DRIVERS_chk_1'
Expected Results
CONSTRAINT_NAME
ACTIVE_DRIVERS_chk_1
Chapter 5 Solutions
Modern Database Management
Ch. 5 - Define each of the following terms: data...Ch. 5 - Match the following terms to the appropriate...Ch. 5 - Prob. 5.3RQCh. 5 - Prob. 5.4RQCh. 5 - Prob. 5.5RQCh. 5 - Prob. 5.6RQCh. 5 - List six potential benefits of achieving an SQL...Ch. 5 - Prob. 5.8RQCh. 5 - Distinguish among data definition commands, data...Ch. 5 - Prob. 5.10RQ
Ch. 5 - Prob. 5.11RQCh. 5 - Explain the purpose of indexing in database...Ch. 5 - What are the potential consequence of...Ch. 5 - Prob. 5.14RQCh. 5 - Explain and provide at least one example Of how to...Ch. 5 - Prob. 5.16RQCh. 5 - What is the difference between COUNT, COUNT...Ch. 5 - What is the evaluation order for the Boolean...Ch. 5 - If an SQL statement includes a GROUP BY clause,...Ch. 5 - Prob. 5.20RQCh. 5 - Prob. 5.21RQCh. 5 - Prob. 5.22RQCh. 5 - Explain why SQL is called a set-oriented language.Ch. 5 - When would the use of the LIKE key word with the...Ch. 5 - Prob. 5.25RQCh. 5 - Prob. 5.26RQCh. 5 - In what order are the clauses of an SQL statement...Ch. 5 - Within which clauses of an SQL statement can a...Ch. 5 - Prob. 5.29RQCh. 5 - Prob. 5.30RQCh. 5 - Prob. 5.31RQCh. 5 - Explain the difference between the WHERE and...Ch. 5 - Prob. 5.33RQCh. 5 - Write a database description for each of the...Ch. 5 - Analyze the database to determine whether or not...Ch. 5 - Prob. 5.36PAECh. 5 - To enforce referential integrity, before any row...Ch. 5 - Write SQL data definition commands for each of the...Ch. 5 - Write SQL commands for the following: Create two...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Prob. 5.44PAECh. 5 - Prob. 5.45PAECh. 5 - Prob. 5.46PAECh. 5 - What is the average Read score for all students?...Ch. 5 - Prob. 5.48PAECh. 5 - What are the TutorIDs for tutors who have not yet...Ch. 5 - Prob. 5.50PAECh. 5 - Prob. 5.51PAECh. 5 - Prob. 5.52PAECh. 5 - Prob. 5.53PAECh. 5 - Prob. 5.54PAECh. 5 - How many tutors have an Active status in the...Ch. 5 - Prob. 5.56PAECh. 5 - Modify the Product_T table by adding an attribute...Ch. 5 - Enter sample data of your own choosing into...Ch. 5 - Add an order to the Order_T table and include a...Ch. 5 - Use the Pine Valley database to answer the...Ch. 5 - Prob. 5.61PAECh. 5 - Prob. 5.62PAECh. 5 - Prob. 5.63PAECh. 5 - Prob. 5.64PAECh. 5 - Prob. 5.65PAECh. 5 - Prob. 5.66PAECh. 5 - Prob. 5.67PAECh. 5 - Modify query in P&E 5-67 by considering only those...Ch. 5 - Prob. 5.69PAECh. 5 - Prob. 5.70PAECh. 5 - Prob. 5.71PAECh. 5 - Prob. 5.72PAECh. 5 - Prob. 5.73PAECh. 5 - Prob. 5.74PAECh. 5 - Prob. 5.75PAECh. 5 - Prob. 5.76PAECh. 5 - Prob. 5.77PAECh. 5 - Assume that for those materials the ID of which...Ch. 5 - Prob. 5.79PAECh. 5 - Prob. 5.80PAECh. 5 - Prob. 5.81PAECh. 5 - Prob. 5.82PAECh. 5 - Prob. 5.83PAECh. 5 - Prob. 5.84PAECh. 5 - Prob. 5.85PAECh. 5 - Prob. 5.86PAECh. 5 - Prob. 5.87PAECh. 5 - Prob. 5.88PAECh. 5 - Prob. 5.89PAECh. 5 - Prob. 5.90PAECh. 5 - Prob. 5.91PAECh. 5 - Prob. 5.92PAECh. 5 - Prob. 5.93PAE
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
- JOIN TABLES One row in the PAT_ENC table represents one patient encounter. One row in the ORDER MED table represents one medication order. One patient encounter can have many medication orders but one medication order can only have one patient encounter. In other words, the cardinality of this PAT_ENC to ORDER_MED relationship is one-to- many. You start a query with PAT_ENC. You then add ORDER_MED using an inner join. What is true about the granularity of the result set before and after adding the ORDER_MED table? SELECT ONE OF THE FOLLOWING A. The granularity stays at one row per patient encounter. B. The granularity stays at one row per medication order. C. The granularity changes from one row per patient encounter to one row per medication order on an encounter. D. The granularity changes from one row per medication order to one row per patient encounter.arrow_forwardCreate a table in SQL developer and name it as ‘MyCrush’. The table should consists of only three attributes as follows: Crush_ID which will be the primary key with the number length of .Crush_Name with the maximum character length of 30.Crush_Description with the maximum character length of 10.Insert exactly three records with the above given attributes. Crush_ID values should be 1, 2 and 3 for the three records. Crush_Description should be ‘Present’ for record 1, ‘Past’ for record 2 and ‘Childhood’ for record 3. If you don’t have any crush from your childhood to present, you can insert some random names. Hmm.. Seems Interesting!! It’s time to implement your programming skills using PL/SQL stored procedures and functions. Create another table called ‘MyDetails’ and should contain exactly four attributes as below: Student_ID,Student_Name ,Student_Term ,Student_GPA If you are not a Master’s student, let’s assume you are a student pursuing masters and taking four semesters or terms.…arrow_forwardThe team wants to track potential list of users who may have forgotten their items on the cars. Therefore, you need to return USER_FIRST_NAME, USER_LAST_NAME, TRAVEL_START_TIME, TRAVEL_END_TIME information from the USERS and TRAVELS tables connected inside a JOIN statement by the USING function and USER_ID fieldarrow_forward
- For every order that has been received, display the order ID, the total dollar amount owed on that order (you’ll have to calculate this total from attributes in one or more tables; label this result TotalDue), and the amount received in payments on that order (assume that there is only one payment made on each order). To make this query a little simpler, you don’t have to include those orders for which no payment has yet been received. List the results in decreasing order of the difference between total due and amount paid.arrow_forwardFor every order that has been received, display the order ID, the total dollar amount owed on that order (you’ll have to calculate this total from attributes in one or more tables; label this result TotalDue), and the amount received in payments on that order (assume that there is only one payment made on each order). To make this query a little simpler, you don’t have to include those orders for which no payment has yet been received. List the results in decreasing order of the difference between total due and amount paid.arrow_forwardThe Horse table has the following columns: ID - integer, auto increment, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Delete the following rows: Horse with ID 5. All horses with breed Holsteiner or Paint. All horses born before March 13, 2013. NOTE: Starter code has been provided. Simply change the blanks ("_") to the appropriate entity/value.arrow_forward
- Without re-creating the table write one sql statement to answer this question. Change the definition of Riverview_customer to include the customer type, but name this column custtype. Put a restriction on the table to ensure that the customer types will include values of O, L and N. Name this restriction valid_custtypesarrow_forwardImplement the above schema with its attributes and relation.• Drop the column PAdress from the above Person table.• Change the column PDesignation from above PersonOfficeDetails table VARCHAR (20) toVARCHAR (30).• Change the data type/definition of column POfficeAdress INT to TEXT from above PersonOfficeDetails table.• Rename Person Table to Person_AlterTable.• Insert one meaning full data on each table of your choicearrow_forwardCreate a View to show the city name of any location that has a department. Only show the city name once in the results. You must use a non-correlated subquery.Call this view: Department_LocationsInclude a second query to display from the View after it is created. Refer to the attached for the table.arrow_forward
- Using the Winners table from Figure 12-2, write a parameter query that selects theActor and Actress fields for the year provided by the user.arrow_forwardWrite SQL statements to create at the two tables for the database. The tables must have at least three relevant columns with appropriate types, a primary key and at least one table should have a foreign key and the related foreign key constraints. CREATE TABLE students ( Student_id int NOT NULL PRIMARY KEY, Stud_firstname VARCHAR(30) NOT NULL, Stud_lastname VARCHAR(30) NOT NULL, Stud_email VARCHAR(80) NOT NULL UNIQUE advisor_id int, ); create table advisor ( advisor_id int not null primary key, stud_id int, adv_firstname varchar(30), adv_lastname varchar(30), foreign key(student_id) references students(student_id) ); [keep getting error, need help correcting]arrow_forwardCreate a query that will show the person id and fee for all players in the football database. Additionally create a column in your output to show the amount of increase if the fee were increased by 20%. Also produce a column that will show what the new fee would be with the 20%. Sort your results showing those that do not pay a fee at the bottom of your list. Finally make sure your column headings read: Person ID, Current Fee, Increase and New Fee. Make sure your spelling and case EXACTLY match what is specified.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
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY