You now have the SQL fundamentals every QA engineer needs. SELECT reads data. WHERE filters it. ORDER BY sorts it. INSERT creates test data. UPDATE modifies it. DELETE cleans it up. You know about data types, NULL handling, and real-world debugging scenarios. This is your foundation. Everything in the next chapters builds on this.
| Command | Purpose | Danger Level | Always Remember |
|---|---|---|---|
| SELECT | Read data | Safe | Use LIMIT on production |
| WHERE | Filter rows | Safe | Parentheses with AND/OR |
| ORDER BY | Sort results | Safe | DESC for newest first |
| INSERT | Add rows | Medium | Specify column names |
| UPDATE | Change rows | High | WHERE first, SELECT to preview |
| DELETE | Remove rows | High | WHERE first, children before parents |
| TRUNCATE | Remove all rows | Very High | Cannot undo in most DBs |
| DROP | Remove table | Critical | Removes structure + data |
Using a users table (id, first_name, last_name, email, status, city, created_at, last_login, phone) and an orders table (order_id, user_id, total_amount, status, created_at), write SQL for the following scenarios.
Key Point: SQL is the single most valuable technical skill for a QA engineer after logical thinking. Master these fundamentals and every chapter from here gets easier.
Key Point: Master SELECT, WHERE, INSERT, UPDATE, DELETE. Write WHERE first. Include SQL in bug reports. Build reusable test data scripts.
Answer all 5 questions, then submit to see your score.
1. Which SQL command is used to read data from a table without modifying anything?
2. What is the correct way to check for NULL values in SQL?
3. You need to delete test data from the orders table before deleting from users table. Why?
4. What happens if you run UPDATE users SET status = 'deleted' without a WHERE clause?
5. Why should phone numbers be stored as VARCHAR instead of INT in a database?