{"id":34918,"date":"2025-11-23T16:41:14","date_gmt":"2025-11-23T13:41:14","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=34918"},"modified":"2025-11-23T16:41:14","modified_gmt":"2025-11-23T13:41:14","slug":"giris-sqlde-where-yan-tumcesi-neden-onemli","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/","title":{"rendered":"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?"},"content":{"rendered":"<p><body><\/p>\n<h2>Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?<\/h2>\n<p>Veritabanlar\u0131, g\u00fcn\u00fcm\u00fcz\u00fcn dijital d\u00fcnyas\u0131nda bilginin kalbi konumundad\u0131r. Milyonlarca hatta milyarlarca sat\u0131r veriyi bar\u0131nd\u0131ran bu sistemlerden, ihtiyac\u0131m\u0131z olan spesifik bilgiyi \u00e7ekebilmek hayati \u00f6nem ta\u015f\u0131r. \u0130\u015fte tam bu noktada, SQL&#8217;in (Structured Query Language) en g\u00fc\u00e7l\u00fc ve en s\u0131k kullan\u0131lan bile\u015fenlerinden biri olan <strong>WHERE yan t\u00fcmcesi<\/strong> devreye girer.<\/p>\n<p>WHERE yan t\u00fcmcesi, bir SQL sorgusunda belirli ko\u015fullar\u0131 kar\u015f\u0131layan sat\u0131rlar\u0131 filtrelemek i\u00e7in kullan\u0131l\u0131r. Adeta bir elek g\u00f6revi g\u00f6rerek, t\u00fcm veri k\u00fcmesinden sadece istedi\u011finiz kriterlere uyan veri par\u00e7alar\u0131n\u0131 ay\u0131klaman\u0131z\u0131 sa\u011flar. Bu sayede, gereksiz verilerle u\u011fra\u015fmak zorunda kalmaz, sorgular\u0131n\u0131z\u0131n performans\u0131n\u0131 art\u0131r\u0131r ve daha anlaml\u0131 sonu\u00e7lar elde edersiniz.<\/p>\n<p>Sadece veri \u00e7ekmekle kalmaz, ayn\u0131 zamanda veritaban\u0131ndaki mevcut kay\u0131tlar\u0131 g\u00fcncellemek (<code>UPDATE<\/code>) veya silmek (<code>DELETE<\/code>) istedi\u011finizde de WHERE yan t\u00fcmcesi kritik bir rol oynar. Do\u011fru WHERE ko\u015fullar\u0131 olmadan yap\u0131lan <code>UPDATE<\/code> veya <code>DELETE<\/code> i\u015flemleri, veritaban\u0131n\u0131zdaki t\u00fcm kay\u0131tlar\u0131 istenmeyen bir \u015fekilde de\u011fi\u015ftirebilir veya silebilir ki bu da ciddi veri kay\u0131plar\u0131na yol a\u00e7abilir. Bu rehberde, WHERE yan t\u00fcmcesinin temelden ileri seviyeye t\u00fcm kullan\u0131m alanlar\u0131n\u0131, pratik \u00f6rneklerle ve performans ipu\u00e7lar\u0131yla derinlemesine inceleyece\u011fiz.<\/p>\n<h2>WHERE Yan T\u00fcmcesinin Temel Kullan\u0131m\u0131 ve Operat\u00f6rler<\/h2>\n<p>WHERE yan t\u00fcmcesi, <code>SELECT<\/code>, <code>UPDATE<\/code> ve <code>DELETE<\/code> gibi SQL komutlar\u0131yla birlikte kullan\u0131larak, i\u015flem yap\u0131lacak sat\u0131rlar\u0131 belirler. En basit haliyle, bir s\u00fctundaki de\u011ferin belirli bir ko\u015fulu kar\u015f\u0131lay\u0131p kar\u015f\u0131lamad\u0131\u011f\u0131n\u0131 kontrol eder.<\/p>\n<h3>Temel S\u00f6zdizimi<\/h3>\n<pre><code>SELECT kolon1, kolon2\nFROM TabloAdi\nWHERE kosul;\n\nUPDATE TabloAdi\nSET kolon1 = yeni_deger\nWHERE kosul;\n\nDELETE FROM TabloAdi\nWHERE kosul;\n<\/code><\/pre>\n<h3>Kar\u015f\u0131la\u015ft\u0131rma Operat\u00f6rleri<\/h3>\n<p>Ko\u015fullar genellikle a\u015fa\u011f\u0131daki kar\u015f\u0131la\u015ft\u0131rma operat\u00f6rleri kullan\u0131larak olu\u015fturulur:<\/p>\n<ul>\n<li><code>=<\/code> (E\u015fittir)<\/li>\n<li><code>!=<\/code> veya <code><><\/code> (E\u015fit de\u011fildir)<\/li>\n<li><code>><\/code> (B\u00fcy\u00fckt\u00fcr)<\/li>\n<li><code><<\/code> (K\u00fc\u00e7\u00fckt\u00fcr)<\/li>\n<li><code>>=<\/code> (B\u00fcy\u00fck veya e\u015fittir)<\/li>\n<li><code><=<\/code> (K\u00fc\u00e7\u00fck veya e\u015fittir)<\/li>\n<\/ul>\n<h4>\u00d6rnekler:<\/h4>\n<p>Bir <code>Musteriler<\/code> tablonuz oldu\u011funu ve bu tabloda <code>MusteriID<\/code>, <code>Ad<\/code>, <code>Soyad<\/code>, <code>Sehir<\/code>, <code>Yas<\/code> ve <code>Bakiye<\/code> gibi s\u00fctunlar bulundu\u011funu varsayal\u0131m.<\/p>\n<p><strong>1. Belirli bir \u015fehre ait m\u00fc\u015fterileri se\u00e7me:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE Sehir = 'Ankara';\n<\/code><\/pre>\n<p><strong>2. Belirli bir ya\u015ftan b\u00fcy\u00fck m\u00fc\u015fterileri se\u00e7me:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Yas\nFROM Musteriler\nWHERE Yas > 30;\n<\/code><\/pre>\n<p><strong>3. Bakiyesi 1000 TL'den az olmayan m\u00fc\u015fterileri se\u00e7me:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Bakiye\nFROM Musteriler\nWHERE Bakiye >= 1000;\n<\/code><\/pre>\n<p><strong>4. Belirli bir \u015fehre ait olmayan m\u00fc\u015fterileri se\u00e7me:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE Sehir != '\u0130stanbul';\n<\/code><\/pre>\n<p>Veya alternatif olarak:<\/p>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE Sehir <> '\u0130stanbul';\n<\/code><\/pre>\n<h2>Daha Geli\u015fmi\u015f Filtreleme Teknikleri<\/h2>\n<p>Tek bir ko\u015ful genellikle yeterli olmaz. Daha karma\u015f\u0131k filtreleme ihtiya\u00e7lar\u0131 i\u00e7in SQL, \u00e7e\u015fitli mant\u0131ksal ve \u00f6zel operat\u00f6rler sunar.<\/p>\n<h3>Mant\u0131ksal Operat\u00f6rler: AND, OR, NOT<\/h3>\n<p>Birden fazla ko\u015fulu birle\u015ftirmek i\u00e7in kullan\u0131l\u0131rlar.<\/p>\n<ul>\n<li><strong><code>AND<\/code>:<\/strong> T\u00fcm ko\u015fullar\u0131n do\u011fru olmas\u0131 gerekir.<\/li>\n<li><strong><code>OR<\/code>:<\/strong> Ko\u015fullardan en az birinin do\u011fru olmas\u0131 yeterlidir.<\/li>\n<li><strong><code>NOT<\/code>:<\/strong> Bir ko\u015fulun sonucunu tersine \u00e7evirir (do\u011fruyu yanl\u0131\u015fa, yanl\u0131\u015f\u0131 do\u011fruya \u00e7evirir).<\/li>\n<\/ul>\n<h4>\u00d6rnekler:<\/h4>\n<p><strong>1. Hem Ankara'da ya\u015fayan hem de 30 ya\u015f\u0131ndan b\u00fcy\u00fck m\u00fc\u015fteriler:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Sehir, Yas\nFROM Musteriler\nWHERE Sehir = 'Ankara' AND Yas > 30;\n<\/code><\/pre>\n<p><strong>2. \u0130stanbul veya \u0130zmir'de ya\u015fayan m\u00fc\u015fteriler:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE Sehir = '\u0130stanbul' OR Sehir = '\u0130zmir';\n<\/code><\/pre>\n<p><strong>3. Ankara'da ya\u015famayan m\u00fc\u015fteriler:<\/strong><\/p>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE NOT Sehir = 'Ankara';\n<\/code><\/pre>\n<p><strong>Parantez Kullan\u0131m\u0131:<\/strong> Karma\u015f\u0131k mant\u0131ksal ifadelerde i\u015flem \u00f6nceli\u011fini belirlemek i\u00e7in parantez kullanmak \u00f6nemlidir.<\/p>\n<pre><code>SELECT Ad, Soyad, Sehir, Yas, Bakiye\nFROM Musteriler\nWHERE (Sehir = '\u0130stanbul' OR Sehir = '\u0130zmir') AND Bakiye > 500;\n<\/code><\/pre>\n<p>Bu sorgu, \u0130stanbul veya \u0130zmir'de ya\u015fayan VE bakiyesi 500'den b\u00fcy\u00fck olan m\u00fc\u015fterileri getirir. Parantezler olmasayd\u0131, sorgu \u0130zmir'de ya\u015fayan veya \u0130stanbul'da ya\u015fayan VE bakiyesi 500'den b\u00fcy\u00fck olan m\u00fc\u015fterileri getirebilirdi, bu da farkl\u0131 bir sonu\u00e7 demektir.<\/p>\n<h3>\u00d6zel Operat\u00f6rler: IN, BETWEEN, LIKE, IS NULL<\/h3>\n<ul>\n<li><strong><code>IN<\/code> Operat\u00f6r\u00fc:<\/strong> Bir de\u011ferin, belirtilen bir liste i\u00e7indeki herhangi bir de\u011ferle e\u015fle\u015fip e\u015fle\u015fmedi\u011fini kontrol eder. \u00d6zellikle <code>OR<\/code> ile birden fazla e\u015fittir ko\u015fulu yazmak yerine daha temiz bir yol sunar.<\/li>\n<pre><code>SELECT Ad, Soyad, Sehir\nFROM Musteriler\nWHERE Sehir IN ('\u0130stanbul', '\u0130zmir', 'Bursa');\n<\/code><\/pre>\n<li><strong><code>BETWEEN<\/code> Operat\u00f6r\u00fc:<\/strong> Bir de\u011ferin, belirtilen iki de\u011fer aras\u0131nda (bu de\u011ferler dahil) olup olmad\u0131\u011f\u0131n\u0131 kontrol eder. Genellikle say\u0131lar, tarihler veya metinler i\u00e7in kullan\u0131l\u0131r.<\/li>\n<pre><code>-- Ya\u015f\u0131 25 ile 40 aras\u0131nda olan m\u00fc\u015fteriler\nSELECT Ad, Soyad, Yas\nFROM Musteriler\nWHERE Yas BETWEEN 25 AND 40;\n\n-- Belirli bir tarih aral\u0131\u011f\u0131ndaki sipari\u015fler (bir Siparisler tablosu oldu\u011funu varsayal\u0131m)\nSELECT SiparisID, SiparisTarihi\nFROM Siparisler\nWHERE SiparisTarihi BETWEEN '2023-01-01' AND '2023-03-31';\n<\/code><\/pre>\n<li><strong><code>LIKE<\/code> Operat\u00f6r\u00fc:<\/strong> Metin verilerinde desen e\u015fle\u015ftirme yapmak i\u00e7in kullan\u0131l\u0131r. Genellikle iki joker karakterle birlikte kullan\u0131l\u0131r:\n<ul>\n<li><code>%<\/code> (y\u00fczde i\u015fareti): S\u0131f\u0131r veya daha fazla karakteri temsil eder.<\/li>\n<li><code>_<\/code> (alt \u00e7izgi): Tam olarak tek bir karakteri temsil eder.<\/li>\n<\/ul>\n<\/li>\n<pre><code>-- Ad\u0131 'A' ile ba\u015flayan m\u00fc\u015fteriler\nSELECT Ad, Soyad\nFROM Musteriler\nWHERE Ad LIKE 'A%';\n\n-- Soyad\u0131 'an' ile biten m\u00fc\u015fteriler\nSELECT Ad, Soyad\nFROM Musteriler\nWHERE Soyad LIKE '%an';\n\n-- Ad\u0131nda 'el' ge\u00e7en m\u00fc\u015fteriler\nSELECT Ad, Soyad\nFROM Musteriler\nWHERE Ad LIKE '%el%';\n\n-- Ad\u0131n\u0131n ikinci harfi 'e' olan m\u00fc\u015fteriler (\u00f6rne\u011fin: Mehmet, Deniz)\nSELECT Ad, Soyad\nFROM Musteriler\nWHERE Ad LIKE '_e%';\n<\/code><\/pre>\n<li><strong><code>IS NULL<\/code> \/ <code>IS NOT NULL<\/code> Operat\u00f6rleri:<\/strong> Bir s\u00fctundaki de\u011ferin NULL (tan\u0131mlanmam\u0131\u015f veya bo\u015f) olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in kullan\u0131l\u0131r. SQL'de <code>NULL = NULL<\/code> veya <code>NULL != NULL<\/code> gibi kar\u015f\u0131la\u015ft\u0131rmalar her zaman bilinmeyen (UNKNOWN) bir sonu\u00e7 d\u00f6nd\u00fcrd\u00fc\u011f\u00fc i\u00e7in, <code>=<\/code> veya <code>!=<\/code> yerine bu operat\u00f6rler kullan\u0131lmal\u0131d\u0131r.<\/li>\n<pre><code>-- E-posta adresi bo\u015f olan m\u00fc\u015fteriler\nSELECT Ad, Soyad, Email\nFROM Musteriler\nWHERE Email IS NULL;\n\n-- Telefon numaras\u0131 girilmi\u015f olan m\u00fc\u015fteriler\nSELECT Ad, Soyad, Telefon\nFROM Musteriler\nWHERE Telefon IS NOT NULL;\n<\/code><\/pre>\n<\/ul>\n<h2>WHERE Yan T\u00fcmcesi ile Veri Manip\u00fclasyonu (UPDATE ve DELETE)<\/h2>\n<p>WHERE yan t\u00fcmcesi, sadece veri \u00e7ekmekle kalmaz, ayn\u0131 zamanda mevcut verileri g\u00fcvenli ve hedefe y\u00f6nelik bir \u015fekilde de\u011fi\u015ftirmek veya silmek i\u00e7in de vazge\u00e7ilmezdir. Bu i\u015flemler, veritaban\u0131 y\u00f6netiminde b\u00fcy\u00fck sorumluluk gerektiren ad\u0131mlard\u0131r, bu y\u00fczden WHERE ko\u015fullar\u0131n\u0131n do\u011fru belirlenmesi hayati \u00f6nem ta\u015f\u0131r.<\/p>\n<h3>UPDATE Komutu ile Kullan\u0131m<\/h3>\n<p><code>UPDATE<\/code> komutu, bir tablodaki mevcut kay\u0131tlar\u0131n bir veya daha fazla s\u00fctunundaki de\u011ferleri de\u011fi\u015ftirmek i\u00e7in kullan\u0131l\u0131r. WHERE yan t\u00fcmcesi, hangi sat\u0131rlar\u0131n g\u00fcncellenece\u011fini belirler.<\/p>\n<pre><code>-- Departman\u0131 'Sat\u0131\u015f' olan personelin maa\u015f\u0131n\u0131 %10 art\u0131rma (Personel tablosu varsay\u0131m\u0131yla)\nUPDATE Personel\nSET Maas = Maas * 1.10\nWHERE Departman = 'Sat\u0131\u015f';\n\n-- M\u00fc\u015fteri ID'si 105 olan m\u00fc\u015fterinin \u015fehrini '\u0130zmir' olarak g\u00fcncelleme\nUPDATE Musteriler\nSET Sehir = '\u0130zmir'\nWHERE MusteriID = 105;\n<\/code><\/pre>\n<p><strong>Uyar\u0131:<\/strong> Bir <code>UPDATE<\/code> komutunda WHERE yan t\u00fcmcesi kullanmazsan\u0131z, o tablodaki T\u00dcM sat\u0131rlar g\u00fcncellenecektir. Bu, \u00e7o\u011fu zaman istenmeyen ve y\u0131k\u0131c\u0131 bir sonu\u00e7tur!<\/p>\n<h3>DELETE Komutu ile Kullan\u0131m<\/h3>\n<p><code>DELETE<\/code> komutu, bir tablodan bir veya daha fazla sat\u0131r\u0131 silmek i\u00e7in kullan\u0131l\u0131r. WHERE yan t\u00fcmcesi, hangi sat\u0131rlar\u0131n silinece\u011fini belirler.<\/p>\n<pre><code>-- Durumu '\u0130ptal Edildi' olan ve 2023 y\u0131l\u0131ndan \u00f6nceki t\u00fcm sipari\u015fleri silme (Siparisler tablosu varsay\u0131m\u0131yla)\nDELETE FROM Siparisler\nWHERE Durum = '\u0130ptal Edildi' AND SiparisTarihi < &#039;2023-01-01&#039;;\n\n-- Ya\u015f\u0131 18&#039;den k\u00fc\u00e7\u00fck olan t\u00fcm m\u00fc\u015fterileri silme\nDELETE FROM Musteriler\nWHERE Yas < 18;\n<\/code><\/pre>\n<p><strong>Uyar\u0131:<\/strong> Bir <code>DELETE<\/code> komutunda WHERE yan t\u00fcmcesi kullanmazsan\u0131z, o tablodaki T\u00dcM sat\u0131rlar silinecektir. Bu, veri kayb\u0131na yol a\u00e7an geri d\u00f6n\u00fc\u015f\u00fc olmayan bir i\u015flemdir! Her zaman \u00f6nce <code>SELECT<\/code> ile silinecek verileri kontrol etmek iyi bir pratiktir.<\/p>\n<h2>Performans \u0130pu\u00e7lar\u0131 ve En \u0130yi Uygulamalar<\/h2>\n<p>WHERE yan t\u00fcmcesini etkin kullanmak, sadece do\u011fru sonu\u00e7lar almakla kalmaz, ayn\u0131 zamanda sorgu performans\u0131n\u0131 da \u00f6nemli \u00f6l\u00e7\u00fcde etkiler. \u0130\u015fte baz\u0131 pratik ipu\u00e7lar\u0131:<\/p>\n<ol>\n<li><strong>\u0130ndeksleme (Indexing):<\/strong> WHERE ko\u015fullar\u0131nda s\u0131k\u00e7a kulland\u0131\u011f\u0131n\u0131z s\u00fctunlara indeks eklemek, veritaban\u0131n\u0131n o s\u00fctunlarda arama yapmas\u0131n\u0131 h\u0131zland\u0131r\u0131r. \u00d6rne\u011fin, <code>WHERE Sehir = 'Ankara'<\/code> gibi bir sorgunuz varsa, <code>Sehir<\/code> s\u00fctununa indeks eklemek sorgu s\u00fcresini k\u0131saltabilir. Ancak, \u00e7ok fazla indeks eklemek <code>INSERT<\/code>, <code>UPDATE<\/code> ve <code>DELETE<\/code> i\u015flemlerini yava\u015flatabilir, bu y\u00fczden dengeli olmak \u00f6nemlidir.<\/li>\n<li><strong>Fonksiyon Kullan\u0131m\u0131ndan Ka\u00e7\u0131nma:<\/strong> WHERE yan t\u00fcmcesinde s\u00fctunlara do\u011frudan fonksiyon uygulamaktan ka\u00e7\u0131n\u0131n (\u00f6rne\u011fin, <code>WHERE YEAR(SiparisTarihi) = 2023<\/code>). Bu t\u00fcr kullan\u0131mlar, indeksi devre d\u0131\u015f\u0131 b\u0131rakabilir ve veritaban\u0131n\u0131n t\u00fcm sat\u0131rlar\u0131 taramas\u0131na neden olabilir. Bunun yerine, aral\u0131\u011f\u0131 do\u011frudan belirtin: <code>WHERE SiparisTarihi BETWEEN '2023-01-01' AND '2023-12-31'<\/code>.<\/li>\n<li><strong>Veri Tiplerini E\u015fle\u015ftirme:<\/strong> Ko\u015fullarda kar\u015f\u0131la\u015ft\u0131rd\u0131\u011f\u0131n\u0131z de\u011ferlerin ve s\u00fctunlar\u0131n veri tiplerinin uyumlu oldu\u011fundan emin olun. \u00d6rne\u011fin, say\u0131sal bir s\u00fctunu metin olarak kar\u015f\u0131la\u015ft\u0131rmak performans\u0131 d\u00fc\u015f\u00fcrebilir veya beklenmedik sonu\u00e7lara yol a\u00e7abilir.<\/li>\n<li><strong>NULL De\u011fer Kontrol\u00fc:<\/strong> <code>IS NULL<\/code> ve <code>IS NOT NULL<\/code> kullan\u0131rken, bu s\u00fctunlar\u0131n indekslenmesinin performans \u00fczerinde daha az etkisi olabilece\u011fini unutmay\u0131n. NULL de\u011ferler indekslerde farkl\u0131 \u015fekilde i\u015flenebilir.<\/li>\n<li><strong>Parametreli Sorgular Kullanma:<\/strong> \u00d6zellikle uygulama geli\u015ftirirken, kullan\u0131c\u0131 girdilerini do\u011frudan WHERE yan t\u00fcmcesine eklemek yerine parametreli sorgular kullan\u0131n. Bu, SQL Injection sald\u0131r\u0131lar\u0131n\u0131 \u00f6nlemenin yan\u0131 s\u0131ra, veritaban\u0131n\u0131n sorgu planlar\u0131n\u0131 \u00f6nbelle\u011fe almas\u0131na yard\u0131mc\u0131 olarak performans\u0131 art\u0131r\u0131r.<\/li>\n<li><strong>Karma\u015f\u0131k Ko\u015fullarda Parantez Kullan\u0131m\u0131:<\/strong> <code>AND<\/code> ve <code>OR<\/code> operat\u00f6rlerinin kar\u0131\u015f\u0131k oldu\u011fu durumlarda parantezleri kullanarak i\u015flem \u00f6nceli\u011fini a\u00e7\u0131k\u00e7a belirtin. Bu, hem sorgunun okunabilirli\u011fini art\u0131r\u0131r hem de beklenen sonucu alman\u0131z\u0131 sa\u011flar.<\/li>\n<\/ol>\n<h2>Sonu\u00e7 ve S\u0131k\u00e7a Sorulan Sorular (SSS)<\/h2>\n<p>SQL'deki WHERE yan t\u00fcmcesi, veritabanlar\u0131yla etkile\u015fim kurman\u0131n ve onlardan anlaml\u0131 bilgiler \u00e7\u0131karman\u0131n temel ta\u015f\u0131d\u0131r. Veri filtrelemeden manip\u00fclasyona kadar geni\u015f bir yelpazede kritik bir rol oynar. Bu rehberde \u00f6\u011frendi\u011finiz temel ve geli\u015fmi\u015f operat\u00f6rler, veri setleriniz \u00fczerinde tam kontrol sa\u011flaman\u0131za olanak tan\u0131r. Unutmay\u0131n, do\u011fru ve etkin WHERE ko\u015fullar\u0131 yazmak, hem sorgular\u0131n\u0131z\u0131n do\u011frulu\u011funu hem de veritaban\u0131 i\u015flemlerinizin performans\u0131n\u0131 do\u011frudan etkiler. Pratik yaparak ve farkl\u0131 senaryolar deneyerek WHERE yan t\u00fcmcesi konusundaki yetkinli\u011finizi s\u00fcrekli geli\u015ftirebilirsiniz.<\/p>\n<h3>S\u0131k\u00e7a Sorulan Sorular (SSS)<\/h3>\n<p><strong>1. WHERE ve HAVING aras\u0131ndaki temel fark nedir?<\/strong><\/p>\n<p><code>WHERE<\/code> yan t\u00fcmcesi, veriler gruplanmadan <strong>\u00f6nce<\/strong> tek tek sat\u0131rlar\u0131 filtreler. <code>HAVING<\/code> yan t\u00fcmcesi ise <code>GROUP BY<\/code> ile olu\u015fturulan gruplar\u0131 <strong>filtrelemek<\/strong> i\u00e7in kullan\u0131l\u0131r. Yani <code>WHERE<\/code> sat\u0131r baz\u0131nda, <code>HAVING<\/code> grup baz\u0131nda \u00e7al\u0131\u015f\u0131r.<\/p>\n<p><strong>2. WHERE yan t\u00fcmcesinde birden fazla ko\u015fulu nas\u0131l birle\u015ftiririm?<\/strong><\/p>\n<p>Mant\u0131ksal operat\u00f6rler <code>AND<\/code> ve <code>OR<\/code> kullanarak birden fazla ko\u015fulu birle\u015ftirebilirsiniz. Ko\u015fullar\u0131n de\u011ferlendirilme s\u0131ras\u0131n\u0131 belirlemek i\u00e7in parantez <code>()<\/code> kullanmak \u00f6nemlidir.<\/p>\n<p><strong>3. WHERE kullanmadan DELETE veya UPDATE yaparsam ne olur?<\/strong><\/p>\n<p>WHERE yan t\u00fcmcesi olmadan bir <code>DELETE FROM TabloAdi;<\/code> komutunu \u00e7al\u0131\u015ft\u0131r\u0131rsan\u0131z, o tablodaki <strong>t\u00fcm sat\u0131rlar<\/strong> silinir. Benzer \u015fekilde, <code>UPDATE TabloAdi SET Kolon = Deger;<\/code> komutunda WHERE olmazsa, o tablodaki <strong>t\u00fcm sat\u0131rlar\u0131n<\/strong> ilgili kolonu g\u00fcncellenir. Bu i\u015flemler geri al\u0131namaz oldu\u011fu i\u00e7in son derece dikkatli olunmal\u0131d\u0131r.<\/p>\n<p><strong>4. NULL de\u011ferleri WHERE ile nas\u0131l kontrol ederim?<\/strong><\/p>\n<p><code>NULL<\/code> de\u011ferleri kontrol etmek i\u00e7in <code>IS NULL<\/code> veya <code>IS NOT NULL<\/code> operat\u00f6rlerini kullanmal\u0131s\u0131n\u0131z. \u00d6rne\u011fin, <code>WHERE Email IS NULL;<\/code> veya <code>WHERE Telefon IS NOT NULL;<\/code>. <code>= NULL<\/code> veya <code>!= NULL<\/code> kullanmak beklenen sonu\u00e7lar\u0131 vermez \u00e7\u00fcnk\u00fc <code>NULL<\/code> hi\u00e7bir \u015feye e\u015fit de\u011fildir, hatta kendisine bile.<\/p>\n<p><strong>5. WHERE yan t\u00fcmcesinde b\u00fcy\u00fck\/k\u00fc\u00e7\u00fck harf duyarl\u0131l\u0131\u011f\u0131 nas\u0131l \u00e7al\u0131\u015f\u0131r?<\/strong><\/p>\n<p>Bu durum, kulland\u0131\u011f\u0131n\u0131z veritaban\u0131 sistemine (MySQL, PostgreSQL, SQL Server vb.) ve veritaban\u0131n\u0131n veya s\u00fctunun harmanlama (collation) ayarlar\u0131na ba\u011fl\u0131d\u0131r. Baz\u0131 veritabanlar\u0131 varsay\u0131lan olarak b\u00fcy\u00fck\/k\u00fc\u00e7\u00fck harf duyars\u0131zken, di\u011ferleri duyarl\u0131d\u0131r. Genellikle, b\u00fcy\u00fck\/k\u00fc\u00e7\u00fck harf duyars\u0131z arama yapmak i\u00e7in <code>LOWER()<\/code> veya <code>UPPER()<\/code> gibi fonksiyonlar\u0131 kullanabilir veya veritaban\u0131n\u0131n harmanlama ayarlar\u0131n\u0131 de\u011fi\u015ftirebilirsiniz (\u00f6rne\u011fin, <code>WHERE LOWER(Sehir) = 'ankara';<\/code>).<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?\nVeritabanlar\u0131, g\u00fcn\u00fcm\u00fcz\u00fcn dijital d\u00fcnyas\u0131nda bilginin kalbi konumundad\u0131r. Milyonlarca hatta","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1505],"tags":[],"class_list":{"0":"post-34918","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-sql-2","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Giri\u015f: SQL&#039;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Giri\u015f: SQL&#039;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?\" \/>\n<meta property=\"og:description\" content=\"Giri\u015f: SQL&#039;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? Veritabanlar\u0131, g\u00fcn\u00fcm\u00fcz\u00fcn dijital d\u00fcnyas\u0131nda bilginin kalbi konumundad\u0131r. Milyonlarca hatta\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-23T13:41:14+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?\",\"datePublished\":\"2025-11-23T13:41:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\"},\"wordCount\":1638,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"SQL\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\",\"name\":\"Giri\u015f: SQL'de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-11-23T13:41:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Giri\u015f: SQL'de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/","og_locale":"tr_TR","og_type":"article","og_title":"Giri\u015f: SQL'de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?","og_description":"Giri\u015f: SQL'de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? Veritabanlar\u0131, g\u00fcn\u00fcm\u00fcz\u00fcn dijital d\u00fcnyas\u0131nda bilginin kalbi konumundad\u0131r. Milyonlarca hatta","og_url":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-11-23T13:41:14+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"10 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?","datePublished":"2025-11-23T13:41:14+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/"},"wordCount":1638,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["SQL"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/","url":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/","name":"Giri\u015f: SQL'de WHERE Yan T\u00fcmcesi Neden \u00d6nemli? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-11-23T13:41:14+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/giris-sqlde-where-yan-tumcesi-neden-onemli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Giri\u015f: SQL&#8217;de WHERE Yan T\u00fcmcesi Neden \u00d6nemli?"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=34918"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34918\/revisions"}],"predecessor-version":[{"id":34919,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34918\/revisions\/34919"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=34918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=34918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=34918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}