nerdexam
PostgreSQL_CE

PGCES-02 · Question #138

Select one incorrect statement concerning the following SQL statement. CREATE OR REPLACE VIEW sales_view AS SELECT * FROM sales_table ORDER BY sales_date DESC LIMIT 10;

The correct answer is D. Some errors occur when "SELECT * FROM sales_table" is executed after the view is defined. See the full explanation below for the reasoning.

Question

Select one incorrect statement concerning the following SQL statement. CREATE OR REPLACE VIEW sales_view AS SELECT * FROM sales_table ORDER BY sales_date DESC LIMIT 10;

Options

  • ADefines the view called "sales_view".
  • BReplaces "sales_view" if it already exists.
  • CWhen you 'SELECT' the "sales_view", it displays the first 10 records from the "sales_table"
  • DSome errors occur when "SELECT * FROM sales_table" is executed after the view is defined.
  • EYou can confirm that the "sales_view" has been added by querying the view called "pg_views".

How the community answered

(29 responses)
  • B
    3% (1)
  • C
    3% (1)
  • D
    83% (24)
  • E
    10% (3)

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice