Scenario 7

Code Solution

Note: On the live exam, you will be evaluated both on the results of your code and the code itself. Your code should be similar to the following example code, but does not need to match exactly:
proc sql;                         /*1*/
   create table work.bonus as     /*2*/
   select EmpId, Jobcode, Salary, /*3*/
         Salary*.10 as Bonus      /*4*/
      from certadv.empdata        /*5*/
      order by JobCode, Salary;   /*6*/
quit;
1 The SQL procedure retrieves data from tables or views to generate a report.
2 The CREATE TABLE statement creates the temporary table Work.Bonus from the query result of the current PROC SQL query.
3 The SELECT statement retrieves the EmpId, Jobcode, and Salary columns and displays the column values in the query result.
4 The SELECT statement also creates a column alias by using the AS keyword followed by the column name of Bonus. The value of Bonus is 10% multiplied by the value of Salary.
5 The FROM clause specifies Certadv.Empdata as the source table to be queried.
6 The ORDER BY clause specifies to sort the rows by the values of the JobCode variable first and then Salary.
Output 17.10 SQL Query Result (partial output)
Partial Output of SQL Query Result

Test Your Code Solution

  1. Correct Answer: 1700
  2. Correct Answer: 2100
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.65.247