Database Models (Hierarchical, Network, E/R, Relational)

एक database model वह आकार है जिसमें data व्यवस्थित होता है: hierarchical एक सख़्त tree है, network एक लचीला web है, E/R model एक design diagram है, और relational model, keys से जुड़ी सरल tables, इसलिए जीता क्योंकि यह query और बदलने में सबसे आसान है।

10 min read · 9 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

वही data, चार आकार

Meera की दुकान में customers, orders और items हैं, सब संबंधित। पर वह एक database के अंदर कैसे व्यवस्थित होना चाहिए? पता चलता है कि data को आकार देने का एक से ज़्यादा तरीका है, और इतिहास ने जमने से पहले कई आज़माए।

एक database model अंतर्निहित आकार है: एक tree, एक web, एक design sketch, या tables का एक set। syllabus जिन चारों को list करता है उन्हें, और उनमें से एक क्यों जीता यह जानना एक क्लासिक exam सवाल है और वह वजह है कि हर database जो आप कभी इस्तेमाल करेंगे वैसा दिखता है जैसा दिखता है।

Theory

एक library व्यवस्थित करने के चार तरीके

आप एक library को एक सख़्त family tree के रूप में व्यवस्थित कर सकते हैं जहाँ हर किताब का ठीक एक shelf-parent हो (hierarchical), एक cross-references के web के रूप में जहाँ एक किताब कई और से link हो (network), बनाने से पहले खींची एक architect की blueprint के रूप में (E/R), या reference numbers से जुड़ी सादी card-catalogue tables के रूप में (relational)। सब एक ही किताबें रखते हैं; वे इसमें अलग हैं कि उन्हें ढूँढना और फिर से व्यवस्थित करना कितना आसान है। Tables जीतीं।

At a glance

चार models

Modelआकारटिप्पणी
HierarchicalTree: हर child का एक parentसख़्त; many-to-many में कमज़ोर
NetworkGraph: कई parents की इजाज़तलचीला पर navigate करने में जटिल
E/RDesign diagramDESIGN के लिए, store के लिए नहीं
Relationalkeys से जुड़ी tablesप्रमुख: सरल + SQL

Theory

Relational क्यों जीता

Relational model (E.F. Codd, 1970) data को rows और columns की tables (relations) के रूप में store करता है, tables साझा keys से जुड़ी। यह उन कारणों से जीता जो रोज़ मायने रखते हैं:

  • सरल: हर कोई एक table समझता है।
  • लचीला: एक column जोड़ो या दो tables link करो बिना सब कुछ फिर से बनाए (data independence!)।
  • शक्तिशाली querying: SQL से समर्थित, सवाल पूछने की एक पूरी भाषा।
  • ठोस theory: normalization नियम इसे साफ़ रखते हैं।

Hierarchical और network models आपसे pointers हाथ से navigate कराते थे; relational आपको बस जो चाहिए वह describe करने देता है। इसीलिए MySQL, Oracle, PostgreSQL, सब relational, दुनिया चलाते हैं।

Quiz

HIERARCHICAL model में, एक child record के कितने parents हो सकते हैं?

  1. ठीक एक
  2. जितने चाहिए उतने
  3. ठीक दो
  4. कोई नहीं; parents होते ही नहीं
Show the answer

ठीक एक

Hierarchical model एक सख़्त tree है: हर child का ठीक एक parent होता है। यह इसकी परिभाषित सीमा है, असली data को अक्सर many-to-many चाहिए (एक student कई courses में, एक course कई students के साथ), जिसे एक one-parent tree साफ़-सुथरे नहीं व्यक्त कर सकता। Network model ने इसे ढीला करके कई parents की इजाज़त दी। वह one-parent-बनाम-कई भेद दोनों के बीच मुख्य exam contrast है।

Think first

एक tree के साथ Meera की समस्या

Meera के data में एक many-to-many हक़ीक़त है: हर customer कई items ख़रीदता है, और हर item कई customers द्वारा ख़रीदा जाता है। एक सख़्त hierarchical (tree) model यहाँ क्यों संघर्ष करता है, और relational model इसे कैसे संभालता है?

Show the answer

एक tree हर child पर एक parent को मजबूर करता है, तो यह स्वाभाविक रूप से नहीं कह सकता कि 'यह item कई customers का है और यह customer के कई items हैं', आप data को गड़बड़ तरह से duplicate करने लगते हैं। Relational model इसे एक अलग linking table (orders) से संभालता है जो customers और items को आज़ादी से जोड़ने को keys इस्तेमाल करती है, कोई duplication नहीं, कोई भी many-to-many रिश्ता साफ़-सुथरे व्यक्त। यह लचीलापन ठीक वह वजह है कि relational ने पुराने models की जगह ली।

Watch out

Marks कहाँ कटते हैं

hierarchical (tree, एक parent) को network (graph, कई parents) से गड्डमड्ड करना, सबसे ज़्यादा test होने वाला भेद। E/R को एक storage model मानना, यह एक design/conceptual model (एक diagram) है, आप E/R में design करते हैं फिर relational के रूप में implement। और 'relational क्यों लोकप्रिय है?' जवाबों में, simplicity, SQL, flexibility और theory list कीजिए, सिर्फ 'यह tables इस्तेमाल करता है' नहीं। इसके जनक के रूप में Codd का नाम लेना एक अच्छा अतिरिक्त mark है।

Theory

आगे सब कुछ relational है

यहाँ से, पूरा subject relational model है: अगले lessons E/R diagrams से DESIGN करते हैं, फिर key lessons और normalization relational tables को साफ़ बनाते हैं, फिर Unit 4 उन्हें SQL से query करता है। आप जीतने वाले model को शुरू से सीख रहे हैं। आगे: E/R model खुद, entities, attributes और relationships, database design की शब्दावली।

Summary

Key takeaways

  • एक database model वह आकार है जिसमें data व्यवस्थित होता है।
  • Hierarchical: एक tree, हर child का ठीक एक parent; सख़्त, many-to-many में कमज़ोर।
  • Network: एक graph, एक child के कई parents हो सकते हैं; लचीला पर navigate करने में जटिल।
  • E/R: एक design/conceptual diagram, बनाने से पहले plan करने को, store के लिए नहीं।
  • Relational: keys से जुड़ी सरल TABLES (Codd); simplicity, SQL, flexibility, theory की बदौलत प्रमुख।
  • याद रखने का hook: family tree बनाम web बनाम blueprint बनाम card-catalogue tables, tables जीतीं।

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Concepts of Database

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Database Models (Hierarchical, Network, E/R, Relational) · Data Processing and Analysis (DPA) · Gri-Learn