You are on page 1of 8

5/18/2021 campuslink.

admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

HCM21_CPL_JAVA_06    Tests & Quizzes

Tests & Quizzes

04_ASQL_Quiz1_SQL Advance 1
Return to Assessment List

Part 1 of 1 - 70.0/ 100.0 Points

Question 1 of 20
The following SQL is which type of join: 5.0/ 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

A. Outer Join

B. Cross Join

C. Inner Join

D. Self Join

Question 2 of 20
If two relations R and S are joined, then the non-matching tuples of both R and S are ignored in 5.0/ 5.0 Points

A. Left outer join

B. Inner join

C. Right outer join

D. Full outer join

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

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

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

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

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 1/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

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

Question 4 of 20
What type of join is needed when you wish to return rows when there is at least one match in 0.0/ 5.0 Points
both tables?

A. Cross-join

B. Inner join

C. Outer join

D. All of the above.

Question 5 of 20
The UNION clause is used to combine the output from multiple queries together into a single 5.0/ 5.0 Points
result table.

True
False

Question 6 of 20
The UNION clause is used to combine the output from multiple queries together into a single 5.0/ 5.0 Points
result table

True
False

Question 7 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?

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 2/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

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

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

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

D. Medium refrigerator, small refrigerator, and air conditioner

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

A. Inner Join

B. Cross Join

C. Self Join

D. Outer Join

Question 9 of 20
Sub-queries can be nested in? 5.0/ 5.0 Points

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 3/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

A. DELETE statements only.

B. UPDATE, DELETE, INSERT and SELECT statements.

C. UPDATE statements only.

D. INSERT statements only.

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

A. One

B. Two

C. Three

D. All of the mentioned options

Question 11 of 20
5.0/ 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


ORDER_BY department_code"

B. " 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"

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"

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 4/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

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


WHERE Table_A.belonging_code = Table_B.department_code"

Question 12 of 20
Which of the following is one of the basic approaches for joining tables? 0.0/ 5.0 Points

A. Subqueries

B. Union Join

C. Natural join

D. All of the mentioned options

Question 13 of 20
A CASE SQL statement is which of the following? 5.0/ 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.

Question 14 of 20
The LIKE SQL keyword is used along with? 5.0/ 5.0 Points

A. ORDER BY clause.

B. GROUP BY clause.

C. JOIN clause.

D. WHERE clause.

Question 15 of 20
0.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/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 5/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

A. 2

B. 4

C. 3

D. 5

Question 16 of 20
What type of join is needed when you wish to include rows when there is a match between the 0.0/ 5.0 Points
tables?

A. Cross-join

B. Inner join

C. Outer join

D. All of the above

Question 17 of 20
The IN SQL keyword? 5.0/ 5.0 Points

A. Is used with the DISTINCT SQL keyword only.

B. Defines the tables we are selecting or deleting data from.

C. Is used with the INSERT SQL keyword only.

D. Determines if a value matches any of the values in a list or a sub-query.

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

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 6/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

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

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

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 1000 rows in the Customer table

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

Question 20 of 20
Which of the following relational algebra operations do not require the participating tables to be 5.0/ 5.0 Points
union-compatible?

A. Union

B. Intersection

C. Join

D. Difference

Gateway
Accessibility Information
The Sakai Project

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 7/8
5/18/2021 campuslink.admin : HCM21_CPL_JAVA_06 : Tests & Quizzes

Powered by Sakai
Copyright 2017 FPT-Software

https://gst.fsoft.com.vn/portal/site/8765e36a-c531-4400-8e1d-cb85613aa518/tool/c67c1a6a-d5b0-4f7c-8d52-54689544a5ff/jsf/index/mainIndex 8/8

You might also like