tutorial4

tutorial4 - Problem 1: SQL Aggregation W rite the requested...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem 1: SQL Aggregation Write the requested SQL queries for each part of this problem. You may (and should) use any aggregation functions you wish. If you feel like you have to make any assumptions, note them explicitly. Consider the following schema: Camera( model , manufacturer, type, price) model , shutter_speed, zoom, internal_memory) SLR( model , shutter_speed, internal_memory) 1. Rewrite the following query as simply as possible, without using DISTINCT: Select Distinct manufacturer From Camera; 2. List the camera models, in alphabetical order, which have the minimum price. You may not assume that all models have a different price - in other words, it may be possible that multiple models all have the minimum price. 3. Find how many camera models are neither P&S's nor SLR's. In other words, give the number of models which are in Camera, but not found in either of the other relations. 4. Give the manufacturer(s), in alphabetical order, which produces the largest number of camera models. Do not assume that the answer will necessarily be unique - it may be the case that there are multiple manufacturers that produce the same largest number.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 2: Modifications and Views
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

tutorial4 - Problem 1: SQL Aggregation W rite the requested...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online