Currently, the contents of the Category column in the BOOKS table are the actual name for each

Question:

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:

Column Name Constraints Datatype Width CATCODE PRIMARY KEY VARCHAR2 3 CATDESC NOT NULL VARCHAR2 11

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 LIT LITERAT


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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Oracle 12c SQL

ISBN: 978-1305251038

3rd edition

Authors: Joan Casteel

Question Posted: