CS Professional · Artificial Intelligence, Data Analytics and Cyber Security - Laws and Practice · Database Management
A bank's database has entities Customer and Account. One customer may hold many accounts, but each account belongs to exactly one customer. When this ER design is converted into relational tables, what is the standard way to implement the relationship?
The Customer primary key should be added as a foreign key in the Account table. In a one-to-many relationship the foreign key sits on the many side. A junction table is needed only for many-to-many relationships, and merging tables creates repeating groups.
- APlace the Customer primary key as a foreign key in the Account tableCorrect
- BPlace the Account primary key as a foreign key in the Customer table
- CCreate a separate junction table holding both primary keys as a composite key
- DMerge both entities into one table with repeating account columns
Explanation
A one-to-many relationship is implemented by putting the primary key of the 'one' side (Customer) as a foreign key in the 'many' side (Account). Placing the key on the Customer side would force repeating groups. A junction table is needed only for many-to-many relationships.
Did you get it right without looking?
One question tells you little. A timed set on Database Management shows your real accuracy, how long you take and where you lose marks.
More Database Management questions
- A fintech firm in Pune executes the following in sequence: INSERT of a new loan record, then SAVEPOINT s1, then UPDATE of the interest rate,…
- A bank's employee, while a transaction updating a customer's balance is still uncommitted, is shown by another session a balance value that …
- In the ETL process used to populate a data warehouse, which activity is performed in the 'Transform' step?
- An e-commerce firm stores personal data of buyers. Its database designer finds that a Buyer table holds buyer name, city and also the city's…
- A table EMP has 6 rows with salaries 20000, 30000, 30000, 40000, 50000 and NULL. Which of the following statements about the results is corr…
- An insurer's DBA wants staff in the claims department to see only the claim number, claimant name and claim status from a table that also ho…