Knowee
Questions
Features
Study Tools

Question 13 Question 13 of 13 5 pointsSave Answ Acme Realty employs a number of sales representatives, each of whom managesone or more of Acme's customers. Their database has the following tables. SalesRep (repIdrepName)Customer (custId, custName, salesRep, priority) Each row of the SalesRep table gives the unique id and the name of one ofAcme's sales representatives. Each row of the table Customer stores information about one customer, including a unique customer id, and the name of thecustomer. The third column, salesRep, contains the id of the sales representative who deals with that customer. The final column priority indicates thepriority of the customer, taking one of the values low or high, depending onhow valuable the customer is to Acme. You may assume that every sales rephas at least one customer, and that the priority is never NULLWhat does the following query return? SELECT S.repName FROM SalesRep SWHERE NOT EXISTS (SELECT * FROM Customer CWHERE C.salesRep = S.repIdAND C.priority = 'high'); The names of the reps with customers of only one priority The names of the reps who only have high-priority customer The names of the reps with at least one high-priority custome O The names of the reps who only have low-priority customers The names of the reps with at least one low-priority custome

Question

Question 13 Question 13 of 13 5 pointsSave Answ Acme Realty employs a number of sales representatives, each of whom managesone or more of Acme's customers. Their database has the following tables. SalesRep (repIdrepName)Customer (custId, custName, salesRep, priority) Each row of the SalesRep table gives the unique id and the name of one ofAcme's sales representatives. Each row of the table Customer stores information about one customer, including a unique customer id, and the name of thecustomer. The third column, salesRep, contains the id of the sales representative who deals with that customer. The final column priority indicates thepriority of the customer, taking one of the values low or high, depending onhow valuable the customer is to Acme. You may assume that every sales rephas at least one customer, and that the priority is never NULLWhat does the following query return? SELECT S.repName FROM SalesRep SWHERE NOT EXISTS (SELECT * FROM Customer CWHERE C.salesRep = S.repIdAND C.priority = 'high'); The names of the reps with customers of only one priority The names of the reps who only have high-priority customer The names of the reps with at least one high-priority custome O The names of the reps who only have low-priority customers The names of the reps with at least one low-priority custome

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

Solution 1

The query returns the names of the sales representatives who only have low-priority customers. This is because the query is looking for sales representatives for whom there does not exist a customer with a high priority. Therefore, if a sales representative is returned by this query, it means that all of their customers must be of low priority.

Solution 2

The correct answer is: The names of the reps who only have low-priority customers.

This SQL query is looking for sales representatives (from the SalesRep table) for whom there does not exist a customer (in the Customer table) that is both managed by them (C.salesRep = S.repId) and has a high priority (C.priority = 'high'). In other words, it's looking for sales representatives who do not manage any high-priority customers. Therefore, these sales representatives only have low-priority customers.

This problem has been solved

Similar Questions

In a table for customers, the information about a single customer resides in a single:Question 6Answera.tableb.rowc.fieldd.column

Problem StatementYou are tasked with managing sales data for a company. The data includes information about salesmen, customers, and orders. Write a query to find the name and numbers of all salesmen who had more than one customer.The following table is already created, and the records are inserted into the table.The Sample records are given below Input format :The input records are already prepopulated, as given in the problem statement.Output format :The output should include the Salesman_id, Salesman_Name, and Customer_Count for all salesmen who had more than one customer as shown below.Salesman_id Salesman_Name Customer_Count5 Chris Wilson 2Refer to the sample output for the column headers.

Question 8Which query will select all columns from the customer table and alias the table to cust?1 pointSELECT *FROM customer AS custSELECT *FROM customer TO custSELECT *FROM customer NEW custSELECT *FROM customer ALIAS cust

You are tasked with managing sales data for a company. The data includes information about salesmen, customers, and orders. Write a query to find the name and numbers of all salesmen who had more than one customer.The following table is already created, and the records are inserted into the table.The Sample records are given below Input format :The input records are already prepopulated, as given in the problem statement.Output format :The output should include the Salesman_id, Salesman_Name, and Customer_Count for all salesmen who had more than one customer as shown below.Salesman_id Salesman_Name Customer_Count5 Chris Wilson 2Refer to the sample output for the column headers.

Question 1Which of these is a database query language?1 pointJuliaPythonSQL

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.