Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following database for a chain of 5 supermarkets in Melbourne. Customers take a collection of products to a checkout for scanning: this is
Consider the following database for a chain of 5 supermarkets in Melbourne. Customers take a collection of products to a checkout for scanning: this is one "Purchase". Each item within the purchase is a "Purchaseltem". Some customers identify themselves at the checkout by scanning a loyalty card. The checkouts are numbered within each store: so a given store n has checkouts n-1, n-2 etc. Each product is classified within a particular category. There are several payment methods. The following ER diagram describes the database schema which has been implemented. Store Checkout id TINYINT Product Category store TINYINT address VARCHAR(50) id CHAR id TINYINT postcode CHAR(4) name VARCHAR(50) Purchase Customer id INT firstName VARCHAR(50) lastName VARCHAR(50) dateofbirth DATE postcode CHAR(4) id BIGINT when TIMESTAMP store TINYINT ++ checkout TINYINT paymethod CHAR customer INT Purchase Item purchase BIGINT product INT quantity SMALLINT Product id INT name VARCHAR(SO) category CHAR price DECIMAL(5,2) tax DECIMAL(5,2) 0-1 Payment Method id CHAR name VARCHAR(50) it has been found that the most common queries being run against the Product table are the following: select price from Product where id = @input; select price, tax from Product where name = @input; Based on this evidence, which columns in the Product table should we index
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