Thursday 16 June 2011

OCA 11g Preparation 3

Basic SQL Commands

List name of companies located in BOMBAY.
SQL>select cname from company where city =`BOMBAY';

list name of employees living in city `NAGPUR'
SQL>select ename from employees where city = `Nagpur';

List the names of employee who are not employee with the company 'ACC'.
SQL>select ename from emp_company where not (cname='ACC');
-OR-
SQL>select ename from emp_company where cname<>'ACC';

Suppose you want the names of employee from company 'ACC' or 'TATA'
SQL>select ename from emp_company where cname='ACC' or cname='TATA';

LAB:-
Create your own commands to find out the required data

No comments:

Post a Comment

How To Install LAMP on Ubuntu 12.04

L inux         A pache         M ySQL             P HP Step One—Install Apache open terminal and type in these commands: s udo apt-ge...