-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_comp.sql
41 lines (36 loc) · 1.41 KB
/
add_comp.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
USE TeamCWebApp;
DROP TABLE IF EXISTS `band_competency`;
DROP TABLE IF EXISTS `competency`;
CREATE TABLE `competency` (
`competency_id` smallint NOT NULL AUTO_INCREMENT,
`competency_name` varchar(30) DEFAULT NULL,
PRIMARY KEY (`competency_id`)
);
CREATE TABLE `band_competency` (
`band_id` smallint NOT NULL,
`competency_id` smallint NOT NULL,
`competency_description` varchar(500),
KEY `band_id` (`band_id`),
KEY `competency_id` (`competency_id`),
CONSTRAINT `band_competency_ibfk_1` FOREIGN KEY (`band_id`) REFERENCES `band` (`band_id`),
CONSTRAINT `band_competency_ibfk_2` FOREIGN KEY (`competency_id`) REFERENCES `competency` (`competency_id`),
CONSTRAINT `band_competency_uniq_1` UNIQUE (`band_id`, `competency_id`)
);
LOCK TABLES `competency` WRITE;
INSERT INTO `competency` VALUES
(1,'test competency'),
(2,'Commercial Awareness'),
(3,'Planning and Organising'),
(4,'Innovation & Continuous Improvement'),
(5,'Job Specific Knowledge'),
(6,'Developing Yourself and Others'),
(7,'Communicating & Teamwork'),
(8,'Customer Focus');
UNLOCK TABLES;
LOCK TABLES `band_competency` WRITE;
INSERT INTO `band_competency` VALUES
(1, 1, 'test description'),
(2, 2, 'Description of Commercial Awareness for Apprentices'),
(3, 2, 'Description of Commercial Awareness for Trainees'),
(4, 4, 'Description of Innovation and Continuous Improvement for Associates');
UNLOCK TABLES;