CS561 Programming Assignment 1 (Spring 2017)
CS561 Programming Assignment 1 (Spring 2017)
The following is a sample output – quantities displayed are for illustration only (not the actual
values). (NOTE – the following output must be generated with a single scan of the ‘sales’ table).
CS 561 Page 1 of 4
Database Management Systems I
Spring 2017
Grading (50 pts.) Logic/Correctness
(10 pts.) Programming Style (e.g., comments, indentation, use of functions, etc.)
(40 pts.) SQL queries
NOTE: A program with compilation errors will lose 30 points (out of 60).
Sample
Command $ sdap1 [sales], where ‘sales’ is an optional argument for the table name.
Line
Submission Submit your source code (file) (with your name and CWID on it) on Canvas.
Please include a “README” file with detailed instructions on how to compile and run the code,
especially if you are using a language other than C, C++ or Java.
In addition to the source code, submit SQL queries to generate the same output – you should use
the SQL queries to check for the correctness of your program output.
CS 561 Page 2 of 4
Database Management Systems I
Spring 2017
Please remember the following points when you're working on your programming assignments:
1. Your program must compile and execute based on the instructions provided in the README file
(i.e., if your programs contain special functions for other compilers and does not compile based
on README, you WILL lose 50% of the grade for the assignment).
2. Programming style is 10% of the grade. Please make sure to provide comments for the
program, functions, etc. as well as in-line comments as needed. Also, make sure to use
meaningful names for your classes, variables, methods/functions, etc. Use proper indentation.
3. In the header comments for your program (i.e., at the beginning of your program), please
provide:
a. General instructions on how to execute your program (e.g., command line for the
program and whatever arguments it requires). This can be a simple copy & paste of the
README file, or you can provide a simplified bullet listing of the steps for compiling and
executing the code.
b. Justification of your choice of data structures for your program – e.g., if you're using a
linked list to maintain whatever information necessary for your program, justify why it's a
data structure of your choice, as opposed to, say, arrays. If you're using other more
sophisticated data structures, please provide a brief description of the data structures
and again justify as to why you chose the data structures for your program.
c. A detailed description of the algorithm of your program, e.g., how you're computing and
maintaining the aggregates (e.g., min, max, avg) for your query output. You can do this
with a detailed pseudo code.
4. Remember the only SQL statement allowed in your program is the simple select statement,
"select * from sales". Points will be deducted if you use any other SQL statements in your
programs.
5. You are NOT allowed to read in the entire table (‘sales’) and store them in memory before
processing the rows. Instead, you need to read each row (one row at a time), process it and
discard it.
Most importantly, make sure it's your own work! If we determine that your program is a copy of
someone else's, both you and that someone else will receive 0 for the assignment and possibly
additional penalties for the course.
CS 561 Page 3 of 4
Database Management Systems I
Spring 2017
Student’s Name:______________________________________________
Sub-Total 100
If compilation fails or ‘sales’ table is cached into 100
Penalties memory (subtract 30); For using anything more
than ‘select * from sales’ for programming (vs. for
% - 30
your SQL queries), 15 points will be deducted.
Total
CS 561 Page 4 of 4
Database Management Systems I
Spring 2017