Intro To Data Science Prelims Reviewer
Intro To Data Science Prelims Reviewer
Why is it sexy?
● Gartner’s 2014 Hype Cycle
Data Scientists
● Data Scientist
○ The Sexiest Job of the 21st Century
● They find stories, extract knowledge. They are not reporters
● Data scientists are the key to realizing the opportunities presented by big data. They
bring structure to it, find compelling patterns in it, and advise executives on the
implications for products, processes, and decisions
LESSON 2
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: 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 can be very large.
● Databases touch all aspects of our lives
Levels of Abstraction
● Physical level: describes how a record (e.g., instructor) is stored.
● Logical level: describes data stored in a database, and the relationships among the
data.
type instructor = record
ID : string;
name : string;
dept_name : string;
salary : integer;
end;
● View level: application programs hide details of data types. Views can also hide
information (such as an employee’s salary) for security purposes.
View of Data
Data Models
● A collection of tools for describing
○ Data
○ Data relationships
○ Data semantics
○ Data constraints
● Relational model
● Entity-Relationship data model (mainly for database design)
● Object-based data models (Object-oriented and Object-relational)
● Semistructured data model (XML)
● Other older models:
○ Network model
○ Hierarchical model
Relational Model
● All the data is stored in various tables.
● Example of tabular data in the relational model
Example:
create table instructor (
ID char(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
SQL
● The most widely used commercial language
● SQL is NOT a Turing machine equivalent language
● SQL is NOT a Turing machine equivalent language
● To be able to compute complex functions SQL is usually embedded in some higher-level
language
● Application programs generally access databases through one of
○ Language extensions to allow embedded SQL
○ Application program interface (e.g., ODBC/JDBC) which allow SQL queries to be
sent to a database
Database Design
The process of designing the general structure of the database:
● Logical Design – Deciding on the database schema. Database design requires that we
find a “good” collection of relation schemas.
○ Business decision – What attributes should we record in the database?
○ Computer Science decision – What relation schemas should we have and how
should the attributes be distributed among the various relation schemas?
● Physical Design – Deciding on the physical layout of the database
Design Approaches
● Need to come up with a methodology to ensure that each of the relations in the
database is “good”
● Two ways of doing so:
○ Entity Relationship Model (Chapter 7)
■ Models an enterprise as a collection of entities and relationships
■ Represented diagrammatically by an entity-relationship diagram:
○ Normalization Theory (Chapter 8)
■ Formalize what designs are bad, and test for them
Database Engine
● Storage manager
● Query processing
● Transaction manager
Storage Management
● Storage manager is a program module that provides the interface between the low-level
data stored in the database and the application programs and queries submitted to the
system.
● The storage manager is responsible to the following tasks:
○ Interaction with the OS file manager
○ Efficient storing, retrieving and updating of data
● Issues:
○ Storage access
○ File organization
○ Indexing and hashing
Query Processing
1. Parsing and translation
2. Optimization
3. Evaluation
Transaction Management
● What if the system fails?
● What if more than one user is concurrently updating the same data?
● A transaction is a collection of operations that performs a single logical function in a
database application
● Transaction-management component ensures that the database remains in a
consistent (correct) state despite system failures (e.g., power failures and operating
system crashes) and transaction failures.
● Concurrency-control manager controls the interaction among the concurrent
transactions, to ensure the consistency of the database.
Database Users and Administrators
Database Architecture
The architecture of a database systems is greatly influenced by the underlying computer system
on which the database is running:
● Centralized
● Client-server
● Parallel (multi-processor)
● Distributed