I'm new to SQL. As an example is my main table:
CREATE TABLE IF NOT EXISTS `main`.`item` (
`item_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing item_id of each job, unique index',
`item_title` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'item title, not-unique',
`item_status`
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='item data';
And my reference table:
CREATE TABLE IF NOT EXISTS `main`.`status` (
`status_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing status_id of each status, unique index',
`status_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'status name, unique',
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='status';
How can I reference the main table to an ID of the status table, so there is a status associated with the main item.
Also since this is my first DB, if I have made any other mistakes please feel free to highlight them.