Exam 1 Flashcards
Naming rules
Singular names are used for entities
Nouns are entity types, verbs are relationship types
Complex attributes
More than one residence with multiple parts of the address
What are important aspects of a model?
Only emphasizes selected aspects of the real world
Is described in some language
can be erroneous
may have features that do not exist in reality
Relationship
Defines a relationship set
Example: “WORKS_FOR” relationship
Degree of relationship is the number of participants
What may be a reason NOT to use a Database Management System?
- Need to support multiple users
- Need for persistent storage of data
- The overhead of providing security, concurrency control, recovery and integrity control
- Need for data independence
- The overhead of providing security, concurrency control, recovery and integrity control
Differences between databases and file processing
Each user maintains separate files and programs to manipulate those files
Describe the difference between schema and data
A schema describes the intention of the data. The data describes the extension. Data is information about reality.
What is atomicity? (in terms of DBMS transactions)
either everything in a transaction is executed or nothing is
What is a schema
A structure described in a formal language supported by the database management system (DBMS). The term “schema” refers to the organization of data as a blueprint of how the database is constructed
What is a naive end user?
querying and updating (posting withdrawals at a bank)
What are the workers behind the scenes?
They are not interested in the content of the database.
DBMS system designers and implementer.
Transaction
executing program that includes database access (reading or writing)
How to draw an attribute?
oval attached by straight line to entity
Ternary degree
Supplier, part, project
Program-operation independence
the user can operate on the data by using functions regardless of how the operations are implemented
What is controlling redundancy
Make sure data is not in more than one place.
DBMS interfaces
Menu based interface
Apps for mobile devices
Forms based interface
GUI
Natural language interfaces
Keyword-based database search
Speech input and output
Interfaces for parametric use
More advanced interfaces for the DBA (privileged commands)
What definition languages do SQL represent?
SQL represents DDL, VDL, and DML. SDL used to be part of it but was removed
Entity set / entity collection
All EMPLOYEE entities in the company
Entity type describes schema (intention) for a set of entities
Completeness (total) constraint (optional)
Every entity in a superclass must be a member of at least one subclass
Union Types
OWNER can be a COMPANY, a BANK, or a PERSON
It can be one of multiple entity types, but not more than one at once.
Only inherits one of the types, not all of them
Some models don’t have union sets
Total specialization
if every entity must be a member of a subclass
What is a casual end user of a database
occasionally use data but need help
NULL values
Doesn’t apply, for example: maiden name for a man or apartment number for a single family home
Both known and unknown nulls
Generalization
Generalizing several classes into a common super class Superclass is an IS-A relationship
How to draw key attribute
they have their names underlined
Program-data independence
In file processing, changes to the file require changes to the application programs. Databases have program-data independence.
Database system utilities
Loading: loading data files. Conversion tools to transfer from one DBMS to another
Backup: backup and restore
Database storage reorganization: for optimizing performance
Performance monitoring: database usage and gives stats
Recursive relationships
An employee can supervise another employee
In simplest terms, what is a database?
A model of reality
Key attributes
Key uniqueness constraint
“Name” can be unique key of COMPANY since no two companies can have the same name
PERSON can have a social security number
Some entities have more than one key
Association
Objects from several independent classes
IS-ASSOCIATED-WITH
Knowledge representation
accurately modeling a domain of knowledge by creating an ontology
Give examples of constraints:
emails must be unique
emails are not allowed to be null
birthdate must be after 1900
hometown must be a city in the US
View
a perspective of data or virtual data of the database
How to draw a partial key?
underlined with dotted line
What is a collection of related data?
A database
Total or partial category
Total category
Union of all entities in its superclass
Partial category
Subset of the union
Design choices for ER conceptual design
Relationships can start as entities, and then be elevated as the design evolves
The inverse is true too
How to draw weak attribute?
Double rectangle with entity in double diamonds
Binary degree
One employee to one department
Stored vs derived
attributes
Stored is storing the actual name
Derived is like calculating the age from the birth date
Two Types of DML?
High level DML (non-procedural) Like SQL Set at a time Called the query language End users typically use this
Low level (procedural)
Also called record-at-a-time dml
More like a programming language
Data Model
an abstract model that organizes elements of data and standardizes how they relate to one another and to properties of the real world entities.
Defining a database
specifying the data types, structures, constraints
Conceptual representation
no details about how data is stored
Name 3 data models we will use in this class
Entity-Relationship model
Relational Model
Hierarchical Model
What is physical data independence?
A measure of how much the internal schema can change without affecting the application programs.
The ability to change the schema at lower level (in ANSI/SPARC three level architecture) without affecting the schema at the next higher level is called data independence.
What is an entity?
A real world object or concept (employee or project)
Conceptual Schema?
Conceptual level describes the structure of the whole database for a group of users.
Conceptual schema is a representation of the entire content of the database.
These schema contains all the information to build relevant external records.
It hides the internal details of physical storage.
Logical data independence
Change conceptual schema without having to change external schema
View of data report isn’t changed by how the grade_report file is structured
What is the software process
Analysis, Specification, Design, Implementation
Data Abstraction
Hides lower level data structures to only see essential views.
3 Types of Schema?
External Schema: Use of data. As viewed by a user.
Conceptual Schema: Meaning of data
Internal Schema: Storage of data
External schema for user views.
Conceptual schema integrates external schemata.
Internal schema that defines physical storage structures.
Single vs multi-valued attributes
Single valued is age
Multi valued is like list of cities visited, names of siblings
Data model can be described using a class diagram using UML
Class: entity Operation (what an object can do) Domain: data type Association: relationship Link attribute: relationship attribute Class: entity Operation (what an object can do) Domain: data type Association: relationship Link attribute: relationship attribute
Database Protection
protecting against malfunction
Client Module
a program that runs on a pc or mobile device. Has a user friendly UI to access information stored in the database
Basic client/server architectures
Define specialized servers with specific functionality
For example, file server, print server, web, email servers
How does a system analyst use a database?
requirements of end users to develop specs for software
Data definition language (DDL):
Define both internal and conceptual schemas
Passed into a DDL compiler
Server Module
Handles data storage, search, etc
What does a database administrator do?
Responsible for authorizing database access, monitoring its use, and dealing with software and hardware
Deals with performance, security breaches, etc
Subtype
Employee can be general type, but they can be specialized into secretary, technician, manager, etc These are subclasses or subtypes of the employee Subclasses have specialized attributes that their parent class doesn’t have
Concurrency control
allows for multiple users to connect and update at the same time
For example, multiple airline agents booking seats at the same time. Called online transaction processing
Entity Relationship Diagram
Shows entities, attributes and attributes
Attributes are simple vs composite, single vs multi values, stored vs derived