Home » SQL & PL/SQL » SQL & PL/SQL » how to I make relationships between tables in oracle (10 g)
how to I make relationships between tables in oracle [message #351637] Wed, 01 October 2008 17:01 Go to next message
orangesandlemons
Messages: 1
Registered: October 2008
Location: chicago
Junior Member
hi I'd just like to know how to make relationships in oracle like one can do in ms sql server. like one to many relationships?...
Re: how to I make relationships between tables in oracle [message #351648 is a reply to message #351637] Wed, 01 October 2008 23:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How do you do it in mssql?
Then maybe we will know what you mean.

In SQL, relationship are declared via foreign keys.

Regards
Michel
Re: how to I make relationships between tables in oracle [message #351652 is a reply to message #351648] Thu, 02 October 2008 00:04 Go to previous message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Like in real life, these tables should first know of each other, i.e. the should meet somewhere, somehow. It might be because they are in the same schema, or one user has granted required privileges (such as SELECT or REFERENCES).

Next step is to start a relationship. Blind date? Not likely; referential integrity constraints enforced by foreign keys are the way to do that (as Michel has already said).

Now it takes only some time, a cup of coffee and documentation studying in order to happily get those table married.
Previous Topic: Materialized View
Next Topic: Find missing orders
Goto Forum:
  


Current Time: Fri Dec 02 20:54:58 CST 2016

Total time taken to generate the page: 0.09815 seconds