Professional Documents
Culture Documents
04_ASQL_Quiz1_SQL Advance 1
Return to Assessment List
Question 1 of 20
You have a table named Employees. You want to identify the supervisor to which each 5.0/ 5.0 Points
employee reports. You write the following query.
You need to ensure that the query returns a list of all employees and their respective supervisor. Which join
clause should you use to complete the query?
Question 2 of 20
5.0/ 5.0 Points
How many rows are included in the table gained as as result of execution of the following
statement?
SELECT DISTINCT customer_name, merchandise_name, unit_price
FROM order_table, merchandise_table
WHERE order_table.merchandise_number = merchandise_table.mnrchandise_number
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 1/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
A. 3
B. 5
C. 4
D. 2
Question 3 of 20
Which of the following is one of the basic approaches for joining tables? 5.0/ 5.0 Points
A. Subqueries
B. Union Join
C. Inner/Outer join
Question 4 of 20
With the UNION clause, each query involved must output the same number of columns, and 5.0/ 5.0 Points
they must be UNION compatible.
True
False
Question 5 of 20
What type of join is needed when you wish to return rows when there is at least one match in 5.0/ 5.0 Points
both tables?
A. Cross-join
B. Inner join
C. Outer join
Question 6 of 20
You have a Microsoft SQL Server 2012 database that contains tables named Customers and 5.0/ 5.0 Points
Orders. The tables are related by a column named CustomerID. You need to create a query that meets the
following requirements:
Returns the CustomerName for all customers and the OrderDate for any orders that they have placed.
Results must include customers who have not placed any orders.
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 2/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
Question 7 of 20
The most frequently used relational operation, which merges data from two or more related 5.0/ 5.0 Points
tables into one resultant table, is called an cross-join.
True
False
Question 8 of 20
5.0/ 5.0 Points
Which is the correct data returned from executing following SQL statements on the “Product”
and “Sales_Datails” tables?
SELECT X.Product_No
FROM Product X LEFT OUTER JOIN Sales_Details Y ON X.Product_No=Y.Product_No
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 3/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
Question 9 of 20
Which of the following is one of the basic approaches for joining tables? 5.0/ 5.0 Points
A. Subqueries
B. Union Join
C. Natural join
Question 10 of 20
Which of the following statements is true concerning subqueries? 5.0/ 5.0 Points
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 4/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
Question 11 of 20
Sub-queries can be nested in? 5.0/ 5.0 Points
Question 12 of 20
The LIKE SQL keyword is used along with? 5.0/ 5.0 Points
A. JOIN clause.
B. GROUP BY clause.
C. WHERE clause.
D. ORDER BY clause.
Question 13 of 20
Which of the following is a correlated subquery? 5.0/ 5.0 Points
A. Uses the result of an inner query to determine the processing of an outer query
B. Uses the result of an outer query to determine the processing of an outer query
C. Uses the result of an outer query to determine the processing of an inner query
D. Uses the result of an inner query to determine the processing of an inner query
Question 14 of 20
You are a developer for a Microsoft SQL Server database instance used to support a customer 0.0/ 5.0 Points
service application. You create tables named complaint, customer, and product as follows:
CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate]
[datetime]);
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 5/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
You need to write a query to sum the monthly sales of each product.
Which SQL query should you use?
B.
"SELECT p.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS
Sales
FROM product p
INNER JOIN complaint com ON p.ProductID = com.ProductID
GROUP BY p.ProductName, ComplaintMonth;
"
Question 15 of 20
What type of join is needed when you wish to return rows when there is at least one match in 5.0/ 5.0 Points
both tables?
A. Cross-join
B. Inner join
C. Outer join
Question 16 of 20
The INNER JOIN clause? 0.0/ 5.0 Points
A. Returns all rows that have matching value in the field on which the 2 tables are joined.
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 6/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
B.
Returns only the rows from the first table, which have non-matching values with the second table in the
field on which the 2 tables are joined.
Question 17 of 20
5.0/ 5.0 Points
Which of the following product groups can be found when searching the “Product Inventory”
table for products with a sales price of 500 dollars or more per unit and an inventory of less than 10 units?
B. Large refrigerator, medium refrigerator, small refrigerator, air purifier, and air conditioner
C.
Large refrigerator, medium refrigerator, small refrigerator, portable refrigerator, air purifier, coffee maker,
and air conditioner
D. Medium refrigerator, small refrigerator, portable refrigerator, coffee maker, and air conditioner
Question 18 of 20
5.0/ 5.0 Points
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 7/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
What type of join is needed when you wish to include rows when there is a match between the tables?
A. Cross-join
B. Inner join
C. Outer join
Question 19 of 20
You are a developer for a Microsoft SQL Server database instance used to support a customer 5.0/ 5.0 Points
service application. You create tables named complaint, customer, and product as follows:
CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate]
[datetime]);
You need to write a query to identify all customers who have complained about products that have an average
sales price of 500 or more from September 01, 2011.
B.
"SELECT p.ProductName,DATEPART(mm, com.ComplaintDate) ComplaintMonth,SUM(p.SalePrice) AS
Sales
FROM product p
INNER JOIN complaint com ON p.ProductID = com.ProductID
GROUP BY CUBE;.CustomerName,COUNT(com.ComplaintID) AS complaints
FROM customer c INNER JOIN complaint com ON c.CustomerID = com.CustomerID
GROUP BY c.CustomerName
HAVING COUNT(com.ComplaintID) > 10;
"
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 8/9
13/05/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes
Question 20 of 20
You have two tables named Customer and SalesOrder. In the Customer table you have 1000 5.0/ 5.0 Points
customers, of which 900 customers have orders in the SalesOrder table. You execute the following query to
list all customers that have had at least one sale.
You need to identify the results of the query. Which results will the query return?
A. The 900 rows in the Customer table with matching rows in the SalesOrder table
C. No rows
Gateway
Accessibility Information
The Sakai Project
Powered by Sakai
Copyright 2017 FPT-Software
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/index/mainIndex 9/9