SQL
SQL
┌──(patel㉿kali)-[~]
└─$ sudo mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 10.11.4-MariaDB-1 Debian 12
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Database changed
MariaDB [sqldemo]> show tables
-> ;
+-------------------+
| Tables_in_sqldemo |
+-------------------+
| users |
+-------------------+
1 row in set (0.000 sec)
MariaDB [sqldemo]> use users;
ERROR 1049 (42000): Unknown database 'users'
MariaDB [sqldemo]> select * from users
-> ;
+----------+----------+------+
| username | password | age |
+----------+----------+------+
| jeremy | letmein | 30 |
| jessamy | kittems | 31 |
+----------+----------+------+
2 rows in set (0.001 sec)
MariaDB [sqldemo]> select age from users where username="jeremy" union select
password from users;
+---------+
| age |
+---------+
| 30 |
| letmein |
| kittems |
+---------+
3 rows in set (0.002 sec)