Code Monkey home page Code Monkey logo

online-sql-cli's Introduction

SQL Command Line



Challenge Statement

Create, design and implement a web-based application capable of running SQL queries and displaying the results of said query. The application must include a space which accepts SQL queries in the form of user inputs, then runs the given query, and displays the result within the application.



Solution

Overview

  • A web-application that supports limited number of syntactically correct SQL queries and displays their respective outputs.
  • The application uses static data to display results.
  • The application also supports for a Clear Console button to clear the output area.
  • The application is built on ReactJS
  • Packages Installed
    styled-components
    @mui/icons-material
    @mui/material

Supported Queries

  • SELECT * FROM [table name]
  • SELECT COUNT(*) FROM [table name]
  • SELECT [column names] FROM [table name]

Queries with dummy output

  • UPDATE [table name]
  • CREATE [table name]
  • DELETE [table name]

Available Tables

  • stockData
  • softDrinks
  • currentTables Contains the table names of the available tables

Demonstration

sql-webapp-demo.mov

Page Load Time

image

Optimizations

  • Updates the component only when submit is triggered and hence reducing number of redundant renders.

  • Reduced updates in the query state by using a pseudo state.

  • createTable.jsx component creates a React Table element from json array.

Future Scope

  • To add query resolution for advanced queries such as GROUP BY, JOINS and Nested Queries.

  • To add a functional backend with database implementation instead of resloving queries in the frontend..

  • To add a history button for the user to take a look at the query and output history.

  • Implement server side-pagination with datagrid for viewing large tables.

online-sql-cli's People

Contributors

bitraylee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.