# Between Joe 要查询 goods 表 ```sql create table goods( id int primary key auto_increment, category_id int, category varchar(64), name varchar(256), price decimal(12, 4), stock int, upper_time timestamp ) ``` 中价格在 1000 到 2000 之间(包含1000和2000)的数据,以下查询中错误的是:
点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill){target="_blank"}。 * `show databases;` 列出所有数据库 * `show tables;` 列出所有表 ## 答案 ```sql SELECT * FROM goods HAVING price BETWEEN 1000 AND 2000; ``` ## 选项 ### A ```sql SELECT * FROM goods WHERE price BETWEEN 1000 AND 2000; ``` ### B ```sql SELECT * FROM goods WHERE price >= 1000 AND price <= 2000; ``` ### C ```sql SELECT * FROM goods WHERE not (price < 1000 or price > 2000); ```