SQL - ViewsWhy are some views considered non-updatable even if they select from a single table without joins or aggregates?ABecause they have no WHERE clauseBBecause they use simple SELECT statementsCBecause they select all columns with *DBecause they include computed columns or DISTINCT keywordCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify factors blocking updates in single-table viewsComputed columns (expressions) and DISTINCT keyword prevent updates because the database cannot map changes back to base columns.Step 2: Evaluate optionsBecause they include computed columns or DISTINCT keyword correctly identifies these factors. Options A, B, and D do not cause non-updatability.Final Answer:Because they include computed columns or DISTINCT keyword -> Option DQuick Check:Computed columns and DISTINCT block updates [OK]Quick Trick: Computed columns or DISTINCT make views non-updatable [OK]Common Mistakes:MISTAKESAssuming simple SELECT always means updatableBelieving WHERE clause affects updatabilityThinking selecting all columns blocks updates
Master "Views" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - CROSS JOIN cartesian product - Quiz 1easy GROUP BY and HAVING - GROUP BY with aggregate functions - Quiz 8hard GROUP BY and HAVING - WHERE vs HAVING mental model - Quiz 9hard INNER JOIN - Self join concept - Quiz 4medium LEFT and RIGHT JOIN - Finding unmatched rows with LEFT JOIN - Quiz 9hard LEFT and RIGHT JOIN - Why outer joins are needed - Quiz 5medium LEFT and RIGHT JOIN - Finding unmatched rows with LEFT JOIN - Quiz 5medium Table Constraints - FOREIGN KEY constraint - Quiz 14medium Table Constraints - Constraint naming conventions - Quiz 12easy Table Constraints - Why constraints matter - Quiz 14medium