Professional Documents
Culture Documents
andrej.tunevic@vgtu.lt
Database roles,
database
modeling 2023
Introduction
• Purpose of Database Systems
• Database Languages
• Relational Databases
• Database Design
• Data Models
• Database Internals
• Database Users and Administrators
• Overall Structure
• History of Database Systems
Database roles, database modeling
Database Management
System (DBMS)
• DBMS contains information about a particular enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
• Database Applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Online retailers: order tracking, customized recommendations
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
• Databases touch all aspects of our lives
Attributes
Example of tabular data in the relational model
Old Modern
Database roles, database modeling
Database Management System
Internals
• Storage management
• Query processing
• Transaction processing
Users are differentiated by the way they expect to interact with the
system:
• Application programmers – interact with system through DML
calls
• Sophisticated users – form requests in a database query
language
• Specialized users – write specialized database applications that
do not fit into the traditional data processing framework
• Naitive users – invoke one of the permanent application programs
that have been written previously
• Examples, people accessing database over the web, bank tellers, clerical
staff
Database Administrator
• Coordinates all the activities of the database system
• has a good understanding of the enterprise’s information resources and
needs.
• Database administrator's duties include:
• Storage structure and access method definition
• Schema and physical organization modification
• Granting users authority to access the database
• Backing up data
• Monitoring performance and responding to changes
• Database tuning
Database Architecture
1. Identify entities
3. Specify relationships
Data Entities
Entity
A "thing" about which you want to store data in
an application
Multiple examples (instances) of the entity
must exist
Goal:
Store data about each entity in a separate table
Do not store duplicate data in multiple tables or
records
Examples: CUSTOMER, PRODUCT
Data Model Naming
Conventions
• Entity names are short, descriptive, compound
word singular nouns
- UWEC_STUDENT, CANDY_PRODUCT,
- Entity names will ultimately correspond to table names
- Why singular?
• Makes more sense when you start talking about
relationships
Data Entity Instances
• Entity instance
- A specific occurrence (data value) of an entity
- An entity must have multiple entity instances
or it is not really an entity!
- Examples: Davey Jones, Celestial Cashew
Crunch
ER Model Attributes
• Attribute
- A characteristic (data field) of an entity that
you want to store in the database
Examples: CUST_ID, PROD_DESC
• Attribute value
- The value of a particular attribute for a
particular entity instance
- Examples: 42, "Nuts Not Nachos"
Data Model Naming
Conventions (continued)
• Attribute names are descriptive compound
words that correspond to the entity name
- Attribute names will ultimately correspond to
field names
- Every attribute name within the database
should be unique
ER Model Notation
Entity UniversityStudent
StudentName
Attributes StudentDOB
StudentAge
Specific DBMS Naming Conventions
• Primary key
• Atomic
• Composite
• Multi-valued
• Derived
Primary Key Attributes
Student
Student_ID Student_Address_Line_1
Student_Name Student_Address_Line_2
Student_Address Student_City
Student_DOB Student_State
Student_Class Student_Country
Student_Postal_Code
Multi-Valued Attributes
Student Employee
Student_ID (PK) Employee_ID (PK)
Student_First_Name Employee_First_Name
Student_Last_Name Employee_Last_Name
Student_Address Employee_Address
Student_DOB Employee_DOB
Student_Class Employee_Dependent1
Student_Phone1 Employee_Dependent2
Student_Phone2
Handling Multi-valued Attributes
1. Identify entities
3. Specify relationships
Data Model Relationships
Store
Store_ID
Store_Name
Store_Address
Rents
Video
Video_ID
Video_Title
Video_Format
Example 1:1 Relationship
Spouse
Spouse_ID
Spouse_Name
Has
Customer
Customer_ID
Customer_Name
Customer_Address
Example M:M Relationship
Video
Video_ID
Video_Title
Rents
Customer
Customer_ID
Customer_Name
Customer_Address
Example ER Model
UniversityInstructor ServiceProject
PK InstructorID PK ProjectID
InstructorLastName ProjectDescription
InstructorFirstName ProjectStartDate
InstructorOffice
Advises
Completes
UniversityStudent UniversityCourse
PK StudentID PK CourseID
EnrollsIn
StudentLastName CourseName
StudentFirstName CourseTitle
StudentMI
StudentDOB
Summary:
The Data Modeling Process
Define entities
Define attributes
Define relationships
• Identify relationship cardinality (1:1, 1:M, M:M)
Tasks
Needed for:
Building activity model diagram
Thanks