437Midterm_Fall2006_T1_solution

Continue on next page longtitude date shipmovement

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: (Continue on next page) longtitude date SHIP_MOVEMENT latitude time M history type tonnage hull 1 shipName M 1 SHIP SHIP_TYPE type owner M M startDate homePort visits continent name endDate 1 portName N 1 in M STATE_COUNTRY PORT SEA_OCEAN_LAKE on M 1 name (a) [5%] Provide a list of ships and their owners that sailed in the month of June 2006. Show only the ship’s name and owner’s name. The names MUST appear only ONCE in the list. Your answer must appear like this: Ship Name Owner Name ---------- ----------- Jolly Roger Neptune Lines The Ripper President Shipping SELECT DISTINCT shipName, owner FROM ship s, ship_movement sm WHERE s.shipName = sm.shipName AND sm.date BETWEEN ‘01/06/2006’ AND ‘30/06/2006’; COMM 437 Mid-Term Exam (Fall 2006 Term 1) Page 2 of 7 (b) [5%] Provide a list of ship types and the number of ships of that type currently in the database. Show only ship type and the number of ships of each type. Sort by the type count descending. Your answer must appear like this: Ship Type Type_Count ---------- ----------- Tanker 5 Container 4 SELECT s.type, COUNT(s.type) AS Type_Coun...
View Full Document

Ask a homework question - tutors are online