Posted by: Namste May 23, 2015
Help from SQL Gurus
Login in to Rate this Post:     0       ?        
I was wondering if any sql guru could help me with the following problem.

There are three tables
There are three tables

Customer (CID, CName, CRanking, CAge)
Product (PID, Pname, PType)
Purchase (CID, PID, date)

1. find all the customer who bought the product with PID=15)
2. find all the customer who have purchased at least one product.
3. find the youngest customer for each ranking level.
4. write a stores procedure that resets the ranking of each person by the number of purchase
[Ranking 0(#purchases<10), Ranking 1( 10<=# purchases<20)] and returns the new rankings.
5. Write a procedure to remove duplicates from a table containing million rows using batching.
Read Full Discussion Thread for this article