The cake problem at the end of the Basic Concepts in SQL needs a fix | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

The cake problem at the end of the Basic Concepts in SQL needs a fix

Hi, I'm trying to do the cake problem at the end of the first chapter of SQL and even though my entry is: SELECT * FROM cakes ORDER BY calories LIMIT 3; The system marks this answer as wrong and shows the following: Input No Input Your Output name,calories opera cake,90 sponge cake,100 apple cake,100 Expected Output name,calories Opera Cake,90 Sponge Cake,100 Apple Cake,100 Even though both answers are the same, I think the system is case sensitive and I don't know how to Capitalize my answer

1st May 2021, 4:37 AM
Eduardo Enrique Echeverría Monasterio
Eduardo Enrique Echeverría Monasterio - avatar
5 Answers
+ 3
SELECT initCap(name) as name ... initCap convert opera cake to Opera Cake
2nd May 2021, 4:17 AM
Krzysztof Deręgowski
+ 4
I think we can consider this a bug in the test data. I have reported it via in-app feedback, we can only hope SL fix it at some point. There is no simple way to convert the string to Title Case, certainly not beginner level.
1st May 2021, 6:07 AM
Tibor Santa
Tibor Santa - avatar
+ 1
Try writing it on a single line? maybe? SELECT * FROM cakes ORDER BY calories LIMIT 3;
1st May 2021, 4:45 AM
Aditya
Aditya - avatar
+ 1
Thank you Krzysztof, that'll do the trick. However, they didn't teach that in any of the lessons. The exercise is supposed to be solved with the tools given until that moment. Oh well, thank you again
2nd May 2021, 4:36 AM
Eduardo Enrique Echeverría Monasterio
Eduardo Enrique Echeverría Monasterio - avatar