Comprehending nulls

07/23/2021
by   James Cheney, et al.
0

The Nested Relational Calculus (NRC) has been an influential high-level query language, providing power and flexibility while still allowing translation to standard SQL queries. It has also been used as a basis for language-integrated query in programming languages such as F#, Scala, and Links. However, SQL's treatment of incomplete information, using nulls and three-valued logic, is not compatible with `standard' NRC based on two-valued logic. Nulls are widely used in practice for incomplete data, but the question of how to accommodate SQL-style nulls and incomplete information in NRC, or integrate such queries into a typed programming language, appears not to have been studied thoroughly. In this paper we consider two approaches: an explicit approach in which option types are used to represent (possibly) nullable primitive types, and an implicit approach in which types are treated as possibly-null by default. We give translations relating the implicit and explicit approaches, discuss handling nulls in language integration, and sketch extensions of normalization and conservativity results.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/24/2020

Handling SQL Nulls with Two-Valued Logic

The design of SQL is based on a three-valued logic (3VL), rather than th...
research
03/16/2022

Translating Canonical SQL to Imperative Code in Coq

SQL is by far the most widely used and implemented query language. Yet, ...
research
03/25/2020

A Formalization of SQL with Nulls

SQL is the world's most popular declarative language, forming the basis ...
research
01/24/2019

TigerGraph: A Native MPP Graph Database

We present TigerGraph, a graph database system built from the ground up ...
research
07/28/2023

No More Nulls!

Since the inception of SQL, nulls have frustrated database users and bui...
research
09/02/2020

The Optics of Language-Integrated Query

Monadic comprehensions reign over the realm of language-integrated query...
research
04/14/2022

Synthesizing Analytical SQL Queries from Computation Demonstration

Analytical SQL is widely used in modern database applications and data a...

Please sign up or login with your details

Forgot password? Click here to reset