mirror of https://gitee.com/openkylin/db5.3.git
19 lines
515 B
SQL
19 lines
515 B
SQL
CREATE DATABASE numismatics;
|
|
|
|
CREATE TABLE coin (cid INT(8) PRIMARY KEY,
|
|
unit VARCHAR(20),
|
|
value NUMERIC(8,2),
|
|
mintage_year INT(8),
|
|
mint_id INT(8),
|
|
CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
|
|
REFERENCES mint(mid));
|
|
|
|
CREATE TABLE mint (mid INT(8) PRIMARY KEY,
|
|
country VARCHAR(20),
|
|
city VARCHAR(20));
|
|
|
|
CREATE INDEX coin ON coin(unit);
|
|
|
|
|
|
|