SQL Statements for Venue and Event Modifications

Answered using GPT-4o mini by AI Answer Generator

Question:
  1. Give the SQL to add the Maracana Stadium to the VENUE table. The stadium is located in Avenida Maracana and has a capacity of 78,838.
  2. Give the SQL to add an attribute Sport to EVENT. (Possible values include Athletics, Swimming, Tennis, etc).
Answer:

Here are the SQL statements to accomplish the tasks you've described:

  1. To add the Maracana Stadium to the VENUE table, you can use the following SQL INSERT statement:
INSERT INTO VENUE (name, address, capacity) 
VALUES ('Maracana Stadium', 'Avenida Maracana', 78838);

Make sure to replace name, address, and capacity with the actual column names in your VENUE table if they are different.

  1. To add an attribute (column) named Sport to the EVENT table, you can use the following SQL ALTER TABLE statement:
ALTER TABLE EVENT 
ADD Sport VARCHAR(50);

This assumes that the Sport attribute will be a string with a maximum length of 50 characters. You can adjust the data type and length as needed based on your requirements.