Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 02: Creating Database. Save database file Create table by using wizard Differentiate field, record and table Define primary key Insert data in.

Similar presentations


Presentation on theme: "Lesson 02: Creating Database. Save database file Create table by using wizard Differentiate field, record and table Define primary key Insert data in."— Presentation transcript:

1 Lesson 02: Creating Database

2 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 At the end of this lesson, students should be able to:

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

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

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

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

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

8 6.There are 10 types of data as stated in the table below: Types DataFunction TextYou may type in any alphabetical/numerical data that you desire-up to a maximum of 255 characters. As indicated, this is a text field, so you can't do mathematical calculations. Examples of Text data are: names, addresses, stock numbers, room numbers, zip codes, etc

9 MemoThis field is for lots of text. You can have up to 32,000 characters. NumberThis field is for numbers where you want to add, subtract, multiply, divide, average, and do numerical calculations. This field can be a very large size, so when we get to Field Properties, we'll talk about "sizing" this field so it doesn't take up too much "space" in storage.

10 Types DataFunction Date/TimeDates and Times. You may format this later, as you may desire. CurrencyDollar ($). You may format this later, as you may desire. For example Ringgit Malaysia (RM) AutoNumberThis field is an "automatic" counter that assigns a number each time you put data into a new field.

11 7.There are 10 types of data as stated in the table below: Types DataFunction OLE ObjectThis means "Object Link Embedding" which indicates you can insert a graphic, picture, sound, etc. Pretty neat to put a photograph in a personnel record or a picture of an inventory item in the stock record (advanced stuff).

12 HyperlinkA hyperlink is a pointer from one object to another. The destination is frequently another Web page, but it can also be a picture, an e- mail address, a file (such as a multimedia file or Microsoft Office document), or a program. The hyperlink itself can be displayed as text or as a picture. Lookup Wizard This wizard creates a lookup column, which displays a list of values you can choose from.

13 8.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”. Figure 7 Place the cursor at address Change Field Size value to 100 Figure 8

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

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

16 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) Figure 12 students profile table created

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

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

19 4.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

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

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

22 4.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). Figure 17 Icon New record

23 5.Add five more record as below. (refer table 1) nameaddressicno Alias b MohamadNo. 5, Jalan Desa Kayang 3, Desa kayang, 01000 Kangar. 950918-02-5533 Mohd Shahid b Mohd Som No. 39, Taman Tapah, Jalan Pahang 35000 Tapah, Perak. 950912-05-5321 Noorul-Aini bt AmbakNo 15, Jalan Limau Kasturi, 4/4A 40000 Shah Alam, Selangor. 950212-11-5678 Noor Asiah bt ZakariaLot 2646, Kg Simpang Tiga, Bt 6 3/4, 53100 Gombak, Selangor 950402-04-5566 Fasitah bt. MansorNo. 36, Jln. Melati, Tmn. Mewah, 31000 Batu Gajah, Perak 950606-03-5432 Table 1 6. Save record. 7.Close students profile : Table.

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

25 3.Type in email inside the Field Name and select text as the Data Type. Figure 18 4.Save the record

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

27 Figure 19 3.Save the record

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

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

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

31 1.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) Edit Record.

32 numbersnamesexaddressemail 1Abdul Rahman b. Idrismaleabd_@yahoo.com 2Johana bt. Muhammadfemalejohana@hotmail.com 3Faridah bt AbdullahFemalegetz@yahoo.com 4Rosnani bt. SembokFemalerosnani@hotmail.com 5Hassan b. WahidMalehassan@yahoo.com 6Alias b MohamadMalealias@yahoo.com 7Mohd Shahid b Mohd SomMaleshah@hotmail.com 8Noorul-Aini bt AmbakFemalenoorul@hotmail.com 9Noor Asiah bt ZakariaFemalenoor@yahoo.com 10Fasitah bt. Mansorfemalefasitah@hotmail.com Table 2

33 3. Repeat step 2 above to add in 5 postcodes (see bold figure) inside the first five record. (Refer Table 3). Numbers NameSexAddress 1Abdul Rahman b. Idrismale 2304, Rumah Rumah Tasek Gelugor, 13300 Pulau Pinang 2 Johana bt. Muhammad sxsMMMuhammad female No 24, Jln 1, Taman Seri Sinar, 50600 Kulal Lumpur 3Faridah bt AbdullahFemale No 39, Jln Pinang Merah 11, 81000 Bandar Tengg, Johor 4Rosnani bt. SembokFemaleNo 1005, Kuala Terengganu, Terengganu 5 Hassan b. Wahid Choong Fook Keong MaleNo 101, Taman Kelang, Selangor Table 3

34 Finding Record From Table 1.Click field name as shown in Figure 21. Figure 21 Icon Find

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

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

37 5.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.


Download ppt "Lesson 02: Creating Database. Save database file Create table by using wizard Differentiate field, record and table Define primary key Insert data in."

Similar presentations


Ads by Google