PROC SQL question

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

PROC SQL question

[ Edited ]

Given the following SQL procedure output:
Table                                    Physical Obs % Deleted
EMPLOYEE_ADDRESSES 424                5.0%
EMPLOYEE_PAYROLL       424                5.0%

 


Which SQL query will produce a report for tables in the ORION library which have had at least 5% of
their physical rows deleted, as shown above?


A. select MEMNAME 'Table', NOBS 'Physical Obs', DELOBS/NOBS '% Deleted' format=percent6.1
     from dictionary.tables
     where LIBNAME='ORION' AND DELOBS/NOBS >= .05;
B. select Table_Name, Num_Rows 'Physical Obs', Deleted_Rows/Num_Rows '% Deleted' format=percent6.1
    from dictionary.DBA_TABLES
    where TABLESPACE_NAME='ORION' AND Deleted_Rows/Num_Rows >= .05;
C. select MEMNAME 'Table', NLOBS 'Physical Obs', DELOBS/NLOBS LABEL='% Deleted' format=percent6.1
    from dictionary.tables
    where LIBNAME='ORION' AND DELOBS/NLOBS >= .05;

D. select MEMNAME 'Table', NOBS 'Physical Obs', DELOBS/NOBS LABEL='% Deleted' format=percent6.1
    from dictionary.members
    where LIBNAME='ORION' AND DELOBS/NOBS >= .05;


correct_answer = "A"

 

Why the choice "C" is wrong? To me it looks like both the choices "A" and "C" are correct. Can someone please explain why the choice "C" is incorrect.

 


Accepted Solutions
Solution
‎01-17-2018 12:47 PM
Super User
Posts: 6,634

Re: PROC SQL question

[ Edited ]

The L in NLOBS means "logical".  That's how many observations are logically in the data set.  The value includes all observations minus the number of deleted observations. 

 

That would be the wrong denominator to use for computing percentages.

View solution in original post


All Replies
Solution
‎01-17-2018 12:47 PM
Super User
Posts: 6,634

Re: PROC SQL question

[ Edited ]

The L in NLOBS means "logical".  That's how many observations are logically in the data set.  The value includes all observations minus the number of deleted observations. 

 

That would be the wrong denominator to use for computing percentages.

New Contributor
Posts: 2

Re: PROC SQL question

Posted in reply to Astounding

Thank you for answering the question.

I haven't noticed L in NLOBS and reading it as NOBS. Thought there might be some mistake with LABEL which I am not able to figure out.

Anyways, got it now. Thanks Again!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 138 views
  • 1 like
  • 2 in conversation