Tuesday, July 10, 2012


Step1: connect system/manager

Step2: select * from dba_users; // for list of user;

step3: drop user <username> cascade;   // for user with u want name.

Step4: create user <username> identified by <password> ;   // For creating a user

Step5: grant connect,resource to satish;   // This will give you access to you user a/c

Step6: conn satish/satish;    // Now you are connected to db as 'satish'

Step7: create table Dept (Dno number(2) primary key, Dname varchar2(25) unique, Location varchar2(15) Not Null);  // This will create table.

Step8: set linesize 300;   // For long row

Step9: Desc <table_name>    // shows the columnname,datatype,Notnull constraint.

Step10: insert into Dept(Dno,Dname,Location) values(&dno,'&dname','&location');  // for multiple inserts

Step11: create table Emp(Eno number(6) primary key,Ename varchar2(35) not null,Salary number(8) check(Salary>10000),Deptno number(2), foreign key(Deptno) references Dept(Dno) on update cascade on delete cascade);

These are the steps i have done. But the step11 was showing an error like "right parentheses missing" like that. By removing any one on delete or on update above script was excecuted.

I have to solve