首页 > 编程知识 正文

mysql数据库查询语句练习题(mysql查询题目)

时间:2023-12-01 15:00:21 阅读:310976 作者:KJUK

本文目录一览:

  • 1、mysql数据库sql查询语句:多条件判断
  • 2、求一个mysql数据库题目怎么做!!!!
  • 3、mysql数据库查询语句问题
  • 4、MySQL数据库查询问题,高分求解.
  • 5、有关MySql数据库查询语句

mysql数据库sql查询语句:多条件判断

1、创建测试表,

create table test_person(id int, RMB int);

2、插入测试数据

insert into test_person values(1,180);

insert into test_person values(2,170);

insert into test_person values(3,290);

insert into test_person values(4,160);

insert into test_person values(5,299);

insert into test_person values(6,266);

insert into test_person values(7,155);

3、查询表中所有记录,select t.* from test_person t,

4、编写sql,汇总每个vip类型的用户数,

select vip_type, count(distinct id)

from (select case when RMB100 and RMB200 then 'VIP1' when RMB200 then 'VIP2' end as vip_type, id

        from test_person) t

group by vip_type

求一个mysql数据库题目怎么做!!!!

1、select * from Record a,Class b where a.姓名=b.姓名 and b.专业='计算机维护' and 班级='1班';

2、select 班级,坐号 from Class where 姓名='张三';

3、create or replace trigger my_trig before delete on Class for each row

declare

delete from Score where 姓名='new.姓名';

delete from Record where 姓名='new.姓名';

commit;

end

也不说给点分。。。。。。。

mysql数据库查询语句问题

思路:

数据库中的数据是原始数据,而页面显示是如何应用数据库原始数据的问题.

我数据库用是MALE和FEMALE, 只要在页面显示层面把MALE转换为"男"显示出来就OK了.我把MALE显示成"女"也没问题,完全在你怎么处理来自数据库的数据.

MySQL数据库查询问题,高分求解.

知识点:

group by 汇总函数

sum/count函数

难点:

多条件汇总

答案:

%百分比,不要在sql中求,建议你用php取到结果,再算。

SELECT class,SUM(id), FROM 你的表名GROUP BY class,sign_date

其他:

你的json不是这样用的。要用php得到结果后,再用php_json来输出json格式。

有关MySql数据库查询语句

select *

from table_name

where CONCAT(username,realname,email) like '%k%'

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。