NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

-- TABLO OLUŞTURMAK
-- CREATE TABLE TABLO ADI
-- (
-- KOLON1AD KOLON1TUR EXTRA OZELLIKLER,
-- KOLON2AD KOLON2TUR EXTRA OZELLIKLER
-- );
-- TABLO OLUSTURMAK
CREATE TABLE IF NOT EXISTS KISILER
(
ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
AD TEXT NOT NULL,
SOYAD TEXT NOT NULL,
YAS INTEGER
);

-- TABLO SILMEK
DROP TABLE IF EXISTS KISILER;

-- VERITABANINDAKI TABLOLARIN LISTESI
SELECT TBL_NAME FROM SQLITE_MASTER;

-- BIR TABLO HAKKINDA BILGI ALMAK
PRAGMA TABLE_INFO(KISILER);

-- TABLOYA KAYIT EKLEME
-- INSERT INTO TABLO ADI (KOLON1, KOLON2 )
-- VALUES (DEGER1, DEGER2);

INSERT INTO KISILER (AD,SOYAD,YAS)
VALUES ('KIVANC', 'TUNCAY', 36);

INSERT INTO KISILER (AD, SOYAD)
VALUES ('EYLEM', 'TUNCAY');

-- TABLODAN KAYIT SİLME
-- DELETE FROM TABLO ADI (WHERE KOSUL...)

-- TÜM KAYITLARI SİLME
-- DELETE FROM KISILER;

-- ADI KIVANC OLAN KAYDI SİL
-- DELETE FROM KISILER WHERE AD = 'KIVANC';

-- ID'Sİ 5 TEN KUCUK OLAN KAYITLARI SİL
-- DELETE FROM KISILER WHERE ID < 5;

-- KAYIT GÜNCELLEME
-- UPDATE TABLO ADI SET KOLON1=DEGER1,
-- KOLON2=DEGER (WHERE KOSUL ...)

-- ID'Sİ 3 OLAN KAYDIN ADINI CEM,
-- YASINI 55 YAP
UPDATE KISILER SET AD = 'CEM', YAS = 55
WHERE ID = 3;

-- TABLODAKI HER KAYDIN YAS DEĞERİNE 15 EKLE
UPDATE KISILER SET YAS = YAS + 15;

-- Veri Çekme
-- SELECT ISTENEN KOLONLAR
-- FROM KULLANILAN TABLOLAR
-- (WHERE KOSULLAR);

-- Kisiler tablosundaki her bir kayıt için
-- tüm kolon değerlerini AL
select id, ad, soyad, yas from kisiler;
select * from kisiler;
-- as ile kolon etiketlerinin değiştirilmesi
select ad as 'Kişinin Adı',
soyad as 'Kişinin Soyadı'
from kisiler;

-- || ile kolon birlestirme
-- ID - Ad Soyad Şeklinde Kayıtların Hepsini AL
SELECT
(id || ' - ' || ad || ' ' || soyad) as 'Kişi'
from kisiler;

-- Kisiler Tablosundaki Kayitlarin
-- ad, soyad ve dogum tarihleri
select ad, soyad, (2017 - yas) as 'D.Tarihi'
from kisiler;

-- Kisiler Tablosunda 26 Yaşından Büyük
-- Olan, Kayıtların Tüm Detaylarını Listele
select * from kisiler where yas > 26

-- 50 yasindan kücük ve id si tek olan
-- kisilerin id ve adlarini listele
select id, ad from KISILER
where yas < 50 and id % 2 = 1;


-- kisiler tablosundaki kayitlari
-- yas degerleri büyükten küçüğe
-- olacak şekilde sırala
select * from kisiler order by yas desc;
select * from kisiler order by yas asc;
select * from kisiler order by soyad,yas;
-- Kayitlari random siralamak
select * from kisiler order by random();

-- Donen Kayitlarin Sadece Bir Bölümünü
-- almak (Blog Sitelerindeki, Sayfalama)
-- kisiler tablosundaki ilk 3 kisinin
-- bilgileri

select * from kisiler limit 3;

-- kisiler tablosundaki ilk 3 kayit
select * from kisiler limit 0, 3;
-- kisiler tablosunki 2. 3 kayit
select * from kisiler limit 3, 3;
-- kisiler tablosundaki 3. 3 kayit
select * from kisiler limit 6, 3;

-- between / and
-- yasi 20 ile 30 arasinda olan kisiler ...
select * from kisiler where yas >= 20 AND
yas <= 30

select * from kisiler where yas between 20 and 30

-- yasi 13, 14, 21, 41 veya 57 olan
-- kisileri getir
-- IN
select * from kisiler where yas in (13,14,21,41,57)

-- yasi 13, 14, 21, 41 veya 57 olmayan
-- not in
select * from kisiler where yas
not in (13,14,21,41,57)

-- Like : String Kiyaslama
-- CONTAINS LIKE '%KEY%'
-- STARTS WITH LIKE 'KEY%';
-- ENDS WITH LIKE '%KEY'
LIKE 'C%N';
-- GMAIL KULLANICILARININ LISTESI
select * from users where email like '%@gmail.com';

-- C Ile Baslayan, N İle Biten 3 Harfli Kullanıcıları
select * from users where ad like 'C_n';

-- Aggregate Fonksiyonlar
-- Count Satır Sayar

select * from kisiler;
select count(*) as 'kisi sayisi' from kisiler;

-- yasi 40 tan buyuk kac kisi var
select count(yas) from kisiler
where yas >= 40;

-- sum
-- tablodaki kisilerin yaslarinin toplami
select sum(yas) as 'Yas Toplam' from kisiler;

-- avg(X)
-- kisilerin yas ortalamasi
select avg(yas) as 'ORT.' from kisiler;

-- MIN ve max(X)
-- kisiler tablosundaki en kucuk ve en buyuk
-- yas degeri
select min(yas) as 'MIN', max(yas) as 'MAX'
from kisiler;

-- yasi, ortalamadan buyuk olan kisilerin
-- bilgilerini
select * from kisiler
where yas >= (select avg(yas) from kisiler);

-- kayit gruplama
select * from kisiler group by yas;
-- hangi yastan kac kisi var
select yas, count(*) from KISILER
group by yas;
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.