0% found this document useful (0 votes)
47 views

My sql2

The document shows the use of MySQL commands to create databases, tables, insert and select data from tables. The user creates a practice database, Emp and Student tables with various fields, inserts sample data, and runs selection queries with filtering, sorting and arithmetic operations on the fields. Errors in SQL syntax are also shown during table creation attempts.

Uploaded by

Project Ideas
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

My sql2

The document shows the use of MySQL commands to create databases, tables, insert and select data from tables. The user creates a practice database, Emp and Student tables with various fields, inserts sample data, and runs selection queries with filtering, sorting and arithmetic operations on the fields. Errors in SQL syntax are also shown during table creation attempts.

Uploaded by

Project Ideas
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Enter password: ***********

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 22

Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

mysql> create database practice;\

Query OK, 1 row affected (0.01 sec)

mysql> create table Emp (Emp_id) INT(10), (Ename) VARCHAR (60), (Salary) INT(100000));

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 ') INT(10), (Ename) VARCHAR (60),
(Salary) INT(100000))' at line 1

mysql> create table Emp ((Emp_id) INT(10), (Ename) VARCHAR (60), (Salary) INT(100000));

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 'Emp_id) INT(10), (Ename) VARCHAR (60),
(Salary) INT(100000))' at line 1

mysql> create table Emp ((Emp_id) INT(10);

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 'Emp_id) INT(10)' at line 1

mysql> create table Emp (Emp_id) INT(10);

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 ') INT(10)' at line 1
mysql> create table Emp (Emp_id INT(10);

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 '' at line 1

mysql> create table Emp (Emp_id INT(10));

ERROR 1046 (3D000): No database selected

mysql> use practice;

Database changed

mysql> create table Emp (Emp_id INT(10),(Ename VARCHAR (100),(Salary INT(100000));

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 '(Ename VARCHAR (100),(Salary
INT(100000))' at line 1

mysql> create table Emp (Emp_id INT(10));

Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> desc Emp;

+--------+------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+------+------+-----+---------+-------+

| Emp_id | int | YES | | NULL | |

+--------+------+------+-----+---------+-------+

1 row in set (0.01 sec)

mysql> ALTER TABLE Emp ADD (Ename VARCHAR(80),Salary INT);

Query OK, 0 rows affected (0.02 sec)

Records: 0 Duplicates: 0 Warnings: 0

mysql> desc Emp;

+--------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |


+--------+-------------+------+-----+---------+-------+

| Emp_id | int | YES | | NULL | |

| Ename | varchar(80) | YES | | NULL | |

| Salary | int | YES | | NULL | |

+--------+-------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> ALTER TABLE Emp SET Emp_id PRIMARY KEY;

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 'SET Emp_id PRIMARY KEY' at line 1

mysql> INSERT INTO Emp VALUES ('1','Suman','20000');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO Emp VALUES ('2','Sanjay','32000');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO Emp VALUES ('3','Ravi','30000');

Query OK, 1 row affected (0.00 sec)

mysql> select*from Emp;

+--------+--------+--------+

| Emp_id | Ename | Salary |

+--------+--------+--------+

| 1 | Suman | 20000 |

| 2 | Sanjay | 32000 |

| 3 | Ravi | 30000 |

+--------+--------+--------+

3 rows in set (0.00 sec)


mysql> select Salary+1000 from Emp;

+-------------+

| Salary+1000 |

+-------------+

| 21000 |

| 33000 |

| 31000 |

+-------------+

3 rows in set (0.00 sec)

mysql> select Emp

->

-> ;

ERROR 1054 (42S22): Unknown column 'Emp' in 'field list'

mysql> select Emp

-> ;

ERROR 1054 (42S22): Unknown column 'Emp' in 'field list'

mysql> select Emp_id, Salary-500 from Emp;

+--------+------------+

| Emp_id | Salary-500 |

+--------+------------+

| 1| 19500 |

| 2| 31500 |

| 3| 29500 |

+--------+------------+

3 rows in set (0.00 sec)


mysql> select Ename, Salary*3 from Emp;

+--------+----------+

| Ename | Salary*3 |

+--------+----------+

| Suman | 60000 |

| Sanjay | 96000 |

| Ravi | 90000 |

+--------+----------+

3 rows in set (0.00 sec)

mysql> select Emp_id, Ename, Salary/2 from Emp;

+--------+--------+------------+

| Emp_id | Ename | Salary/2 |

+--------+--------+------------+

| 1 | Suman | 10000.0000 |

| 2 | Sanjay | 16000.0000 |

| 3 | Ravi | 15000.0000 |

+--------+--------+------------+

3 rows in set (0.00 sec)

mysql> select Emp_id, Ename from Emp;

+--------+--------+

| Emp_id | Ename |

+--------+--------+

| 1 | Suman |

| 2 | Sanjay |
| 3 | Ravi |

+--------+--------+

3 rows in set (0.00 sec)

mysql> create table Student (Admno INT, Name VARCHAR(100), Class INT, House VARCHAR(60);

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 '' at line 1

mysql> create table Student (Admno INT,Name VARCHAR(100),Class INT,House VARCHAR(60);

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 '' at line 1

mysql> create table Student (Admno INT,Name VARCHAR(100),Class INT,House VARCHAR(60));

Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO Student VALUES ('1001','Sonam','9','Blue');

Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO Student VALUES ('1002','Ravi','10','Yellow');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO Student VALUES ('1003','Poonam','10','Green');

Query OK, 1 row affected (0.00 sec)

mysql> select*from Student;

+-------+--------+-------+--------+

| Admno | Name | Class | House |

+-------+--------+-------+--------+

| 1001 | Sonam | 9 | Blue |

| 1002 | Ravi | 10 | Yellow |


| 1003 | Poonam | 10 | Green |

+-------+--------+-------+--------+

3 rows in set (0.00 sec)

mysql> select*from Student where House='Blue'

-> ;

+-------+-------+-------+-------+

| Admno | Name | Class | House |

+-------+-------+-------+-------+

| 1001 | Sonam | 9 | Blue |

+-------+-------+-------+-------+

1 row in set (0.00 sec)

mysql> select Admno from Student where House='Green';

+-------+

| Admno |

+-------+

| 1003 |

+-------+

1 row in set (0.00 sec)

mysql> select*from Student order by Admno Asc;

+-------+--------+-------+--------+

| Admno | Name | Class | House |

+-------+--------+-------+--------+

| 1001 | Sonam | 9 | Blue |

| 1002 | Ravi | 10 | Yellow |


| 1003 | Poonam | 10 | Green |

+-------+--------+-------+--------+

3 rows in set (0.00 sec)

mysql> select*from Student order by Admno Dsc;

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 'Dsc' at line 1

mysql> select*from Student order by Admno Dec;

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 'Dec' at line 1

mysql> select*from Student order by Admno Desc;

+-------+--------+-------+--------+

| Admno | Name | Class | House |

+-------+--------+-------+--------+

| 1003 | Poonam | 10 | Green |

| 1002 | Ravi | 10 | Yellow |

| 1001 | Sonam | 9 | Blue |

+-------+--------+-------+--------+

3 rows in set (0.00 sec)

mysql> select*from Student where class='10'

-> ;

+-------+--------+-------+--------+

| Admno | Name | Class | House |

+-------+--------+-------+--------+

| 1002 | Ravi | 10 | Yellow |

| 1003 | Poonam | 10 | Green |

+-------+--------+-------+--------+
2 rows in set (0.00 sec)

mysql> selecr Class from Student where Name='Ravi';

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 'selecr Class from Student where
Name='Ravi'' at line 1

mysql> select Class from Student where Name='Ravi';

+-------+

| Class |

+-------+

| 10 |

+-------+

1 row in set (0.00 sec)

mysql> INSERT INTO Student VALUES ('1004','Aman','11','Blue');

Query OK, 1 row affected (0.00 sec)

mysql> select*from Student;

+-------+--------+-------+--------+

| Admno | Name | Class | House |

+-------+--------+-------+--------+

| 1001 | Sonam | 9 | Blue |

| 1002 | Ravi | 10 | Yellow |

| 1003 | Poonam | 10 | Green |

| 1004 | Aman | 11 | Blue |

+-------+--------+-------+--------+

4 rows in set (0.00 sec)


mysql> create table Item (Itemno INT, Iname VARCHAR(80),Price INT, Qty INT);

Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO Item VALUES (('12','Pen','10','17'),('13','Eraser','5','15'),


('14','Notebook','15','20'));

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> INSERT INTO Item VALUES ('12','Pen','10','17'),('13','Eraser','5','15'),('14','Notebook','15','20');

Query OK, 3 rows affected (0.00 sec)

Records: 3 Duplicates: 0 Warnings: 0

mysql> select*from Item;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+

| 12 | Pen | 10 | 17 |

| 13 | Eraser | 5 | 15 |

| 14 | Notebook | 15 | 20 |

+--------+----------+-------+------+

3 rows in set (0.00 sec)

mysql> INSERT INTO Item VALUES ('15','Pencil','20','10');

Query OK, 1 row affected (0.00 sec)

mysql> select*from Item;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+

| 12 | Pen | 10 | 17 |
| 13 | Eraser | 5 | 15 |

| 14 | Notebook | 15 | 20 |

| 15 | Pencil | 20 | 10 |

+--------+----------+-------+------+

4 rows in set (0.00 sec)

mysql> select*from Item where Qty>10;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+

| 12 | Pen | 10 | 17 |

| 13 | Eraser | 5 | 15 |

| 14 | Notebook | 15 | 20 |

+--------+----------+-------+------+

3 rows in set (0.00 sec)

mysql> update Item set Qty='25' where Itemno='13';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> select*from Item;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+

| 12 | Pen | 10 | 17 |

| 13 | Eraser | 5 | 25 |

| 14 | Notebook | 15 | 20 |
| 15 | Pencil | 20 | 10 |

+--------+----------+-------+------+

4 rows in set (0.00 sec)

mysql> select Price*Qty from Item;

+-----------+

| Price*Qty |

+-----------+

| 170 |

| 125 |

| 300 |

| 200 |

+-----------+

4 rows in set (0.00 sec)

mysql> select Iname from Item where Price='10';

+-------+

| Iname |

+-------+

| Pen |

+-------+

1 row in set (0.00 sec)

mysql> select*from Item order by Price asc;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+
| 13 | Eraser | 5 | 25 |

| 12 | Pen | 10 | 17 |

| 14 | Notebook | 15 | 20 |

| 15 | Pencil | 20 | 10 |

+--------+----------+-------+------+

4 rows in set (0.00 sec)

mysql> update Item set Price=Price+2;

Query OK, 4 rows affected (0.00 sec)

Rows matched: 4 Changed: 4 Warnings: 0

mysql> select*from Item;

+--------+----------+-------+------+

| Itemno | Iname | Price | Qty |

+--------+----------+-------+------+

| 12 | Pen | 12 | 17 |

| 13 | Eraser | 7 | 25 |

| 14 | Notebook | 17 | 20 |

| 15 | Pencil | 22 | 10 |

+--------+----------+-------+------+

4 rows in set (0.00 sec)

mysql> update Item set Price=Price-2 where Price<20;

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3 Changed: 3 Warnings: 0

mysql> show tables;


+--------------------+

| Tables_in_practice |

+--------------------+

| emp |

| item |

| student |

+--------------------+

3 rows in set (0.00 sec)

mysql> create table STUDENT (ADMNO INT,NAME VARCHAR (100),GRADE INT,DOB


DATETIME,MARKS INT,HOUSE VARCHAR(100),GENDER CHAR);

ERROR 1050 (42S01): Table 'student' already exists

mysql> create table STUDENTS (ADMNO INT,NAME VARCHAR (100),GRADE INT,DOB


DATETIME,MARKS INT,HOUSE VARCHAR(100),GENDER CHAR);

Query OK, 0 rows affected (0.02 sec)

mysql> desc STUDENTS;

+--------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+--------------+------+-----+---------+-------+

| ADMNO | int | YES | | NULL | |

| NAME | varchar(100) | YES | | NULL | |

| GRADE | int | YES | | NULL | |

| DOB | datetime | YES | | NULL | |

| MARKS | int | YES | | NULL | |

| HOUSE | varchar(100) | YES | | NULL | |

| GENDER | char(1) | YES | | NULL | |

+--------+--------------+------+-----+---------+-------+
7 rows in set (0.00 sec)

mysql> INSERT INTO STUDENTS VALUES ('1001','RUPAL','9','10/04/2006','76','GREEN','M');

ERROR 1292 (22007): Incorrect datetime value: '10/04/2006' for column 'DOB' at row 1

mysql> INSERT INTO STUDENTS VALUES ('1001','RUPAL','9','10-04-2006','76','GREEN','M');

ERROR 1292 (22007): Incorrect datetime value: '10-04-2006' for column 'DOB' at row 1

mysql> INSERT INTO STUDENTS VALUES ('1001','RUPAL','9','2006-04-10','76','GREEN','M');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO STUDENTS VALUES ('1002','RASHMI','9','2005-12-08','87','RED','F');

Query OK, 1 row affected (0.00 sec)

mysql> SELECT*FROM STUDENTS;

+-------+--------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |

+-------+--------+-------+---------------------+-------+-------+--------+

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1002 | RASHMI | 9 | 2005-12-08 00:00:00 | 87 | RED | F |

+-------+--------+-------+---------------------+-------+-------+--------+

2 rows in set (0.00 sec)

mysql> ALTER TABLE STUDENTS MODIFY(DOB DATE);

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 '(DOB DATE)' at line 1

mysql> ALTER TABLE STUDENTS MODIFY(DOB DATETIME);

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 '(DOB DATETIME)' at line 1

mysql> ALTER TABLE STUDENTS MODIFY (DOB DATE);


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 '(DOB DATE)' at line 1

mysql>

mysql> ALTER TABLE STUDENTS MODIFY ('DOB' DATE);

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 '('DOB' DATE)' at line 1

mysql> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9',2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'> );

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9',2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10',0','2004-08-26','89','BLUE','M');

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 '','68',RED','F'),('1005','ARUN','9','2005-
07-16','72','GREEN','M'),('1006','TIA'' at line 1

mysql> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9',2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

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 '','68',RED','F'),('1005','ARUN','9','2005-
07-16','72','GREEN','M'),('1006','TIA'' at line 1

mysql> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'> ;

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

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 '','F'),('1005','ARUN','9','2005-07-
16','72','GREEN','M'),('1006','TIA','9','2005' at line 1

mysql> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');
'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),
('1004','SUMONA','9','2005-08-23','68','RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'>

'>

'>

'>

'>

'>

'>

'>

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68','RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68','RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68','RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

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 '','F'),('1005','ARUN','9','2005-07-
16','72','GREEN','M'),('1006','TIA','9','2005' at line 1

mysql> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68','RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

Query OK, 5 rows affected (0.00 sec)

Records: 5 Duplicates: 0 Warnings: 0

mysql> SELECT*FROM STUDENTS;


+-------+--------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |

+-------+--------+-------+---------------------+-------+-------+--------+

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1002 | RASHMI | 9 | 2005-12-08 00:00:00 | 87 | RED | F |

| 1003 | ARNAV | 10 | 2004-05-25 00:00:00 | 81 | GREEN | M |

| 1004 | SUMONA | 9 | 2005-08-23 00:00:00 | 68 | RED | F |

| 1005 | ARUN | 9 | 2005-07-16 00:00:00 | 72 | GREEN | M |

| 1006 | TIA | 9 | 2005-09-22 00:00:00 | 91 | BLUE | F |

| 1007 | ROSHAN | 10 | 2004-08-26 00:00:00 | 89 | BLUE | M |

+-------+--------+-------+---------------------+-------+-------+--------+

7 rows in set (0.00 sec)

mysql> SELECT*FROM STUDENTS WHERE HOUSE='GREEN';

+-------+-------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |

+-------+-------+-------+---------------------+-------+-------+--------+

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1003 | ARNAV | 10 | 2004-05-25 00:00:00 | 81 | GREEN | M |

| 1005 | ARUN | 9 | 2005-07-16 00:00:00 | 72 | GREEN | M |

+-------+-------+-------+---------------------+-------+-------+--------+

3 rows in set (0.00 sec)

mysql> UPDATE STUDENTS SET MARKS=MARKS+5 WHERE ADMNO='1005';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0


mysql> SELECT*FROM STUDENTS WHERE MARKS<80;

+-------+--------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |

+-------+--------+-------+---------------------+-------+-------+--------+

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1004 | SUMONA | 9 | 2005-08-23 00:00:00 | 68 | RED | F |

| 1005 | ARUN | 9 | 2005-07-16 00:00:00 | 77 | GREEN | M |

+-------+--------+-------+---------------------+-------+-------+--------+

3 rows in set (0.00 sec)

mysql> SELECT*FROM STUDENTS ORDER BY MARKS DESC;

+-------+--------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |

+-------+--------+-------+---------------------+-------+-------+--------+

| 1006 | TIA | 9 | 2005-09-22 00:00:00 | 91 | BLUE | F |

| 1007 | ROSHAN | 10 | 2004-08-26 00:00:00 | 89 | BLUE | M |

| 1002 | RASHMI | 9 | 2005-12-08 00:00:00 | 87 | RED | F |

| 1003 | ARNAV | 10 | 2004-05-25 00:00:00 | 81 | GREEN | M |

| 1005 | ARUN | 9 | 2005-07-16 00:00:00 | 77 | GREEN | M |

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1004 | SUMONA | 9 | 2005-08-23 00:00:00 | 68 | RED | F |

+-------+--------+-------+---------------------+-------+-------+--------+

7 rows in set (0.00 sec)

mysql> SELECT*FROM STUDENTS ORDER BY ADMNO ASC;

+-------+--------+-------+---------------------+-------+-------+--------+

| ADMNO | NAME | GRADE | DOB | MARKS | HOUSE | GENDER |


+-------+--------+-------+---------------------+-------+-------+--------+

| 1001 | RUPAL | 9 | 2006-04-10 00:00:00 | 76 | GREEN | M |

| 1002 | RASHMI | 9 | 2005-12-08 00:00:00 | 87 | RED | F |

| 1003 | ARNAV | 10 | 2004-05-25 00:00:00 | 81 | GREEN | M |

| 1004 | SUMONA | 9 | 2005-08-23 00:00:00 | 68 | RED | F |

| 1005 | ARUN | 9 | 2005-07-16 00:00:00 | 77 | GREEN | M |

| 1006 | TIA | 9 | 2005-09-22 00:00:00 | 91 | BLUE | F |

| 1007 | ROSHAN | 10 | 2004-08-26 00:00:00 | 89 | BLUE | M |

+-------+--------+-------+---------------------+-------+-------+--------+

7 rows in set (0.00 sec)

mysql> SHOW TABLES;

+--------------------+

| Tables_in_practice |

+--------------------+

| emp |

| item |

| student |

| students |

+--------------------+

4 rows in set (0.00 sec)

mysql> SHOW DATABASES;

+--------------------+

| Database |

+--------------------+

| ani |
| blank_hiho |

| information_schema |

| macces |

| mysql |

| performance_schema |

| practice |

| sakila |

| student_practice |

| sys |

| world |

+--------------------+

11 rows in set (0.00 sec)

mysql> DROP DATABASE blank_hiho;

Query OK, 1 row affected (0.05 sec)

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| ani |

| information_schema |

| macces |

| mysql |

| performance_schema |

| practice |

| sakila |
| student_practice |

| sys |

| world |

+--------------------+

10 rows in set (0.00 sec)

mysql> use student_practice;

Database changed

mysql> desc table;

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 '' at line 1

mysql> show tables;

+----------------------------+

| Tables_in_student_practice |

+----------------------------+

| info |

| information |

+----------------------------+

2 rows in set (0.00 sec)

mysql> desc info;

+-----------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-----------+-------------+------+-----+---------+-------+

| firstname | varchar(25) | YES | | NULL | |

| lastname | varchar(25) | YES | | NULL | |

| gender | char(1) | YES | | NULL | |

| grade | int | YES | | NULL | |


| dob | date | YES | | NULL | |

+-----------+-------------+------+-----+---------+-------+

5 rows in set (0.00 sec)

mysql> select*from info;

+-----------+----------+--------+-------+------------+

| firstname | lastname | gender | grade | dob |

+-----------+----------+--------+-------+------------+

| Amanda | Williams | m | 10 | 1999-03-30 |

+-----------+----------+--------+-------+------------+

1 row in set (0.01 sec)

mysql> desc information;

+------------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+------------+-------------+------+-----+---------+-------+

| firstname | varchar(20) | YES | | NULL | |

| lastname | varchar(20) | YES | | NULL | |

| gender | char(1) | YES | | NULL | |

| grade | int | YES | | NULL | |

| dob | date | YES | | NULL | |

| rollnumber | int | YES | | NULL | |

+------------+-------------+------+-----+---------+-------+

6 rows in set (0.00 sec)

mysql> select*from information;

+-----------+----------+--------+-------+------------+------------+
| firstname | lastname | gender | grade | dob | rollnumber |

+-----------+----------+--------+-------+------------+------------+

| Devraj | Singh | m | 10 | 2007-08-13 | NULL |

| Priya | Kumari | f | 10 | 2005-06-23 | NULL |

| Sonu | Jha |f | 10 | 1999-01-25 | NULL |

+-----------+----------+--------+-------+------------+------------+

3 rows in set (0.00 sec)

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| ani |

| information_schema |

| macces |

| mysql |

| performance_schema |

| practice |

| sakila |

| student_practice |

| sys |

| world |

+--------------------+

10 rows in set (0.00 sec)

mysql> use ani;

Database changed
mysql> show tables;

+---------------+

| Tables_in_ani |

+---------------+

| aniruddha |

+---------------+

1 row in set (0.00 sec)

mysql> desc aniruddha;

+-------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------+-------------+------+-----+---------+-------+

| name | varchar(90) | YES | | NULL | |

+-------+-------------+------+-----+---------+-------+

1 row in set (0.00 sec)

mysql> drop ani;

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 'ani' at line 1

mysql> drop database ani;

Query OK, 1 row affected (0.01 sec)

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| macces |
| mysql |

| performance_schema |

| practice |

| sakila |

| student_practice |

| sys |

| world |

+--------------------+

9 rows in set (0.00 sec)

mysql> use practice;

Database changed

mysql> CREATE TABLE PLAYER (PID CHAR(10),PNAME VARCHAR(50),RUNS INT,GENDER CHAR,DOB


DATE);

Query OK, 0 rows affected (0.01 sec)

mysql> DESC PLAYER;

+--------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| PID | char(10) | YES | | NULL | |

| PNAME | varchar(50) | YES | | NULL | |

| RUNS | int | YES | | NULL | |

| GENDER | char(1) | YES | | NULL | |

| DOB | date | YES | | NULL | |

+--------+-------------+------+-----+---------+-------+

5 rows in set (0.00 sec)


mysql> INSERT INTO PLAYER ('P101','SACHIN','13000','M','2001-04-10'),
('P102','KAPIL','7000','M','1998-02-12'),('P103','SAURABH','12000','M','2001-04-13'),
('P104','VIRAT','12500','M','2005-03-17');

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 ''P101','SACHIN','13000','M','2001-04-
10'),('P102','KAPIL','7000','M','1998-02-12' at line 1

mysql> INSERT INTO PLAYER ('P101','SACHIN','13000','M','2001-04-10'),


('P102','KAPIL','7000','M','1998-02-12'),('P103','SAURABH','12000','M','2001-04-13'),
('P104','VIRAT','12500','M','2005-03-17'));

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 ''P101','SACHIN','13000','M','2001-04-
10'),('P102','KAPIL','7000','M','1998-02-12' at line 1

mysql> INSERT INTO PLAYER (('P101','SACHIN','13000','M','2001-04-10'),


('P102','KAPIL','7000','M','1998-02-12'),('P103','SAURABH','12000','M','2001-04-13'),
('P104','VIRAT','12500','M','2005-03-17'));

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 ''P101','SACHIN','13000','M','2001-04-
10'),('P102','KAPIL','7000','M','1998-02-12' at line 1

mysql>

mysql>

mysql>

mysql> INSERT INTO PLAYER ('P101','SACHIN','13000','M','2001-04-10');

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 ''P101','SACHIN','13000','M','2001-04-10')'
at line 1

mysql> INSERT INTO PLAYER ('P101','SACHIN','13000','M','2001-04-10');

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 ''P101','SACHIN','13000','M','2001-04-10')'
at line 1

mysql> INSERT INTO PLAYER 'P101','SACHIN','13000','M','2001-04-10');

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 ''P101','SACHIN','13000','M','2001-04-10')'
at line 1

mysql> INSERT INTO PLAYER 'P101','SACHIN','13000','M','2001-04-10


'> ;

'> ;

'> INSERT INTO PLAYER 'P101','SACHIN','13000','M','2001-04-10');

'> INSERT INTO PLAYER (('P101','SACHIN','13000','M','2001-04-10'),('P102','KAPIL','7000','M','1998-


02-12'),('P103','SAURABH','12000','M','2001-04-13'),('P104','VIRAT','12500','M','2005-03-17'));

'> \

'>

'> INSERT INTO PLAYER (('P101','SACHIN','13000','M','2001-04-10'),('P102','KAPIL','7000','M','1998-


02-12'),('P103','SAURABH','12000','M','2001-04-13'),('P104','VIRAT','12500','M','2005-03-17'));

'>

'>

'> m;

'> mysql>

'> ;

'>

'>

'>

'>

'>

'> show tables;

'>

'> INSERT INTO STUDENTS VALUES ('1003','ARNAV','10','2004-05-25','81','GREEN','M'),


('1004','SUMONA','9','2005-08-23','68',RED','F'),('1005','ARUN','9','2005-07-16','72','GREEN','M'),
('1006','TIA','9','2005-09-22','91','BLUE','F'),('1007','ROSHAN','10','2004-08-26','89','BLUE','M');

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 ''P101','SACHIN','13000','M','2001-04-10

INSERT INTO PLAYER 'P101','SACHIN','' at line 1


mysql> INSERT INTO PLAYER ('P101','SACHIN','13000','M','2001-04-10'),
('P102','KAPIL','7000','M','1998-02-12'),('P103','SAURABH','12000','M','2001-04-13'),
('P104','VIRAT','12500','M','2005-03-17');

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 ''P101','SACHIN','13000','M','2001-04-
10'),('P102','KAPIL','7000','M','1998-02-12' at line 1

mysql> show tables;

+--------------------+

| Tables_in_practice |

+--------------------+

| emp |

| item |

| player |

| student |

| students |

+--------------------+

5 rows in set (0.00 sec)

mysql> desc player;

+--------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| PID | char(10) | YES | | NULL | |

| PNAME | varchar(50) | YES | | NULL | |

| RUNS | int | YES | | NULL | |

| GENDER | char(1) | YES | | NULL | |

| DOB | date | YES | | NULL | |

+--------+-------------+------+-----+---------+-------+

5 rows in set (0.00 sec)


mysql> INSERT INTO PLAYER VALUES ('P101','SACHIN','13000','M','2001-04-10'),
('P102','KAPIL','7000','M','1998-02-12'),('P103','SAURABH','12000','M','2001-04-13'),
('P104','VIRAT','12500','M','2005-03-17');

Query OK, 4 rows affected (0.01 sec)

Records: 4 Duplicates: 0 Warnings: 0

mysql> select*from player;

+------+---------+-------+--------+------------+

| PID | PNAME | RUNS | GENDER | DOB |

+------+---------+-------+--------+------------+

| P101 | SACHIN | 13000 | M | 2001-04-10 |

| P102 | KAPIL | 7000 | M | 1998-02-12 |

| P103 | SAURABH | 12000 | M | 2001-04-13 |

| P104 | VIRAT | 12500 | M | 2005-03-17 |

+------+---------+-------+--------+------------+

4 rows in set (0.00 sec)

mysql> create table EMPLOYEE (EMP_ID INT,NAME VARCHAR(200),SALARY INT,DATE OF JOINING


DATE,COMMISSION INT,DEPARTMNET VARCHAR(50),GEND

ER CHAR);

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 'OF JOINING DATE,COMMISSION
INT,DEPARTMNET VARCHAR(50),GENDER CHAR)' at line 1

mysql> create table EMPLOYEE (EMP_ID INT,NAME VARCHAR(200),SALARY INT,DOJ


DATE,COMMISSION INT,DEPARTMNET VARCHAR(50),GENDER CHAR);

Query OK, 0 rows affected (0.02 sec)

mysql> DESC EMPLOYEE;

+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |

+------------+--------------+------+-----+---------+-------+

| EMP_ID | int | YES | | NULL | |

| NAME | varchar(200) | YES | | NULL | |

| SALARY | int | YES | | NULL | |

| DOJ | date | YES | | NULL | |

| COMMISSION | int | YES | | NULL | |

| DEPARTMNET | varchar(50) | YES | | NULL | |

| GENDER | char(1) | YES | | NULL | |

+------------+--------------+------+-----+---------+-------+

7 rows in set (0.00 sec)

mysql> INSERT INTO EMPLOYEE VALUES (M

->

-> 300

->

-> SALES

->

-> 10/04/2006

->

-> 7000

->

-> 1001;

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 '300

SALES
10/04/2006

7000

1001' at line 3

mysql> INSERT INTO EMPLOYEE VALUES ('1001','ROHAN','7000','2006-04-10','300','SALES','M');

Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

'> );

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M'),('1006','TAMNNA','15000','2005-
09-22','200','FINANCE','F'),('1007','ROHIT' at line 1

mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M'),('1006','TAMNNA','15000','2005-
09-22','200','FINANCE','F'),('1007','ROHIT' at line 1
mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),
('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'> INSERT INTO EMPLOYEE VALUES ('1001','ROHAN','7000','2006-04-10','300','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1001','ROHAN','7000','2006-04-10','300','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1001','ROHAN','7000','2006-04-10','300','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M'),('1006','TAMNNA','15000','2005-
09-22','200','FINANCE','F'),('1007','ROHIT' at line 1

mysql>

mysql>
mysql>

mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>

'>
'>

'>

'>

'>

'>

'>

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M'),('1006','TAMNNA','15000','2005-
09-22','200','FINANCE','F'),('1007','ROHIT' at line 1

mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M'),('1006','TAMNNA','15000','2005-
09-22','200','FINANCE','F'),('1007','ROHIT' at line 1

mysql>

mysql>

mysql>

mysql>

mysql>

mysql>

mysql>
mysql>

mysql>

mysql>

mysql> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO EMPLOYEE VALUES ('1003','DEVANSH','9000','2004-05-25','500','SALES','M');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO EMPLOYEE VALUES ('1004','SUMAN','10000','2005-08-


23','300','MARKETING','F');

Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO EMPLOYEE VALUES ('1005','ARYAN','11000','2005-07-16','500',SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1005','ARYAN','11000','2005-07-16','500','SALES','M');

'> INSERT INTO EMPLOYEE VALUES ('1002','RISHU','12000','2005-12-08','100','FINANCE','F'),


('1003','DEVANSH','9000','2004-05-25','500','SALES','M'),('1004','SUMAN','10000','2005-08-
23','300','MARKETING','F'),('1005','ARYAN','11000','2005-07-16','500',SALES','M'),
('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),('1007','ROHIT','8000','2004-08-
26','900','SALES','M');

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 '','M');

INSERT INTO EMPLOYEE VALUES ('1005','ARYAN','11000','2005-07-16','500','' at line 1

mysql> INSERT INTO EMPLOYEE VALUES ('1003','DEVANSH','9000','2004-05-25','500','SALES','M');

Query OK, 1 row affected (0.00 sec)

mysql>

mysql> INSERT INTO EMPLOYEE VALUES ('1006','TAMNNA','15000','2005-09-22','200','FINANCE','F'),


('1007','ROHIT','8000','2004-08-26','900','SALES','M');

Query OK, 2 rows affected (0.00 sec)


Records: 2 Duplicates: 0 Warnings: 0

mysql> select*from employee;

+--------+---------+--------+------------+------------+------------+--------+

| EMP_ID | NAME | SALARY | DOJ | COMMISSION | DEPARTMNET | GENDER |

+--------+---------+--------+------------+------------+------------+--------+

| 1001 | ROHAN | 7000 | 2006-04-10 | 300 | SALES |M |

| 1002 | RISHU | 12000 | 2005-12-08 | 100 | FINANCE | F |

| 1003 | DEVANSH | 9000 | 2004-05-25 | 500 | SALES |M |

| 1004 | SUMAN | 10000 | 2005-08-23 | 300 | MARKETING | F |

| 1003 | DEVANSH | 9000 | 2004-05-25 | 500 | SALES |M |

| 1006 | TAMNNA | 15000 | 2005-09-22 | 200 | FINANCE | F |

| 1007 | ROHIT | 8000 | 2004-08-26 | 900 | SALES |M |

+--------+---------+--------+------------+------------+------------+--------+

7 rows in set (0.00 sec)

mysql>

You might also like