By admin | August 10, 2009

SAS Certified Adv Programmer 50 Questions (3)

Which one of the following programs is syntactically correct?

a.

proc sql;
    create table forecast as
        select a.*, b.sales
            from actual a, budget b
            where a.dept=b.dept and
                  a.month=b.month;
quit;

b.

proc sql;
    create table forecast as
        select a.* b.sales
            from actual as a, budget as b
            where a.dept=b.dept and
                  a.month=b.month;
quit;

c.

proc sql;
    create table forecast as
        select a.*, b.sales
            from actual as a, budget as b
            where dept=dept and
                  month=month;
quit;

d.

proc sql;
    create table forecast as
        select a.*, b.sales
            from actual, budget
            where a.dept=b.dept and
                  a.month=b.month;
quit;

3 comments | Add One

  1. admin - 08/10/2009 at 9:30 pm

    A

  2. Lili - 09/29/2014 at 5:07 am

    I think the answer is B. “as” is needed for defining a table alias.

  3. Lili - 09/29/2014 at 5:20 am

    Please ignore my previous comment. The answer should be A. “as” is optional. In the choice B, the comma is missing in the “select” statement.

Leave a Comment

Leave a Reply

Your email address will not be published.