select coalesce(empname,empemail)as det from emp2 orser by select * from emp2 order by empid desc; select * from emp2ORder by empid asc,empemail desc; inserting one row with same empid and then ordering: insert into emp2 (empid,empname)values(122,'nivas','
[email protected]'); creating tables : create table student (sid number constraint student_id primary key, sname varchar2(20) not null, saddress varchar2(40) unique, did number, constraint student_did foreign key(did) ); create table student( studentid number primary key, depid foreign key references department(did) , studentname varchar2(30) constraint 'std_nn' not null, studentbranch varchar2(20), constraint 'stdbran-nn' not null(studentbranch) ); Creating student database Create table student (sid number, did int primary key); insert into student values(202,303); insert into student values(202,401); insert into student values(202,401) inserting duplicate entry with same did gives an error