Databases Flashcards
What is a database?
A database is a structured way to store data so that it can be retrieved using queries
What do database fields meed to have?
A data type
What are flat file databases
Databases that store a single table of data in a text file
Advantages and Disadvantages of flat file databases
Ad- Easy to set up
Dis-Hard to manage larger data sets
Data repeated more often leading to more inconsistencies and redundancies making searching and sorting more difficult
What is a primary key?
A file that is unique for each record in the table
Eg.ID number
What is data repeated in a table know as?
Redundancy
What is the same data written in different ways in the same field (eg. ‘Five’ and ‘5’) called?
Inconsistency
What is a relational database?
A database with multiple tables, with links know as relationships
Advantages and disadvantages of relational databases?
Ad- Less repetitions in the same table reducing inconsistencies and data redundancy.Easier to manage larger sets of data
Dis-Initially harder to set up
What is a foreign key?
A field in a table that references the primary key of another table
Relationship types
One to one (eg one owner to one dog)
Many to many (eg many books to many authors)
One to many (eg many kids to one teacher)