You are on page 1of 51

ITD 256

Database Concepts

Lecture 01

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Introduction
Name / Nickname
Academic Plans / Major

Professional Goals / Career


Databases Experience

Introduction
Career Advice
Sooner than later
Career not a job
Current & future high demand
Compensation
Job Security

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Syllabus
Refer to the Syllabus Handout

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Blackboard

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

MySQL Overview
http://dev.mysql.com/downloads/
MySQL Installer
MySQL Workbench
Installation instructions posted on BlackBoard

MySQL Overview

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

List Problem
Data
Raw and unorganized facts

Information
Processed and organized facts

Database (non-technical term)


System to store data and provide information

Personal Databases
Keep track of information
Text/CSV files, Excel, MS Access

Enterprise Databases
Integral part of Information Systems
SQL Server, mySQL, Oracle, Teradata, DB2, etc.

List Problem
Student List in a Spreadsheet

Common operations?

List Problem
Add Advisor Data

Delete Data
Change Data
Insert Data

List Problem
Modification Problem

Cause of problem?

List Problem
Student with Residence List

Why no modification problem?

List Problem
List problems identified in the late 1960s
INSERT causes NULL values
DELETE removes too much information
UPDATE causes Data Anomalies when all
redundant data changes are not made correctly

Relational Model
Single themed related tables
Databases provide data independence over
file processing models like excel, text, etc.

List Problem

So what is the solution?

List Problem

Identify the themes


Identify columns of each table
Identify rows data of each table
Identify Parent & Child tables

List Problem

Create & populate single themed tables


Identify unique identifiers in each table

List Problem

Which table gets the LINK and WHY?

Place Parents nonrepeating link in Child table


Tables linked on AdviserLastName

List Problem

Is AdvisorLastName the best choice?

List Problem
Unique ID
Unique ID columns ensure unique identifying
number
Unique ID columns added to link related tables
Linking column is always placed in child table

List Problem
Modification problem solved
No UPDATE issues
No INSERT issues
No DELETE issues

List Problem
Another example with 3 themes

List Problem
Which table(s) get the linking fields and why?

List Problem

How many students are advised by Shawnas Dept?

List Problem
Difficulties in processing tables
Managing tables
Jumping from table to table

Structured Query Language (SQL)


Developed in the 1980s
Universal Database sublanguage
Used for all Data Definitions & Manipulations

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Exercise
_________ is/are organized and processed facts.
_________ is/are raw, unorganized, and unprocessed facts.
Databases provide _________ over file processing models.
_________ modification problem removes too much
information.
_________ occurs when all redundant data updates are not
made correctly

_________ modification problem causes NULL values.

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Whats Next?
Locate Labs at Annandale Campus
Open Labs in CT Building
ITD256 Lab in Class

Locate Labs in Loudoun Waddell Building


Open Lab in LW230

Whats Next?
Purchase textbook
Optional but recommended

Download & Install MySQL


Installer
Workbench

HW 1

1. Figure above shows a list that is used by a veterinary office. Give examples of three
modification problems that are likely to occur when using this list. (3pts)
2. Break the list in figure above into two tables, each with data for a single theme. Assume
that owners have a unique OwnerEmail and pets have unique PetName column. Indicate the
unique identifiers and linking column. (5pts)
3. Describe how the tables you created in Q2 solves the problems you identified in Q1. (3pts)
4. Why is it a bad idea to assume PetName as a unique identifier? (2pts)
5. What is the difference between data and information? (2pts)
6. How is relational model better than traditional file processing? (2pts)
7. Describe in your own words how relationships between single themed tables are
represented in a relational database. (2pts)
8. Define the term database. (2pts)
9. What is a DBMS? (2pts)
10. Define the term Data Anomaly and give an example. (2pts)

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Agenda

Introduction
Database Management
Syllabus
Blackboard Use
MySQL Overview
List Problem
Class Exercise
Whats Next?
Project Phase 1 Signup
Quiz

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

MngrID
2
2
1
2
1

Identify the themes in list


Break the themes into respective tables
Determine unique identifiers in each table
Determine PARENT and CHILD tables
Place Parent's identifier as link in Child table
Draw & Populate the two tables showing all data

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

Identify the themes in list


EMPLOYEE
MANAGER

Break the themes into respective tables


Determine unique identifiers in each table
Determine PARENT and CHILD tables
Place Parent's identifier as link in Child table
Draw & Populate the two tables showing all data

MngrID
2
2
1
2
1

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

Break the themes into respective tables


EMPLOYEE (EmpID, EmpFirst, EmpLast)
MANAGER (MngrFirst, MngrLast, MngrID)

Determine unique identifiers in each table


Determine PARENT and CHILD tables
Place Parent's identifier as link in Child table
Draw & Populate the two tables showing all data

MngrID
2
2
1
2
1

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

Determine unique identifiers in each table


EMPLOYEE (EmpID, EmpFirst, EmpLast)
MANAGER (MngrFirst, MngrLast, MngrID)
Determine PARENT and CHILD tables
Place Parent's identifier as link in Child table
Draw & Populate the two tables showing all data

MngrID
2
2
1
2
1

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

Place Parent's identifier as link in Child table


EMPLOYEE (EmpID, EmpFirst, EmpLast, MngrID)
MANAGER (MngrFirst, MngrLast, MngrID)

Draw & Populate the two tables showing all data

MngrID
2
2
1
2
1

Quiz Exercise
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrFirst
James
James
Albert
James
Albert

MngrLast
Knight
Knight
Hudson
Knight
Hudson

MngrID
2
2
1
2
1

EMPLOYEE (EmpID, EmpFirst, EmpLast, MngrID)


MANAGER (MngrFirst, MngrLast, MngrID)
EmpID
22
11
44
55
33

EmpFirst
Robert
Kevin
Alec
John
Rodney

EmpLast
Smith
Brown
Stewart
Charles
Marsh

MngrID
2
2
1
2
1
MngrFirst

MngrLast

MngrID

James

Knight

Albert

Hudson