An interactive platform to learn SQL fundamentals directly in your browser with hands-on practice. Try it out at buddysql.seancoughlin.me!
- Interactive SQL Lessons: Step-by-step tutorials covering SQL basics to more advanced topics
- Live SQL Editor: Execute queries and see results immediately
- Built-in Database: Practice with a pre-populated e-commerce database
- Instant Feedback: Get helpful error messages and validation for your queries
- Progress Tracking: Your progress is saved automatically to local storage
- Zero Backend Required: Everything runs client-side using SQL.js
- Frontend: React, Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS
- SQL Engine: SQL.js (SQLite compiled to WebAssembly)
- State Management: React hooks with local storage persistence
- Node.js 20.x or later
- npm, yarn, or pnpm
-
Clone the repository:
git clone https://github.com/Scc33/BuddySQL.git cd BuddySQL -
Install dependencies:
npm install # or yarn install # or pnpm install
-
Start the development server:
npm run dev # or yarn dev # or pnpm dev
-
Open http://localhost:3000 with your browser to see the result.
/app: Next.js app directory structure with pages and layouts/components: React components organized by purpose/hooks: Custom React hooks including SQL.js integration/lib: Utility functions, database initialization, and lesson content/types: TypeScript type definitions/public: Static assets
- SqlEditor: Interactive SQL editor with query execution and feedback
- LessonContent: Markdown-rendered lesson content with code highlighting
- useSqlJs: Custom hook to initialize and interact with SQL.js
- lessons.ts: Content and structure of all SQL lessons
The application includes a sample e-commerce database with the following tables:
- Customers: customer information
- Products: product catalog
- Orders: order information
- Order_Items: individual items within orders
- Introduction to SQL
- SELECT Basics
- Filtering with WHERE
- Sorting Results
- Aggregate Functions
- Grouping Data
- Basic JOINs
Contributions are welcome! Feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SQL.js - SQLite compiled to WebAssembly
- Next.js - The React framework
- Tailwind CSS - Utility-first CSS framework