Last answered:

18 Jun 2022

Posted on:

17 Nov 2021

0

Resolved: Quotation marks for INT column

For the second query, the answer file lists the WHERE clause as WHERE emp_no NOT BETWEEN '10004' AND '10012'. However, since emp_no is of type INT(11), wouldn't it make more sense to leave out the quotation marks for the numbers?

3 answers ( 1 marked as helpful)
Instructor
Posted on:

01 Dec 2021

0

Hi Sizar!

Thanks for reaching out!
Yes, if a column is of type INT you can simply remove the quotes. However, if the column is of type DATE, omitting the quotes will result in a different result set. The date 2010-02-03 will be calculated
as 2010-2-3=2005. So, we want a range from 2010-02-03 but instead it is being calculated as a range starting from 2005. So, we should use quotes with dates like this – '2010-02-03'.

Hope this helps.
Best,
Martin

Posted on:

16 Jun 2022

0

The explanation regarding where to use quotation marks and where to not has been scattered during the course, while I see by this comment of yours that it is a really important tip to remember, I hope it is explained further ahead and if not, you add a video exlpaining it completely once forever.

Instructor
Posted on:

18 Jun 2022

0

Hi Saeed!

Thanks for your suggestion! We will note it down and consider adding the relevant information to the course the next time we are making an update!

Kind regards,
Martin

Submit an answer