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
Sabiendo que z1 = 10, z2 = 20, z3 =10 , z4 = 20, n1 = 1200 rpm.
romanna [79]

Answer:

a. engranaje 1 → engranaje 2 → engranaje 3 → engranaje 4

     z1 = 10            z2 = 20              z3 =10            z4 = 20

b. n2 = 600 rpm, n3 = 1200 rpm, n4 = 600 rpm

   la relacion de transmision = 2

Explanation:

where z1 = 10, z2 = 20, z3 = 10, z4 = 20

and n1 = 1200 rpm

n2 = n1 * z1/z2 = (1200 * 10)/ 20 = 600 rpm

n3 = n2 * z2/z3 = (600 * 20)/ 10 = 1200 rpm

n4 = n3 * z3/z4 = (1200 * 10)/ 20 = 600 rpm

la relacion de transmision = z2/z1 * z3/z2 * z4/z3

= 20/10 * 10/20 * 20/10 = 2 * 0.5 * 2 = 2

7 0
3 years ago
Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
Wewaii [24]

Answer:

B. Malware

Explanation:

Malware is general to most harmful programs on a computer, as Adware is a potentially unwanted program that is designed to advertise other programs or services. And ransomware is a program that will encrypt important user files such as; documents, pictures, and videos. Spyware is a program that is designed to spy on users, examples are; using your camera without your consent, key-loggers, and taking screenshots of our desktop. Thus i believe it is malware because the question covers multiple categories.

6 0
4 years ago
The shell of a document that may be used over and over in desktop publishing is called a
Kay [80]
It is called a template
7 0
3 years ago
What online resource would you use if you wanted to read a review about a new movie?
Vilka [71]

Answer:

fdgf

Explanation:

fdgdfg

5 0
2 years ago
How does theatre compare with movies or television? What makes it similar to movies and television? What makes it different?
givi [52]

Answer:

you cant mess up in theatre but you can redo scences in movies, thay both have acting in them

Explanation:

im a theatre person

3 0
4 years ago
Other questions:
  • Which network topology requires terminators at the ends of the backbone cable?
    6·1 answer
  • Write a program that accepts three decimal numbers as input and outputs their sums?​
    5·1 answer
  • User-system interaction is?
    11·1 answer
  • Many computer magazines and Web sites present comparisons of several DBMSs. Find one such DBMS comparison article and compare th
    10·1 answer
  • The algorithm ____ is used to find the elements in one range of elements that do not appear in another range of elements.
    5·1 answer
  • What are attribute grammars used for?
    8·1 answer
  • The average price of milk increased from $3.00 last year to $3.50 this year. This is most likely due to:
    14·1 answer
  • What is the command to list the contents of directors in Unix- like operating system
    10·1 answer
  • Calculate the heat energy required to raise the temperature of 5 kg of water from 20℃ to
    5·1 answer
  • Which is an example of machine-to-machine communication?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!