-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.sql
98 lines (84 loc) · 3.28 KB
/
search.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
-- -----------------------------------------------------
-- Table `urls`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `urls` (
`idurl` INTEGER PRIMARY KEY AUTOINCREMENT,
`meta` VARCHAR(60) NULL,
`descricao` VARCHAR(200) NULL,
`url` VARCHAR(2000) NULL DEFAULT NULL);
-- -----------------------------------------------------
-- Table `page_rank`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `page_rank` (
`idurl` INTEGER,
`nota` FLOAT NOT NULL,
PRIMARY KEY (`idurl`),
CONSTRAINTEGER `fk_page_rank_idurl`
FOREIGN KEY (`idurl`)
REFERENCES `urls` (`idurl`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `palavras`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `palavras` (
`idpalavra` INTEGER PRIMARY KEY AUTOINCREMENT,
`palavra` VARCHAR(200));
-- -----------------------------------------------------
-- Table `palavra_localizacao`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `palavra_localizacao` (
`idpalavra_localizacao` INTEGER(11) NOT NULL AUTOINCREMENT,
`idurl` INTEGER(11) NOT NULL,
`idpalavra` INTEGER(11) NOT NULL,
`localizacao` INTEGER(11) NULL DEFAULT NULL,
PRIMARY KEY (`idpalavra_localizacao`),
INDEX `fk_palavra_localizacao_idurl` (`idurl` ASC),
INDEX `idx_palavra_localizacao_idpalavra` (`idpalavra` ASC),
CONSTRAINTEGER `fk_palavra_localizacao_idpalavra`
FOREIGN KEY (`idpalavra`)
REFERENCES `palavras` (`idpalavra`),
CONSTRAINTEGER `fk_palavra_localizacao_idurl`
FOREIGN KEY (`idurl`)
REFERENCES `urls` (`idurl`))
ENGINE = InnoDB
AUTOINCREMENT = 376606
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `url_ligacao`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `url_ligacao` (
`idurl_ligacao` INTEGER(11) NOT NULL AUTOINCREMENT,
`idurl_origem` INTEGER(11) NOT NULL,
`idurl_destino` INTEGER(11) NOT NULL,
PRIMARY KEY (`idurl_ligacao`),
INDEX `idx_url_ligacao_idurl_origem` (`idurl_origem` ASC),
INDEX `idx_url_ligacao_idurl_destino` (`idurl_destino` ASC),
CONSTRAINTEGER `fk_url_ligacao_idurl_destino`
FOREIGN KEY (`idurl_destino`)
REFERENCES `urls` (`idurl`),
CONSTRAINTEGER `fk_url_ligacao_idurl_origem`
FOREIGN KEY (`idurl_origem`)
REFERENCES `urls` (`idurl`))
ENGINE = InnoDB
AUTOINCREMENT = 68783;
-- -----------------------------------------------------
-- Table `url_palavra`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `url_palavra` (
`idurl_palavra` INTEGER(11) NOT NULL AUTOINCREMENT,
`idpalavra` INTEGER(11) NOT NULL,
`idurl_ligacao` INTEGER(11) NOT NULL,
PRIMARY KEY (`idurl_palavra`),
INDEX `fk_url_palavra_idurl_ligacao` (`idurl_ligacao` ASC),
INDEX `idx_url_palavra_idpalavra` (`idpalavra` ASC),
CONSTRAINTEGER `fk_url_palavra_idpalavra`
FOREIGN KEY (`idpalavra`)
REFERENCES `palavras` (`idpalavra`),
CONSTRAINTEGER `fk_url_palavra_idurl_ligacao`
FOREIGN KEY (`idurl_ligacao`)
REFERENCES `url_ligacao` (`idurl_ligacao`))
ENGINE = InnoDB
AUTOINCREMENT = 966013;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;