CREATE TABLE IF NOT EXISTS `#__testquestions_sets` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `description` text NULL, `published` tinyint NOT NULL DEFAULT 1, `ordering` int NOT NULL DEFAULT 0, `created` datetime NULL DEFAULT NULL, `created_by` int unsigned NOT NULL DEFAULT 0, `modified` datetime NULL DEFAULT NULL, `modified_by` int unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_published` (`published`), KEY `idx_ordering` (`ordering`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__testquestions_set_questions` ( `set_id` int unsigned NOT NULL, `question_id` int unsigned NOT NULL, `ordering` int NOT NULL DEFAULT 0, PRIMARY KEY (`set_id`, `question_id`), KEY `idx_question_id` (`question_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;