Sunday 20 March 2011

Blog Tutorial 1 - Table and Relationship

TABLE AND RELATIONSHIP

To create Table by using Design View
Create table


v  Select Table > click on Create table in Design View > you will see a Table properties

·         Field Name           -               Identifies the information within a field
·         Data Type             -               Determine the type of information you can enter in a field, such as text,
                                                       numbers or dates.

To create Student table
 

v  Type the data at Field Name column , choose the Data Type and change the field size as below:
Field Name                Data Type                    
StudentID                     Text (15)
StudentIC                     Text (50)
StudentName               Text (100)
Attendance                   Yes/No

To Insert Row
v  To insert Row > highlight the column that you want to insert the row > than right click at the column that you highlight > choose Insert Rows.
               


To Delete row
v  To delete the row that you insert > highlight the column that you want to delete > than right click at the column that you highlight > choose delete Row


To Insert primary key
v  Before you save the table you need to insert Primary key. To insert Primary key > highlight the first column > right click > choose the Primary Key > and you will see the Primary Key sign
 

To Save
v  To save > click on to save button > you will see a save as dialog box >  type Student > click to OK button > you will see the title of the table.


To create Relationship

v  To create relationship > click Relationship icon > you will see a few tables below > choose one by one and click add > than click close button.
v  Choose doctor , Patient , Registration and Treatment as below:


v  Click RegID (Foreign Key) and drag to RegID (Primary Key) > choose Enforce Referential Integrity and click > than click ok > than save



To Enter Data

v  Open the Doctor > click the first empty cell > enter the data for a record at first cell  > and press enter to move to next cell . As per below data > than click close

·         DoctorID – D001
·         DoctorName – Anusha
·         TypeOfSick – Fewer
·         Price – 20
·         MedicalLeave – tick
·         TreatID – T001



To create Table by Using Wizard

To Create table


v  Click Table > choose and click Create Table By Using Wizard > you will see Table Wizard below
v  Choose the table category > choose the sample table > choose the sample table as per below that you want to include in your table > and click next button.

·         Students                     - StudentClassID
                                        - ClassID
                                        - StudentID
                                        - Grade

·         Students and Classes - FirstName
                                        - LastName
                                        - Address
                                        - PhoneNumber
v  Once you click the next button, you will see another box > give a name for your table > and click next
    button again.
v  Click next to continue > choose enter data directly into the table options > click finish button



To enter data


v  To enter the data into the table > click on the empty cell > the first cell is auto update > Update the data as per below:

·         Student Class ID   - auto update
·         First Name           - sara
·         Last Name           - Charu
·         Address               - Skudai
·         Phone Number     - 0123456677
·         Class ID              - 1234
·         Student ID           - 1


v  Click close button > when you finish entering the data





No comments:

Post a Comment