This is a MINI SQL project implemented in Java, designed to mimic the functionality of MySQL. Instead of using a traditional database server, this project stores all data in files on the local filesystem. It supports querying data, user authentication, and transaction management, providing a lightweight alternative for database operations.
- File-based Storage: Data is persisted in files, allowing for easy backup and portability.
- Authentication: Secure login system with success and failure handling (e.g.,
login-success,login-failed). - SQL-like Queries: Supports basic SQL commands such as:
CREATE DATABASEandCREATE TABLEINSERT,SELECT,UPDATE, andDELETESELECTwith column specification andWHEREclause- Transaction management with
TRANSACTIONandTRANSACTION ROLLBACK
- Error Handling: Detects and reports incorrect syntax (e.g.,
incorrect-syntax). - Logging: Tracks operations and errors (e.g.,
log). - Captcha Integration: Adds a layer of security during login (e.g.,
captcha).
Below are screenshots demonstrating the functionality of the MINI SQL project:
Displays the captcha verification during the login process.
Shows the successful creation of a new database.
Illustrates the creation of a new table within the database.
Demonstrates the deletion of data from a table.
Shows an example of error handling for invalid SQL syntax.
Depicts the insertion of new data into a table.
Displays the logging of operations and errors.
Shows the login interface with authentication.
Illustrates a failed login attempt.
Displays a basic SELECT query result.
Shows a SELECT query with specific columns.
Demonstrates a SELECT query with a WHERE clause.
Illustrates the start of a transaction.
Shows the rollback of a transaction.
Depicts the updating of existing data.
Shows the selection of a database for operations.
- Java Development Kit (JDK) 8 or higher
- An IDE (e.g., IntelliJ IDEA, Eclipse) or a command-line environment
- Clone the repository:
git clone https://github.com/sneh2102/Mini-MySQL.git
- Navigate to the project directory:
cd mini-sql-project - Compile the Java files:
javac src/*.java - Run the application:
java -cp src Main
-
Start the application and use the command-line interface to execute SQL-like commands.
-
Example commands:
CREATE DATABASE mydb;USE mydb;CREATE TABLE users (id INT, name VARCHAR(50));INSERT INTO users VALUES (1, 'John');SELECT * FROM users;SELECT * FROM users where id = 1;SELECT * FROM users where id > 1;SELECT * FROM users where id < 1;SELCT name,id from users;SELCT name,id from users where id = 6;BEGIN TRANSACTION;ROLLBACK;
