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
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.
ou will create a GUI data entry program to be used to enter Customer Information. This...
ou will create a GUI data entry program to be used to enter Customer Information. This program should be based on the requirements and design you created in previous modules. It will be a GUI, based either on the Java Swing classes or JavaFX. The program will allow for entry of all fields described in your requirements and include appropriate validations for each field. It will be left to you to decide if the validations methods should be part of...
Write a Java program to process the information for a bank customer.  Create a class to manage...
Write a Java program to process the information for a bank customer.  Create a class to manage an account, include the necessary data members and methods as necessary.  Develop a tester class to create an object and test all methods and print the info for 1 customer.  Your program must be able to read a record from keyboard, calculate the bonus and print the details to the monitor.  Bonus is 2% per year of deposit, if the amount is on deposit for 5 years...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT