This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full 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.
- Fall '09