CREATE TABLE Customer - Qty Unit price Sales $ Product Qty...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CREATE TABLE Customer ( CustomerNo NUMERIC(6) NOT NULL, CustomerName VARCHAR(30), City VARCHAR(30), State VARCHAR(2), Region_id CHAR(6), ); CREATE TABLE Region ( Region_id CHAR(6) NOT NULL, Region_desc VARCHAR(20) ); CREATE TABLE OrderLine ( ProductID VARCHAR(12) NOT NULL, OrderNo NUMERIC(10), Qty NUMERIC(8), UnitPrice NUMERIC(8,2), ShipDate DATETIME ); CREATE TABLE Product ( ProductID VARCHAR(12) NOT NULL, Description VARCHAR(20), ListPrice NUMERIC(8,2) ); CREATE TABLE Orders ( OrderNo NUMERIC(10), NOT NULL, CustomerNo NUMERIC(6) NOT NULL, OrderDate DATETIME ); INSERT INTO Orders(OrderNo, CustomerNo, OrderDate) VALUES (‘801002’, ’13578’, ’01/01/2009’); Order# Date Customer Name Region City State Product
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Qty Unit price Sales $ Product Qty Unit price Sales $ 801001 1/1/2009 12556 Toy Engineering East Erie PA Round 214 15.26 $ 3,265.64 Square 128 18.53 $ 2,371.84 801002 1/1/2009 13578 ABC Stick-ons Meast Cleveland OH Square 125 18.53 $ 456.34 ALTER TABLE Customer ADD CONSTRAINT pk_name PRIMARY KEY (CustomerNo); ALTER TABLE Region ADD CONSTRAINT pk_name PRIMARY KEY (Region_id); ALTER TABLE OrderLine ADD CONSTRAINT pk_name PRIMARY KEY (ProductID, OrderNo); ALTER TABLE Product ADD CONSTRAINT pk_name PRIMARY KEY (ProductID); ALTER TABLE Orders ADD CONSTRAINT pk_name PRIMARY KEY (OrderNo);...
View Full Document

This note was uploaded on 08/02/2009 for the course IST 210 taught by Professor Mcconn,charlotteryoo,jungwoo during the Summer '08 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online