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

LabAssignment_2_Questions

Uploaded by

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

LabAssignment_2_Questions

Uploaded by

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

1. Show the structure of the S_DEPT table.

Select all information from the S_DEPT


table, S_CUSTOMER table (hint DESCRIBE s_customer,...)
2. Display the name and phone number for each customer
3. Display the phone number and name for each customer, with phone number appearing
first.
4. Display the user name for employee 23
5. Display the first name, last name, and department number of the employees in
departments 10 and 50 in alphabetical order of last name. Merge the first name and
last name together, and title the column Employees.
6. Display all employees whose last names contain an �s�.
7. Display the user names and start date of employees hired between May 5,
1990 and May 26, 1991. Order the query results by start date ascending order.
8. Write a query to show the last name and salary of all employees who are not
making between 1000 and 2500 per month
9. List the last name and salary of employees who earn more than 1350 who are in
department 31, 42, or 50. Label the last name column Employee Name, and label the
salary column Monthly Salary.
10. Display the last name and start date of every employee who was hired in 1991
11. Display the full name of all employees with no manager
12. Alphabetically display all products having a name beginning with Pro
13. Display all product names and short descriptions for all descriptions
containing the word bicycle
14. Display all short descriptions. Compare the results from above question. Did
your response in above question return all descriptions containing �bicycle�?
15. Display the employee number, last name, and salary increased by 15% and
expressed as a whole number
16. Display the employee last name and title in parentheses for all employees. The
report should look like the output below : Jonh Herry (Director)
17. Display each employee�s last name, hire date, and salary review date, which is
the first Monday after six months of service. Format the dates to appear in the
format similar to Eighth of May 1992
18. Display the product name for products that have �ski� in the name
19. For each employee, calculate the number of months between today and the date
the employee was hired. Order your result by the number of months employed.
20. Display the last name for all employees and the day of the week they started
21. Write a query that produces the following for each employee:
<employee name> earns <salary> monthly but wants<3 times salary>.
For example: ALLEN earns $1,100 monthly but wants $3,300.
22. Write a report containing each employee�s last name, department number, and
name of their department.
23. Write a query to display the last name, department name, and region name of all
employees who earn a commission.
24. Display the employee name and department name for Smith
25. Display the product name, product number, and quantity ordered of all items in
order number 101. Label the quantity column ORDERED.
26. Display the customer number and the last name of their sales
representative.Order the list by last name.
27. Display the customer number, customer name, and order number of all customers
and their orders. Display the customer number and name, even if they have not
placed an order
28. Display all employees by last name name and employee number along with their
manager�s last name and manager number
29. Display all employees who has no manager
30. isplay all customers and the product number and quantities they ordered for
those customers whose order totaled more than 100,000
31. Display the highest and lowest order totals in the S_ORD. Label the columns
Highest and Lowest, respectively.
32. Write a query to display the minimum and maximum salary for each job type
ordered alphabetically
33. Determine the number of managers without listing them
34. Display the number of line items in each order under each order number, labeled
number of Items
35. Display the manager number and the salary of the lowest paid employee for that
manager. Exclude any groups where the minimum salary is less than 1000. Sort the
output by salary
36. Display the product number and number of times it was ordered, labeled Times
Ordered. Only show those products that have been ordered at least three times.
Order the data by the number of products ordered.
37. Retrieve the region number, region name, and the number of departments within
each region.
38. Display the order number and total item count for each order of 100 or more
items. For example, if order number 99 contains quantity 30 of one item, and
quantity 75 of another item, then the total item count for that order is 105.
39. Display the customer name and the number of orders for each customer.
40. Display the first name, last name, and start date for all employees in the same
department as Magee
41. Display the employee number, first name, last name, and user name for all
employees with salaries above the average salary.
42. Display the name and short description for any product that did not appear on
an
order in the month of September, 1992.
43. Display each sales representative�s last name in region 1 and region 2, their
customers� names and each customer�s total sales orders. Round the number of months
up to the closest whole number

You might also like