-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathders04.sql
51 lines (38 loc) · 907 Bytes
/
ders04.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- Siralama - Order By : asc, desc
use db_taskoprumyo;
select *
from tbl_ogrenci
order by ortalama;
select ad, soyad, ortalama, bid
from tbl_ogrenci
order by soyad desc;
select ad, soyad, ortalama, bid
from tbl_ogrenci
order by ad asc;
-- Group by - Gruplama
select * from tbl_ogrenci;
select ortalama, count(*) As 'Kac Adet'
from tbl_ogrenci
group by ortalama;
select bid, count(*) As 'Kac Adet'
from tbl_ogrenci
group by bid
order by bid desc;
select bid, count(*) As 'Kac Adet'
from tbl_ogrenci
group by bid
order by count(*) desc;
-- Having : Filtreleme, Where gibi davriniyor
select * from tbl_ogrenci;
select ortalama, avg(ortalama)
from tbl_ogrenci
group by ortalama
having avg(ortalama) > 2.5;
select ortalama, count(*) as 'Tekrar Sayisi'
from tbl_ogrenci
group by ortalama
having count(*) > 1;
select ortalama, avg(ortalama)
from tbl_ogrenci
group by ortalama
having count(*) > 1;