EVIKA.ACADEMY›SQL Tutorial
SQL Tutorial›SELECT

SQL SELECT Statement

Chapter 3 of 40 · Estimated read time: 7 min

The SELECT statement is the most used SQL command. It retrieves data from one or more tables. The result is returned as a temporary result set called the result-set.

Syntax

SELECT column1, column2, ... FROM table_name;

Example 1 — Select Specific Columns

Select only the product name and price from the products table:

SELECT product_name, price
FROM products;
OUTPUT ↓
product_nameprice
Wireless Mouse899
USB-C Hub1499
Notebook A599
Ballpoint Pens49
Desk Lamp1199
Ergonomic Chair8999
HDMI Cable299

Example 2 — Select All Columns with *

Use * (asterisk) to select every column in the table:

SELECT *
FROM products;
Avoid SELECT * in production queries. It is fine for quick exploration, but in real applications always name the columns you need — it makes queries faster, more readable, and less likely to break when the table schema changes.

Example 3 — Expressions and Calculations

You can calculate new values directly in SELECT:

-- Price including 18% GST
SELECT
  product_name,
  price,
  price * 1.18        AS price_with_gst,
  stock * price       AS inventory_value
FROM products;
OUTPUT ↓
product_namepriceprice_with_gstinventory_value
Wireless Mouse8991060.82134850
USB-C Hub14991768.82119920
Notebook A599116.8249500
Ergonomic Chair899910618.82179980
AS gives a column a new name (alias) in the result. You will learn more about aliases in the Aliases chapter.

Example 4 — Select a Literal Value

You can select constant values — useful for adding a fixed label column:

SELECT
  product_name,
  price,
  'INR'          AS currency,
  'In Stock'     AS status
FROM products
WHERE stock > 0;

Example 5 — Combine Strings (Concatenation)

-- PostgreSQL / BigQuery: use ||
SELECT
  customer_name || ' (' || city || ')' AS customer_with_city
FROM customers;

-- MySQL: use CONCAT()
SELECT
  CONCAT(customer_name, ' (', city, ')') AS customer_with_city
FROM customers;
OUTPUT ↓
customer_with_city
Amit Verma (Noida)
Priya Sharma (Delhi)
Rohan Mehta (Mumbai)
Sneha Gupta (Noida)
Arjun Singh (Bengaluru)
✏️ Practice Exercises
1. Write a query to select only customer_name and city from the customers table.
2. Select product_name, price, and a calculated column showing the price after a 10% discount.
3. Select all orders where the total_amount column is shown in thousands (divide by 1000).
Show Answers
-- 1.
SELECT customer_name, city FROM customers;

-- 2.
SELECT product_name, price, price * 0.90 AS discounted_price FROM products;

-- 3.
SELECT order_id, customer_id, total_amount / 1000.0 AS amount_k FROM orders;