TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Database

    Database Entities and Relationships

    Overview

    In this tutorial, we will learn about database entities and relationships. Relational databases store information about entities and how these entities are related.

    Database Entity

    In database modelling, an entity is used to denote real-world thing, person,place, concept, etc for which we want to store data in the database. For example, bank account, bank customer are entities. Database table is used to store data that represents entities of one particular kind. Each row represents data of one instance of the entity. For example, the Customers table is used to store information of customers. Each row represents the data of one customer.

    Relationships

    A relationship is an association between entities. It is the link between the database entities and is used to denote how entities relate to each other. A relationship is defined y a diamond-shape symbol in an ER diagram.

    Relationships can be categorized according to how entities can be involved in the relationship::

    • One-to-One ( 1:1)
    • One-to-Many( 1:M)
    • Many-to-One( M:1)
    • Many-to-Many( M:N)

    A one-to-one relationship exists when a single entity is linked with another single entity. For example, a single person can have a single passport.

    Let’s consider the bank example. A customer can have more than one bank account. So, the relationship between customers and bank accounts is a one-to-many relationship. Note that it is even possible that a customer has no bank account at all. The term many refers o the maximum number of accounts the customer can have.

    For example, let’s consider students and courses in a university. The entities in the relationship are Student and Course. A student can attend more than one course. Conversely, a course can be attended by many student. So, the relationship between students and courses is a many-to-many relationship.

    ER Model

    https://www.testingdocs.com/entity-relationship-model/

    —

    MySQL Tutorials

    MySQL Tutorials on this website:

    https://www.testingdocs.com/mysql-tutorials-for-beginners/

    For more information on MySQL Database:

    https://www.mysql.com/

    Related Posts

    SQLite

    Database /

    SQLite database introduction

    Database /

    Types of NoSQL databases

    Database /

    Popular NoSQL Databases

    Database /

    Database Characteristics

    3-Tier Architecture

    Database /

    3-Tier Architecture

    ‹ Popular Relational Databases› ER Diagram Cardinality Symbols

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com