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)
)
Column names can contain any valid characters (for example, spaces).
DML SQL query with space in a column name When we run INSERT, UPDATE, and DELETE statements, we must use a square bracket or double quotes to handle the column name with space.
Table names can contain any valid characters (for example, spaces).
You can refer to column names that contain spaces or operators by surrounding them in backticks. This way you can also escape names that start with a digit, or those that are a Python keyword.
Just put the name in backticks:
CREATE TABLE info (`Full Names` varchar(20), ...)
But that's no good handle for naming your columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With