The objective of this talk is getting you started with the main concepts of working with RelationalDatabases through the Entity framework in the Wolfram Language.
Outline
◼
Philosophy
◼
Classes of entities
◼
Inspection
◼
Querying
◼
Relations
◼
EmbeddedSQL and ExternalEvaluate
◼
Q&A
Philosophy
EntityValue[class,properties]
First argument: EntityClass (and related heads)
◼
Fully inert and symbolic
◼
Represents all the data
◼
Rows
Second argument: EntityProperty (usually plural)
◼
Projection
◼
Columns
Principles
◼
Resolution only happens when EntityValue is called
◼
EntityList considered dangerous (/s)
◼
1 EntityValue = 1 SQL query
Classes of entities
EntityClass
Legacy, can do basic filtering and sorting
FilteredEntityClass
Full-fledged filtering (WHERE)
ExtendedEntityClass
Annotations, renamings
SampledEntityClass
Roughly follows the Take syntax (LIMIT, OFFSET)
SortedEntityClass
Like SortBy (ORDER BY)
AggregatedEntityClass
2-ary version performs aggregations, 3-argument version groups and aggregates (GROUP BY)
CombinedEntityClass
Similar to JoinAcross, but supports more complex statements (JOIN)
UnionedEntityClass
Most complex set operation, supports SameTestProperties (UNION, UNION ALL, DISTINCT ON)
IntersectedEntityClass
Also supports SameTestProperties (INTERSECT)
ComplementedEntityClass
Also supports SameTestProperties (EXCEPT)
Classes of entities (cont.d)
◼
Like Lego: each class of entities is takes one (or more) classes of entities as arguments
◼
Completely inert and symbolic
◼
You can reason about their EntityProperties without executing