BuyFindarrow_forward

A Guide to SQL

9th Edition
Philip J. Pratt
Publisher: Course Technology Ptr
ISBN: 9781111527273
Chapter 7, Problem 9TD
Textbook Problem
102 views

Add the ORDER_NUM column as a foreign key in the ORDER_LINE table.

Program Plan Intro

ALTER TABLE Statement:

  • “ALTER TABLE” statement comes under Data Definition Language.
  • It is used to modify column, add constraints, add column(s), drop column, rename column name and table name, drop constraints, and so on.

Syntax:

The syntax to drop constraint is as follows:

ALTER TABLE table_Name ADD CONSTRAINT constraint_Name;

Explanation of Solution

Query to add a column “ORDER_NUM”:

ALTER TABLE ORDER_LINE

ADD FOREIGN KEY (ORDER_NUM) REFERENCES ORDERS;

Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Chapter 7 Solutions

A Guide to SQL
Show all chapter solutions
add
Ch. 7 - Which command deletes an index?Ch. 7 - Does the DBMS or the user make the choice of which...Ch. 7 - Describe the information the DBMS maintains in the...Ch. 7 - The CUSTOMER table contains a foreign key,...Ch. 7 - Which command do you use to obtain information...Ch. 7 - How is the system catalog updated?Ch. 7 - What are integrity constraints?Ch. 7 - How do you specify a general integrity constraint?Ch. 7 - When would you usually specify primary key...Ch. 7 - How do you specify a foreign key in Oracle?Ch. 7 - Use the Internet to find information about...Ch. 7 - Use the Internet to find information about a data...Ch. 7 - Use SQL to make the following changes to the TAL...Ch. 7 - Create a view named ITEM_ORDER. It consists of the...Ch. 7 - Create a view named ORDER_TOTAL. It consists of...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Write, but do not execute, the command to revoke...Ch. 7 - Perform the following tasks: a. Create an index...Ch. 7 - Delete the index named ITEM_INDEX3.Ch. 7 - Write the commands to obtain the following...Ch. 7 - Add the ORDER_NUM column as a foreign key in the...Ch. 7 - Ensure that the only legal values for the...Ch. 7 - Toys Galore currently has a credit limit of 7,500....Ch. 7 - Use SQL to make the following changes to the...Ch. 7 - Create a view named RESERVATION_CUSTOMER. It...Ch. 7 - Create a view named TRIP_INVENTORY. It consists of...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Write, but do not execute, the command to revoke...Ch. 7 - Create the following indexes: a. Create an index...Ch. 7 - Delete the index named TRIP_INDEX3.Ch. 7 - Write the commands to obtain the following...Ch. 7 - Add the CUSTOMER_NUM column as a foreign key in...Ch. 7 - Ensure that the only legal values for the TYPE...Ch. 7 - The maximum group size for a trip must be greater...Ch. 7 - Use SQL to make the following changes to the...Ch. 7 - Create a view named CONDO_OWNERS. It consists of...Ch. 7 - Create a view named CONDO_FEES. It consists of two...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Write, but do not execute, the command to revoke...Ch. 7 - Create the following indexes: a. Create an index...Ch. 7 - Delete the OWNER_INDEX 3 index from the OWNER...Ch. 7 - Write the commands to obtain the following...Ch. 7 - Add the OWNER_NUM column as a foreign key in the...Ch. 7 - Ensure that the only legal values for the BDRMS...Ch. 7 - In Question 9, you added owner number as a foreign...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Show solutions add
What was the earliest reason for the use of cryptography?

Principles of Information Security (MindTap Course List)

List three key points in caring for precision measuring tool.

Precision Machining Technology (MindTap Course List)

Calculate the amount of thermal energy required to raise the temperature of 20 gallon of water from 60 F to 120...

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

Why would a systems analyst have to act as a translator? What groups might be involved?

Systems Analysis and Design (Shelly Cashman Series) (MindTap Course List)

Compute the moment amplification factorB1 for the member of Problem 6.2-2. a. Use LRFD. b. Use ASD.

Steel Design (Activate Learning with these NEW titles from Engineering!)

Define these terms: proprietary software, backward compatible, and upward compatible.

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

How large is an ATM cell?

Network+ Guide to Networks (MindTap Course List)