levo

Exchanging Data

Flat file and relational databases, keys and indexing

  • 3 things to know
  • Component 01

Overview

Recall questions on flat file and relational databases, entities and attributes, primary, composite, foreign and secondary keys, choosing a primary key, and indexing and why not every field is indexed.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is a relational database?

Evaluation

Explain three advantages a relational database has over a flat file.

Key term

What is indexing in a database?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a flat file database?

    Model answer

    A flat file database stores all its data in a single table or file, with every field held together in one record structure and no links to any other table. It is simple to set up and adequate for a small, single-purpose set of data such as one class's contact details.

  2. 2

    A school keeps every student's details, every course they take and the tutor for each course in one single table. Describe the problems this causes.

    Model answer

    Data redundancy: a student's name and address are repeated on every row for every course they take, wasting storage. Update anomalies: if the student moves house, every one of those rows must be changed and missing one leaves the database inconsistent. Insertion anomalies: a new course cannot be recorded until at least one student enrols on it, because there is nowhere to put it. Deletion anomalies: removing the last student on a course deletes the only record of that course and its tutor. The data is also harder to search and validate, and inconsistent duplicates make results unreliable.

  3. 3

    What is a relational database?

    Model answer

    A relational database stores data in several linked tables, each holding data about a single entity such as students, courses or bookings. Each table has a primary key, and tables are linked by foreign keys, so data about one entity is stored once and referred to from elsewhere rather than repeated. Relationships between the tables let data from several of them be combined in a query.

  4. 4

    Explain three advantages a relational database has over a flat file.

    Model answer

    Any three of: much less redundancy, because each fact is stored in one place only, saving storage; better consistency, because an update is made once and is immediately correct everywhere; no insertion or deletion anomalies, because independent entities live in their own tables; easier and more flexible querying, because data from several tables can be combined as needed; and better security and control, because access can be granted to individual tables rather than to everything at once.

  5. 5

    In database terms, what is an entity and what is an attribute?

    Model answer

    An entity is a thing about which data is stored, such as a student, a book or an order; in a relational database each entity typically becomes a table, and each individual instance of it becomes a record. An attribute is a single item of data recorded about that entity, such as a student's date of birth, and becomes a field, that is a column, in the table.

  6. 6

    What is a primary key and what must be true of it?

    Model answer

    A primary key is the field, or combination of fields, that uniquely identifies each record in a table. Its value must be unique across the table and must never be blank, so that every record can be picked out unambiguously. It is also the value that other tables refer to in order to link to this one.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Exchanging Data, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.