Q61
Q61 Correct the syntax error in
"UPDATE Products SET Price = Price * 1.1 WHERE Price < 100 OR Price > 200;"
* 1.1
WHERE
OR
No syntax error
Q62
Q62 What is incorrect in
"SELECT EmployeeID, Salary FROM Employees WHERE Salary BETWEEN 30000 AND 50000;"?
SELECT
EmployeeID, Salary
BETWEEN
All Correct
Q63
Q63 In "SELECT Name FROM Employees WHERE NOT (Age < 30 AND Department = 'Sales');",
identify the error.
NOT operator
< 30
AND
No error
Q64
Q64 Identify the mistake in
"SELECT * FROM Employees WHERE Department = 'HR' XOR Department = 'Finance';"
XOR operator
= 'HR'
= 'Finance'
No mistake, the statement is correct
Q65
Q65 What needs to be changed in
"UPDATE Employees SET Salary *= 2 WHERE YearsOfExperience > 5;"?
*= 2
WHERE
YearsOfExperience > 5
All Correct
Q66
Q66 What does the WHERE clause do in an SQL query?
Sorts the result set
Filters rows before grouping
Joins tables
Filters rows after grouping
Q67
Q67 What is the purpose of the ORDER BY clause in SQL?
Filters rows
Sorts the result set
Groups rows
Joins tables
Q68
Q68 In SQL, how does the GROUP BY clause function when combined with an aggregate function like SUM or COUNT?
It calculates the aggregate for the entire table
It groups rows based on unique values in a column and calculates the aggregate for each group
It filters the rows before aggregation
It sorts the result set
Q69
Q69 What is the main difference between WHERE and HAVING clauses in SQL?
WHERE filters rows before grouping, HAVING filters rows after grouping
HAVING filters rows before grouping, WHERE filters rows after grouping
No difference
WHERE is used with aggregate functions, HAVING is not
Q70
Q70 In an SQL query, what role does HAVING play without a GROUP BY clause?
It functions as a WHERE clause
It has no effect
It causes an error
It filters aggregated results
Q71
Q71 How does the ORDER BY clause treat NULL values by default?
It places them at the beginning of the result set
It places them at the end of the result set
It ignores them
It causes an error
Q72
Q72 What happens if you use a column in the SELECT statement that is not in the GROUP BY clause?
The query fails
The query succeeds, and the column shows arbitrary values
The query is automatically corrected
The column is ignored
Q73
Q73 Can the ORDER BY clause use column aliases defined in the SELECT statement?
Yes
No
Only if they are numerical
Only in subqueries
Q74
Q74 What is the effect of combining GROUP BY with ORDER BY in an SQL query?
GROUP BY overrides ORDER BY
ORDER BY overrides GROUP BY
They can be used together for organized grouping and sorting
They cannot be used together in the same query
Q75
Q75 In SQL, can the HAVING clause be used without an aggregate function?
Yes, it acts like a WHERE clause
No, it must be used with an aggregate function
Yes, but it has no effect
No, it causes an error
Q76
Q76 What is incorrect in
"SELECT Name FROM Employees WHERE Department = 'Sales' ORDER BY Age;"?
SELECT Name
WHERE Department = 'Sales'
ORDER BY Age
All Correct
Q77
Q77 Identify the error in
"SELECT Department, COUNT(*) FROM Employees GROUP BY Salary;"
SELECT Department
COUNT(*)
GROUP BY Salary
No error
Q78
Q78 What needs to be corrected in
"SELECT AVG(Salary) AS AverageSalary FROM Employees HAVING AverageSalary > 50000;"?
SELECT AVG(Salary)
AS AverageSalary
FROM Employees
HAVING AverageSalary > 50000
Q79
Q79 Correct the syntax error in
"SELECT Name, Department, COUNT(*) FROM Employees WHERE Department = 'Sales' GROUP BY Department;"
SELECT Name
Department
COUNT(*)
WHERE Department = 'Sales'
Q80
Q80 In "SELECT Department, SUM(Salary) FROM Employees GROUP BY Department HAVING COUNT(*) > 5;",
identify the error.
SELECT Department
SUM(Salary)
GROUP BY Department
No Error
Q81
Q81 What is incorrect in
"SELECT * FROM Employees ORDER BY 3;"?
SELECT *
FROM Employees
ORDER BY 3
All Correct
Q82
Q82 Identify the mistake in
"SELECT Department, MAX(Salary) FROM Employees WHERE MAX(Salary) > 50000 GROUP BY Department;"
SELECT Department
MAX(Salary)
WHERE MAX(Salary) > 50000
GROUP BY Department
Q83
Q83 In "SELECT Department, COUNT(EmployeeID) FROM Employees GROUP BY Department HAVING COUNT(EmployeeID) > ALL (SELECT COUNT(EmployeeID) FROM Employees GROUP BY Department);"
what needs correction?
The ALL operator
COUNT(EmployeeID)
No error
The subquery
Q84
Q84 Correct the error in
"SELECT Name FROM Employees WHERE Department IN (SELECT Department FROM Departments WHERE Location = 'New York') ORDER BY Name GROUP BY Department;"
WHERE Department IN
ORDER BY Name
GROUP BY Department
No error
Q85
Q85 What is wrong in
"SELECT Department, COUNT(*) AS TotalEmployees FROM Employees GROUP BY Department HAVING TotalEmployees > 5 ORDER BY TotalEmployees;"?
SELECT Department
COUNT(*) AS TotalEmployees
HAVING clause misuse
ORDER BY TotalEmployees
Q86
Q86 What is the main difference between UNION and UNION ALL in SQL?
UNION removes duplicates, UNION ALL does not
UNION ALL removes duplicates, UNION does not
No difference
UNION is faster than UNION ALL
Q87
Q87 What needs to be corrected in
"SELECT Name FROM Employees UNION ALL SELECT Name FROM Managers;"?
All Correct
The UNION ALL keyword
The SELECT statement
The table names
Q88
Q88 Identify the error in
"SELECT Name, Department FROM Employees UNION SELECT Name FROM Managers;"
The UNION keyword
The number of columns in SELECT statements
The table names
No error
Q89
Q89 What does an INNER JOIN do in SQL?
Joins rows that satisfy a condition in either table
Joins all rows from both tables
Joins rows with matching values in both tables
Joins rows that do not match in either table
Q90
Q90 What is the main characteristic of a FULL OUTER JOIN?
It combines all records from both tables when there are no matches
It only joins rows with matching values in both tables
It excludes all unmatched rows
It joins rows that satisfy a condition in either table