To load the database please follow the procedure outlined below. This will be useful later when you are creating tables and loading actual data into them.
The database will be loaded by first creating the tables and then loading the data for the tables from the data files. Example data definitions are available for the DreamHome and Hotel databases. These are from the book by Connolly and Begg.
Example data files are available for the DreamHome database. These are ready for bulk copying with the field delimiter character being \t and the row delimiter being \n. The delimiters are necessary for the bulk copy utility to parse the files properly. The available data files correspond to the table names. They are as follows.
The procedure for craeting and loading the Dream Home Rental Database is the following:
At the isql prompt enter (here your database name should be your login ID):
use master go sp_dboption your_database_name, "select into/bulkcopy", true go use your_database_name go checkpoint go
bcp table_name in data_file_name -t "\t" -r "\n"
For example, to copy data in Branch table use
add dblab bcp Branch in "/ncsu/dblab/www/mpsingh/local/info/sybase-info/DHRental/Branch.dat" -t "\t" -r "\n"
It will prompt for your password and ask a lot of questions to which the default answers are OK. The exceptions are the prefix length for Area in Branch, Address in Owner, Area in Property_For_Rent, and Comment in Viewing, which should be set to 0, and Date in Viewing should be set to 1.
You can view the complete set of flags for bcp using -h flag.
SELECT * FROM Branch
The bcp utility can corrupt the non character data. Use UPDATE to correct any fields.