Mysql 25 Queries
Mysql 25 Queries
+-------+-----------+-----------+------+------------+----------+---------+--------+
+-------+-----------+-----------+------+------------+----------+---------+--------+
+-------+-----------+-----------+------+------------+----------+---------+--------+
+-------+-------+-------+------+------------+----------+------+--------+
+-------+-------+-------+------+------------+----------+------+--------+
+-------+-------+-------+------+------------+----------+------+--------+
4 rows in set (0.00 sec)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '=!'clerk'' at line 1
+-------+-----------+-----------+------+------------+---------+---------+--------+
+-------+-----------+-----------+------+------------+---------+---------+--------+
+-------+-----------+-----------+------+------------+---------+---------+--------+
+-------+-----------+---------+------+------------+---------+------+--------+
+-------+-----------+---------+------+------------+---------+------+--------+
+-------+-----------+---------+------+------------+---------+------+--------+
+-----------+-----------+----------+-----------+
+-----------+-----------+----------+-----------+
+-----------+-----------+----------+-----------+
+-----------+
| job |
+-----------+
| CLERK |
| SALESMAN |
| MANAGER |
| PRESIDENT |
| ANALYST |
+-----------+
+---------------------+
| count(distinct job) |
+---------------------+
| 5|
+---------------------+
+----------+
| count(*) |
+----------+
| 14 |
+----------+
+----------+----------+-------------+----------+-------+
+----------+----------+-------------+----------+-------+
+----------+----------+-------------+----------+-------+
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'having count(*)>3' at line 1
+-------+-------+----------+------+------------+----------+--------+--------+
+-------+-------+----------+------+------------+----------+--------+--------+
+-------+-------+----------+------+------------+----------+--------+--------+
+--------+------------+
| deptno | dname |
+--------+------------+
| 10 | Marketing |
| 20 | Sourcing |
| 30 | Production |
| 40 | Management |
| 50 | Overseas |
+--------+------------+
+-------+-----------+-----------+----------+------------+
+-------+-----------+-----------+----------+------------+
+-------+-----------+-----------+----------+------------+
+----------+
| char(65) |
+----------+
|A |
+----------+
+-------------------+
| concat(ename,job) |
+-------------------+
| SMITHCLERK |
| ANYASALESMAN |
| SETHSALESMAN |
| MAHADEVANMANAGER |
| MOMINSALESMAN |
| BINAMANAGER |
| AMIRPRESIDENT |
| KULDEEPSALESMAN |
| SHIVANSHMANAGER |
| ANOOPCLERK |
| SCOTTANALYST |
| JATINCLERK |
| FAKIRANALYST |
| MITACLERK |
+-------------------+
+------------------------------+
| concat('riddhima','murarka') |
+------------------------------+
| riddhimamurarka |
+------------------------------+
+--------------+
| ucase(ename) |
+--------------+
| SMITH |
| ANYA |
| SETH |
| MAHADEVAN |
| MOMIN |
| BINA |
| AMIR |
| KULDEEP |
| SHIVANSH |
| ANOOP |
| SCOTT |
| JATIN |
| FAKIR |
| MITA |
+--------------+
+---------------------------------+
+---------------------------------+
| riddhima |
+---------------------------------+
+---------------+
| length(ename) |
+---------------+
| 5|
| 4|
| 4|
| 9|
| 5|
| 4|
| 4|
| 7|
| 8|
| 5|
| 5|
| 5|
| 5|
| 4|
+---------------+
+----------------------+
| truncate(12.56789,2) |
+----------------------+
| 12.56 |
+----------------------+
+---------------------+
| now() |
+---------------------+
| 2023-12-11 08:58:02 |
+---------------------+
+--------------------+
| date('2023-11-03') |
+--------------------+
| 2023-11-03 |
+--------------------+
1 row in set (0.00 sec)
mysql>