-
HAVING vs WHERE Clause
Where clause restricts rows, what does having clause restricts ?1. only group results.2. rows results.3. both rows and groups result.
-
write a query to update third column such that
There is a table having the following columns :-student id marks1 marks2 maxmarks1 10 20 202 25 30 303 30 10 304 35 25 355 20 40 40write a query to update column maxmarks such that maxmarks column contains whatever be the greater value among marks1...
-
Suppose a customer table is having different columns like customer no, payments.What will be the query to select top three max payments?
SELECT customer_no, payments from customer C1WHERE 3<=(SELECT COUNT(*) from customer C2WHERE C1.payment <= C2.payment)
-
Which is more faster - IN or EXISTS?
EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.
-
There is a string 120000 12 0 .125 , how you will find the position of the decimal place?
INSTR('120000 12 0 .125',1,'.')output 13
-
How will you delete duplicating rows from a base table?
delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); ordelete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv);
-
What is a view ?
A view is stored procedure based on one or more tables, it�s a virtual table.
-
What is difference between Rename and Alias?
Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.
-
What are different Oracle database objects?
TABLESVIEWSINDEXESSYNONYMSSEQUENCESTABLESPACES etc
-
What are various constraints used in SQL?
NULLNOT NULLCHECKDEFAULT
-
What are various joins used while writing SUBQUERIES?
Self join-Its a join foreign key of a table references the same table. Outer Join--Its a join condition used where One can query all the rows of one of the tables in the join condition even though they don't satisfy the join condition.Equi-join--Its a join condition that retrieves rows from one or more tables in which one or more columns in one table are equal to one or more columns in the second table.