Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Biostatistics

Practical Session DB1

WARNING
Section:

REMEMBER TO SAVE YOUR WORK! You must deliver it at the end of Practical Session DB3 Goal: Creation of a new database and design new tables.

1. First, you have to create a new database. Call it Practice1.mdb 2. Next, create a new table to fill the patients information. Call the table PATIENTS. It must include this fields:
Field Name HISTORYNUMBER NAME ADDRESS CITY PHONE POSTAL CODE BORNDATE SEX AMOUNTDUE Data type Number Text Text Text Text TEXT Date/Time Text Currency Size Long Integer 40 50 25 11 5 Title Surname and Name Street, number and floor/door Others Required

Day, Month and Year Use lookup wizard & limit to list

You have to assign as primary key the field HISTORYNUMBER. 3. Create a NEW TABLE to record the doctors info. Call it DOCTORS. It has to include this fields:
Nombre del campo LICENSENUMBER NAME SPECIALITY Tipo de datos Number Text Text Tamao Long Integer 30 30 Titulo Surname and Name Otras Required

You have to assign the field LICENSENUMBER as primary key. 4. Create a NEW TABLE to record CONSULTATION information. Call it CONSULTATIONS. It will consist of these fields:
Nombre del campo CONSULTATIONNUMBER HISTORYNUMBER LICENSENUMBER DATE DIAGNOSTIC MEDICATION SUBTOTAL BILLED AMOUNTPAID Tipo de datos Number Number Number Time/Date Text Memo Currency Yes/No Currency Tamao Long Integer Long Integer Long Integer Otras

Validation: Lower or equal to now()

Consultation Amount Amount paid

Dentistry

Biostatistics

Practical Session DB1

CONSULTATIONNUMBER will be the primary key.

Section:

Goal: Practice using data sheets

1. Open the PATIENTS table and fill in 10 records. At least two patients must come from Valencia. Close the table when you are done. 2. Open the DOCTORS table and fill in 10 records. 3. Using the PATIENTS table, try to do this: a. RESIZE the columns to the size of its contents. (RIGHT BUTTON COLUMN WIDTH) b. ORDER by name all the records from column NAME. (RECORDS SORT or RIGHT BUTTON) Notice the order effect on the other columns. Try the same with the other columns. c. Ask Access to SEARCH a random datum in the table. (edit find) E.g.: try to find a patient from VALENCIA or a patient whose phone number starts with 321 (if theres any). d. Create and apply a SELECTION FILTER that: Shows only the MALE patients. Shows only patients from VALENCIA. e. MOVE the column PHONE to the left of column NAME. Try to move other columns. f. HIDE columns AMOUNTDUE and SEX. Show them again. Try the same using other columns. g. FREEZE the column HISTORYNUMBER. Try to move other columns to the left of it. Unfreeze this column. h. Try to create a NEW RECORD and use a HISTORYNUMBER that already EXISTS at the table. Look at the event when you try it. (the system locks the change because you cannot have to equal values in a column that is a tables primary key)

Section:

Goal: Stablish relationts among tables and practice with referential integrity.

1. From ACCESS main window find RELATIONSHIPS at the TOOLS. 2. Add the three tables to create relationships among them. 3. Create these relations among the tables: All relations will be created ENFORCING REFERENTIAL INTEGRITY, with CASCADE UPDATES AND DELETIONS.

Dentistry

Biostatistics

Practical Session DB1

a. Create a relationship between PATIENTS HISTORYNUMBER and CONSULTATIONS HISTORYNUMBER. b. Create another relationship between DOCTORS LICENSENUMBER and CONSULTATIONS LICENSENUMBER. 4. Open the CONSULTATIONS table and fill in 10 records. Remember that, due to the relationship stablished between LICENSENUMBER and HISTORYNUMBER, Access will only let you fill in records using values that previously exist at DOCTORS and PATIENTS tables. 5. Try entering some patients or doctors that do not exist at DOCTORS or PATIENTS in the table CONSULTATIONS and see what happens. 6. Create 2 records at CONSULTATIONS with the same PATIENT historynumber. 7. Close the table CONSULTATIONS. 8. Open the table PATIENTS, look for the record whit the code used at exercise 6. Change the HISTORYNUMBER using a new non-existent number. 9. Close the table PATIENTS. 10. Open the table consultations and check that the two records created at exercise 6 have their HISTORYNUMBER modified. This is what we call a CASCADE UPDATE. 11. Close CONSULTATIONS table. 12. Open the table PATIENTS and look for the record you changed before at exercise 8. Delete it. 13. Close PATIENTS table. 14. Open the CONSULTATIONTS table and check that the records that had the deleted HISTORYNUMBER have been deleted too. This is what we call a CASCADE DELETION. 15. Close the table and COPY the DATABASE to a USB PEN or send it to yourself by e-mail. You will need it at the next practical session. WHEN YOU HAVE FINISHED, YOU MAY LEAVE THE CLASS! HAVE A NICE DAY!

Dentistry

You might also like