- Which data type should be used for money, such as an hourly rate of pay?
- Money is currency/numeric. A rate of pay is not always a whole number, so integer is the wrong type. A decimal type would not display the currency symbol. Names are text/alphanumeric, and a yes/no field is Boolean.
- What is referential integrity?
- Referential integrity describes the relationship between two tables. It ensures that all data remains consistent, because every foreign key depends on a matching primary key. It gives the user a warning if they try to delete parent data, and it helps to reduce redundant data.
- How does a compound key differ from a primary key?
- A primary key contains unique data, cannot contain a null value, uniquely identifies a record, and there is only one per table. A compound key combines more than one foreign key to create a unique value. A composite key uses the contents of two or more fields from one table.
- How is a many-to-many relationship set up in a relational database?
- A many-to-many relationship is not linked directly. It is broken into two one-to-many relationships using a third table, a link table. For example, a student can join many clubs and a club has many students, so the link table joins the Student table and the Club table.
- What is the difference between a static and a dynamic parameter query?
- A static parameter query has its criterion written into it, so it must be rewritten to search for something else. A dynamic parameter query prompts the user for an input each time it runs. Dynamic queries save time, as a new query is not created every time.
- Why do students lose marks on data types?
- A common mistake is choosing integer for a rate of pay, which is not always a whole number, or for a telephone number. A telephone number has a leading zero and spaces, and it is never used in a calculation, so text or alphanumeric is correct. Give the reason, not only the type.