With data comes the need for a system that is able to store, sort, and search through it.
A database is an organised collection of data.
Databases can be as simple as a single file, and as complex as a set of related tables, each with fields and keys.
Keywords
record
a data structure that stores related fields of data for a single object or being
field
the part of a record which are the category headings for data in a table sometimes called an attribute
primary key
an attribute that uniquely identifies a record in a database table
foreign key
an attribute in one table that is the primary key in another table and is used to link the tables together
A common mistake
Mistake:A primary key and a foreign key are the same thing.
In fact:A primary key is an attribute that uniquely identifies a record in a database table, whereas a foreign key is an attribute in one table that is the primary key in another table and is used to link the tables together.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.Read the licence
Lesson 2 of 2 · GCSE level, ages 14 to 16
Builds the basics this topic needs
Reading CSV files
By the end:I can read and structure data in a CSV file.
CSV text files group data together on individual lines and separates values in these groups by commas.
CSV files can be read by a range of different spreadsheet software packages as well as Python files.
Each item is seperated by a comma, each record is seperated over a new row in the file.
A CSV file is the same as any other text file where each row is stored as string.
Keywords
CSV
comma-separated values are a plaintext data file where each value is separated by a single comma
tabular
displaying data in a grid of rows and columns
strip()
a Python method which removes any leading, and trailing whitespaces or characters that you specify
split()
a Python method which is used to break a string into a list based on a specified delimiter
A common mistake
Mistake:It is not possible to interrogate a CSV file in Python without importing a specialised library.
In fact:A CSV file behaves in the same way as a txt file in Python. Data is read from the file as strings and methods can be used to remove extra characters like commas, spliting the values either side in to separate items.
Check what you learned
From Oak National Academy's exit quiz. Choose every answer that is right.
A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0.Read the licence
The wording comes from each publisher. The layout and the links to your syllabus are ours.