jim killian\'s sql server 2008 portfolio

36
JIM KILLIAN [email protected] (818) 362-7546 Samples of coursework completed while participating in The Master's Program: SQL Server Training Track from SetFocus, LLC. Featuring: SSMS - SQL Server Management Studio 2008 SSIS - SQL Server Integration Services 2008 SSRS - SQL Server Reporting Services 2008 SQL Server 2008 Portfolio

Upload: jim-killian

Post on 17-May-2015

999 views

Category:

Technology


1 download

DESCRIPTION

Samples of coursework completed while participating in The Master\'s Program: SQL Server Training Track from SetFocus, LLC.

TRANSCRIPT

Page 1: Jim Killian\'s SQL Server 2008 Portfolio

JIM KILLIAN [email protected]

(818) 362-7546

Samples of coursework completed while participating in The Master's Program: SQL Server Training Track from SetFocus, LLC.

Featuring:

SSMS - SQL Server Management Studio 2008

SSIS - SQL Server Integration Services 2008

SSRS - SQL Server Reporting Services 2008

SQL Server 2008 Portfolio

Page 2: Jim Killian\'s SQL Server 2008 Portfolio

Table of Contents

Introduction 3

What is the SetFocus Master’s Program? 4

PiggyBank Project 5

Table/Relationship Diagram 6

AccountDeposit 7

AccountWithdraw 8

CustomerAccountUpdate 9

Views 10

DDL and DML Triggers 11

SSIS/SSRS Project 12

Import Ship Methods 13

Import Vendors 14

Import Products 15

Import POs Control Flow 16

Import PO Headers Data Flow 17

Import PO Details Data Flow 18

Update Price Control Flow 19

rptTopSales.rdl 20

rptSalesMatrixByYear.rdl 22

Report Manager Schedule 24

BlockFlix Project 25

Table/Relationship Diagram 26

Bulk Purchase Import XML File 27

XML Import SSIS 28

Online Queue 29

rptLostDamaged.rdl 30

rptCustomersByMembershipType.rdl 31

rptMostActiveCustomers.rdl 32

rptMostRentedMovies.rdl 33

rptInventoryListing.rdl 34

Proposals 35

2

Page 3: Jim Killian\'s SQL Server 2008 Portfolio

Introduction

This portfolio contains examples of my development skills in Microsoft SQL Server 2008. These are products of my work during the 9½-week hands-on experience in SetFocus' The Master's Program: SQL Server Training Track.

SetFocus utilizes the Microsoft Official Curriculum (MOC) customized with its own training materials. Below is a brief outline of the topics covered:

● RDBMS Concepts ● Writing Queries using MS SQL Server 2008 T-SQL ● Implementing a Microsoft SQL Server 2008 Database ● T-SQL Programming Project (PiggyBank) ● Advanced SQL Querying and Programming ● Microsoft SQL Server 2008 Integration Services (SSIS) ● Microsoft SQL Server 2008 Reporting Services (SSRS) ● SSIS/SSRS Project ● Final Team Project (BlockFlix)

In addition to the coursework and programming labs, the program included challenging real-world projects where I applied the skills developed in class.

3

Page 4: Jim Killian\'s SQL Server 2008 Portfolio

What is the SetFocus Master’s Program?

The SetFocus Master’s Program: SQL Server Training Track…

● …is an intensive, hands-on, project-oriented program that combines knowledge and valuable experience in putting the SQL skill set to use in a simulated work environment.

● …provides in-depth hands-on experience focused on T-SQL Development, SSIS Packages, and SSRS Reports and deployment.

● SetFocus projects are real-world simulated projects. Project specifications were provided and course of action determined with deliverables due within tight scheduling deadlines.

4

Page 5: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank Project

The goal of this project was to create a database for a fictitious bank utilizing stored procedures, functions, views, and DDL and DML triggers. It was stated in the specification that another team would be responsible for creating the user interface for working with our input requirements and the data we return. Some of the required functions of the database include:

● Creating and updating customer information. ● Creating and updating customer accounts. ● Adding a new customer to an existing account. ● Opening and closing accounts. ● Preventing account deletions (closing them instead). ● Performing transactions such as deposits, withdrawals and money transfers. ● Charging overdraft and other applicable fees to both Checking and Savings accounts. ● Applying interest rates to savings accounts. ● Obtaining account history for the current month or any specified month. ● Queries to search for customers by name, phone number, or account number. ● Implementing ATM procedures to display current balance and transactions.

I received 100% on this project.

5

Page 6: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – Table/Relationship Diagram

6

Page 7: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – AccountDeposit

After determining that the Account and other data passed as parameters are valid for a deposit, the CurrentBalance column is updated and a row is added to the Transactions table.

The new balance amount is returned to the calling statement via the @NewBalance output variable.

7

Page 8: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – AccountWithdraw

After verifying that the Account and other data passed as parameters are valid for a withdrawal, the need for an overdraft and what type is determined.

The new balance amount will be returned to the calling statement via the @NewBalance output parameter.

In the case of an overdraft, the procedure calls itself recursively to get the required funds, which are then deposited before completing the original transaction.

8

Page 9: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – CustomerAccountUpdate

This procedure is central to the project, as only a customer associated with an account has access to it.

The procedure verifies that the Customer, Account and other data passed as parameters are valid, and whether or not they are already associated with each other.

The number of customers associated with this account (@CustsAcct) and the number of accounts associated with this customer (@AcctsCust) are returned via the associated output parameters.

9

Page 10: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – Views

This view displays information for all of the accounts associated with each customer, enabling simpler querying.

This view returns the information required when a customer requests account history via an ATM.

10

Page 11: Jim Killian\'s SQL Server 2008 Portfolio

PiggyBank – DDL and DML Triggers

This DDL trigger prevents tables and views from being dropped (deleted) or altered (modified).

This DML trigger prevents rows from being deleted from the Account table.

11

Page 12: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS Project

The goal of this project was to take historical spreadsheet (CSV) data for a company's list of products, vendors, and purchase order history, and load the data into a SQL Server database. Some of the requirements include:

● The load process needs to work on a go-forward basis, so that new/modified products/vendors/orders can be loaded into the database as well.

● The load process for orders should validate that any incoming orders with product numbers or vendor numbers that do not match an existing product/vendor number should NOT be written to the SQL Server database. Instead, this data should be written to an exception file and emailed.

● Build two reports : rptTopSales.RDL – Top vendor and product sales rptSalesMatrixByYear.RDL – Sales by vendor and ship method across

years ● Schedule rptSalesMatrixByYear.RDL for a report snapshot and email

subscription I received 100% on this project.

12

Page 13: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import Ship Methods

The CSV file format was provided.

If the Shipper is not found in the database, a new row is inserted.

If the Shipper is found in the database, it is checked to see if any of the data has changed.

If the Shipper data has changed, the row is updated.

If the Shipper data has not changed, no action is taken.

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

13

Page 14: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import Vendors

The CSV file format was provided.

If the Vendor is not found in the database, a new row is inserted.

If the Vendor is found in the database, it is checked to see if any of the data has changed.

If the Vendor data has changed, the row is updated.

If the Vendor data has not changed, no action is taken.

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

14

Page 15: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import Products

The CSV file format was provided.

If the Product is not found in the database, a new row is inserted.

If the Product is found in the database, it is checked to see if any of the data has changed.

If the Product data has changed, the row is updated.

If the Product data has not changed, no action is taken.

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

15

Page 16: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import POs Control Flow

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

After each file is processed, any rows with bad products or vendors (if the associated variable is greater than zero) are emailed to the appropriate department for reconciliation.

16

The CSV file format was provided.

Any CSV files with appropriate names are processed in the ForEach Loop.

Page 17: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import PO Headers Data Flow

The CSV file format was provided.

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

If the vendor or product is not found in the database, the associated variable is incremented by one and the row is written to a CSV file.

The detail data is totaled for the header. If the PO doesn't exist in the database, it's created, otherwise it's updated.

17

Page 18: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Import PO Details Data Flow

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

The CSV file format was provided.

If the PO header or product is not found in the database, the row is written to a CSV file. This should never happen, as the POs were created and products validated in a previous step.

The TotalDue column is added and populated. If the detail row doesn't exist in the database, it's created, otherwise it's updated.

18

Page 19: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Update Price Control Flow

The work was being performed on a Virtual Server, so the connections were all via “localhost”.

This package does a bulk update of the list price of any product whose name contains a specified string.

The SQL Statement is an expression based on two variables, which are populated by the configuration file, which makes it possible to modify the update without having to open BIDS or SSMS.

The ListPrice of any row whose ProductName includes the string in @NameSearch is multiplied by the value in @PriceMultiplier.

These variables are populated by the configuration file.

19

Page 20: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – rptTopSales.rdl

The data for this report is from this stored procedure:

20

Page 21: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – rptTopSales.rdl

The dates and number of top vendors and products to display are specified in the parameter fields at the top, and are included in the page header information.

As shown here, ties are included via use of the DENSE_RANK aggregation.

21

Page 22: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – rptSalesMatrixByYear.rdl

The data for this report is from this query:

A matrix is used to provide the aggregated values for the sales per year for each product in the dataset.

22

Page 23: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – rptSalesMatrixByYear.rdl

The ship methods to include are selected in the parameter drop-down at the top and are displayed in the page header.

23

Page 24: Jim Killian\'s SQL Server 2008 Portfolio

SSIS/SSRS – Report Manager Schedule

This is the schedule used to create the report snapshot and run two linked reports. The results are emailed to the appropriate personnel.

24

Page 25: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix Project

As the final project of the course, BlockFlix (a new movie rental company) was designed to utilize almost all of the SQL skills we had developed. It was also our only team-based project, so we worked in teams of three in order to simulate a real-world environment, including many of the situations encountered when working as only one part of a development team. Some of the requirements include:

● There is a central database as well as remote databases for stores and kiosks which are updated via SSIS daily (no constant connection).

● A new website will be created to allow customers to rent movies online. This Web site requires all access to the database be via stored procedures.

● Bulk movie purchases will include an XML file with the data to be imported into the central database and distributed to the remote sites as appropriate.

● An online queue is required to allow the customer to specify the order in which movies are to be shipped. The queue must be updated when a disc is returned.

● Six membership packages were specified, which include the monthly fee and number of movies which can be loaned out at any time. There is no late fee.

● Store and kiosk locations rent movies for $1 per day, billed daily to a credit card. No membership or customer account is required, just a valid credit card.

● Stores can also sell movies and other merchandise. ● Customers are to be assessed a fee of $4.99 for each damaged or lost disc. ● Management requested four online reports be available to them in XLS and PDF formats. ● There is a request for proposals for a backup and maintenance plan, and future online

video streaming.

25

Page 26: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – Table/Relationship Diagram

26

Page 27: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – Bulk Purchase Import XML File

This is the sample XML file used in our presentation to demonstrate importing new movies into the system. My teammate chose parameters vs. elements for the XML style.

(The file was split into two columns to better fit the slide.)

27

Page 28: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – XML Import SSIS

28

Page 29: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – Online Queue

Starting with an empty queue, add 5 movies to get the resulting rows:

The movie at the top of the queue ships, to get the resulting rows:

Which sets the DateOut, AccountID, and Unavailable fields for the disc:

The customer can remove a movie from the queue, to get the resulting rows:

When the disc is returned, the DateOut, AccountID, and Unavailable fields for the disc are reset:

29

Page 30: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – rptLostDamaged.rdl

Spec: Lost / damaged movies and their related transactions.

30

Page 31: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – rptCustomersByMembershipType.rdl

Spec: List of customers in each membership type.

31

Page 32: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – rptMostActiveCustomers.rdl

Spec: Most active customers in the past month.

32

Page 33: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – rptMostRentedMovies.rdl

Spec: Most rented movies in the past month.

33

Page 34: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – rptInventoryListing.rdl

Spec: None, this was my idea.

34

Page 35: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – Proposals

Backup / Maintenance Plan ● Database backups and transaction log backups on a scheduled basis

o Database backups - once a week o Transaction log – Daily

● Run SSIS Packages – Daily ● Run SSRS – No reports are currently scheduled to run automatically, but this can be

modified as needed. Hardware ● Central Database

o Microsoft SQL Server 2008

● Stores o Microsoft SQL Server 2008 o Need VPN connection to sync data

● Kiosks o Video/Rental Machine o Need VPN connection to sync data

35

Page 36: Jim Killian\'s SQL Server 2008 Portfolio

BlockFlix – Proposals (continued)

Online Video Streaming ● All DVD rental memberships (possibly above a minimum cost/month) should include

access to streaming video

● A separate membership type for “streaming only” should be implemented

● Movies should be added to the list of “available streaming” in order of rental popularity or member requests

● A separate queue for streaming should be implemented, keyed by CustomerID

● All online activities (searching, queue building, “suggested viewing”, etc.) should be by CustomerID, not AccountID

● Investigate inclusion on non-PC devices such as game consoles (PS3), set-top boxes (Roku), cell phones, DVD players, and TVs

● Be aware of frustrations encountered by users on other services and work to avoid them (e.g., episode/season sorting problems within a series)

36