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 of the following SQL statements modifies existing data in a table?
Answer: UPDATE
UPDATE changes the values of existing rows in a table based on the specified SET and optional WHERE conditions.
What is the effect of using ORDER BY SALARY DESC in a SELECT statement?
Answer: Rows are sorted by SALARY from highest to lowest
DESC (descending) orders values from the largest to the smallest, so the highest salary appears first.
In Oracle, which character is used to concatenate two strings in SQL?
Answer: ||
Oracle uses the || (double pipe) operator to concatenate strings, e.g., first_name || ' ' || last_name.
Which of the following WHERE conditions correctly uses the LIKE operator to find names starting with 'J'?
Answer: WHERE name LIKE 'J%'
J% matches any string that starts with 'J' followed by zero or more characters.
What does the AVG aggregate function do when NULL values are present in the column?
Answer: Ignores NULL values in the calculation
AVG (like most aggregate functions) ignores NULL values and calculates the average only from non-NULL values.
Which of the following is a valid use of a table alias in SQL?
Answer: SELECT e.name FROM employees AS e WHERE e.dept = 'HR'
A table alias is assigned in the FROM clause (e.g., employees AS e or employees e) and then used to qualify column references.
What is the difference between DELETE and TRUNCATE in Oracle?
Answer: TRUNCATE cannot be rolled back; DELETE can be rolled back before COMMIT
TRUNCATE is a DDL operation that cannot be rolled back; DELETE is DML and can be undone with ROLLBACK before committing.