SQL General Concepts 2 — Questions and Answers
Question 1: What does the acronym SQL stand for?
- Structured Query Language (Correct answer)
- Sequential Query Logic
- Standard Question Layout
- System Quality Level
Correct answer: Structured Query Language
SQL stands for Structured Query Language, used to manage relational databases.
Question 2: Which category does the SELECT statement belong to?
- DML (Data Manipulation Language) (Correct answer)
- DDL (Data Definition Language)
- DCL (Data Control Language)
- TCL (Transaction Control Language)
Correct answer: DML (Data Manipulation Language)
SELECT retrieves data and is part of DML, though some classify it as DQL.
Question 3: What is a relational database primarily organized into?
- Tables made of rows and columns (Correct answer)
- Nested folders
- Key-value pairs only
- Graph nodes
Correct answer: Tables made of rows and columns
Relational databases store data in tables consisting of rows and columns.
Question 4: Which clause is used to filter rows in a SELECT query?
- WHERE (Correct answer)
- FROM
- ORDER BY
- GROUP BY
Correct answer: WHERE
The WHERE clause filters rows based on a specified condition.
Question 5: What does a primary key guarantee for a table?
- Each row is uniquely identifiable (Correct answer)
- Faster inserts only
- Encrypted storage
- Automatic backups
Correct answer: Each row is uniquely identifiable
A primary key uniquely identifies each row and cannot contain NULLs.
Question 6: Which SQL command is used to remove all rows but keep the table structure most efficiently?
- TRUNCATE (Correct answer)
- DELETE
- DROP
- REMOVE
Correct answer: TRUNCATE
TRUNCATE quickly removes all rows while preserving the table structure.
Question 7: What is NULL in SQL?
- The absence of a value (Correct answer)
- The number zero
- An empty string
- A boolean false
Correct answer: The absence of a value
NULL represents a missing or unknown value, not zero or an empty string.
What does the acronym SQL stand for?