Is it possible to insert values in column using just a primary key reference?
I have a table 'users' with the columns:
user_id(PK), user_firstname, user_lastname
and another table 'room' with the columns:
event_id(PK), user_id(FK), user_firstname, user_lastname....(and more
columns).
I want to know if it is possible to fill the user_firstname and
user_lastname automatically just knowing the user_id column.
Like the default value of user_firstname would be like: "select
users.user_firstname where users.user_id = user_id"
I don't know if was clear enough...As you can see my knowledge in database
is very narrow.
No comments:
Post a Comment