SQL-GENERATOR-DATASETS / dataset-SQL-GENERATOR.JSONL
fknguedia's picture
sql-datasets-LoRa-finetuning
9e24782 verified
Raw
History Blame Contribute Delete
38.9 kB
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What are the top 5 most popular genres of music in the database, based on the number of tracks in each genre?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId GROUP BY T2.Name ORDER BY TrackCount DESC LIMIT 5;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artist has the most albums in the database?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(T2.AlbumId) as AlbumCount FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId GROUP BY T1.Name ORDER BY AlbumCount DESC LIMIT 1;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each genre of music in the database?"}
{"role": "assistant", "content": "SELECT T2.Name, SUM(T1.UnitPrice * T3.Quantity) as TotalRevenue FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from more than one genre of music?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Genre T3 ON T2.GenreId = T3.GenreId GROUP BY T1.CustomerId HAVING COUNT(DISTINCT T3.GenreId) > 1;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have tracks in more than one genre of music?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.ArtistId FROM Album T1 INNER JOIN Track T2 ON T1.AlbumId = T2.AlbumId INNER JOIN Genre T3 ON T2.GenreId = T3.GenreId GROUP BY T1.ArtistId HAVING COUNT(DISTINCT T3.GenreId) > 1;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total number of tracks in each playlist?"}
{"role": "assistant", "content": "SELECT T1.PlaylistId, COUNT(T2.TrackId) as TrackCount FROM Playlist T1 INNER JOIN PlaylistTrack T2 ON T1.PlaylistId = T2.PlaylistId GROUP BY T1.PlaylistId;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from the same artist more than once?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId GROUP BY T1.CustomerId, T4.ArtistId HAVING COUNT(T1.InvoiceLineId) > 1;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist in the database?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T4.UnitPrice * T5.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 5 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds > 300000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each artist in the database?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T3.TrackCount) as AverageTracksPerAlbum FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN (SELECT AlbumId, COUNT(TrackId) as TrackCount FROM Track GROUP BY AlbumId) T3 ON T2.AlbumId = T3.AlbumId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from artists who have won a Grammy award?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId WHERE T4.Name IN (SELECT Name FROM Artist WHERE GrammyWinner = 1);" }
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total number of tracks in each genre that have been purchased by customers from the USA?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'USA' GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have the most tracks in the 'Rock' genre?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(T2.TrackId) as TrackCount FROM Artist T1 INNER JOIN Album T3 ON T1.ArtistId = T3.ArtistId INNER JOIN Track T2 ON T3.AlbumId = T2.AlbumId INNER JOIN Genre T4 ON T2.GenreId = T4.GenreId WHERE T4.Name = 'Rock' GROUP BY T1.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre that have been purchased by customers from Europe?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country IN (SELECT Country FROM Country WHERE Continent = 'Europe') GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from artists who have released albums in the 'Jazz' genre?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId WHERE T4.ArtistId IN (SELECT T3.ArtistId FROM Album T3 INNER JOIN Track T2 ON T3.AlbumId = T2.AlbumId INNER JOIN Genre T4 ON T2.GenreId = T4.GenreId WHERE T4.Name = 'Jazz');" }
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist in the 'Pop' genre?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T4.UnitPrice * T5.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId INNER JOIN Genre T6 ON T3.GenreId = T6.GenreId WHERE T6.Name = 'Pop' GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of less than 3 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds < 180000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per playlist for each genre of music?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T4.TrackCount) as AverageTracksPerPlaylist FROM Genre T2 INNER JOIN Track T1 ON T2.GenreId = T1.GenreId INNER JOIN PlaylistTrack T3 ON T1.TrackId = T3.TrackId INNER JOIN (SELECT PlaylistId, COUNT(TrackId) as TrackCount FROM PlaylistTrack GROUP BY PlaylistId) T4 ON T3.PlaylistId = T4.PlaylistId GROUP BY T2.Name;"}
]
}{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music, considering only the tracks that have been purchased at least once?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have released tracks in the most genres of music?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(DISTINCT T3.GenreId) as GenreCount FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId GROUP BY T1.Name ORDER BY GenreCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist in the 'Rock' genre, considering only the tracks that have been purchased in the year 2010?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T5.UnitPrice * T6.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T5 ON T3.TrackId = T5.TrackId INNER JOIN Invoice T6 ON T5.InvoiceId = T6.InvoiceId INNER JOIN Genre T7 ON T3.GenreId = T7.GenreId WHERE T7.Name = 'Rock' AND STRFTIME('%Y', T6.InvoiceDate) = '2010' GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 5 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds > 300000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each artist?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T3.TrackCount) as AverageTracksPerAlbum FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN (SELECT AlbumId, COUNT(TrackId) as TrackCount FROM Track GROUP BY AlbumId) T3 ON T2.AlbumId = T3.AlbumId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from artists who have released albums in the 'Classical' genre?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId WHERE T4.ArtistId IN (SELECT T3.ArtistId FROM Album T3 INNER JOIN Track T2 ON T3.AlbumId = T2.AlbumId INNER JOIN Genre T4 ON T2.GenreId = T4.GenreId WHERE T4.Name = 'Classical');" }
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each genre of music, considering only the tracks that have been purchased in the year 2015?"}
{"role": "assistant", "content": "SELECT T2.Name, SUM(T1.UnitPrice * T3.Quantity) as TotalRevenue FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId WHERE STRFTIME('%Y', T4.InvoiceDate) = '2015' GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have released tracks in the most genres of music, considering only the tracks that have been purchased at least once?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(DISTINCT T3.GenreId) as GenreCount FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId GROUP BY T1.Name ORDER BY GenreCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music, considering only the tracks that have been purchased in the year 2010?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId WHERE STRFTIME('%Y', T4.InvoiceDate) = '2010' GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", " content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of less than 2 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds < 120000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each artist?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.TrackCount) as AverageTracksPerAlbum FROM Artist T1 INNER JOIN (SELECT T2.ArtistId, T2.AlbumId, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Album T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.ArtistId, T2.AlbumId) T2 ON T1.ArtistId = T2.ArtistId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from the same artist more than once?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId GROUP BY T1.CustomerId, T4.ArtistId HAVING COUNT(DISTINCT T1.InvoiceId) > 1;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist, considering only the tracks that have been purchased in the year 2012?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T4.UnitPrice * T5.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId WHERE STRFTIME('%Y', T5.InvoiceDate) = '2012' GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 5 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds > 300000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music, considering only the tracks that have been purchased by customers from the USA?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'USA' GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have released tracks in the most genres of music, considering only the tracks that have been purchased at least once and have a duration of more than 3 minutes?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(DISTINCT T3.GenreId) as GenreCount FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId WHERE T3.Milliseconds > 180000 GROUP BY T1.Name ORDER BY GenreCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each genre of music, considering only the tracks that have been purchased by customers from the UK and have a duration of less than 4 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, SUM(T1.UnitPrice * T4.Quantity) as TotalRevenue FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'UK' AND T1.Milliseconds < 240000 GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from the same artist more than twice?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId GROUP BY T1.CustomerId, T4.ArtistId HAVING COUNT(DISTINCT T1.InvoiceId) > 2;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each artist, considering only the albums that have been released after 2000?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.TrackCount) as AverageTracksPerAlbum FROM Artist T1 INNER JOIN (SELECT T2.ArtistId, T2.AlbumId, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Album T2 ON T1.AlbumId = T2.AlbumId WHERE T2.ReleaseDate > '2000-01-01' GROUP BY T2.ArtistId, T2.AlbumId) T2 ON T1.ArtistId = T2.ArtistId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 10 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds > 600000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music, considering only the tracks that have been purchased by customers from the USA?"}
{"role": "assistant", "content": "SELECT T2.Name, AVG(T1.UnitPrice) as AveragePrice FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'USA' GROUP BY T2.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have the most tracks in the 'Rock' genre?"}
{"role": "assistant", "content": "SELECT T1.Name, COUNT(T2.TrackId) as TrackCount FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Genre T4 ON T3.GenreId = T4.GenreId WHERE T4.Name = 'Rock' GROUP BY T1.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist, considering only the tracks that have been purchased by customers from the UK?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T2.UnitPrice * T4.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId INNER JOIN Customer T6 ON T5.CustomerId = T6.CustomerId WHERE T6.Country = 'UK' GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of less than 2 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds < 120000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each genre of music?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.TrackCount) as AverageTracksPerAlbum FROM Genre T1 INNER JOIN (SELECT T2.GenreId, T2.AlbumId, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Album T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.GenreId, T2.AlbumId) T2 ON T1.GenreId = T2.GenreId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from the same artist more than three times?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId GROUP BY T1.CustomerId, T4.ArtistId HAVING COUNT(DISTINCT T1.InvoiceId) > 3;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each media type, considering only the tracks that have been purchased by customers from the USA?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T2.UnitPrice * T4.Quantity) as TotalRevenue FROM MediaType T1 INNER JOIN Track T2 ON T1.MediaTypeId = T2.MediaTypeId INNER JOIN InvoiceLine T3 ON T2.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'USA' GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 5 minutes?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId WHERE T1.Milliseconds > 300000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each media type, considering only the tracks that have been purchased by customers from the UK?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.UnitPrice) as AveragePrice FROM MediaType T1 INNER JOIN Track T2 ON T1.MediaTypeId = T2.MediaTypeId INNER JOIN InvoiceLine T3 ON T2.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country = 'UK' GROUP BY T1.Name;"}
]
}{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average number of tracks per album for each artist, considering only the albums with more than 10 tracks?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.TrackCount) as AverageTracksPerAlbum FROM Artist T1 INNER JOIN (SELECT T2.ArtistId, T2.AlbumId, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Album T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.ArtistId, T2.AlbumId HAVING COUNT(T1.TrackId) > 10) T2 ON T1.ArtistId = T2.ArtistId GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from the same artist more than five times, considering only the tracks that have been purchased in the year 2010?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Album T3 ON T2.AlbumId = T3.AlbumId INNER JOIN Artist T4 ON T3.ArtistId = T4.ArtistId INNER JOIN Invoice T5 ON T1.InvoiceId = T5.InvoiceId WHERE T5.InvoiceDate LIKE '%2010%' GROUP BY T1.CustomerId, T4.ArtistId HAVING COUNT(DISTINCT T1.InvoiceId) > 5;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each genre of music, considering only the tracks that have been purchased by customers from Europe?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T2.UnitPrice * T4.Quantity) as TotalRevenue FROM Genre T1 INNER JOIN Track T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T2.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country IN ('UK', 'France', 'Germany', 'Italy', 'Spain') GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have tracks in more than two genres of music, considering only the tracks that have been purchased by customers from the USA?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.ArtistId FROM Album T1 INNER JOIN Track T2 ON T1.AlbumId = T2.AlbumId INNER JOIN Genre T3 ON T2.GenreId = T3.GenreId INNER JOIN InvoiceLine T4 ON T2.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId INNER JOIN Customer T6 ON T5.CustomerId = T6.CustomerId WHERE T6.Country = 'USA' GROUP BY T1.ArtistId HAVING COUNT(DISTINCT T3.GenreId) > 2;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each media type, considering only the tracks that have been purchased by customers from Asia?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.UnitPrice) as AveragePrice FROM MediaType T1 INNER JOIN Track T2 ON T1.MediaTypeId = T2.MediaTypeId INNER JOIN InvoiceLine T3 ON T2.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country IN ('China', 'Japan', 'India', 'South Korea') GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which genres of music have the most tracks with a duration of more than 10 minutes, considering only the tracks that have been purchased by customers from South America?"}
{"role": "assistant", "content": "SELECT T2.Name, COUNT(T1.TrackId) as TrackCount FROM Track T1 INNER JOIN Genre T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T1.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country IN ('Brazil', 'Argentina', 'Chile', 'Colombia') AND T1.Milliseconds > 600000 GROUP BY T2.Name ORDER BY TrackCount DESC;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the total revenue generated by each artist, considering only the tracks that have been purchased by customers from Africa?"}
{"role": "assistant", "content": "SELECT T1.Name, SUM(T2.UnitPrice * T4.Quantity) as TotalRevenue FROM Artist T1 INNER JOIN Album T2 ON T1.ArtistId = T2.ArtistId INNER JOIN Track T3 ON T2.AlbumId = T3.AlbumId INNER JOIN InvoiceLine T4 ON T3.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId INNER JOIN Customer T6 ON T5.CustomerId = T6.CustomerId WHERE T6.Country IN ('Egypt', 'South Africa', 'Nigeria', 'Morocco') GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which customers have purchased tracks from more than three genres of music, considering only the tracks that have been purchased in the year 2015?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.CustomerId FROM InvoiceLine T1 INNER JOIN Track T2 ON T1.TrackId = T2.TrackId INNER JOIN Genre T3 ON T2.GenreId = T3.GenreId INNER JOIN Invoice T4 ON T1.InvoiceId = T4.InvoiceId WHERE T4.InvoiceDate LIKE '%2015%' GROUP BY T1.CustomerId HAVING COUNT(DISTINCT T3.GenreId) > 3;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "What is the average price of tracks in each genre of music, considering only the tracks that have been purchased by customers from North America?"}
{"role": "assistant", "content": "SELECT T1.Name, AVG(T2.UnitPrice) as AveragePrice FROM Genre T1 INNER JOIN Track T2 ON T1.GenreId = T2.GenreId INNER JOIN InvoiceLine T3 ON T2.TrackId = T3.TrackId INNER JOIN Invoice T4 ON T3.InvoiceId = T4.InvoiceId INNER JOIN Customer T5 ON T4.CustomerId = T5.CustomerId WHERE T5.Country IN ('USA', 'Canada', 'Mexico') GROUP BY T1.Name;"}
]
}
{"messages":
[
{"role": "system", "content": "You are a SQL expert assistant. Generate clear, efficient SQL queries based on user requests. Provide only the SQL query without any additional text or explanation."}
{"role": "user", "content": "Which artists have tracks in more than one genre of music, considering only the tracks that have been purchased by customers from Australia?"}
{"role": "assistant", "content": "SELECT DISTINCT T1.ArtistId FROM Album T1 INNER JOIN Track T2 ON T1.AlbumId = T2.AlbumId INNER JOIN Genre T3 ON T2.GenreId = T3.GenreId INNER JOIN InvoiceLine T4 ON T2.TrackId = T4.TrackId INNER JOIN Invoice T5 ON T4.InvoiceId = T5.InvoiceId INNER JOIN Customer T6 ON T5.CustomerId = T6.CustomerId WHERE T6.Country = 'Australia' GROUP BY T1.ArtistId HAVING COUNT(DISTINCT T3.GenreId) > 1;"}
]
}