Sectiunea 3.docx

  • Uploaded by: Laura Ferent
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Sectiunea 3.docx as PDF for free.

More details

  • Words: 1,091
  • Pages: 6
Sectiunea 3 Test: Section 3 Quiz Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 3 Quiz (Answer all questions in this section) 1. Which of the following best describes the meaning of the LIKE operator?

Mark for Review (1) Points

Match a character pattern. (*) To test for values in a list. Display rows based on a range of values. To find Null values. Incorrect. See Section 3 Lesson 1. 2. Which symbol in the WHERE clause means "Not Equal To"? (Choose Two)

Mark for Review (1) Points

(Choose all correct answers) NOT IN (..) (*) <> (*) >< =+ Incorrect. See Section 3 Lesson 1. 3. You 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?

Mark for Review (1) Points

ASC SORT DESC (*) CHANGE Incorrect. See Section 3 Lesson 1. 4. Which clause would you include in a SELECT statement to sort the rows returned by the LAST_NAME column?

Mark for Review (1) Points

WHERE FROM HAVING ORDER BY (*) Incorrect. See Section 3 Lesson 1. 5. Which statement about the logical operators is true?

Mark for Review (1) Points

The order of operator precedence is AND, OR, and NOT. The order of operator precedence is NOT, AND, and OR. (*) The order of operator precedence is NOT, OR, and AND. The order of operator precedence is AND, NOT, and OR. Correct.

Page 1 of 3

Next Summary

Test: Section 3 Quiz Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 3 Quiz (Answer all questions in this section) 6. What clause must you place in a SQL statement to have your results sorted from highest to lowest salary?

Mark for Review (1) Points

ORDER BY salary DESC (*) ORDER salary BY DESC None, the database always sorts from highest to lowest on the salary column. ORDER BY salary ASC Incorrect! See Section 3 Lesson 2. 7. Evaluate this SELECT statement: SELECT first_name, last_name, email FROM employees ORDER BY last_name; Which statement is true?

Mark for Review (1) Points

The rows will be sorted in reverse alphabetical order by the LAST_NAME values. The rows will not be sorted. The rows will be sorted alphabetically by the FIRST_NAME and then the LAST_NAME values The rows will be sorted alphabetically by the LAST_NAME values. (*) Incorrect! See Section 3 Lesson 2. 8. What value will the following SQL statement return? SELECT employee_id FROM employees WHERE employee_id BETWEEN 100 AND 150 OR employee_id IN(119, 175, 205) AND (employee_id BETWEEN 150 AND 200);

Mark for Review (1) Points

19 200, 201, 202, 203, 204, 205, 206 No rows will be returned 100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149 (*) Incorrect! See Section 3 Lesson 2. 9. Evaluate this SELECT statement: SELECT * FROM employees WHERE salary > 30000 AND department_id = 10 OR email IS NOT NULL;

Mark for Review (1) Points

Which statement is true? The OR condition will be evaluated before the AND condition. The OR and AND conditions have the same precedence and will be evaluated from right to left The OR and AND conditions have the same precedence and will be evaluated from left to right The AND condition will be evaluated before the OR condition. (*) Incorrect! See Section 3 Lesson 2. 10. You query the database with this SQL statement: SELECT price FROM products WHERE price IN(1, 25, 50, 250) AND (price BETWEEN 25 AND 40 OR price > 50); Which two values could the statement return? (Choose two.)

Mark for Review (1) Points

(Choose all correct answers) 10 25 (*) 50 1 250 (*) Incorrect! See Section 3 Lesson 2.

Previous

Page 2 of 3

Next Summary

Test: Section 3 Quiz Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 3 Quiz (Answer all questions in this section) 11. Will the following statement return one row? SELECT MAX(salary), MIN(Salary), AVG(SALARY) FROM employees;

Mark for Review (1) Points

No, it is illegal. You cannot use more than one multi-row function in a SELECT statement. Yes, it will return the average salary from the employees table. Yes, it will return the highest salary, the lowest salary, and the average salary from all employees. (*) Yes, it will return the highest salary from each employee. Incorrect! See Section 3 Lesson 3. 12. Evaluate 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? Remove the table aliases in the WHERE clause. Include a HAVING clause. Remove the table aliases in the ORDER BY clause. Reorder the clauses in the query. (*)

Mark for Review (1) Points

Incorrect! See Section 3 Lesson 3. 13. The following statement represents a multi-row function. True or False? SELECT MAX(salary) FROM employees

Mark for Review (1) Points

True (*) False Incorrect! See Section 3 Lesson 3. 14. The 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)

Mark for Review (1) Points

You must display the player name, team id, and salary for players whose salary is in the range from 25000 through 100000 and whose team id is in the range of 1200 through 1500. The results must be sorted by team id from lowest to highest and then further sorted by salary from highest to lowest. Which statement should you use to display the desired result? SELECT last_name, first_name, team_id, salary FROM players WHERE (salary > 25000 OR salary < 100000) AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id, salary; SELECT last_name, first_name, team_id, salary FROM players WHERE salary BETWEEN 25000 AND 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id, salary DESC; (*) SELECT last_name, first_name, team_id, salary FROM players WHERE salary BETWEEN 24999.99 AND 100000.01 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id DESC, salary DESC; SELECT last_name, first_name, team_id, salary FROM players WHERE salary > 24999.99 AND salary < 100000 AND team_id BETWEEN 1200 AND 1500 ORDER BY team_id ASC, salary DESC; Incorrect! See Section 3 Lesson 3. 15. The conversion function TO_CHAR is a single row function. True or False?

Mark for Review (1) Points

True (*) False Incorrect! See Section 3 Lesson 3.

Previous

Page 3 of 3

Summary

Related Documents


More Documents from "daniel rechita"

Sectiunea 3.docx
November 2019 8
Flori Seral.docx
November 2019 20
November 2019 5
November 2019 21