Critical Path SQL Thane Schaffer: Database Administrator/Architect, Transcore, Albuquerque NM Traversing trees of hierarchal data structures, solving cumulative minimum/maximum problems for critical paths in SQL
Critical Path SQL Thane Schaffer Current employment DBA with Transcore, an Engineer To Order (ETO) R&D, manufacturingof RFID tolling equipment, i.e. tags & readers, bidding software projects to governmental agencies Support MS SQL Server 2005, 2008R2, 2014, Oracle offsite/onsite clients, Postgres Open GIS, mySQL, and Visibility ETO ERP Administration Previously consulted/employed Daimler Trucks North America (Freightliner): data modeler for a global Teamcenter PLM reporting (Oracle OLAP) Gallo Wines (Oracle data migration/interfaces); Beverage industry Precision Castparts (Delphi & VB app dev/Oracle design OLTP); Aerospace Clackamas County Tax Assessors office (Informix Y2K conversion); Local government Mitsubishi Silicon America (DEC VAX & VB app dev/Oracle OLTP); Silicon wafer manufacturer HMO – Oregon (HP 3000 Image hierarchal DB); Healthcare SEH America (DEC VAX/VMS app dev/DEC rDB); Silicon wafer manufacturer ITI Technologies (HP 3000/9000 Image hierarchal DBMS); Motherboards Electro Scientific Industries (DEC VAX app dev/RMS/Datatrieve/operations); Laser trimmers – Silicon wafers linkedin: thane schaffer blog: / 2/20/2016SQLSaturday #478 – Albuquerque |
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | Critical path definition: An algorithm that examines a constraint and all possible outcomes for that constraint so as to understand the maximum/minimum duration of that constraint Examples: Project management examining manpower or time constraints Travel: salesman, transportation and logistics Designing or building complex products: motherboards, cars, trucks War/Military actions and objectives: seizing territories Answer for shortest path? 1)ADF 2)AE 3)BC
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | Another example: Additional variables add to complexity Direct labor hours, machine capacity/time, machine setup time/costs, material costs, acquisition/lead times, queue/wait times, move times (DRAG), and many variations in labor, machines compound issues
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | OLTP Hierarchal data can be found in many places in the business
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | OLTP Hierarchal data structures in your databases Employee tableBill of Materials table
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | Traversing hierarchal data structures in proper order that’s meaningful for the business Computer science data structure courses teach about pre-order, in- order, post-order traversals. Inverted tree structure requires pre-order for most business needs Pre-order starts at the root and travels down and left, working right / up Produces an ordered set {F, B, A, D, C, E, G, I, H}
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | Syntax for recursive common table expressions: WITH CTEbom (column1, column2, …columnN) as ( select column1, column2, …columnN from table1 (anchor query) UNION ALL select column1, column2, …columnN from table2 t2 inner join CTEbom ct on ct.column1 to t2.column1 (recursive query & join back on itself) ) select column1, column2, …columnN from CTEbom option (maxrecursion 6) Basic example: Solution: SQLSaturday478_DemoProject.ssmssln, Open:BTreeBOMExample.sql
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | AdventureWorks example: Solution: SQLSaturday478_DemoProject.ssmssln, Open:AdventureWorksBOMCTE.sql
Critical Path SQL 2/20/2016SQLSaturday #478 – Albuquerque | Transcore examples: Solution: SQLSaturday478_DemoProject.ssmssln, Open: TranscoreExamples.sql Proc finds maximum cumulative lead time: AMTC_FETCH_BOM_CUM_LT Function returns result set of BOM structure: AMTC_FIND_BOM_LT VisMaintenance (Bart) application How messy can this all get, see old Oracle example: OracleBOMExample.sql
Thanks to our Sponsors!
Join us at our Networking happy hour immediately following the closing remarks today Fox & Hound 4301 The Lane at 25 NE, Albuquerque, NM Drinks, Light appetizers, Raffle drawings, Pool tables, dart boards, and more networking with speakers, organizers, and attendees. See you there!