Microsoft SQL Server Database Quiz Questions

Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:'=' (equal to) Operator
Current Quiz Count:45
Progress
0%
Q1
True / False

The `=` operator can be used to compare two values for equality in SQL queries.

Q2
True / False

Using `=` with NULL values in SQL always returns true.

Q3
True / False

The `=` operator can be used in `JOIN` conditions to match rows from two tables.

Q4
True / False

You can use the `=` operator to compare string values in SQL.

Q5
True / False

The `=` operator can be used with aggregate functions to filter results.

Q6
True / False

The `=` operator in SQL can be used to compare dates and times.

Q7
True / False

The `=` operator can be used in a `CASE` statement to perform conditional logic.

Q8
True / False

You can use the `=` operator to filter results in a `GROUP BY` clause.

Q9
True / False

The `=` operator can be used in a subquery to match values with the outer query.

Q10
True / False

Using `=` with integer values can result in performance issues if indexes are not properly used.

Q11
True / False

The `=` operator can be used to compare decimal values accurately in SQL.

Q12
True / False

In SQL, `=` can be used to compare values in different data types directly.

Q13
True / False

The `=` operator in SQL can be used within a `WHERE` clause to filter rows based on equality.

Q14
True / False

The `=` operator can be used to match values in a `JOIN` condition.

Q15
True / False

You can use `=` to compare columns with functions that return boolean values.

Q16
Single Choice

You can use `=` in a `WHERE` clause to check if a column value equals a constant.

SQL Code
SELECT EmployeeID, EmployeeName
FROM Employees
WHERE Department = 'Sales';
Q17
Single Choice

Which query will find all products where the category is 'Electronics'?

SQL Code
SELECT ProductID, ProductName
FROM Products
WHERE Category = 'Electronics';
Q18
Single Choice

Which query correctly retrieves customers with a specific email address?

SQL Code
SELECT CustomerID, CustomerName
FROM Customers
WHERE Email = 'customer@example.com';
Q19
Single Choice

How would you find orders with a status of 'Completed'?

SQL Code
SELECT OrderID, OrderDate
FROM Orders
WHERE Status = 'Completed';
Q20
Single Choice

Which query returns employees with the role 'Manager'?

SQL Code
SELECT EmployeeID, EmployeeName
FROM Employees
WHERE Role = 'Manager';
Q21
Single Choice

Which query retrieves orders where the payment method is 'Credit Card'?

SQL Code
SELECT OrderID, PaymentMethod
FROM Orders
WHERE PaymentMethod = 'Credit Card';
Q22
Single Choice

Which query retrieves products with a discount of 20%?

SQL Code
SELECT ProductID, ProductName, Discount
FROM Products
WHERE Discount = 20;
Q23
Single Choice

Which query retrieves employees with an employee number of 12345?

SQL Code
SELECT EmployeeID, EmployeeName
FROM Employees
WHERE EmployeeNumber = 12345;
Q24
Single Choice

How can you find all records in a table where a column equals a certain value?

SQL Code
SELECT *
FROM TableName
WHERE ColumnName = 'Value';
Q25
Single Choice

Which query returns all orders placed by a customer with ID 1001?

SQL Code
SELECT OrderID, OrderDate
FROM Orders
WHERE CustomerID = 1001;
Q26
Single Choice

Which query retrieves products where the stock is exactly 50?

SQL Code
SELECT ProductID, ProductName, Stock
FROM Products
WHERE Stock = 50;
Q27
Single Choice

Which query will find all customers with a status of 'Active'?

SQL Code
SELECT CustomerID, CustomerName
FROM Customers
WHERE Status = 'Active';
Q28
Single Choice

Which query returns employees hired on '2023-01-01'?

SQL Code
SELECT EmployeeID, EmployeeName, HireDate
FROM Employees
WHERE HireDate = '2023-01-01';
Q29
Single Choice

How would you find all products where the price is exactly 19.99?

SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 19.99;
Q30
Single Choice

Which query retrieves orders where the total amount is exactly 100?

SQL Code
SELECT OrderID, TotalAmount
FROM Orders
WHERE TotalAmount = 100;
Q31
Multiple Choice

Which query retrieves all customers with an address in 'New York'?

SQL Code
SELECT CustomerID, CustomerName, Address
FROM Customers
WHERE Address = 'New York';
Q32
Multiple Choice

Which query retrieves all orders placed on '2023-07-30'?

SQL Code
SELECT OrderID, OrderDate
FROM Orders
WHERE OrderDate = '2023-07-30';
Q33
Multiple Choice

Which query retrieves products with a price of 50?

SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 50;
Q34
Multiple Choice

How can you retrieve employees with a salary of 60000?

SQL Code
SELECT EmployeeID, EmployeeName, Salary
FROM Employees
WHERE Salary = 60000;
Q35
Multiple Choice

Which query retrieves products with a stock quantity of 100?

SQL Code
SELECT ProductID, ProductName, Stock
FROM Products
WHERE Stock = 100;
Q36
Multiple Choice

Which query retrieves customers where the city is 'Chicago'?

SQL Code
SELECT CustomerID, CustomerName, City
FROM Customers
WHERE City = 'Chicago';
Q37
Multiple Choice

How would you find employees hired on '2023-01-01'?

SQL Code
SELECT EmployeeID, EmployeeName, HireDate
FROM Employees
WHERE HireDate = '2023-01-01';
Q38
Multiple Choice

Which query retrieves orders where the payment method is 'PayPal'?

SQL Code
SELECT OrderID, PaymentMethod
FROM Orders
WHERE PaymentMethod = 'PayPal';
Q39
Multiple Choice

Which query retrieves customers with a specific phone number?

SQL Code
SELECT CustomerID, CustomerName, Phone
FROM Customers
WHERE Phone = '123-456-7890';
Q40
Multiple Choice

Which query retrieves products with a discount of 15%?

SQL Code
SELECT ProductID, ProductName, Discount
FROM Products
WHERE Discount = 15;
Q41
Multiple Choice

Which query retrieves employees with the role 'Developer'?

SQL Code
SELECT EmployeeID, EmployeeName, Role
FROM Employees
WHERE Role = 'Developer';
Q42
Multiple Choice

Which query retrieves all customers where the email is 'customer@example.com'?

SQL Code
SELECT CustomerID, CustomerName, Email
FROM Customers
WHERE Email = 'customer@example.com';
Q43
Multiple Choice

Which query retrieves orders where the total amount is 200?

SQL Code
SELECT OrderID, TotalAmount
FROM Orders
WHERE TotalAmount = 200;
Q44
Multiple Choice

Which query retrieves products with a price of 25.99?

SQL Code
SELECT ProductID, ProductName, Price
FROM Products
WHERE Price = 25.99;
Q45
Multiple Choice

How would you retrieve employees with a department of 'HR'?

SQL Code
SELECT EmployeeID, EmployeeName, Department
FROM Employees
WHERE Department = 'HR';