DATABASE SYSTEMS ASSIGNMENT 1 Solution

$30.00 $24.00

In this assignment, you are supposed to write a mini​sql engine which will run a subset of SQL Queries using ​command line interface​ Programming Languages Allowed : Java, Python and C/C++ Dataset: csv files for tables. If a file is : ​File1.csv ​, the table name would be File1. There will be no tab ​separation…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

In this assignment, you are supposed to write a minisql engine which will run a subset of SQL Queries using command line interface

Programming Languages Allowed : Java, Python and C/C++

Dataset:

  1. csv files for tables.

    1. If a file is : File1.csv , the table name would be File1.

    1. There will be no tab separation or space separation, so you are not required to handle it but you have to make sure to take care of both csv file type cases: the one where values are in double quotes and the one where values are without quotes.

  1. All the elements in files would be only INTEGERS.

  1. A file named: metadata.txt(note the extension) would be given to you which will have the following structure for each table:

<begin_table>

<table_name>

<attribute1>

….

<attributeN>

<end_table>

Type of Queries:You’ll be presented with the following set of queries:

  1. Select all records : Select * from table_name;

  1. Aggregate functions: Simple aggregate functions on a single column.

Sum, average, max and min. They will be very trivial given that the data is only

numbers:

Select max(col1) from table1;

  1. Project Columns(could be any number of columns) from one or more tables : Select

col1, col2 from table_name;

    1. Select/project with distinct from one table : Select distinct(col1), distinct(col2) from table_name;

    2. Select with where from one or more tables : Select col1,col2 from table1,table2 where col1 = 10 AND col2 = 20;

        1. In the where queries, there would be a maximum of one AND/OR operator with no NOT operators.

        2. Relational operators that are to be handled in the assignment, the operators include “< , >, <=, >=, =”.

    3. Projection of one or more(including all the columns) from two tables with one join condition :

        1. Select * from table1, table2 where table1.col1=table2.col2;

        1. Select col1,col2 from table1,table2 where table1.col1=table2.col2;

        1. NO REPETITION OF COLUMNS – THE JOINING COLUMN SHOULD BE PRINTED ONLY ONCE.

  1. IMPORTANT:

      1. ERROR HANDLING: 10% marks will be for error handling.

      1. For the above queries, please note all the permutations and combinations of SQL that MySQL permits, specially when it comes to multiple tables.

What is mentioned above are examples of what the queries could be.

  1. Parser: You can use prebuilt parsers for SQL queries

  1. Format of Input:

Command lines input such that: {compiled files} “SQL Query”. Here SQL Query would be a command line argument. Example :

      1. For C++ it will be – ./a.out “select * from table_name where condition”

      1. For Java it will be – java classfile.class “select * from table_name where

Condition”

c. For Python it will be – python RollNumber.py “select * from table_name where condition”

  1. ​​Format of Output:

<Table1.column1, Table1.column2….TableN.columnM>

Row1

Row2

…….

RowN

  1. Deliverables:

    1. Java/Python/C++ Source Code files.

    1. Compiled Java/C++ files.

    1. Bash script as your roll number.

    1. Keep all of this in a folder RollNumber, zip it and upload.

Copying in the Assignments can lead from a Zero in the current assignment to an F in the course.

DATABASE SYSTEMS ASSIGNMENT 1 Solution
$30.00 $24.00