Parts Implemented by İhsan HALICI¶
Code and Database Definitions¶
Database Definitions¶
CREATE TABLE TEAMS(ID SERIAL PRIMARY KEY, NAME VARCHAR(50) NOT NULL, FOUNDATION_YEAR INT NOT NULL, COLOURS VARCHAR(50), LEAGUE INT NOT NULL, COUNTRY INT NOT NULL);
CREATE TABLE MATCHES(ID SERIAL PRIMARY KEY, HOME VARCHAR(50) NOT NULL, AWAY VARCHAR(50) NOT NULL, REFEREE VARCHAR(50), LEAGUE INT NOT NULL);
CREATE TABLE COMPETITION(ID SERIAL PRIMARY KEY, NAME VARCHAR(100) NOT NULL, TYPE VARCHAR(50) NOT NULL);
Here ID SERIAL PRIMARY KEY definition is done for all tables. This does the increasing one-by-one order for the tuples. League and Country variables are defined as integer. Becaues they are referenced from the Leagues and Countries Tables. And ID of the Lagues and Countries table is referenced, so they are defined as integer.
PYTHON CODE EXPLANATIONS¶
TABLE EXPLANATIONS¶
TEAMS TABLE EXPLANATIONS¶
Teams Table includes the columns below
ID (SERIAL PRIMARY KEY) NAME (VARCHAR(50)) FOUNDATION_YEAR (INT) COLOURS (VARCHAR(50)) LEAGUE (INT) COUNTRY (INT)
Teams Table
MATCHES TABLE EXPLANATIONS¶
Matches Table includes the columns below
ID (SERIAL PRIMARY KEY) HOME (VARCHAR(50)) AWAY (VARCHAR(50)) REFEREE (VARCHAR(50)) LEAGUE (INT)
Matches Table
COMPETITION TABLE EXPLANATIONS¶
Competition Table includes the columns below
ID (SERIAL PRIMARY KEY) NAME (VARCHAR(100)) TYPE (VARCHAR(50))
Competition Table