Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please prove the full typed Mysql code and some typed answer for the assignment blew: We will create a concerts database: create the following

Please prove the full typed Mysql code and some typed answer for the assignment blew:

"

We will create a concerts database: create the following tables that will store information about performance types (ex. song, dance, etc.), about performers, arenas (for performances) and concerts.

Save your work as Yourname_lab2_1.sql

Here is the schema for these tables, with primary key underlined and foreign keys in RED italic

PerformanceTypes(PerformanceTypeName) types of performance

Performers(PerformerID, FirstName, LastName, Address, PerformanceTypeName) Each performer has a performedID (integer), a name, address and type of performance

Arenas(ArenaID, ArenaName, City, Capacity) -- Each arena has an id (integer), a name (Ex. Allstate Center), a city where the arena is located, and seating capacity of the arena

Concerts(PerformerID, ArenaID, ConcertDate) each concert is given by one performer, on a given arena, at a given date .

Write and execute the SQL statements to create the 4 tables given above. Choose appropriate data types for each column, and declare primary key and foreign key constraints as appropriate.

Insert rows in the PerformanceTypes table, for type singer, dancer and comedian.

Write the SQL statement to modify your Performers table to add a new column called DateOfBirth. Choose the appropriate data type for this column. The values in the column could be null.

Insert one row in the Performers table with PerformerID 1, name John Dow, address Annapolis, MD, and performance type singer.

Try now to insert a performer row with a PerformanceTypeName that does not exist in PerformanceTypes table (ex. painter). What happens? Show your work with errors.

Insert 3 more rows in the Performers table, with names Matt Smith, Jane Brown, and respectively Jennifer Shade, and addresses Baltimore, MD, New York, NY, and respectively Seattle, WA. All these 3 performers should be of type dancer.

Change the DateOfBirth of the performer with id 1 to be 1990-03-02.

Remove the performer Matt Smith from the Performers table.

Write the SQL statement to remove performance type singer from the PerformanceTypes table.

Execute the statement above, then list all rows from the PerformanceTypes table. Was singer removed? Explain why the row was removed from the PerformanceTypes table, or why it was not removed.

Write the SQL statement to update the performance type name for dancer in PerformanceTypes to be dance performer.

Execute the statement above. Does the query succeed?

Write the SQL statements to insert 3 rows with ids 1, 2, and respectively 3 into the Arenas table.

Write the SQL statements to insert 4 rows in the Concerts table, two of them for arena 1, and two for arena 2.

Write the SQL statement to update all arenas with at least 2 concerts to have the seat capacity 50000. The query should work for any possible data in the database.

Create a new Dancers table with the same structure as the Performers table

Insert all performers of type dancer from the Performers table into the Dancers table

"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions

Question

How effective will the strategy be in addressing the trigger?

Answered: 1 week ago

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago

Question

2. Are you varying your pitch (to avoid being monotonous)?

Answered: 1 week ago

Question

3. Are you varying your speaking rate and volume?

Answered: 1 week ago