34
AOIT Database Design Lesson 9 Creating a Relational Database Teacher Resources Resource Description Teacher Resource 9.1 Rubric: Relational Database Teacher Resource 9.2 Guide: Setting Up Tables in Access Teacher Resource 9.3 Sample Access, Excel, and Text Files: DolphinDemo.accdb, DolphinTables.accdb, Categories.xls, and Suppliers.txt (separate ZIP file) Teacher Resource 9.4 Presentation and Notes: Data Integrity (includes separate PowerPoint file) Teacher Resource 9.5 Answer Key: Validation Rules Worksheet Teacher Resource 9.6 Key Vocabulary: Creating a Relational Database Teacher Resource Bibliography: Creating a Relational Database Copyright © 2009–2014 NAF. All rights reserved.

Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database Design

Lesson 9Creating a Relational Database

Teacher Resources

Resource Description

Teacher Resource 9.1 Rubric: Relational Database

Teacher Resource 9.2 Guide: Setting Up Tables in Access

Teacher Resource 9.3 Sample Access, Excel, and Text Files: DolphinDemo.accdb, DolphinTables.accdb, Categories.xls, and Suppliers.txt (separate ZIP file)

Teacher Resource 9.4 Presentation and Notes: Data Integrity (includes separate PowerPoint file)

Teacher Resource 9.5 Answer Key: Validation Rules Worksheet

Teacher Resource 9.6 Key Vocabulary: Creating a Relational Database

Teacher Resource 9.7 Bibliography: Creating a Relational Database

Copyright © 2009–2014 NAF. All rights reserved.

Page 2: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.1

Rubric: Relational DatabaseStudent Names: ______________________________________________Date: ________________

Exemplary Solid Developing Needs Attention

Required Elements

All required elements are included in the assignment. Some additional elements are included to enhance the assignment.

All required elements are included in the assignment.

One or two of the required elements are missing.

More than two required elements are missing.

Naming Conventions

All naming conventions are completely aligned with standard best-practice guidelines for databases. All table and column names in the database adhere to the naming conventions completely. No table or column names are misspelled.

Most of the naming conventions are completely aligned with standard best-practice guidelines for databases. Almost all table and column names in the database adhere to the naming conventions completely. No more than two table or column names are misspelled.

Most of the naming conventions are somewhat aligned with standard best-practice guidelines for databases. Most of the table and column names in the database adhere to the naming conventions. Some table or column names might be misspelled.

Naming conventions are sloppy or non-existent and do not reflect standard best-practice guidelines for databases. Table and column names do not necessarily adhere to the naming conventions. Some table or column names might be misspelled.

Tables and Columns

Every table is an integral part of the database and serves to meet the client’s requirements. There are no extraneous tables, no duplicate tables, and no missing tables. Every column in every table serves to meet the client’s requirements. There are no extraneous columns, no duplicate columns, and no missing columns. Every column has the correct data type.

The tables required to meet the client’s requirements are included in the database. There may be no more than one extraneous or duplicate table. No tables are missing. Almost all columns in every table serve to meet the client’s requirements. There are no more than two missing columns. Almost all columns have the correct data type.

Most tables required to meet the client’s requirements are included in the database. There may be as many as two extraneous, duplicate, or missing tables. Most columns in every table serve to meet the client’s requirements. There are no more than five missing columns. Some columns may not have the correct data type.

Tables are missing from the database, or tables that should not be included are included. The columns in the tables do not meet the client’s needs, or there are more than five missing columns. Many columns do not have the correct data type.

Sample Customer Data

All sample data has been entered in the database and appears in the correct tables and columns. There are no errors (such as duplicates) due to spelling errors, typos, or inattention.

All sample data has been entered in the database, and almost everything appears in the correct tables and columns. There are no more than one or two errors (such as duplicates) due to spelling errors, typos, or inattention.

Not all sample data was entered in the database, or some data was entered in the wrong tables or columns.

There is very little sample data entered into the correct tables and columns.

Copyright © 2009–2014 NAF. All rights reserved.

Page 3: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Exemplary Solid Developing Needs Attention

Entity Integrity

All tables have properly specified primary keys and completely respect the rules of entity integrity.

There is no more than one error in specifying primary keys and entity integrity.

There are no more than three errors in specifying primary keys and entity integrity.

The primary keys are not specified correctly in most of the tables.

Foreign Keys and Relationships

All foreign keys are specified correctly. The relationship diagram is well laid out and easy to read (everything is visible, and no lines are crossing). All relationships are expressed correctly. Cardinality is expressed correctly. Relational integrity is correct for all tables.

There are no more than two errors with foreign keys. The relationship diagram is well laid out and easy to read (everything is visible, and no lines are crossing). Almost all relationships are expressed correctly, with correct cardinality and correct relational integrity.

There are no more than five errors with foreign keys. The relationship diagram is a bit sloppy and hard to follow. Most relationships are expressed correctly, with correct cardinality and correct relational integrity.

Most foreign keys are incorrect or missing, and the relationship diagram is sloppy or nonexistent. Many relationships are not expressed correctly.

Field Properties

All field properties are set correctly and consistently, and the formats, checks, and constraints enforce the client’s business rules. All validation rules work correctly. All validation text is extremely clear and concise and conveys the correct message.

Almost all field properties are set correctly and consistently, and the formats, checks, and constraints enforce most of the client’s business rules. Almost all validation rules work correctly. Almost all validation text is clear and concise and conveys the correct message.

Most field properties are set correctly and consistently, and the formats, checks, and constraints enforce some of the client’s business rules. Most validation rules work correctly. Most validation text conveys the correct message.

Field properties are not set correctly or are inconsistent. The formats, checks, and constraints do not enforce the client’s business rules. Validation rules are nonexistent or not correct. Validation text does not convey the correct message.

Additional Comments:

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

_____________________________________________________________________________

Copyright © 2009–2014 NAF. All rights reserved.

Page 4: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.2

Guide: Setting Up Tables in AccessThis procedure explains how to create a new database in Microsoft Access, create a new table in the database, and import tables into the new database from an existing database. If you are using a version of Access earlier than Access 2013, you may notice some color and design differences, but process and navigation are mostly the same.

Creating a New DatabaseFirst, create a new database called DolphinDemo. This procedure assumes you already have Microsoft Access open:

1. Select Blank desktop database.

2. In the file name window, name the database DolphinDemo, navigate to the location where you want to store the database, and click Create.

Creating a Table in DolphinDemoAccess automatically creates Table1 when it creates a new database. You need to change the name of Table1, add column (field) names, and set the columns’ data types.

1. Switch to Design View by right-clicking Table1 and selecting Design View.

The Save As dialog box opens.

2. Change the name Table1 to Categories, as shown in the following image. Click OK.

Copyright © 2009–2014 NAF. All rights reserved.

Page 5: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

The Categories table opens in Design View. The only column in the table is ID, which is the primary key.

3. Change the name of the ID column to CategoryID, and create the other two fields shown in the following image. Assign the correct data type to each field. (Remind students that they will be assigning the data types that they prepared in their entity-relationship model.)

4. Right-click the Categories tab, and save the table.

5. Right-click the Categories tab again, and switch to Datasheet View.

Notice that there is no data in the table, not even automatically inserted numbers in the primary key. When you add data to the table (either manually or by importing data from an external data source like an Excel spreadsheet), an automatically numbered (AutoNumber) primary key is inserted for each row of data in the table.

6. Save the Categories table and close it.

Importing the Rest of the Tables into DolphinDemo The rest of the tables for DolphinDemo are in the DolphinTables.accdb file.

1. Choose External Data > Access.

2. Use the Browse button to locate the DolphinTables file, and select the “Import tables…” radio button.

Copyright © 2009–2014 NAF. All rights reserved.

Page 6: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

3. In the Import Objects dialog box, select all the tables and click OK.

You should receive a message in the Get External Data dialog box that all objects were imported successfully.

4. Close the Get External Data dialog box.

The newly imported tables should appear in the All Tables list.

5. Open the tables one by one and make sure they look as you expect them to look.

The following image shows the Design View of the Orders table.

Copyright © 2009–2014 NAF. All rights reserved.

Page 7: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Copyright © 2009–2014 NAF. All rights reserved.

Page 8: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.4

Presentation Notes: Data IntegrityBefore you show this presentation, use the text accompanying each slide to develop presentation notes. Writing the notes yourself enables you to approach the subject matter in a way that is comfortable to you and engaging for your students. Make this presentation as interactive as possible by stopping frequently to ask questions and encourage class discussion.

This presentation provides the following:

• An overview of data integrity and the different types of data integrity

• Examples of how Microsoft Access enforces data integrity

• Example problems involving data integrity

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 9: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

The physical design of a database (also called a physical model) focuses on its physical components.

In physical design, entities are called tables, and attributes are called columns or fields.

The data for a given entity is called a row or record.

In the example, the table is Customers, and the columns (or fields) are the same as the attributes.

A row in the Customers table has data like “Vanegas, Marlene,” and “362 W. 182 Ave.”

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 10: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

It is very important that the data in the relational database be accurate, valid, and consistent. As you can imagine, there are many mechanisms in Microsoft Access to help ensure that this is true. Clients would not be happy if their customer data got deleted or messed up in some way!

Data integrity is explained more in the following slides.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 11: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

You have probably heard the word integrity in English. A person who has integrity is thought to be honest and straightforward. That person is widely admired for his or her positive qualities.

Data integrity indicates the same kinds of qualities for a database: the database management system includes features that help make sure that data is not lost and relationships are maintained.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 12: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

In Access, any time you designate a table field of type AutoNumber as a primary key, an index for the field with No Duplicates specified will also be created.

This prevents you from entering duplicate values for such a field in any table record. It helps establish and maintain entity integrity.

If you tried to enter a second “customer 3” (Orlando Garcia) in the Customers table, Access would refuse to accept your input.

You could have duplicate data in other columns. Suppose there were two people by the same name living in the same household. Everything about them in the sample table would be the same except their customer ID. It is the one thing in the record that makes them unique in this database.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 13: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Access automatically creates an index for every column that you designate as a primary key and specifies that there cannot be any duplicate entries. The index is a fast way for the DBMS to search through the database, identify an entry as a duplicate, and reject it.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 14: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

To create a composite primary key, select the two fields that will make up the primary key (click to the left of the top field and pull down to include the bottom field), and then click Design > Primary Key. The PK icon appears to the left of both fields.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 15: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

If you have a composite primary key OrderID and ProductID, you might have the same ProductID many times in a table. But you will never have two records that both have the same OrderID and the same ProductID.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 16: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Referential integrity checks to make sure you don’t have a foreign key in one table that no longer refers to a primary key in another table.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 17: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

As you have seen, entity integrity relates to primary keys, and it is automatically enforced in Access.

Referential integrity relates to foreign keys, and like foreign keys, it deals with relationships.

This slide and the next explain how orphan records might occur, why they are a problem in databases, and how to prevent them by asking Access to enforce referential integrity in related tables. Enforcing referential integrity prevents accidentally removing data.

Orphan records are somewhat like orphan children: they no longer have a parent.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 18: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

With referential integrity in force, Access will not let you delete the record for Speedy Delivery in the Shippers table.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 19: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

When you create a relationship between tables, Access prompts you with the Edit Relationships dialog box. Select the radio button if you want referential integrity enforced.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 20: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Access will warn you before it deletes data. It will tell you how many child records will also be deleted. But this is very risky.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 21: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

It is a good practice to delete or update data manually instead of using cascading delete and cascading update. You can still delete the child records manually and then delete the shipper, if that is what you want to do. In that case, you don’t need to turn on cascading delete.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 22: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

The data in a database is useful only if it has integrity. Entity integrity and referential integrity ensure data integrity and are critical to client satisfaction with a database.

Presentation notes

Copyright © 2009–2014 NAF. All rights reserved.

Page 23: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.5

Answer Key: Validation Rules WorksheetThis answer key for Student Resource 9.9, Worksheet: Validation Rules, indicates the information that students will find using the Access Help file called “Restrict Data Input by Using a Validation Rule.”

To access the help file about validation rules, follow these steps:

1. Press F1 to display Access Help.

2. On the home page of Access Help, type validation rule in the search field and click the search button.

3. Select the first article, “Restrict Data Input by Using a Validation Rule.”

Read the following two sections of this help page, and do the numbered exercises on this worksheet as you read them:

Understand validation rules

Validate data during entry in table fields

6. Below is a list of the different validation methods that help to ensure users enter data properly. Explain how each method validates data, and give an example of each. If possible, use examples from your culminating project database.

Data types: Restrict the type of data users can enter in a particular field of a table.Example: With a data type of Date/Time, users can only enter a date in a field. (Examples will vary.)

Field size: A field property that limits the number of characters that users can enter for a particular field.Example: Set a field where users enter a first name to 20 characters to prevent bogus first names and to prevent first name and last name entries.

Table properties (or field properties): Provide specific types of validation.Example: Set Required to Yes to force a user to enter a value in a field.

Input masks: A field property that validates data by forcing users to enter values in a specific way.

Example: An input mask can force users to enter dates in a European format, such as 2007.04.14.

7. What is the difference between a field validation rule and a record (or table) validation rule?

A field validation rule checks the value that a user enters into a field when the user leaves that field. The user cannot leave the field without entering a correct value.A record validation rule refers to other fields in the same table. It checks the values entered in one field against the values entered in another field in the same table.

Copyright © 2009–2014 NAF. All rights reserved.

Page 24: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

8. Label the following validation rules as field validation rules or record validation rules, and explain what each rule does. The first one is done for you as an example.

Validation Rule Type of Rule Explanation

>=#01/01/2013# Field validation Requires the user to enter a date on or after January 1, 2013

[ShipDate]<=[OrderDate]+30 Record validation Requires the user to enter a ship date that is not more than 30 days after the order date

>10 Field validation Requires the user to enter a value greater than 10

>=0 Field validation Prevents the user from entering a negative number

4. Using the dolphin database, follow the instructions in the section of Access Help titled “Validate data during entry in table fields” to create the following validation rules:

In the Order Details table, create a field rule to validate that the quantity of items ordered is greater than 3. In the screenshot below, write what you wrote in the database file.

Copyright © 2009–2014 NAF. All rights reserved.

Page 25: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Validation Rule >3Validation Text Quantity must be greater than 3.

In the Orders table, create a table rule to validate that the ship date is no more than 3 days after the order date. In the following screenshot, write what you wrote in the database file.

Validation Rule [ShipDate]<=[OrderDate]+3Validation Text Ship date must be no more than three days after the order date.

When you test the validation rules using the procedure in the help file, what message do you get?

If all the data is valid, students will get the message “All data is valid for all rules.”If some data is not valid, the message is “Existing data violates the new record validation rule.”

Copyright © 2009–2014 NAF. All rights reserved.

Page 26: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.6

Key Vocabulary: Creating a Relational Database

Term Definition

business rule The operations and constraints that apply to an organization in achieving its goals. Can be used to generate database constraints or rules.

Example: “No merchandise item can have more than 15 units in stock.”

See also constraint.

cascading delete The deletion of a related row in a child table when you delete a matching row in the parent table.

Cascading delete applies only in situations where referential integrity is being enforced.

In general, Access maintains referential integrity by preventing the deletion of a record in a parent table that has associated records in a child table.

In Access you can permit the deletion of the parent entity and the associated child entities (which would need to be deleted also, to maintain relational integrity) by selecting the Cascade Delete Related Records option in the Edit Relationships window.

If cascading delete is in effect, Access warns you that your related records are about to be deleted when the potential for that operation occurs.

Allowing this operation may lead to lost data and is not recommended.

cascading update The update of a related row in a child table when you update a matching row in the parent table.

Cascading update applies only in situations where referential integrity is being enforced.

In general, Access maintains referential integrity by preventing the update of a record in a parent table that has associated records in a child table.

In Access you can permit the update of the parent entity and the associated child entities (which would also need to be updated to maintain relational integrity) by selecting the Cascade Update Related Records option in the Edit Relationships window.

If cascading update is in effect, Access warns you that your related records are about to be updated when the potential for that operation occurs.

Allowing this operation may lead to lost data and is not recommended.

Copyright © 2009–2014 NAF. All rights reserved.

Page 27: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Term Definition

check constraint The enforcement of validity when data is added to or changed in a database table.

In Microsoft Access, such constraints are defined using validation rules.

See also constraint.

constraint A constraint restricts the data that can be stored in a table.

Constraints are usually defined using expressions that result in a Boolean (yes/no) value, indicating whether the data satisfies the constraint.

See also business rule.

data integrity The consistency and accuracy of data that is stored in a database.

Database management systems need to provide mechanisms to ensure data integrity in the databases they manage.

domain Defines the possible values of an attribute.

domain integrity The type of data integrity that specifies the set of data values that are valid for an attribute.

In a database system, the domain integrity is defined by the data type and its length, the null value acceptance, the allowable values, techniques like constraints or rules, and the default value.

See also data integrity.

entity integrity The type of data integrity that requires that all rows in a table have a unique identifier, known as the primary key value. The identifier can be a single column or multiple columns. The latter is known as a composite primary key.

See also data integrity.

field validation rule In Microsoft Access, a single check constraint or validation rule for restricting the data that can be entered in a single field.

See also validation, constraint, and check constraint.

foreign key constraint A foreign key constraint specifies that the data in a foreign key must match the data in the primary key of the linked table.

Copyright © 2009–2014 NAF. All rights reserved.

Page 28: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Term Definition

index In a relational database, an index is a structure that improves the speed of operations on tables; for example, to improve performance on database lookup operations. In that sense, it is similar in concept to the index of a book.

An index is a copy of part of a table containing only those columns most likely to be searched.

Indexes may be defined as unique or nonunique. A unique index acts as a constraint on the table by preventing duplicate entries in the index.

primary key constraint A rule stating that a primary key field cannot be null and cannot contain duplicate data.

referential integrity The type of data integrity that ensures that the relationship between the primary key in the referenced table (where the primary key exists) and the foreign key in each of the referencing tables (where the foreign keys exist) is always maintained. Enforcing referential integrity prevents accidentally removing data.

See also data integrity.

table validation rule In Microsoft Access, a single check constraint or validation rule for restricting the data that can be entered in a table row.

See also validation and check constraint.

user-defined integrity The type of data integrity that does not fall into one of the other data integrity categories and that is specified by the user.

See also data integrity.

validation The testing of data being added to or changed in a database table, using check constraint rules.

In Microsoft Access, such rules are called validation rules.

See also check constraint.

Copyright © 2009–2014 NAF. All rights reserved.

Page 29: Lesson 16 - curriculum.naf.orgcurriculum.naf.org/packaged/assets/downloads...  · Web viewAlmost all table and column names in the database adhere to the naming conventions completely

AOIT Database DesignLesson 9 Creating a Relational Database

Teacher Resource 9.7

Bibliography: Creating a Relational DatabaseThe following sources were used in the preparation of this lesson and may be useful for your reference or as classroom resources. We check and update the URLs annually to ensure that they continue to be useful.

PrintOppel, Andy. Databases Demystified: A Self-Teaching Guide. Emeryville, CA: McGraw-Hill/Osborne, 2004.

Takahashi, Mana, and Shoko Azuma. The Manga Guide to Databases. San Francisco: No Starch Press, 2009.

Taylor, Allen G. Database Development for Dummies. Hoboken, NJ: Wiley, 2001.

Online “Check Constraint.” Wikipedia, http://en.wikipedia.org/wiki/Check_constraint (accessed April 29, 2014).

“Data Integrity.” Wikipedia, http://en.wikipedia.org/wiki/Data_integrity (accessed April 29, 2014).

Copyright © 2009–2014 NAF. All rights reserved.