1
select from good order by price
2
select cid from SalesRecorder where gid='1002'
3
select count(distinct cid) from SalesRecorder
4
select count() from Customer where sex='男'
5
select avg(to_number(to_char(sysdate,'yyyy'))-to_number(to_char(birth,'yyyy'))) from Customer where sex='男'
6
select cid,cname from Customer
where cid in
(select cid from SalesRecorder where gid in('1002','1006'))
7
select cname from Customer
where cid not in (select cid from SalesRecorder)
8
select max(quantity) from SalesRecorder where gid='1001'
9
select cname from Customer where cid in
(select cid from SalesRecorder where gid='1001'
and quantity=(select max(quantity) from SalesRecorder where gid='1001'))
10
select cid from SalesRecorder where gid in
(select gid from Good where price<100)
11
select cid from SalesRecorder where gid not in
(select gid Good where price<100)
12
select cname from Customer where cid in
(select cid from SalesRecorder where gid not in
(select gid Good where price<100))
13
select bgid,bgname
from Customer a,Good b,SalesRecorder c
where acid=ccid and bgid=cgid
and asex='女'
group by bgid,bgname
14
select bgid,bgname,sum(cquantity)
from Customer a,Good b,SalesRecorder c
where acid=ccid and bgid=cgid
and asex='女'
group by bgid,bgname
15
select bgname,bprice
from Customer a,Good b,SalesRecorder c
where acid=ccid and bgid=cgid
and (to_number(to_char(sysdate,'yyyy'))-to_number(to_char(abirth,'yyyy')))
between 20 and 25
group by bgname,bprice
16
select t from
(select bgid,bgname,sum(cquantity) quantity
from Customer a,Good b,SalesRecorder c
where acid=ccid and bgid=cgid
group by bgid,bgname)
order by tquantity desc
17
select from Good where gid not in
(select gid from SalesRecorder)
18
delete from Good where gid not in
(select gid from SalesRecorder)
19
update Good set price=price(1-01) where gid in
(select t1gid from
(select tgid,tquantity,row_number() over order by (quantity) rn
from
(select gid,sum(quantity) quantity from SalesRecorder group by gid) t) t1
where rn between 1 and 2)
写的太急,可能多少有点错误,自己能改就自己改了吧
以上就是关于关于Oracle数据库查询问题全部的内容,包括:关于Oracle数据库查询问题、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)