Translate

Saturday 9 October 2021

BETWEEN,LIKE,not equal operators sql videos in telugu 56

 https://youtu.be/OiZ9Xb5R1LY

-------------------------------------------
AND TRUE if all the conditions separated by AND is TRUE

OR
Warning: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe: ignoring option
'--no-beep' due to invalid value ''
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.51-log MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.

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> \c
mysql> selec \c
mysql> use vlrinst;
Database changed
mysql> select * from emp;
+-------+--------+-----------+------+------------+---------+---------+--------+
| empno | ename  | job       | mgr  | hiredate   | sal     | comm    | deptno |
+-------+--------+-----------+------+------------+---------+---------+--------+
|  7369 | SMITH  | CLERK     | 7902 | 1980-12-17 |  800.00 |    NULL |     20 |
|  7499 | ALLEN  | SALESMAN  | 7698 | 1981-02-20 | 1600.00 |  300.00 |     30 |
|  7521 | WARD   | SALESMAN  | 7698 | 1981-02-22 | 1250.00 |  500.00 |     30 |
|  7566 | JONES  | MANAGER   | 7839 | 1981-04-02 | 2975.00 |    NULL |     20 |
|  7654 | MARTIN | SALESMAN  | 7698 | 1981-09-28 | 1250.00 | 1400.00 |     30 |
|  7698 | BLAKE  | MANAGER   | 7839 | 1981-05-01 | 2850.00 |    NULL |     30 |
|  7782 | CLARK  | MANAGER   | 7839 | 1981-06-09 | 2450.00 |    NULL |     10 |
|  7788 | SCOTT  | ANALYST   | 7566 | 1982-12-09 | 3000.00 |    NULL |     20 |
|  7839 | KING   | PRESIDENT | NULL | 1981-11-17 | 5000.00 |    NULL |     10 |
|  7844 | TURNER | SALESMAN  | 7698 | 1981-09-08 | 1500.00 |    0.00 |     30 |
|  7876 | ADAMS  | CLERK     | 7788 | 1983-01-12 | 1100.00 |    NULL |     20 |
|  7900 | JAMES  | CLERK     | 7698 | 1981-12-03 |  950.00 |    NULL |     30 |
|  7902 | FORD   | ANALYST   | 7566 | 1981-12-03 | 3000.00 |    NULL |     20 |
|  7934 | MILLER | CLERK     | 7782 | 1982-01-23 | 1300.00 |    NULL |     10 |
+-------+--------+-----------+------+------------+---------+---------+--------+
14 rows in set (0.00 sec)

mysql> select ename from emp where job="clerk" and mgr=7902;
+-------+
| ename |
+-------+
| SMITH |
+-------+
1 row in set (0.00 sec)

mysql> select ename from emp where job="clerk" or mgr=7902;
+--------+
| ename  |
+--------+
| SMITH  |
| ADAMS  |
| JAMES  |
| MILLER |
+--------+
4 rows in set (0.00 sec)

mysql> select ename from emp where job="clerk" or mgr=7698;
+--------+
| ename  |
+--------+
| SMITH  |
| ALLEN  |
| WARD   |
| MARTIN |
| TURNER |
| ADAMS  |
| JAMES  |
| MILLER |
+--------+
8 rows in set (0.00 sec)

mysql> select ename,job,mgr from emp where job="clerk" or mgr=7698;
+--------+----------+------+
| ename  | job      | mgr  |
+--------+----------+------+
| SMITH  | CLERK    | 7902 |
| ALLEN  | SALESMAN | 7698 |
| WARD   | SALESMAN | 7698 |
| MARTIN | SALESMAN | 7698 |
| TURNER | SALESMAN | 7698 |
| ADAMS  | CLERK    | 7788 |
| JAMES  | CLERK    | 7698 |
| MILLER | CLERK    | 7782 |
+--------+----------+------+
8 rows in set (0.00 sec)

mysql> select ename,job,mgr from emp where job="clerk" || mgr=7698;
+--------+----------+------+
| ename  | job      | mgr  |
+--------+----------+------+
| SMITH  | CLERK    | 7902 |
| ALLEN  | SALESMAN | 7698 |
| WARD   | SALESMAN | 7698 |
| MARTIN | SALESMAN | 7698 |
| TURNER | SALESMAN | 7698 |
| ADAMS  | CLERK    | 7788 |
| JAMES  | CLERK    | 7698 |
| MILLER | CLERK    | 7782 |
+--------+----------+------+
8 rows in set (0.00 sec)

mysql> select ename,job,mgr from emp where job="clerk" && mgr=7698;
+-------+-------+------+
| ename | job   | mgr  |
+-------+-------+------+
| JAMES | CLERK | 7698 |
+-------+-------+------+
1 row in set (0.00 sec)

mysql> select ename,job,mgr from emp where job="clerk" && mgr=7699;
Empty set (0.00 sec)

mysql> select 1 && 1;
+--------+
| 1 && 1 |
+--------+
|      1 |
+--------+
1 row in set (0.00 sec)

mysql> select 1 && 0;
+--------+
| 1 && 0 |
+--------+
|      0 |
+--------+
1 row in set (0.00 sec)

mysql> select 0 && 0;
+--------+
| 0 && 0 |
+--------+
|      0 |
+--------+
1 row in set (0.00 sec)

mysql> select 1 && 1 && 1 && 1;
+------------------+
| 1 && 1 && 1 && 1 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql> select 1 && 1 && 1 && 0;
+------------------+
| 1 && 1 && 1 && 0 |
+------------------+
|                0 |
+------------------+
1 row in set (0.00 sec)

mysql> select 1 || 1 || 1 || 0;
+------------------+
| 1 || 1 || 1 || 0 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql> select 0 || 0 || 1 || 0;
+------------------+
| 0 || 0 || 1 || 0 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql> select 0 || 0 || 0 || 0;
+------------------+
| 0 || 0 || 0 || 0 |
+------------------+
|                0 |
+------------------+
1 row in set (0.00 sec)

mysql> select 1 || 0 && 1 || 0;
+------------------+
| 1 || 0 && 1 || 0 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql> select 1 || 0 && 0 || 0;
+------------------+
| 1 || 0 && 0 || 0 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql> select (1 || 0) && (0 || 0);
+----------------------+
| (1 || 0) && (0 || 0) |
+----------------------+
|                    0 |
+----------------------+
1 row in set (0.00 sec)

mysql> select 1 || 0 && 0 || 0;
+------------------+
| 1 || 0 && 0 || 0 |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql>

No comments:

Post a Comment

Note: only a member of this blog may post a comment.