views:

78

answers:

1

Can anyone plz give example how functional dependencies are being implemented in sql.

I have read somewhere that functional dependencies can be implemented using assertions. But how these are implemented can anyone give an example for it. Moreover how to implement FD's in Oracle coz, assertions can't be created in oracle.

+1  A: 

Primary keys and UNIQUE constraints are two examples of how functional dependencies are implemented in SQL.

Functional dependency:

DEPTNO -> DNAME, LOC
DNAME -> DEPTNO, LOC

SQL implementation:

create table dept
  (deptno integer PRIMARY KEY,
   dname varchar2(10) UNIQUE,
   loc varchar2(10));
Tony Andrews