BuyFindarrow_forward

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900

Solutions

Chapter
Section
BuyFindarrow_forward

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900
Chapter 8, Problem 19P
Textbook Problem
132 views

Write the set of SQL commands necessary to insert the data into the INVOICE table you created in Problem 17, as illustrated in Figure P8.16.

Program Plan Intro

Primary key:

  • To identify each record in a table, at least there must be one data field, which should be unique.
    • That is corresponding data field of every record should be unique.
    • It is called primary key.
  • Primary key is used to identify the unique record from a collection of records.

Foreign key:

  • Sometimes, it is necessary to relate two tables to maintain some details in another table, which contains the relationship between two tables.
  • So, to connect two tables, a primary key field in one table is added to the related table, and it is called foreign key.

Explanation of Solution

Insert values:

Inserting values comes under Data Manipulation Language (DML).

  • The INSERT command in SQL is employed to add records to an existing table.

Syntax for inserting values into the table is as follows:

INSERT INTO TABLE_NAME VALUES('DATA 1', 'DATA 2');

Inserting values into the table “INVOICE”:

INSERT INTO INVOICE VALUES (8000, 1000, 'Mar-23-16', 235.89);

INSERT INTO INVOICE VALUES (8001, 1001, 'Mar-23-16', 312.82);

INSERT INTO INVOICE VALUES (8002, 1001, 'Mar-30-16', 528.10);

INSERT INTO INVOICE VALUES (8003, 1000, 'Apr-12-16', 194...

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 8 Solutions

Database Systems: Design, Implementation, & Management
Show all chapter solutions
add
Ch. 8 - What is a trigger, and what is its purpose? Give...Ch. 8 - What is a stored procedure, and why is it...Ch. 8 - Write the SQL code that will create only the table...Ch. 8 - Having created the table structure in Problem 1,...Ch. 8 - Using the EMPLOYEE table that already exists, use...Ch. 8 - Write the SQL code that will save the changes made...Ch. 8 - Write the SQL code to change the job code to 501...Ch. 8 - Write the SQL code to delete the row for William...Ch. 8 - Write the SQL code to create a copy of EMP_1,...Ch. 8 - Using the EMP_2 table, write the SQL code that...Ch. 8 - Using the EMP_2 table, write the SQL code to...Ch. 8 - Using the EMP_2 table, write a single SQL command...Ch. 8 - Using the EMP_2 table, write a single SQL command...Ch. 8 - Using the EMP_2 table, write the SQL command to...Ch. 8 - Using a single command sequence with the EMP_2...Ch. 8 - Using a single command sequence with the EMP_2...Ch. 8 - Write the SQL code that will change the PROJ_NUM...Ch. 8 - Create the CUSTOMER table structure illustrated in...Ch. 8 - Create the INVOICE table structure illustrated in...Ch. 8 - Write the set of SQL commands necessary to insert...Ch. 8 - Write the set of SQL commands necessary to insert...Ch. 8 - Create an Oracle sequence named CUST_NUM_SEQ to...Ch. 8 - Create an Oracle sequence named INV_NUM_SEQ to...Ch. 8 - Insert the following customer into the CUSTOMER...Ch. 8 - Modify the CUSTOMER table to include the customers...Ch. 8 - Modify customer 1000 to indicate the date of birth...Ch. 8 - Modify customer 1001 to indicate the date of birth...Ch. 8 - Create a trigger named trg_updatecustbalance to...Ch. 8 - Write a procedure named prc_cust_add to add a new...Ch. 8 - Write a procedure named prc_invoice_add to add a...Ch. 8 - Write a trigger to update the customer balance...Ch. 8 - Write a procedure to delete an invoice, giving the...Ch. 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 - Write the queries to update the MOD_WAIT_CHG...Ch. 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 - Modify the PILOT table to add the attribute shown...Ch. 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 - Write the SQL code to create the table structures...Ch. 8 - The following tables provide a very small portion...Ch. 8 - For Questions 49-63, use the tables that were...Ch. 8 - Write the SQL command to change the price code for...Ch. 8 - Write a single SQL command to increase all price...Ch. 8 - Alter the DETAILRENTAL table to include a derived...Ch. 8 - Update the DETAILRENTAL table to set the values in...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 - Update the PRICE table to place the values shown...Ch. 8 - Create a sequence named rent_num_seq to start with...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Show solutions add
What is US-CERT and what does it do?

Fundamentals of Information Systems

What is the extract-transform-load process?

Principles of Information Systems (MindTap Course List)

VocabularyState the meaning of the following terms: Duty Cycle _____ Footcandle _____ Efficacy _____ CRI _____ ...

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

List the sections of a system design specification, and describe the contents.

Systems Analysis and Design (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)

Compare and contrast three programs or apps that can edit a video. Which one do you like the most? Why? Which o...

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

What types of protection are available to protect the ears during welding?

Welding: Principles and Applications (MindTap Course List)