Why use a database instead of a spreadsheet

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Why use a database instead of a spreadsheet

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which tool makes sure every record has the same fields?
A A spreadsheet
B A database
2. Which tool is better for storing thousands of student records?
A A database
B A spreadsheet
3. In a database, a field has a fixed data type such as integer or text.
A False
B True
4. Which tool lets you ask a question of the data using a query?
A A database, using SQL
B A spreadsheet grid, using colours
5. Which is a flexible grid where you can type anything in any cell?
A A spreadsheet
B A database

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1SELECT firstName FROM students WHERE house = 'Red'; ACREATE TABLE products (productId INTEGER, name TEXT, price REAL);
2students(studentId, firstName, lastName, yearLevel, house, points) BA spreadsheet is a flexible grid that gets slow and hard to manage with huge data. A database suits large amounts of data and queries.
3A database lets you query large amounts of data to find just the matching records CA flexible spreadsheet grid does not stop mixed data types in one column. A database field has one fixed data type, so this would be rejected.
4A database makes every record follow the same structure, with a fixed data type for each field DAsks the database a question: show the first names of only the students in Red house
5A spreadsheet cell in the points column holds the text 'lots' while the other cells hold numbers EEvery record in the table has these same fields, each with a fixed data type
6Use a spreadsheet to store and search millions of customer records because it is best for large amounts of data FSELECT * FROM students WHERE points > 100;

Definitions

database

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
______ * FROM students
2.
SELECT * FROM students _____ house = 'Red'
3.
SELECT _____(*) FROM results
4.
CREATE TABLE pets ( name TEXT, age _______ );
5.
SELECT * FROM ________ WHERE yearLevel = 7

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A SELECT firstName points
B FROM students
C WHERE points > 100;
Question 2
A CREATE TABLE pets (
B petId INTEGER
C name TEXT,
D age INTEGER
E );
Question 3
A SELECT name, price
B FROM products
C WHERE stock > 0
D ORDER price;
Question 4
A SELECT COUNT(*)
B FROM students
C WHERE house = Red;
Question 5
A SELECT name, category
B FROM product
C WHERE price < 10;

Answer Key

Why use a database instead of a spreadsheet
Section A: Quick Questions
Q1
B — A database
Q2
A — A database
Q3
B — True
Q4
A — A database, using SQL
Q5
A — A spreadsheet
Section B: Match the Pairs
Q1
SELECT firstName FROM students WHERE house = 'Red'; → Asks the database a question: show the first names of only the students in Red house
Q2
students(studentId, firstName, lastName, yearLevel, house, points) → Every record in the table has these same fields, each with a fixed data type
Q3
A database lets you query large amounts of data to find just the matching records → SELECT * FROM students WHERE points > 100;
Q4
A database makes every record follow the same structure, with a fixed data type for each field → CREATE TABLE products (productId INTEGER, name TEXT, price REAL);
Q5
A spreadsheet cell in the points column holds the text 'lots' while the other cells hold numbers → A flexible spreadsheet grid does not stop mixed data types in one column. A database field has one fixed data type, so this would be rejected.
Q6
Use a spreadsheet to store and search millions of customer records because it is best for large amounts of data → A spreadsheet is a flexible grid that gets slow and hard to manage with huge data. A database suits large amounts of data and queries.
Section C: Definitions
Q1
database — A database gives every record the same fields and data types and lets you query large amounts of data; a spreadsheet is a flexible grid.
Section D: Fill in the Blanks
Q1
SELECT * FROM students
Q2
SELECT * FROM students WHERE house = 'Red'
Q3
SELECT COUNT(*) FROM results
Q4
CREATE TABLE pets ( name TEXT, age INTEGER );
Q5
SELECT * FROM students WHERE yearLevel = 7
Section E: Spot the Error
Q1
A — Fields in a SELECT list must be separated by commas. It should be SELECT firstName, points. A query picks out the fields and matching records you ask for.
Q2
B — Each field definition in a table is separated by a comma. It should be petId INTEGER, with a comma. A database fixes the fields and data types so every record has the same structure.
Q3
D — Sorting needs the keyword BY. It should be ORDER BY price;. Queries can pick matching records and sort them, even in large tables.
Q4
C — Text values in a condition need quotes. It should be WHERE house = 'Red';. Without quotes SQL thinks Red is a field name.
Q5
B — The table is called products, not product. A database table has a fixed name and fixed fields, so the query must use them exactly.