Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Foreign key with multiple columns.

Posted on 2001-09-10
1
Medium Priority
?
1,304 Views
Last Modified: 2008-02-26
I have two table say emp & dept.

In the emp table I have set 3 columns as primary key (composite key)

In the dept table again I have all the 3 columns in the emp table for which I want to establish a foreign key relation ship with the corresponding key in the emp table.

Is this possible?
0
Comment
Question by:Bijumathews
1 Comment
 
LVL 1

Accepted Solution

by:
TarekEslim earned 100 total points
ID: 6473337
yes,

use create index
or
 use alter table add constarint.

Tarek
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question