CIS 145 Test Review

907 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
907
On SlideShare
0
From Embeds
0
Number of Embeds
200
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CIS 145 Test Review

  1. 1. Test 2 Review<br />CIS-145<br />
  2. 2. Relational Databases<br />Have more than one table where tables are related to each other<br />One to one<br />One to many<br />Many to many<br />A combination of fields may be used for the table’s primary key<br />
  3. 3. One to Many Relationships<br />Each table contains data about a specific subject (customers, loans)<br />Each table on the ‘one’ side has a primary key<br />Primary key of the “one” table is a foreign key in the many table<br />
  4. 4. Many to Many Relationships<br />Two tables are related, but can have many records in each table in common<br />One student can attend many courses; one course can be attended by many students<br />Implement a many to many relationship by creating a pair of one to many relationships with a third table<br />Third table is often referred to as a “join” or “junction” table<br />Entries in the join table point to rows in the original tables<br />
  5. 5. Foreign Key<br />A foreign key points to a record in another table<br />Foreign key “looks like” the related primary key<br />Same number of fields<br />Data types for each field must match<br />Field names don’t matter<br />
  6. 6. Referential Integrity<br />Makes sure that the records in related tables are consistent<br />Must have a customer in the customer table for an order assigned to that customer<br />Avoids “orphans”<br />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<br />
  7. 7. Editing Data<br />Making new entries, changing existing entries, and deleting rows are all affected by referential integrity<br />A customer can be added at any time<br />Must have a customer before a loan can be entered and associated with a customer<br />Referential integrity doesn’t require entry into a foreign key<br />Can delete a loan at any time, but can only delete a customer if they don’t have any loans (assuming no cascade delete)<br />
  8. 8. Cascading Changes<br />When referential integrity is enforced can choose to include Cascade Update and/or Cascade Delete<br />Cascade update passes changes to the primary key of the “one” table to the related rows in the “many” table<br />Cascade delete removes rows from the “many” table when a primary key (row) is deleted from the “one” table<br />
  9. 9. Relationships Window<br />Where relationships between tables are created and defined<br />Related fields must have the same data type<br />Autonumber is related to number field with long integer field size<br />The one table has a 1 next to it; the many has a  next to it<br />
  10. 10. Autolookup Queries<br />Use queries to automatically look up data from related tables<br />Must contain the foreign key from the many table<br />Can add, change or delete data in the source tables<br />

×