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
The rhythmic note that three beats is called a____half note.
aev [14]

Answer:

it is called a dotted half note

7 0
2 years ago
Read 2 more answers
PC’s &amp; More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
photoshop1234 [79]

Answer:

Growth Strategy

Explanation:

A growth strategy is a plan of action that allows you to achieve a higher level of market share than you currently have. Such as the case in the question, PC's shifted so sales and service of Laptops and PCs because there is a greater market share for them there than where they currently operate from.

5 0
3 years ago
Edhesive assignment 7 calendar
ikadub [295]

Answer:

def leap_year(y):

 if y % 4 == 0:

     return 1

 else:

     return 0

def number_of_days(m,y):

 if m == 2:

     return 28 + leap_year(y)

 elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:

     return 31

 elif m == 4 or m == 6 or m == 9 or m == 11:

     return 30

def days(m,d):

 if m == 1:

     return 0 + d

 if m == 2:

     return 31 + d

 if m == 3:

     return 59 + d

 if m == 4:

     return 90 + d

 if m == 5:

     return 120 + d

 if m == 6:

     return 151 + d

 if m == 7:

     return 181 + d

 if m == 8:

     return 212 + d

 if m == 9:

     return 243 + d

 if m == 10:

     return 273 + d

 if m == 11:

     return 304 + d

 if m == 12:

     return 334 + d

def days_left(d,m,y):

 if days(m,d) <= 60:

     return 365 - days(m,d) + leap_year(y)

 else:

     return 365 - days(m,d)

print("Please enter a date")

day=int(input("Day: "))

month=int(input("Month: "))

year=int(input("Year: "))

choice=int(input("Menu:\n1) Calculate the number of days in the given month.\n2) Calculate the number of days left in the given year.\n"))

if choice == 1:

 print(number_of_days(month, year))

if choice == 2:

 print(days_left(day,month,year))

Explanation:

Hoped this helped

5 0
2 years ago
Device managment is the process of managing what kind of devices​
prisoha [69]

Mobile device management is a type of security software used by an IT department to monitor, manage, and secure employees' mobile devices (laptops, smartphones, tablets, etc.) that are deployed across multiple mobile service providers and across multiple mobile operating systems being used in the organization.

6 0
2 years ago
Gregor installed a third stick of known-good RAM into his Core i7 system, bringing the total amount of RAM up to 3 GB. Within a
MA_775_DIABLO [31]

Answer:

The speed or quality was different.

Explanation:

The new ram that he installed most likely had a different rate, or was a different quality than the old ram.

5 0
2 years ago
Other questions:
  • Host A is sending Host B a large le over a TCP connection. Assume Host B has no data to send Host A. Host B will not send acknow
    14·1 answer
  • Qbasic program to accept 10 numbers and to find their sum. <br>​
    7·1 answer
  • A table is a useful way to present information that is organized into categories, or fields.
    15·1 answer
  • What is the benefit of the load balancing logic to end-user?
    15·1 answer
  • The first few lines of a script that say "using" ... that point the code to the right groups are called
    11·1 answer
  • Does coaxial cable use radio waves to transmit data
    10·2 answers
  • When adjusting the aperture, an F-stop of F32 lets in more light then a setting of F8
    10·1 answer
  • The _____ of a story describes the time and location of a story.
    5·2 answers
  • Tim is a project manager. He is brainstorming with his team about problems that could arise during the next phase of the project
    5·1 answer
  • How would you use keywords and Boolean operators to help you with a web search?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!