中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

3.6.2 Database Systems: Insertion

1. To insert data into a relation, we either specify a tuple, or write a query whose result is the set of tuples to be inserted. Attribute values for inserted tuples must be members of the attribute's domain.

2. An insertion is expressed by

r ← r ∪ E

where r is a relation and E is a relational algebra expression.

3. Some examples:

1. To insert a tuple for Smith who has $1200 in account 9372 at the SFU branch.

deposit ←deposit{("SFU", 9372, "Smith",1200)}

2. To provide all loan customers in the SFU branch with a $200 savings account.

r1←∑bname="SFU"(borrow))
r2 ←bname,loan#,cname(r1)
deposit deposit(r2×{(200)})

Database System Structure: