Skip to content

Commit bf91fec

Browse files
committed
start with Poluatate the database
1 parent 7af7cf1 commit bf91fec

3 files changed

Lines changed: 113 additions & 3 deletions

File tree

fdb-homework3-template/groupdata.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
\makecell{\textbf{Last Name}} & \makecell{\textbf{First Name}} & \makecell{\textbf{Student Number}} \\\hline
66
\makecell{Giuliani} & \makecell{Amedeo} & \makecell{2005797} \\\hline
77
\makecell{Insert last name here} & \makecell{Insert first name here} & \makecell{Insert student number here} \\\hline
8-
\makecell{Insert last name here} & \makecell{Insert first name here} & \makecell{Insert student number here} \\\hline
8+
\makecell{Zanini} & \makecell{Samuele} & \makecell{2019038} \\\hline
99
\end{longtable}

fdb-homework3-template/sections/Physical.tex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ \section{Physical Schema}
22
\textcolor{red}{[Report SQL statements for the database creation]}
33

44
-- Database Creation
5+
\begin{lstlisting}[
6+
stringstyle=\color{grey},
7+
basicstyle=\ttfamily\footnotesize]
8+
59
CREATE DATABASE tagmsdb OWNER admin ENCODING = 'UTF8';
610

711
-- Create new Schema (you can use the public schema without crating a new one, if you want)
@@ -78,4 +82,7 @@ \section{Physical Schema}
7882
FOREIGN KEY (product_id) REFERENCES Tagms.product(product_id),
7983
FOREIGN KEY (item_id) REFERENCES Tagms.item(item_id),
8084
PRIMARY KEY (product_id, item_id)
81-
);
85+
);
86+
87+
88+
\end{lstlisting}
Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,105 @@
1+
12
\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

Comments
 (0)