Is it possible to index table A ID to table B userId in postgreSQL ? So i would join 2 tables by id or something like that.
to better explain my question here is an example of mongoDB and mongoose:
const Billing = new Schema({
account:Number,
user: {
type: Schema.Types.ObjectId,
ref: 'user',
required: true
}
});
// later in the code i can do something like
Billing.findOne().populate('user');
that will create a virtual relationship between billing to user.
can something like that be done with postgreSQL
I am using sequelize ORM.