GithubHelp home page GithubHelp logo

mandi's Introduction

mandi

General

Data management, warehousing, and reporting in SQL Server.

['mandi' (mun-dHee) is Telugu for 'storehouse, warehouse, godown.']

Naming Conventions

"These are important." - Laszlo

  • Always include the name of the 'product', and then a $. Otherwise things won't sort nicely and maintenance becomes a nightmare. For example, if the view relates to MS grades, preface the name with GRADES$.

  • Generally speaking the 'product' name should match the subfolder that it lives in.

  • When picking a name, think about the class of data in question, broadly. There are a few notable exceptions to this rule, namely EMAIL$ (all things notifications) and REPORTING$ (views for the progress trackers and others).

  • Views don't get a 'v_' prefix database side, but use the prefix on the file name [views should be functionally interchangeable with tables, so no prefix].

  • If there is a school-specific aspect, use #SCHOOL ABBREVIATION to indicate.

  • Put |refresh after the file name if this is a script that refreshes a local table.

  • If it is a Powerschool table name, put it in ALL CAPS. Otherwise generally use lower case for the name of your file. (EMAIL$failure_monitoring#NCA)

  • Stored procedures should have sp_ in front of their name.

Naming your commits

Jokes are fine but please be descriptive about what changed.

Best Practices

  • Use the flag /*--UPDATE FIELD FOR CURRENT TERM--*/ for code that requires regular turnover (hex, trimester, etc.) to allow for easy Find/Replace action. Or better yet, make your JOIN dynamic.

  • When creating or adjusting a cached refresh, use the following procedure to quickly replicate a static table from your view:

      EXEC sp_CacheView '[DATABASE]', '[VIEW]', '[DROP/REBUILD? (1/0)]'
    
  • All users are granted READ permission through the db_data_tool_reader server role. Any public-facing views must be explicity given access through GRANT SELECT:

      GRANT SELECT ON [DATABASE]..[TABLE OR VIEW NAME] TO db_data_tool_reader
    
  • Avoid hard-coding dates. If the date range is part of a regularly occuring reporting term, add an entry to the REPORTING$dates table.

  • Avoid hard-coding termid parameters. Instead, use the scalar-valued function dbo.fn_Global_Term_Id()

  • Avoid hard-coding academic year parameters. Instead, use the scalar-valued function dbo.fn_Global_Academic_Year()

Code Reviews

Follow along at home with this Asana Project

mandi's People

Contributors

cbini avatar almartin82 avatar ldesimon avatar kevinverhoff avatar smircovich avatar

Stargazers

Anthony Nevico avatar  avatar Mari avatar Willy Morin avatar Brandon Wall avatar  avatar

Watchers

i avatar  avatar James Cloos avatar  avatar  avatar Pedro Lebre avatar Michael Alderman avatar Rishi Sharma avatar  avatar  avatar  avatar  avatar Anthony Nevico avatar  avatar

mandi's Issues

create students#identifiers

a convenience view, which:
-joins to custom to get key custom fields (SPED etc)
-joins to cohort to get cohort name
-has a use for reporting flag that takes into account enroll status and out of district

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.