Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to add column 'name' to the film_category table and have it reference category.name in PostgreSQL? This is using the PostgreSQL dvdrental database Attempt 1

How to  add column 'name' to the film_category table and have it reference category.name in PostgreSQL?


This is using the PostgreSQL dvdrental database

Attempt 1

INSERT INTO film_category(name)

SELECT category.name

FROM category

INNER JOIN film_category

ON category.category_id = film_category.category_id;

ERROR: there is no unique constraint matching given keys for referenced table "category"

imageimage

4 INSERT INTO film_category (genre) 5 SELECT category.genre FROM category 7 INNER JOIN film_category 8 ON category.category_id = film_category.category_id; 16 Data Output Explain Messages Notifications ERROR: there is no unique constraint matching given keys for referenced table "category" SQL state: 42830

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is the financial outlook of the organization?

Answered: 1 week ago

Question

Describe the purpose of the SELECT command in relational algebra.

Answered: 1 week ago