Module quiz: SQL operators and sorting and filtering data

Ace your homework & exams now with Quizwiz!

Select the right SQL statement to display the values of the total prices that are greater than $140. a. SELECT total FROM Orders WHERE total > 140; b. SELECT total FROM Orders WHERE total >= 140; c. SELECT total FROM Orders WHERE total < 140;

a. SELECT total FROM Orders WHERE total > 140;

The following SQL statement filters data based on ____ SELECT * FROM customers WHERE Country = "Germany"; a. 'Germany' column with 'country' value b. 'Country' column with 'Germany' value

b. 'Country' column with 'Germany' value

What does the following SQL statement do? SELECT total / 2 FROM Orders; a. It returns the value of total price column in the second row. b. It returns the result of total price divided by 2 for each cell in the total price column

b. It returns the result of total price divided by 2 for each cell in the total price column

Which of the following SQL statements adds a $2.00 service fee to the total price in a table called "Orders", that lists the price of orders customers placed with a store? a. SELECT total + 2 FROM Orders TABLE; b. SELECT total + 2 FROM the Orders TABLE; c. SELECT total + 2 FROM Orders;

c. SELECT total + 2 FROM Orders;

Does the following SQL statements sort the result-set of the total prices in ascending or descending order? SELECT * FROM Orders ORDER BY total; a. Descending b. Ascending

b. Ascending

The following SQL statement returns 2 percent of the total price: SELECT total % 2 FROM Orders; a. True b. False

This SQL statement returns the remainder of the total price value divided by 2.

The output of the following SQL query within the Orders table is: UK, UK, UK, France, France, Finland SELECT DISTINCT Country FROM Orders; a. False b. True

a. False The output result of this SQL query will be: UK, France, Finland

In SQL you can sort records in descending order using the DESCENDING keyword. a. False b. True

a. False You need to use the DESC keyword.

What does the following SQL statement do? SELECT * FROM Orders ORDER BY country, total; a. Orders the result by country first then total price. b. Orders the result by country and ignores the total price.

a. Orders the result by country first then total price. It orders the result by country first, but if some records have the same country, it orders them by lowest total price.

Which of the following SQL statements returns 50% of the total price? Choose all correct answers. a. SELECT total / 2 FROM Orders; b. SELECT total * 0.5 FROM Orders; c. SELECT total / 50% FROM Orders; d. SELECT total * 50 FROM Orders;

a. SELECT total / 2 FROM Orders; b. SELECT total * 0.5 FROM Orders;


Related study sets

Myers' Psychology for the AP® Course, 4e, Unit 1, English

View Set

Ch 37 (Management of Patients With HIV Infection and AIDS) Prep U

View Set

Chapter 10 Certification Style Exam Quiz

View Set

Reference Angles, Coterminal angles, Standard Position, Coterminal and Reference Angles, Coterminal and Reference Angles

View Set

Fundamentals of Nursing practice exam #1

View Set