| 2 | |
| 3 | ==Релациска шема |
| 4 | |
| 5 | BOLD=not null |
| 6 | Underline = Primary Key |
| 7 | * - takes from |
| 8 | |
| 9 | Faculty(FacultyID,CityName*(City),Fname) |
| 10 | |
| 11 | Building(BuildingID,CityName*(City),Building_Adress) |
| 12 | |
| 13 | City(CityName) |
| 14 | |
| 15 | Apartment(ApartmentID, BuildingID*(Building),UserID*(Owner),Aparment_Adress,Size) |
| 16 | |
| 17 | ApartmentAgreement(AgreementID, ApartmentID*(Apartment),UserID*(Owner), Date_Signed,Date_Expires,ApartmentRent) |
| 18 | |
| 19 | User(UserID,Name,Surname,Password,Phone_Number,City_of_Residency) |
| 20 | |
| 21 | Post(PID, CityName*(City), Num_Roomates, Price, Date_Posted, Description) |
| 22 | |
| 23 | Apartment_photos(PID,Apartment_photos) |
| 24 | |
| 25 | Admin(UserID*(User), Role) |
| 26 | |
| 27 | Owner(UserID*(User)) |
| 28 | |
| 29 | Student(UserID*(User),FacultyID*(Faculty),Age,Gender) |
| 30 | |
| 31 | StudentPost(PID*(Post),UserID*(Student)) |
| 32 | |
| 33 | OwnerPost(PID*(Post), ApartmentID*(Apartment),UserID(Owner),Apartment_photos) |
| 34 | |
| 35 | Moderates_Posts_For(CityName*(City),UserID*(Admin)) |
| 36 | |
| 37 | Student_Signs(UserID*(Student),AgreementID*(Agreement)) |
| 38 | |