---
title: "SQL: Query Fundamentals & Database Concepts"
description: "Master the fundamentals of Relational Databases, from basic SELECT statements to complex JOIN operations and database normalization."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/sql-query-fundamentals-quiz
---

# SQL: Query Fundamentals & Database Concepts

Welcome to the SQL Basics Quiz! Relational databases hold the data behind most modern applications. Whether you're a developer writing queries or a DevOps engineer maintaining a production cluster, mastering SQL is essential for data integrity and system performance. This quiz will test your knowledge from basic selection to complex joins and database management. Good luck!

## Questions

### 1. What does "SQL" stand for?

- Simple Query Language
- Structured Query Language
- System Query Logic
- Standard Queue List

**Hint:** A language for structures.

### 2. Which SQL statement is used to extract data from a database?

- GET
- SELECT
- EXTRACT
- FETCH

**Hint:** Retrieves records.

### 3. Which clause is used to filter records based on a specific condition?

- IF
- WHERE
- FILTER
- CONDITION

**Hint:** Filters the rows.

### 4. What is the purpose of the "INNER JOIN" keyword?

- To merge only the primary keys of two unrelated tables
- To return records that have matching values in both tables
- To combine all rows from all tables regardless of matches
- To create a copy of a table within the same database schema

**Hint:** Matches both sides.

### 5. Which SQL command is used to update existing data in a table?

- MODIFY
- UPDATE
- REPLACE
- CHANGE

**Hint:** Modify values.

### 6. What is a "Primary Key"?

- The first column created during the table definition
- A column that uniquely identifies each row in a table
- The encrypted password used to access the database server
- A metadata tag that describes the purpose of the database

**Hint:** Unique identifier.

### 7. What is a "Foreign Key"?

- A column that establishes a relationship between two tables
- A secondary index used to speed up complex query joins
- A backup identifier used when the primary key is corrupted
- An external API key used to connect to third-party databases

**Hint:** Links to another table.

### 8. How do you sort the result set in SQL?

- SORT BY
- ORDER BY
- ARRANGE
- GROUP BY

**Hint:** Arrange the rows.

### 9. What is the "LEFT JOIN" keyword used for?

- To return all records from the left table and matched records from the right
- To return only the records that exist in the left table but not the right
- To merge columns from two tables without checking for matching values
- To remove the right-most columns from the final query result

**Hint:** Keep everything from the left.

### 10. What is "Database Normalization"?

- The process of compressing data to save physical disk space
- Organizing data to minimize redundancy and maximize data integrity
- Converting all non-standard data types into string formats
- The automated process of fixing corrupted database indexes

**Hint:** Reducing redundancy.

### 11. Which SQL command is used to remove a table from a database?

- DELETE
- DROP
- REMOVE
- TRUNCATE

**Hint:** Deletes the structure.

### 12. What is the "GROUP BY" clause used for?

- To arrange the query results in alphabetical order
- To arrange rows with identical values into summary rows
- To limit the number of users who can access a table
- To join multiple tables into a single virtual view

**Hint:** Used with COUNT, SUM, or AVG.

### 13. Which aggregate function finds the number of rows in a table?

- SUM()
- COUNT()
- TOTAL()
- ADD()

**Hint:** Total amount.

### 14. What is the "HAVING" clause used for?

- To filter rows before they are processed by a join
- To filter groups based on a condition after aggregation
- To define a primary key on a newly created table
- To check if a subquery returns any valid results

**Hint:** Filter for groups.

### 15. What does "NULL" represent in SQL?

- A value of zero for numerical columns
- The state of a value being missing or unknown
- An empty string within a character column
- A boolean value indicating a false condition

**Hint:** Empty vs Unknown.

### 16. Which keyword is used to return only unique values?

- UNIQUE
- DISTINCT
- DIFFERENT
- SINGLE

**Hint:** No duplicates.

### 17. What is the purpose of the "LIKE" operator?

- To verify that two tables have identical column names
- To search for a specified pattern within a string column
- To join tables that have similar data structures
- To sort data based on the similarity of text values

**Hint:** Pattern matching.

### 18. What is a "Transaction" in SQL?

- A single data transfer between two different servers
- A unit of work that succeeds or fails as a complete set
- The history of all changes made to a specific record
- An individual row within a financial ledger table

**Hint:** All or nothing.

### 19. What is an "Index" used for?

- To define the order in which columns appear in a query
- To provide a faster lookup path for retrieving data rows
- To map the physical location of the database on the disk
- To count the total number of tables in a database schema

**Hint:** Speeding up reads.

### 20. Which SQL command is used to add new rows to a table?

- ADD DATA
- INSERT INTO
- PUSH
- CREATE ROW

**Hint:** Put data in.

### 21. What is a "View" in SQL?

- A graphical user interface for browsing database tables
- A virtual table based on the results of a stored query
- A snapshot of the database used for backup and recovery
- A read-only permission level assigned to guest users

**Hint:** A virtual table.

### 22. What does the "AS" keyword do?

- It permanently renames a column in the database schema
- It creates a temporary alias for a column or table in a query
- It assigns a specific data type to a new table column
- It encrypts the results of a SELECT statement

**Hint:** Nicknaming.

### 23. What is a "Constraint" in SQL?

- A physical limitation on the size of the database file
- A rule enforced on columns to ensure data accuracy and reliability
- A performance bottleneck caused by too many concurrent users
- A piece of code that prevents a table from being deleted

**Hint:** Rules for data.

### 24. Which command changes the structure of an existing table?

- UPDATE TABLE
- ALTER TABLE
- RESTRUCTURE
- MODIFY SCHEMA

**Hint:** Modify columns.

### 25. What is "Referential Integrity"?

- The guarantee that every query will return at least one row
- The consistency between tables maintained via foreign key constraints
- The encryption level applied to data while it is in transit
- The speed at which a primary key can be looked up in a query

**Hint:** Relationships must be valid.

### 26. What does the "UNION" operator do?

- It multiplies the numeric values of two distinct result sets
- It combines the results of two SELECT statements into one set
- It joins two tables based on a common identifier
- It creates a link between a primary and secondary database

**Hint:** Stacks results.

### 27. What is a "Stored Procedure"?

- A hardware configuration used to store large database files
- A group of SQL statements that can be saved and reused
- A log of all actions taken by a database administrator
- An automated backup routine scheduled by the system

**Hint:** Saved SQL code.

### 28. What is the "TRUNCATE" command?

- It deletes the table structure and its associated permissions
- It removes all records from a table while keeping the structure
- It limits the number of characters allowed in a string column
- It hides specific rows from users without deleting them

**Hint:** Fast delete all rows.

### 29. What does "ACID" stand for in database terms?

- Automated, Clean, Integrated, Distributed
- Atomicity, Consistency, Isolation, Durability
- Access, Control, Integrity, Data
- Allocate, Commit, Initialize, Deploy

**Hint:** Reliability properties.

### 30. What is the difference between "DELETE" and "TRUNCATE"?

- DELETE can remove specific rows, whereas TRUNCATE empties the whole table
- DELETE is used for NoSQL databases, while TRUNCATE is for SQL only
- TRUNCATE can be rolled back in all databases, but DELETE cannot
- DELETE removes the table structure, but TRUNCATE keeps it

**Hint:** Logging and speed.
