A3-Ting Wei Chien(Willy)
.docx
keyboard_arrow_up
School
Santa Clara University *
*We aren’t endorsed by this school
Course
443
Subject
Computer Science
Date
Jun 11, 2024
Type
docx
Pages
5
Uploaded by CaptainMorningDonkey44
CS443 - Assignment 3
Question #1
NAME:TING WEI CHIEN(WILLY)
Consider the following Table All information have been placed in one table. Arrows show the functional dependency. You are required to place this table in 3
rd
normal form. 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.
a)
Write the tables
Table 1
: Receipt (
Receipt Number
, Sales Date)
Table 2
: Product (
Product Id
, Product Description)
Table 3
: Item (
Item Number
, Item Description)
Table 4
: Sold (
Receipt Number
, Product Id
, Quantity Sold)
Table 5
: Used (
Item Number
, Product Id
, Quantity Used)
b)
Place the tables in 3
rd
normal form (if necessary)
It’s already in 3 NF.
c)
Create ERD based on the normalized tables
Question #2
Consider the following ERD
Where
-
PatientId: It is the identification number of each patient
-
PatientName: It is the name of the patient
-
Patientddr: It is the address of the patient
-
AdmitDate: It is the date when the patient is admitted to the hospital
-
AmounOwing: The amount the patient owes based on his/her sickness after being discharged
-
RoomNo: it is the room where the patient is kept in the hospital
-
RoomPhone: The phone number in the patient’s room
-
HospitalStayDays: Number of days the patient would be in the hospital for treatment.
-
RoomRate: The rate charged for every day the patient is in the room
In the second table:
-
PhysId: It is the identification number of each physician
-
PhyName: It is the name of each physician
-
PhysDept: It is the department id where physician works
-
DeptSupervisorId: It is the id of the physician who is in change of managing the PhyDept. For example, suppose physician x works in department y. DeptSupervisorId is the id of the physician (not necessarily physician x) who in managing department y. -
TreatId is a number that represents the type of treatment the physician can do
-
TreatDesc and TreatCost are Treatment description and treatment cost
Each patient is assigned one doctor, but a doctor can have many patients
There may be more than one patient in a room but each patient is kept in one room only
There is only one phone number in each room in the hospital
Each doctor can do only do one treatment, but a treatment can be done by many doctors
The treatment cost is fixed for each treatment
Each doctor works in only one department, but a department can have many doctors
Each department has 1 supervisor. This supervisor is just one of the physicians who works in that department
A Patient is charged based on the treatment cost and number of days in hospital
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
a)
Change the ERD to tables
Table 1
: Physicians (
Phys ID
, PhyName, PhysDept, DeptSuperviosorld, TreatCost, TrearDesc, TreatId)
Table 2
: Patient (
Patient ID
, Phys ID*
, RoomPhone, RoomNo, RoomRate, Amount Owing, AdminDate, PatientAddress, PatientName, HospitalStaydays)
b)
Place the tables in 3
rd
normal form
Table 1
: Physicians (
Phys ID
, PhyName, PhysDept*
, TreatId*
)
Table 2
: Patient (
Patient ID
, RoomNo*
, Phys ID*
, AdminDate, PatientAddress, PatientName, HospitalStaydays)
Table 3
: Treat (
Treat Id
, TreatCost, TrearDesc)
Table 4
: Room (
Room No
, RoomPhone, RoomRate)
Table 5: Department (
PhysDept
, DeptSuperviosorlD*
)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Create Relation Schema for ERD in question 1(question 1 was: Create ERD for the given case study using Crows Feet Notation)
arrow_forward
SpecificationFunctional DependencyConsider the relational schemas given below and the respective sets of functional dependencies valid in the schemas. For each one of the relational schemas identify its highest normal form. Remember that the identification of a normal form requires analysis of the valid functional dependencies and the minimal keys.
TRUCK(registration#, type, owner, driver, date-used)The values of attributes of a relational table TRUCK satisfy the following properties:- a truck has a unique registration number,- a truck has only one owner,- a truck is used only once per day,- an owner owns many trucks and driver uses many trucks.
arrow_forward
Instructions: Write your answers by replacing the blue lines. Explain your answers if necessary.
REGIONAL LABS CASE QUESTIONS
Regional Labs is a company that conducts research and development work on a contract basis for other companies and organizations. Figure 3-32 shows data that Regional Labs collects about projects and the employees assigned to them. This data is stored in a relation (table) named PROJECT:
PROJECT (ProjectID, EmployeeName, EmployeeSalary)
Assuming that all functional dependencies are apparent in this data, which of the following are true?
ProjectID ->EmployeeName _______
ProjectID ->EmployeeSalary _______
EmployeeName -> EmployeeSalary _______
EmployeeSalary -> ProjectID _______
EmployeeSalary -> (ProjectID, EmployeeName) ______
What is the primary key of PROJECT?
________________________________
Are all the non-key attributes (if any) dependent on the primary key?…
arrow_forward
Instructions: Write your answers by replacing the blue lines. Explain your answers if necessary.
REGIONAL LABS CASE QUESTIONS
Regional Labs is a company that conducts research and development work on a contract basis for other companies and organizations. Figure 3-32 shows data that Regional Labs collects about projects and the employees assigned to them. This data is stored in a relation (table) named PROJECT:
PROJECT (ProjectID, EmployeeName, EmployeeSalary)
Assuming that all functional dependencies are apparent in this data, which of the following are true?
ProjectID à EmployeeName _______
ProjectID à EmployeeSalary _______
EmployeeName à EmployeeSalary _______
EmployeeSalary à ProjectID _______
EmployeeSalary à (ProjectID, EmployeeName) ______
What is the primary key of PROJECT?
________________________________
Are all the non-key attributes (if any) dependent on the primary key?
____________________________________________…
arrow_forward
SpecificationFunctional DependencyConsider the relational schemas given below and the respective sets of functional dependencies valid in the schemas. For each one of the relational schemas identify its highest normal form. Remember that the identification of a normal form requires analysis of the valid functional dependencies and the minimal keys.
FLIGHT(passenger, phone#, flight#, seat#, departure-place,departure-time)The values of attributes of a relational table FLIGHT satisfy the following properties:- a passenger has one phone number,- a passenger books seats on many different flights,- the attributes flight#, seat#, and departure place uniquely identify each passenger,- only one flight takes of from a given departure place at a given departure time.
arrow_forward
Indicate dependences and their type.
arrow_forward
Consider the following ER diagram:
storcid
address
description
value
Displays
Store
Memorabilia
The above diagram represents information pertaining to stores and the memorabilia that is
displayed within the stores.
a) Write the SQL statements to create the necessary tables to represent the above diagram,
representing as many constraints as possible. Note: you do not need to worry about
specifying types for the fields, but you do need to provide suitable foreign key option(s).
arrow_forward
Schema:
Part(PartNo, PartName, VehicleType, UnitPrice, SalesPrice)
Service(ServiceNo, PartNo, ServiceDate, CustomerNo, Qty)
Constraints: i. Vehicle Type should be V1', V2', 'V3', 'V4', or 'V5'
ii. UnitPrice and SalesPrice should be greater than zero
iii. PartNo, FK in Service refers to PartNo, PK in Part
Data:
Part
Service
P1
V1
10
12
1
01-Jan-17
C1
P2
V2
100
110
3
01-Jan-17
C1
4
P3
V1
150
175
2
3
05-Feb-18
C2
10
P4
V3
200
250
3
1
15-May-18 СЗ
9.
P5
V2
75
90
1
03-Jun-19
C1
Write a PL/SQL program to find the total profit done in the sales of a given part number in
the service of different customer vehicles. Raise an exception for invalid part number.
12345n
arrow_forward
Identify the normal form it is in. Please make sure to provide explanations to support your answer. Convert it to BCNF.
1.GRADES (S#, C#, sem, year, F#, FName, Sname, Cname, grade, crHrs)
a) Write down the following functional dependencies:
S# -->
C# -->
F# -->
b) Which normal form is the above relation in?
c) Convert it to BCNF:
2.TEACHES (C#, sem, year, F#, Fname, Foffice)
a) Write down the functional dependency for F#:
F# -->
b) Which normal form is the above relation in?
c) Convert it to BCNF
3. R (a,b,c,d,e,f,g)
Given that: d --> a
e --> f,g
a) Which normal form is the above relation in?
b) Convert it to BCNF:
arrow_forward
Write the SQL statements to create all of the necessary tables to represent the above diagram, representing as many constraints as possible. Note: you do not need to worry about specifying types for the fields, but you do need to provide suitable foreign key option(s). When playing a game, the home team name should be stored in attribute htname and the away team name should be stored in atname.
arrow_forward
Material : Relational Algebra
Course : Database Systems
Create a Relational Algebra From Entity Relational Diagram (ERD) Below for:a) Displays books published in the last 5 years from 2020.b) Displays details of customers who have done shopping (using the Join operator)c) Displays email customers who have done shopping (using the Set operator)d) Displays the ISBN book that has never been purchased (using the Set operator)
arrow_forward
A transitive dependency is equivalent to which of the following?A) A functional dependency between two or more key attributes.B) A functional dependency between two or more nonkey attributes.C) A relation that is in first normal form.D) A relation that is in second normal form.
arrow_forward
Create an unnormalized relation using student and class entities.
arrow_forward
The following functional dependencies describe a relation that is in 3NF.Book_ID -> Genre_ID, Genre_TypeGenre_ID -> Genre_Type
True or False?
Thanks.
arrow_forward
Which normal form requires that, no non-key attribute should functionally depend on a part of the primary key?
arrow_forward
Question 1:
a) Write a relation from a given digraph. b) Determine properties. c) Write in a matrix form.
文
arrow_forward
The below data is in first normal form. Normalise the data to third normal form,showing all steps with explanations.Dependency diagrams or tabular data are acceptable for the final answer.
arrow_forward
Q7: An ERD about a company has been mapped to the following Relations.
Please choose the correct statement that describes the company
Employee(ID,E.Name, Salary)
Project(Name, Location, ID)
Project Location(Name, Location)
a. A company has several projects and employees. An employee can work on
one or more projects. A project can be located at several locations
b. A company has several projects and employees. An employee can work on
a single project only and each project has several employees. A project can
be located at several locations
c. A company has several projects and employees. An employee can work on
one or more projects. A project is located at a single location
d. A company has several projects and employees. An employee can work on
one project only. A project can be located at several locations
Employee
EID
001
002
003
004
005
006
Name
Ahmad
Ali
Sameh
Salem
Huda
Ali
Department
group by Name
order by EID;
a. TWO columns and FOUR records
b. TWO columns and ONE record
c. TWO…
arrow_forward
Page - 1
DBMS - TASK 1: Draw an ERD and Map it to relational schema.
Please complete reading page 1 before going to page 2.
In this task, you will be given a text that describes a company (in page 2). Each student
should complete the steps below to fully solve the task
Represent the company description as an ER-diagram, including all relevant constraints as the
following steps:
-
Each student should download Lucidchart app
Every student should use Lucidchart to draw the ERD
Edit
Lucidchart
Blank diagram
Select View Insert Arrange Help
80
What's New
Saved
Start a free trial to access unlimited shapes and documents! X
BIUAT-
2 px None None
408
Liberation Sans
▾
10 pt +
Shapes
O
Standard
×
T
Flowchart
000
☐ ODOT
☐ ☐ ☐ ☐ ☐☐
)>0 ×
TU Xx
14
<<
ΔΟ
▼ Shapes
ΠΑ
☐ ☐
Name
B
Present
MA
when you create
After each entity
ID
print screen, your
name include your
user ID should be
shown
university ID number
Department
0190334
Dep_ID
Employee
0190334
Name
arrow_forward
Name: exis Johnsin
Using this unnormalized table and the five functional dependencies below, determine the first, second,
and third normal forms. In other words, normalize Relation1 up to third normal form.
Unnormalized Table: Relation1
A B CD
Primary key: A, B
Functional dependencies
fd1: A, B
C, D, E, F, G
fd2: B
C
fd3:
AD
E-F
fd4:
fd5: G, BH
First Normal Form
Second Normal Form
Third Normal Form
G
E F
H
arrow_forward
TASK 3: Airline transportation
AIRPORT (IDLE, name, city, country)
Relation
Relational schema
I airport
a airplane
p lands
AIRPLANE (IdTL, type, description, manufacturer)
LANDS (#IDLE, #IdTL, dateFrom)
Relation LANDS includes information about where each type of an airplane can land, on what airports and
since when.
Using domain and tuple relational calculus, find:
1. Find all names of the airports, where type B747 airplanes can land.
2. Find all IDLE of airports, on which type B747 or B748 airplanes can land
3. Find all IdLE of airports, which are located in Austria or that type B747 airplane can land on them.
4. Find all IDLE of airports, on which all types of planes can land.
arrow_forward
4. In a company, employees involved in many projects, and each project may have
many employees working on it. The number of hours each employee works in
each project, and the start date on which the employee starts working on the
project are capture in the following relational table.
EmployeeProject (EmpeNum, ProjNum, HoursWork,
DateStartWorkOnProj)
arrow_forward
Q1. explain the relation between them VERYBRIEFLY: => [span and live time], [scope and principle of proximity]
arrow_forward
19.
The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation .
a.
Referential relation
b.
Referencing relation
c.
Referenced relation
d.
Referred relation
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Create Relation Schema for ERD in question 1(question 1 was: Create ERD for the given case study using Crows Feet Notation)arrow_forwardSpecificationFunctional DependencyConsider the relational schemas given below and the respective sets of functional dependencies valid in the schemas. For each one of the relational schemas identify its highest normal form. Remember that the identification of a normal form requires analysis of the valid functional dependencies and the minimal keys. TRUCK(registration#, type, owner, driver, date-used)The values of attributes of a relational table TRUCK satisfy the following properties:- a truck has a unique registration number,- a truck has only one owner,- a truck is used only once per day,- an owner owns many trucks and driver uses many trucks.arrow_forwardInstructions: Write your answers by replacing the blue lines. Explain your answers if necessary. REGIONAL LABS CASE QUESTIONS Regional Labs is a company that conducts research and development work on a contract basis for other companies and organizations. Figure 3-32 shows data that Regional Labs collects about projects and the employees assigned to them. This data is stored in a relation (table) named PROJECT: PROJECT (ProjectID, EmployeeName, EmployeeSalary) Assuming that all functional dependencies are apparent in this data, which of the following are true? ProjectID ->EmployeeName _______ ProjectID ->EmployeeSalary _______ EmployeeName -> EmployeeSalary _______ EmployeeSalary -> ProjectID _______ EmployeeSalary -> (ProjectID, EmployeeName) ______ What is the primary key of PROJECT? ________________________________ Are all the non-key attributes (if any) dependent on the primary key?…arrow_forward
- Instructions: Write your answers by replacing the blue lines. Explain your answers if necessary. REGIONAL LABS CASE QUESTIONS Regional Labs is a company that conducts research and development work on a contract basis for other companies and organizations. Figure 3-32 shows data that Regional Labs collects about projects and the employees assigned to them. This data is stored in a relation (table) named PROJECT: PROJECT (ProjectID, EmployeeName, EmployeeSalary) Assuming that all functional dependencies are apparent in this data, which of the following are true? ProjectID à EmployeeName _______ ProjectID à EmployeeSalary _______ EmployeeName à EmployeeSalary _______ EmployeeSalary à ProjectID _______ EmployeeSalary à (ProjectID, EmployeeName) ______ What is the primary key of PROJECT? ________________________________ Are all the non-key attributes (if any) dependent on the primary key? ____________________________________________…arrow_forwardSpecificationFunctional DependencyConsider the relational schemas given below and the respective sets of functional dependencies valid in the schemas. For each one of the relational schemas identify its highest normal form. Remember that the identification of a normal form requires analysis of the valid functional dependencies and the minimal keys. FLIGHT(passenger, phone#, flight#, seat#, departure-place,departure-time)The values of attributes of a relational table FLIGHT satisfy the following properties:- a passenger has one phone number,- a passenger books seats on many different flights,- the attributes flight#, seat#, and departure place uniquely identify each passenger,- only one flight takes of from a given departure place at a given departure time.arrow_forwardIndicate dependences and their type.arrow_forward
- Consider the following ER diagram: storcid address description value Displays Store Memorabilia The above diagram represents information pertaining to stores and the memorabilia that is displayed within the stores. a) Write the SQL statements to create the necessary tables to represent the above diagram, representing as many constraints as possible. Note: you do not need to worry about specifying types for the fields, but you do need to provide suitable foreign key option(s).arrow_forwardSchema: Part(PartNo, PartName, VehicleType, UnitPrice, SalesPrice) Service(ServiceNo, PartNo, ServiceDate, CustomerNo, Qty) Constraints: i. Vehicle Type should be V1', V2', 'V3', 'V4', or 'V5' ii. UnitPrice and SalesPrice should be greater than zero iii. PartNo, FK in Service refers to PartNo, PK in Part Data: Part Service P1 V1 10 12 1 01-Jan-17 C1 P2 V2 100 110 3 01-Jan-17 C1 4 P3 V1 150 175 2 3 05-Feb-18 C2 10 P4 V3 200 250 3 1 15-May-18 СЗ 9. P5 V2 75 90 1 03-Jun-19 C1 Write a PL/SQL program to find the total profit done in the sales of a given part number in the service of different customer vehicles. Raise an exception for invalid part number. 12345narrow_forwardIdentify the normal form it is in. Please make sure to provide explanations to support your answer. Convert it to BCNF. 1.GRADES (S#, C#, sem, year, F#, FName, Sname, Cname, grade, crHrs) a) Write down the following functional dependencies: S# --> C# --> F# --> b) Which normal form is the above relation in? c) Convert it to BCNF: 2.TEACHES (C#, sem, year, F#, Fname, Foffice) a) Write down the functional dependency for F#: F# --> b) Which normal form is the above relation in? c) Convert it to BCNF 3. R (a,b,c,d,e,f,g) Given that: d --> a e --> f,g a) Which normal form is the above relation in? b) Convert it to BCNF:arrow_forward
- Write the SQL statements to create all of the necessary tables to represent the above diagram, representing as many constraints as possible. Note: you do not need to worry about specifying types for the fields, but you do need to provide suitable foreign key option(s). When playing a game, the home team name should be stored in attribute htname and the away team name should be stored in atname.arrow_forwardMaterial : Relational Algebra Course : Database Systems Create a Relational Algebra From Entity Relational Diagram (ERD) Below for:a) Displays books published in the last 5 years from 2020.b) Displays details of customers who have done shopping (using the Join operator)c) Displays email customers who have done shopping (using the Set operator)d) Displays the ISBN book that has never been purchased (using the Set operator)arrow_forwardA transitive dependency is equivalent to which of the following?A) A functional dependency between two or more key attributes.B) A functional dependency between two or more nonkey attributes.C) A relation that is in first normal form.D) A relation that is in second normal form.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education