Loading…
Welcome to SQL! SQL (Structured Query Language) is the most widely-used language for working with databases. Companies like Google, Amazon, Netflix, and banks all rely on SQL every day to manage their data.
A database is like a collection of organized spreadsheets (called tables). Each table stores rows of data, and each row has columns (fields) that describe specific attributes.
Here's what the products table looks like:
| id | name | category | price |
|---|---|---|---|
| 1 | Laptop | Electronics | 999 |
| 2 | Notebook | Office | 5 |
| ... | ... | ... | ... |
The most basic SQL command is SELECT. It retrieves data from a table.
Syntax:
SELECT * FROM table_name;
Let's break this down:
SELECT — tells the database you want to retrieve data* — means "all columns" (a wildcard)FROM — specifies which table to pull data from; — ends the statement (always include this!)Every data analysis project starts with SELECT. Whether you're checking inventory, reviewing sales numbers, or building a report — this is your starting point.
FROM keyword; at the endWe have a table called products with information about items in a store.
Write a query to select all data from the products table.
Run your query to see results