Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago