Databases Flashcards
What is a database?
An organized collection of data.
What are the benefits of using databases?
=> Make it easier to add, modify, delete, and search for data.
=> Make backing up and creating copies of data easier.
=> Can be accessed by multiple people from multiple locations simultaneously.
How can a database be broken down?
=> A database is made of tables.
=> Tables are made up of records.
=> Records are made up of fields.
What are the differences between a flat file database and a relational database?
=> Flat file databases are very inefficient as they contain a lot of redundant data duplicates which take up space in the database. As the database grows, the problem quickly escalates. Flat file databases are slow to query, difficult to maintain, and take up unnecessary space.
=> Relational databases are more efficient since they split data into multiple tables create a relationship between them, telling us how tables are linked together. Normalized databases can have either one-to-one or one-to-many relationships. For a relationship to work however, both tables being linked need to have a field in common.
What are primary and foreign keys? Why are they required?
=> A primary key is a unique identifier within a data table that is used to create relationships between tables.
=> A foreign key is a key within a data table that links directly to the primary key of another table.
=> They are required for creating links between tables in a database.
What is a flat file database?
=> Generally used for very small amounts of data.
=> Data redundancy becomes an issue as the database size increases.
What is data redundancy?
When lots of data is replicated in a database leading to inefficiency.
Why is data redundancy an issue?
=> If a piece of data needs to be changed, all instances of the data would need to be changed to maintain data integrity.
=> Adding fields means that entries will have to be repeated multiple times.
What is a relational database?
=> Created to remove the problems that existed with flat file databases.
=> Made up of lots of small tables linked together.
What advantages are there to using relational databases?
=> Removes any redundant data.
What disadvantages are there to using relational databases?
=> More complex to create and maintain.
=> Requires all separate data tables to be linked together.