Relational Algebra (Union Operation)

preview_player
Показать описание
DBMS: Relational Algebra (Union Operation)
Topics discussed:
1. Recap of various fundamental operations in relational algebra.
2. Basics of Union (U) operation in relational algebra.
3. Syntax of Union (U) operation in relational algebra.
4. Difference between the union of two relations and the union of two attributes.
5. Solved examples using union (U) in relational algebra.
6. Two necessary conditions to be satisfied before performing union (U) operation on any relation with example.

Music:
Axol x Alex Skrindo - You [NCS Release]

#DBMSByNeso #DBMS #RelationalAlgebraOperations
Рекомендации по теме
Комментарии
Автор

Q.2 Ans- pi <ID> (sigma <Semester='Spring' ^ Year='2020'> (Teaches)) U pi <ID> (sigma <Semester='Fall' ^ Year='2021'> (Teaches))

tanishhede
Автор

Thanks a bunch. This helped me pass my Data Management course I need for my bachelors degree!

sebastiananderson
Автор

solution
π ID (σ semester = "Spring" ^ year = "2020"(Teaches)) U π ID (σ semester = "Fall" ^ year = "2021"(Teaches))

AgnesLuntu
Автор

Q2 =pi iD (sigma semaster ="spring" ^ years =2020(teaches)) U pi iD (sigma semaster ="fall" ^ years =2021(teaches))

Milanou_R
Автор

instead of using the ∪ between the two projections in the following general scheme: Π_id ( σ_a Table ) ∪ Π_id ( σ_b Table ) can I simply use the OR operator between the two conditions a and b resulting in a simplified Π_id ( σ_(a ∨ b) Table ) scheme?
Is it equivalent or does the resulting table change? and if so how?

albertopini
Автор

Yep since the question ssys "who taught courses" we use teaches relation😮

YohannesBayeh
Автор

For the 2nd one....we have to choose teaches relation....is it correct??

prathyusha
Автор

Is there a way that we will be getting a pdf for the above teaching?

AduotJok
Автор

Homework Question 2 Answer with Explanation:
Π ID (σ ID = (σ Semester = 'Spring' ^ Year = 2020 (Teaches)) U Π ID (σ Semester = 'Fall' ^ Year = 2021 (Teaches)) (Instructors))

Explanation:
1) We will be using 'Teaches' to find the value as it contains 'Semester', 'Year' and 'ID'. (Semester and Year columns needed for the condition and ID required to find the names of the Instructors as it being present in the Instructors table as well)

2) Selecting the entries in 'Teaches' which have the 'Semester' as 'Spring' and 'Year' as 2020:
σ Semester = 'Spring' ^ Year = 2020 (Teaches)

3) Selecting the entries in 'Teaches' which have the 'Semester' as 'Spring' and 'Year' as 2020:
σ Semester = 'Fall' ^ Year = 2021 (Teaches)

4) Projecting only 'ID' column from the given selection:
Π ID (σ Semester = 'Spring' ^ Year = 2020 (Teaches))
Π ID (σ Semester = 'Fall' ^ Year = 2021 (Teaches))

5) Finding their Union which will return 'ID' of all those in 'Teaches' which had 'Semester' as 'Spring' and 'Year' as 2020 and/or had 'Semester' as 'Fall' and 'Year' as 2021:
Π ID (σ Semester = 'Spring' ^ Year = 2020 (Teaches)) U Π ID (σ Semester = 'Fall' ^ Year = 2021 (Teaches))

6) Projecting the 'ID' of all 'Instructors' after selecting the entries where 'ID' is equal to 'ID' from above:
skeleton query = Π ID (σ ID = XXX (Instructor))
Π ID (σ ID = (σ Semester = 'Spring' ^ Year = 2020 (Teaches)) U Π ID (σ Semester = 'Fall' ^ Year = 2021 (Teaches)) (Instructors))

kaushiksinghrawat
Автор

can someone explain which relation to take as some is using teaches whereas some section.can we take any? pls help

karanpegu
Автор

Project ID (select sem=fall OR year=2021 (Teaches) U select sem=Spring OR year=2020 (Teaches))

dbzaddicted
Автор

How can a member take loan if he's account is not in the same bank

independent
Автор

Solution:
1. π Course_ID (σ Semester="Spring" ^ Year=2020 (Section)) U π Course_ID (σ Semester="Fall" ^ Year=2021 (Section))
2. 😶‍🌫

ismailfaridi
Автор

for part a we will use takes relation because the section relation contains all courses irrespective of them being taken or not while we want all courses that have been taken
for part b we will use teaches relation because again we want the instrusctors who have taught courses

Devansh
Автор

why u use section relation instate of teaches ? in example 2

phanendraojha
Автор

Sir can we perform the union operation in a single relation ?

rahulmahanta
Автор

Why can't we consider teaches or takes relation instead of section relation in the example2

SravikaCh-jl
Автор

Q1) list all the course IDs which are taken in spring 2020 or Fall 2021.
Solution:

πID(σ semester="Spring"(Takes)) U πID (σ semester="Fall"(Takes))


Q2) List all the instructors ID who taught courses in Spring 2020 or Fall 2021.
Solution:

πID(σ semester="Spring" ^ year=2020(Teaches)) U πID (σ semester="Fall" ^ year=2021(Teaches))

tahirahmed
Автор

π InstructorID, CourseID​ (σ Semester= ′ Spring ′ ^ Year=2020 (Teaches)) ∪
π InstructorID, CourseID (σ Semester= ′Fall ′ ^ Year=2021(Teaches))

maginodaniel
Автор

π Id (Instructor) (ρ semester ='Spring' ^ year = 2020(teaches)) U π Id (Instructor) (ρ semester= 'Fall' ^ year = 2021(teaches))

jayshreeram