SQL Server 2008R2       Lezlee Coulter               lezlee99@comcast.net      linkedin.com/pub/lezlee-coulter            ...
Table of Contents Introduction                 Why SetFocus? Piggy Bank    Developing and Implementing a SQL Server Data...
Why SetFocus?Drawn to the intense nature of the course work and the high caliberinstruction, I came to SetFocus to start o...
SQL Server Master’s Curriculum   RDBMS Concepts   MS SQL Server 2008R2 T-SQL   Implementing a Microsoft SQL Server 2008...
Piggy BankFollowing our RDBMS and T-SQL instruction, we weregiven a banking scenario and data that the bank maywant to ut...
Transfer Funds                       •   Declare proper Accounts for Transfer                       •   Declare proper Bal...
•   Verify opening balance based on    Business Requirement•   Ensure proper data entry                                   ...
Views                                         A Current Month Bank Statement                          Utilizing Concatenat...
T-SQL Queries       The Merge StatementNew in 2008: Insert & Update in One           • Update target table when date and c...
Merge ResultsTaking advantage of Output $Action  to review the results of the Merge
T-SQL Queries  Recursive CTE’s    And again…
Recursive CTE Results
T-SQL Queries                    Apply2005 feature that allows us to ‘apply’ the results       of a UDF to all the rows in...
Apply with Results
T-SQL Queries The Pivot Statement
SSIS PackageUses a Merge Stored Procedure       • Data Flow to Import Files       • Inserts into a Temp Staging Table
SSIS Package The Control Flow
Mini-AdventureWorks                                         Working in BIDSCreate a small database using the AdventureWor...
SSISDynamic Import Products
Import OrdersInserts into the Details & Header Tables       A Mail Task to Relay Results
SSISImport Orders Data Flow
SSRSStored Procedure for Required ReportUtilizes Cross Apply and Rank Function
SSRSReport Results from the Stored Procedure
Matrix Report   SSRS
Group Roles   Block-Flix                                           Project Lead: Lezlee Coulter                           ...
Online                                         Store                           Kiosk Kiosk                    Database    ...
• Store and Kiosk databases mirror Central database to  facilitate efficient import & export of data• Online Store utilize...
ER-DiagramPrimary Key- Foreign Key Relationships
Receiving a Shipment • New copies of existing titles are delivered • An .xls file is accompanied, electronically • File co...
SSISInsert Existing Titles Into InventoryControl Flow : Moves processed files to a new location         Send Tasks to rela...
SSIS              DATA FLOWInserting new copies of existing titles            into inventory
Stored Procedure to Insert Inventory       Using the While Statement to       ‘”loop” through the Quantity                ...
SSRSReport Procedures       Most Rented Movies for Current Month   •   Counts TransactionID’s based on Movie Rentals   •  ...
Requested ReportBased on Procedure, includes Company Name & Logo
SSRSReport Procedures       Most Active Customers for Current Month   •    Sums Transaction Types based on Movie Rentals  ...
Requested ReportBased on Procedure, includes Company Name & Logo
Managing Block Flix As the project lead, looking at the task as a whole, “seeing the forest”, was my mainpurpose. We had j...
Topping It All Off…                    with a Trigger                After TriggerSets DateModified to GETDAT() on any Upd...
DDL TriggerA Safety Trigger to ensure that the tables       are not dropped or altered
Thank you!Please contact me with    any questions.                   Lezlee Coulter                   443-871-5557        ...
Lezlee Coulter SQl Server Portfolio
Upcoming SlideShare
Loading in …5
×

Lezlee Coulter SQl Server Portfolio

510 views
418 views

Published on

SetFocus SQL Server Master's Program Portfolio

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
510
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lezlee Coulter SQl Server Portfolio

  1. 1. SQL Server 2008R2 Lezlee Coulter lezlee99@comcast.net linkedin.com/pub/lezlee-coulter 443-871-5557
  2. 2. Table of Contents Introduction Why SetFocus? Piggy Bank Developing and Implementing a SQL Server Database for a Banking Institution T-SQL Queries Sample T-SQL Queries to include Merge, Recursive CTE’s, Pivot, Cross Apply Mini-AdventureWorks Implentation of Database Development, SSIS Packages & SSRS Reports Putting It All Together BLOCK FLIX  Adhering to RDBMS core concepts through design and development of a database for a movie rental company.  Import and export of data to and from central, store and kiosk databases through SSIS.  Utilizing SSRS to create and distribute marketing & finance reports.
  3. 3. Why SetFocus?Drawn to the intense nature of the course work and the high caliberinstruction, I came to SetFocus to start on a new career path. “I want tolive and breathe SQL Server,” was my request. They did not disappoint.The ten-week SQL Master’s Program delivered real world application ofthe skills needed in today’s work force. From Normalization toReporting, from Stored Procedures to Integration, SetFocus provided mewith an invaluable education.But who am I? That’s what you really want to know. I am a person whodecided that life is too short not do something I love. I wanted to knowhow they pull up my balance at the bank or find my information when Iswipe my card at the grocery store. But, I wanted to be able to do itmyself. That’s why I’m here. That’s why I chose this path.I’ve included some samples of my work and I hope you enjoy them.Please feel free to contact me with any questions. Lezlee Coulter
  4. 4. SQL Server Master’s Curriculum RDBMS Concepts MS SQL Server 2008R2 T-SQL Implementing a Microsoft SQL Server 2008R2 Database Advanced T-SQL Querying and Programming Microsoft SQL Server 2008R2 Integration Services Microsoft SQL Server 2008R2 Reporting Services
  5. 5. Piggy BankFollowing our RDBMS and T-SQL instruction, we weregiven a banking scenario and data that the bank maywant to utilize.Normalize the data through Codd’s rules.Write Stored Procedures to create customers andaccounts.Write Stored Procedures to initialize and completestandard banking transactions.Create Views to access ATM and statement balancesand transaction history.
  6. 6. Transfer Funds • Declare proper Accounts for Transfer • Declare proper Balances based on AccountID• Withdraw and Update Account• Deposit and Update Account
  7. 7. • Verify opening balance based on Business Requirement• Ensure proper data entry Using SCOPE_IDENTITY() to Insert into Customer Account following Account Insert Cont’d
  8. 8. Views A Current Month Bank Statement Utilizing Concatenation , Joins & Date Functions• Select Customer data, Account data & Transaction data to provide a statement based on the current month• Using INNER JOINS to retrieve a “match” for the Customer/Account
  9. 9. T-SQL Queries The Merge StatementNew in 2008: Insert & Update in One • Update target table when date and currencies match, BUT rate DOES NOT • Insert into target table when date and currencies DO NOT match
  10. 10. Merge ResultsTaking advantage of Output $Action to review the results of the Merge
  11. 11. T-SQL Queries Recursive CTE’s And again…
  12. 12. Recursive CTE Results
  13. 13. T-SQL Queries Apply2005 feature that allows us to ‘apply’ the results of a UDF to all the rows in a table The Function
  14. 14. Apply with Results
  15. 15. T-SQL Queries The Pivot Statement
  16. 16. SSIS PackageUses a Merge Stored Procedure • Data Flow to Import Files • Inserts into a Temp Staging Table
  17. 17. SSIS Package The Control Flow
  18. 18. Mini-AdventureWorks Working in BIDSCreate a small database using the AdventureWorks modelBuild SSIS Packages to import data from flat filesDesign and deploy SSRS Reports to Report ServerCreate linked reports from multi-parameterized reportsand make available through subscriptions
  19. 19. SSISDynamic Import Products
  20. 20. Import OrdersInserts into the Details & Header Tables A Mail Task to Relay Results
  21. 21. SSISImport Orders Data Flow
  22. 22. SSRSStored Procedure for Required ReportUtilizes Cross Apply and Rank Function
  23. 23. SSRSReport Results from the Stored Procedure
  24. 24. Matrix Report SSRS
  25. 25. Group Roles Block-Flix Project Lead: Lezlee Coulter Developers: James Vaughn Theresa Rice Irina Zilbermanas Putting It All TogetherA movie rental company needs a new databaseto function with store, kiosk & online rentals & salesAs a group, design and implement the databaseDevelop the necessary packages in SSIS to import inventoryCreate reports for the finance & marketing departmentsPresent our work to management
  26. 26. Online Store Kiosk Kiosk Database Kiosk Store StoreDatabase Store Database Databas Database Database e Kiosk Kiosk Central Database DatabaseDatabase Store Store Kiosk Database Database KioskDatabase Kiosk Database Database
  27. 27. • Store and Kiosk databases mirror Central database to facilitate efficient import & export of data• Online Store utilizes Central Database• Access to database restricted through stored procedures• Import & Export of data through SSIS packages
  28. 28. ER-DiagramPrimary Key- Foreign Key Relationships
  29. 29. Receiving a Shipment • New copies of existing titles are delivered • An .xls file is accompanied, electronically • File contains • MovieID’s • MediaTypeID’s (DVD or Blu-Ray) • Quantity • ID’s must be imported via SSIS
  30. 30. SSISInsert Existing Titles Into InventoryControl Flow : Moves processed files to a new location Send Tasks to relay success or failure
  31. 31. SSIS DATA FLOWInserting new copies of existing titles into inventory
  32. 32. Stored Procedure to Insert Inventory Using the While Statement to ‘”loop” through the Quantity Inserts 10 copies of MovieID 11
  33. 33. SSRSReport Procedures Most Rented Movies for Current Month • Counts TransactionID’s based on Movie Rentals • Groups by Title & Genre • Orders by Date desc
  34. 34. Requested ReportBased on Procedure, includes Company Name & Logo
  35. 35. SSRSReport Procedures Most Active Customers for Current Month • Sums Transaction Types based on Movie Rentals • Groups by Members • Orders by Rentals desc
  36. 36. Requested ReportBased on Procedure, includes Company Name & Logo
  37. 37. Managing Block Flix As the project lead, looking at the task as a whole, “seeing the forest”, was my mainpurpose. We had just one week in which to design and implement the databases and prepare a presentation. Which aspects needed to be fully functional? Which aspects were Phase Two? Where did my teammates’ strengths lie? Where do we need to be by week’s end and how do we get there? We normalized the data and created the databases. I distributed the procedures and the SSIS packages that call them. After we wrote the procedures to be called from user-interface applications, such as Transactions and CreateMember,I then focused on the procedures for the required reports and distributed the design. The challenge, for me, in this project was not as related to the technology as it was to “steering the ship” in the direction of success. It was a wonderful experience and one from which I learned to truly see all of our processes as a part of a whole.
  38. 38. Topping It All Off… with a Trigger After TriggerSets DateModified to GETDAT() on any Update Instead of Trigger Inhibits an update or delete of Transactions
  39. 39. DDL TriggerA Safety Trigger to ensure that the tables are not dropped or altered
  40. 40. Thank you!Please contact me with any questions. Lezlee Coulter 443-871-5557 lezlee99@comcast.net

×