zajicek=> select ename as meno; ERROR: Attribute 'ename' not found zajicek=> select ename as meno from emp; meno -------- KING BLAKE CLARK JONES MARTIN ALLEN TURNER JAMES WARD FORD SMITH SCOTT ADAMS MILLER (14 rows) zajicek=> select *from emp; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 (14 rows) zajicek=> select meno from emp; ERROR: Attribute 'meno' not found zajicek=> alias select ename,12*sal as "rocny plat"; ERROR: parser: parse error at or near "alias" zajicek=> alias select ename, 12*sal as "rocny plat"; ERROR: parser: parse error at or near "alias" zajicek=> alias select ename 12*sal as "rocny plat"; ERROR: parser: parse error at or near "alias" zajicek=> alias select ename, 12*sal as "rocny plat" from emp; ERROR: parser: parse error at or near "alias" zajicek=> alias select ename, 12*sal as "rocny plat" from emp; ERROR: parser: parse error at or near "alias" zajicek=> select ename, 12*sal as "rocny plat" from emp; ename | rocny plat --------+------------ KING | 60000.00 BLAKE | 34200.00 CLARK | 18000.00 JONES | 35700.00 MARTIN | 15000.00 ALLEN | 19200.00 TURNER | 18000.00 JAMES | 11400.00 WARD | 15000.00 FORD | 36000.00 SMITH | 9600.00 SCOTT | 36000.00 ADAMS | 13200.00 MILLER | 15600.00 (14 rows) zajicek=> :) zajicek-> alias ename as meno from emp; ERROR: parser: parse error at or near ":" zajicek=> alias: ename as meno from emp; ERROR: parser: parse error at or near "alias" zajicek=> select ename || ' je ' || job as firma; ERROR: Attribute 'ename' not found zajicek=> select ename || ' je ' || job as firma from emp; firma -------------------- KING je PRESIDENT BLAKE je MANAGER CLARK je MANAGER JONES je MANAGER MARTIN je SALESMAN ALLEN je SALESMAN TURNER je SALESMAN JAMES je CLERK WARD je SALESMAN FORD je ANALYST SMITH je CLERK SCOTT je ANALYST ADAMS je CLERK MILLER je CLERK (14 rows) zajicek=> select ename || ' SA HRA NA ' || job || 'A' as firma from emp; firma ---------------------------- KING SA HRA NA PRESIDENTA BLAKE SA HRA NA MANAGERA CLARK SA HRA NA MANAGERA JONES SA HRA NA MANAGERA MARTIN SA HRA NA SALESMANA ALLEN SA HRA NA SALESMANA TURNER SA HRA NA SALESMANA JAMES SA HRA NA CLERKA WARD SA HRA NA SALESMANA FORD SA HRA NA ANALYSTA SMITH SA HRA NA CLERKA SCOTT SA HRA NA ANALYSTA ADAMS SA HRA NA CLERKA MILLER SA HRA NA CLERKA (14 rows) zajicek=> \dt List of relations Name | Type | Owner ----------+-------+--------- dept | table | zajicek emp | table | zajicek salgrade | table | zajicek (3 rows) zajicek=> select * from salgrade; grade | losal | hisal -------+---------+--------- 1 | 700.00 | 1200.00 2 | 1201.00 | 1400.00 3 | 1401.00 | 2000.00 4 | 2001.00 | 3000.00 5 | 3001.00 | 9999.00 (5 rows) zajicek=> select * from dept; deptno | dname | loc --------+------------+---------- 10 | ACCOUNTING | NEW YORK 20 | RESEARCH | DALLAS 30 | SALES | CHICAGO 40 | OPERATIONS | BOSTON (4 rows) zajicek=> select * from emp; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 (14 rows) zajicek=> select distinct job from emp; job ----------- ANALYST CLERK MANAGER PRESIDENT SALESMAN (5 rows) zajicek=> select job from emp; job ----------- PRESIDENT MANAGER MANAGER MANAGER SALESMAN SALESMAN SALESMAN CLERK SALESMAN ANALYST CLERK ANALYST CLERK CLERK (14 rows) zajicek=> select * from emp order by job; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 (14 rows) zajicek=> select * from emp order by hiredate; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 (14 rows) zajicek=> select ename from emp where sal>3000; ename ------- KING (1 row) zajicek=> select ename from emp where job!='CLERK'; ename -------- KING BLAKE CLARK JONES MARTIN ALLEN TURNER WARD FORD SCOTT (10 rows) zajicek=> select ename from emp where job<>'CLERK'; ename -------- KING BLAKE CLARK JONES MARTIN ALLEN TURNER WARD FORD SCOTT (10 rows) zajicek=> select ename from emp where job |= 'CLERK'; ERROR: Unable to identify an operator '|=' for types 'varchar' and 'unknown' You will have to retype this query using an explicit cast zajicek=> select ename from emp when sal between 2000 and 3000; ERROR: parser: parse error at or near "when" zajicek=> select ename from emp where sal between 2000 and 3000; ename ------- BLAKE JONES FORD SCOTT (4 rows) zajicek=> select ename from emp where hiredate between '1980-01-01' and '1981-0 1-01; zajicek'> select ename from emp where hiredate between '1980-01-01' and '1981-0 1-01'; zajicek'> select ename from emp where hiredate between '1980-01-01' and '1981-0 1-01'; zajicek'> select ename from emp where hiredate between '1980-01-01' and '1981-01-01'; zajicek'> shit zajicek'> select * from emp where job in ('MANAGER','CLERK'); zajicek'> ' zajicek-> zajicek-> zajicek-> zajicek-> df zajicek-> zajicek-> select * from emp where job in ('MANAGER','CLERK'); ERROR: parser: parse error at or near "1980" zajicek=> select * from emp where job in ('MANAGER','CLERK'); empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+---------+------+------------+---------+------+-------- 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 (7 rows) zajicek=> select ename from emp where hiredate between '1980-01-01' and '1981-0 1-01'; ename ------- SMITH (1 row) zajicek=> select * from emp where ename like 'IS%'; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+-------+-----+-----+----------+-----+------+-------- (0 rows) zajicek=> select * from emp where ename like 'J%'; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+-------+---------+------+------------+---------+------+-------- 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 (2 rows) zajicek=> select * from emp where ename like '_A%'; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+----------+------+------------+---------+---------+-------- 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 (3 rows) zajicek=> select ename from emp where comm is null; ename -------- KING BLAKE CLARK JONES JAMES FORD SMITH SCOTT ADAMS MILLER (10 rows) zajicek=> select ename from emp where comm is not null; ename -------- MARTIN ALLEN TURNER WARD (4 rows) zajicek=> select ename from emp where not comm is null; ename -------- MARTIN ALLEN TURNER WARD (4 rows) zajicek=> select ename from emp where comm not is null; ERROR: parser: parse error at or near "is" zajicek=> :) zajicek-> select ename as meno, hiredate as nastup, sal as plat where hiredate zajicek-> select ename as meno, hiredate as nastup, sal as plat where hiredate zajicek-> select ename as meno, hiredate as nastup, sal as plat where hiredate zajicek-> select ename as meno, hiredate as nastup, sal as plat where (hiredate zajicek-> select ename as meno, hiredate as nastup, sal as plat where (hiredate zajicek-> select ename as meno, hiredate as nastup, sal as plat where (hiredat zajicek-> select ename as meno, hiredate as nastup, sal as plat where (hireda zajicek-> select * from emp order by sal decs; ERROR: parser: parse error at or near ":" zajicek=> select * from emp order by sal; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 (14 rows) zajicek=> select * from emp order by sal decs; ERROR: parser: parse error at or near "decs" zajicek=> select * from emp order by sal desc; empno | ename | job | mgr | hiredate | sal | comm | deptno -------+--------+-----------+------+------------+---------+---------+-------- 7839 | KING | PRESIDENT | | 1981-11-17 | 5000.00 | | 10 7902 | FORD | ANALYST | 7566 | 1981-12-03 | 3000.00 | | 20 7788 | SCOTT | ANALYST | 7566 | 1982-12-09 | 3000.00 | | 20 7566 | JONES | MANAGER | 7839 | 1981-04-02 | 2975.00 | | 20 7698 | BLAKE | MANAGER | 7839 | 1981-05-01 | 2850.00 | | 30 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 7782 | CLARK | MANAGER | 7839 | 1981-06-09 | 1500.00 | | 10 7844 | TURNER | SALESMAN | 7698 | 1981-09-08 | 1500.00 | 0.00 | 30 7934 | MILLER | CLERK | 7782 | 1982-01-23 | 1300.00 | | 10 7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 | 1250.00 | 1400.00 | 30 7521 | WARD | SALESMAN | 7698 | 1981-02-22 | 1250.00 | 500.00 | 30 7876 | ADAMS | CLERK | 7788 | 1983-01-12 | 1100.00 | | 20 7900 | JAMES | CLERK | 7698 | 1981-12-03 | 950.00 | | 30 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | | 20 (14 rows) zajicek=> select (ename||' JE '||job||' A BERIE '||12*sal||' ROCNE.')as zamestn anie; ERROR: Attribute 'ename' not found zajicek=> select (ename||' JE '||job||' A BERIE '||12*sal||' ROCNE.')as zamestn zajicek=> select (ename||' JE '||job||' A BERIE '||12*sal||' ROCNE.')as zamestn anie from emp; ERROR: Unable to identify an operator '||' for types 'varchar' and 'numeric' You will have to retype this query using an explicit cast zajicek=> select (ename||' JE '||job||' A BERIE '||12*sal||' ROCNE.')as zamestn zajicek=> select (ename||' JE '||job||' A BERIE ||12*sal||' ROCNE.')as zamestna zajicek=> select (ename||' JE '||job||' A BERIE||12*sal||' ROCNE.')as zamestnan zajicek=> select (ename||' JE '||job||' A BERI||12*sal||' ROCNE.')as zamestnani zajicek=> select (ename||' JE '||job||' A BER||12*sal||' ROCNE.')as zamestnanie zajicek=> select (ename||' JE '||job||' A BE||12*sal||' ROCNE.')as zamestnanie zajicek=> select (ename||' JE '||job||' A B||12*sal||' ROCNE.')as zamestnanie f zajicek=> select (ename||' JE '||job||' A ||12*sal||' ROCNE.')as zamestnanie fr zajicek=> select (ename||' JE '||job||' A||12*sal||' ROCNE.')as zamestnanie fro zajicek=> select (ename||' JE '||job||' ||12*sal||' ROCNE.')as zamestnanie from zajicek=> select (ename||' JE '||job||'||12*sal||' ROCNE.')as zamestnanie from zajicek=> select (ename||' JE '||job||')||12*sal||' ROCNE.')as zamestnanie from zajicek=> select (ename||' JE '||job||') ||12*sal||' ROCNE.')as zamestnanie fro zajicek=> select (ename||' JE '||job||') a||12*sal||' ROCNE.')as zamestnanie fr zajicek=> select (ename||' JE '||job||') as||12*sal||' ROCNE.')as zamestnanie f zajicek=> select (ename||' JE '||job||') as ||12*sal||' ROCNE.')as zamestnanie zajicek=> select (ename||' JE '||job||') as z||12*sal||' ROCNE.')as zamestnanie zajicek=> select (ename||' JE '||job||') as za||12*sal||' ROCNE.')as zamestnani zajicek=> select (ename||' JE '||job||') as zam||12*sal||' ROCNE.')as zamestnan zajicek=> select (ename||' JE '||job||') as zame||12*sal||' ROCNE.')as zamestna zajicek=> select (ename||' JE '||job||') as zames||12*sal||' ROCNE.')as zamestn zajicek=> select (ename||' JE '||job||') as zamest||12*sal||' ROCNE.')as zamest zajicek=> select (ename||' JE '||job||') as zamestn||12*sal||' ROCNE.')as zames zajicek=> select (ename||' JE '||job||') as zamestna||12*sal||' ROCNE.')as zame zajicek=> select (ename||' JE '||job||') as zamestnan||12*sal||' ROCNE.')as zam zajicek=> select (ename||' JE '||job||') as zamestnani||12*sal||' ROCNE.')as za zajicek=> select (ename||' JE '||job||') as zamestnanie||12*sal||' ROCNE.')as z zajicek=> select (ename||' JE '||job||') as zamestnanie ||12*sal||' ROCNE.')as zajicek=> select (ename||' JE '||job||') as zamestnanie |12*sal||' ROCNE.')as z zajicek=> select (ename||' JE '||job||') as zamestnanie 12*sal||' ROCNE.')as za zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCNE.')as z zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCNE.'as za zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCNE.as zam zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCNEas zame zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCNas zames zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROCas zamest zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' ROas zamestn zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' Ras zamestna zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||' as zamestnan zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||'as zamestnani zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal||as zamestnanie zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal|as zamestnanie zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*salas zamestnanie f zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamestnanie zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamestnani f zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamestnan fr zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamestna fro zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamestn from zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zamest from zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zames from e zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zame from em zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as zam from emp zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as za from emp; zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as z from emp; zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as roc from emp zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as rocn from em zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as rocny from e zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as rocn from em zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as roc from emp zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as ro from emp; zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as r from emp; zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "ro from emp zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "roc from em zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocn from e zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny from zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny from zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny p fro zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny pl fr zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny pla f zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny plat zajicek=> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny plat" from emp; zajicek'> ' zajicek(> ) zajicek-> select (ename||' JE '||job||') as zamestnanie, 12*sal as "rocny plat" zajicek-> select (ename||' JE '||job||' as zamestnanie, 12*sal as "rocny plat" zajicek-> select ename||' JE '||job||' as zamestnanie, 12*sal as "rocny plat" f zajicek-> select ename||' JE '||job|| as zamestnanie, 12*sal as "rocny plat" fr zajicek-> select ename||' JE '||job|| as zamestnanie, 12*sal as "rocny plat" fr om emp; ERROR: parser: parse error at or near "select" zajicek=> select ename||' JE '||job|| as zamestnanie, 12*sal as "rocny plat" fr zajicek=> select ename ||' JE '||job|| as zamestnanie, 12*sal as "rocny plat" f zajicek=> select ename || ' JE '||job|| as zamestnanie, 12*sal as "rocny plat" zajicek=> select ename || ' JE ' ||job|| as zamestnanie, 12*sal as "rocny plat" zajicek=> select ename || ' JE ' || job|| as zamestnanie, 12*sal as "rocny plat zajicek=> select ename || ' JE ' || job || as zamestnanie, 12*sal as "rocny pla zajicek=> select ename || ' JE ' || job || as zamestnanie, 12*sal as "rocny pla t" from emp; ERROR: Unable to identify a right operator '||' for type 'varchar' You may need to add parentheses or an explicit cast zajicek=> select ename || ' JE ' || job || as zamestnanie, 12*sal as "rocny pla zajicek=> select ename || ' JE ' || job | as zamestnanie, 12*sal as "rocny plat zajicek=> select ename || ' JE ' || job as zamestnanie, 12*sal as "rocny plat" zajicek=> select ename || ' JE ' || job as zamestnanie, 12*sal as "rocny plat" from emp; zamestnanie | rocny plat --------------------+------------ KING JE PRESIDENT | 60000.00 BLAKE JE MANAGER | 34200.00 CLARK JE MANAGER | 18000.00 JONES JE MANAGER | 35700.00 MARTIN JE SALESMAN | 15000.00 ALLEN JE SALESMAN | 19200.00 TURNER JE SALESMAN | 18000.00 JAMES JE CLERK | 11400.00 WARD JE SALESMAN | 15000.00 FORD JE ANALYST | 36000.00 SMITH JE CLERK | 9600.00 SCOTT JE ANALYST | 36000.00 ADAMS JE CLERK | 13200.00 MILLER JE CLERK | 15600.00 (14 rows) zajicek=> select ename || ' JE ' || job as zamestnanie, 12*sal as "rocny plat" zajicek=> zajicek=> select ename || ' JE ' || job as zamestnanie, 12*sal as "rocny plat" zajicek=> select ename || ' JE ' || job || as zamestnanie, 12*sal as "rocny pla zajicek=> select ename || ' JE ' || job as zamestnanie, 12*sal as "rocny plat" zajicek=> zajicek=> select ename, 12*sal+comm as "Rocny prijem" from emp; ename | Rocny prijem --------+-------------- KING | BLAKE | CLARK | JONES | MARTIN | 16400.00 ALLEN | 19500.00 TURNER | 18000.00 JAMES | WARD | 15500.00 FORD | SMITH | SCOTT | ADAMS | MILLER | (14 rows) zajicek=> select "rocny prijem" from emp; ERROR: Attribute 'rocny prijem' not found zajicek=> select ename:dname from emp,dept where emp.depthno=dept.deptno; ERROR: parser: parse error at or near ":" zajicek=> select ename,dname from emp,dept where emp.depthno=dept.deptno; ERROR: No such attribute or function 'depthno' zajicek=> select ename,dname from emp,dept where emp.deptno=dept.deptno; ename | dname --------+------------ KING | ACCOUNTING CLARK | ACCOUNTING MILLER | ACCOUNTING JONES | RESEARCH FORD | RESEARCH SMITH | RESEARCH SCOTT | RESEARCH ADAMS | RESEARCH BLAKE | SALES MARTIN | SALES ALLEN | SALES TURNER | SALES JAMES | SALES WARD | SALES (14 rows) zajicek=> select ename,grade from emp,salgrade, where emp.sal between salgrade. losal and salgrade.hisal; ERROR: parser: parse error at or near "where" zajicek=> select ename,grade from emp,salgrade, where emp.sal between salgrade. zajicek=> select ename,grade from emp,salgrade where emp.sal between salgrade.l zajicek=> select ename,grade from emp,salgrade where emp.sal between salgrade.l osal and salgrade.hisal; ename | grade --------+------- KING | 5 BLAKE | 4 CLARK | 3 JONES | 4 MARTIN | 2 ALLEN | 3 TURNER | 3 JAMES | 1 WARD | 2 FORD | 4 SMITH | 1 SCOTT | 4 ADAMS | 1 MILLER | 2 (14 rows) zajicek=> select ename,grade from emp,salgrade where emp.sal between salgrade.l zajicek=> select ename,grade from emp,salgrade where emp.sal between salgradelo zajicek=> select ename,grade from emp,salgrade where emp.sal between salgradlos zajicek=> select ename,grade from emp,salgrade where emp.sal between salgralosa zajicek=> select ename,grade from emp,salgrade where emp.sal between salgrlosal zajicek=> select ename,grade from emp,salgrade where emp.sal between salglosal zajicek=> select ename,grade from emp,salgrade where emp.sal between sallosal a zajicek=> select ename,grade from emp,salgrade where emp.sal between salosal an zajicek=> select ename,grade from emp,salgrade where emp.sal between slosal and zajicek=> select ename,grade from emp,salgrade where emp.sal between losal and zajicek=> select ename,grade from emp,salgrade where empsal between losal and h zajicek=> select ename,grade from emp,salgrade where emsal between losal and hi zajicek=> select ename,grade from emp,salgrade where esal between losal and his zajicek=> select ename,grade from emp,salgrade where sal between losal and hisa zajicek=> select ename,grade from emp,salgrade where sal between losal and hisa l; ename | grade --------+------- KING | 5 BLAKE | 4 CLARK | 3 JONES | 4 MARTIN | 2 ALLEN | 3 TURNER | 3 JAMES | 1 WARD | 2 FORD | 4 SMITH | 1 SCOTT | 4 ADAMS | 1 MILLER | 2 (14 rows) zajicek=> select ename,grade from emp,salgrade where sal between losal and hisa l order by grade; ename | grade --------+------- JAMES | 1 SMITH | 1 ADAMS | 1 MARTIN | 2 WARD | 2 MILLER | 2 CLARK | 3 ALLEN | 3 TURNER | 3 BLAKE | 4 JONES | 4 FORD | 4 SCOTT | 4 KING | 5 (14 rows) zajicek=> \q