假设有一张账目表account,里面记录着你今年的每一笔开支,目前你想查看一下3月和7月这两个月份哪个月份的消费总额最高,那么下面正确的sql语句是 create table `account`(     `id` int(11) not null auto_increment,     `month` int(11) not null comment ‘月份’,     `item` char(50) not null comment ‘开支条目’,     `pay` int(11) not null comment ‘消费金额’,     primary key(`id`) )engine = innodb;

区块链毕设网qklbishe.com为您提供问题的解答

假设有一张账目表account,里面记录着你今年的每一笔开支,目前你想查看一下3月和7月这两个月份哪个月份的消费总额最高,那么下面正确的sql语句是

create table `account`(
    `id` int(11) not null auto_increment,
    `month` int(11) not null comment ‘月份’,
    `item` char(50) not null comment ‘开支条目’,
    `pay` int(11) not null comment ‘消费金额’,
    primary key(`id`)
)engine = innodb;

答案是:D
首先需要查询消费总额,需要用到的计算总和函数 sum() 而不是统计总数的函数 count() ,排除选项A和C,其次需要查询3月和7月两个月的数据进行对比,WHERE查询条件应当为month = 3 OR month = 7或者month in (3,7),排除选项A和B,故选D。

47:01

以上就是关于问题假设有一张账目表account,里面记录着你今年的每一笔开支,目前你想查看一下3月和7月这两个月份哪个月份的消费总额最高,那么下面正确的sql语句是 create table `account`(     `id` int(11) not null auto_increment,     `month` int(11) not null comment ‘月份’,     `item` char(50) not null comment ‘开支条目’,     `pay` int(11) not null comment ‘消费金额’,     primary key(`id`) )engine = innodb;的答案

欢迎关注区块链毕设网-
专业区块链毕业设计成品源码,定制。

区块链NFT链游项目方科学家脚本开发培训

承接区块链项目定制开发

微信:btc9767

QQ :1330797917

TELEGRAM: BTCOK9

承接区块链项目定制开发


qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 假设有一张账目表account,里面记录着你今年的每一笔开支,目前你想查看一下3月和7月这两个月份哪个月份的消费总额最高,那么下面正确的sql语句是 create table `account`(     `id` int(11) not null auto_increment,     `month` int(11) not null comment ‘月份’,     `item` char(50) not null comment ‘开支条目’,     `pay` int(11) not null comment ‘消费金额’,     primary key(`id`) )engine = innodb;