This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

sqlschema

By: a guest on Jun 22nd, 2012  |  syntax: SQL  |  size: 1.97 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. CREATE TABLE Customer
  2. (
  3. Customer_Id NUMBER PRIMARY KEY,
  4. Cust_First_Name varchar2(50),
  5. Cust_Last_Name varchar2(50)
  6. )
  7.  
  8. CREATE TABLE Orders
  9. (
  10. Order_Id NUMBER PRIMARY KEY,
  11. Customer_Id NUMBER NOT NULL REFERENCES Customer(Customer_Id)
  12. )
  13.  
  14. CREATE TABLE Product_Info
  15. (
  16. Product_Id NUMBER PRIMARY KEY,
  17. Product_Name varchar2(50),
  18. Category varchar2(50)
  19. )
  20.  
  21. CREATE TABLE Order_Items
  22. (
  23. Order_Item_Id NUMBER PRIMARY KEY,
  24. Order_Id NUMBER NOT NULL REFERENCES Orders(Order_Id),
  25. Product_Id NUMBER NOT NULL REFERENCES Product_Info(Product_Id)
  26. )
  27.  
  28. INSERT INTO Customer VALUES ('1','Martin','Davids')
  29. INSERT INTO Customer VALUES ('2','John','Hugs')
  30. INSERT INTO Customer VALUES ('3','Maria','Shay')
  31. INSERT INTO Customer VALUES ('4','Mallorie','Hay')
  32. INSERT INTO Customer VALUES ('5','Sophia','Valdes')
  33.  
  34. INSERT INTO Orders VALUES ('1','1')
  35. INSERT INTO Orders VALUES ('2','1')
  36. INSERT INTO Orders VALUES ('3','2')
  37. INSERT INTO Orders VALUES ('4','2')
  38. INSERT INTO Orders VALUES ('5','2')
  39. INSERT INTO Orders VALUES ('6','3')
  40. INSERT INTO Orders VALUES ('7','4')
  41.  
  42. INSERT INTO Order_items VALUES ('20','1','1')
  43. INSERT INTO Order_items VALUES ('21','2','1')
  44. INSERT INTO Order_items VALUES ('22','2','3')
  45. INSERT INTO Order_items VALUES ('23','1','2')
  46. INSERT INTO Order_items VALUES ('24','2','2')
  47. INSERT INTO Order_items VALUES ('25','3','1')
  48. INSERT INTO Order_items VALUES ('26','4','1')
  49. INSERT INTO Order_items VALUES ('27','5','1')
  50. INSERT INTO Order_items VALUES ('28','6','2')
  51. INSERT INTO Order_items VALUES ('29','6','1')
  52. INSERT INTO Order_items VALUES ('30','6','3')
  53. INSERT INTO Order_items VALUES ('31','7','5')
  54.  
  55. INSERT INTO Product_info VALUES ('1','Lenovo netbook','Computer')
  56. INSERT INTO Product_info VALUES ('2','Dell PC','Computer')
  57. INSERT INTO Product_info VALUES ('3','MSI All-in-one','Computer')
  58. INSERT INTO Product_info VALUES ('4','Samsung','Dishwasher')
  59. INSERT INTO Product_info VALUES ('5','Panasonic SmartTv','TV')
  60. INSERT INTO Product_info VALUES ('6','Phillips','Toaster')
clone this paste RAW Paste Data