Wednesday, October 21, 2015MAT 145 Please review TEST #2 Results and see me with questions.
CIS 145 Test Review
Click here to load reader
-
Upload
randy-riness-south-puget-sound-community-college -
Category
Entertainment & Humor
-
view
820 -
download
4
Transcript of CIS 145 Test Review
Test 2 ReviewCIS-145
Relational DatabasesHave more than one table where tables are
related to each otherOne to oneOne to manyMany to many
A combination of fields may be used for the table’s primary key
One to Many RelationshipsEach table contains data about a specific
subject (customers, loans)Each table on the ‘one’ side has a primary
keyPrimary key of the “one” table is a foreign
key in the many table
Many to Many RelationshipsTwo tables are related, but can have many
records in each table in commonOne student can attend many courses; one
course can be attended by many studentsImplement a many to many relationship by
creating a pair of one to many relationships with a third tableThird table is often referred to as a “join” or
“junction” tableEntries in the join table point to rows in the
original tables
Foreign KeyA foreign key points to a record in another
tableForeign key “looks like” the related primary
keySame number of fieldsData types for each field must matchField names don’t matter
Referential IntegrityMakes sure that the records in related tables
are consistentMust have a customer in the customer table for
an order assigned to that customerAvoids “orphans”
Cannot delete a record or change the primary key in the one table when associated records are in the many table, unless have cascade delete and cascade update enabled
Editing DataMaking new entries, changing existing
entries, and deleting rows are all affected by referential integrityA customer can be added at any timeMust have a customer before a loan can be
entered and associated with a customer Referential integrity doesn’t require entry into a
foreign keyCan delete a loan at any time, but can only
delete a customer if they don’t have any loans (assuming no cascade delete)
Cascading ChangesWhen referential integrity is enforced can
choose to include Cascade Update and/or Cascade DeleteCascade update passes changes to the primary
key of the “one” table to the related rows in the “many” table
Cascade delete removes rows from the “many” table when a primary key (row) is deleted from the “one” table
Relationships WindowWhere relationships between tables are
created and definedRelated fields must have the same data type
Autonumber is related to number field with long integer field size
The one table has a 1 next to it; the many has
a next to it
Autolookup QueriesUse queries to automatically look up data
from related tablesMust contain the foreign key from the many
tableCan add, change or delete data in the source
tables