Homechevron_rightEngineeringchevron_rightRPSC Programmerchevron_rightProgrammer DBMSchevron_rightConsider a join&nbsp;<span style="font family:calibri,sans...

Consider a join ...

  • Q. Consider a join \(X_1 ⋈_ \theta X_2\). Let \(A_1\) and \(A_2\) be sets of attributes from \(X_1\) and \(X_2\)respectively. Let \(A_3\) be the attributes of \(X_1\) that are involved in join condition \(\theta\) but are not in \(A_1 \cup A_2\), and let \(A_4\) be attributes of \(X_2\) that are involved in join condition \(\theta\) but are not in \(A_1 \cup A_2\). What is the optimized version of the relational algebra expression \(\Pi _{A_1 \cup A_2}(X_1 ⋈_ \theta X_2)\)?
  • filter_dramaExplanation
    Answer is : C

    Theta join operations are commutative. 

    \(X_1 ⋈_ \theta X_2\)\(X_2 ⋈_ \theta X_1\)

    Theta joins are associative in the following manner:

    \((X_1 ⋈_ {\theta _1} X_2) ⋈_ {\theta _2 \wedge \theta _3} X_3\) = \(X_1 ⋈_ {\theta _1 \wedge \theta _3} (X_2 ⋈_ {\theta _2} X_3)\)

     

Discussion

    No one started the discussion yet. Break the ice and start the conversation.
    Please Login to be part of the discussion.

Similar Questions

  • 1.

    Which is/are the correct statement given about a relation?

    I. In relational algebra, selection may return duplicate tuples.

    II. In relational algebra, projection will never return duplicate column.
  • filter_dramaExplanation
    Answer is : B

    In relational algebra, selection and projection will never return duplicate entries.

    Symbol

    Name

    Example

    σ

    selection

    σA = 500(R) → Return rows whose A attribute is equal to 500 and no duplicates are allowed

    projection

    B(R) → Output the column B and no duplicate are allowed

  • 2. Consider Join of a relation R with a relation S. If R has m tuples and S has n tuples, then maximum and minimum sizes of the Join respectively are
  • filter_dramaExplanation
    Answer is : B

    Concept:

     A natural join (join) is based on common attributes or common columns to join two tables or relations.

    Explanation:

    Consider an example, suppose there is two tables Employee(Eid, Ename) consists of 5 tuples and department(Eid, Did) consists of 3 tuples only.

    Eid

    Ename

    1

    E1

    1

    E2

    1

    E3

    1

    E4

    1

    E5

     

    Eid

    Did

    1

    D1

    1

    D2

    1

    D3

     

    Natural join of employee and department(Employee * Department) gives:

     m×n = 5 × 3 = 15

    Therefore maximum size is m × n

    Minimum size: 

    When Both the relations have a common attribute but no tuple in both relations match.

    ∴ minimum size = 0.

  • 3.

    The following question involve the three relation below:

    1) R(a,b) = {(0,1), (4,5), (8,9)}

    2) S(b,c) = {(1,2), (5,2), (5,6), (5,10), (13,10)}

    3) T(c,d) = {(2,3), (6,7), (10,11), (10,3)}

    The number of tuples in R ⋈ S ⋈ T, where ⋈ is the natural join is:

  • filter_dramaExplanation
    Answer is : A

    Result of R ⋈ S ⋈ T is

    0

    1

    2

    3

    4

    5

    2

    3

    4

    5

    6

    7

    4

    5

    10

    11

    4

    5

    10

    3

  • 4.

    Consider the following relation schema of students.

    STUDENT (Rollno, Name, DOB, Marks, Gender) Which of the given query is equivalent to this query in English? “Find the tuples of student having marks above 80”. 

  • filter_dramaExplanation
    Answer is : A
    Key Points

    Option 1:σMARKS>80 (STUDENT)

    True, Find the number of students having marks above 80. A selection operator is used to select tuples from a relation based on some condition.

    Option 2: ΠMarks<80 (STUDENT)

    The projection operator is used to project particular columns from a relation but here condition is used so wrong statement. 

    Option 3: σMARKS<80 (STUDENT)

    Find the number of students having marks less than 80. A selection operator is used to select tuples from a relation based on some condition.

    Option 4: ΠMarks>80 (STUDENT)

    The projection operator is used to project particular columns from a relation but here condition is used so wrong statement. 

    Hence the correct answer is σMARKS>80 (STUDENT).

  • 5.

    Consider two relational schemas: 

    emp(ID, name, address, phone number, deptID)

    department(ID, managerID, deptname, location)

    What does the following relational expression perform?

    \(π_{(name, managerID)} (σ_{emp.deptID=department.ID} (σ_{deptname="Marketing"}(emp × department)))\)

  • filter_dramaExplanation
    Answer is : A
    The expression retrieves name of all employees in the Marketing department along with their manager ID.

Programmer DBMSTopics

leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points