Q91
Q91 What is a LEFT JOIN in SQL?
A join that retrieves records from the left table only
A join that retrieves records from the right table only
A join that retrieves all records from the left table and matched records from the right table
A join that retrieves matched records from both tables
Q92
Q92 In SQL, what does a SELF JOIN refer to?
Joining a table with a different table
Joining a table with itself using a different alias
Joining a table with a copy of itself
Joining a table with its foreign key
Q93
Q93 What is an EQUI JOIN?
A join using an equality operator
A join using any comparison operator other than equality
A join based on the equidistant principle
A join that always produces an equal number of rows from both tables
Q94
Q94 In a RIGHT JOIN, what happens to the rows from the right table that have no matches in the left table?
They are included in the result set with NULLs in the columns of the left table
They are excluded from the result set
They are included as duplicates
They are replaced with values from the left table
Q95
Q95 How does a NON-EQUI JOIN differ from an EQUI JOIN?
NON-EQUI JOIN uses non-equality operators, EQUI JOIN uses equality operators
NON-EQUI JOIN is faster than EQUI JOIN
NON-EQUI JOIN cannot be used with WHERE clause, EQUI JOIN can
There is no difference
Q96
Q96 What needs to be corrected in
"SELECT * FROM Employees INNER JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID;"?
All Correct
INNER JOIN
ON clause
Table names
Q97
Q97 Identify the error in
"SELECT Employees.Name, Departments.Name FROM Employees LEFT JOIN Departments USING (DepartmentID);"
The LEFT JOIN
USING (DepartmentID)
No error
The SELECT statement
Q98
Q98 Correct the syntax error in
"SELECT * FROM Orders RIGHT OUTER JOIN Customers ON Orders.CustomerID = Customers.ID WHERE Orders.OrderDate = '2023-01-01';"
RIGHT OUTER JOIN
ON clause
WHERE clause
No syntax error
Q99
Q99 What is incorrect in
"SELECT A.Name, B.Name FROM Employees A, Employees B WHERE A.EmployeeID < B.EmployeeID;"?
The SELECT statement
The WHERE clause
No error, it is a SELF JOIN
The table aliases (A, B)
Q100
Q100 In "SELECT * FROM Orders FULL JOIN Customers ON Orders.CustomerID = Customers.ID;",
identify the error.
The FULL JOIN keyword
ON clause
No error
The table names
Q101
Q101 What needs to be changed in
"SELECT * FROM Orders INNER JOIN Customers ON Orders.CustomerID <> Customers.ID;"?
INNER JOIN
<> operator
No change
The ON clause
Q102
Q102 Correct the syntax error in
"SELECT * FROM Employees A LEFT JOIN Departments B ON A.DepartmentID == B.DepartmentID;"
LEFT JOIN
ON clause
No syntax error
== operator
Q103
Q103 Identify the issue in
"SELECT E.Name, D.Name FROM Employees E JOIN Departments D ON E.DepartmentID > D.DepartmentID;"
JOIN keyword
> operator
No error
The ON clause
Q104
Q104 In "SELECT * FROM Employees CROSS JOIN Departments;",
what needs correction?
CROSS JOIN
No error
The SELECT statement
The table names
Q105
Q105 What is wrong in
"SELECT * FROM Employees FULL OUTER JOIN
Departments ON Employees.
DepartmentID = Departments.DepartmentID WHERE Departments.
DepartmentName IS NULL;"?
FULL OUTER JOIN
ON clause
WHERE clause
All Correct
Q106
Q106 What is the purpose of the ROUND function in SQL?
To round a number to the nearest integer
To round a number to a specified number of decimal places
To find the square root of a number
To return the value of PI
Q107
Q107 What does the CEILING function do in SQL?
Returns the smallest integer greater than or equal to a given number
Returns the largest integer less than or equal to a given number
Calculates the square of a number
Calculates the square root of a number
Q108
Q108 In SQL, what is the result of the SQRT function when applied to a negative number?
A positive number
Zero
An error
A negative number
Q109
Q109 What is the purpose of the PI function in SQL?
To return the value of PI
To calculate the perimeter of a circle
To calculate the area of a circle
To return the radius of a circle
Q110
Q110 How does the SQUARE function differ from the POWER function in SQL?
SQUARE calculates the square, POWER calculates any exponent
SQUARE and POWER are the same
SQUARE calculates the square root, POWER calculates the square
SQUARE calculates any exponent, POWER calculates the square
Q111
Q111 What needs to be corrected in
"SELECT ROUND(Salary, 2) FROM Employees;"?
All Correct
ROUND
Salary
2
Q112
Q112 Identify the error in
"SELECT Name, SQRT(Age) FROM Employees WHERE Age >= 0;"
SELECT Name
SQRT
Age >= 0
No error
Q113
Q113 Correct the syntax error in
"SELECT CEILING(Price) AS RoundedPrice FROM Products WHERE Price > 0;"
CEILING
RoundedPrice
FROM Products
No syntax error
Q114
Q114 What is incorrect in
"SELECT Name, PI() * Radius * Radius AS Area FROM Circles;"?
PI()
Radius * Radius
AS Area
All Correct
Q115
Q115 In "SELECT SQUARE(Length) FROM Rectangles;",
what needs correction?
SQUARE
Length
No error
FROM Rectangles
Q116
Q116 What needs to be corrected in
"SELECT CAST(Salary AS INT) FROM Employees;"?
All Correct
CAST
Salary
AS INT
Q117
Q117 Identify the error in
"SELECT CONVERT(VARCHAR, StartDate, 103) FROM Projects WHERE StartDate IS NOT NULL;"
CONVERT function
VARCHAR keyword
StartDate column
No Error
Q118
Q118 Correct the syntax error in
"SELECT Name, TRY_CONVERT(INT, Age) AS IntegerAge FROM Employees WHERE Age IS NOT NULL;"
TRY_CONVERT function
INT keyword
Age column
No Error
Q119
Q119 What does the COALESCE function do in SQL?
Returns the first non-null value in a list
Combines multiple rows into a single string
Duplicates a string
Compares two expressions and returns NULL if they are equal
Q120
Q120 What needs to be corrected in
"SELECT COALESCE(Salary, 0) FROM Employees;"?
All Correct
COALESCE
Salary
0