/* script name: CREATEBIGPV11E-MySQL.SQL */ /* purpose: Builds MYSQL tables for Big PVFC DB 11e */ /* date: 7 Sep 2013 */ /* updated: */ /* */ /* comment: These tables have the same names as the */ /* Book PVFC database, so if you run these */ /* script files after you have created the */ /* Book database files, you will wipe out */ /* the data in the earlier database */ /* */ /* comment: The Photo column in the PRODUCT table */ /* is not included in the MYSQL version of */ /* this database */ /* */ /* set up session settings */ /* Drop all tables before creating tables */ DROP TABLE IF EXISTS Supplies_T CASCADE ; DROP TABLE IF EXISTS Uses_T CASCADE ; DROP TABLE IF EXISTS RawMaterial_T CASCADE ; DROP TABLE IF EXISTS Vendor_T CASCADE ; DROP TABLE IF EXISTS Shipped_T CASCADE ; DROP TABLE IF EXISTS PaymentType_T CASCADE ; DROP IF EXISTS Payment_T CASCADE ; DROP TABLE IF EXISTS OrderLine_T CASCADE ; DROP TABLE IF EXISTS Order_T CASCADE ; DROP IF EXISTS CustomerShipAddress_T CASCADE ; DROP TABLE IF EXISTS ProducedIn_T CASCADE ; DROP TABLE IF EXISTS Product_T CASCADE ; DROP TABLE IF EXISTS ProductLine_T CASCADE ; DROP TABLE IF EXISTS WorksIn_T CASCADE ; DROP TABLE IF EXISTS WorkCenter_T CASCADE ; DROP TABLE IF EXISTS EmployeeSkills_T CASCADE ; DROP TABLE IF EXISTS Employee_T CASCADE ; DROP TABLE IF EXISTS Skill_T CASCADE ; DROP TABLE IF EXISTS Salesperson_T CASCADE ; DROP TABLE IF EXISTS DoesBusinessIn_T CASCADE ; DROP TABLE IF EXISTS Territory_T CASCADE ; DROP TABLE IF EXISTS Customer_T CASCADE ; /* Create all PVFC Big Database Tables (23) */ CREATE TABLE Customer_T (CustomerID NUMERIC(11,0) NOT NULL, CustomerName VARCHAR(25) NOT NULL, CustomerAddress VARCHAR(30) , CustomerCity VARCHAR(20) , CustomerState CHAR(2) , CustomerPostalCode VARCHAR(10) ,
/* script name: CREATEBIGPV11E-MySQL.SQL */ /* purpose: Builds MYSQL tables for Big PVFC DB 11e */ /* date: 7 Sep 2013 */ /* updated: */ /* */ /* comment: These tables have the same names as the */ /* Book PVFC database, so if you run these */ /* script files after you have created the */ /* Book database files, you will wipe out */ /* the data in the earlier database */ /* */ /* comment: The Photo column in the PRODUCT table */ /* is not included in the MYSQL version of */ /* this database */ /* */ /* set up session settings */ /* Drop all tables before creating tables */ DROP TABLE IF EXISTS Supplies_T CASCADE ; DROP TABLE IF EXISTS Uses_T CASCADE ; DROP TABLE IF EXISTS RawMaterial_T CASCADE ; DROP TABLE IF EXISTS Vendor_T CASCADE ; DROP TABLE IF EXISTS Shipped_T CASCADE ; DROP TABLE IF EXISTS PaymentType_T CASCADE ; DROP IF EXISTS Payment_T CASCADE ; DROP TABLE IF EXISTS OrderLine_T CASCADE ; DROP TABLE IF EXISTS Order_T CASCADE ; DROP IF EXISTS CustomerShipAddress_T CASCADE ; DROP TABLE IF EXISTS ProducedIn_T CASCADE ; DROP TABLE IF EXISTS Product_T CASCADE ; DROP TABLE IF EXISTS ProductLine_T CASCADE ; DROP TABLE IF EXISTS WorksIn_T CASCADE ; DROP TABLE IF EXISTS WorkCenter_T CASCADE ; DROP TABLE IF EXISTS EmployeeSkills_T CASCADE ; DROP TABLE IF EXISTS Employee_T CASCADE ; DROP TABLE IF EXISTS Skill_T CASCADE ; DROP TABLE IF EXISTS Salesperson_T CASCADE ; DROP TABLE IF EXISTS DoesBusinessIn_T CASCADE ; DROP TABLE IF EXISTS Territory_T CASCADE ; DROP TABLE IF EXISTS Customer_T CASCADE ; /* Create all PVFC Big Database Tables (23) */ CREATE TABLE Customer_T (CustomerID NUMERIC(11,0) NOT NULL, CustomerName VARCHAR(25) NOT NULL, CustomerAddress VARCHAR(30) , CustomerCity VARCHAR(20) , CustomerState CHAR(2) , CustomerPostalCode VARCHAR(10) ,