a2 - Winter 2009 University of Waterloo School of Computer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Waterloo School of Computer Science CS338 Winter 2009 Assignment 2 Due: 5:00pm, Feb 12, 2009 Consider the following relational Schema drawn using the style of diagram as shown on page 1-33 of the lecture notes. sales_order id cust_id order_date fin_code_id region sales_rep sales_order_items id line_id prod_id quantity ship_date contact id last_name first_name title street city state zip phone fax fin_data year quarter code amount fin_code code type description customer id fname lname address city state zip phone company_name department dept_id dept_name dept_head_id product id name description size color quantity unit_price employee emp_id manager_id emp_fname emp_lname dept_id street city state zip_code phone status ss_number salary +7 more (below)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CREATE TABLE cs338.employee ( emp_id integer NOT NULL, manager_id integer, emp_fname char(20) NOT NULL, emp_lname char(20) NOT NULL, dept_id integer NOT NULL, street char(40) NOT NULL, city char(20) NOT NULL, state char(4) NOT NULL, zip_code char(9) NOT NULL, phone char(10), status char(1), ss_number char(11) NOT NULL, salary numeric(20,3) NOT NULL, start_date date NOT NULL, termination_date date, birth_date date, bene_health_ins char(1), bene_life_ins char(1), bene_day_care char(1), sex char(1), PRIMARY KEY (emp_id) ) CREATE TABLE cs338.department ( dept_id integer NOT NULL, dept_name char(40) NOT NULL, dept_head_id integer, PRIMARY KEY (dept_id) ) CREATE TABLE cs338.customer ( id integer NOT NULL, fname char(15) NOT NULL, lname char(20) NOT NULL, address char(35) NOT NULL, city char(20) NOT NULL, state char(2) NOT NULL, zip char(10) NOT NULL, phone char(12) NOT NULL, company_name char(35), PRIMARY KEY (id) ) CREATE TABLE cs338.contact ( id integer NOT NULL,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

a2 - Winter 2009 University of Waterloo School of Computer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online