Selasa, 29 Mac 2011

EXERCISE

EXERCISE
1.a) What is the definition of relational key and why it is needed?
        A key consists of one or more attributes that can be identified in a row and relational key is an attributes that relates one entity with another entity in a relationship
Why  is needed?
Relational key enables us to link the tables together in a database for easier data access storage
   b) List and explain 4 types of relational keys
     Candidate key: an attributes or group of attributes that identity a unique rows in a relation. One of       the candidate key in chosen to be the primary key.
     Primary key:any of the candidates that are selected to the key or an attributes that uniquesly identites each row in a relational table.
     Foreign key: an attributes in one table where values must match the primary key in another table or whose value must not be full
     Composite key: a primary key that consists of more than one attributes especially in (M.N) relationship
   c) Based on the table given below, answer all the following questions
Borrower : Table
Borrower ID             BorrowerName           ContactNo             Address           category         age       datebirth 
01-200506-002            Ali Ahmed               03-12345678         sental                 student          18          02 feb
01-200506-012           Aminah hasan         03-12345678         bandar baru       student         20           15 feb
What is the name for the above table?
   Borrower                                                                                 
What is the primary key for the above table?
    BorrowerID
What is the data type for borrower’s name category age and date of birth columns?
      Text

2.Based on the diagram know’s draw a complete entity relationship diagram (ERD) which includes entity attributes relationship,candinality constraints and by attributes.
Housecode
Address
Rentalrate
Tenantcode
Tenantname
Startdate
Griddate
H0021
SENTUL
RM560
T0021
Ali
01/10/04
30/09/05
H0022
KAJANG
RM600
T0022
Aminah
01/12/04
30/11/05
H0023
BANGI
RM850
T0023
Stephen
01/01/04
31/12/04








OwnerNo                        Housecode                Tenantcode
OwnerName                   Address                     Tenant name
                                          Rentaldate                Startdate
address
ownerhouse househouse

                                                                              Enddate





 SECTION B

Based on the diagram above create a complete ERD which includes entity attributes,relational key and cardinality.



QUESTION 2
                                             DR IDZHAM DENTAL CLINIC
                                                     Taman ulu kluang
                                                            Selangor

PatientID: KK 00120                                             Address: Bukit Antarabangsa     
Patientname: Mr Richard Gene                         ICNO:450101-01-0121
RegistrationID: PP15412                                     Registration date:01/12/05

                                                APPOINTMENT DATE/TIME
AppointmentID                   date                        time                      DoctorID             DoctorName  
B0001                                05/12/05                   2.00AM                  DD005                    DR.Ali      
B0002                               15/01/06                    3.00PM                  DD002                 DR.Aminah




QUESTION 3
a)what is the meaning of database and database management system (DBMS)?
  Database is collection is related data,designed to meet  the information needed in an organisation and stores it in one specific location.
Database management  system (DBMS) Is a collection of progress that enable user to create and maintain a database and provide control access to the database

b)There are 4 types of attributes,list down and give definition,example and symbol

QUESTION 4
Everyday,there are five doctors is on duty in orthopedic words .they are working on shif. A doctor can give a treatment to their patients and each patients can received a treatment from many doctor based on type of diseases. A patient can take a medicane could be town by many patients.
         i.            Doctor information is Doctor ID and Doctor Name
       ii.            Patient information is Patient ID ,Patient Name and address
      iii.            Medicine information is medicinecode and medicinename
     iv.            For each treatment it had type of treatment, it had type of treatment and cast of treatment
       v.            For each accepted medicine, it has a quantity and date


Create one complete end for situation given 

Tiada ulasan:

Catat Ulasan