Homework 1 Managing Data(bases) using SQL

$24.99 $18.99

Objective: CREATE TABLE statement, Primary/Foreign key constraints Problem 1: Create the following table: Table name: customer Columns: customerID (whole number max 4 digits) customerName (variable character max 50 characters) o customerSince (date) Primary key on column customerID named customer_pk Problem 2: Execute the following two statements (inserting one sample record into table customer and verifying…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Objective: CREATE TABLE statement, Primary/Foreign key constraints

Problem 1:

Create the following table:

  • Table name: customer

  • Columns:

  1. customerID (whole number max 4 digits)

    1. customerName (variable character max 50 characters) o customerSince (date)

  • Primary key on column customerID named customer_pk

Problem 2:

Execute the following two statements (inserting one sample record into table customer and verifying that record was correctly inserted):

  • INSERT INTO customer VALUES(1008, ‘New Customer’, sysdate);

  • SELECT * FROM customer;

Problem 3:

Create a second table:

  • Table name: orders

  • Columns:

    1. orderID (whole number max 8 digits) o orderDate (date)

o shippingMethod (variable character max 25 characters) o customerID (whole number max 4 digits)

  • Primary key on column orderID named orderID_pk

  • Foreign key on column customerID relating to column customerID in table customer named customerid_fk

Problem 4:

Execute the following statements:

  • INSERT INTO orders VALUES(12345678, sysdate, ‘2-Day’, 1008);

  • INSERT INTO orders VALUES(88888888, sysdate, ‘2-Day’, 1009);

  • SELECT * FROM orders;

Problem 5:

Explain why the second INSERT statement under 4. failed with an error (No screenshot needed, simply a written answer).

Homework 1 Managing Data(bases) using SQL
$24.99 $18.99