Cis145 Final Review


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • CIS-145 Final 08/18/09
  • Cis145 Final Review

    1. 1. CIS-145 Final <ul><li>100 points </li></ul><ul><li>Open book, open notes, open computer </li></ul><ul><li>True-false, multiple choice, fill-in, short answer </li></ul>
    2. 2. Databases <ul><li>Collection of related information </li></ul><ul><ul><li>Scope is based on what information we need to complete tasks </li></ul></ul><ul><li>Access uses seven objects to organize and manage data </li></ul><ul><ul><li>Tables, queries, forms, reports, macros, modules </li></ul></ul><ul><ul><li>All objects are in one file </li></ul></ul>
    3. 3. Tables <ul><li>Fields are individual data elements/values - columns </li></ul><ul><li>Records are the collection of data for one occurrence – rows </li></ul><ul><li>Table should be about one thing or idea </li></ul><ul><li>Primary key uniquely identifies each record </li></ul>
    4. 4. Table Design <ul><li>Include all necessary data </li></ul><ul><li>Store data in smallest parts </li></ul><ul><li>Don’t include calculated fields </li></ul>
    5. 5. Field Data Types <ul><li>Common Types </li></ul><ul><li>Number </li></ul><ul><li>Currency </li></ul><ul><li>Text </li></ul><ul><li>Yes/No </li></ul><ul><li>Date/Time </li></ul><ul><li>What kind of data will be stored in the field? </li></ul><ul><li>Numbers not used for calculations should usually be text. </li></ul>
    6. 6. Properties <ul><li>Set specific characteristics and behaviors of objects (fields, controls, or other objects) </li></ul><ul><li>Properties set for a field are inherited by controls that refer to that field </li></ul><ul><ul><li>Drag field from field list in form design view </li></ul></ul>
    7. 7. Data Validation <ul><li>Need to make sure we have good data - proper type and values </li></ul><ul><li>Properties can help with validation: </li></ul><ul><ul><li>Field Size: How much data to accept </li></ul></ul><ul><ul><li>Input Mask: How or what data is entered </li></ul></ul><ul><ul><li>Format: How data is displayed </li></ul></ul><ul><ul><li>Validation Rules: What data is acceptable </li></ul></ul><ul><ul><li>Required: value must be entered </li></ul></ul>
    8. 8. Relational Databases <ul><li>Have more than one table where tables are related to each other </li></ul><ul><ul><li>One to one </li></ul></ul><ul><ul><li>One to many </li></ul></ul><ul><ul><li>Many to many </li></ul></ul><ul><li>A combination of fields may be used for the table’s key </li></ul>
    9. 9. One to Many Relationships <ul><li>Each table contains data about a specific subject (customers, loans) </li></ul><ul><li>Each table on the ‘one’ side has a primary key </li></ul><ul><li>Primary key of the “one” table is used to create a foreign key in the “many” table </li></ul>
    10. 10. Many to Many Relationships <ul><li>Two tables are related, but can have many records in each table in common </li></ul><ul><ul><li>One student can attend many courses; one course can be attended by many students </li></ul></ul><ul><li>Implement a many to many relationship by creating a pair of one to many relationships with a third (join) table </li></ul>
    11. 11. Foreign Key <ul><li>A foreign key points to a record in another table </li></ul><ul><li>Foreign key “looks like” the related primary key </li></ul><ul><ul><li>Same number of fields </li></ul></ul><ul><ul><li>Data types for each field must match </li></ul></ul><ul><ul><li>Field names don’t matter </li></ul></ul>
    12. 12. Referential Integrity <ul><li>Makes sure that the records in related tables are consistent </li></ul><ul><ul><li>Must have a customer in the customer table for an order assigned to that customer </li></ul></ul><ul><ul><li>Avoids “orphans” </li></ul></ul><ul><li>Can’t 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 </li></ul>
    13. 13. Relationships Window <ul><li>Where relationships between tables are created and defined </li></ul><ul><li>Related fields must have the same data type </li></ul><ul><ul><li>Autonumber is related to number field with long integer field size </li></ul></ul><ul><li>The one table has a 1 next to it; the many has a  next to it </li></ul>
    14. 14. Select Queries <ul><li>Select Queries represent a question and an answer </li></ul><ul><li>Question is created in design view </li></ul><ul><ul><li>Design view creates a Structured Query Language (SQL) statement </li></ul></ul><ul><li>Answer is shown in datasheet view </li></ul><ul><ul><li>Answer is a dynaset - dyna mic sub set of a table </li></ul></ul>
    15. 15. Query Design <ul><li>Specify data source - table or another query (FROM) </li></ul><ul><li>Determine which rows to include (WHERE) </li></ul><ul><li>Identify groups (GROUP BY) </li></ul><ul><li>Specify groups to include in result (HAVING) </li></ul><ul><li>Identify fields to include in result (SELECT) </li></ul><ul><li>Specify how to sort the answer (ORDER BY) </li></ul>
    16. 16. Criteria And Or
    17. 17. Wildcards <ul><li>‘ *’ is for a group of characters (0, 1 or more characters) </li></ul><ul><li>‘ ?’ is for a single character (and there must be a character) </li></ul><ul><li>“ S*ND” will return s a nd, s ou nd, s e nd, s ta nd, s pe nd </li></ul><ul><li>“ S?ND” will return s a nd, s e nd </li></ul>
    18. 18. Total Queries <ul><li>Select query with results summarized by one or more fields </li></ul><ul><ul><li>Find value(s) that records share and summarize information </li></ul></ul><ul><li>Similar to Groups in a Report </li></ul>
    19. 19. Multi-table Queries <ul><li>Can use multiple tables in a query </li></ul><ul><li>If tables are not already related, can connect tables in the query itself </li></ul><ul><ul><li>Drag the connecting field from the one table to the many table </li></ul></ul><ul><li>“ Joins” describe how rows in one table match rows in the other table(s) </li></ul>
    20. 20. Joins <ul><li>When using multiple tables, need to connect through a join </li></ul><ul><li>Inner-join is most common and requires matching values in both tables </li></ul><ul><li>Outer-join includes all rows from one table and any matching records from second table that exist </li></ul><ul><li>Cartesian Join matches all rows from one table with all rows from 2 nd table </li></ul>
    21. 21. Autolookup Queries <ul><li>Use queries to automatically look up data from related tables </li></ul><ul><li>Must contain the foreign key from the many table </li></ul><ul><ul><li>Value entered in foreign key is matched to value in related primary key to “look up” data </li></ul></ul><ul><li>Can add, change or delete data in the source tables </li></ul><ul><ul><li>Many side will determine where a new row is added or existing row deleted </li></ul></ul>
    22. 22. Parameter Queries <ul><li>Parameter queries allow entry of criteria when query is run </li></ul><ul><ul><li>A “place holder” allows the criteria to be saved without a specific value </li></ul></ul><ul><ul><li>Behaves like an argument in other programming languages </li></ul></ul><ul><li>Allows query to be used with different values without having to go into design view </li></ul>
    23. 23. Action Queries <ul><li>Action queries are about change </li></ul><ul><li>Can change data </li></ul><ul><ul><li>Update: change an existing value </li></ul></ul><ul><ul><li>Append: add rows to a table </li></ul></ul><ul><ul><li>Delete: remove rows from a table </li></ul></ul><ul><li>Can change database </li></ul><ul><ul><li>Make-table: create a new database object </li></ul></ul>
    24. 24. Forms <ul><li>Basic use is to enter and display information from a table </li></ul><ul><ul><li>Forms can also help to change data stored in table by being bound (record source is a table or query) </li></ul></ul><ul><li>Forms can help others use an application </li></ul><ul><ul><ul><li>Typically an unbound form (no record source) </li></ul></ul></ul><ul><li>Forms use controls: bound, unbound, calculated </li></ul>
    25. 25. Forms - 2 <ul><li>Forms have sections: header, footer, and detail </li></ul><ul><ul><li>Detail section is used to display data from one row in a table or query </li></ul></ul><ul><li>Tab order controls how the cursor moves through controls on a form </li></ul>
    26. 26. Forms & Subforms <ul><li>Main form is based on the primary (“one”) table </li></ul><ul><li>Subform is based on the many table </li></ul><ul><li>Subform shows records associated with the current record in the primary table </li></ul><ul><li>Each form has its own status bar, record selector, and navigation buttons </li></ul>
    27. 27. Subforms <ul><li>Main form and subform are linked through specific fields; fields don’t have to be shown, but must be in data source (record source) </li></ul><ul><li>A main form can have several subforms </li></ul><ul><li>Subforms can be displayed as a data sheet, single form or continuous forms </li></ul><ul><ul><li>Display is set through the form’s default view in the properties window </li></ul></ul>
    28. 28. List Controls <ul><li>A list or combo box can be bound to a field in one table, and display data from fields in a second table </li></ul><ul><ul><li>Good choice for selecting a value for a foreign key, if the primary and foreign keys are single fields </li></ul></ul><ul><li>Rowsource property specifies the list of choices, bound column specifies the value to save </li></ul><ul><li>Can show/not show different columns in the list </li></ul>
    29. 29. Reports <ul><li>Displays information from a table or query </li></ul><ul><li>Cannot change data </li></ul><ul><ul><li>A report shows the data at the time of printing or print preview </li></ul></ul><ul><ul><li>Each time a report is displayed or printed, it recalculates and re-reads the data from tables, so one report can show different values </li></ul></ul>
    30. 30. Reports - 2 <ul><li>Reports have sections: report, page, and group headers and footers; and detail </li></ul><ul><li>Controls are used to display data, information, calculations </li></ul><ul><ul><li>The most common controls are text boxes, labels, and lines </li></ul></ul>
    31. 31. Sorting & Grouping <ul><li>Groups help to organize data into information for records that have something in common </li></ul><ul><ul><li>Can summarize information for subgroups (for example, showing subtotals by location) </li></ul></ul><ul><li>Sorting controls the order that information is shown </li></ul>
    32. 32. Subreports <ul><li>Allow main report to include all records, regardless of whether there are related records </li></ul><ul><ul><li>Subreports are similar in function to subforms, finding related rows for the current row in main report </li></ul></ul><ul><li>Can include several subreports, if a query would create incomplete or duplicating results </li></ul>
    33. 33. Getting & Using Data in Forms and Reports <ul><li>Forms and reports have a recordsource property </li></ul><ul><ul><li>Can get data from a table or query </li></ul></ul><ul><li>Bound controls use the controlsource property to connect to a field </li></ul><ul><ul><li>Field for controlsource must be in form recordsource </li></ul></ul><ul><ul><li>Controlsource is also used for calculations </li></ul></ul>