Database Programming Section 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

If you write queries using the BETWEEN operator, it does not matter in what order you enter the values, i.e. BETWEEN low value AND high value will give the same result as BETWEEN high value and low value. True or False?

False

You want to retrieve a list of customers whose last names begin with the letters 'Fr'. Which symbol should you include in the WHERE clause of your SELECT statement to achieve the desired result? a. % b. * c. ~ d. #

a. %

Which of the following commands will display the last name concatenated with the job ID from the employees table, separated by a comma and space, and label the resulting column "Employee and Title"? a. SELECT last_name||', '|| job_id "Employee and Title" FROM employees; b. SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM emp; c. SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM employees; d. SELECT last_name||','|| job_id "Employee and Title" FROM employees;

a. SELECT last_name||', '|| job_id "Employee and Title" FROM employees;

Which operator is used to combine columns of character strings to other columns? a. || b. * c. / d. +

a. ||

Which symbol represents the not equal to condition? a. + b. != c. # d. ~

b. !=

You need to display employees with salaries that are at least 30000 or higher. Which comparison operator should you use? a. "=>" b. >= c. != d. >

b. >=

The EMPLOYEES table includes these columns: EMPLOYEE_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(15) NOT NULL FIRST_NAME VARCHAR2(10) NOT NULL HIRE_DATE DATE NOT NULL You want to produce a report that provides the last names, first names, and hire dates of those employees who were hired between March 1, 2000, and August 30, 2000. Which statements can you issue to accomplish this task? a. SELECT last_name, first_name, hire_date FROM employees AND hire_date >= '01-Mar-2000' and hire_date <= '30-Aug-2000'; b. SELECT last_name, first_name, hire_date FROM employees WHERE hire_date BETWEEN '01-Mar-2000' AND '30-Aug-2000'; c. SELECT last_name, first_name, hire_date FROM employees GROUP BY hire_date >= '01-Mar-2000' and hire_date <= '30-Aug-2000'; d. SELECT last_name, first_name, hire_date FROM employees WHERE hire_date BETWEEN '30-Aug-2000' AND '01-Mar-2000';

b. SELECT last_name, first_name, hire_date FROM employees WHERE hire_date BETWEEN '01-Mar-2000' AND '30-Aug-2000';

Which two statements would select salaries that are greater than or equal to 2500 and less than or equal to 3500? a. WHERE salary <=2500 AND salary >= 3500 b. WHERE salary BETWEEN 3500 AND 2500 c. WHERE salary BETWEEN 2500 AND 3500 d. WHERE salary >=2500 AND salary <= 3500

c and d c. WHERE salary BETWEEN 2500 AND 3500 d. WHERE salary <=2500 AND salary >= 3500

Which of the following WHERE clauses would not select the number 10? a. WHERE hours IN (8,9,10) b. WHERE hours BETWEEN 10 AND 20 c. WHERE hours <>10 d. WHERE hours <= 10

c. WHERE hours <>10

You need to display employees whose salary is in the range of 30000 and 50000. Which comparison operator should you use? a. LIKE b. IN c. IS NULL d. BETWEEN... AND...

d. BETWEEN... AND...

Which of the following is NOT BEING DONE in this SQL statement? SELECT first_name || ' ' || last_name "Name" FROM employees; a. Selecting columns from the employees table b. Using a column alias c. Putting a space between first name and last name d. Concatenating first name, middle name and last name

d. Concatenating first name, middle name and last name

Evaluate the SELECT statement: SELECT * FROM employees WHERE department_id IN(10, 20, 30) AND salary > 20000; Which values would cause the logical condition to return TRUE? a. DEPARTMENT_ID = null and SALARY = 20001 b. DEPARTMENT_ID = 10 and SALARY = 20000 c. DEPARTMENT_ID = 20 and SALARY = 20000 d. DEPARTMENT_ID = 10 and SALARY = 20001

d. DEPARTMENT_ID = 10 and SALARY = 20001

You need to display all the values in the EMAIL column that contains the underscore (_) character as part of that email address. The WHERE clause in your SELECT statement contains the LIKE operator. What must you include in the LIKE operator? a. A percent sign (%) b. The ESCAPE option (\) c. The (+) operator d. The ESCAPE option (\) and one or more percent signs (%)

d. The ESCAPE option (\) and one or more percent signs (%)

You need to display all the employees whose last names (of any length) start with the letters 'Sm'. Which WHERE clause should you use? a. WHERE last_name LIKE '%Sm' b. WHERE last_name LIKE '_Sm' c. WHERE last_name LIKE 'Sm_' d. WHERE last_name LIKE 'Sm%'

d. WHERE last_name LIKE 'Sm%'

Which of the following are examples of comparison operators used in the WHERE clause? a. =, >, <, <=, >=, <> b. between _______ and _______ c. in (..,..,..) d. is null e. All of the above

e. All of the above


Kaugnay na mga set ng pag-aaral

The Turbulent Sixties Quiz Chp 29

View Set

BAS 282: Advertising and Sales Promotion: SmartBook

View Set

Study Guide 6 - Part One - Identifying Accounting Terms

View Set

Ch 3 - Electronic Business (E-Business) Systems

View Set

Water and Carbon Cycles - The Amazon Rainforest

View Set

HESI 799 RN Exit Exam-w/ rationales

View Set

HESI RN Congenital Heart Disease - Peds

View Set

Chapter 9.2 Process of Cellular Respiration-GLYCOLYSIS

View Set