suma


{ City }
< Country > india
* Profession *
User No # 96948
Total Questions Posted # 0
Total Answers Posted # 5

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 69
Users Marked my Answers as Wrong # 20
Questions / { suma }
Questions Answers Category Views Company eMail




Answers / { suma }

Question { 5387 }

how can we replace the particular column value of a resulted
set of executed query? I mean write down a sql query to
chane the particular column's value of a resulted set of
executed query


Answer

select decode(salary,2500,1000,3000,2500, 3000) from
employees;
This query will replace the salary column value from
employees.
If the salary is 2500 then 1000 is displayed in the
resultset, else if 3000 then 2500 will be displayed esle
2000 is displayed.

Is This Answer Correct ?    0 Yes 0 No

Question { Cap Gemini, 15245 }

How will you select unique values from a list of records?


Answer

select distinct(emp_name) from employees;

Is This Answer Correct ?    27 Yes 0 No


Question { Cap Gemini, 13918 }

How will you delete a particular row from a Table?


Answer

delete from rmployees where employee_id=101

Is This Answer Correct ?    20 Yes 3 No

Question { Cap Gemini, 14230 }

What is the difference between the Primary and Foreign key?


Answer

Primary key is unique index and non null coulum in a table.
While foreign key can have repeated values.

Is This Answer Correct ?    9 Yes 1 No

Question { Synechron, 31949 }

From an Employee table, how will you display the record
which has a maximum salary?


Answer

SELECT emp_name, salary FROM EMPLOYEES E1
WHERE (0) = (SELECT COUNT(DISTINCT(E2.salary))
FROM EMPLOYEES E2
WHERE E1.salary < E2.salary)

Is This Answer Correct ?    13 Yes 16 No