rowen_1 0 Newbie Poster

I am trying out sqlite3 create statements and forign keys in c++ and I came up with 4 requirements.

1) a employer can create a job position
2) a employer can view the form reject or shortlist the applicant for interview
3) a applicant may apply for a job position
4) a applicant must fill up their details and submit the form if they are keen to apply for a position

This is what I wrote

employer Table

/*SQL statement for employer table*/
 char *sql;
 sql = "CREATE TABLE EMPLOYER("  \
     "ID INT PRIMARY KEY     NOT NULL," \
     "NAME           TEXT    NOT NULL," \
     "ROLE           TEXT    NOT NULL );";

jobposition table

/*SQL statement for jobposition table */
char *sql;
sql = "CREATE TABLE JOBPOSITION("  \
     "ID INT PRIMARY KEY     NOT NULL," \
     "JOBPOSITION    TEXT    NOT NULL," \
     "OUTCOME        TEXT    NOT NULL );";

form table

/*SQL statement for form table*/
char *sql;
sql = "CREATE TABLE FORM ("  \
      "ID INT PRIMARY KEY     NOT NULL," \
     "FOREIGN KEY (ID) REFERENCES APPLICANT(ID)",
     "FOREIGN KEY (ID) REFERENCES JOBPOSITION(ID)",
     " FOREIGN KEY (ID) REFERENCES EMPLOYER(ID)" );";

applicant table

 /*SQL statement for applicant table*/
 char *sql;
 sql = "CREATE TABLE APPLICANT ("  \
     "ID INT PRIMARY KEY     NOT NULL," \
     "APPLICANT_NAME    TEXT    NOT NULL," \
     "APPLICANT_ADDRESS    TEXT    NOT NULL," );";

I am not really sure if this is correct as I just started learning database and need some help with it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.