TCMG 316 Study Quiz 3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

When you code a SELECT statement, you must code the four main clauses in the following order: A. SELECT, ORDER BY, FROM, WHERE B. SELECT, WHERE, ORDER BY, FROM C. SELECT, FROM, WHERE, ORDER BY D. SELECT, FROM, ORDER BY, WHERE

C. The four main clauses used with a SELECT statement are: SELECT, FROM, WHERE, ORDER BY. The correct order of each clause is also important to note, as shown to give proper results when executed.

Which of the following WHERE clauses will return vendor names from A to C? A. WHERE vendor_name < 'C' B. WHERE vendor_name = 'D' C. WHERE vendor_name < 'D' D. WHERE vendor_name = D

C. Using WHERE vendor_name < 'D' will filter the vendor names starting with A, B, & C when returning data upon execution of the SQL statement.

What is the result of the expression that follows if the value of last_name is "Smith" and the value of first_name is "Steve"? A. Smith, Steve B. Smith,Steve C. SmithSteve D. Smith Steve

C. Using the CONCAT function causes both strings to be joined together as a single string, so the correct answers is SmithSteve.

Which of the following statements about sorting the rows in a result set is not true? A. The rows can be sorted by any number of columns in either ascending or descending sequence B. Null values always appear first in the sort sequence. C. A column that is used for sorting must be included in the SELECT clause. D. The sort order is determined by the character set being used.

D. A column that is used for sorting must be included in the SELECT clause is incorrect, as the returned data set will be sorted in some form by default when the SQL statement is executed

Which of the following SELECT clauses could you use to assign an alias to the invoice_total column? A. SELECT invoice_number, invoice_date, invoice_total total B. SELECT invoice_number, invoice_date, invoice_total AS total C. none of the above D. a and b are both correct

D. Both A & B are correct in this case and would create the column alias of total for the column invoice_total.

Which clause do you use to filter the rows returned by a SELECT statement? A. FROM B. ORDER BY C. SELECT D. WHERE

D. The WHERE clause is used with a SELECT statement to determine or filter which rows of data are returned when the statement is executed.

How would you code a SELECT clause so it returns all columns from the base table? A. SELECT COLUMNS B. SELECT ALL C. SELECT MAIN D. SELECT *

D. Using the " * " (asterisk) character with a SELECT statement allows for all columns of data in each associated row to be returned when the statement is executed.

The * is used in a SQL statement to retrieve a single column in a table. True or False

FALSE! The * is used in a SQL statement to retrieve all columns in a table. For specific columns in a table, use the individual column name(s) in the SQL statement.

The most common clause to retrieve data is the SELECT clause. True or False

TRUE! When using a SQL statement to retrieve data from a database, the SELECT clause is the most common clause used to return a data result set.


Set pelajaran terkait

Computer Programming - Final Exam Review

View Set

U.S. History - Ch. 14, Sec. 4 - Questions

View Set