Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part C-Relational Algebra 15 Marks Drawing the requested result s using relation

ID: 3836576 • Letter: P

Question

Part C-Relational Algebra 15 Marks Drawing the requested result s using relational algebra for the questions below. Show the column names and values in your result set. 31. EMPLOYEE1 UNION EMPLOYEE2 (4 Marks) EMPLOYEE2 EMPLOYEE1 EMP ID EMP AME EMP ID EMP NAME 123 John Mary 124 Mat 126 Tel 125 Richard Peter 234 Charlie 126 Terr 235 236 Stewart 127 Mike (2 Marks) 32. EMPLOYEE 1 DIFFFERNCE EMPLOYEE2 EMPLOYEE2 EMPLOYEE 1 EMP ID EMP NAME EMP ID EMP NAME. 123 John 123 John 126 Terry 124 Ma 236 Stewart 125 Peter 126 Terry Ron 237

Explanation / Answer

Unique Rows from all the records

EMP_ID

EMP_NAME

123

John

124

Mary

125

Peter

126

Terry

127

Mike

234

Richard

235

Charlie

236

Stewart

Difference query gives unique row from 1st table which are not in 2nd

124

Mary

125

Peter

gives common rows which are present in both tables

123

John

126

Terry

Joins on the basis of Dept_Id, if dep_id is not found in dept table, record will not appear in result set

EMP_ID

EMP_NAME

DEPT_ID

DEPT_NAME

124

Mary

440

Inventory

125

Peter

330

Payroll

126

Terry

220

Finance

LEFT OUTER JOIN, will bring all the rows from left table, and try to join to department if department_id is valid, Else, will put null in dept_name

123

John

550

null

124

Mary

440

Inventory

125

Peter

330

Payroll

126

Terry

220

Finance

Unique Rows from all the records

EMP_ID

EMP_NAME

123

John

124

Mary

125

Peter

126

Terry

127

Mike

234

Richard

235

Charlie

236

Stewart

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote