databasics a primer on data structures. what is data? everything. everything is a datum. seriously....

20
DATABASIC S A PRIMER ON DATA STRUCTURES

Upload: rodger-edwards

Post on 11-Jan-2016

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

DATABASIC

SA P

RIM

E R O

N D

ATA ST R

UC

TUR

E S

Page 2: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

WHAT IS DATA?

Everything.

Everything is a datum.

Seriously. Pretty much by definition*.

But some data are better than other data. And, crucially, how you choose to record your data dramatically affects its usability.

*Irrelevant aside:Physicist John Wheeler argues that the boolean bit, the basic quantum of information, is also the smallest possible unit of the physical universe.

Page 3: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

ALSO DATA

Page 4: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

WAYS TO STORE DATA

Sticky notes

Pictures

Static web pages

PDFs

Documents

Spreadsheets

Databases

Simplicity

Power

Page 5: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

ALTERNATIVE DATA STORAGE

Page 6: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

ADVANTAGES OF A DATABASE

Strongly-typed data

Automated validation and constraints

Simultaneous shared access

Centralization of data

Security

Performance

Reliability

Page 7: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

DISADVANTAGES OF A DATABASE

Requires architectural consideration

Requires user management

Requires user interfaces for data input and retrieval (which may or may not be provided by the DBMS selected; prosumer databases like MS Access and FileMaker Pro generally have very usable templates.)

Page 8: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

DATABASES IN USE AT EDGEWOOD

Jenzabar EX

PowerFAIDS (SQL and MS Access)

WWW & My.Edgewood websites

Education Department (FileMaker)

ITSO Inventory

Printer/Copier Management

… and many, many more.

Page 9: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

SCHEMATIC

SA B

A S I C O

V E RV I EW

OF D

ATABA S E

OB

J EC

T S

Page 10: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

TABLES: LISTS OF LISTS

Each row represents one data transaction

Columns store data points relevant to that transaction

Can be infinitely large (depending on platform), but performance suffers eventually

Page 11: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

AFTER THAT SLIDE, SOME CUTE PUPPIES….

Page 12: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

KEYS

The most important fields in a table; usually included by default in any index

A “primary key” is a key which holds only the data fields that must be used to uniquely identify a single record:Sequence numbers (incrementing integers)Globally Unique IDentifierSUnique combinations of data across several fields

Page 13: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

RELATIONAL DATA

How data from one table is associated with data in another table.

Joined via “relationships” recorded as “foreign keys” in the child table.

The hardest and most important part of database design.

Page 14: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

QUERIES

The mechanism by which everything happens – Create, Read, Update, and Delete.

Structured Query Language allows direct communication with a database engine over an established database connection (generally via an Open DataBase Connectivity object).

INSERT INTO STAGE_HISTORY_TRAN(ID_NUM, HIST_STAGE, TRANSACTION_SEQ,

YR_CDE, TRM_CDE, PROG_CDE, DIV_CDE,LOCA_CDE, DEPT_CDE, HIST_STAGE_DTE, ADD_TO_COUNT_DUP, USER_NAME, JOB_NAME,

JOB_TIME)SELECT TOP 1 ID_NUM, dbo.[CUS_ReturnAcceptedStageCode](HIST_STAGE),

TRANSACTION_SEQ + 1, YR_CDE, TRM_CDE, PROG_CDE, DIV_CDE,

LOCA_CDE, DEPT_CDE, @DTE, 'Y', 'sa', 'AcceptCand', GETDATE()FROM STAGE_HISTORY_TRANWHERE ID_NUM = @ID_NUM ORDER BY TRANSACTION_SEQ desc, HIST_STAGE_DTE desc;

Page 15: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

WE MIGHT NEED TO HUG A PUPPY NOW.

Page 16: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

STORED PROCEDURES/FUNCTIONS

Scripts written in Transactional SQL that can perform updates, execute programs (like automatic emails), and/or calculate data.

Often used to process data in large batches.

Functions like GetCurrentTerms() or CalcNextPayDate() can simplify business logic.

Can be assigned to run on a regular schedule or triggered by data changes.

Page 17: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

ANALYTI

CS

GE TT I N

G Y

OU

R D

ATA BAC

K OU

T

Page 18: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

STRUCTURED QUERY LANGUAGE

SQL is the most widely accepted scripting language used to communicate with modern databases, although there are several variants and exceptions.

Almost all tools that allow you to drag and drop tables and select fields using a visual editor are actually writing SQL code for you behind the scenes.

SQL is easier than it looks; there are only a handful of objects and operators (nouns and verbs), meaning that it is relatively simple to read and write.

Want to learn SQL for free? It’s more fun than a fair number of things which are not fun. Start here: http://www.w3schools.com/SQL/

Page 19: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

STILL INTERESTED?

Ask us about our fabulous Infomaker and Reporting Tools Overview Presentation!

Disclaimer: No puppies included

Page 20: DATABASICS A PRIMER ON DATA STRUCTURES. WHAT IS DATA? Everything. Everything is a datum. Seriously. Pretty much by definition*. But some data are better

QUESTIONS?

Get these slides – and special bonus material – here:http://tinyurl.com/73qq59q

Want more? Nostalgic for this presentation already?