-
-
Data Conversion
Have 2 table Emp1 (Column Name: Ename), 2nd table Emp2 (Column Name: First and Column Name: LastTable Name :Emp1ENameHunt, MichaelGraham, SmithNelson, Ryan Table Name: Emp2First LastMichael HuntSmith GrahamRyan NelsonNeed to write a SQL query to convert the data from Emp1 to Emp2 in this way.Can any body help me.Thanks
-
Maxvalue.sql Select the Nth Highest value from a table
select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') >'col_name')group by level;Example:Given a table called emp with the following columns:-- id number-- name varchar2(20)-- sal number---- For the second highest salary:-- select level, max(sal) from emp-- where level=2-- connect by prior sal > sal-- group by level
-
-
-
-
HAVING vs WHERE Clause
Where clause restricts rows, what does having clause restricts ?1. only group results.2. rows results.3. both rows and groups result.
-
-
Rename a Column
How to rename a column in a SQL table?
-
How you will avoid duplicating records in a query?
By using DISTINCT
-
-
-
What is difference between Rename and Alias?
Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.
-
-
-
-
What is a view ?
A view is stored procedure based on one or more tables, it’s a virtual table.
-
There is a % sign in one field of a column. What will be the query to find it?
'' Should be used before '%'.
-
-
Oracle SQL Interview Questions
Ans