Concept Flow - What is SQL
Start
Write SQL Query
Send Query to Database
Database Processes Query
Return Results
Use Results
End
SQL is a language to ask databases questions and get answers by writing queries that the database understands and runs.
SELECT name FROM employees WHERE age > 30;
| Step | Action | Evaluation | Result |
|---|---|---|---|
| 1 | Parse Query | Check syntax of SELECT statement | Valid syntax |
| 2 | Check Table | Look for 'employees' table | Table found |
| 3 | Filter Rows | Apply condition age > 30 | Rows with age > 30 selected |
| 4 | Select Columns | Pick 'name' column from filtered rows | List of names |
| 5 | Return Results | Send data back to user | Names of employees older than 30 |
| Variable | Start | After Step 3 | After Step 4 | Final |
|---|---|---|---|---|
| Query Text | SELECT name FROM employees WHERE age > 30; | Same | Same | Same |
| Filtered Rows | None | Rows where age > 30 | Same | Same |
| Selected Data | None | None | Names from filtered rows | Names from filtered rows |
SQL is a language to talk to databases. You write queries like SELECT to ask for data. The database checks syntax, finds tables, filters rows, and returns results. Queries must be correct to work. SQL helps get exactly the data you want.
users?SELECT * FROM table_name;.SELECT name FROM employees WHERE age > 30;
name column from employees where the age is greater than 30.age > 30 means only employees older than 30 are included.SELEC name FROM customers;
SELECT, but here it is misspelled as SELEC.users with columns name and age. Which SQL command should you use?INSERT INTO adds new rows; UPDATE changes existing rows; SELECT reads data; DELETE removes data.Pass the test and this pattern moves unknown