0% found this document useful (0 votes)
8 views

Question Based On Usecase SQL Script

Uploaded by

suresh p
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Question Based On Usecase SQL Script

Uploaded by

suresh p
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Question based on usecase SQL script

Write a query to retrieve all customers whose first_name starts with 'J' and
last_name contains the letter 'o'

Write a query to retrieve all orders where the total_amount is greater than
200, but not between 250 and 350

Write a query to fetch all products that are in the category 'Electronics'
and have unit_price either less than 300 or more than 500

Write a query to find all employees whose salary is either greater than
70,000 or who were hired before '2018-01-01'

Write a query to retrieve all order_items where the quantity is exactly 2,


and the unit_price is more than 50 but less than 100

Write a query to find all customers who live in either 'New York' or 'Los
Angeles' and are active customers

Write a query to retrieve all orders placed in January 2024 where the
order_status is either 'Shipped' or 'Pending'

Write a query to fetch all employees who work in the 'IT' department and
have a job_title that includes the word 'Engineer'

Write a query to retrieve all products that have units_in_stock less than
100 and are not in the 'Accessories' category

Write a query to find all orders placed by customers living in 'USA' and
where the total_amount is greater than 300
Retrieve all customers who either live in cities starting with 'N' or whose
email domain is 'gmail.com' and were born after the year 1990.

Write a query to find all orders where the total_amount is above the
average order amount for orders placed in 2023, but the order_status is
not 'Completed'.

Fetch all products that either belong to the 'Electronics' category with
unit_price between 200 and 500, or belong to the 'Accessories' category
with units_in_stock less than 50.

Find all employees whose salary is within 10% of the average salary of
their department but have not been hired in the last 3 years.

Write a query to find all products that have been ordered by customers
from 'USA' at least three times but have more than 20 units in stock.

Retrieve all employees who work in the 'IT' department, earn more than
the department's average salary, and have been hired within the last 5
years.

You might also like