Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the most preferred vehicle maker in each state? Hint: Use the window function RANK() to rank based on the count of customers for

What is the most preferred vehicle maker in each state?

Hint: Use the window function RANK() to rank based on the count of customers for each state and vehicle maker. After ranking, take the vehicle maker whose rank is 1.

Note: vehicle maker is in product_t table and state in customer_t table.

I need SQL query

image text in transcribed

image text in transcribed

New Wheels Data Dictionary shipper_id: Unique ID of the Shipper shipper_name: Name of the Shipper shipper_contact_details: Contact detail of the Shipper product_id: Unique ID of the Product vehicle_maker: Vehicle Manufacturing company name vehicle_model: Vehicle model name vehicle_color: Color of the Vehicle vehicle_model year: Year of Manufacturing vehicle_price: Price of the Vehicle quantity: Ordered Quantity customer_id: Unique ID of the customer customer_name: Name of the customer gender: Gender of the customer job_title: Job Title of the customer phone_number: Contact detail of the customer email_address: Email address of the customer city: Residing city of the customer country: Residing country of the customer state: Residing state of the customer customer_address: Address of the customer order_date: Date on which customer ordered the vehicle order_id: Unique ID of the order ship_date: Shipment Date ship_mode: Shipping Mode/Class shipping: Shipping Ways postal_code: Postal Code of the customer discount: Discount given to the customer for the particular order by credit card in percentage credit_card_type: Credit Card Type credit_card_number: Credit card number customer_feedback: Feedback of the customer quarter_number : Quarter Number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What is the relationship between humans and nature?

Answered: 1 week ago