#425 Albums with More Than a Given Number of Tracks
Display albums whose titles start with A and that contain more than 10 tracks. The result must contain the album title and the number of tracks:
CREATE TABLE Album
(
AlbumId INTEGER NOT NULL,
Title VARCHAR(160) NOT NULL,
ArtistId INTEGER NOT NULL,
CONSTRAINT PK_Album PRIMARY KEY (AlbumId),
FOREIGN KEY (ArtistId) REFERENCES Artist (ArtistId)
);
CREATE UNIQUE INDEX IPK_Album ON Album(AlbumId);
CREATE TABLE Track
(
TrackId INTEGER NOT NULL,
Name VARCHAR NOT NULL,
AlbumId INTEGER,
UnitPrice NUMERIC(10,2) NOT NULL,
CONSTRAINT PK_Track PRIMARY KEY (TrackId),
FOREIGN KEY (AlbumId) REFERENCES Album (AlbumId)
);
CREATE UNIQUE INDEX IPK_Track ON Track(TrackId);
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor