Data Models PDF
Document Details
Uploaded by RicherRhinoceros8845
CTINFMGL
Tags
Summary
This document presents an overview of data models, including a recap of database management systems, what data modeling is, entities, attributes, and relationships. It also discusses various stages of data modeling, different types of data models, and the relational model, with examples. This presentation seems geared towards a computer science or information technology class.
Full Transcript
CTINFMGL CS Department Data Models CTINFMGL CS Department Outline Recap of Database and Database Management System What is Data Modeling? CTINFMGL BSIT Department The digital world is filled with data CTINFMGL BSIT Department...
CTINFMGL CS Department Data Models CTINFMGL CS Department Outline Recap of Database and Database Management System What is Data Modeling? CTINFMGL BSIT Department The digital world is filled with data CTINFMGL BSIT Department Social media apps collect data about our posts and our likes. CTINFMGL BSIT Department Online stores collect data about the products we view. CTINFMGL BSIT Department How is all this data stored? CTINFMGL BSIT Department It may start off in a computer program, where variables store the data in memory. CTINFMGL BSIT Department But it eventually needs to be stored in a persistent storage format. The data needs to be accessible after the program stops running CTINFMGL BSIT Department We can store data in.txt files or.csv files or spreadsheets CTINFMGL BSIT Department Most applications store data in a database, a system that stores data on a computer in a way that can be easily accessed, updated, queried, and deleted. Desktop Apps Databa se Mobile CTINFMGL BSIT Department When we build our own application, we need to know the types of data we will use and store in our CTINFMGL BSIT Department We need to model our data! CTINFMGL CS Department What is Data Modeling? The process of capturing the business requirements of a system or application and turning them into a database design. CTINFMGL CS Department What is Data Modeling? The process of conceptualizing and visualizing how data is captured, stored, and used by an organization. CTINFMGL CS Department What is Data Modeling? In data modeling, you typically define entities their attributes, and the relationships between these entities. CTINFMGL CS Department Relationship Entity Entity Orde Customer Product rs Name Email Name Price Attribute Attribute Attribute Attribute CTINFMGL CS Department What are Entities? Entities are the objects or concepts for which data is collected. In database terms, entities usually become tables. CTINFMGL CS Department What are Entities? They represent real-world objects or concepts that are of interest to a business or organization, such as customers, products, or orders. CTINFMGL CS Department What are Entities? Entities are the building blocks of a data model and are used to define the structure of data. CTINFMGL CS Department Entities in an Online Store App User Product Category Order Cart Cart Item Review Discount CTINFMGL CS Department What are Attributes? Attributes are the properties that define an entity. They describe the characteristics of an entity, such as a customer's name, address, or age CTINFMGL CS Department Attributes of a User Entity Age Date of Birth User Name Email CTINFMGL CS Department Attributes of an Order Entity Shippin g User ID Address Order Order Order Date Amount CTINFMGL CS Department Attributes of a Product Entity Product Price Image Product Descript Name ion CTINFMGL CS Department What are Relationships? Relationships describe the associations or connections between entities in a data model. CTINFMGL CS Department What are Relationships? Place User Order s CTINFMGL CS Department What are Relationships? Receiv Product Review es CTINFMGL CS Department What are Relationships? User Writes Review CTINFMGL CS Department What are Relationships? Contai Cart Cart Item ns CTINFMGL CS Department What are Relationships? Provide Supplier Product s CTINFMGL CS Department What are Relationships? Belong Product Category s to CTINFMGL CS Department Stages of Data Modeling Requirements Conceptual Logical Gathering Design Design Physical Implementati Design on CTINFMGL CS Department Requirements Gathering In the initial phase, data modelers identify and understand the data requirements and business objectives through surveys, and interviews with the stakeholders. CTINFMGL CS Department Requirements Gathering Example: Imagine a hospital looking to develop a data model for patient record management. The requirements gathering would involve talking to doctors, nurses, and administrative staff to comprehend their necessities, like patient demographics, medical histories, and appointment schedules. CTINFMGL CS Department Conceptual Design In the conceptual design phase, a broad overview of the data structure is developed. It outlines the main entities, their attributes, and the relationships between them. CTINFMGL CS Department Conceptual Design Example: The conceptual design might include entities like Patient, Doctor, and Appointment. Relationships could be represented, such as a Patient scheduling an Appointment with a Doctor. CTINFMGL CS Department Logical Design In the conceptual design phase, a broad overview of the data structure is developed. It outlines the main entities, their attributes, and the relationships between them. CTINFMGL CS Department Logical Design Example: The logical design might include assigning unique identifiers (primary keys) to both patients and doctors. The Appointment entity might have foreign keys linking it to the relevant patient and doctor. CTINFMGL CS Department Physical Design In this step, the logical model is transformed into a detailed schema that the database will use. It includes technical specifications such as table structures, indexing strategies, and storage allocations that are tailored to the chosen database management system. CTINFMGL CS Department Physical Design Example: The physical design would include the creation of tables like 'Patients,' 'Doctors,' and 'Appointments' in a specific database system like Oracle or SQL Server. Indexes could be created on the names of patients for faster search results. CTINFMGL CS Department Implementation Finally, the database is brought to life in the implementation phase. The physical model is used to build the database structure, and data is populated into the tables. CTINFMGL CS Department Implementation Example: The final step involves the database management system to create the tables defined in the physical model and then importing patient and doctor information from existing records or inputting new data. CTINFMGL CS Department Types of Data Models 1. Hierarchical Model 2. Network Model 3. Relational Data Model 4. Entity-Relationship Model CTINFMGL CS Department Relational Model Used solely for relational databases, the relational data model defines data in terms of tables, rows, and columns CTINFMGL CS Department User Table Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 CTINFMGL CS Department User Table Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- Rows 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 Each row store data about one CTINFMGL CS Department Columns Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 Columns represent the characteristics of CTINFMGL CS Department Columns Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 Each attribute has a rule where a specific datatype (domain) and specific limitations (constraint) CTINFMGL CS Department Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 For example, the Age attribute only allows integers. Thus, the domain for Age is Int CTINFMGL CS Department Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 Date of Birth attribute only allows values in Date format (mm-dd-yyyy). CTINFMGL CS Department Date of User ID Name Age Email Birth john@mai 01-01- 1 John 22 l.com 2000 joe@mail. 01-02- 2 Joe 23 com 2000 jake@mai 01-03- 3 Jake 24 l.com 2000 User ID attribute has a constraint that is cannot be empty or cannot be a CTINFMGL CS Department Entity-Relationship Model In an ER model, entities represent real- world objects or concepts and are depicted as rectangles. Relationships between entities are shown with lines connecting them to indicate how entities are related to each other. CTINFMGL CS Department Relationship Entity Entity Orde Customer Product rs Name Email Name Price Attribute Attribute Attribute Attribute Similar to relational data models, each attribute has a rule where a specific datatype (domain) and specific limitations (constraint) are only allowed CTINFMGL CS Department Relationship Entity Entity Orde Customer Product rs Name Email Name Price Attribute Attribute Attribute Attribute Entities are represented as rectangles, relationships in rhombus, and attributes in ovals CTINFMGL CS Department References https://www.khanacademy.org/computing/ap-computer-s cience-principles/data-analysis-101/data-tools/a/storing- data-sets#:~:text=Most%20applications%20store%20d ata%20in,stores%20the%20data%20in%20files. https://www.cdata.com/blog/data-modeling-examples#: ~:text=A%20simple%20example%20is%20the,common ly%20used%20in%20retail%20businesses.&text=A%20 Sales%20table%20is%20very,SalesID%20(Primary%20K ey)