Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.29 KB | None | 0 0
  1. create table Products (
  2. product_id int,
  3. product_name varchar(255),
  4. supplier_id int,
  5. product_type varchar(255),
  6. product_price money,
  7. );
  8.  
  9. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  10. VALUES (5441, ' Apple iPhone XR' , 305, 'Apple mobile phones ', 899);
  11. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  12. VALUES (5442, 'Apple iPhone XS' , 306, 'Apple mobile phones ', 1349);
  13. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  14. VALUES (5443, ' Apple iPhone 8' , 306, 'Apple mobile phones ', 849 );
  15. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  16. VALUES (5445, 'Apple iPhone X' , 306, 'Apple mobile phones ', 1149);
  17. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  18. VALUES (5446, 'Samsung Galaxy A9' , 306, 'Samsung mobile phones ', 549);
  19. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  20. VALUES (5447, 'Samsung Galaxy J4+' , 306, 'Samsung mobile phones', 244 );
  21. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  22. VALUES (5448, 'Samsung Galaxy A6s' , 306, 'Samsung mobile phones', 422 );
  23. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  24. VALUES (5449, 'Samsung A9 Star' , 306, 'Samsung mobile phones', 710);
  25. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  26. VALUES (5450, 'Lenovo Z5 Pro' , 306, 'Lenovo mobile phones', 488 );
  27. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  28. VALUES (5451, 'Lenovo K5 Pro' , 306, 'Lenovo mobile phones', 244);
  29. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  30. VALUES (5452, 'Lenovo K5s' , 306, 'Lenovo mobile phones', 199);
  31. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  32. VALUES (5453, 'Lenovo S5 Pro ' , 306, 'Lenovo mobile phones', 311);
  33. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  34. VALUES (5454, 'Nokia X7' , 306, 'Nokia mobile phones', 444);
  35. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  36. VALUES (5455, 'Nokia 3.1 Plus' , 306, 'Nokia mobile phones', 255 );
  37. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  38. VALUES (5456, 'Nokia 7.1' , 306, 'Nokia mobile phones', 555);
  39. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  40. VALUES (5457, 'Nokia X5' , 306, 'Nokia mobile phones', 222);
  41. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  42. VALUES (5458, 'Sony Xperia XZ3' , 306, 'Sony mobile phones', 1422);
  43. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  44. VALUES (5459, 'Sony Xperia XA2 Plus' , 306, 'Sony mobile phones ', 733);
  45. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  46. VALUES (5460, 'Sony Xperia XZ2 Premium' , 306, 'Sony mobile phones ', 1444 );
  47. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  48. VALUES (5461, 'Blackberry KEY2 LE' , 306, 'Blackberry mobile phones', 666 );
  49. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  50. VALUES (5462, 'Blackberry EvolveX' , 306, 'Blackberry mobile phones', 777 );
  51. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  52. VALUES (5463, 'Blackberry Aurora' , 306, 'Blackberry mobile phones', 388 );
  53. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  54. VALUES (5463, 'Blackberry Motion' , 306, 'Blackberry mobile phones', 666);
  55. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  56. VALUES (5464, 'Asus Zenfone Max' , 306, 'Asus mobile phones', 166);
  57. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  58. VALUES (5465, 'Asus Zenfone Lite L1' , 306, 'Asus mobile phones ', 133);
  59. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  60. VALUES (5466, 'Asus Zenfone Max Plus' , 306, 'Asus mobile phones ', 399);
  61. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  62. VALUES (5467, 'Huawei Honor WaterPlay 8' , 306, 'Huawei mobile phones ', 355 );
  63. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  64. VALUES (5468, 'Huawei Honor Magic 2' , 306, 'Huawei mobile phones ', 888);
  65. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  66. VALUES (5469, 'Huawei Enjoy 9 Plus' , 306, 'Huawei mobile phones ', 422);
  67. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  68. VALUES (5470, 'Huawei Enjoy Max' , 306, 'Huawei mobile phones ', 355);
  69. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  70. VALUES (5471, 'Motorola Moto P30 Note' , 306, 'Motorola mobile phones ', 444);
  71. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  72. VALUES (5472, 'Motorola One Power' , 306, 'Motorola mobile phones ', 577);
  73. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  74. VALUES (5473, 'Motorola One' , 306, 'Motorola mobile phones ', 555);
  75. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  76. VALUES (5474, 'Motorola Moto P30' , 306, 'Motorola mobile phones ', 488);
  77. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  78. VALUES (5475, 'Motorola Moto Z3' , 306, 'Motorola mobile phones ', 733);
  79. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  80. VALUES (5476, 'LG V40 ThinQ' , 306, 'LG mobile phones ', 1555 );
  81. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  82. VALUES (5477, 'LG Q Stylus+' , 306, 'LG mobile phones ', 488);
  83. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  84. VALUES (5478, 'LG G7 Fit' , 306, 'LG mobile phones ', 555 );
  85. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price)
  86. VALUES (5479, 'Xiaomi Mi MIX 3' , 306, 'Xiaomi mobile phones', 777);
  87. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  88. VALUES (5480, 'Xiaomi Black Shark Helo' , 306, 'Xiaomi mobile phones', 866 );
  89. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  90. VALUES (5481, 'Panasonic P85 NXT' , 306, 'Panasonic mobile phones', 155 );
  91. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  92. VALUES (5482, 'Panasonic Eluga Z1 Pro' , 306, 'Panasonic mobile phones', 388 );
  93. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  94. VALUES (5483, 'Huawei WATCH GT' , 306, 'Huawei Smartwatches', 230 );
  95. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  96. VALUES (5484, 'Samsung Galaxy Watch 42mm 2018' , 306, 'Samsung Smartwatches', 349 );
  97. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  98. VALUES (5485, 'Apple Watch Series 4' , 306, 'Apple Smartwatches', 399 );
  99. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  100. VALUES (5486, 'Apple Watch Series 3' , 306, 'Apple Smartwatches', 329 );
  101. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  102. VALUES (5487, 'Samsung Gear Sport' , 306, 'Samsung Smartwatches', 399 );
  103. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  104. VALUES (5488, 'Huawei Band 3 Pro' , 306, 'Huawei Smartwatches', 113 );
  105. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  106. VALUES (5489, 'Acer Predator Helios 300 Gaming Laptop' , 306, 'Acer Laptops', 1199 );
  107. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  108. VALUES (5490, 'Acer Aspire E 15 ' , 306, 'Acer Laptops', 359 );
  109. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  110. VALUES (5491, 'Acer Flagship CB3-532 15.6"' , 306, 'Acer Laptops', 133 );
  111. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  112. VALUES (5492, 'ASUS Chromebook C202SA-YS02 11.6' , 306, 'ASUS Laptops', 218 );
  113. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  114. VALUES (5493, 'ASUS VivoBook F510UA 15.6' , 306, 'ASUS Laptops', 509 );
  115. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  116. VALUES (5494, 'ASUS C302CA-DHM4 Chromebook' , 306, 'ASUS Laptops', 474 );
  117. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  118. VALUES (5495, 'Samsung Chromebook 3' , 306, 'Samsung Laptops', 193 );
  119. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  120. VALUES (5496, 'Lenovo Ideapad 2019 15.6 HD Laptop Notebook Computer' , 306, 'Lenovo Laptops', 309 );
  121. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  122. VALUES (5497, 'ROG Zephyrus S Ultra Slim Gaming Laptop' , 306, 'ASUS Laptop', 1899 );
  123. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  124. VALUES (5498, '2018 Lenovo Flex 5 15.6' , 306, 'Lenovo Laptops', 849 );
  125. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  126. VALUES (5499, '2018 Lenovo ThinkPad T480 14' , 306, 'Lenovo Laptops', 839 );
  127. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  128. VALUES (5500, 'Razer Blade 15: Worlds Smallest 15.6' , 306, 'Razer Laptops', 1899 );
  129. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  130. VALUES (5501, 'Samsung Galaxy Tab A' , 306, 'Samsung Tablets', 250 );
  131. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  132. VALUES (5502, 'Samsung Galaxy Tab A 10.5' , 306, 'Samsung Tablets', 450 );
  133. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  134. VALUES (5503, 'Samsung Galaxy Tab S4' , 306, 'Samsung Tablets', 650 );
  135. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  136. VALUES (5504, 'Apple iPad Pro 11-inch' , 306, 'Apple Tablets', 1699 );
  137. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  138. VALUES (5505, 'Apple iPad Pro 12.9-inch (2018)' , 306, 'Apple Tablets', 1899 );
  139. INSERT INTO Products (product_id, product_name, supplier_id, product_type,product_price )
  140. VALUES (5506, 'Apple iPad 9.7-inch (2018)' , 306, 'Apple Tablets', 559 );
  141.  
  142.  
  143. Select * from Products
  144.  
  145.  
  146. -- removed product_id as it mathces product_type_id
  147.  
  148. create table Product_types (
  149. product_type_id int,
  150. product_name varchar(50),
  151. );
  152.  
  153. INSERT INTO Product_types (product_type_id, product_name )
  154. VALUES ( 10001,'Apple mobile phones');
  155. INSERT INTO Product_types (product_type_id, product_name )
  156. VALUES ( 10002,'Samsung mobile phones');
  157. INSERT INTO Product_types (product_type_id, product_name )
  158. VALUES ( 10003,'Lenovo mobile phones');
  159. INSERT INTO Product_types (product_type_id, product_name )
  160. VALUES ( 10004,'Nokia mobile phones');
  161. INSERT INTO Product_types (product_type_id, product_name )
  162. VALUES ( 10005,'Sony mobile phones');
  163. INSERT INTO Product_types (product_type_id, product_name )
  164. VALUES ( 10006,'Blackberry mobile phones');
  165. INSERT INTO Product_types (product_type_id, product_name )
  166. VALUES ( 10007,'Asus mobile phones');
  167. INSERT INTO Product_types (product_type_id, product_name )
  168. VALUES ( 10008,'Huawei mobile phones');
  169. INSERT INTO Product_types (product_type_id, product_name )
  170. VALUES (10009,'Motorola mobile phones');
  171. INSERT INTO Product_types (product_type_id, product_name )
  172. VALUES (10010,'LG mobile phones');
  173. INSERT INTO Product_types (product_type_id, product_name )
  174. VALUES (10011,'Xiaomi mobile phones');
  175. INSERT INTO Product_types (product_type_id, product_name )
  176. VALUES (10012,'Panasonic mobile phones');
  177. INSERT INTO Product_types (product_type_id, product_name )
  178. VALUES (10013,'Huawei Smartwatches');
  179. INSERT INTO Product_types (product_type_id, product_name )
  180. VALUES (10014,'Samsung Smartwatches');
  181. INSERT INTO Product_types (product_type_id, product_name )
  182. VALUES (10015,'Acer Laptops');
  183. INSERT INTO Product_types (product_type_id, product_name )
  184. VALUES (10016,'ASUS Laptops');
  185. INSERT INTO Product_types (product_type_id, product_name )
  186. VALUES (10017,'Samsung Laptops');
  187. INSERT INTO Product_types (product_type_id, product_name )
  188. VALUES (10018,'Lenovo Laptops');
  189. INSERT INTO Product_types (product_type_id, product_name )
  190. VALUES (10019,'Razer Laptops');
  191. INSERT INTO Product_types (product_type_id, product_name )
  192. VALUES (10020,'Samsung Tablets');
  193. INSERT INTO Product_types (product_type_id, product_name )
  194. VALUES (10021,'Apple Tablets');
  195.  
  196.  
  197.  
  198. select * from Product_types
  199.  
  200.  
  201. create table Suppliers (
  202. supplier_id int,
  203. supplier_name varchar(255),
  204. supplier_phone varchar(10),
  205. supplier_email varchar(255),
  206. other_details text
  207. );
  208. create table Customers (
  209. customer_id int,
  210. customer_fname varchar(50),
  211. customer_lname varchar(50),
  212. customer_phone varchar(20),
  213. customer_email varchar(50),
  214. );
  215.  
  216. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  217. VALUES (301,'Dragomir','Antonov','(0913) 107-225','zeller@sbcglobal.net');
  218. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  219. VALUES (302,'Vladislav','Valchev','(0778) 734-072','bdbrown@mac.com');
  220. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  221. VALUES (303,'Svilen','Bukhalov','(0913) 107-225','suresh@comcast.net');
  222. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  223. VALUES (304,'Tihomir','Mladenov','(0544) 842 454','saridder@me.com');
  224. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  225. VALUES (305,'Hristo','Penchev','+359(0)723 363 416','webinc@yahoo.ca');
  226. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  227. VALUES (306,'Lyutskan','Vitanov','0159 471882','budinger@me.com');
  228. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  229. VALUES (307,'Zayko','Georgiev','0948 529-784','noodles@yahoo.ca');
  230. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  231. VALUES (308,'Vezenko','Mihailov','0373061973','mrsam@gmail.com');
  232. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  233. VALUES (309,'Zhelyazko','Svetkov','+359(0)137 221087','goresky@aol.com');
  234. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  235. VALUES (310,'Kaloyan','Gavrilov','0641 685879','citizenl@msn.com');
  236. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  237. VALUES (311,'Dako','Karapetrov','(0616) 952 115','engelen@me.com');
  238. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  239. VALUES (312,'Preslava','Teodorova','(0978) 055279','mahbub@att.net');
  240. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  241. VALUES (313,'Trayana','Zdravkova','0255841577','jguyer@verizon.net');
  242. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  243. VALUES (314,'Plamena','Nikolova','(0774) 134403','research@me.com');
  244. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  245. VALUES (315,'Branimira','Yankova','0695168677','parasite@icloud.com');
  246. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  247. VALUES (316,'Assen ','Savov','(0651) 216 260','lstaf@gmail.com');
  248. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  249. VALUES (317,'Bilka','Ivanova','(0322) 137 8515','hamilton@comcast.net');
  250. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  251. VALUES (318,'Stoyan','Kamenov','(0599) 738 276','breegster@gmail.com');
  252. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  253. VALUES (319,'Detelin','Atanasov','+359410879882','dkasak@live.com');
  254. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  255. VALUES (320,'Emil','Tanev','(0653) 900-916','bulletin@yahoo.ca');
  256. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  257. VALUES (321,'Mitko','Evgeniev','+359252691883','dburrows@comcast.net');
  258. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  259. VALUES (322,'Kostadin','Iliev','(0642) 336-656','cliffski@optonline.net');
  260. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  261. VALUES (323,'Krasimir ','Mihaelov','+359410879882','guialbu@msn.com');
  262. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  263. VALUES (324,'Galin','Bozhidarov','+359830757245','airship@icloud.com');
  264. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  265. VALUES (325,'Ventsislav','Hadjiev','(0750) 631-825','ninenine@aol.com');
  266. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  267. VALUES (326,'Bogomil','Samuilov','0984 247-661','giafly@msn.com');
  268. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  269. VALUES (327,'Blaga','Dimitrova','(0339) 465-680','jimmichie@verizon.net');
  270. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  271. VALUES (328,'Zornitsa','Todorova','0240 723-634','heine@att.net');
  272. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  273. VALUES (329,'Miroslava ',' Popova','(0387) 211681','kayvonf@yahoo.com');
  274. INSERT INTO Customers(customer_id , customer_fname,customer_lname,customer_phone,customer_email )
  275. VALUES (30,'Nadezhda ','Dineva','8008135','notfake@gmail.com');
  276.  
  277. select * from Customers
  278.  
  279.  
  280.  
  281. create table Orders (
  282. order_id int,
  283. customer_id int,
  284. order_day_date date,
  285. );
  286. create table Customer_addresses (
  287. customer_address_id int,
  288. customer_id int,
  289. address_id int,
  290. );
  291. create table Order_items (
  292. order_id int,
  293. product_id int,
  294. quantity int
  295. );
  296. create table Deliveries (
  297. delivery_id int,
  298. delivered_by_employee_id int,
  299. order_id int,
  300. delivery_date_time date,
  301. other_delivery_details text
  302. );
  303. create table Employees (
  304. employee_id int,
  305. employee_name varchar(255),
  306. employee_phone varchar(10),
  307. other_employee_details text
  308. );
  309. create table Calendar (
  310. day_date date,
  311. day_of_the_week varchar(10)
  312. );
  313. create table Addresses (
  314. steet varchar(50),
  315. city varchar(20),
  316. country varchar(20),
  317. other_address_details text
  318. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement