完成以下功能:
-- 1
select card.*
from user, card
where user.name='李峰' and user.userId = card.userId;
-- 2
select user.*
from user, card
where card.cardNo=001 and user.userId = card.userId;
-- 3
select user.name,user.personId
from user,card
where card.money>10000 and user.userId = card.userId;
-- 4
select user.name,card.money
from user,card
where user.credit>400 and user.userId = card.userId;
-- 5
select city,sum(money)总金额
from user,card
where user.userId = card.userId
GROUP BY city
ORDER BY sum(money)desc;
-- 6
select user.*
from user,card
where openDate BETWEEN '2019-01-01' and '2019-03-01' and user.userId = card.userId;
-- 7
select user.*
from user,card
where card.money>=20000 and user.city='北京' and user.userId = card.userId;
-- 8
select sex,avg(money)总金额
from user,card
where user.userId = card.userId
GROUP BY sex;
-- 9
select city,count(cardNo)
from card,user
where user.userId = card.userId
group by city;
-- 10
select name,sum(money)总金额
from user,card
where user.userId = card.userId
GROUP BY name;
-- 11
select city
from user,card
where user.userId = card.userId
GROUP BY city
having avg(money)>10000;