Database Systems: Design, Implementation, & Management
11th Edition
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
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 8, Problem 45C
Alter the VIDEO table to include an attribute named VID_STATUS to store character data up to four characters long. The attribute should have a constraint to enforce the domain (“IN,” “OUT,” and “LOST”) and have a default value of “IN.”
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The 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.
SQL:
Add a table-level PRIMARY KEY constraint to the EMPLOYEE table using the ID column. The constraint should be named at creation. (Which means you'll need to drop the table, then recreate.)
Create a PRIMARY KEY constraint on the DEPARTMENT table using the ID column. The constraint should be named at creation. (Which means you'll need to drop the table, then recreate.)
Add a foreign key reference on the EMPLOYEE table that will ensure that the employee is not assigned to a nonexistent department.
Confirm that the constraints were added by querying USER_CONSTRAINTS. Note the types and names of the constraints and include them in your statement comments.
Display the object names and types from the USER_OBJECTS data dictionary view for EMPLOYEE and DEPARTMENT tables. You will want to format the columns for readability. Provide comments that include the new tables and indexes created.
Modify the EMPLOYEE table by adding a SALARY column of NUMBER data type, precision 7. Confirm…
Create the CUSTOMER table structure illustrated in Figure P8.16. The customer number should store integer values. The name attributes should support variable length character data up to 30 characters each. The customer balance should support up to six digits on the left of the decimal place and two digits to the right of the decimal place.
Chapter 8 Solutions
Database Systems: Design, Implementation, & Management
Ch. 8 - What is a cross join? Give an example of its...Ch. 8 - What three join types are included in the outer...Ch. 8 - Using tables named T1 and T2, write a query...Ch. 8 - Prob. 4RQCh. 8 - Prob. 5RQCh. 8 - Prob. 6RQCh. 8 - Prob. 7RQCh. 8 - What does it mean to say that SQL operators are...Ch. 8 - Prob. 9RQCh. 8 - Prob. 10RQ
Ch. 8 - Prob. 11RQCh. 8 - Prob. 12RQCh. 8 - Prob. 13RQCh. 8 - Given the employee information in Question 11,...Ch. 8 - Prob. 15RQCh. 8 - Prob. 16RQCh. 8 - Prob. 17RQCh. 8 - Prob. 18RQCh. 8 - What string function should you use to list the...Ch. 8 - Prob. 20RQCh. 8 - Prob. 21RQCh. 8 - Prob. 22RQCh. 8 - Prob. 23RQCh. 8 - Prob. 24RQCh. 8 - Prob. 1PCh. 8 - Insert the data into the tables you created in...Ch. 8 - Prob. 3PCh. 8 - Prob. 4PCh. 8 - Prob. 5PCh. 8 - Prob. 6PCh. 8 - Prob. 7PCh. 8 - Prob. 8PCh. 8 - Prob. 9PCh. 8 - Modify the CUSTOMER table to include two new...Ch. 8 - Prob. 11PCh. 8 - Prob. 12PCh. 8 - Prob. 13PCh. 8 - Prob. 14PCh. 8 - Prob. 15PCh. 8 - Prob. 16PCh. 8 - Write a trigger to update the customer balance...Ch. 8 - Write a procedure to delete an invoice, giving the...Ch. 8 - Prob. 19PCh. 8 - Prob. 20PCh. 8 - Prob. 21PCh. 8 - Prob. 22PCh. 8 - Prob. 23PCh. 8 - Prob. 24PCh. 8 - Prob. 25PCh. 8 - Prob. 26PCh. 8 - Prob. 27PCh. 8 - Create a trigger named trg_line_total to write the...Ch. 8 - Create a trigger named trg_line_prod that...Ch. 8 - Create a stored procedure named prc_inv_amounts to...Ch. 8 - Create a procedure named prc_cus_balance_update...Ch. 8 - Modify the MODEL table to add the attribute and...Ch. 8 - Prob. 33PCh. 8 - Modify the CHARTER table to add the attributes...Ch. 8 - Write the sequence of commands required to update...Ch. 8 - Write the sequence of commands required to update...Ch. 8 - Write the command required to update the...Ch. 8 - Write the command required to update the...Ch. 8 - Write the command required to update the...Ch. 8 - Prob. 40PCh. 8 - Create a trigger named trg_char_hours that...Ch. 8 - Create a trigger named trg_pic_hours that...Ch. 8 - Create a trigger named trg_cust_balance that...Ch. 8 - Alter the DETAILRENTAL table to include a derived...Ch. 8 - Alter the VIDEO table to include an attribute...Ch. 8 - Update the VID_STATUS attribute of the VIDEO table...Ch. 8 - Alter the PRICE table to include an attribute...Ch. 8 - Prob. 48CCh. 8 - Prob. 51C
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
- Alter the PRICE table to include an attribute named PRICE_RENTDAYS to store integers of up to two digits. The attribute should not accept null values, and it should have a default value of 3.arrow_forwardTask 7: The development team wants to add new residents and new service requests to StayWell without checking the latest IDs and manually incrementing it. Therefore, you need to alter the RESIDENTS table and change the RESIDENT_ID field to an auto-incremented field of type SMALLINT. Task Alter the RESIDENTS table and change the ID field to an auto-incremented field. 1 Task 8: The Colombia City office of StayWell indicated that there is a new tenant by the name of Yigit Yilmaz staying at the property with an ID of 13. You need to include this new resident in the RESIDENTS table. Task Add Yigit Yilmaz to the RESIDENTS table. 1 Task 9: The StayWell property management team wants to add two additional properties and run some simulation tests relating to market coverage. Add the following properties to the PROPERTY table: PROPERTY_ID OFFICE_NUM ADDRESS SQR_FT BDRMS FLOORS OWNER_NUM 14 1 9 Houston Drive 1,100 2 1 MO100 15 1 11 Village Drive 1,300 3 1…arrow_forwardComputer Science Create the Branch_Reps table and define the constraints at the table level. Note that Not Null can be created only with the column level. The table includes the following columns and constraints.arrow_forward
- 15. Open the AttendeeFirstName query in Design View and add criteria to select only those records where the FirstName field value begins with Lau followed by any other letters. Save the changes to the query. Open the query in Datasheet View, confirm that two records appear in the query results, and then close it.arrow_forwardAlert dont submit AI generated answer. Now you want to focus on the summarizing data for Account Reps hired before 11/2018. Specifically, you want to calculate the total number of Account Reps. In cell J13, insert the COUNTIFS function to calculate the number of Account Reps (cell H9) in the Title column where the date in the Hire Date column was before 1/1/2018. Use relative references for the two criteria range arguments and the title criteria argument in cell H9. Type the date comparison for the second criteria argument. The next step is to calculate the total salary for Account Reps hired before 11/2018. You will use mixed references so that you can later copy the function and change the function name for other calculations. In cell H14, insert the SUMIFS function to calculate the total amount in the Salary column where the Title contains the job title criteria Account Rep (cell H9) and where the date in the Hire Date column was before 1/1/2018. Use relative references for the…arrow_forwardGot the first two, just need help with #3. Create a primary key constraint on the owner column in the owners table and make the owner_name column the primary key. This must be done before a foreign key constraint can be created on the dogs table. Create a foreign key constraint on the dogs table. The dogs table will reference the owners table through the owner_name column (a foreign key/exported key for the owner_name column in the dogs table.) Test your foreign key constraint by adding a row to the owners table and then add a row to the dogs table with the same owner_name value. Subject: MySQLarrow_forward
- To specify the value to be assigned to an attribute with domain DATE, you should give: a string in 'mm/dd/yy' format the keyword DATE followed by a string in 'yyyy-mm-dd' format a tuple containing numerical values for day, month, and yeararrow_forwardThe Driver Relationship team realized that maintaining driver IDs is difficult and requested an automatic way of incrementing the value when a new driver is added. You need to make the changes on the table to automatically increment the DRIVER_ID. After the change, you need to insert the following driver: First Name: Nursin Last Name: Yilmaz Driving License ID: 4141447 Start Date: 2021-12-28 Driving License Checked: True Rating: 4.0arrow_forwardUsing the Winners table from Figure 12-2, write a SELECT statement that selects onlythe Animated field for records whose Animated field begins with the letter R. Sort therecords in ascending order by the Animated field.arrow_forward
- 1. Create the My Employee table with the following fields: Not Null ID Last Name First Name Userid Salary 1 2 3 4 5 2. Add the constraint Primary Key (ID) to the table. 3. Insert the following data to the table: ID Last Name First Name Ali Number(4) Varchar(25) Varchar(25) Varchar(8) Number(9,2) AlChameri Alanizi Hejazi Turki AlKamel Rayen Decham Mohamed Fahhed Userid raptel bdancs bbiri cnewman aropebur Salary 795 860 1100 750 1550 I 4. Select all the data in the table. 5. Change the Last Name of employee 4 to Turkish. 6. Change the Salary to 1000 for all employees with a salary less than 900arrow_forwardTask 5: The Driver Relationship team requested to ensure that there will be no duplicates in the active drivers tables in terms of first name, last name and driving license ID. You need to create a constraint in the ACTIVE_DRIVERS table, called DuplicateCheck, to ensure the first name, last name, and the driving license ID are unique. ANSWER IN MYSQL PLEASEarrow_forwardCREATE TABLE MEMBERSHIP ( MEM_NUM CHAR(3) CONSTRAINT MEMBER_MEM_NUM_PK PRIMARY KEY, MEM_FNAME VARCHAR(30) NOT NULL, MEM_LNAME VARCHAR(30) NOT NULL, MEM_STREET VARCHAR(30), MEM_CITY VARCHAR(10), MEM_STATE CHAR(2), MEM_ZIP CHAR(5), MEM_BALANCE NUMBER (2)); CREATE TABLE RENTAL ( RENT_NUM CHAR(4) CONSTRAINT RENTAL_RENT_NUM_PK PRIMARY KEY, RENT_DATE DATE, MEM_NUM CHAR(3), CONSTRAINT RENTAL_MEM_NUM_FK FOREIGN KEY (MEM_NUM) REFERENCES MEMBERSHIP); CREATE TABLE PRICE (PRICE_CODE CHAR(1) CONSTRAINT PRICE_PRICE_CODE_PK PRIMARY KEY, PRICE_DESC VARCHAR(20), PRICE_RENTFEE NUMBER (3,1), PRICE_DAILYATFEE NUMBER(3,1)); CREATE TABLE MOVIE (MOVIE_NUM CHAR(4) CONSTRAINT MOVIE_MOVIE_NUM_PK PRIMARY KEY, MOVIE_NAME VARCHAR(30) NOT NULL, MOVIE_YEAR CHAR(4), MOVIE_COST NUMBER(5,2), MOVIE_GENRE VARCHAR(15), PRICE_CODE CHAR(1), CONSTRAINT MOVIE_PRICE_CODE_FK FOREIGN KEY (PRICE_CODE) REFERENCES PRICE); CREATE TABLE VIDEO (VID_NUM CHAR(5) CONSTRAINT VIDEO_VIDEO_NUM_PK PRIMARY KEY, VID_INDATE…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase 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 Learning
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
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
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY