count.md 645 字节
Newer Older
M
Mars Liu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# count 练习

Joe 建立了一个名为items的表

```
mysql> select * from items;
+----+-----------+
| id | item      |
+----+-----------+
|  1 |         2 |
|  2 |      NULL |
|  3 |         9 |
|  4 | 534214123 |
+----+-----------+
```

当他执行

```mysql
select count(*), count(item) from items;
```

会得到什么结果?

M
Mars Liu 已提交
25 26
点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill)

M
Mars Liu 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
## 答案

```
3, 4
```

## 选项

### A

```
4, NULL
```

### B

```
3, 3
```

### C

```
1, 0
```

### D

```
NULL,  NULL
```

### E

```
4, 4
```