U@H@GÃTRGÃFPHVUG6SDIDÃ`6aH6FÃà Ihrà Dört NULL øúyr Alias Bvqryvrà • Sorgulama yapmap için SELECT statemenÕÃxyyhÕyÕ ç ç ç ç SELECT clauseuna sadece görülmesi istenen columnlar ya SELECT [DISTINCT] {* | column [alias], ...} FROM table SELECT * FROM dept SELECT deptno, dname, loc FROM dept SELECT loc, dname, deptno FROM dept SELECT deptno, loc FROM dept SELECT ename, sal, sal + 300 FROM emp SELECT ename, sal, 12 * sal + 100 FROM emp SELECT ename, sal, 12 * (sal + 100) FROM emp T@G@8UÃpyhrqhxvÃÃvúh rvÃÃpyyh ÃhyhÕhÃtryv T@G@8UÃpyhrhÃhiyrqhxvÃpyyh ÕÃurvÃhÕyhivyv T@G@8UÃpyhrhÃhiyrqhxvÃpyyh ÕÃurvÃvrrÃÕ hqhÃhÕyhivyv Õyhivyv • ASPHÃpyhrÃqÕúÕqhÃiÃpyhryh qhÃh vrvxÃvúyryr Ã-xyyhÕyhivyv • Toyh ÕÃt|r rxÃvovÃhqrprÃrx hhÃrvÃpyyh ÃhoÕyÕ ÃUhiyrhÃhyhÃhoÕyh • gpryvxÃÕ hÕÃ-ÃyÃvúyryr ÃhÕÃ|pryv÷rÃhuvrÃyqhÃh÷hà • 7v ÃpyÃIPUÃIVGGÃhqhÃQ vh ÃFrÃyh hxÃh hÕyhqÕhÃIVGGÃqr÷r à içerebilir • IVGGÃhhhÕúÃivyvrrÃiv Ãqr÷r qv ÃIVGG13ÃIVGG13¶¶ÃIVGG13¶Ãµ • IVGGÃqr÷r yvÃiv Ãh vrvxÃvúyrvÃpÃIVGGÃy • 7v ÃpyÃvvvÃrx hqhÃsh xyÕÃvvyrÃt|r rÃyhÕhÃhyvhÃhÕyhhÃqrv • 8yyh ÕÃihúxhÃpyyh yhh vrvxÃvúyryr yrÃrhÃhivÃqr÷r yr yrÃiv yrúv v • T@G@8UÃpyhrqhÃpyyh ÕÃiv yrúvvvÃxyhÃhyhúÕyhÕÃvovÃxyyhÕyhà SELECT ename, sal, 12 * sal + comm FROM emp SELECT ename Name, job, sal “Annual Salary $” FROM emp Column 7v yrú SELECT ename||’ is a ‘||job||’ and will earn ‘|| sal * 12 || ’ $ in year ’||2000 Employee FROM emp xh hxr yr ÃqvvvrÃGvr hyÃxh hxr yr Ãqrv ÃUh vuÃxh hxr yr õ¶ÃvovrÃhyÕhyÕà tirmek hÕyh ÃvrÃyq÷ÃtvivÃhÕyhyÕqÕ Unique pyyh ÕÃivyrúvvvÃvrÃqr÷r yr vvÃt|r v 96U6`DÃTDIDSG6I9DSH6FÃW@ÃTDS6G6H6FÃà Ihrà Where • SELECT claurqhxvÃ9DTUDI8UÃxrà qÃxrqvvqrà hÃhÕyhà SELECT DISTINCT deptno FROM emp SELECT DISTINCT deptno, job FROM emp Bvqryvrà • WHERE clarÃq|q yrprxà ÃhÕÕÃÕÕ yhqÕ ÕyÕ SELECT [DISTINCT] {* | column [alias], ...} FROM table [WHERE condition(s)] ç ç Hiredate’i 01-JANç ç anlar ç ç Mgr’si 7902, 7566 yada 7788 olanlar ç Ename’i FORD yada ALLEN olanlar ç ç Hiredate’i 01-JAN-81 ile 31-DECç Ename’inin ikinci harfi A olanlar ç Comm’u NULL olanlar ç Gerçek % vaya _ karakterlerini kullanmak içi ç Sal’i 1100’den büyük ve job ç ç ç ç ç Ename’inde A harfi olmayanlar ç Comm’u NULL olmayanlar @hr¶vÃE6H@TÃyhyh õ¶ÃvovrÃhÕyÕ ÃÃphrÃrrvrqv Logical Operators SELECT * FROM emp WHERE ename = ‘JAMES’ SELECT * FROM emp WHERE hiredate = ’01-JAN-95’ SELECT * FROM emp WHERE deptno = 10 SELECT * FROM emp WHERE sal <= comm SELECT * FROM emp WHERE sal BETWEEN 1000 AND 1500 SELECT * FROM emp WHERE mgr IN (7902, 7566, 7788) SELECT * FROM emp WHERE ename IN (‘FORD’, ‘ALLEN’) SELECT * FROM emp WHERE ename LIKE ‘S%’ SELECT * FROM emp WHERE hiredate LIKE ‘%81’ SELECT * FROM emp WHERE ename LIKE ‘_A%’ SELECT * FROM emp WHERE comm IS NULL SELECT * FROM emp WHERE ename LIKE ‘\%A\_\%B’ ESCAPE ‘\’ ODD ÕU6 TRUE T F U FALSE F F F UNKNOWN U F U Ãvryà $Ãh hÕqhÃy @hr¶vÃTÃuh svÃvyrÃihúyhhyh ' PSà TRUE FALSE UNKNOWN Ãh hÕqhÃyhyh Ã@T86Q@õ¶ÃxyyhÕyÕ ¶ÕÃ8G@SFÃyhyh Thy¶và ¶qrÃixÃrhÃwi¶ÕÃ8G@SFÃyhyh Ei¶ÕÃ8G@SFÃH6I6B@SÃ6I6G`TUÃyhhyh Ei¶ÕÃ8G@SFÃH6I6B@SÃ6I6G`TUÃyhhyh Thy¶và ç ç ç ç SELECT * FROM emp ORDER BY hiredate SELECT * FROM emp ORDER BY hiredate DESC SELECT ename, sal * 12 annsal FROM emp ORDER BY annsal SELECT ename, sal, job FROM emp ORDER BY deptno, sal DESC, job 6I9à Ãyhyh ÃThÕyh Ãyq÷ÃtvivÃhÕyÕ Thy¶vÃp¶qhÃxoxÃrhÃrúvÃyhyh Thy¶và SELECT * FROM emp WHERE sal >= 1100 AND job = ‘CLERK’ SELECT * FROM emp WHERE sal >= 1100 OR job = ‘CLERK’ SELECT * FROM emp WHERE job NOT IN (‘CLERK’, ‘MANAGER’, ‘ANALYST’) SELECT * FROM emp WHERE NOT job IN (‘CLERK’, ‘MANAGER’, ‘ANALYST’) SELECT * FROM emp WHERE sal NOT BETWEEN 1000 AND 1500 SELECT * FROM emp WHERE ename NOT LIKE ‘%A%’ SELECT * FROM emp WHERE comm IS NOT NULL SELECT * FROM emp WHERE job = ‘SALESMAN’ OR job = ‘PRESIDENT’ AND sal > 1500 SELECT * FROM emp WHERE (job = ‘SALESMAN’ OR job = ‘PRESIDENT’) AND sal > 1500 TRUE FALSE UNKNOWN -MON-YY’ ($Ãyhyh õ¶ÃvovrÃhÕyÕ ÃÃ9rshyÃs hõ99 9r¶Ã TRUE T T T FALSE T F U Ãvyrà $Ãh hÕqhÃyhhyh 1 2 3 4 5 gpryvxÃTÕ hÕ Operator (...) =,<>,>=,... NOT AND OR Hireqhr¶rxvÃrÃrxvÃh vurÃrÃÃh vurÃt| rÃÕyh hyhÃhh Cv rqhr¶rxvÃrÃÃh vurÃrÃrxvÃh vurÃt| rÃÕyh hyhÃhh 6yvhyh hÃt| rÃqrÃÕ hyhhÃhh PS9@SÃ7`ÃpyhrqhxvÃiv ÃpyÃT@G@8UÃpyhrqhÃyhÕÃúh Ãqr÷vy UNKNOWN T U U NOT TRUE FALSE UNKNOWN F T U
© Copyright 2024 ExpyDoc