SQL Screening TestBy Collab Team Contributor / February 15, 2025 SQL Screening Test 1 / 20 Which command is used to modify an existing table structure? CHANGE MODIFY ALTER UPDATE 2 / 20 Which SQL clause is used to filter grouped records? WHERE ORDER BY HAVING GROUP BY 3 / 20 What does the SQL CASE statement do? Defines conditional logic inside a query Handles NULL values Creates a new table Checks foreign key constraints 4 / 20 What is the primary function of an index in SQL? To define foreign key relationships To improve query performance To store duplicate records To enforce referential integrity 5 / 20 What happens when a NULL value is compared using the = operator? It returns FALSE It returns NULL It returns TRUE It throws an error 6 / 20 What will be the result of a CROSS JOIN between two tables with 5 and 10 rows respectively? 5 rows 15 rows 10 rows 50 rows 7 / 20 What will happen if you try to insert a duplicate value in a column with a UNIQUE constraint? It will replace the existing value It will return an error It will ignore the duplicate and insert It will insert successfully 8 / 20 What is the default isolation level in SQL Server? REPEATABLE READ READ UNCOMMITTED SERIALIZABLE READ COMMITTED 9 / 20 Which SQL statement is used to check for the existence of rows in a subquery? IN HAVING JOIN EXISTS 10 / 20 What is the function of the DISTINCT keyword in SQL? Joins two tables on unique values Filters out duplicate rows in query results Groups rows based on unique values Deletes duplicate rows permanently 11 / 20 In SQL, what does the COALESCE function do? Returns the last non-null value in a list Replaces NULL values with a default value Joins multiple tables Returns the first non-null value in a list 12 / 20 What will happen if a subquery returns multiple rows in a scalar subquery context? It will return NULL It will return only the first row It will return all row It will cause an error 13 / 20 Which SQL function is used to remove leading and trailing spaces from a string? LTRIM() RTRIM() TRIM() REPLACE() 14 / 20 Which type of join includes all records from the left table and only matching records from the right table? LEFT JOIN INNER JOIN FULL JOIN RIGHT JOIN 15 / 20 What does the ROW_NUMBER() function do in SQL? Assigns a unique sequential number to rows Groups rows based on a column Sorts rows in descending order Returns the number of rows in a table 16 / 20 Which SQL statement is used to remove all rows from a table without logging individual row deletions? DROP REMOVE DELETE TRUNCATE 17 / 20 In SQL, what is the purpose of the RANK() function? Assigns a unique rank to each row with possible gaps Assigns a unique rank to each row without gaps Returns the number of rows in a table Computes the sum of a column 18 / 20 In SQL Server, which function is used to get the current system date and time? NOW() GETDATE() CURRENT_TIMESTAMP SYSDATE() 19 / 20 What does the UNION operator do in SQL? Merges two tables permanently Combines results of multiple SELECT queries with duplicates Joins two tables on a common key Combines results of multiple SELECT queries without duplicates 20 / 20 What is the maximum number of clustered indexes allowed per table in SQL Server? 1 Unlimited 2 5 Your score isThe average score is 38% 0% Restart quiz