Databases (Ultimate Deck) 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
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
- 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