Docsity

Assignment # 4 - Database Design | CMSC 424, Assignments of Principles of Database Management

Toggle sidebar
bg1
CMSC 424: Database Design
Spring 2001
HOMEWORK 4
Due: At the beginning of class on Tuesday, April 17, 2001.
This homework continues the homeworks previously assigned. As before, assume that you have two files
calledsavings an d checkingsuch t hat each row in those files has (SSN, Fname, Lname, Amount)
fields with the same format as the test data provided for Homework 1. As per homework 2, you should have
code that automatically creates Oracle tables using these two files.
You are to write a C program that allowsthe user to pick one of the following three query “templates.”
1. Find the FNAME, LNAME of all individuals who have over
X
in their savings account. If the user
chooses this option, the system should prompt him for a value of
X
.
2. Find the FNAME, LNAME of all individuals who have over
X
and less than
Y
in their savings account.
If the user chooses this option, the system should prompt him for values of
X
and
Y
.
3. Find an aggregate value for the “Amount” attribute of a given table. If the user chooses this option, the
system should prompt him for the table name (savings or checking) andthe aggregate (e.g. min, max,
avg, sum).
Once the user has fed his input, the system should automatically execute the query expressed by his choice.
Test your programs on the test data providedfor Homework 1.
1

Partial preview of the text

Download Assignment # 4 - Database Design | CMSC 424 and more Assignments Principles of Database Management in PDF only on Docsity!

CMSC 424: Database Design

Spring 2001 HOMEWORK 4 Due: At the beginning of class on Tuesday, April 17, 2001.

This homework continues the homeworks previously assigned. As before, assume that you have two files called savings and checking such that each row in those files has (SSN, Fname, Lname, Amount) fields with the same format as the test data provided for Homework 1. As per homework 2, you should have code that automatically creates Oracle tables using these two files. You are to write a C program that allows the user to pick one of the following three query “templates.”

  1. Find the FNAME, LNAME of all individuals who have over X in their savings account. If the user chooses this option, the system should prompt him for a value of X.
  2. Find the FNAME, LNAME of all individuals who have over X and less than Y in their savings account. If the user chooses this option, the system should prompt him for values of X and Y.
  3. Find an aggregate value for the “Amount” attribute of a given table. If the user chooses this option, the system should prompt him for the table name (savings or checking) and the aggregate (e.g. min, max, avg, sum).

Once the user has fed his input, the system should automatically execute the query expressed by his choice. Test your programs on the test data provided for Homework 1.