What is a database?
structured and persistent store of data that is used on a computer system
What is an entity?
Object that data can be stored about
Example of an entity?
customers, products,sales
What does an entity become in a database?
A table
What is an attribute? What will it become in a table?
Something that an entity has , a property of it e.g. an entity of Products may have product id, stock, price etc.
It will become the columns
What do databases allow us to do?
meaning of structured in the definition of a database?
data i organised for ease of processing
meaning of persistent in the definition of a database?
can’t be lost, stored on secondary storage
What is a record?
a row in a table, it contains a number of fields containing data relating to a specific item within an entity
What is a field?
Something that stores one piece of data. property of an record in an entity
What does atomic mean?
Cannot be broken down anymore
What is a flat file database?
A database that consists of a single file/ entity
What would a flat file database be suitable for ?
e.g. all members in a club
What do flat file databases cause?
a lot of redundancy
What is redundancy?
- leads to inconsistencies
How is an entity usually written?
Entity1(Attribute1,Attribute2,Attribute3)
e.g. Customers(CustomerID,DOB,Address,Phone Number)
What is special about flat file databases?
They’re unnormalised
What is another name for a fields/row?
A tuple or a record
What is a primary key? - only relational databases
a unique identifier of each record in an entity
What is a secondary key? - relational databases
secondary key is a unique attribute used for indexing
When would a secondary key be useful? - example
When a customer calls with an enquiry about an order they may not know their ID so a secondary identifier can be used e.g. surname
What does secondary key allow?
quicker searching and easier identification(as possibilities become smaller)
What is a relational database?
Database where there is more than one entity, which share attributes using foreign keys
What is a foreign key?
A primary key used as an attirbute of another table used to link the entities together. Essentially a primary of the entity that one entity is linked with.