Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started