Bu sayfa bir sorgu arama sihirbazıdır. Ayrıca çok sayıda sql sorgu örnekleri içermektedir. Sorgunuzda bulunmasını istediğiniz ifadeleri yukarıdaki arama panelinden işaretleyerek arama yapabilirsiniz. İki türlü arama mevcut isterseniz sadece seçtiğiniz ifadeler yer alır. İsterseniz seçtiğiniz ifadeler mutlaka yer almak üzere diğer sql ifadeleri de sorgunuzda bulunabilir. Sorguların cevapları kütüphane veritabanında çözüldü. Diyagmı sol alt köşeden tıklayarak inceleyebilirsiniz.1600 kitap 500 den fazla yazardan oluşan Tamamen Türkçe kütüphane veritabanını bu linke tıklayarak indirebilirsiniz.
Çözüm 1)
Select * from ogrenci
where ad = 'Bill'
ETİKETLER
Select - Where -Çözüm 1)
Select * from ogrenci
where ad like 'a%'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from ogrenci
where ad like '%a'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from ogrenci
where ad like '%a%'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from kitap
where kitapno like '%1%'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from ogrenci
where ad like '_a%'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from ogrenci
where ad like '%a_'
ETİKETLER
Select - Where - Like -Çözüm 1)
Select * from ogrenci
where ogrno<= 20 and ogrno< 30
Çözüm 2)
Select * from ogrenci
where ogrno between 20 and 30
ETİKETLER
Select - Where - Between - Çoklu Şart -Çözüm 1)
select * from ogrenci
where ad= 'Suna' and soyad not like '%a%'
ETİKETLER
Select - Where - Like - Çoklu Şart -Çözüm 1)
select * from ogrenci
where (ad='Ali' or ad= 'Ayşe') and ogrno <30
Çözüm 2)
Select * from ogrenci
where ad='Ali' and ogrno <30 or ad='Ayşe' and ogrno <30
Çözüm 3)
Select * from ogrenci
where ad in('Ali','Ayşe') and ogrno<30
ETİKETLER
Select - Where - Parantez - Çoklu Şart -Çözüm 1)
Select * from kitap
where kitapno in(3,4,8,9,11,23)
Çözüm 2)
Select * from books
where kitapno = 3 or
kitapno = 4 or
kitapno = 8 or
kitapno = 9 or
kitapno =11 or
kitapno = 23
ETİKETLER
Select - Where -Çözüm 1)
Select * from kitap
where kitapno % 2 = 0
ETİKETLER
Select - Where -Çözüm 1)
select * from ogrenci
where ad = 'Sinan' and soyad not like '%a%'
Çözüm 2)
select * from ogrenci
where ad = 'Sinan' and not soyad like '%a%'
ETİKETLER
Select - Where - Çoklu Şart -Çözüm 1)
select * from ogrenci
where ("Kemal" or "Suna") and ogrno<30
Çözüm 2)
select * from ogrenci
where ad='Kemal' and ogrno<30 or
ad='Suna' and ogrno<30
ETİKETLER
Select - Where - Parantez - Çoklu Şart -Çözüm 1)
select * from ogrenci
where ogrno=1 or ogrno=7 or
ogrno=11 or ogrno=17
Çözüm 2)
select * from student
where ogrno in (1,7,11,17)
ETİKETLER
Select - Where -Çözüm 1)
Select * from ogrenci
where ogrno % 2 = 1
ETİKETLER
Select - Where -Çözüm 1)
Select * from student
where ad like 'a%' and ogrno % 2 = 1
ETİKETLER
Select - Where - Çoklu Şart -Çözüm 1)
Select * from ogrenci
where cinsiyet = 'E'
order by ad
Çözüm 2)
Select * from ogrenci
where cinsiyet = 'E'
order by 2
ETİKETLER
Select - Where - Order By -Çözüm 1)
Select * from ogrenci
where cinsiyet = 'E'
order by newid()
ETİKETLER
Select - Where - Order By -Çözüm 1)
select * from ogrenci
where sinif='10A' and cinsiyet='E'
order by newid()
ETİKETLER
Select - Where - Order By -Çözüm 1)
Select top 1 * from ogrenci
where sinif= '10A'
order by newid()
ETİKETLER
Select - Top - Where - Order By -Çözüm 1)
Select top 1 * from ogrenci
where sinif= '10A' and cinsiyet= 'K'
order by newid()
ETİKETLER
Select - Top - Where - Order By - Çoklu Şart -Çözüm 1)
Select top 1 * from kitap
order by sayfaSayisi desc
Çözüm 2)
Select * from kitap
where sayafaSayisi=(Select max(sayfaSayisi) from kitap)
ETİKETLER
Select - Top - Where - Order By - Alt Sorgu - Toplam Fonksiyonları -Çözüm 1)
Insert into yazar(ad,soyad)
select ad,soyad from ogrenci
where sinif='9A' and cinsiyet='E'
Çözüm 2)
Insert into yazar
select ad,soyad from ogrenci
where sinif='9A' and cinsiyet='E'
ETİKETLER
Select - Insert - Where -Çözüm 1)
Select ad,soyad,atarih from ogrenci,islem
where ogrenci.ogrno = islem.ogrno
Çözüm 2)
Select ad,soyad,atarih from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
ETİKETLER
Select - Join - Where - Çoklu Tablo -Çözüm 1)
Select ogrenci.ad,ogrenci.soyad,kitap.ad,atarih
from ogrenci,islem,kitap
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno
Çözüm 2)
Select ogrenci.ad,ogrenci.soyad,kitap.ad,atarih from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
ETİKETLER
Select - Join - Where - Çoklu Tablo -Çözüm 1)
Select ogrenci.ad as OgrenciAd,
ogrenci.soyad,kitap.ad as KitapAd,
atarih,tur.ad as TurAd
from ogrenci,islem,kitap,tur
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and
kitap.turno = tur.turno
Çözüm 2)
Select ogrenci.ad as studentName,
ogrenci.soyad,kitap.ad as BookName,
atarih,tur.ad as TypeName
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
join tur on kitap.turno = tur.turno
ETİKETLER
Select - Join - Where - Çoklu Tablo -Çözüm 1)
Select ogrenci.ad as studentName,
ogrenci.soyad,kitap.ad as BookName,
atarih,tur.ad as TypeName,
yazar.ad as AuthorName, yazar.soyad as AuthorSurad
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
join tur on kitap.turno = tur.turno
join yazar on yazar.yazarno = kitap.yazarno
Çözüm 2)
Select ogrenci.ad as studentName,ogrenci.soyad,
kitap.ad as BookName,atarih,tur.ad as TypeName ,
yazar.ad as AuthorName,yazar.soyad as AuthorSurad
from ogrenci, islem, kitap, tur, yazar
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and
kitap.turno = tur.turno and
yazar.yazarno = kitap.yazarno
ETİKETLER
Select - Join - Where - Çoklu Tablo -Çözüm 1)
Select ogrenci.ad as ogrenciAd, ogrenci.soyad,
kitap.ad as KitapAd,atarih
from ogrenci,islem,kitap,tur,yazar
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and sinif='11B'
Çözüm 2)
Select ogrenci.ad as ogrenciAd,ogrenci.soyad,
kitap.ad as kitapAd,atarih
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
where sinif='11B'
ETİKETLER
Select - Join - Where - Çoklu Tablo -Çözüm 1)
Select ogrenci.ad as studentName,ogrenci.soyad,
kitap.ad as BookName,atarih
from ogrenci, islem, kitap, tur, yazar
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and
sinif='11B' and cinsiyet='F'
Çözüm 2)
Select ogrenci.ad as studentName,ogrenci.soyad,
kitap.ad as BookName,atarih
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
where sinif='11B' and cinsiyet='F'
ETİKETLER
Select - Join - Where - Çoklu Şart - Çoklu Tablo -Çözüm 1)
Select yazar.ad, yazar.soyad, kitap.ad as bookName from yazar
join kitap on yazar.yazarno = kitap.yazarno
join tur on tur.turno = kitap.turno
where tur.ad = 'Dram'
Çözüm 2)
Select yazar.ad, yazar.soyad, kitap.ad as bookName
from yazar, kitap, tur
where yazar.yazarno = kitap.yazarno and
tur.turno = kitap.turno and
tur.ad = 'Dram'
ETİKETLER
Select - Join - Where - Çoklu Şart - Çoklu Tablo -Çözüm 1)
Select kitap.ad as bookName, yazar.ad, yazar.soyad
from yazar
join kitap on yazar.yazarno = kitap.yazarno
where sayfasayisi >300
Çözüm 2)
Select yazar.ad, yazar.soyad, kitap.ad as bookName
from yazar,kitap
where yazar.yazarno = kitap.yazarno and sayfasayisi >300
ETİKETLER
Select - Join - Where - Çoklu Şart - Çoklu Tablo -Çözüm 1)
Select distinct ogrenci.* from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
join yazar on yazar.yazarno = kitap.yazarno
where yazar.ad = 'Peyami' and yazar.soyad = 'Safa'
Çözüm 2)
Select distinct ogrenci.*
from ogrenci, islem, kitap, yazar
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and
yazar.yazarno = kitap.yazarno and
yazar.ad = 'Peyami' and yazar.soyad = 'Safa'
ETİKETLER
Select - Join - Where - Çoklu Şart - Çoklu Tablo -Çözüm 1)
Select distinct ogrenci.* from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
join yazar on yazar.yazarno = kitap.yazarno
where yazar.ad = 'Yahya' and yazar.soyad = 'Kemal' and sinif = '10A'
Çözüm 2)
Select distinct ogrenci.*
from ogrenci, islem, kitap, yazar
where ogrenci.ogrno = islem.ogrno and
kitap.kitapno = islem.kitapno and
yazar.yazarno = kitap.yazarno and
yazar.ad = 'Yahya' and yazar.soyad = 'Kemal' and
sinif = '10A'
ETİKETLER
Select - Join - Where - Çoklu Şart - Alt Sorgu - Çoklu Tablo -Çözüm 1)
Select count(*) from ogrenci
where sinif = '9B'
ETİKETLER
Select - Where - Toplam Fonksiyonları -Çözüm 1)
Select sum(sayfasayisi) from kitap
join tur on tur.turno = kitap.turno
where tur.ad = 'Romance'
ETİKETLER
Select - Join - Where - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select count(*) from kitap
join tur on tur.turno = kitap.turno
where tur.ad = 'Gerilim'
ETİKETLER
Select - Join - Where - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select avg(sayfasayisi) from kitap
join tur on tur.turno = kitap.turno
where tur.ad = 'Deneme'
ETİKETLER
Select - Join - Where - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select sum(sayfasayisi) from kitap
join yazar on yazar.yazarno = kitap.yazarno
where yazar.ad = 'Kemal' and yazar.soyad = 'Tahir'
ETİKETLER
Select - Join - Where - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select sum(puan) from kitap
join yazar on yazar.yazarno = kitap.yazarno
where yazar.ad = 'Aziz' and yazar.soyad = 'Nesin'
ETİKETLER
Select - Join - Where - Çoklu Şart - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select count(*) from kitap
join yazar on yazar.yazarno = kitap.yazarno
where yazar.ad = 'Halit Ziya' and yazar.soyad = 'Uşaklıgil'
ETİKETLER
Select - Join - Where - Çoklu Şart - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select count(*) from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
where ogrenci.ad = 'Ayşe' and ogrenci.soyad = 'Bakır'
ETİKETLER
Select - Join - Where - Çoklu Şart - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select sum(sayfasayisi) from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
where ogrenci.ad = 'Sinan' and ogrenci.soyad = 'Ay'
ETİKETLER
Select - Join - Where - Çoklu Şart - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Select count(distinct yazarno) from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
join kitap on kitap.kitapno = islem.kitapno
where ogrenci.ad = 'Ali' and ogrenci.soyad = 'Al'
ETİKETLER
Select - Distinct - Join - Where - Çoklu Şart - Toplam Fonksiyonları - Çoklu Tablo -Çözüm 1)
Insert into ogrenci(ad,soyad,sinif)
Select ad,soyad,'12M' from yazar where ad like '%a%'
ETİKETLER
Select - Insert - Where -Çözüm 1)
Select top 1 ogrenci.*,atarih
from ogrenci,islem
where ogrenci.ogrno = islem.ogrno
order by islem.atarih desc
Çözüm 2)
Select top 1 ogrenci.*,atarih
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
order by islem.atarih desc
Çözüm 3)
Select ogrenci.*,atarih
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
where atarih = (Select max(atarih) from islem)
ETİKETLER
Select - Top - Join - Where - Order By - Alt Sorgu - Çoklu Tablo -Çözüm 1)
Select sinif,cinsiyet,count(*) as OgrenciSayısı
from ogrenci
where cinsiyet = 'F'
group by cinsiyet,sinif
ETİKETLER
Select - Where - Group By - Toplam Fonksiyonları - Takma Ad -Çözüm 1)
Select ad,soyad,count(*) KitapSayısı
from ogrenci,islem
where ogrenci.ogrno = islem.ogrno
group by ogrenci.ogrno,ad,soyad
Çözüm 2)
Select ad,soyad,count(*) KitapSayısı
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
group by ogrenci.ogrno,ad,soyad
ETİKETLER
Select - Join - Where - Group By - Toplam Fonksiyonları - Takma Ad - Çoklu Tablo -Çözüm 1)
Select ad,soyad,count(*) KitapSayısı
from ogrenci
join islem on ogrenci.ogrno = islem.ogrno
group by ogrenci.ogrno,ad,soyad
order by BookCount desc
Çözüm 2)
Select ad,soyad,count(*) KitapSayısı
from ogrenci,islem
where ogrenci.ogrno = islem.ogrno
group by ogrenci.ogrno,ad,soyad
order by BookCount desc
ETİKETLER
Select - Join - Where - Group By - Order By - Toplam Fonksiyonları - Takma Ad - Çoklu Tablo -Çözüm 1)
Select ad,soyad,count(islemno) KitapSayısı
from ogrenci
left join islem on ogrenci.ogrno = islem.ogrno
group by ogrenci.ogrno,ad,soyad
order by BookCount
Çözüm 2)
Select ad, soyad,
(Select count(*) from islem
where ogrenci.ogrno = islem.ogrno) as KitapSayısı
from ogrenci
order by KitapSayısı
ETİKETLER
Select - Top - Where - Having - Alt Sorgu -Çözüm 1)
Select ogrenci.* from ogrenci
left join islem on ogrenci.ogrno = islem.ogrno
where islemno is null
Çözüm 2)
Select * from ogrenci
where ogrno not in
(Select ogrno from islem)
ETİKETLER
Select - Where - Alt Sorgu - Çoklu Tablo - Left Join -Çözüm 1)
Select kitap.* from kitap
left join islem on kitap.kitapno = islem.kitapno
where islemno is null
Çözüm 2)
Select * from kitap
where kitapno not in
(Select kitapno from islem)
ETİKETLER
Select - Where - Alt Sorgu - Çoklu Tablo - Left Join -Çözüm 1)
Delete from ogrenci
where ogrno = 5
ETİKETLER
Delete - Where -Çözüm 1)
Delete from kitap
where sayfasayisi between 50 and 100
Çözüm 2)
Delete from kitap
where sayfasayisi<=100 and sayfasayisi>=50
ETİKETLER
Delete - Where -Çözüm 1)
Delete from ogrenci
where ogrno not in
(Select ogrno from islem)
ETİKETLER
Delete - Where - Alt Sorgu -Çözüm 1)
Delete from ogrenci
where ad = 'Serpil'
ETİKETLER
Delete - Where -Çözüm 1)
Delete from ogrenci
where ad = 'Serpil' and soyad = 'Bakır'
ETİKETLER
Delete - Where - Çoklu Şart -Çözüm 1)
Delete from ogrenci
where ogrno in (Select ogrno from islem
group by ogrno
having count(*)<5)
ETİKETLER
Delete - Where - Group By - Having - Alt Sorgu -Çözüm 1)
Update ogrenci set ad='Veli'
where ad = 'Ali'
ETİKETLER
Update - Where -Çözüm 1)
Update ogrenci set ad = 'Süleyman' where ogrno = 20
ETİKETLER
Update - Where -Çözüm 1)
Update ogrenci set sinif = '10C' where ogrno between 20 and 30
ETİKETLER
Update - Where - Between -Çözüm 1)
Update ogrenci set puan += 5 where sinif = '10E' and cinsiyet = 'E'
ETİKETLER
Update - Where - Çoklu Şart -Çözüm 1)
Update ogrenci set ad = 'Arzu', soyad = 'Çelik' where ogrno = 24
ETİKETLER
Update - Where -Çözüm 1)
Update kitap set puan +=10
where sayfasayisi = (Select MAX(sayfasayisi) from kitap)
ETİKETLER
Update - Where - Alt Sorgu - Toplam Fonksiyonları -Çözüm 1)
Update kitap set puan += 1
where turno = (Select turno from kitap where ad = 'Dram')
Çözüm 2)
Update kitap set puan += 1
where turno in (Select turno from kitap where ad = 'Dram')
ETİKETLER
Update - Where - Alt Sorgu -