Step y step exercise. Creating a Table.
Practising the procedures to create and open a data table with Access2003.
1 If Access is not open, open it to be able to carry out the exercise.
2 Open the Classes.mdb database which is found in the My documents folder.
We are going to create two tables in the database. One table will be for the students and the other for the courses.
We will start by creating the Students table.
3 Double click on Create table in design view in the database window with Tables object selected.
Or, click on the New button in the database window, select Design View, and click on the OK button.
4 In the first row write the name of the first field, Student Code.
5 Press the ENTER key to go to the second column of the field.
6 By default, once situated in the second column the Data Type is Text, click on the arrow on the right and select Autonumber.
7 Press the ENTER key to go to the third column, but we will not use it. For the moment we will not change the properties of this field.
8 Press the ENTER key to go to the next field.
9 Write Student name as the Field Name of the second field. Leave Text as Data Type and position yourself in the third column.
10 In the Description column in the grid write: Type the student name. Press ENTER to go to the next column.
11 Write Student surname.
12 Press ARROW BELOW on the keyboard to go to the next row.
13 Now create the following fields: Address, City which will all be of the Text type and Postcode as numeric.
14 Next create a Date of birth field with Date/Time data type.
Now we are going to make Student code the Primary key so as not to have two students with the same code.
15 Click on Student code.
16 Click on the Primary key button on the taskbar.
To the left of the field name a key will appear, indicating that this field is the primary key of the table.
Now we can save the table.
17 Drop down the File menu.
18 Select the Save option.
19 When asked for the name of the table, write Students.
20 Click on the OK button.
Now we will close the table.
21 Drop down the File menu.
22 Select the Close option.
Now we will create the second table:
23 Click on the New button in the Database window.
24 Select Design View.
25 Click on the OK button.
26 In the first row write the name of the first field, Course code.
27 Press the ENTER key to go to the second column of the field.
28 Choose as Number as Data Type.
29 Press the ENTER key to go to the third column of the field.
30 Press the ENTER key to go to the next field.
31 Type Course name as the name in the second field of the table.
32 As we do not wish to change any of the other characteristics of the field, press the ARROW BELOW to go to the next field.
33 Type Hours , and select data type Number. (you can drop down the list or type the first letter (N))
34 Create the following fields: Start date and Finish date - data type: Date/Time.
Now we will define Course code as the Primary key.
35 Click on Course code.
36 Click on the Primary key button on the taskbar.
On the left of the field name a key will appear, indicating that this field is the primary key of the table.
Now we can save the table.
37 Click on the Save button on the toolbar.
38 Type Courses as the name of the table.
39 Click on the OK button.
40 Click on the Close button in the Design window of the table.
41 Click on the Close button in the Database window to close to database.
Legal warning: Authorised on-line use only. It is not allowed the use of these courses in companies or private teaching centres.
© aulaClic. All rights reserved. Reproduction in any form whatsoever is prohibited. April-2006.