Results 1 to 4 of 4

Thread: plz help

  1. #1
    Join Date
    Jan 2004
    Posts
    21

    Unanswered: plz help

    Considering the following Database Schema:


    CUSTOMER(Cust_id,Name,Address,City)

    PRODUCT(Product_id,Name,Cost_price,Selling_price,Q uantity_on_hand)

    VENDOR(Vendor_id,Name,Address,City)

    WAREHOUSE(Warehouse_id,Location,Capacity)

    TRANSACTION(Tran_id,Cust_id,date,Cash_or_credit)

    SUPPLY(Vendor_id,Product_id,date,To_warehouse_id)

    TRANSACTION_DETAILS(Tran_id,Product_id,Quantity)



    (Please note that the columns in bold form the primary key of that table)



    i have to answer the following queries using SQL.

    1.1 List the name of the city from where the maximum number of customers are operating. Also list the total number of customers for that city.

    1.2 List the names of all those cities which has more vendors operating than the number of customers.

    1.3 List the id and name of all the customers who has done a transaction of more than Rs. 1 lakh on December 31, 2000 through credit.

    1.4 List the details for all customers and the transactions they made from January 1, 1999 till today. The output should contain Customer id, Transaction id, Date_of_Transaction, Amount of Transaction and whether the transaction was done through cash or credit.

    1.5 List the id and name of those vendors who has never supplied any product and reside in the same city which has maximum number of customers.

    plz help
    Rishabh Agarwal

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, we do not do homework assignments
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2004
    Posts
    21
    thanks a lot sir
    Rishabh Agarwal

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    We are not trying to be mean, answering the questions would be easy. But if we answer it, you will not have learned the material and you will have problems in your course down the road. If you can't figure it out, ask your instructor for help. Any teacher worth their salt will be glad to help you out.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •