Tag Archives: SQL

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.)

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.) A. The number, but not names, of columns must be identical for all SELECT statements in the query. B. The data type of each column returned by the second query must exactly match the data type of the corresponding column returned by… Read More »

Examine this description of the TRANSACTIONS table: (Exhibit) Which two SQL statements execute successfully?

Examine this description of the TRANSACTIONS table:Which two SQL statements execute successfully? (Choose two.)SELECT customer_id AS “CUSTOMER-ID”, transaction_date AS DATE, amount + 100 A. ‘DUES AMOUNT’ FROM transactions; B. 100 “DUES AMOUNT” FROM transactions;SELECT customer_id CUSTID, transaction_date TRANS_DATE, amount + 100 DUES FROM C. “DUES” FROM transactions;SELECT customer_id AS “CUSTOMER-ID”, transaction_date AS “DATE”, amount + 100 D. transactions;SELECT… Read More »

Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET

Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET operator such as UNION? (Choose two.) A. The first column in the first SELECT of the compound query with the UNION operator is used by default to sort output in the absence of an ORDER BY clause B. Only… Read More »

Examine this description of the TRANSACTIONS table: (Exhibit) Which two SQL statements execute successfully?

Examine this description of the TRANSACTIONS table:Which two SQL statements execute successfully? (Choose two.)SELECT customer_id AS “CUSTOMER-ID”, transaction_date AS DATE, amount + 100 A. DUES FROM transactions;SELECT customer_id AS CUSTOMER-ID, transaction_date AS TRANS_DATE, amount + B. 100 “DUES AMOUNT” FROM transactions;SELECT customer_id CUSTID, transaction_date TRANS_DATE, amount + 100 DUES FROM C. transactions;SELECT customer_id AS ‘CUSTOMER-ID’, transaction_date AS DATE,… Read More »

Examine this SQL statement: SELECT cust_id, cust_last_name "Last Name" FROM customers WHERE country_id

Examine this SQL statement:SELECT cust_id, cust_last_name “Last Name”FROM customersWHERE country_id = 10UNIONSELECT cust_id CUST_NO, cust_last_nameFROM customersWHERE country_id = 30Identify three ORDER BY clauses, any one of which can complete the query successfully.(Choose three.) A. ORDER BY 2, cust_id B. ORDER BY “CUST_NO” C. ORDER BY “Last Name” D. ORDER BY 2, 1 E. ORDER BY CUST_NO Correct Answer:… Read More »

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.)

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.) A. The data type group of each column returned by the second query must match the data type of the corresponding column returned by the first query. B. The names and number of columns must be identical for all SELECT statements in… Read More »

Examine this SQL statement: SELECT cust_id, cust_last_name "Last Name" FROM customers WHERE country_id

Examine this SQL statement:SELECT cust_id, cust_last_name “Last Name”FROM customersWHERE country_id = 10UNIONSELECT cust_id CUST_NO, cust_last_nameFROM customersWHERE country_id = 30Identify three ORDER BY clauses, any one of which can complete the query successfully.(Choose three.) A. ORDER BY “Last Name” B. ORDER BY CUST_NO C. ORDER BY “CUST_NO” D. ORDER BY 2, 1 E. ORDER BY 2, cust_id Correct Answer:… Read More »

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.)

Which two are true about a SQL statement using SET operators such as UNION? (Choose two.) A. The names and number of columns must be identical for all SELECT statements in the query. B. The data type of each column returned by the second query must be implicitly convertible to the data type of the corresponding column returned… Read More »

Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET

Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET operator such as UNION? (Choose two.) A. Each SELECT statement in the compound query must have its own ORDER BY clause B. Column positions must be used in the ORDER BY clause C. Each SELECT statement in the compound… Read More »