Computer AwarenessHardIBPS SO IT Officer

In an ER model, CUSTOMER and ACCOUNT have a one-to-many relationship (one customer, many accounts; each account has one customer). When converted to tables, where does the foreign key go?

  1. A. In CUSTOMER, holding the account number
  2. B. In a third table that is required for every relationship
  3. C. In ACCOUNT, holding the customer's ID
  4. D. In both tables, each pointing to the other

Correct answer: C. In ACCOUNT, holding the customer's ID

The foreign key goes on the 'many' side: each account row stores its one customer's ID. A separate linking table is needed only for many-to-many relationships.

हिंदी में

ER मॉडल में CUSTOMER और ACCOUNT में एक-से-अनेक संबंध है (एक ग्राहक, कई खाते; प्रत्येक खाते का एक ग्राहक)। तालिकाओं में बदलने पर फ़ॉरेन की कहाँ जाती है?

  1. A. CUSTOMER में, जो खाता संख्या रखे
  2. B. तीसरी तालिका में, जो प्रत्येक संबंध के लिए आवश्यक है
  3. C. ACCOUNT में, जो ग्राहक की ID रखे
  4. D. दोनों तालिकाओं में, प्रत्येक दूसरी की ओर संकेत करे

उत्तर: C. फ़ॉरेन की ‘अनेक’ वाले पक्ष में जाती है: प्रत्येक खाता-पंक्ति अपने एक ग्राहक की ID रखती है। अलग लिंकिंग तालिका केवल अनेक-से-अनेक संबंधों के लिए चाहिए।

More Computer Awareness questions

Exams that ask this topic