-
-
-
-
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.
-
-
-
Find the Latest Salary of each Employee in Employer table
How to find the latest salary of each employee in the Employer table?
emp.id sal year month
1001 5000 2015 3
1001 3000 2014 4
1002 4000 2013 3
1003 2000 2013 2 -
-
-
SubQuery Performace - IN clause or EXISTS clause
In subqueries, which is efficient ,the IN clause or EXISTS clause? Does they produce the same result?
-
-
-
There are 2 tables, Employee and Department. There are few records in employee table, for which, the department is not assigned. The output of the query should contain all th employees names and their corresponding departments, if the department is assigned otherwise employee names and null value in the place department name. What is the query?
Select emp_name, Dept_name from (Employee_table left outer join Dept_table on Employee_table.Dept_id = Dept_table.Dept_id)
-
Count Records
I have following table as books101 BOOK_NO BOOK_NAME AUTHOR_NAME COST CATEGORY1234 C Dennis 450 System1235 Oracle Loni 550 Database1236 Sql Loni 250 Database1237 Pl/Sql Scott 750 Database Now I want to List all the authors and book name that has more then 1 book written by them.pls help
-
-
-
-
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?
SQL Interview Questions
Ans