| 1 | = Логички и физички дизајн |
| 2 | |
| 3 | == Релациска шема |
| 4 | |
| 5 | * BOLD=not null |
| 6 | * Underline = Primary Key |
| 7 | * * - takes from |
| 8 | ---- |
| 9 | |
| 10 | * Faculty(**__FacultyID__,CityName*(City),Fname**) |
| 11 | * Building(**__BuildingID__,CityName*(City),Building_Adress**) |
| 12 | * City(**__CityName__**) |
| 13 | * Apartment(**__ApartmentID__, BuildingID*(Building),UserID*(Owner),Aparment_Adress,Size**) |
| 14 | * ApartmentAgreement(**__AgreementID__, ApartmentID*(Apartment),UserID*(Owner), Date_Signed,Date_Expires,ApartmentRent**) |
| 15 | * User(**__UserID__,Name,Surname,Password,Phone_Number**,City_of_Residency) |
| 16 | * Post(**__PID__, CityName*(City), Num_Roomates, Price, Date_Posted**, Description) |
| 17 | * Apartment_photos(**__PostID*(OwnerPost),Apartment_photos__**) |
| 18 | * Admin(**__UserID*(User)__, Role**) |
| 19 | * Owner(**__UserID*(User)__**) |
| 20 | * Student(**__UserID*(User)__,FacultyID*(Faculty)**,Age,Gender) |
| 21 | * StudentPost(**__PID*(Post)__,UserID*(Student)**) |
| 22 | * OwnerPost(**__PID*(Post)__, ApartmentID*(Apartment),UserID(Owner)**) |
| 23 | * Moderates_Posts_For(**__CityName*(City),UserID*(Admin)__**) |
| 24 | * Student_Signs(**__UserID*(Student),AgreementID*(Agreement)__**) |
| 25 | |
| 26 | == DDL скрипта за бришење на табелите и креирање на табелите |
| 27 | [attachment:kreiranje.sql kreiranje.sql] |
| 28 | |
| 29 | == DML скрипта за полнење на табелите со податоци |
| 30 | [attachment:vnesuvanje.sql vnesuvanje.sql] |
| 31 | |
| 32 | == Релациски дијаграм изведен од DBeaver |
| 33 | |
| 34 | [[Image(DBeaverRD.png)]] |