Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions