views:

46

answers:

1
+1  Q: 

Oracle delete user

I have such table:

users:
id PK
.
.
.
workers:
id PK
user_id (FK to users)
.
.
.
evaluations:
id PK
worker_id (FK to workers)
.
.
.

And now I want to delete user. When I delete user then worker also should be deleted. How can I do this?

+7  A: 

You have 2 options:

  1. Create 3 delete-statements
  2. Create a cascading delete constraint
Espo