Easy. Show the number 2 with the column name my_number. Target: One row, my_number = 2. No tables required.
SELECT 2 AS my_number;
Medium. Ask MySQL to add 2 and 3. Target: One column named total containing 5.
SELECT 2 + 3 AS total;
Hard. Display your shop's name as text. Target: One column named shop containing Learning Shop. Text needs single quotes.
SELECT 'Learning Shop' AS shop;
Professional. Prepare a two-column welcome result for your practice notebook. Target: One row: shop = Learning Shop, next_step = Connect MySQL. This is a small handoff task, not an advanced database exercise.
SELECT 'Learning Shop' AS shop, 'Connect MySQL' AS next_step;
Easy. Show the number 10 in a column called ten. Target: 1 row: ten = 10
SELECT 10 AS ten;
Easy. Show the word Hello in a column called greeting. Target: 1 row: greeting = Hello
SELECT 'Hello' AS greeting;
Easy. Multiply 12 by 5 and call it result. Target: 1 row: result = 60
SELECT 12 * 5 AS result;
Easy. Show 100 minus 35 as change_due. Target: 1 row: change_due = 65
SELECT 100 - 35 AS change_due;
Medium. Show three columns in one row: a = 1, b = 2, c = 3. Target: 1 row: a = 1, b = 2, c = 3
SELECT 1 AS a, 2 AS b, 3 AS c;
Medium. A notebook costs 100. Show the price of 3 notebooks as total. Target: 1 row: total = 300
SELECT 3 * 100 AS total;
Medium. Show the price of a 250 mug after 10% discount as sale_price. Target: 1 row: sale_price = 225.0
SELECT 250 * 0.9 AS sale_price;
Medium. Show the shop name and city in one row: Learning Shop, Pune. Target: 1 row: shop = Learning Shop, city = Pune
SELECT 'Learning Shop' AS shop, 'Pune' AS city;
Medium. Calculate 2 + 3 * 4 and explain why the answer is not 20. Target: 1 row: answer = 14
SELECT 2 + 3 * 4 AS answer;
Hard. Force the addition to happen first: (2 + 3) * 4. Target: 1 row: answer = 20
SELECT (2 + 3) * 4 AS answer;
Hard. Show a column name that has a space in it: unit price = 100. Target: 1 row: unit price = 100 (backticks keep the space in the name)
SELECT 100 AS `unit price`;
Hard. Show NULL with the alias missing_value and explain what NULL means. Target: 1 row: missing_value = NULL
SELECT NULL AS missing_value;
Hard. Show what 5 + NULL returns. Target: 1 row: result = NULL
SELECT 5 + NULL AS result;
Professional. Create a one-row receipt preview: item Pen, qty 5, price 20, line_total. Target: 1 row: item = Pen, qty = 5, price = 20, line_total = 100
SELECT 'Pen' AS item, 5 AS qty, 20 AS price, 5 * 20 AS line_total;
Professional. Write the same query twice: once on one line, once split over four lines with a -- comment. Both must give the same result. Target: 1 row: item = Pen, line_total = 100
/* receipt preview */ SELECT 'Pen' AS item, 5 * 20 AS line_total;