-
-
Query to find amout of salary hike
In table "salary" with emp_no,sal_dt,salary which records salary of all employees every month.find the query to give the amount of salary hike and date of hike for all the employees.
-
INSERT Statement Optimization
A script is inserting data into one table, it was taking 15 min to complete before. Today it is taking more than 2 hours. What kind of action you will take?
-
DROP command and VIEW
How does dropping a table affects its view?
-
Remove redundant rows
How to remove redundant rows without any distinct columns in the table itself ?
-
How to retrieve uncommon fields from two different tables?
How can i retrieve uncommon fields from two different tables along with the data??? say i have table A and table B and Tbl A has x,y,z fields and Tbl B has x,a,b fields and i have to retrieve y,z,a,b fields from two tables along with the data.
-
Retrieve all columns except 1 in a table.
I have a table with 20 columns and I have to retrieve 19 except one.
Is there any way easier then giving
SELECT Col1,Col2,Col3,..........Col19 from table1. -
SQL Query to convert single row from multiple tables into single row in a table
I have a scenario like Have 7 tables. All these 7 tables have same metadata structure and also all have 2 columns. In that, One column is same in all 7 tables (Joining column, But not a primary column) and another column has different values.
Below have a example for 2 tables. How can we achieve for 7 tables?
Tab1
====
loc_name mem_name
HYD ... -
-
-
SubQuery Performace - IN clause or EXISTS clause
In subqueries, which is efficient ,the IN clause or EXISTS clause? Does they produce the same result?
-
-
What will be the output of the following query?
SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '**'),'*','TROUBLE') FROM DUAL;TROUBLETHETROUBLE
-
-
-
-
-
-
Case function
if i have a Customer table with following datacust id custname1 A2 Band cars table with following datacar id cust id Model1 1 Toyota2 1 Honda3 2 Suzukiwhat is the query to give follwing out putcustid cust name model model 11 A Toyota Honda2 ...
-
Create View
Write an SQL statement to create views.
SQL Interview Questions
Ans