Sample Table Name: EMPTBL
EMPID |
NAME |
SALARY |
1 |
ABC |
10000 |
2 |
XYA |
20000 |
3 |
PAR |
30000 |
1 |
ABC |
10000 |
2 |
XYA |
20000 |
SELECT COUNT(*) FROM EMPTBL;
5
SELECT DISTINCT(NAME) FROM EMPTBL;
SELECT * FROM EMPTBL;
EMPID |
NAME |
SALARY |
1 |
ABC |
10000 |
2 |
XYA |
20000 |
3 |
PAR |
30000 |
1 |
ABC |
10000 |
2 |
XYA |
20000 |
SELECT SUM(SALARY) FROM EMPTBL;
90000
SELECT MIN(SALARY) FROM EMPTBL;
1000
SELECT MAX(SALARY) FROM EMPTBL;
3000
SELECT * FROM EMPTBL ORDER BY EMPID;
EMPID |
NAME |
SALARY |
1 |
ABC |
10000 |
1 |
ABC |
10000 |
2 |
XYA |
20000 |
2 |
XYA |
20000 |
3 |
PAR |
30000 |
SELECT * FROM EMPTBL WHERE SALARY > 10000;
EMPID |
NAME |
SALARY |
2 |
XYA |
20000 |
2 |
XYA |
20000 |
3 |
PAR |
30000 |
SELECT NAME FROM EMPTBL WHERE NAME LIKE 'A%';
SELECT NAME FROM EMPTBL WHERE NAME LIKE '%A';