Professional Documents
Culture Documents
Example Query
Example Query
2. Show me the birth dates and hire dates for all employees who were born before '1960-01-01'.
3. Provide me a list of all employees who live in the USA, have a salary greater than $50,000, and were
born before January 1st, 1970.
4. Show me the employee IDs and hire dates of all employees who were hired after Nancy
5. Select all columns where the order date is not equal to '1996-07-04'.
6. Select all columns products table where the price is greater than 100 and the category is not
'Beverages'.
7. Select the first name, last name, and title columns where the hire date is not in ('1992-08-14', '1994-05-
01').
8. Select all columns from the orders table where the required date is between '1996-08-01' and '1996-08-
31' and the ship country is not 'USA'.
10. Provide me a list of all employees who were hired after '1996-01-01'.
11. Give me the first and last names of all employees who do not have a title.
12. Provide me a list of all employees who live in the USA and have a last name that begins with 'S'.
13. Show me the employee IDs and salaries of all employees who earn between $40,000 and $60,000 per
year and have a hire date before January 1st, 1995.
14. Provide me a list of all employees who have a last name starting with 'S' and whose birth year is
between 1950 and 1960.
select* from "alanparadise/nw"."employees"
where(birthdate >='1950-1-1' and birthdate <='1960-1-1' )and lastname like 'F%'
15. Show me the employee IDs and titles of all employees who have a title that contains the word
"Manager" and were hired after January 1st, 1990.
16. Provide me a list of all employees who live in the USA, have a salary greater than $50,000, and were
born before January 1st, 1970.
17. Show me the employee IDs and hire dates of all employ who were hired after Nancy Davolio but
before Andrew Fuller.
18. Show me the employee IDs and salaries of all who earn between $40,000 and $60,000 per year and
were born between January 1st, 1950 and December 31st, 1960, and are not currently managers.
19. Provide me a list of all employees who have a first name that contains the letter 'e' and a last name that
contains the letter 'o', and were hired after January 1st, 1995.
20. Show me the employee IDs and birth dates of all employees who were born in the same year as their
hire date.
21. Provide me a list of all employees who live in the USA or the UK, have a salary greater than $50,000,
and have been with the company for more than 10 years.
22. Show me the employee IDs and salaries of all employees who have a salary that is a multiple of 1000
and were hired before January 1st, 1995.
23. Provide me a list of all employees whose salary is greater than $50,000 and work in either the Sales or
Marketing department, and were hired between January 1st, 2019, and December 31st, 2021.
24. Provide me a list of all employees who either live in California, USA or British Columbia or Alberta,
Canada.
25. Provide me a list of all employees whose hire date plus five years is greater than the current date and
whose annual salary is less than $70,000.
26. This command selects employees whose job title contains the word "manager", their salary is between
$60,000 and $80,000, and they do not work in either the IT or HR department.
27. This command selects employees whose first name is John, Jane, or Peter, and their last name ends
with "son" or "er".
2. What products have a name that starts with the letter 'A' and ends with exactly 4 characters,
including a letter 'C' as the third character?
3. Who are the customers with a phone number that starts with the area code '415' and ends with
exactly 4 digits?
4. What orders have a shipping address that contains the word 'Street' followed by a space and
then exactly 3 characters?
Select all employees from the USA and order them by first name in ascending order:
Select all employees with the title "Manager" and order them by birthdate in descending order:
Select all employees hired between January 1st, 2000 and December 31st, 2010, and order them by hire date in
ascending order:
Select all employees from the city "Seattle" and order them by home phone number in ascending order:
Show a list of all employees' first and last names along with their ages (as of the current date).
Create a new column in the orders table called total_price that multiplies the unitprice and quantity columns.