Q1
True / FalseThe `=` operator can be used to compare two values for equality in SQL queries.
The `=` operator is used in SQL to compare two values for equality. It returns true if the values are equal and false otherwise.
Q2
True / FalseUsing `=` with NULL values in SQL always returns true.
`=` does not work with NULL values as expected. NULL comparisons require `IS NULL` or `IS NOT NULL`. Using `=` with NULL results in unknown.
Q3
True / FalseThe `=` operator can be used in `JOIN` conditions to match rows from two tables.
The `=` operator is commonly used in `JOIN` conditions to match rows based on the equality of columns from different tables.
Q4
True / FalseYou can use the `=` operator to compare string values in SQL.
The `=` operator can compare string values in SQL to check for exact matches.
Q5
True / FalseThe `=` operator can be used with aggregate functions to filter results.
The `=` operator can be used with aggregate functions such as `COUNT()`, `SUM()`, etc., but it is used in the `HAVING` clause rather than `WHERE` for aggregated results.
Q6
True / FalseThe `=` operator in SQL can be used to compare dates and times.
The `=` operator can compare date and time values in SQL to check if they are exactly equal.
Q7
True / FalseThe `=` operator can be used in a `CASE` statement to perform conditional logic.
The `=` operator is used in `CASE` statements to compare values and determine which condition to satisfy.
Q8
True / FalseYou can use the `=` operator to filter results in a `GROUP BY` clause.
The `=` operator is used to filter results before grouping. To filter results after grouping, use `HAVING` with `=`.
Q9
True / FalseThe `=` operator can be used in a subquery to match values with the outer query.
The `=` operator is often used in subqueries to match values from the inner query with those in the outer query.
Q10
True / FalseUsing `=` with integer values can result in performance issues if indexes are not properly used.
Using `=` with integer values generally performs well, but performance issues can arise if indexes are not used effectively.
Q11
True / FalseThe `=` operator can be used to compare decimal values accurately in SQL.
The `=` operator can compare decimal values accurately, though care must be taken with floating-point precision.
Q12
True / FalseIn SQL, `=` can be used to compare values in different data types directly.
`=` cannot directly compare different data types. Implicit conversions may occur, but itβs best to ensure the types are compatible.
Q13
True / FalseThe `=` operator in SQL can be used within a `WHERE` clause to filter rows based on equality.
The `=` operator is commonly used within a `WHERE` clause to filter rows where column values match a specified value.
Q14
True / FalseThe `=` operator can be used to match values in a `JOIN` condition.
The `=` operator is frequently used in `JOIN` conditions to match rows from different tables based on equal column values.
Q15
True / FalseYou can use `=` to compare columns with functions that return boolean values.
`=` can be used to compare columns with the results of functions that return boolean values, such as `CASE` statements.
Q22
Single ChoiceWhich query retrieves products with a discount of 20%?
SQL Code
SELECT ProductID, ProductName, Discount
FROM Products
WHERE Discount = 20;
The `=` operator is used to match the `Discount` column with a value of 20.
Q26
Single ChoiceWhich query retrieves products where the stock is exactly 50?
SQL Code
SELECT ProductID, ProductName, Stock
FROM Products
WHERE Stock = 50;
The `=` operator is used to match the `Stock` column with the value 50.
Q28
Single ChoiceWhich query returns employees hired on '2023-01-01'?
SQL Code
SELECT EmployeeID, EmployeeName, HireDate
FROM Employees
WHERE HireDate = '2023-01-01';
The `=` operator is used to match the `HireDate` column with '2023-01-01'.
Q29
Single ChoiceHow would you find all products where the price is exactly 19.99?
SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 19.99;
The `=` operator is used to match the `Price` column with the value 19.99.
Q31
Multiple ChoiceWhich query retrieves all customers with an address in 'New York'?
SQL Code
SELECT CustomerID, CustomerName, Address
FROM Customers
WHERE Address = 'New York';
The `=` operator is used to match the `Address` column with 'New York'.
Q33
Multiple ChoiceWhich query retrieves products with a price of 50?
SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 50;
The `=` operator is used to match the `Price` column with the value 50.
Q34
Multiple ChoiceHow can you retrieve employees with a salary of 60000?
SQL Code
SELECT EmployeeID, EmployeeName, Salary
FROM Employees
WHERE Salary = 60000;
The `=` operator is used to match the `Salary` column with the value 60000.
Q35
Multiple ChoiceWhich query retrieves products with a stock quantity of 100?
SQL Code
SELECT ProductID, ProductName, Stock
FROM Products
WHERE Stock = 100;
The `=` operator is used to match the `Stock` column with the value 100.
Q36
Multiple ChoiceWhich query retrieves customers where the city is 'Chicago'?
SQL Code
SELECT CustomerID, CustomerName, City
FROM Customers
WHERE City = 'Chicago';
The `=` operator is used to match the `City` column with 'Chicago'.
Q37
Multiple ChoiceHow would you find employees hired on '2023-01-01'?
SQL Code
SELECT EmployeeID, EmployeeName, HireDate
FROM Employees
WHERE HireDate = '2023-01-01';
The `=` operator is used to match the `HireDate` column with '2023-01-01'.
Q39
Multiple ChoiceWhich query retrieves customers with a specific phone number?
SQL Code
SELECT CustomerID, CustomerName, Phone
FROM Customers
WHERE Phone = '123-456-7890';
The `=` operator is used to match the `Phone` column with the specific phone number '123-456-7890'.
Q40
Multiple ChoiceWhich query retrieves products with a discount of 15%?
SQL Code
SELECT ProductID, ProductName, Discount
FROM Products
WHERE Discount = 15;
The `=` operator is used to match the `Discount` column with the value 15.
Q41
Multiple ChoiceWhich query retrieves employees with the role 'Developer'?
SQL Code
SELECT EmployeeID, EmployeeName, Role
FROM Employees
WHERE Role = 'Developer';
The `=` operator is used to match the `Role` column with 'Developer'.
Q42
Multiple ChoiceWhich query retrieves all customers where the email is 'customer@example.com'?
SQL Code
SELECT CustomerID, CustomerName, Email
FROM Customers
WHERE Email = 'customer@example.com';
The `=` operator is used to match the `Email` column with 'customer@example.com'.
Q44
Multiple ChoiceWhich query retrieves products with a price of 25.99?
SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 25.99;
The `=` operator is used to match the `Price` column with the value 25.99.
Q45
Multiple ChoiceHow would you retrieve employees with a department of 'HR'?
SQL Code
SELECT EmployeeID, EmployeeName, Department
FROM Employees
WHERE Department = 'HR';
The `=` operator is used to match the `Department` column with 'HR'.