Question: using chinook database, MSQL 2016 Server Development Can anyone help me with q_retrieval quries ? Also when I use these 2 queries below it showing
using chinook database, MSQL 2016 Server Development
Can anyone help me with q_retrieval quries? Also when I use these 2 queries below it showing me error: Cannot insert the value NULL into column 'ArtistId', table 'Chinook.dbo.tbl_Artist'; column does not allow nulls. INSERT fails. Why? Thank you so much.
----Insert new artist using values, name is Berliner Philharmoniker & Simon Rattle
INSERT INTO tbl_Artist (Name) VALUES ('Berliner Philharmoniker & Simon Rattle');
----Insert two new albums using values for new artist, include proper ArtistID
Tchaikovsky: The Nutcracker
Mahler: Symphony No. 6
DECLARE @ArtistId INT; SET @ArtistId = (SELECT ArtistId FROM tbl_Artist WHERE Name = 'Berliner Philharmoniker & Simon Rattle');
INSERT INTO tbl_Album (Title, ArtistId) VALUES ('Tchaikovsky: The Nutcracker', @ArtistId), ('Mahler: Symphony No. 6', @ArtistId);
Create new q_PopulateTables.sql file
Write statements to generate empty tbl_Album, tbl_Artist and tbl_Track tables, based on Album, Artist and Track tables, using SELECT INTO command
Insert all artists in tbl_Artist, from Artist table, whose name starts with P and Q
Delete all artists from tbl_Artist table with name starting with Q
Truncate tbl_Artist table
Insert all artists in tbl_Artist, from Artist table, whose name starts with B
Insert all albums in tbl_Album, from Album table, for all artists in tbl_Artist table
Insert all tracks in tbl_Track, from Track table, for all albums in tbl_Album
Insert new artist using values, name is Berliner Philharmoniker & Simon Rattle
Insert two new albums using values for new artist, include proper ArtistID
Tchaikovsky: The Nutcracker
Mahler: Symphony No. 6
Insert tracks for two new albums, use tracks from tbl_Track table with AlbumId:
339
340
Create new q_Retrieval.sql file
1.Write a query to find a shortest track in tbl_Track table, using derived table
2.Write yet another query to find a shortest track for all artists in tbl_Track table, using CTE
3.New query should list all artists and number of their albums from tbl_Artist, using grouping
4.List all artists, number of tracks, minimum, maximum and total size (in bytes) of tracks for all of their albums. Use tbl_Artist (for artist name) and tbl_Track tables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
