{ "type": "statement", "variant": "list", "statement": [ { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "people" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "name", "definition": [ { "type": "constraint", "variant": "primary key" } ], "datatype": { "type": "datatype", "variant": "text", "affinity": "text" } }, { "type": "definition", "variant": "column", "name": "role", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "text", "affinity": "text" } }, { "type": "definition", "variant": "column", "name": "height", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "int", "affinity": "integer" } }, { "type": "definition", "variant": "constraint", "definition": [ { "type": "constraint", "variant": "check", "expression": { "type": "expression", "format": "binary", "variant": "operation", "operation": "in", "right": { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "text", "value": "teacher" } ] }, "left": { "type": "identifier", "variant": "column", "name": "role" } } } ] } ] }, { "type": "statement", "target": { "type": "identifier", "variant": "index", "name": "people_idx1" }, "on": { "type": "identifier", "variant": "expression", "format": "table", "name": "people", "columns": [ { "type": "identifier", "variant": "column", "name": "role" }, { "type": "identifier", "variant": "column", "name": "height" } ] }, "variant": "create", "format": "index" }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Alice" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "156" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Bob" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "161" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Cindy" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "155" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "David" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "181" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Emily" }, { "type": "literal", "variant": "text", "value": "teacher" }, { "type": "literal", "variant": "decimal", "value": "158" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Fred" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "163" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Ginny" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "169" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Harold" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "172" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Imma" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "179" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Jack" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "181" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Karen" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "163" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Logan" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "177" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Megan" }, { "type": "literal", "variant": "text", "value": "teacher" }, { "type": "literal", "variant": "decimal", "value": "159" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Nathan" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "163" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Olivia" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "161" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Patrick" }, { "type": "literal", "variant": "text", "value": "teacher" }, { "type": "literal", "variant": "decimal", "value": "180" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Quiana" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "182" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Robert" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "159" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Sally" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "166" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Tom" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "171" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Ursula" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "170" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Vance" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "179" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Willma" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "175" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Xavier" }, { "type": "literal", "variant": "text", "value": "teacher" }, { "type": "literal", "variant": "decimal", "value": "185" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Yvonne" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "149" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Zach" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "170" } ] } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ], "explain": true }, { "type": "statement", "variant": "analyze" }, { "type": "statement", "variant": "update", "into": { "type": "identifier", "variant": "table", "name": "sqlite_stat1" }, "set": [ { "type": "assignment", "target": { "type": "identifier", "variant": "column", "name": "stat" }, "value": { "type": "literal", "variant": "text", "value": "10000 5000 20" } } ], "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "idx" }, "right": { "type": "literal", "variant": "text", "value": "people_idx1" } } ] }, { "type": "statement", "variant": "update", "into": { "type": "identifier", "variant": "table", "name": "sqlite_stat1" }, "set": [ { "type": "assignment", "target": { "type": "identifier", "variant": "column", "name": "stat" }, "value": { "type": "literal", "variant": "text", "value": "10000 1" } } ], "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "idx" }, "right": { "type": "literal", "variant": "text", "value": "sqlite_autoindex_people_1" } } ] }, { "type": "statement", "variant": "analyze", "target": "sqlite_master" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ], "explain": true }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "in", "right": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "role" } ], "distinct": true, "from": { "type": "identifier", "variant": "table", "name": "people" } }, "left": { "type": "identifier", "variant": "column", "name": "role" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "compound", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "role" }, "right": { "type": "literal", "variant": "text", "value": "teacher" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ] }, "compound": [ { "type": "compound", "variant": "union all", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "role" }, "right": { "type": "literal", "variant": "text", "value": "student" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ] } } ], "order": [ { "type": "literal", "variant": "decimal", "value": "1" } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Angie" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "166" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Brad" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "176" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Claire" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "168" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Donald" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "162" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Elaine" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "177" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Frazier" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "159" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Grace" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "179" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Horace" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "166" } ] } ] }, { "type": "statement", "variant": "analyze" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "stat" } ], "from": { "type": "identifier", "variant": "table", "name": "sqlite_stat1" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "idx" }, "right": { "type": "literal", "variant": "text", "value": "people_idx1" } } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ], "explain": true }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Ingrad" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "155" } ] } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "people" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "Jacob" }, { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "decimal", "value": "179" } ] } ] }, { "type": "statement", "variant": "analyze" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "stat" } ], "from": { "type": "identifier", "variant": "table", "name": "sqlite_stat1" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "idx" }, "right": { "type": "literal", "variant": "text", "value": "people_idx1" } } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "people" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ], "explain": true }, { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "peoplew" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "name", "definition": [ { "type": "constraint", "variant": "primary key" } ], "datatype": { "type": "datatype", "variant": "text", "affinity": "text" } }, { "type": "definition", "variant": "column", "name": "role", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "text", "affinity": "text" } }, { "type": "definition", "variant": "column", "name": "height", "definition": [ { "type": "constraint", "variant": "not null" } ], "datatype": { "type": "datatype", "variant": "int", "affinity": "integer" } }, { "type": "definition", "variant": "constraint", "definition": [ { "type": "constraint", "variant": "check", "expression": { "type": "expression", "format": "binary", "variant": "operation", "operation": "in", "right": { "type": "expression", "variant": "list", "expression": [ { "type": "literal", "variant": "text", "value": "student" }, { "type": "literal", "variant": "text", "value": "teacher" } ] }, "left": { "type": "identifier", "variant": "column", "name": "role" } } } ] } ], "optimization": [ { "type": "optimization", "value": "without rowid" } ] }, { "type": "statement", "target": { "type": "identifier", "variant": "index", "name": "peoplew_idx1" }, "on": { "type": "identifier", "variant": "expression", "format": "table", "name": "peoplew", "columns": [ { "type": "identifier", "variant": "column", "name": "role" }, { "type": "identifier", "variant": "column", "name": "height" } ] }, "variant": "create", "format": "index" }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "expression", "format": "table", "name": "peoplew", "columns": [ { "type": "identifier", "variant": "column", "name": "name" }, { "type": "identifier", "variant": "column", "name": "role" }, { "type": "identifier", "variant": "column", "name": "height" } ] }, "result": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" }, { "type": "identifier", "variant": "column", "name": "role" }, { "type": "identifier", "variant": "column", "name": "height" } ], "from": { "type": "identifier", "variant": "table", "name": "people" } } }, { "type": "statement", "variant": "alter table", "target": { "type": "identifier", "variant": "table", "name": "people" }, "action": "rename", "name": { "type": "identifier", "variant": "table", "name": "old_people" } }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "in", "right": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "role" } ], "distinct": true, "from": { "type": "identifier", "variant": "table", "name": "peoplew" } }, "left": { "type": "identifier", "variant": "column", "name": "role" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "compound", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "role" }, "right": { "type": "literal", "variant": "text", "value": "teacher" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ] }, "compound": [ { "type": "compound", "variant": "union all", "statement": { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "and", "left": { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "role" }, "right": { "type": "literal", "variant": "text", "value": "student" } }, "right": { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } } ] } } ], "order": [ { "type": "literal", "variant": "decimal", "value": "1" } ] }, { "type": "statement", "variant": "analyze" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ] }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "column", "name": "name" } ], "from": { "type": "identifier", "variant": "table", "name": "peoplew" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": ">=", "left": { "type": "identifier", "variant": "column", "name": "height" }, "right": { "type": "literal", "variant": "decimal", "value": "180" } } ], "order": [ { "type": "expression", "format": "unary", "variant": "operation", "expression": { "type": "identifier", "variant": "column", "name": "name" }, "operator": "+" } ], "explain": true }, { "type": "statement", "name": { "type": "identifier", "variant": "table", "name": "t3" }, "variant": "create", "format": "table", "definition": [ { "type": "definition", "variant": "column", "name": "a", "definition": [] }, { "type": "definition", "variant": "column", "name": "b", "definition": [] }, { "type": "definition", "variant": "column", "name": "c", "definition": [] }, { "type": "definition", "variant": "constraint", "definition": [ { "type": "constraint", "variant": "primary key" } ], "columns": [ { "type": "identifier", "variant": "column", "name": "a" }, { "type": "identifier", "variant": "column", "name": "b" } ] } ], "optimization": [ { "type": "optimization", "value": "without rowid" } ] }, { "type": "statement", "variant": "insert", "action": "insert", "into": { "type": "identifier", "variant": "table", "name": "t3" }, "result": [ { "type": "expression", "variant": "list", "expression": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "%", "left": { "type": "identifier", "variant": "column", "name": "sub_i" }, "right": { "type": "literal", "variant": "decimal", "value": "2" } }, { "type": "identifier", "variant": "column", "name": "sub_i" }, { "type": "literal", "variant": "text", "value": "xyz" } ] } ] }, { "type": "statement", "variant": "analyze" }, { "type": "statement", "variant": "select", "result": [ { "type": "identifier", "variant": "star", "name": "*" } ], "from": { "type": "identifier", "variant": "table", "name": "t3" }, "where": [ { "type": "expression", "format": "binary", "variant": "operation", "operation": "=", "left": { "type": "identifier", "variant": "column", "name": "b" }, "right": { "type": "literal", "variant": "decimal", "value": "42" } } ] } ] }