Advertisement
IT-Academy

DB + TB Customers

Jul 31st, 2018
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 11.39 KB | None | 0 0
  1. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  2. SET time_zone = "+00:00";
  3.  
  4. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  5. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  6. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  7. /*!40101 SET NAMES utf8 */;
  8.  
  9. CREATE DATABASE IF NOT EXISTS `store` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
  10. USE `store`;
  11.  
  12. CREATE TABLE IF NOT EXISTS `customers` (
  13.   `id` int(11) NOT NULL,
  14.   `name` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
  15.   `address` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
  16.   `city` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  17.   `state` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  18.   `zip` int(11) NOT NULL
  19. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  20.  
  21. INSERT INTO `customers` (`id`, `name`, `address`, `city`, `state`, `zip`) VALUES
  22. (1, 'Adam Sangala', '32 Hafe Ave', 'Adams', 'NY', 13605),
  23. (2, 'Noah Parker', '342 Tunafish Lane', 'Raleigh', 'NC', 27606),
  24. (3, 'Kelsey Burger', '43 Crab Orchard Dr', 'Oakland', 'CA', 90210),
  25. (4, 'Corey Smith', '423 Wisteria Lane', 'Simmersville', 'AK', 54112),
  26. (5, 'Harry Potter', '673 Greenwich Ave', 'Newark', 'NJ', 80432),
  27. (6, 'Henry Jackson', '2134 Grant St', 'Gary', 'IN', 47404),
  28. (7, 'Cynthia Alvarez', '1568 Greenfield Ave', 'Augusta', 'GA', 30568),
  29. (8, 'Teresa Smith', '8725 Black St', 'Philadelphia', 'PA', 19603),
  30. (9, 'Gary Foster', '3752 Wittfield Blvd', 'Indianapolis', 'IN', 46219),
  31. (10, 'Sherry Gibbons', '5517 Oak St', 'Phoenix', 'AZ', 85072),
  32. (11, 'Jack Nicholson', '1234 Star Lane', 'Hollywood', 'CA', 90210),
  33. (12, 'Penny Green', '4972 Massachusetts Ave', 'Orlando', 'FL', 33718),
  34. (13, 'Alexander Evans', '6310 E 21st Rd', 'Las Vegas', 'NV', 83594),
  35. (14, 'Jeremy White', '3954 Brentwood Dr', 'Seattle', 'WA', 99037),
  36. (15, 'Omar Badshah', '6801 Regina Cir', 'Madison', 'WI', 53209),
  37. (16, 'Preston Harrison', '104 Main St', 'Denver', 'CO', 81712),
  38. (17, 'Manuel Rodriguez', '99543 Westin Blvd', 'Provo', 'UT', 85478),
  39. (18, 'David Jones', '5488 W 34th St', 'Boston', 'MA', 2104),
  40. (19, 'Nick Flanders', '3486 Happy Trails Dr', 'Springfield', 'OH', 45872),
  41. (20, 'Paul Brown', '3290 Pennsylvania Ave', 'Chicago', 'IL', 61208),
  42. (21, 'Sara Rehm', '7746 Wysong Ave', 'Detroit', 'MI', 48913),
  43. (22, 'Haley Carter', '2957 Princess Way', 'Portland', 'OR', 97532),
  44. (23, 'Julian Thomas', '5564 Dandy Trail', 'Santa Fe', 'NM', 81543),
  45. (24, 'George Lucas', '8224 Star Wars Ln', 'Galaxy', 'TN', 37512),
  46. (25, 'Perry Jordan', '4321 Victory Rd', 'Montgomery', 'AL', 33219),
  47. (26, 'Christopher Layton', '871 Georgia Pl', 'Houston', 'TX', 78704),
  48. (27, 'Devon Myers', '9932 Carmel Dr', 'New York', 'NY', 11920),
  49. (28, 'Debra Talkington', '8421 Smithfield Ave', 'Mesa', 'AZ', 82573),
  50. (29, 'Peter Johnson', '4213 Jones Pkwy', 'Missoula', 'MS', 37228),
  51. (30, 'Harry Brown', '125 Cinnamon Way', 'Raleigh', 'NC', 27418),
  52. (31, 'Kay Billings', '4592 Jessica Ave', 'Cincinnati', 'OH', 43118),
  53. (32, 'Desmond Rafferty', '6329 Jordan St', 'San Diego', 'CA', 93980),
  54. (33, 'Lisa Washington', '3490 Dearborn Ave', 'Boise', 'ID', 84930),
  55. (34, 'Jackson Taylor', '7733 Miami Way', 'Atlanta', 'GA', 37544),
  56. (35, 'Michael Davis', '9245 Olney Ave', 'Eau Claire', 'WI', 54732),
  57. (36, 'Candice Thompson', '3122 Ebony Blvd', 'Memphis', 'TN', 33152),
  58. (37, 'Terry Mitchell', '7438 Tacoma St', 'Spokane', 'WA', 99753),
  59. (38, 'Ruth Bolen', '5584 Frigid Ln', 'Anchorage', 'AK', 99831),
  60. (39, 'James Hamilton', '449 Routiers Ave', 'Ft Lauderdale', 'FL', 33912),
  61. (40, 'Harvey Akins', '7950 Ridge Rd', 'Newark', 'NJ', 2753),
  62. (41, 'Timothy Smothers', '5892 Maple Ave', 'Washington', 'DC', 213),
  63. (42, 'Stephanie Nichols', '2275 Apple St', 'Highland', 'MI', 49003),
  64. (43, 'Ken Davidson', '1583 N 27th Rd', 'Dallas', 'TX', 78432),
  65. (44, 'Angel Martin', '3195 Mapleton Ave', 'Providence', 'RI', 8132),
  66. (45, 'Cathy Douglas', '8934 Glory St', 'Boulder', 'CO', 89578),
  67. (46, 'Kendall Norton', '8733 Jordan Ave', 'Kansas City', 'KS', 66555),
  68. (47, 'Desire Morton', '2138 Peaches Way', 'Ellettsville', 'IL', 67330),
  69. (48, 'Patty Zrock', '7397 Happy St', 'Brooklyn', 'NY', 13420),
  70. (49, 'Evan Bayh', '6613 North St', 'Miami', 'FL', 33990),
  71. (50, 'Kevin Masters', '91350 Carmel Dr', 'Brisket', 'WY', 80154),
  72. (51, 'Paula Barker', '6528 Prozac Ave', 'San Francisco', 'CA', 92953),
  73. (52, 'John Jacobs', '2957 Ashway Ct', 'Pittsburgh', 'PA', 18320),
  74. (53, 'Dana Brunswick', '4825 Polly Ln', 'Las Vegas', 'NV', 89223),
  75. (54, 'David Turner', '743 Main St', 'Knoxville', 'TN', 37710),
  76. (55, 'Michael Orlando', '1355 Joseph Way', 'Pensacola', 'FL', 31552),
  77. (56, 'Terry Green', '6320 LaSalle St', 'Yazoo', 'MS', 30428),
  78. (57, 'Greg Evans', '2294 South St', 'Indianapolis', 'IN', 46203),
  79. (58, 'Sandy Johnson', '5319 Brentwood Dr', 'Louisville', 'KY', 41350),
  80. (59, 'Charlie Jones', '5382 Miracle Ln', 'New Orleans', 'LA', 73210),
  81. (60, 'Kevin Grier', '855 Henry St', 'Provo', 'UT', 83111),
  82. (61, 'Lani Kulana', '3352 Hibiscus Ln', 'Honolulu', 'HI', 93525),
  83. (62, 'Mary Worley', '4291 Cherry St', 'Oaktown', 'NH', 5308),
  84. (63, 'Tanya Gleason', '7315 Franklin Rd', 'Peoria', 'IL', 66514),
  85. (64, 'Donna Bradley', '2753 Florida Way', 'San Jose', 'CA', 91342),
  86. (65, 'Jimmy Lawson', '9 Corporate Dr', 'Excelsior', 'GA', 37833),
  87. (66, 'Brenda Fowler', '8447 Jackson Pl', 'St Louis', 'MO', 63153),
  88. (67, 'Karen Mills', '9077 Cumberland Way', 'Tulsa', 'OK', 74319),
  89. (68, 'Aretha Gordon', '1489 Pumpkin Ave', 'Appleton', 'WI', 54310),
  90. (69, 'Carol Brown', '6225 Tamiami Trl', 'Ft Myers', 'FL', 33914),
  91. (70, 'Jerry Freeman', '7840 Princess Dr', 'Topeka', 'KS', 63330),
  92. (71, 'LuAnn Dennis', '5602 Norman St', 'Philadelphia', 'PA', 17569),
  93. (72, 'Thomas Jackson', '3958 Breen Ave', 'Mobile', 'AL', 34558),
  94. (73, 'Marilyn Pritchett', '1468 Duncan St', 'Trenton', 'NJ', 7104),
  95. (74, 'Katherine Cain', '4388 Drysdale Ln', 'Texarkana', 'AR', 77315),
  96. (75, 'Patsy Cline', '9926 Hemingway Blvd', 'Tuscaloosa', 'CA', 97221),
  97. (76, 'Kerry Jackson', '5533 Penelope St', 'Beaverton', 'OR', 91353),
  98. (77, 'Princess Wilson', '3127 Spencer Dr', 'Norton', 'sC', 27384),
  99. (78, 'Henry Fisk', '6341 Wilmington Ave', 'Lincoln', 'NE', 70011),
  100. (79, 'Jessica Grant', '2203 Pansy Ln', 'Butte', 'MT', 54438),
  101. (80, 'Joe Franklin', '1078 Dusky Dr', 'Independence', 'IN', 46935),
  102. (81, 'Larry Hood', '3522 Potter St', 'Marietta', 'GA', 37023),
  103. (82, 'Jim OBrien', '6084 Maple St', 'Boston', 'MA', 1358),
  104. (83, 'Tanya Hicks', '1487 Potter St', 'Orlando', 'FL', 34258),
  105. (84, 'Dean Williams', '2279 Gray St', 'Roanoke', 'VA', 27384),
  106. (85, 'Jason Freeman', '4301 Perry Ave', 'Lincoln', 'NE', 67301),
  107. (86, 'Katy Smith', '8733 Johnson Way', 'Santa Fe', 'NM', 80227),
  108. (87, 'Andy Jones', '5177 US 42 S', 'Paragon', 'MI', 48203),
  109. (88, 'Crystal Jarvis', '9028 Indiana Ave', 'Tuscaloosa', 'AL', 32784),
  110. (89, 'Elizabeth McMurray', '730 Walnut St', 'Mooresville', 'WI', 53802),
  111. (90, 'Cassandra Tansy', '1209 Broadway St', 'Bloomington', 'IN', 46801),
  112. (91, 'Dick Moore', '3209 Simpson Rd', 'New York', 'NY', 10220),
  113. (92, 'Marisa Rodriguez', '873 Olney Ave', 'Muncie', 'VA', 20384),
  114. (93, 'Tyrone Jackson', '7725 Georgia St', 'Salt Lake City', 'UT', 82004),
  115. (94, 'Donald Gray', '8339 Olivia St', 'Champaign', 'IL', 60337),
  116. (95, 'Victoria Jameson', '2804 Oak Tree St', 'Salina', 'KS', 67905),
  117. (96, 'Lucy Bronson', '5336 Michigan Ave', 'Wilmington', 'DE', 1903);
  118.  
  119. CREATE TABLE IF NOT EXISTS `items` (
  120.   `id` int(11) NOT NULL,
  121.   `name` varchar(65) COLLATE utf8_unicode_ci NOT NULL,
  122.   `cost` float NOT NULL,
  123.   `seller_id` int(11) NOT NULL,
  124.   `bids` int(11) NOT NULL
  125. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  126.  
  127. INSERT INTO `items` (`id`, `name`, `cost`, `seller_id`, `bids`) VALUES
  128. (1, 'Brand New iMac Computer', 149.99, 32, 3),
  129. (2, 'used diaper from my sister', 2.04, 1, 0),
  130. (3, 'Fresh apple pie', 14.99, 54, 32),
  131. (4, 'New gym socks', 2.34, 90, 566),
  132. (5, 'Weedwacker only slightly used', 4.56, 84, 2),
  133. (6, 'New ipad stolen from best buy', 399, 32, 23),
  134. (7, 'Book about having babies', 21.34, 44, 21),
  135. (8, 'Woman Jeans', 49.5, 56, 123),
  136. (9, 'traditional carpet', 25.45, 14, 75),
  137. (10, '3 boxes of frogs', 30.49, 68, 145),
  138. (11, '48 boxes of frogs', 74.29, 6, 99),
  139. (12, '7 boxes of frogs', 857.75, 18, 88),
  140. (13, 'laptop', 743.3, 89, 158),
  141. (14, 'thumbelina', 228.05, 15, 49),
  142. (15, 'bed', 127.15, 65, 189),
  143. (16, 'shampoing', 12.8, 6, 105),
  144. (17, 'stove', 37.66, 68, 111),
  145. (18, 'cushion', 7.15, 97, 157),
  146. (19, 'refrigerator', 657.49, 61, 129),
  147. (20, 'gold necklace', 853.07, 10, 101),
  148. (21, 'pan', 33.7, 7, 184),
  149. (22, 'awesome alien computer game', 10.75, 18, 29),
  150. (23, 'baby coat', 89.99, 14, 47),
  151. (24, 'baby seat', 145.78, 2, 199),
  152. (25, 'satchel', 44.71, 15, 66),
  153. (26, 'women perfum', 110.9, 48, 84),
  154. (27, 'conveyor belt', 1120.75, 11, 4),
  155. (28, 'used car', 5700.5, 12, 135),
  156. (29, 'supercomputer', 49.75, 50, 176),
  157. (30, 'mirror', 26.8, 19, 56),
  158. (31, 'piano', 1800.4, 13, 147),
  159. (32, 'quitar', 88.4, 25, 164),
  160. (33, 'trumpet', 255.15, 36, 23),
  161. (34, 'machintosh', 3845, 20, 107),
  162. (35, 'earphone', 10.5, 17, 110),
  163. (36, 'computer', 418, 11, 152),
  164. (37, 'night light', 13.87, 97, 198),
  165. (38, 'pc bag', 50.99, 48, 65),
  166. (39, 'babyfoot', 376.7, 2, 121),
  167. (40, 'hairdryer', 88.9, 12, 177),
  168. (41, 'babyliss', 130.75, 68, 79),
  169. (42, 'door', 150.5, 98, 13),
  170. (43, 'baby soap', 12.7, 4, 198),
  171. (44, 'used phone', 43.75, 9, 69),
  172. (45, 'bath', 757.15, 96, 55),
  173. (46, 'flower', 10.75, 16, 89),
  174. (47, 'battery charger', 48.75, 25, 87),
  175. (48, 'air conditioner', 975, 12, 151),
  176. (49, 'casserole', 115.75, 46, 35),
  177. (50, 'used toilet', 180.7, 64, 11),
  178. (51, 'teashirt', 14.98, 65, 114),
  179. (52, 'moto', 920, 22, 174),
  180. (53, 'saxophone', 220.9, 60, 140),
  181. (54, 'bicycle', 180.55, 97, 35),
  182. (55, 'man perfum', 95, 75, 199),
  183. (56, 'table', 157.25, 91, 48),
  184. (57, 'boat', 4890.5, 17, 177),
  185. (58, 'iphone', 547, 8, 28),
  186. (59, 'body milk', 50.5, 16, 90),
  187. (60, 'new curtain for bedroom', 278.4, 92, 11),
  188. (61, 'diamond ring', 1900, 15, 45),
  189. (62, 'swept', 4.5, 9, 99),
  190. (63, 'women hat', 17.55, 39, 60),
  191. (64, 'washing machine', 680.9, 42, 125),
  192. (65, 'baby bottle', 27.98, 91, 117),
  193. (66, 'women sun glasses', 66.7, 18, 174),
  194. (67, 'person weighs', 65.25, 10, 100),
  195. (68, 'photo frame', 18, 85, 170),
  196. (69, 'key board', 16.7, 90, 101),
  197. (70, 'screen', 250, 81, 188),
  198. (71, 'bucket', 2.5, 1, 19),
  199. (72, 'lipstick', 24.75, 3, 44),
  200. (73, 'wardrobe', 120.75, 9, 71),
  201. (74, 'blue dress size 40', 88.9, 7, 113),
  202. (75, 'newspaper', 1.5, 95, 172),
  203. (76, 'scanner', 350, 14, 62),
  204. (77, 'camera', 550.7, 17, 95),
  205. (78, 'camcorder', 788.99, 25, 127),
  206. (79, 'gun', 420.1, 81, 107),
  207. (80, 'domestic dog', 200, 19, 129),
  208. (81, 'horse', 759.5, 30, 115),
  209. (82, 'truck', 7800.5, 32, 123),
  210. (83, 'soccer ball', 95.49, 54, 155),
  211. (84, 'gold earring', 385, 75, 92),
  212. (85, 'basket', 250.45, 46, 142),
  213. (86, 'bikini', 85.2, 12, 57),
  214. (87, 'red skirt', 15.9, 18, 188),
  215. (88, 'copier machine', 800.7, 50, 160),
  216. (89, 'handbag', 35.9, 8, 108),
  217. (90, 'bath towel', 25.1, 11, 186),
  218. (91, 'coffee machine', 210.89, 15, 170),
  219. (92, 'wedding dress', 690, 26, 48),
  220. (93, 'man sun glasses', 80.7, 19, 174),
  221. (94, 'candle', 7.5, 22, 102),
  222. (95, 'scarf', 11.9, 7, 143),
  223. (96, 'microwave', 150.29, 6, 11),
  224. (97, 'electric oven', 645, 62, 171),
  225. (98, 'play station', 256.75, 12, 188),
  226. (99, 'dvd', 126.84, 14, 113),
  227. (100, 'magazine', 3.5, 8, 152);
  228.  
  229.  
  230. ALTER TABLE `customers`
  231.   ADD PRIMARY KEY (`id`);
  232.  
  233. ALTER TABLE `items`
  234.   ADD PRIMARY KEY (`id`);
  235.  
  236. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  237. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  238. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement