$18.20
Question #1
Consider the following data. Arrows show the functional dependency.
The arrows in this question indicated the determination of two attributes. For example, the arrow that goes ProductID to ProductDescription indicates that ProductID determines the ProductDescription. This in turn means that ProductId can be considered as primary key for ProductDescription.
Here is some information to create your tables
Data Item (Column Name) |
Type |
Restriction |
ProductId |
Numeric – Integer |
|
ItemNum |
Numeric – Integer |
Not null |
QuantityUsed |
Numeric – Integer |
>= 0 |
ItemDescription |
Character – Up to 200 |
|
ProductDescription |
Character – Up to 200 |
|
ReceiptNumber |
Numeric – Integer |
Not null |
QuantitySold |
Numeric – Integer |
> = 0 |
SalesDate |
Date |
Question #2
Consider the following ERD
Where
In the second table:
Note that not all the rooms in the hospital has patient at a particular time but all patient must be is some rooms. Further, only some of the physicians are supervising the departments in the hospital; however, all departments must be managed by some physicians.
You may make any other assumption you think is necessary but you have to be very specific and realistic. You can add other assumptions but you are not allowed to change the above assumptions
Do the following
Here is some information to create your tables using SQL. Depending on your normalization process, some of the following fields may not be in your final normalized table.
Data Item (Column Name) |
Type |
restrictions |
PatientID |
Numeric – Integer |
|
PhysID |
Numeric – Integer |
|
RoomNo |
Numeric – Integer |
>= 100 and <= 999 |
AdmitDate |
Date |
|
PatientName |
Character -- Up to 50 |
Not null |
PatientAddress |
Character -- Up to 200 |
Not null |
RoomPhone |
Character -- Up to 8 |
|
HospitalStayDays |
Numeric – Integer |
>= 0 |
RoomRate |
Numeric – Decimal 10 with 2 decimals |
>= 30.00 and < =100.00 |
AmountOwing |
Numeric – Decimal 10 with 2 decimals |
|
PhysName |
Character -- Up to 50 |
Not null |
PhysDept |
Numeric – Integer |
|
DeptSupervisorId |
Numeric – Integer |
|
TreatId |
Numeric – Integer |
|
TreatDesc |
Character -- Up to 200 |
|
TreatCost |
Numeric – Decimal 10 with 2 decimals |
>= 50.00 |
Question #3
Create the tables related to the following ERD
Question #4
Create the tables related to the following ERD
Question #5
Create ERD based on the following tables. The underlines attributes are primary keys. The links are connection between primary keys and foreign keys
Question #6
Create ERD based on the following tables. The underlines attributes are primary keys. The links are connection between primary keys and foreign keys