Questions
List Customer and Product Without Sale In one list return, all customers who do not have...

List Customer and Product Without Sale

In one list return, all customers who do not have an invoice and all products that were not sold. Use the UNION operator in this query. Return 3 values:
- category - Is this line related to "customer" or "product"? Print "customer" or "product" without quotes.

- id - customer.id (category="customer") or product.id (category="product")

- name - customer.customer_name (category="customer") or product.product_name (category="product")

Table definitions and a data sample are given below.

Schema

Table: customer

column name column type key / NULL
id int PK
customer_name varchar(255)
city_id int FK
customer_address varchar(255)
contact_person varchar(255) N
email varchar(128)
phone varchar(128)

Table: product

column name column type key / NULL
id int PK
sku varchar(32)
product_name varchar(128)
product_description text
current_price decimal(8,2)
quantity_in_stock int

Table: invoice

column name column type key / NULL
id int PK
invoice_number varchar(255)
customer_id int FK
user_account_id int
total_price decimal(8,2)
time_issued varchar N
time_due varchar N
time_paid varchar N
time_canceled varchar N
time_refunded varchar N

invoice.customer_id references customer.id

Table: invoice_item

column name column type key / NULL
id int PK
invoice_id int FK
product_id int FK
quantity int
price decimal(8,2)
line_total_price decimal(8,2)

invoice_item.invoice_id references invoice.id

invoice_item.product_id references product.id

Sample Data Tables

Table: customer

id customer_name city_id customer_address contact_person email phone
1 Drogerie Wien 1 Deckergasse 15A Emil Steinbach [email protected] 094234234
2 Cosmetics Store 4 Watling Street 347 Jeremy Corbyn [email protected] 093923923
3 Kosmetikstudio 3 Rothenbaumchaussee 53 Willy Brandt [email protected] 0941562222
4 Neue Kosmetik 1 Karlsplatz 2 NULL [email protected] 094109253
5 Bio Kosmetik 2 Motzstraße 23 Clara Zetkin [email protected] 093825825
6 K-Wien 1 Kärntner Straße 204 Maria Rauch-Kallat [email protected] 093427002
7 Natural Cosmetics 4 Clerkenwell Road 14B Glenda Jackson [email protected] 093555123
8 Kosmetik Plus 2 Unter den Linden 1 Angela Merkel [email protected] 094727727
9 New Line Cosmetics 4 Devonshire Street 92 Oliver Cromwell [email protected] 093202404

Table: product

id sku product_name product_description current_price quantity_in_stock
1 330120 Game Of Thrones - URBAN DECAY Game Of Thrones Eyeshadow Palette 65 122
2 330121 Advanced Night Repair - ESTEE LAUDER Advanced Night Repair Synchronized Recovery Complex II 98 51
3 330122 Rose Deep Hydration - FRESH Rose Deep Hydration Facial Toner 45 34
4 330123 Pore-Perfecting Moisturizer - TATCHA Pore-Perfecting Moisturizer & Cleanser Duo 25 393
5 330124 Capture Youth - DIOR Capture Youth Serum Collection 95 74
6 330125 Slice of Glow - GLOW RECIPE Slice of Glow Set 45 40
7 330126 Healthy Skin - KIEHL S SINCE 1851 Healthy Skin Squad 68 154
8 330127 Power Pair! - IT COSMETICS IT is Your Skincare Power Pair! Best-Selling Moisturizer & Eye Cream Duo 80 0
9 330128 Dewy Skin Mist - TATCHA Limited Edition Dewy Skin Mist Mini 20 281
10 330129 Silk Pillowcase - SLIP Silk Pillowcase Duo + Scrunchies Kit 170 0

Table: invoice

id invoice_number customer_id user_account_id total_price time_issued time_due time_paid time_canceled time_refunded
1 in_25181b07ba800c8d2fc967fe991807d9 7 4 1436 7/20/2019 3:05:07 PM 7/27/2019 3:05:07 PM 7/25/2019 9:24:12 AM NULL NULL
2 8fba0000fd456b27502b9f81e9d52481 9 2 1000 7/20/2019 3:07:11 PM 7/27/2019 3:07:11 PM 7/20/2019 3:10:32 PM NULL NULL
3 3b6638118246b6bcfd3dfcd9be487599 3 2 360 7/20/2019 3:06:15 PM 7/27/2019 3:06:15 PM 7/31/2019 9:22:11 PM NULL NULL
4 dfe7f0a01a682196cac0120a9adbb550 5 2 1675 7/20/2019 3:06:34 PM 7/27/2019 3:06:34 PM NULL NULL NULL
5 2a24cc2ad4440d698878a0a1a71f70fa 6 2 9500 7/20/2019 3:06:42 PM 7/27/2019 3:06:42 PM NULL 7/22/2019 11:17:02 AM NULL
6 cbd304872ca6257716bcab8fc43204d7 4 2 150 7/20/2019 3:08:15 PM 7/27/2019 3:08:15 PM 7/27/2019 1:42:45 PM NULL 7/27/2019 2:11:20 PM

Table: invoice_item

id invoice_id product_id quantity price line_total_price
1 1 1 20 65 1300
2 1 7 2 68 136
3 1 5 10 100 1000
4 3 10 2 180 360
5 4 1 5 65 325
6 4 2 10 95 950
7 4 5 4 100 400
8 5 10 100 95 9500
9 6 4 6 25 150

The first 2 lines of the result should be:

category ("customer" or "product") id (customer.id or product.id) name (customer_name or product_name)

-> customer 2 Cosmetics Store
-> product 9 Dewy Skin Mist - TATCHA

In: Computer Science

Monopolistic Competition

Sparkle is one firm of many in the market for toothpaste, which is in long-run equilibrium.
a. Draw a diagram showing Sparkle's demand curve, marginal-revenue curve, average-total-cost curve, and marginal-cost curve. Label Sparkle's profit-maximizing outputand price.
b. What is Sparkle's profit? Explain.
c. On your diagram, show the consumer surplus derived from the purchase of Sparkle toothpaste. Also show the deadweight loss relative to the efficient level ofoutput.
d. If the government forced Sparkle to produce the efficient level of output, what would happen to the firm? What would happen to Sparkle's customers?

In: Economics

Example 4: Suppose that the monopolist faces a demand curve for its widgets as q =...

Example 4:

Suppose that the monopolist faces a demand curve for its widgets as q = 9 - 0.2p. The firm’s marginal revenue and cost functions are: MR(q) = 45 – 10q and MC(q) = 15 + 5q. The firm’s total cost function is C(q) = 2.5q2 + 15q + 3.

  1. How many widgets should the firm produce and sell so that the monopolist can maximize its profits?
  2. How much should the firm charge to each of its customers so that the firm can maximize its profits?
  3. How much will the firm earn in total sales (or total revenues)?
  4. How much will the firm earn in total profits?

In: Economics

KF Services provides Cars' check up its customers. The selling price of each check up is...

KF Services provides Cars' check up its customers. The selling price of each check up is $75 and the variable costs associated are $42,5. The monthly relevant fixed costs are $10,000. Required: a. How many check up are needed to break even? What is the break even point in dollars? b. What is the margin of safety in dollars, assuming sales total $30,000? c. How many check up are needed to achieve a net income of $40,000?, if the tax rate is 20% d. What is the break even level in units, assuming the fixed costs are $5000 plus 10% of revenue received?

In: Accounting

Amazon can generate extra revenue from other businesses by offering its excess capacity to those who...

Amazon can generate extra revenue from other businesses by offering its excess capacity to those who need it. Like most companies, Amazon uses only a small portion of its total computing capacity at any time. Its infrastructure is considered by many to be among the most robust in the world.

Write a 1-2 page analysis using the referencing the following criteria:

Think of an idea for a startup business. Explain how this business could utilize Amazon’s Web Services (AWS).

How do the concepts of capacity planning and scalability apply to this case? Apply these concepts both to Amazon and to customers of your business.

In: Economics

Amazon can generate extra revenue from other businesses by offering its excess capacity to those who...

Amazon can generate extra revenue from other businesses by offering its excess capacity to those who need it. Like most companies, Amazon uses only a small portion of its total computing capacity at any time. Its infrastructure is considered by many to be among the most robust in the world. Write a 1-2 page analysis using the referencing the following criteria:

  • Think of an idea for a startup business. Explain how this business could utilize Amazon’s Web Services (AWS).
  • How do the concepts of capacity planning and scalability apply to this case? Apply these concepts both to Amazon and to customers of your business.

In: Computer Science

What are the three categories of business entities? List and briefly describe the two primary differences...

  1. What are the three categories of business entities?
  2. List and briefly describe the two primary differences between the three categories of business entities.

In: Accounting

A 1000 kg car has a maximum power output of 120 hp. How steep a hill...

A 1000 kg car has a maximum power output of 120 hp. How steep a hill can it climb at a constant speed of 74 km/h if the frictional forces add up to 600 N?

In: Physics

Describe the communications objectives. Select at least three online media and describe in detail how these...

Describe the communications objectives.

Select at least three online media and describe in detail how these media will appeal to your two targeted market segments.

Develop a message to be delivered through the three online media.

The message should contain the key information you want to communicate to your target markets and might include benefits of the product or service, key features, prices and promotions, and where to buy.

Develop a budget for message development and placement of the message for 12 months in each of the three media.

Identify how you will measure the performance of each media, including revenue and e-marketing performance measures.

In: Economics

Eccles Paper Inc. is considering a three-year project to manufacture absorbent surgical pads based on its...

Eccles Paper Inc. is considering a three-year project to manufacture absorbent surgical pads based on its patented line of related products. The project requires immediate investment in equipment at $1,200,000. This will be depreciated straight-line to zero over five years, though the project will only last three years. At the end of the third year the equipment will be sold at a forecasted price of $600,000. Revenue is expected to be $5,200,000 in year one, and will increase by 5% for years two and three. Costs are 90% of sales. If the corporate tax rate is 35% and the cost of capital is 12%, should the project be pursued using the NPV criterion?

In: Finance