Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SELECT name, SUM ( length ) FROM MovieExec, Movies WHERE producerC# = cert# GROUP BY name HAVING MIN ( year ) 1 9 3 0

SELECT name, SUM (length)
FROM MovieExec, Movies
WHERE producerC# = cert#
GROUP BY name
HAVING MIN(year)1930;
Figure 6.14: Computing the total length of film for early producers
6.4.8 Exercises for Section 6.4
Exercise 6.4.1: Write each of the queries in Exercise 2.4.1 in SQL, making
sure that duplicates are eliminated.
Exercise 6.4.2: Write each of the queries in Exercise 2.4.3 in SQL, making
sure that duplicates are eliminated.
! Exercise 6.4.3: For each of your answers to Exercise 6.3.1, determine whether
or not the result of your query can have duplicates. If so, rewrite the query
to eliminate duplicates. If not, write a query without subqueries that has the
same, duplicate-free answer.
! Exercise 6.4.4 : Repeat Exercise 6.4.3 for your answers to Exercise 6.3.2.
! Exercise 6.4.5 : In Example 6.27, we mentioned that different versions of the
query "find the producers of Harrison Ford's movies" can have different answers
as bags, even though they yield the same set of answers. Consider the version
of the query in Example 6.22, where we used a subquery in the FROM clause.
Does this version produce duplicates, and if so, why?
Exercise 6.4.6 : Write the following queries, based on the database schemaPC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
Printer(model, color, type, price)of Exercise 2.4.1, and evaluate your queries using the data of that exercise.
a) Find the average speed of PC's.
b) Find the average speed of laptops costing over $1000.
c) Find the average price of PC's made by manufacturer "A."
!d) Find the average price of PC 's and laptops made by manufacturer "D."
e) Find, for each different speed, the average price of a PC .
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

What is the difference between absolute and relative pay?

Answered: 1 week ago