IFSM 330 SQL

  

[SQL Week 2 Question 100-026] Your publisher has decided to reclassify all Knights from Real to Magical with regard to their Realm. Make this update in your database. Before you do this update, you should be able to verify you have 100 creatures with Realm of Magical. After this update, how many creatures have a Magical Realm?

o If you get an error code 1175 that grumbles that you are using safe update mode, run the following code before your update:

o SET SQL_SAFE_UPDATES = 0;

o Note this command has you modify the database. If you are then going to go back and answer some other questions after you do this command, be sure you refresh your database (i.e. re-load and re-run the script which made the database in the first place) before answering those questions.

<Paste/Enter SQL Code here>

<Paste Screenshot here>

[SQL Week 2 Question 100-027] DELETE. Its time to delete stuff.

o Note this command has you modify the database. If you are going to go back and answer some other questions after you do this command, be sure you refresh your database (i.e. re-load and re-run the script which made the database in the first place) before answering those questions.

o First, lets verify your database is fully refreshed. Run the following checksum code. (Theres a lot of code here; its best to copy/paste into SQL.)

o SELECT ((COUNT(*) * AVG(Weight)) % 99) as checksum from litcharacters;

o You should get a checksum answer of 47. 

o Delete all the dinosaurs who have already made an appearance. In other words, delete anything with a Creature SubType of Dinosaur and more than 0 appearances. 

o Run the checksum code again. What is your checksum now?

<Paste/Enter SQL Code here>

<Paste Screenshot here>

[SQL Week 2 Question 100-028] Note this command has you modify the database. If you are going to go back and answer some other questions after you do this command, be sure you refresh your database (i.e. re-load and re-run the script which made the database in the first place) before answering those questions.

o First, check your database is fully refreshed. Run the following checksum code. (Theres a lot of code here; its best to copy/paste into SQL.)

o SELECT ((COUNT(*) * AVG(Weight)) % 99) as checksum from litcharacters;

o You should get a checksum answer of 47. 

o You have some more characters to include. Insert the below characters in to the database:

o (‘Mogwai’, ‘Magical’, ‘Other’, ‘Fairy’, ‘Female’, ’25’, ‘158’,’2′),

o (‘Menehune’, ‘Real’, ‘Human’, ‘Superhero’, ‘Male’, ’56’, ‘195’,’5′)

o Now what is your checksum?

<Paste/Enter SQL Code here>

<Paste Screenshot here>

VISIT – TO COMPLETE THE ASSIGNMENT https://sqliteonline.com/