{'fraction_non_alphanumeric': 0.01589825119236884, 'fraction_numerical': 0.009538950715421303, 'mean_word_length': 4.431034482758621, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Logic and Semantics for SQL Queries

Introduction. The problem addressed in this paper occurred to the author about twenty years ago while attending a seminar concerning the logical query transformations used in a certain commercial SQL compiler. To one not knowing much about SQL but having studied logic the process seemed straightforward. As illustrated in the diagram below, we start with a query q1 and map it to a logical formula F1 in an appropriate theory. We then apply the theory to find a logically equivalent formula F2 and reinterpret F2 as a query q2 which is then equivalent to q1, i.e., has the same result set.