Sql komutları baslangıc


use HR --VERİTABANIMIZA BAĞLANDIK--

SELECT --GETİR DEMEK--
DEPARTMENT_ID,DEPARTMENT_NAME --TABLODAKİ KOLONLAR--
FROM --HANGİ TABLODAN GETİRELİM-
 DEPARTMENTS
GO  --SORGUNUN BİTTİĞİNİ GÖSTERİR--

SELECT * FROM JOBS

SELECT LAST_NAME  AS --GÖRÜNEN İSMİNİ DEĞİŞTİR--

 SOYADİ ,SALARY ,COMMISSION_PCT,SALARY*COMMISSION_PCT FROM EMPLOYEES "NULL"

SELECT FIRST_NAME,LAST_NAME,FIRST_NAME+ ' HASAN AYLAS  '+ LAST_NAME AS "SOYADİ" FROM EMPLOYEES


SELECT DISTINCT --TEKRARLI KOMUTLARI YOKET-

DEPARTMENT_ID FROM EMPLOYEES

EXECUTE --ÖZELLİKLER--
sp_columns JOBS

SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID=90 --KOLONDAKİ DEPARTMAN İD 90 OLANLARI GETİR--


SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE LAST_NAME='WHALEN' --KOLONDAKİ DEPARTMAN STRİNG İFADELERİ ARAT OLANLARI GETİR--
-----------------------------------------------------------------------------------
SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID <> 90 --KOLONDAKİ DEPARTMAN İD 90 DAN KÜCÜK OLANLARI GETİR--
-----------------------------------------------------------------------------------
SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID <> 90 --KOLONDAKİ DEPARTMAN İD 90 HARİCLERİ GETİR--

-----------------------------------------------------------------------------------
SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID BETWEEN 60 AND 90 --KOLONDAKİ DEPARTMAN İD 90 İLE 60 ARASINDAKİLERİ  GETİR--
-----------------------------------------------------------------------------------
SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID IN (60,90) AND SALARY>900 --KOLONDAKİ DEPARTMAN İD 90 VE  60 OLANLARI  GETİR--

SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID NOT IN (60,90) AND SALARY>900 --KOLONDAKİ DEPARTMAN İD 90 VE  60 OLMAYANLARI  GETİR--
-----------------------------------------------------------------------------------

SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE DEPARTMENT_ID= NULL --KOLONDAKİ DEPARTMAN NULL OLANLARI  GETİR--
-----------------------------------------------------------------------------------

SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE LAST_NAME LIKE 'S%' --KOLONDAKİ S HARFİYLE BAŞLAYANLARI GETİRİR--
-----------------------------------------------------------------------------------
SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE LAST_NAME LIKE '_O%' --KOLONDAKİ İKİNCİ HARFİ O HARFİYLE BAŞLAYANLARI GETİRİR'_ KARAKTER SAYISI'--
-----------------------------------------------------------------------------------

SELECT FIRST_NAME,LAST_NAME,SALARY,DEPARTMENT_ID FROM EMPLOYEES --EMPLOYESS KOLONUNDAN AD SOYAD VE MAAS İSİMLERİ GETİRDİK--

WHERE LAST_NAME LIKE '_a%' --KOLONDAKİ İKİNCİ HARFİ A  HARFİYLE BAŞLAYANLARI GETİRİR'_ KARAKTER SAYISI'--

-----------------------------------------------------------------------------------

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir