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

null not, operators

The document details a MySQL session where the user connects to the MySQL monitor, attempts to access various databases and tables, and executes several SQL queries. It highlights errors encountered when trying to access non-existent databases or tables and demonstrates successful queries retrieving employee data and performing calculations. Additionally, it showcases the use of variables and functions within SQL commands.

Uploaded by

Shweta Raut
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

null not, operators

The document details a MySQL session where the user connects to the MySQL monitor, attempts to access various databases and tables, and executes several SQL queries. It highlights errors encountered when trying to access non-existent databases or tables and demonstrates successful queries retrieving employee data and performing calculations. Additionally, it showcases the use of variables and functions within SQL commands.

Uploaded by

Shweta Raut
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Enter password: ********

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


Your MySQL connection id is 17
Server version: 8.0.28 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> use jfsdeveloper;


ERROR 1049 (42000): Unknown database 'jfsdeveloper'
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| abcd |
| advancedmysql |
| capgeminipro |
| cbse |
| ccprogram |
| chennaisalem |
| chennnaisalam |
| class12 |
| classicmodels |
| ctbangalore |
| dbsboa |
| dd33 |
| dd33sdf |
| ddd |
| great |
| information_schema |
| javafullstack |
| jdeveloper |
| jfs |
| madhura |
| morningbatch |
| mumbaicgaws |
| mumbang |
| myconnection |
| myproject |
| mysql |
| narasimh |
| narasimha |
| new_schema |
| otp |
| performance_schema |
| pune |
| sys |
| thane |
| vardb |
+--------------------+
35 rows in set (0.11 sec)

mysql> use jdeveloper;


Database changed
mysql> table jfsdeveloper;
ERROR 1146 (42S02): Table 'jdeveloper.jfsdeveloper' doesn't exist
mysql> show tables;
+----------------------+
| Tables_in_jdeveloper |
+----------------------+
| abc |
| ads |
| employee |
| hibernate_sequence |
| javad |
| jdevel |
| person |
| sboa |
| sboa1 |
| sdf |
| student |
| users |
| vvv |
| welcomelear |
| worker |
+----------------------+
15 rows in set (0.03 sec)

mysql> show databases;


+--------------------+
| Database |
+--------------------+
| abcd |
| advancedmysql |
| capgeminipro |
| cbse |
| ccprogram |
| chennaisalem |
| chennnaisalam |
| class12 |
| classicmodels |
| ctbangalore |
| dbsboa |
| dd33 |
| dd33sdf |
| ddd |
| great |
| information_schema |
| javafullstack |
| jdeveloper |
| jfs |
| madhura |
| morningbatch |
| mumbaicgaws |
| mumbang |
| myconnection |
| myproject |
| mysql |
| narasimh |
| narasimha |
| new_schema |
| otp |
| performance_schema |
| pune |
| sys |
| thane |
| vardb |
+--------------------+
35 rows in set (0.00 sec)

mysql> use jfs;


Database changed
mysql> show tables;
+---------------------+
| Tables_in_jfs |
+---------------------+
| a |
| abc |
| achecking |
| afterunique |
| ai |
| anull |
| arrayconcept |
| arraypro1 |
| arrayprocess |
| auto111 |
| auto123 |
| autoinc |
| b |
| batsman |
| bchecking |
| beforeunique |
| bnull |
| booleanex |
| bowler |
| cnull |
| con |
| cons |
| consnp |
| constr |
| cursor_table |
| cust |
| customer |
| customers |
| def |
| default12 |
| dev2 |
| dev3 |
| developer |
| devloper2 |
| dnull |
| eee |
| empfemaledetails |
| employee |
| empmale |
| empmaledetails |
| estudent |
| example |
| exportmysqltable |
| friend1 |
| friend2 |
| insertdemo |
| javadeveloper |
| jfresher |
| jfsemployee |
| manager123 |
| managernew |
| narasimha |
| newtable |
| notconstr |
| notnull |
| pertab |
| pk |
| pk1 |
| primarykey |
| product |
| productdetailsdummy |
| programmers1 |
| pune |
| qqq |
| simple1 |
| simple2 |
| t1 |
| t2 |
| tt |
| uni |
+---------------------+
70 rows in set (0.02 sec)

mysql> table jfsemployee;


+--------+----------------+---------+------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+------------+--------+------+------------+
16 rows in set (0.01 sec)

mysql> select emp_name from employee4 where salary between 100000 and 125000 order
by emp_name desc;
ERROR 1146 (42S02): Table 'jfs.employee4' doesn't exist
mysql> select emp_name from jfsemployee where salary between 100000 and 125000
order by emp_name desc;
+----------------+
| emp_name |
+----------------+
| Selvaganapathy |
| revathi |
| Ramya |
| Rajkamal |
| Mohammed |
| Karthick |
| dharani |
| Ashutosh |
| Allwin |
+----------------+
9 rows in set (0.01 sec)

mysql> select emp_name, salary from jfsemployee where salary between 100000 and
125000 order by emp_name desc;
+----------------+--------+
| emp_name | salary |
+----------------+--------+
| Selvaganapathy | 120000 |
| revathi | 120000 |
| Ramya | 120000 |
| Rajkamal | 120000 |
| Mohammed | 120000 |
| Karthick | 120000 |
| dharani | 120000 |
| Ashutosh | 120000 |
| Allwin | 120000 |
+----------------+--------+
9 rows in set (0.00 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+------------+--------+------+------------+
16 rows in set (0.00 sec)

mysql> select * from jfsemployee where dob is null;


Empty set (0.00 sec)

mysql> select * from jfsemployee where dob=null;


Empty set (0.00 sec)

mysql> select emp_name from jfsemployee where dob=null;


Empty set (0.00 sec)
mysql> select emp_name from jfsemployee where not (dob=null;)
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
-> ;
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> select emp_name from jfsemployee where not (dob=null);
Empty set (0.00 sec)

mysql> select is null(12,2,,4);


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 'is
null(12,2,,4)' at line 1
mysql> select 1=null;
+--------+
| 1=null |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)

mysql> select 0=null;


+--------+
| 0=null |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)

mysql> select 1<>null;


+---------+
| 1<>null |
+---------+
| NULL |
+---------+
1 row in set (0.00 sec)

mysql> set @var=12;


Query OK, 0 rows affected (0.01 sec)

mysql> select @var;


+------+
| @var |
+------+
| 12 |
+------+
1 row in set (0.00 sec)

mysql> select @var+12;


+---------+
| @var+12 |
+---------+
| 24 |
+---------+
1 row in set (0.00 sec)
mysql> select @var+@var;
+-----------+
| @var+@var |
+-----------+
| 24 |
+-----------+
1 row in set (0.00 sec)

mysql> set @n='';


Query OK, 0 rows affected (0.00 sec)

mysql> select @n<>null;


+----------+
| @n<>null |
+----------+
| NULL |
+----------+
1 row in set (0.00 sec)

mysql> select 1+45;


+------+
| 1+45 |
+------+
| 46 |
+------+
1 row in set (0.00 sec)

mysql> select sin(90);


+--------------------+
| sin(90) |
+--------------------+
| 0.8939966636005579 |
+--------------------+
1 row in set (0.01 sec)

mysql> select sqrt(144);


+-----------+
| sqrt(144) |
+-----------+
| 12 |
+-----------+
1 row in set (0.00 sec)

mysql> select pow(2,3);


+----------+
| pow(2,3) |
+----------+
| 8 |
+----------+
1 row in set (0.00 sec)

mysql> select now();


+---------------------+
| now() |
+---------------------+
| 2023-08-01 14:38:29 |
+---------------------+
1 row in set (0.01 sec)
mysql> select now(),pow(3,2),sum(45,45),3+20;
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
',45),3+20' at line 1
mysql> select now(),pow(3,2),sum(45,45);
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 ',45)' at
line 1
mysql> select now(),pow(3,2),45+45;
+---------------------+----------+-------+
| now() | pow(3,2) | 45+45 |
+---------------------+----------+-------+
| 2023-08-01 14:40:08 | 9 | 90 |
+---------------------+----------+-------+
1 row in set (0.00 sec)

mysql> select now(),pow(3,2),45+45,true;


+---------------------+----------+-------+------+
| now() | pow(3,2) | 45+45 | true |
+---------------------+----------+-------+------+
| 2023-08-01 14:40:26 | 9 | 90 | 1 |
+---------------------+----------+-------+------+
1 row in set (0.00 sec)

mysql> select now(),pow(3,2),45+45,true,false;


+---------------------+----------+-------+------+-------+
| now() | pow(3,2) | 45+45 | true | false |
+---------------------+----------+-------+------+-------+
| 2023-08-01 14:40:33 | 9 | 90 | 1 | 0 |
+---------------------+----------+-------+------+-------+
1 row in set (0.00 sec)

mysql> select now(),pow(3,2),45+45,true,false from dual;


+---------------------+----------+-------+------+-------+
| now() | pow(3,2) | 45+45 | true | false |
+---------------------+----------+-------+------+-------+
| 2023-08-01 14:41:11 | 9 | 90 | 1 | 0 |
+---------------------+----------+-------+------+-------+
1 row in set (0.00 sec)

mysql> select now(),pow(3,2),45+45,true,false from dual @n is null,@var is null;


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 '@n is
null,@var is null' at line 1
mysql> select now(),pow(3,2),45+45,true,false, @n is null,@var is null;
+---------------------+----------+-------+------+-------+------------
+--------------+
| now() | pow(3,2) | 45+45 | true | false | @n is null | @var is null
|
+---------------------+----------+-------+------+-------+------------
+--------------+
| 2023-08-01 14:42:08 | 9 | 90 | 1 | 0 | 0 | 0
|
+---------------------+----------+-------+------+-------+------------
+--------------+
1 row in set (0.00 sec)

mysql> set @q;


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> set @q=null;
Query OK, 0 rows affected (0.00 sec)

mysql> select now(),pow(3,2),45+45,true,false, @q is null,@var is null;


+---------------------+----------+-------+------+-------+------------
+--------------+
| now() | pow(3,2) | 45+45 | true | false | @q is null | @var is null
|
+---------------------+----------+-------+------+-------+------------
+--------------+
| 2023-08-01 14:42:32 | 9 | 90 | 1 | 0 | 1 | 0
|
+---------------------+----------+-------+------+-------+------------
+--------------+
1 row in set (0.00 sec)

mysql> select @var;


+------+
| @var |
+------+
| 12 |
+------+
1 row in set (0.00 sec)

mysql> select @var, @q;


+------+------------+
| @var | @q |
+------+------------+
| 12 | NULL |
+------+------------+
1 row in set (0.00 sec)

mysql> select now(),pow(3,2),45+45,true,false, @q is not null,@var is null;


+---------------------+----------+-------+------+-------+----------------
+--------------+
| now() | pow(3,2) | 45+45 | true | false | @q is not null | @var is
null |
+---------------------+----------+-------+------+-------+----------------
+--------------+
| 2023-08-01 14:44:17 | 9 | 90 | 1 | 0 | 0 |
0 |
+---------------------+----------+-------+------+-------+----------------
+--------------+
1 row in set (0.00 sec)

mysql> select * from jfsemployee where dob is null;


Empty set (0.00 sec)

mysql> select * from jfsemployee where sdalary is null;


ERROR 1054 (42S22): Unknown column 'sdalary' in 'where clause'
mysql> select * from jfsemployee where salary is null;
Empty set (0.00 sec)

mysql> select * from jfsemployee where dob=null;


Empty set (0.00 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+------------+--------+------+------------+
16 rows in set (0.00 sec)

mysql> desc jfsemployee;


+----------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------+------+-----+---------+-------+
| emp_id | int | NO | PRI | NULL | |
| Emp_name | text | YES | | NULL | |
| dojyear | int | YES | | NULL | |
| posting | text | YES | | NULL | |
| salary | int | YES | | NULL | |
| age | int | YES | | NULL | |
| DOB | text | YES | | NULL | |
+----------+------+------+-----+---------+-------+
7 rows in set (0.04 sec)

mysql> insert into jfsemployee values(109,'bushra','2023-06-


31','Sr.Developer',123500,17);
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into jfsemployee values(109,'bushra','2023-06-
31','Sr.Developer',123500,17,null);
ERROR 1265 (01000): Data truncated for column 'dojyear' at row 1
mysql> insert into jfsemployee
values(109,'bushra',2023,'Sr.Developer',123500,17,null);
Query OK, 1 row affected (0.07 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+--------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+--------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 109 | bushra | 2023 | Sr.Developer | 123500 | 17 | NULL |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+--------------+--------+------+------------+
17 rows in set (0.00 sec)

mysql> select * from jfsemployee where dob=null;


Empty set (0.00 sec)

mysql> select * from jfsemployee where dob is null;


+--------+----------+---------+--------------+--------+------+------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------+---------+--------------+--------+------+------+
| 109 | bushra | 2023 | Sr.Developer | 123500 | 17 | NULL |
+--------+----------+---------+--------------+--------+------+------+
1 row in set (0.00 sec)

mysql> insert into jfsemployee


values(123,'sakshi',2023,'Sr.Developer',123500,17,'2000-06-31');
Query OK, 1 row affected (0.01 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+--------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+--------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 109 | bushra | 2023 | Sr.Developer | 123500 | 17 | NULL |
| 123 | sakshi | 2023 | Sr.Developer | 123500 | 17 | 2000-06-31 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+--------------+--------+------+------------+
18 rows in set (0.00 sec)

mysql> insert into jfsemployee


values(131,'ankita',2023,'Sr.Developer',123500,17,'2000-08-31');
Query OK, 1 row affected (0.01 sec)

mysql> insert into jfsemployee


values(131,'ankita',2023,'Sr.Developer',123500,17,'2000-02-31');
ERROR 1062 (23000): Duplicate entry '131' for key 'jfsemployee.PRIMARY'
mysql> insert into jfsemployee
values(132,'ankita',2023,'Sr.Developer',123500,17,'2000-02-31');
Query OK, 1 row affected (0.01 sec)

mysql> insert into jfsemployee


values(152,'ankita',2023,'Sr.Developer',123500,17,'2000/02/31');
Query OK, 1 row affected (0.01 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+--------------+--------+------+------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+--------------+--------+------+------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 109 | bushra | 2023 | Sr.Developer | 123500 | 17 | NULL |
| 123 | sakshi | 2023 | Sr.Developer | 123500 | 17 | 2000-06-31 |
| 131 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000-08-31 |
| 132 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000-02-31 |
| 152 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000/02/31 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+--------------+--------+------+------------+
21 rows in set (0.00 sec)

mysql> desc jfsemployee;


+----------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------+------+-----+---------+-------+
| emp_id | int | NO | PRI | NULL | |
| Emp_name | text | YES | | NULL | |
| dojyear | int | YES | | NULL | |
| posting | text | YES | | NULL | |
| salary | int | YES | | NULL | |
| age | int | YES | | NULL | |
| DOB | text | YES | | NULL | |
+----------+------+------+-----+---------+-------+
7 rows in set (0.01 sec)

mysql> insert into jfsemployee


values(152,'ankita',2023,'Sr.Developer',123500,17,'2000/feb/31');
ERROR 1062 (23000): Duplicate entry '152' for key 'jfsemployee.PRIMARY'
mysql> insert into jfsemployee
values(150,'ankita',2023,'Sr.Developer',123500,17,'2000/feb/31');
Query OK, 1 row affected (0.01 sec)

mysql> desc jfsemployee;


+----------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------+------+-----+---------+-------+
| emp_id | int | NO | PRI | NULL | |
| Emp_name | text | YES | | NULL | |
| dojyear | int | YES | | NULL | |
| posting | text | YES | | NULL | |
| salary | int | YES | | NULL | |
| age | int | YES | | NULL | |
| DOB | text | YES | | NULL | |
+----------+------+------+-----+---------+-------+
7 rows in set (0.00 sec)

mysql> select * from jfsemployee;


+--------+----------------+---------+--------------+--------+------+-------------+
| emp_id | Emp_name | dojyear | posting | salary | age | DOB |
+--------+----------------+---------+--------------+--------+------+-------------+
| 0 | Logabharathi | 2000 | sr-Manager | 150000 | 0 | |
| 58 | Sathyam | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 88 | Nivetha | 2000 | srManager | 150000 | 0 | |
| 89 | Lakshna | 2000 | Manager | 150000 | 22 | 1998-10-13 |
| 98 | monisha | 2000 | Manager | 150000 | 23 | 2000-11-04 |
| 99 | Gayathri | 2000 | Manager | 150000 | 24 | 2000-10-16 |
| 100 | Naveen Kumar | 2000 | srManager | 150000 | 23 | 2000-10-12 |
| 101 | dharani | 2000 | Developer | 120000 | 23 | 1998-10-13 |
| 102 | Karthick | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 103 | Mohammed | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 104 | Ramya | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 105 | Allwin | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 106 | Selvaganapathy | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 107 | Ashutosh | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 108 | Rajkamal | 2000 | Developer | 120000 | 23 | 2000-07-03 |
| 109 | bushra | 2023 | Sr.Developer | 123500 | 17 | NULL |
| 123 | sakshi | 2023 | Sr.Developer | 123500 | 17 | 2000-06-31 |
| 131 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000-08-31 |
| 132 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000-02-31 |
| 150 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000/feb/31 |
| 152 | ankita | 2023 | Sr.Developer | 123500 | 17 | 2000/02/31 |
| 233 | revathi | 2000 | developer | 120000 | 50 | 1972-12-12 |
+--------+----------------+---------+--------------+--------+------+-------------+
22 rows in set (0.00 sec)

mysql> alter table jfsemployee modify dob date;


ERROR 1292 (22007): Incorrect date value: '' for column 'dob' at row 1
mysql> select 5 in(2,3,4,5,6);
+-----------------+
| 5 in(2,3,4,5,6) |
+-----------------+
| 1 |
+-----------------+
1 row in set (0.00 sec)

mysql> select 54 in(2,3,4,5,6);


+------------------+
| 54 in(2,3,4,5,6) |
+------------------+
| 0 |
+------------------+
1 row in set (0.00 sec)

mysql> select 54 is(2,3,4,5,6);


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
'(2,3,4,5,6)' at line 1
mysql> select @q is null;
+------------+
| @q is null |
+------------+
| 1 |
+------------+
1 row in set (0.00 sec)

mysql> select @q in null;


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

You might also like