Check this post for SqlServer Faqs
SQL Query to Drop Database in Sql Server
Syntax:DROP DATABASE databasename
Example:drop database lakshmi
Check This SQL Query to Rename Database
Check this post for SQL Query To Find Minimum Salary From Emp Table in SQLSERVER.
Sql query to find highest salary in sqlserver.
Check this post to get 2nd and 3rd Highest salary
SQL Query to copy only structure of one table to other table in SqlServer
SQL Query to get structure of table in SqlServer
Movie Songs Lyrics
Software Testing-QTP Scripts,Testing Faqs
Showing posts with label sql queries asked in interviews. Show all posts
Showing posts with label sql queries asked in interviews. Show all posts
SQL Query To Find Minimum Salary From Emp Table in SQLSERVER.
sql query to get min sal from emp table
Check this post to find 2nd and 3rd Highest salary
sql query to get least salary from emp table
Syntax:select min(columnname)as MIN_SAL from tablename
Ex:select min(sal)as MIN_SAL from emp
Sql query to find highest salary in sqlserver.
Check this post to get 2nd and 3rd Highest salary
SQL Query to copy only structure of one table to other table in SqlServer
SQL Query to get structure of table in SqlServer
Movie Songs Lyrics
Software Testing-QTP Scripts,Testing Faqs
Check this post to find 2nd and 3rd Highest salary
sql query to get least salary from emp table
Syntax:select min(columnname)as MIN_SAL from tablename
Ex:select min(sal)as MIN_SAL from emp
Sql query to find highest salary in sqlserver.
Check this post to get 2nd and 3rd Highest salary
SQL Query to copy only structure of one table to other table in SqlServer
SQL Query to get structure of table in SqlServer
Movie Songs Lyrics
Software Testing-QTP Scripts,Testing Faqs
Sql Query to Retrieve Nth Highest Salary From Table in SQL Server
SQL Server Faqs
SQL Query to find Nth Highest Salary in SQL Server.
SELECT * FROM tablename e1 WHERE N = (SELECT COUNT(DISTINCT (e2.sal))
FROM tablename e2 WHERE e2.sal >= e1.sal)
For example to get 3rd highest salary:
SELECT * FROM emp e1 WHERE 3 = (SELECT COUNT(DISTINCT (e2.sal))FROM emp e2 WHERE e2.sal >= e1.sal)
Similarly to get 2nd highest salary:
SELECT * FROM emp e1 WHERE 2 = (SELECT COUNT(DISTINCT (e2.sal))FROM emp e2 WHERE e2.sal >= e1.sal)
SQL Server Faqs
SQL Query to copy only structure of one table to other table in SqlServer
SQL Query to get structure of table in SqlServer
Movie Songs Lyrics
Software Testing-QTP Scripts,Testing Faqs
SQL Query to find Nth Highest Salary in SQL Server.
SELECT * FROM tablename e1 WHERE N = (SELECT COUNT(DISTINCT (e2.sal))
FROM tablename e2 WHERE e2.sal >= e1.sal)
For example to get 3rd highest salary:
SELECT * FROM emp e1 WHERE 3 = (SELECT COUNT(DISTINCT (e2.sal))FROM emp e2 WHERE e2.sal >= e1.sal)
Similarly to get 2nd highest salary:
SELECT * FROM emp e1 WHERE 2 = (SELECT COUNT(DISTINCT (e2.sal))FROM emp e2 WHERE e2.sal >= e1.sal)
SQL Server Faqs
SQL Query to copy only structure of one table to other table in SqlServer
SQL Query to get structure of table in SqlServer
Movie Songs Lyrics
Software Testing-QTP Scripts,Testing Faqs
Subscribe to:
Posts (Atom)