Chapter 7: Creating And Managing Views Using Proc SQL

10 Questions | Total Attempts: 64

SettingsSettingsSettings
Please wait...
SQL Quizzes & Trivia

Practice for the SAS advance certification exam.


Questions and Answers
  • 1. 
    Which of the following statements is false regarding a PROC SQL view?
    • A. 

      A view cannot be used in a join.

    • B. 

      A view accesses the most current underlying data.

    • C. 

      A view follows the same naming conventions as a table.

    • D. 

      A view can be used in SAS programs in place of an actual SAS data file.

  • 2. 
    Which of the following statements describes an advantage of using a PROC SQL view?
    • A. 

      Views often save space, because a view is usually quite small compared with the data that it accesses.

    • B. 

      Views prevent users from continually submitting queries to omit unwanted columns or rows.

    • C. 

      Views hide complex joins or queries from users.

    • D. 

      All of the above

  • 3. 
    Which PROC SQL step creates a view that queries the table Sasuser.Payrollmaster?
    • A. 

      proc sql; insert into sasuser.newview select * from sasuser.payrollmaster;

    • B. 

      proc sql; create sasuser.newview as select * from sasuser.payrollmaster;

    • C. 

      proc sql; create view sasuser.newview as select * from sasuser.payrollmaster;

    • D. 

      proc sql; select * from sasuser.payrollmaster into view sasuser.newview;

  • 4. 
    Which of the following PROC SQL steps enables you to see a description of the view definition?
    • A. 

      proc sql; select * from sasuser.payrollmasterv;

    • B. 

      proc sql; describe view sasuser.payrollmasterv;

    • C. 

      proc sql; list sasuser.payrollmasterv;

    • D. 

      proc sql; contents view=sasuser.payrollmasterv;

  • 5. 
    Which PROC SQL step correctly references the view Data.Empview?
    • A. 

      proc sql; select * from data.empview;

    • B. 

      proc sql; select * from view data.empview;

    • C. 

      proc sql; select view * from data.empview;

    • D. 

      proc sql; select * from data where view='empview';

  • 6. 
    Which of the following PROC SQL steps correctly embeds a LIBNAME statement with a view definition?
    • A. 

      proc sql; insert into sasuser.newview select * from airline.supervisors libname airline 'c:\mysql';

    • B. 

      proc sql; create view sasuser.newview as from airline.supervisors embed libname airline 'c:\mysql';

    • C. 

      proc sql; using airline 'c:\mysql'; insert into sasuser.newview select * from airline.supervisors;

    • D. 

      proc sql; create view sasuser.newview as select * from airline.supervisors using libname airline 'c:\mysql';

  • 7. 
    PROC SQL views can access data from
    • A. 

      A SAS data file.

    • B. 

      Another PROC SQL view.

    • C. 

      A relational database table.

    • D. 

      All of the above

  • 8. 
    When you are working with PROC SQL views, it is best to
    • A. 

      Avoid using an ORDER BY clause in a view.

    • B. 

      Avoid creating views that are based on tables whose structure might change.

    • C. 

      Specify a one-level name in the FROM clause if the view resides in the same SAS data library as the contributing table(s).

    • D. 

      All of the above

  • 9. 
    You can update the data underlying PROC SQL view using the INSERT, DELETE, and UPDATE statements under which of the following conditions:
    • A. 

      The view is joined or linked to another table.

    • B. 

      The view contains a subquery.

    • C. 

      The view contains a WHERE clause.

    • D. 

      All of the above

  • 10. 
    Which of the following programs drops (deletes) a view?
    • A. 

      proc sql; delete sasuser.newview;

    • B. 

      proc sql; drop view sasuser.newview;

    • C. 

      proc sql; erase view sasuser.newview;

    • D. 

      proc sql; remove newview from sasuser;

Related Topics
Back to Top Back to top