0

Error lesson 4.2 in SQL Course

Appears an error when executing the select statement of lesson 4.2 of SQL Course. Despite writing the requested columns in the statement, appears an error indicating that the column does not exist. This is the description: When buying food, it is important to make sure it is fresh and not expired. You are given the following 'Products' list: columns are: productname, price, productiondate, expirationdate Write a query to select the ProductName, ProductionDate and ExpirationDate. Use the SELECT statement and separate the required columns by commas. The query I have written: SELECT productname, productiondate, expirationdate; Executing this query I get the following error message: ERROR: column "productname" does not exist. I do not know if this a code error or there is something wrong in the website. Appreciate your help!

7th Nov 2021, 5:19 PM
Abdulrahman Mohamed Mohamed Awadeen
8 Answers
+ 6
this is the description: When buying food, it is important to make sure it is fresh and not expired. You are given the following 'Products' list: columns are: productname, price, productiondate, expirationdate Write a query to select the ProductName, ProductionDate and ExpirationDate. Use the SELECT statement and separate the required columns by commas.
7th Nov 2021, 5:46 PM
Lothar
Lothar - avatar
+ 2
Is it possible to copy/paste the task/requirement into the post Description above? wanted to try and help you, but don't remember that one quiz anymore ...
7th Nov 2021, 5:33 PM
Ipang
+ 2
Can you show what you have written?
7th Nov 2021, 5:37 PM
A͢J
A͢J - avatar
+ 2
You are pretty close there! You just forgot to specify, the table name, from which you want to select the columns from. In this case (cmiiw) you need to add FROM specifier which defines exactly that FROM Products; And the full query could be as follows SELECT productname, productiondate, expirationdate FROM Products; Give it another shot!
7th Nov 2021, 7:06 PM
Ipang
+ 1
This is the description: When buying food, it is important to make sure it is fresh and not expired. You are given the following 'Products' list: columns are: productname, price, productiondate, expirationdate Write a query to select the ProductName, ProductionDate and ExpirationDate. Use the SELECT statement and separate the required columns by commas. The query I have written: SELECT productname, productiondate, expirationdate; Executing this query I get the following error message: ERROR: column "productname" does not exist. I do not know if this a code error or there is something wrong in the website. Appreciate your help!
7th Nov 2021, 7:00 PM
Abdulrahman Mohamed Mohamed Awadeen
+ 1
Thank you for the clarification! I really appreciate your comment.
7th Nov 2021, 7:23 PM
Abdulrahman Mohamed Mohamed Awadeen
0
Abdulrahman Mohamed Mohamed Syntax for select query: SELECT column_name1, column_name2,....so on FROM table_name So you have missed FROM table_name You are selecting columns but from which table?
7th Nov 2021, 7:26 PM
A͢J
A͢J - avatar
0
I think your error is u written "ProductName" here letter "p" and "n" were capital in the query u written "productname" here those letters were in lower case.
9th Nov 2021, 3:02 AM
Ram Sagar