Ranae Dietzel & Andee Kaplan
select count(1) ...
counts the number of rows in the result setselect sum(var) ...
sums value of var
for rows in the resultselect max(var) ...
returns max of var
for rows in the resultselect group, aggregate(variable) ... group by group
select distinct columns ...
A subquery is a SELECT statement nested in another statement.
select trackid,
name,
albumid
from track
where albumid = (
select albumid
from album
where title = 'Nevermind'
);
Here, select albumid from album where title = 'Nevermind'
is the subquery that lets us grab the albumid for Nirvana’s Nevermind album.
Continue working with the Chinook database to answer the following questions. For reference, http://www.sqlitetutorial.net/