SQL Test

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Evaluate the SQL statement and data below. What is correct result? (Refer to SQLTest1_Figure5) SELECT SUM(Cost) + SUM(Markup) FROM Profit; -450, 35 -125, 200, 160 -485 -250, 35

485

Refer to the Product table. Which columns are present in the query's result table? (Refer to SQLTest1_Figure1) SELECT * FROM Product; -ProductId, ProductName, Quantity -ProductId, ProductName, UnitPrice -All columns are present -No columns are present

All columns are present

Refer to the Product table. Which products are selected by the query below? (Refer to SQLTest1_Figure2) SELECT ProductName FROM Product WHERE Quantity >= 10; -Rompers, Shorts set -Onesies set, Pajama set -Onesies set, Sunsuit, Pajama set -No products

Onesies set, Sunsuit, Pajama set

Refer to the tables below. Which join completes the SQL query and produces the result table below? SELECT CourseTitle, FirstName, LastName FROM Class _____ Teacher ON Class.TeacherID = Teacher.TeacherID; (Refer to SQLTest1_Figure9 && Figure10) -FULL JOIN -LEFT JOIN -INNER JOIN -RIGHT JOIN

RIGHT JOIN

Refer to the tables below. Which join completes the SQL query and produces the result table below? SELECT CourseTitle, FirstName, LastName FROM Class _____ Teacher ON Class.TeacherID = Teacher.TeacherID; (Refer to SQLTest1_Figure7 && Figure8) -INNER JOIN -LEFT JOIN -RIGHT JOIN -FULL JOIN

LEFT JOIN

In the SQL query below, the Teacher table is the _____. SELECT LastName, FirstName, CourseTitle FROM Teacher INNER JOIN Class ON Teacher.TeacherID = Class.TeacherID; -Left table -Right table -Main table -Source table

Left table

Refer to the Product table. Complete the SQL statement so the result table shows 23.99. (Refer to SQLTest1_Figure3) SELECT _____ FROM Product; -SUM(UnitPrice) -MAX(Quantity) -AVG(UnitPrice) -MAX(UnitPrice)

MAX(UnitPrice)

Find the count of movies with ratings between 7 and 8.

SELECT *FROM boxofficeWHERE Rating BETWEEN 7 AND 8;

Find the movie with the highest domestic sales.

SELECT *FROM movies, boxofficeORDER BY Domestic_sales DESC LIMIT 1;

Write an SQL statement to list all movies with titles starting with the letter 'T'.

SELECT *FROM moviesWHERE title LIKE 'T%';

Write an SQL statement to count all the movies directed by 'Andrew Stanton'.

SELECT COUNT(*)FROM moviesWHERE Director = 'Andrew Stanton';

Refer to the Customer table. Which query returns the result table below? (Refer to SQLTest1_Figure6) -SELECT State, COUNT(*) FROM Customer GROUP BY State WHERE SUM(CustomerId) > 1; -SELECT State, COUNT(*) FROM Customer GROUP BY State WHERE COUNT(*) > 1; -SELECT State, COUNT(*) FROM Customer GROUP BY State HAVING COUNT(*) > 1; -SELECT State, COUNT(*) FROM Customer GROUP BY State HAVING MAX(CustomerId) > 1;

SELECT State, COUNT(*) FROM Customer GROUP BY State HAVING COUNT(*) > 1;

What does the following statement return? SELECT ROUND(12.439, 1); -12 -12.0 -12.4 -12.44

12.4

What does SQL stand for? -Simple Query Language -Structured Query Language -Standard Query Language -Selected Query Language

Structured Query Language

Which of the following values violates the CHECK constraint below? CREATE TABLE Customer ( CustomerId INT AUTO_INCREMENT, Name VARCHAR(60), Age INT CHECK (Age BETWEEN 18 AND 50), ShippingAddress VARCHAR(200), PRIMARY KEY (CustomerId) ); -(111, NULL, 20, "12301 270th Pl, Seattle, WA 98126") -(123, "Sarah Mcgraw", 50, NULL) -(456, "Sarah Mcgraw", 61, "12301 270th Pl, Seattle, WA 98126") -(999, "Sarah Mcgraw", NULL, "12301 270th Pl, Seattle, WA 98126")

(456, "Sarah Mcgraw", 61, "12301 270th Pl, Seattle, WA 98126")

Which language defines statements used for creating and dropping tables? -Data Manipulation Language -Data Query Language -Data Definition Language -Data Control Language

Data Definition Language

Refer to the Product table. Complete the SQL statement so the result table shows 63, which is the total quantity of all products. (Refer to SQLTest1_Figure4) SELECT _____ FROM Product; -SUM(Quantity) -AVG(Quantity) -MIN(Quantity) -Quantity * 5

SUM(Quantity)


संबंधित स्टडी सेट्स

GI Exam 2 - Regulation of Food Intake

View Set

Chapter Quiz - Policy Provisions & Contract Law

View Set

Comptia fundamentals 1.3 Illustrate the basics of computing and processing.

View Set

Environmental Science - Fossil Fuels

View Set

Chapter 14 Childhood Development

View Set