Spreadsheets and Databases Flashcards
What is a database? What is a database management system?
A database is a collection of organised information that can be easily accessed, managed and updated. A database management system is a software that allows for the creation and editing of databases.
Define the following terms:
1. Table
2. Field
3. Record
- Table - Stores data in rows (records) and columns (fields)
- Field - A column that holds a specific category of data (E.g., Name, Product number)
- Record - A row containing all the details/information about one item (E.g., a student’s details)
What is a primary key?
A primary key is a field which uniquely identifies each record in a table. It doesn’t allow for duplicate data to be entered and cannot be left empty.
What are the datatypes for databases?
- Text - For words and letters
- Number/Numerical/Integer - For numerical values
- Date/Time - For dates ad times
- Yes/No or Boolean - For true/false or yes/no answers
- Curreny - For monetary values
What is data validation?
Data validation ensures the data entered into a database is meaningful, consistent and accurate. It prevents incorrect data from being stored in your database.
What is the purpose of -
1. Range Check
2. Presence Check
3. Length Check
- Range Check - Ensures a number or data falls within a specific range
- Presence Check - Ensures that a field is not left blank
- Length Check - Ensures that the data entered is of a specific length or within a length range
What is the purpose of -
1. Type Check
2. Format Check
3. Uniqueness Check
4. Consistency Check
- Type Check - Ensues that a data is of a correct type (e.g., date, numerical)
- Format Check - Ensures that te data matches a specific format or pattern
- Uniqueness Check - Ensures that the entered data is unique and doesn’t duplicate existing data
- Consistency Check - Ensures that the related data is logically consistent
How to write a length check?
Len([Field_Name])<=LENGTH
Describe the following functions -
SUM, AVERAGE, PRODUCT, ROUND
Sum - Adds all the numbers in a given range
Average - Calculates the average/mean of all the numbers in a given range
Product - Multiplies all the numbers in a given range
Round - Rounds a number to a specified number of decimal places
Describe the following functions -
MAX, MIN, COUNT, COUNTA, COUNTIF, SUMIF
Max - Returns the highest value of all the numbers in a given range
Min - Returns the lowest value of all the numbers in a given range
Count - Counts the number of numerical values in a given range
CountA - Counts all the non-empty cells in the range
Countif - Counts the number of cells which meet a specific condition
Sumif - Adds the values of cells that meet a specific condition.
How do you write these functions?
IF, NESTED IF, COUNTIF, SUMIF
(Write via examples)
=IF(condition, “value_if_true”, “value_if_false”)
=IF(condition, “value_if_true”, IF(condition2, “value_if_true”, “value_if_false”))
=COUNTIF(range, criteria in “”)
=SUMIF(range, “criteria”)