Week #11 Quiz - CIST1220-Structured Query Language-SQL

Week #11 Quiz - CIST1220-Structured Query Language-SQL

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Which of the following functions is used to determine the number of months between two date values? A) MONTH_BETWEEN B) MONTHS_BETWEEN C) MTH_BETWEEN D) MNTH_BETWEEN

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

5 years ago

Date created

Mar 1, 2020

Cards (10)

Section 1

(10 cards)

Which of the following functions is used to determine the number of months between two date values? A) MONTH_BETWEEN B) MONTHS_BETWEEN C) MTH_BETWEEN D) MNTH_BETWEEN

Front

B) MONTHS_BETWEEN

Back

The SOUND function is used to determine the phonetic representation of a character string. A) True B) False

Front

B) False

Back

The LTRIM function can be used to remove a specific number of characters from the left side of a set of data. A) True B) False

Front

B) False

Back

Based upon the contents of the CUSTOMERS table, which of the following will display the shipping location as: City, State Zip A) SELECT INITCAP(CONCAT(city, CONCAT(', ', CONCAT(state, CONCAT(' ', zip))))) FROM customers; B) SELECT CONCAT(city, CONCAT(', ', CONCAT(state, CONCAT(' ', CONCAT(zip))))) FROM customers; C) SELECT INITCAP(CONCAT(city, ', ', state, ' ', zip)) FROM customers; D) none of the above

Front

A) SELECT INITCAP(CONCAT(city, CONCAT(', ', CONCAT(state, CONCAT(' ', zip))))) FROM customers;

Back

Which of the following can be used to replace a specific set of characters with another set of characters? A) SUBSTR B) REPLACE C) FNDRPLCE D) none of the above

Front

B) REPLACE

Back

Which statement will return a listing of last names, salaries, and a rating of 'Low', 'Medium', 'Good' or 'Excellent' depending on the salary value? A) SELECT 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; B) SELECT 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; C) SELECT 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; D) SELECT 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;

Front

C) SELECT 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;

Back

Based upon the contents of the ORDERS table, which of the following SQL statements will display only those orders shipped to the zip code zone that begins with 323? A) SELECT order#, SUBSTR(shipzip, 1, 323) FROM orders; B) SELECT order#, SUBSTR(shipzip, 1, 323) FROM orders WHERE shipzip = 323; C) SELECT order# FROM orders WHERE shipzip = SUBSTR(shipzip, 1, 323); D) SELECT order# FROM orders WHERE SUBSTR(shipzip, 1, 3) = 323;

Front

D) SELECT order# FROM orders WHERE SUBSTR(shipzip, 1, 3) = 323;

Back

A positive number is used in the ROUND function to indicate that numeric data should be rounded to the indicated position to the right of the decimal point. A) True B) False

Front

A) True

Back

The TO_CHAR function can be used to add a dollar sign ($) to a numeric value. A) True B) False

Front

A) True

Back

Which of the following is a valid SQL statement based upon the contents of the CUSTOMERS table? A) SELECT INITCAP(firstname, lastname) FROM customers; B) SELECT LENGTH (city, state, zip) FROM customers; C) SELECT customer#, NVL2(referred, 'Referred', 'Not Referred') FROM customers; D) SELECT INITCAP((firstname),( lastname)) FROM customers; Note: The ST column name is truncated, this represents the STATE column.

Front

C) SELECT customer#, NVL2(referred, 'Referred', 'Not Referred') FROM customers;

Back