Skip to content

Tag: postgresql

Columns with keywords as names in PostgreSQL

I have a couple of tables which have keywords as column names. I am not able to write a subquery using them. Even if I use non-existing column names, the query works. For example I have a few questions – when I use a non-existing column name in a subquery, it works. But if I use the same column name

PostgreSQL Foreign Key syntax

I have 2 tables as you will see in my PosgreSQL code below. The first table students has 2 columns, one for student_name and the other student_id which is the Primary Key. In my second table called tests, this has 4 columns, one for subject_id, one for the subject_name, then one for a student with the highest…