1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alecsey [184]
3 years ago
8

Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year

, and year_written are all integers, and that name, title, author, and character_name are strings. Be sure to define appropriate keys and foreign key constraints.
Computers and Technology
1 answer:
Sunny_sXe [5.5K]3 years ago
4 0

Answer:

  • SQL statement that defines table for Actor

CREATE TABLE Actor(

person_id integer primary key,

name varchar2(40) not null,

birth_year integer check ((birth_year) <= 2019)

);

  • SQL statement that defines table for Play

CREATE TABLE Play(

play_id integer primary key,

title varchar2(60) not null,

author varchar2(60) not null,

year_written integer check ((year_written) <= 2019)

);

  • SQL statement that defines table for Role

CREATE TABLE Role (

person_id integer,

character_name varchar2(60) not null,

play_id integer,

constraint fk_person foreign key (person_id) references actor(person_id),

constraint fk_play foreign key (play_id) references play(play_id),

primary key (person_id, character_name, play_id)

);

Explanation:

Other information that were not added to the question are as below:

The following database contains information about three tables i.e. actors, plays, and roles they performed.

Actor (person_id, name, birth_year)

Play (play_id, title, author, year_written)

Role (person_id, character_name, play_id)

Where: Actor is a table of actors, their names, and the year they were born. Each actor has a unique person_id, which is a key.

Play is a table of plays, giving the title, author, and year written for each play. Each play has a unique play_id, which is a key.

Role records which actors have performed which roles (characters) in which plays.

Attributes person_id and play_id are foreign keys to Actor and Play respectively.

All three attributes make up the key since it is possible for a single actor to play more than one character in the same play

Further Explanation:

In SQL, in order to define relational schema (Tables) for a database, we use CREATE TABLE statement to create a new table in a database.  The column parameters specify the names of the columns of the table.  The datatype parameter specifies the type of data the column can hold (varchar, integer, date)

You might be interested in
Important tools used in the _____ phase of the DMAIC process include a project charter, a description of customer requirements,
pishuonlain [190]

Answer:

d. define

Explanation:

DMAIC is an acronym for Define, Measure, Analyze, Improve and Control is a data-driven improvement cycle used for improving processes and driving Six Sigma projects.

Important tools used in the define phase of the Define, Measure, Analyze, Improve, and Control (DMAIC) process include;

- A project charter.

- A description of customer requirements.

- Process maps.

- Voice of the Customer (VOC) data.

5 0
3 years ago
Some scientists say that robots my become self - aware in the near future Do you think this is possible?​
galben [10]

Answer:

i believe that robots could become self aware because its called artificial intelligence, and that means that they can pretty much think for themselves

Explanation:

its just my opinion but i hope i helped!

6 0
2 years ago
How a student can use computer to improve academic performance?
nikdorinn [45]

Answer:

k Nishant

Explanation:

he can learn many things internet by using computer he change his self by learning about many things

3 0
3 years ago
Read 2 more answers
Given an array a, declared to contain 34 elements, write an expression that refers to the last element of the array.
Mice21 [21]
If the language is zero indexed:

a[ 33 ]
4 0
3 years ago
Match the data-management concepts to their meanings.
harina [27]
Master data = represents critical data for important functions
Big data = represents a large volume of data for analysis
Outsourcing = uses another firms services
Archiving = stores rarely accessed important data
6 0
2 years ago
Other questions:
  • Given the integer variables x and y, write a fragment of code that assigns the larger of x and y to another integer variable max
    5·1 answer
  • How is IT related to new business initiatives?
    6·1 answer
  • Would anyone know this
    10·2 answers
  • What are computer crimes?​
    14·1 answer
  • Xavier buys a new laptop for $540. He makes a down payment $75 and pays the rest in 6 equal monthly payments, p. What equation r
    7·1 answer
  • I really need this done Thank you!!
    6·1 answer
  • Which of the following candidates would most likely be hired as a graphic artist?
    15·2 answers
  • Claire wants to use a conditional statement in JavaScript that provides a block of statement to be executed if the condition is
    7·2 answers
  • How can I master networking my home/business computer(s) - Tv's - iot devices and make the whole system as secure as possible?
    12·1 answer
  • THIS IS TIMED PLS HURRY UP
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!