Lab 04 DBMS
Lab 04 DBMS
1. From the following schema, write a SQL query to find those employees whose first
name contains the letters R, A, or N. Sort the result-set in ascending order by salary.
Return all fields.
Query:
Output:
2. From the following schema, write a SQL query to find those employees who earn
above 21000 or the fifth character in their phone number is 8.. Sort the result-set in
ascending order by last name. Return full name (first name and last name), hire date,
commission percentage, email, and telephone separated by '-', and salary.
Query:
Output:
3. From the following table, write a SQL query to find those salespersons generated
the largest and smallest orders on each date. Return salesperson ID, name, order no.,
highest on/ lowest on, order date.
QUERY:
OUTPUT:
4. From the following tables, write a SQL query to find those salespersons who have
same cities where customer lives as well as do not have customers in their cities and
indicate it by ‘NO MATCH’. Sort the result set on 2nd column (i.e. name) in
descending order. Return salesperson ID, name, customer name, commission.
QUERY:
OUTPUT: