Databases IB SL + HL Flashcards
Distinction between Data and Information
Data is just raw facts, numbers and figures
(e.g. 1975)
Information is data that has been given a context and meaning.
(e.g. The Vietnam war ended in 1975)
Database
An organized collection of structured information.
What is the software called that creates, defines, and manipulates a database?
Database Management System (DBMS)
What are the things at the top of columns in a database that describe what’s inside that column?
Fields/Attributes
What is a row in a database referred to?
A record
3 Benefits of a database
- Enables for processing/querying of data
- Can easily generate reports
- Standardized (can be used by multiple systems)
Data Verification (in context of databases)
This is the checking that input matches expected values in database
E.g. login details of a user matches those stored in the database
Data Validation (in context of databases)
Checks that input follows rules for the type of input entered
For example: CVV code should be 3 numerical digits
Entity
A real-world object or person represented by a record in a database
Primary Key
A unique key used to identify a given record in a database
Foreign Key
A field in one table that refers to the primary key field in another table. It is used to connect (relational) databases.
6 different types of data types in a database
- Text:
Combination of letters, numbers or symbols. Basically a string. - Character:
In individual letter, number or symbol - Boolean:
A binary value (True/False, Yes/No) - Integer:
A whole number - Real:
A decimal number - Datetime:
A date and/or time
Write the SQL to get ProductName from the table Products where the price is more than 20 but less than 25
SELECT ProductName FROM Products WHERE Price > 20 AND Price < 25
Secondary Key
Keys that are also capable of functioning as a primary key. Also known as the alternate key.
2 differences between Primary and Secondary Key
Primary Key - Cannot be Null, only one primary key possible
Secondary Key - Can be Null, multiple secondary keys possible
Candidate Key
Umbrella term for keys that can uniquely identify each record in a database
Both primary and secondary keys are candidate keys
Composite Primary Key
When one field is not enough to uniquely identify records, two fields can function together as the primary key
Database schema
A diagram of how data is organized in a relational database.
This means a diagram showing table names, fields, data types of fields, and relationships between tables
Records can also be referred to as?
Tuples
Referential Integrity
This is a feature of relational databases. What this means is every row has a primary key, and that every value in a foreign key column will be found in the primary key of the table from which it originated.
Concurrency, and what does it use to prevent more than one user accessing the same row/record at the same time?
This is the process referred to managing simultaneous updates or transactions at the same time. It ensures updates/transactions occur sequentially to avoid collision between users’ actions.
Row locking
Data Dictionary
A file or set of files that stores how the information and tables should be organized and stored in a database
How does DBMS provide security to a database? (5 ways)
- Access Rights
- Audit trail (Record of any changes to the database)
- Data/Row Locking
- Encryption
- Backups - Continually updated copes that can be accessed in case the original database is lost or corrupted