Databases
Problem 01
Basics of Sets and Relations 01
You are given two sets:
- \(Set\, A = \{1,2,3,4,5,6\}\)
- \(Set\, B = \{2,3,4,5,6,7,8\}\)
How many elements are present in \(A \cup B\) ?
Solution
\(A \cup B = 8 = \{1,2,3,4,5,6,7,8\}\)Problem 02
Basics of Sets and Relations 02
You are given two sets:
- \(Set\, A = \{1,2,3,4,5,6\}\)
- \(Set\, B = \{2,3,4,5,6,7,8\}\)
How many elements are present in \(A \cap B\) ?
Solution
\(A \cap B = 5 = \{2,3,4,5,6\}\)Problem 03
Basics of Sets and Relations 03
You are given two sets:
- \(Set\, A = \{1,2,3,4,5,6\}\)
- \(Set\, B = \{2,3,4,5,6,7,8\}\)
How many elements are present in \(A - B\) ?
Solution
\(A - B = 1 = \{1\}\)
Problem 04
Basics of Sets and Relations 04
You are given two sets:
- \(Set\, A = \{1,2,3,4,5,6\}\)
- \(Set\, B = \{2,3,4,5,6,7,8\}\)
What is the total number of ordered pairs present in the Cartesian Product \(A \times B\)
Solution
\(A \times B = 6 \cdot 7 = 42 = \{(1,2),(1,3),...,(2,2),(2,3),...,(6,7),(6,8)\}\)Problem 05
Basics of Sets and Relations 05
Consider the following data table named Student
Student Name | Number | Sex |
---|---|---|
Ben | 3412 | M |
Dan | 1234 | M |
Nel | 2341 | F |
What is the count
of rows returned in the following relational selection:
\[\begin{align} \sigma(Number < 3000)(Student) \end{align}\]
Solution
\(\sigma(Number < 3000)(Student) = 2 = \{1234,2341\}\)