QUESTION 5 Table 5.1, 5.2 and 5.3 show instances for three (3) relations, Patient, Treatment and Doctor. Table 5.1: Patient(PID, PName, PGender, PDOB, Address, PTelNo) Address PID PName PGender P1 Ali Male P2 Ani Female P3 Wahab Male P4 Yan Male DID D11 Aminah D22 Jenny D33 Hamid PDOB 01-01-1974 12-10-1970 03-08-1980 08-06-1981 Tmn. Universiti, Skudai, Johor Tmn. Pulai Perdana, Johor Tmn. Pulai Jaya, Johor Tmn. Pulai Emas, Johor Table 5.2: Treatment (PID, TreatDate, DID PID TreatDate DID P1 23-01-2007 D11 P3 23-01-2007 D11 P1 25-06-2009 D33 P4 25-06-2009 D22 Table 5.3: Doctor (DID, DName, DGender, DDOB, Address, DTelNo) DName DGender Address PTelNo 07-5211234 07-5217894 DDOB Female 11-11-1974 Tmn. Universiti, Skudai, Johor Female 12-16-1973 Tmn. Pulai Perdana, Johor Male 03-10-1974 Tmn. Pulai Jaya, Johor DTelNo 07-5214444 07-5217878 07-5214563

Database Systems: Design, Implementation, & Management
11th Edition
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Chapter10: Transaction Management And Concurrency Control
Section: Chapter Questions
Problem 1P
icon
Related questions
Question

The subject is called database

QUESTION 5
Table 5.1, 5.2 and 5.3 show instances for three (3) relations, Patient, Treatment and Doctor.
Table 5.1: Patient(PID, PName, PGender, PDOB, Address, PTelNo)
Address
PID PName PGender
P1 Ali
Male
P2 Ani
Female
P3 Wahab Male
P4
Yan
Male
DID
D11 Aminah
D22 Jenny
D33 Hamid
PDOB
01-01-1974
12-10-1970
03-08-1980
08-06-1981
Tmn. Universiti, Skudai, Johor
Tmn. Pulai Perdana, Johor
Tmn. Pulai Jaya, Johor
Tmn. Pulai Emas, Johor
Table 5.2: Treatment (PID, TreatDate, DID
PID TreatDate DID
P1
23-01-2007 D11
P3
23-01-2007 D11
P1
25-06-2009 D33
P4
25-06-2009 D22
Table 5.3: Doctor (DID, DName, DGender, DDOB, Address, DTelNo)
DName DGender
Address
PTelNo
07-5211234
07-5217894
DDOB
Female 11-11-1974 Tmn. Universiti, Skudai, Johor
Female 12-16-1973 Tmn. Pulai Perdana, Johor
Male 03-10-1974 Tmn. Pulai Jaya, Johor
DTelNo
07-5214444
07-5217878
07-5214563
Transcribed Image Text:QUESTION 5 Table 5.1, 5.2 and 5.3 show instances for three (3) relations, Patient, Treatment and Doctor. Table 5.1: Patient(PID, PName, PGender, PDOB, Address, PTelNo) Address PID PName PGender P1 Ali Male P2 Ani Female P3 Wahab Male P4 Yan Male DID D11 Aminah D22 Jenny D33 Hamid PDOB 01-01-1974 12-10-1970 03-08-1980 08-06-1981 Tmn. Universiti, Skudai, Johor Tmn. Pulai Perdana, Johor Tmn. Pulai Jaya, Johor Tmn. Pulai Emas, Johor Table 5.2: Treatment (PID, TreatDate, DID PID TreatDate DID P1 23-01-2007 D11 P3 23-01-2007 D11 P1 25-06-2009 D33 P4 25-06-2009 D22 Table 5.3: Doctor (DID, DName, DGender, DDOB, Address, DTelNo) DName DGender Address PTelNo 07-5211234 07-5217894 DDOB Female 11-11-1974 Tmn. Universiti, Skudai, Johor Female 12-16-1973 Tmn. Pulai Perdana, Johor Male 03-10-1974 Tmn. Pulai Jaya, Johor DTelNo 07-5214444 07-5217878 07-5214563
Based on these relations, answer all questions in Question (a) - (d).
Write the SQL statement to create a table named Patient for the Patient relation.
Write the SQL statement to update the telephone number of a patient with ID
number D33 to 019-7558088.
(a)
(b)
(c)
(d)
Write the SQL statement to list patient information (ID number, name and telephone
number) with the doctor's information (ID number and name) for patients who
receive treatment on 25 June 2009.
You want to list all doctors (doctor's ID number and doctor's name) who perform
treatment to patients. You run the following SQL statement. What will be displayed
when the SQL statement execute? If the statement is correct, show the result
displayed. If the statement is incorrect, state what the possible error(s) to the SQL
statement and write the correct SQL statement.
SELECT DID, DName
FROM DOCTOR D, TREATMENT T
WHERE DID = 'D22' and D.DID=T.DID;
Transcribed Image Text:Based on these relations, answer all questions in Question (a) - (d). Write the SQL statement to create a table named Patient for the Patient relation. Write the SQL statement to update the telephone number of a patient with ID number D33 to 019-7558088. (a) (b) (c) (d) Write the SQL statement to list patient information (ID number, name and telephone number) with the doctor's information (ID number and name) for patients who receive treatment on 25 June 2009. You want to list all doctors (doctor's ID number and doctor's name) who perform treatment to patients. You run the following SQL statement. What will be displayed when the SQL statement execute? If the statement is correct, show the result displayed. If the statement is incorrect, state what the possible error(s) to the SQL statement and write the correct SQL statement. SELECT DID, DName FROM DOCTOR D, TREATMENT T WHERE DID = 'D22' and D.DID=T.DID;
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Complex Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning