Related Topics

Related Subjects

Entity in ER Model in Hindi

RGPV University / DIPLOMA_CSE / DBMS

Entity in ER Model Explained with Examples in Hindi

Entity in ER Model in Hindi

What is an Entity in ER Model?

अगर आप Database Design सीख रहे हैं तो ER Model (Entity Relationship Model) का नाम आपने ज़रूर सुना होगा। इसमें सबसे पहला और बेसिक कॉन्सेप्ट होता है — Entity। Entity का मतलब होता है — "कोई भी ऐसा object या चीज़ जिसके बारे में हम डेटा स्टोर करना चाहते हैं।" ये एक real-world object भी हो सकता है, जैसे Student, Teacher, Product, Car, या कोई भी Person।

  • Entity को हम Table की तरह visualize कर सकते हैं।
  • हर Entity के कुछ Attributes होते हैं, जैसे Student Entity में — Name, Roll Number, Age, Class वगैरह।
  • हर Entity एक Unique पहचान भी रखती है, जिसे हम Primary Key कहते हैं (इसके बारे में नीचे detail में बताया गया है)।

Types of Entity in ER Model in Hindi

ER Model में Entity को दो मुख्य categories में divide किया गया है:

  • Strong Entity: ये ऐसी entity होती है जो अपने आप में independent होती है, और इसका अपना Primary Key होता है। उदाहरण के लिए — Student एक strong entity है क्योंकि इसका अपना Roll Number (Primary Key) होता है।
  • Weak Entity: ये अपने आप में complete नहीं होती, और इसकी पहचान किसी दूसरी entity से जुड़ी होती है। इसका अपना कोई complete primary key नहीं होता। उदाहरण के लिए — Dependent entity किसी Employee entity पर depend करती है, जैसे उसका बच्चा या spouse।

What is Primary Key in Entity in Hindi

Primary Key एक ऐसा Attribute होता है जो Entity की हर एक record को uniquely identify करता है। मतलब — एक table में ऐसा कोई field जो दो बार repeat न हो, वो Primary Key कहलाता है।

  • Student Entity में — Roll Number एक Primary Key हो सकता है।
  • Employee Entity में — Employee ID एक Primary Key होगी।
  • Primary Key से ही हम किसी भी record को uniquely ढूंढ सकते हैं।

Primary Key के कुछ important नियम होते हैं:

  • Primary Key कभी NULL नहीं हो सकती।
  • Primary Key की value हमेशा unique होनी चाहिए।
  • एक table में सिर्फ एक ही Primary Key हो सकती है (चाहे वो single field हो या composite)।

Examples of Entity in ER Model in Hindi

चलिए अब कुछ real-world examples देखते हैं जिससे आपको concept और अच्छे से clear हो जाए:

Entity Name Real World Example Primary Key Attributes
Student कोई भी स्कूल या कॉलेज स्टूडेंट Roll Number Name, Age, Class
Employee Company का कोई worker Employee ID Name, Department, Salary
Product किसी shop में बेचा जाने वाला सामान Product ID Name, Price, Quantity
Book Library में रखी कोई भी book ISBN Title, Author, Publisher

इन examples से साफ़ है कि हर Entity का कोई unique पहचान (Primary Key) होता है, और हर Entity के multiple attributes होते हैं जो उसका detail बताते हैं।

Types of Entity in Hindi

What are Types of Entity in ER Model?

चलो दोस्तो, आज हम एक बहुत ही जरूरी और interesting topic समझने वाले हैं — Types of Entity. जब भी हम Entity-Relationship Model (ER Model) की बात करते हैं, तो Entity एक main concept होता है। लेकिन हर entity एक जैसी नहीं होती। हर entity की अपनी category होती है, और इन categories को ही हम कहते हैं — Types of Entity.

तो चलिए, एक-एक करके हर टाइप को बड़े ही friendly और आसान अंदाज़ में समझते हैं:

1. Strong Entity

Strong Entity वो entity होती है जो खुद में complete होती है, यानी इसे uniquely पहचानने के लिए किसी और entity की ज़रूरत नहीं होती। इसका अपना एक Primary Key होता है जो इसे uniquely identify करता है।

  • Example: अगर हम "Student" entity की बात करें, तो उसका Roll Number उसे uniquely identify करता है।
  • Student, Teacher, Employee — ये सब strong entity के examples हैं।
  • ER Diagram में इसे एक simple rectangle से दर्शाया जाता है।

2. Weak Entity

Weak Entity अपने आप में complete नहीं होती। इसकी पहचान किसी दूसरी entity पर depend करती है। इसका खुद का कोई complete Primary Key नहीं होता, इसलिए इसे पहचानने के लिए दूसरी entity की key का सहारा लिया जाता है। Weak Entity को हम dependent entity भी कह सकते हैं।

  • Example: Dependent (Employee के बच्चे या spouse)
  • ये entity तब तक meaningful नहीं होती जब तक इसके साथ related strong entity न हो।
  • ER Diagram में इसे double rectangle से दिखाते हैं।

3. Associative Entity

Associative Entity दो या दो से ज्यादा entities के बीच के relationship को represent करने के लिए use होती है। ये तब create की जाती है जब दो entities के बीच कई-to-कई (many-to-many) relationship हो। और उस relationship से जुड़ी कुछ extra information को store करना हो।

  • Example: मान लो एक Student कई Courses में enroll कर सकता है, और एक Course में कई Students हो सकते हैं। इस relationship को handle करने के लिए हम एक Associative Entity बनाएंगे — "Enrollment"
  • Enrollment entity में हम Student ID, Course ID, और Enrollment Date जैसे attributes रख सकते हैं।

4. Recursive Entity

Recursive Entity वो होती है जहाँ एक ही entity अपने आप से ही relationship में होती है। मतलब — एक ही टेबल में एक row दूसरी row से related होती है।

  • Example: एक Employee किसी दूसरे Employee का manager हो सकता है। यानी एक ही टेबल में hierarchy बनती है।
  • Employee entity में Manager_ID एक ऐसा attribute होगा जो उसी टेबल के किसी और employee की ID होगी।

5. Composite Entity

Composite Entity तब use की जाती है जब दो strong entities का relationship खुद एक entity की तरह behave करे। इसमें generally composite primary key होती है जो दोनों entities की primary key से मिलकर बनती है।

  • Example: अगर Student और Course के बीच Enrollment एक entity है, और उसमें primary key = StudentID + CourseID है, तो वो Composite Entity कहलाएगी।
  • ये बहुत useful होती है many-to-many relationships को normalize करने में।

Entity Types Table (Quick Summary)

Entity Type Definition Example Symbol in ER Diagram
Strong Entity Self-dependent entity with its own Primary Key Student, Employee Rectangle
Weak Entity Dependent entity without full Primary Key Dependent (Child of Employee) Double Rectangle
Associative Entity Represents relationship with additional attributes Enrollment Rectangle (sometimes diamond with attributes)
Recursive Entity Entity related to itself Employee (manager of another employee) Arrow looping back to same rectangle
Composite Entity Entity formed from two primary keys Student-Course (Enrollment) Rectangle with composite key

Primary Key in Entity in Hindi

What is Primary Key in Entity?

चलो दोस्तो! आज हम बात करने वाले हैं एक ऐसे concept की जो हर एक student को अच्छे से आना चाहिए — Primary Key. जब भी आप कोई भी table या entity बनाते हो, तो उसमें एक ऐसा field ज़रूर होता है जो हर रिकॉर्ड को uniquely पहचानता है। बस उसी को हम Primary Key कहते हैं। Primary Key एक ऐसा attribute होता है जिसकी value कभी दोहराई (duplicate) नहीं जा सकती और वो कभी null भी नहीं हो सकती।

Why Primary Key is Important?

चलिए थोड़ा practical बनते हैं — सोचो आपके पास 1000 students का data है, और आप किसी एक specific student को पहचानना चाहते हो। अगर आपने Roll Number को Primary Key बनाया है, तो आप उसी के ज़रिए उस student का पूरा data निकाल सकते हो। मतलब, Primary Key ही वो gate होती है जिससे आप किसी record तक पहुंचते हो — Fast, Accurate और Reliable way में।

Rules of Primary Key

Primary Key को define करने के कुछ जरूरी rules होते हैं जिन्हें याद रखना बहुत जरूरी है:

  • Primary Key की value हमेशा Unique होनी चाहिए — दो records में same primary key नहीं हो सकती।
  • Primary Key कभी NULL नहीं हो सकती — हर रिकॉर्ड में उसकी value ज़रूरी है।
  • एक table में केवल एक ही Primary Key हो सकती है।
  • Primary Key Single column या Composite (multi-column) भी हो सकती है।

Types of Primary Key

  • Simple Primary Key: जब primary key एक single column से बनती है। जैसे - Roll_Number in Student Table।
  • Composite Primary Key: जब दो या दो से ज्यादा columns मिलकर एक unique key बनाते हैं। जैसे - StudentID + CourseID मिलकर बनाएं एक unique Enrollment ID।

Real World Examples of Primary Key

Entity Primary Key Explanation
Student Roll_Number हर student को अलग-अलग roll number दिया जाता है जिससे वो uniquely identify हो सके।
Employee Employee_ID किसी भी company में हर employee को एक unique ID assign की जाती है।
Book ISBN हर book का ISBN नंबर unique होता है जो international level पर उसे पहचानता है।
Course Enrollment StudentID + CourseID एक student कई courses में enroll हो सकता है, इसलिए दोनों मिलकर एक composite key बनाते हैं।

Primary Key Syntax in SQL

अब एक basic SQL example देख लेते हैं जिससे Primary Key का usage clear हो जाए:

CREATE TABLE Student (   Roll_Number INT PRIMARY KEY,   Name VARCHAR(50),   Class VARCHAR(10) );

ऊपर दिए गए code में Roll_Number को Primary Key declare किया गया है। इसका मतलब यही field हर student को uniquely identify करेगा।

CREATE TABLE Enrollment (   StudentID INT,   CourseID INT,   EnrollmentDate DATE,   PRIMARY KEY (StudentID, CourseID) );

इस example में दो fields मिलकर एक Primary Key बना रहे हैं — इसे हम Composite Primary Key कहते हैं।

Examples of Entity in ER Model in Hindi

What are Examples of Entity in ER Model?

दोस्तों, अगर आप ER Model (Entity-Relationship Model) पढ़ रहे हैं, तो सबसे पहले आपको "Entity" का मतलब अच्छे से समझना होगा। Entity वो होती है जिसके बारे में हम database में information store करते हैं। अब बात करते हैं — असली examples की, ताकि आपको बिल्कुल clear समझ आ जाए कि कौन-कौन सी चीज़ें entity हो सकती हैं। मैं आपको वो सारे examples explain करूंगा जो आपकी पढ़ाई और practical knowledge — दोनों के लिए useful हैं।

Real-Life Examples of Entity

Entity किसी भी इंसान, चीज़, जगह या concept को represent कर सकती है। जिसके बारे में आप data रखना चाहते हैं, वो आपकी entity है। चलिए सबसे पहले daily life से जुड़े कुछ best examples को देखते हैं:

Entity Description (in Hindi) Possible Attributes
Student कोई भी ऐसा व्यक्ति जो स्कूल या कॉलेज में पढ़ता हो। Roll_Number, Name, Class, Age
Teacher शिक्षा देने वाला व्यक्ति जो संस्थान से जुड़ा होता है। Teacher_ID, Name, Subject, Salary
Book लाइब्रेरी या स्टोर में रखी गई कोई किताब। ISBN, Title, Author, Price
Course शैक्षणिक संस्थान द्वारा पढ़ाया जाने वाला कोई भी पाठ्यक्रम। Course_ID, Name, Duration, Fees
Employee कोई भी ऐसा व्यक्ति जो किसी company या organization में काम करता हो। Employee_ID, Name, Department, Salary
Hospital ऐसा स्थान जहां मरीजों का इलाज होता है। Hospital_ID, Name, Location, Total_Beds
Product किसी दुकान या store में बेचा जाने वाला item। Product_ID, Name, Price, Quantity

Academic Examples of Entity in ER Model

  • Student – एक main entity होती है जिसमें हर छात्र का डेटा स्टोर होता है। जैसे Roll Number, Name, Mobile Number आदि।
  • Teacher – ये भी एक entity होती है, जिसमें teachers के विषय और salary आदि store होते हैं।
  • Classroom – हर क्लासरूम एक unique number से represent किया जा सकता है।
  • Library Book – एक book भी entity है जिसमें Title, ISBN, Author जैसे attributes होते हैं।

Business Examples of Entity in ER Model

  • Customer – Customer_ID, Name, Address जैसी information store करने के लिए।
  • Order – हर order एक entity होती है जिसका unique Order_ID होता है।
  • Invoice – Billing के लिए हर invoice को एक entity के रूप में treat किया जाता है।

Entity के Example का Use कैसे होता है?

Entity और उसके attributes को define करने के बाद, हम ER Diagram में उसे एक rectangle से represent करते हैं। नीचे एक example code देखिए जहाँ Student नाम की entity और उसके attributes define किए गए हैं:

Entity: Student Attributes: - Roll_Number (Primary Key) - Name - Class - Mobile_Number

इस structure से हम हर student का data unique तरीके से save कर सकते हैं। इस तरह के examples exam, assignment और real database project में भी बहुत useful होते हैं।

FAQs

Entity एक real-world object होती है जिसके बारे में हम data store करते हैं, जैसे Student, Book, Employee आदि।
हाँ, एक entity के पास कई attributes हो सकते हैं जैसे Student entity में Name, Roll Number, Class, Age आदि।
Primary Key एक ऐसा attribute होता है जो हर record को uniquely identify करता है और उसकी value कभी null या duplicate नहीं होती।
हाँ, entity सिर्फ व्यक्ति नहीं बल्कि कोई स्थान (जैसे Hospital) या वस्तु (जैसे Product) भी हो सकती है।
Composite Entity वो होती है जो दो entities को connect करती है, जैसे Student और Course के बीच Enrollment entity जो StudentID और CourseID दोनों को जोड़ती है।
हर table एक entity को represent करती है, लेकिन जरूरी नहीं कि हर table खुद में entity हो; कुछ tables सिर्फ relationship दिखाने के लिए होती हैं।

Please Give Us Feedback