|
| 1 | + |
1 | 2 | \section{Populate the Database: Example} |
2 | | -\textcolor{red}{[Report SQL statements for the database population: one row per table is enough for the HW, but we suggest to insert a sufficient amount of data in your DB to run queries]} |
| 3 | +\textcolor{red}{[Report SQL statements for the database population: one row per table is enough for the HW, but we suggest to insert a sufficient amount of data in your DB to run queries]} |
| 4 | + |
| 5 | + |
| 6 | +\begin{lstlisting}[ |
| 7 | +stringstyle=\color{grey}, |
| 8 | +basicstyle=\ttfamily\footnotesize] |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +-- Employee |
| 13 | +INSERT INTO Tagms.employee(TAX_numeber, First_name, Last_name, Phone_number, Email_address, |
| 14 | +Birth_date, Hiring_date, Still_working, Role_ID) VALUES |
| 15 | +('','','','','','','','',''); |
| 16 | + |
| 17 | +-- Work |
| 18 | +INSERT INTO Tagms.work(Department_ID, Employee_ID) VALUES |
| 19 | +('',''); |
| 20 | + |
| 21 | +-- Departament |
| 22 | +INSERT INTO Tagms.departament(Department_ID, Name,Description) VALUES ('','',''); |
| 23 | + |
| 24 | +-- Role |
| 25 | +INSERT INTO Tagms.role(Role_ID, Name,Description) VALUES |
| 26 | +('','',''); |
| 27 | + |
| 28 | +-- Ship |
| 29 | +INSERT INTO Tagms.ship(Order_ID, Employee_ID, Shipping_date,Track_num) VALUES |
| 30 | +('','','',''); |
| 31 | + |
| 32 | +-- Supplier |
| 33 | +INSERT INTO Tagms.supplier(VAT_numeber, Supplier_name, Phone_number, Address, Email_address, |
| 34 | +Registration_date) VALUES |
| 35 | +('','','','','',''); |
| 36 | + |
| 37 | +-- Contract |
| 38 | +INSERT INTO Tagms.contract(Contract_ID, Description, Contract_date, Delivery_date, |
| 39 | +Expiration_date, Supplier_ID, Employee_ID) VALUES |
| 40 | +('','','','','','',''); |
| 41 | + |
| 42 | + |
| 43 | +-- Item |
| 44 | +INSERT INTO Tagms.item(Item_ID, Name, Description, |
| 45 | +Quantity, Item_Category_ID, Minimum_quantity) VALUES |
| 46 | +('','','','','',''); |
| 47 | + |
| 48 | +-- Item_Category |
| 49 | +INSERT INTO Tagms.item_Category(Item_Category_ID, Name, Description) VALUES |
| 50 | +('','',''); |
| 51 | + |
| 52 | +-- Specify |
| 53 | +INSERT INTO Tagms.specify(Item_ID, Contract_ID, Purchase_Quantity, Price) VALUES |
| 54 | +('','','',''); |
| 55 | + |
| 56 | + |
| 57 | +-- Product |
| 58 | +INSERT INTO Tagms.product(Product_ID, Name, Description, Product_cost, Price_increase, |
| 59 | +Volume, Net_weight, Nutritional_Facts, Product_Category_ID) VALUES |
| 60 | +('', '', '', '', '', '', '', '', ''); |
| 61 | + |
| 62 | +-- Product_Category |
| 63 | +INSERT INTO Tagms.product_Category(Product_Category_ID, Name, Description) VALUES |
| 64 | +('','',''); |
| 65 | + |
| 66 | +-- Made_Up_Of_1 |
| 67 | +INSERT INTO Tagms.Made_Up_Of(Product_ID, Item_ID,Quantity) VALUES |
| 68 | +('','',''); |
| 69 | + |
| 70 | + |
| 71 | +-- Package |
| 72 | +INSERT INTO Tagms.package(Package_ID, Name, Description, Weight, Height, Width, Depth, |
| 73 | +Package_Category_ID)VALUES |
| 74 | +('', '', '', '', '', '', '', ''); |
| 75 | + |
| 76 | +-- Package_Category |
| 77 | +INSERT INTO Tagms.product_Category(Package_Category_ID, Name, Description) VALUES |
| 78 | +('','',''); |
| 79 | + |
| 80 | +-- Made_Up_Of_2 |
| 81 | +INSERT INTO Tagms.Made_Up_Of(Package_ID, Item_ID,Quantity) VALUES |
| 82 | +('','',''); |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +-- Order |
| 87 | +INSERT INTO Tagms.order(Order_ID,Net_price, Taxes, Order_date, Order_paid, Employee_ID, |
| 88 | +Customer_ID) VALUES |
| 89 | +('','', '', '', '', '', '') |
| 90 | + |
| 91 | +-- Customer |
| 92 | +INSERT INTO Tagms.customer(VAT_numeber, Customer_name, Registration_date, Address, |
| 93 | +Email_address, Phone_number) VALUES |
| 94 | +('', '', '', '','', '') |
| 95 | + |
| 96 | +-- Lot |
| 97 | +INSERT INTO Tagms.lot(Lot_ID, Expiration_date,Lot_discount,VAT, Lot_price, Product_Quantity, |
| 98 | +Package_Quantity,Package_ID, Product_ID) VALUES |
| 99 | +('', '','','', '', '', '','', ''); |
| 100 | + |
| 101 | +-- Draws_from |
| 102 | +INSERT INTO Tagms.Made_Up_Of(Lot_ID, Order_ID) VALUES |
| 103 | +('',''); |
| 104 | + |
| 105 | +\end{lstlisting} |
0 commit comments