Ict200 - Lab Exercise
Ict200 - Lab Exercise
Dr. Jamil Abdullah Optometry Centre plans to use a database system to support its
operations. The
optometry Centre currently has four optometrists and is open from Monday to Friday
from 9.00 am to 5.00pm. Given below are the scenarios at the optometry center.
One patient can make many payment, but a single payment is made
by only one patient. Some patients are insured by insurance
company. If they are insured, they can only carry insurance with
one company.
For a patient that carries insurance, the insurance company will make
payment; each single payment is made by only one insurance
company.
b)List two example of report that can be produced from this database system.
Solution
Entity: RED
Relationship: GREEN
Attribute: BLUE
Relational scheme:
about:blank 1/5
12/18/23, 10:26 AM ICT200 - LAB EXERCISE
ANSWER :
about:blank 2/5
12/18/23, 10:26 AM ICT200 - LAB EXERCISE
This is a preview
Do you want full access? Go
db2 => create table optometrist(optometrist_ICNo char(12) not null, optometrist_name
varchar(20), optometrist_telephoneNo char(12) notPremium and unlock all
5 pages
null, optometrist_address
varchar(20), optometrist_roomNo char(12) not null, constraint pk_optometrist primary
key(optometrist_ICNo))
Access to all documents
db2 => create table patient(patient_name varchar(20) not null, patient_ICNo char(12)
Getvarchar(20),
not null, patient_telephoneNo char(12) not null, patient_address Unlimited Downloads
constraint
pk_patient primary key(patient_name))
Improve your grades
db2 => create table appointment(patient_name varchar(20) not null, optometrist_name
varchar(20) not null, appointment_date date, appointment_time time)
db2 => alter table appointment add constraint pk_appointment primary
key(patient_name,optometrist_name)
Free Trial
Get 7 days of free
db2 => create table payment(payment_amount char(12) not null, payment_method
varchar(20) not null, payment_receiptNo char(12) not null)
Premium
db2 => alter table payment add constraint pk_payment primary key(payment_method)
about:blank 3/5
12/18/23, 10:26 AM ICT200 - LAB EXERCISE
about:blank 4/5
12/18/23, 10:26 AM ICT200 - LAB EXERCISE
about:blank 5/5