DAS_2024_1/kashin_maxim_lab_3/faculty_service/init.sql

17 lines
420 B
MySQL
Raw Permalink Normal View History

CREATE TABLE IF NOT EXISTS faculty (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
university_id INT NOT NULL
);
CREATE TABLE IF NOT EXISTS university (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL
);
CREATE TABLE IF NOT EXISTS faculty_university (
faculty_id INT REFERENCES faculty(id),
university_id INT REFERENCES university(id),
PRIMARY KEY (faculty_id, university_id)
);