insert into accountvalues (``SFU'', ``A-9372'', 1200)
insert into accountselect bname, loan#, 200
from loan
where bname=``SFU''
Here, we use a select to specify a set of tuples.
It is important that we evaluate the select statement fully before carrying out any insertion. If some insertions were carried out even as the select statement were being evaluated, the insertion
insert into accountselect *
from account
might insert an infinite number of tuples. Evaluating the select statement completely before performing insertions avoids such problems.
We can prohibit the insertion of null values using the SQL DDL.