In: Computer Science
OWNER (ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, COMPANY_NAME,
EMAIL_ADDRESS, PHONE_NUMBER,TYPE_OF_BUSINESS)
PROPERTY (ID, STREET_NUMBER, STREET_NAME, CITY, PROVINCE, ZIP,
TYPE, EMPLOYEE_ID, OWNER_ID)
EMPLOYEE (ID, NAME, ADDRESS, PHONE, EMAIL, GENDER, POSITION,
SALARY, MANAGER_ID, BRANCH_ID)
BRANCH (ID, ADDRESS, PHONE)
RENTOR (ID, NAME, ADDRESS, PHONE, EMAIL)
RENTAL (ID, PROPERTY_ID, RENTER_ID, DATE_SIGNED, START_DATE,
END_DATE)
VIEWING (ID, PROPERTY_ID, RENTOR_ID, DATE)
ADVERTISING (ID, NEWSPAPER_NAME, PROPERTY_ID, DATE_OF_AD)
For the above use case for each entity identify their data types
and if the fields are required (NOT NULL). Create the ERD document
using Word, Excel, PowerPoint documents (or equivalent software) of
your choice. Be sure to include Primary/Foreign Key relationship
lines between the fields (not the entities) to show the
relationship.
This is a database question
Identifies the proper data types of the attributes and include a required indicator
Proper implementation of Primary Key / Foreign Key Relationship LINES
Identifying data types
NOT NULL constraint will specify that NULL is not allowed for that column.
Int NOT NULL is used for ID attribute of each entity as ID is a mandatory column .
Char is used for those attributes which contain strings only e.g. FIRST_NAME, GENDER
Varcahr is used for those attributes which contain a combination is letters and numbers like Email, Address
Float is used for decimal numbers e.g. salary
OWNER (ID int NOT NULL , FIRST_NAME char(20) NOT NULL, MIDDLE_NAME char(20), LAST_NAME char(20), COMPANY_NAME char(20), EMAIL_ADDRESS varchar(20), PHONE_NUMBER int ,TYPE_OF_BUSINESS char(50))
PROPERTY (ID int NOT NULL, STREET_NUMBER int , STREET_NAME varchar(20), CITY char(20), PROVINCE char(20), ZIP int, TYPE varchar(20), EMPLOYEE_ID int, OWNER_ID int )
EMPLOYEE (ID int NOT NULL, NAME char(20), ADDRESS varchar(50), PHONE int, EMAIL varchar(20), GENDER char(10), POSITION varchar(20), SALARY float, MANAGER_ID int NOT NULL, BRANCH_ID int )
BRANCH (ID int NOT NULL, ADDRESS varchar(50), PHONE int)
RENTOR (ID int NOT NULL, NAME char(20), ADDRESS varchar(50), PHONE int, EMAIL varchar(50))
RENTAL (ID int NOT NULL, PROPERTY_ID int , RENTER_ID int NOT NULL, DATE_SIGNED varchar(20), START_DATE varchar(20), END_DATE varchar(20))
VIEWING (ID int NOT NULL, PROPERTY_ID int , RENTOR_ID int , DATE varchar(20))
ADVERTISING (ID int NOT NULL, NEWSPAPER_NAME char(20), PROPERTY_ID int , DATE_OF_AD varchar(20))
Primary key will uniquely identify the records from tables whereas Foreign key is a field in a table that uniquely identifies a row in another table or same table.
Primary key is marked as PK
Foreign key is marked as FK
If this answer is helpful Please give it a thumbs up .Thank You