Posts

Showing posts with the label #9_Entity-Relationship
Image
An ER (Entity-Relationship) model in Oracle SQL (or any database system) is a conceptual framework used to design and represent the structure of a database. It visually defines how entities (tables) are related to each other. Key Components of an ER Model: Entities → Represent real-world objects (e.g., Customers, Orders, Employees). In SQL, they become tables. Attributes → Characteristics of an entity (e.g., CustomerID, Name, Email). In SQL, they are columns. Primary Key (PK) → A unique identifier for an entity (e.g., CustomerID). Relationships → Define how entities are related (e.g., "A Customer places an Order"). These are represented using foreign keys in SQL. Cardinality → Defines the type of relationship: One-to-One (1:1) → One entity relates to only one of another. One-to-Many (1:M) → One entity relates to multiple entities (e.g., one Customer has many Orders). Many-to-Many (M:N) → Requires a junction table in SQL (e.g., Students and Courses). Join the discussion on Lin...