Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.vscode/
.vscode/
**/.DS_Store
20 changes: 16 additions & 4 deletions 1-setup/schema/University-DB-ER-model.drawio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mxfile host="app.diagrams.net" modified="2024-04-29T11:38:16.857Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" etag="kaMvB7wFvrAHa6npQko_" version="24.3.1" type="google">
<mxfile host="app.diagrams.net" modified="2024-06-12T18:55:40.534Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" etag="QsMRP0G2qmgOHPBHAOd5" version="24.5.4" type="device">
<diagram id="cdb5e136-1861-7ef1-5e76-c57f7e18aa8d" name="UML">
<mxGraphModel dx="1050" dy="565" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<mxGraphModel dx="954" dy="506" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
Expand All @@ -11,7 +11,7 @@
</mxGeometry>
</mxCell>
<mxCell id="4a63a70a29bb4ada-1" value="Faculty" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;strokeWidth=1;fontSize=13;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry y="2" width="160" height="224" as="geometry" />
<mxGeometry y="2" width="160" height="250" as="geometry" />
</mxCell>
<mxCell id="4a63a70a29bb4ada-2" value="id" style="shape=partialRectangle;top=0;left=0;right=0;bottom=1;align=left;verticalAlign=middle;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;fontStyle=5;" parent="4a63a70a29bb4ada-1" vertex="1">
<mxGeometry y="26" width="160" height="30" as="geometry" />
Expand Down Expand Up @@ -55,6 +55,12 @@
<mxCell id="-yvy37UwG201HpsQHLqc-2" value="" style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;" parent="-yvy37UwG201HpsQHLqc-1" vertex="1" connectable="0">
<mxGeometry width="30" height="26" as="geometry" />
</mxCell>
<mxCell id="AV330qxZJO8WnukwR470-12" value="active" style="shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;" vertex="1" parent="4a63a70a29bb4ada-1">
<mxGeometry y="224" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="AV330qxZJO8WnukwR470-13" value="" style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;" vertex="1" connectable="0" parent="AV330qxZJO8WnukwR470-12">
<mxGeometry width="30" height="26" as="geometry" />
</mxCell>
<mxCell id="4a63a70a29bb4ada-32" value="Department" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#FFE6CC;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;strokeWidth=1;fontSize=13;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="642" y="7" width="160" height="112" as="geometry" />
</mxCell>
Expand Down Expand Up @@ -116,7 +122,7 @@
<mxGeometry width="30" height="20" as="geometry" />
</mxCell>
<mxCell id="4a63a70a29bb4ada-26" value="Student" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;strokeWidth=1;fontSize=13;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1349" y="282" width="160" height="186" as="geometry" />
<mxGeometry x="1349" y="282" width="160" height="212" as="geometry" />
</mxCell>
<mxCell id="4a63a70a29bb4ada-27" value="id" style="shape=partialRectangle;top=0;left=0;right=0;bottom=1;align=left;verticalAlign=middle;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;fontStyle=5;" parent="4a63a70a29bb4ada-26" vertex="1">
<mxGeometry y="26" width="160" height="30" as="geometry" />
Expand Down Expand Up @@ -154,6 +160,12 @@
<mxCell id="5ecfb9fce94ea102-4" value="" style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;fontStyle=2" parent="5ecfb9fce94ea102-3" vertex="1" connectable="0">
<mxGeometry width="30" height="26" as="geometry" />
</mxCell>
<mxCell id="AV330qxZJO8WnukwR470-5" value="gpa" style="shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;fontStyle=0" vertex="1" parent="4a63a70a29bb4ada-26">
<mxGeometry y="186" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="AV330qxZJO8WnukwR470-6" value="" style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;fontStyle=2" vertex="1" connectable="0" parent="AV330qxZJO8WnukwR470-5">
<mxGeometry width="30" height="26" as="geometry" />
</mxCell>
<mxCell id="4f2698fda814bacb-14" value="Teaching" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;fontSize=13;strokeColor=#d79b00;strokeWidth=1;" parent="1" vertex="1">
<mxGeometry x="220" y="629" width="160" height="210" as="geometry" />
</mxCell>
Expand Down
Binary file modified 1-setup/schema/University-DB-ER-model.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions 1-setup/schema/populate-university-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ INSERT INTO Department (id, name, code) VALUES
(4, 'Civil Engineering', 'CE'),
(5, 'Mathematics', 'MA');

INSERT INTO Student (id, name, national_id, birth_date, enrollment_date, graduation_date) VALUES
(1001, 'John Liu', 123345566, '2001-04-05', '2020-01-15', '2024-06-15'),
(1003, 'Rita Ora', 132345166, '2001-01-14', '2020-01-15', '2024-06-15'),
(1007, 'Philip Lose', 321345566, '2001-06-15', '2020-01-15', '2024-06-15'),
(1010, 'Samantha Prabhu', 3217165566, '2001-03-21', '2020-01-15', '2024-06-15'),
(1011, 'Vikas Jain', 321345662, '2001-7-18', '2020-01-15', NULL),
(1610, 'Ritu Raj', 3203455662, '2002-2-05', '2021-01-15', '2025-06-15'),
(1607, 'Peter Liu',3043455662, '2002-4-14', '2021-01-15', '2025-06-15'),
(1617, 'Philip Mohan', 3103455662, '2002-5-15', '2021-01-15', '2025-06-15'),
(1619, 'Sam Roberts', 9203455662, '2002-6-21', '2021-01-15', '2025-06-15'),
(1621, 'Vineet Jha', 7203421662, '2002-05-18', '2021-01-15', NULL),
(2001, 'Reena Roy', 9023455613, '2003-01-13', '2022-01-15', '2025-06-15'),
(2009, 'Pollards Grey', 6503453662, '2003-4-19', '2022-01-15', '2025-06-15'),
(2017, 'Potu Singh', 1312445677, '2003-3-11', '2022-01-15', NULL),
(2008, 'Julia Roberts', 1212446677, '2003-6-12', '2022-01-15', '2025-06-15'),
(2006, 'Agatha Christi', 1100245767, '2003-05-19', '2022-01-15', NULL),
(1101, 'Jia Grey', 1345236267, '2001-02-05', '2020-01-15', '2024-06-15'),
(1103, 'Rose Rit', 1323612067, '2001-05-14', '2020-01-15', NULL),
(1107, 'Phellum Luis', 203678911, '2001-3-15', '2020-01-15', '2024-06-15'),
(1110, 'Albert Decosta', 2617897011, '2001-2-21', '2020-01-15', '2024-06-15'),
(1111, 'Vikram Kohli', 1516578091, '2001-3-8', '2020-01-15', '2024-06-15'),
(1710, 'Roni Roto', 2678910631, '2002-3-11', '2021-01-15', '2025-06-15'),
(1707, 'Piu Liu', 2101368101, '2002-3-14', '2021-01-15', NULL),
(1717, 'Param Mohan', 1023456545, '2002-5-15', '2021-01-15', '2025-06-15'),
(1719, 'Siren Lobo', 189091342, '2002-6-17', '2021-01-15', NULL),
(1721, 'Vini Puh', 1312091343, '2002-5-13', '2021-01-15', '2025-06-15');
INSERT INTO Student (id, name, national_id, birth_date, enrollment_date, graduation_date, gpa) VALUES
(1001, 'John Liu', 123345566, '2001-04-05', '2020-01-15', '2024-06-15', 4),
(1003, 'Rita Ora', 132345166, '2001-01-14', '2020-01-15', '2024-06-15', 4.2),
(1007, 'Philip Lose', 321345566, '2001-06-15', '2020-01-15', '2024-06-15', 3.8),
(1010, 'Samantha Prabhu', 3217165566, '2001-03-21', '2020-01-15', '2024-06-15', 4.9),
(1011, 'Vikas Jain', 321345662, '2001-7-18', '2020-01-15', NULL, 3.3),
(1610, 'Ritu Raj', 3203455662, '2002-2-05', '2021-01-15', '2025-06-15', NULL),
(1607, 'Peter Liu',3043455662, '2002-4-14', '2021-01-15', '2025-06-15', NULL),
(1617, 'Philip Mohan', 3103455662, '2002-5-15', '2021-01-15', '2025-06-15', 5),
(1619, 'Sam Roberts', 9203455662, '2002-6-21', '2021-01-15', '2025-06-15', 4.3),
(1621, 'Vineet Jha', 7203421662, '2002-05-18', '2021-01-15', NULL, 2.9),
(2001, 'Reena Roy', 9023455613, '2003-01-13', '2022-01-15', '2025-06-15', 4.15),
(2009, 'Pollards Grey', 6503453662, '2003-4-19', '2022-01-15', '2025-06-15', 4.65),
(2017, 'Potu Singh', 1312445677, '2003-3-11', '2022-01-15', NULL, NULL),
(2008, 'Julia Roberts', 1212446677, '2003-6-12', '2022-01-15', '2025-06-15', 3.04),
(2006, 'Agatha Christi', 1100245767, '2003-05-19', '2022-01-15', NULL, 4.59),
(1101, 'Jia Grey', 1345236267, '2001-02-05', '2020-01-15', '2024-06-15', 3.98),
(1103, 'Rose Rit', 1323612067, '2001-05-14', '2020-01-15', NULL, 3.57),
(1107, 'Phellum Luis', 203678911, '2001-3-15', '2020-01-15', '2024-06-15', 4.21),
(1110, 'Albert Decosta', 2617897011, '2001-2-21', '2020-01-15', '2024-06-15', 4),
(1111, 'Vikram Kohli', 1516578091, '2001-3-8', '2020-01-15', '2024-06-15', 3.27),
(1710, 'Roni Roto', 2678910631, '2002-3-11', '2021-01-15', '2025-06-15', 4.44),
(1707, 'Piu Liu', 2101368101, '2002-3-14', '2021-01-15', NULL, 2.99),
(1717, 'Param Mohan', 1023456545, '2002-5-15', '2021-01-15', '2025-06-15', 2.75),
(1719, 'Siren Lobo', 189091342, '2002-6-17', '2021-01-15', NULL, NULL),
(1721, 'Vini Puh', 1312091343, '2002-5-13', '2021-01-15', '2025-06-15', 3.64);

INSERT INTO Faculty (id, name, national_id, position, start_date, end_date, department_id) VALUES
(1, 'Anubha Gupta', 1018901231, 'Professor', '2010-1-11', '2027-3-11', 2),
Expand Down
2 changes: 2 additions & 0 deletions 1-setup/schema/university-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CREATE TABLE Student
birth_date DATE,
enrollment_date DATE,
graduation_date DATE,
gpa FLOAT,
UNIQUE (id)
);

Expand All @@ -53,6 +54,7 @@ CREATE TABLE Faculty
start_date DATE,
end_date DATE,
department_id INT,
active BOOLEAN DEFAULT true,
CONSTRAINT faculty_department_id_fkey FOREIGN KEY(department_id) REFERENCES Department(id),
UNIQUE (id)
);
Expand Down
2 changes: 2 additions & 0 deletions 1-setup/schema/university-postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ CREATE TABLE Student
birth_date DATE,
enrollment_date DATE,
graduation_date DATE,
gpa REAL,
UNIQUE (id)
);

Expand All @@ -59,6 +60,7 @@ CREATE TABLE Faculty
start_date DATE,
end_date DATE,
department_id INT,
active BOOLEAN DEFAULT true,
CONSTRAINT faculty_department_id_fkey FOREIGN KEY(department_id) REFERENCES Department(id),
UNIQUE (id)
);
Expand Down
2 changes: 2 additions & 0 deletions 1-setup/schema/university-sqlserver.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CREATE TABLE Student
birth_date DATE,
enrollment_date DATE,
graduation_date DATE,
gpa FLOAT(4),
UNIQUE (id)
);

Expand All @@ -57,6 +58,7 @@ CREATE TABLE Faculty
start_date DATE,
end_date DATE,
department_id INT,
active BIT DEFAULT 1,
CONSTRAINT faculty_department_id_fkey FOREIGN KEY(department_id) REFERENCES Department(id),
UNIQUE (id)
);
Expand Down