项目作者: calindamian

项目描述 :
Wolfram SQL like operators
高级语言:
项目地址: git://github.com/calindamian/Wolfram-SQL-like-operators.git
创建时间: 2020-10-22T11:53:46Z
项目社区:https://github.com/calindamian/Wolfram-SQL-like-operators

开源协议:GNU General Public License v3.0

下载


Wolfram-SQL-like-operators

Wolfram SQL like operators

Objective

New to Wolfram language I’m very impressed by its expressive power .
However coming from a database background I found sometimes counterintuitive to manipulate data using Datasets.
In my journey of learning Wolfram language I’m trying to implement SQL like operators in order to explore data structures
with the simplicity of SQL Language .

A small query example using stocks data imported from FinancialData package:
sampledataSQL is a 2 dimensional list with 3 columns { symbol, time , close}

  1. whereSQL[sampledataSQL , (! MissingQ[close]) ] //
  2. groupBySQL[# , {time} ]&//
  3. summarySQL [# , Association["maxclose" :> (close//Max) ,
  4. "minclose" :> (close//Min) ,
  5. "count" :> (table//Length) ]
  6. ]&//
  7. orderBySQL[#, {maxclose}]&//
  8. showTableSQL

Demo

https://www.wolframcloud.com/obj/damcalrom/Published/SQL_Operators.nb