SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Mathematics/Algorithms in SQL


Mathematics/Algorithms in SQL

Author
Message
karthik M
karthik M
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26221 Visits: 2591
All,

I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.

karthik
GilaMonster
GilaMonster
SSC Guru
SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)

Group: General Forum Members
Points: 919180 Visits: 48849
Such as?
Asking because I'm not sure I understand what you're after.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Tom Thomson
Tom Thomson
SSC Guru
SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)SSC Guru (95K reputation)

Group: General Forum Members
Points: 95117 Visits: 13650
Ar you asking about the underlying mathematics behind the relational model? If so, you could look for papers writen by Ted Codd in the early to mid 1970s. You may find that you have to pay to get copies of some of them.

Tom

Eric M Russell
Eric M Russell
SSC Guru
SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)

Group: General Forum Members
Points: 111560 Visits: 14880
For the concepts of relational algebra that underly SQL, here is an overview:
https://en.wikipedia.org/wiki/Relational_algebra

The mathematical operators and functions included in the T-SQL language are quite basic.
https://msdn.microsoft.com/en-us/library/ms187716.aspx
https://msdn.microsoft.com/en-us/library/ms177516.aspx


"The universe is complicated and for the most part beyond your control, but your life is only as complicated as you choose it to be."
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
OR... are you looking for things like why you might want to use Integer math, how to do things with dates and times, how to compare two differently partitioned ROW_NUMBER() results to identify overlapping events, the math behind quickly building high performance nested sets instead of using loops or recursion, why automatic conversions to decimal datatypes can suck, etc, etc?

In other words, what the hell does "all" mean in your original post? ;-)

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
karthik M - Tuesday, November 29, 2016 3:36 AM
All,I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.


Dude! It's been over a year since you posted this request... can you at least take the time to read the responses and provide some feedback?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
HappyGeek
HappyGeek
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15362 Visits: 7571
Jeff Moden - Monday, December 4, 2017 10:03 AM
karthik M - Tuesday, November 29, 2016 3:36 AM
All,I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.


Dude! It's been over a year since you posted this request... can you at least take the time to read the responses and provide some feedback?


Looks like an interesting question, would like to see feedback on what the OP wanted.

...
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
HappyGeek - Monday, December 4, 2017 11:19 AM
Jeff Moden - Monday, December 4, 2017 10:03 AM
karthik M - Tuesday, November 29, 2016 3:36 AM
All,I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.


Dude! It's been over a year since you posted this request... can you at least take the time to read the responses and provide some feedback?


Looks like an interesting question, would like to see feedback on what the OP wanted.


Precisely.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Alan Burstein
Alan Burstein
SSC Guru
SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)

Group: General Forum Members
Points: 55481 Visits: 9039
I know that this is an old question bumped back up to the front of the line but I agree that it's an important one.

My two cents. With respect to the "mathematics concepts" I'd say to start with
Set Theory and The Relational Model.

-- Alan Burstein


Helpful links:

Best practices for getting help on SQLServerCentral -- Jeff Moden
How to Post Performance Problems -- Gail Shaw

Nasty fast set-based string manipulation functions:
For splitting strings try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL Server 2012+)
To split strings based on patterns try PatternSplitCM
Need to clean or transform a string? try NGrams, PatExclude8K, PatReplace8K, DigitsOnlyEE, or Translate8K

I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code. -- Itzik Ben-Gan 2001

drew.allen
drew.allen
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67104 Visits: 17675
Jeff Moden - Monday, December 4, 2017 2:49 PM
HappyGeek - Monday, December 4, 2017 11:19 AM
Jeff Moden - Monday, December 4, 2017 10:03 AM
karthik M - Tuesday, November 29, 2016 3:36 AM
All,I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.


Dude! It's been over a year since you posted this request... can you at least take the time to read the responses and provide some feedback?


Looks like an interesting question, would like to see feedback on what the OP wanted.


Precisely.

He hasn't been active in four months, so I wouldn't hold my breath waiting for a response.

Drew


J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
How to post data/code on a forum to get the best help.
How to Post Performance Problems
Make sure that you include code in the appropriate IFCode tags, e.g. [code=sql]<your code here>[/code]. You can find the IFCode tags under the INSERT options when you are writing a post.
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
drew.allen - Monday, December 4, 2017 3:23 PM
Jeff Moden - Monday, December 4, 2017 2:49 PM
HappyGeek - Monday, December 4, 2017 11:19 AM
Jeff Moden - Monday, December 4, 2017 10:03 AM
karthik M - Tuesday, November 29, 2016 3:36 AM
All,I am looking for some article which explain what are all the mathematics concepts and algorithms used in SQL.


Dude! It's been over a year since you posted this request... can you at least take the time to read the responses and provide some feedback?


Looks like an interesting question, would like to see feedback on what the OP wanted.


Precisely.

He hasn't been active in four months, so I wouldn't hold my breath waiting for a response.

Drew


Heh... too bad... I was hoping to hold HIS breath. Wink Pork chops, anyone? Wink

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
Alan.B - Monday, December 4, 2017 3:07 PM
I know that this is an old question bumped back up to the front of the line but I agree that it's an important one.

My two cents. With respect to the "mathematics concepts" I'd say to start with
Set Theory and The Relational Model.


Heh... we should definitely do one on "Tuples" as they relate to "Set Theory"... maybe Microsoft will take the hint and finally add an "element ordinal" to the String_Split function.

As for "Relational Model", I'm just happy there are some people out there that know how to get the current date and time using -T-SQL. Wink

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
ChrisM@Work
ChrisM@Work
SSC Guru
SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)SSC Guru (168K reputation)

Group: General Forum Members
Points: 168558 Visits: 21825
Jeff Moden - Monday, December 4, 2017 5:17 PM
Alan.B - Monday, December 4, 2017 3:07 PM
I know that this is an old question bumped back up to the front of the line but I agree that it's an important one.

My two cents. With respect to the "mathematics concepts" I'd say to start with
Set Theory and The Relational Model.


Heh... we should definitely do one on "Tuples" as they relate to "Set Theory"... maybe Microsoft will take the hint and finally add an "element ordinal" to the String_Split function.

As for "Relational Model", I'm just happy there are some people out there that know how to get the current date and time using -T-SQL. Wink

The "Relational Model" - which Airfix kit to give to which nephew at Christmas??

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)SSC Guru (895K reputation)

Group: General Forum Members
Points: 895077 Visits: 48186
ChrisM@Work - Tuesday, December 5, 2017 12:49 AM
Jeff Moden - Monday, December 4, 2017 5:17 PM
Alan.B - Monday, December 4, 2017 3:07 PM
I know that this is an old question bumped back up to the front of the line but I agree that it's an important one.

My two cents. With respect to the "mathematics concepts" I'd say to start with
Set Theory and The Relational Model.


Heh... we should definitely do one on "Tuples" as they relate to "Set Theory"... maybe Microsoft will take the hint and finally add an "element ordinal" to the String_Split function.

As for "Relational Model", I'm just happy there are some people out there that know how to get the current date and time using -T-SQL. Wink

The "Relational Model" - which Airfix kit to give to which nephew at Christmas??


The answer is "none". Keep them for yourself... they're fun to build. Wink If they know the GETDATE() question, buy them a laptop instead. Wink

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Brandie Tarvin
Brandie Tarvin
SSC Guru
SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)

Group: General Forum Members
Points: 158979 Visits: 9848
Since we're already derailing...

How many people have seen the James May Toy Stories where they build Airfix?

If not, you should. It's fantastic. I think it's available on Hulu right now (or Netflix, but I'm pretty sure it's Hulu).

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)

Group: Administrators
Points: 619276 Visits: 21251
I think the various suggestions posted are all likely good questions to think about writing about. If anyone wants to tackle any of them

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search