GeekInterview.com
Answered Questions

How we can transform the columns of a table in rows ?

Asked By: disara | Asked On: Oct 30th, 2007

Answered by: ravinder lathwal on: May 4th, 2012

Using pivot option in SQL server 2008.

Answered by: sankar babu on: May 25th, 2011

by using decode function

Write a query to display the no.Of people with the same job

Asked By: zecar | Asked On: Sep 14th, 2006

Answered by: Iyappan on: Feb 24th, 2012

select job, count(job) from emp group by job;

Answered by: z_ashwini on: Jan 13th, 2012

Code
  1. SELECT count(*), job
  2. FROM emp
  3. GROUP BY job

Create a query that display the last name,hire date and the day of the week on which the employee started. Label the column day. Order the results by the day of the week starting with monday.Last_name...

Asked By: zecar | Asked On: Sep 12th, 2006

Answered by: sankar babu on: May 25th, 2011

select last_name,hiredate,to_char(hiredate,'day') day

from emp

Answered by: mjennna52 on: Aug 28th, 2010

eg. if use scott/tiger schema:

select ename, TO_CHAR(hiredate, 'DAY') as DAY from emp;

What is the difference between replace and translate

Asked By: Srinu | Asked On: Mar 22nd, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: Saumendra Mohanty

Answered On : May 16th, 2006

Both Replace and Translate are single row functions in Oracle 9i.

The Replace Function replaces single character with multiple characters.

But in Translate Function replaces sinlge character with sinlge character only.

Answered by: on: Jan 8th, 2012

The Replace Function can replace the old substring whose length are not same to the length of new substring. (length of newsub DONT NEED eaqual tolength of oldsub ) But in Translate Function only can...

Answered by: #emadri on: Jan 3rd, 2012

It is used to replace one string with another string, and
translate used to translate one character to another char.

What is the diffrence between and constraints and triggers?

Asked By: Interview Candidate | Asked On: Sep 9th, 2005

Answered by: vishnuvardhanarao on: Nov 14th, 2012

Check constraints it cant work multiple tables

Answered by: Chittaranjan Kotian on: May 16th, 2012

Constraints and triggers are both used to enforce business rules at the database level. Constraints are primary key, unique key, foreign key, not null contraints etc, while triggers can be defined at the database and table level to do certain tasks depending on data entered

Find out nth highest salary from emp table

Asked By: Interview Candidate | Asked On: Aug 29th, 2004

Select distinct (a.Sal) from emp a where &n = (select count (distinct (b.Sal)) from emp b where a.Sal < = b.Sal);for eg:-enter value for n: 2sal---------3700

Answered by: bhavikgore on: Oct 27th, 2012

This will work for only highest salary n=1 but not work for 2nd and rest nth salary...
Did you have tried this?

Answered by: rohitosu on: Jul 30th, 2012

Code
  1.  SELECT * FROM  (SELECT employee_id, salary, dense_rank() OVER ( ORDER BY salary DESC)  r
  2.   FROM employees) a
  3.   WHERE a.r =3 ;

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: