Column name with spaces

From SQLZoo

SELECT a column whose name contains spaces?

schema:scott

You can access columns where the name contains a space.

DROP TABLE SpaceMonster
CREATE TABLE SpaceMonster([Account Balance] INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT [Account Balance] FROM SpaceMonster
CREATE TABLE SpaceMonster(`Account Balance` INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT `Account Balance` FROM SpaceMonster
CREATE TABLE SpaceMonster("Account Balance" INT);
INSERT INTO SpaceMonster VALUES (42);
SELECT "Account Balance" FROM SpaceMonster
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects
  • Your server today is: Laa-Laa