SQLile / SQL Tutorials( SQLile SQL Kullanımı /

SQLile / SQL Tutorials( SQLile SQL Kullanımı /

4. January 2010

Read this article in your language IT | EN | DE | ES

Merhaba Arkadşlar  sizlere bu örnek makkalede  Sqlite kullanımı  hakkında bilgiler  sunacağım işallah sizler için yararlı bir bilgi  kaynağı  olur diyorum 

Giriş

Bu eğitimde Sadece  Windows ve Linux için de geçerlidir.

Cmd.exe ilgili bazı bilgiler: http://www.ss64.com/nt/cmd.html,

http://www.linuxdevcenter.com/pub/ct/19 de bir dizi örnek tabloların içeriğini  nasıl kullanılır  görebilirsiniz .

 

SQLite yükleme

   
1. Http://www.sqlite.org/download.html git
   
2. Bir komut indirin yeni versiyonu satırı programı erişim ve SQLite veritabanları değiştirme. (örneğin, sqlite-3_2_7.zip. bu yazının sürümü için önemli değildir).
   
3. Bir dizin oluşturun (örneğin C: / SQLite3 "> c: \ SQLite3) ve unzip sqlite *. exe o dizindeki.

SQLite ile Kullanımı
Komut satırı yorumlayıcısı (Cmd.exe) Başlangıç:

 















C: \ WINNT \ system32>

Aşağıdaki komutu  oluşturun :

C: \ WINNT \ system32> cd c: \ SQLite3

 
ve "" girin.


Creation  / Açılış Veritabanı

Bir veri tabanı aşağıdaki komut ile  açılabilir:

C: \ SQLite3> SQLite3 mycds.sl3

sl2 kullanmak ve "SL3" SQLite sürüm 2 ve 3 için sırasıyla. bir dosya  ve programı yeniden  bir veritabanı içinde oluşturur.

C: \ SQLite3> SQLite3 mycds.sl3

SQLite version 3.2.7

"Girin." Talimatları için yardım

SQLite>

SQLite komutları

 "sqlit değiştirildi Not>". Bu programı SQL komutlarını çalıştırmaya hazır olduğunu gösteririr


Closing Veritabanı

"Type ".exit" or ".quit"  "." Programına çıkmak için çıkın:

sqlite>. çıkmak


Table Creation / Tablo Oluşturma

 
Şimdi iki alan içeren bir tablo oluşturalım.

sqlite>create table Artists (
--->ArtistID INTEGER PRIMARY KEY,
--->ArtistName TEXT)


 
unutmayın. Aşağıdaki tablo daha karmaşık bir örnektir.

sqlite>create table CDs (
--->CDID INTEGER PRIMARY KEY,
--->ArtistID INTEGER NOT NULL,
--->Title TEXT NOT NULL,
--->Date TEXT);


Table Population

Bu PRIMARY KEY AUTOINCREMENT varsayılan olduğunu unutmayın.

sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Peter Gabriel');
sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Bruce Hornsby');
sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Lyle Lovett');
sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Beach Boys');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,1,'So','1984');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,1,'Us','1992');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,2,'The Way It Is','1986');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,2,'Scenes from the Southside','1990');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,1,'Security','1990');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,3,'Joshua Judges Ruth','1992');
sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,4,'Pet Sounds','1966');


SQLite, ancak METİN veri (Tarih) değerleri  için  sadece   tek tırnak  kullanılır.

İpucu 1: Bir satır kopyalanabilir ve sağ CMD tıklayarak yapıştırılır. CMD Seçilen metni Shift sağ tıklayın (ya da" sağ tıklayın ve.

İpucu 2: Alternatif olarak, (adını ins_artists.sql gibi) aşağıdaki gibi  bir metin dosyası oluşturabilirsiniz:

-- insert 4 records into Artists (a comment line starts with "--") 
insert into Artists (ArtistID,ArtistName) values (NULL,'Peter Gabriel');
insert into Artists (ArtistID,ArtistName) values (NULL,'Bruce Hornsby');
insert into Artists (ArtistID,ArtistName) values (NULL,'Lyle Lovett');
insert into Artists (ArtistID,ArtistName) values (NULL,'Beach Boys');

nokta sonunda noktalı virgül (olmadan) komut çalıştırmak isterseniz :

sqlite>.read ins_artists.sql 

 

SELECT deyimi

ifadeleri   kontrol edelim .

sqlite>select * from Artists;   


and

sqlite>select * from CDs;    

Eğer diğer ,  alanın başlıklarını görüntülemek isterseniz , sqlite>. başlıkları şunlardır

 

ArtisID|ArtistName
1      |Peter Gabriel
2      |Bruce Hornsby
3      |Lyle Lovett
4      |Beach Boys

 

 and

CDID|ArtisID|Title                    |Date
1   |1      |So                       |1984
2   |1      |Us                       |1992
3   |2      |The Way It Is            |1986
4   |2      |Scenes from the Southside|1990
5   |1      |Security                 |1990
6   |3      |Joshua Judges Ruth       |1992
7   |4      |Pet Sounds               |1966

Diğer ifadeler :

sqlite>SELECT Title AS AlbumName FROM CDs;     
sqlite>SELECT Title FROM CDs WHERE Date>=1990 ORDER BY Title;     
sqlite>SELECT Date FROM CDs;     
sqlite>SELECT DISTINCT Date FROM CDs;     
sqlite>SELECT Title FROM CDs GROUP BY ArtistID;     
Iki  tablo arası   veri seçimi

Aşağıdaki SQL deyimi
sqlite>SELECT t1.ArtistName,CDs.Title FROM Artists t1, CDs WHERE t1.ArtistID=CDs.ArtistID    

gives

ArtistName   |Title
Peter Gabriel|So
Peter Gabriel|Us
Peter Gabriel|Security
Bruce Hornsby|The Way It Is
Bruce Hornsby|Scenes from the Southside
Lyle Lovett  |Joshua Judge Ruth
Beach Boys   |Pet Sounds
Bazı Sanatçılar için bir takma ad olarak kullanılan T1 yukarıdaki açıklamada. 

UPDATE deyimi

yanlış bir kayıt  durumun da 

sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Supernatural');

Then correct:

sqlite>UPDATE Artists SET ArtistName ='Santana' WHERE ArtistID=5;     

Now you can insert a CD:

sqlite>insert into CDs (CDID,ArtistID,Title,Date) values (NULL,5,'Supernatural','1999');     

 

table silme komutu ,  deneme

 

sqlite>select * FROM CDs WHERE Title LIKE 'Super%';     

OK? Now we are sure what we are going to delete:

sqlite>DELETE FROM CDs WHERE Title LIKE 'Super%';     

As a precaution you can try first

sqlite>Select * From CDs WHERE Title LIKE 'Super%';     

Kaynak Adres  :  http://shokhirev.com/nikolai/abc/sql/sql.html

Saygılarımla Orhan Türk 

FacebookDigg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

SQL SERVER, SQLite ,

Comments

2/6/2010 8:36:22 PM #
You should really moderate the comments here
2/16/2010 2:16:49 PM #
This is interesting, post more often!
4/5/2010 4:07:37 PM #
I have had problem browsing this post using my iPhone, whats the reason?
4/6/2010 7:30:05 PM #
Hi  blog im from birmingham but im moving to manchester i found this on the google search engine, im in the crane hire company business keep the good work up i will add you to my favoroties.
4/7/2010 12:13:37 AM #
Completely understand what your stance in this matter. Although I would disagree on some of the finer details, I think you did an awesome job explaining it. Sure beats having to research it on my own. Thanks
4/7/2010 5:40:27 PM #
5/14/2010 9:30:02 PM #
Great animations, thanks
Michael shawn Majeed Toronto
Michael shawn Majeed Toronto
5/15/2010 12:12:22 PM #
Be pleasant until ten o'clock in the morning and the rest of the day will take care of itself. ~Elbert Hubbard
5/17/2010 12:21:32 AM #
Hi  blog im from birmingham but im moving to manchester i found this on the google search engine, im in the crane hire company business keep the good work up i will add you to my favoroties.
5/21/2010 5:10:28 PM #
Hi admin, your web page's design is fancy and i like it. Your posts are great. Please continue this great work. Cheers!!
5/22/2010 1:32:37 AM #
Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.
5/29/2010 10:58:26 AM #
Hi
I wanted to sign up to your RSS but the link did not work.  I will come back later.
6/2/2010 5:56:35 AM #
Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck!
6/2/2010 8:08:30 AM #
I like this website. Really helpful and very motivational. Thanks a bunch. This will help me a lot.
6/3/2010 4:05:32 PM #
Form one reason only one-half of the site is being showed. Is this my web browser causing it or is it the site?
6/4/2010 8:58:44 PM #
lot of good information, I come here all the time and am very happy with your updates, Thank you!
6/6/2010 1:30:18 AM #
This is my first post.I really like this blog..nice to meet youI'm reading this post from my I-Phone and it looks great!
6/6/2010 2:31:05 AM #
This is my first post.I really like this blog..nice to meet youI'm reading this post from my I-Phone and it looks great!
6/6/2010 11:26:07 AM #
The import of this is that some men who need the drug to get their sexual function on as often as they want are not able to do so.
6/7/2010 3:30:18 AM #
Thanks for this brilliant article. I am delighted after reading this. Thank you!

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Sayfa 0.015625 saniyede yuklendi.