Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Microsoft Windows [Version 10.0.

14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\DMS2>cd/

C:\>cd xampp/mysql/bin

C:\xampp\mysql\bin>mysql.exe -u root --password


Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.28-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use bhavya;


ERROR 1049 (42000): Unknown database 'bhavya'
MariaDB [(none)]> use test;
Database changed
MariaDB [test]> create table club(Coach_id int,Coach_name varchar(21),Age
int,Sports varchar(21),Pay int,Sex varchar(21));
Query OK, 0 rows affected (0.037 sec)

MariaDB [test]> desc club;


+------------+-------------+------+-----+---------+-------+--------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Coach_id | int (11) | YES | | NULL | |
| Coach_name | varchar (21) | YES | | NULL | |
| Age | int (11) | YES | | NULL | |
| Sports | varchar (21)| YES | | NULL | |
| Pay | int (11) | YES | | NULL | |
| Sex | varchar (21) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+--------+
6 rows in set (0.021 sec)

MariaDB [test]> insert into club values(1,'kKukrega'35,'karte',1000,'M');


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'35,'karte',1000,'M')' at line 1
MariaDB [test]> insert into club values(1,'Kukrega',35,'karte',1000,'M');
Query OK, 1 row affected (0.039 sec)

MariaDB [test]> insert into club values(2,'Ravina',34,'karte',1200,'F');


Query OK, 1 row affected (0.002 sec)

MariaDB [test]> insert into club values(3,'Karan',34,'Squash',2000,'M');


Query OK, 1 row affected (0.005 sec)

MariaDB [test]> insert into club values(4,'Tarun',33,'Basketball',1500,'m');


Query OK, 1 row affected (0.003 sec)

MariaDB [test]> insert into club values(5,'Zubin',36,'Swimming',750,'M');


Query OK, 1 row affected (0.002 sec)

MariaDB [test]> insert into club values(6,'Ketari',36,'Savesh',800,'F');


Query OK, 1 row affected (0.003 sec)
MariaDB [test]> insert into club values(7,'Ankita',39,'Karate',2200,'M');
Query OK, 1 row affected (0.002 sec)

MariaDB [test]> insert into club values(8,'Zareen',37,'Swimming',1100,'M');


Query OK, 1 row affected (0.003 sec)

MariaDB [test]> insert into club values(9,'Kush',41,'Basketball',900,'F');


Query OK, 1 row affected (0.002 sec)

MariaDB [test]> insert into club values(10,'Shailya',37,'Basketball',1700,'M');


Query OK, 1 row affected (0.004 sec)

MariaDB [test]> select * from club;


+----------+------------+------+------------+------+------+--------+
| Coach_id | Coach_name | Age | Sports | Pay | Sex |
+----------+------------+------+------------+------+------+
| 1 | Kukrega | 35 | karte | 1000 | M |
| 2 | Ravina | 34 | karte | 1200 | F |
| 3 | Karan | 34 | Squash | 2000 | M |
| 4 | Tarun | 33 | Basketball | 1500 | M |
| 5 | Zubin | 36 | Swimming | 750 | M |
| 6 | Ketari | 36 | Savesh | 800 | F |
| 7 | Ankita | 39 | Karate | 2200 | M |
| 8 | Zareen | 37 | Swimming | 1100 | M |
| 9 | Kush | 41 | Basketball | 900 | F |
| 10 | Shailya | 37 | Basketball | 1700 | M |
+----------+------------+------+------------+------+------+---------+
10 rows in set (0.001 sec)

MariaDB [test]> select distinct (sports) from club;


+------------+
| sports |
+------------+
| karte |
| Squash |
| Basketball |
| Swimming |
| Savesh |
| Karate |
+------------+
6 rows in set (0.001 sec)

MariaDB [test]> select age from club where pay>=2000;


+------+
| age |
+------+
| 34 |
| 39 |
+------+
2 rows in set (0.001 sec)

MariaDB [test]> select pay from club where sex='M';


+------+
| pay |
+------+
| 1000 |
| 1500 |
| 750 |
| 2200 |
| 1100 |
| 1700 |
+------+
6 rows in set (0.001 sec)

MariaDB [test]>

You might also like