| Feature | Flat-File Database | Relational Database |
|---|---|---|
| Structure | Single table containing all data | Multiple linked tables |
| Redundancy | High (data often repeats) | Low (data stored once and linked) |
| Maintenance | Difficult (multiple updates needed) | Easy (update once, reflects everywhere) |
| Complexity | Simple to understand | Requires knowledge of keys/links |
Identify the Relationship: When presented with two tables, always look for the field they share to identify the link. The shared field will be a Primary Key in its 'home' table and a Foreign Key in the table where it is used as a reference.
Check Data Types: If asked to define a database structure, ensure you select the most restrictive and accurate data type. For example, 'Boolean' is better than 'String' for a 'Paid' status, and 'Numeric' is required for any field involving calculations.
Sorting Order Logic: Remember that Ascending means going up (1 to 10) and Descending means going down (10 to 1). In alphabetical sorts, A is 'smaller' than Z in ascending order.
Redundancy Analysis: If a question asks why a flat file is poor, focus on the term Data Redundancy. Explain that repeating data leads to larger file sizes and a higher risk of Inconsistency if only some instances of the data are updated.
Non-Unique Primary Keys: A common mistake is selecting a field as a primary key that might not be unique, such as a 'Surname'. Always look for an ID or code field that is guaranteed to be different for every single record.
Confusing Records and Fields: Students often mix up rows and columns. Remember that a Field is a single attribute (column) and a Record is a collection of all fields for one entity (row).
Calculation Errors: Attempting to perform math on 'String' fields will fail. Ensure that fields intended for calculations, like 'Price' or 'Quantity', are explicitly set to a Numeric data type.