id int primary key,
name varchar(50),
type varchar(20),
quantity int,
measurement varchar(10)
);
create or replace table
teacher (
id int primary key,
name varchar(50),
type varchar(20),
quantity int,(5)
measurement varchar(10)
);
create or replace table
Subject (id int primary key,
name varchar(50),
type varchar(20),
quantity int,
measurement varchar(10)
);
create or replace table grade
(
id int primary key,
name varchar(50),
type varchar(20),
quantity int,
measurement varchar(10)
);
create or replace table student (
School_id int,
Teacher_id int,
Subject_id int,
Student_id int,
grade_id int,
foreign key (school_id)
references school(school_id),
foreign key (teacher_id)
references teacher(teacher_id),
foreign key (subject_id)
references subject(subject_id),
FOREIGN KEY (grade_id)
references grade(grade_id)
);
Then revised to create or
replace table Subject (
subject_id int primary key,
name varchar(50),
type varchar(20),
quantity int,
measurement varchar(10)
);
create or replace table student (
student_id int primary key,
name varchar(50),
type varchar(20),
quantity int,
measurement varchar(10)
);
CREATE or replace table
studentrecord (Subject_id int,
student_id int,
foreign key (subject_id)
references subject(subject_id),
FOREIGN KEY (student_id)
references student(student_id)
);