Apendice B Modelo de datos y tablas de la RDU Diagrama de los componentes de la RDU con sus respectivos atributos. Diagrama de escuelas - cursos. 103 Tablas resultantes de los diagramas anteriores create table book_reserve ( id_book serial not null, title char(255), year int, loan_time int, ini_day int, ini_mon int, ini_year int, end_day int, end_mon int, end_year int, description text ); create table autor ( id_autor serial not null, name char(255), last_name char(255) ); create table doc_digital ( id_doc serial not null, title char(255), year int, ini_day int, ini_mon int, ini_year int, end_day int, end_mon int, end_year int, description text, archive_pdf byte ); create table dig_pag_doc ( num_page int, id_doc int, page byte ); create table thumbnail ( num_page int, id_doc int, thumbnail byte ); create table course 104 ( course_key char(255) not null, section int not null, name char(255), id_user char(255), depto_key Char(255) ); create table depart ( depto_key char(255) not null, name char(255), url char(255), sc_key char(255) ); create table school ( sc_key char(255) not null, url char(255), name char(255) ); create table url_suge ( id_url serial not null, title char(255), ini_day int, ini_mon int, ini_year int, end_day int, end_mon int, end_year int, description text, url char(255), course_key char(255), section int ); create table course_book ( id_book int, course_key char(255), section int ); create table course_doc ( id_doc int, course_key char(255), section int ); create table autor_book 105 ( id_autor int, id_book int ); create table autor_doc ( id_autor int, id_doc int ); create table user_t_course ( course_key char(255), section int, id_user char(255) ); create table user_i_course ( course_key char(255), section int, id_user char(255) ); Diagrama de los usuarios 106 create table person ( id_person char(255) not null, name_i char(255), name_s char(255), last_name_p char(255), last_name_m char(255) ); create table user ( id_user char(255) not null, id_person char(255), password char (255), email char(255) ); create table roles ( id_role char(255) not null, role char(255) ); create table user_role ( id_user char(255), id_role char(255) ); Índices creados para el mejor rendimiento de la base de datos create index user_index on user (id_user); create index user_role_index on user_role (id_user); create index doc_index on doc_digital (id_doc); create index pag_doc_index on dig_pag_doc (id_doc, num_page); create index thumbnail_index on thumbnail (id_doc, num_page); create index url_index on url_suge (id_url); create index course_index on course (course_key, section); create index course_doc_index on course_doc (id_doc, course_key, section); create index user_t_cou_index on user_t_course (section, id_user); create index user_i_cou_index on user_i_course (section, id_user); 107