From Thundering Mousedeer, 3 Months ago, written in Text.
Embed
  1. CREATE TABLE ITEM
  2. (
  3.   ITEMCODE VARCHAR2(10)  CONSTRAINT ITEM_PK PRIMARY KEY  
  4. , ITEMNAME VARCHAR2(200) CONSTRAINT ITEM_NOT_NULL NOT NULL
  5. , MANUFACTURERNAME VARCHAR2(200)
  6. , UNITPRICE NUMBER(10,2) CONSTRAINT UNITPRICE_CHECK CHECK(UNITPRICE>0)
  7. , MANUFACTURINGYEAR DATE
  8. , ITEMCATEGORY VARCHAR2(20)
  9. );
  10.  
  11. CREATE TABLE CUSTOMER
  12. (
  13.   CUSTOMERID NUMBER CONSTRAINT CUSTOMER_PK PRIMARY KEY
  14. , CUSTOMERNAME VARCHAR2(200) CONSTRAINT CUSTOMER_NOT_NULL NOT NULL
  15. , ADDRESS VARCHAR2(300)
  16. , PHONENUMBER VARCHAR2(10)
  17. , CUSTOMERMAILID VARCHAR2(20)  
  18. );
  19.  
  20.  
  21.  
  22. CREATE TABLE ORDERMASTER
  23. (
  24.   ORDERID NUMBER CONSTRAINT ORDERMASTER_PK PRIMARY KEY
  25. , ORDERDATE DATE CONSTRAINT ORDERDATE_NOT_NULL NOT NULL
  26. , TOTALORDERAMOUNT NUMBER(10,2) CONSTRAINT ORDERMASTER_CHK1 CHECK(TOTALORDERAMOUNT>0) CONSTRAINT T_ORDER_AMOUNT_NOT_NULL NOT NULL
  27. , CUSTOMERID NUMBER CONSTRAINT ORDER_MASTER_CUST_FK1 REFERENCES CUSTOMER(CUSTOMERID)  CONSTRAINT CUSTOMERID_NOT_NULL NOT NULL
  28. );
  29.  
  30.  
  31. CREATE TABLE ORDERTRANSACTION
  32. (
  33.   ORDERID NUMBER CONSTRAINT ORDERTRANSACTION_FK1  REFERENCES ORDERMASTER(ORDERID)
  34. , ITEMCODE VARCHAR2(10) CONSTRAINT ORDERTRANSACTION_FK2 REFERENCES ITEM(ITEMCODE)
  35. , QTYORDERED NUMBER(2) CONSTRAINT QTYORDERED_CHECK CHECK(QTYORDERED>0)
  36. , CONSTRAINT ORDERTRANSACTION_PK PRIMARY KEY (ORDERID, ITEMCODE)
  37. );
  38.  
  39.  
  40. ---Data Insertion script for Item Table
  41.  
  42. INSERT INTO ITEM VALUES ('IT101', 'LED32Inch'        , 'Samsung'        , '15000'  , '14-Nov-2015' , 'Television');
  43. INSERT INTO ITEM VALUES ('IT102', 'GlaxyS5'          , 'Samsung'        , '13000'  , '16-Apr-2016' , 'Mobile');
  44. INSERT INTO ITEM VALUES ('IT103', 'FrontLoad'        , 'Samsung'        , '20000'  , '23-May-2016' , 'WashingMachine');
  45. INSERT INTO ITEM VALUES ('IT104', 'DualDoor'         , 'Samsung'        , '12000'  , '20-Nov-2015' , 'Refrigerator');
  46. INSERT INTO ITEM VALUES ('IT105', 'Pencils'          , 'Natraj'         , '2'      , '11-Jan-2016' , 'Stationery');
  47. INSERT INTO ITEM VALUES ('IT106', 'LED32Inch'        , 'LG'             , '19000'  , '01-Jan-2016' , 'Television');
  48. INSERT INTO ITEM VALUES ('IT107', 'LG G5 Sliver'     , 'LG'             , '11000'  , '20-Nov-2015' , 'Mobile');
  49. INSERT INTO ITEM VALUES ('IT108', 'TopLoad'          , 'LG'             , '25000'  , '18-Apr-2016' , 'WashingMachine');
  50. INSERT INTO ITEM VALUES ('IT109', 'FourDoor'         , 'LG'             , '18000'  , '18-May-2016' , 'Refrigerator');
  51. INSERT INTO ITEM VALUES ('IT110', 'Erasers'          , 'Camlin'         , '5'      , '15-Jan-2016' , 'Stationery');
  52. INSERT INTO ITEM VALUES ('IT111', 'LED32Inch'        , 'Sony'           , '22000'  , '14-Mar-2016' , 'Television');
  53. INSERT INTO ITEM VALUES ('IT112', 'Sony Xperia Z5'   , 'Sony'           , '9000'   , '14-Dec-2015' , 'Mobile');
  54. INSERT INTO ITEM VALUES ('IT113', 'FullyAutomatic'   , 'Sony'           , '22000'  , '13-Dec-2015' , 'WashingMachine');
  55. INSERT INTO ITEM VALUES ('IT114', 'ThreeDoorNormal'  , 'Sony'           , '19000'  , '14-Jun-2016' , 'Refrigerator');
  56. INSERT INTO ITEM VALUES ('IT115', 'Pens'             , 'Faber Castell'  , '10'     , '19-Jan-2016' , 'Stationery');
  57. INSERT INTO ITEM VALUES ('IT116', 'LED32Inch'        , 'Onida'          , '20000'  , '19-Feb-2016' , 'Television');
  58. INSERT INTO ITEM VALUES ('IT117', 'Onida i505'       , 'Onida'          , '10000'  , '23-Apr-2016' , 'Mobile');
  59. INSERT INTO ITEM VALUES ('IT118', 'SemiAutoMatic'    , 'Onida'          , '11000'  , '31-Dec-2015' , 'WashingMachine');
  60. INSERT INTO ITEM VALUES ('IT119', 'ThreeDoorLux'     , 'Onida'          , '18000'  , '19-Jun-2016' , 'Refrigerator');
  61. INSERT INTO ITEM VALUES ('IT120', 'Sharpner'         , 'Apsara'         , '5'      , '21-Jan-2016' , 'Stationery');
  62.  
  63. INSERT INTO ITEM VALUES ('IT121', 'LED50Inch'        , 'Onida'          , '48000'  , add_months(sysdate,-2*12) , 'Television');
  64. INSERT INTO ITEM VALUES ('IT122', 'ThreeDoor'        , 'Thomson'        , '21000'  , add_months(sysdate,-2*12) , 'Refrigerator');
  65. INSERT INTO ITEM VALUES ('IT123', 'LED50Inch'        , 'LG'             , '38000'  , add_months(sysdate,-2*12) , 'Television');
  66. INSERT INTO ITEM VALUES ('IT124', 'ThreeDoor'        , 'Samsung'        , '22000'  , add_months(sysdate,-2*12) , 'Refrigerator');
  67. INSERT INTO ITEM VALUES ('IT125', 'FourDoor'         , 'Samsung'        , '21000'  , add_months(sysdate,-2*12) , 'Refrigerator');
  68. commit;
  69.  
  70.  
  71.  
  72.  
  73. ---Data Insertion script for CustomerTable
  74.  
  75. INSERT INTO CUSTOMER VALUES ('1001', 'Mario'   , 'Street: 1, Cross: 2, Town: 3, Pin: 1231'   , '1234567890' , 'Mario@xyz.com');
  76. INSERT INTO CUSTOMER VALUES ('1002', 'Megan'   , 'Street: 1, Cross: 2, Town: 3, Pin: 1231'   , '1234567891' , 'Megan@xyz.com');
  77. INSERT INTO CUSTOMER VALUES ('1003', 'Amy'     , 'Street: 1, Cross: 2, Town: 3, Pin: 1231'   , '1234567892' , 'Amy@xyz.com');
  78. INSERT INTO CUSTOMER VALUES ('1004', 'Stuart'  , 'Street: 1, Cross: 2, Town: 3, Pin: 1231'   , '1234567893' , 'Stuart@xyz.com');
  79. INSERT INTO CUSTOMER VALUES ('1005', 'Phil'    , 'Street: 2, Cross: 4, Town: 5, Pin: 1232'   , '1234567894' , 'Phil@xyz.com');
  80. INSERT INTO CUSTOMER VALUES ('1006', 'Jacob'   , 'Street: 2, Cross: 4, Town: 5, Pin: 1232'   , '1234567895' , 'Jacob@xyz.com');
  81. INSERT INTO CUSTOMER VALUES ('1007', 'James'   , 'Street: 2, Cross: 4, Town: 5, Pin: 1232'   , '1234567896' , 'James@xyz.com');
  82. INSERT INTO CUSTOMER VALUES ('1008', 'Dan'     , 'Street: 2, Cross: 4, Town: 5, Pin: 1232'   , '1234567897' , 'Dan@xyz.com');
  83. INSERT INTO CUSTOMER VALUES ('1009', 'Henry'   , 'Street: 12, Cross: 4, Town: 15, Pin: 1235' , '1234567898' , 'Henry@xyz.com');
  84. INSERT INTO CUSTOMER VALUES ('1010', 'Eric'    , 'Street: 12, Cross: 4, Town: 15, Pin: 1235' , '1234567899' , 'Eric@xyz.com');
  85. INSERT INTO CUSTOMER VALUES ('1011', 'Ken'     , 'Street: 12, Cross: 4, Town: 15, Pin: 1235' , '1234567900' , 'Ken@xyz.com');
  86. INSERT INTO CUSTOMER VALUES ('1012', 'Mecon'   , 'Street: 14, Cross: 6, Town: 16, Pin: 1236' , '1234567901' , 'Mecon@xyz.com');
  87. INSERT INTO CUSTOMER VALUES ('1013', 'Merlin'  , 'Street: 14, Cross: 5, Town: 16, Pin: 1236' , '1234567902' , 'Merlin@xyz.com');
  88. INSERT INTO CUSTOMER VALUES ('1014', 'Morgan'  , 'Street: 14, Cross: 5, Town: 16, Pin: 1236' , '1234567903' , 'Morgan@xyz.com');
  89. commit;
  90.  
  91.  
  92.  
  93. ---Data Insertion script for OrderMaster Table
  94.  
  95. INSERT INTO ORDERMASTER VALUES ('70001', '07-Jul-2016', '49000', '1001');
  96. INSERT INTO ORDERMASTER VALUES ('70002', '27-Jun-2016', '82000', '1006');
  97. INSERT INTO ORDERMASTER VALUES ('70003', '09-Jul-2016', '200', '1005');
  98. INSERT INTO ORDERMASTER VALUES ('70004', '10-Jul-2016', '46000', '1006');
  99. INSERT INTO ORDERMASTER VALUES ('70005', '20-Jun-2016', '48000', '1005');
  100. INSERT INTO ORDERMASTER VALUES ('70006', '10-Jul-2016', '200', '1006');
  101. INSERT INTO ORDERMASTER VALUES ('70007', '20-Jul-2016', '49000', '1005');
  102. commit;
  103.  
  104.  
  105.  
  106. ---Data Insertion script for OrderTransaction Table
  107.  
  108. INSERT INTO ORDERTRANSACTION VALUES ('70001', 'IT101', '2');
  109. INSERT INTO ORDERTRANSACTION VALUES ('70001', 'IT114', '1');
  110. INSERT INTO ORDERTRANSACTION VALUES ('70002', 'IT111', '2');
  111. INSERT INTO ORDERTRANSACTION VALUES ('70002', 'IT103', '1');
  112. INSERT INTO ORDERTRANSACTION VALUES ('70002', 'IT109', '1');
  113. INSERT INTO ORDERTRANSACTION VALUES ('70003', 'IT115', '20');
  114. INSERT INTO ORDERTRANSACTION VALUES ('70004', 'IT117', '2');
  115. INSERT INTO ORDERTRANSACTION VALUES ('70004', 'IT102', '2');
  116. INSERT INTO ORDERTRANSACTION VALUES ('70005', 'IT121', '1');
  117. INSERT INTO ORDERTRANSACTION VALUES ('70006', 'IT115', '20');
  118. INSERT INTO ORDERTRANSACTION VALUES ('70007', 'IT101', '2');
  119. INSERT INTO ORDERTRANSACTION VALUES ('70007', 'IT114', '1');
  120. Commit;
  121.  

Replies to Untitled rss

Title Name Language When
Re: Untitled Emerald Mosquito text 3 Months ago.