1 / 37

Lesson 02:

Lesson 02:. Creating Database. At the end of this lesson, students should be able to: . Save database file Create table by using wizard Differentiate field, record and table Define primary key Insert data in the table Save table Find record from table. Field 1 (numbers).

lori
Download Presentation

Lesson 02:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 02: Creating Database

  2. At the end of this lesson, students should be able to: • Save database file • Create table by using wizard • Differentiate field, record and table • Define primary key • Insert data in the table • Save table • Find record from table

  3. Field 1 (numbers) Field 1 (name) Field 1 (address) Field 1 (icno) Creating Table For example, students profiles table as shown below. (Figure 1) record 2 Figure 1

  4. Steps Creating Table • Open MS Access 2003 software • Click File, click Open, find students profiles database file then click Openbutton. (refer Figure 2) Figure 2

  5. Database window students profile: Database will appeared as shown below (Figure 3) then click Newbutton at database windows toolbar. The dialog box in Figure 4 will appear. Figure 3

  6. Click Design View , then click OK to get Datasheet view as shown at Figure 5. Design View Figure 4 Figure 5

  7. At Field Namecolumn, type in numbers and at Data typecolumn, change value Text to Number. (refer Figure 6) Click this button to view the list of data type, then click number Figure 6

  8. There are 10 types of data as stated in the table below:

  9. There are 10 types of data as stated in the table below:

  10. Insert data in the Field Name, Data Types for each fields as displays (Figure 7). Students can move to the next column by press “Tab key”. Place the cursor at address Figure 7 Change Field Size value to 100 Figure 8

  11. Click numbers at field name column, click at Edit menu bar, then click • Primary Key or icon Primary Key . Shown • at Figure 9. Primary key icon close icon Figure 9

  12. Click Close icon as shown at figure 8 to • close the creating table session. Then • dialog box in figure 9 displayed. Figure 10 • Click Yes. Dialog box Save As in figure 10 • displayed Key in table name here Figure 11

  13. Type students profile at Table Name and • then click OK at dialog box as shown in • figure 10. Now you had finished creating • one table named “students pofile:database” • as shown below. (Figure 12) students profile table created Figure 12

  14. Inserting Data in the Table • Click at Students Profile table then click open at database window toolbar. • (Figure 13) Figure 13

  15. Datasheet view Students Profile : Table as shown in Figure 14 displayed Figure 14 • Key in data at the students profile datasheet

  16. At the first row, type number ‘1’ at numbers column. Then, Type name Abdul Rahman b. Idris at name column. Next, type address and ic number at address and icno column. Figure 15

  17. Insert all data in the table by repeating the same process above. As a result, students will get the table below Figure 16 • Click icon save to saving file. Students Profile table now contained five records • Click icon close to close the inserting data session

  18. Add Records • Open Microsoft Access 2003 • Click Open an Existing Database, then click file students profile and click OK. • In the database window, double click students profile in the Tables pane to open the table in Datasheet view, as shown in figure 17.

  19. To add new record, click on icon New Record that can be seen at database toolbar or at the bottom of datasheet window. (refer Figure 17). Icon New record Figure 17

  20. Add five more record as below. (refer table 1) Table 1 • Save record. • Close students profile : Table.

  21. Add Fields Method 1: Add field after the last field. • Click Design button at database toolbar windows Students Profile: Database, to display all the fields. • Click field below icno (refer Figure 18)

  22. Type in email inside the Field Name and select text as the Data Type. Figure 18 • Save the record

  23. Add Fields Method 1: Add field after the last field. • Click Design button at database toolbar windows Students Profile: Database, to display all the fields. • Click field below icno (refer Figure 19)

  24. Figure 19 • Save the record

  25. Method 2: Add new field in between the two fields • Click Design button at database toolbar windows Students Profile: Database, to display all the fields. • Click the address field ( the row will be highlight -refer Figure 20 )

  26. Figure 20 • Put cursor in between field name and field address. • Type in sex inside the blank Field Name and select text as the Data Type.(refer Figure 20)

  27. Put cursor in between field name and field address. • Type in sex inside the blank Field Name and select text as the Data Type.(refer Figure 20) • Save students profile. • Click to close students profile : Table.

  28. Edit Record. Open Students Profile table. 2. To edit record, click inside the selected field. (sex and email) 3. Insert in all the record for sex field and email field. (refer Table 2)

  29. Table 2

  30. 3. Repeat step 2 above to add in 5 postcodes (see bold figure) inside the first five record. (Refer Table 3). Table 3

  31. Finding Record From Table • Click field name as shown in Figure 21. Icon Find Figure 21

  32. Click icon Find (refer Figure 21) and dialog box Find and Replace will be display as below (Figure 22). Figure 22

  33. 3. Type in Noor* inside box Find What to find all the name starting with Noor. • Click Find Next button. Name Noorul-Aini bt Ambak will be highlighted at name field (refer figure 23). Figure 23

  34. Click Find Next button to find similar name with Noor. Name Noor Asiah bt Zakaria will be highlighted. 6. You can repeat step 3 to find other record. 7. Click File and Close to end this session.

More Related