initial commit
This commit is contained in:
32
sql/database.sql
Normal file
32
sql/database.sql
Normal file
@@ -0,0 +1,32 @@
|
||||
drop database if exists alumnos;
|
||||
create database alumnos;
|
||||
|
||||
use alumnos;
|
||||
|
||||
create table alumno (
|
||||
id int primary key auto_increment,
|
||||
rut varchar(255) not null,
|
||||
nombre varchar(255) not null
|
||||
);
|
||||
|
||||
create table asignatura (
|
||||
id int primary key auto_increment,
|
||||
nombre varchar(255) not null
|
||||
);
|
||||
|
||||
create table alumno_asignatura (
|
||||
id int primary key auto_increment,
|
||||
alumno_id int not null,
|
||||
asignatura_id int not null,
|
||||
foreign key (alumno_id) references alumno (id),
|
||||
foreign key (asignatura_id) references asignatura (id)
|
||||
);
|
||||
|
||||
create table nota (
|
||||
id int primary key auto_increment,
|
||||
puntaje_total int not null default 0,
|
||||
puntaje_obtenido int not null default 0,
|
||||
exigencia int not null default 50,
|
||||
alumno_asignatura_id int not null,
|
||||
foreign key (alumno_asignatura_id) references alumno_asignatura (id)
|
||||
);
|
||||
Reference in New Issue
Block a user