SQL Frames Tutorial for Beginners
This is a quick introductory tutorial for SQL Frames. The purpose is only to give an idea of some of the key capabilities of SQL Frames and give a flavor of using the low code API.
The code is presented using a REPL app built specifically for SQL Frames. All the examples are live, that is, they are executed on page load as opposed to pre-rendering or static snippets.
Loading data
Let's first load data from usgs.gov related to all the earthquake activity for the last 30 days.
The variable S
above is a special object of the REPL environment that is shared across multiple REPL
instances and also across the pages within this documentation.
Group By
Notice how the DataFrame is composed using SQL constructs. Not only is the DataFrame computed within the browser, the corresponding SQL is also generated for easy validation.
Advanced features like ROLLUP and CUBE are supported by SQL Frames to make life easy.
SQL Frames is reactive. That is why, no explicit coordination is required between loading
the remote data into a source DataFrame, S.earthquake
and computing the Grouped DataFrame, S.gdf
.
SQL Frames is also lazy by default. That is, the composed DataFrames are not evaluated till required either by the UI layer or calling an API that explicitly triggers the computation.
Chart
Let's visualize the above data as a chart.
This is a static grid chart with multiple levels of detail, type and status in this example, and SQL Frames provides many more advanced charting capabilities.
Pivot
Let's pivot the above grouped data with sub-totals and grand-totals.
You can use the View menu in the DataFrame UI to transpose the Pivot Table or expand/collapse the levels. The low-code API, combined with no-code UI makes SQL Frames appealing to a wide range of users.
Drills & Details
Let's present the summarized data and the drills/details as master detail interface. Select a cell in the summarized table and see the details change to reflect the selection.
The drills and details are computed instantaneously as all the data is in-memory making it a pleasure to work with your data rather than dread the loading spinners.
Hierarchical Data
DataFrames can be visualized hierarchically by specifying the fields that form the hierarchy.
For non-aggregate DataFrames the rows are organized as a hierarchy with data present only in the leaf rows. For Group By DataFrames including Pivoted DataFrames, the intermediate rows may be present and contain sub-totals if the advanced Group By clauses are used to create corresponding levels of details.
Conditional Formatting
What if we want to highlight important features?
Statistics
Let's display histogram and data binning.
Statistical analysis is a vast subject and SQL Frames doesn't try to be all things. The goal is to provide the most common feature set and provide the ability to extend it as needed.
Summary
This is just a quick introduction of what's possible with SQL Frames. All you need is to get some data into the browser and rest all things like data wrangling, analytics, charts, conditional formatting, full text search and statistics can be performed within the browser.
Learn more by visiting the documentation.
Try SQL Frames either online or locally following instructions on the demo page.