Q241
Q241 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
Q242
Q242 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
Q243
Q243 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
Q244
Q244 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
Q245
Q245 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
Q246
Q246 What needs to be corrected in "SELECT * FROM Employees INNER JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID;"?
Replace 'INNER JOIN' with 'LEFT JOIN'
Change 'ON' to 'USING'
Remove 'Employees.' prefix from 'DepartmentID'
No error
Q247
Q247 Identify the error in "SELECT Employees.Name, Departments.Name FROM Employees LEFT JOIN Departments USING (DepartmentID);"
Change 'LEFT JOIN' to 'RIGHT JOIN'
Replace 'USING (DepartmentID)' with 'ON Employees.DepartmentID = Departments.DepartmentID'
Add 'AS EmployeeName, AS DepartmentName' for clarity
No error
Q248
Q248 Correct the syntax error in "SELECT * FROM Orders RIGHT OUTER JOIN Customers ON Orders.CustomerID = Customers.ID WHERE Orders.OrderDate = '2023-01-01';"
Change 'RIGHT OUTER JOIN' to 'LEFT OUTER JOIN'
Replace 'WHERE' with 'AND'
Remove 'Orders.' prefix from 'OrderDate'
No error
Q249
Q249 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)
Q250
Q250 In "SELECT * FROM Orders FULL JOIN Customers ON Orders.CustomerID = Customers.ID;", identify the error.
Replace 'FULL JOIN' with 'FULL OUTER JOIN'
Change 'ON' to 'USING'
Add 'WHERE Orders.OrderDate IS NOT NULL'
No error
Q251
Q251 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
Q252
Q252 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
Q253
Q253 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
Q254
Q254 In "SELECT * FROM Employees CROSS JOIN Departments;", what needs correction?
Change 'CROSS JOIN' to 'INNER JOIN'
Add 'ON' clause with condition
Remove 'FROM Employees'
No error
Q255
Q255 What is wrong in "SELECT * FROM Employees FULL OUTER JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID WHERE Departments.DepartmentName IS NULL;"?
Replace 'FULL OUTER JOIN' with 'LEFT JOIN'
Change 'WHERE' to 'AND'
Remove 'WHERE Departments.DepartmentName IS NULL'
No error
Q256
Q256 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
Q257
Q257 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
Q258
Q258 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
Q259
Q259 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
Q260
Q260 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
Q261
Q261 What needs to be corrected in "SELECT ROUND(Salary, 2) FROM Employees;"?
Change 'ROUND' to 'ROUNDDOWN'
Replace '2' with '-2'
Add 'AS RoundedSalary' for clarity
No error
Q262
Q262 Identify the error in "SELECT Name, SQRT(Age) FROM Employees WHERE Age >= 0;"
Change 'SQRT' to 'SQUARE'
Replace 'Age >= 0' with 'Age > 0'
Add 'AS SquareRootAge' for clarity
No error
Q263
Q263 Correct the syntax error in "SELECT CEILING(Price) AS RoundedPrice FROM Products WHERE Price > 0;"
Change 'CEILING' to 'FLOOR'
Replace 'AS RoundedPrice' with 'AS PriceCeiling'
Remove 'WHERE Price > 0'
No error
Q264
Q264 What is incorrect in "SELECT Name, PI() * Radius * Radius AS Area FROM Circles;"?
Replace 'PI()' with '3.14'
Change 'Radius * Radius' to 'Power(Radius, 2)'
Remove 'AS Area'
No error
Q265
Q265 In "SELECT SQUARE(Length) FROM Rectangles;", what needs correction?
Change 'SQUARE' to 'SQRT'
Replace 'Length' with 'Width'
Add 'AS SquareLength' for clarity
No error
Q266
Q266 What needs to be corrected in "SELECT CAST(Salary AS INT) FROM Employees;"?
Change 'INT' to 'INTEGER'
Replace 'CAST' with 'CONVERT'
Add 'AS IntegerSalary' for clarity
No error
Q267
Q267 Identify the error in "SELECT CONVERT(VARCHAR, StartDate, 103) FROM Projects WHERE StartDate IS NOT NULL;"
Change 'VARCHAR' to 'DATE'
Replace '103' with '101'
Remove 'WHERE StartDate IS NOT NULL'
No error
Q268
Q268 Correct the syntax error in "SELECT Name, TRY_CONVERT(INT, Age) AS IntegerAge FROM Employees WHERE Age IS NOT NULL;"
Change 'TRY_CONVERT' to 'CONVERT'
Replace 'INT' with 'INTEGER'
Remove 'WHERE Age IS NOT NULL'
No error
Q269
Q269 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
Q270
Q270 What needs to be corrected in "SELECT COALESCE(Salary, 0) FROM Employees;"?
Change 'COALESCE' to 'NVL'
Replace '0' with '10000'
Add 'AS DefaultSalary' for clarity
No error