NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Lab Sheet 7

Ques1. Consider a table

a) List the number of customers in each country. Only include countries with more than 10 customers.
b) List the number of customers in each country, except the USA, sorted high to low.
Only include countries with 9 or more customers.

Ques 2. Consider below two relations –
Employees (Id, Name, Department, Salary)
Order_Details(OrderId, Department, Sales)
a) List the departments with total sales greater than $1000.
b) List the departments with more than 10 employees whose salary > $25000 per year.
c) List those departments where the minimum salary is greater than $35,000.
d) List those departments whose maximum salary is less than $50,000.

Ques3. Consider below tables –
Customer(Customer_id, Customer_name, City, Grade, Salesman_id)
Salesman(Salesman_id, Name, City, Commission)
Orders(Ord_no, purch_amt, ord_date, customer_id, salesman_id)
a) Write a query to find those customers with their name and those salesmen with their name and city who lives in the same city.
b) Write a SQL statement to find the names of all customers along with the salesmen who works for them.
c) Write a SQL statement to display all those orders by the customers not located in the same cities where their salesmen live.
d) Write a SQL statement that finds out each order number followed by the name of the customers who made the order.
e) Write a SQL statement that sorts out the customer and their grade who made an order. Each of the customers must have a grade and served by at least a salesman, who belongs to a city.
f) Write a query that produces all customers with their name, city, salesman and commission, who served by a salesman and the salesman works at a rate of the commission within 12% to 14%.
g) Write a SQL statement that produces all orders with the order number, customer name, commission rate and earned commission amount for those customers who carry their grade more than 200 and served by an existing salesman.

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.