Monday, October 28, 2013

CHAPTER 4 (WORKING WITH DB2 USING SQL AND XQUERY) DB2 9 Exam 730 certification Dumps

730 CERTIFICATION GUIDE

Q.Given the following two tables:
         NAMES
-----------------------------
NAME                 NUMBER
----------                -------
Wayne Gretzky        99
Jaromir Jagr             68
Bobby Orr                 4
Bobby Hull              23
Mario Lemieux        66

        POINTS
-----------------------------
NAME                 POINTS
----------                 ------
Wayne Gretzky        244
Bobby Orr               129
Brett Hull                 121
Mario Lemieux        189
Joe Sakic                    94
How many rows would be returned using the following statement?
SELECT name FROM names, points
A. 0
B. 5
C. 10
D. 25

Q.Given the following CREATE TABLE statement:
CREATE TABLE EMPLOYEE
 (EMPNO       CHAR(3) NOT NULL,
  FIRSTNAME   CHAR(20) NOT NULL,
  MIDINIT     CHAR(1),
  LASTNAME    CHAR(20) NOT NULL,
  SALARY      DECIMAL(10, 2))
Which of the following will retrieve the rows that have a missing value in the MIDINIT column?
A. SELECT * FROM employee WHERE midinit = ' '
B. SELECT * FROM employee WHERE midinit = NULL
C. SELECT * FROM employee WHERE midinit = " "
D. SELECT * FROM employee WHERE midinit IS NULL

Q.Given the following two tables:
       TAB1
----------------------
COL_1         COL_2
-----         -----
A             10
B             12
C             14

       TAB2
----------------------
COL_A         COL_B
-----         -----
A             21
C             23
D             25
Assuming the following results are desired:
COL_1            COL_2            COL_A            COL_B
A                    10                        A                21
B                    12                         -                -
C                    14                        C                23
-                -                                D                25
Which of the following joins will produce the desired results?
A. SELECT * FROM tab1 INNER JOIN tab2 ON col_1 = col_a
B. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON col_1 = col_a
C. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON col_1 = col_a
D. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON col_1 = col_a

Q.If the following SQL statements are executed in the order shown:
CREATE TABLE table1 (c1 INTEGER, c2 INTEGER);
INSERT INTO table1 VALUES (123, 456);
UPDATE table1 SET c1 = NULL;
What will be the result of the following statement?
SELECT * FROM table1;
A.
C1    C2
---   ---
123   456
1 record(s) selected.
B.
C1    C2
---   ---
NULL  456
1 record(s) selected.
C.   
C1    C2
---   ---
-     456
1 record(s) selected.

D.
C1    C2
---   ---
0     456
1 record(s) selected.
Q.Given the following table:
TAB1

COL1         COL2
-----        -----
A            10
B            20
C            30
A            10
D            40
C            30
Assuming the following results are desired:
TAB1

COL1         COL2
-----        -----
A            10
B            20
C            30
D            40
Which of the following statements will produce the desired results?
A. SELECT UNIQUE * FROM tab1
B. SELECT DISTINCT * FROM tab1
C. SELECT UNIQUE(*) FROM tab1
D. SELECT DISTINCT(*) FROM tab1

Q.Assuming table TAB1 contains 100 rows, which of the following queries will return only half of the rows available?
A. SELECT * FROM tab1 FIND FIRST 50 ROWS
B. SELECT * FROM tab1 FETCH FIRST 50 ROWS ONLY
C. SELECT * FROM tab1 WHILE ROW_NUM < 50
D. SELECT * FROM tab1 MAXROWS 50

Q.Given the following two tables:
EMPLOYEE

ID NAME           DEPTID
-- ---------------- ---
01 Mick Jagger     10
02 Keith Richards  20
03 Ronnie Wood     20
04 Charlie Watts   20
05 Bill Wyman      30
06 Brian Jones    -

DEPARTMENT

ID DEPTNAME
-- ------------------
10 Executive Staff
20 Sales
30 Marketing
40 Engineering
50 Human Resources
Which two of the following queries will display the employee name and department name for all employees that are in Sales?
A.    SELECT e.name, d.deptname
FROM employee e, department d
WHERE e.deptid = d.id AND d.id = '20'

B.    SELECT e.name, d.deptname
FROM employee e FULL OUTER JOIN department d
ON e.deptid = d.id
WHERE d.id = '20'
C.    SELECT e.name, d.deptname
FROM employee e RIGHT OUTER JOIN department d
ON e.deptid = d.id
WHERE d.id = '20'
D.    SELECT e.name, d.deptname
FROM employee e LEFT OUTER JOIN department d
ON e.deptid = d.id
WHERE d.id = '20'
E.    SELECT e.name, d.deptname
FROM employee e INNER JOIN department d
ON e.deptid = d.id
WHERE d.id = '20'


Q.Given the following queries:
SELECT c1 FROM tab1;
SELECT c1 FROM tab2;
Which of the following set operators can be used to produce a result data set that contains only records that are not found in the result data set produced by each query after duplicate rows have been eliminated?
A. UNION
B. INTERSECT
C. EXCEPT
D. MERGE

Q.Given the following two tables:
NAMES

NAME                   NUMBER
----------                  -------
Wayne Gretzky          99
Jaromir Jagr               68
Bobby Orr                  4
Bobby Hull               23
Brett Hull                  16
Mario Lemieux         66
Mark Messier           11

POINTS

NAME                   POINTS
----------                  ------
Wayne Gretzky       244
Jaromir Jagr           168
Bobby Orr              129
Brett Hull               121
Mario Lemieux      189
Joe Sakic                 94
Which of the following statements will display the player name, number, and points for all players that have scored points?
A. SELECT p.name, n.number, p.points FROM names n INNER JOIN points p ON n.name = p.name
B. SELECT p.name, n.number, p.points FROM names n LEFT OUTER JOIN points p ON n.name = p.name
C. SELECT p.name, n.number, p.points FROM names n RIGHT OUTER JOIN points p ON n.name = p.name
D. SELECT p.name, n.number, p.points FROM names n FULL OUTER JOIN points p ON n.name = p.name

Q.Which of the following is a valid wildcard character in a LIKE clause of a SELECT statement?
A. %
B. *
C. ?
D. \

Q.Given the following tables:
YEAR_2006

EMPID  NAME
-----  ---------------
1      Jagger, Mick
2      Richards, Keith
3      Wood, Ronnie
4      Watts, Charlie
5      Jones, Darryl
6      Leavell, Chuck

YEAR_1962

EMPID  NAME
-----  ---------------
1      Jagger, Mick
2      Richards, Keith
3      Jones, Brian
4      Wyman, Bill
5      Watts, Charlie
6      Stewart, Ian
If the following SQL statement is executed, how many rows will be returned?
SELECT name FROM year_2007
UNION ALL
SELECT name FROM year_1962
A. 6
B. 9
C. 10
D. 12

Q.Given the following table definition:
SALES
--------------------------------------
INVOICE_NO          CHAR(20) NOT NULL
SALES_DATE          DATE
SALES_PERSON        VARCHAR(25)
REGION              CHAR(20)
SALES_AMT           DECIMAL(9,2)
Which of the following queries will return SALES information, sorted by SALES_PERSON, from A to Z, and SALES_DATE, from most recent to earliest?
A. SELECT invoice_no, sales_person, sales_date, sales_amt FROM sales SORT BY sales_person, sales_date DESC
B. SELECT invoice_no, sales_person, sales_date, sales_amt FROM sales SORT BY sales_person DESC, sales_date
C. SELECT invoice_no, sales_person, sales_date, sales_amt FROM sales ORDER BY sales_person, sales_date DESC
D. SELECT invoice_no, sales_person, sales_date, sales_amt FROM sales ORDER BY sales_person DESC, sales_date

Q.Given the following statement:
SELECT hyear, AVG(salary)
FROM (SELECT YEAR(hiredate) AS hyear, salary
              FROM employee WHERE salary > 30000)
GROUP BY hyear
Which of the following describes the result if this statement is executed?
A. The statement will return the year and average salary for all employees that have a salary greater than $30,000, sorted by year.
B. The statement will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000.C. The statement will return the year and average salary for all years that every employee hired had a salary greater than $30,000.
D. The statement will return the year and average salary for all years that any employee had a salary greater than $30,000.

Q.Which two of the following statements are true about the HAVING clause?
A. The HAVING clause is used in place of the WHERE clause.
B. The HAVING clause uses the same syntax as the WHERE clause.
C. The HAVING clause can only be used with the GROUP BY clause.
D. The HAVING clause accepts wildcards.
E. The HAVING clause uses the same syntax as the IN clause.

Q.Given the following table definitions:
DEPARTMENT
--------------------------
DEPTNO       CHAR(3)
DEPTNAME     CHAR(30)
MGRNO        INTEGER
ADMRDEPT     CHAR(3)

EMPLOYEE
--------------------------
EMPNO        INTEGER
FIRSTNAME    CHAR(30)
MIDINIT      CHAR
LASTNAME     CHAR(30)
WORKDEPT     CHAR(3)
Which of the following statements will list every employee number and last name, along with the employee number and last name of their manager, including employees that have not been assigned to a manager?
A. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT INNER JOIN department INNER JOIN employee m ON mgrno=m.empno ON e.workdept=deptno
B. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT OUTER JOIN department INNER JOIN employee m ON mgrno=m.empno ON e.workdept=deptno
C. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT OUTER JOIN department INNER JOIN employee m ON mgrno=m.empno ON e.workdept=deptno
D. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT INNER JOIN department INNER JOIN employee m ON mgrno=m.empno ON e.workdept=deptno

Q.Given the following table:
EMPLOYEE

EMPID     NAME            INSTRUMENT
---       ---------------         -------------------
1         Jagger, Mick           01
2         Richards, Keith      02
3         Wood, Ronnie        02
4         Watts, Charlie        03
5         Jones, Darryl         04
6         Leavell, Chuck      05
If the following query is executed:
SELECT name,
   CASE WHEN instrument = '01' THEN 'HARMONICA'
     WHEN instrument = '02' THEN 'GUITAR'
     WHEN instrument = '03' THEN 'DRUMS'
     ELSE 'UNKNOWN'
   END AS instrument
FROM employee
What will be the results?
A.
NAME                INSTRUMENT
---------------        --------
Jagger, Mick       HARMONICA
Richards, Keith   GUITAR
Wood, Ronnie     GUITAR
Watts, Charlie     DRUMS
Jones, Darryl       ERROR
Leavell, Chuck    ERROR
B.
NAME                 INSTRUMENT
------------------     --------
Jagger, Mick        HARMONICA
Richards, Keith    GUITAR
Wood, Ronnie      GUITAR
Watts, Charlie     DRUMS
Jones, Darryl      04
Leavell, Chuck   05
C.   
NAME               INSTRUMENT
------------------ --------
Jagger, Mick       HARMONICA
Richards, Keith    GUITAR
Wood, Ronnie       GUITAR
Watts, Charlie     DRUMS
Jones, Darryl      UNKNOWN
Leavell, Chuck     UNKNOWN

D.   
NAME               INSTRUMENT
------------------ --------
Jagger, Mick       HARMONICA
Richards, Keith    GUITAR
Wood, Ronnie       GUITAR
Watts, Charlie     DRUMS
Jones, Darryl      -
Leavell, Chuck     -

Q.Given the following UPDATE statement:
UPDATE employees SET workdept =
   (SELECT deptno FROM department WHERE deptno = 'A01')
    WHERE workdept IS NULL
Which of the following describes the result if this statement is executed?
A. The statement will fail because an UPDATE statement cannot contain a subquery.
B. The statement will only succeed if the data retrieved by the subquery does not contain multiple records.
C. The statement will succeed; if the data retrieved by the subquery contains multiple records, only the first record will be used to perform the update.
D. The statement will only succeed if every record in the EMPLOYEES table has a null value in the WORKDEPT column.

Q.Given the following table:
CURRENT_EMPLOYEES
--------------------------
EMPID        INTEGER NOT NULL
NAME         CHAR(20)
SALARY       DECIMAL(10,2)

PAST_EMPLOYEES
--------------------------
EMPID        INTEGER NOT NULL
NAME         CHAR(20)
SALARY       DECIMAL(10,2)
Assuming both tables contain data, which of the following statements will NOT successfully add data to table CURRENT_EMPLOYEES?
A. INSERT INTO current_employees (empid) VALUES (10)
B. INSERT INTO current_employees VALUES (10, 'JAGGER', 85000.00)
C. INSERT INTO current_employees SELECT empid, name, salary FROM past_employees WHERE empid = 20
D. INSERT INTO current_employees (name, salary) VALUES (SELECT name, salary FROM past_employees WHERE empid = 20)

Q.Given the following table definition:
SALES
--------------------------
SALES_DATE       DATE
SALES_PERSON     CHAR(20)
REGION           CHAR(20)
SALES            INTEGER
Which of the following SQL statements will remove all rows that had a SALES_DATE in the year 1995?
A. DELETE * FROM sales WHERE YEAR(sales_date) = 1995
B. DELETE FROM sales WHERE YEAR(sales_date) = 1995
C. DROP * FROM sales WHERE YEAR(sales_date) = 1995
D. DROP FROM sales WHERE YEAR(sales_date) = 1995

Q.Given the following table definition:
EMPLOYESS
--------------------------
EMP ID             INTEGER
NAME              CHAR(20)
DEPT               CHAR(10)
SALARY          DECIMAL (10, 2)
COMMISSION DECIMAL (8, 2)
Assuming the DEPT column contains the values ‘ADMIN’, ‘PRODUCTION’, and ‘SALES’, which of the following statements will produce a result data set in which all ADMIN department employees are grouped together, all PRODUCTION department employees are grouped together, and all SALES department employees are grouped together?
A. SELECT name, dept FROM employees ORDER BY dept
B. SELECT name, dept FROM employees GROUP BY dept
C. SELECT name, dept FROM employees GROUP BY ROLLUP (dept)
D. SELECT name, dept FROM employees GROUP BY CUBE (dept)

Q.The following SQL statement:
DELETE FROM tab1 WHERE CURRENT OF csr1 WITH RR
Is used to perform which type of delete operation?
A. Positioned
B. Searched
C. Embedded
D. Dynamic 


Q.Given the following data:
TAB1

C1    C2
--      ---
200  abc
250  abc
150  def
300  ghi
175  def
If the following query is executed:
WITH subset (col1, col2) AS
    (SELECT c1, c2 FROM tab1 WHERE c1 > 150)
SELECT col2, SUM(col1) AS col1_sum
  FROM subset
  GROUP BY col2
  ORDER BY col2
Which of the following result data sets will be produced?
A.  
COL2      COL1_SUM
----          --------
abc         200
abc         250
def         175
ghi         300
4 record(s) selected.
B.  
COL2     COL1_SUM
----         --------
abc         450
def         175
ghi         300
3 record(s) selected.

C.  
COL2     COL1_SUM
----          --------
abc         450
def         325
ghi         300
3 record(s) selected.
D.  
COL2     COL1_SUM
----         --------
abc         450
abc         450
def         175
def         175
ghi         300
5 record(s) selected.


Q.Given the following table definitions:
TABLE1
-----------------------------------
ID                   INT
NAME           CHAR(30)
PERSON       INT
CITIES          INT


TABLE2
-----------------------------------
ID                      INT
LASTNAME    CHAR(30)


Which of the following statements will remove all rows in table TABLE1 that have matching PERSONs in table TABLE2?
A. DELETE FROM table1 WHERE id IN (SELECT id FROM table2)
B. DELETE FROM table1 WHERE id IN (SELECT person FROM table2)
C. DELETE FROM table1 WHERE person IN (SELECT id FROM table2)
D. DELETE FROM table1 WHERE person IN (SELECT person FROM table2)


Q.Given the following two tables:
NAMES


NAME                NUMBER
-----------             --------------

Wayne Gretzky     99
Jaromir Jagr          68
Bobby Orr              4
Bobby Hull           23
Brett Hull             16
Mario Lemieux    66
Mark Messier      11

POINTS

NAME                   POINTS
-----------                --------------
Wayne Gretzky      244
Jaromir Jagr           168
Bobby Orr              129
Brett Hull               121
Mario Lemieux      189
Joe Sakic                94

Which of the following statements will display the player name, number, and points for all players that have scored points?
A. SELECT p.name, n.number, p.points FROM names n INNER JOIN points p ON n.name = p.name
B. SELECT p.name, n.number, p.points FROM names n LEFT OUTER JOIN points p ON n.name = p.name
C. SELECT p.name, n.number, p.points FROM names n RIGHT OUTER JOIN points p ON n.name = p.name
D. SELECT p.name, n.number, p.points FROM names n FULL OUTER JOIN points p ON n.name = p.name


Q.Given the following table definitions:
EMPLOYEES
------------------------------------------------
EMPID                          INTEGER
NAME                          CHAR(20)
DEPTID                        CHAR(3)
SALARY                      DECIMAL(10,2)
COMMISSION             DECIMAL(8,2)
DEPARTMENTS
------------------------------------------------
DEPTNO                      INTEGER
DEPTNAME                CHAR(20)
Which of the following statements will produce a result data set that satisfies all of these conditions:
> Displays the total number of employees in each department
>> Displays the corresponding department name for each department ID
>> Sorted by department employee count, from greatest to least


A. SELECT *, COUNT(empno) FROM departments, employees WHERE deptid = deptno GROUP BY deptname ORDER BY 2 DESC
B. SELECT deptname, COUNT(empno) FROM departments, employees WHERE deptid = deptno GROUP BY deptname ORDER BY 2 DESC
C. SELECT deptname, COUNT(empno) FROM departments, employees WHERE deptid = deptno GROUP BY deptname ORDER BY 2 ASC
D. SELECT deptname, COUNT(*) FROM departments, employees WHERE deptid = deptno GROUP BY deptname ORDER BY 2


Q.Given the following table:
CURRENT_EMPLOYEES
--------------------------------------
EMPID INTEGER NOT NULL
NAME CHAR(20)
SALARY DECIMAL(10,2)
PAST_EMPLOYEES
--------------------------------------
EMPID INTEGER NOT NULL
NAME CHAR(20)
SALARY DECIMAL(10,2)
Assuming both tables contain data, which of the following statements will NOT successfully add data to table CURRENT_EMPLOYEES?
A. INSERT INTO current_employees (empid) VALUES (10)
B. INSERT INTO current_employees VALUES (10, ‘JAGGER’, 85000.00)
C. INSERT INTO current_employees SELECT empid, name, salary FROM past_employees WHERE empid = 20
D. INSERT INTO current_employees (name, salary) VALUES (SELECT name, salary FROM past_employees WHERE empid = 20)


Q.Given the following table:
STOCK
--------------------------
CATEGORY        CHAR(1)
PARTNO              CHAR(12)
DESCRIPTION   VARCHAR(40)
QUANTITY        INTEGER
PRICE                 DEC(7,2)
If items are indicated to be out of stock by setting DESCRIPTION to NULL and QUANTITY and PRICE to zero, which of the following statements updates the STOCK table to indicate that all items except those with CATEGORY of ‘S’ are temporarily out of stock?
A. UPDATE stock SET description = ’NULL’, quantity = 0, price = 0 WHERE category ‘S’
B. UPDATE stock SET description = NULL, SET quantity = 0, SET price = 0 WHERE category ‘S’
C. UPDATE stock SET (description, quantity, price) = (‘null’, 0, 0) WHERE category ‘S’
D. UPDATE stock SET (description, quantity, price) = (NULL, 0, 0) WHERE category ‘S’


Q.Given the following SQL statements:
CREATE TABLE tab1 (col1 INTEGER)
INSERT INTO tab1 VALUES (NULL)
INSERT INTO tab1 VALUES (1)
CREATE TABLE tab2 (col2 INTEGER)
INSERT INTO tab2 VALUES (NULL)
INSERT INTO tab2 VALUES (1)
INSERT INTO tab2 VALUES (2)
What will be the result when the following statement is executed?
SELECT * FROM tab1 WHERE col1 IN (SELECT col2 FROM tab2)
A.
COL1
----
1
1 record(s) selected.


B.
COL1
----
NULL
1
2 record(s) selected.

C.
COL1
----
-
1
2 record(s) selected.

D.
COL1
----
-
1 record(s) selected.


Q.Given the following table definition:
SALES
---------------------------------------------
INVOICE_NO           CHAR(20) NOT NULL
SALES_DATE          DATE
SALES_PERSON     CHAR(20)
REGION                   CHAR(20)
SALES                      INTEGER
If the following SELECT statement is executed, which of the following describes the order of the rows in the result data set produced?
SELECT * FROM sales
A. The rows are sorted by INVOICE_NO in ascending order.
B. The rows are sorted by INVOICE_NO in descending order.
C. The rows are ordered based on when they were inserted into the table.
D. The rows are not sorted in any particular order.


Q.Given the following tables:
YEAR_2006
EMPID NAME
---------------------------------
1                Jagger, Mick
2                Richards, Keith
3                Wood, Ronnie
4                Watts, Charlie
5                Jones, Darryl
6                Leavell, Chuck
YEAR_1962
EMPID NAME
---------------------------------
1                Jagger, Mick
2                Richards, Keith
3                Jones, Brian
4                Wyman, Bill
5                Chapman, Tony
6                Stewart, Ian
If the following SQL statement is executed, how many rows will be returned?
SELECT name FROM year_2006
UNION
SELECT name FROM year_1962
A. 0
B. 6
C. 10
D. 12


Q.Which of the following best describes a unit of work?
A. It is a recoverable sequence of operations whose point of consistency is established when a connection to a database has been established or when a mechanism known as a savepoint is created.
B. It is a recoverable sequence of operations whose current point of consistency can be determined by querying the system catalog tables.
C. It is a recoverable sequence of operations whose point of consistency is established when an executable SQL statement is processed after a connection to a database has been established or a previous transaction has been terminated.
D. It is a recoverable sequence of operations whose point of consistency is only established if a mechanism known as a savepoint is created.


Q.Given the following set of statements:
CREATE TABLE tab1 (col1 INTEGER, col2 CHAR(20));
COMMIT;
INSERT INTO tab1 VALUES (123, 'Red');
INSERT INTO tab1 VALUES (456, 'Yellow');
SAVEPOINT s1 ON ROLLBACK RETAIN CURSORS;
DELETE FROM tab1 WHERE col1 = 123;
INSERT INTO tab1 VALUES (789, 'Blue');
ROLLBACK TO SAVEPOINT s1;
INSERT INTO tab1 VALUES (789, 'Green');
UPDATE tab1 SET col2 = NULL WHERE col1 = 789;
COMMIT;
Which of the following records would be returned by the following statement?
SELECT * FROM tab1
A.
COL1     COL2
----     -------
123      Red
456      Yellow
2 record(s) selected.
B.
COL1     COL2
----     ------
456      Yellow
1 record(s) selected.

C.
COL1     COL2
----     -----
123      Red
456      Yellow
789      -
3 record(s) selected.


D.
COL1     COL2
----     ------
123      Red
456      Yellow
789      Green
3 record(s) selected.


Q. 
Given the following table:
TAB1

COL1         COL2
-----        -----
A            10
B            20
C            30
D            40
E            50
And the following SQL statements:
DECLARE c1 CURSOR WITH HOLD FOR
SELECT * FROM tab1 ORDER BY col_1;
OPEN c1;
FETCH c1;
FETCH c1;
FETCH c1;
COMMIT;
FETCH c1;
CLOSE c1;
FETCH c1;
Which of the following is the last value obtained for COL_2?
A. 20
B. 30
C. 40
D. 50


Q.A stored procedure has been created with the following statement:
CREATE PROCEDURE proc1 (IN var1 VARCHAR(10), OUT rc INTEGER)
SPECIFIC myproc LANGUAGE SQL …
What is the correct way to invoke this procedure from the command line processor (CLP)?
A. CALL proc1 ('SALES', ?)
B. CALL myproc ('SALES', ?)
C. CALL proc1 (SALES, ?)
D. RUN proc1 (SALES, ?)


Q.Given the following table:
TEMP_DATA

TEMP     DATE
-----         -----
45           12/25/2006
51           12/26/2006
67           12/27/2006
72           12/28/2006
34           12/29/2006
42           12/30/2006
And the following SQL statement:
CREATE FUNCTION degf_to_c (temp INTEGER)
   RETURNS INTEGER
   LANGUAGE SQL
   CONTAINS SQL
   NO EXTERNAL ACTION
   DETERMINISTIC
   BEGIN ATOMIC
      DECLARE newtemp INTEGER;
      SET newtemp = temp - 32;
      SET newtemp = newtemp * 5;
      RETURN newtemp / 9;
   END
Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?
A. VALUES degf_to_c(32)
B. SELECT date, degf_to_c(temp) AS temp_c FROM temp_data
C. CALL degf_to_c(32)
D. SELECT * FROM TABLE(degf_to_c(temp)) AS temp_c
E. VALUES degf_to_c(32) AS temp_c

No comments:

Post a Comment