1.3.2 databases
No description yet. This curated deck is ready for daily study.
Card preview (24)
what is a database
• An organised collection of data (persistent organised store of related data)
what does organising data in an electronic database allow for? (advantages)
• easier + quicker adding, modification, deletion, updating and searching • easier to back up data • can be accessed by multiple people at the same time from different locations
what is data
• information stored which can to be personal in some cases • it can be collected and analysed
what is information
• facts and details about a certain thing in context.
what is knowledge
• something humans obtain/acquire and remember by reading or searching up topics to broaden understanding.
what is a relational database
• Where data is stored in tables grouped by entity and linked (related) together.
what is a relationship and what is needed in both tables for it to work
• link between tables • we need a common field in both tables for relationship to work
when designing a relational database and linking tables, relationships come in what 3 forms?
• one-to-one • one-to-many • many-to-many
what do we use to sketch the relationships between tables
• entity-relationship diagram (ERD) • can also call it entity-relationship model
what is a flat file database. what is a suitable use for this type of database (think in terms of quantity of data)
• A database with multiple independent tables or single table • no links/relationships between tables • suitable to store small amount of data e.g contact details, small product database, maintain game/music collection
what is a flat file database normally saved as
• a comma-separated values file (CSV)
what are the positives to a flat file database
• simple + require little expertise to maintain • quick to set up • all records stored in one place
what are the downsides to a flat file database
• no links –> inefficient • can become difficult to maintain, expand in future and update, less secure • not easy to query - searching slower • data can be easily duplicated (take up unnecessary storage space due to redundancy)
what are the advantages of a relational database (multiple diff. tables linked together using relationships created by primary and foreign keys)
• Data Integrity maintains consistency, accuracy and reliability of data • referential integrity can be enforced which improves data integrity • Linked tables makes it easier to query, add, modify, delete, update, search and manage/maintain • Easier to change format • Provides security features - keeping data secure is of high importance • Normalised to 3NF • Ensures less data duplication therefore less redundant data reducing file size
drawbacks of relational database
• more difficult to set up and need more technical expertise to do things like normalisation • data spread out between multiple table. some tables may be link tables which only display key fields / references • more expensive as DBMS required
what is a primary key
• field in a table that is unique for every record
what does the primary key ensure for each record
• primary key ensures that each record is distinct from the others.
what is a foreign key
• it’s the unique primary key field of one table that is stored in another for purpose of creating a link between the tables. (linking field in a table that is a primary key in a related table)
fill the gaps: • a foreign key value must have a corresponding _________ ____ value in another _____
• primary key • table
In order to combine information from two tables, there must be a what?
• there must be a primary/foreign key pair.
what are composite keys are made up of.
• more than one attribute
give an example of composite key used for taking one school course
• none of the attributes on their own (Subject and StudentID) can be guaranteed unique. • But, a student can only enrol for a subject just once so combination of Subject and StudentId will be unique. • Combining these two attributes will form a composite primary key. (to uniquely identify a record)
what is a secondary key
• a field by which records are likely to be searched and is therefore indexed
what is meant by “indexed”
• process of creating a linked list (database index) to improve speed of data retrieval operations on a dataset table at the cost of additional writes and storage space to maintain the index data structure.