SHARE
TWEET

Untitled

a guest Mar 15th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -------------------------------------------------------------
  2. -- Sams Teach Yourself SQL in 10 Minutes
  3. -- http://forta.com/books/0672336073/
  4. -- Example table population scripts for Microsoft SQL Server.
  5. -------------------------------------------------------------
  6.  
  7.  
  8. ---------------------------
  9. -- Populate Customers table
  10. ---------------------------
  11. INSERT INTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
  12. VALUES('1000000001', 'Village Toys', '200 Maple Lane', 'Detroit', 'MI', '44444', 'USA', 'John Smith', 'sales@villagetoys.com');
  13. INSERT INTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact)
  14. VALUES('1000000002', 'Kids Place', '333 South Lake Drive', 'Columbus', 'OH', '43333', 'USA', 'Michelle Green');
  15. INSERT INTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
  16. VALUES('1000000003', 'Fun4All', '1 Sunny Place', 'Muncie', 'IN', '42222', 'USA', 'Jim Jones', 'jjones@fun4all.com');
  17. INSERT INTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
  18. VALUES('1000000004', 'Fun4All', '829 Riverside Drive', 'Phoenix', 'AZ', '88888', 'USA', 'Denise L. Stephens', 'dstephens@fun4all.com');
  19. INSERT INTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact)
  20. VALUES('1000000005', 'The Toy Store', '4545 53rd Street', 'Chicago', 'IL', '54545', 'USA', 'Kim Howard');
  21.  
  22. -------------------------
  23. -- Populate Vendors table
  24. -------------------------
  25. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  26. VALUES('BRS01','Bears R Us','123 Main Street','Bear Town','MI','44444', 'USA');
  27. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  28. VALUES('BRE02','Bear Emporium','500 Park Street','Anytown','OH','44333', 'USA');
  29. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  30. VALUES('DLL01','Doll House Inc.','555 High Street','Dollsville','CA','99999', 'USA');
  31. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  32. VALUES('FRB01','Furball Inc.','1000 5th Avenue','New York','NY','11111', 'USA');
  33. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  34. VALUES('FNG01','Fun and Games','42 Galaxy Road','London', NULL,'N16 6PS', 'England');
  35. INSERT INTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  36. VALUES('JTS01','Jouets et ours','1 Rue Amusement','Paris', NULL,'45678', 'France');
  37.  
  38. --------------------------
  39. -- Populate Products table
  40. --------------------------
  41. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  42. VALUES('BR01', 'BRS01', '8 inch teddy bear', 5.99, '8 inch teddy bear, comes with cap and jacket');
  43. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  44. VALUES('BR02', 'BRS01', '12 inch teddy bear', 8.99, '12 inch teddy bear, comes with cap and jacket');
  45. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  46. VALUES('BR03', 'BRS01', '18 inch teddy bear', 11.99, '18 inch teddy bear, comes with cap and jacket');
  47. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  48. VALUES('BNBG01', 'DLL01', 'Fish bean bag toy', 3.49, 'Fish bean bag toy, complete with bean bag worms with which to feed it');
  49. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  50. VALUES('BNBG02', 'DLL01', 'Bird bean bag toy', 3.49, 'Bird bean bag toy, eggs are not included');
  51. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  52. VALUES('BNBG03', 'DLL01', 'Rabbit bean bag toy', 3.49, 'Rabbit bean bag toy, comes with bean bag carrots');
  53. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  54. VALUES('RGAN01', 'DLL01', 'Raggedy Ann', 4.99, '18 inch Raggedy Ann doll');
  55. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  56. VALUES('RYL01', 'FNG01', 'King doll', 9.49, '12 inch king doll with royal garments and crown');
  57. INSERT INTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
  58. VALUES('RYL02', 'FNG01', 'Queen doll', 9.49, '12 inch queen doll with royal garments and crown');
  59.  
  60. ------------------------
  61. -- Populate Orders table
  62. ------------------------
  63. INSERT INTO Orders(order_num, order_date, cust_id)
  64. VALUES(20005, '2012-05-01', '1000000001');
  65. INSERT INTO Orders(order_num, order_date, cust_id)
  66. VALUES(20006, '2012-01-12', '1000000003');
  67. INSERT INTO Orders(order_num, order_date, cust_id)
  68. VALUES(20007, '2012-01-30', '1000000004');
  69. INSERT INTO Orders(order_num, order_date, cust_id)
  70. VALUES(20008, '2012-02-03', '1000000005');
  71. INSERT INTO Orders(order_num, order_date, cust_id)
  72. VALUES(20009, '2012-02-08', '1000000001');
  73.  
  74. ----------------------------
  75. -- Populate OrderItems table
  76. ----------------------------
  77. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  78. VALUES(20005, 1, 'BR01', 100, 5.49);
  79. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  80. VALUES(20005, 2, 'BR03', 100, 10.99);
  81. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  82. VALUES(20006, 1, 'BR01', 20, 5.99);
  83. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  84. VALUES(20006, 2, 'BR02', 10, 8.99);
  85. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  86. VALUES(20006, 3, 'BR03', 10, 11.99);
  87. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  88. VALUES(20007, 1, 'BR03', 50, 11.49);
  89. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  90. VALUES(20007, 2, 'BNBG01', 100, 2.99);
  91. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  92. VALUES(20007, 3, 'BNBG02', 100, 2.99);
  93. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  94. VALUES(20007, 4, 'BNBG03', 100, 2.99);
  95. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  96. VALUES(20007, 5, 'RGAN01', 50, 4.49);
  97. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  98. VALUES(20008, 1, 'RGAN01', 5, 4.99);
  99. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  100. VALUES(20008, 2, 'BR03', 5, 11.99);
  101. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  102. VALUES(20008, 3, 'BNBG01', 10, 3.49);
  103. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  104. VALUES(20008, 4, 'BNBG02', 10, 3.49);
  105. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  106. VALUES(20008, 5, 'BNBG03', 10, 3.49);
  107. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  108. VALUES(20009, 1, 'BNBG01', 250, 2.49);
  109. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  110. VALUES(20009, 2, 'BNBG02', 250, 2.49);
  111. INSERT INTO OrderItems(order_num, order_item, prod_id, quantity, item_price)
  112. VALUES(20009, 3, 'BNBG03', 250, 2.49);
RAW Paste Data
Top