{"genre": {"columns": [[0, "g_name", "varchar2(20)", 1, null, 1], [1, "rating", "varchar2(10)", 0, null, 0], [2, "most_popular_in", "varchar2(50)", 0, null, 0]], "primary_keys": ["g_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "g_name"]]], "check_constraints": []}, "artist": {"columns": [[0, "artist_name", "varchar2(50)", 1, null, 1], [1, "country", "varchar2(20)", 0, null, 0], [2, "gender", "varchar2(20)", 0, null, 0], [3, "preferred_genre", "varchar2(50)", 0, null, 0]], "primary_keys": ["artist_name"], "foreign_keys": [[0, 0, "genre", "preferred_genre", "g_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "artist_name"]]], "check_constraints": []}, "files": {"columns": [[0, "f_id", "number(10)", 1, null, 1], [1, "artist_name", "varchar2(50)", 0, null, 0], [2, "file_size", "varchar2(20)", 0, null, 0], [3, "duration", "varchar2(20)", 0, null, 0], [4, "formats", "varchar2(20)", 0, null, 0]], "primary_keys": ["f_id"], "foreign_keys": [[0, 0, "artist", "artist_name", "artist_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "f_id"]]], "check_constraints": []}, "song": {"columns": [[0, "song_name", "varchar2(50)", 0, null, 1], [1, "artist_name", "varchar2(50)", 0, null, 0], [2, "country", "varchar2(20)", 0, null, 0], [3, "f_id", "number(10)", 0, null, 0], [4, "genre_is", "varchar2(20)", 0, null, 0], [5, "rating", "number(10)", 0, null, 0], [6, "languages", "varchar2(20)", 0, null, 0], [7, "releasedate", "Date", 0, null, 0], [8, "resolution", "number(10)", 1, null, 0]], "primary_keys": ["song_name"], "foreign_keys": [[0, 0, "genre", "genre_is", "g_name", "NO ACTION", "CASCADE", "NONE"], [1, 0, "files", "f_id", "f_id", "NO ACTION", "CASCADE", "NONE"], [2, 0, "artist", "artist_name", "artist_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "song_name"]]], "check_constraints": ["rating number(10) check(rating>0 and rating<11),"]}}
CREATE TABLE genre (
    g_name varchar2(20) NOT NULL  PRIMARY KEY,
    rating varchar2(10),
    most_popular_in varchar2(50),
    UNIQUE (g_name)
);

CREATE TABLE artist (
    artist_name varchar2(50) NOT NULL  PRIMARY KEY,
    country varchar2(20),
    gender varchar2(20),
    preferred_genre varchar2(50),
    UNIQUE (artist_name),
    FOREIGN KEY (preferred_genre) REFERENCES genre(g_name)
);

CREATE TABLE files (
    f_id number(10) NOT NULL  PRIMARY KEY,
    artist_name varchar2(50),
    file_size varchar2(20),
    duration varchar2(20),
    formats varchar2(20),
    UNIQUE (f_id),
    FOREIGN KEY (artist_name) REFERENCES artist(artist_name)
);

CREATE TABLE song (
    song_name varchar2(50)   PRIMARY KEY,
    artist_name varchar2(50),
    country varchar2(20),
    f_id number(10),
    genre_is varchar2(20),
    rating number(10),
    languages varchar2(20),
    releasedate Date,
    resolution number(10) NOT NULL,
    UNIQUE (song_name),
    FOREIGN KEY (genre_is) REFERENCES genre(g_name),
    FOREIGN KEY (f_id) REFERENCES files(f_id),
    FOREIGN KEY (artist_name) REFERENCES artist(artist_name),
    rating number(10) check(rating>0 and rating<11),
);