Headline

A SQLite-Contribution

Characteristics

A small Contribution implementing 101companies with plain (non-embedded) Language:SQL.

Illustration

The following Diagram describes the Data-Schema:

media:https://raw.githubusercontent.com/101companies/101repo/master/contributions/sqliteSingle/doc/schema.png

SQL uses so-called Pragmas for storing settings, in most cases this is handled by the embedding language.

PRAGMA foreign_keys = "TRUE"; --enable foreign keys
PRAGMA recursive_triggers = "TRUE"; --enable recursive triggers

SQL wraps all Actions in so called Transactions, which are aferwards committed. (Here for inserting the sample company.)

BEGIN TRANSACTION;
INSERT INTO Department(name) VALUES("Research");
INSERT INTO Department(name) VALUES("Development" );
INSERT INTO Department(name, superdepartment) VALUES("Dev1" ,(SELECT ID FROM Department WHERE name == "Development"));
INSERT INTO Department(name, superdepartment) VALUES("Dev1.1" ,(SELECT ID FROM Department  WHERE name == "Dev1"));
---- Some more entities
END TRANSACTION;

SQL can also automatically call Triggers after certain Actions:

CREATE TRIGGER IF NOT EXISTS noManager AFTER DELETE ON Department BEGIN UPDATE Employee SET isManager = NULL WHERE department == NULL; END; --Removes Manager Attribute if Department is erased

Architecture

The Contribution consists out of one file for each Feature, Setup, Teardown and Inserting a sample company and a Makefile for testing and executing.

Usage

Please consult the Readme


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.