When should we use `` or '' in mySQL?

CREATE TABLE counties(      idint (11) NOT NULL auto_increment,      countytinytext NOT NULL, PRIMARY KEY ( id)) TYPE = MyISAM;

-- 
INSERT INTO `counties` VALUES (1, 'Alachua County');

I saw several patterns here. People use `` to surround field names and use '' for surrounding values. It's true?

Or the main reason for this is that then we can put the code in a text file and import it into the database.

Thank you

+3
source share
3 answers

, [`] , . , / , SQL (..: from, where)

['] .

+4

`` MySQL afaik; , , SQL . table.column schema.table.column , - , .

table.column , dtd .

+2

'' - ​​ , MySQL . ( '1'. , MySQL- .)

Backticks , , . , . , , , - select, , . ( ) , .

+2

Source: https://habr.com/ru/post/1755653/


All Articles