H3-Sol

H3-Sol - CS174A Fundamentals of Database Systems (Winter 20...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS174A Fundamentals of Database Systems (Winter 20 10 ) Homework #3 Solutions 1. Express the following queries in the relational algebra and the domain relational calculus CLASSES ( class , type , country , numGuns , bore , displacement ) SHIPS ( name , class , launched ) BATTLES ( battle , date ) OUTCOMES ( ship , battle , result ) a. Find the names of the ships that were launched before 1921 and sunk in the battle of the North Atlantic. Relational Algebra: sname SHIPS.name=OUTCOMES.ship launched<1921 battle='North Atlantic' result = 'sunk' ( ) SHIPS OUTCOMES Domain Relational Calculus: ( )| ( , , ) 1921 (N,'North Atlantic', 'sunk') N C N C R SHIPS OUTCOMES b. Find all ships (i.e., their names) mentioned in the database. Relational Algebra: name SHIPS Domain Relational Calculus: ( )| ( , , ) N C N C SHIPS c. Find the ships (i.e., their names) with at least 10 guns that were never damaged in each c....
View Full Document

This note was uploaded on 05/02/2010 for the course CS 174a taught by Professor Zhin during the Fall '09 term at UCSB.

Page1 / 2

H3-Sol - CS174A Fundamentals of Database Systems (Winter 20...

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

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