Database design & modeling
48 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following scenarios best illustrates an indirect interaction with a database?

  • A user accessing their bank account information through a mobile banking application. (correct)
  • A data analyst querying the database directly using SQL commands.
  • A database administrator performing a system backup on the database server.
  • A developer using a DBMS to create tables and define relationships.

When designing a database, which task would a database designer primarily be responsible for?

  • Creating the physical structure of the database, including tables and relationships. (correct)
  • Developing user interfaces and applications for accessing the database.
  • Ensuring the security and integrity of the database.
  • Determining the functional requirements of the database.

In the context of database development, what is the significance of metadata?

  • It represents the visual elements of the user interface.
  • It describes the structure and properties of the data within the database. (correct)
  • It defines the security protocols for accessing the database.
  • It contains the actual transactional data stored within the database.

In ER modeling, which concept is used to represent a characteristic or property of an entity?

<p>Attribute (A)</p> Signup and view all the answers

What is the primary function of a Database Management System (DBMS)?

<p>To manage and organize collections of data, allowing for efficient access and manipulation. (B)</p> Signup and view all the answers

Which of the following is a key characteristic of an 'operational' database?

<p>Supports day-to-day transactions and operations of an organization. (D)</p> Signup and view all the answers

In ER modeling, what is the purpose of identifying 'relationships' between entities?

<p>To illustrate how entities are connected and interact with each other. (C)</p> Signup and view all the answers

A library database stores information about books and authors. A book can have multiple authors, and an author can write multiple books. What type of relationship exists between 'Book' and 'Author' entities?

<p>Many-to-many (B)</p> Signup and view all the answers

In ER diagrams, what distinguishes a weak entity from a strong entity?

<p>Weak entities are depicted with double rectangles, indicating their dependency on a strong entity, while strong entities are represented with single rectangles. (B)</p> Signup and view all the answers

Which of the following best describes the purpose of cardinality in the context of relationships within an ER diagram?

<p>Cardinality specifies how many instances of one entity relate to instances of another entity. (D)</p> Signup and view all the answers

In an ER diagram, how is a derived attribute represented, and what does it signify?

<p>A derived attribute is represented by a dashed oval, signifying that its value is calculated from other attributes. (D)</p> Signup and view all the answers

What is the primary distinction between an ER diagram and a relational model diagram in database design?

<p>An ER diagram focuses on the visual representation of entities, attributes, and relationships, while a relational model diagram details the tables, primary keys, and foreign keys for implementation. (D)</p> Signup and view all the answers

Consider a scenario where a customer must have one and only one account. How would you represent this relationship in terms of cardinality?

<p>1:1 (Mandatory One) (D)</p> Signup and view all the answers

Which of the following is NOT a typical component of an Entity Relationship Diagram (ERD)?

<p>Stored procedures represented as circles. (C)</p> Signup and view all the answers

If an attribute can hold multiple values (e.g., a person having multiple phone numbers), how is this represented in an ER diagram?

<p>Using a double oval around the attribute name. (B)</p> Signup and view all the answers

Why is it important to avoid including unnecessary details when creating an ER diagram?

<p>Unnecessary details can complicate the diagram and obscure the essential database structure. (C)</p> Signup and view all the answers

In a relational database, what is the primary purpose of a foreign key?

<p>To establish a link between two tables based on related columns. (C)</p> Signup and view all the answers

Which type of key is used to uniquely identify each record in a database table?

<p>Primary Key (A)</p> Signup and view all the answers

When converting an Entity-Relationship Diagram (ERD) to a relational schema, what is the standard practice for mapping entities?

<p>Each entity becomes a table, and the entity's attributes become columns of that table. (C)</p> Signup and view all the answers

In the context of database design, what is the main function of constraints?

<p>To enforce data accuracy and integrity. (A)</p> Signup and view all the answers

Consider an ERD with entities PRODUCT and CATEGORY, where one category can have many products. How is this relationship typically mapped in a relational schema?

<p>Add a foreign key in the <code>PRODUCT</code> table referencing the <code>CATEGORY</code> table. (C)</p> Signup and view all the answers

What is the purpose of creating a composite key in a database table?

<p>To uniquely identify records using a combination of two or more columns. (C)</p> Signup and view all the answers

In a database for a library, books and authors have a many-to-many relationship (an author can write many books, and a book can have multiple authors). How is this relationship best implemented in a relational schema?

<p>Create a linking table with foreign keys pointing to both the <code>Authors</code> and <code>Books</code> tables. (C)</p> Signup and view all the answers

Consider two tables, Employees and Departments. Each employee belongs to one department, and each department can have multiple employees. If you need to find all employees in a specific department, which table should contain the foreign key?

<p><code>Employees</code> table should contain a foreign key referencing <code>Departments</code> table. (C)</p> Signup and view all the answers

In ERD design, what is the primary benefit of explicitly including cardinality constraints like '0:1'?

<p>It ensures that the database design adheres to specific business rules and avoids ambiguity during implementation. (B)</p> Signup and view all the answers

Which of the following steps is MOST critical in the initial phase of the ERD design process?

<p>Understanding the system's purpose and data storage requirements through stakeholder communication. (B)</p> Signup and view all the answers

What action should a database designer take to ensure an ERD accurately reflects real-world processes and requirements?

<p>Verification with stakeholders. (B)</p> Signup and view all the answers

What is a key consideration when choosing names for entities and attributes in an ERD?

<p>Using descriptive names for entities and attributes (e.g., Customer_ID, not C_ID). (C)</p> Signup and view all the answers

In the context of ERD best practices, what is the primary reason to avoid redundancy (duplication) of attributes across entities?

<p>To minimize the risk of data inconsistencies and update anomalies. (C)</p> Signup and view all the answers

Which scenario best exemplifies an insertion anomaly in a database?

<p>Inability to add a new product without also specifying a customer who has purchased it. (D)</p> Signup and view all the answers

When is it MOST appropriate to include derived attributes in an ERD, despite the general recommendation to avoid redundancy?

<p>When the derived attribute simplifies data retrieval for frequent reporting or analysis purposes. (B)</p> Signup and view all the answers

A common mistake in ERD design is misidentifying cardinality. What impact does this have on the resulting database?

<p>It can cause data inconsistencies (e.g., orphaned records) and violate business rules. (A)</p> Signup and view all the answers

A database table lists employees and their project assignments. If deleting an employee record also removes all records of their project assignments, this is an example of which type of update anomaly?

<p>Deletion Anomaly (A)</p> Signup and view all the answers

In a poorly designed database, a customer's address is stored in multiple tables. Updating the address in one table but not the others leads to inconsistent data. This scenario is an example of which type of anomaly?

<p>Modification Anomaly (C)</p> Signup and view all the answers

You've created an ERD for a library system, including entities like 'Book,' 'Author,' and 'Patron.' During testing with sample scenarios, you realize that the ERD doesn't account for books having multiple genres. What adjustment should you make to the ERD?

<p>Introduce a new entity, 'BookGenre,' to create a many-to-many relationship between 'Book' and 'Genre'. (B)</p> Signup and view all the answers

Which database operation is used to add a new student record to a university database?

<p>Insert (A)</p> Signup and view all the answers

A company decides to remove a product from its online catalog because it is no longer manufactured. Which database operation would accomplish this?

<p>Delete (A)</p> Signup and view all the answers

A customer changes their phone number in an online store. Which database operation is used to reflect this change?

<p>Modify (A)</p> Signup and view all the answers

Why is normalization important in database design?

<p>To prevent update anomalies and ensure data consistency. (D)</p> Signup and view all the answers

In what situation might denormalization be considered in database design?

<p>When complex queries need to be optimized for speed. (C)</p> Signup and view all the answers

Which of the following scenarios violates the principles of First Normal Form (1NF)?

<p>A table that stores multiple values in a single column. (B)</p> Signup and view all the answers

In the context of functional dependencies, what does 'EmployeeID → EmployeeEmail' imply?

<p>Each EmployeeID determines a unique EmployeeEmail. (D)</p> Signup and view all the answers

What is the primary goal of normalization in database design?

<p>To reduce data redundancy and prevent update anomalies. (C)</p> Signup and view all the answers

Consider a table with columns 'OrderID', 'ProductID', and 'ProductName' where 'OrderID' and 'ProductID' form a composite primary key. If 'ProductName' is only dependent on 'ProductID', which normal form is violated?

<p>Second Normal Form (2NF) (D)</p> Signup and view all the answers

Which of the following best describes a transitive dependency in the context of database normalization?

<p>A non-key attribute depends on another non-key attribute. (A)</p> Signup and view all the answers

A table contains 'EmployeeID', 'EmployeeName', 'Salary', and 'TaxBracket'. 'TaxBracket' is determined by 'Salary'. Which normal form is violated?

<p>Third Normal Form (3NF) (A)</p> Signup and view all the answers

Why is it generally bad to have transitive dependencies in a database design?

<p>They can lead to data inconsistencies and update anomalies. (A)</p> Signup and view all the answers

Which of the following is an example of a violation of the Second Normal Form (2NF)?

<p>A table with a composite key where a non-key attribute depends on only part of the key. (C)</p> Signup and view all the answers

Flashcards

Data

Stored facts, like text or numbers.

Information

Useful data for specific tasks.

Metadata

Data describing data's structure.

Database

Organized collection of data for quick access.

Signup and view all the flashcards

DBMS (Database Management System)

Software to manage databases.

Signup and view all the flashcards

ER Diagram (ERD)

Visual blueprint for database design.

Signup and view all the flashcards

Entity

Represents a person, place, or thing in a database.

Signup and view all the flashcards

Attribute

Describes a characteristic of an entity.

Signup and view all the flashcards

What is an ERD?

Visual representation of a database's structure, mapping entities, attributes, and relationships.

Signup and view all the flashcards

Relational Model Diagram

Focuses on the implementation of the database, detailing tables, primary keys (PK), and foreign keys (FK).

Signup and view all the flashcards

Entities in ERD

Objects or things in a database, such as customers, orders, or products, represented as rectangles.

Signup and view all the flashcards

Strong Entity

Can exist independently (e.g., Employee).

Signup and view all the flashcards

Weak Entity

Depends on a strong entity and cannot exist alone (e.g., OrderItem). Represented as a double rectangle.

Signup and view all the flashcards

Attributes in ERD

Properties or details of an entity, represented as ovals connected to entities.

Signup and view all the flashcards

Primary Key (PK)

An attribute that uniquely identifies each record in an entity, represented as underlined text.

Signup and view all the flashcards

Relationships in ERD

Define how entities are related, represented as diamonds between entities (e.g., Customer Places Order).

Signup and view all the flashcards

Optional One/Zero or One (0:1)

Entity A can have zero or one related instance in Entity B.

Signup and view all the flashcards

Understand Requirements

The first step in ERD design to understand the system goal and data storage needs.

Signup and view all the flashcards

Identify Entities

Main objects/components in the system (e.g., Customer, Order).

Signup and view all the flashcards

Define Relationships

How entities interact with each other.

Signup and view all the flashcards

Add Attributes

Facts or characteristics describing an entity.

Signup and view all the flashcards

Determine Cardinality

The number of instances in a relationship (1:1, 1:N, M:N).

Signup and view all the flashcards

Draw the ERD

Visual representation of entities, attributes, and relationships.

Signup and view all the flashcards

Relational Database Model

Organizes data into tables (relations).

Signup and view all the flashcards

Primary Key

Uniquely identifies each row in a database table.

Signup and view all the flashcards

Foreign Key

Connects tables by referencing a primary key in another table.

Signup and view all the flashcards

Constraints

Rules to ensure data is accurate and reliable.

Signup and view all the flashcards

Entity Relationship Diagram (ERD)

A visual representation of entities and their relationships.

Signup and view all the flashcards

Relational Schema

Transforms an ERD into a set of database tables.

Signup and view all the flashcards

Entity (in ERD)

Represents an object or concept in the database.

Signup and view all the flashcards

Composite Primary Key

A key formed by combining two or more attributes to uniquely identify records.

Signup and view all the flashcards

Insert Operation

Adding a new record into the table.

Signup and view all the flashcards

Delete Operation

Removing an existing record from the table.

Signup and view all the flashcards

Modify Operation

Updating or changing an existing record.

Signup and view all the flashcards

Insertion Anomaly

Occurs when you need to add extra, unrelated info just to add new data.

Signup and view all the flashcards

Deletion Anomaly

Occurs when deleting one record accidentally deletes other important info.

Signup and view all the flashcards

Modification Anomaly

Occurs when the same data needs to be updated in multiple places.

Signup and view all the flashcards

Insert

Adding new records to a database.

Signup and view all the flashcards

Delete

Removing outdated or unnecessary records.

Signup and view all the flashcards

Functional Dependency

A rule where a column's value uniquely determines another column’s value.

Signup and view all the flashcards

Trivial Dependencies

Dependencies that are obvious and unnecessary (A → A).

Signup and view all the flashcards

Augmented Dependencies

Dependencies where extra columns are added without adding value.

Signup and view all the flashcards

Equivalent Dependencies

Dependencies where one value determines another, and vice versa.

Signup and view all the flashcards

Normalization

Reduces redundancy and prevents update anomalies by structuring tables efficiently.

Signup and view all the flashcards

First Normal Form (1NF)

No multi-valued columns or duplicate rows.

Signup and view all the flashcards

Second Normal Form (2NF)

No partial dependencies on a composite key.

Signup and view all the flashcards

Third Normal Form (3NF)

No transitive dependencies (non-key columns shouldn't depend on other non-key columns).

Signup and view all the flashcards

Study Notes

  • These are all the study notes for the BUSI 2053 - Data & Information Management chapters 1-4 recap

Chapter 1: Introduction

  • Data are stored facts in various formats like text, numbers, and images
  • Information is data accessed for specific tasks, making it useful
  • Metadata describes the structure of data to make it usable, including names and types
  • A database is an organized collection of data designed for quick access
  • DBMS is software used to create, manage, and use databases
  • DBMS allows users to work directly with the database in a direct interaction
  • Users accessing databases through apps or interfaces is an indirect interaction

Steps to Build a Database

  • Plan: Identify the data needed and its intended use
  • Model: Design a blueprint for the database, using diagrams
  • Build: Use a DBMS to create the database
  • Add Features: Develop user-friendly interfaces like forms and menus
  • Deploy: Make the database available for use
  • Maintain: Handle security, backups, and updates

Database Roles

  • Analysts define the purpose of the database
  • Designers create the structure of the database
  • Developers build the database and its interfaces
  • DBAs maintain and secure the database
  • Users access and use the data for various tasks

Types of Databases

  • Operational databases support daily tasks and transactions
  • Analytical databases support decision-making by analyzing data

Chapter 2: Database Requirements & ER Diagrams

  • ER Modeling: a database design tool
  • Key Concepts are entities, attributes, relationships, and ER Diagrams (ERDs)
  • ERDs serve as a blueprint for database creation

Chapter 2 Breakdown

  • Entity-Relationship (ER) Modeling helps organize database requirements and design in a technique
  • ER diagrams (ERDs) serve as the blueprints for databases

Entities

  • Represented as rectangles
  • Entities are things like people, places, or objects
  • Attributes describe entities, for example: name and/or ID
  • Strong Entities: Can exist independently (e.g., Employee).
  • Weak Entities: Depend on a strong entity and cannot exist alone (e.g., OrderItem).

ERD Basics

ERDs

  • ERDs visually represent a database’s structure
  • They map entities (tables), attributes (columns), and relationships between entities

Core components of an ERD

  • Entities represented as rectangles denoting objects/things such as Customer, Order, and Product
  • Strong entities, such as employees, can exist independently
  • Weak entities, such as OrderItem, depend on strong entities and cannot exist alone
  • Attributes represented as ovals connected to entities, describing their properties, such as details
  • Relationships represented as diamonds between entities
  • Relationships show how entities are related such as: Customer Places Order, Employee Assigned To Project

Attributes

  • Simple: cannot divide (e.g., FirstName)
  • Composite: it can be broken into smaller parts (e.g., FullName → FirstName + LastName)
  • Derived: Calculated (e.g., Age derived from DateOfBirth)
  • Multi-Valued: Can have multiple values

Primary Key

  • Primary keys(PK) are attributes uniquely identifying each record in an entity
  • Primary keys are represented as underlined text

Special Cases

  • Weak entities depend on other entities for identification
  • Associative entities simplify complex relationships, especially many-to-many connections
  • Ternary relationships involve three entities

Relationships

  • Mandatory Many / One or Many / 1:M: An instance of Entity A must be related to at least one or more instances of the other entity
  • Optional Many / Zero or Many / 0:M: An instance of Entity A can be related to zeor , one or many isntances of teh otehr entity
  • Mandatory One / One and Only One / 1:1: An instance of Entity A must be related to exactly one instance of the other entity
  • Optional One / Zero or One / 0:1: An instance of Entity A can be related to zero or one instance of the other entity

ER Diagram Practices

  • Naming conventions should be clear
  • Diagrams should avoid over-complication,
  • Organization processes not database info., should not be the focus

Common Mistakes

  • Confusing entities with ER diagrams
  • Including unnecessary details

Design Process for ERD

  • Requirements must be understood by talking to stake holders to see what it needs to store
  • Entities are determined by figuring out the main objects
  • Define Relationships by determining how entities interact with each other
  • Attributes for each entity can be defined
  • Cardinality (1:1, 1:N, M:N) must be determined by defining the # of instances in each relationship
  • ERD must then be drawn using the symbols

Best Practices

  • The design must stay clear of over complex ERDs but grouping up logical similiar data instead
  • Naming should be consistent by descriptive names (e.g.,Customer_ID, not C_ID)
  • Redundancy is avoided if attributes are not duplicated
  • Stakeholder should then verify the diagram to see if it reflects what it shows
  • Sample Scenarios should be tested by real usage

Tools to Creating ERDs

  • ERDPlus for free
  • Lucidchart the most popular option for free
  • Paid Microsoft Visio

Common Mistakes

  • Not defining a primary key for every entity
  • Failing to identify proper relationships(misidentifying cardinality)
  • Ignoring derived attributes
  • Adding redundant entities or attributes

Chapter 3: Relational Database Modelling

  • Introduction to the relational database model to design databases by mapping real-world data and relationships into a logical framework. This ensures data intergrity.
  • Entity Relationship ER diagrams transaltion to relation schemas handle various attribute types
  • Database designs show how contraints and modeling techniques work together to creat efficient, consistent, and scalable databases.

10 Key Takeaways

  • Relational Databases organize data into tables
  • Specific rules qualify tables as relations
  • Primary keys make each row in a table unique
  • Composite primary keys use multiple columns to identify rows
  • ER Diagrams help the design of tables and its relationships
  • Foreign keys connect related tables
  • Different types of relationships are handles differently in tables
  • Constraints ensure data accuracy and consistency
  • Special attributes like multivalued and derived are handled separately
  • ER Diagram make easier understanding and communication for database designs

What is a relational database?

  • Structured tables are the organization for data

Relational Database components

  • Tables: entity representations
  • Rows: indivisula records
  • Columns: entity attributes

Rules for relations

Data in each column must follow a predefined format Each cell must have a single value. Column must have a unique name

Primary key

  • The definition of this is that primary key is a column or set of columns that identifies each table row
  • This makes sure there is no duplicate rows and a unique identifier is presented

Foreign Key

  • The definition of this is that foreign key is a column that one table that references the primary key in another table
  • It maintains referential intergrity ensure no orders can exists for non existant customers

Translating entities to tables

  • Break down into indivisual columns
  • Each entity becomes a table
  • Attributes of the entity becomes columns
  • Unique attributrs are mapped as primary keys

Relationships - Mapping

  • 1-M is the reuqirment for "many side"
  • M:N create foreign keys tables for both entities
  • 1:1 ensures keys are mapped as is to the tables

Data intergrity

  • Ensures no duplicates row
  • Enitity intergrity constraint must not have null vaules

Special attributes

  • Store multiple tables with foreign keys
  • Calculated application and not always in a database

Mapping Unary and Ternary Relationships

  • Ternary Relationships involve three entities, e.g., Doctors, Patients, and Appointments.
  • Create a table with foreign keys for three entities
  • Unar Relationships are the same entity, e.g., employees managing employees
  • Multiple tables with foreign keys

Cardinality

  • The relationship is one-to-many (1:N)
  • One side is the foreign key to the (DEVICE) through the EID table

How to deal with each type

  • One-to-One: add forigen keys w. the table merge or unique constriants
  • One-to-Many: add forigen key in the 'many' table
  • Many-to-Many: make a table with keys from both entities

Chapter 4: Update Operations, Update Anomalies, and Normalization

  • Updates are considered as insert, delete, modify for operations that keep a database running smoothly
  • Update: Existing Records are updated (changing a customer's)
  • Deletion: Remove outdated or unnecessary records
  • Insert: Add new records

Update Anomalies

  • Insertion Anomaly: Add new related extra info
  • Deletion Anomaly: Removing one record deleting other important info
  • Modification Anomaly: data has to be updated in multiple places ( error-prone)

Functional Depencies-The Rules of Data Relationships

  • A column's value uniquely determines another column's value
  • Avoiding pitfall ( A-A is an obivous statement) _ Equivalent ( One vaue determines another)

Power of Normalization

  • Reduces the amount of data and avoids anomalies by breakign down tables into efficient structures
  • 1 Normal Form (1NF): (no multi vaules multiple vaules in a single column)
  • 2 Second normal Form (2NF): no patial dependencies on a composite key
  • 3 Third Normal Form (3NF) non- key column should not depend on antoher non-key colum

First Normal Form Rules

Multi-valued columns or duplicate rows are not permissable but each feild contains only one vaules and every ow is unique

Second Normal Form Rules

For every column in the primary key is a composition that should depend the values of the key

Third Normal Form Rules

  • Is split into employee table, because of a non-key column that does not determine another non-key column

When do you NOT Normalization

  • When queries can get faster, simpilier reports
  • Balance is key! Normalize for Accuracy, Speed for denormalize

Normalization Perspective

  • To aovid and update anamolies, this should be descompse into INF A movies table that has MOvieID, AND MOvieName that also contains a move cast table

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Test your knowledge of database concepts, ER modeling, and DBMS functions. Explore relationships between entities and database characteristics.

More Like This

Database Mapping
39 questions

Database Mapping

WorkableAtlanta avatar
WorkableAtlanta
Database Design: ER Modeling Chapter 4
24 questions
ER Modeling
34 questions

ER Modeling

DignifiedSulfur7856 avatar
DignifiedSulfur7856
Use Quizgecko on...
Browser
Browser