pre-bug
实在没bug了,只能改成prevent-bug,预防bug
今天复习了很多sql的部分,还有很多没POST上来,果真是
Periodic Table Database
ALTER TABLE properties RENAME COLUMN weight TO atomic_mass;
ALTER TABLE properties RENAME COLUMN melting_point TO melting_point_celsius;
ALTER TABLE properties RENAME COLUMN boiling_point TO boiling_point_celsius;
sql
ALTER TABLE properties ALTER COLUMN melting_point_celsius SET NOT NULL;
sql
ALTER TABLE properties ALTER COLUMN boiling_point_celsius SET NOT NULL;
ALTER TABLE elements ADD CONSTRAINT unique_symbol UNIQUE (symbol);
ALTER TABLE elements ADD CONSTRAINT unique_name UNIQUE (name);
ALTER TABLE elements ALTER COLUMN symbol SET NOT NULL;
ALTER TABLE elements ALTER COLUMN name SET NOT NULL;
ALTER TABLE properties ADD CONSTRAINT fk_atomic_number FOREIGN KEY (atomic_number) REFERENCES elements(atomic_number);
CREATE TABLE types ( type_id SERIAL PRIMARY KEY, type VARCHAR(255) NOT NULL );