1.SELECT T.TrackTitles, A.EntryDate
FROM Tracks
JOIN Titles USING (TitleID)
JOIN Artists USING (ArtistID)
WHERE (A.EntryDate > “October 1, 2003”);
2. SELECT TrackTitles, EntryDate
FROM Tracks
WHERE (EntryDate>ALL
(SELECT EntryDate
FROM Artist
WHERE EntryDate = “October 1, 2003”));
嘿,伙计们,所以我有这两个查询,但我很难得到正确的信息。在第一个查询中,我试图查找2003年10月1日之后输入数据库(即具有输入日期)的艺术家录制的所有曲目的tracktitle。使用一个或多个连接;不要使用任何子查询
第二个我试图找到在上一个问题中选择的相同数据。这一次,使用一个或多个子查询,并且不使用任何连接。
请尝试以下查询:
1)
SELECT tr.TrackTitles, ar.EntryDate
FROM Tracks tr
INNER JOIN Titles ti on tr.TitleID = ti.TitleID
INNER JOIN Artists ar on ar.ArtistID = ti.ArtistID
WHERE (ar.EntryDate > '2003-10-01');
2)
SELECT tr.TrackTitles, (Select EntryDate from Artists where ArtistID in
(Select ArtistID from Titles where TitleID = tr.TitleID)
)
FROM Tracks tr
WHERE tr.TitleID in (Select TitleID from Titles where ArtistID in
(Select ArtistID from Artists where EntryDate > '2003-10-01')
)