Knowee
Questions
Features
Study Tools

Using the CUSTOMERS table, you need to generate a report that shown the average credit limit for customers in WASHINGTON and NEW YORK. Which SQL statement would produce the required result?Select one:a.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_city,cust_credit_limit;b.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_city;c.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_credit_limit,cust_city;d.SELECT cust_city,AVG(NVL(cust_credit_limit,0)) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK')

Question

Using the CUSTOMERS table, you need to generate a report that shown the average credit limit for customers in WASHINGTON and NEW YORK. Which SQL statement would produce the required result?Select one:a.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_city,cust_credit_limit;b.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_city;c.SELECT cust_city,AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK') GROUP BY cust_credit_limit,cust_city;d.SELECT cust_city,AVG(NVL(cust_credit_limit,0)) FROM customers WHERE cust_city IN ('WASHINGTON','NEW YORK')

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct answer is:

b. SELECT cust_city, AVG(cust_credit_limit) FROM customers WHERE cust_city IN ('WASHINGTON', 'NEW YORK') GROUP BY cust_city;

This SQL statement will select the city and the average credit limit from the customers table where the city is either Washington or New York. The results will be grouped by city. This will give you the average credit limit for customers in each of these cities.

This problem has been solved

Similar Questions

Which statement would display the highest credit limit available in each income level in each city in the Customers table? Select one:a.SELECT cust_city, cust_income_level,MAX(cust_credit_limit)FROM customersGROUP BY cust_city, cust_income_level;b.SELECT cust_city, cust_income_level,MAX(cust_credit_limit)FROM customersGROUP BY cust_city, cust_income_level,cust_credit_limit;c.SELECT cust_city, cust_income_level,MAX(cust_credit_limit)FROM customersGROUP BY cust_credit_limit , cust_income_level, cust_city ;d.SELECT cust_city, cust_income_level,MAX(cust_credit_limit)FROM customersGROUP BY cust_city , , cust_income_level ,MAX(cust_credit_limit);

SELECT cust_city, COUNT(cust_last_name) FROM customersWHERE cust_credit_limit > 1000 GROUP BY cust_city HAVING AVG(cust_credit_limit) BETWEEN 5000 AND 6000;Which statement is true regarding the outcome of the above query? Select one:a.It executes successfully.b.It returns an error because WHERE and HAVING clauses cannot be used in the same SELECT statement.c.It returns an error because the BETWEEN operator cannot be used in the HAVING clause.d.It returns an error because WHERE and HAVING clauses cannot be used to apply conditions on the same column. e.Date functions

Select the correct answerWhat will be the result of the following query? SELECT customer_id, AVG(total_amount) AS avg_amount FROM Orders GROUP BY customer_id HAVING AVG(total_amount) > 200;OptionsReturns the customer IDs and average order amounts for all customers.Returns the customer IDs and total order amounts for customers with an average order amount greater than 200.Returns an error because the HAVING clause is not allowed in this context.Returns the customer IDs and average order amounts for customers with an average order amount greater than 200.

List all orders, showing order number, customer name and credit limit of a customer.Orders Table:Order_Number, Customer_Number, Product_AmountCustomers Table:Customer_Number, Customer_Name, Credit_LimitWhich of the below query satisfy the above question:A. Select Order_Number, Customer_Name, Credit_Limitfrom Customers left join Orderswhere Customer_Number = Customer_NumberB. Select Order_Number, Customer_Name, Credit_Limitfrom Customers INNER JOIN OrdersON Customers.Customer_Number = Orders.Customer_Number;

Write a query to display the average of payable_amount from the bill table for the buildings with electricity connection slab rate less than 24. Give an alias name for payable amount as 'payable_amount'.Note:1. Display only the average of payable_amount from the bill table for the buildings with electricity connection slab rate less than 24.2. Tables involves are bill, meter, building, building_type, electricity_connection_type and slab.3. Specify the alias name without any mistake.4. Compare your executed result with the sample output given below.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.