sql ppt portfolio

63
.SQL Portfolio Name: Stephen Slaven Email : [email protected] Phone: (407)-287-9984 Cell Phone: (856)-340- 2766 2/19/2009 1

Upload: stephen-slaven

Post on 29-Jun-2015

964 views

Category:

Technology


1 download

DESCRIPTION

SQL Server Projects

TRANSCRIPT

Page 1: Sql Ppt Portfolio

.SQL Portfolio

Name: Stephen SlavenEmail : [email protected]: (407)-287-9984Cell Phone: (856)-340-2766

2/19/2009 1

Page 2: Sql Ppt Portfolio

Table of Contents

• Library Client Application• PiggyBank Project• Library Report Project• BlockFlix Movie Project

2/19/2009 [email protected]

Page 3: Sql Ppt Portfolio

Library Client application

Library Database • Return member info from Member and Adult table• Display available books• Search member info using member number • Use UNION, list all member reserve the specific book• Use CASE, list all member reserve the specific book• Create temporary table• Display members have past due loan use temporary table• Display members who pay highest fine• List of member who want to reserve the specific book

2/19/2009 [email protected]

Page 4: Sql Ppt Portfolio

Library Diagram

2/19/2009 4

Page 5: Sql Ppt Portfolio

Display available books

2/19/2009 5

Page 6: Sql Ppt Portfolio

Use UNION

2/19/2009 6

Page 7: Sql Ppt Portfolio

Display member pay highest fine

2/19/2009 7

Page 8: Sql Ppt Portfolio

Library Stored Procedure

• Add • Add • Check• Check• Add• Convert• Renew• Update

2/19/2009 8

Page 9: Sql Ppt Portfolio

ADD ADULT Stored procedure

2/19/2009 9

Page 10: Sql Ppt Portfolio

CHECK OUT ITEM Stored Procedure

2/19/2009 10

Page 11: Sql Ppt Portfolio

WORKING TEST SCRIPT

2/19/2009 11

Page 12: Sql Ppt Portfolio

Create PiggyBank Database

2/19/2009 12

Page 13: Sql Ppt Portfolio

• DDL - Prevent Drops/Alters to Tables & Views• DML – Prevent Deletes on Adult Table

2/19/2009 13

PiggyBank Triggers

Page 14: Sql Ppt Portfolio

DDL Trigger

2/19/2009 14

Page 15: Sql Ppt Portfolio

2/19/2009 15

DML Trigger

Page 16: Sql Ppt Portfolio

• Add Account• Add Customer• Deposits• Check Balance• Transactions• Update Interest Rates• Search by Customer• Withdrawals2/19/2009 16

PiggyBank Stored Procedure

Page 17: Sql Ppt Portfolio

Add Account Stored Procedure

2/19/2009 17

Page 18: Sql Ppt Portfolio

2/19/2009 18

Add Customer Stored Procedure

Page 19: Sql Ppt Portfolio

2/19/2009 19

Deposits Stored Procedure

Page 20: Sql Ppt Portfolio

2/19/2009 20

Get Balance Stored Procedure

Page 21: Sql Ppt Portfolio

2/19/2009 21

Transactions Stored Procedure

Page 22: Sql Ppt Portfolio

2/19/2009 22

Update Interest Rates Stored Procedure

Page 23: Sql Ppt Portfolio

2/19/2009 23

Search by Customer Name

Page 24: Sql Ppt Portfolio

2/19/2009 24

Withdrawals Stored Procedure

Page 25: Sql Ppt Portfolio

• Complete List of Books• Most Active Members for a month• Kids Reading Club• Current Fines Report• Total Fines by Member

2/19/2009 25

Reports for Library Project

Page 26: Sql Ppt Portfolio

2/19/2009 26

Complete List of Books

Page 27: Sql Ppt Portfolio

2/19/2009 27

Most Active Members for Month

Page 28: Sql Ppt Portfolio

2/19/2009 28

Kids Reading Club Report

Page 29: Sql Ppt Portfolio

2/19/2009 29

Current Fines Report

Page 30: Sql Ppt Portfolio

2/19/2009 30

Total Fines by Member

Page 31: Sql Ppt Portfolio

2/19/2009 31

BlockFlix Project

Page 32: Sql Ppt Portfolio

2/19/2009 32

BlockFlix ERD Diagram

Page 33: Sql Ppt Portfolio

2/19/2009 33

High Availability Corporate headquarters:• Principal server in Omaha, NE• Mirror server in Kansas City, KS• Witness server in Helena, MT

Regional Servers:

Western United States:• Principal Server - Flagstaff, AZ• Mirror Server - Las Vegas, NV• Witness Server - San Antonio, TX

Eastern United States:• Principal Server – Atlanta, GA• Mirror Server – Memphis, TN• Witness Server – Indianapolis, IN

Page 34: Sql Ppt Portfolio

• Corporate Will have a (32-bit) requirement:

1. Server: Windows Small Business Server 2003 Premium Edition SP1

2. There will be 3 servers: 1 Production, 1 Backup, and 1 Witness

3. SQL Server 2005 Enterprise Edition4. Pentium III – compatible processor with 1 GHz processor

speed5. Memory – 2 GB6. Disk Space: 400 GB for Production and Backup and 100 GB

for Witness

2/19/2009 34

Hardware Considerations

Page 35: Sql Ppt Portfolio

• Regional Stores Will have a (32-bit) requirement:

1. Server: Windows Small Business Server 2003 Premium Edition SP1

2. There will be 3 servers: 1 Production, 1 Backup, and 1 Witness

3. SQL Server 2005 Standard Edition4. Pentium III – compatible processor with 1 GHz processor

speed5. Memory – 1 GB6. Disk Space: 200 GB for Production and Backup and 100 GB

for Witness

2/19/2009 35

Hardware Considerations (cont.)

Page 36: Sql Ppt Portfolio

• Regular Stores Will have a (32-bit) requirement: 1. Server: Windows Small Business Server 2003 Premium Edition SP1 2. SQL Server 2005 Standard Edition 3. Pentium III – compatible processor with 1 GHz processor speed 4. Memory – 1 GB 5. Disk Space: 200 GB

2/19/2009 36

Hardware Considerations (cont.)

Page 37: Sql Ppt Portfolio

BlockFlix will be using Redgate’s SQL Backup 3rd party software. SQL Backup will provide the following benefits:1. Compression of backup files up to 90% - saving on backup

space2. Using 256-bit AES encryption will create secure backup

NOTE: We will use this software, until SQL Server 2008 is implemented. When SQL Server will have its own backup encryption. We will at that time evaluate both and determine which is a better backup solution.

Retention of the daily tapes will be Monthly. Retention of the Monthly tapes will be 7 years. Retention of Yearly backup will be indefinite.

2/19/2009 37

Backup Strategy

Page 38: Sql Ppt Portfolio

2/19/2009 38

Maintenance Plan

Task Time Daily/Weekly

Backup DB Differential Every hour Daily

Check Database Integrity 22:00 Daily

Shrink Database 22:30 Daily

Reorganize Indexes 23:00 Daily

Rebuild Indexes 0:00 Weekly – Sunday

Update Statistics 1:00 Weekly - Sunday

Cleanup History 2:00 Weekly - Sunday

Backup BlockFlix and system DBs

3:00 Weekly - Sunday

Backup Transaction Log 5:00 Daily

Maintenance Cleanup 6:00 Weekly - Sunday

Page 39: Sql Ppt Portfolio

2/19/2009 39

Daily Maintenance Plan Diagram

Page 40: Sql Ppt Portfolio

2/19/2009 40

Weekly Maintenance Plan Diagram

Page 41: Sql Ppt Portfolio

2/19/2009 41

Maintenance Plan Email

Page 42: Sql Ppt Portfolio

BlockFlix will need to address the retention of the data long term. We will have backups, but we need the data to be available at all times.

1. We will partition the following tables:A. InventoryB. TransactionsC. CustomerD. MovieE. Rental

2. We will strip off data from the tables that are over 1 year old and send the data to the backup server.

2/19/2009 42

Archival Plan

Page 43: Sql Ppt Portfolio

2/19/2009 43

• Usp_AddStore Results

Stored Procedures

Page 44: Sql Ppt Portfolio

• usp_CheckedOutMovies Results

2/19/2009 44

Stored Procedures (cont.)

Page 45: Sql Ppt Portfolio

• usp_InactiveAccounts Results

2/19/2009 45

Stored Procedures (cont)

Page 46: Sql Ppt Portfolio

• usp_LostDamaged Results

2/19/2009 46

Stored Procedures (cont.)

Page 47: Sql Ppt Portfolio

• usp_Payments Results

2/19/2009 47

Stored Procedures (cont.)

Page 48: Sql Ppt Portfolio

2/19/2009 48

Function – ufn_GetLastDayOfMonth

Page 49: Sql Ppt Portfolio

• Add triggers to prevent inserts, deletes, or updates to tables:

Inventory Movie Rental Store Transactions Talent

• Prevent alters or drops on BlockFlix tables and views

2/19/2009 49

Triggers

Page 50: Sql Ppt Portfolio

• Prevent Store Insert Prevent Store Update

2/19/2009 50

Triggers (cont.)

Page 51: Sql Ppt Portfolio

• Prevent Inventory Delete Prevent Movie Delete

2/19/2009 51

Triggers (cont.)

Page 52: Sql Ppt Portfolio

BlockFlix purchases movies in bulk through the corporate headquarters and distributes them to the stores.  The package of movies includes an XML File that contains a list of movies.  The XML file will be run by the store to update the following their inventory tables:

-          Movie-          MovieTalent-          Inventory A separate feed from corporate will have already loaded tables:-          Talent Type (actors, directors and producers)-          Talent-          RatingType  (G, PG, PG-13, R, NC-17)-          Genre (Action, Drama, Chick Flick, Horror, etc)-          Store

2/19/2009 52

XML

Page 53: Sql Ppt Portfolio

2/19/2009 53

Demo of XML File

Page 54: Sql Ppt Portfolio

2/19/2009 54

Movie Checkout

Page 55: Sql Ppt Portfolio

2/19/2009 55

Reports

Page 56: Sql Ppt Portfolio

2/19/2009 56

Reports (cont.)

Page 57: Sql Ppt Portfolio

2/19/2009 57

Reports (cont.)

Page 58: Sql Ppt Portfolio

2/19/2009 58

Reports (cont.)

Page 59: Sql Ppt Portfolio

Logins will be assigned using Windows and SQL Server authentication

Roles will be assigned according to user groups specific to their job tasks

Permissions will be set according to their user groups Corporate leaders and store managers will have access to all

servers Employees within corporate such as marketing representatives

will have access only to stored procedures with the necessary privileges to the tables needed to run their reports

Store level employees will be denied changes to the tables and only granted select permissions on tables where necessary to run the stored procedures

2/19/2009 59

Users/Logins/Permissions

Page 60: Sql Ppt Portfolio

through Stored Procedures Prevent SQL Injection attacks Grant most granular permission schema Microsoft Baseline Security Analyzer SQL Server Profiler Maintain Updated Hotfixes or Service Packs

2/19/2009 60

Application Security

Page 61: Sql Ppt Portfolio

2/19/2009 61

Certificates/Encryption

Page 62: Sql Ppt Portfolio

2/19/2009 62

Certificates/Encryption(cont.)

Page 63: Sql Ppt Portfolio

2/19/2009 63

Video Streaming