Docsity

Database Design Homework 5 for CMSC 424 Spring 2001 - Prof. Venkatramana Subrahmanian, Assignments of Principles of Database Management

Toggle sidebar
bg1
CMSC 424: Database Design
Spring 2001
HOMEWORK 5
Due: At the beginning of class on Tuesday, May 8, 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 Homework1. As per previous homeworks, you should
have code that automatically creates Oracle tables using these two files.
You are to write a C program that interactively asks the user to provide the following inputs (via the com-
mand line)
1. A table name (either savings or checking);
2. A list of fields from the selected table (your program should prompt the user to enter a field one at a
time till the user has no more fields to enter) ;
3. A list of atomic selection conditions w.r.t. the selected table (again your program should prompt the
user to enter a field one at a time till the user has no more fields to enter). Notethat an atomic selection
condition is an expression of the form
t
1
op t
2
where
t
1
;t
2
are either attribute names or constants, and
op
is a comparison operator such as
>;
=
;<
.
Once the user has fed his input, your program should automatically execute the query
SELECT fields in item (2)
FROM table in item (1)
WHERE conjunction of atomic selection conditions in item (3)
Test your programs on the test data provided for Homework 1.
1

Partial preview of the text

Download Database Design Homework 5 for CMSC 424 Spring 2001 - Prof. Venkatramana Subrahmanian and more Assignments Principles of Database Management in PDF only on Docsity!

CMSC 424: Database Design

Spring 2001 HOMEWORK 5 Due: At the beginning of class on Tuesday, May 8, 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 previous homeworks, you should have code that automatically creates Oracle tables using these two files. You are to write a C program that interactively asks the user to provide the following inputs (via the com- mand line)

  1. A table name (either savings or checking);
  2. A list of fields from the selected table (your program should prompt the user to enter a field one at a time till the user has no more fields to enter) ;
  3. A list of atomic selection conditions w.r.t. the selected table (again your program should prompt the user to enter a field one at a time till the user has no more fields to enter). Note that an atomic selection condition is an expression of the form t 1 op t 2 where t 1 ; t 2 are either attribute names or constants, and op is a comparison operator such as >; =; <.

Once the user has fed his input, your program should automatically execute the query

SELECT fields in item (2) FROM table in item (1) WHERE conjunction of atomic selection conditions in item (3)

Test your programs on the test data provided for Homework 1.