SQL71. 检索供应商名称
描述
vend_name | vend_country | vend_state |
apple | USA | CA |
vivo | CNA | shenzhen |
huawei | CNA | xian |
vend_name |
apple |
示例1
输入:
DROP TABLE IF EXISTS `Vendors`; CREATE TABLE IF NOT EXISTS `Vendors` ( `vend_name` VARCHAR(255) NOT NULL COMMENT 'vend名称', `vend_country` VARCHAR(255) NOT NULL COMMENT 'vend国家', `vend_state` VARCHAR(255) NOT NULL COMMENT 'vend州' ); INSERT INTO `Vendors` VALUES ('apple','USA','CA'), ('vivo','CNA','shenzhen'), ('huawei','CNA','xian');
输出:
apple
Mysql 解法, 执行用时: 39ms, 内存消耗: 6420KB, 提交时间: 2022-03-03
SELECT vend_name FROM Vendors WHERE vend_country='USA' AND vend_state='CA'
Mysql 解法, 执行用时: 39ms, 内存消耗: 6452KB, 提交时间: 2022-03-04
select vend_name from Vendors where vend_country="USA" and vend_state="CA"
Mysql 解法, 执行用时: 39ms, 内存消耗: 6500KB, 提交时间: 2022-03-05
select vend_name from Vendors where vend_state='CA' and vend_country='USA'
Mysql 解法, 执行用时: 39ms, 内存消耗: 6500KB, 提交时间: 2022-03-03
SELECT vend_name FROM Vendors WHERE vend_country = 'USA' and vend_state = 'CA';
Mysql 解法, 执行用时: 39ms, 内存消耗: 6508KB, 提交时间: 2022-03-06
select vend_name from Vendors where vend_country = 'USA' and vend_state = 'CA';