Home > Mobile >  While Inserting Data Showing Data as does not exist
While Inserting Data Showing Data as does not exist

Time:08-31

Query

INSERT INTO public.employee
(id,first_name,last_name,salary,joining_date,department)
VALUES
(1, Monika, Arora, 100000, '2014-02-20 09:00:00', HR);

Output:

ERROR: column "monika" does not exist

CodePudding user response:

Add single quotes, as this is how string constants are represented in SQL: 'Monika'

CodePudding user response:

Monika, Arora and HR should be quoted like that:

INSERT INTO public.employee (id,first_name,last_name,salary,joining_date,department)
VALUES (1, 'Monika', 'Arora', 100000, '2014-02-20 09:00:00', 'HR');
  • Related