I've started learning SQL on Friday. I'm using pgAdmin4
I'm having trouble with one line on this code:
SELECT first_name, last_name, nationality, date_of_birth
FROM DIRECTORS
WHERE nationality IN ('French' , 'German', 'British');
AND date_of_birth BETWEEN 01/01/1940 AND 31/12/1969; // error
The first 3 lines work, they list everything as needed, the 4th line is giving me an error
ERROR: syntax error at or near "AND" LINE 4: AND date_of_birth BETWEEN 01/01/1940 AND 31/12/1969;
On the fourth line I'm trying to check date_of_birth between =>01/01/1940 && <=31/12/1969.
I still get an error when I use WHERE
instead of AND
on the 4th line, I don't know what word to use (AND,WHERE,etc) when I am being asked to find more details in a database.
Any help appreciated.
;
after thewhere
statement that means end of code block. Remove it and also put an inverted comma like this '01/01/1940' for the date value.