Noah_bean
Noah_bean

Reputation: 61

How to create column name with space?

Can anybody tell me how to create columns with space like "FULL NAMES"? I've tried like the following but it doesn't work.

CREATE TABLE info
(
Full Names varchar(20),
Physical Address varchar(20),
Moviesrented varchar(100),
Salutation varchar(20),
Category varchar(20),
PRIMARY KEY (address)
)

Upvotes: 6

Views: 13821

Answers (2)

donald123
donald123

Reputation: 5739

Just put the name in backticks:

CREATE TABLE info (`Full Names` varchar(20), ...)

But that's no good handle for naming your columns.

Upvotes: 8

John Woo
John Woo

Reputation: 263723

I wonder why you want that. But to answer your question, wrap it with backticks.

`Full Names` VARCHAR(20)

Upvotes: 3

Related Questions