Due: October 6, 1998 (Tuesday)
Using the suggested solution for homework #1, implement the voting system relations in Oracle by writing a script to create the tables and populate them with some rows.
For ease of reference, you should precede your tables and sequences with H1. For example, VotingProblem should be created as H1_VotingProblem. Make changes in attribute names only when it is necessary.
For all ID, use sequences that starts at 100, incrementing 1 at a time.
Here is a description of the data type sizes and precision. All ID
are numbers. Sizes of the IDs are:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create three questions:
Q1. Who should be the president of the United States?
Choices:
The three questions, choices and keywords should be stored exactly as above.
Make Q3 the current question being posted. Include three post time rows, one for each question. The current question should have NULL as value of EndTime in its most recent PostTime row.
Include at least 10 votes and 5 comments.
Save your script file as 'h2sol.sql' in your 5931/hw directory in your account.
Turn in a hard copy of your script and a listing of all tables created.