Databases Flashcards
What is an entity?
A table in a data base
What is a field?
A column on a table
What is a primary key?
The field which uniquely identifies every record in the entity
What is a foreign key?
A primary key in a different entity
What are the possible relationships between entities?
One-to-one, one-to-many and many-to-many
What is data validation?
This is what makes sure data is sensible, reasonable, complete and within acceptable boundaries
What is range check?
It is used for numbered data and it allows you to set suitable boundaries
What is type check?
This is what makes sure the correct type of data has been entered into the field (e.g. String, Date, Integer etc.)
What is “check digit”?
This checks a range of numbers to see if they have been entered correctly. This is usually for barcodes or ISBN numbers.
What is length check?
This makes sure that the length of your data is correct. E.g. sometimes you need exactly 11 numbers (for phone numbers).
What is “lookup”?
When you have a field which can only contain a limited list of items then a lookup is used to improve accuracy.
What is picture/format check?
It is for when you have data which always consists of the same pattern. The format/picture check checks whether the data inputted fits the pattern.
What is presence check?
It is when there is a field which cannot have any blank entries. The presence check checks whether something has been entered for each box.
What is SQL?
It is the Standard Query Language used by database programs
In SQL, what does SELECT do?
It extracts records from an entity without modifying them
In SQL, what does the * mean?
It is the symbol for all records
In SQL, what does FROM do?
It specifies which entity the data should be taken from
In SQL, what is WHERE used to do?
It is used to make sure only data which fits a certain criteria is extracted
In SQL, what is WHERE followed by?
A logical condition which must result in either true, false or null.
In SQL, what are the main comparison conditions? (give symbols)
Equal to (=), not equal to (!=), greater than (>), less than (=) or less than or equal to (<=)
In SQL, what are logic operations used for?
They allow more than one field at a time to be used to extract certain records
What is an entity relationship diagram?
It is a diagram which describes the relationships between different entities
In SQL, what are some examples of logic operations?
And, or, not
Give the 6 main data types in a database and their properties.
- Numeric (can only hold numbers (0-9))
- Date/time (can only hold date (dd/mm/yyyy) or time (hh:mm:ss))
- Boolean (can only hold true or false)
- Binary (can only hold 1 or 0)
- Varchar (variable data length, most commonly used with specific data sets like ASCII. This is defined during setup)
- String