Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS3223: Database Systems Implementation

1. Project Description

2. Environment Setup

  1. Create a folder named classes under the root folder which serves as the output directory for the project.

  2. In project root folder, create a system variable COMPONENT pointing to the root directory:

    Linux / Mac : execute command source queryenv

    Windows : follow the guide

    Eclipse (other IDEs such as IntelliJ are similar) : follow the guide

3. Compilation

Windows : execute build.bat file

Linux / Mac : execute build.sh file via ./build.sh

4. Testing Procedure

Guide is taken from official instruction.

4.1 Create test cases:

Enter testcases directory.

Write Table Schema in customized file: < tablename >.det

Format for schema:

<# of columns>
<size of tuple>
<attribute name> <data type> <range> <key type> <column size>

Explanation:

data type:

  • either INTEGER / STRING / REAL

range:

  • For integers, and real, it considers the values between 0 and the range specified.
  • For primary keys, provide range value greater than or equal to number of records.
  • For strings, just specify number of characters you string need to contain.

Key type:

  • May be PK/FK/NK respectively for primary key, foreign key, not a key.
  • Use only integer data type for primary key.

Attribute size:

  • It is number of bytes required for the attribute.
  • In java, integer is 4 bytes, character is 2 bytes.

After creating the schema, use RandomDB class to generate serialized schema file < tablename >.md and the data file in text format < tablename >.txt via command:

java RandomDB <tablename> <# of records>

Once you had the database records in text format in < table name >.txt file, convert the records into object format (< table name >.tbl):

java ConvertTxtToTbl <table name>

The above command also creates another file < table name >.stat that gives the statistics of the table. i.e., number of distinct values for each column. The format of this file is as below.

<# of tuples>
<#of distinct values for col 1> <for col 2>

4.2 Test:

Eclipse / IntelliJ :

  • Copy the table schemas and test cases generated in previous step into the root folder. Run the project with extra parameters query.in query.out

Command line :

  • Copy the table schemas and test cases generated in previous step into the classes folder.
  • Run the project java QueryMain _query.in_ _query.out_

About

CS3223 DBI project

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages