{"Scientists": {"columns": [[0, "SSN", "INT", 0, null, 1], [1, "Name", "Char(30)", 1, null, 0]], "primary_keys": ["SSN"], "foreign_keys": [], "unique_constraints": [[[0, 0, "SSN"]]], "check_constraints": []}, "Projects": {"columns": [[0, "Code", "Char(4)", 0, null, 1], [1, "Name", "Char(50)", 1, null, 0], [2, "Hours", "INT", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Code"]]], "check_constraints": []}, "AssignedTo": {"columns": [[0, "Scientist", "INT", 1, null, 1], [1, "Project", "char(4)", 1, null, 2]], "primary_keys": ["Scientist", "Project"], "foreign_keys": [[0, 0, "Projects", "Project", "Code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Scientists", "Scientist", "SSN", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Scientist"], [1, 1, "Project"]]], "check_constraints": []}}
CREATE TABLE Scientists (
    SSN INT   PRIMARY KEY,
    Name Char(30) NOT NULL,
    UNIQUE (SSN)
);

CREATE TABLE Projects (
    Code Char(4)   PRIMARY KEY,
    Name Char(50) NOT NULL,
    Hours INT,
    UNIQUE (Code)
);

CREATE TABLE AssignedTo (
    Scientist INT NOT NULL  PRIMARY KEY,
    Project char(4) NOT NULL  PRIMARY KEY,
    PRIMARY KEY (Scientist, Project),
    UNIQUE (Scientist, Project),
    FOREIGN KEY (Project) REFERENCES Projects(Code),
    FOREIGN KEY (Scientist) REFERENCES Scientists(SSN)
);