lab 4 my sql programm

My sql

Lb 4

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

– Changing Data

— 1. Create a new table in Chinook called RockTrack that contains all of the tracks in the Rock genre (genreid=1) by executing the following statement:

Create table RockTrack as (Select * from track where genreid=1);

— After creating the table run the following statement to set the primary key and auto_increment the trackid. If you do not do this, you may have trouble with some of the later queries.

ALTER TABLE RockTrack CHANGE trackid trackid INT primary key NOT NULL AUTO_INCREMENT;

— 2. Update trackid 2 to set the price at 1.19.

— 3. Update all tracks with albumId = 90, to change the composer to Axl Rose

— 4. Change trackid 2213 to reflect the following values:
— mediatypeid = 3
— milliseconds = 234000
— bytes = 6500000
— unitprice = 1.29

— 5. Add a record to the RockTrack table with the following information

— Trackid: 3700
— Name: MySQL Melodies
— AlbumId: 249
— MediaTypeId: 1
— GenreId: 1
— Composer: your name
— Milliseconds: 123456
— Bytes: 3333333
— UnitPrice: .99

— 6. Add a record to the RockTrack table with the following information. Accept default values for all other fields

— Name: Database Blues
— MediaTypeId: 3
— Millisecond: 200000
— UnitPrice: 1.09

— 7. Use a single query to add the following 3 tracks to the RockTrack Table
— Name Albumid Mediatypeid Genreid Composer Milliseconds Bytes UnitPrice
— Brookhaven Boogie 117 1 1 Thom Chesney 234567 6543210 0.99
— Homework Hell 249 1 1 Patti Burks 210987 7654321 0.99
— Computer Chaos 17 1 1 null 334455 6789123 0.99

— 8. Delete Trackid 2700 from the RockTrack table

— 9. Delete all the tracks in the RockTrack table with albumId 249

— 10. Delete all the tracks in the RockTrack table that do not have a composer
— What happens when you run this query? Why?

— When you are done with this lab, you can get rid of the RockTrack table by running this query:

DROP table RockTrack;

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"