Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
77 views

CIS182 Homework 5

This document outlines homework assignments involving SQL queries using joins. It provides instructions to complete queries involving trips data, runs data, vehicles, operators, and routes. The queries are of varying difficulty and point values. They involve inner joins, natural joins, counts, inserts, and filtering by date fields. The goal is to return related data from multiple tables based on the join conditions.

Uploaded by

rriness
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

CIS182 Homework 5

This document outlines homework assignments involving SQL queries using joins. It provides instructions to complete queries involving trips data, runs data, vehicles, operators, and routes. The queries are of varying difficulty and point values. They involve inner joins, natural joins, counts, inserts, and filtering by date fields. The goal is to return related data from multiple tables based on the join conditions.

Uploaded by

rriness
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Name:___________________________

CIS-182
Homework #5 – Joins
Complete the following queries. "Natural join" refers to fields compared in the WHERE
clause. Turn in this sheet with your SQL code and screen prints.

1. Each query is worth two points.


a. Display the Run ID and all fields from the trips table for each trip using an inner-join.
b. Display the vehicle name used for each trip, and all fields from the trip table, using a
natural join.
c. Display each Operator and the vehicles that he/she drives using an inner-join (operator
name, manufacturer, model, vehicle id).

2. Each query is worth three points.


a. Display the count of trips for each January 2005 run using a natural join (test the Bid
Date field in Runs).
b. Calculate the number of trips Vehicle #3 made in September 2004's schedule using an
inner-join (you may need to refer to assignment #1 for the correct vehicle, depending
on identity values) (use the Effective Date in Trips).
c. List any routes that have more than one bus operating trips grouped by Effective Date.
d. Calculate the number of Operators who start at or arrive at Lacey in January 2005 (use
Effective Date in Trips).
e. Insert a new vehicle (CityCruiser, 35 foot, 1996); create a list of buses and trip details,
including all buses.

3. Four points:
Display the Operator name, vehicle model, start location, and start time for all trips starting
after 9:00 am in September 2004.

3/26/10

You might also like