Quiz
QUIZ 5
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (15)
1You have been asked to create a report that lists all customers who have placed orders of at least $2,500. The report's date should be displayed using this format:
Day, Date Month, Year (For example, Tuesday, 13 April, 2004 ).
Which statement should you issue?- ASELECT companyname, TO_CHAR (sysdate, 'fmdd, dy month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500; - BSELECT companyname, TO_DATE (sysdate, 'dd, dy month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500; - CSELECT companyname, TO_CHAR (sysdate, 'fmDay, dd Month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500; - DSELECT companyname, TO_DATE (date, 'day, dd month, yyyy'), total
FROM customers NATURAL JOIN orders
WHERE total >= 2500;
- ASELECT companyname, TO_CHAR (sysdate, 'fmdd, dy month, yyyy'), total
2Which two statements concerning SQL functions are true? (Choose two.)
- ASingle-row functions manipulate groups of rows to return one result per group of rows.
- BCharacter functions can accept numeric input.
- CNot all date functions return date values.
- DNumber functions can return number or character values.
- EConversion functions convert a value from one data type to another data type.
3If you use the RR format when writing a query using the date 27-Oct-17 and the year is 2001, what year would be the result?
- A1901
- B2001
- C2017
- D1917
4Which arithmetic operation will return a numeric value?
- ASYSDATE + 30 / 24
- BSYSDATE - 6
- CNEXT_DAY(hire_date) + 5
- DTO_DATE('01-Jun-2004') - TO_DATE('01-Oct-2004')
5 Which best describes the TO_CHAR function?
- AThe TO_CHAR function can be used to display dates and numbers according to formatting conventions that are supported by Oracle.
- BThe TO_CHAR function can be used to remove text from column data that will be returned by the database.
- CThe TO_CHAR function can be used to specify meaningful column names in an SQL statement's result set.
- DThe TO_CHAR function can only be used on Date columns.
6All Human Resources data is stored in a table named EMPLOYEES. You have been asked to create a report that displays each employee's name and salary. Each employee's salary must be displayed in the following format: $000,000.00. Which function should you include in a SELECT statement to achieve the desired result?
- ATO_CHAR
- BTO_NUMBER
- CCHARTOROWID
- DTO_DATE
7Consider the following data in the Employees table: (last_name, commission_pct, manager_id)
DATA:
King, null, null
Kochhar, null, 100
Vargas, null, 124
Zlotkey, .2, 100
What is the result of the following statement:
SELECT last_name, COALESCE(commission_pct, manager_id, -1) comm
FROM employees ;- AKing, -1
Kochhar, 100
Vargas, 124
Zlotkey, 100 - BKing, null
Kochhar, 100
Vargas, 124
Zlotkey, .2 - CKing, -1
Kochhar, 100
Vargas, 124
Zlotkey, .2 - DStatement will fail
- AKing, -1
8If quantity is a number datatype, what is the result of this statement?
SELECT NVL(200/quantity, 'zero') FROM inventory;- ANull
- Bzero
- CThe statement fails.
- DZERO
9You need to replace null values in the DEPT_ID column with the text N/A. Which functions should you use?
- ATO_CHAR and NULLIF
- BTO_NUMBER and NULLIF
- CTO_CHAR and NULL
- DTO_CHAR and NVL
10The PRODUCT table contains this column: PRICE NUMBER(7,2)
Evaluate this statement:
SELECT NVL(10 / price, '0')
FROM PRODUCT;
What would happen if the PRICE column contains null values?- AThe statement would fail because values cannot be divided by 0.
- BA value of 10 would be displayed.
- CA value of 0 would be displayed.
- DThe statement would fail because values cannot be divided by null.
11The STYLES table contains this data:
Evaluate this SELECT statement:
SELECT style_id, style_name, category, cost
FROM styles
WHERE style_name LIKE 'SANDAL' AND NVL(cost, 0) < 15.00
ORDER BY category, cost;
Which result will the query provide?
- ASTYLE_ID STYLE_NAME CATEGORY COST
895840 SANDAL 85940 12.00
968950 SANDAL 85909 10.00
758960 SANDAL 86979 - BSTYLE_ID STYLE_NAME CATEGORY COST
895840 SANDAL 85909 12.00
968950 SANDAL 85909 10.00
758960 SANDAL 86979
869506 SANDAL 89690 15.00 - CSTYLE_ID STYLE_NAME CATEGORY COST
968950 SANDAL 85909 10.00
895840 SANDAL 85940 12.00
758960 SANDAL 86979 - DSTYLE_ID STYLE_NAME CATEGORY COST
895840 SANDAL 85909 12.00
968950 SANDAL 85909 10.00
869506 SANDAL 89690 15.00
758960 SANDAL 86979
- ASTYLE_ID STYLE_NAME CATEGORY COST
12The following statement returns 0 (zero). True or False?
SELECT 121/NULL
FROM dual;- ARichtig
- BFalsch
13CASE and DECODE evaluate expressions in a similar way to IF-THEN-ELSE logic. However, DECODE is specific to Oracle syntax. True or False?
- ARichtig
- BFalsch
14Which statement will return a listing of last names, salaries, and a rating of 'Low', 'Medium', 'Good' or 'Excellent' depending on the salary value?
- ASELECT last_name,sal,
(CASE WHEN sal<5000 THEN 'Low'
WHEN sal<10000 THEN 'Medium'
WHEN sal<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees; - BSELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN sal <10000 THEN 'Medium'
WHEN sal <20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees; - CSELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees; - DSELECT last_name,salary,
(RATING WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
- ASELECT last_name,sal,
15For the given data from Employees (last_name, manager_id) what is the result of the following statement:
DATA:( King, null
Kochhar, 100
De Haan, 100
Hunold, 102
Ernst, 103)
SELECT last_name,
DECODE(manager_id, 100, 'King', 'A N Other') "Works For?"
FROM employees- AKing, A N Other
Kochhar, King
De Haan, King
Hunold, A N Other
Ernst, A N Other - BInvalid statement.
- CKing, Null
Kochhar, King
De Haan, King
Hunold, A N Other
Ernst, A N Other - DKing, A N Other
Kochhar, King
De Haan, King
Hunold, Kochhar
Ernst, De Haan
- AKing, A N Other
Informationen
- Beschreibung
- Quiz am QUIZ 5, erstellt von Claudia Piscociu am 14/01/2017.
- Autor
- Claudia Piscociu
- Sprache
- English
- Aufrufe
- 9
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz