0% found this document useful (0 votes)
254 views

Campuslink - Admin - HCM21 - CPL - JAVA - 05 - Tests & Quizzes

This document provides a quiz on SQL concepts with 20 multiple choice questions. It tests knowledge of different types of joins (inner, outer, left, right), how to retrieve average values and identify matching rows between tables, and the purpose of SQL statements like CASE and UNION.

Uploaded by

Quang Vũ Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
254 views

Campuslink - Admin - HCM21 - CPL - JAVA - 05 - Tests & Quizzes

This document provides a quiz on SQL concepts with 20 multiple choice questions. It tests knowledge of different types of joins (inner, outer, left, right), how to retrieve average values and identify matching rows between tables, and the purpose of SQL statements like CASE and UNION.

Uploaded by

Quang Vũ Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

5/13/2021 campuslink.

admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

HCM21_CPL_JAVA_05    Tests & Quizzes

Tests & Quizzes

04_ASQL_Quiz1_SQL Advance 1
Show Feedback | Table of Contents

Part 1 of 1 -

Question 1 of 20
You have a table named Employees. You want to identify the supervisor to which each employee 5.0 Points
reports. You write the following query.

SELECT e.EmloyeeName AS [EmployeeName], s.EmployeeName AS [SuperVisorName] FROM Employees


e

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?

A. RIGHT JOIN Employees s ON e.ReportsTo = s.EmployeeId

B. INNER JOIN Employees s ON e.EmployeeId = s.EmployeeId

C. LEFT JOIN Employees s ON e.ReportsTo = s.EmployeeId

Reset Selection

Question 2 of 20
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?

https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 1/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

A. Large refrigerator, medium refrigerator, small refrigerator, air purifier, and air conditioner

B. Medium refrigerator, small refrigerator, portable refrigerator, coffee maker, and air conditioner

C. Medium refrigerator, small refrigerator, and air conditioner

D.
Large refrigerator, medium refrigerator, small refrigerator, portable refrigerator, air purifier, coffee maker,
and air conditioner

Reset Selection

Question 3 of 20
How many tables may be included with a join? 5.0 Points

A. One

B. Two

C. Three

D. All of the mentioned options

Reset Selection

Question 4 of 20
The following SQL is which type of join: 5.0 Points
SELECT CUSTOMER_T.CUSTOMER_ID, ORDER_T.CUSTOMER_ID, NAME, ORDER_ID
FROM CUSTOMER_T, ORDER_T
WHERE CUSTOMER_T.CUSTOMER_ID = ORDER_T.CUSTOMER_ID
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 2/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

A. Inner Join

B. Cross Join

C. Outer Join

D. Self Join

Reset Selection

Question 5 of 20
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

A. S101, S103, S104

B. S101, S101, S102, S103, S104, S104

C. S101, S102, S103, S104

D. S101, S101, S103, S104, S104

Reset Selection

Question 6 of 20
The most frequently used relational operation, which merges data from two or more related tables 5.0 Points
into one resultant table, is called an cross-join.

True
False
Reset Selection

https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 3/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

Question 7 of 20
The following SQL is which type of join: 5.0 Points
SELECT CUSTOMER_T.CUSTOMER_ID, ORDER_T.CUSTOMER_ID, NAME, ORDER_ID
FROM CUSTOMER_T, ORDER_T ;

A. Cross Join

B. Outer Join

C. Self Join

D. Inner Join

Reset Selection

Question 8 of 20
5.0 Points
Which of the following SQL statements can extract the average salary by department from tables A
and B?

A. " SELECT department_code, department_name, AVR(salary) FROM Table_A, Table_B


WHERE Table_A.belonging_code = Table_B.department_code"

B. " SELECT department_code, department_name, AVR(salary) FROM Table_A, Table_B


ORDER_BY department_code"

C. " SELECT department_code, department_name, AVR(salary) FROM Table_A, Table_B


WHERE Table_A.belonging_code = Table_B.department_code
ORDER BY department_code"

D. " SELECT department_code, department_name, AVR(salary) FROM Table_A, Table_B


WHERE Table_A.belonging_code = Table_B.department_code
GROUP BY department_code, department_name"

Reset Selection

Question 9 of 20
5.0 Points

https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 4/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

What type of join is needed when you wish to return rows when there is at least one match in both tables?

A. Cross-join

B. Inner join

C. Outer join

D. All of the above.

Reset Selection

Question 10 of 20
A CASE SQL statement is which of the following 5.0 Points

A. A way to establish an IF-THEN-ELSE in SQL

B. A way to establish a loop in SQL

C. A way to establish a data definition in SQL

D. All of the above

Reset Selection

Question 11 of 20
There should be one condition within the WHERE clause for each pair of tables being joined. 5.0 Points

True
False
Reset Selection

Question 12 of 20
The INNER JOIN clause? 5.0 Points

A. Returns all the matching rows from 2 tables.

B. Returns all rows that have matching value in the field on which the 2 tables are joined.

C. Returns all rows from 2 tables.

D.
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.

Reset Selection

Question 13 of 20
The following SQL is which type of join: 5.0 Points
SELECT CUSTOMER_T.CUSTOMER_ID, ORDER_T.CUSTOMER_ID, NAME, ORDER_ID
FROM CUSTOMER_T, ORDER_T ;
https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 5/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

A. Self Join

B. Outer Join

C. Cross Join

D. Inner Join

Reset Selection

Question 14 of 20
You have two tables named Customer and SalesOrder. In the Customer table you have 1000 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.

SELECT * FROM Customer WHERE Customer.CustomerID IN (SELECT SalesOrder.CustomerID FROM


SalesOrder).

You need to identify the results of the query. Which results will the query return?

A. No rows

B. The 900 rows in the Customer table with matching rows in the SalesOrder table

C. The 1000 rows in the Customer table

Reset Selection

Question 15 of 20
A UNION query is which of the following? 5.0 Points

A. Combines the output from multiple queries and does not include the same number of columns.

B.
Combines the output from no more than two queries and does not include the same number of columns.

C. Combines the output from multiple queries and must include the same number of columns.

D. Combines the output from no more than two queries and must include the same number of columns.

Reset Selection

Question 16 of 20
5.0 Points
In SQL the word ‘natural’ can be used with

A. Inner join

https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 6/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

B. Full outer join

C. Right outer join

D. All of the above

Reset Selection

Question 17 of 20
Subqueries can be nested multiple times 5.0 Points

True
False
Reset Selection

Question 18 of 20
A function returns one value and has only output parameters. 5.0 Points

True
False
Reset Selection

Question 19 of 20
With the UNION clause, each query involved must output the same number of columns, and they 5.0 Points
must be UNION compatible.

True
False
Reset Selection

Question 20 of 20
If you join a table to itself, what kind of join are you using? 5.0 Points

A. Natural Join

B. You can't join a table to itself.

C. Selective Join.

D. Self Join

Reset Selection

Save Exit
Submit for Grading

https://gst.fsoft.com.vn/portal/site/b0d8cac9-9f19-4f09-9eb7-71661cf003c0/tool/e2c4d983-f0d7-4b16-b69b-7235434d4adb/jsf/delivery/deliverAssessm… 7/8
5/13/2021 campuslink.admin : HCM21_CPL_JAVA_05 : Tests & Quizzes

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/delivery/deliverAssessm… 8/8

You might also like