Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,5 @@
create or replace table s (id INTEGER UNIQUE NOT NULL);
create or replace table t (id INTEGER UNIQUE NOT NULL);
insert into s from generate_series(1,10);
insert into t from generate_series(5,15);

View file

@ -0,0 +1 @@
from s union from t;

View file

@ -0,0 +1 @@
from s INTERSECT from t;

View file

@ -0,0 +1 @@
select count() as n from (from s INTERSECT from t);

View file

@ -0,0 +1 @@
from s EXCEPT from t;

View file

@ -0,0 +1,2 @@
select count() from
( (from s EXCEPT from t) UNION (from t EXCEPT from s));

View file

@ -0,0 +1,2 @@
select (EXISTS (from s where NOT EXISTS (from t where s.id=t.id))) or
(EXISTS (from t where NOT EXISTS (from s where s.id=t.id)) );

View file

@ -0,0 +1,2 @@
select NOT EXISTS
(from s where NOT EXISTS (from t where s.id = t.id));

View file

@ -0,0 +1 @@
select NOT EXISTS (from s EXCEPT from t);

46
Task/Set/Pluto/set.pluto Normal file
View file

@ -0,0 +1,46 @@
require "map"
local fmt = require "fmt"
local fruits = new set()
fruits:add("apple", "pear", "orange", "banana")
fmt.print("fruits : %s", fruits)
local fruits2 = new set()
fruits2:add("melon", "orange", "lemon", "gooseberry")
fmt.print("fruits2 : %s", fruits2)
print()
fmt.print("fruits contains 'banana' : %s", fruits:contains("banana"))
fmt.print("fruits2 contains 'elderberry' : %s", fruits2:contains("elderberry"))
print()
fmt.print("Union : %s", fruits:union(fruits2))
fmt.print("Intersection : %s", fruits:intersect(fruits2))
fmt.print("Difference : %s", fruits:except(fruits2))
print()
fmt.print("fruits2 is a subset of fruits : %s", fruits2:subset(fruits))
print()
local fruits3 = fruits:copy()
fmt.print("fruits3 : %s", fruits3)
print()
fmt.print("fruits2 and fruits are equal : %s", fruits2:same(fruits))
fmt.print("fruits3 and fruits are equal : %s", fruits3:same(fruits))
print()
local fruits4 = new set()
fruits4:add("apple", "orange")
fmt.print("fruits4 : %s", fruits4)
print()
fmt.print("fruits3 is a proper subset of fruits : %s", fruits3:subset(fruits, true))
fmt.print("fruits4 is a proper subset of fruits : %s", fruits4:subset(fruits, true))
print()
local fruits5 = new set()
fruits5:add("cherry", "blueberry", "raspberry")
fmt.print("fruits5 : %s", fruits5)
print()
fruits5:add("guava")
fmt.print("fruits5 + 'guava' : %s", fruits5)
fruits5:remove("cherry")
fmt.print("fruits5 - 'cherry' : %s", fruits5)