All IGCSE Information and Communication Technology videos
Preparing the video…

0417 · 18.1Create a database structure

Cambridge IGCSE Information and Communication Technology (0417) · Topic 18, Databases · 12:32

Practise this topic

Real past-paper questions on create a database structure, with their mark schemes. Free with an account.

Practise this topic

57 more Information and Communication Technology videos like this one

With a CIE Buddy account: every video in syllabus order, past-paper practice on each topic, and an AI tutor for anything unclear.

In this video

  1. 0:00Flat files and relational databases. Explains database terms and compares flat file and relational databases using Willow Lending.
  2. 2:15Primary keys and relationships. Explains primary keys, foreign keys and one-to-many relationships between members and loans.
  3. 3:05Importing files and choosing data types. Shows how to import delimited files accurately and select suitable data types for each field.
  4. 5:20Field properties and relationships. Covers field lengths, display formats, primary keys and creating an enforced table relationship.
  5. 7:29Designing and testing data entry forms. Explains how to design a clear loans form, use controls and enter a new record.
  6. 9:48Evidence and exam recap. Covers screenshots, common practical mistakes, exam-style answers and key database concepts.

Transcript: Create a database structure

Flat files and relational databases

0:00Willow Lending is a club that lends cameras, tripods and telescopes to its members. Its first list stores every loan in one table, with the borrower’s name and telephone number on each row. Maya Reed has borrowed two items, so her details are stored twice. When her number changes, staff must find and correct every copy, and one missed copy leaves the list inconsistent. Data is facts or values that a computer can process.

0:22A database is an organised collection of related data. Inside a database table, a field stores one item of data about something. A record, in contrast, is a collection of related fields about one item or person. In this list, each row is one loan record, while each column is one field. A table is an arrangement of cells in rows and columns. In a database table, every record has the same fields in the same order.

0:48Willow Lending needs details about members and details about loans. Deciding which table each detail belongs in comes before importing anything, because the structure controls how the data fits together. A flat file database stores all its data in one table. Each record holds every field, so a borrower’s details are repeated on every loan. It suits a small list kept by one person, such as an equipment list with a few fields.

1:10The person setting it up gains most, because a single table is quick to create and easy to understand without specialist knowledge. Searching is simple too, as every value sits in that one table. The drawbacks fall on the staff who maintain the list. Repeated details waste storage space and take longer to type. Every change must be made in each copy, which takes time and is easy to get wrong.

1:30When one copy is missed, the table holds two different values for one fact, so the data becomes inconsistent. A relational database, in contrast, stores data in several tables that are linked through key fields. Willow Lending can keep one members table and one loans table, because one member can borrow many items. Libraries, schools and online shops use this structure for the same reason. Each member’s details are stored once, so staff type them once and update them in one place.

1:56Less repeated data means less wasted storage and fewer typing errors. Because each fact is stored once, the data stays consistent across every loan. The software can still combine the tables, so staff can list each loan with its borrower’s name. The designer bears the cost, since linked tables are more complex to set up and need more skill to plan.

Primary keys and relationships

2:15A primary key is a field that uniquely identifies each record. Each member therefore needs a member number that belongs to that person alone. The primary key must contain a value in every record, and no two records can share the same value. A member’s name can change or be shared by another person, so an assigned member number is the dependable choice. A foreign key is a field in one table that is the primary key of another table, used to link them.

2:39Each loan contains the member number of its borrower. That value connects the loan to the matching member record. Several loans can contain the same member number, because the same person can borrow several items. A relationship is a link between two tables through matching fields. Our diagram shows a one-to-many relationship between members and loans. One member can have many loans, while each loan belongs to one member. The member number appears once in the members table and can appear many times in the loans table.

Importing files and choosing data types

3:05A file is a named collection of information stored together. Our worked task starts with a comma separated values file, or C S V file, called Members dot C S V. Each C S V file stores one record per line, and commas separate its values. A character that separates the values in this way is called a delimiter. The first line holds the field names, and each later line holds one member’s record.

3:27The second source is Loans dot T X T, a text file with a semicolon between its values. A text file can use different delimiters, so open it and look before choosing one. Start a new database and import each source file into its own table. Tell the import that the first row contains field names, then check that every heading matches the task exactly. Sometimes a source file has no heading row, or the task gives different names.

3:50In that case, type each field name exactly as the task specifies, with the same spelling, capitals and spacing. One wrong letter in a field name such as Loan Date loses the mark. The examiner compares every name with the task wording. Use the import preview to check that each value sits in the correct column. Confirm that names containing spaces stay together and that every record is present. Set the data types before completing the import, especially for identifiers with leading zeros.

4:16How a value will be used decides which data type it needs. A data type specifies the category of values a field can store. Our choices include text, numeric, date and time, and Boolean or logical. Text stores characters, including identifiers and telephone numbers. Keeping member number as text preserves its leading zeros. Telephone numbers also belong in text fields, because they start with zero and are never used in calculations.

4:42Numeric fields store quantities used in calculations, with integer, decimal and currency as the main sub-types. An integer stores whole numbers, so duration uses an integer for whole days. Decimal storage allows fractional values, such as a member’s discount. Currency is meant for amounts of money, so it suits the daily rate. A date and time field stores calendar dates, times, or both. This lets the database sort and compare loan dates correctly.

5:06A Boolean or logical field stores only one of two values, such as yes or no. Returned uses this type because an item is either returned or still on loan. Complete both imports using this plan, then inspect the structure of each table.

Field properties and relationships

5:20Field length is the maximum number of characters allowed in a field. Set each text field long enough for its longest value, so no characters are cut off. Member number appears in both tables, so give it the same data type and field length in each. Matching fields like these can then be linked. Display format controls how a stored value appears on screen and on printouts. Set the discount field to percentage format with zero decimal places.

5:43A stored value of zero point one represents one tenth, so it displays as ten per cent. Zero point zero five displays as five per cent, and the stored values themselves do not change. The number of decimal places sets how many digits appear after the decimal point. Display rounding can hide extra stored digits, so check both the data type and the format. Set daily rate to currency with a pound symbol and two decimal places.

6:06The stored value four point five then displays as four pounds fifty. Boolean display options include yes and no, true and false, and a checkbox. Choose the one the task asks for, and give the field a label that makes its meaning clear. Here, returned displays as yes or no in the table, while the form will show it as a checkbox. Set the loan date display to the day, the month written as a word, and the year.

6:28A time can also be shown when the task asks for one. Set member number as the primary key of members, and loan number as the primary key of loans. Before applying each key, check that the field has no repeated or empty values. To edit a primary key, remove the key from the current field and set it on the required field. The new key field must still identify every record uniquely.

6:50Create the relationship by linking member number in the members table to member number in the loans table. Member number in loans becomes the foreign key, because it holds values of the primary key of members. Check that the diagram shows one member linked to many loans. Every member number in loans must match a member number in members. Setting the relationship to enforce this match stops a loan being saved for a member who does not exist.

7:13A foreign key can be edited too. Delete the relationship that uses it, change the field or its data type, then create the relationship again. Check the diagram afterwards, because a link to the wrong field connects loans to the wrong members. Save the structure once both keys and the relationship are correct.

Designing and testing data entry forms

7:29A data entry form is a screen layout used to enter, view and edit the records in a table. Create a form based on loans and include every field the task specifies. Give it a clear title and short instructions, so staff recognise its purpose. Arrange the fields in the order a person naturally completes them. A label such as duration in days makes the expected entry clear. Good form design includes readable fonts, suitable spacing, sensible field widths, white space and consistent alignment.

7:57Use a larger bold title, with one readable font size for every label and entry. Leave clear gaps between fields, so each label clearly belongs to its control. White space separates groups and reduces clutter. Size each entry box to show its expected contents in full. Character spacing controls the space between the individual characters in a field. Keep it comfortable and consistent, so identifiers and telephone numbers are easy to read.

8:21Check that longer entries stay fully visible inside their boxes. Include only the fields the task needs, because extra fields slow data entry. Navigation buttons should move between records in a logical order and be easy to recognise. Form controls include radio buttons, check boxes and drop-down menus. Radio buttons let the user select exactly one option from a group, so they suit the standard or extended loan type. A checkbox is ticked or left clear, which suits a Boolean field such as returned.

8:47The member number drop-down lists the existing members and stores the number chosen. Together, these controls reduce typing and stop entries that are not allowed. Create the loan type options and connect them to the loan type field. Connect the returned checkbox to the Boolean field, so ticking it changes the stored value. Set the member list to show existing members and store their member numbers. Test each control by moving between records and checking the value it shows.

9:11For a typical practical task, add the new loan shown on the task card. Open a new record in the form, then enter loan number one hundred and four. Select member number zero zero two from the drop-down list. Type binoculars, then enter the seventh of March, two thousand and twenty-nine. Copy each value exactly, because the examiner checks every character. Set duration to two and daily rate to two pounds seventy-five.

9:36Choose standard from the radio buttons and leave returned unticked. Save the record, move to another record, then return to confirm the values were kept. Finally, open the loans table and check that the new row holds member number zero zero two.

Evidence and exam recap

9:48A screenshot is an image captured from all or part of a screen. The practical papers provide the source files, give no internet access, and ask for screenshots in an Evidence Document. Include your name, centre number and candidate number on every printout. Make sure each screenshot shows the settings asked for, such as the data types or the relationship. The marks most often lost in this task come from small slips.

10:11A field name with one wrong letter loses marks, and so does an identifier stored as a number, because its leading zeros vanish. Further marks go when a currency, percentage or date format is left at its default, or the primary key is set on the wrong field. Missing relationships, mistyped entries and form labels cut off at the edge are also common. A screenshot that hides the data types or key settings earns nothing.

10:33Before finishing, compare the database with the task card line by line. Confirm exact field names, complete imports, correct data types and the required display formats. Check both primary keys and the one-to-many relationship. Inspect the form for cut-off entries, missing labels and wrong control values, then take the screenshots. A one-mark question on Paper One could ask you to define primary key. The answer is that a primary key is a field that uniquely identifies each record.

11:00Giving an example from the case, such as member number, shows the examiner you can apply the term. Answers naming a brand of database software gain no marks. For four marks, explain two advantages of a relational database for this lending club. Member details are stored once in the members table. This means no storage is wasted on repeated contact details. When a telephone number changes, staff update one member record only.

11:21As a result, every loan for that member shows the same, consistent number. Another question could ask you to describe three characteristics of good form design. Clear labels identify the information required in each field. A logical field order follows the sequence in which users enter the data. Suitable field widths keep every expected entry fully visible. A two-mark question could ask for two disadvantages of a flat file database.

11:46Repeated data wastes storage space. Because the same detail is stored in several records, a missed update leaves the data inconsistent. To sum up, every piece of data needs the right table, the right data type and the right display format. As a reminder, a primary key is a field that uniquely identifies each record. The foreign key, by contrast, is a field in one table that is the primary key of another table, used to link them.

12:10Together, these keys connect separate tables while every record keeps its own identity. Recall that a data type specifies the category of values a field can store. Display formats then present those values clearly without changing them. Accurate imports create the records, and relationships connect the data that belongs together. A well-designed form then gives staff a clear and reliable way to add new records.