Single Row Functions Exam: SELECT Last - Name, (Salary 12) Commission - PCT FROM EMPLOYEES
Single Row Functions Exam: SELECT Last - Name, (Salary 12) Commission - PCT FROM EMPLOYEES
Single Row Functions Exam: SELECT Last - Name, (Salary 12) Commission - PCT FROM EMPLOYEES
Sameh Bakkar
New Horizons - Cairo
(1)
Eng. Sameh Bakkar
New Horizons - Cairo
(2)
Eng. Sameh Bakkar
New Horizons - Cairo
(3)
Eng. Sameh Bakkar
New Horizons - Cairo
(4)
Eng. Sameh Bakkar
New Horizons - Cairo
B. REPLACE
C. TRUNC
D. TO_DATE
E. MOD
F. CASE
Q10: The EMPLOYEES table contains these columns.
*LAST_NAME VARCHAR2 (25)
*SALARY NUMBER (6,2)
*COMMISSION_PCT NUMBER (6)
You need to write a query that will produce these results.
1. Display the salary multiplied by the commission_pct.
2. Exclude employees with a zero commission_pct.
3. Display a zero for employees with a null commission value.
Evaluate the SQL statement.
SELECT LAST_NAME, SALARY*COMMISSION_PCT
FROM EMPLOYEES
WHERE COMMISSION_PCT IS NOT NULL;
What does the statement provide?
A. All of the desired results
B. Two of the desired results
C. One of the desired results
D. An error statement
Q11: Which SELECT statement should you use to extract the year from
the system date and display it in the format "1998"?
A.SELECT TO_CHAR(SYSDATE,'yyyy') FROM dual;
B. SELECT TO_DATE(SYSDATE,'yyyy') FROM dual;
C. SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM dual;
D. SELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM dual;
(5)
Eng. Sameh Bakkar
New Horizons - Cairo
(6)
Eng. Sameh Bakkar
New Horizons - Cairo
A. cannot be nested
B. manipulate data items
C. act on each row returned
D. return one result per row
E. accept only one argument and return only one value
F. accept arguments which can be a column or an expression
Q15:Which SQL statement returns a numeric value?
A. SELECT ADD_MONTHS(MAX(hire_Date), 6) FROM EMP;
B. SELECT ROUND(hire_date) FROM EMP;
C. SELECT sysdate-hire_date FROM EMP;
D. SELECT TO_NUMBER(hire_date + 7) FROM EMP;
Q15:Which four are types of functions available in SQL?
(Choose 4)
A. string
B. character
C. integer
D. calendar
E. numeric
F. translation
G. date
H. conversion
Q16: Which SQL statement displays the date March 19, 2001 in a format
that appears as "Nineteenth of March 2001 12.00.00 AM"?
A. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'),
'fmDdspth "of" Month YYYY fmHH.MI.SS AM') NEW_DATE FROM
dual;
B. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'),
(7)
Eng. Sameh Bakkar
New Horizons - Cairo
A. 17000.00 B. 17000*****
C. ****170.00 D. **17000.00 D. an error statement .
(8)