What will be the outcome of the following query?
SELECT ROUND(144.23,-1) FROM dual;
SQL: Using Single-Row Functions
Quiz
•
Computers
•
8th Grade - Professional Development
•
Medium
Chetna Dass
Used 19+ times
FREE Resource
100 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the outcome of the following query?
SELECT ROUND(144.23,-1) FROM dual;
140
144
150
100
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You are currently located in New Jersey and have connected to a remote database in San Diego. You issue the following command.
SELECT ROUND (sysdate-hire_date,0) FROM employees WHERE (sysdate-hire_date)/180 = 2;
What is the outcome of this query?
An error because the ROUND function cannot be used with Date arguments.
An error because the WHERE condition expression is invalid.
Number of days since the employee was hired based on the current San Diego date and time.
Number of days since the employee was hired based on the current New Jersey date and time.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You need to display the names of the employees who have the letter 's' in their first name and the letter 't' at the second position in their last name. Which query would give the required output?
SELECT first_name, last_name FROM employees WHERE INSTR(first_name,'s') <> 0 AND SUBSTR(last_name,2,1) = 't';
SELECT first_name, last_name FROM employees WHERE INSTR(first_name,'s') <> '' AND SUBSTR(last_name,2,1) = 't';
SELECT first_name, last_name FROM employees WHERE INSTR(first_name,'e') IS NOT NULL AND SUBSTR(last_name,2,1) = 't';
SELECT first_name, last_name FROM employees WHERE INSTR(first_name,'e') <> 0 AND SUBSTR(last_name,LENGTH(first_name),1) = 't';
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following statements is true regarding the COUNT function? (Select all that apply)
COUNT (*) counts duplicate values and NULL values in columns of any data type.
COUNT function cannot work with DATE datatypes.
COUNT (DISTINCT job_id) returns the number of rows excluding rows containing duplicates and NULL values in the job_id column.
A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a WHERE clause.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Examine the structure of the EMPLOYEES table as given. What will be the outcome of the following query?
SELECT last_name, NVL(job_id, 'Unknown') FROM employees WHERE last_name LIKE 'A%' ORDER BY last_name;
It will throw an ORA error on execution.
It will list the job IDs for all employees from EMPLOYEES table.
It will list the job IDs of all employees and substitute NULL job IDs with a literal 'Unknown'.
It will display the last names for all the employees and their job IDs including the NULL values in the job ID.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the outcome of the following query? (Consider the structure of the EMPLOYEES table as given)
SELECT employee_id , NVL(salary, 0) FROM employees WHERE first_name like 'P%' ORDER BY first_name;
It will display 0 in the salary column for all the employees whose first name starts with a 'P'
It will display the salaries for the employees whose name start with a 'P' and 0 if the salaries are NU
It will throw an ORA error as the ORDER BY clause should also contain the salary column.
The NVL function should be correctly used as NVL (0, salary)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the outcome of the following query? (Consider the structure of the EMPLOYEES table as given)
SELECT NVL2(job_id,'Regular Employee','New Joinee') FROM employees;
It will return the value 'Regular Employee' for all the employees who have NULL job IDs
It will return the value 'New Joinee' for all the employees who have NULL job IDs
It will return 'Regular Employee' if the job ID is NULL
It will throw an ORA error on execution.
99 questions
untitled
Quiz
•
12th Grade - University
96 questions
Database final
Quiz
•
University
100 questions
SK SPM F5 (All Chapters)
Quiz
•
11th Grade
100 questions
N5CS: Database Design
Quiz
•
9th Grade
98 questions
OCR GCSE Computer Science Revision Paper 1- Saim C :D
Quiz
•
8th - 12th Grade
100 questions
Security Quiz Chapter 12
Quiz
•
Professional Development
102 questions
ICT WORD PROCESSING (FINAL EXAM REVIEW)
Quiz
•
6th - 8th Grade
102 questions
Penilaian Pasca UASA: SQL
Quiz
•
8th - 9th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade