Quiz
QUIZ 3
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (15)
1Evaluate this SELECT statement:
SELECT *
FROM employees
WHERE department_id = 34
OR department_id = 45
OR department_id = 67;
Which operator is the equivalent of the OR conditions used in this SELECT statement?- ABETWEEN AND...
- BLIKE
- CIN
- DAND
2You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id "Category", price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";
This statement fails when executed. Which clause contains a syntax error?- AFROM products
- BWHERE "Category" = 5570
- CORDER BY "Product Number";
- DSELECT product_id "Product Number", category_id "Category", price "price"
3Evaluate this SELECT statement:
SELECT employee_id, last_name, first_name, salary 'Yearly Salary'
FROM employees
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Which clause contains an error?- ASELECT employee_id, last_name, first_name, salary 'Yearly Salary'
- BWHERE salary IS NOT NULL
- CFROM employees
- DORDER BY last_name, 3;
4Evaluate this SQL statement:
SELECT product_id, product_name, price
FROM products
ORDER BY product_name, price;
What occurs when the statement is executed?- AThe results are sorted alphabetically only.
- BThe results are sorted numerically and then alphabetically.
- CThe results are sorted alphabetically and then numerically.
- DThe results are sorted numerically only.
5A column alias can be specified in an ORDER BY Clause. True or False?
- ATrue
- BFalse
6You need to change the default sort order of the ORDER BY clause so that the data is displayed in reverse alphabetical order. Which keyword should you include in the ORDER BY clause?
- ADESC
- BCHANGE
- CASC
- DSORT
7Which statement about the logical operators is true?
- AThe order of operator precedence is NOT, AND, and OR.
- BThe order of operator precedence is AND, NOT, and OR.
- CThe order of operator precedence is AND, OR, and NOT.
- DThe order of operator precedence is NOT, OR, and AND.
8Which logical operator returns TRUE if either condition is true?
- AAND
- BOR
- CBOTH
- DNOT
9Which clause would you include in a SELECT statement to sort the rows returned by the LAST_NAME column?
- AFROM
- BORDER BY
- CHAVING
- DWHERE
10The ORDER BY clause always comes last. True or False?
- ATrue
- BFalse
11Will the following statement return one row?
SELECT MAX(salary), MIN(Salary), AVG(SALARY)
FROM employees;- AYes, it will return the highest salary, the lowest salary, and the average salary from all employees.
- BYes, it will return the highest salary from each employee.
- CYes, it will return the average salary from the employees table.
- DNo, it is illegal. You cannot use more than one multi-row function in a SELECT statement.
12The PLAYERS table contains these columns:
PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)
You want to display all players' names with position 6900 or greater.
You want the players names to be displayed alphabetically by last name and then by first name.
Which statement should you use to achieve the required results?- ASELECT last_name, first_name
FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name; - BSELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name; - CSELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name; - DSELECT last_name, first_name
FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;
- ASELECT last_name, first_name
13Evaluate this SQL statement:
SELECT e.employee_id, e.last_name, e.first_name, m.manager_id
FROM employees e, employees m
ORDER BY e.last_name, e.first_name
WHERE e.employee_id = m.manager_id;
This statement fails when executed. Which change will correct the problem?- ARemove the table aliases in the WHERE clause.
- BReorder the clauses in the query.
- CInclude a HAVING clause.
- DRemove the table aliases in the ORDER BY clause.
14 The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(9) PK
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
Compare these two SQL statements:
1.
SELECT DISTINCT department_id DEPT, last_name, first_name
FROM employees
ORDER BY department_id;
2.
SELECT department_id DEPT, last_name, first_name
FROM employees
ORDER BY DEPT;
How will the results differ?- AThe statements will sort on different column values.
- BThere is no difference in the result between the two statements.
- COne of the statements will return a syntax error.
- DOne of the statements will eliminate all duplicate DEPARTMENT_ID values.
15The conversion function TO_CHAR is a single row function. True or False?
- ATrue
- BFalse
Information
- Description
- Quiz on QUIZ 3, created by Claudia Piscociu on 14/01/2017.
- Author
- Claudia Piscociu
- Language
- English
- Views
- 3
- Rating
- No ratings yet Rate this quiz