MYSQL Workbench question
Using a function, display the customer who has the highest credit limit.
. Display the customer number, customer name and credit limit.
I need my answer checked over for the question.
#Show me a list of customers who have the highest credit limit
use premier_products;
select count(*) customer_num, customer_name, credit_limit
from customers
Where credit_limit=
(Select AVG (credit_limit)
from customers)

See Answers (1)

Accepted Answer

A function that displays the customer who has the highest credit limit is given below:The nested query to display the customer names and credit limit with a lower credit limit than the customer in SunnyvaleSELECT Name,CREDITLIMIT FROM  CUSTOMERS WHERE CREDITLIMIT < (SELECT CREDITLIMIT FROM CUSTOMERS                     WHERE CITY = 'Sunnyvale')ORDER BY CREDITLIMIT For Multiple CustomersSELECT Name,CREDITLIMIT FROM  CUSTOMERS WHERE CREDITLIMIT < (SELECT MAX(CREDITLIMIT) FROM CUSTOMERS                     WHERE CITY = 'Sunnyvale')ORDER BY CREDITLIMIT Read more about SQL here:https://brainly.com/question/27851066#SPJ1

Related Question in Computers and Technology