Basic SQL Statements Flashcards
7 cards from real 1Z0-006 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Basic SQL Statements flashcards as text
Which DELETE syntax correctly removes all rows from a table named EMPLOYEES?
Answer: DELETE FROM EMPLOYEES;
DELETE FROM table_name without a WHERE clause removes all rows while keeping the table structure intact.
What does the ORDER BY clause do by default when no ASC or DESC is specified?
Answer: Sorts in ascending order
If neither ASC nor DESC is specified, ORDER BY sorts in ascending (ASC) order by default.
Which aggregate function returns the number of non-NULL values in a column?
Answer: COUNT
COUNT(column_name) counts only non-NULL values in that column; COUNT(*) counts all rows including NULLs.
Which SQL clause is used to join data from a column with the rows of another table inline?
Answer: SUBQUERY in FROM (inline view)
A subquery in the FROM clause (inline view) acts as a derived table that can be queried like a regular table.
Which wildcard character in a LIKE condition matches any single character?
Answer: _
The underscore (_) wildcard matches exactly one character, while % matches zero or more characters.
What is the purpose of the GROUP BY clause?
Answer: Arranges rows into groups for aggregate functions
GROUP BY partitions rows into groups so aggregate functions like COUNT, SUM, or AVG can be applied to each group.
Which statement about the WHERE clause is TRUE?
Answer: It filters rows before any grouping occurs
WHERE is evaluated before GROUP BY; it filters individual rows before aggregation takes place.