Storing and Searching Data Flashcards
What is a record?
A type of data structure which means that it’s used to store a collection of data values.
What makes records so useful?
Unlike arrays, they can store values with different data types.
What is each item in a record called?
- field
What can a field name help do?
Describe the data stored in that field of the record.
Why can’t you add extra fields to a record once they’ve been created?
Records are fixed in length.
What can records help do?
keep related information in one place.
What happens when you create a record structure?
You can assign a data type and a name to each field.
What is the record called and the fields in the example below?
record recipes int recipe_number string recipe_name bool tested int score endrecord
- record called ‘recipes’
- fields called:
‘recipe_number’
‘recipe_name’
‘tested’
‘score’
What happens once you’ve created the structure of your record?
You can assign it to variables.
What does the data in each filed need?
To have the correct data type. e.g. if an int it has to be a number.
What can you use the variable name for?
- To access a whole record
- or use both the variable name and a field name to access a particular item of a record.
What can happen to individual items in a record?
They can be accessed and changed.
If you have multiple variables with the same record structure what can you do?
collect them into an array.
What can Structured Query Language (SQL) be used for?
- search tables (usually in a database) for specific data
What does it mean when we talk about records and fields of a database table?
rows and columns