CREATE TABLE Student (
Student_id INT NOT NULL PRIMARY KEY,
campus_id INT NOT NULL,
trainning_site_id INT NOT NULL,
full_name VARCHAR(20) NOT NULL ,
age INT NOT NULL,
email VARCHAR(50) NOT NULL
);
CREATE TABLE car(
rego_number VARCHAR(20) NOT NULL PRIMARY KEY,
owner_id INT NOT NULL,
owner_name VARCHAR(20) NOT NULL,
CONSTRAINT fk1_car FOREIGN KEY (owner_id) REFERENCES student (student_id)
);
CREATE TABLE campus (
campus_id INT NOT NULL PRIMARY KEY,
campus_location VARCHAR(30) NOT NULL
);
CREATE TABLE trainning_site(
trainning_site_id INT NOT NULL PRIMARY KEY,
trainning_site_location VARCHAR(30) NOT NULL
);
ALTER TABLE Student ADD CONSTRAINT fkl_student FOREIGN KEY (campus_id) REFERENCES campus (campus_id);
ALTER TABLE Student ADD CONSTRAINT fk2_student FOREIGN KEY (trainning_site_id) REFERENCES trainning_site(trainning_site_id);
希望能帮忙修改一下