Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1077513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:35:08+00:00 2026-05-16T21:35:08+00:00

So I am a beginner to this, and trying to follow my professors instructions

  • 0

So I am a beginner to this, and trying to follow my professors instructions on how to complete this. They are as follows:

Consider the relational database described in Tables 1-3. The underlined attribute(s) is the primary key for a table. Use your Oracle account to create this database and to insert the tuples listed in each table. Make sure you include the primary key and foreign key constraints. Put check constraints on the following three attributes. Rating (between 0 and 10), Lengith (greater than 0), ReleaseDate (after 1/1/1900).

Table 1: Theatres
Name (Underlined as Primary), City, State, Zip, Phone

Table 2: Movies
Title (Primary), Rating, Length, ReleaseDate

Table 3: ShownAt
TheatreName, MovieTitle (BOTH listed as Primary)

Here is how I have them declared:

CREATE TABLE Theatres (
Name   varchar2(50) not null,
City   varchar2(50) not null,
State   varchar2(50) not null,
Zip   number not null,
Phone   varchar2(50) not null,
CONSTRAINT name_pk PRIMARY KEY (Name)
);

create table Movies (
Title   varchar2(100),
Rating NUMBER CONSTRAINT Rating_CHK CHECK (Rating BETWEEN 0 AND 10),
Length NUMBER CONSTRAINT Length_CHK CHECK (Length > 0),
ReleaseDate date CONSTRAINT RDATE_CHK CHECK (ReleaseDate > to_date('1/January/1900', 'DD/MONTH/YYYY')),
CONSTRAINT title_pk PRIMARY KEY (Title)
);

create table ShownAt (
TheatreName varchar2(50),
MovieTitle varchar2(100),
CONSTRAINT moviet_fk FOREIGN KEY (MovieTitle) REFERENCES Movies(Title),
CONSTRAINT shown_pk PRIMARY KEY (TheatreName, MovieTitle)
);

This declares fine, and I get no errors. Below are my inserts (I gave one example insert for each table):

insert into theatres values ( 'Great Escape 14', 'Wilder', 'KY', '41076', '(859) 442-0000' );
insert into movies values ( 'The Expendables', '7.6', '103', '13 August 2010' );
insert into shownat values ( 'Great Escape 14', 'The Expendables' );

All inserts into theatres and movies go off without a hitch. For ShownAt, I get A LOT OF ERRORS, most of which look something like this:

Error starting at line 37 in command:
insert into shownat values ( 'Showcase Cinema De Lux Florence', 'The Pianist' )
Error report:
SQL Error: ORA-02291: integrity constraint (LANGB1.MOVIET_FK) violated - parent key not found

Meaning:

02291. 00000 - "integrity constraint (%s.%s) violated - parent key not found"
*Cause:    A foreign key value has no matching primary key value.
*Action:   Delete the foreign key or add a matching primary key.

Any insert into ShownAt where the title is just one word (say the movie Up) works just fine, but anything with more than one word (like The Expendables) won’t execute, and give the above error. ANY HELP would be much appreciated. I can post any other details that you need.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:35:09+00:00Added an answer on May 16, 2026 at 9:35 pm

    There is no technical reason why a primary key consisting of multiple words should fail when a single word key succeeeds.

    Generally it is a good idea to avoid using long VARCHAR2 (or any string datatype) for primary key columns. This is because it is easier to introduce mistakes with mismatched case or extra spaces. The following are all distinct values: 'The Pianist', 'The pianist', 'The Pianist '.

    So one explanation for the failure of some inserts into ShownAt is transcription errors: the additional complexity of the multi-word, mixed case key makes it more likely that you didn’t get the keys exactly right in the failing statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to follow this beginner tutorial about Google Charts: http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted I already have
I'm a complete beginner to this language and am currently trying to create a
I'm a beginner coder in Ruby and currently I'm trying to use this plugin:
I am beginner in PHP. I am trying to parse this xml file. <relationship>
I believe this is a beginner's CSS question. I am utilizing the method described
I am beginner to java and was trying out this code puzzle from the
Apologies as I'm a bit of a beginner with this. I'm trying to send
Ok, I am a complete beginner to this, in fact I am still building
Beginner at Django here, I've been trying to fix this for a long time
I'm a JS beginner. I posted this question because I've been trying to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.