Java Reference
In-Depth Information
choiceb varchar ( 1000 ),
choicec varchar ( 1000 ),
choiced varchar ( 1000 ),
answer varchar ( 5 ));
The Quiz table stores multiple-choice questions. Suppose the multiple-choice
questions are stored in a text file accessible from www.cs.armstrong.edu/liang/data/
Quiz.txt in the following format:
1. question1
a. choice a
b. choice b
c. choice c
d. choice d
Answer:cd
2. question2
a. choice a
b. choice b
c. choice c
d. choice d
Answer:a
...
Write a program that reads the data from the file and populate it into the Quiz
table.
*32.8
( Populate Salary table ) Create a table named Salary as follows:
create table Salary(
firstName varchar ( 100 ),
lastName varchar ( 100 ),
rank varchar ( 15 ),
salary float );
Obtain the data for salary from http://cs.armstrong.edu/liang/data/Salary.txt and popu-
late it into the Salary table in the database.
*32.9
( Copy table ) Suppose the database contains a student table defined as follows:
create table Student1 (
username varchar ( 50 ) not null ,
password varchar ( 50 ) not null ,
fullname varchar ( 200 ) not null ,
constraint pkStudent primary key (username)
);
Create a new table named Student2 as follows:
create table Student2 (
username varchar ( 50 ) not null ,
password varchar ( 50 ) not null ,
firstname varchar ( 100 ),
lastname varchar ( 100 ),
constraint pkStudent primary key (username)
);
A full name is in the form of firstname mi lastname or firstname
lastname . For example, John K Smith is a full name. Write a program that
 
Search WWH ::




Custom Search