ORACLE SQL文筆記試験問題
3219 ワード
(1) :
A 2
B 4
C 1
A 2
B 5
……
( )
:select * from where in (select from group by having count(*) >= 2);
(2) :
81
75
56
90
81
100
49
……
( )
( 、 、 ), : 60
:select * from where not in (select distinct from where < 60)
:
select * from where in (select from group by having min( ) >=60)
(3) :
2.5
1.9
3
1.5
2.4
……
( )
2
:select from group by having avg( ) < 2
(4) :
2006001 119
2006001 108
2006002 142
2006001 136
2006001 127
2006002 149
2006002 110
2006002 105
2006001 98
2006002 129
……
( )
600
:select from group by having sum( ) > 600
(5) :
2006001 108 119 98 127 136
2006002 149 105 110 142 129
……
( )
600
:select from where ( + + + + ) > 600
( )
( ) :club
id gender age
67 M 19
68 F 30
69 F 27
70 F 16
71 M 32
……( )
:select gender,count(id) from club group by gender
( ) :team
ID(number ) Name(varchar2 )
1 a
2 b
3 b
4 a
5 c
6 c
: , Name , ID
: :
ID(number ) Name(varchar2 )
1 a
2 b
5 c
SQL 。
delete from team where id not in (select min(id) from team group by name)
( ) :student
name course score
72
72
81
67
98
70
76
“ ” 75
:select * from student where name in (select name from student
where name like ' %' group by name having avg(score) > 75)