SQL Lab ๐Ÿ—„๏ธ

Practise MySQL queries on ready-made tables: SELECT, WHERE, ORDER BY, GROUP BY, joins and MySQL functions. Nothing to install.

Query
Loading tablesโ€ฆ
๐Ÿ“„ query.sqlCtrl + Enter to run
๐Ÿ“Š Output Loading SQL engine...
Results will appear here...

About the SQL Lab

The SQL Lab lets CBSE Class 11 and 12 students practise the SQL part of Computer Science (083) and Informatics Practices (065) without installing MySQL. Type a query, press Run, and the result appears as a table, just like the MySQL command line.

What you can practise

  • Queries: SELECT, DISTINCT, WHERE with AND/OR/NOT, BETWEEN, IN, LIKE, IS NULL, ORDER BY and LIMIT.
  • Aggregates: COUNT, SUM, AVG, MAX, MIN with GROUP BY and HAVING.
  • Joins: equi-join, NATURAL JOIN, JOIN ... ON, LEFT and RIGHT JOIN, Cartesian product.
  • MySQL functions: UCASE, LCASE, MID, SUBSTR, LENGTH, LEFT, RIGHT, INSTR, TRIM, POWER, ROUND, MOD, NOW, DATE, MONTH, MONTHNAME, YEAR, DAY, DAYNAME and more.
  • DDL and DML: CREATE DATABASE, USE, SHOW TABLES, DESC, CREATE TABLE with constraints, ALTER TABLE, DROP, INSERT, UPDATE and DELETE.

Sample tables

The school database has student, employee, dept, sports and product, with the kind of data used in board questions, including a few NULL values. Click a table name above the editor to see its rows. Your changes are kept in this browser; Reset DB brings the sample data back.

Good to know

  • Runs in your browser: queries run on your device; nothing is sent to a server.
  • The lab follows MySQL 8 rules for data types, text comparison and number formatting. A few advanced features (stored procedures, triggers, user variables) are not available, and some error messages may be worded differently.