SQL (pertaining to 'playlist maker' challenge'
Hello,
The site won't allow me to move on to the next step when I enter this code into code editor: SELECT * FROM songs WHERE title = "Bohemian Rhapsody" OR title = "Bicycle Race";
please assist.
Hello,
The site won't allow me to move on to the next step when I enter this code into code editor: SELECT * FROM songs WHERE title = "Bohemian Rhapsody" OR title = "Bicycle Race";
please assist.
Your query should return all songs from the artist "Queen" which is currently does, but you had to look and find all the titles and add them to your query individually. So, although these songs are from that artist, your query should work without having to modify it if you add another song from Queen.
Assume that there are thousands of songs, and you want to display all songs from a particular artist. You wouldn't want to look through all the songs to find the titles of each one and build your query. You want to tell the computer to show you all the titles for the particular artist.
How do I complete Step 2 of the Playlist maker challenge.
Do you know how to complete Step 2 of the challenge?
Can you help me out?
You don't need to answer me immediatly but I need an answer before winter break ends, on Janurary 18, 2027.
Deepest regrets for not being able to finish the assignment,
Skyler Otto
Skyler Otto,
Questions to get help with a computing Challenge are most commonly asked and answered in the Discussion area under the video or article immediately preceding the challenge (in this case, 'Querying IN subqueries'). You may find useful explanations there, and it's usually the best place to ask for help with the challenge.
What was your selection line for step 1?
What are the instructions for step 2?
What have you tried for step 2?
My selection line for step 1 is:
SELECT "title" FROM songs WHERE artist="Queen"
I managed to fix my mistake for step 2. My code is:
SELECT "name" FROM artists WHERE genre="Pop"
Now I need help with step 3. My code so far is:
SELECT "artist" FROM songs WHERE title IN ("Pop")
What am I missing?
The instructions state "It should use IN on a nested subquery that's based on your previous query." You're missing the nested subquery based on
SELECT "name" FROM artists WHERE genre="Pop"
You could look at the previous video for a reference with the nested subquery 'SELECT type FROM drs_favorites':
SELECT * FROM exercise_logs WHERE type IN (
SELECT type FROM drs_favorites);
Does that help?
~ Janice
JaniceHolz,
I don't know if it helped, I looked back at the video, use the IN tag, and did what was needed:
(SELECT "genre" FROM artists WHERE genre= "Pop");
This is the new code. Am I missing something? Hopper doesn't say I can finish the step and spin-off the challenge. There must be something missing.
Thanks,
Skyler Otto
I don't understand; you say you used the IN tag, but the code you shared doesn't have IN.
Is the code below what you used for step 3?
(SELECT "genre" FROM artists WHERE genre= "Pop");
If not, what was the exact code you used for step 3?
The code for step 3 should have a subquery that starts with IN. It won't be this, but it will have the same capitalized keywords:
SELECT * FROM exercise_logs WHERE type IN (
SELECT type FROM drs_favorites WHERE _____);
That code is what I used for step 3, but I accidentally forgot to include the IN in the line of code when I sent that response. Sorry about the delay. Khan Academy was down for 2 days in my class, so we had to use Scratch for our coding assignments. Funnily enough, and also expected, we had to make a game, but no one followed the assignment. Everyone in my class decided to somehow play Five Nights At Freedy's on the website, even though no one has made a Five Nights At Freddy's game. So, that happened. Also, the exact code I used for step 3 was
SELECT "name" FROM artists WHERE genre IN (SELECT "genre" FROM artists WHERE genre= "Pop");
SELECT "artist" FROM songs WHERE title IN ("Pop");
Skyler Otto,
The instructions for step 3 are "To finish creating the 'Pop' playlist, add another query that will select the title of all the songs from the 'Pop' artists. It should use IN on a nested subquery that's based on your previous query."
1 issue: Your query is selecting "name" from the artists table rather than title from the song table. Do you understand why 'SELECT "name" FROM artists' is the wrong way to start a query to select song titles?
(There are more issues, but I wanted to start slowly. Also: Only one line is needed for step 3.)
Влезте в услугата, за да оставите коментар.