Question: pid is a foreign key ( without CASCADE ) in Emp table references to the Prj table and cid the primary key in Emp table.

pid is a foreign key (without CASCADE) in Emp table references to the Prj table and cid the primary key in Emp table.
If we need to add a new record (cid, cname, salary, pid, pname) with values (1, 'Mary', 12000,3,'C++'), which answer is TRUE?
Given the following tables and records:
mysql> select * from Emp;
+-----+-------+--------+------+
| cid | cname | salary | pid |
+-----+-------+--------+------+
|1| Mary |12000|1|
|2| Tom |6000|2|
+-----+-------+--------+------+
mysql> select * from Prj;
+-----+--------+
| pid | pname |
+-----+--------+
|1| Java |
|2| Python |
|3| Web |
+-----+--------+
pid is a foreign key (without CASCADE) in Emp table references to the Prj table and cid the primary key in Emp table.
If we need to add a new record (cid, cname, salary, pid, pname) with values (1, 'Mary', 12000,3,'C++'), which answer is TRUE?
We must insert the data into the Prj table first.
We cannot insert the data of this record into both tables.
We can either insert the data into the Prj table first or insert the data into the Emp table first. There is no order we need to follow.
We must insert the data into the Emp table first.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!