For the following Relational Algebra / SQL statements, specify the output of each query. (do not explain how each query will be executed, but specify the output to be obtained when the query is executed). (c) R1: ACTORS WHERE YearOfBirth < 1940 OR Gender = 'female' R2(SSNo, FName, LName): R1 [ SSNo, FName, LName ] R3: R2 NATURAL-JOIN ACTEDIN OVER SSNo    C: R3 [ LName, Character ]   (d)  SELECT A1.FName, A1.LName, A1.YearOfBirth FROM ACTORS A1, ACTORS A2 WHERE A1.YearOfBirth = A2.YearOfBirth AND                        A1.SSNo != A2.SSNo   (e) R1: ACTEDIN [ FilmNo, SSNo ] R2: FILMS WHERE FilmTitle = 'Unforgiven' [ FilmNo ] R3: ACTEDIN NATURAL-JOIN R2 OVER FilmNo [ SSNo ] R4: ACTORS NATURAL-JOIN R3 OVER SSNo [ SSNo, FName, LName ] R5: ( R1.SSNo ÷ R4.SSNo ) [ FilmNo ]   C: ACTEDIN NATURAL-JOIN R5 OVER FilmNo [ FilmTitle ]   (f)  SELECT A.FName, A.LName, COUNT(*) FROM ACTORS A, ACTEDIN AI WHERE A.SSNo = AI.SSNo GROUP BY A.SSNo, A.FName, A.LName HAVING count(*) > 2 OR count(*) = 0

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

For the following Relational Algebra / SQL statements, specify the output of each query. (do not explain how each query will be executed, but specify the output to be obtained when the query is executed).

(c) R1: ACTORS WHERE YearOfBirth < 1940 OR Gender = 'female'

R2(SSNo, FName, LName): R1 [ SSNo, FName, LName ]

R3: R2 NATURAL-JOIN ACTEDIN OVER SSNo 

  C: R3 [ LName, Character ]

 

(d)  SELECT A1.FName, A1.LName, A1.YearOfBirth

FROM ACTORS A1, ACTORS A2

WHERE A1.YearOfBirth = A2.YearOfBirth AND

                       A1.SSNo != A2.SSNo

 

(e) R1: ACTEDIN [ FilmNo, SSNo ]

R2: FILMS WHERE FilmTitle = 'Unforgiven' [ FilmNo ]

R3: ACTEDIN NATURAL-JOIN R2 OVER FilmNo [ SSNo ]

R4: ACTORS NATURAL-JOIN R3 OVER SSNo [ SSNo, FName, LName ]

R5: ( R1.SSNo ÷ R4.SSNo ) [ FilmNo ]

  C: ACTEDIN NATURAL-JOIN R5 OVER FilmNo [ FilmTitle ]

 

(f)  SELECT A.FName, A.LName, COUNT(*)

FROM ACTORS A, ACTEDIN AI

WHERE A.SSNo = AI.SSNo

GROUP BY A.SSNo, A.FName, A.LName

HAVING count(*) > 2 OR count(*) = 0

Consider the following ACTORS, FILMS and ACTEDIN relations for this problem.
АСTORS
FILMS
SSNO FName
LName
YearOfBirth
Gender
Film FilmTitle
Number Lengthin
Production OfPrices Mins
Yearof
No
1
Bruce
Willis
1955
male
1
The Sixth Sense
1999
32
107
Milla
Jονοvich
1975
female
2
Sin City
2005
31
124
3
Clint
Eastwood 1930
male
3
The Fifth Element
1997
126
4
Turkan
Sray
1945
female
4
Unforgiven
1992
40
131
Kevin
Costner
1955
male
5
A Perfect World
1993
22
138
Robert
De Niro
1943
male
6.
A Bronx Tale
1993
1
177
7
Yilmaz
Guney
1937
male
The Godfather I|
7
1974
16
202
8.
Al
Pacino
1940
male
8
Once Upon a Time in America
1984
13
229
9
Danny
Devito
1944
male
9
One Flew Over the Cuckoo's Nest 1975
35
131
10
Jack
Nicholson 1937
male
10
The Departed
2006
94
151
11
Tarik
Akan
1949
male
11
The Shining
1980
3
146
12
Kadir
Inanir
1949
male
12
Titanic
1997
121
194
13
Selvi Boylum Al Yazmalim
1977
90
АСТEDIN
14
Yol
1982
6
114
SSNO
FilmNo
Character
15
Inception
2010
148
148
1
1
Dr. Malcolm Crowe
1
2
Hartigan
1
3
Korben Dallas
2
3
Leeloo
3
4
Bill Munny
3
Chief Red Garnett
4
13
Asya
Robert 'Butch' Haynes
6.
Lorenzo
7
Vito Corleone
8
David 'Noodles' Aaronson
7
Michael Corleone
9
Martini
10
R.P. McMuphy
10
10
Frank Costello
10
11
Jack Torrance
Seyit Ali
11
14
12
13
Ilyas
2.
Transcribed Image Text:Consider the following ACTORS, FILMS and ACTEDIN relations for this problem. АСTORS FILMS SSNO FName LName YearOfBirth Gender Film FilmTitle Number Lengthin Production OfPrices Mins Yearof No 1 Bruce Willis 1955 male 1 The Sixth Sense 1999 32 107 Milla Jονοvich 1975 female 2 Sin City 2005 31 124 3 Clint Eastwood 1930 male 3 The Fifth Element 1997 126 4 Turkan Sray 1945 female 4 Unforgiven 1992 40 131 Kevin Costner 1955 male 5 A Perfect World 1993 22 138 Robert De Niro 1943 male 6. A Bronx Tale 1993 1 177 7 Yilmaz Guney 1937 male The Godfather I| 7 1974 16 202 8. Al Pacino 1940 male 8 Once Upon a Time in America 1984 13 229 9 Danny Devito 1944 male 9 One Flew Over the Cuckoo's Nest 1975 35 131 10 Jack Nicholson 1937 male 10 The Departed 2006 94 151 11 Tarik Akan 1949 male 11 The Shining 1980 3 146 12 Kadir Inanir 1949 male 12 Titanic 1997 121 194 13 Selvi Boylum Al Yazmalim 1977 90 АСТEDIN 14 Yol 1982 6 114 SSNO FilmNo Character 15 Inception 2010 148 148 1 1 Dr. Malcolm Crowe 1 2 Hartigan 1 3 Korben Dallas 2 3 Leeloo 3 4 Bill Munny 3 Chief Red Garnett 4 13 Asya Robert 'Butch' Haynes 6. Lorenzo 7 Vito Corleone 8 David 'Noodles' Aaronson 7 Michael Corleone 9 Martini 10 R.P. McMuphy 10 10 Frank Costello 10 11 Jack Torrance Seyit Ali 11 14 12 13 Ilyas 2.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Complex Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education