Question

In: Computer Science

Create a procedure to find out information about the most premium customer whose number of items...

Create a procedure to find out information about the most premium customer whose number of items sold is the max using mysql server.

-here are some hints In Sale table, find out the highest number of items sold by a seller. Then in customer table, find the customer.

The tables are as follows

Customer (CID, F_name, m_name, l_name, type, street, city, state, zip, password, email)

Item (ITEMNum, name, description, asking_price, notification_price, status, expiration_date, posting_date, condition, type, picture, order_point, qty_onhold, CID)

Bid (ID, price, time, CID, ITEMNum)

Sale (ID, sale_date, win_price, seller_approval, buyer_acceptance, completion_date, ITEMNum, BID, shippingticket)

Solutions

Expert Solution

//This might be the solution of your problem // the basic intuition is first we count item numbers where it is the most we select that item number //with that item number we cid from the item table //with the cid we select customer from customer table the procedure for that is create procedure p1 As Begin declare @num int select top 1 @num=ItemNumber,count(ItemNumber) as num from sale order by num desc select * from customer where cid=(select cid from item where ItemNumber=@num); end


Related Solutions

In Python Create customer information system as follows: Python 3 Create customer information system as follows:...
In Python Create customer information system as follows: Python 3 Create customer information system as follows: Ask the user to enter name, phonenumber, email for each customer. Build a dictionary of dictionaries to hold 10 customers with each customer having a unique customer id. (random number generated) Take the keys of the above mentioned dictionary which are customer ids and make a list. Ask the use to enter a customer id and do a binary search to find if the...
Use TAIR to find out the following information. Perform the gene search for AT3G05330 and number...
Use TAIR to find out the following information. Perform the gene search for AT3G05330 and number of locus matches. What is the name of the gene? Describe its biological function. Give the gene expression atlas. Urgent Thank You I'll upvote!
what is the most important information about scurbber (with out reaction) type packed pad . in...
what is the most important information about scurbber (with out reaction) type packed pad . in point
Out of 10 customers- Customer A purchases the most products from a company but is not...
Out of 10 customers- Customer A purchases the most products from a company but is not the most profitable for the company (Customer B is the most profitable out of the 10 customers), what concerns might you have from an audit perspective?
If a stock with .40 beta has a risk premium of 11%, find out the market's...
If a stock with .40 beta has a risk premium of 11%, find out the market's return assuming zero risk-free rate. a. none of the above b. 27.5% c. 11.4% d. 4.4%
From recent outbreaks (minimum 3), find out how the information about the outbreak and the risk,...
From recent outbreaks (minimum 3), find out how the information about the outbreak and the risk, protection, and other important public health information was disseminated to the public. Include: How long did it take to get out to the public? What media did the public health service and/or WHO use to disseminate? What was the public reaction?
Use the Multiplication Rule to find the number of positive divisors of 20!. Include a procedure...
Use the Multiplication Rule to find the number of positive divisors of 20!. Include a procedure that “builds” such divisors
Create an C# application named ConvertMilesToKilometers whose Main() method prompts a user for a number of...
Create an C# application named ConvertMilesToKilometers whose Main() method prompts a user for a number of miles, passes the value to a method that converts the value to kilometers, and then returns the value to the Main() method where it is displayed.
Think about a healthcare organization/clinic. Create a discipline and termination procedure and then analyze what is...
Think about a healthcare organization/clinic. Create a discipline and termination procedure and then analyze what is missing and how you would modify the procedure to make it more effective.
A trainer wishes to find out if there is a relationship between the number of miles...
A trainer wishes to find out if there is a relationship between the number of miles walked per week and the weight of a person. The data for the sample are shown: Miles Walked, x: 15 20 3 12 17 8 Weight (lbs.), y: 147 106 210 160 122 165 a) Compute the value of the correlation coefficient. b) Find the equation of the regression line. c) Find y’ (the weight) when x = 11. (Someone walks 11 miles).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT