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
Database queries is an example of
storchak [24]

Answer:

A query in a database is a request for information stored within a database management system (DBMS), which is the software program that maintains data.

SQL(Structured Query Language ( is a standard language for storing, manipulating, and retrieving data in database.

Five types of SQL queries are:

1) Data Definition Language (DDL).

used to define and modify the structure of a database.

2) Data Manipulation Language (DML).

used to manipulate (change) the data in the database.

3) Data Control Language(DCL).

used for access control and permission management for users in the database.

4) Transaction Control Language(TCL).

used for maintaining consistency of the database and for the management of transactions made by the DML commands.

5) Data Query Language (DQL).

used for performing queries on the data within schema objects.

8 0
2 years ago
A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then th
Kipish [7]

Answer:

(target - 10 ≤ score) AND (score ≤ target + 10)

Explanation:

8 0
2 years ago
Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
madreJ [45]

Answer:

Visual.

Explanation:

Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a process called visual programming.

A visual programming language is also commonly referred to as graphics user interface builder (GUI builder) and can be defined as a programming tool that avails programmers the ability to develop software programs (applications) using graphical elements and figures rather than texts alone.

Some examples of visual programming language are executable UML, Blockly, Kodu, Alice, Lego mindstorms, Gamemakers etc.

6 0
3 years ago
______ is/are the replacement of human operation and control of machinery with some form of programmed control.
Thepotemich [5.8K]
Automation is/are the replacement of human operation and control of machinery with some form of programmed control. Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions here.
7 0
3 years ago
It takes you 0.8 of a minute to read each page of your health book. It takes you 5.5 minutes to take the test at the end. How lo
NeTakaya
The answer would be 13.3125 because 6.25 / 0.8 is 7.8125 than add 5.5 which will equal 13.3125. I'm sure about this.
7 0
3 years ago
Read 2 more answers
Other questions:
  • What kind of fragment is near the computer?
    14·1 answer
  • Computing devices translate digital to analog information in order to process the information
    8·1 answer
  • If you implement a Wireless LAN (WLAN) to support connectivity for laptops in the Workstation Domain, which domain does WLAN fal
    5·1 answer
  • When Mark’s organization implemented an IS, they faced the lack of confidence in users. Which strategy can improve user confiden
    11·1 answer
  • Should the existing system be replaced?This is a question that is asked during the _____ stage of the Systems Development Life C
    8·1 answer
  • Which of the following is true regarding data acquisition? Because data acquisition is often technical, the research team does n
    15·2 answers
  • Could someone please explain to me the an electrical circuit.
    13·2 answers
  • Which of the following behaviors does not harm a company if your employment is terminated?
    9·1 answer
  • Ajdbksjdnksnsd helppp​
    11·1 answer
  • Windows is a GUI Operating System, what is the other type?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!