MockSQL is a simple MySQL database management system clone created using core Java. The project aims to mimic basic functionalities of MySQL, allowing users to interact with databases, create tables, insert data, and execute SQL queries, all within a Java environment. This project is built entirely without using any third-party libraries.
- Authentication
- User login with User ID and Password.
- CAPTCHA verification to enhance security.
- Database Management
- List Database
- Switch Database
- Table Management
- Create Table
- Add Primary Key Constraint
- Insert Rows
- Select Query
- Drop Table
- Transactions
- Manage multiple SQL statements as a single transaction to maintain data integrity.
Upon running the project, you'll be prompted to log in using your User ID and Password, along with a CAPTCHA verification. Once authenticated, you can execute various SQL-like commands to manage databases and tables.
Here are some basic commands you can use:
SHOW DATABASES;
CREATE DATABASE my_database;
USE my_database;
SHOW TABLES;
CREATE TABLE my_table (id integer primary key, name varchar(255), age integer);
INSERT INTO my_table (id, name, age) VALUES (1, 'John Doe', 30);
SELECT * FROM my_table;
DROP TABLE my_table;
DROP DATABASE my_database;
BEGIN TRASACTION
INSERT INTO my_table VALUES (1, 'John', 23);
INSERT INTO my_table VALUES (2, 'Doe', 22);
COMMIT;
END TRANSACTION;
BEGIN TRASACTION
INSERT INTO my_table VALUES (1, 'John', 23);
INSERT INTO my_table VALUES (2, 'Doe', 22);
ROLLBACK;
END TRANSACTION;