Data Science · SQL for Data Analysis For a column email containing two NULLs among ten rows, what does COUNT(email) return? A 2, because it counts only the NULL entries B NULL, because aggregate functions skip the column C 8, because NULL values are not counted Correct answer D 10, because it counts every row MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What is the difference between the WHERE and HAVING clauses in SQL? A WHERE filters groups; HAVING filters individual rows B WHERE works only with numeric columns; HAVING works with text C Both are interchangeable in every standard query D WHERE filters rows before grouping; HAVING filters groups Correct answer MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does the predicate x = NULL evaluate to? A False, but the row is returned B An error during execution C Unknown, so no row is returned Correct answer D True, whenever x is NULL MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What makes a subquery correlated? A It refers to a column of the outer row Correct answer B It returns exactly one column C It appears only in the FROM clause D It joins two copies of one table MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What sort order does ORDER BY apply when no direction is written? A Primary key order B Ascending Correct answer C Descending D Insertion order MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does COALESCE(a, b, c) return? A The sum of all its arguments B NULL if any argument is NULL C The first argument that is not NULL Correct answer D The last argument that is not NULL MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does UNION do that UNION ALL does not? A Combines columns, not rows B Removes duplicate rows Correct answer C Keeps duplicate rows D Sorts by the first column MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Which guarantee does a PRIMARY KEY constraint give? A Physical sorting of the table rows B A default value for new rows C Uniqueness with no NULL values Correct answer D Uniqueness while allowing NULLs MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What distinguishes RANK() from DENSE_RANK()? A RANK gives tied rows different ranks B DENSE_RANK leaves gaps after ties C DENSE_RANK ignores the ORDER BY D RANK leaves gaps after ties Correct answer MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Which clause forms groups before aggregate functions are applied? A GROUP BY Correct answer B ORDER BY C WHERE D LIMIT MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis How does AVG treat NULL values in its column? A It ignores them entirely Correct answer B It treats them as zeros C It returns NULL for the column D It raises an error on NULL MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does the DISTINCT keyword do in a SELECT list? A Keeps only rows with NULLs B Removes duplicate result rows Correct answer C Sorts the result rows D Counts repeated rows MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does a LEFT JOIN produce for a left row with no match? A The right row with NULLs on the left B Nothing; the row is dropped C The left row with NULLs on the right Correct answer D Only rows that found a match MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis What does COUNT(column) exclude that COUNT(*) includes? A Rows where the column is NULL Correct answer B Rows that duplicate earlier ones C Rows rejected by the WHERE clause D Rows whose value is zero MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis How does the WHERE clause differ from HAVING? A WHERE may test aggregate values B WHERE is applied after ORDER BY C WHERE filters rows before grouping Correct answer D WHERE filters groups after grouping MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis A CASE expression in SQL is used to: A sort rows by a chosen column B return different values based on conditions Correct answer C create a new table inside the database schema D join two tables on a common column MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis In SQL, a CTE is introduced with which keyword? A WITH Correct answer B LET C TEMP D AS MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Compared with UNION, UNION ALL: A removes duplicate rows B sorts the result C joins tables horizontally D keeps duplicate rows Correct answer MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis The window function ROW_NUMBER() OVER (...) is used to: A count the distinct values appearing in a column B rank ties with equal numbers as equal C sum a numeric column across all rows D assign a sequential number to rows within a partition Correct answer MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis Which SQL clause sorts the result of a query? A SORT BY B ARRANGE BY C ORDER BY Correct answer D GROUP BY MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis The SQL function COUNT(*) returns: A the largest value in a column B the number of rows in the result Correct answer C the sum of a numeric column D the number of distinct values MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis A LEFT JOIN returns: A only the matching rows from both tables B all rows of the right table only C all rows of the left table plus matches from the right Correct answer D the union of both tables with no duplicates kept MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis An INNER JOIN returns: A only rows present in the right-hand table B all rows of the left table only C only rows with matching values in both tables Correct answer D all rows of both tables combined together MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis In SQL, the HAVING clause is used to: A rename columns B filter groups after aggregation Correct answer C filter individual rows before grouping D sort the result set MCQSEXAM Show answer Read explanation
Data Science · SQL for Data Analysis In SQL, the GROUP BY clause is used to: A filter individual rows by a condition B sort the result set in ascending order C aggregate rows that share a value into groups Correct answer D join two tables on a common key MCQSEXAM Show answer Read explanation