GeekInterview.com
Series: Subject: Topic:

Oracle SQL Interview Questions

Showing Questions 1 - 7 of 7 Questions
Sort by: 
 | 

What are the advantages and disadvantages of view?

Asked By: sbagai2001 | Asked On: May 26th, 2006

Star Read Best Answer

Editorial / Best Answer

Answered by: Mohan

Answered On : Jun 2nd, 2006

Hi,

Advantages of views:

1. View the data without storing the data into the object.

2. Restict the view of a table i.e. can hide some of columns in the tables.

3. Join two or more tables and show it as one object to user.

4. Restict the access of a table so that nobody can insert the rows into the table.

Disadvatages:

1. Can not use DML operations on this.

2. When table is dropped view becomes inactive.. it depends on the table objects.

3. It is an object, so it occupies space.

Pls. add , if I miss any of them.

Thanks,

Mohan

Answered by: soumya on: May 17th, 2013

View when called always contacts the base table, on which it is built to get the data .so it always goes to the server thats why it degrades the performance of the server.

Answered by: purna chandrudu on: May 13th, 2013

DML operation can performed on views.

Difference between nested query,sub query and nested query?

Asked By: pvsp.indian | Asked On: Jun 15th, 2008

What is difference between nested query,sub query and nested query? Explain clearly with an example?

Star Read Best Answer

Editorial / Best Answer

Answered by: arpitapatel

View all answers by arpitapatel

Member Since Sep-2008 | Answered On : Sep 24th, 2008

Query inside the query is nested query.
It is also called as sub query.
Correlated subquery runs once for each row selected by the outer query. It contains a reference to a value from the row selected by the outer query.

Nested subquery runs only once for the entire nesting (outer) query. It does not contain any reference to the outer query row.

Answered by: rams on: Apr 3rd, 2012

Both are same

Answered by: katgeektalk on: Aug 22nd, 2010

The subquerry is often reffered to as a nested SELECT, sub-SELECT, or inner SELECT statement.
The subquery generally excuted first, and its output is used to complete the query condition for the main (or outer) query.

How many columns can be in the group by clause

Asked By: radha11 | Asked On: Jul 16th, 2008

Star Read Best Answer

Editorial / Best Answer

Answered by: Srinivas4u

View all answers by Srinivas4u

Member Since Jul-2008 | Answered On : Jul 16th, 2008

I am sure that a group by clause can have all columns which are there in that table,not sure if you are looking for anotehr answer

Answered by: akshya dash on: Jul 25th, 2011

there can be n no of columns in a group by clause other than group functions for ex select ename, deptno max(sal) from emp group by ename,deptno; here max(sal) is a group function and ename and ...

Answered by: sasanka on: Jul 21st, 2011

In GroupBy clause contains the no of columns in the select Statement to retrieve the data.

Is there any way we can change the column name in a table

Asked By: sheela | Asked On: Nov 23rd, 2005

Star Read Best Answer

Editorial / Best Answer

Answered by: Praveena

Answered On : Dec 14th, 2005

Yes we can alter Column name in a table using the following query:

alter table <tablename> rename column <old Column Name> to <New Column Name>

Regards,

Praveena

 

 

Answered by: dude_8550 on: Jun 15th, 2011

u can change the column name and also column definition that is whether the data type and its size by the ALTER command.

ALTER TABLE RENAME COLUMN <old column name> TO <new coumn name>;

Answered by: Santhoshkandula on: May 11th, 2011


   yes, it's possible to change the column name by using the following query in SQL server


       SP_RENAME ' <TABLE_NAME.OLD_COLUMN_NAME> ' , ' NEW_COLUMN_NAME '



   Thanks & Regards
    K.Santhosh

View - base tables

Asked By: manu4sql | Asked On: Oct 23rd, 2008

Does view occupy memory? If we delete the base table of existing view, what happens?

Star Read Best Answer

Editorial / Best Answer

Answered by: Mad Hatter

View all answers by Mad Hatter

Member Since Nov-2008 | Answered On : Nov 4th, 2008

View does not occupy memory, but Oracle keeps view code in its dictionary (you can check in user_views, for example)
If you delete the base table, the view becomes INVALID.
In order to make it valid again, you have to ether build the deleted table again, or create anotehr view with the same name and structure as deleted table, or create synonym with the same name as deleted table, which will point to the table with the same structure.

Answered by: pkshve on: Sep 12th, 2010

Views are database objects - they are just SQL code stored in database which will be executed every single time the view is called. Database will check the existance of columns and tables in the base ...

Answered by: manimehra905 on: May 18th, 2010

View does not occupy memory as it only provides a way for watching multiple views of an object: Table. Moreover, it is a virtual table which does not take space.It provides DATA HIDING.For e.g. i...

Having vs where clause

Asked By: abhi abhi | Asked On: Sep 25th, 2008

Where clause restricts rows, what does having clause restricts ?1. Only group results.2. Rows results.3. Both rows and groups result.

Star Read Best Answer

Editorial / Best Answer

Answered by: ajaysinghnegi

View all answers by ajaysinghnegi

Member Since Mar-2009 | Answered On : Mar 27th, 2009

1) HAVING clause can only be used to filter out the aggegate functions whereas WHERE clause cannot filter out the aggegate functions.
2) HAVING clause can be used with GROUP BY function where as WHERE clause cannot be used with group by function.

Answered by: gubba123 on: Aug 8th, 2010

Example: Write a query to display the Managers who are working for more than one Departments:Select  emp_id, count(distinct dept_id)     From emp     Where...

Answered by: Tartauris on: Feb 16th, 2010

Having is used for agregate results while where is used for unagregated results.

What is difference between unique and primary key constraints?

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

A table can have only one primary key whereas there can be any number of unique keys. The columns that compose pk are automatically define not null, whereas a column that compose a unique is not automatically defined to be mandatory must also specify the column is not null.

Star Read Best Answer

Editorial / Best Answer

Answered by: Vijay Raj Jaiswal

Answered On : Sep 20th, 2005

Hi this is modified answer ,pls post this instead of previous which i post

Primay Key                     Unique key

-----------                  ------------------

There is only one         there may be more than 1
Primary key for           Unique Key in table
1 table

It can not contain           It Can contain Null Value
Null value

Answered by: ankitagujrati28 on: Apr 30th, 2010

Unique key means we have to enter unique value but we can enter null.
But in case of Primary key we should have to enter Unique + Not Null value in that particular column.

Answered by: sumanpani on: Sep 16th, 2008

Primay Key                     Unique key-----------        ...

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.