-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.sql
More file actions
176 lines (164 loc) · 14.9 KB
/
insert.sql
File metadata and controls
176 lines (164 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
create table authors ( au_id uint, au_lname str, au_fname str, phone str, address str, city str, state str, zip str)
insert into authors values(1, 'Bennet', 'Abraham', '415 658-9932', '6223 Bateman St.', 'Berkeley', 'CA', '94705')
insert into authors values(2, 'Green', 'Marjorie', '415 986-7020', '309 63rd St. #411', 'Oakland', 'CA', '94618')
insert into authors values(3, 'Carson', 'Cheryl', '415 548-7723', '589 Darwin Ln.', 'Berkeley', 'CA', '94705')
insert into authors values(4, 'Ringer', 'Albert', '801 826-0752', '67 Seventh Av.', 'Salt Lake City', 'UT', '84152')
insert into authors values(5, 'Ringer', 'Anne', '801 826-0752', '67 Seventh Av.', 'Salt Lake City', 'UT', '84152')
insert into authors values(6, 'DeFrance', 'Michel', '219 547-9982', '3 Balding Pl.', 'Gary', 'IN', '46403')
insert into authors values(7, 'Panteley', 'Sylvia', '301 946-8853', '1956 Arlington Pl.', 'Rockville', 'MD', '20853')
insert into authors values(8, 'McBadden', 'Heather', '707 448-4982', '301 Putnam', 'Vacaville', 'CA', '95688')
insert into authors values(9, 'Stringer', 'Dirk', '415 843-2991', '5420 Telegraph Av.', 'Oakland', 'CA', '94609')
insert into authors values(10, 'Straight', 'Dean', '415 834-2919', '5420 College Av.', 'Oakland', 'CA', '94609')
insert into authors values(11, 'Karsen', 'Livia', '415 534-9219', '5720 McAuley St.', 'Oakland', 'CA', '94609')
insert into authors values(12, 'MacFeather', 'Stearns', '415 354-7128', '44 Upland Hts.', 'Oakland', 'CA', '94612')
insert into authors values(13, 'Dull', 'Ann', '415 836-7128', '3410 Blonde St.', 'Palo Alto', 'CA', '94301')
insert into authors values(14, 'Yokomoto', 'Akiko', '415 935-4228', '3 Silver Ct.', 'Walnut Creek', 'CA', '94595')
insert into authors values(15, 'O`Leary', 'Michael', '408 286-2428', '22 Cleveland Av. #14', 'San Jose', 'CA', '95128')
insert into authors values(16, 'Gringlesby', 'Burt', '707 938-6445', 'PO Box 792', 'Covelo', 'CA', '95428')
insert into authors values(17, 'Greene', 'Morningstar', '615 297-2723', '22 Graybar House Rd.', 'Nashville', 'TN', '37215')
insert into authors values(18, 'White', 'Johnson', '408 496-7223', '10932 Bigge Rd.', 'Menlo Park', 'CA', '94025')
insert into authors values(19, 'del Castillo', 'Innes', '615 996-8275', '2286 Cram Pl. #86', 'Ann Arbor', 'MI', '48105')
insert into authors values(20, 'Hunter', 'Sheryl', '415 836-7128', '3410 Blonde St.', 'Palo Alto', 'CA', '94301')
insert into authors values(21, 'Locksley', 'Charlene', '415 585-4620', '18 Broadway Av.', 'San Francisco', 'CA', '94130')
insert into authors values(22, 'Blotchet-Halls', 'Reginald', '503 745-6402', '55 Hillsdale Bl.', 'Corvallis', 'OR', '97330')
insert into authors values(23, 'Smith', 'Meander', '913 843-0462', '10 Mississippi Dr.', 'Lawrence', 'KS', '66044')
create table publishers (pub_id uint, pub_name str, city str, state str, country str)
insert into publishers values(1, 'New Moon Books', 'Boston', 'MA', 'USA')
insert into publishers values(2, 'Binnet & Hardley', 'Washington', 'DC', 'USA')
insert into publishers values(3, 'Algodata Infosystems', 'Berkeley', 'CA', 'USA')
insert into publishers values(4, 'Scootney Books', 'New York', 'NY', 'USA')
insert into publishers values(5, 'Five Lakes Publishing', 'Chicago', 'IL', 'USA')
insert into publishers values(6, 'Ramona Publishers', 'Dallas', 'TX', 'USA')
insert into publishers values(7, 'GGG&G', 'Mnchen', NULL, 'Germany')
insert into publishers values(8, 'Lucerne Publishing', 'Paris', NULL, 'France')
create table titles(title_id uint, title str, type str, pub_id str, price num, advance num, royalty int, ytd_sales int, notes str, pubdate str)
insert into titles values (1, 'Secrets of Silicon Valley', 'popular_comp', '1389', 20.00, 8000.00, 10, 4095, 'Muckraking reporting on the world`s largest computer hardware and software manufacturers.', '06/12/94')
insert into titles values (2, 'The Busy Executive`s Database Guide', 'business', '1389', 19.99, 5000.00, 10, 4095, 'An overview of available database systems with emphasis on common business applications. Illustrated.', '06/12/91')
insert into titles values (3, 'Emotional Security: A New Algorithm', 'psychology', '0736', 7.99, 4000.00, 10, 3336, 'Protecting yourself and your loved ones from undue emotional stress in the modern world. Use of computer and nutritional aids emphasized.', '06/12/91')
insert into titles values (4, 'Prolonged Data Deprivation: Four Case Studies', 'psychology', '0736', 19.99, 2000.00, 10, 4072, 'What happens when the data runs dry? Searching evaluations of information-shortage effects.', '06/12/91')
insert into titles values (5, 'Cooking with Computers: Surreptitious Balance Sheets', 'business', '1389', 11.95, 5000.00, 10, 3876, 'Helpful hints on how to use your electronic resources to the best advantage.', '06/09/91')
insert into titles values (6, 'Silicon Valley Gastronomic Treats', 'mod_cook', '0877', 19.99, 0.00, 12, 2032, 'Favorite recipes for quick, easy, and elegant meals.', '06/09/91')
insert into titles values (7, 'Sushi, Anyone?', 'trad_cook', '0877', 14.99, 8000.00, 10, 4095, 'Detailed instructions on how to make authentic Japanese sushi in your spare time.', '06/12/91')
insert into titles values (8, 'Fifty Years in Buckingham Palace Kitchens', 'trad_cook', '0877', 11.95, 4000.00, 14, 15096, 'More anecdotes from the Queen`s favorite cook describing life among English royalty. Recipes, techniques, tender vignettes.', '06/12/91')
insert into titles values (9, 'But Is It User Friendly?', 'popular_comp', '1389', 22.95, 7000.00, 16, 8780, 'A survey of software for the naive user, focusing on the `friendliness` of each.', '06/30/91')
insert into titles values(10, 'You Can Combat Computer Stress!', 'business', '0736', 2.99, 10125.00, 24, 18722, 'The latest medical and psychological techniques for living with the electronic office. Easy-to-understand explanations.', '06/30/91')
insert into titles values(11, 'Is Anger the Enemy?', 'psychology', '0736', 10.95, 2275.00, 12, 2045, 'Carefully researched study of the effects of strong emotions on the body. Metabolic charts included.', '06/15/91')
insert into titles values(12, 'Life Without Fear', 'psychology', '0736', 7.00, 6000.00, 10, 111, 'New exercise, meditation, and nutritional techniques that can reduce the shock of daily interactions. Popular audience. Sample menus included, exercise video available separately.', '10/05/91')
insert into titles values(13, 'The Gourmet Microwave', 'mod_cook', '0877', 2.99, 15000.00, 24, 22246, 'Traditional French gourmet recipes adapted for modern microwave cooking.', '06/18/91')
insert into titles values(14, 'Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean', 'trad_cook', '0877', 20.95, 7000.00, 10, 375, 'Profusely illustrated in color, this makes a wonderful gift book for a cuisine-oriented friend.', '10/21/91')
insert into titles (title_id, title, pub_id) values(15, 'The Psychology of Computer Cooking', '0877')
insert into titles values (16, 'Straight Talk About Computers', 'business', '1389', 19.99, 5000.00, 10, 4095, 'Annotated analysis of what computers can do for you: a no-hype guide for the critical user.', '06/22/91')
insert into titles values(17, 'Computer Phobic AND Non-Phobic Individuals: Behavior Variations', 'psychology', '0877', 21.59, 7000.00, 10, 375, 'A must for the specialist, this book examines the difference between those who hate and fear computers and those who don`t.', '10/21/91')
insert into titles (title_id, title, type, pub_id, notes) values(19, 'Net Etiquette', 'popular_comp', '1389', 'A must-read for computer conferencing.')
create table titleauthor (au_id int, title_id int, au_ord int, royaltyper int)
insert into titleauthor values(1, 1, 1, 60)
insert into titleauthor values(1, 2, 1, 100)
insert into titleauthor values(1, 3, 1, 100)
insert into titleauthor values(1, 4, 1, 100)
insert into titleauthor values(1, 5, 1, 100)
insert into titleauthor values(1, 6, 2, 40)
insert into titleauthor values(1, 7, 1, 100)
insert into titleauthor values(1, 8, 1, 100)
insert into titleauthor values(1, 9, 1, 50)
insert into titleauthor values(10, 10, 2, 50)
insert into titleauthor values(11, 11, 1, 100)
insert into titleauthor values(12, 12, 1, 75)
insert into titleauthor values(13, 13, 2, 25)
insert into titleauthor values(14, 14, 1, 100)
insert into titleauthor values(15, 15, 1, 100)
insert into titleauthor values(16, 16, 1, 50)
insert into titleauthor values(17, 17, 2, 50)
insert into titleauthor values(18, 18, 1, 75)
insert into titleauthor values(19, 19, 2, 25)
insert into titleauthor values(20, 20, 1, 60)
insert into titleauthor values(21, 21, 2, 40)
insert into titleauthor values(22, 22, 1, 40)
insert into titleauthor values(23, 23, 2, 30)
insert into titleauthor values(24, 24, 3, 30)
insert into titleauthor values(25, 25, 1, 100)
create table stores (stor_id str, stor_name str, stor_address str, city str, state str, zip str)
insert into stores values('7066','Barnums','567 Pasadena Ave.','Tustin','CA','92789')
insert into stores values('7067','News & Brews','577 First St.','Los Gatos','CA','96745')
insert into stores values('7131','Doc-U-Mat: Quality Laundry and Books', '24-A Avogadro Way','Remulade','WA','98014')
insert into stores values('8042','Bookbeat','679 Carson St.','Portland','OR','89076')
insert into stores values('6380','Eric the Read Books','788 Catamaugus Ave.', 'Seattle','WA','98056')
insert into stores values('7896','Fricative Bookshop','89 Madison St.','Fremont','CA','90019')
create table sales(stor_id str, ord_num str, ord_date str, qty int, payterms str, title_id int)
insert into sales values('7066', 'QA7442.3', '09/13/94', 75, 'ON invoice',1)
insert into sales values('7067', 'D4482', '09/14/94', 10, 'Net 60',2)
insert into sales values('7131', 'N914008', '09/14/94', 20, 'Net 30',3)
insert into sales values('7131', 'N914014', '09/14/94', 25, 'Net 30',4)
insert into sales values('8042', '423LL922', '09/14/94', 15, 'ON invoice',5)
insert into sales values('8042', '423LL930', '09/14/94', 10, 'ON invoice',6)
insert into sales values('6380', '722a', '09/13/94', 3, 'Net 60',8)
insert into sales values('6380', '6871', '09/14/94', 5, 'Net 60',9)
insert into sales values('8042','P723', '03/11/93', 25, 'Net 30', 10)
insert into sales values('7896','X999', '02/21/93', 35, 'ON invoice', 11)
insert into sales values('7896','QQ2299', '10/28/93', 15, 'Net 60', 12)
insert into sales values('7896','TQ456', '12/12/93', 10, 'Net 60', 13)
insert into sales values('8042','QA879.1', '5/22/93', 30, 'Net 30', 14)
insert into sales values('7066','A2976', '5/24/93', 50, 'Net 30', 15)
insert into sales values('7131','P3087a', '5/29/93', 20, 'Net 60', 16)
insert into sales values('7131','P3087a', '5/29/93', 25, 'Net 60', 17)
insert into sales values('7131','P3087a', '5/29/93', 15, 'Net 60', 18)
insert into sales values('7131','P3087a', '5/29/93', 25, 'Net 60', 19)
insert into sales values('7067','P2121', '6/15/92', 40, 'Net 30', 20)
insert into sales values('7067','P2121', '6/15/92', 20, 'Net 30', 21)
insert into sales values('7067','P2121', '6/15/92', 20, 'Net 30', 22)
create table roysched(title_id int, lorange int, hirange int, royalty int)
insert into roysched values(1, 0, 5000, 10)
insert into roysched values(2, 5001, 50000, 12)
insert into roysched values(3, 0, 2000, 10)
insert into roysched values(4, 2001, 3000, 12)
insert into roysched values(5, 3001, 4000, 14)
insert into roysched values(6, 4001, 10000, 16)
insert into roysched values(7, 10001, 50000, 18)
insert into roysched values(8, 0, 1000, 10)
insert into roysched values(8, 1001, 3000, 12)
insert into roysched values(8, 3001, 5000, 14)
create table discounts(discounttype str, stor_id str, lowqty int, highqty int, discount num)
insert into discounts values('Initial Customer', NULL, NULL, NULL, 10.5)
insert into discounts values('Volume Discount', NULL, 100, 1000, 6.7)
insert into discounts values('Customer Discount', '8042', NULL, NULL, 5.0)
create table jobs(job_id uint, job_desc str, min_lvl int, max_lvl int)
insert into jobs values (1, 'New Hire - Job not specified', 10, 10)
insert into jobs values (2, 'Chief Executive Officer', 200, 250)
insert into jobs values (3, 'Business Operations Manager', 175, 225)
insert into jobs values (4, 'Chief Financial Officier', 175, 250)
insert into jobs values (5, 'Publisher', 150, 250)
insert into jobs values (6, 'Managing Editor', 140, 225)
insert into jobs values (7, 'Marketing Manager', 120, 200)
insert into jobs values (8, 'Public Relations Manager', 100, 175)
insert into jobs values (9, 'Acquisitions Manager', 75, 175)
insert into jobs values (10, 'Productions Manager', 75, 165)
insert into jobs values (11, 'Operations Manager', 75, 150)
insert into jobs values (12, 'Editor', 25, 100)
insert into jobs values (13, 'Sales Representative', 25, 100)
insert into jobs values (14, 'Designer', 25, 100)
create table pub_info(pub_id str, pr_info str)
insert into pub_info values('0736', 'x474946383961D3001F00B30F00000000800000008000808000000080')
insert into pub_info values('9952', 'x4749463DBA1319000000000000000000000000000000000900000000')
insert into pub_info values('1622', 'x474946383961D3001F00B30F00000000800000008000808000000080')
insert into pub_info values('9999', 'x474946383961D3001F00B30F00000000800000008000808000000080')
insert into pub_info values('0877', 'x474946383961D3001F00B30F00000000800000008000808000000080')
create table employee(emp_id uint, fname str, minit str, lname str, job_id int, job_lvl int, pub_id str, hire_date str)
insert into employee values (1, 'Philip', 'T', 'Cramer', 2, 215, '9952', '11/11/89')
insert into employee values (2, 'Ann', 'M', 'Devon', 3, 200, '9952', '07/16/91')
insert into employee values (3, 'Francisco', '', 'Chang', 4, 227, '9952', '11/03/90')
insert into employee values (4, 'Laurence', 'A', 'Lebihan', 5, 175, '0736', '06/03/90')
insert into employee values (5, 'Paul', 'X', 'Henriot', 5, 159, '0877', '08/19/93')
insert into employee values (6, 'Sven', 'K', 'Ottlieb', 5, 150, '1389', '04/05/91')
insert into employee values (7, 'Rita', 'B', 'Muller', 5, 198, '1622', '10/09/93')
insert into employee values (8, 'Maria', 'J', 'Pontes', 5, 246, '1756', '03/01/89')
insert into employee values (9, 'Janine', 'Y', 'Labrune', 5, 172, '9901', '05/26/91')
insert into employee values (10, 'Carlos', 'F', 'Hernadez', 5, 211, '9999', '04/21/89')
insert into employee values (11, 'Victoria', 'P', 'Ashworth', 6, 140, '0877', '09/13/90')
insert into employee values (12, 'Lesley', '', 'Brown', 7, 120, '0877', '02/13/91')
insert into employee values (13, 'Anabela', 'R', 'Domingues', 8, 100, '0877', '01/27/93')
insert into employee values (14, 'Martine', '', 'Rance', 9, 75, '0877', '02/05/92')
insert into employee values (15, 'Peter', 'H', 'Franken', 10, 75, '0877', '05/17/92')
insert into employee values (16, 'Daniel', 'B', 'Tonini', 11, 75, '0877', '01/01/90')
insert into employee values (17, 'Helen', '', 'Bennett', 12, 35, '0877', '09/21/89')
insert into employee values (18, 'Paolo', 'M', 'Accorti', 13, 35, '0877', '08/27/92')
insert into employee values (19, 'Elizabeth', 'N', 'Lincoln', 14, 35, '0877', '07/24/90')
select au_lname, au_fname, title from authors join titleauthor on au_id=au_id join titles on title_id=title_id where city='Berkeley' limit 100