Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
-- This file:
--   http://anggtwu.net/SQLITE/calendar1.sql.html
--   http://anggtwu.net/SQLITE/calendar1.sql
--          (find-angg "SQLITE/calendar1.sql")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- (defun e () (interactive) (find-angg "SQLITE/calendar1.sql"))
-- (find-es "sqlite" "with-recursive")
-- (find-es "sqlite" "date")



CREATE TABLE semana (weekday_n, weekday_pt);
INSERT INTO  semana VALUES (0, "dom");
INSERT INTO  semana VALUES (1, "2a");
INSERT INTO  semana VALUES (2, "3a");
INSERT INTO  semana VALUES (3, "4a");
INSERT INTO  semana VALUES (4, "5a");
INSERT INTO  semana VALUES (5, "6a");
INSERT INTO  semana VALUES (6, "sab");

CREATE TABLE main (beg_julian, beg_yyyymmdd, end_julian, end_yyyymd);

CREATE TABLE semestre0 (julian);

WITH RECURSIVE
  cnt(j) AS (
    VALUES(1)
    UNION ALL
    SELECT j+1 FROM cnt WHERE j<10)
INSERT INTO semestre0(julian) VALUES (cnt.j);

-- SELECT j FROM cnt;

CREATE TABLE semestre1 (day_julian, day_yyyymmdd, weekday_n, weekday_pt);

/*
* (eepitch-sqlite3)
* (eepitch-kill)
* (eepitch-sqlite3)
.read "calendar1.sql"

select weekday_pt from semana where weekday_n = 3;
select weekday_n  from semana where weekday_pt = "sab";

*/




-- Local Variables:
-- sql-product: sqlite
-- End: