Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help ASAP. Just basically looking for what I would input into my sql file to make it work properly. ISQA3310 - SQL practice sheet

Need help ASAP. Just basically looking for what I would input into my sql file to make it work properly.

ISQA3310 - SQL practice sheet

image text in transcribed

image text in transcribed

Background: SQL is an important standard to know for managing databases. Relational databases and consequently SQL require a new way of thinking, which best develops when using SQL.

Deliverable: Create a text file (name ending in .sql) with all SQL statements that you wrote and executed on the database.

NOTE: Remember to commit your changes!

Task 1: Write your own SQL statements to INSERT and SELECT.

Find the structure of the original database here: https://unomaha.instructure.com/files/300502/download?download_frd=1 The structure changed since we first talked about it and it is always a good idea to check the current table structure with : DESCRIBE HEROVILLAIN.TABLENAME;

Show all hero and villain characters in the database. SELECT * FROM HEROVILLAIN.CHARACTER;

Insert a Hero or Villain of your choice (that does not yet exist) into the HEROVILLAIN.CHARACTER table. INSERT INTO HEROVILLAIN.CHARACTER (column, column) VALUES (value, values); COMMIT;

Write a SELECT statement that returns the newly added row with all columns. SELECT * FROM HEROVILLAIN.CHARACTER WHERE real_name = your new character name;

Accordingly add the same character to the HEROVILLAIN.HERO or HEROVILLAIN.VILLAIN table. INSERT INTO HEROVILLAIN.hero/villain-tablename (columns) VALUES (values); COMMIT;

Write a SELECT statement that returns the real_name, alter_ego, and back_story or motive. SELECT real_name, alter_ego, back_story/motive FROM HEROVILLAIN.CHARACTER JOIN HEROVILLAIN.tablename ON character.real_name = tablename.real_name WHERE real_name = name;

Add this hero/villains lair or base (HEROVILLAIN.LAIR or HEROVILLAIN.BASE). INSERT INTO HEROVILLAIN.base/lair (columns) VALUES (values); COMMIT;

connect the lair or base to the character UPDATE HEROVILLAIN.HERO/VILLAIN SET base_base_name/lair_lair_name=lair/base name WHERE real_name = name; COMMIT;

Retrieve the location of your character: SELECT location FROM HEROVILLAIN.hero/villain JOIN HEROVILLAIN.base/lair ON villain.lair_lair_name/hero.base_base_name = lair.lair_name/base.base_name WHERE villain/hero_real_name = your character name;

Add an adversary (the hero or villain counterpart to your character) to the CHARACTER table. Same as (2).

Add the adversary to the appropriate VILLAIN or HERO table. Same as (4);

Register the ENEMY_RIVALRY of your characters. INSERT INTO HEROVILLAIN.ENEMY_RIVALRY (villain_real_name, hero_real_name) VALUES (your villains name, your heros name); COMMIT;

Give your hero some equipment in their base. INSERT INTO HEROVILLAIN.baseequipment (equipment, base_name) VALUES (value, base_name); COMMIT;

Write a SELECT statement that shows all the equipment that your hero has.

Add a comic in which your characters appear. INSERT INTO HEROVILLAIN.COMIC (title, release_year, author, sales, COMIC_ID) VALUES (value, value, ); COMMIT;

Connect your characters (hero and villain) to the comic. INSERT INTO HEROVILLAIN.COMIC_CHARACTER (comic_comic_id, character_real_name) VALUES (comic_id, real_name); COMMIT;

Add a movie and connect your hero and vaillain to that movie (same as 14 and 15 but for tables MOVIE and ACTOR).

Show for each movie that one of your characters appeared in which actor played the character.

Show the average box office sales for all movies.

Show the total comic sales for all comics that one of your characters appeared in.

Show the total comic sales for each character.

Show for each character the average comic sales and the average dvd sales of all movies and comics that these characters appear in.

Show the average comic sales and the average dvd sales of all movies and comics for each character that earned more in movies than comics

Need help ASAP. Just basically looking for what I would input into my sql file to make it work properly.

HERCO-V LLAIN Moce.pat-Adobe Acrobart Hese X Fil: EitViido Helo Home Tools HERO-VILLAIN Mo.. * signin Conceptual Model (ERD) tring re esse year Integer acarnama String Saing CHAK(!) hiturvilen notve tring bose nane Sinp lrng sed by cause.? intervener lhiten n unud bry ARTFACT lecaton EMENT PK (event name) sring LAR PK 0ar name) ARTIFACT PK (arifact neme E O lype here to search HERCO-V LLAIN Moce.pat-Adobe Acrobart Hese X Fil: EitViido Helo Home Tools HERO-VILLAIN Mo.. * signin Conceptual Model (ERD) tring re esse year Integer acarnama String Saing CHAK(!) hiturvilen notve tring bose nane Sinp lrng sed by cause.? intervener lhiten n unud bry ARTFACT lecaton EMENT PK (event name) sring LAR PK 0ar name) ARTIFACT PK (arifact neme E O lype here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions