Relational Database Elements Flashcards
Gives examples of field types:
- Text, such as ‘customer last name’
- Memo, such as ‘notes’
- Number, such as ‘# of units ordered’
- Currency, such as ‘beginning account balance’
- Date/time, such as ‘transaction date’
- Yes/no, such as ‘credit approved’
What is a primary key?
A field which uniquely identifies every record in a table. (Only 1)
- Primary key is UNDERLINED.
What is a foreign key?
A primary key from one table that is also included in another table for purposes of linking.
- Foreign key is in brackets.
[Example]
What is a compound primary key?
A set of fields which uniquely identify every record. (Just 2 of them)
What is a query?
- ‘Power tool’ of relational databases
- Allow user to extract records based on specified criteria
- Queries store instructions, not data
Give an example of a sample query for an employee table:
Query: Last name & First name of all purchasing agents.
What would you classify this query as: What is the total cost of all inventory purchased by John Smith?
Compound query of employee, purchases, purchases/inventory tables
What are the two purposes for using “forms”?
- Entering data in tables (populating)
2. Looking up data
What are some of the specialized elements of a form?
- Drop-down lists
- Radio buttons
- Command buttons
What are the design principles for form?
- Title
- White space (can’t be crowded)
- Font size (usually Arial)
- Element positioning
What else do forms allow users to do?
Forms allow a user to interact with a database even if they know nothing about databases.
What are reports?
- Display output from one or more tables/queries
- Can incorporate simple calculations
- Same design considerations as forms
What type of tables would you use in these given relationships: (1) many-to-many and (2) one-to-many?
- Junction table
2. Put primary key of “one” in table for “many”
What are tables?
Fundamental building block of relational databases.
- Organized in: (1) rows (records) and (2) columns (fields).
- New records are “cheap.” New fields are “expensive.”