lanky Girl

3.7 Databases

In DITA on December 30, 2009 at 9:19 pm

This week in DITA we have been learning about Databases and the DBMS. The DBMS is used to access structured data efficiently. Previously access to data tended to be quite slow as data was stored on separate files on magnetic strips. There was inconsistency in the formats that each file was stored in and because there was program/data independence any small changes in the data meant the programs had to change.

DBMS

The introduction of DBMS into companies allowed information to be centralised and easier to share and access amongst departments. Using a DBMS meant that the data was more secure as access was controlled to database administrator.

Relational model

The Relational Model of data is The purpose of the relational model is to provide a declarative method for specifying data and queries: we directly state what information the database contains and what information we want from it, and let the database management system software take care of describing data structures for storing the data and retrieval procedures for getting queries answered. (C0dd, 1970)

Below is a worked example:

Sample Table: empinfo
first last id age city state
John Jones 99980 45 Payson Arizona
Mary Jones 99982 25 Payson Arizona
Eric Edwards 88232 32 San Diego California
Mary Ann Edwards 88233 32 Phoenix Arizona
Ginger Howell 98002 42 Cottonwood Arizona
Sebastian Smith 92001 23 Gila Bend Arizona
Gus Gray 22322 35 Bagdad Arizona
Mary Ann May 32326 52 Tucson Arizona
Erica Williams 32327 60 Show Low Arizona
Leroy Brown 32380 22 Pinetop Arizona
Elroy Cleaver 32382 22 Globe Arizona

(http://sqlcourse.com/select.html)

Display all columns for people under 25.

Query

SELECT  * from empinfo

WHERE  age >25

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: