...
In this example we will build the logic manually, however, you can also get started quicker by using theĀ Autogenerating APIs from tables option for one of the tables first.
You can use the SQL code below to create and populate the tables used in the example or use your own tables and adjust the steps accordingly.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
CREATE TABLE employees ( EMPNUMBER INT NOT NULL , LASTNAME VARCHAR(50) NOT NULL , FIRSTNAME VARCHAR(50) NOT NULL , EXTENSION VARCHAR(10) NOT NULL , EMAIL VARCHAR(100) NOT NULL , OFFICECODE VARCHAR(10) NOT NULL , REPORTSTO INT DEFAULT NULL , JOBTITLE VARCHAR(50) NOT NULL , PRIMARY KEY( EMPNUMBER ) ) ; CREATE TABLE offices ( OFFICECODE VARCHAR(10) NOT NULL , CITY VARCHAR(50) NOT NULL , PHONE VARCHAR(50) NOT NULL , ADDRESS1 VARCHAR(50) NOT NULL , ADDRESS2 VARCHAR(50) DEFAULT NULL , STATE VARCHAR(50) DEFAULT NULL , COUNTRY VARCHAR(50) NOT NULL , POSTALCODE VARCHAR(15) NOT NULL , TERRITORY VARCHAR(10) NOT NULL , PRIMARY KEY( OFFICECODE ) ) ; |
...