DATABASES Relational AlgebraQeury evaluation queries SQL Con
DATABASES: Relational Algebra/Qeury evaluation. ..queries, SQL,
Consider the Movie Stars database that contains the following relations:
SELECT FROM WHERE
Reference Book (Almost same problems): https://docs.google.com/file/d/0B9aJA_iV4kHYM2dieHZhMHhyRVE/edit
Problem 2. [10 pts] Consider the Movie Stars database that contains the following relations StarsIn(movie Title, movie Year, starName) MovieStar(Name, address, gender, birthdate) For the following SQL query: SELECT movieTitle FROM StarsIn, MovieStar WHERE starName = Name and birthdate LIKE \'% 1960\': write an efficient relational algebra expression that is the equivalent to this query and give an evaluation plan for this expression (choose the algorithm to implement each operation). Justify vour answver.Solution
Query:
Project(pi symbol)movieTitle(Select(sigma symbol)starName = Name AND birthdate = \'%1960\')
bold letter text is the original query.
Evaluation:
first select statement gets executed and gets all the tuple which satisfies two conditions.from returned tubles attribute \'movieTitle\' is picked up and display.
