Mini SQL - end each statement with ;
sql> CREATE TABLE students (roll INT, name TEXT, branch TEXT, marks INT, cgpa REAL);
Table students created with 5 column(s)

sql> INSERT INTO students VALUES   (101, 'Asha', 'CSE', 91, 9.1),   (102, 'Ravi', 'ECE', 74, 7.4),   (103, 'Meera', 'CSE', 85, 8.6),   (104, 'John', 'MECH', 58, 6.2),   (105, 'Priya', 'ECE', 88, 8.8),   (106, 'O''Brien', 'CSE', 67, NULL);
6 row(s) inserted

sql> SELECT * FROM students;
+------+---------+--------+-------+------+
| roll | name    | branch | marks | cgpa |
+------+---------+--------+-------+------+
|  101 | Asha    | CSE    |    91 | 9.10 |
|  102 | Ravi    | ECE    |    74 | 7.40 |
|  103 | Meera   | CSE    |    85 | 8.60 |
|  104 | John    | MECH   |    58 | 6.20 |
|  105 | Priya   | ECE    |    88 | 8.80 |
|  106 | O'Brien | CSE    |    67 | NULL |
+------+---------+--------+-------+------+
6 row(s)

sql> SELECT name, marks FROM students WHERE branch = 'CSE' AND marks >= 80 ORDER BY marks DESC;
+-------+-------+
| name  | marks |
+-------+-------+
| Asha  |    91 |
| Meera |    85 |
+-------+-------+
2 row(s)

sql> SELECT name FROM students WHERE NOT (branch = 'CSE' OR marks < 60);
+-------+
| name  |
+-------+
| Ravi  |
| Priya |
+-------+
2 row(s)

sql> SELECT name, branch FROM students WHERE name LIKE '%a' ORDER BY name;
+-------+--------+
| name  | branch |
+-------+--------+
| Asha  | CSE    |
| Meera | CSE    |
| Priya | ECE    |
+-------+--------+
3 row(s)

sql> SELECT branch, COUNT(*), AVG(marks), MAX(cgpa) FROM students GROUP BY branch ORDER BY branch;
+--------+----------+------------+-----------+
| branch | COUNT(*) | AVG(marks) | MAX(cgpa) |
+--------+----------+------------+-----------+
| CSE    |        3 |       81.0 |      9.10 |
| ECE    |        2 |       81.0 |      8.80 |
| MECH   |        1 |       58.0 |      6.20 |
+--------+----------+------------+-----------+
3 row(s)

sql> SELECT COUNT(cgpa), SUM(marks), MIN(name) FROM students;
+-------------+------------+-----------+
| COUNT(cgpa) | SUM(marks) | MIN(name) |
+-------------+------------+-----------+
|           5 |        463 | Asha      |
+-------------+------------+-----------+
1 row(s)

sql> UPDATE students SET marks = 70, cgpa = 7.0 WHERE roll = 106;
1 row(s) updated

sql> DELETE FROM students WHERE marks < 60;
1 row(s) deleted

sql> SELECT roll, name, marks FROM students ORDER BY marks LIMIT 3;
+------+---------+-------+
| roll | name    | marks |
+------+---------+-------+
|  106 | O'Brien |    70 |
|  102 | Ravi    |    74 |
|  103 | Meera   |    85 |
+------+---------+-------+
3 row(s)

sql> INSERT INTO students VALUES (107, 'Kiran', 'IT', 'ninety', 8.0);
ERROR: column marks needs an INT, got 'ninety'

sql> INSERT INTO students VALUES (108, 'Lina');
ERROR: expected 5 values but got 2

sql> SELECT age FROM students;
ERROR: no column 'age'

sql> SELECT name, COUNT(*) FROM students;
ERROR: column name must be aggregated or in GROUP BY

sql> SELEC * FROM students;
ERROR: unknown statement starting with 'SELEC'

sql> SELECT * FROM teachers;
ERROR: no table teachers

sql> SELECT * FROM students WHERE name = Asha;
ERROR: expected a value but found 'Asha' (strings need 'quotes')

sql> CREATE TABLE students (x INT);
ERROR: table students already exists

sql> SHOW TABLES;
+----------+---------+------+
| table    | columns | rows |
+----------+---------+------+
| students |       5 |    5 |
+----------+---------+------+
1 row(s)

sql> SELECT * FROM students WHERE name = 'unterminated;
ERROR: unterminated string literal

21 statement(s), 9 error(s)
