BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
monu101
Calcite | Level 5

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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

2 REPLIES 2
Astounding
PROC Star

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.

monu101
Calcite | Level 5

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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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