Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Faidra Papanikolaou
Faidra Papanikolaou
1,890 Points

Data types mySQL

Since we define the type of data of the whole column when we create the table, why do we have to use quotes when we insert strings?

Does it mean that we can insert a string in a column defined as an integer?

Sorry I am a beginner and it does not make sense.

1 Answer

No, you cannot insert a string into a column defined as an integer.

The quotes are necessary to denote the beginning and end of the string. Every character between the opening and closing quotes are included in the string.

Also important to distinguish strings from SQL keywords, function & parameter names, etc.