SlideShare a Scribd company logo
1 of 2
Download to read offline
1. For a Movies database with a person entity with attributes pid (key), fname, lname, suppose
we want to add some publicity-related info for which media have done interviews or which are
scheduled to do interviews. We would want to include the unique media name (ex:
"Entertainment Tonight"), the media type (ex: "TV", "print", or "web") and date of the interview.
How might this be modeled?
a) Add attributes for media name, type and interview date to Person
b) Create an entity for Media with attributes for media name and type and have a many-to-many
relationship between Media and Person
c) Create an entity for Media with attributes for media name and type and have a many-to-one
relationship between Media and Person
d) Create an entity for Media with attributes for media name and type and have a one-to-many
relationship between Media and Person
2.
Suppose we have the following relational model:
Movie(mov_id(PK), title, yr)
Person(pid(PK), fname, lname, gender)
Acts_In(actor_id(PFK), movie_id(PFK), role) -- actor_id references Person, movie_id references
Movie
If you want to query a count of how many movies each actor acted in each year, you should
include the following in the query:
a) GROUP BY pid
b) GROUP BY pid, yr
c) SELECT COUNT(mov_id), COUNT(yr)
d) FROM Movie M1, Person P1, Movie M2, Person P2
1- For a Movies database with a person entity with attributes pid (key.pdf

More Related Content

More from aggallerychennai

1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
aggallerychennai
 
1- Explain what it means to say that an accounting class is not the sa.pdf
1- Explain what it means to say that an accounting class is not the sa.pdf1- Explain what it means to say that an accounting class is not the sa.pdf
1- Explain what it means to say that an accounting class is not the sa.pdf
aggallerychennai
 
1- Elements are the primary types of matter- What make one element dif.pdf
1- Elements are the primary types of matter- What make one element dif.pdf1- Elements are the primary types of matter- What make one element dif.pdf
1- Elements are the primary types of matter- What make one element dif.pdf
aggallerychennai
 

More from aggallerychennai (20)

1- Give an example of Tyler Pipe-MsiWane's culture prior to the change.pdf
1- Give an example of Tyler Pipe-MsiWane's culture prior to the change.pdf1- Give an example of Tyler Pipe-MsiWane's culture prior to the change.pdf
1- Give an example of Tyler Pipe-MsiWane's culture prior to the change.pdf
 
1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
1- Functions of bone- a- b- c- d- e- f- 2- Types of bone cells- a- (bo (1).pdf
 
1- Give a brief statement on the use of PCR and restriction enzymes in.pdf
1- Give a brief statement on the use of PCR and restriction enzymes in.pdf1- Give a brief statement on the use of PCR and restriction enzymes in.pdf
1- Give a brief statement on the use of PCR and restriction enzymes in.pdf
 
1- Foreign direct investment (FDI) occurs a- when there is an acquisi.pdf
1- Foreign direct investment (FDI) occurs a-  when there is an acquisi.pdf1- Foreign direct investment (FDI) occurs a-  when there is an acquisi.pdf
1- Foreign direct investment (FDI) occurs a- when there is an acquisi.pdf
 
1- For a Movies database with a Person entity and a Movie entity which.pdf
1- For a Movies database with a Person entity and a Movie entity which.pdf1- For a Movies database with a Person entity and a Movie entity which.pdf
1- For a Movies database with a Person entity and a Movie entity which.pdf
 
1- Explain why children are so vulnerable to media messages and why ma.pdf
1- Explain why children are so vulnerable to media messages and why ma.pdf1- Explain why children are so vulnerable to media messages and why ma.pdf
1- Explain why children are so vulnerable to media messages and why ma.pdf
 
1- Explain what it means to say that an accounting class is not the sa.pdf
1- Explain what it means to say that an accounting class is not the sa.pdf1- Explain what it means to say that an accounting class is not the sa.pdf
1- Explain what it means to say that an accounting class is not the sa.pdf
 
1- File input reads information from an external file into a C++ progr.pdf
1- File input reads information from an external file into a C++ progr.pdf1- File input reads information from an external file into a C++ progr.pdf
1- File input reads information from an external file into a C++ progr.pdf
 
1- Explain why the higher temperature results in greater absorption- 2.pdf
1- Explain why the higher temperature results in greater absorption- 2.pdf1- Explain why the higher temperature results in greater absorption- 2.pdf
1- Explain why the higher temperature results in greater absorption- 2.pdf
 
1- Explain the risk factors- signs- and symptoms of post-traumatic str.pdf
1- Explain the risk factors- signs- and symptoms of post-traumatic str.pdf1- Explain the risk factors- signs- and symptoms of post-traumatic str.pdf
1- Explain the risk factors- signs- and symptoms of post-traumatic str.pdf
 
1- Explain why is Social responsibility is the extent to which a busin.pdf
1- Explain why is Social responsibility is the extent to which a busin.pdf1- Explain why is Social responsibility is the extent to which a busin.pdf
1- Explain why is Social responsibility is the extent to which a busin.pdf
 
1- Evaluate the hardware components of modern computing environments a.pdf
1- Evaluate the hardware components of modern computing environments a.pdf1- Evaluate the hardware components of modern computing environments a.pdf
1- Evaluate the hardware components of modern computing environments a.pdf
 
1- Evaluating the Effectiveness of Your Message The best way to improv.pdf
1- Evaluating the Effectiveness of Your Message The best way to improv.pdf1- Evaluating the Effectiveness of Your Message The best way to improv.pdf
1- Evaluating the Effectiveness of Your Message The best way to improv.pdf
 
1- Explain the principles of sterilization- disinfection- pasteurizati.pdf
1- Explain the principles of sterilization- disinfection- pasteurizati.pdf1- Explain the principles of sterilization- disinfection- pasteurizati.pdf
1- Explain the principles of sterilization- disinfection- pasteurizati.pdf
 
1- Eve has tricked Alice into decrypting a bunch of ciphered that Alic.pdf
1- Eve has tricked Alice into decrypting a bunch of ciphered that Alic.pdf1- Eve has tricked Alice into decrypting a bunch of ciphered that Alic.pdf
1- Eve has tricked Alice into decrypting a bunch of ciphered that Alic.pdf
 
1- Explain translation elongation- Make sure you mention the role of t.pdf
1- Explain translation elongation- Make sure you mention the role of t.pdf1- Explain translation elongation- Make sure you mention the role of t.pdf
1- Explain translation elongation- Make sure you mention the role of t.pdf
 
1- Explain an ethical dilemma concern which has arisen in recent years.pdf
1- Explain an ethical dilemma concern which has arisen in recent years.pdf1- Explain an ethical dilemma concern which has arisen in recent years.pdf
1- Explain an ethical dilemma concern which has arisen in recent years.pdf
 
1- Explain the Business environment and its internal factors 2- Explai.pdf
1- Explain the Business environment and its internal factors 2- Explai.pdf1- Explain the Business environment and its internal factors 2- Explai.pdf
1- Explain the Business environment and its internal factors 2- Explai.pdf
 
1- Elements are the primary types of matter- What make one element dif.pdf
1- Elements are the primary types of matter- What make one element dif.pdf1- Elements are the primary types of matter- What make one element dif.pdf
1- Elements are the primary types of matter- What make one element dif.pdf
 
1- Eind the values for (hint you will need to use the formula sheet at.pdf
1- Eind the values for (hint you will need to use the formula sheet at.pdf1- Eind the values for (hint you will need to use the formula sheet at.pdf
1- Eind the values for (hint you will need to use the formula sheet at.pdf
 

Recently uploaded

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 

Recently uploaded (20)

The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 

1- For a Movies database with a person entity with attributes pid (key.pdf

  • 1. 1. For a Movies database with a person entity with attributes pid (key), fname, lname, suppose we want to add some publicity-related info for which media have done interviews or which are scheduled to do interviews. We would want to include the unique media name (ex: "Entertainment Tonight"), the media type (ex: "TV", "print", or "web") and date of the interview. How might this be modeled? a) Add attributes for media name, type and interview date to Person b) Create an entity for Media with attributes for media name and type and have a many-to-many relationship between Media and Person c) Create an entity for Media with attributes for media name and type and have a many-to-one relationship between Media and Person d) Create an entity for Media with attributes for media name and type and have a one-to-many relationship between Media and Person 2. Suppose we have the following relational model: Movie(mov_id(PK), title, yr) Person(pid(PK), fname, lname, gender) Acts_In(actor_id(PFK), movie_id(PFK), role) -- actor_id references Person, movie_id references Movie If you want to query a count of how many movies each actor acted in each year, you should include the following in the query: a) GROUP BY pid b) GROUP BY pid, yr c) SELECT COUNT(mov_id), COUNT(yr) d) FROM Movie M1, Person P1, Movie M2, Person P2