Monday 4 January 2016

2nd highest sal,top3 rd,delete duplicate,union and union all,joins,remove constraint.

Important Interview Question and Answer.

1.Database
A) Find  2nd Highest Salary.
B) Find Top 2nd Salary.
C) Find Top 3rd Salary.
D) Delete duplicate record.
E) Change the database name.
F) How to remove constraint from a table.



Ans: 1. select max(sal) from salary where sal not in(select max(sal) from salary);
         2.select max(sal)from salary where sal < (select max(sal) from salary);

Ans: 1.select distinct top 2 sal from  salary order by sal desc;

Ans: select top1 sal as '3rd highest salary' from (select distinct top3 sal from salary
order by sal desc) order by sal asc;

Ans: 1. Delete from emp a where rowid !=(select max(rowid) from emp b where a.empno=b.empno);
        2. delete dbo.Temp where Name=(Select top(1)Name from dbo.Temp)

Ans: exec sp_renamedb "test", "test1"
                      OR
        Alter database "test1" modify name="test"

Ans: Alter table mytable drop constraint myconstraint.

How to Upload  File To Blogger

How to upload file in blogger.

1. Go to google search (google drive)
2. Click to the upload file.
3. Choose the upload file you want to upload.
4. Go  to Blog posts -> Add Pages
5. Click on the add via URL button.
6. Enter the URL and click upload.


7. You should now have a working download link to the file in your new post or page.

 Example:  My File


No comments:

Post a Comment