0% found this document useful (0 votes)
14 views9 pages

Show Databases : Mariadb (Param)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views9 pages

Show Databases : Mariadb (Param)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

MariaDB [(none)]> show databases;

+--------------------+
| Database |
+--------------------+
| information_schema |
| movie |
| mysql |
| param |
| performance_schema |
| phpmyadmin |
| sample |
| test |
+--------------------+
8 rows in set (0.002 sec)

MariaDB [(none)]> use param;


Database changed
MariaDB [param]> show tables;
+-----------------+
| Tables_in_param |
+-----------------+
| course_tbl |
| movies |
| saleman |
| std |
+-----------------+
4 rows in set (0.001 sec)

MariaDB [param]> select * from course_tbl;


+----------+-----------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+-----------------+---------------+------------+
| 1 | Php | Rahul | 2022-01-10 |
| 2 | Mysql | Sunil | 2019-10-15 |
| 3 | Learning Java | Shiddhu | 2009-03-16 |
| 4 | MYSQL with PERL | Subha | 2009-03-16 |
+----------+-----------------+---------------+------------+
4 rows in set (0.088 sec)

MariaDB [param]> select * from course_tbl where


course_author LIKE '%l';
+----------+--------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+--------------+---------------+------------+
| 1 | Php | Rahul | 2022-01-10 |
| 2 | Mysql | Sunil | 2019-10-15 |
+----------+--------------+---------------+------------+
2 rows in set (0.001 sec)

MariaDB [param]> select * from course_tbl where


course_author LIKE 'S%';
+----------+-----------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+-----------------+---------------+------------+
| 2 | Mysql | Sunil | 2019-10-15 |
| 3 | Learning Java | Shiddhu | 2009-03-16 |
| 4 | MYSQL with PERL | Subha | 2009-03-16 |
+----------+-----------------+---------------+------------+
3 rows in set (0.000 sec)

MariaDB [param]> select * from course_tbl where


course_author LIKE 'S%l';
+----------+--------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+--------------+---------------+------------+
| 2 | Mysql | Sunil | 2019-10-15 |
+----------+--------------+---------------+------------+
1 row in set (0.000 sec)

MariaDB [param]> select * from course_tbl where


course_author LIKE 'S%o';
Empty set (0.000 sec)

MariaDB [param]> select * from course_tbl ORDER BY


course_author ASC;
+----------+-----------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+-----------------+---------------+------------+
| 1 | Php | Rahul | 2022-01-10 |
| 3 | Learning Java | Shiddhu | 2009-03-16 |
| 4 | MYSQL with PERL | Subha | 2009-03-16 |
| 2 | Mysql | Sunil | 2019-10-15 |
+----------+-----------------+---------------+------------+
4 rows in set (0.001 sec)

MariaDB [param]> select * from course_tbl ORDER BY


course_author DESC;
+----------+-----------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+-----------------+---------------+------------+
| 2 | Mysql | Sunil | 2019-10-15 |
| 4 | MYSQL with PERL | Subha | 2009-03-16 |
| 3 | Learning Java | Shiddhu | 2009-03-16 |
| 1 | Php | Rahul | 2022-01-10 |
+----------+-----------------+---------------+------------+
4 rows in set (0.000 sec)

MariaDB [param]> select * from std;


+--------+----------+-----------+----------------+
| std_id | std_name | mobile_no | email |
+--------+----------+-----------+----------------+
| 101 | Balaji | 012345678 | [email protected] |
| 111 | Steven | 097987956 | [email protected] |
| 111 | Steven | 097987956 | [email protected] |
| 103 | Mohammed | 09353956 | [email protected] |
| 105 | kadiatu | 09878665 | [email protected] |
| 110 | Ista | 069878665 | [email protected] |
| 112 | Grace | 979678 | [email protected] |
| 114 | Sessay | 9977865 | [email protected] |
| 116 | kallon | 574679467 | [email protected] |
| 231 | albert | 69747867 | [email protected] |
| 119 | martina | 798609 | [email protected] |
| 117 | Sheriff | 9867857 | [email protected] |
+--------+----------+-----------+----------------+
12 rows in set (0.024 sec)

MariaDB [param]> select * from std ORDER BY std_name


DESC;
+--------+----------+-----------+----------------+
| std_id | std_name | mobile_no | email |
+--------+----------+-----------+----------------+
| 111 | Steven | 097987956 | [email protected] |
| 111 | Steven | 097987956 | [email protected] |
| 117 | Sheriff | 9867857 | [email protected] |
| 114 | Sessay | 9977865 | [email protected] |
| 103 | Mohammed | 09353956 | [email protected] |
| 119 | martina | 798609 | [email protected] |
| 116 | kallon | 574679467 | [email protected] |
| 105 | kadiatu | 09878665 | [email protected] |
| 110 | Ista | 069878665 | [email protected] |
| 112 | Grace | 979678 | [email protected] |
| 101 | Balaji | 012345678 | [email protected] |
| 231 | albert | 69747867 | [email protected] |
+--------+----------+-----------+----------------+
12 rows in set (0.001 sec)

MariaDB [param]> select * from std ORDER BY std_name


ASC;
+--------+----------+-----------+----------------+
| std_id | std_name | mobile_no | email |
+--------+----------+-----------+----------------+
| 231 | albert | 69747867 | [email protected] |
| 101 | Balaji | 012345678 | [email protected] |
| 112 | Grace | 979678 | [email protected] |
| 110 | Ista | 069878665 | [email protected] |
| 105 | kadiatu | 09878665 | [email protected] |
| 116 | kallon | 574679467 | [email protected] |
| 119 | martina | 798609 | [email protected] |
| 103 | Mohammed | 09353956 | [email protected] |
| 114 | Sessay | 9977865 | [email protected] |
| 117 | Sheriff | 9867857 | [email protected] |
| 111 | Steven | 097987956 | [email protected] |
| 111 | Steven | 097987956 | [email protected] |
+--------+----------+-----------+----------------+
12 rows in set (0.000 sec)

MariaDB [param]> show tables;


+-----------------+
| Tables_in_param |
+-----------------+
| course_tbl |
| movies |
| saleman |
| std |
+-----------------+
4 rows in set (0.001 sec)

MariaDB [param]> create table tcount(course_author


varchar(50),tcount int);
Query OK, 0 rows affected (0.130 sec)

MariaDB [param]> insert into tcount values('Shiddhu',3);


Query OK, 1 row affected (0.076 sec)
MariaDB [param]> insert into tcount values('Rahul',2);
Query OK, 1 row affected (0.038 sec)

MariaDB [param]> insert into tcount values('Sunil',3);


Query OK, 1 row affected (0.030 sec)

MariaDB [param]> select * from tcount;


+---------------+--------+
| course_author | tcount |
+---------------+--------+
| Shiddhu | 3|
| Rahul | 2|
| Sunil | 3|
+---------------+--------+
3 rows in set (0.000 sec)

MariaDB [param]> select * from course_tbl;


+----------+-----------------+---------------+------------+
| courseid | course_title | course_author | submission |
+----------+-----------------+---------------+------------+
| 1 | Php | Rahul | 2022-01-10 |
| 2 | Mysql | Sunil | 2019-10-15 |
| 3 | Learning Java | Shiddhu | 2009-03-16 |
| 4 | MYSQL with PERL | Subha | 2009-03-16 |
+----------+-----------------+---------------+------------+
4 rows in set (0.000 sec)

MariaDB [param]> select


a.course_title,a.course_author,b.tcount from course_tbl
a,tcount b where a.course_author=b.course_author;
+---------------+---------------+--------+
| course_title | course_author | tcount |
+---------------+---------------+--------+
| Php | Rahul | 2|
| Mysql | Sunil | 3|
| Learning Java | Shiddhu | 3|
+---------------+---------------+--------+
3 rows in set (0.001 sec)

MariaDB [param]>

You might also like