The operation that allows the combination of information from any two relations is known as
The Relational Algebra
The Select Operation
Q . To select those tuples of the instructor relation where the instructor is in the “Physics” department. [ Hint : instructor (ID, name, dept_name, salary) ]
Q . To find all instructors with salary greater than $90,000. [ Hint : instructor (ID, name, dept_name, salary) ]
Q . To find the instructors in Physics with a salary greater than $90,000. [ Hint : instructor (ID, name, dept_name, salary) ]
The Project Operation
Q . To Find the id, salary, name of all instructors. [ Hint : instructor (ID, name, dept_name, salary) ]
Q . Find the name of all instructors in the Physics department. [ Hint : instructor (ID, name, dept_name, salary) ]
The Union Operation :
Q . To Find the set of all courses taught in the Fall 2009 semester, the Spring 2010 semester, or both. [ Hint : section ( course_id, sec_id, semester, year, building, room_number, time_slot_id ) ]
The Set-Difference Operation
To find all the courses taught in the Fall 2009 semester but not in Spring 2010 semester [ Hint : section ( course_id, sec_id, semester, year, building, room_number, time_slot_id ) ]
The Cartesian-Product Operation
To find the names of all instructors in the Physics department together with the course id of all courses they taught. [ Hint : instructor ( ID, name, dept name, salary ) and teaches ( ID, course id, sec id, semester, year ) ]
To find the names of all instructors in the Physics department together with the course id of all courses they taught. [ Hint : instructor ( ID, name, dept name, salary ) and teaches ( ID, course id, sec id, semester, year ) ]
The Rename Operation
Additional Relational - Algebra Operations
Find the names of all instructors in the Comp. Sci. department together with the course titles of all the courses that the instructors teach. [ Hint : instructor ( ID, name, dept name, salary ) , teaches ( ID, course id, sec id, semester, year ) , course ( course_id, title, dept_name, credits ) ]
Demonstrate Outer join Operations.
Extended Relational-Algebra Operations
The general form of the aggregation operation G is as follows:
Q. Find the average salary in each department [ Hint : instructor ( ID, name, dept_name, salary ) ]
Which operation allows the combining of two relation?Explanation: Union just combines all the values of relations of same attributes.
Which operation includes the tuples that are in both the relations?Set Intersection:
The set intersection operation contains all tuples that are in both R & S. It is denoted by intersection ∩.
What is the term used when two relations produces a relation with all possible combinations of the tuples of the two relations operated upon?On applying CARTESIAN PRODUCT on two relations that is on two sets of tuples, it will take every tuple one by one from the left set(relation) and will pair it up with all the tuples in the right set(relation).
What provides a set of operations that take one or more relations as input and return a relation as an output?Relational algebra is also procedural. It takes instances of relations as input and gives instances of relations as output. Operators are used to perform queries.
|