Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL Advanced Challenge Currently, the contents of the Category column in the BOOKS table are the actual name for each category. This structure presents a
SQL
Advanced Challenge Currently, the contents of the Category column in the BOOKS table are the actual name for each category. This structure presents a problem if one user enters COMPUTER for the Computer category and another user enters COMPUTERS. To avoid this and other problems that might occur, the database designers have decided to create a CATEGORY table containing a code and description for each category. The structure for the CATEGORY table should be as follows: Width Column Name CATCODE CATDESC Datatype VARCHAR2 Constraints PRIMARY KEY NOT NULL VARCHAR2 The data for the CATEGORY table is as follows: CATCODE CATDESC BUS BUSINESS CHN CHILDREN COK COOKING COM COMPUTER FAL FAMILY LIFE FIT FITNESS SEH SELF HELP LITERATURE LIT Required: Create the CATEGORY table and populate it with the given data. Save the changes permanently. Add a column to the BOOKS table called Catcode. Add a FOREIGN KEY constraint that requires all category codes entered in the BOOKS table to already exist in the CATEGORY table. Set the Catcode values for the existing rows in the BOOKS table, based on each book's current Category value. Verify that the correct categories have been assigned in the BOOKS table, and save the changes permanently. Delete the Category column from the BOOKS table. Only save the changes here Don't worry about verifying
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started