Does the creation of constraints affect the views that have been created earlier

database-design

Does the creation of constraints(foreign key) affect the views that we have created earlier?

create view allreservations (fno, customer) as
SELECT f.flight_number, customer_number
FROM flight f, flight_reservation fr
WHERE f.flight_number = fr.flight_number;

ALTER TABLE <tablename>
ADD FOREIGN KEY (<attribute>)
REFERENCES <tablename>(<attribute>);

Best Answer

No matter what database you are using, you shouldn't find any problem with it, UNLESS you are using the VIEWS to UPDATE\DELETE records (I know is possible in SQL SERVER).

If you are doing that (update\delete on the view), you will get a constraint error once you try to violate the reference.