Sunday, May 9, 2010

Primary key in oracle




CREATE TABLE emp_table
( emp_id numeric(10) not null,
emp_name varchar2(50) not null,
company_name varchar2(50),
CONSTRAINT emp_pk PRIMARY KEY (emp_id, emp_name)
);

How to Create a Table in Oracle




CREATE TABLE DEMO_TBLE(
EMP_NAME VARCHAR2(30),
EMP_SALARY NUMBER);

Saturday, May 8, 2010

What is mutating trigger



A trigger which refers to the table on which it resides,and creates a deadlock is called mutating trigger

What is pragma in oracle



Pragma is a keyword in Oracle PL/SQL that is used to provide an instruction to the compiler

Getting Oracle Database Size

select sum(bytes) from dba_data_files

Selecting second maximum salary of employee table

SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY < (SELECT MAX(SALARY) FROM EMPLOYEE)

Difference between grep and find

GREP :

g/re/p meaning search globally for a regular expression and print lines where instances are found
Searches for a pattern in a file. syntax
grep "/bin/bash" /etc/files

FIND :
command searches for files in the current directory and its subdirectories