Sie sind auf Seite 1von 5

Setting environment for using XAMPP for Windows.

lal bc@DESKTOP-0547CH6 c:\xampp


# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.1.21-MariaDB mariadb.org binary distribution

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

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

MariaDB [(none)]> show databases;


+--------------------+
| Database |
+--------------------+
| daaju |
| information_schema |
| lal |
| lalu |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
8 rows in set (0.00 sec)

MariaDB [(none)]> use daaju;


Database changed
MariaDB [daaju]> describes tbl_student;
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
'describes tbl_student' at line 1
MariaDB [daaju]> describe tbl_student;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Sid | int(10) | NO | PRI | NULL | |
| Address | varchar(20) | YES | | NULL | |
| Sname | varchar(20) | YES | | NULL | |
| Age | int(3) | YES | | NULL | |
| Fee | int(5) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
5 rows in set (0.03 sec)

MariaDB [daaju]> selec * from tbl_student;


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 'selec
* from tbl_student' at line 1
MariaDB [daaju]> selec * from tbl_student;
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 'selec
* from tbl_student' at line 1
MariaDB [daaju]> select * from tbl_student;
+-----+---------+-------+------+------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+------+
| 1 | NULL | NULL | NULL | NULL |
| 2 | NULL | NULL | NULL | NULL |
| 4 | NULL | NULL | NULL | NULL |
| 5 | NULL | NULL | NULL | NULL |
| 9 | NULL | NULL | NULL | NULL |
| 15 | NULL | NULL | NULL | NULL |
+-----+---------+-------+------+------+
6 rows in set (0.00 sec)

MariaDB [daaju]> delete 8


-> *;
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 '8
*' at line 1
MariaDB [daaju]> delete * from tbl_student;
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 '* from
tbl_student' at line 1
MariaDB [daaju]> delete * from table tbl_student;
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 '* from
table tbl_student' at line 1
MariaDB [daaju]> delete * from table tbl_student;
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 '* from
table tbl_student' at line 1
MariaDB [daaju]> delete * from tbl_student;
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 '* from
tbl_student' at line 1
MariaDB [daaju]> delete from tbl_student
-> ;
Query OK, 6 rows affected (0.08 sec)

MariaDB [daaju]> select * from tbl_student;


Empty set (0.00 sec)

MariaDB [daaju]> insert into table tbl_student(1,'dhn','ram',23,13000);


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 'table
tbl_student(1,'dhn','ram',23,13000)' at line 1
MariaDB [daaju]> insert into tbl_student(1,'dhn','ram',23,13000);
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
'1,'dhn','ram',23,13000)' at line 1
MariaDB [daaju]> Insert into tbl_student(1,'dhn','ram',23,13000);
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
'1,'dhn','ram',23,13000)' at line 1
MariaDB [daaju]> describe tbl_student;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Sid | int(10) | NO | PRI | NULL | |
| Address | varchar(20) | YES | | NULL | |
| Sname | varchar(20) | YES | | NULL | |
| Age | int(3) | YES | | NULL | |
| Fee | int(5) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
5 rows in set (0.01 sec)
MariaDB [daaju]> insert into tbl
-> insert into tbl
-> ;
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 'insert
into tbl' at line 2
MariaDB [daaju]> insert into tbl_student(1,'dhn','ram',23,12000);
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
'1,'dhn','ram',23,12000)' at line 1
MariaDB [daaju]> insert into tbl_student(1,"dhn","ram",23,12000);
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
'1,"dhn","ram",23,12000)' at line 1
MariaDB [daaju]> insert into tbl_student(1,'dhn','ram',23,12000);
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
'1,'dhn','ram',23,12000)' at line 1
MariaDB [daaju]> insert into tbl_student values (1,'dhn','ram',23,12000);
Query OK, 1 row affected (0.08 sec)

MariaDB [daaju]> insert into tbl_student values (2,'dhn','hari',21,17000);


Query OK, 1 row affected (0.08 sec)

MariaDB [daaju]> insert into tbl_student values (3,'ktm','rohit',20,14000);


Query OK, 1 row affected (0.16 sec)

MariaDB [daaju]> insert into tbl_student values (4,'pkr','mohit',24,17000);


Query OK, 1 row affected (0.16 sec)

MariaDB [daaju]> insert into tbl_student values (5,'dang','saugat',22,11000);


Query OK, 1 row affected (0.16 sec)

MariaDB [daaju]> select * from tbl_student;


+-----+---------+--------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+--------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
| 3 | ktm | rohit | 20 | 14000 |
| 4 | pkr | mohit | 24 | 17000 |
| 5 | dang | saugat | 22 | 11000 |
+-----+---------+--------+------+-------+
5 rows in set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Sage > some (select Tage from
tbl_teacher where address="dhn");
ERROR 1054 (42S22): Unknown column 'Sage' in 'IN/ALL/ANY subquery'
MariaDB [daaju]> select * from tbl_student where Age > some (select Tage from
tbl_teacher where address="dhn");
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
+-----+---------+-------+------+-------+
2 rows in set (0.13 sec)

MariaDB [daaju]> select * from tbl_teacher;


+-----+-----------+----------+------+
| Tid | Tname | Taddress | Tage |
+-----+-----------+----------+------+
| 1 | Ram | Dhn | 20 |
| 2 | hari | pkr | 20 |
| 4 | prashant | ktm | 20 |
| 5 | mahesh | mhn | 20 |
| 9 | siddartha | geta | 20 |
| 15 | ram | ktm | 20 |
+-----+-----------+----------+------+
6 rows in set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age < some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age = some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age <= some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age >= some (select Tage from
tbl_teacher where address="dhn");
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
+-----+---------+-------+------+-------+
2 rows in set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age all > some (select Tage from
tbl_teacher where address="dhn");
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 'all >
some (select Tage from tbl_teacher where address="dhn")' at line 1
MariaDB [daaju]> select * from tbl_student where Age >all (select Tage from
tbl_teacher where address="dhn");
+-----+---------+--------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+--------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
| 3 | ktm | rohit | 20 | 14000 |
| 4 | pkr | mohit | 24 | 17000 |
| 5 | dang | saugat | 22 | 11000 |
+-----+---------+--------+------+-------+
5 rows in set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age >all (select Tage from
tbl_teacher );
+-----+---------+--------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+--------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
| 4 | pkr | mohit | 24 | 17000 |
| 5 | dang | saugat | 22 | 11000 |
+-----+---------+--------+------+-------+
4 rows in set (0.00 sec)

MariaDB [daaju]> select * from tbl_student where Age =all (select Tage from
tbl_teacher );
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 3 | ktm | rohit | 20 | 14000 |
+-----+---------+-------+------+-------+
1 row in set (0.00 sec)

MariaDB [daaju]> Bye

lal bc@DESKTOP-0547CH6 c:\xampp


#

lal bc@DESKTOP-0547CH6 c:\xampp


#

lal bc@DESKTOP-0547CH6 c:\xampp


#

Das könnte Ihnen auch gefallen