Write a postgre SQL statement to insert rows into the table employees in which a set of columns department_id and job_id contains the values which must have existed into the table departments and jobs
All Answers
total answers (1)
total answers (1)
Now input two rows into the table departments:
Here is the command to see the list of inserted rows :
Here is another table jobs:
Now input two rows into the table departments:
Here is the command to see the list of inserted rows :
Here is another table employees :
Now insert the rows into the table employees.
Here is the command to see the list of inserted rows :
Here in the above insert statement the child column department_id and job_id of child table employees are successfully referencing with the department_id and job_id column of parent tables departments and jobs respectively, so no problem have been arisen to the insertion.
Now insert another row in the employees table.
Now see the output :
Here in the above insert statement show that, within child columns department_id and job_id of child table employees, the department_id are successfully referencing with the department_id of parent table departments but job_id column are not successfully referencing with the job_id of parent table jobs, so the problem have been arisen to the insertion displayed an error message.
Now insert another row in the employees table.
Now see the output :
need an explanation for this answer? contact us directly to get an explanation for this answer