Download presentation
Presentation is loading. Please wait.
Published byDarrell Barton Modified over 9 years ago
1
Skills © Paradigm Publishing, Inc. 1 Skills © Paradigm Publishing, Inc. 1
2
Skills © Paradigm Publishing, Inc. 2 Skills © Paradigm Publishing, Inc. 2 SECTION 2 SKILLS Creating Tables and Relationships 2.1Understand Table Design PrinciplesUnderstand Table Design Principles 2.2Create a New DatabaseCreate a New Database 2.2Create a TableCreate a Table 2.3Create a Table in Design ViewCreate a Table in Design View 2.3Set the Primary KeySet the Primary Key CHECKPOINT 1 2.4Modify the Field Size PropertyModify the Field Size Property 2.4Modify the Caption PropertyModify the Caption Property 2.4Modify the Default Value PropertyModify the Default Value Property 2.5Validate Field EntriesValidate Field Entries 2.6Create Input MasksCreate Input Masks 2.6Format a FieldFormat a Field 2.7Create a Lookup ListCreate a Lookup List 2.8Insert, Move, and Delete FieldsInsert, Move, and Delete Fields 2.8Insert a TotalInsert a Total CHECKPOINT 2 2.9Understand RelationshipsUnderstand Relationships 2.9Use the Relationships WindowUse the Relationships Window 2.10Create a One-to-Many RelationshipCreate a One-to-Many Relationship 2.11Create a One-to-One RelationshipCreate a One-to-One Relationship 2.12Print a Relationships ReportPrint a Relationships Report 2.12Delete a RelationshipDelete a Relationship 2.12Display Records in a SubdatasheetDisplay Records in a Subdatasheet CHECKPOINT 3
3
Skills © Paradigm Publishing, Inc. 3 Understand Table Design Principles To design a new table: 1. Analyze the required data elements. 2. Break down the data into the smallest unit. 3. Create a field name. 4. Assign each field an appropriate data type. 5. Identify the field suitable for the primary key. 6. Assign a name for the table. sample data
4
Skills © Paradigm Publishing, Inc. 4 Understand Table Design Principles…continued A field name can be up to 64 characters including a combination of letters and numbers. Some symbols are permitted but others are excluded, so it is best to avoid symbols other than the underscore character which is often used as a word separator. Do not use a space in a field name. Although a space is an accepted character, most database designers avoid using spaces in field names and object names. This practice facilitates easier management of the data with scripting or other database programming tools. Use compound words for field names or the underscore character as a word separator. For example, a field to hold a person’s last name would be named LastName, Last_Name, or LName. Abbreviate field names so that the names are as short as possible while still readily understood. For example, a field such as ContactLastName could be abbreviated to ContactLN or a field such as Telephone to Phone. Shorter names are easier to manage and type into expressions.
5
Skills © Paradigm Publishing, Inc. 5 Understand Table Design Principles…continued Data TypeDescription TextAlphanumeric data up to 255 characters in length, such as a name, address, or value such as a telephone number or social security number, that is used as an identifier and not for calculating MemoAlphanumeric data up to 64,000 characters in length NumberPositive or negative values that can be used in calculations; do not use for values that will calculate monetary amounts (see Currency) Date/TimeUse this type to that ensure dates and times are entered and sorted properly CurrencyValues that involve money; Access will not round off during calculations AutoNumberAccess automatically numbers each record sequentially (incrementing by 1) when you begin typing a new record
6
Skills © Paradigm Publishing, Inc. 6 Understand Table Design Principles…continued Data TypeDescription Yes/NoData in the field will be either Yes or No, True or False, On or Off OLE ObjectUsed to embed or link objects created in other Office applications HyperlinkField that will store a hyperlink such as a URL AttachmentUse this data type to add file attachments to a record such as a Word document or an Excel workbook CalculatedThe contents of a calculated field are generated by Access from an expression you create; for example, a total cost could be calculated by adding a price plus a sales tax column Lookup WizardCan be used to enter data in the field from another existing table or display a list of values in a drop-down list for the user to choose from
7
Skills © Paradigm Publishing, Inc. 7 Create a New Database To create a new database: 1. Start Access. 2. Click the Browse button. 3. Navigate to the desired drive and/or folder. 4. Type the file name in the File Name text box. 5. Click OK. 6. Click the Create button. Create button File Name text box
8
Skills © Paradigm Publishing, Inc. 8 Create a Table To create a table: 1. Click the desired data type in the Add & Delete group in the Table Tools Fields tab. 2. Type the field name and press Enter. steps continued on next slide… Add & Delete group field name
9
Skills © Paradigm Publishing, Inc. 9 Create a Table…continued 3. Click the desired field data type in the drop- down list. 4. Type the field name and press Enter. 5. Repeat Steps 3-4 for the remaining columns. 6. Click the Save button on the Quick Access toolbar. 7. Type a table name at the Save As dialog box. 8. Press Enter or click OK. field data type drop-down list table name
10
Skills © Paradigm Publishing, Inc. 10 Create a Table…continued To type data in the fields: 1. Click in any empty cell below a column heading to close the Click to Add column. 2. Click in the empty cell. 3. Type the desired text. 4. Press Tab or Enter to move to the next field. 5. Continue typing the data for the remainder of the fields. typed data
11
Skills © Paradigm Publishing, Inc. 11 Create a Table…continued To switch to Design view: 1. Click the View button in the Views group of the Home tab. View button Design view
12
Skills © Paradigm Publishing, Inc. 12 Create a Table in Design View To create a table in Design view: 1. Click the Create tab. 2. Click the Table Design button in the Tables group. 3. Type the field names, change the data types, add descriptions, or modify other field properties as desired. 4. Assign a primary key. 5. Click the Save button in the Quick Access toolbar. 6. Type a table name. 7. Click OK. field in Design view Table Design button
13
Skills © Paradigm Publishing, Inc. 13 Set the Primary Key To assign a primary key: 1. Open the table in Design view. 2. Make the desired primary key field active. 3. Click the Primary Key button in the Tools group in the Table Tools Design tab. 4. Click the Save button in the Quick Access toolbar. Primary Key button
14
Skills © Paradigm Publishing, Inc. 14 CHECKPOINT 1 1)A field name can be how many characters long? a.24 b.36 c.48 d.64 1)A field name can be how many characters long? a.24 b.36 c.48 d.64 3)In addition to creating a table in datasheet view, a table can be created in this view. a.Edit b.Print Preview c.Design d.Structure 3)In addition to creating a table in datasheet view, a table can be created in this view. a.Edit b.Print Preview c.Design d.Structure 2)This is the name of the field that Access creates automatically in new tables. a.AB b.ID c.IA d.IB 2)This is the name of the field that Access creates automatically in new tables. a.AB b.ID c.IA d.IB 4)The primary field is indicated in Design view by this icon. a.plus sign b.minus sign c.key d.circle 4)The primary field is indicated in Design view by this icon. a.plus sign b.minus sign c.key d.circle Next Question Next Slide Answer
15
Skills © Paradigm Publishing, Inc. 15 Modify the Field Size Property To set the field size: 1. Open the table in Design view. 2. Click in the desired field row. 3. Select the current value in the Field Size property box. 4. Type a maximum number of characters for the field. 5. Click the Save button in the Quick Access toolbar. Field Size property box
16
Skills © Paradigm Publishing, Inc. 16 Modify the Caption Property To add a caption: 1. Open the table in Design view. 2. Click in the desired field row. 3. Click in the Caption property box. 4. Type the desired field label. 5. Click the Save button in the Quick Access toolbar. Caption property box
17
Skills © Paradigm Publishing, Inc. 17 Modify the Default Value Property To set a default value: 1. Open the table in Design view. 2. Click in the desired field row. 3. Click or select the current entry in the Default Value property box. 4. Type the default value. 5. Click the Save button in the Quick Access toolbar. Default Value property box
18
Skills © Paradigm Publishing, Inc. 18 Validate Field Entries To create a validation rule: 1. Open the table in Design view. 2. Click in the desired field row. 3. Click in the Validation Rule property box. 4. Type the statement. 5. Click in the Validation Text property box. 6. Type the error message. 7. Click the Save button in the Quick Access toolbar. Validation Rule property box Validation Text property box
19
Skills © Paradigm Publishing, Inc. 19 Validate Field Entries…continued Field NameValidation RuleData Check Customer_No>1000 And <1100Limits customer numbers to 1001 through 1099. Credit_Limit<=5000Restricts credit limits to values of 5000 or less. State“CA”Only the state of California is accepted. Country“CA” Or “US”Only the United States or Canada is accepted. Order_Qty>=25Quantity ordered must be a minimum of 25.
20
Skills © Paradigm Publishing, Inc. 20 Create Input Masks To use the Input Mask Wizard: 1. Open the table in Design view. 2. Click in the desired field row. 3. Click in the Input Mask property box. 4. Click the Build button. 5. Click the input mask you want to create. 6. Click Next. steps continued on next slide… Input Mask Wizard Build button
21
Skills © Paradigm Publishing, Inc. 21 Create Input Masks…continued 7. Select the placeholder character. 8. Click Next. 9. Click Finish at the last wizard dialog box. 10. Click the Save button in the Quick Access toolbar. placeholder character
22
Skills © Paradigm Publishing, Inc. 22 Create Input Masks…continued UseTo restrict data entry to 0digit, zero through nine, entry is required 9digit or space, entry is not required Lletter, A through Z, entry is required ?letter, A through Z, entry is not required >all characters following are converted to uppercase <all characters following are converted to lowercase
23
Skills © Paradigm Publishing, Inc. 23 Format a Field To format a field: 1. Open the table in Design view. 2. Click in the desired field row. 3. Click in the Format property box. 4. Click the down-pointing arrow at the end of the property box. 5. Click the desired option at the drop-down list. 6. Click the Save button in the Quick Access toolbar. Format property box
24
Skills © Paradigm Publishing, Inc. 24 Create a Lookup List To create a list of values using the Lookup Wizard: 1. Open the table in Design view. 2. Type or click the field name. 3. Press Enter. 4. Change the data type to Lookup Wizard. 5. Click the I will type in the values that I want option. 6. Click Next. steps continued on next slide… Lookup Wizard dialog box
25
Skills © Paradigm Publishing, Inc. 25 Create a Lookup List…continued 7. Type the field values in the Col1 column and click Next. 8. Click Finish at the last wizard dialog box. 9. Click the Save button in the Quick Access toolbar. field values
26
Skills © Paradigm Publishing, Inc. 26 Create a Lookup List…continued To change the Limit To List property: 1. Click the Lookup tab in the Field Properties section. 2. Click in the Limit To List property box. 3. Click the down-pointing arrow that appears. 4. Click Yes. 5. Click the Save button in the Quick Access toolbar. Limit To List property box
27
Skills © Paradigm Publishing, Inc. 27 Create a Lookup List…continued To select from a list of values in Datasheet view: 1. Click the View button to switch to Datasheet view. 2. Click in the column. 3. Click the down-pointing arrow that appears. 4. Click the desired selection in the drop- down list. list of values
28
Skills © Paradigm Publishing, Inc. 28 Insert, Move, and Delete Fields To insert a field in Design view: 1. Open the table in Design view. 2. Make the desired field active. 3. Click the Insert Rows button in the Tools group in the Table Tools Design tab. 4. Click in the Field Name area of the new row and type the field name. 5. Change the data type, description, or field properties as desired. 6. Click the Save button in the Quick Access toolbar. Insert Rows button
29
Skills © Paradigm Publishing, Inc. 29 Insert, Move, and Delete Fields…continued To move a field in Design view: 1. Open the table in Design view. 2. Select the field using the field selector bar. 3. With the pointer in the field selector bar, drag the field to the desired position. 4. Click the Save button in the Quick Access toolbar. move pointer
30
Skills © Paradigm Publishing, Inc. 30 Insert, Move, and Delete Fields…continued To delete a field in Design view: 1. Open the table in Design view. 2. Make the desired field active. 3. Click the Delete Rows button in the Tools group in the Table Tools Design tab. 4. Click Yes at the message box. 5. Click the Save button in the Quick Access toolbar. Delete Rows button message box
31
Skills © Paradigm Publishing, Inc. 31 Insert a Total To insert a total: 1. Open the table in Datasheet view. 2. Click the Totals button in the Records group in the Home tab. 3. Click in the Total row in the desired field. 4. Click the down-pointing arrow. 5. Click the desired function. 6. Click the Save button in the Quick Access toolbar. functions
32
Skills © Paradigm Publishing, Inc. 32 CHECKPOINT 2 1)This is the default value for the field size of a Text field. a.55 b.155 c.255 d.355 1)This is the default value for the field size of a Text field. a.55 b.155 c.255 d.355 3)This displays a pattern indicating how data is to be entered into the field. a.data mask b.input mask c.enter mask d.text mask 3)This displays a pattern indicating how data is to be entered into the field. a.data mask b.input mask c.enter mask d.text mask 2)This property stores descriptive titles for fields. a.Validation Text b.Default Value c.Field Size d.Caption 2)This property stores descriptive titles for fields. a.Validation Text b.Default Value c.Field Size d.Caption 4)When you insert rows using the Insert Rows button, where are new rows inserted in relation to the active field? a.above b.below c.at the beginning d.at the end 4)When you insert rows using the Insert Rows button, where are new rows inserted in relation to the active field? a.above b.below c.at the beginning d.at the end Next Question Next Slide Answer
33
Skills © Paradigm Publishing, Inc. 33 Understand Relationships Access is referred to as a relational database management system. A relational database is one in which tables have been joined. When two or more tables have been joined to create a relationship, you can look up or create reports from multiple tables as if they were one table. In most cases, tables are joined by a common field that exists in both tables. When designing a new database, consider if two tables need to be joined and make sure to include a common field in each table so that you can create the relationship after the tables have been created.
34
Skills © Paradigm Publishing, Inc. 34 Use the Relationships Window To arrange tables in the Relationships Window: 1. Click the Database Tools tab. 2. Click the Relationships button in the Relationships group. 3. Add the required tables to the window at the Show Table dialog box. 4. Close the Show Table dialog box. 5. Resize and move the field list boxes as necessary. 6. Save the layout. Show Table dialog box
35
Skills © Paradigm Publishing, Inc. 35 Use the Relationships Window…continued To resize a field list box: 1. Position the mouse pointer on the bottom border of the field list box until the pointer changes to an up- and down- pointing arrow. 2. Drag the bottom border down until the vertical scroll bar disappears. resize pointer
36
Skills © Paradigm Publishing, Inc. 36 Create a One-To-Many Relationship When two tables are joined in a relationship, one table is called the primary table, and the other table is called the related table. A one-to-many relationship means that one table in the relationship contains one unique record in the field used to join the tables (this table will be the primary table), while the other table can have several records with a matching field value in the joined field (this table will be the related table). In this type of relationship, the common field in the primary table is also the primary key field. In the related table the common field is not the primary key and is known as the foreign key field.
37
Skills © Paradigm Publishing, Inc. 37 Create a One-To-Many Relationship…continued To create a one-to-many relationship: 1. Open the Relationships window. 2. If necessary, add the desired tables to the window. 3. Close the Show Table dialog box. 4. Drag the common field name from the primary table field list box to the related table field list box. steps continued on next slide… Relationships window
38
Skills © Paradigm Publishing, Inc. 38 Create a One-To-Many Relationship…continued 5. Click Enforce Referential Integrity at the Edit Relationships dialog box. 6. Click Create. 7. Click the Save button. join line Edit Relationships dialog box
39
Skills © Paradigm Publishing, Inc. 39 Create a One-To-One Relationship A one-to-one relationship exists when both the primary table and the related table contain only one record with a matching field value in the common field. In this relationship the common field used to join the tables is the primary key in each table. For example, the Employees table would contain only one record for each employee. The Benefits table would also contain only one record for each employee. If these tables are joined on the common EmployeeID field, a one-to-one relationship would be created. In this type of relationship, consider the primary table to be the table with the fields (such as the employee names) that describe the identity of each ID number (describe for whom the employee number was created).
40
Skills © Paradigm Publishing, Inc. 40 Create a One-To-One Relationship…continued To create a one-to-one relationship: 1. Open the Relationships window. 2. If necessary, add the desired tables to the window. 3. Close the Show Table dialog box. 4. Drag the common field name from the primary table field list box to the related table field list box. steps continued on next slide… common field
41
Skills © Paradigm Publishing, Inc. 41 Create a One-To-One Relationship…continued 5. Turn on the desired relationship options. 6. Click Create. 7. Click the Save button. Edit Relationships dialog box
42
Skills © Paradigm Publishing, Inc. 42 Create a One-To-One Relationship…continued To edit a relationship: 1. Open the Relationships window. 2. Position the mouse pointer on the black join line between the field list boxes. 3. Right-click. 4. Click Edit Relationship at the shortcut menu. shortcut menu join line
43
Skills © Paradigm Publishing, Inc. 43 Print a Relationships Report To print a relationships report: 1. Open the Relationships window. 2. Click the Relationship Report button in the Tools group of the Relationship Tools Design tab. 3. Click the Print button. 4. Click OK. 5. Click the Close Print Preview button. Print button
44
Skills © Paradigm Publishing, Inc. 44 Delete a Relationship To delete a relationship: 1. Open the Relationships window. 2. Right-click the join line between the tables. 3. Click the Delete option from the shortcut menu. 4. Click Yes at the confirmation message. confirmation message shortcut menu
45
Skills © Paradigm Publishing, Inc. 45 Display Records in a Subdatasheet To display records in a subdatasheet: 1. Open the primary table in Datasheet view. 2. Click the plus symbol next to the record for which you want to view related records. subdatasheet
46
Skills © Paradigm Publishing, Inc. 46 CHECKPOINT 3 1)This is the most common type of relationship created between Access tables. a.one-to-one b.one-to-many c.many-to-one d.many-to-many 1)This is the most common type of relationship created between Access tables. a.one-to-one b.one-to-many c.many-to-one d.many-to-many 3)This symbol appears next to the related table, indicating the many side of a relationship. a.plus b.minus c.asterisk d.infinity 3)This symbol appears next to the related table, indicating the many side of a relationship. a.plus b.minus c.asterisk d.infinity 2)Always be careful to drag the common field starting from this table. a.smallest b.largest c.primary d.secondary 2)Always be careful to drag the common field starting from this table. a.smallest b.largest c.primary d.secondary 4)In this type of relationship, the common field used to join the tables is the primary key in each table. a.one-to-one b.one-to-many c.many-to-one d.many-to-many 4)In this type of relationship, the common field used to join the tables is the primary key in each table. a.one-to-one b.one-to-many c.many-to-one d.many-to-many Next Question Next Slide Answer
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.