The database wants to find an example is really not simple. Oh, the original book, the database is just a standard, not a version of the implementation. After discovering this form online, it does not match the type of MySQL field that is discovered since the used. So I changed. The following SQL files can be imported directly into MySQL. Have this stuff. Can save a lot of time. Learning is more convenient. --study.sql files are as follows: Create DateBase Study; Use study - Table Employee_TBL Structure
CREATE TABLE Employee_TBL (Emp_id varchar (9) Not null,
Last_name varchar (15) NOT NULL,
First_name varchar (15) Not null,
Middle_name varchar (15),
Address Varchar (30) Not Null,
City varchar (15) Not null,
State Char (2) Not Null,
Zip Numeric (5) Not Null,
Phone char (10),
Pager char (10),
ConsTRAINT EMP_PK PRIMARY Key (EMP_ID));
- Table Employee_Pay_TBL Structure Create Table Employee_Pay_TBL (Emp_id Varchar (9) Not Null,
Position varchar (15) Not null,
Date_Hire Date,
Pay_Rate Numeric (4, 2),
Date_last_raise Date,
Salary Numeric (8, 2),
Bonus Numeric (6, 2),
ConsTRAINT EMP_FK Foreign Key (EMP_ID) REFERENCES EMPLOYEE_TBL (EMP_ID));
- Table Customer_TBL Structure Create Table Customer_TBL (Cust_ID VARCHAR (10) Not Null Primary Key,
Cust_name varchar (30) Not null,
Cust_address varchar (20) Not null,
Cust_city varchar (15) Not null,
Cust_State Char (2) Not NULL,
Cust_zip Numeric (5) Not null,
Cust_Phone Numeric (10),
Cust_fax numeric (10));
- Table ORDERS_TBL Structure Create Table ORDERS_TBL (ORD_NUM VARCHAR (10) Not Null Primary Key,
Cust_id varchar (10) Not null,
PROD_ID VARCHAR (10) Not null,
Qty numeric (6) Not null,
ORD_DATE DATE);
- Table Products_TBL Structure CREATE TABLE PRODUCTS_TBL (Prod_id Varchar (10) Not Null Primary Key,
PROD_DESC VARCHAR (40) Not null,
Cost numeric (6,2) not null;
Here are the insert records of each table.
INSERT INTO Employee_TBL VALUES
('311549902', 'Stephens', 'Tina', 'Dawn', 'RR 3 Box 17a', 'Green Wood',
'In', '47890', '3178784465', NULL);
INSERT INTO Employee_TBL VALUES
('442346889', 'Plew', 'Linda', 'Carol', '3301 Reacon', 'Indianapo Lis', 'IN', '46224', '3172978990', NULL);
INSERT INTO Employee_TBL VALUES
('213764555', 'Glass', 'Brandon', 'Scott', '1710 Main St', 'WhiteLand',
'In', '47885', '3178984321', '3175709980';
INSERT INTO Employee_TBL VALUES
('313782439', 'Glass', 'Jacob', NULL, '3789 White River BLVD',
'Indianapolis', 'In', '45734', '3175457676', '8887345678'); INSERT INTO Employee_TBL VALUES
('220984332', 'Wallace', 'Mariah', NULL, '7889 Keystone Ave',
'Indianapolis', 'IN', '48741', '3173325986', NULL); Insert Into Employee_TBL Values
('443679012', 'Spurgeon', 'Tiffany', NULL, '5 George Court',
'Indianapolis', 'IN', '46234', '317569007', NULL);
INSERT INTO EMPLOYEE_PAY_TBL VALUES
('311549902', 'Marketing', '1989-05-23', NULL, '1997-05-01', '40000', NULL);
INSERT INTO EMPLOYEE_PAY_TBL VALUES
('442346889', 'Team Leader', '1990-06-17', '14.75', '1997-06-01', NULL, NULL);
INSERT INTO EMPLOYEE_PAY_TBL VALUES
('213764555', 'Sales Manager', '1994-08-14', NULL, '1997-08-01', '30000', '2000'); INSERT INTO Employee_Pay_TBL VALUES
('313782439,' Salesman ',' 1997-06-28 ', NULL, NULL,' 20000 ',' 1000 ');
INSERT INTO EMPLOYEE_PAY_TBL VALUES
('220984332', 'Shipper', '1996-07-22', '11.00', '1997-07-01', NULL, NULL); Insert Into Employee_Pay_TBL VALUES
('443679012', 'Shipper', '1991-01-14', '15.00', '1997-01-01', NULL, NULL);
INSERT INTO Customer_TBL VALUES
('232', 'leslte Gleason', '798 Hardaway DR', 'Indianapolis',
'In', '47856', '3175457690', NULL);
INSERT INTO Customer_TBL VALUES
('109', 'Nancy Bunker', 'Apt A 4556 Waterway', 'Broad Ripple',
'IN', '47950', '3174262323', NULL);
INSERT INTO Customer_TBL VALUES
('345', 'Angela Dobko', 'RR3 Box 76', 'Lebanon', 'IN', '49967',
'7858970090', null;
INSERT INTO Customer_TBL VALUES
('090', 'Wendy Wolf', '3345 Gateway DR', 'Indianapolis', 'In',
'46224', '3172913421', NULL);
INSERT INTO Customer_TBL VALUES
('12', 'Marys Gift Shop', '435 Main St', 'Danville', 'IL', '47978',
'3178567221', '3178523434');
INSERT INTO Customer_TBL VALUES
('432', 'Scott Market', 'RR2 BDX 173', 'Brownsburg', 'IN',
'45687', '3178529835', '3178529836');
INSERT INTO Customer_TBL VALUES
('333', 'JASDNS AND DALLAS Goodies', 'Lafayette SQ MALL',
'Indianapolis', 'IN', '46222', '3172978886', '3172978887'; Insert Into Customer_TBL Values
('21', 'Morgans Candies and Treats', '5657 W TENTH ST',
'Indianapolis', 'IN', '46234', '3172714398', NULL); Insert Into Customer_TBL Values
('43', 'Schylers Novelties', '17 MAPLE ST', 'Lebanon', 'IN',
'48990', '3174346758', null;
INSERT INTO Customer_TBL VALUES
('288', 'Hollys Gamerama ",' 567 US 31 South ',' Whiteland ',
'IN', '49980', '3178879023', NULL); Insert Into Customer_TBL Values
('287', 'Gavins Place', '9880Rockville Rd', 'Indianapolis',
'In', '46244', '3172719991', '3172719992'; Insert Into Customer_TBL Values
('590', 'Heathers Feathers and Things', '4090 N Shadeland Ave',
'Indianapolis', 'IN', '43278', '3175456768', NULL);
INSERT INTO Customer_TBL VALUES
('610', 'Ragans Hobbies INC', '451 Green St', 'Plainfield', 'IN',
'46818', '3178393441', '3178399090');
INSERT INTO Customer_TBL VALUES
('560', 'Andys Candies', 'RR 1 Box 34', 'Nashville', 'In',
'48756', '8123239871', null;
INSERT INTO Customer_TBL VALUES
('221', 'Ryans Stuff', '2337 S shelby St', 'Indianapolis', 'IN',
'47834', '3175634402', null);
INSERT INTO Orders_TBL VALUES
('56A901', '232', '11235', '1', '1997-10-22');
INSERT INTO Orders_TBL VALUES
('56A917', '12', '907', '100', '1997-09-30');
INSERT INTO Orders_TBL VALUES
('32A132', '43', '222', '25', '1997-10-10');
INSERT INTO Orders_TBL Values ('16C17', '090', '222', '2', '1997-10-17');
INSERT INTO Orders_TBL VALUES
('18D778', '287', '90', '10', '1997-10-17');
INSERT INTO Orders_TBL VALUES
('23E934', '432', '13', '20', '1997-10-15');
INSERT INTO PRODUCTS_TBL VALUES
('11235', 'Witches Costume', '29.99');
INSERT INTO PRODUCTS_TBL VALUES
('222', 'plastic pumpkin 18 inch', '7.75');
INSERT INTO PRODUCTS_TBL VALUES
('13', 'false Paraffin Teeth,' 1.10 ');
INSERT INTO PRODUCTS_TBL VALUES
('90', 'LIGHTED LANTERNS', '14.50');
INSERT INTO PRODUCTS_TBL VALUES
('15', 'Assorted Costumes', '10.00');
INSERT INTO PRODUCTS_TBL VALUES
('9', 'Candy Corn', '1.35');
INSERT INTO PRODUCTS_TBL VALUES
('6', 'pumpkin Candy', '1.45');
INSERT INTO PRODUCTS_TBL VALUES
('87', 'Plastic Spiders', '1.05');
INSERT INTO PRODUCTS_TBL VALUES
('119,' Assorted Masks', '4.95');