Result of a set operation in relational algebra
Question:
4. Which of the following binary operations will ALWAYS produce equal number of records as in R or more number of records than in R?
(a) R U S
(b) R / S
(c) R - S
(d) R ∩ S
Answer:
(a) R U S
R U S will always produce equal or more number of records as in R. If S does not contain a record, then result will contain equal number of records to R. If S contains some records then the result will contain R+S number of records
All the other operations will produce equal or less number of records as that of R. For example,
R/S will produce equal number of records if S has only one record.
R - S will produce equal number of records to R if no records are common between R and S.
R ∩ S will produce equal number of records if both R and S same records/similar records.
R - S will produce equal number of records to R if no records are common between R and S.
R ∩ S will produce equal number of records if both R and S same records/similar records.
No comments:
Post a Comment