This glossary covers the words you need to work with data in tables: how a database is built, how to ask it questions in SQL, how to combine and summarise tables, how to clean messy data and how to describe the numbers you get.
Each entry says what the term means, why it matters and how it differs from the term people often mix it up with. Most entries have an example: a short SQL query or a small calculation. The queries use a tiny fictional shop database with two main tables, customers(id, name, city) and orders(id, customer_id, order_date, amount, region), so you can try most of them in the SQL sandbox with tables of your own. Small details of SQL differ between database systems; the examples use the common core.
The terms are grouped in eight sections. Pick a section to see only its terms, search for a word, or practise them as flashcards.
Data and SQL terms
Data basics
- Data
- Recorded facts, such as numbers, names, dates or measurements, before anyone has interpreted them. Data becomes information once it is organised to answer a question. A list of 500 order amounts is data; "sales rose 8% in March" is information.
- 2026-03-04, Fabrikam, 1,250 euros: three pieces of data about one order.
- Dataset
- A collection of data about one topic, often one or more tables, gathered for a purpose. A good dataset comes with a description of where the data comes from and what each column means. A dataset is the whole collection; a table is one part of it.
- The Northwind sample orders: 200 orders in one CSV file, with a data dictionary.
- Table
- Data arranged in rows and columns, like one sheet of a spreadsheet. In a database each table holds one kind of thing, such as customers or orders. Unlike a spreadsheet sheet, a database table has fixed columns with fixed data types.
- A table customers with the columns id, name and city.
- Row
- One record in a table, such as one order or one customer. Every row has a value, or NULL, for every column. A row is also called a record; it holds one item, while a column describes one property of all items.
- 1042 | 2 | 2026-03-04 | 1250.00 | North
- Column
- One property that every row has, such as the order date. Each column has a name and a data type. A column is also called a field; columns describe, rows hold the actual items.
- The column order_date holds one date for every order.
- Cell
- The single value where one row meets one column, such as the city of one customer. In a well-designed table each cell holds one value only. A cell with several values, such as "Berlin, Hamburg", makes filtering and counting hard.
- Row 3, column city: Leipzig.
- Data type
- The kind of value a column holds, such as text, whole number, decimal number, date or true/false. It decides what you can do with the values: you can add numbers but not text. Numbers stored as text sort wrongly, so "10" comes before "9".
- amount DECIMAL(10,2), order_date DATE, city VARCHAR(80)
- CSV
- Comma-separated values: a plain text file of a table, with one row per line and commas between values. Almost every program can read and write it. A CSV has no data types or formatting, only text, and some countries use semicolons instead of commas.
- id,name,city / 1,Fabrikam,Berlin / 2,Contoso,Hamburg (one row per line)
- JSON
- JavaScript Object Notation: a text format for data written as names and values, which can be nested in lists and objects. Web APIs use it to exchange data. JSON can hold nested data; a CSV holds one flat table.
- {"id": 1042, "customer": "Fabrikam", "items": [{"sku": "A-17", "qty": 3}]}
- Spreadsheet
- A program or file that shows data in a grid of cells and calculates with formulas. It is quick for small tables and one-off analysis. A database handles more data and more users at once, and enforces stricter rules on what each column may hold.
- A sheet with 300 orders and a cell that adds up the amount column with =SUM(D2:D301).
- Structured data
- Data organised in a fixed format of rows and columns with known types, such as an orders table. It is easy to search, count and join. Unstructured data, such as emails, photos or free text, has no fixed format and needs other methods to analyse.
- Structured: an orders table. Unstructured: 300 customer emails about late deliveries.
- Metadata
- Data about data: when a file was made, by whom, what each column means and which unit it uses. Without it, data is easy to misread. Metadata describes the data; it is not the data itself.
- orders.csv, exported 2026-10-31, 200 rows, amounts in euros including VAT.
- Data dictionary
- A table that describes every column of a dataset: its name, data type, meaning, unit and allowed values. It lets others use the data without guessing. A data dictionary is one kind of metadata, written for people.
- order_date | DATE | Day the order was placed | format YYYY-MM-DD
Databases and design
- Database
- An organised collection of tables that belong together, stored so that many people and programs can use it safely at the same time. It enforces rules, such as which values a column may hold. The database is the data; the database management system is the software that runs it.
- The shop database holds the tables customers, products, orders and order_items.
- Database management system (DBMS)
- The software that stores databases, runs queries, controls who may do what and keeps data safe when many users work at once. Most relational DBMSs understand SQL. The DBMS is the program; a database is the data it manages.
- A school runs one DBMS on its server with separate databases for the library and the canteen.
- Relational database
- A database that stores data in tables linked by keys, so each fact is stored once and tables are combined with joins. SQL is the language used to query it. Other kinds, such as document databases, store nested records instead of linked tables.
- customers and orders are linked through orders.customer_id.
- Schema
- The design of a database: its tables, columns, data types, keys and rules. It is planned before data goes in and changed with care later. The schema is the structure; the data is what fills it.
- customers(id, name, city) and orders(id, customer_id, order_date, amount, region)
- Primary key
- The column, or set of columns, whose value identifies each row and is never repeated or empty. Other tables use it to point at the row. A name makes a poor primary key, because two customers can share the same name.
- customers.id: 1, 2, 3 and so on, each used exactly once.
- Foreign key
- A column that points at the primary key of another table and so links the rows. The database can refuse values that point at nothing. A foreign key may repeat (one customer, many orders); a primary key may not.
- orders.customer_id = 2 means the order belongs to customer 2, Contoso.
- Relationship
- How rows in two tables belong together, usually through a foreign key. One-to-many is the most common kind: one customer has many orders, each order has one customer. One-to-one and many-to-many relationships also exist.
- One customer → many orders; one order → exactly one customer.
- Many-to-many relationship
- A relationship in which rows on both sides can link to many rows on the other, such as orders and products. It cannot be stored with a single foreign key, so a junction table sits in between. It is really two one-to-many relationships.
- An order contains many products, and a product appears in many orders.
- Junction table
- A table that links two other tables in a many-to-many relationship, with one row per pair. It often holds facts about the pair, such as the quantity. It is also called a link table or bridge table.
- order_items(order_id, product_id, quantity)
- Index
- An extra structure that lets the database find rows quickly by a column's value, like the index at the back of a book. It speeds up searching and joining but slows writing a little and takes space. An index changes only the speed, never the results.
- CREATE INDEX idx_orders_customer ON orders(customer_id);
- Constraint
- A rule the database enforces on data, such as NOT NULL, UNIQUE, a foreign key or a CHECK on values. Rows that break it are refused. Constraints stop bad data at the door instead of cleaning it later.
- CHECK (amount >= 0) refuses an order with a negative amount.
- Database normalisation
- Designing tables so each fact is stored once, for example by moving customer addresses out of the orders table into a customers table. It prevents contradictions when data changes. It differs from normalising values, which makes entries comparable during cleaning.
- Instead of typing "Fabrikam, Berlin" in 300 orders, store it once in customers and point to it with customer_id.
- Entity relationship diagram (ERD)
- A drawing of a database's tables (entities), their columns and the relationships between them. It is used to plan and explain a schema. Symbols at the ends of each line show one-to-one, one-to-many or many-to-many.
- Two boxes, customers and orders, joined by a line with "1" at one end and "many" at the other.
- View
- A saved query that can be used like a table. It shows the current data every time it is read, without storing a copy. A view stores the question; a table stores the data.
- CREATE VIEW big_orders AS SELECT * FROM orders WHERE amount > 1000;
Writing queries
- SQL
- Structured Query Language: the standard language for asking databases questions and changing their data. The core is the same in every relational database, but each system adds its own details. In sales, the same letters mean a sales qualified lead.
- SELECT name FROM customers WHERE city = 'Berlin';
- Query
- A question written in SQL, which the database answers with a result table. A query that only reads with SELECT changes nothing. Statements such as UPDATE or DELETE change data and need more care.
- SELECT COUNT(*) FROM orders; returns one number.
- SELECT
- The SQL keyword that reads data: it names the columns you want, and FROM names the table they come from. SELECT * returns every column. Columns appear in the order you list them, not the order in which they are stored.
- SELECT name, city FROM customers;
- Filter
- Keeping only the rows that meet a condition, done with WHERE in SQL. Conditions can be combined with AND and OR. WHERE filters single rows before grouping; HAVING filters groups after it.
- SELECT * FROM orders WHERE amount > 1000 AND region = 'North';
- Comparison operator
- A symbol that compares two values: = equal, <> not equal, <, >, <= and >=. Each comparison is true or false for a row. A comparison with NULL is neither, so missing values need IS NULL instead.
- WHERE amount >= 500
- AND, OR and NOT
- Words that combine conditions: AND needs both to be true, OR needs at least one, NOT reverses a condition. AND is applied before OR, so brackets matter. Without brackets, a OR b AND c means a OR (b AND c).
- WHERE (city = 'Berlin' OR city = 'Hamburg') AND amount > 1000
- LIKE
- An operator that matches text against a pattern, where % stands for any number of characters and _ for exactly one. It searches for parts of a text. Whether LIKE ignores capital letters depends on the database system.
- WHERE email LIKE '%@fabrikam.example' finds every Fabrikam address.
- IN
- An operator that checks whether a value is in a list: a shorter way to write several ORs. The list can also come from a subquery. NOT IN gives no rows at all when the list contains a NULL, which surprises many people.
- WHERE city IN ('Berlin', 'Hamburg', 'Leipzig')
- BETWEEN
- An operator that checks whether a value lies in a range, including both ends. It works for numbers, dates and text. With date-and-time values, an end date of '2026-03-31' misses everything after midnight on that day, so >= and < are safer.
- WHERE amount BETWEEN 100 AND 500
- ORDER BY
- The clause that sorts the result by one or more columns, ascending (ASC, the default) or descending (DESC). Without ORDER BY, the order of the rows is not guaranteed. It sorts the output only; the stored data does not change.
- ORDER BY amount DESC lists the largest orders first.
- LIMIT
- A clause that returns only the first rows of a result, for example the top ten. It only makes sense together with ORDER BY. Some systems write it differently, as TOP or FETCH FIRST.
- ORDER BY amount DESC LIMIT 5 returns the five largest orders.
- DISTINCT
- A keyword that removes repeated rows from a result, so each combination appears once. COUNT(DISTINCT column) counts different values. DISTINCT hides duplicates in one result; it does not remove them from the table.
- SELECT DISTINCT city FROM customers; lists each city once.
- Alias
- A temporary name for a column or a table in a query, given with AS. It makes results readable and long queries shorter. The alias exists only in that query; nothing is renamed in the database.
- SELECT SUM(amount) AS revenue FROM orders;
- CASE
- An expression that returns different values depending on conditions, like an if-then-else inside a query. It is used to sort values into groups or give them labels. CASE adds a new value to each row; WHERE removes rows.
- CASE WHEN amount >= 1000 THEN 'large' ELSE 'small' END AS size
- Subquery
- A query written inside another query, in brackets. Its result is used as a single value, a list or a temporary table. A subquery lives inside one statement; a view is saved for reuse.
- WHERE amount > (SELECT AVG(amount) FROM orders) finds orders above the average.
- Common table expression (CTE)
- A named temporary result defined with WITH at the start of a query and then used like a table. It makes long queries readable, one step at a time. A CTE exists for one query only; a view is saved in the database.
- WITH big AS (SELECT * FROM orders WHERE amount > 1000) SELECT region, COUNT(*) FROM big GROUP BY region;
Joins
- Join
- Combining rows of two tables that belong together, usually where a foreign key matches a primary key. The ON clause states the matching rule. The kind of join decides what happens to rows without a partner.
- SELECT c.name, o.amount FROM orders o JOIN customers c ON o.customer_id = c.id;
- Inner join
- A join that keeps only rows with a partner in both tables; it is what plain JOIN means. Customers without orders disappear from the result. That is sometimes intended and sometimes a hidden mistake, so compare row counts.
- 50 customers, 42 of them with orders: the inner join shows 42 customers.
- Left join
- A join that keeps every row of the left (first) table and adds matching rows from the right one, with NULL where there is no partner. It is used to find what is missing. A right join does the same from the other side and is rarely needed.
- customers LEFT JOIN orders, then WHERE orders.id IS NULL, finds the 8 customers who never ordered.
- Full outer join
- A join that keeps all rows from both tables, matched where possible and filled with NULL where not. It shows mismatches on both sides at once. Not every database system supports it.
- Comparing a list of customers with a list of invoices shows who is missing from either side.
- Cross join
- A join that pairs every row of one table with every row of the other, with no matching rule. 10 rows and 20 rows give 200 rows. It is useful for building combinations, but a forgotten ON clause can create one by accident.
- 3 sizes × 4 colours = 12 product variants.
- Self join
- Joining a table to itself, using two different aliases. It is used when rows point at other rows in the same table. A self join uses one table twice; a normal join uses two different tables.
- SELECT e.name, m.name AS manager FROM employees e JOIN employees m ON e.manager_id = m.id;
- Join key
- The column or columns used to match rows in a join, usually a foreign key and the primary key it points to. Matching on names or other free text is risky because of spelling differences. Both sides should have the same data type.
- orders.customer_id matches customers.id.
- Row multiplication
- What happens when a join matches one row to several partners: the row is repeated once for each. Sums taken after such a join can count the same amount several times. Checking the row count before and after a join catches it.
- An order with 3 items, joined to order_items, appears 3 times, so summing the order total triples it.
Aggregates and grouping
- Aggregate
- A value calculated from many rows, such as a count, sum or average. Aggregate functions turn many rows into one result per group. Without GROUP BY, they return a single row for the whole table.
- SELECT COUNT(*), SUM(amount), AVG(amount) FROM orders;
- COUNT
- The aggregate function that counts rows. COUNT(*) counts all rows; COUNT(column) counts only rows where that column is not NULL. The two can give different answers on the same table.
- COUNT(*) gives 200 orders; COUNT(discount_code) gives 35 orders that used a code.
- SUM
- The aggregate function that adds up the values of a numeric column. NULL values are skipped. If no rows match at all, SUM returns NULL rather than 0.
- SELECT SUM(amount) FROM orders WHERE region = 'North';
- AVG
- The aggregate function that returns the mean of a numeric column. NULL values are left out, which gives a different result from counting them as 0. AVG gives the mean, not the median.
- Values 100, 200 and NULL: AVG gives 150, not 100.
- MIN and MAX
- Aggregate functions that return the smallest and the largest value of a column. They work on numbers, dates and text. On text they compare alphabetically, so MAX(city) is the city that comes last in the alphabet.
- MIN(order_date) is the first order, MAX(order_date) the most recent one.
- Group
- Rows that share a value and are summarised together with GROUP BY. Every column in the SELECT must either be in the GROUP BY or inside an aggregate. The result has one row per group.
- SELECT region, SUM(amount) FROM orders GROUP BY region; gives one row per region.
- HAVING
- The clause that filters groups after GROUP BY, using aggregate values. WHERE filters single rows before grouping; HAVING filters the groups that result. A condition on SUM or COUNT must go in HAVING.
- GROUP BY customer_id HAVING COUNT(*) >= 5 keeps customers with five or more orders.
- Window function
- A function that calculates across a set of related rows but keeps every row, unlike GROUP BY. It is used for running totals, rankings and comparisons with the previous row. The OVER clause defines which rows it looks at.
- SUM(amount) OVER (ORDER BY order_date) gives a running total on every row.
- Pivot table
- A spreadsheet tool that groups and summarises rows by the values in one or two columns, like GROUP BY with a few clicks. The rows and columns of the summary can be swapped freely. It summarises the data; it does not change the source.
- Regions down the side, months across the top, the sum of amount in the cells.
Changing data
- INSERT
- The SQL statement that adds new rows to a table. You list the columns and then the values in the same order. Constraints are checked, so a row that breaks a rule is refused.
- INSERT INTO customers (id, name, city) VALUES (51, 'Litware', 'Dresden');
- UPDATE
- The SQL statement that changes values in existing rows. Without a WHERE clause it changes every row in the table. Running the same WHERE as a SELECT first shows which rows will change.
- UPDATE customers SET city = 'Leipzig' WHERE id = 7;
- DELETE
- The SQL statement that removes rows from a table. Like UPDATE, it hits every row if the WHERE clause is missing. DELETE removes rows but keeps the table; DROP TABLE removes the table itself.
- DELETE FROM orders WHERE order_date < '2020-01-01';
- CREATE TABLE
- The SQL statement that creates a new table with its columns, data types and constraints. It defines the structure only, so the table starts empty. Planning the schema first saves changes later.
- CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT NOT NULL, price DECIMAL(8,2));
- ALTER TABLE
- The SQL statement that changes an existing table, for example by adding, renaming or removing a column. The data stays, but programs that use the table may break. ALTER changes the structure; UPDATE changes the values.
- ALTER TABLE customers ADD COLUMN country TEXT;
- DROP TABLE
- The SQL statement that deletes a whole table with all its data. There is usually no undo apart from a backup. DROP TABLE removes the table; DELETE only removes rows from it.
- DROP TABLE old_imports;
- Transaction
- A group of changes that the database treats as one: either all succeed (COMMIT) or none do (ROLLBACK). It keeps data consistent when something fails half-way. In a bank transfer, money must leave one account and arrive in the other, or neither.
- BEGIN; UPDATE accounts SET balance = balance - 100 WHERE id = 1; UPDATE accounts SET balance = balance + 100 WHERE id = 2; COMMIT;
- CRUD
- Create, read, update, delete: the four basic things done with stored data. In SQL they are INSERT, SELECT, UPDATE and DELETE. Much business software, a CRM for example, is a set of CRUD screens on top of a database.
- Adding a contact, viewing it, changing its phone number and removing it.
- Backup
- A copy of data kept separately so it can be restored after a mistake, a failure or an attack. A backup is only useful if restoring it has been tested. A backup protects against losing data; a transaction protects one set of changes from being half done.
- Every night at 2 am the shop database is copied to a server in another building.
Data quality and cleaning
- NULL
- An empty value: nothing was recorded. NULL is not zero and not empty text; it means unknown or missing. Comparisons with NULL are never true, so you test for it with IS NULL.
- WHERE phone IS NULL finds customers without a phone number; WHERE phone = NULL finds nothing.
- Missing value
- A value that should be there but is not, shown as NULL, an empty cell or a placeholder such as "n/a" or 0. Missing values can distort averages and counts. Decide on purpose whether to leave, fill or exclude them, and say which you did.
- 12 of 200 orders have no region: report them as "region unknown" instead of dropping them silently.
- Duplicate
- The same record entered more than once. Duplicates inflate counts and sums and can lead to the same person being contacted twice. Exact duplicates are easy to find; near duplicates differ in spelling or format.
- "Fabrikam" and "Fabrikam " (with a space at the end) on two rows with the same email address.
- Deduplication
- Finding duplicate records and merging or removing them. It needs a rule for what counts as the same, such as the same email address, and a rule for which version to keep. Deduplication removes repeats from the data; DISTINCT only hides them in one result.
- 1,040 rows, 37 of them with an email address already seen: 1,003 rows after deduplication.
- Normalisation
- Making values comparable before checking or matching them, such as ignoring capital letters, removing extra spaces or writing dates the same way. It is a cleaning step. Database normalisation is a different idea: designing tables so each fact is stored once.
- " Anna.Berger@Fabrikam.EXAMPLE " becomes "anna.berger@fabrikam.example".
- Standard format
- An agreed way of writing a kind of value so everyone reads it the same way, such as ISO 8601 for dates (YYYY-MM-DD). Values in a standard format sort and compare correctly. Without one, 03/04/2026 means 3 April in Britain but 4 March in the US.
- 2026-03-04 instead of 4.3.26, 03/04/2026 or "4th March".
- Validation
- Checking that values follow the rules before they are saved or used: the right type, an allowed range, the correct format, required fields filled. It catches errors at the source. Validation checks the form of a value; it cannot prove that a well-formed value is true.
- A form refuses an order quantity of -3 and a delivery date in the past.
- Data cleaning
- Fixing or removing wrong, incomplete, duplicate or badly formatted data before analysis. Keep the original file and write down every step, so the cleaning can be checked and repeated. Cleaning changes the data; analysis only reads it.
- Trim spaces, fix date formats, merge duplicates, mark impossible values, then start the analysis.
- Whitespace
- Invisible characters such as spaces, tabs and line breaks. An extra space at the start or end of a value makes "Berlin" and "Berlin " different to a computer. Functions such as TRIM remove it.
- TRIM(' Berlin ') returns 'Berlin'.
- Character encoding
- The rule that turns characters into bytes, such as UTF-8. If a file is read with the wrong encoding, letters such as ü or é turn into nonsense. UTF-8 covers almost every language and is the safe default.
- "Müller" in a CSV is "Müller" read with the wrong encoding.
- Outlier
- A value far away from the others. It can be an error, such as an extra zero, or a real but rare case. Check outliers before removing them, because a real one may be the most interesting row.
- Order amounts are mostly between 200 and 2,000 euros, and one is 98,000 euros.
- Fuzzy matching
- Finding values that are similar but not identical, such as "Fabrikam Ltd" and "Fabrikam Limited", by measuring how alike two texts are. Exact matching misses these. Fuzzy matching finds them, but a person should check the doubtful pairs.
- "Contoso Ltd", "Contoso" and "Contosso": three spellings of one company.
Statistics
- Mean
- The sum of all values divided by how many there are, often simply called the average. Outliers pull it strongly. When a few values are very large, the median describes the typical case better.
- (200 + 300 + 400 + 3,100) / 4 = 4,000 / 4 = 1,000.
- Median
- The middle value once all values are sorted; with an even count, the mean of the two middle values. Outliers hardly move it. A mean far above the median shows that a few large values pull the average up.
- 200, 300, 400, 3,100: median (300 + 400) / 2 = 350, while the mean is 1,000.
- Mode
- The value that appears most often. It is the only average that works for categories, such as the most common city. A set of values can have several modes, or none.
- Berlin, Hamburg, Berlin, Leipzig, Berlin: the mode is Berlin.
- Range
- The difference between the largest and the smallest value. It shows the spread quickly but depends entirely on the two extremes. The interquartile range, between the 25th and 75th percentiles, is less affected by outliers.
- Smallest order 40 euros, largest 2,040 euros: a range of 2,000 euros.
- Standard deviation
- A measure of how far values typically lie from the mean. A small value means the data sits close together; a large one means it is spread out. It is in the same unit as the data, unlike the variance, which is its square.
- Delivery times of 2, 3, 3 and 4 days have a smaller standard deviation than 1, 1, 5 and 5, though both average 3.
- Percentile
- The value below which a given share of the data lies. The 50th percentile is the median; the 25th and 75th are the quartiles. A percentile is a value in the data's own unit, while a percentage is a share.
- The 90th percentile of delivery times is 5 days: 90% of deliveries take 5 days or less.
- Weighted average
- An average in which some values count more than others, according to a weight such as the size of each group. It is the right choice when groups differ in size. A simple mean of group averages ignores how big each group is.
- 100 orders averaging 50 euros and 300 averaging 30 euros: (100 × 50 + 300 × 30) / 400 = 35 euros, not 40.
- Percentage change
- How much a value grew or shrank compared with where it started: (new - old) / old × 100. A fall of 50% needs a rise of 100% to get back. It differs from a change in percentage points.
- From 400 to 500 orders: (500 - 400) / 400 = +25%.
- Percentage point
- The unit for the difference between two percentages. A rate that goes from 10% to 12% rises by 2 percentage points, which is a 20% increase. Mixing the two up makes changes sound bigger or smaller than they are.
- A reply rate up from 5% to 6% is +1 percentage point, or +20%.
- Correlation
- A measure of how closely two variables move together, from -1 (opposite) through 0 (no straight-line link) to +1 (together). It shows a link, not a cause. Ice cream sales and sunburn correlate because both depend on sunny weather.
- Over 12 months, website visits and orders rise and fall together: a strong positive correlation.
- Sample
- The part of a group that is actually measured, used to draw conclusions about the whole group, called the population. It should be chosen so it represents the population, for example at random. A small or one-sided sample can give confident but wrong answers.
- Surveying 200 of Contoso's 4,000 customers, picked at random.
- Frequency table
- A table that counts how often each value, or each range of values, occurs. It is the first step towards a bar chart or a histogram. Relative frequency shows the counts as shares of the total.
- North 80, South 70, West 50 orders: 200 in total, so North has a relative frequency of 40%.
Using it in class
As a reference. Keep the glossary open while learners work in the SQL sandbox or on the SQL basics exercise. When a query fails or returns something unexpected, ask them to look up each keyword in it and check what it really does. Most surprises come from NULL, from WHERE versus HAVING and from row multiplication after a join.
As flashcards. Start with "Data basics" and "Writing queries", then add "Joins" and "Aggregates and grouping" once learners write their first joins. "Statistics" works on its own in a maths or business class. A good homework: for each card in a section, write one query or calculation of your own using the shop tables.
For a vocabulary test. Pick ten terms from one or two sections and use three kinds of question:
Give the definition, learners write the term.
Give a short query, learners say what each keyword does and what the result will contain.
Give a pair from the table below, learners explain the difference in one sentence and give an example.
Mark one point for the meaning and one for a correct example or difference.
Often mixed up | The difference in one line |
|---|---|
Row and column | A row is one item; a column is one property of every item. |
Primary key and foreign key | A primary key identifies a row and is unique; a foreign key points at one and may repeat. |
WHERE and HAVING | WHERE filters rows before grouping; HAVING filters groups after it. |
Inner join and left join | An inner join drops rows without a partner; a left join keeps all rows of the first table. |
NULL and 0 | NULL means unknown; 0 is a known value. |
DELETE and DROP TABLE | DELETE removes rows; DROP TABLE removes the whole table. |
DISTINCT and deduplication | DISTINCT hides repeats in one result; deduplication removes them from the data. |
Normalisation and database normalisation | One makes values comparable; the other stores each fact once. |
Mean and median | The mean adds and divides; the median takes the middle value and resists outliers. |
Percentage change and percentage points | From 10% to 12% is +2 points but +20%. |
Related resources
SQL joins lesson and SQL joins exercise: inner and left joins step by step.
Analyse sales data with SQL: grouping, HAVING and aggregates on a realistic table.
Data cleaning basics and Duplicate or not?: the cleaning terms in practice.
Mean, median and the outlier: choose the right average for a set of numbers.
Sample orders dataset: a fictional table to practise on.
