+ 3

SQL Chocolate project ISSUE 15.2

Hello, First of all I am trying to complete this in the web browser(PC) and spoiler but I typed: SELECT * FROM desserts WHERE name LIKE "%chocolate"; and it throws up an error: " ERROR: column "%Chocolate" does not exist LINE 2: WHERE name LIKE "%Chocolate"; " so I look at the answer and the only difference is that the example uses '' instead of "" so when I switch to that it doesn't work, but it does give the column names just no values inside

22nd Jul 2022, 8:02 PM
Chris Mealing
Chris Mealing - avatar
9 Answers
+ 2
-- Try it SELECT * FROM desserts WHERE name LIKE '%Chocolate%';
22nd Jul 2022, 10:14 PM
SoloProg
SoloProg - avatar
+ 2
-- In MySQL desc desserts; -- or SHOW COLUMNS FROM desserts; -- Those describe statements above show the columns in the table and all their attributes
22nd Jul 2022, 10:06 PM
SoloProg
SoloProg - avatar
+ 1
I did try your second reply and it didn't query anything earlier when I wrote the post. only returned the attribute names. however, some reason it works now...#computers
23rd Jul 2022, 1:22 AM
Chris Mealing
Chris Mealing - avatar
0
Write a query to output the name and year columns of all of the films which were produced by marvel studios in 2010 or later ,sorted by the 'year' column in ascending order
15th Sep 2023, 4:07 AM
Jaasir ahamed AJ
Jaasir ahamed AJ - avatar
0
SELECT * FROM Desserts WHERE name LIKE '%Chocolate%' Sql is case sensitive so please aware with chocolate and Chocolate
29th Oct 2023, 12:04 PM
ABHISHEK SAHANA
ABHISHEK SAHANA - avatar
0
tyring 3 days the chocolate project, but the code has shown an error. at the end, I find the solution. First, i will show the wrong Code is SELECT dessert_name, price FROM desserts WHERE dessert_name LIKE '%chocolate%'; This code is totally wrong. The correct code is SELECT name, price FROM desserts WHERE name LIKE '%chocolate%'; please make sure the SQL case is sensitive; see the question, then give the output
27th Nov 2023, 5:38 AM
Syed Junaid Ali Shah
Syed Junaid Ali Shah - avatar
0
The answer is : /* select the dessert name and price where the name contains 'chocolate' */ SELECT name, price FROM desserts WHERE name LIKE 'chocolate%';
14th Dec 2023, 6:31 PM
Maysa Jumayeva
Maysa Jumayeva - avatar
0
SELECT name, price FROM desserts WHERE name LIKE '%chocolate%';
16th Dec 2023, 4:42 PM
Aya Benaziza
Aya Benaziza - avatar
0
This thing is still a mess sometimes its working and sometimes is not wth? After couples times of trying the same code it finally accepted CODE: SELECT name, price FROM desserts WHERE name LIKE '%chocolate%'
22nd Apr 2024, 12:06 PM
Michael Wol
Michael Wol - avatar