Welcome to the Treehouse Community
Looking to learn something new?
Cecilie Johnsen1,694 Points
Single or double quotes in MySQL
What is the difference between single quotes and double quotes in SQL? I've learned that you should stick to using single quotes, but it can vary from database to database.
Konstantinos Pedarakis21,301 Points
Actually there is no difference between the two. You can store string with single and double quotes. But... single quotes are used to indicate the beginning and end of a string in SQL. Double quotes generally aren't used in SQL, you use them in order to store lets say the whole SQL statement(query), in a variable so you can use it later in your code. As you correctly mention, yes you should stick to single quotes, in terms like when you want to indicate a string and not double. but you can do your job either way. Just another tip i can give you is that you should declare your tables and columns in lowercase. That way will be more convinient to you later when you use them inside your code. in PHP for example. Its easier to remember that you have all your fields in lowercase.