52.7k views
3 votes
Using a subquery, list customers who have the same credit limit as customer number 725. let mysql do the work for you. to receive credit for this question, do not explicitly query for rep number 35. display the customer number, customer name, credit limit, and rep number. insert your snip of the query and resultset together here.

User Seryh
by
7.3k points

1 Answer

6 votes

Final answer:

A subquery can be used in a SQL command to list customers who have the same credit limit as customer number 725, selecting columns customer number, customer name, credit limit, and rep number without directly querying for a specific representative.

Step-by-step explanation:

To list customers who have the same credit limit as customer number 725 using a subquery, you can perform a SELECT statement where the credit limit of other customers is compared to the credit limit of customer 725. Here is an example of how this query can be structured in MySQL:

SELECT customerNumber, customerName, creditLimit, salesRepEmployeeNumber
FROM customers
WHERE creditLimit = (
SELECT creditLimit
FROM customers
WHERE customerNumber = 725
);

This query selects the customer number, customer name, credit limit, and sales representative number (rep number) for all customers that have the same credit limit as the customer with customer number 725. The subquery is used to find the credit limit of customer 725, and this value is then used to filter the main query.

User Paul Stengel
by
8.0k points