Sobes.tech
Intern — Middle

Relational schema: employees and their departments

livecode

Task condition

Transform the presented tables into a correct relational structure.

CREATE TABLE dept (
    id INT PRIMARY KEY,
    name VARCHAR(100) NOT NULL
);

CREATE TABLE staff (
    id INT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    dept_id INT,
    FOREIGN KEY (dept_id) REFERENCES dept(id)
);