USE DATABASE mytools;

-- drop tables if they already exist:
DROP TABLE IF EXISTS customers;
DROP TABLE IF EXISTS purchase_orders;
DROP TABLE IF EXISTS line_items;
DROP TABLE IF EXISTS item_desc;

CREATE TABLE customers (cust_id INTEGER, first_name VARCHAR(20), last_name VARCHAR(20), home_address VARCHAR(20), city VARCHAR(20), state VARCHAR(20), zip_code VARCHAR(10));
CREATE TABLE purchase_orders ( po_id INTEGER, cust_id INTEGER, purchase_date date, purchase_subtotal DECIMAL(8,2), purchase_tax DECIMAL(8,2), purchase_bill DECIMAL(8,2));
CREATE TABLE line_items (po_id INTEGER, cust_id INTEGER, line_id INTEGER, line_count INTEGER);
CREATE TABLE item_desc (item_id INTEGER, item_price DECIMAL(8,2), item_desc VARCHAR(80));
