{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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) P&S( 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.
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern