QuestionQ25

VerifiedManaging Data

A data analyst works with a Unity Catalog table called sales_data that stores customer order information. The order_quantity column is defined as an INTEGER, but it sometimes contains -1 values that indicate a data-entry error. To enable accurate reporting, the analyst must create a new view named clean_sales_data that omits these erroneous rows.

Which SQL query creates the clean_sales_data view while filtering out records whose order_quantity is -1?

Explanation

A row-level predicate in a WHERE clause filters the source table before the view result is produced. The condition order_quantity != -1 excludes exactly the invalid -1 entries while retaining all other values.

Community Discussion

No comments yet. Be the first to start the discussion!