日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql表单查询_表单查询实例

發(fā)布時間:2023/12/20 数据库 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql表单查询_表单查询实例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

[TOC]

### 1.查找部門30中員工的詳細信息。

```

select * from emp where deptno = 30;

```

### 2.找出從事clerk工作的員工的編號、姓名、部門號。

```

select empno,ename,deptno from emp where job = 'clerk';

```

### 3.檢索出獎金多于基本工資的員工信息。

```

select * from emp where comm > sal;

```

### 4.檢索出獎金多于基本工資60%的員工信息。

```

select * from emp where comm > sal * 0.6;

```

### 5.找出10部門的經(jīng)理、20部門的職員 的員工信息。

```

select * from emp where deptno = 10 and job='MANAGER' or deptno = 20 and job = 'CLERK';

```

### 6.找出10部門的經(jīng)理、20部門的職員 或者既不是經(jīng)理也不是職員但是工資高于2000元的員工信息。

```

select * from emp

where (deptno = 10 and job='MANAGER')

or (deptno = 20 and job = 'CLERK')

or (job!='MANAGER' and job != 'CLERK' and sal > 2000) ;

// or (job not in ('MANAGER','CLERK' and sal > 2000);

```

### 7.找出獲得獎金的員工的工作。

```

select * from emp where comm > 0;

```

### 8.找出獎金少于100或者沒有獲得獎金的員工的信息。

```

select * from emp where comm < 100 or comm is null;

```

### 9.找出姓名以A、B、S開始的員工信息。

```

select * from emp where ename like 'A%' or ename like 'B%' or ename like 'S%';

```

### 10.找到名字長度為6個字符的員工信息。

```

select * from emp where length(ename) = 6;

// select * from emp where ename like '______';

```

### 11.名字中不包含R字符的員工信息。

```

select * from emp where ename not like '%R%';

```

### 12.返回員工的詳細信息并按姓名排序。

```

select * from emp order by ename asc;

```

### 13.返回員工的信息并按工作降序工資升序排列。

```

select * from emp order by job desc,sal asc;

```

### 14.計算員工的日薪(按30天)。

```

select ename,sal/30 as '日薪' from emp;

// select ename,truncate(sal/30,2) '日薪' from emp;

```

### 15.找出姓名中包含A的員工信息。

```

select * from emp where ename like '%A%';

```

總結(jié)

以上是生活随笔為你收集整理的mysql表单查询_表单查询实例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。