Write a query that returns the alphabetized first letter of the customer's last name and the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a query that returns the alphabetized first letter of the customer's last name and the count of active and inactive customers. Limit the results to only those first letters that occur in the last_name colum of the customer table. Label the columns as follows: • starts with is the first column and the first letter of the customer's last_name. active_count is the second column and the count of active customers (as defined in the textbook examples of Chapter 11). • inactive_count is the third column and the count of inactive customers (as defined in the textbook examples of Chapter 11). The output should look like the following: . starts with active_count | inactive_count | A 1 B IC D IE F IG I 1 J K L IM IN 10 IP 10 R S T IV W Y I 1 1 1 I 1 I 23 rows in set (0.00 sec) 18 1 55 1 49 1 17 | 11 I 25 1 42 1 49 1 3 13 1 13 I 21 | 57 1 10 I 10 | 28 1 31 38 1 54 1 201 71 37 | 3 | 21 01 31 21 01 11 01 01 11 01 1 | 21 11 01 01 01 21 01 01 11 Write a query that returns the alphabetized first letter of the customer's last name and the count of active and inactive customers. Limit the results to only those first letters that occur in the last_name colum of the customer table. Label the columns as follows: • starts with is the first column and the first letter of the customer's last_name. active_count is the second column and the count of active customers (as defined in the textbook examples of Chapter 11). • inactive_count is the third column and the count of inactive customers (as defined in the textbook examples of Chapter 11). The output should look like the following: . starts with active_count | inactive_count | A 1 B IC D IE F IG I 1 J K L IM IN 10 IP 10 R S T IV W Y I 1 1 1 I 1 I 23 rows in set (0.00 sec) 18 1 55 1 49 1 17 | 11 I 25 1 42 1 49 1 3 13 1 13 I 21 | 57 1 10 I 10 | 28 1 31 38 1 54 1 201 71 37 | 3 | 21 01 31 21 01 11 01 01 11 01 1 | 21 11 01 01 01 21 01 01 11
Expert Answer:
Answer rating: 100% (QA)
It seems youre asking for help with writing a SQL query based on the instructions in the image provi... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
Abby found a roll of fabric. The fabric is 36 inches wide and 23 feet 3 inches long. He needs to cut four 1-yard-wide sections from this roll. The length of those sections are 5 2/3 ft., 4 7/8 ft., 5...
-
On July 12 of this year, Lucas transferred $250,000 of FFP stock to a new trust. He gave the trustee directions to pay income to Dina for the next 20 years and then remit the remainder to Dina's son...
-
Write a query that returns the alphabetized first letter of the customer's last name and the count of active and inactive customers for only those letters where the count of active customers is...
-
Suppose we have an automatic module on the module path named lizard-^-cricket-^-1.0.0-SNAPSHOT.jar and no Automatic-Module-Name specified. What module name should named modules use to reference it?...
-
When a wire carries an AC current with a known frequency, you can use a Rogowski coil to determine the amplitude I max of the current without disconnecting the wire to shunt the current in a meter....
-
Assuming Raoult's law to apply to the system n-pentane (1) In-hcptand(2), (a) What arc the values of x1 and y1 at t = 55C und P = 1/2 (P1sat + P2sat)? For these conditions plot the fraction of system...
-
Sheds Ahead Ltd produces outdoor sheds for domestic use. The manager in charge of production has been asked to prepare a production budget, a direct materials budget and a direct labour budget for...
-
Record the following transactions on the books of Keyser Co. (a) On July 1,Keyser Co. sold merchandise on account to Maxfield Inc. for $15,200, terms 2/10, n/30. (b) On July 8, Maxfield Inc. returned...
-
Regarding the Introduction to Epidemiology it talks about Descriptive and Analytic epidemiology. With descriptive you would look at When, Where, and who in the population was affected With analytic...
-
The Philbrick Company has two plants on opposite sides of the United States. Each of these plants produces the same two products and then sells them to wholesalers within its half of the country. The...
-
1) (a) Determine if the following statements are true or false. If true give a reason or cite a theorem and if false, give a counterexample i) If {a} is bounded, then it converges. ii) If {a} is not...
-
https://youtu.be/uEAa3b64QIo Describe the various decisions that Elon Musk faced. Describe how concepts can help managers make decisions. Explain how you would have made the decision if you were in...
-
The volume or chargeable weight can be determined by usingseveral factors, depending on whether the measurements are inmetric, pounds, or a combination. Also, whenever you have afraction of a pound...
-
Suppose a firm is considering the following project: to undertake the project, the firm will need to make a one-time investment of $130,000 in year 0. This specialized equipment can be depreciated...
-
Calculate the value of electric field (E) for a surface, if the coefficient of surface charge density is 16 x10-22 N/Cm.
-
Carlos Cavalas, the manager of Echo Products' Brazilian Division, is setting the production schedule for the last quarter of the year. The Brazilian Division planned to sell 68,090 units during the...
-
1. In the fictional land of Westeros, House Lannister vies with rival Houses for control of the throne. War breaks out. To finance its war operations, House Lannister borrows 900,000 gold pieces from...
-
1. What is the semi-annually compounded interest rate if $200 accumulates to $318.77 in eight years? Answer in percentage with two decimal places. 2. What is the quarterly compounded interest rate if...
-
The items in a list box belong to which collection? a. Items b. List c. ListItems d. Values
-
Open the Validate Number Solution.sln file contained in the VB2017\Chap07\Validate Number Solution folder. The interface provides a text box for entering a 9-digit number. The btnValidate_Click...
-
The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following If clauses determines whether the intSub variable contains a valid...
-
What are the four main consumer rights?
-
Identify the four levels of a company's ethical environment.
-
What is meant by social responsibility, and why do companies exercise it?
Study smarter with the SolutionInn App