Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TFG
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
estegar
TFG
Commits
5848dd6a
Commit
5848dd6a
authored
Jul 6, 2024
by
estegar
Browse files
Options
Downloads
Patches
Plain Diff
Update file SchemaBD.sql
parent
11fdaedb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Base de datos/SchemaBD.sql
+83
-0
83 additions, 0 deletions
Base de datos/SchemaBD.sql
with
83 additions
and
0 deletions
Base de datos/SchemaBD.sql
0 → 100644
+
83
−
0
View file @
5848dd6a
-- - Autora: Ester García Pérez
create
database
`TOPICOS_MUSICALES`
;
use
`TOPICOS_MUSICALES`
;
SET
foreign_key_checks
=
0
;
-- -USUARIOS
drop
table
if
exists
usuarios
;
create
table
usuarios
(
id_us
integer
not
null
AUTO_INCREMENT
,
usuario
varchar
(
25
)
not
null
,
contrasenia
varchar
(
25
)
not
null
,
rol
varchar
(
25
)
not
null
,
constraint
us_id
primary
key
(
id_us
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -LISTA OBJETOS
drop
table
if
exists
objetos
;
create
table
objetos
(
id_o
integer
not
null
AUTO_INCREMENT
,
objeto
varchar
(
200
)
not
null
,
color
varchar
(
7
),
-- -(#RRGGBB)
constraint
so_id
primary
key
(
id_o
),
constraint
o_c_hex
CHECK
(
color
REGEXP
'^#([A-Fa-f0-9]{6})$'
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -LISTA PREDICADOS
drop
table
if
exists
predicados
;
create
table
predicados
(
id_pr
integer
not
null
AUTO_INCREMENT
,
predicado
varchar
(
200
)
not
null
,
constraint
pr_id
primary
key
(
id_pr
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -TRIPLETAS
drop
table
if
exists
tripletas
;
create
table
tripletas
(
id_tr
integer
not
null
AUTO_INCREMENT
,
sujeto
varchar
(
200
)
not
null
,
predicado
varchar
(
200
)
not
null
,
objeto
varchar
(
200
)
not
null
,
validada
boolean
not
null
default
0
,
descripcion
varchar
(
500
)
not
null
,
colaborador
varchar
(
25
)
not
null
,
moderador
varchar
(
25
)
not
null
,
constraint
tr_id
primary
key
(
id_tr
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -OBRAS entidad débil
drop
table
if
exists
obras
;
create
table
obras
(
id_tr
integer
not
null
,
compositor
varchar
(
120
)
not
null
,
obra
varchar
(
500
)
not
null
,
fragmento
varchar
(
500
),
grabacion
varchar
(
500
),
enlace
varchar
(
500
),
constraint
ob_id
primary
key
(
obra
,
id_tr
),
constraint
ob_id2
foreign
key
(
id_tr
)
references
tripletas
(
id_tr
)
on
delete
cascade
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -BIBLIO entidad débil
drop
table
if
exists
biblios
;
create
table
biblios
(
id_tr
integer
not
null
,
autor
varchar
(
120
)
not
null
,
titulo
varchar
(
500
)
not
null
,
anio
int
(
4
)
not
null
,
editorial
varchar
(
500
)
not
null
,
constraint
bi_id
primary
key
(
titulo
,
id_tr
),
constraint
bi_id2
foreign
key
(
id_tr
)
references
tripletas
(
id_tr
)
on
delete
cascade
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
-- -SUGERENCIA
drop
table
if
exists
sugerencias
;
create
table
sugerencias
(
id_su
integer
not
null
AUTO_INCREMENT
,
sugerencia
varchar
(
500
)
not
null
,
colaborador
varchar
(
25
)
not
null
,
fecha
date
,
constraint
su_id
primary
key
(
id_su
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_0900_ai_ci
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment