Giter Site home page Giter Site logo

jcolinmurray / sql-nested-set-model Goto Github PK

View Code? Open in Web Editor NEW

This project forked from njohnson9402/sql-nested-set-model

0.0 2.0 0.0 14 KB

More complete implementation of the nested set model, with schema, triggers, stored procedures, and get-ers.

License: MIT License

SQLPL 89.73% PLSQL 10.27%

sql-nested-set-model's Introduction

SQL-Nested-Set-Model

More complete implementation of the nested set model, with schema, triggers, stored procedures, and get-ers.

How to get started

  1. Run Create Entities.sql in your favorite playground SQL database. It will create the schema nsm, the base table, and the friendly view.
  2. Run Sample Data.sql in said database to fill the new table with some data.
  3. Run the trg_ scripts to create the triggers.
  4. Run MoveCatSubtree.sql to create the stored-procedure that moves nodes/subtrees around. a. In re-thinking about this project, it should probably be called "ChangeCatParent", but I'll get to that renaming later.

Trying it out

  • Check out the Sample Queries.sql to see some SELECTs in action.
  • Revisit Sample Data.sql and run the comment-blocked INSERTs at the bottom.
  • Write your own INSERT/UPDATE/DELETE queries to build your favorite family of cats!

I welcome any feedback, pull-requests, issues, suggestions, and rants! Leave a comment on my blog (natethedba.wordpress.com), and of course, stalk me right here on GitHub!

Compatibility: MS SQL Server 2008R2 & higher.

I ask politely for attribution if you found these scripts helpful, but I'd settle for an upvote on StackOverflow and/or a comment/follow on my blog! Cheers.

sql-nested-set-model's People

Contributors

njohnson9402 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.