# Databases > Oracle Difference between Table, View and Synonym?

## richa

Hi All,
 Can anyone tell me the difference between a Table, View and Synonym.
What is the significance of Synonym and under which situations it is used??

Please let me know
thanks in advance - RICHA   :Smile:

----------


## krishnaindia2007

*Table* is a basic unit of data storage in an oracle database. It holds all user accessible data.

*View* is a virtual table
- It can be created on a table or another view.
- It is just like a window through which we can access or change base table data.
- It does contain data of its own. It always takes data from its base table.
- It is stored as a query in data dictionary.Whenever you query a view it gets data from its based table   using this query.

*Main advantage of using views*
- You can ristrict access to predetermined set of rows and columns of a table
- You can hide complexity of query 
- You can hide complexity of calculation

*Synonym* is alternate name given to table, view, sequence or program unit. 
-It is used to mask real name and owner of the object.  
- You can provide public access to tables  by creating public synonymns.

----------


## krish_ORA

I Agree with krishna

----------


## mihir_orcl

HI Bro,
Table :- It is a collection of row and column and it is a basic sotage unit
view :- IT  logically represents subset of data from one or more tables
synonym :- It is Alternative name of Object

----------


## Venus

hi,

  The main functionality of synonym is to access the database objects between different schema's without using the schema names.

----------


## shiva chitta

Hi this shiva prasad chitta...


post a question if u hav any in ( c, c++,  oracle )....

ok .....
now

	A view is created on one or more objects (tables, views, functions) and can include more than one object type as well as more than one object (example: 3-4 tables, 1 function, 1 view can be combined together to form a single view - a logical definition).  Synonyms are created on only one single object - a table, a view, a function, a stored procedure etc.
	Not all views are updateable by definition.  If a view is a single table view, it would be updateable, however, if it is comprised of complex calculations and joins, it is not directly updateable - one has to write Instead Of triggers (IO triggers) in order to make them updateable.  Synonyms (when created on tables or single table views) are updateable since they are created on a single object.
	An index can be created on a view thus forming an indexed view (SQL Server) or a materialized view (Oracle) which materializes the data to the disk - this is pretty common in data warehousing and BI applications.  Synonyms are just a logical definition.
	Synonyms (in Oracle) can be created as a public or a private synonym.  For a view, one needs to specifically grant privileges since there is no such thing like a public or a private view.

----------


## kolisetty

Good morning everybody,

what is the difference between cursor and ref cursor? In which circumstances we use these both and how to use?

thankyou.

----------


## iwaitfor

hi this is raj,

 i have vb project with sql server , but now i am using oracle 9i, so the same project has to be run in xp srv pack 2, vb, oracle. where do i want to change. tell me.

when the project runs it ask for login password for sql server. 
please

----------


## himanshu singh

A table is a two- dimensoinal arrangement of data consisting of rows and columns.
A view is a logical table that contains data collated from a database after you executes a query to retrive data from the database.The arrangement of a column in a view is different from arrangment of columns in database

----------


## sandeep chauhan

i dont know

----------


## sandeep chauhan

plz answer it

----------


## krishnaindia2007

*>>plz answer it*

Already given.

You are expecting answer for what?

----------


## kondleravi

table,view,synonym are called as database objects.
A table is basic storage unit in the form of rows&columns.
A view is a virtual table.we can restrict privileges on table by creating view.
view is used to  retrieve the data with more performance than table .
synonym is alias name for any database object(table,view,synonym....etc)
synonyms are more securable.

----------


## radhikakundala

Hi everybody,
This is radhika....could u please temme 

what is a difference between procedure and a function??

----------


## radhikakundala

:Roll Eyes (Sarcastic): 


> Hi everybody,
> This is radhika....could u please temme 
> 
> what is a difference between procedure and a function??

----------


## Sonawane.naresh82

hi,
table contains coloumns and rows .we denote it with the name TAB_xyz,view is temp table which uses table to retrive dta fasterly.the are started with nane VW_xyz generally.and synonym are alias nasme to dtabase objects e.g- table name TABxyz then we write synonym as a.TABxyz.

----------


## Sonawane.naresh82

store procedure are group of statements but it dose not returns any value.they performs only tasks while functios returns value.

----------


## Sonawane.naresh82

coursors allows row by row processing of result set. disadvantage is that if select quries contain cursor then it will take more time b'se courser takes rountrip during one transation.if we fired select qury then it will take time as that of records and causes n/w conjection.

----------


## Jirange

Hi,
Radhika. differance between function and procedure.
this is very common que.
procedure performs action.
function returns single value.
IN, INOUT, OUT available for procedure.
IN and return used for function. INOUT, OUT possible in function but its very poor programing. also procedure call is possible throanother procedure or execute statement while function called by using select statement or by assigning to any value in PL/SQL block.

----------


## Jirange

view is replica of table , table is oracle object has allocated memory for records in it.
synonym is just calling alise for table name has same allocated memory existance.

----------


## Nikhil Ranjan

> Good morning everybody,
> 
> what is the difference between cursor and ref cursor? In which circumstances we use these both and how to use?
> 
> thankyou.


When you say cursor, u mean explicit cursor or cursor variable. 
cursor(explicit cursor)- it is used to point select query in sql work area
and 
ref cursor it is an explicit cursor which has been defined in standard package.
For more details: search devinline pl/SQl and read in more details. (Not able to post url.)

----------


## yatharthsingh

it has something to do with SQL

----------

