完成以下功能;
select ename ,LOWER(ename) from user
select name,ename,concat(name,',',ename) from user
-- 查找1992年出生的客户的交易记录信息
-- 找日期
select *,SUBSTRING(personId,7,4) x from user
-- 找userid
select userld from ( select *,SUBSTRING(personId,7,4) x from user) a where x=1992
-- 找cardno
select cardno from(select userld from ( select *,SUBSTRING(personId,7,4) x from user) a where x=1992) b,card where b.userld=card.userId
-- 找交易记录信息
select * from (select cardno from(select userld from ( select *,SUBSTRING(personId,7,4) x from user) a where x=1992) b,card where b.userld=card.userId) c,transinfo where c.cardno=transinfo.cardNo
-- 按姓氏统计客户信息:展示每个姓氏有多少张银行卡
select name,count(cardno) c,userId x from card ,user where card.userId=user.userld group by card.userId
select left(name,1),sum(c) from (select name,count(cardno) c,userId x from card ,user where card.userId=user.userld group by card.userId) s
group by left(name,1)
-- 查找姓名是两个汉字的客户信息
select * from user,card,transinfo where user.userld=card.userId and card.cardNo=transinfo.cardNo and name like'__';
-- 展示客户的出生日期,以【1998-02-23】格式展示
select name,concat('【',substring(personId,7,4),'-',substring(personId,11,2),'-',substring(personId,13,2),'】') x from user