NEW
Font size
WorksheetsSQL Query Assignment
Total questions: 10
Worksheet time: 5mins
Which SQL statement will return the minimum and maximum prices from a "Products" table?
SELECT MIN(Price), MAX(Price) FROM Products;
SELECT Price FROM Products WHERE Price = MIN() AND MAX();
SELECT MINIMUM(Price), MAXIMUM(Price) FROM Products;
SELECT MINIMUM(Price), MAXIMUM(Price) FROM Products;
How can you retrieve the first 10 records from a table called "Customers"?
SELECT TOP 10 * FROM Customers;
SELECT * FROM Customers LIMIT 10;
SELECT * FROM Customers WHERE ROWNUM <= 10;
SELECT FIRST 10 * FROM Customers;
Which SQL query will select all records from the "Employees" table where the "Salary" column is not NULL?
SELECT * FROM Employees WHERE Salary IS NOT NULL;
SELECT * FROM Employees WHERE Salary NOT NULL;
SELECT * FROM Employees WHERE Salary != NULL;
SELECT * FROM Employees WHERE Salary IS NOT EMPTY;
Which SQL query will select all records from the "Orders" table where the "ShippedDate" column is NULL?
SELECT * FROM Orders WHERE ShippedDate NULL;
SELECT * FROM Orders WHERE ShippedDate IS NULL;
SELECT * FROM Orders WHERE ShippedDate = NULL;
SELECT * FROM Orders WHERE ShippedDate IS EMPTY;
Which SQL statement will insert a new record into the "Customers" table?
INSERT INTO Customers VALUES ('John Doe', '123 Main St', 'Anytown');
ADD INTO Customers ('John Doe', '123 Main St', 'Anytown');
INSERT INTO Customers (Name, Address, City) VALUES ('John Doe', '123 Main St', 'Anytown');
INSERT Customers ('John Doe', '123 Main St', 'Anytown');
Which SQL statement will select all records from the "Employees" table, sorted by the "LastName" column in descending order?
SELECT * FROM Employees ORDER BY LastName;
SELECT * FROM Employees ORDER BY LastName DESC;
SELECT * FROM Employees SORT BY LastName DESC;
SELECT * FROM Employees ORDER LastName DESC;
Which SQL query will select records from the "Products" table where the "Price" is greater than 20 AND the "Category" is not 'Electronics' OR the "Stock" is more than 50?
SELECT * FROM Products WHERE Price > 20 AND Category != 'Electronics' OR Stock > 50;
SELECT * FROM Products WHERE Price > 20 OR Category != 'Electronics' AND Stock > 50;
SELECT * FROM Products WHERE (Price > 20 AND Category != 'Electronics') OR Stock > 50;
SELECT * FROM Products WHERE Price > 20 AND (Category != 'Electronics' OR Stock > 50);
Which SQL query will select all records from the "Customers" table where "Country" is 'USA' AND "City" is NOT 'New York'?
SELECT * FROM Customers WHERE Country = 'USA' AND City != 'New York';
SELECT * FROM Customers WHERE Country = 'USA' AND NOT City = 'New York';
SELECT * FROM Customers WHERE Country = 'USA' OR NOT City = 'New York';
SELECT * FROM Customers WHERE Country = 'USA' AND City IS NOT 'New York';
Which SQL statement will select all records from the "Orders" table where the "OrderDate" is '2023-01-01'?
SELECT * FROM Orders WHERE OrderDate = '2023-01-01';
SELECT * FROM Orders WHERE OrderDate IS '2023-01-01';
SELECT * FROM Orders WHERE OrderDate == '2023-01-01';
SELECT * FROM Orders WHERE OrderDate EQUALS '2023-01-01';
Which SQL query will select only the unique values from the "City" column in the "Customers" table?
SELECT DIFFERENT City FROM Customers;
SELECT DISTINCT City FROM Customers;
SELECT UNIQUE City FROM Customers;
SELECT ALL DISTINCT City FROM Customers;
