The given SQL creates a Song table and inserts some songs. The SELECT statement selects all songs. Modify the SELECT statement to select only songs that have a NULL Title or NULL Artist. Run your solution and verify only the songs with IDs 100, 300, 500, and 600 appear in the result table. CREATE TABLE Song ( ID INT, Title VARCHAR(60), Artist VARCHAR(60), ReleaseYear INT, PRIMARY KEY (ID) ); INSERT INTO Song VALUES (100, 'Hey Jude', NULL, 1968), (200, 'When Doves Cry', 'Prince', 1997), (300, NULL, 'The Righteous Brothers', 1964), (400, 'Johnny B. Goode', 'Chuck Berry', 1958), (500, 'Smells Like Teen Spirit', NULL, 1991), (600, NULL, 'Aretha Franklin', 1967); -- Modify the SELECT statement SELECT * FROM Song;
The given SQL creates a Song table and inserts some songs. The SELECT statement selects all songs.
Modify the SELECT statement to select only songs that have a NULL Title or NULL Artist.
Run your solution and verify only the songs with IDs 100, 300, 500, and 600 appear in the result table.
CREATE TABLE Song (
ID INT,
Title VARCHAR(60),
Artist VARCHAR(60),
ReleaseYear INT,
PRIMARY KEY (ID)
);
INSERT INTO Song VALUES
(100, 'Hey Jude', NULL, 1968),
(200, 'When Doves Cry', 'Prince', 1997),
(300, NULL, 'The Righteous Brothers', 1964),
(400, 'Johnny B. Goode', 'Chuck Berry', 1958),
(500, 'Smells Like Teen Spirit', NULL, 1991),
(600, NULL, 'Aretha Franklin', 1967);
-- Modify the SELECT statement
SELECT *
FROM Song;
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images