Question 31
In SQL, what is the effect of executing: DELETE FROM Student; without a WHERE clause?
Without a WHERE clause, DELETE removes all rows from the table while retaining the table schema in the database catalog.
In SQL, what is the effect of executing: DELETE FROM Student; without a WHERE clause?
Without a WHERE clause, DELETE removes all rows from the table while retaining the table schema in the database catalog.
Which of the following SQL constraints ensures that a column cannot accept duplicate values, but can accept multiple NULLs (in standard SQL)?
A UNIQUE constraint prevents duplicate non-NULL values. Under the usual SQL treatment, NULL is not equal to NULL, so multiple NULLs may be permitted; exact NULL uniqueness behavior can vary by DBMS.
Which SQL clause is used to filter aggregated group records produced by a GROUP BY clause?
HAVING filters groups after aggregation; WHERE filters rows before grouping.
In SQL, what is the output of the query: SELECT 10 + NULL; ?
Any arithmetic operation with a NULL operand evaluates to NULL in standard SQL.
Which SQL function replaces a NULL value with a specified replacement value?
COALESCE is standard ANSI SQL, NVL is Oracle SQL, and IFNULL is MySQL syntax. All replace NULL values with an alternate value. Thus, more than one of the above is correct.