MySql Task 2
MySql Task 2
Table 1: Products
id INT - - YES
description TEXT - - -
stockQuantity INT - 0 -
Insert a new product into the Products table. The productName is 'Wireless Mouse',
description is 'High-precision wireless mouse', price is 15.99, and stockQuantity is 100. Set
the status to 'active'.
"Insert a product into the Products table with only the productName as 'USB Cable' and
price as 5.99."
"Update the price of the product with id = 1 to 20.99."
"Update the stockQuantity of the product with productName = 'Laptop Stand' to 50."
"Remove all products from the Products table where the status is 'inactive'."
"Retrieve all details of the product with id = 1."
"Find all products where the price is greater than 50."
"Get a list of all products with status set to 'active'."
"Retrieve the productName and price for all products where stockQuantity is greater than
0."
Table 2: Categories
id INT - - YES
categoryName VARCHAR 50 - -
description TEXT - - -
"Insert a new category into the Categories table. The categoryName is 'Electronics',
description is 'Devices and gadgets', and the status is 'active'."
"Insert a category into the Categories table with only the categoryName as 'Furniture'."
"Update the status of the category with id = 1 to 'inactive'."
id INT - - YES
phone VARCHAR 15 - -
"Insert a new supplier into the Suppliers table. The supplierName is 'Tech Supplies Co',
contactEmail is '[email protected]', phone is '1234567890', and the status is
'active'."
"Insert a supplier into the Suppliers table with the supplierName as 'Office Depot' and
contactEmail as '[email protected]'."
"Change the phone number of the supplier with supplierName = 'Tech Supplies Co' to
'0987654321'."
"Remove all suppliers from the Suppliers table where the status is 'inactive'."
Select supplier details by phone number:
"Retrieve all details of the supplier with the phone number '1234567890'."
Select suppliers where the name contains a keyword:
"Find all suppliers where the supplierName contains the word 'Supply'."
Select suppliers that do not have a specific status:
"Get a list of all suppliers where the status is not 'inactive'."
Select suppliers with emails from a specific domain:
"Find all suppliers whose contactEmail ends with '@techsupplies.com'."
Select suppliers based on a list of specific statuses:
"Retrieve all suppliers where the status is either 'active' or 'pending'."
Select suppliers created in the last 60 days:
"Get a list of suppliers who were added to the Suppliers table in the last 60 days."
Select suppliers with a name starting with a specific letter:
"Retrieve all suppliers where the supplierName starts with 'O'."
Select suppliers based on phone pattern:
"Find all suppliers whose phone number starts with '123'."
Table 4: Customers
id INT - - YES
phone VARCHAR 15 - -
"Insert a new customer into the Customers table. The customerName is 'John Doe', email is
'[email protected]', phone is '1234567890', address is '123 Main St, Springfield', and
status is 'active'."
"Insert a customer into the Customers table with customerName as 'Jane Smith' and email
as '[email protected]'."
"Change the phone number of the customer with customerName = 'John Doe' to
'0987654321'."
"Remove all customers from the Customers table where the status is 'inactive'."
Select customer details by phone number:
"Retrieve all details of the customer with the phone number '1234567890'."
Select customers where the name contains a keyword:
"Find all customers where the customerName contains the word 'Smith'."
Select customers that do not have a specific status:
"Get a list of all customers where the status is not 'inactive'."
Select customers with emails from a specific domain:
"Find all customers whose email ends with '@example.com'."
Select customers based on a list of specific statuses:
"Retrieve all customers where the status is either 'active' or 'pending'."
Select customers created in the last 90 days:
"Get a list of customers who were added to the Customers table in the last 90 days."
Select customers with a name starting with a specific letter:
"Retrieve all customers where the customerName starts with 'J'."
Table 5: Orders
id INT - - YES
"Insert a new order into the Orders table. The orderTotal is 150.75 and the status is 'active'."
"Remove all orders from the Orders table where the status is 'inactive'."
Select order details by specific date:
"Retrieve all orders placed on '2023-12-15'."
Select orders with a total greater than a specific amount:
"Find all orders where the orderTotal is greater than 100.00."