Database | SQL | PL- SQL Interview Questions

Write the complete query for Fetching the data from tables.
select         column1, column2 .
from          table_name
where       <condition>
group by  <columns> having <conditions>
order by   <columns>

Write the SQL for finding the second highest value.
mysql> select * from employee;
+---------+--------+
| name    |  salary |
+---------+--------+
| Dhiraj   |   1000 |
| Dhiraj   |   1000 |
| Kunal    |   2000 |
| Aryan    |   3000 |
+---------+--------+

mysql> select * from employee emp where 2=(select count(distinct salary) from employee where emp.salary>=salary);

+-------+--------+
| name  | salary |
+-------+--------+
| Kunal |   2000 |
+-------+--------+


Write the code to find the duplicate records in a table.
mysql> select * from employee;
+---------+--------+
| name    |  salary |
+---------+--------+
| Dhiraj   |   1000 |
| Dhiraj   |   1000 |
| Kunal    |   2000 |
| Aryan    |   3000 |
+---------+--------+

mysql> select name,salary from employee group by name, salary having count(*)>1;

+--------+--------+
| name   | salary |
+--------+--------+
| Dhiraj |   1000 |
+--------+--------+

What are DDL and DML?

What is Join? Write the query for inner join.

What is natural join?

What are the usage of Self  Join?

What is outer join and what are the types of outer joins, explain briefly?

What are the differences between SQL, PL-SQL, Procedures & Triggers?

What are views and what are it's advantages?

What are the differences between Truncate and Delete command?






Comments

  1. If you fail in finding any details about the placement of the operator, opting for one other casino might be the most effective alternative. In most cases, reside supplier casinos are streamed both from a traditional land-based casino or from their very own reside casino of the site. As mentioned above, dealers are liable for handling the sport so the 카지노 사이트 participant does not really feel even the slightest difference between the online format and the normal casino games. No self-respecting on line casino would tolerate a supplier who isn't familiar with the sport rules, so that they make them bear thorough training. The development of the applied sciences made it possible for each action of the supplier to be tracked by a wise card. The bodily transactions made by the supplier are translated into information used by the software program or to be more exact, by the so-called Optical Character Recognition .

    ReplyDelete

Post a Comment

Thank You for reading our post.
Your comment or feedback encourages us to improve the quality of content.
Don't forget to follow/subscribe to get the latest post.

Popular posts from this blog

Java Coding Interview Questions with Answers

Ericsson Java Interview Questions.

Xylem bangalore : Senior Java Developer.