text
stringlengths
6
9.38M
# --- !Ups alter table charge drop CONSTRAINT fk_charge_rule; delete from charge; alter table charge add CONSTRAINT fk_charge_entry foreign key(rule_id) references entry (id) on update restrict on delete restrict; drop table rule; # --- !Downs CREATE TABLE rule ( id serial NOT NULL, title character varying(255) NOT NULL DEFAULT ''::character varying, removed boolean NOT NULL DEFAULT false, CONSTRAINT pk_rule PRIMARY KEY (id) ); alter table charge drop CONSTRAINT fk_charge_entry; alter table charge add CONSTRAINT fk_charge_rule FOREIGN KEY (rule_id) REFERENCES rule (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION;
create table uac_qid ( uac varchar(255) not null, qid varchar(255), unique_number serial, primary key (uac) );
/********************************************************************** * This file is part of ADempiere Business Suite * * http://www.adempiere.org * * * * Copyright (C) Trifon Trifonov. * * Copyright (C) Contributors * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301, USA. * * * * Contributors: * * - Trifon Trifonov (trifonnt@users.sourceforge.net) * * * *********************************************************************** * * Title.........: * Description...: Replace: * YYYY -> %Y * MM -> %m * DD -> %d * HH24 -> %H * MI -> %i * SS -> %s * Test..........: SELECT to_date('2010-08-17', 'YYYY-MM-DD'); => 2010-08-17 00:00:00 * SELECT to_date('2010-08-17 13:01:35', 'YYYY-MM-DD HH24:MI:SS'); => 2010-08-17 13:01:35 * * *** * SELECT STR_TO_DATE('2010-08-17 13:01:35','%Y-%m-%d %H:%i:%s'); => 2010-08-17 13:01:35 * SELECT STR_TO_DATE(null, '%Y-%m-%d %H:%i:%s'); => NULL * SELECT STR_TO_DATE('2010-08-17 13:01:35', null); => NULL * SELECT STR_TO_DATE('2010-08-17 13:01:35', ''); => 0000-00-00 * * SELECT STR_TO_DATE('2010-08-17', '%Y-%m-%d') => 2010-08-17 * * *** * SELECT REPLACE('www.mysql.com', 'w', 'Ww'); => 'WwWwWw.mysql.com' * select REPLACE('YYYY-MM-DD HH24:MI:SS', 'YYYY', '%Y') => %Y-MM-DD HH24:MI:SS * select REPLACE('%Y-MM-DD HH24:MI:SS', 'MM', '%m') => %Y-%m-DD HH24:MI:SS * select REPLACE('%Y-%m-DD HH24:MI:SS', 'DD', '%d') => %Y-%m-%d HH24:MI:SS * select REPLACE('%Y-%m-%d HH24:MI:SS', 'HH24', '%H') => %Y-%m-%d %H:MI:SS * select REPLACE('%Y-%m-%d %H:MI:SS', 'MI', '%i') => %Y-%m-%d %H:%i:SS * select REPLACE('%Y-%m-%d %H:%i:SS', 'SS', '%s') => %Y-%m-%d %H:%i:%s * Converted to MySQL..: by Trifon Trifonov ************************************************************************/ -- ## Drop statement DROP FUNCTION IF EXISTS to_date; DELIMITER $$ -- ## Create statement CREATE FUNCTION to_date ( p_StrDate VARCHAR(40), p_formatStr VARCHAR(40) ) RETURNS TIMESTAMP DETERMINISTIC BEGIN DECLARE new_formatStr VARCHAR(255); SET new_formatStr = p_formatStr; SET new_formatStr = REPLACE(new_formatStr, 'YYYY', '%Y'); SET new_formatStr = REPLACE(new_formatStr, 'MM', '%m'); SET new_formatStr = REPLACE(new_formatStr, 'DD', '%d'); SET new_formatStr = REPLACE(new_formatStr, 'HH24', '%H'); SET new_formatStr = REPLACE(new_formatStr, 'MI', '%i'); SET new_formatStr = REPLACE(new_formatStr, 'SS', '%s'); RETURN STR_TO_DATE(p_StrDate, new_formatStr); END$$ DELIMITER ;
SELECT receipt_id, MIN(price) AS min_price FROM receipt_item GROUP BY receipt_id ORDER BY receipt_id LIMIT 5; /* receipt_id | min_price ------------+----------- 1 | 100 2 | 700 3 | 100 4 | 100 5 | 100 (5 rows) */
-- criando tabela gravadora -- TABELA PAI create table gravadora ( id_grav int not null, gravadora varchar(45) not null, telefone varchar(20) null primary key(id_grav) ); -- criando tabela cd -- TABELA FILHO create table cd ( id_cd int identity, id_grav int not null, banda varchar(40) not null, nome_cd varchar(40) not null, dta_lancamento datetime not null primary key(id_cd) foreign key(id_grav) references gravadora (id_grav) ); -- inserindo dois dados na tabela gravadora -- TABELA PAI insert into gravadora values (1,'som livre','99199-8099'); insert into gravadora values (2,'globo','99288-7188'); -- verificando dados cadastrados select * from gravadora; -- inserindo três dados tabela cd -- TABELA FILHO insert into cd values (1,'Legiao urbana','dois','20/12/2019'); insert into cd values (1,'Engenheiros do Hawaii','alivio imediato','10/11/2019'); insert into cd values (2,'Titãs','cabeça dinossauro','02/09/2019'); -- verificando dados cadastrados select * from cd;
CREATE DATABASE nba_players; USE nba_players; DROP TABLE player_week; create table player_week( id INT, player_name varchar(30) not null, age int, height varchar(30) not null, team varchar(30) not null, real_value int, PRIMARY KEY (id) ); -- Create and use customer_db DROP TABLE player_birth_date; -- Create tables for raw data to be loaded into CREATE TABLE player_birth_date( id INTEGER PRIMARY KEY, player_name TEXT, birth_date DATETIME, height TEXT, name_height TEXT, zodiac TEXT ); SELECT name_height, count(player_name) FROM player_birth_date GROUP BY name_height having count(player_name) > 1; drop view Zodiac_Player_of_the_Week; CREATE VIEW Zodiac_Player_of_the_Week AS SELECT player_birth_date.zodiac, sum(player_week.real_value) as '# of Player of the Week Award' FROM player_week INNER JOIN player_birth_date ON player_birth_date.player_name=player_week.player_name GROUP BY zodiac ORDER BY sum(player_week.real_value) desc; select * from Zodiac_Player_of_the_Week; select player_name, sum(real_value) as '# of Player of the Week Award' FROM player_week GROUP BY player_name
-- DDL 맛보기 use webdb; drop table member; create table member( no int(11) not null auto_increment, email varchar(200) not null, password varchar(64) not null, name varchar(100) not null, deparment varchar(100), primary key(no) ); -- 수정 email 밑에 주소 만들기 alter table member add juminbunho char(13) not null after email; alter table member add join_date datetime not null; alter table member add self_intro text; -- 삭제 juminbunho 삭제 alter table member drop juminbunho; -- 수정 / 이름만 바꿀 수 없다 alter table member change deparment department varchar(100) not null; -- 삽입 insert into member() value(null, 'naver@naver.com', password('1234'),'김김김','개발팀',now(),null); insert into member(email, password, name, department, join_date) value('naver2@naver.com',password('1234'),'나나나','개발팀',now()); select * from member; -- -- 삭제 delete from member where no =2; desc member; commit; set autocommit = 1;
-- CHALLENGE 1 -- Step 1 SELECT titleauthor.title_id as 'Title ID', au_id as 'Author ID', titles.advance * titleauthor.royaltyper / 100 AS "Advance", titles.price * sales.qty * titles.royalty / 100 * titleauthor.royaltyper / 100 AS "Royalty" FROM sales INNER JOIN publications.titleauthor ON sales.title_id = titleauthor.title_id INNER JOIN publications.titles ON sales.title_id = titles.title_id; -- Step 2 SELECT `Title ID`, summary.au_id as 'Author ID', Advance as 'Aggregated advance', SUM(Royalty) as 'Aggregated royalties' FROM ( SELECT titleauthor.title_id as 'Title ID', au_id, titles.advance * titleauthor.royaltyper / 100 AS "Advance", titles.price * sales.qty * titles.royalty / 100 * titleauthor.royaltyper / 100 AS "Royalty" FROM sales INNER JOIN publications.titleauthor ON sales.title_id = titleauthor.title_id INNER JOIN publications.titles ON sales.title_id = titles.title_id ) summary GROUP BY au_id, `Title ID`; -- Step 3 SELECT `Author ID`, SUM(`Aggregated advance`) + SUM(`Aggregated royalties`) as 'Profits'\ FROM ( SELECT `Title ID`, summary.au_id as 'Author ID', Advance as 'Aggregated advance', SUM(Royalty) as 'Aggregated royalties' FROM ( SELECT titleauthor.title_id as 'Title ID', au_id, titles.advance * titleauthor.royaltyper / 100 AS "Advance", titles.price * sales.qty * titles.royalty / 100 * titleauthor.royaltyper / 100 AS "Royalty" FROM sales INNER JOIN publications.titleauthor ON sales.title_id = titleauthor.title_id INNER JOIN publications.titles ON sales.title_id = titles.title_id ) summary GROUP BY au_id, `Title ID` ) total GROUP BY `Author ID` ORDER BY Profits DESC LIMIT 3; -- CHALLENGE 2 DROP TABLE summary; CREATE TEMPORARY TABLE publications.presummary SELECT titleauthor.title_id as 'Title ID', au_id as 'Author ID', titles.advance * titleauthor.royaltyper / 100 AS "Advance", titles.price * sales.qty * titles.royalty / 100 * titleauthor.royaltyper / 100 AS "Royalty" FROM sales INNER JOIN publications.titleauthor ON sales.title_id = titleauthor.title_id INNER JOIN publications.titles ON sales.title_id = titles.title_id; SELECT * FROM publications.presummary; CREATE TEMPORARY TABLE publications.summary SELECT `Title ID`, `Author ID`, MAX(Advance) as 'Aggregated advance', SUM(Royalty) as 'Aggregated royalties' FROM publications.presummary GROUP BY `Author ID`, `Title ID`; SELECT * FROM publications.summary; CREATE TEMPORARY TABLE publications.total SELECT `Author ID`, SUM(`Aggregated advance`) + SUM(`Aggregated royalties`) as 'Profits' FROM publications.summary GROUP BY `Author ID` ORDER BY Profits DESC LIMIT 3; SELECT * FROM publications.total; -- CHALLENGE 3 CREATE TABLE publications.most_profiting_authors_victoria SELECT `Author ID`, SUM(`Aggregated advance`) + SUM(`Aggregated royalties`) as 'Profits' FROM publications.summary GROUP BY `Author ID` ORDER BY Profits DESC;
-- AlterTable ALTER TABLE "InvestmentValue" ADD COLUMN "deleted" BOOLEAN NOT NULL DEFAULT false; -- AlterTable ALTER TABLE "PortfolioValue" ADD COLUMN "deleted" BOOLEAN NOT NULL DEFAULT false;
INSERT INTO `discount_methods` VALUES ('1', '1', '1', '1', 'Item Price - Percentage Based'); INSERT INTO `discount_methods` VALUES ('2', '1', '1', '2', 'Item Price - Flat Fee'); INSERT INTO `discount_methods` VALUES ('3', '1', '1', '3', 'Item Price - New Value'); INSERT INTO `discount_methods` VALUES ('4', '1', '2', '1', 'Item Shipping - Percentage Based'); INSERT INTO `discount_methods` VALUES ('5', '1', '2', '2', 'Item Shipping - Flat Fee'); INSERT INTO `discount_methods` VALUES ('6', '1', '2', '3', 'Item Shipping - New Value'); INSERT INTO `discount_methods` VALUES ('7', '2', '3', '1', 'Summary Item Total - Percentage Based'); INSERT INTO `discount_methods` VALUES ('8', '2', '3', '2', 'Summary Item Total - Flat Fee'); INSERT INTO `discount_methods` VALUES ('9', '2', '4', '1', 'Summary Shipping Total - Percentage Based'); INSERT INTO `discount_methods` VALUES ('10', '2', '4', '2', 'Summary Shipping Total - Flat Fee'); INSERT INTO `discount_methods` VALUES ('11', '2', '4', '3', 'Summary Shipping Total - New Value'); INSERT INTO `discount_methods` VALUES ('12', '2', '5', '1', 'Summary Total - Percentage Based'); INSERT INTO `discount_methods` VALUES ('13', '2', '5', '2', 'Summary Total - Flat Fee'); INSERT INTO `discount_methods` VALUES ('14', '3', '6', '2', 'Summary Total - Flat Fee (Voucher)');
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 31-10-2017 a las 02:14:55 -- Versión del servidor: 10.1.25-MariaDB -- Versión de PHP: 7.1.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `satipo` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `clientes` -- CREATE TABLE `clientes` ( `cod_cli` int(3) NOT NULL, `nom_cli` varchar(30) NOT NULL, `ape_cli` varchar(30) NOT NULL, `ciu_cli` varchar(30) NOT NULL, `tel_cli` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `clientes` -- INSERT INTO `clientes` (`cod_cli`, `nom_cli`, `ape_cli`, `ciu_cli`, `tel_cli`) VALUES (1, 'deivis', 'guerra', 'floresta', '1128358758'), (1, 'david', 'guerr', 'flores', '124578'), (1, 'david', 'guerr', 'flores', '124578'), (1, 'david', 'guerr', 'flores', '124578'), (2, 'dei', 'nina', 'flores', '455214'), (2, 'dei', 'nina', 'flores', '455214'), (4, 'yenny', 'lijarza porto', 'caba', '11235878'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- -- Title: Apply schema modifications to upgrade from 2.1 -- Database: MySQL -- Since: V2.2 Schema 91 -- Author: Derek Hulley -- -- In order to streamline the upgrade, all modifications to large tables need to -- be handled in as few steps as possible. This usually involves as few ALTER TABLE -- statements as possible. The general approach is: -- Create a table with the correct structure, including indexes and CONSTRAINTs -- Copy pristine data into the new table -- Drop the old table -- Rename the new table -- -- Please contact support@alfresco.com if you need assistance with the upgrade. -- -- ------------------------------- -- Build Namespaces and QNames -- -- ------------------------------- CREATE TABLE alf_namespace ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, uri VARCHAR(100) NOT NULL, PRIMARY KEY (id), UNIQUE (uri) ) ENGINE=InnoDB; CREATE TABLE alf_qname ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, ns_id BIGINT NOT NULL, local_name VARCHAR(200) NOT NULL, INDEX fk_alf_qname_ns (ns_id), CONSTRAINT fk_alf_qname_ns FOREIGN KEY (ns_id) REFERENCES alf_namespace (id), PRIMARY KEY (id), UNIQUE (ns_id, local_name) ) ENGINE=InnoDB; -- Create temporary table to hold static QNames CREATE TABLE t_qnames ( qname VARCHAR(255) NOT NULL, namespace VARCHAR(100), localname VARCHAR(200), qname_id BIGINT, INDEX tidx_tqn_qn (qname), INDEX tidx_tqn_ns (namespace), INDEX tidx_tqn_ln (localname) ) ENGINE=InnoDB; -- Populate the table with all known static QNames INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.type_qname FROM alf_node s LEFT OUTER JOIN t_qnames t ON (s.type_qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM alf_node_aspects s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM alf_node_properties s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM avm_aspects s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.name FROM avm_aspects_new s LEFT OUTER JOIN t_qnames t ON (s.name = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM avm_node_properties s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM avm_node_properties_new s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.qname FROM avm_store_properties s LEFT OUTER JOIN t_qnames t ON (s.qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.type_qname FROM alf_node_assoc s LEFT OUTER JOIN t_qnames t ON (s.type_qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.type_qname FROM alf_child_assoc s LEFT OUTER JOIN t_qnames t ON (s.type_qname = t.qname) WHERE t.qname IS NULL ); INSERT INTO t_qnames (qname) ( SELECT DISTINCT s.type_qname FROM alf_permission s LEFT OUTER JOIN t_qnames t ON (s.type_qname = t.qname) WHERE t.qname IS NULL ); -- Extract the namespace and localnames from the QNames UPDATE t_qnames SET namespace = CONCAT('FILLER-', SUBSTR(SUBSTRING_INDEX(qname, '}', 1), 2)); UPDATE t_qnames SET localname = SUBSTRING(qname, INSTR(qname, '}')+1); -- Move the Namespaces to their new home INSERT INTO alf_namespace (uri, version) ( SELECT distinct(x.namespace), 1 FROM ( SELECT t.namespace, n.uri FROM t_qnames t LEFT OUTER JOIN alf_namespace n ON (n.uri = t.namespace) ) x WHERE x.uri IS NULL ); -- Move the Localnames to their new home INSERT INTO alf_qname (ns_id, local_name, version) ( SELECT x.ns_id, x.t_localname, 1 FROM ( SELECT n.id AS ns_id, t.localname AS t_localname, q.local_name AS q_localname FROM t_qnames t JOIN alf_namespace n ON (n.uri = t.namespace) LEFT OUTER JOIN alf_qname q ON (q.local_name = t.localname) ) x WHERE q_localname IS NULL GROUP BY x.ns_id, x.t_localname ); -- Record the new qname IDs UPDATE t_qnames t SET t.qname_id = ( SELECT q.id FROM alf_qname q JOIN alf_namespace ns ON (q.ns_id = ns.id) WHERE ns.uri = t.namespace AND q.local_name = t.localname ); -- ---------------------------- -- SHORTCUT: -- Up to this point, we have been extracting static data. The data can be dumped and loaded -- to do faster testing of the ugprades: -- mysqldump derek1 alf_qname alf_namespace t_qnames > extracted-qnames.sql -- Load the dump file and continue from this point -- ---------------------------- -- Create temporary table for dynamic (child) QNames CREATE TABLE t_qnames_dyn ( qname VARCHAR(255) NOT NULL, namespace VARCHAR(100), namespace_id BIGINT, local_name VARCHAR(255), INDEX tidx_qnd_qn (qname), INDEX tidx_qnd_ns (namespace) ) ENGINE=InnoDB; -- Populate the table with the child association paths -- Query OK, 415312 rows affected (1 min 11.91 sec) INSERT INTO t_qnames_dyn (qname) ( SELECT distinct(qname) FROM alf_child_assoc ); -- Extract the Namespace -- Query OK, 415312 rows affected (20.03 sec) UPDATE t_qnames_dyn SET namespace = CONCAT('FILLER-', SUBSTR(SUBSTRING_INDEX(qname, '}', 1), 2)); -- Extract the Localname -- Query OK, 415312 rows affected (16.22 sec) UPDATE t_qnames_dyn SET local_name = SUBSTRING(qname, INSTR(qname, '}')+1); -- Move the namespaces to the their new home -- Query OK, 4 rows affected (34.59 sec) INSERT INTO alf_namespace (uri, version) ( SELECT distinct(x.namespace), 1 FROM ( SELECT t.namespace, n.uri FROM t_qnames_dyn t LEFT OUTER JOIN alf_namespace n ON (n.uri = t.namespace) ) x WHERE x.uri IS NULL ); -- Record the new namespace IDs -- Query OK, 415312 rows affected (10.41 sec) UPDATE t_qnames_dyn t SET t.namespace_id = (SELECT ns.id FROM alf_namespace ns WHERE ns.uri = t.namespace); -- Recoup some storage ALTER TABLE t_qnames_dyn DROP COLUMN namespace; OPTIMIZE TABLE t_qnames_dyn; -- ---------------------------- -- Populate the Permissions -- -- ---------------------------- -- This is a small table so we change it in place ALTER TABLE alf_permission DROP INDEX type_qname, ADD COLUMN type_qname_id BIGINT NULL AFTER id ; UPDATE alf_permission p SET p.type_qname_id = ( SELECT q.id FROM alf_qname q JOIN alf_namespace ns ON (q.ns_id = ns.id) WHERE CONCAT('{', SUBSTR(ns.uri, 8), '}', q.local_name) = p.type_qname ); ALTER TABLE alf_permission DROP COLUMN type_qname, MODIFY COLUMN type_qname_id BIGINT NOT NULL AFTER id, ADD UNIQUE (type_qname_id, name), ADD INDEX fk_alf_perm_tqn (type_qname_id), ADD CONSTRAINT fk_alf_perm_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id) ; -- ------------------- -- Build new Store -- -- ------------------- CREATE TABLE t_alf_store ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, protocol VARCHAR(50) NOT NULL, identifier VARCHAR(100) NOT NULL, root_node_id BIGINT, PRIMARY KEY (id), UNIQUE (protocol, identifier) ) ENGINE=InnoDB; -- -------------------------- -- Populate the ADM nodes -- -- -------------------------- CREATE TABLE t_alf_node ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, store_id BIGINT NOT NULL, uuid VARCHAR(36) NOT NULL, transaction_id BIGINT NOT NULL, node_deleted bit NOT NULL, type_qname_id BIGINT NOT NULL, acl_id BIGINT, audit_creator VARCHAR(255), audit_created VARCHAR(30), audit_modifier VARCHAR(255), audit_modified VARCHAR(30), audit_accessed VARCHAR(30), INDEX idx_alf_node_del (node_deleted), INDEX fk_alf_node_acl (acl_id), INDEX fk_alf_node_tqn (type_qname_id), INDEX fk_alf_node_txn (transaction_id), INDEX fk_alf_node_store (store_id), CONSTRAINT fk_alf_node_acl FOREIGN KEY (acl_id) REFERENCES alf_access_control_list (id), CONSTRAINT fk_alf_node_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id), CONSTRAINT fk_alf_node_txn FOREIGN KEY (transaction_id) REFERENCES alf_transaction (id), CONSTRAINT fk_alf_node_store FOREIGN KEY (store_id) REFERENCES t_alf_store (id), PRIMARY KEY (id), UNIQUE (store_id, uuid) ) ENGINE=InnoDB; -- Fill the store table INSERT INTO t_alf_store (version, protocol, identifier, root_node_id) SELECT 1, protocol, identifier, root_node_id FROM alf_store ; -- Summarize the alf_node_status table CREATE TABLE t_summary_nstat ( node_id BIGINT(20) NOT NULL, transaction_id BIGINT(20) DEFAULT NULL, PRIMARY KEY (node_id) ) ENGINE=InnoDB; --FOREACH alf_node_status.node_id system.upgrade.t_summary_nstat.batchsize INSERT INTO t_summary_nstat (node_id, transaction_id) SELECT node_id, transaction_id FROM alf_node_status WHERE node_id IS NOT NULL AND node_id >= ${LOWERBOUND} AND node_id <= ${UPPERBOUND}; -- Copy data over --FOREACH alf_node.id system.upgrade.t_alf_node.batchsize INSERT INTO t_alf_node ( id, version, store_id, uuid, transaction_id, node_deleted, type_qname_id, acl_id, audit_creator, audit_created, audit_modifier, audit_modified, audit_accessed ) SELECT STRAIGHT_JOIN n.id, 1, s.id, n.uuid, nstat.transaction_id, false, q.qname_id, n.acl_id, null, null, null, null, null FROM alf_node n JOIN t_qnames q ON (q.qname = n.type_qname) JOIN t_summary_nstat nstat ON (nstat.node_id = n.id) JOIN t_alf_store s ON (s.protocol = n.protocol AND s.identifier = n.identifier) WHERE n.id >= ${LOWERBOUND} AND n.id <= ${UPPERBOUND} ; DROP TABLE t_summary_nstat; -- Hook the store up to the root node ALTER TABLE t_alf_store ADD INDEX fk_alf_store_root (root_node_id), ADD CONSTRAINT fk_alf_store_root FOREIGN KEY (root_node_id) REFERENCES t_alf_node (id) ; -- ----------------------------- -- Populate Version Counter -- -- ----------------------------- CREATE TABLE t_alf_version_count ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, store_id BIGINT NOT NULL UNIQUE, version_count INTEGER NOT NULL, INDEX fk_alf_vc_store (store_id), CONSTRAINT fk_alf_vc_store FOREIGN KEY (store_id) REFERENCES t_alf_store (id), PRIMARY KEY (id) ) ENGINE=InnoDB; INSERT INTO t_alf_version_count ( version, store_id, version_count ) SELECT 1, s.id, vc.version_count FROM alf_version_count vc JOIN t_alf_store s ON (s.protocol = vc.protocol AND s.identifier = vc.identifier) ; DROP TABLE alf_version_count; ALTER TABLE t_alf_version_count RENAME TO alf_version_count; -- ----------------------------- -- Populate the Child Assocs -- -- ----------------------------- CREATE TABLE t_alf_child_assoc ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, parent_node_id BIGINT NOT NULL, type_qname_id BIGINT NOT NULL, child_node_name_crc BIGINT NOT NULL, child_node_name VARCHAR(50) NOT NULL, child_node_id BIGINT NOT NULL, qname_ns_id BIGINT NOT NULL, qname_localname VARCHAR(255) NOT NULL, is_primary BIT, assoc_index INTEGER, INDEX idx_alf_cass_qnln (qname_localname), INDEX fk_alf_cass_pnode (parent_node_id), INDEX fk_alf_cass_cnode (child_node_id), INDEX fk_alf_cass_tqn (type_qname_id), INDEX fk_alf_cass_qnns (qname_ns_id), INDEX idx_alf_cass_pri (parent_node_id, is_primary, child_node_id), CONSTRAINT fk_alf_cass_pnode foreign key (parent_node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_cass_cnode foreign key (child_node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_cass_tqn foreign key (type_qname_id) REFERENCES alf_qname (id), CONSTRAINT fk_alf_cass_qnns foreign key (qname_ns_id) REFERENCES alf_namespace (id), PRIMARY KEY (id), UNIQUE (parent_node_id, type_qname_id, child_node_name_crc, child_node_name) ) ENGINE=InnoDB; --FOREACH alf_child_assoc.id system.upgrade.t_alf_child_assoc.batchsize INSERT INTO t_alf_child_assoc ( id, version, parent_node_id, type_qname_id, child_node_name_crc, child_node_name, child_node_id, qname_ns_id, qname_localname, is_primary, assoc_index ) SELECT STRAIGHT_JOIN ca.id, 1, ca.parent_node_id, tqn.qname_id, ca.child_node_name_crc, ca.child_node_name, ca.child_node_id, tqndyn.namespace_id, tqndyn.local_name, ca.is_primary, ca.assoc_index FROM alf_child_assoc ca JOIN t_qnames_dyn tqndyn ON (ca.qname = tqndyn.qname) JOIN t_qnames tqn ON (ca.type_qname = tqn.qname) WHERE ca.id >= ${LOWERBOUND} AND ca.id <= ${UPPERBOUND} ; -- Clean up DROP TABLE t_qnames_dyn; DROP TABLE alf_child_assoc; ALTER TABLE t_alf_child_assoc RENAME TO alf_child_assoc; -- ---------------------------- -- Populate the Node Assocs -- -- ---------------------------- CREATE TABLE t_alf_node_assoc ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL, source_node_id BIGINT NOT NULL, target_node_id BIGINT NOT NULL, type_qname_id BIGINT NOT NULL, INDEX fk_alf_nass_snode (source_node_id), INDEX fk_alf_nass_tnode (target_node_id), INDEX fk_alf_nass_tqn (type_qname_id), CONSTRAINT fk_alf_nass_snode FOREIGN KEY (source_node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_nass_tnode FOREIGN KEY (target_node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_nass_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id), PRIMARY KEY (id), UNIQUE (source_node_id, target_node_id, type_qname_id) ) ENGINE=InnoDB; --FOREACH alf_node_assoc.id system.upgrade.t_alf_node_assoc.batchsize INSERT INTO t_alf_node_assoc ( id, version, source_node_id, target_node_id, type_qname_id ) SELECT STRAIGHT_JOIN na.id, 1, na.source_node_id, na.target_node_id, tqn.qname_id FROM alf_node_assoc na JOIN t_qnames tqn ON (na.type_qname = tqn.qname) WHERE na.id >= ${LOWERBOUND} AND na.id <= ${UPPERBOUND} ; -- Clean up DROP TABLE alf_node_assoc; ALTER TABLE t_alf_node_assoc RENAME TO alf_node_assoc; -- ----------------------------- -- Populate the Node Aspects -- -- ----------------------------- CREATE TABLE t_alf_node_aspects ( node_id BIGINT NOT NULL, qname_id BIGINT NOT NULL, INDEX fk_alf_nasp_n (node_id), INDEX fk_alf_nasp_qn (qname_id), CONSTRAINT fk_alf_nasp_n FOREIGN KEY (node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_nasp_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id), PRIMARY KEY (node_id, qname_id) ) ENGINE=InnoDB; --FOREACH alf_node_aspects.node_id system.upgrade.t_alf_node_aspects.batchsize -- Note the omission of sys:referencable. This is implicit. INSERT INTO t_alf_node_aspects ( node_id, qname_id ) SELECT na.node_id, tqn.qname_id FROM alf_node_aspects na JOIN t_qnames tqn ON (na.qname = tqn.qname) WHERE tqn.qname != '{http://www.alfresco.org/model/system/1.0}referenceable' AND na.node_id >= ${LOWERBOUND} AND na.node_id <= ${UPPERBOUND} ; -- Clean up DROP TABLE alf_node_aspects; ALTER TABLE t_alf_node_aspects RENAME TO alf_node_aspects; -- --------------------------------- -- Populate the AVM Node Aspects -- -- --------------------------------- CREATE TABLE t_avm_aspects ( node_id BIGINT NOT NULL, qname_id BIGINT NOT NULL, INDEX fk_avm_nasp_n (node_id), INDEX fk_avm_nasp_qn (qname_id), CONSTRAINT fk_avm_nasp_n FOREIGN KEY (node_id) REFERENCES avm_nodes (id), CONSTRAINT fk_avm_nasp_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id), PRIMARY KEY (node_id, qname_id) ) ENGINE=InnoDB; --FOREACH avm_aspects.node_id system.upgrade.t_avm_aspects.batchsize INSERT INTO t_avm_aspects ( node_id, qname_id ) SELECT aspects_old.node_id, tqn.qname_id FROM avm_aspects aspects_old JOIN t_qnames tqn ON (aspects_old.qname = tqn.qname) WHERE aspects_old.node_id >= ${LOWERBOUND} AND aspects_old.node_id <= ${UPPERBOUND} ; --FOREACH avm_aspects_new.id system.upgrade.t_avm_aspects.batchsize INSERT INTO t_avm_aspects ( node_id, qname_id ) SELECT anew.id, tqn.qname_id FROM avm_aspects_new anew JOIN t_qnames tqn ON (anew.name = tqn.qname) LEFT JOIN avm_aspects aold ON (anew.id = aold.node_id AND anew.name = aold.qname) WHERE aold.id IS NULL AND anew.id >= ${LOWERBOUND} AND anew.id <= ${UPPERBOUND} ; -- Clean up DROP TABLE avm_aspects; DROP TABLE avm_aspects_new; ALTER TABLE t_avm_aspects RENAME TO avm_aspects; -- ---------------------------------- -- Migrate Sundry Property Tables -- -- ---------------------------------- -- Create temporary mapping for property types CREATE TABLE t_prop_types ( type_name VARCHAR(15) NOT NULL, type_id INTEGER NOT NULL, PRIMARY KEY (type_name) ); INSERT INTO t_prop_types values ('NULL', 0); INSERT INTO t_prop_types values ('BOOLEAN', 1); INSERT INTO t_prop_types values ('INTEGER', 2); INSERT INTO t_prop_types values ('LONG', 3); INSERT INTO t_prop_types values ('FLOAT', 4); INSERT INTO t_prop_types values ('DOUBLE', 5); INSERT INTO t_prop_types values ('STRING', 6); INSERT INTO t_prop_types values ('DATE', 7); INSERT INTO t_prop_types values ('DB_ATTRIBUTE', 8); INSERT INTO t_prop_types values ('SERIALIZABLE', 9); INSERT INTO t_prop_types values ('MLTEXT', 10); INSERT INTO t_prop_types values ('CONTENT', 11); INSERT INTO t_prop_types values ('NODEREF', 12); INSERT INTO t_prop_types values ('CHILD_ASSOC_REF', 13); INSERT INTO t_prop_types values ('ASSOC_REF', 14); INSERT INTO t_prop_types values ('QNAME', 15); INSERT INTO t_prop_types values ('PATH', 16); INSERT INTO t_prop_types values ('LOCALE', 17); INSERT INTO t_prop_types values ('VERSION_NUMBER', 18); -- Modify the avm_store_properties table CREATE TABLE t_avm_store_properties ( id BIGINT NOT NULL AUTO_INCREMENT, avm_store_id BIGINT, qname_id BIGINT NOT NULL, actual_type_n integer NOT NULL, persisted_type_n integer NOT NULL, multi_valued bit NOT NULL, boolean_value bit, long_value BIGINT, float_value float, double_value DOUBLE PRECISION, string_value TEXT, serializable_value blob, INDEX fk_avm_sprop_store (avm_store_id), INDEX fk_avm_sprop_qname (qname_id), CONSTRAINT fk_avm_sprop_store FOREIGN KEY (avm_store_id) REFERENCES avm_stores (id), CONSTRAINT fk_avm_sprop_qname FOREIGN KEY (qname_id) REFERENCES alf_qname (id), PRIMARY KEY (id) ) ENGINE=InnoDB; --FOREACH avm_store_properties.avm_store_id system.upgrade.t_avm_store_properties.batchsize INSERT INTO t_avm_store_properties ( avm_store_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value ) SELECT p.avm_store_id, tqn.qname_id, ptypes_actual.type_id, ptypes_persisted.type_id, p.multi_valued, p.boolean_value, p.long_value, p.float_value, p.double_value, p.string_value, p.serializable_value FROM avm_store_properties p JOIN t_qnames tqn ON (p.qname = tqn.qname) JOIN t_prop_types ptypes_actual ON (ptypes_actual.type_name = p.actual_type) JOIN t_prop_types ptypes_persisted ON (ptypes_persisted.type_name = p.persisted_type) WHERE p.avm_store_id >= ${LOWERBOUND} AND p.avm_store_id <= ${UPPERBOUND} ; DROP TABLE avm_store_properties; ALTER TABLE t_avm_store_properties RENAME TO avm_store_properties; -- Modify the avm_node_properties_new table CREATE TABLE t_avm_node_properties ( node_id BIGINT NOT NULL, qname_id BIGINT NOT NULL, actual_type_n INTEGER NOT NULL, persisted_type_n INTEGER NOT NULL, multi_valued BIT NOT NULL, boolean_value BIT, long_value BIGINT, float_value FLOAT, double_value DOUBLE PRECISION, string_value TEXT, serializable_value BLOB, INDEX fk_avm_nprop_n (node_id), INDEX fk_avm_nprop_qn (qname_id), CONSTRAINT fk_avm_nprop_n FOREIGN KEY (node_id) REFERENCES avm_nodes (id), CONSTRAINT fk_avm_nprop_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id), PRIMARY KEY (node_id, qname_id) ) ENGINE=InnoDB; --FOREACH avm_node_properties_new.node_id system.upgrade.t_avm_node_properties.batchsize INSERT INTO t_avm_node_properties ( node_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value ) SELECT p.node_id, tqn.qname_id, ptypes_actual.type_id, ptypes_persisted.type_id, p.multi_valued, p.boolean_value, p.long_value, p.float_value, p.double_value, p.string_value, p.serializable_value FROM avm_node_properties_new p JOIN t_qnames tqn ON (p.qname = tqn.qname) JOIN t_prop_types ptypes_actual ON (ptypes_actual.type_name = p.actual_type) JOIN t_prop_types ptypes_persisted ON (ptypes_persisted.type_name = p.persisted_type) WHERE p.node_id >= ${LOWERBOUND} AND p.node_id <= ${UPPERBOUND} ; --FOREACH avm_node_properties.node_id system.upgrade.t_avm_node_properties.batchsize INSERT INTO t_avm_node_properties ( node_id, qname_id, actual_type_n, persisted_type_n, multi_valued, boolean_value, long_value, float_value, double_value, string_value, serializable_value ) SELECT p.node_id, tqn.qname_id, ptypes_actual.type_id, ptypes_persisted.type_id, p.multi_valued, p.boolean_value, p.long_value, p.float_value, p.double_value, p.string_value, p.serializable_value FROM avm_node_properties p JOIN t_qnames tqn ON (p.qname = tqn.qname) JOIN t_prop_types ptypes_actual ON (ptypes_actual.type_name = p.actual_type) JOIN t_prop_types ptypes_persisted ON (ptypes_persisted.type_name = p.persisted_type) LEFT OUTER JOIN t_avm_node_properties tanp ON (tqn.qname_id = tanp.qname_id) WHERE tanp.qname_id IS NULL AND p.node_id >= ${LOWERBOUND} AND p.node_id <= ${UPPERBOUND} ; DROP TABLE avm_node_properties_new; DROP TABLE avm_node_properties; ALTER TABLE t_avm_node_properties RENAME TO avm_node_properties; -- ----------------- -- Build Locales -- -- ----------------- CREATE TABLE alf_locale ( id BIGINT NOT NULL AUTO_INCREMENT, version BIGINT NOT NULL DEFAULT 1, locale_str VARCHAR(20) NOT NULL, PRIMARY KEY (id), UNIQUE (locale_str) ) ENGINE=InnoDB; INSERT INTO alf_locale (id, locale_str) VALUES (1, '.default'); -- Locales come from the attribute table which was used to support MLText persistence -- Query OK, 0 rows affected (17.22 sec) --FOREACH alf_attributes.id system.upgrade.alf_attributes.batchsize INSERT INTO alf_locale (locale_str) SELECT DISTINCT(ma.mkey) FROM alf_node_properties np JOIN alf_attributes a1 ON (np.attribute_value = a1.id) JOIN alf_map_attribute_entries ma ON (ma.map_id = a1.id) LEFT OUTER JOIN alf_locale l ON (ma.mkey = l.locale_str) WHERE l.locale_str IS NULL AND a1.id >= ${LOWERBOUND} AND a1.id <= ${UPPERBOUND} ; -- ------------------------------- -- Migrate ADM Property Tables -- -- ------------------------------- CREATE TABLE t_alf_node_properties ( node_id BIGINT NOT NULL, qname_id BIGINT NOT NULL, locale_id BIGINT NOT NULL, list_index smallint NOT NULL, actual_type_n INTEGER NOT NULL, persisted_type_n INTEGER NOT NULL, boolean_value BIT, long_value BIGINT, float_value FLOAT, double_value DOUBLE PRECISION, string_value TEXT, serializable_value BLOB, INDEX fk_alf_nprop_n (node_id), INDEX fk_alf_nprop_qn (qname_id), INDEX fk_alf_nprop_loc (locale_id), CONSTRAINT fk_alf_nprop_n FOREIGN KEY (node_id) REFERENCES t_alf_node (id), CONSTRAINT fk_alf_nprop_qn FOREIGN KEY (qname_id) REFERENCES alf_qname (id), CONSTRAINT fk_alf_nprop_loc FOREIGN KEY (locale_id) REFERENCES alf_locale (id), PRIMARY KEY (node_id, qname_id, list_index, locale_id) ) ENGINE=InnoDB; --BEGIN TXN -- Copy values over --FOREACH alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize INSERT INTO t_alf_node_properties ( node_id, qname_id, locale_id, list_index, actual_type_n, persisted_type_n, boolean_value, long_value, float_value, double_value, string_value, serializable_value ) SELECT np.node_id, tqn.qname_id, 1, -1, ptypes_actual.type_id, ptypes_persisted.type_id, np.boolean_value, np.long_value, np.float_value, np.double_value, np.string_value, np.serializable_value FROM alf_node_properties np JOIN t_qnames tqn ON (np.qname = tqn.qname) JOIN t_prop_types ptypes_actual ON (ptypes_actual.type_name = np.actual_type) JOIN t_prop_types ptypes_persisted ON (ptypes_persisted.type_name = np.persisted_type) WHERE np.attribute_value IS NULL AND np.node_id >= ${LOWERBOUND} AND np.node_id <= ${UPPERBOUND} ; -- Update cm:auditable properties on the nodes --FOREACH t_alf_node.id system.upgrade.t_alf_node.batchsize UPDATE t_alf_node n SET audit_creator = ( SELECT string_value FROM t_alf_node_properties np JOIN alf_qname qn ON (np.qname_id = qn.id) JOIN alf_namespace ns ON (qn.ns_id = ns.id) WHERE np.node_id = n.id AND ns.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND qn.local_name = 'creator' ) WHERE n.id >= ${LOWERBOUND} AND n.id <= ${UPPERBOUND}; --FOREACH t_alf_node.id system.upgrade.t_alf_node.batchsize UPDATE t_alf_node n SET audit_created = ( SELECT string_value FROM t_alf_node_properties np JOIN alf_qname qn ON (np.qname_id = qn.id) JOIN alf_namespace ns ON (qn.ns_id = ns.id) WHERE np.node_id = n.id AND ns.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND qn.local_name = 'created' ) WHERE n.id >= ${LOWERBOUND} AND n.id <= ${UPPERBOUND}; --FOREACH t_alf_node.id system.upgrade.t_alf_node.batchsize UPDATE t_alf_node n SET audit_modifier = ( SELECT string_value FROM t_alf_node_properties np JOIN alf_qname qn ON (np.qname_id = qn.id) JOIN alf_namespace ns ON (qn.ns_id = ns.id) WHERE np.node_id = n.id AND ns.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND qn.local_name = 'modifier' ) WHERE n.id >= ${LOWERBOUND} AND n.id <= ${UPPERBOUND}; --FOREACH t_alf_node.id system.upgrade.t_alf_node.batchsize UPDATE t_alf_node n SET audit_modified = ( SELECT string_value FROM t_alf_node_properties np JOIN alf_qname qn ON (np.qname_id = qn.id) JOIN alf_namespace ns ON (qn.ns_id = ns.id) WHERE np.node_id = n.id AND ns.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND qn.local_name = 'modified' ) WHERE n.id >= ${LOWERBOUND} AND n.id <= ${UPPERBOUND}; -- Remove the unused cm:auditable properties -- SHORTCUT: -- The qname_id values can be determined up front -- SELECT * FROM -- alf_qname -- JOIN alf_namespace ON (alf_qname.ns_id = alf_namespace.id) -- WHERE -- alf_namespace.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND -- alf_qname.local_name IN ('creator', 'created', 'modifier', 'modified') -- ; -- DELETE t_alf_node_properties -- FROM t_alf_node_properties -- WHERE -- qname_id IN (13, 14, 23, 24); --FOREACH t_alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize DELETE t_alf_node_properties FROM t_alf_node_properties JOIN alf_qname ON (t_alf_node_properties.qname_id = alf_qname.id) JOIN alf_namespace ON (alf_qname.ns_id = alf_namespace.id) WHERE alf_namespace.uri = 'FILLER-http://www.alfresco.org/model/content/1.0' AND alf_qname.local_name IN ('creator', 'created', 'modifier', 'modified') AND t_alf_node_properties.node_id >= ${LOWERBOUND} AND t_alf_node_properties.node_id <= ${UPPERBOUND} ; -- Copy all MLText values over --FOREACH alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize INSERT INTO t_alf_node_properties ( node_id, qname_id, locale_id, list_index, actual_type_n, persisted_type_n, boolean_value, long_value, float_value, double_value, string_value, serializable_value ) SELECT np.node_id, tqn.qname_id, loc.id, -1, -1, 0, FALSE, 0, 0, 0, a2.string_value, a2.serializable_value FROM alf_node_properties np JOIN t_qnames tqn ON (np.qname = tqn.qname) JOIN alf_attributes a1 ON (np.attribute_value = a1.id) JOIN alf_map_attribute_entries ma ON (ma.map_id = a1.id) JOIN alf_locale loc ON (ma.mkey = loc.locale_str) JOIN alf_attributes a2 ON (ma.attribute_id = a2.id) WHERE np.node_id >= ${LOWERBOUND} AND np.node_id <= ${UPPERBOUND} ; -- (OPTIONAL) --FOREACH t_alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize UPDATE t_alf_node_properties SET actual_type_n = 6, persisted_type_n = 6, serializable_value = NULL WHERE actual_type_n = -1 AND string_value IS NOT NULL AND t_alf_node_properties.node_id >= ${LOWERBOUND} AND t_alf_node_properties.node_id <= ${UPPERBOUND} ; --FOREACH t_alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize UPDATE t_alf_node_properties SET actual_type_n = 9, persisted_type_n = 9 WHERE actual_type_n = -1 AND serializable_value IS NOT NULL AND t_alf_node_properties.node_id >= ${LOWERBOUND} AND t_alf_node_properties.node_id <= ${UPPERBOUND} ; --FOREACH t_alf_node_properties.node_id system.upgrade.t_alf_node_properties.batchsize DELETE FROM t_alf_node_properties WHERE actual_type_n = -1 AND t_alf_node_properties.node_id >= ${LOWERBOUND} AND t_alf_node_properties.node_id <= ${UPPERBOUND} ; -- Delete the node properties and move the fixed values over DROP TABLE alf_node_properties; ALTER TABLE t_alf_node_properties RENAME TO alf_node_properties; CREATE TABLE t_del_attributes ( id BIGINT NOT NULL, PRIMARY KEY (id) ); INSERT INTO t_del_attributes SELECT id FROM alf_attributes WHERE type = 'M' ; DELETE t_del_attributes FROM t_del_attributes JOIN alf_map_attribute_entries ma ON (ma.attribute_id = t_del_attributes.id) ; DELETE t_del_attributes FROM t_del_attributes JOIN alf_list_attribute_entries la ON (la.attribute_id = t_del_attributes.id) ; DELETE t_del_attributes FROM t_del_attributes JOIN alf_global_attributes ga ON (ga.attribute = t_del_attributes.id) ; INSERT INTO t_del_attributes SELECT a.id FROM t_del_attributes t JOIN alf_map_attribute_entries ma ON (ma.map_id = t.id) JOIN alf_attributes a ON (ma.attribute_id = a.id) ; DELETE alf_map_attribute_entries FROM alf_map_attribute_entries JOIN t_del_attributes t ON (alf_map_attribute_entries.map_id = t.id) ; DELETE alf_list_attribute_entries FROM alf_list_attribute_entries JOIN t_del_attributes t ON (alf_list_attribute_entries.list_id = t.id) ; DELETE alf_attributes FROM alf_attributes JOIN t_del_attributes t ON (alf_attributes.id = t.id) ; DROP TABLE t_del_attributes; -- --------------------------------------------------- -- Remove the FILLER- values from the namespace uri -- -- --------------------------------------------------- UPDATE alf_namespace SET uri = '.empty' WHERE uri = 'FILLER-'; UPDATE alf_namespace SET uri = SUBSTR(uri, 8) WHERE uri LIKE 'FILLER-%'; -- ------------------ -- Final clean up -- -- ------------------ DROP TABLE t_qnames; DROP TABLE t_prop_types; DROP TABLE alf_node_status; ALTER TABLE alf_store DROP INDEX FKBD4FF53D22DBA5BA, DROP FOREIGN KEY FKBD4FF53D22DBA5BA; -- (OPTIONAL) ALTER TABLE alf_store DROP FOREIGN KEY alf_store_root; -- (OPTIONAL) DROP TABLE alf_node; ALTER TABLE t_alf_node RENAME TO alf_node; DROP TABLE alf_store; ALTER TABLE t_alf_store RENAME TO alf_store; -- ------------------------------------- -- Modify index and constraint names -- -- ------------------------------------- ALTER TABLE alf_attributes DROP INDEX fk_attributes_n_acl, DROP FOREIGN KEY fk_attributes_n_acl; -- (optional) ALTER TABLE alf_attributes DROP INDEX fk_attr_n_acl, DROP FOREIGN KEY fk_attr_n_acl; -- (optional) ALTER TABLE alf_attributes ADD INDEX fk_alf_attr_acl (acl_id) ; ALTER TABLE alf_global_attributes DROP FOREIGN KEY FK64D0B9CF69B9F16A; -- (optional) ALTER TABLE alf_global_attributes DROP INDEX FK64D0B9CF69B9F16A; -- (optional) -- alf_global_attributes.attribute is declared unique. Indexes may automatically have been created. ALTER TABLE alf_global_attributes ADD INDEX fk_alf_gatt_att (attribute); -- (optional) ALTER TABLE alf_global_attributes ADD CONSTRAINT fk_alf_gatt_att FOREIGN KEY (attribute) REFERENCES alf_attributes (id) ; ALTER TABLE alf_list_attribute_entries DROP INDEX FKC7D52FB02C5AB86C, DROP FOREIGN KEY FKC7D52FB02C5AB86C; -- (optional) ALTER TABLE alf_list_attribute_entries DROP INDEX FKC7D52FB0ACD8822C, DROP FOREIGN KEY FKC7D52FB0ACD8822C; -- (optional) ALTER TABLE alf_list_attribute_entries ADD INDEX fk_alf_lent_att (attribute_id), ADD CONSTRAINT fk_alf_lent_att FOREIGN KEY (attribute_id) REFERENCES alf_attributes (id), ADD INDEX fk_alf_lent_latt (list_id), ADD CONSTRAINT fk_alf_lent_latt FOREIGN KEY (list_id) REFERENCES alf_attributes (id) ; ALTER TABLE alf_map_attribute_entries DROP INDEX FK335CAE26AEAC208C, DROP FOREIGN KEY FK335CAE26AEAC208C; -- (optional) ALTER TABLE alf_map_attribute_entries DROP INDEX FK335CAE262C5AB86C, DROP FOREIGN KEY FK335CAE262C5AB86C; -- (optional) ALTER TABLE alf_map_attribute_entries ADD INDEX fk_alf_matt_matt (map_id), ADD CONSTRAINT fk_alf_matt_matt FOREIGN KEY (map_id) REFERENCES alf_attributes (id), ADD INDEX fk_alf_matt_att (attribute_id), ADD CONSTRAINT fk_alf_matt_att FOREIGN KEY (attribute_id) REFERENCES alf_attributes (id) ; ALTER TABLE alf_transaction DROP INDEX idx_commit_time_ms; -- (optional) ALTER TABLE alf_transaction ADD COLUMN commit_time_ms BIGINT NULL ; -- (optional) ALTER TABLE alf_transaction DROP INDEX FKB8761A3A9AE340B7, DROP FOREIGN KEY FKB8761A3A9AE340B7, ADD INDEX fk_alf_txn_svr (server_id), ADD CONSTRAINT fk_alf_txn_svr FOREIGN KEY (server_id) REFERENCES alf_server (id), ADD INDEX idx_alf_txn_ctms (commit_time_ms) ; UPDATE alf_transaction SET commit_time_ms = id WHERE commit_time_ms IS NULL; ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_child, DROP FOREIGN KEY fk_avm_ce_child; -- (optional) ALTER TABLE avm_child_entries DROP INDEX fk_avm_ce_parent, DROP FOREIGN KEY fk_avm_ce_parent; -- (optional) ALTER TABLE avm_child_entries ADD INDEX fk_avm_ce_child (child_id), ADD CONSTRAINT fk_avm_ce_child FOREIGN KEY (child_id) REFERENCES avm_nodes (id), ADD INDEX fk_avm_ce_parent (parent_id), ADD CONSTRAINT fk_avm_ce_parent FOREIGN KEY (parent_id) REFERENCES avm_nodes (id) ; ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_desc, DROP FOREIGN KEY fk_avm_hl_desc; -- (optional) ALTER TABLE avm_history_links DROP INDEX fk_avm_hl_ancestor, DROP FOREIGN KEY fk_avm_hl_ancestor; -- (optional) ALTER TABLE avm_history_links DROP INDEX idx_avm_hl_revpk; -- (optional) ALTER TABLE avm_history_links ADD INDEX fk_avm_hl_desc (descendent), ADD CONSTRAINT fk_avm_hl_desc FOREIGN KEY (descendent) REFERENCES avm_nodes (id), ADD INDEX fk_avm_hl_ancestor (ancestor), ADD CONSTRAINT fk_avm_hl_ancestor FOREIGN KEY (ancestor) REFERENCES avm_nodes (id), ADD INDEX idx_avm_hl_revpk (descendent, ancestor) ; ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_to, DROP FOREIGN KEY fk_avm_ml_to; -- (optional) ALTER TABLE avm_merge_links DROP INDEX fk_avm_ml_from, DROP FOREIGN KEY fk_avm_ml_from; -- (optional) ALTER TABLE avm_merge_links ADD INDEX fk_avm_ml_to (mto), ADD CONSTRAINT fk_avm_ml_to FOREIGN KEY (mto) REFERENCES avm_nodes (id), ADD INDEX fk_avm_ml_from (mfrom), ADD CONSTRAINT fk_avm_ml_from FOREIGN KEY (mfrom) REFERENCES avm_nodes (id) ; ALTER TABLE avm_nodes DROP INDEX fk_avm_n_acl, DROP FOREIGN KEY fk_avm_n_acl; -- (optional) ALTER TABLE avm_nodes DROP INDEX fk_avm_n_store, DROP FOREIGN KEY fk_avm_n_store; -- (optional) ALTER TABLE avm_nodes DROP INDEX idx_avm_n_pi; -- (optional) ALTER TABLE avm_nodes ADD INDEX fk_avm_n_acl (acl_id), ADD CONSTRAINT fk_avm_n_acl FOREIGN KEY (acl_id) REFERENCES alf_access_control_list (id), ADD INDEX fk_avm_n_store (store_new_id), ADD CONSTRAINT fk_avm_n_store FOREIGN KEY (store_new_id) REFERENCES avm_stores (id), ADD INDEX idx_avm_n_pi (primary_indirection) ; ALTER TABLE avm_stores DROP INDEX fk_avm_s_root, DROP FOREIGN KEY fk_avm_s_root; -- (optional) ALTER TABLE avm_stores ADD INDEX fk_avm_s_acl (acl_id), ADD CONSTRAINT fk_avm_s_acl FOREIGN KEY (acl_id) REFERENCES alf_access_control_list (id), ADD INDEX fk_avm_s_root (current_root_id), ADD CONSTRAINT fk_avm_s_root FOREIGN KEY (current_root_id) REFERENCES avm_nodes (id) ; ALTER TABLE avm_version_layered_node_entry DROP INDEX FK182E672DEB9D70C, DROP FOREIGN KEY FK182E672DEB9D70C; -- (optional) ALTER TABLE avm_version_layered_node_entry ADD INDEX fk_avm_vlne_vr (version_root_id), ADD CONSTRAINT fk_avm_vlne_vr FOREIGN KEY (version_root_id) REFERENCES avm_version_roots (id) ; ALTER TABLE avm_version_roots DROP INDEX idx_avm_vr_version; -- (optional) ALTER TABLE avm_version_roots DROP INDEX idx_avm_vr_revuq; -- (optional) ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_root, DROP FOREIGN KEY fk_avm_vr_root; -- (optional) ALTER TABLE avm_version_roots DROP INDEX fk_avm_vr_store, DROP FOREIGN KEY fk_avm_vr_store; -- (optional) ALTER TABLE avm_version_roots ADD INDEX idx_avm_vr_version (version_id), ADD INDEX idx_avm_vr_revuq (avm_store_id, version_id), ADD INDEX fk_avm_vr_root (root_id), ADD CONSTRAINT fk_avm_vr_root FOREIGN KEY (root_id) REFERENCES avm_nodes (id), ADD INDEX fk_avm_vr_store (avm_store_id), ADD CONSTRAINT fk_avm_vr_store FOREIGN KEY (avm_store_id) REFERENCES avm_stores (id) ; -- -- Record script finish -- DELETE FROM alf_applied_patch WHERE id = 'patch.db-V2.2-Upgrade-From-2.1'; INSERT INTO alf_applied_patch (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report) VALUES ( 'patch.db-V2.2-Upgrade-From-2.1', 'Manually executed script upgrade V2.2: Upgrade from 2.1', 0, 85, -1, 91, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed' );
-- ################################ -- USER MANAGER TABLES -- ################################ CREATE TABLE IF NOT EXISTS UM_TENANT ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_TENANT_UUID VARCHAR(36) NOT NULL, UM_DOMAIN_NAME VARCHAR(255) NOT NULL, UM_EMAIL VARCHAR(255), UM_ACTIVE BOOLEAN DEFAULT FALSE, UM_CREATED_DATE TIMESTAMP NOT NULL, UM_USER_CONFIG LONGBLOB NOT NULL, PRIMARY KEY (UM_ID), UNIQUE(UM_DOMAIN_NAME), UNIQUE(UM_TENANT_UUID)); CREATE TABLE IF NOT EXISTS UM_DOMAIN( UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, UM_DOMAIN_NAME VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID), UNIQUE(UM_DOMAIN_NAME,UM_TENANT_ID) ); CREATE INDEX IF NOT EXISTS INDEX_UM_TENANT_UM_DOMAIN_NAME ON UM_TENANT (UM_DOMAIN_NAME); CREATE TABLE IF NOT EXISTS UM_USER ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_ID VARCHAR(255) NOT NULL, UM_USER_NAME VARCHAR(255) NOT NULL, UM_USER_PASSWORD VARCHAR(255) NOT NULL, UM_SALT_VALUE VARCHAR(31), UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, UM_CHANGED_TIME TIMESTAMP NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID), UNIQUE(UM_USER_ID, UM_TENANT_ID)); CREATE INDEX IF NOT EXISTS INDEX_UM_USERNAME_UM_TENANT_ID ON UM_USER(UM_USER_NAME, UM_TENANT_ID); CREATE TABLE IF NOT EXISTS UM_SYSTEM_USER ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_NAME VARCHAR(255) NOT NULL, UM_USER_PASSWORD VARCHAR(255) NOT NULL, UM_SALT_VALUE VARCHAR(31), UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, UM_CHANGED_TIME TIMESTAMP NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID), UNIQUE(UM_USER_NAME, UM_TENANT_ID)); CREATE TABLE IF NOT EXISTS UM_USER_ATTRIBUTE ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_ATTR_NAME VARCHAR(255) NOT NULL, UM_ATTR_VALUE VARCHAR(1024), UM_PROFILE_ID VARCHAR(255), UM_USER_ID INTEGER, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID), FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID)); CREATE INDEX IF NOT EXISTS UM_USER_ID_INDEX ON UM_USER_ATTRIBUTE(UM_USER_ID); CREATE INDEX IF NOT EXISTS UM_ATTR_NAME_VALUE_INDEX ON UM_USER_ATTRIBUTE(UM_ATTR_NAME, UM_ATTR_VALUE); CREATE TABLE IF NOT EXISTS UM_ROLE ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_ROLE_NAME VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, PRIMARY KEY (UM_ID, UM_TENANT_ID), UNIQUE(UM_ROLE_NAME, UM_TENANT_ID)); CREATE TABLE IF NOT EXISTS UM_MODULE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_MODULE_NAME VARCHAR(100), UNIQUE(UM_MODULE_NAME), PRIMARY KEY(UM_ID) ); CREATE TABLE IF NOT EXISTS UM_MODULE_ACTIONS( UM_ACTION VARCHAR(255) NOT NULL, UM_MODULE_ID INTEGER NOT NULL, PRIMARY KEY(UM_ACTION, UM_MODULE_ID), FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS UM_PERMISSION ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_RESOURCE_ID VARCHAR(255) NOT NULL, UM_ACTION VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UM_MODULE_ID INTEGER DEFAULT 0, UNIQUE(UM_RESOURCE_ID,UM_ACTION, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID)); CREATE INDEX IF NOT EXISTS INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); CREATE TABLE IF NOT EXISTS UM_ROLE_PERMISSION ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_PERMISSION_ID INTEGER NOT NULL, UM_ROLE_NAME VARCHAR(255) NOT NULL, UM_IS_ALLOWED SMALLINT NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UM_DOMAIN_ID INTEGER, FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, PRIMARY KEY (UM_ID, UM_TENANT_ID)); CREATE TABLE IF NOT EXISTS UM_USER_PERMISSION ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_PERMISSION_ID INTEGER NOT NULL, UM_USER_NAME VARCHAR(255) NOT NULL, UM_IS_ALLOWED SMALLINT NOT NULL, UNIQUE (UM_PERMISSION_ID, UM_USER_NAME, UM_TENANT_ID), UM_TENANT_ID INTEGER DEFAULT 0, FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, PRIMARY KEY (UM_ID, UM_TENANT_ID)); CREATE TABLE IF NOT EXISTS UM_USER_ROLE ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_ROLE_ID INTEGER NOT NULL, UM_USER_ID INTEGER NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID)); CREATE TABLE IF NOT EXISTS UM_SHARED_USER_ROLE( UM_ROLE_ID INTEGER NOT NULL, UM_USER_ID INTEGER NOT NULL, UM_USER_TENANT_ID INTEGER NOT NULL, UM_ROLE_TENANT_ID INTEGER NOT NULL, UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE , FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS UM_ACCOUNT_MAPPING( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_NAME VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER NOT NULL, UM_USER_STORE_DOMAIN VARCHAR(100), UM_ACC_LINK_ID INTEGER NOT NULL, UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, PRIMARY KEY (UM_ID) ); CREATE TABLE IF NOT EXISTS UM_DIALECT( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_DIALECT_URI VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_CLAIM( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_DIALECT_ID INTEGER NOT NULL, UM_CLAIM_URI VARCHAR(255) NOT NULL, UM_DISPLAY_TAG VARCHAR(255), UM_DESCRIPTION VARCHAR(255), UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), UM_MAPPED_ATTRIBUTE VARCHAR(255), UM_REG_EX VARCHAR(255), UM_SUPPORTED SMALLINT, UM_REQUIRED SMALLINT, UM_DISPLAY_ORDER INTEGER, UM_CHECKED_ATTRIBUTE SMALLINT, UM_READ_ONLY SMALLINT, UM_TENANT_ID INTEGER DEFAULT 0, UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI,UM_MAPPED_ATTRIBUTE_DOMAIN, UM_TENANT_ID), FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_PROFILE_CONFIG( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_DIALECT_ID INTEGER, UM_PROFILE_NAME VARCHAR(255), UM_TENANT_ID INTEGER DEFAULT 0, FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_CLAIM_BEHAVIOR( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_PROFILE_ID INTEGER, UM_CLAIM_ID INTEGER, UM_BEHAVIOUR SMALLINT, UM_TENANT_ID INTEGER DEFAULT 0, FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID,UM_TENANT_ID), FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID,UM_TENANT_ID), PRIMARY KEY(UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_HYBRID_ROLE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_ROLE_NAME VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID), UNIQUE (UM_ROLE_NAME, UM_TENANT_ID) ); CREATE INDEX IF NOT EXISTS UM_ROLE_NAME_IND ON UM_HYBRID_ROLE(UM_ROLE_NAME); CREATE TABLE IF NOT EXISTS UM_HYBRID_USER_ROLE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_NAME VARCHAR(255), UM_ROLE_ID INTEGER NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UM_DOMAIN_ID INTEGER, UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID,UM_DOMAIN_ID), FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_HYBRID_GROUP_ROLE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_GROUP_NAME VARCHAR(255), UM_ROLE_ID INTEGER NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UM_DOMAIN_ID INTEGER, UNIQUE (UM_GROUP_NAME, UM_ROLE_ID, UM_TENANT_ID,UM_DOMAIN_ID), FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_HYBRID_REMEMBER_ME ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_NAME VARCHAR(255) NOT NULL, UM_COOKIE_VALUE VARCHAR(1024), UM_CREATED_TIME TIMESTAMP, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_SYSTEM_ROLE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_ROLE_NAME VARCHAR(255) NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID, UM_TENANT_ID), UNIQUE(UM_ROLE_NAME,UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_SYSTEM_USER_ROLE( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_NAME VARCHAR(255), UM_ROLE_ID INTEGER NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), PRIMARY KEY (UM_ID, UM_TENANT_ID) ); CREATE TABLE IF NOT EXISTS UM_UUID_DOMAIN_MAPPER ( UM_ID INTEGER NOT NULL AUTO_INCREMENT, UM_USER_ID VARCHAR(255) NOT NULL, UM_DOMAIN_ID INTEGER NOT NULL, UM_TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (UM_ID), UNIQUE (UM_USER_ID), FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE ); CREATE INDEX IF NOT EXISTS UUID_DM_UID_TID ON UM_UUID_DOMAIN_MAPPER(UM_USER_ID, UM_TENANT_ID);
create table orders ( id bigserial not null, user_id bigint not null, cart_id bigint not null, order_detail text, order_status text, payment_amount bigint not null, payment_status text, created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(), constraint orders_pkey primary key (id) ) with (OIDS = FALSE);
DROP TABLE TRANSACTION; DROP TABLE CLIENT;
/* Navicat Premium Data Transfer Source Server : server.cuci.cc Source Server Type : MySQL Source Server Version : 50561 Source Host : server.cuci.cc:3306 Source Schema : framework Target Server Type : MySQL Target Server Version : 50561 File Encoding : 65001 Date: 26/10/2018 12:41:48 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for store_goods -- ---------------------------- DROP TABLE IF EXISTS `store_goods`; CREATE TABLE `store_goods` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `title` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品标题', `logo` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品图标', `specs` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品规格JSON', `lists` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品列表JSON', `image` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品图片', `content` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品内容', `number_sales` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '销售数量', `number_stock` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '库库数量', `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '销售状态', `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', `is_deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城商品主表' ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for store_goods_list -- ---------------------------- DROP TABLE IF EXISTS `store_goods_list`; CREATE TABLE `store_goods_list` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `goods_id` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品ID', `goods_spec` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '商品规格', `price_market` decimal(20, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '商品标价', `price_selling` decimal(20, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '商品售价', `number_sales` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '销售数量', `number_stock` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品库存', `number_virtual` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '虚拟销量', `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '商品状态', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `index_store_goods_list_id`(`goods_id`) USING BTREE, INDEX `index_store_goods_list_spec`(`goods_spec`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城商品规格' ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for store_goods_stock -- ---------------------------- DROP TABLE IF EXISTS `store_goods_stock`; CREATE TABLE `store_goods_stock` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `goods_id` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品ID', `goods_spec` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '商品规格', `number_stock` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品库存', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `index_store_goods_stock_gid`(`goods_id`) USING BTREE, INDEX `index_store_goods_stock_spec`(`goods_spec`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商城商品规格' ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for system_auth -- ---------------------------- DROP TABLE IF EXISTS `system_auth`; CREATE TABLE `system_auth` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名称', `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '权限状态', `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注说明', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `index_system_auth_title`(`title`) USING BTREE, INDEX `index_system_auth_status`(`status`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统权限' ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for system_auth_node -- ---------------------------- DROP TABLE IF EXISTS `system_auth_node`; CREATE TABLE `system_auth_node` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `auth` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '角色', `node` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点', PRIMARY KEY (`id`) USING BTREE, INDEX `index_system_auth_auth`(`auth`) USING BTREE, INDEX `index_system_auth_node`(`node`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统授权' ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for system_config -- ---------------------------- DROP TABLE IF EXISTS `system_config`; CREATE TABLE `system_config` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '配置名', `value` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '配置值', PRIMARY KEY (`id`) USING BTREE, INDEX `index_system_config_name`(`name`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统配置' ROW_FORMAT = Compact; -- ---------------------------- -- Records of system_config -- ---------------------------- INSERT INTO `system_config` VALUES (1, 'app_name', 'Framework'); INSERT INTO `system_config` VALUES (2, 'site_name', '基线开发平台'); INSERT INTO `system_config` VALUES (3, 'app_version', 'v1.0'); INSERT INTO `system_config` VALUES (4, 'site_copy', '©版权所有 2014-2018 楚才科技'); INSERT INTO `system_config` VALUES (5, 'site_icon', '/upload/f47b8fe06e38ae99/08e8398da45583b9.png'); INSERT INTO `system_config` VALUES (7, 'miitbeian', '粤ICP备16006642号-2'); INSERT INTO `system_config` VALUES (8, 'storage_type', 'local'); INSERT INTO `system_config` VALUES (9, 'storage_local_exts', 'png,jpg,rar,doc,icon,mp4'); INSERT INTO `system_config` VALUES (10, 'storage_qiniu_bucket', '用你自己的'); INSERT INTO `system_config` VALUES (11, 'storage_qiniu_domain', '用你自己的'); INSERT INTO `system_config` VALUES (12, 'storage_qiniu_access_key', '用你自己的'); INSERT INTO `system_config` VALUES (13, 'storage_qiniu_secret_key', '用你自己的'); INSERT INTO `system_config` VALUES (14, 'storage_oss_bucket', '用你自己的'); INSERT INTO `system_config` VALUES (15, 'storage_oss_endpoint', '用你自己的'); INSERT INTO `system_config` VALUES (16, 'storage_oss_domain', '用你自己的'); INSERT INTO `system_config` VALUES (17, 'storage_oss_keyid', '用你自己的'); INSERT INTO `system_config` VALUES (18, 'storage_oss_secret', '用你自己的'); INSERT INTO `system_config` VALUES (36, 'storage_oss_is_https', '用你自己的'); INSERT INTO `system_config` VALUES (43, 'storage_qiniu_region', '用你自己的'); INSERT INTO `system_config` VALUES (44, 'storage_qiniu_is_https', '用你自己的'); -- ---------------------------- -- Table structure for system_menu -- ---------------------------- DROP TABLE IF EXISTS `system_menu`; CREATE TABLE `system_menu` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `pid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '父ID', `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '名称', `node` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '节点代码', `icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单图标', `url` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '链接', `params` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '链接参数', `target` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '_self' COMMENT '打开方式', `sort` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '菜单排序', `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `index_system_menu_node`(`node`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统菜单' ROW_FORMAT = Compact; -- ---------------------------- -- Records of system_menu -- ---------------------------- INSERT INTO `system_menu` VALUES (1, 0, '后台首页', '', '', 'admin/index/main', '', '_self', 100, 1, '2018-09-05 17:59:38'); INSERT INTO `system_menu` VALUES (2, 0, '系统管理', '', '', '#', '', '_self', 300, 1, '2018-09-05 18:04:52'); INSERT INTO `system_menu` VALUES (3, 12, '系统菜单', '', 'layui-icon layui-icon-layouts', 'admin/menu/index', '', '_self', 3, 1, '2018-09-05 18:05:26'); INSERT INTO `system_menu` VALUES (4, 2, '系统配置', '', '', '#', '', '_self', 10, 1, '2018-09-05 18:07:17'); INSERT INTO `system_menu` VALUES (5, 12, '用户管理', '', 'far fa-user', 'admin/user/index', '', '_self', 4, 1, '2018-09-06 11:10:42'); INSERT INTO `system_menu` VALUES (6, 12, '节点管理', '', 'layui-icon layui-icon-template', 'admin/node/index', '', '_self', 1, 1, '2018-09-06 14:16:13'); INSERT INTO `system_menu` VALUES (7, 12, '权限管理', '', 'layui-icon layui-icon-vercode', 'admin/auth/index', '', '_self', 2, 1, '2018-09-06 15:17:14'); INSERT INTO `system_menu` VALUES (10, 4, '文件存储', '', 'layui-icon layui-icon-template-1', 'admin/config/file', '', '_self', 2, 1, '2018-09-06 16:43:19'); INSERT INTO `system_menu` VALUES (11, 4, '系统参数', '', 'layui-icon layui-icon-set', 'admin/config/info', '', '_self', 1, 1, '2018-09-06 16:43:47'); INSERT INTO `system_menu` VALUES (12, 2, '权限管理', '', '', '#', '', '_self', 20, 1, '2018-09-06 18:01:31'); INSERT INTO `system_menu` VALUES (13, 0, '商城管理', '', '', '#', '', '_self', 200, 1, '2018-10-12 13:56:29'); INSERT INTO `system_menu` VALUES (14, 13, '商品管理', '', '', 'store/goods/index', '', '_self', 0, 1, '2018-10-12 13:56:48'); INSERT INTO `system_menu` VALUES (15, 13, '商品列表', '', 'fab fa-palfed', 'store/goods/index', '', '_self', 0, 1, '2018-10-12 13:57:37'); -- ---------------------------- -- Table structure for system_node -- ---------------------------- DROP TABLE IF EXISTS `system_node`; CREATE TABLE `system_node` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `node` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点代码', `title` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点标题', `is_menu` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否可设置为菜单', `is_auth` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否启动RBAC权限控制', `is_login` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否启动登录控制', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `index_system_node_node`(`node`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统节点' ROW_FORMAT = Compact; -- ---------------------------- -- Records of system_node -- ---------------------------- INSERT INTO `system_node` VALUES (1, 'admin', '系统管理', 0, 1, 1, '2018-09-06 14:20:42'); INSERT INTO `system_node` VALUES (2, 'admin/menu', '菜单管理', 0, 1, 1, '2018-09-06 14:23:01'); INSERT INTO `system_node` VALUES (3, 'admin/menu/index', '菜单列表', 1, 1, 1, '2018-09-06 14:23:01'); INSERT INTO `system_node` VALUES (4, 'admin/menu/edit', '编辑菜单', 0, 1, 1, '2018-09-06 14:23:01'); INSERT INTO `system_node` VALUES (5, 'admin/menu/add', '添加菜单', 0, 1, 1, '2018-09-06 14:23:01'); INSERT INTO `system_node` VALUES (6, 'admin/menu/resume', '启用菜单', 0, 1, 1, '2018-09-06 14:23:01'); INSERT INTO `system_node` VALUES (7, 'admin/menu/forbid', '禁用菜单', 0, 1, 1, '2018-09-06 14:23:02'); INSERT INTO `system_node` VALUES (8, 'admin/menu/del', '删除菜单', 0, 1, 1, '2018-09-06 14:23:02'); INSERT INTO `system_node` VALUES (9, 'admin/node/index', '节点列表', 1, 1, 1, '2018-09-06 14:24:20'); INSERT INTO `system_node` VALUES (10, 'admin/node/clear', '清理节点', 0, 1, 1, '2018-09-06 14:24:20'); INSERT INTO `system_node` VALUES (11, 'admin/node/save', '更新节点', 0, 1, 1, '2018-09-06 14:24:20'); INSERT INTO `system_node` VALUES (12, 'admin/user/index', '用户列表', 1, 1, 1, '2018-09-06 14:24:21'); INSERT INTO `system_node` VALUES (13, 'admin/user/auth', '用户授权', 0, 1, 1, '2018-09-06 14:24:21'); INSERT INTO `system_node` VALUES (14, 'admin/user/add', '添加用户', 0, 1, 1, '2018-09-06 14:24:21'); INSERT INTO `system_node` VALUES (15, 'admin/user/edit', '编辑用户', 0, 1, 1, '2018-09-06 14:24:21'); INSERT INTO `system_node` VALUES (16, 'admin/user/pass', '修改密码', 0, 1, 1, '2018-09-06 14:24:22'); INSERT INTO `system_node` VALUES (17, 'admin/user/del', '删除用户', 0, 1, 1, '2018-09-06 14:24:22'); INSERT INTO `system_node` VALUES (18, 'admin/user/forbid', '禁用用户', 0, 1, 1, '2018-09-06 14:24:22'); INSERT INTO `system_node` VALUES (19, 'admin/user/resume', '启用用户', 0, 1, 1, '2018-09-06 14:24:22'); INSERT INTO `system_node` VALUES (20, 'admin/node', '节点管理', 0, 1, 1, '2018-09-06 14:35:36'); INSERT INTO `system_node` VALUES (21, 'admin/user', '用户管理', 0, 1, 1, '2018-09-06 14:36:09'); INSERT INTO `system_node` VALUES (22, 'admin/auth', '权限管理', 0, 1, 1, '2018-09-06 15:16:10'); INSERT INTO `system_node` VALUES (23, 'admin/auth/index', '权限列表', 1, 1, 1, '2018-09-06 15:16:10'); INSERT INTO `system_node` VALUES (24, 'admin/auth/apply', '节点授权', 0, 1, 1, '2018-09-06 15:16:10'); INSERT INTO `system_node` VALUES (25, 'admin/auth/add', '添加授权', 0, 1, 1, '2018-09-06 15:16:10'); INSERT INTO `system_node` VALUES (26, 'admin/auth/edit', '编辑权限', 0, 1, 1, '2018-09-06 15:16:10'); INSERT INTO `system_node` VALUES (27, 'admin/auth/forbid', '禁用权限', 0, 1, 1, '2018-09-06 15:16:11'); INSERT INTO `system_node` VALUES (28, 'admin/auth/resume', '启用权限', 0, 1, 1, '2018-09-06 15:16:11'); INSERT INTO `system_node` VALUES (29, 'admin/auth/del', '删除权限', 0, 1, 1, '2018-09-06 15:16:11'); INSERT INTO `system_node` VALUES (30, 'admin/config', '参数配置', 0, 1, 1, '2018-09-06 16:41:18'); INSERT INTO `system_node` VALUES (32, 'admin/config/file', '文件存储', 1, 1, 1, '2018-09-06 16:41:19'); INSERT INTO `system_node` VALUES (34, 'admin/config/info', '系统信息', 1, 1, 1, '2018-09-06 16:42:10'); INSERT INTO `system_node` VALUES (36, 'store/goods/index', '商品列表', 1, 1, 1, '2018-10-12 13:54:45'); INSERT INTO `system_node` VALUES (37, 'store/goods/add', '添加商品', 0, 1, 1, '2018-10-12 13:54:45'); INSERT INTO `system_node` VALUES (38, 'store/goods/edit', '编辑商品', 0, 1, 1, '2018-10-12 13:54:46'); INSERT INTO `system_node` VALUES (39, 'store', '商城管理', 0, 1, 1, '2018-10-12 13:54:53'); INSERT INTO `system_node` VALUES (40, 'store/goods', '商品管理', 0, 1, 1, '2018-10-12 13:55:20'); INSERT INTO `system_node` VALUES (41, 'store/goods/forbid', '禁用商品', 0, 1, 1, '2018-10-12 16:49:02'); INSERT INTO `system_node` VALUES (42, 'store/goods/resume', '启用商品', 0, 1, 1, '2018-10-16 18:31:42'); INSERT INTO `system_node` VALUES (43, 'store/goods/del', '删除商品', 0, 1, 1, '2018-10-16 18:31:50'); INSERT INTO `system_node` VALUES (44, 'store/goods/stock', '商品入库', 0, 1, 1, '2018-10-22 17:58:37'); -- ---------------------------- -- Table structure for system_user -- ---------------------------- DROP TABLE IF EXISTS `system_user`; CREATE TABLE `system_user` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户账号', `password` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户密码', `qq` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '联系QQ', `mail` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '联系邮箱', `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '联系手机号', `login_at` datetime NULL DEFAULT NULL COMMENT '登录时间', `login_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '登录IP', `login_num` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '登录次数', `authorize` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '权限授权', `desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注说明', `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', `is_deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除(1:删除,0:未删)', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `index_system_user_username`(`username`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 10001 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统用户' ROW_FORMAT = Compact; -- ---------------------------- -- Records of system_user -- ---------------------------- INSERT INTO `system_user` VALUES (10000, 'admin', '21232f297a57a5a743894a0e4a801fc3', '22222222', '', '13111111111', '2018-10-26 11:49:32', '127.0.0.1', 99, '3', '', 1, 0, '2015-11-13 15:14:22'); SET FOREIGN_KEY_CHECKS = 1;
SET SESSION FOREIGN_KEY_CHECKS=0; -- 客户信息数据表 create table case_customer( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , id int not null auto_increment comment '客户id' , code varchar(32) comment '客户编码' , ctype varchar(32) comment '客户类型' , id_card varchar(32) comment '客户身份证信息' , e_code varchar(32) comment '企业组织机构代码' , phone varchar(32) comment '联系电话' , link_man varchar(32) comment '联系人' , remark varchar(1024) comment '备注' , del_flag varchar(1) default 0 comment '删除标记' , primary key (id) ) engine = innodb comment = '客户信息记录表' default character set utf8 collate utf8_bin; -- 用户信息表 create table sys_user_ext( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , uid int not null auto_increment comment '用户id' , name varchar(32) comment '姓名' , sex varchar(1) comment '性别' , phone varchar(32) comment '手机号' , tel varchar(32) comment '联系电话' , qq varchar(32) comment 'qq号码' , position varchar(32) comment '职位类别' , entry_date date comment '入职时间' , birt date comment '出生日期' , email varchar(128) comment '电子邮箱' , remark varchar(1024) comment '备注' , del_flag varchar(1) default 0 comment '删除标记' , primary key (uid) ) engine = innodb comment = '用户扩展信息表' default character set utf8 collate utf8_bin; -- 案件执行阶段信息 create table case_carry_out( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , case_id int not null comment '案件序号' , lawyer varchar(32) comment '执行主办律师' , app_date date comment '执行申请日期' , app_total decimal(32,8) comment '申请执行总额' , judge varchar(32) comment '执行主办法官' , judge_contact varchar(128) comment '联系方式' , actual_total decimal(32,8) comment '实际执行总额' , f_collection_subject varchar(1024) comment '首位收款主体' , remark varchar(1024) comment '备注' , primary key (case_id) ) engine = innodb comment = '案件执行阶段信息记录表' default character set utf8 collate utf8_bin; -- 案件二审阶段信息 create table case_second_instance( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , case_id int not null comment '案件序号' , lawyer varchar(32) comment '二审主办律师' , s_court_date date comment '二审开庭日期' , judge varchar(32) comment '主办法官' , judge_contact varchar(128) comment '联系方式' , s_judgment_effective_date varchar(32) comment '二审判决生效日期' , is_apology varchar(1) comment '是否致歉' , defendant_compensation_total varchar(32) comment '一审被告赔偿总额' , defendant_expenses varchar(32) comment '一审被告承担合理开支费用' , plaintiff_costs varchar(32) comment '一审原告承担诉费' , defendant_costs decimal(32,8) comment '一审被告承担诉费' , is_close varchar(1) comment '是否结案' , execution_deadline date comment '执行截止日期' , remark varchar(1024) comment '备注' , primary key (case_id) ) engine = innodb comment = '案件二审阶段信息记录表' default character set utf8 collate utf8_bin; -- 案件一审阶段信息 create table case_first_instance( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , case_id int not null comment '案件序号' , firstor varchar(32) comment '第一责任人' , lawyer varchar(32) comment '一审主办律师' , submit_date date comment '提交立案材料日期' , establish_date date comment '立案日期' , litigation_costs decimal(32,8) comment '诉讼费用' , announcement_costs decimal(32,8) comment '公告费用' , notary_costs decimal(32,8) comment '公证费用' , other_costs decimal(32,8) comment '其它费用' , adjudication_court varchar(1024) comment '受理法院' , judge varchar(32) comment '主办法官' , judge_contact varchar(128) comment '联系方式' , f_court_date date comment '一审开庭日期' , f_verdict_date date comment '一审判决书落款日期' , f_verdict_receive_date date comment '一审判决书收到日期' , is_apology varchar(1) comment '是否致歉' , defendant_compensation_total decimal(32,8) comment '被告赔偿总额' , defendant_expenses decimal(32,8) comment '被告承担合理开支总额' , plaintiff_costs decimal(32,8) comment '原告承担诉费' , defendant_costs decimal(32,8) comment '被告承担诉费' , is_close varchar(1) comment '是否结案' , appeal_date date comment '上诉截止日期' , remark varchar(1024) comment '备注' , primary key (case_id) ) engine = innodb comment = '案件一审阶段信息记录表' default character set utf8 collate utf8_bin; -- 案件诉前和解信息 create table case_pre_litigation( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , case_id int not null comment '案件序号' , letter varchar(32) comment '律师函编号' , letteror varchar(32) comment '律师函主办人' , send_date date comment '律师函发送日期' , delivery_date date comment '律师函送达日期' , is_close varchar(1) comment '是否结案' , remark varchar(1024) comment '备注' , primary key (case_id) ) engine = innodb comment = '案件诉前和解信息登记表' default character set utf8 collate utf8_bin; -- 案件确立阶段信息 create table case_apply( status int comment '状态' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , case_id int not null comment '案件序号' , src varchar(32) comment '案件来源' , supply varchar(32) comment '案源人' , apply_date date comment '申请公证日期' , applicant varchar(32) comment '公证书申请人' , forensics varchar(32) comment '取证人' , violate_type varchar(32) comment '侵权类型' , violate_desc varchar(3072) comment '侵权概况' , action_date date comment '案件可诉确认日期' , action_img varchar(1024) comment '案件可诉确认截图' , litigant_ac_date date comment '当事人确认日期' , litigant_ac_img varchar(1024) comment '当事人确认截图' , primary key (case_id) ) engine = innodb comment = '案件确立阶段信息记录表' default character set utf8 collate utf8_bin; -- 案件基本信息 create table case_info( status int comment '状态' , del_flag varchar(1) default 0 comment '删除标记' , org varchar(32) comment '机构编码' , created_by varchar(32) comment '创建人' , created_time datetime comment '创建时间' , updated_by varchar(32) comment '更新人' , updated_time datetime comment '更新时间' , id int not null auto_increment comment '序号' , litigant varchar(128) comment '当事人' , defendant_name varchar(1024) comment '被告名称' , defendant_reg_capital varchar(32) comment '被告注册资本' , defendant_area varchar(1024) comment '被告所在地' , primary key (id) ) engine = innodb comment = '案件基本信息登记表' default character set utf8 collate utf8_bin;
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 02, 2020 at 01:53 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; USE db_e_learning; -- -- Database: `db_e_learning` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_cart` -- CREATE TABLE `tbl_cart` ( `product_id` int(11) NOT NULL, `user_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_cart` -- INSERT INTO `tbl_cart` (`product_id`, `user_id`) VALUES (1, 4); -- -------------------------------------------------------- -- -- Table structure for table `tbl_course` -- CREATE TABLE `tbl_course` ( `topic` varchar(100) NOT NULL, `link` varchar(200) NOT NULL, `id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_course` -- INSERT INTO `tbl_course` (`topic`, `link`, `id`) VALUES ('Algebra', 'https://www.youtube.com/watch?v=wph0cGICqCI', 1), ('Probability', 'https://www.youtube.com/watch?v=uzkc-qNVoOk', 2), ('Area and Volume', 'https://www.youtube.com/watch?v=muw-MQeIkO4', 3); -- -------------------------------------------------------- -- -- Table structure for table `tbl_product` -- CREATE TABLE `tbl_product` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, `price` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_product` -- INSERT INTO `tbl_product` (`id`, `name`, `description`, `price`) VALUES (1, 'product1', 'Description of product', 30), (2, 'product2', 'Description of product', 40), (3, 'product3', 'Description of product', 50), (4, 'product4', 'Description of product', 50); -- -------------------------------------------------------- -- -- Table structure for table `tbl_ques` -- CREATE TABLE `tbl_ques` ( `id` int(11) NOT NULL, `question` varchar(255) NOT NULL, `op1` varchar(255) NOT NULL, `op2` varchar(255) NOT NULL, `op3` varchar(255) NOT NULL, `op4` varchar(255) NOT NULL, `ans` varchar(255) NOT NULL, `course_id` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_ques` -- INSERT INTO `tbl_ques` (`id`, `question`, `op1`, `op2`, `op3`, `op4`, `ans`, `course_id`) VALUES (1, '3/6x=4', '7', '9', '8', '3', 'Option3', '1'), (2, '2x-3=9', '5', '6', '7', '8', 'Option2', '1'), (3, 'What is P(tails) for tossing a coin', '1', '0.5', '0.33', '10', 'Option2', '2'), (4, 'How to calculate P failure if P success is given', 'Subtract from 1', '1+1', 'Divide by 1', 'Multiply by 1', 'Option1', '2'), (5, 'How to calculate area of Triangle', '1/2 x b x h', 'b x h', 'b + h', 'b/h', 'Option1', '3'), (6, 'What is area unit in centimeters', 'cm', 'cm2', '2cm', 'cm3', 'Option2', '3'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_quiz` -- CREATE TABLE `tbl_quiz` ( `id` int(11) NOT NULL, `question` varchar(200) NOT NULL, `mcq1` varchar(200) NOT NULL, `mcq2` varchar(200) NOT NULL, `mcq3` varchar(200) NOT NULL, `mcq4` varchar(200) NOT NULL, `ans` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `tbl_user` -- CREATE TABLE `tbl_user` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tbl_user` -- INSERT INTO `tbl_user` (`id`, `name`, `email`, `password`) VALUES (1, 'bilal akbar', 'bilalakbar1094@gmail.com', '123'), (3, 'Ali', 'bcsm-f18-221@superior.edu.pk', '123'), (4, 'Test', 'Test@gmail.com', '123'); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_course` -- ALTER TABLE `tbl_course` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_product` -- ALTER TABLE `tbl_product` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_ques` -- ALTER TABLE `tbl_ques` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_quiz` -- ALTER TABLE `tbl_quiz` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_user` -- ALTER TABLE `tbl_user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_course` -- ALTER TABLE `tbl_course` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_product` -- ALTER TABLE `tbl_product` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tbl_ques` -- ALTER TABLE `tbl_ques` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_quiz` -- ALTER TABLE `tbl_quiz` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_user` -- ALTER TABLE `tbl_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 21-03-2018 a las 23:25:47 -- Versión del servidor: 10.1.31-MariaDB -- Versión de PHP: 7.2.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `matricula` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `estudiante` -- CREATE TABLE `estudiante` ( `id` int(11) NOT NULL, `nombre` varchar(50) NOT NULL, `apellido` varchar(50) NOT NULL, `cedula` varchar(10) NOT NULL, `usuario` varchar(30) NOT NULL, `pass` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `estudiante` -- INSERT INTO `estudiante` (`id`, `nombre`, `apellido`, `cedula`, `usuario`, `pass`) VALUES (20, 'Jose', 'Guarnizo', '1105774200', 'jos', '1234'), (21, 'j', 'j', '12', 'j', 'qw'), (22, 'j', 'j', '1', 'j', '363b122c528f54df4a0446b6bab05515'), (23, 'jose', 'jimenez', '1106000121', 'jose123123', 'e120ea280aa50693d5568d0071456460'), (24, 'jose', 'dark', '1443265438', 'us1', 'e8f8c558045c1b4e78344c94c564cd70'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `estudiante` -- ALTER TABLE `estudiante` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `estudiante` -- ALTER TABLE `estudiante` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select artist.name as artist, count(*) as count from artist left join album using(artistid) group by artist order by count desc limit :n;
select distinct coalesce(r.repo_group, 'No repo group') as "Repo group", r.name as "Repo", r.license_name as "License", rl.lang_name as "Language", rl.lang_loc as "LOC", rl.lang_perc as "Language percent" from gha_repos r, gha_repos_langs rl where r.name = rl.repo_name ;
su - postgres psql CREATE USER "sbcuser" WITH PASSWORD 's8cU$3r'; CREATE DATABASE "climatedb" WITH OWNER "sbcuser"; \q psql -U postgres "climatedb" CREATE SCHEMA "climateapp" authorization "sbcuser"; ALTER USER "sbcuser" SET search_path TO "climateapp"; \q psql -U "sbcuser" "climatedb" select current_schema();
SELECT MAX(id) as mx FROM posts WHERE thread = ?
-- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: sitpmm -- ------------------------------------------------------ -- Server version 10.3.16-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `barang` -- DROP TABLE IF EXISTS `barang`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `barang` ( `id` int(11) NOT NULL, `kategori` int(11) DEFAULT NULL, `merk` varchar(255) DEFAULT NULL, `suplier` int(11) DEFAULT NULL, `nama_barang` varchar(100) DEFAULT NULL, `harga_satuan` float(11,0) DEFAULT NULL, `qty` int(11) DEFAULT NULL, `keterangan` text DEFAULT NULL, `id_request` int(11) DEFAULT NULL, `pilih` tinyint(1) DEFAULT 0, `request` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `barang` -- LOCK TABLES `barang` WRITE; /*!40000 ALTER TABLE `barang` DISABLE KEYS */; /*!40000 ALTER TABLE `barang` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `m_kategori` -- DROP TABLE IF EXISTS `m_kategori`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `m_kategori` ( `id` int(11) NOT NULL AUTO_INCREMENT, `kategori` varchar(150) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `m_kategori` -- LOCK TABLES `m_kategori` WRITE; /*!40000 ALTER TABLE `m_kategori` DISABLE KEYS */; /*!40000 ALTER TABLE `m_kategori` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `m_menu` -- DROP TABLE IF EXISTS `m_menu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `m_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT, `menu` varchar(50) DEFAULT NULL, `sub_menu` varchar(50) DEFAULT NULL, `url` varchar(50) DEFAULT NULL, `icon` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `m_menu` -- LOCK TABLES `m_menu` WRITE; /*!40000 ALTER TABLE `m_menu` DISABLE KEYS */; INSERT INTO `m_menu` VALUES (1,'PENGADAAN BARANG','REQUEST','PermintaanBarang','fas fa-fw fa-sticky-note'),(2,'PENGADAAN BARANG','APRV LVL 1','Penyetujuan1','fas fa-fw fa-sticky-note'),(3,'PENGADAAN BARANG','APRV LVL 2','Penyetujuan2','fas fa-fw fa-sticky-note'),(4,'PENGADAAN BARANG','REF BARANG','ReferensiBarang','fas fa-fw fa-sticky-note'),(5,'PENGADAAN BARANG','APRV LVL 3','PenyetujuanLevel3','fas fa-fw fa-sticky-note'),(6,'PENGADAAN BARANG','PAYMENT','Pembayaran','fas fa-fw fa-sticky-note'),(7,'PENGADAAN BARANG','BARANG MASUK','BarangMasuk','fas fa-fw fa-sticky-note'),(8,'AKUN','PROFILE','Profile','fas fa-fw fa-user'),(9,'AKUN','LOGOUT','Login/logout','fas fa-fw fa-user'),(10,'MASTER','BARANG','Barang','fas fa-fw fa-sticky-note'),(11,'MASTER','PEGAWAI','Pegawai','fas fa-fw fa-user'),(12,'MASTER','DIVISI','Divisi','fas fa-fw fa-landmark'); /*!40000 ALTER TABLE `m_menu` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `t_akses` -- DROP TABLE IF EXISTS `t_akses`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_akses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_menu` int(11) NOT NULL, `id_role` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `t_akses` -- LOCK TABLES `t_akses` WRITE; /*!40000 ALTER TABLE `t_akses` DISABLE KEYS */; INSERT INTO `t_akses` VALUES (1,1,1),(8,8,1),(9,9,1),(10,2,1),(11,3,1),(12,4,1),(13,5,1),(14,6,1),(15,7,1),(16,1,2),(17,2,0),(18,3,0),(19,4,0),(20,5,2),(21,6,0),(22,7,0),(23,8,2),(24,9,2),(25,10,1),(26,11,1),(27,12,1); /*!40000 ALTER TABLE `t_akses` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `t_divisi` -- DROP TABLE IF EXISTS `t_divisi`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_divisi` ( `id` int(11) NOT NULL AUTO_INCREMENT, `divisi` varchar(100) DEFAULT NULL, `kepala_divisi` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `t_divisi` -- LOCK TABLES `t_divisi` WRITE; /*!40000 ALTER TABLE `t_divisi` DISABLE KEYS */; INSERT INTO `t_divisi` VALUES (1,'DIVISI IT',NULL),(2,'DIVISI FINANCE',NULL),(3,'DIVISI LAIN-LAIN',NULL); /*!40000 ALTER TABLE `t_divisi` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `t_pegawai` -- DROP TABLE IF EXISTS `t_pegawai`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_pegawai` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nik` varchar(50) DEFAULT NULL, `nama` varchar(100) DEFAULT NULL, `id_divisi` int(11) DEFAULT NULL, `jenis_kelamin` enum('Laki-Laki','Perempuan') DEFAULT NULL, `alamat` text DEFAULT NULL, `no_telp` varchar(15) DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `password` varchar(100) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `update_at` datetime DEFAULT NULL, `deleted_at` datetime DEFAULT NULL, `is_active` tinyint(1) DEFAULT 0, `is_deleted` tinyint(1) DEFAULT 0, `akses` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_divisi` (`id_divisi`), CONSTRAINT `id_divisi` FOREIGN KEY (`id_divisi`) REFERENCES `t_divisi` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `t_pegawai` -- LOCK TABLES `t_pegawai` WRITE; /*!40000 ALTER TABLE `t_pegawai` DISABLE KEYS */; INSERT INTO `t_pegawai` VALUES (1,'TPMM1211002','ATWIS ANDREAS HADI SAPUTRO',1,'Laki-Laki','Jakarta Timur','085xxxxx','aan','0cc175b9c0f1b6a831c399e269772661','2019-11-15 22:42:56',NULL,NULL,1,0,1),(2,'TPMM0415018','NANIK ERNAWATI',3,'Perempuan','Depok','085xxxxx','nanik','0cc175b9c0f1b6a831c399e269772661','2019-11-17 18:40:32',NULL,NULL,1,0,2); /*!40000 ALTER TABLE `t_pegawai` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `t_request` -- DROP TABLE IF EXISTS `t_request`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_request` ( `request_id` int(11) NOT NULL AUTO_INCREMENT, `kode_permintaan` varchar(100) DEFAULT NULL, `tanggal_request` date DEFAULT NULL, `tgl_entry` datetime DEFAULT NULL, `status` tinyint(1) DEFAULT NULL, `status_bayar` tinyint(1) DEFAULT NULL, `keterangan_bayar` tinyint(1) DEFAULT NULL, PRIMARY KEY (`request_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `t_request` -- LOCK TABLES `t_request` WRITE; /*!40000 ALTER TABLE `t_request` DISABLE KEYS */; /*!40000 ALTER TABLE `t_request` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `t_role` -- DROP TABLE IF EXISTS `t_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nama` varchar(50) DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `t_role` -- LOCK TABLES `t_role` WRITE; /*!40000 ALTER TABLE `t_role` DISABLE KEYS */; INSERT INTO `t_role` VALUES (1,'ADMINISTRATOR'),(2,'DIREKTUR'),(3,'KEPALA IT'),(4,'KEPALA FINANCE'),(5,'IT'),(6,'HRD'),(7,'FINANCE'); /*!40000 ALTER TABLE `t_role` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `temp_barang` -- DROP TABLE IF EXISTS `temp_barang`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `temp_barang` ( `id` int(11) NOT NULL, `session_id` int(11) DEFAULT NULL, `kategori` int(11) DEFAULT NULL, `merk` varchar(255) DEFAULT NULL, `suplier` int(11) DEFAULT NULL, `nama_barang` varchar(100) DEFAULT NULL, `harga_satuan` float(11,0) DEFAULT NULL, `qty` int(11) DEFAULT NULL, `keterangan` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `temp_barang` -- LOCK TABLES `temp_barang` WRITE; /*!40000 ALTER TABLE `temp_barang` DISABLE KEYS */; /*!40000 ALTER TABLE `temp_barang` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping routines for database 'sitpmm' -- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2019-11-24 2:36:28
--SELECT DISTINCT plan FROM ufce_mixes; --SELECT * FROM ufce_mixes; UPDATE ufce_mixes SET plan = REPLACE(plan, '50º', '50º') WHERE 1=1; --SELECT * FROM ufce_cron_eval_parc_estados; UPDATE ufce_cron_eval_parc_estados SET descripcion = REPLACE(descripcion, 'ó', 'ó') WHERE 1=1; UPDATE ufce_cron_eval_parc_estados SET descripcion = REPLACE(descripcion, 'í', 'í') WHERE 1=1; --SELECT * FROM ufce_parametros; UPDATE ufce_parametros SET descripcion = REPLACE(descripcion, 'ó', 'ó') WHERE 1=1; UPDATE ufce_parametros SET descripcion = REPLACE(descripcion, 'í', 'í') WHERE 1=1; UPDATE ufce_parametros SET descripcion = REPLACE(descripcion, 'á', 'á') WHERE 1=1; --SELECT * FROM ufce_periodos_tipo; UPDATE ufce_periodos_tipo SET descripcion = REPLACE(descripcion, 'ó', 'ó') WHERE 1=1; UPDATE ufce_periodos_tipo SET descripcion = REPLACE(descripcion, 'í', 'í') WHERE 1=1;
INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 1, 'Whole Life Policy', $837.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 2, 'Endowment Plans', $966.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 3, 'Term Life Insurance', $526.00, 'Term Life Insurance' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 4, 'Term Life Insurance', $565.00, 'Personal Injury Protection' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 5, 'Collision Coverage', $992.00, 'Liability Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 6, 'Whole Life Policy', $855.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 7, 'Whole Life Policy', $949.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 8, 'Comprehensive Coverage', $654.00, 'Collision Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 9, 'Personal Injury Protection', $557.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 10, 'Collision Coverage', $684.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 11, 'Term Life Insurance', $310.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 12, 'Medical Payments Coverage', $892.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 13, 'Term Life Insurance', $499.00, 'Term Life Insurance' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 14, 'Personal Injury Protection', $456.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 15, 'Endowment Plans', $668.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 16, 'Endowment Plans', $935.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 17, 'Collision Coverage', $274.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 18, 'Collision Coverage', $213.00, 'Motorist Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 19, 'Term Life Insurance', $826.00, 'Term Life Insurance' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 20, 'Collision Coverage', $283.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 21, 'Liability Coverage', $842.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 22, 'Endowment Plans', $243.00, 'Unit Linked Insurance Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 23, 'Medical Payments Coverage', $435.00, 'Personal Injury Protection' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 24, 'Collision Coverage', $307.00, 'Liability Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 25, 'Collision Coverage', $638.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 26, 'Collision Coverage', $428.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 27, 'Unit Linked Insurance Plans', $606.00, 'Motorist Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 28, 'Endowment Plans', $600.00, 'Personal Injury Protection' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 29, 'Unit Linked Insurance Plans', $928.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 30, 'Unit Linked Insurance Plans', $498.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 31, 'Collision Coverage', $900.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 32, 'Unit Linked Insurance Plans', $394.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 33, 'Personal Injury Protection', $442.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 34, 'Unit Linked Insurance Plans', $971.00, 'Liability Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 35, 'Endowment Plans', $593.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 36, 'Whole Life Policy', $529.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 37, 'Personal Injury Protection', $304.00, 'Term Life Insurance' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 38, 'Collision Coverage', $500.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 39, 'Motorist Coverage', $829.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 40, 'Whole Life Policy', $632.00, 'Collision Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 41, 'Motorist Coverage', $579.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 42, 'Medical Payments Coverage', $511.00, 'Personal Injury Protection' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 43, 'Motorist Coverage', $574.00, 'Collision Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 44, 'Medical Payments Coverage', $914.00, 'Whole Life Policy' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 45, 'Personal Injury Protection', $375.00, 'Comprehensive Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 46, 'Medical Payments Coverage', $647.00, 'Motorist Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 47, 'Term Life Insurance', $357.00, 'Endowment Plans' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 48, 'Term Life Insurance', $360.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 49, 'Personal Injury Protection', $611.00, 'Medical Payments Coverage' ); INSERT INTO insuranceplans( planid, coverage, price, pname ) VALUES( 50, 'Collision Coverage', $378.00, 'Whole Life Policy' );
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jul 14, 2020 at 04:11 PM -- Server version: 5.6.47-cll-lve -- PHP Version: 7.2.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `quiztion` -- -- -------------------------------------------------------- -- -- Table structure for table `Discover` -- CREATE TABLE `Discover` ( `topic_id` int(255) NOT NULL, `title` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Discover` -- INSERT INTO `Discover` (`topic_id`, `title`) VALUES (1, 'Culture'), (2, 'Coding'), (3, 'History'), (4, 'Science'); -- -------------------------------------------------------- -- -- Table structure for table `Leaderboard` -- CREATE TABLE `Leaderboard` ( `user_id` int(11) NOT NULL, `quiz_name` varchar(255) NOT NULL, `score` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Leaderboard` -- INSERT INTO `Leaderboard` (`user_id`, `quiz_name`, `score`) VALUES (2, 'PAP', '0'), (3, 'PAP', '20'), (4, 'PAP', '40'), (2, 'mobile app development', '33'), (2, 'test', '0'), (2, 'test2', '0'), (2, 'vvv', '100'), (2, 'zzz', '0'), (7, 'vvv', '100'), (7, 'PAP', '0'), (7, 'mobile app development', '33'), (7, 'test', '20'), (2, 'Language C', '50'), (6, 'Language C', '0'), (6, 'texas', '100'), (2, 'texas', '50'), (6, 'culture', '100'), (2, 'pizza', '50'); -- -------------------------------------------------------- -- -- Table structure for table `QuestionBank` -- CREATE TABLE `QuestionBank` ( `quizname` varchar(255) NOT NULL, `question` varchar(255) NOT NULL, `choice 1` varchar(255) NOT NULL, `choice 2` varchar(255) NOT NULL, `choice 3` varchar(255) NOT NULL, `choice 4` varchar(255) NOT NULL, `answer` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `QuestionBank` -- INSERT INTO `QuestionBank` (`quizname`, `question`, `choice 1`, `choice 2`, `choice 3`, `choice 4`, `answer`) VALUES ('PAP', 'PRIME MINISTER OF INDIA', 'MODI', 'ANIL', 'TRUMP', 'SUNIL', ''), ('PAP', 'WER', 'A', 'B', 'C', 'D', 'A'), ('PAP', 'POPKJ', 'A', 'B', 'C', 'D', 'B'), ('PAP', 'MNBVG', 'A', 'B', 'C', 'D', 'C'), ('PAP', 'UYTY', 'A', 'B', 'C', 'D', 'D'), ('mobile app development', 'android', 'android', 'apple', 'samsung', 'black berry', 'A'), ('mobile app development', 'apple', 'android', 'apple', 'blackberry', 'samsung', 'B'), ('mobile app development', 'blackberry', 'blackberry', 'samsung', 'samsung', 'android', 'A'), ('test', 'anil', 'anil', 'sunil', 'alekhya', 'rakshith', 'anil'), ('test', 'nithin', 'anil', 'nithin', 'alekhya', 'sunil', 'nithin'), ('test', 'rakshith', 'sunil', 'aadarsh', 'rakshith', 'eka', 'rakshith'), ('test2', 'Anil', 'Anil', 'adarsh', 'sunil', 'eka', 'A'), ('test2', 'Sunil ', 'eka', 'rak', 'sai', 'sunil', 'D'), ('test', 'A', 'A', 'anil', 'sunil', 'cat', 'A'), ('test', 'B', 'anil', 'B', 'sunil', 'dog', 'B'), ('vvv', 'abba', 'abba', 'hjk', 'jdmdn', 'ndnd', 'A'), ('vvv', 'yuu', 'idkdk', 'nsmd', 'yuu', 'ndmdl', 'C'), ('zzz', 'bbb', 'bbb', 'sk k n', 'ndndj', 'ndjd', 'A'), ('zzz', 'ggg', 'etay', 'kakk', 'ndmsl', 'ggg', 'D'), ('', '', '', '', '', '', ''), ('Language C', 'Father of C', 'James', 'John', 'Cat', 'Apple', 'B'), ('Language C', 'A stands for', 'Apple', 'Ball', 'Bag', 'Dragon', 'A'), ('texas', 'anil is', 'good', 'bad', 'verygood', 'awsome', 'A'), ('texas', 'raksith is ', 'bad', 'good ', 'crazy', 'lazy', 'D'), ('culture', 'captail of india', 'delhi', 'hyder', 'ahmedabad', 'gujarat', 'A'), ('culture', 'Captial of hyderabad', 'ts', 'ap', 'jaipur', 'rajsthan', 'A'), ('pizza', 'pizza but or dominos', 'pizza hut', 'dominos', 'both', 'neither', 'D'), ('pizza', 'Veggies masaala or Pizza', 'Veggi masala', 'pizza', 'both', 'neither', 'A'), ('sunil', 'snsks', 'ejsj', 'jek', 'kkek', 'kkdkd', 'djd'); -- -------------------------------------------------------- -- -- Table structure for table `Quiz` -- CREATE TABLE `Quiz` ( `topic_id` int(11) NOT NULL, `quizname` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Quiz` -- INSERT INTO `Quiz` (`topic_id`, `quizname`) VALUES (1, 'PAP'), (2, 'mobile app development'), (3, 'test'), (1, 'test2'), (4, 'vvv'), (4, 'zzz'), (0, ''), (2, 'Language C'), (3, 'texas'), (1, 'culture'), (1, 'pizza'), (4, 'sunil'); -- -------------------------------------------------------- -- -- Table structure for table `Users` -- CREATE TABLE `Users` ( `user_id` int(11) NOT NULL, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `institution` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `imageurl` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Users` -- INSERT INTO `Users` (`user_id`, `username`, `password`, `institution`, `email`, `phone`, `imageurl`) VALUES (1, 'Admin', 'Admin', 'CSULb', 'Admin@gmail.com', '9876543210', ''), (2, 'Anil', 'Anil', 'CSUF', 'Anil@gmail.com', '8765432190', ''), (3, 'sunil', 'sunil123', 'csulb', 'sunil@gmail.com', '5623148540', ''), (12, '', '', '', '', '', ''), (6, 'alekhya', 'alekhya', 'csulb', 'alekhya@gmail.com', '9638527412', ''), (7, 'Rakshith', 'Chinnu1215', 'CSULB', 'rakshith22@outlook.com', '5623419195', ''), (9, 'bobby', 'bobby123', 'csulb', 'bobby@gmail.com', '7896541238', ''), (11, 'sunilkumarpog', 'sunilkumar', 'sunilkumarpog@gmail.com', 'sunilkumarpog@gmail.com', '8897589060', ''); -- -- Indexes for dumped tables -- -- -- Indexes for table `Discover` -- ALTER TABLE `Discover` ADD PRIMARY KEY (`topic_id`); -- -- Indexes for table `Users` -- ALTER TABLE `Users` ADD PRIMARY KEY (`user_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `Discover` -- ALTER TABLE `Discover` MODIFY `topic_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `Users` -- ALTER TABLE `Users` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select * from tb_student; select * from tb_course; select * from tb_score; -- select * from tb_student ts ,tb_course tc; select * from tb_student ts cross join tb_course tc; select tsc.stuname,tsc.crsname,ts1.score from ( select ts.id stuid,ts.no stuno,ts.name stuname,tc.id crsid, tc.name crsname from tb_student ts cross join tb_course tc ) tsc left join tb_score ts1 on tsc.stuid=ts1.stuid and tsc.crsid=ts1.couid; --换转列 decode,case when select tsc2.stuname, sum(decode(tsc2.crsname,'javase',tsc2.score,0)) javase, sum(decode(tsc2.crsname,'oracle',tsc2.score,0)) oracle, sum(decode(tsc2.crsname,'html',tsc2.score,0)) html from ( select tsc.stuname,tsc.crsname,ts1.score from ( select ts.id stuid,ts.no stuno,ts.name stuname,tc.id crsid, tc.name crsname from tb_student ts cross join tb_course tc ) tsc left join tb_score ts1 on tsc.stuid=ts1.stuid and tsc.crsid=ts1.couid )tsc2 group by tsc2.stuname; create or replace view v$_tsc as select tsc.stuname,tsc.crsname,ts1.score from ( select ts.id stuid,ts.no stuno,ts.name stuname,tc.id crsid, tc.name crsname from tb_student ts cross join tb_course tc ) tsc left join tb_score ts1 on tsc.stuid=ts1.stuid and tsc.crsid=ts1.couid select * from v$_tsc; select tsc2.stuname, sum(decode(tsc2.crsname,'javase',tsc2.score,0)) javase, sum(decode(tsc2.crsname,'oracle',tsc2.score,0)) oracle, sum(decode(tsc2.crsname,'html',tsc2.score,0)) html from v$_tsc tsc2 group by tsc2.stuname; --存储过程 --思路:将上面的行转列语句拼接 --利用匿名块实现 declare v_sql varchar2(5000):= 'select tsc2.stuname,'; v_temp varchar2(300); --用来拼接select语句中会变化的那一部分,如:sum(decode(tsc2.crsname,'javase',tsc2.score,0)) javase, cursor cur_course is select * from tb_course;--利用游标来获取课程表 表的行类型 --cursor cur_course is select distinct name from tb_course; --也可以写成这样 begin for v_cour in cur_course loop --在for循环中,c_cour 可以不应定义 v_temp :=v_temp || 'sum(decode(tsc2.crsname,'''||v_cour.name||''',tsc2.score,0)) '||v_cour.name||','; end loop; dbms_output.put_line(v_temp);--打印一下看看拼接成什么样子了,最后发现在末尾多了一个逗号,接下来删除(截取字符串) v_temp := substr(v_temp,1,length(v_temp) -1); v_sql := v_sql || v_temp || ' from v$_tsc tsc2 group by tsc2.stuname;' ; dbms_output.put_line(v_sql);--打印看看最终结果拼对了没有 end; --最终拼接结果 select tsc2.stuname,sum(decode(tsc2.crsname,'javase',tsc2.score,0)) javase,sum(decode(tsc2.crsname,'oracle',tsc2.score,0)) oracle,sum(decode(tsc2.crsname,'html',tsc2.score,0)) html from v$_tsc tsc2 group by tsc2.stuname; --将上面的匿名块写成存储过程 create or replace procedure rowtocol(sc_cur out sys_refcursor) is v_sql varchar2(5000):= 'select tsc2.stuname,'; v_temp varchar2(300); --用来拼接select语句中会变化的那一部分,如:sum(decode(tsc2.crsname,'javase',tsc2.score,0)) javase, cursor cur_course is select * from tb_course;--利用游标来获取课程表 表的行类型 --cursor cur_course is select distinct name from tb_course; --也可以写成这样 begin for v_cour in cur_course loop --在for循环中,c_cour 可以不应定义 v_temp :=v_temp || 'sum(decode(tsc2.crsname,'''||v_cour.name||''',tsc2.score,0)) '||v_cour.name||','; end loop; dbms_output.put_line(v_temp);--打印一下看看拼接成什么样子了,最后发现在末尾多了一个逗号,接下来删除(截取字符串) v_temp := substr(v_temp,1,length(v_temp) -1); v_sql := v_sql || v_temp || ' from v$_tsc tsc2 group by tsc2.stuname'; dbms_output.put_line(v_sql);--打印看看最终结果拼对了没有 open sc_cur for v_sql;--打开游标 end; declare sys_cursor sys_refcursor; begin rowtocol(sys_cursor); end; select tsc2.stuname, sum(decode(tsc2.crsname, 'javase', tsc2.score, 0)) javase, sum(decode(tsc2.crsname, 'oracle', tsc2.score, 0)) oracle, sum(decode(tsc2.crsname, 'html', tsc2.score, 0)) html from v$_tsc tsc2 group by tsc2.stuname;
-- query 18 INSERT INTO links_prematch.freq_firstname ( name_str , frequency ) SELECT name_str , COUNT(*) AS frequency FROM links_prematch.freq_firstname_sex_tmp GROUP BY name_str ;
--22 select * from nikovits.emp natural join nikovits.dept where sal>2000 or loc='CHICAGO'; --23 select deptno from nikovits.dept minus select distinct deptno from nikovits.emp; --24 select * from nikovits.emp e1 join nikovits.emp e2 on e1.mgr=e2.empno where e1.sal>2000; --25 select ename from nikovits.emp minus select distinct e2.ename from nikovits.emp e1 join nikovits.emp e2 on e1.mgr=e2.empno where e1.sal>2000; --26 select dname, loc from nikovits.emp, nikovits.dept where nikovits.emp.deptno = nikovits.dept.deptno and job='ANALYST'; --27 select distinct dname, loc from nikovits.dept minus select distinct dname, loc from nikovits.emp, nikovits.dept where nikovits.emp.deptno = nikovits.dept.deptno and job='ANALYST'; --28 select ename from nikovits.emp minus select e1.ename from nikovits.emp e1 join nikovits.emp e2 on e1.sal < e2.sal; select ename from nikovits.emp where sal=(select max(sal) from nikovits.emp); /* new for today */ select LOWER('ASD') from dual; select sysdate from dual; select sysdate+1/24*20 from dual; --1 select ename, sal from nikovits.emp where mod(sal,15)=0; --2 select ename, hiredate from nikovits.emp where hiredate > to_date('1982.01.01'); --3 select ename from nikovits.emp where substr(ename,2,1)='A'; --4 select ename from nikovits.emp where instr(ename,'L',1,2)>0; --5 select substr(ename,-3,3) from nikovits.emp; --6 select ename from nikovits.emp where substr(ename,-2,1)='T'; --7 select ename, sal, round(sqrt(sal),2), trunc(sqrt(sal)) from nikovits.emp; --8 select ename, hiredate, to_char(hiredate,'MONTH') from nikovits.emp where ename='ADAMS'; --9 select hiredate,trunc(sysdate-hiredate) from nikovits.emp where ename='ADAMS'; --10 select ename, hiredate, to_char(hiredate,'DAY') from nikovits.emp where to_char(hiredate,'DAY') like 'TUESDAY%'; --11 select e1.ename, e2.ename from nikovits.emp e1 join nikovits.emp e2 on e1.mgr=e2.empno where length(e1.ename)=length(e2.ename); --12 select ename,sal from nikovits.emp join nikovits.sal_cat on sal between lowest_sal and highest_sal where category=1; --13 select ename,sal from nikovits.emp join nikovits.sal_cat on sal between lowest_sal and highest_sal where mod(category, 2)=0; --14 select e1.hiredate,e2.hiredate,e1.hiredate-e2.hiredate from nikovits.emp e1 join nikovits.emp e2 on e1.ename = 'KING' and e2.ename='JONES'; --15 select hiredate, to_char(last_day(hiredate),'DAY') from nikovits.emp where ename='KING'; --16 select hiredate, to_char(trunc(hiredate,'MONTH'),'DAY') from nikovits.emp where ename='KING'; --17 select ename,dname, category from nikovits.emp join nikovits.sal_cat on sal between lowest_sal and highest_sal natural join nikovits.dept where dname like '%C%' and category>=4; --18 HW
SELECT name as carrier , MAX(PRICE) AS max_price FROM Flights JOIN Carriers ON Flights.carrier_id = Carriers.cid WHERE (Flights.origin_city LIKE 'Seattle%' OR Flights.origin_city LIKE 'New York%') AND ( Flights.dest_city LIKE 'New York%' OR Flights.dest_city LIKE 'Seattle%') GROUP BY Carriers.name ORDER BY 1,2;
--修改人 田进 --修改时间 2012-11-27 --修改内容 增加资金矫正数据同步及查询茶单和矫正表 --修改人 田进 --修改时间 2012-11-27 --修改内容 增加资金矫正数据同步及查询茶单和矫正表 create table ERP_FUND_RECTIFY ( ID int not null, CUSTOMER_CODE VARCHAR2(100), CUSTOMER_NAME VARCHAR2(100), CORP_CODE VARCHAR2(100), AMT NUMBER(15,2), COM_CODE VARCHAR2(100), BANK_CODE VARCHAR2(100), BANK_ACC VARCHAR2(100), BUDAT DATE, BYTTER_CORP_CODE VARCHAR2(100) ); comment on column ERP_FUND_RECTIFY.CUSTOMER_CODE is '客户编号'; comment on column ERP_FUND_RECTIFY.CUSTOMER_NAME is '客户名称'; comment on column ERP_FUND_RECTIFY.CORP_CODE is '单位代码'; comment on column ERP_FUND_RECTIFY.AMT is '金额'; comment on column ERP_FUND_RECTIFY.COM_CODE is '公司代码'; comment on column ERP_FUND_RECTIFY.BANK_CODE is '银行代码'; comment on column ERP_FUND_RECTIFY.BANK_ACC is '银行账号'; comment on column ERP_FUND_RECTIFY.BUDAT is '记账日期'; comment on column ERP_FUND_RECTIFY.BUDAT is '对应拜特公司代码'; insert into BT_SYS_RES (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) select (select max(RES_CODE) + 1 from bt_sys_res), '资金矫正数据同步及查询', 'nis', RES_CODE, '/dataExchange/capitalRectifyDataSynAction.do?method=initData', '0', '0', '0', '0', 7, null, null, null, null, null, null, null, null, null, null, null, 2, '' from bt_sys_res where res_name = '收款' and father_code=0; commit;
-- phpMyAdmin SQL Dump -- version 4.0.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 17, 2016 at 01:57 AM -- Server version: 5.6.12-log -- PHP Version: 5.4.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `dbrips` -- CREATE DATABASE IF NOT EXISTS `dbrips` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `dbrips`; -- -------------------------------------------------------- -- -- Table structure for table `tblAmenity` -- CREATE TABLE IF NOT EXISTS `tblAmenity` ( `strAmenityId` varchar(45) NOT NULL, `strAmenityName` varchar(100) NOT NULL, `strAmenityDesc` text, `strAmenityATId` varchar(45) NOT NULL, `dblAmenityERate` float NOT NULL, `intAmenityStatus` tinyint(1) NOT NULL, PRIMARY KEY (`strAmenityId`), KEY `strAmenityATId_idx` (`strAmenityATId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblAmenity` -- INSERT INTO `tblAmenity` (`strAmenityId`, `strAmenityName`, `strAmenityDesc`, `strAmenityATId`, `dblAmenityERate`, `intAmenityStatus`) VALUES ('AME-0001', 'Claro M. Recto Hall', 'testing', 'ATYPE-0002', 101.25, 1), ('AME-0002', 'Bulwagang Balagtas', 'adsfa', 'ATYPE-0002', 101.5, 1), ('AME-0003', 'PUP-Oval', '', 'ATYPE-0001', 12.98, 1), ('AME-0004', 'PUP Freedom Park', 'freedom', 'ATYPE-0001', 15.96, 1); -- -------------------------------------------------------- -- -- Table structure for table `tblAmenityType` -- CREATE TABLE IF NOT EXISTS `tblAmenityType` ( `strAmenityTId` varchar(45) NOT NULL, `strAmenityTName` varchar(100) NOT NULL, `strAmenityTDesc` text, PRIMARY KEY (`strAmenityTId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblAmenityType` -- INSERT INTO `tblAmenityType` (`strAmenityTId`, `strAmenityTName`, `strAmenityTDesc`) VALUES ('ATYPE-0001', 'Open Area', 'shit'), ('ATYPE-0002', 'Hall', ''), ('ATYPE-0003', 'Auditorium', ''), ('ATYPE-0004', 'Conference Room', ''); -- -------------------------------------------------------- -- -- Table structure for table `tblClient` -- CREATE TABLE IF NOT EXISTS `tblClient` ( `strClientId` varchar(45) NOT NULL, `strClientFirst` varchar(100) NOT NULL, `strClientMiddle` varchar(100) DEFAULT NULL, `strClientLast` varchar(100) NOT NULL, `strClientContact` varchar(45) NOT NULL, `intClientType` tinyint(2) NOT NULL, `strClientOfficeId` varchar(45) NOT NULL, PRIMARY KEY (`strClientId`), UNIQUE KEY `strClientFirst` (`strClientFirst`,`strClientMiddle`,`strClientLast`), KEY `strClientOfficeId_idx` (`strClientOfficeId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblClient` -- INSERT INTO `tblClient` (`strClientId`, `strClientFirst`, `strClientMiddle`, `strClientLast`, `strClientContact`, `intClientType`, `strClientOfficeId`) VALUES ('CLIENT-0001', 'Angelito', '', 'Pastrana', '09054095023', 3, 'OFFICE-0001'), ('CLIENT-0002', 'Paul', '', 'Cruz', '090234324', 1, 'OFFICE-0001'), ('CLIENT-0003', 'Angelica', 'Caba-nilla', 'O''Ramos', '09054090523', 3, 'OFFICE-0001'), ('CLIENT-0004', 'Rexielyn', 'Sta.Catalina', 'Santos', '09054090523', 1, 'OFFICE-0001'), ('CLIENT-0005', 'Emmanuel', 'Capuz', 'Cambronero', '09054090523', 1, 'OFFICE-0001'), ('CLIENT-0006', 'Moises', '', 'Unisa', '09054090523', 1, 'OFFICE-0001'), ('CLIENT-0007', 'Emman', '', 'Cambronero', '093812974918', 1, 'OFFICE-0001'), ('CLIENT-0008', 'Mami', 'Paw', 'Parail', '09054090523', 3, 'OFFICE-0004'); -- -------------------------------------------------------- -- -- Table structure for table `tblEmployee` -- CREATE TABLE IF NOT EXISTS `tblEmployee` ( `strEmpId` varchar(45) NOT NULL, `strEmpFirst` varchar(100) NOT NULL, `strEmpMiddle` varchar(100) DEFAULT NULL, `strEmpLast` varchar(100) NOT NULL, `strEmpContact` varchar(45) NOT NULL, `dtmEmpBirth` date NOT NULL, `dtmEmpHired` date NOT NULL, `strEmpJobId` varchar(45) NOT NULL, `dtmEmpResigned` date DEFAULT NULL, `dtmEmpUpdated` datetime NOT NULL, `intEmpStatus` tinyint(1) NOT NULL, PRIMARY KEY (`strEmpId`), UNIQUE KEY `strEmpFirst` (`strEmpFirst`,`strEmpMiddle`,`strEmpLast`), KEY `strEmpJobId_idx` (`strEmpJobId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblEmployee` -- INSERT INTO `tblEmployee` (`strEmpId`, `strEmpFirst`, `strEmpMiddle`, `strEmpLast`, `strEmpContact`, `dtmEmpBirth`, `dtmEmpHired`, `strEmpJobId`, `dtmEmpResigned`, `dtmEmpUpdated`, `intEmpStatus`) VALUES ('EMP-0001', 'Paul Andrei', 'Navarro', 'Cruz', '09054090523', '1999-01-28', '2016-10-01', 'TITLE-0003', NULL, '2016-10-01 07:46:42', 1), ('EMP-0002', 'Mami Piyur', 'Paw', 'Parail', '123124234', '1998-04-26', '2016-10-01', 'TITLE-0002', NULL, '2016-10-01 18:44:38', 0), ('EMP-0003', 'Emmanuel', '', 'Lacsamana', '234234', '2016-10-04', '2016-10-12', 'TITLE-0001', NULL, '2016-10-04 17:46:46', 1), ('EMP-0004', 'Angelou', 'O''bilar', 'Capa-rosso', '09054090523', '1969-09-08', '2016-10-04', 'TITLE-0004', NULL, '2016-10-04 22:26:29', 1), ('EMP-0005', 'Alexis', '', 'Libunao', '09054090523', '1970-03-09', '2016-10-10', 'TITLE-0004', NULL, '2016-10-10 08:18:14', 0), ('EMP-0006', 'Rosita', 'Escfabanan', 'Canlas', '09054090523', '1965-03-05', '1986-06-17', 'TITLE-0004', NULL, '2016-10-17 09:32:18', 1); -- -------------------------------------------------------- -- -- Table structure for table `tblEmpSkill` -- CREATE TABLE IF NOT EXISTS `tblEmpSkill` ( `strEmpSEmpId` varchar(45) NOT NULL, `strEmpSJobSId` varchar(45) NOT NULL, PRIMARY KEY (`strEmpSEmpId`,`strEmpSJobSId`), KEY `strEmpSEmpId_idx` (`strEmpSEmpId`), KEY `strEmpSJobSId_idx` (`strEmpSJobSId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblEmpSkill` -- INSERT INTO `tblEmpSkill` (`strEmpSEmpId`, `strEmpSJobSId`) VALUES ('EMP-0001', 'SKILL-0001'), ('EMP-0001', 'SKILL-0002'), ('EMP-0001', 'SKILL-0003'), ('EMP-0001', 'SKILL-0005'), ('EMP-0001', 'SKILL-0006'), ('EMP-0001', 'SKILL-0007'), ('EMP-0002', 'SKILL-0005'), ('EMP-0002', 'SKILL-0006'), ('EMP-0003', 'SKILL-0001'), ('EMP-0003', 'SKILL-0003'), ('EMP-0004', 'SKILL-0005'), ('EMP-0004', 'SKILL-0006'), ('EMP-0005', 'SKILL-0005'), ('EMP-0005', 'SKILL-0006'), ('EMP-0005', 'SKILL-0007'), ('EMP-0006', 'SKILL-0005'), ('EMP-0006', 'SKILL-0006'), ('EMP-0006', 'SKILL-0007'); -- -------------------------------------------------------- -- -- Table structure for table `tblItem` -- CREATE TABLE IF NOT EXISTS `tblItem` ( `strItemId` varchar(45) NOT NULL, `strItemName` varchar(100) NOT NULL, `strItemDesc` text, `strItemITypeId` varchar(45) NOT NULL, PRIMARY KEY (`strItemId`), KEY `strItemITypeId_idx` (`strItemITypeId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblItem` -- INSERT INTO `tblItem` (`strItemId`, `strItemName`, `strItemDesc`, `strItemITypeId`) VALUES ('ITEM-0001', 'Gunting', '', 'ITYPE-0001'), ('ITEM-0002', 'Turnilyo - 10mm', 'sample lang to bes', 'ITYPE-0006'), ('ITEM-0003', 'Semento - sako', '', 'ITYPE-0007'), ('ITEM-0004', 'Acrylic Pintura - Can', 'f', 'ITYPE-0003'), ('ITEM-0005', 'Turnilyo - 20mm', '', 'ITYPE-0006'), ('ITEM-0006', 'Meter stick', '', 'ITYPE-0008'), ('ITEM-0007', 'Ruler', '', 'ITYPE-0008'), ('ITEM-0008', 'Plywood', 'wood', 'ITYPE-0009'), ('ITEM-0009', 'palo-china', '', 'ITYPE-0009'); -- -------------------------------------------------------- -- -- Table structure for table `tblItemDefect` -- CREATE TABLE IF NOT EXISTS `tblItemDefect` ( `strItemDefId` varchar(45) NOT NULL, `strItemDefItemId` varchar(45) NOT NULL, `strItemDefUnitId` varchar(45) NOT NULL, `intItemDefQty` int(11) NOT NULL, `dtmItemDefDate` datetime DEFAULT NULL, PRIMARY KEY (`strItemDefId`), KEY `strItemDefItemId_idx` (`strItemDefItemId`), KEY `strItemDefUnitId_idx` (`strItemDefUnitId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tblItemDelDetail` -- CREATE TABLE IF NOT EXISTS `tblItemDelDetail` ( `intDeliId` int(11) NOT NULL AUTO_INCREMENT, `strDeliHId` varchar(45) NOT NULL, `strDeliDItemId` varchar(45) NOT NULL, `strDeliDUnitId` varchar(45) NOT NULL, `intDeliDQty` int(11) NOT NULL, PRIMARY KEY (`intDeliId`,`strDeliHId`), KEY `strDeliDItemId_idx` (`strDeliDItemId`), KEY `strDeliDUnitId_idx` (`strDeliDUnitId`), KEY `strDeliHId_idx` (`strDeliHId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `tblItemDelDetail` -- INSERT INTO `tblItemDelDetail` (`intDeliId`, `strDeliHId`, `strDeliDItemId`, `strDeliDUnitId`, `intDeliDQty`) VALUES (2, 'DELI-0001', 'ITEM-0004', 'UNIT-0006', 25), (3, 'DELI-0002', 'ITEM-0007', 'UNIT-0002', 50), (4, 'DELI-0002', 'ITEM-0003', 'UNIT-0003', 80), (5, 'DELI-0003', 'ITEM-0009', 'UNIT-0002', 50), (6, 'DELI-0004', 'ITEM-0002', 'UNIT-0006', 10); -- -------------------------------------------------------- -- -- Table structure for table `tblItemDelHeader` -- CREATE TABLE IF NOT EXISTS `tblItemDelHeader` ( `strDeliId` varchar(45) NOT NULL, `strDeliHNo` varchar(100) NOT NULL, `strDeliHPurReqHId` varchar(45) NOT NULL, `strDeliHEmpId` varchar(45) NOT NULL, `dtmDeliHDate` datetime NOT NULL, PRIMARY KEY (`strDeliId`), KEY `strDeliPurReqHId_idx` (`strDeliHPurReqHId`), KEY `strDeliEmpId_idx` (`strDeliHEmpId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblItemDelHeader` -- INSERT INTO `tblItemDelHeader` (`strDeliId`, `strDeliHNo`, `strDeliHPurReqHId`, `strDeliHEmpId`, `dtmDeliHDate`) VALUES ('DELI-0001', 'dsfgsdg', 'PREQ-0001', 'EMP-0001', '2016-10-10 02:57:52'), ('DELI-0002', 'Semen2 - 09123z', 'PREQ-0002', 'EMP-0003', '2016-10-10 07:05:22'), ('DELI-0003', 'asdf', 'PREQ-0003', 'EMP-0004', '2016-10-12 12:36:16'), ('DELI-0004', 'ACE HARDWARE - 00123456789', 'PREQ-0004', 'EMP-0006', '2016-10-17 09:40:33'); -- -------------------------------------------------------- -- -- Table structure for table `tblItemRelDetail` -- CREATE TABLE IF NOT EXISTS `tblItemRelDetail` ( `intItemRelDId` int(11) NOT NULL AUTO_INCREMENT, `strItemRelHId` varchar(45) NOT NULL, `strItemRelDItemId` varchar(45) NOT NULL, `strItemRelDUnitId` varchar(45) NOT NULL, `intItemRelDQty` int(11) NOT NULL, PRIMARY KEY (`intItemRelDId`,`strItemRelHId`), KEY `strItemRelDItemId_idx` (`strItemRelDItemId`), KEY `strItemRelDUnitId_idx` (`strItemRelDUnitId`), KEY `strItemRelHId_idx` (`strItemRelHId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `tblItemRelDetail` -- INSERT INTO `tblItemRelDetail` (`intItemRelDId`, `strItemRelHId`, `strItemRelDItemId`, `strItemRelDUnitId`, `intItemRelDQty`) VALUES (1, 'REL-0003', 'ITEM-0007', 'UNIT-0002', 4), (2, 'REL-0003', 'ITEM-0003', 'UNIT-0003', 5), (3, 'REL-0004', 'ITEM-0007', 'UNIT-0002', 1), (4, 'REL-0004', 'ITEM-0002', 'UNIT-0006', 2); -- -------------------------------------------------------- -- -- Table structure for table `tblItemRelHeader` -- CREATE TABLE IF NOT EXISTS `tblItemRelHeader` ( `strItemRelId` varchar(45) NOT NULL, `strItemRelItemReqId` varchar(45) NOT NULL, `strItemRelEmpId` varchar(45) NOT NULL, `dtmItemRelDate` datetime NOT NULL, PRIMARY KEY (`strItemRelId`), KEY `strItemRelReqId_idx` (`strItemRelItemReqId`), KEY `strItemRelEmpId_idx` (`strItemRelEmpId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblItemRelHeader` -- INSERT INTO `tblItemRelHeader` (`strItemRelId`, `strItemRelItemReqId`, `strItemRelEmpId`, `dtmItemRelDate`) VALUES ('REL-0001', 'IREQ-0001', 'EMP-0004', '2016-10-10 07:06:05'), ('REL-0002', 'IREQ-0006', 'EMP-0005', '2016-10-10 08:50:58'), ('REL-0003', 'IREQ-0001', 'EMP-0003', '2016-10-16 16:43:01'), ('REL-0004', 'IREQ-0007', 'EMP-0004', '2016-10-17 09:40:48'); -- -------------------------------------------------------- -- -- Table structure for table `tblItemReqDetail` -- CREATE TABLE IF NOT EXISTS `tblItemReqDetail` ( `intItemReqDId` int(11) NOT NULL AUTO_INCREMENT, `strItemReqHId` varchar(45) NOT NULL DEFAULT '', `strItemReqDItemId` varchar(45) NOT NULL, `strItemReqDUnitId` varchar(45) NOT NULL, `intItemReqDQty` int(11) NOT NULL, PRIMARY KEY (`intItemReqDId`,`strItemReqHId`), KEY `strItemReqDItemId_idx` (`strItemReqDItemId`), KEY `strItemReqDUnitId_idx` (`strItemReqDUnitId`), KEY `strItemReqHId` (`strItemReqHId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ; -- -- Dumping data for table `tblItemReqDetail` -- INSERT INTO `tblItemReqDetail` (`intItemReqDId`, `strItemReqHId`, `strItemReqDItemId`, `strItemReqDUnitId`, `intItemReqDQty`) VALUES (4, 'IREQ-0001', 'ITEM-0007', 'UNIT-0002', 4), (5, 'IREQ-0001', 'ITEM-0003', 'UNIT-0003', 5), (6, 'IREQ-0002', 'ITEM-0004', 'UNIT-0006', 10), (7, 'IREQ-0002', 'ITEM-0009', 'UNIT-0002', 2), (8, 'IREQ-0002', 'ITEM-0008', 'UNIT-0002', 1), (9, 'IREQ-0003', 'ITEM-0004', 'UNIT-0001', 5), (10, 'IREQ-0003', 'ITEM-0008', 'UNIT-0002', 7), (11, 'IREQ-0003', 'ITEM-0003', 'UNIT-0003', 10), (12, 'IREQ-0004', 'ITEM-0009', 'UNIT-0002', 2), (13, 'IREQ-0005', 'ITEM-0009', 'UNIT-0002', 5), (14, 'IREQ-0006', 'ITEM-0009', 'UNIT-0002', 4), (15, 'IREQ-0007', 'ITEM-0007', 'UNIT-0002', 5), (16, 'IREQ-0007', 'ITEM-0002', 'UNIT-0006', 2); -- -------------------------------------------------------- -- -- Table structure for table `tblItemReqHeader` -- CREATE TABLE IF NOT EXISTS `tblItemReqHeader` ( `strItemReqId` varchar(45) NOT NULL, `strItemReqHProjHId` varchar(45) NOT NULL, `strItemReqHEmpId` varchar(45) NOT NULL, `dtmItemReqHDate` date NOT NULL, PRIMARY KEY (`strItemReqId`), KEY `strItemReqHProjHId_idx` (`strItemReqHProjHId`), KEY `strItemReqHEmpId_idx` (`strItemReqHEmpId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblItemReqHeader` -- INSERT INTO `tblItemReqHeader` (`strItemReqId`, `strItemReqHProjHId`, `strItemReqHEmpId`, `dtmItemReqHDate`) VALUES ('IREQ-0001', 'REQ-0001', 'EMP-0001', '2016-10-08'), ('IREQ-0002', 'REQ-0002', 'EMP-0001', '2016-10-10'), ('IREQ-0003', 'REQ-0003', 'EMP-0005', '2016-10-10'), ('IREQ-0004', 'REQ-0002', 'EMP-0005', '2016-10-10'), ('IREQ-0005', 'REQ-0006', 'EMP-0005', '2016-10-10'), ('IREQ-0006', 'REQ-0007', 'EMP-0005', '2016-10-10'), ('IREQ-0007', 'REQ-0008', 'EMP-0006', '2016-10-17'); -- -------------------------------------------------------- -- -- Table structure for table `tblItemType` -- CREATE TABLE IF NOT EXISTS `tblItemType` ( `strItemTypeId` varchar(45) NOT NULL, `strItemTypeName` varchar(45) NOT NULL, `strItemTypeDesc` text, PRIMARY KEY (`strItemTypeId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblItemType` -- INSERT INTO `tblItemType` (`strItemTypeId`, `strItemTypeName`, `strItemTypeDesc`) VALUES ('ITYPE-0001', 'Cutting', 'Used for cutting objects'), ('ITYPE-0002', 'Masonry', ''), ('ITYPE-0003', 'Painting', ''), ('ITYPE-0004', 'Fabricating', ''), ('ITYPE-0005', 'Adhesives', ''), ('ITYPE-0006', 'Fasteners', ''), ('ITYPE-0007', 'Concrete', ''), ('ITYPE-0008', 'Measuring', ''), ('ITYPE-0009', 'Wood', ''), ('ITYPE-0010', 'Hammering', ''), ('ITYPE-0011', 'Trial', ''); -- -------------------------------------------------------- -- -- Table structure for table `tblJobSkill` -- CREATE TABLE IF NOT EXISTS `tblJobSkill` ( `strJobSId` varchar(45) NOT NULL, `strJobSName` varchar(100) NOT NULL, `strJobSDesc` text, `intJobSStatus` tinyint(1) NOT NULL, PRIMARY KEY (`strJobSId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblJobSkill` -- INSERT INTO `tblJobSkill` (`strJobSId`, `strJobSName`, `strJobSDesc`, `intJobSStatus`) VALUES ('SKILL-0001', 'Wood carving', '', 1), ('SKILL-0002', 'Wood painting', '', 1), ('SKILL-0003', 'Wood fabricating', '', 1), ('SKILL-0004', 'Wood carvingsss', 'asdf', 0), ('SKILL-0005', 'Typing', '', 1), ('SKILL-0006', 'File keeping', '', 1), ('SKILL-0007', 'Electrical Maintenance', '', 1), ('SKILL-0008', 'Masonry', '', 1), ('SKILL-0009', 'Plumbing', '', 0), ('SKILL-0010', 'aa', 'aaa', 1); -- -------------------------------------------------------- -- -- Table structure for table `tblJobTitle` -- CREATE TABLE IF NOT EXISTS `tblJobTitle` ( `strJobTId` varchar(45) NOT NULL, `strJobTName` varchar(100) NOT NULL, `strJobTDesc` text, PRIMARY KEY (`strJobTId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblJobTitle` -- INSERT INTO `tblJobTitle` (`strJobTId`, `strJobTName`, `strJobTDesc`) VALUES ('TITLE-0001', 'Carpenter', 'gupit ng kahoy'), ('TITLE-0002', 'Secretary', 'tago papel'), ('TITLE-0003', 'Electrician', 'ayos kuryente'), ('TITLE-0004', 'Chief', 'eto ba yun tagaluto'), ('TITLE-0005', 'Warehouse Maintenance', 'taga tago ng gamit'), ('TITLE-0006', 'Painter', ''), ('TITLEID-0007', 'Mason', ''); -- -------------------------------------------------------- -- -- Table structure for table `tblOffice` -- CREATE TABLE IF NOT EXISTS `tblOffice` ( `strOfficeId` varchar(45) NOT NULL, `strOfficeName` varchar(100) NOT NULL, `strOfficeDesc` text, `strOfficeContact` varchar(45) NOT NULL, PRIMARY KEY (`strOfficeId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblOffice` -- INSERT INTO `tblOffice` (`strOfficeId`, `strOfficeName`, `strOfficeDesc`, `strOfficeContact`) VALUES ('OFFICE-0001', 'College of Computer and Information Sciences', 'asdf', '13123'), ('OFFICE-0002', 'College of Accountancy and Finance', 'puro pera dito', '123123'), ('OFFICE-0003', 'College of Communication', 'asdf', '32432'), ('OFFICE-0004', 'Office of the President', '', '207'); -- -------------------------------------------------------- -- -- Table structure for table `tblProjAssignment` -- CREATE TABLE IF NOT EXISTS `tblProjAssignment` ( `strProjAProjHId` varchar(45) NOT NULL, `strProjAEmpId` varchar(45) NOT NULL, PRIMARY KEY (`strProjAProjHId`,`strProjAEmpId`), KEY `strProjAEmpId_idx` (`strProjAEmpId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblProjAssignment` -- INSERT INTO `tblProjAssignment` (`strProjAProjHId`, `strProjAEmpId`) VALUES ('REQ-0001', 'EMP-0001'), ('REQ-0008', 'EMP-0001'), ('REQ-0003', 'EMP-0003'), ('REQ-0008', 'EMP-0003'), ('REQ-0003', 'EMP-0004'), ('REQ-0008', 'EMP-0004'); -- -------------------------------------------------------- -- -- Table structure for table `tblProjectDetail` -- CREATE TABLE IF NOT EXISTS `tblProjectDetail` ( `intProjDId` int(11) NOT NULL AUTO_INCREMENT, `strProjDProjHId` varchar(45) NOT NULL, `strProjDItemId` varchar(45) NOT NULL, `strProjDUnitId` varchar(45) NOT NULL, `intProjDQty` int(11) NOT NULL, PRIMARY KEY (`intProjDId`,`strProjDProjHId`), KEY `strProjDItemId_idx` (`strProjDItemId`), KEY `strProjDUnitId_idx` (`strProjDUnitId`), KEY `strProjDProjHId_idx` (`strProjDProjHId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ; -- -- Dumping data for table `tblProjectDetail` -- INSERT INTO `tblProjectDetail` (`intProjDId`, `strProjDProjHId`, `strProjDItemId`, `strProjDUnitId`, `intProjDQty`) VALUES (5, 'REQ-0001', 'ITEM-0007', 'UNIT-0002', 4), (6, 'REQ-0001', 'ITEM-0003', 'UNIT-0003', 5), (9, 'REQ-0002', 'ITEM-0008', 'UNIT-0002', 1), (10, 'REQ-0002', 'ITEM-0009', 'UNIT-0002', 2), (11, 'REQ-0002', 'ITEM-0004', 'UNIT-0006', 10), (17, 'REQ-0003', 'ITEM-0008', 'UNIT-0002', 10), (18, 'REQ-0003', 'ITEM-0003', 'UNIT-0003', 10), (19, 'REQ-0003', 'ITEM-0004', 'UNIT-0001', 5), (20, 'REQ-0006', 'ITEM-0009', 'UNIT-0002', 5), (21, 'REQ-0007', 'ITEM-0009', 'UNIT-0002', 4), (22, 'REQ-0008', 'ITEM-0007', 'UNIT-0002', 5), (23, 'REQ-0008', 'ITEM-0002', 'UNIT-0006', 2); -- -------------------------------------------------------- -- -- Table structure for table `tblProjectHeader` -- CREATE TABLE IF NOT EXISTS `tblProjectHeader` ( `strProjHReqId` varchar(45) NOT NULL, `strProjHSecId` varchar(45) NOT NULL, `dtmProjHStart` datetime NOT NULL, `dtmProjHEnd` datetime NOT NULL, `intProjHPriority` tinyint(2) NOT NULL, `strProjHRemarks` text, PRIMARY KEY (`strProjHReqId`), KEY `strProjHSecId_idx` (`strProjHSecId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblProjectHeader` -- INSERT INTO `tblProjectHeader` (`strProjHReqId`, `strProjHSecId`, `dtmProjHStart`, `dtmProjHEnd`, `intProjHPriority`, `strProjHRemarks`) VALUES ('REQ-0001', 'SEC-0005', '2016-10-10 06:58:44', '2016-10-10 07:06:22', 3, NULL), ('REQ-0002', 'SEC-0001', '2016-10-05 14:31:43', '0000-00-00 00:00:00', 1, NULL), ('REQ-0003', 'SEC-0001', '2016-10-10 08:35:37', '0000-00-00 00:00:00', 2, NULL), ('REQ-0006', 'SEC-0005', '2016-10-10 08:49:06', '0000-00-00 00:00:00', 1, NULL), ('REQ-0007', 'SEC-0005', '2016-10-10 08:49:10', '0000-00-00 00:00:00', 1, NULL), ('REQ-0008', 'SEC-0001', '2016-10-17 09:38:15', '0000-00-00 00:00:00', 3, NULL); -- -------------------------------------------------------- -- -- Table structure for table `tblProjReqD` -- CREATE TABLE IF NOT EXISTS `tblProjReqD` ( `strProjReqDId` varchar(45) NOT NULL, `strProjReqDReqHId` varchar(45) NOT NULL, `strProjReqDServId` varchar(45) NOT NULL, `strProjReqDDesc` text NOT NULL, `intProjReqDStatus` tinyint(2) NOT NULL, PRIMARY KEY (`strProjReqDId`), KEY `strProjReqDReqHId_idx` (`strProjReqDReqHId`), KEY `strProjReqDServId_idx` (`strProjReqDServId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblProjReqD` -- INSERT INTO `tblProjReqD` (`strProjReqDId`, `strProjReqDReqHId`, `strProjReqDServId`, `strProjReqDDesc`, `intProjReqDStatus`) VALUES ('REQ-0001', 'PROJR-0001', 'SERV-0002', 'Air-condition', 2), ('REQ-0002', 'PROJR-0001', 'SERV-0003', 'Teachers table', 2), ('REQ-0003', 'PROJR-0002', 'SERV-0001', 'Teachers Table', 2), ('REQ-0004', 'PROJR-0002', 'SERV-0002', 'Air-condition', 1), ('REQ-0005', 'PROJR-0002', 'SERV-0003', 'Teacher', 1), ('REQ-0006', 'PROJR-0003', 'SERV-0002', 'Table ', 2), ('REQ-0007', 'PROJR-0003', 'SERV-0002', 'chair', 2), ('REQ-0008', 'PROJR-0004', 'SERV-0002', 'Electric Fan', 2), ('REQ-0009', 'PROJR-0004', 'SERV-0001', 'Teachers Table', 1); -- -------------------------------------------------------- -- -- Table structure for table `tblProjReqH` -- CREATE TABLE IF NOT EXISTS `tblProjReqH` ( `strProjReqHId` varchar(45) NOT NULL, `strProjReqHDesc` text, `strProjReqHClientId` varchar(45) NOT NULL, `dtmProjReqHDateRec` datetime NOT NULL, PRIMARY KEY (`strProjReqHId`), KEY `strProjReqHClientId_idx` (`strProjReqHClientId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblProjReqH` -- INSERT INTO `tblProjReqH` (`strProjReqHId`, `strProjReqHDesc`, `strProjReqHClientId`, `dtmProjReqHDateRec`) VALUES ('PROJR-0001', 'basta aircon', 'CLIENT-0003', '2016-10-04 22:35:49'), ('PROJR-0002', 'For room renovation and fabrication', 'CLIENT-0006', '2016-10-10 08:24:48'), ('PROJR-0003', 'project na may palochina', 'CLIENT-0007', '2016-10-10 08:47:49'), ('PROJR-0004', 'Room Renovation', 'CLIENT-0008', '2016-10-17 09:36:42'); -- -------------------------------------------------------- -- -- Table structure for table `tblPurReqDetail` -- CREATE TABLE IF NOT EXISTS `tblPurReqDetail` ( `intPurReqDId` int(11) NOT NULL AUTO_INCREMENT, `strPurReqHId` varchar(45) NOT NULL, `strPurReqDItemId` varchar(45) NOT NULL, `strPurReqDUnitId` varchar(45) NOT NULL, `intPurReqDQty` int(11) NOT NULL, PRIMARY KEY (`intPurReqDId`,`strPurReqHId`), KEY `strPurReqDItemId_idx` (`strPurReqDItemId`), KEY `strPurReqDUnitId_idx` (`strPurReqDUnitId`), KEY `strPurReqHId_idx` (`strPurReqHId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ; -- -- Dumping data for table `tblPurReqDetail` -- INSERT INTO `tblPurReqDetail` (`intPurReqDId`, `strPurReqHId`, `strPurReqDItemId`, `strPurReqDUnitId`, `intPurReqDQty`) VALUES (27, 'PREQ-0001', 'ITEM-0004', 'UNIT-0006', 3), (28, 'PREQ-0002', 'ITEM-0007', 'UNIT-0002', 50), (29, 'PREQ-0002', 'ITEM-0003', 'UNIT-0003', 80), (30, 'PREQ-0003', 'ITEM-0009', 'UNIT-0002', 50), (31, 'PREQ-0004', 'ITEM-0002', 'UNIT-0006', 10); -- -------------------------------------------------------- -- -- Table structure for table `tblPurReqHeader` -- CREATE TABLE IF NOT EXISTS `tblPurReqHeader` ( `strPurReqId` varchar(45) NOT NULL, `strPurReqHEmpId` varchar(45) NOT NULL, `dtmPurReqHDate` datetime NOT NULL, `intPurReqHStatus` tinyint(2) NOT NULL, PRIMARY KEY (`strPurReqId`), KEY `strPurReqHEmpId_idx` (`strPurReqHEmpId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblPurReqHeader` -- INSERT INTO `tblPurReqHeader` (`strPurReqId`, `strPurReqHEmpId`, `dtmPurReqHDate`, `intPurReqHStatus`) VALUES ('PREQ-0001', 'EMP-0004', '2016-10-10 00:34:17', 1), ('PREQ-0002', 'EMP-0004', '2016-10-10 07:04:38', 1), ('PREQ-0003', 'EMP-0004', '2016-10-12 12:36:04', 1), ('PREQ-0004', 'EMP-0001', '2016-10-17 09:40:10', 1); -- -------------------------------------------------------- -- -- Table structure for table `tblReservation` -- CREATE TABLE IF NOT EXISTS `tblReservation` ( `strResId` varchar(45) NOT NULL, `strResEName` varchar(100) NOT NULL, `strResAmenityId` varchar(45) NOT NULL, `dtmResDateRec` datetime NOT NULL, `dateReservation` date NOT NULL, `timeResStart` time NOT NULL, `timeResEnd` time NOT NULL, `intResStatus` tinyint(2) NOT NULL, `strResClientId` varchar(45) NOT NULL, PRIMARY KEY (`strResId`), KEY `strResAmenityId_idx` (`strResAmenityId`), KEY `strResClientId_idx` (`strResClientId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblReservation` -- INSERT INTO `tblReservation` (`strResId`, `strResEName`, `strResAmenityId`, `dtmResDateRec`, `dateReservation`, `timeResStart`, `timeResEnd`, `intResStatus`, `strResClientId`) VALUES ('RES-0001', 'iSEMINAR', 'AME-0001', '2016-10-06 00:27:57', '2016-10-09', '09:00:00', '12:00:00', 1, 'CLIENT-0004'), ('RES-0002', 'iSeminart part 2', 'AME-0002', '2016-10-08 08:57:00', '2016-10-09', '08:00:00', '12:00:00', 1, 'CLIENT-0004'), ('RES-0003', 'DBA Seminar - Finals', 'AME-0002', '2016-10-10 08:22:39', '2016-10-15', '12:00:00', '16:00:00', 1, 'CLIENT-0005'), ('RES-0004', 'Lord Digong', 'AME-0004', '2016-10-17 09:35:39', '2016-10-22', '11:00:00', '12:00:00', 1, 'CLIENT-0005'); -- -------------------------------------------------------- -- -- Table structure for table `tblSection` -- CREATE TABLE IF NOT EXISTS `tblSection` ( `strSecId` varchar(45) NOT NULL, `strSecName` varchar(100) NOT NULL, `strSecDesc` text, PRIMARY KEY (`strSecId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblSection` -- INSERT INTO `tblSection` (`strSecId`, `strSecName`, `strSecDesc`) VALUES ('SEC-0001', 'Building Maintenance', 'checking edit'), ('SEC-0002', 'Lights and Sounds', ''), ('SEC-0003', 'Grounds Maintenance', ''), ('SEC-0004', 'Electrical Maintenance', ''), ('SEC-0005', 'Air-conditioning', ''), ('SEC-0006', 'Building Maintenance - HASMIN', ''); -- -------------------------------------------------------- -- -- Table structure for table `tblService` -- CREATE TABLE IF NOT EXISTS `tblService` ( `strServId` varchar(45) NOT NULL, `strServName` varchar(100) NOT NULL, `strServDesc` varchar(100) DEFAULT NULL, `intServStatus` tinyint(2) NOT NULL, PRIMARY KEY (`strServId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblService` -- INSERT INTO `tblService` (`strServId`, `strServName`, `strServDesc`, `intServStatus`) VALUES ('SERV-0001', 'Repair', 'under replacement', 1), ('SERV-0002', 'Install', '', 1), ('SERV-0003', 'Replacement', '', 1); -- -------------------------------------------------------- -- -- Table structure for table `tblUnit` -- CREATE TABLE IF NOT EXISTS `tblUnit` ( `strUnitId` varchar(45) NOT NULL, `strUnitName` varchar(100) NOT NULL, `strUnitDesc` text, PRIMARY KEY (`strUnitId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblUnit` -- INSERT INTO `tblUnit` (`strUnitId`, `strUnitName`, `strUnitDesc`) VALUES ('UNIT-0001', 'Can - 4 liters', ''), ('UNIT-0002', 'Piece', ''), ('UNIT-0003', 'Kilogram', ''), ('UNIT-0004', 'Gram', ''), ('UNIT-0005', 'Pack', ''), ('UNIT-0006', 'Box', 'd'), ('UNIT-0007', 'Liter', ''); -- -- Constraints for dumped tables -- -- -- Constraints for table `tblAmenity` -- ALTER TABLE `tblAmenity` ADD CONSTRAINT `strAmenityATId` FOREIGN KEY (`strAmenityATId`) REFERENCES `tblAmenityType` (`strAmenityTId`) ON UPDATE CASCADE; -- -- Constraints for table `tblClient` -- ALTER TABLE `tblClient` ADD CONSTRAINT `strClientOfficeId` FOREIGN KEY (`strClientOfficeId`) REFERENCES `tblOffice` (`strOfficeId`) ON UPDATE CASCADE; -- -- Constraints for table `tblEmployee` -- ALTER TABLE `tblEmployee` ADD CONSTRAINT `strEmpJobId` FOREIGN KEY (`strEmpJobId`) REFERENCES `tblJobTitle` (`strJobTId`) ON UPDATE CASCADE; -- -- Constraints for table `tblEmpSkill` -- ALTER TABLE `tblEmpSkill` ADD CONSTRAINT `strEmpSEmpId` FOREIGN KEY (`strEmpSEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE, ADD CONSTRAINT `strEmpSJobSId` FOREIGN KEY (`strEmpSJobSId`) REFERENCES `tblJobSkill` (`strJobSId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItem` -- ALTER TABLE `tblItem` ADD CONSTRAINT `strItemITypeId` FOREIGN KEY (`strItemITypeId`) REFERENCES `tblItemType` (`strItemTypeId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemDefect` -- ALTER TABLE `tblItemDefect` ADD CONSTRAINT `strItemDefItemId` FOREIGN KEY (`strItemDefItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemDefUnitId` FOREIGN KEY (`strItemDefUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemDelDetail` -- ALTER TABLE `tblItemDelDetail` ADD CONSTRAINT `strDeliDItemId` FOREIGN KEY (`strDeliDItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strDeliDUnitId` FOREIGN KEY (`strDeliDUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE, ADD CONSTRAINT `strDeliHId` FOREIGN KEY (`strDeliHId`) REFERENCES `tblItemDelHeader` (`strDeliId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemDelHeader` -- ALTER TABLE `tblItemDelHeader` ADD CONSTRAINT `strDeliEmpId` FOREIGN KEY (`strDeliHEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE, ADD CONSTRAINT `strDeliPurReqHId` FOREIGN KEY (`strDeliHPurReqHId`) REFERENCES `tblPurReqHeader` (`strPurReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemRelDetail` -- ALTER TABLE `tblItemRelDetail` ADD CONSTRAINT `strItemRelDItemId` FOREIGN KEY (`strItemRelDItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemRelDUnitId` FOREIGN KEY (`strItemRelDUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemRelHId` FOREIGN KEY (`strItemRelHId`) REFERENCES `tblItemRelHeader` (`strItemRelId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemRelHeader` -- ALTER TABLE `tblItemRelHeader` ADD CONSTRAINT `strItemRelEmpId` FOREIGN KEY (`strItemRelEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemRelReqId` FOREIGN KEY (`strItemRelItemReqId`) REFERENCES `tblItemReqHeader` (`strItemReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemReqDetail` -- ALTER TABLE `tblItemReqDetail` ADD CONSTRAINT `strItemReqDItemId` FOREIGN KEY (`strItemReqDItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemReqDUnitId` FOREIGN KEY (`strItemReqDUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemReqHId` FOREIGN KEY (`strItemReqHId`) REFERENCES `tblItemReqHeader` (`strItemReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblItemReqHeader` -- ALTER TABLE `tblItemReqHeader` ADD CONSTRAINT `strItemReqHEmpId` FOREIGN KEY (`strItemReqHEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE, ADD CONSTRAINT `strItemReqHProjHId` FOREIGN KEY (`strItemReqHProjHId`) REFERENCES `tblProjectHeader` (`strProjHReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblProjAssignment` -- ALTER TABLE `tblProjAssignment` ADD CONSTRAINT `strProjAEmpId` FOREIGN KEY (`strProjAEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE, ADD CONSTRAINT `strProjAProjHId` FOREIGN KEY (`strProjAProjHId`) REFERENCES `tblProjectHeader` (`strProjHReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblProjectDetail` -- ALTER TABLE `tblProjectDetail` ADD CONSTRAINT `strProjDItemId` FOREIGN KEY (`strProjDItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strProjDProjHId` FOREIGN KEY (`strProjDProjHId`) REFERENCES `tblProjectHeader` (`strProjHReqId`) ON UPDATE CASCADE, ADD CONSTRAINT `strProjDUnitId` FOREIGN KEY (`strProjDUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE; -- -- Constraints for table `tblProjectHeader` -- ALTER TABLE `tblProjectHeader` ADD CONSTRAINT `strProjHReqId` FOREIGN KEY (`strProjHReqId`) REFERENCES `tblProjReqD` (`strProjReqDId`) ON UPDATE CASCADE, ADD CONSTRAINT `strProjHSecId` FOREIGN KEY (`strProjHSecId`) REFERENCES `tblSection` (`strSecId`) ON UPDATE CASCADE; -- -- Constraints for table `tblProjReqD` -- ALTER TABLE `tblProjReqD` ADD CONSTRAINT `strProjReqDReqHId` FOREIGN KEY (`strProjReqDReqHId`) REFERENCES `tblProjReqH` (`strProjReqHId`) ON UPDATE CASCADE, ADD CONSTRAINT `strProjReqDServId` FOREIGN KEY (`strProjReqDServId`) REFERENCES `tblService` (`strServId`) ON UPDATE CASCADE; -- -- Constraints for table `tblProjReqH` -- ALTER TABLE `tblProjReqH` ADD CONSTRAINT `strProjReqHClientId` FOREIGN KEY (`strProjReqHClientId`) REFERENCES `tblClient` (`strClientId`) ON UPDATE CASCADE; -- -- Constraints for table `tblPurReqDetail` -- ALTER TABLE `tblPurReqDetail` ADD CONSTRAINT `strPurReqDItemId` FOREIGN KEY (`strPurReqDItemId`) REFERENCES `tblItem` (`strItemId`) ON UPDATE CASCADE, ADD CONSTRAINT `strPurReqDUnitId` FOREIGN KEY (`strPurReqDUnitId`) REFERENCES `tblUnit` (`strUnitId`) ON UPDATE CASCADE, ADD CONSTRAINT `strPurReqHId` FOREIGN KEY (`strPurReqHId`) REFERENCES `tblPurReqHeader` (`strPurReqId`) ON UPDATE CASCADE; -- -- Constraints for table `tblPurReqHeader` -- ALTER TABLE `tblPurReqHeader` ADD CONSTRAINT `strPurReqHEmpId` FOREIGN KEY (`strPurReqHEmpId`) REFERENCES `tblEmployee` (`strEmpId`) ON UPDATE CASCADE; -- -- Constraints for table `tblReservation` -- ALTER TABLE `tblReservation` ADD CONSTRAINT `strResAmenityId` FOREIGN KEY (`strResAmenityId`) REFERENCES `tblAmenity` (`strAmenityId`) ON UPDATE CASCADE, ADD CONSTRAINT `strResClientId` FOREIGN KEY (`strResClientId`) REFERENCES `tblClient` (`strClientId`) ON DELETE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
INSERT INTO productos (nombre, precio, create_at) VALUES('Panasonic', 800, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Sony', 342, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Apple', 123, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Sony Notebook', 565, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Hewlett Packard', 343, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Bianchi', 111, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Nike', 323, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Adidas', 345, NOW()); INSERT INTO productos (nombre, precio, create_at) VALUES('Reebok', 563, NOW());
UPDATE backend_usercompany SET company_id_id = backend_company.id, user_id_id = backend_user.id FROM backend_company, backend_user WHERE backend_usercompany.company_id_migration = backend_company.id_migration AND backend_usercompany.user_id_migration = backend_user.id_migration; ALTER TABLE backend_usercompany DROP column company_id_migration, DROP column user_id_migration;
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. -- -- You can write comments in this file by starting them with two dashes, like -- these lines here. -- player table -- match scores table CREATE TABLE players (name text, id serial primary key ); CREATE TABLE matches (winner integer references players(id), loser integer references players(id), id serial PRIMARY KEY); CREATE VIEW standings AS SELECT players.id,players.name, (SELECT count(matches.winner) FROM matches WHERE matches.winner = players.id) AS wins, (SELECT count(matches.id) FROM matches WHERE players.id = matches.winner OR players.id = matches.loser) AS matches FROM players ORDER BY wins DESC; CREATE VIEW ranks AS SELECT id, name, ROW_NUMBER() OVER (ORDER BY wins DESC) as position FROM standings ORDER BY position; CREATE VIEW groups AS SELECT *, -- integer division -> (1+1)/2 = 1 (2+1)/2 = 1 (3+1)/2 = 2 -- gives same group number for position 1,2 then 3,4 etc (position+1)/2 as group FROM ranks;
CREATE OR REPLACE VIEW V_CMS_LOAN_BOOK AS SELECT CLB.CLB_ID, CLB.CLB_NO, CLB.CLB_LOAN_CORP_ID AS BL_CORP_ID, BL.CORP_CODE AS BL_CORP_CODE, BL.CORP_NAME AS BL_CORP_NAME, CLB.CLB_BORROW_CORP_ID AS BB_CORP_ID, BB.CORP_CODE AS BB_CORP_CODE, BB.CORP_NAME AS BB_CORP_NAME, ROUND(CLB.CLB_LOAN_MONEY, 2) AS CLB_LOAN_MONEY, (SELECT NVL(SUM(CLA.CLA_MONEY), 0) FROM CMS_LOAN_ABATE CLA WHERE CLB.CLB_ID = CLA.CLB_ID) AS CLA_MONEY, ROUND(NVL(CLB.CLB_BALANCE, 0), 2) AS CLB_BALANCE, ROUND(NVL(CLB.CLB_FIXED_RATE, 0), 6) AS CLB_FIXED_RATE, ROUND(NVL(CLB.CLB_AGREEMENT_RATE, 0), 6) AS CLB_AGREEMENT_RATE, (SELECT NVL(SUM(CRL.CRL_MONEY), 0) FROM CMS_REPAY_LOAN CRL WHERE CLB.CLB_ID = CRL.CLB_ID) AS CRL_MONEY, (SELECT NVL(SUM(CBI.FIX_FEE_REAL), 0) FROM CMS_BILLING CBI WHERE CLB.CLB_ID = CBI.CLB_ID) AS FIX_FEE_REAL, (SELECT NVL(SUM(CBI.AGREEMENT_FEE_REAL), 0) FROM CMS_BILLING CBI WHERE CLB.CLB_ID = CBI.CLB_ID) AS AGREEMENT_FEE_REAL, (SELECT NVL(SUM(CRL.CRL_FIXED_MONEY), 0) FROM CMS_REPAY_LOAN CRL WHERE CLB.CLB_ID = CRL.CLB_ID) AS CRL_FIXED_MONEY, (SELECT NVL(SUM(CRL.CRL_AGREEMENT_MONEY), 0) FROM CMS_REPAY_LOAN CRL WHERE CLB.CLB_ID = CRL.CLB_ID) AS CRL_AGREEMENT_MONEY, (SELECT NVL(SUM(CPR.CPR_FIXED_MONEY), 0) FROM CMS_PAYMENT_RECORDS CPR WHERE CLB.CLB_ID = CPR.CLB_ID) AS CPR_FIXED_MONEY, (SELECT NVL(SUM(CPR.CPR_AGREEMENT_MONEY), 0) FROM CMS_PAYMENT_RECORDS CPR WHERE CLB.CLB_ID = CPR.CLB_ID) AS CPR_AGREEMENT_MONEY, CLB.CLB_START_DATE, CLB.CLB_END_DATE, CLB.CLB_STATUS FROM CMS_LOAN_BILL CLB INNER JOIN BT_CORP BL ON CLB.CLB_LOAN_CORP_ID = BL.ID INNER JOIN BT_CORP BB ON CLB.CLB_BORROW_CORP_ID = BB.ID; --修改日期:20121017 --修改人:叶爱军 --修改内容:CMS_LOAN_BILL 增加字段 应付固定费用 应付协定费用 已付固定费用 已付协定费用 减免固定费用 减免协定费用 待付固定费用 待付协定费用 --参数设置: ALTER TABLE CMS_LOAN_BILL ADD CLB_BIIL_FIX NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_BILL_AGREEMENT NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_PAY_FIX NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_PAY_AGREEMENT NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_ABATE_FIX NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_ABATE_AGREEMENT NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_UNPAY_FIX NUMBER(15,2); ALTER TABLE CMS_LOAN_BILL ADD CLB_UNPAY_AGREEMENT NUMBER(15,2); UPDATE CMS_LOAN_BILL SET CLB_BIIL_FIX = 0 WHERE CLB_BIIL_FIX IS NULL; UPDATE CMS_LOAN_BILL SET CLB_BILL_AGREEMENT = 0 WHERE CLB_BILL_AGREEMENT IS NULL; UPDATE CMS_LOAN_BILL SET CLB_PAY_FIX = 0 WHERE CLB_PAY_FIX IS NULL; UPDATE CMS_LOAN_BILL SET CLB_PAY_AGREEMENT = 0 WHERE CLB_PAY_AGREEMENT IS NULL; UPDATE CMS_LOAN_BILL SET CLB_ABATE_FIX = 0 WHERE CLB_ABATE_FIX IS NULL; UPDATE CMS_LOAN_BILL SET CLB_ABATE_AGREEMENT = 0 WHERE CLB_ABATE_AGREEMENT IS NULL; UPDATE CMS_LOAN_BILL SET CLB_UNPAY_FIX = 0 WHERE CLB_UNPAY_FIX IS NULL; UPDATE CMS_LOAN_BILL SET CLB_UNPAY_AGREEMENT = 0 WHERE CLB_UNPAY_AGREEMENT IS NULL; COMMIT;
--Monthly sales SELECT DISTINCT TOP (100) PERCENT QtyOrd.item_no , EDI.edi_item_num AS SAP#, IM.item_desc_1, IM.item_desc_2, INV.qty_on_hand AS QOH, QtyOrd.QtyOrd AS [QtyOrd] FROM ( SELECT SUM(QtyOrd) AS QtyOrd, item_no FROM ( SELECT item_no, SUM(qty_ordered) AS QtyOrd FROM dbo.oehdrhst_sql OH WITH(NOLOCK) JOIN oelinhst_Sql OL ON OL.inv_no = OH.inv_no WHERE MONTH(OH.inv_dt) = MONTH(DATEADD(month, -1, GETDATE())) AND YEAR(OH.inv_dt) = YEAR(DATEADD(month, -1, getdate())) AND (LTRIM(OH.cus_no) IN ('20938', '1575')) --Exclude Case Fronts and AP AND OL.prod_cat NOT IN ('037', '2', '036', '102', '111', '336','AP','7') --Exclude Z parts AND OL.item_no NOT LIKE 'Z%' --Exclude Replacements AND OH.user_def_fld_3 NOT LIKE ('%RP%') AND cus_item_no IS NOT NULL --Exclude prototypes AND OL.item_no NOT LIKE 'PROTO%' --Exclude BAK619 door pieces AND OL.item_no NOT LIKE 'B619%' AND OL.item_no NOT IN ('BAK-619 DOORSBL','BAK-619 DOORSBR') --Exclude CapEx AND OH.user_def_fld_3 NOT LIKE '%CAPEX%' GROUP BY item_no, inv_dt UNION ALL SELECT item_no, SUM(qty_ordered) AS QtyOrd FROM dbo.oeordhdr_sql OH WITH(NOLOCK) JOIN oeordlin_Sql OL ON OL.ord_no = OH.ord_no WHERE MONTH(OL.shipped_dt) = MONTH(DATEADD(month, -1, GETDATE())) AND YEAR(OL.shipped_dt) = YEAR(DATEADD(month, -1, getdate())) --Exclude Case Fronts and AP AND OL.prod_cat NOT IN ('037', '2', '036', '102', '111', '336','AP','7') --Exclude Z parts AND OL.item_no NOT LIKE 'Z%' --Exclude Replacements AND OH.user_def_fld_3 NOT LIKE ('%RP%') AND cus_item_no IS NOT NULL --Exclude prototypes AND OL.item_no NOT LIKE 'PROTO%' --Exclude BAK619 door pieces --AND OL.item_no NOT LIKE 'B619%' AND OL.item_no NOT IN ('BAK-619 DOORSBL','BAK-619 DOORSBR') --Exclude CapEx AND OH.user_def_fld_3 NOT LIKE '%CAPEX%' GROUP BY item_no ) AS Tot GROUP BY item_no ) AS QtyOrd JOIN edcitmfl_sql EDI WITH(NOLOCK) ON EDI.mac_item_num = QtyOrd.item_no JOIN Z_IMINVLOC INV WITH(NOLOCK) ON INV.item_no = QtyOrd.item_no JOIN imitmidx_sql IM WITH(NOLOCK) ON IM.item_no = QtyOrd.item_no ORDER BY QtyOrd.item_no DESC
RENAME TABLE decisions TO votings, decision_option_mapping TO voting_option_mapping; ALTER TABLE voting_option_mapping DROP FOREIGN KEY FK67500DC7CBADE601; ALTER TABLE voting_option_mapping CHANGE decision_id voting_id bigint; alter table voting_option_mapping add constraint FK67500DC7CBADE601 foreign key (voting_id) references votings (id); ALTER TABLE votes DROP FOREIGN KEY fk_votes_decision_option_id; ALTER TABLE votes DROP INDEX idx_votes_decision_option_id; ALTER TABLE votes CHANGE decision_option_id voting_option_id bigint; alter table votes add index idx_votes_voting_option_id (voting_option_id), add constraint fk_votes_voting_option_id foreign key (voting_option_id) references options (id);
--PROBLEM 15 --Select all employees who earn more than 30000 into a new table. Then delete all employees --who have ManagerID = 42 (in the new table). --Then increase the salaries of all employees with DepartmentID=1 by 5000. --Finally, select the average salaries in each department. SELECT * INTO Temp_Table1 FROM Employees WHERE Salary> 30000 DELETE FROM Temp_Table1 WHERE ManagerID = 42 UPDATE Temp_Table1 SET Salary += 5000 WHERE DepartmentID =1 SELECT DepartmentID ,AVG(Salary) AS AverageSalary FROM Temp_Table1 GROUP BY DepartmentID
-- phpMyAdmin SQL Dump -- version 4.0.10.18 -- https://www.phpmyadmin.net -- -- Хост: localhost:3306 -- Время создания: Июн 23 2018 г., 02:36 -- Версия сервера: 5.6.39-cll-lve -- Версия PHP: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- База данных: `SOCIALNETWORK999` -- -- -------------------------------------------------------- -- -- Структура таблицы `comments` -- CREATE TABLE IF NOT EXISTS `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `post_body` text NOT NULL, `posted_by` varchar(60) NOT NULL, `posted_to` varchar(60) NOT NULL, `date_added` datetime NOT NULL, `removed` varchar(3) NOT NULL, `post_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Дамп данных таблицы `comments` -- INSERT INTO `comments` (`id`, `post_body`, `posted_by`, `posted_to`, `date_added`, `removed`, `post_id`) VALUES (1, 'Wake up!', 'john_smith', 'john_smith', '2017-09-21 01:55:34', 'no', 20), (2, 'hi', 'ihar_petrushenka', 'john_smith', '2017-09-21 01:57:35', 'no', 20), (3, 'ughnjmi', 'ihar_petrushenka', 'john_smith', '2017-09-21 01:59:56', 'no', 18), (4, 'hi again', 'ihar_petrushenka', 'john_smith', '2017-09-21 04:13:36', 'no', 20), (5, 'Nice to see ya!', 'ihar_petrushenka', 'john_smith', '2017-10-11 23:44:03', 'no', 20), (6, 'That was my previous car, and it was me who was driving it. This stupid motherfucker scared me a lot... ', 'ihar_petrushenka', 'ihar_petrushenka', '2018-03-06 10:58:58', 'no', 42), (7, 'Just before sad events. It was a sign from above, I suppose.', 'ihar_petrushenka', 'ihar_petrushenka', '2018-05-20 13:27:59', 'no', 42); -- -------------------------------------------------------- -- -- Структура таблицы `friend_requests` -- CREATE TABLE IF NOT EXISTS `friend_requests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_to` varchar(50) NOT NULL, `user_from` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Структура таблицы `likes` -- CREATE TABLE IF NOT EXISTS `likes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(60) NOT NULL, `post_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ; -- -- Дамп данных таблицы `likes` -- INSERT INTO `likes` (`id`, `username`, `post_id`) VALUES (6, 'ihar_petrushenka', 15), (9, 'ihar_petrushenka', 24), (15, 'ihar_petrushenka', 39), (18, 'ihar_petrushenka', 38), (19, 'ihar_petrushenka', 36), (20, 'ihar_petrushenka', 21), (21, '', 42), (22, '', 40), (25, '', 38), (26, 'ihar_petrushenka', 40), (27, 'ihar_petrushenka', 42); -- -------------------------------------------------------- -- -- Структура таблицы `messages` -- CREATE TABLE IF NOT EXISTS `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_to` varchar(50) NOT NULL, `user_from` varchar(50) NOT NULL, `body` text NOT NULL, `date` datetime NOT NULL, `opened` varchar(3) NOT NULL, `viewed` varchar(3) NOT NULL, `deleted` varchar(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=39 ; -- -- Дамп данных таблицы `messages` -- INSERT INTO `messages` (`id`, `user_to`, `user_from`, `body`, `date`, `opened`, `viewed`, `deleted`) VALUES (1, 'bart_simpson', 'ihar_petrushenka', 'Hi, Bart!', '2017-10-08 14:02:54', 'yes', 'yes', 'no'), (2, 'bart_simpson', 'ihar_petrushenka', 'ewrty', '2017-10-08 14:03:46', 'yes', 'yes', 'no'), (3, 'bart_simpson', 'ihar_petrushenka', 'wretrh', '2017-10-08 14:03:48', 'yes', 'yes', 'no'), (4, 'bart_simpson', 'ihar_petrushenka', 'wacsfd', '2017-10-08 14:03:50', 'yes', 'yes', 'no'), (5, 'bart_simpson', 'ihar_petrushenka', 'esrdgf', '2017-10-08 14:03:52', 'yes', 'yes', 'no'), (6, 'bart_simpson', 'ihar_petrushenka', 'ewfrt', '2017-10-08 14:03:56', 'yes', 'yes', 'no'), (7, 'bart_simpson', 'ihar_petrushenka', 'qr3wt4e5', '2017-10-08 14:03:58', 'yes', 'yes', 'no'), (8, 'bart_simpson', 'ihar_petrushenka', 'ewrt', '2017-10-08 14:04:00', 'yes', 'yes', 'no'), (9, 'bart_simpson', 'ihar_petrushenka', 'wewr', '2017-10-08 14:04:02', 'yes', 'yes', 'no'), (10, 'ihar_petrushenka', 'bart_simpson', 'Hi, Ihar, my dear friend!', '2017-10-08 16:53:21', 'yes', 'yes', 'no'), (11, 'ihar_petrushenka', 'bart_simpson', 'Nice to see you again!\r\n', '2017-10-08 16:53:40', 'yes', 'yes', 'no'), (12, 'bart_simpson', 'ihar_petrushenka', 'wergf', '2017-10-08 17:01:19', 'yes', 'yes', 'no'), (13, 'bart_simpson', 'ihar_petrushenka', 'qewreg', '2017-10-08 17:01:21', 'yes', 'yes', 'no'), (14, 'bart_simpson', 'ihar_petrushenka', 'sdftgyhjkl;kkjuytrewertyuiolkjmnbvdswertyuikljmnbvfdertyuiol,mnnbvcdsewrtyuiolk,mnbnvvfcdsertryuikjmnbvcdsertyujikj', '2017-10-08 17:01:38', 'yes', 'yes', 'no'), (15, 'bart_simpson', 'ihar_petrushenka', 'sdftgyhjkl;kkjuytrewertyuiolkjmnbvdswertyuikljmnbvfdertyuiol,mnnbvcdsewrtyuiolk,mnbnvvfcdsertryuikjmnbvcdsertyujikj', '2017-10-08 17:15:13', 'yes', 'yes', 'no'), (16, 'bart_simpson', 'ihar_petrushenka', 'hei', '2017-10-08 17:15:47', 'yes', 'yes', 'no'), (17, 'bart_simpson', 'ihar_petrushenka', 'ewrtghj', '2017-10-08 17:17:43', 'yes', 'yes', 'no'), (18, 'john_smith', 'ihar_petrushenka', 'Hey, man!', '2017-10-08 19:03:49', 'yes', 'yes', 'no'), (19, 'bart_simpson', 'ihar_petrushenka', 'GF', '2017-10-08 19:06:30', 'yes', 'yes', 'no'), (20, 'bart_simpson', 'ihar_petrushenka', 'nice', '2017-10-08 23:31:09', 'yes', 'yes', 'no'), (21, 'bart_simpson', 'ihar_petrushenka', 'ert', '2017-10-09 01:57:45', 'yes', 'yes', 'no'), (22, 'bart_simpson', 'ihar_petrushenka', 'hi there', '2017-10-09 02:04:30', 'yes', 'yes', 'no'), (23, 'john_smith', 'ihar_petrushenka', 'hjybjnk', '2017-10-09 23:27:15', 'yes', 'yes', 'no'), (24, 'bart_simpson', 'ihar_petrushenka', 'ghbjnk', '2017-10-09 23:38:00', 'yes', 'yes', 'no'), (25, 'bart_simpson', 'ihar_petrushenka', 'hi', '2017-10-12 00:15:47', 'yes', 'yes', 'no'), (26, 'bart_simpson', 'ihar_petrushenka', 'how r u?', '2017-10-12 00:16:11', 'yes', 'yes', 'no'), (27, 'bart_simpson', 'ihar_petrushenka', 'how r u?', '2017-10-12 00:16:30', 'yes', 'yes', 'no'), (28, 'bart_simpson', 'ihar_petrushenka', 'how r u?', '2017-10-12 00:17:00', 'yes', 'yes', 'no'), (29, 'bart_simpson', 'ihar_petrushenka', 'Щрипо', '2018-01-26 11:09:24', 'no', 'no', 'no'), (30, 'bart_simpson', 'ihar_petrushenka', 'Long time no see!', '2018-04-19 15:30:05', 'no', 'no', 'no'), (31, 'bart_simpson', 'ihar_petrushenka', 'What have you been up to?', '2018-04-19 15:30:25', 'no', 'no', 'no'), (32, 'ihar_petrushenka', 'name_surname', 'Hi there, my friend :)', '2018-05-05 14:55:55', 'yes', 'yes', 'no'), (33, 'ihar_petrushenka', 'name_surname', 'Long time no see!\r\nWhat have you been up to lately?', '2018-05-05 14:56:59', 'yes', 'yes', 'no'), (34, 'name_surname', 'ihar_petrushenka', 'Hi! It''s been ages, since I saw you!', '2018-05-05 15:01:03', 'yes', 'yes', 'no'), (35, 'name_surname', 'ihar_petrushenka', 'Let''s hang out somewhere in the city!', '2018-05-05 15:02:06', 'yes', 'yes', 'no'), (36, 'name_surname', 'ihar_petrushenka', 'Let me know when you''ll have time for it.\r\nKeep in touch!', '2018-05-05 15:03:05', 'yes', 'yes', 'no'), (37, 'ihar_petrushenka', 'name_surname', 'Deal! See ya!', '2018-05-05 15:04:49', 'yes', 'yes', 'no'), (38, 'bart_simpson', 'ihar_petrushenka', 'Hi\r\n', '2018-05-20 22:32:28', 'no', 'no', 'no'); -- -------------------------------------------------------- -- -- Структура таблицы `notifications` -- CREATE TABLE IF NOT EXISTS `notifications` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_to` varchar(50) NOT NULL, `user_from` varchar(50) NOT NULL, `message` text NOT NULL, `link` varchar(100) NOT NULL, `datetime` datetime NOT NULL, `opened` varchar(3) NOT NULL, `viewed` varchar(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ; -- -- Дамп данных таблицы `notifications` -- INSERT INTO `notifications` (`id`, `user_to`, `user_from`, `message`, `link`, `datetime`, `opened`, `viewed`) VALUES (1, 'ihar_petrushenka', 'bart_simpson', 'Bart Simpson liked your post.', 'post.php?id=21', '2017-10-11 22:34:30', 'yes', 'yes'), (2, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka posted on your profile.', 'post.php?id=28', '2017-10-11 22:43:38', 'no', 'yes'), (3, 'john_smith', 'ihar_petrushenka', 'Ihar Petrushenka commented on your post.', 'post.php?id=20', '2017-10-11 23:44:03', 'yes', 'yes'), (4, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka posted on your profile.', 'post.php?id=29', '2017-10-12 00:16:23', 'no', 'yes'), (5, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka posted on your profile.', 'post.php?id=30', '2017-10-12 00:16:48', 'yes', 'yes'), (6, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka posted on your profile.', 'post.php?id=31', '2017-10-12 00:16:58', 'yes', 'yes'), (7, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka liked your post.', 'post.php?id=24', '2017-10-12 00:17:16', 'yes', 'yes'), (8, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka liked your post.', 'post.php?id=39', '2018-05-06 15:09:58', 'no', 'no'), (9, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka liked your post.', 'post.php?id=39', '2018-05-06 15:10:00', 'no', 'no'), (10, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka liked your post.', 'post.php?id=39', '2018-05-06 15:10:05', 'no', 'no'), (11, 'bart_simpson', 'ihar_petrushenka', 'Ihar Petrushenka liked your post.', 'post.php?id=39', '2018-05-06 15:10:07', 'no', 'no'), (12, 'ihar_petrushenka', '', ' liked your post.', 'post.php?id=42', '2018-05-20 18:05:00', 'yes', 'yes'), (13, 'ihar_petrushenka', '', ' liked your post.', 'post.php?id=40', '2018-05-20 18:05:06', 'yes', 'yes'), (14, 'ihar_petrushenka', '', ' liked your post.', 'post.php?id=38', '2018-05-20 18:05:40', 'yes', 'yes'), (15, 'ihar_petrushenka', '', ' liked your post.', 'post.php?id=38', '2018-05-20 18:14:38', 'yes', 'yes'), (16, 'ihar_petrushenka', '', ' liked your post.', 'post.php?id=38', '2018-05-20 18:14:42', 'yes', 'yes'); -- -------------------------------------------------------- -- -- Структура таблицы `posts` -- CREATE TABLE IF NOT EXISTS `posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `body` text NOT NULL, `added_by` varchar(60) NOT NULL, `user_to` varchar(60) NOT NULL, `date_added` datetime NOT NULL, `user_closed` varchar(3) NOT NULL, `deleted` varchar(3) NOT NULL, `likes` int(11) NOT NULL, `image` varchar(500) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ; -- -- Дамп данных таблицы `posts` -- INSERT INTO `posts` (`id`, `body`, `added_by`, `user_to`, `date_added`, `user_closed`, `deleted`, `likes`, `image`) VALUES (1, 'yeah!', 'john_smith', 'none', '2017-09-16 03:54:48', 'no', 'no', 0, ''), (2, 'Hi, everybody!', 'john_smith', 'none', '2017-09-17 02:45:43', 'no', 'no', 0, ''), (9, 'Hello!', 'john_smith', 'none', '2017-09-17 02:50:06', 'no', 'no', 0, ''), (10, 'fgh', 'john_smith', 'none', '2017-09-19 00:48:21', 'no', 'no', 0, ''), (11, 'fvghbhjnj', 'john_smith', 'none', '2017-09-19 00:48:29', 'no', 'no', 0, ''), (12, 'gbh', 'john_smith', 'none', '2017-09-19 00:48:33', 'no', 'no', 1, ''), (13, 'hgjb', 'john_smith', 'none', '2017-09-19 00:48:37', 'no', 'no', 1, ''), (14, 'gbhj', 'john_smith', 'none', '2017-09-19 00:48:42', 'no', 'no', 1, ''), (15, 'gvbhn', 'john_smith', 'none', '2017-09-19 00:48:46', 'no', 'no', 2, ''), (16, 'gbhnj', 'john_smith', 'none', '2017-09-19 00:48:54', 'no', 'no', 0, ''), (17, 'hjb', 'john_smith', 'none', '2017-09-19 00:48:57', 'no', 'no', 0, ''), (18, 'hjbjn', 'john_smith', 'none', '2017-09-19 00:49:04', 'no', 'no', 0, ''), (19, 'vyjhjb', 'john_smith', 'none', '2017-09-19 00:49:07', 'no', 'no', 0, ''), (20, 'vyjhjb', 'john_smith', 'none', '2017-09-19 00:50:35', 'no', 'no', 0, ''), (21, 'ybgunhimj', 'ihar_petrushenka', 'none', '2017-09-21 01:57:20', 'no', 'no', 1, ''), (22, 'tfybgnuhj', 'ihar_petrushenka', 'none', '2017-09-21 01:57:24', 'no', 'no', 0, ''), (23, 'tfybgnuhj', 'ihar_petrushenka', 'none', '2017-09-21 02:48:21', 'no', 'no', 0, ''), (24, 'hi', 'bart_simpson', 'none', '2017-09-29 22:29:40', 'no', 'no', 2, ''), (25, 'dwefrty', 'ihar_petrushenka', 'bart_simpson', '2017-10-04 01:29:13', 'no', 'no', 0, ''), (26, 'defrg', 'ihar_petrushenka', 'none', '2017-10-04 01:29:31', 'no', 'yes', 0, ''), (27, 'Hi, Ihar!', 'bart_simpson', 'ihar_petrushenka', '2017-10-11 22:35:21', 'no', 'no', 0, ''), (28, 'Hi, Bart!', 'ihar_petrushenka', 'bart_simpson', '2017-10-11 22:43:38', 'no', 'yes', 0, ''), (29, 'nice', 'ihar_petrushenka', 'bart_simpson', '2017-10-12 00:16:23', 'no', 'yes', 0, ''), (30, 'g', 'ihar_petrushenka', 'bart_simpson', '2017-10-12 00:16:48', 'no', 'yes', 0, ''), (31, 'g', 'ihar_petrushenka', 'bart_simpson', '2017-10-12 00:16:58', 'no', 'yes', 0, ''), (32, '<br><iframe width=''420'' height=''315'' src=''https://www.youtube.com/enmed/-T_OMIeXQbo''></iframe><br>', 'bart_simpson', 'none', '2017-10-14 19:29:00', 'no', 'yes', 0, ''), (33, '<br><iframe width=''420'' height=''315'' src=''https://www.youtube.com/embed/-T_OMIeXQbo''></iframe><br>', 'bart_simpson', 'none', '2017-10-14 19:32:31', 'no', 'no', 0, ''), (34, 'hi guys i am looking forward to superbowl, too!', 'ihar_petrushenka', 'none', '2017-10-15 13:07:23', 'no', 'no', 0, ''), (35, 'dfgjh', 'ihar_petrushenka', 'none', '2017-10-15 16:33:21', 'no', 'yes', 0, 'assets/images/posts59e363a10f6afmy own elephant))).jpg'), (36, 'Me and my beautiful wife!', 'ihar_petrushenka', 'none', '2017-10-15 16:38:45', 'no', 'no', 1, 'assets/images/posts/59e364e513372having fun.jpg'), (37, '<br><iframe width=''640'' height=''480'' src=''https://www.youtube.com/embed/IBDRnax7RaE''></iframe><br>', 'ihar_petrushenka', 'none', '2017-10-15 17:03:19', 'no', 'no', 0, ''), (38, 'Good times...', 'ihar_petrushenka', 'none', '2017-10-15 22:57:27', 'no', 'no', 1, 'assets/images/posts/59e3bda71b345on the beach.jpg'), (39, '', 'bart_simpson', 'none', '2017-10-16 00:05:17', 'no', 'no', 1, 'assets/images/posts/59e3cd8dd0c92good times....jpg'), (40, '<br><iframe width=''640'' height=''480'' src=''https://www.youtube.com/embed/KlZv4MSF5I8''></iframe><br>', 'ihar_petrushenka', 'none', '2017-10-16 00:19:41', 'no', 'no', 2, ''), (41, 'The site looks great! :) ', 'reece_kenney_1', 'none', '2017-10-22 21:50:12', 'no', 'no', 0, ''), (42, '<br><iframe width=''640'' height=''480'' src=''https://www.youtube.com/embed/4KkFKx1bQPY''></iframe><br>', 'ihar_petrushenka', 'none', '2017-11-08 18:58:02', 'no', 'no', 1, ''), (43, '<br><iframe width=''640'' height=''480'' src=''https://www.youtube.com/embed/Q1xJ4m7fPSg''></iframe><br>', 'ihar_petrushenka', 'none', '2017-11-10 22:40:41', 'no', 'yes', 0, ''); -- -------------------------------------------------------- -- -- Структура таблицы `trends` -- CREATE TABLE IF NOT EXISTS `trends` ( `title` varchar(50) NOT NULL, `hits` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Дамп данных таблицы `trends` -- INSERT INTO `trends` (`title`, `hits`) VALUES ('Hello', 1), ('Guys', 2), ('Looking', 2), ('Forward', 2), ('Superbowl', 2), ('Hi', 1), ('Dfgjh', 1), ('Beautiful', 1), ('Wife', 1), ('Times', 1), ('Site', 1), ('Looks', 1); -- -------------------------------------------------------- -- -- Структура таблицы `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(25) NOT NULL, `last_name` varchar(25) NOT NULL, `username` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(255) NOT NULL, `signup_date` date NOT NULL, `profile_pic` varchar(255) NOT NULL, `num_posts` int(11) NOT NULL, `num_likes` int(11) NOT NULL, `user_closed` varchar(3) NOT NULL, `friend_array` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ; -- -- Дамп данных таблицы `users` -- INSERT INTO `users` (`id`, `first_name`, `last_name`, `username`, `email`, `password`, `signup_date`, `profile_pic`, `num_posts`, `num_likes`, `user_closed`, `friend_array`) VALUES (1, 'name', 'yyguhj', 'reece_kenney', 'reece@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', '2017-08-08', 'htgf', 1, 1, 'no', ''), (2, 'Reece', 'Good', 'reece_good', 'Reece22@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b', '0000-00-00', 'profile_pic', 0, 0, 'no', ','), (5, 'Ihar', 'Petrushenka', 'ihar_petrushenka', 'Petrushen@yahoo.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2017-09-10', 'assets/images/profile_pics/ihar_petrushenka5f52b88b98a9c9ebbab5a2da4da82129n.jpeg', 17, 8, 'no', ',mickey_mouse,bart_simpson,'), (6, 'John', 'Smith', 'john_smith', 'Js@js.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2017-09-10', 'assets/images/profile_pics/defaults/head_emerald.png', 22, 5, 'no', ',bart_simpson,'), (7, 'Mickey', 'Mouse', 'mickey_mouse', 'Mickey@gmail.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2017-09-20', 'assets/images/profile_pics/defaults/head_deep_blue.png', 0, 0, 'no', ',ihar_petrushenka,'), (8, 'Bart', 'Simpson', 'bart_simpson', 'Bart@gmail.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2017-09-20', 'assets/images/profile_pics/defaults/head_deep_blue.png', 5, 3, 'no', ',mickey_mouse,john_smith,ihar_petrushenka,'), (9, 'Reece', 'Kenney', 'reece_kenney_1', 'Reece1@gmail.com', '5f4dcc3b5aa765d61d8327deb882cf99', '2017-10-22', 'assets/images/profile_pics/defaults/head_emerald.png', 1, 0, 'no', ','), (10, 'John', 'Lennon', 'john_lennon', 'Beatles4ever@beatles.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2017-10-24', 'assets/images/profile_pics/defaults/head_deep_blue.png', 0, 0, 'no', ','), (11, 'Name', 'Surname', 'name_surname', 'Email@google.com', '67f78137a7c6f9cd55a4c74ebc01b4ff', '2018-05-05', 'assets/images/profile_pics/defaults/head_deep_blue.png', 0, 0, 'no', ','); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 01, 2019 at 11:07 AM -- Server version: 10.1.35-MariaDB -- PHP Version: 7.2.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `larashop` -- -- -------------------------------------------------------- -- -- Table structure for table `books` -- CREATE TABLE `books` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `slug` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `author` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `publisher` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `cover` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `price` double(8,2) NOT NULL, `views` int(10) UNSIGNED NOT NULL DEFAULT '0', `stock` int(10) UNSIGNED NOT NULL DEFAULT '0', `status` enum('PUBLISH','DRAFT') COLLATE utf8_unicode_ci NOT NULL, `created_by` int(11) NOT NULL, `updated_by` int(11) DEFAULT NULL, `deleted_by` int(11) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `books` -- INSERT INTO `books` (`id`, `title`, `slug`, `description`, `author`, `publisher`, `cover`, `price`, `views`, `stock`, `status`, `created_by`, `updated_by`, `deleted_by`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'Laravel', 'laravel', 'Buku Laravel', 'Supriadi', 'supriadi', 'book-covers/CXI35I89Uuw9AanACDkNChu0NANrIezbKFfUzLp9.png', 100000.00, 0, 10, 'PUBLISH', 1, NULL, NULL, '2019-02-26 05:14:48', '2019-02-26 05:14:48', NULL), (2, 'PHP', 'php', 'Buku PHP', 'Roadman', 'roadman', 'book-covers/8xiayae5DkesmZnLtUnipF4GRjymCBgwHwW4QRHD.png', 200000.00, 0, 20, 'PUBLISH', 1, NULL, NULL, '2019-02-26 05:15:29', '2019-02-26 05:15:29', NULL), (3, 'Laskar Pelangi', 'laskar-pelangi', 'Buku Laskar Pelangi', 'Siagian', 'siagian', 'book-covers/rVmPULX71gWJ6gK9awG8IIXSDRzwhEoSRH9R94AG.jpeg', 300000.00, 0, 30, 'PUBLISH', 1, NULL, NULL, '2019-02-26 05:16:50', '2019-02-26 05:16:50', NULL), (4, 'Sijuki', 'sijuki', 'Buku Sijuki', 'Supriadi', 'supriadi', 'book-covers/US48ivfr31sXcsa7Zc9jjig5hAef45Q0kYCbKj9w.jpeg', 50000.00, 0, 40, 'PUBLISH', 1, NULL, NULL, '2019-02-26 05:18:22', '2019-02-26 05:18:22', NULL), (5, 'Kancil', 'kancil', 'Buku Kancil', 'Roadman', 'roadman', 'book-covers/JDwWvabBRz3VEWumGcTHAPojaR23l2hrnnwIO568.jpeg', 100000.00, 0, 20, 'PUBLISH', 1, NULL, NULL, '2019-02-26 05:19:59', '2019-02-26 05:19:59', NULL); -- -------------------------------------------------------- -- -- Table structure for table `book_category` -- CREATE TABLE `book_category` ( `id` int(10) UNSIGNED NOT NULL, `book_id` int(10) UNSIGNED DEFAULT NULL, `category_id` int(10) UNSIGNED DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `book_category` -- INSERT INTO `book_category` (`id`, `book_id`, `category_id`, `created_at`, `updated_at`) VALUES (1, 1, 1, NULL, NULL), (2, 2, 1, NULL, NULL), (3, 3, 2, NULL, NULL), (4, 4, 3, NULL, NULL), (5, 5, 6, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `book_order` -- CREATE TABLE `book_order` ( `id` int(10) UNSIGNED NOT NULL, `order_id` int(10) UNSIGNED NOT NULL, `book_id` int(10) UNSIGNED NOT NULL, `quantity` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `slug` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `image` varchar(191) COLLATE utf8_unicode_ci NOT NULL COMMENT 'berisi nama file image saja tanpa path', `created_by` int(11) NOT NULL, `updated_by` int(11) DEFAULT NULL, `deleted_by` int(11) DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`, `slug`, `image`, `created_by`, `updated_by`, `deleted_by`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'Programming', 'programming', 'category_images/bpBGY7dKjiMHnXBjDSfgrL9w7F8uVi7YRUyY6S20.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:06:07', '2019-02-26 05:06:07'), (2, 'Novel', 'novel', 'category_images/ELpOYuwKoIV7hPxH0Bxqs0bj6V0aM1zcHuaZhHGE.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:07:06', '2019-02-26 05:07:06'), (3, 'Komik', 'komik', 'category_images/ZP449bPRmaqXGt1EspUiSH0gNlBvVm4bOKcqocwq.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:08:17', '2019-02-26 05:08:17'), (4, 'Ensiklopedi', 'ensiklopedi', 'category_images/UwPREdEbgxR4KmHouWqUKIm3qbBz2dYjSqkUuev8.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:09:21', '2019-02-26 05:09:21'), (5, 'Antologi', 'antologi', 'category_images/G4SJL216p6ZVabIVQyH1AH6Aw0VgOwRqFCbLGMpv.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:09:55', '2019-02-26 05:09:55'), (6, 'Dongeng', 'dongeng', 'category_images/POR5ghEMhXJNVYiGPfHZ4N3uV5b8RhhmpGnJ9ORw.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:10:23', '2019-02-26 05:10:23'), (7, 'Biografi', 'biografi', 'category_images/lItbBLSMPHtDKh3wrXFFayC9keCUuuM6IGhdPao7.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:10:45', '2019-02-26 05:10:45'), (8, 'Fotografi', 'fotografi', 'category_images/OuuDQG9og65Tl6rYn4MXR7KeisSxLB5Iikx1cvU6.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:11:17', '2019-02-26 05:11:17'), (9, 'Karya ilmiah', 'karya-ilmiah', 'category_images/vhppsjTjmpClDVRjJ8ecMC4DW4kilESzK8x6xiVA.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:11:39', '2019-02-26 05:11:39'), (10, 'Kamus', 'kamus', 'category_images/2G1xIeFDs0I7Rx9rAWiaPSXkKgxW7dmUaSlL98XD.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:12:28', '2019-02-26 05:12:28'), (11, 'Ilmiah', 'ilmiah', 'category_images/z7co6aGcViyHpNijdk2hdGdaal0x3AWp9hP8WXjo.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:12:56', '2019-02-26 05:12:56'), (12, 'Atlas', 'atlas', 'category_images/sZd94CVHFLGbTXdmWlCjwi9jVptTowxqI4Nzzyvb.jpeg', 1, NULL, NULL, NULL, '2019-02-26 05:13:48', '2019-02-26 05:13:48'), (13, 'baru', 'baru', 'category_images/0QoMk3f38dn0pMLAQjMOuu3v8w2jZHnIF2O3SaSx.jpeg', 1, NULL, NULL, '2019-03-01 03:00:06', '2019-03-01 01:58:19', '2019-03-01 03:00:06'), (14, 'Cobagfgf', 'cobagfgf', 'category_images/mJd5ITDiWl7H9HGBuGkr5LXv8qDjN1kCYQdHeSnS.jpeg', 1, NULL, NULL, '2019-03-01 02:59:57', '2019-03-01 02:08:26', '2019-03-01 02:59:57'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_02_21_085439_penyesuaian_table_users', 1), (4, '2019_02_25_110644_create_categories_table', 1), (5, '2019_02_26_031612_create_books_table', 1), (6, '2019_02_26_032033_create_book_category_table', 1), (7, '2019_02_26_080754_create_orders_table', 1), (8, '2019_02_26_081337_create_book_order_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `total_price` double(8,2) UNSIGNED NOT NULL, `invoice_number` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `status` enum('SUBMIT','PROCESS','FINISH','CANCEL') COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `user_id`, `total_price`, `invoice_number`, `status`, `created_at`, `updated_at`) VALUES (1, 1, 390000.00, '201807060001', 'FINISH', '2018-07-05 17:00:00', '2018-07-05 17:00:00'), (2, 1, 780000.00, '201807250002', 'PROCESS', '2018-07-25 17:00:00', '2018-10-02 01:50:04'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `username` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `roles` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `address` text COLLATE utf8_unicode_ci, `phone` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `avatar` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `status` enum('ACTIVE','INACTIVE') COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `username`, `roles`, `address`, `phone`, `avatar`, `status`) VALUES (1, 'Site Administrator', 'administrator@larashop.test', NULL, '$2y$10$YRfv9ylyrVImed2W4cXQV.QEsumgAM6/hSVD5ccUTF5u5Hghzen3e', 'Cfy4FhFow9u2pYwiJdYNRV05XhcyxsV4HAR9k5OXJYAZMt62x0ei0vH6uwEA', '2019-02-26 04:38:06', '2019-02-26 04:38:06', 'administrator', '[\"ADMIN\"]', NULL, NULL, NULL, 'ACTIVE'); -- -- Indexes for dumped tables -- -- -- Indexes for table `books` -- ALTER TABLE `books` ADD PRIMARY KEY (`id`); -- -- Indexes for table `book_category` -- ALTER TABLE `book_category` ADD PRIMARY KEY (`id`), ADD KEY `book_category_book_id_foreign` (`book_id`), ADD KEY `book_category_category_id_foreign` (`category_id`); -- -- Indexes for table `book_order` -- ALTER TABLE `book_order` ADD PRIMARY KEY (`id`), ADD KEY `book_order_order_id_foreign` (`order_id`), ADD KEY `book_order_book_id_foreign` (`book_id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `categories_slug_unique` (`slug`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`), ADD KEY `orders_user_id_foreign` (`user_id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`), ADD UNIQUE KEY `users_username_unique` (`username`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `books` -- ALTER TABLE `books` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `book_category` -- ALTER TABLE `book_category` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `book_order` -- ALTER TABLE `book_order` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- Constraints for dumped tables -- -- -- Constraints for table `book_category` -- ALTER TABLE `book_category` ADD CONSTRAINT `book_category_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`), ADD CONSTRAINT `book_category_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`); -- -- Constraints for table `book_order` -- ALTER TABLE `book_order` ADD CONSTRAINT `book_order_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`), ADD CONSTRAINT `book_order_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`); -- -- Constraints for table `orders` -- ALTER TABLE `orders` ADD CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select count(*) as 'COUNT ALL ROWS' from food_diary; select count(*) as 'NON-BLANK date_time' from food_diary where date_time <> ''; -- the previous showed that all the date_time columns are empty, so ignore them. select count(*) as 'NON-BLANK date' from food_diary where date <> ''; select count(*) as 'COUNT NON-BLANK ROWS' from food_diary where date<>'' and real_date <> ''; select count(*) as 'COUNT PARTIAL BLANK ROWS' from food_diary where date <> '' and real_date = '' or date = '' and real_date <> ''; select count(*) as 'DISAGREE DATES' from food_diary where date <> '' and real_date <> '' and date <> real_date; -- select min(date),max(date) from food_diary; -- select min(date),max(date) from food_diary where date <> ''; -- select min(real_date),max(real_date) from food_diary; select min(real_date),max(real_date) from food_diary where real_date <> ''; -- select min(date_time),max(date_time) from food_diary; -- select min(date_time),max(date_time) from food_diary where date_time <> ''; -- select date,str_to_date(date,'%c/%e/%Y %k:%i:%s') AS pdate -- from food_diary where date <> ''; -- can the dates be parsed? Seems so! select date as 'UNPARSEABLE NON-EMPTY DATES' from ( select date,str_to_date(date,'%c/%e/%Y %k:%i:%s') AS pdate from food_diary where date <> '') as T where T.pdate is null; select count(*) as 'COUNT GOOD DATES' from ( select date,str_to_date(date,'%c/%e/%Y %k:%i:%s') AS pdate from food_diary where date <> '' and date <> '-- ::00') as T where T.pdate is not null; -- select * from ( -- select real_date,str_to_date(real_date,'%c/%e/%Y %k:i%:%s') AS pdate -- from food_diary where real_date <> '') as T -- where T.pdate is not null; -- =============================================================== -- Are the rounded times unique? select 'Non-unique rounded times'; select pdate,count(*) from ( select rec_num,date,date5f(str_to_date(date,'%c/%e/%Y %k:%i:%s')) as pdate from food_diary where date <> '' and date <> '-- ::00') as T group by pdate having count(*) > 1; -- can we join with the ICS2 table? select 'Records not matching times in ICS2'; select rec_num,date from food_diary where date <> '' and date <> '-- ::00' and date5f(str_to_date(date,'%c/%e/%Y %k:%i:%s')) not in (select rtime from insulin_carb_smoothed_2); -- =============================================================== select distinct(meal) as 'MEAL KINDS' from food_diary; select distinct(exercise) as 'EXERCISE KINDS' from food_diary; select distinct(meal_size) as 'MEAL SIZES' from food_diary; -- ================================================================
Create Procedure sp_get_splCategoryItem (@Special_Cat_Code INT) As Select Product_Code from Special_Cat_Product where Special_Cat_Code=@Special_Cat_Code
-- -- MySQL drop table if exists JFILE; create table JFILE ( UUID varchar(42), REALNAME varchar(255), CREATETIME timestamp, DESCRIPTION varchar(255), STORAGEFOLDER varchar(255), APPLICATIONCODE varchar(60), STORAGETYPE varchar(20), primary key (UUID) ); --------------------------------- --Derby --------------------------- drop table JFILE; create table JFILE ( UUID varchar(42), REALNAME varchar(255), CREATETIME timestamp, DESCRIPTION varchar(255), STORAGEFOLDER varchar(255), APPLICATIONCODE varchar(60), STORAGETYPE varchar(20), primary key (UUID) ); ---------------------------------------- --Oracle --------------------------------------- drop table JFILE; create table JFILE( UUID varchar2(42) not null, REALNAME varchar2(255) not null, CREATETIME timestamp not null, DESCRIPTION varchar2(255), STORAGEFOLDER varchar2(255) not null, APPLICATIONCODE varchar2(60), STORAGETYPE varchar2(20) not null, constraint PK_JFILE primary key(UUID) )
-- ORIGINAL TABLES CREATE TABLE PEOPLE( ID INTEGER PRIMARY KEY, AGE INTEGER, GENDER ENUM('M','F'), CITY VARCHAR(50) ); CREATE TABLE PREFERENCES( ID INTEGER PRIMARY KEY, FOOD_TYPE VARCHAR(50), FOREIGN KEY (ID) REFERENCES PEOPLE(ID) ); CREATE TABLE JOB( ID INTEGER PRIMARY KEY, JOB VARCHAR(50), FOREIGN KEY (ID) REFERENCES PEOPLE(ID) ); CREATE TABLE COMBINED( AGE INTEGER, GENDER ENUM('M','F'), CITY VARCHAR(50), FOOD_TYPE VARCHAR(50), JOB VARCHAR(50), STATE VARCHAR(50), AGE_GROUP VARCHAR(50) ); CREATE TABLE MEN AS SELECT * FROM COMBINED WHERE GENDER='M'; -- CREATING SEPARATE TABLE FOR MEN CREATE TABLE WOMEN AS SELECT * FROM COMBINED WHERE GENDER='F'; -- CREATING SEPARATE TABLE FOR WOMEN -- SEEING THE NUMBER OF MEN AND WOMEN IN THE ENTIRE POPULATION SELECT GENDER,COUNT(*) FROM COMBINED GROUP BY GENDER; -- AGE GROUP WISE ANALYSIS OF ENTIRE POPULATION SELECT AGE_GROUP, COUNT(*) FROM COMBINED GROUP BY AGE_GROUP ORDER BY COUNT(*) DESC; -- AGE GROUP WISE ANALYSIS OF MEN AND WOMEN SELECT AGE_GROUP,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY AGE_GROUP,GENDER ORDER BY AGE_GROUP; -- AGE GROUP WISE ANALYSIS OF MEN AND WOMEN IN EACH STATE SELECT STATE,AGE_GROUP,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY STATE,AGE_GROUP,GENDER ORDER BY STATE,AGE_GROUP; -- AGE GROUP WISE ANALYSIS OF MEN AND WOMEN IN EACH PROFESSION SELECT JOB,AGE_GROUP,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY AGE_GROUP,JOB,GENDER ORDER BY JOB,AGE_GROUP; -- AGE GROUP WISE ANALYSIS OF MEN AND WOMEN LIKING EACH FOOD TYPE SELECT FOOD_TYPE, AGE_GROUP,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY FOOD_TYPE,GENDER,AGE_GROUP ORDER BY FOOD_TYPE,AGE_GROUP; -- NUMBER OF CITY AND STATES SELECT COUNT(DISTINCT(CITY)) AS NUM_CITIES, COUNT(DISTINCT(STATE)) AS NUM_STATES FROM COMBINED; -- POPULATION OF MEN AND WOMEN IN EACH CITY SELECT CITY, GENDER, COUNT(*) AS POPULATION FROM COMBINED GROUP BY CITY,GENDER ORDER BY CITY; -- POPULATION OF MEN AND WOMEN IN EACH STATE SELECT STATE, GENDER, COUNT(*) AS POPULATION FROM COMBINED GROUP BY STATE,GENDER ORDER BY STATE; -- NUMBER OF CITIES IN EACH STATE SELECT STATE, COUNT(DISTINCT(CITY)) AS CITIES FROM COMBINED GROUP BY STATE ORDER BY STATE; -- ANALYSING EACH STATE IN DETAIL -- HARYANA -- PROMINENT CITIES IN HARYANA SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Haryana'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Haryana'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF HARYANA SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Haryana' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN HARYANA SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Haryana' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN HARYANA SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Haryana' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF HARYANA SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Haryana' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN HARYANA SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Haryana' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN HARYANA SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Haryana' GROUP BY JOB ORDER BY COUNT(*) DESC; -- RAJASTHAN -- PROMINENT CITIES IN RAJASTHAN SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Rajasthan'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Rajasthan'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF RAJASTHAN SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Rajasthan' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN RAJASTHAN SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Rajasthan' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN RAJASTHAN SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Rajasthan' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF RAJASTHAN SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Rajasthan' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN RAJASTHAN SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Rajasthan' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN RAJASTHAN SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Rajasthan' GROUP BY JOB ORDER BY COUNT(*) DESC; -- PUNJAB -- PROMINENT CITIES IN PUNJAB SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Punjab'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Punjab'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF PUNJAB SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Punjab' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN PUNJAB SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Punjab' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN PUNJAB SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Punjab' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF PUNJAB SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Punjab' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN PUNJAB SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Punjab' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN PUNJAB SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Punjab' GROUP BY JOB ORDER BY COUNT(*) DESC; -- HIMACHAL PRADESH -- PROMINENT CITIES IN HIMACHAL PRADESH SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Himachal Pradesh'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Himachal Pradesh'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF HIMACHAL PRADESH SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Himachal Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN HIMACHAL PRADESH SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Himachal Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN HIMACHAL PRADESH SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Himachal Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF HIMACHAL PRADESH SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Himachal Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN HIMACHAL PRADESH SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Himachal Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN HIMACHAL PRADESH SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Himachal Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JAMMU -- PROMINENT CITIES IN JAMMU SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Jammu'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Jammu'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF JAMMU SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Jammu' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN JAMMU SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Jammu' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN JAMMU SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Jammu' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF JAMMU SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Jammu' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN JAMMU SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Jammu' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN JAMMU SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Jammu' GROUP BY JOB ORDER BY COUNT(*) DESC; -- UTTARAKHAND -- PROMINENT CITIES IN UTTARAKHAND SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Uttarakhand'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Uttarakhand'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF UTTARAKHAND SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Uttarakhand' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN UTTARAKHAND SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Uttarakhand' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN UTTARAKHAND SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Uttarakhand' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF UTTARAKHAND SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Uttarakhand' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN UTTARAKHAND SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Uttarakhand' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN UTTARAKHAND SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Uttarakhand' GROUP BY JOB ORDER BY COUNT(*) DESC; -- UTTAR PRADESH -- PROMINENT CITIES IN UTTAR PRADESH SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Uttar Pradesh'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Uttar Pradesh'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF UTTAR PRADESH SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Uttar Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN UTTAR PRADESH SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Uttar Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN UTTAR PRADESH SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Uttar Pradesh' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF UTTAR PRADESH SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Uttar Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN UTTAR PRADESH SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Uttar Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN UTTAR PRADESH SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Uttar Pradesh' GROUP BY JOB ORDER BY COUNT(*) DESC; -- BIHAR -- PROMINENT CITIES IN BIHAR SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Bihar'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Bihar'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF BIHAR SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Bihar' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN BIHAR SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Bihar' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN BIHAR SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Bihar' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF BIHAR SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Bihar' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN BIHAR SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Bihar' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN BIHAR SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Bihar' GROUP BY JOB ORDER BY COUNT(*) DESC; -- UNION TERRITORY -- PROMINENT CITIES IN UNION TERRITORY SELECT DISTINCT(CITY) FROM COMBINED WHERE STATE='Union Territory'; SELECT COUNT(DISTINCT(CITY)) FROM COMBINED WHERE STATE='Union Territory'; -- FOOD TYPE PREFERRED BY THE GENERAL POPULATION OF UNION TERRITORY SELECT FOOD_TYPE, COUNT(*) FROM COMBINED WHERE STATE='Union Territory' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY MEN IN UNION TERRITORY SELECT FOOD_TYPE, COUNT(*) FROM MEN WHERE STATE='Union Territory' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- FOOD TYPE PREFERRED BY WOMEN IN UNION TERRITORY SELECT FOOD_TYPE, COUNT(*) FROM WOMEN WHERE STATE='Union Territory' GROUP BY FOOD_TYPE ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY THE GENERAL POPULTAION OF UNION TERRITORY SELECT JOB, COUNT(*) FROM COMBINED WHERE STATE='Union Territory' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN IN UNION TERRITORY SELECT JOB, COUNT(*) FROM MEN WHERE STATE='Union Territory' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY WOMEN IN UNION TERRITORY SELECT JOB, COUNT(*) FROM WOMEN WHERE STATE='Union Territory' GROUP BY JOB ORDER BY COUNT(*) DESC; -- JOBS PURSUED BY MEN AND WOMEN SELECT JOB,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY GENDER,JOB ORDER BY JOB; -- FOOD TYPES LIKED BY MEN AND WOMEN OF EACH PROFESSION SELECT JOB, FOOD_TYPE,GENDER,COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY GENDER,FOOD_TYPE,JOB ORDER BY FOOD_TYPE,JOB; -- JOBS PURSUED BY MEN AND WOMEN OF EACH AGE GROUP SELECT AGE_GROUP, JOB, GENDER, COUNT(*) AS NUM_PPL FROM COMBINED GROUP BY AGE_GROUP, JOB, GENDER ORDER BY AGE_GROUP, JOB;
-- This script generates a new database, called CSE412. It then makes -- tables. drop database if exists CSE412; create database CSE412; use CSE412; CREATE TABLE band ( band_name VARCHAR (50), band_start_date DATE, band_end_date DATE CHECK (band_end_date > band_start_date), band_billboard_rating INT, PRIMARY KEY (band_name, band_start_date) ); CREATE TABLE person ( band_name VARCHAR (50), band_start_date DATE, person_name VARCHAR (50) CHECK (person_name NOT LIKE '%[0-9]%'), person_birthdate DATE, INDEX (person_name, person_birthdate), PRIMARY KEY (band_name, band_start_date, person_name, person_birthdate), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE band_member ( band_name VARCHAR (50), band_start_date DATE, person_name VARCHAR (50) CHECK (person_name NOT LIKE '%[0-9]%'), person_birthdate DATE, member_start_date DATE, member_end_date DATE, INDEX (person_name, person_birthdate), PRIMARY KEY (band_name, band_start_date, person_name, person_birthdate, member_start_date), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (person_name, person_birthdate) REFERENCES person (person_name, person_birthdate) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE staff ( band_name VARCHAR (50), band_start_date DATE, person_name VARCHAR (50) CHECK (person_name NOT LIKE '%[0-9]%'), person_birthdate DATE, staff_role VARCHAR (50), from_date DATE, to_date DATE, INDEX (person_name, person_birthdate), PRIMARY KEY (band_name, band_start_date, person_name, person_birthdate, from_date, to_date), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (person_name, person_birthdate) REFERENCES person (person_name, person_birthdate) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE instrument ( instrument_name VARCHAR (50) NOT NULL, PRIMARY KEY (instrument_name) ); CREATE TABLE plays ( band_name VARCHAR (50), band_start_date DATE, person_name VARCHAR (50) CHECK (person_name NOT LIKE '%[0-9]%'), person_birthdate DATE, instrument_name VARCHAR (50), INDEX (person_name, person_birthdate), INDEX (instrument_name), PRIMARY KEY (band_name, band_start_date, person_name, person_birthdate, instrument_name), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (person_name, person_birthdate) REFERENCES person (person_name, person_birthdate) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (instrument_name) REFERENCES instrument (instrument_name) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE tour ( band_name VARCHAR (50), band_start_date DATE, tour_name VARCHAR (50), tour_start_date DATE, tour_end_date DATE CHECK (tour_end_date > tour_start_date), band_is_headliner BIT, PRIMARY KEY (band_name, band_start_date, tour_name, tour_start_date), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE concert ( band_name VARCHAR (50), band_start_date DATE, tour_name VARCHAR (50), tour_start_date DATE, concert_time DATETIME, concert_day DATE CHECK (concert_day >= tour_start_date), concert_city VARCHAR (50), concert_venue VARCHAR (50), PRIMARY KEY (band_name, band_start_date, tour_name, tour_start_date, concert_day, concert_time), FOREIGN KEY (band_name, band_start_date, tour_name, tour_start_date) REFERENCES tour (band_name, band_start_date, tour_name, tour_start_date) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE album ( band_name VARCHAR (50), band_start_date DATE, album_name VARCHAR (50), album_record_label VARCHAR (50), album_type INT, album_release_year INT CHECK (album_release_year <= YEAR(band_start_date)), PRIMARY KEY (band_name, band_start_date, album_name, album_release_year), FOREIGN KEY (band_name, band_start_date) REFERENCES band (band_name, band_start_date) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE song ( band_name VARCHAR (50), band_start_date DATE, album_name VARCHAR (50), album_release_year INT CHECK (album_release_year <= YEAR(band_start_date)), song_name VARCHAR (50), song_number INT, song_billboard_rating INT, PRIMARY KEY (band_name, band_start_date, album_name, album_release_year, song_number), FOREIGN KEY (band_name, band_start_date, album_name, album_release_year) REFERENCES album (band_name, band_start_date, album_name, album_release_year) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE featured_artist ( band_name VARCHAR (50), band_start_date DATE, album_name VARCHAR (50), album_release_year INT, song_number INT, feat_artist_name VARCHAR (50) CHECK (person_name NOT LIKE '%[0-9]%'), feat_artist_role VARCHAR (50), PRIMARY KEY (band_name, band_start_date, album_name, album_release_year, song_number, feat_artist_name), FOREIGN KEY (band_name, band_start_date, album_name, album_release_year, song_number) REFERENCES song (band_name, band_start_date, album_name, album_release_year, song_number) ON DELETE CASCADE ON UPDATE CASCADE ); delimiter $ CREATE TRIGGER album_type_check AFTER INSERT ON song FOR EACH ROW BEGIN DECLARE song_count INTEGER; SET song_count = (SELECT COUNT(*) FROM song WHERE album_name = new.album_name); IF song_count < 2 THEN UPDATE album a SET a.album_type = 0 WHERE a.album_name = new.album_name AND a.band_name = new.band_name; ELSEIF song_count < 6 THEN UPDATE album a SET a.album_type = 1 WHERE a.album_name = new.album_name AND a.band_name = new.band_name; ELSE UPDATE album a SET a.album_type = 2 WHERE a.album_name = new.album_name AND a.band_name = new.band_name; END IF; END; $ delimiter $$ CREATE TRIGGER featured_artist_check AFTER INSERT ON featured_artist FOR EACH ROW BEGIN IF NEW.feat_artist_name IN ( SELECT bm.person_name FROM band_member bm WHERE bm.band_name = NEW.band_name AND YEAR(bm.member_start_date) < NEW.album_release_year AND YEAR(bm.member_end_date) > NEW.album_release_year) THEN SET msg = "Error: Featured Artist cannot be in the releasing band"; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg; END IF; END; $$
INSERT INTO Persona VALUES ('Emmanuel','Barrantes','Chaves','Familiar', '88255578','1','emanu.87@gmail.com','13'); INSERT INTO Persona VALUES ('Kevin','Mendez','Arce','Estudiante', '22222222','0','Kevin@gmail.com','8'); INSERT INTO Persona VALUES ('Jose','Alvarado','Chaves','Colega', '87014233','1','Jose@gmail.com','5'); SELECT NLibros FROM Persona WHERE Relacion_Ocupacion='Estudiante'; SELECT NLibros FROM Persona WHERE Relacion_Ocupacion='Colega'; SELECT NLibros FROM Persona WHERE Relacion_Ocupacion='Familiar'; DELETE FROM Persona WHERE PNombre='Emmanuel'; DELETE FROM Persona WHERE PNombre='Jose'; DELETE FROM Persona WHERE PNombre='Kevin';
USE TelerikAcademy SELECT * FROM Departments
INSERT INTO core_katastima(myid,mykatastimanum,mykatastima) VALUES (1,'1000',:mykatastima);
CREATE TABLE ENDRET_UTBETALING_ANDEL ( ID BIGINT PRIMARY KEY, FK_BEHANDLING_ID BIGINT REFERENCES BEHANDLING (ID) NOT NULL, FK_PO_PERSON_ID BIGINT REFERENCES PO_PERSON (ID) NOT NULL, FOM TIMESTAMP(3) NOT NULL, TOM TIMESTAMP(3) NOT NULL, PROSENT NUMERIC NOT NULL, AARSAK VARCHAR NOT NULL, BEGRUNNELSE TEXT NOT NULL, VERSJON BIGINT DEFAULT 0 NOT NULL, OPPRETTET_AV VARCHAR DEFAULT 'VL' NOT NULL, OPPRETTET_TID TIMESTAMP(3) DEFAULT localtimestamp NOT NULL, ENDRET_AV VARCHAR, ENDRET_TID TIMESTAMP(3) ); CREATE SEQUENCE ENDRET_UTBETALING_ANDEL_SEQ INCREMENT BY 50 START WITH 1000000 NO CYCLE; CREATE INDEX ON ENDRET_UTBETALING_ANDEL (FK_BEHANDLING_ID);
-- Table: security.logins -- DROP TABLE security.logins; CREATE TABLE security.logins ( id SERIAL NOT NULL, username TEXT, password TEXT, facebook_id TEXT, is_disabled BOOLEAN DEFAULT FALSE, CONSTRAINT logins_pkey PRIMARY KEY (id), CONSTRAINT logins_username_unique UNIQUE (username) ) WITH (OIDS =FALSE);
CREATE TABLE `demo_client` ( `client_id` int(11) NOT NULL auto_increment, `client_name` varchar(255) default NULL, `client_password` varchar(255) default NULL, PRIMARY KEY (`client_id`) ) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8; CREATE TABLE `demo_server` ( `server_id` int(11) NOT NULL auto_increment, `server_name` varchar(255) default NULL, `server_password` varchar(255) default NULL, PRIMARY KEY (`server_id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
drop table uw_umdtalks_lists; drop table uw_umdtalks_talks; drop table uw_umdtalks_users;
drop table contact; --1.DDL create table contact( pidx number(6) constraint contact_pidx_pk primary key, name varchar2(10) not null, phonenumber number(12) not null, address varchar2(20) default '입력없음' not null, email varchar2(10) default '입력없음' not null, type varchar2(5) constraint contact_type_check check(type in('univ','com','cafe')), major varchar2(10), grade number(1), comname varchar2(15), comdept varchar2(10), comjob varchar2(10), cafename varchar2(10), cafenick varchar2(10) ); 2. DEPT 테이블에 데이터를 삽입하는 SQL을 작성하시오. 입력 데이터는 임의로 작성하시오. insert into dept (deptno,dname,loc) values (50,'program','JEJU'); 3. DEPT 테이블에 위에서 삽입한 데이터의 dname, loc 데이터를 변경하는 SQL을 작성하시오. 입력 데이터는 임의로 작성하시오. update dept set dname='design', loc='SEOUL' where dname='program' and loc='JEJU'; 4. DEPT 테이블에 위에서 삽입한 데이터를 deptno 컬럼의 값을 기반으로 삭제하는 SQL을 작성하시오. delete from dept where deptno=50; 5. 사용자가 보유한 테이블 목록을 확인하는 SQL문을 작성하시오. select * from tab; 6. EMP 테이블의 구조를 확인하는 SQL을 작성하시오. desc emp; 7. 사용자가 정의한 제약조건들을 확인하는 SQL문을 작성하시오. select * from user_constraints ; #2 아래 요구사항에 맞도록 고급 SQL 문을 작성하시오. 1. EMP 테이블의 ename 컬럼에 인덱스를 생성하는 SQL을 작성하시오. 인덱스의 이름은 emp_index create index emp_index on emp(ename); 2. EMP 테이블과 DEPT 테이블을 조인하는 SQL을 기반으로 view 객체를 생성하는 SQL을 작성하시오. view 의 이름은 emp_view 로 하시오. create view emp_view as select e.empno,e.ename,e.job,e.hiredate,e.mgr,e.sal,e.comm,e.deptno,d.dname,d.loc from emp e, dept d where e.deptno=d.deptno; 3. EMP 테이블에서 모든 사원의 부서번호를 이름이 'SCOTT'인 사원의 부서번호로 변경하는 SQL을 작성하시오. update emp set deptno=(select deptno from emp where ename='SCOTT'); select * from user_objects where object_type='VIEW';
-- dbms_log.sql -- Jared Still -- 2018 jkstill@gmail.com -- -- the alert_log fucntions from sys.dbms_system.ksdwrt are now available in dbms_log, available since 11.2.0.4 -- as reported by Jonathan Lewis -- https://jonathanlewis.wordpress.com/2018/10/12/dbms_log -- thanks to Cary Millsap -- /* Write messages to the alert log and/or current trace file DBMS_LOG PROCEDURE KSDDDT - write date PROCEDURE KSDFLS - flush writes PROCEDURE KSDIND - indent output Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- LVL BINARY_INTEGER IN PROCEDURE KSDWRT - write to output Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- DEST BINARY_INTEGER IN TST VARCHAR2 IN The value for DEST controls which files are writtent to 1: write to trace file only 2: write to alert log only 3: write to both The first call must be to KSDWRT, which will open the file */ -- create an easily identifiable trace file alter session set tracefile_identifier = 'DBMS-LOG'; alter session set sql_trace=true; -- could also use one of the following -- dbms_monitor.session_trace_enable -- alter session set events '10046 trace name context forever, level 12'; -- dbms_system.set_ev -- initialize both files exec sys.dbms_log.ksdwrt(3,'Initialize log and trace file write') -- write the date - goes to all open files exec sys.dbms_log.ksdddt -- write a line to trace file only exec sys.dbms_log.ksdwrt(1,'Trace file only') -- write a line to alert log only exec sys.dbms_log.ksdwrt(2,'Alert log only') -- write a line to the trace file and the alert log exec sys.dbms_log.ksdwrt(3,'Write to both the alert log and the trace file'); -- flush the writes exec sys.dbms_log.ksdfls -- close the trace file alter session set events '10046 trace name context off';
DROP TABLE ALARMTYPE ; DROP TABLE ACTIVEALARM ; DROP TABLE HISTORYALARM ; DROP TABLE ALARMASSIGNMENT; DROP sequence ALARMASSIGNMENT_id_SEQ ; DROP sequence USERHISTORYDATA_IDX_SEQ ; DROP sequence SESSIONDATA_IDX_SEQ ; DROP TABLE ISMUSER ; DROP TABLE SEVERITYCOLORS ; DROP TABLE GROUPDATA ; DROP TABLE SESSIONDATA ; DROP TABLE USERHISTORYDATA ; DROP TABLE pmdata ; DROP TABLE pmmeasure ; DROP TABLE thresholdsetting ; DROP sequence pmdatanum ; DROP sequence measurenum ; DROP TABLE nodeconfig ; DROP TABLE thresholdsetting ; DROP TABLE threshold ; DROP sequence threshold_idx_seq ;
insert into user(username, password) values ('admin','password'), ('user', '123456'), ('editor', '123456'); insert into role(name) values ('ADMIN'),('USER'),('EDITOR'); insert into user_role(user_id,role_id) values (1, 1), (1, 2), (1,3), (2, 2), (3,2), (3,3); insert into book(id,name) values (1,'Атлант затарил гречи'), (2,'Трое в лодке, нищета и собаки'), (3,'Над пропастью моржи'), (4,'Трое на четырех колесах'), (5,'Происхождение химических элементов'); insert into author(id,name) values (1,'Айн Рэнд'), (2,'Джером Клапка Джером'), (3,'Джером Сэлинджер'), (4,'Ральф Альфер'), (5,'Джордж Гамов'), (6,'Ганс Бэт'); insert into category(id,name) values (1,'Роман'), (2,'Юмор'), (3,'Повесть'), (4,'Физика'), (5,'Искаженное название'); insert into book_author(book_id,author_id) values (1, 1), (2, 2), (3, 3), (4, 2), (5, 4), (5, 5), (5, 6); insert into book_category(book_id,category_id) values (1, 1), (2, 2), (3, 3), (4, 2), (5, 4), (1, 5), (2, 5), (3,5); insert into comment(id,text,book_id) values (1,'Комментарий 1',1), (2,'Комментарий 2',1), (3,'Комментарий 3',2), (4,'Комментарий 4',2), (5,'Комментарий 5',2), (6,'Комментарий 6',3), (7,'Комментарий 7',4), (8,'Комментарий 8',5), (9,'Комментарий 9',5); INSERT INTO acl_sid (id, principal, sid) VALUES (1, 0, 'ROLE_ADMIN'), (2, 0, 'ROLE_EDITOR'), (3, 0, 'ROLE_USER'), (4, 1, 'admin'), (5, 1, 'editor'), (6, 1, 'user'); INSERT INTO acl_class (id, class) VALUES (1, 'ru.otus.homework13.model.Book'); INSERT INTO acl_object_identity (id, object_id_class, object_id_identity, parent_object, owner_sid, entries_inheriting) VALUES (1, 1, 1, NULL, 1, 0), (2, 1, 2, NULL, 1, 0), (3, 1, 3, NULL, 1, 0), (4, 1, 4, NULL, 1, 0), (5, 1, 5, NULL, 1, 0); INSERT INTO acl_entry (id, acl_object_identity, ace_order, sid, mask, granting, audit_success, audit_failure) VALUES (1, 1, 1, 1, 1, 1, 1, 1), (2, 2, 1, 1, 1, 1, 1, 1), (3, 3, 1, 1, 1, 1, 1, 1), (4, 4, 1, 1, 1, 1, 1, 1), (5, 5, 1, 1, 1, 1, 1, 1), (6, 1, 2, 2, 1, 1, 1, 1), (8, 3, 2, 2, 1, 1, 1, 1), -- (9, 4, 2, 2, 1, 1, 1, 1), -- для editor доступ на чтение от ROLE_USER -- (10, 5, 2, 2, 1, 1, 1, 1), (11, 1, 3, 3, 1, 1, 1, 1), (12, 4, 3, 3, 1, 1, 1, 1), (13, 5, 3, 3, 1, 1, 1, 1), (14, 1, 4, 1, 2, 1, 1, 1), (15, 2, 4, 1, 2, 1, 1, 1), (16, 4, 4, 1, 2, 1, 1, 1), (17, 1, 5, 2, 2, 1, 1, 1), (18, 4, 5, 2, 2, 1, 1, 1) ;
-- sqlplus_return_code_2.sql -- test if a+b = c -- exit if test fails create or replace function errchk ( test_number_in varchar2 ) return integer is v_number integer; begin v_number := to_number(test_number_in); return 1; exception when invalid_number or value_error then raise_application_error(-20100,'Your Error Message Here' ); end; / define a=1 define b=2 define c=3 -- it is important to exit to the shell with an -- error code so that the controlling process -- knows an error occurred whenever sqlerror exit 1 select decode( sign( (&a+&b) - &c) , 0,errchk(0), errchk('failed') ) from dual / define c=2 select decode( sign( (&a+&b) - &c) , 0,errchk(0), errchk('failed') ) from dual /
UPDATE npc_template SET gfxID=9066,sex=0 WHERE id=30061;
CREATE OR REPLACE PUBLIC SYNONYM eng_cpm_endorsments_pkg FOR orient.eng_cpm_endorsments_pkg;
insert into diplom_work.role ( name) VALUES ('ADMIN'); INSERT INTO diplom_work.role (name) VALUES ('LECTOR'); INSERT INTO diplom_work.role ( name) VALUES ('STUDENT');
CREATE DATABASE IF NOT EXISTS `osstest` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `osstest`; -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) -- -- Host: localhost Database: osstest -- ------------------------------------------------------ -- Server version 5.7.20-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `activity_log` -- DROP TABLE IF EXISTS `activity_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `activity_log` ( `log_id` int (11) NOT NULL AUTO_INCREMENT, `user_id` int (11) DEFAULT NULL, `log_action` varchar (255) DEFAULT NULL, `log_module` varchar (100) DEFAULT NULL, `log_info` text, `log_date` timestamp NULL DEFAULT NULL, PRIMARY KEY (`log_id`) ) ENGINE=InnoDB AUTO_INCREMENT=177 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `departement`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `departement` ( `departement_id` int (11) NOT NULL, `departement_name` varchar (50) NOT NULL, PRIMARY KEY (`departement_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `division` -- DROP TABLE IF EXISTS `division`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `division` ( `division_id` int (11) NOT NULL AUTO_INCREMENT, `division_code` varchar (10) NOT NULL, `division_name` varchar (45) DEFAULT NULL, PRIMARY KEY (`division_id`,`division_code`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `jabatan` -- DROP TABLE IF EXISTS `jabatan`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `jabatan` ( `jabatan_id` int (11) NOT NULL AUTO_INCREMENT, `jabatan_code` varchar (10) NOT NULL, `jabatan_name` varchar (150) DEFAULT NULL, PRIMARY KEY (`jabatan_id`,`jabatan_code`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `kawin` -- DROP TABLE IF EXISTS `kawin`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `kawin` ( `kawin_id` int (11) NOT NULL AUTO_INCREMENT, `kawin_code` varchar (10) NOT NULL, `kawin_name` varchar (100) DEFAULT NULL, PRIMARY KEY (`kawin_id`,`kawin_code`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `kelamin` -- DROP TABLE IF EXISTS `kelamin`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `kelamin` ( `kelamin_id` int (11) NOT NULL AUTO_INCREMENT, `kelamin_code` varchar (45) NOT NULL, `kelamin_name` varchar (45) DEFAULT NULL, PRIMARY KEY (`kelamin_id`,`kelamin_code`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `pendidikan` -- DROP TABLE IF EXISTS `pendidikan`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pendidikan` ( `pendidikan_id` int (11) NOT NULL AUTO_INCREMENT, `pendidikan_code` varchar (10) NOT NULL, `pendidikan_name` varchar (100) NOT NULL, PRIMARY KEY (`pendidikan_id`,`pendidikan_code`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `religion` -- DROP TABLE IF EXISTS `religion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `religion` ( `religion_id` int (11) NOT NULL AUTO_INCREMENT, `religion_code` varchar (10) NOT NULL, `religion_name` varchar (100) DEFAULT NULL, PRIMARY KEY (`religion_id`,`religion_code`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `status` -- DROP TABLE IF EXISTS `status`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `status` ( `status_id` int (11) NOT NULL AUTO_INCREMENT, `status_code` varchar (10) NOT NULL, `status_name` varchar (150) DEFAULT NULL, PRIMARY KEY (`status_id`,`status_code`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `employe` -- DROP TABLE IF EXISTS `employe`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `employe` ( `employe_id` int(11) NOT NULL AUTO_INCREMENT, `employe_nrp` int(11) NOT NULL, `employe_name` varchar(255) DEFAULT NULL, `employe_born_date` timestamp NULL DEFAULT NULL, `employe_born_place` varchar(100) DEFAULT NULL, `employe_citizen` varchar(100) DEFAULT NULL, `employe_address` text, `employe_address2` text, `employe_city` varchar(100) DEFAULT NULL, `employe_golongan` varchar(100) DEFAULT NULL, `employe_ns` varchar(100) DEFAULT NULL, `employe_superior` int(11) DEFAULT '0', `employe_postal_code` varchar(10) DEFAULT NULL, `employe_email` varchar(255) DEFAULT NULL, `employe_phone` varchar(100) DEFAULT NULL, `employe_start_work_date` timestamp NULL DEFAULT NULL, `employe_permanent_date` timestamp NULL DEFAULT NULL, `employe_update` timestamp NULL DEFAULT NULL, `kelamin_kelamin_id` int(11) DEFAULT NULL, `religion_religion_id` int(11) DEFAULT NULL, `division_division_id` int(11) DEFAULT NULL, `departement_departement_id` int(11) DEFAULT NULL, `jabatan_jabatan_id` int(11) DEFAULT NULL, `pendidikan_pendidikan_id` int(11) DEFAULT NULL, `status_status_id` int(11) DEFAULT NULL, `kawin_kawin_id` int(11) DEFAULT NULL, `employe_images` varchar(255) DEFAULT NULL, PRIMARY KEY (`employe_id`,`employe_nrp`), KEY `fk_employe_kelamin1_idx` (`kelamin_kelamin_id`), KEY `fk_employe_religion1_idx` (`religion_religion_id`), KEY `fk_employe_division1_idx` (`division_division_id`), KEY `fk_employe_departement1_idx` (`departement_departement_id`), KEY `fk_employe_jabatan1_idx` (`jabatan_jabatan_id`), KEY `fk_employe_pendidikan1_idx` (`pendidikan_pendidikan_id`), KEY `fk_employe_status1_idx` (`status_status_id`), KEY `fk_employe_kawin1_idx` (`kawin_kawin_id`), CONSTRAINT `fk_employe_departement1` FOREIGN KEY (`departement_departement_id`) REFERENCES `departement` (`departement_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_division1` FOREIGN KEY (`division_division_id`) REFERENCES `division` (`division_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_jabatan1` FOREIGN KEY (`jabatan_jabatan_id`) REFERENCES `jabatan` (`jabatan_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_kawin1` FOREIGN KEY (`kawin_kawin_id`) REFERENCES `kawin` (`kawin_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_kelamin1` FOREIGN KEY (`kelamin_kelamin_id`) REFERENCES `kelamin` (`kelamin_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_pendidikan1` FOREIGN KEY (`pendidikan_pendidikan_id`) REFERENCES `pendidikan` (`pendidikan_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_religion1` FOREIGN KEY (`religion_religion_id`) REFERENCES `religion` (`religion_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_status1` FOREIGN KEY (`status_status_id`) REFERENCES `status` (`status_id`) ON DELETE SET NULL ON UPDATE SET NULL ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `employe_images` -- DROP TABLE IF EXISTS `employe_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `employe_images` ( `employe_images_id` int(11) NOT NULL AUTO_INCREMENT, `employe_employe_id` int(11) DEFAULT NULL, `employe_images_path` varchar(255) DEFAULT NULL, PRIMARY KEY (`employe_images_id`), KEY `fk_employe_images_employe1_idx` (`employe_employe_id`), CONSTRAINT `fk_employe_images_employe1` FOREIGN KEY (`employe_employe_id`) REFERENCES `employe` (`employe_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `user_id` int (11) NOT NULL AUTO_INCREMENT, `user_name` varchar (100) DEFAULT NULL, `user_password` varchar (255) DEFAULT NULL, `user_email` varchar (100) DEFAULT NULL, `user_created_date` timestamp NULL DEFAULT NULL, `user_last_update` timestamp NULL DEFAULT NULL, `user_deleted` tinyint (1) DEFAULT NULL, `employe_id` int (11) DEFAULT NULL, PRIMARY KEY (`user_id`) USING BTREE, KEY `FK_employe_id_idx` (`employe_id`), CONSTRAINT `FK_employe_id` FOREIGN KEY (`employe_id`) REFERENCES `employe` (`employe_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `user_role` -- DROP TABLE IF EXISTS `user_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_role` ( `user_id` int (11) NOT NULL AUTO_INCREMENT, `role_itservice` tinyint (1) DEFAULT NULL, `role_master` tinyint (1) DEFAULT NULL, `role_log` tinyint (1) DEFAULT NULL, PRIMARY KEY (`user_id`) USING BTREE, CONSTRAINT `FK_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `Itservice_category` -- DROP TABLE IF EXISTS `Itservice_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Itservice_category` ( `Itservice_category_id` int (11) NOT NULL AUTO_INCREMENT, `Itservice_category_name` varchar (200) DEFAULT NULL, PRIMARY KEY (`Itservice_category_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `itservice` -- DROP TABLE IF EXISTS `itservice`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itservice` ( `itservice_id` int (11) NOT NULL AUTO_INCREMENT, `itservice_date_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `itservice_date_end ` timestamp NULL DEFAULT NULL, `itservice_status` varchar (50) NOT NULL, `itservice_issue` text NOT NULL, `itservice_solution` text, `itservice_image` varchar (255) DEFAULT NULL, `itservice_categories_id` int (11) DEFAULT NULL, `employe_employe_id` int (11) DEFAULT NULL, PRIMARY KEY (`itservice_id`), KEY `fk_itservice_employe1_idx` (`employe_employe_id`), KEY `fk_itservice_category1_idx` (`itservice_categories_id`), CONSTRAINT `fk_itservice_category1` FOREIGN KEY (`itservice_categories_id`) REFERENCES `Itservice_category` (`Itservice_category_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_itservice_employe1` FOREIGN KEY (`employe_employe_id`) REFERENCES `employe` (`employe_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `itservice_image` -- DROP TABLE IF EXISTS `itservice_image`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itservice_image` ( `itservice_image_id` int (11) NOT NULL AUTO_INCREMENT, `itservice_itservice_id` int (11) DEFAULT NULL, `itservice_image_path` varchar (255) DEFAULT NULL, PRIMARY KEY (`itservice_image_id`), KEY `fk_itservice_image_itservice1_idx` (`itservice_itservice_id`), CONSTRAINT `fk_itservice_image_itservice1` FOREIGN KEY (`itservice_itservice_id`) REFERENCES `itservice` (`itservice_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `iventoryit_offifeapp`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `iventoryit_offifeapp` ( `iventoryit_offifeapp_id` int (11) NOT NULL AUTO_INCREMENT, `iventoryit_offifeapp_name` varchar (255) DEFAULT NULL, PRIMARY KEY (`iventoryit_offifeapp_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `iventoryit_os`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `iventoryit_os` ( `iventoryit_os_id` int (11) NOT NULL AUTO_INCREMENT, `iventoryit_os_name` varchar (255) DEFAULT NULL, PRIMARY KEY (`iventoryit_os_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `iventoryit_status`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `iventoryit_status` ( `iventoryit_status_id` int (11) NOT NULL AUTO_INCREMENT, `iventoryit_status_name` varchar (255) DEFAULT NULL, PRIMARY KEY (`iventoryit_status_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `iventoryit_type`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `iventoryit_type` ( `iventoryit_type_id` int (11) NOT NULL AUTO_INCREMENT, `iventoryit_type_name` varchar (255) DEFAULT NULL, PRIMARY KEY (`iventoryit_type_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `iventoryit`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `iventoryit` ( `iventoryit_id` int (11) NOT NULL AUTO_INCREMENT, `iventoryit_hostname` varchar (100) DEFAULT NULL, `iventoryit_IP` varchar (100) DEFAULT NULL, `iventoryit_types_id` int (11) DEFAULT NULL, `employe_employes_id` int (11) DEFAULT NULL, `iventoryit_statuss_id` int (11) DEFAULT NULL, `iventoryit_oss_id` int (11) DEFAULT NULL, `iventoryit_offifeapps_id` int (11) DEFAULT NULL, `iventoryit_ket` text, `iventoryit_last_update` timestamp NULL DEFAULT NULL, PRIMARY KEY (`iventoryit_id`), KEY `fk_iventoryit_type1_idx` (`iventoryit_types_id`), KEY `fk_employe_employe1_idx` (`employe_employes_id`), KEY `fk_eiventoryit_status1_idx` (`iventoryit_statuss_id`), KEY `fk_iventoryit_os1_idx` (`iventoryit_oss_id`), KEY `fk_iventoryit_offifeapp1_idx` (`iventoryit_offifeapps_id`), CONSTRAINT `fk_iventoryit_type1` FOREIGN KEY (`iventoryit_types_id`) REFERENCES `iventoryit_type` (`iventoryit_type_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_employe_employe1` FOREIGN KEY (`employe_employes_id`) REFERENCES `employe` (`employe_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_iventoryit_os1` FOREIGN KEY (`iventoryit_oss_id`) REFERENCES `iventoryit_os` (`iventoryit_os_id`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `fk_iventoryit_offifeapp1` FOREIGN KEY (`iventoryit_offifeapps_id`) REFERENCES `iventoryit_offifeapp` (`iventoryit_offifeapp_id`) ON DELETE SET NULL ON UPDATE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
SELECT FirstName + ' ' + LastName as [Full name] FROM Employees WHERE ManagerID IS NULL
\W USE codeup_test_db; select * from albums; select concat_ws(', ', artist, name) as 'Albums released before 1990:' from albums where release_date < 1980; select name as 'Michael Jackson albums:' from albums where artist = 'Michael Jackson'; update albums set sales = sales * 10; select * from albums; update albums set release_date = release_date - 100 where release_date < 1980; select * from albums; update albums set artist = 'Peter Jackson' where artist = 'Michael Jackson'; select * from albums;
CREATE PROCEDURE P_NOME_VINHOS AS SELECT v.nome as nome_vinho FROM vinho v EXEC P_NOME_VINHOS
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Nov 01, 2020 at 11:26 AM -- Server version: 5.7.29-0ubuntu0.18.04.1 -- PHP Version: 7.2.24-0ubuntu0.18.04.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `youtube` -- -- -------------------------------------------------------- -- -- Table structure for table `videos` -- CREATE TABLE `videos` ( `id` int(5) NOT NULL, `video_type` tinyint(2) DEFAULT NULL, `video_id` varchar(50) DEFAULT NULL, `title` varchar(500) CHARACTER SET ucs2 COLLATE ucs2_bin DEFAULT NULL, `description` varchar(500) NOT NULL, `thumbnail_url` varchar(100) DEFAULT NULL, `published_at` varchar(30) DEFAULT NULL, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `videos` -- INSERT INTO `videos` (`id`, `video_type`, `video_id`, `title`, `description`, `thumbnail_url`, `published_at`, `updated_at`, `created_at`) VALUES (11, 1, 'njVyLme1m7c', 'من فيرجينيا.. موفد إكسترا نيوز يوضح مدى إقبال الناخبين على التصويت المبكر في الانتخابات الرـئاسية', '', 'https://i.ytimg.com/vi/njVyLme1m7c/hqdefault.jpg', '2020-10-31T15:48:44Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (12, 1, 'YcDl9zOa-yw', 'Talking Horses', '', 'https://i.ytimg.com/vi/YcDl9zOa-yw/hqdefault.jpg', '2020-10-31T15:34:52Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (13, 1, 'OC_THioVdPc', 'ხმაური აბასთუმნის საარჩევნო უბანთან', '', 'https://i.ytimg.com/vi/OC_THioVdPc/hqdefault.jpg', '2020-10-31T14:31:20Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (14, 1, 'uUXXEgK2Jh8', 'First Negative Number in every Window of Size K | Sliding Window', '', 'https://i.ytimg.com/vi/uUXXEgK2Jh8/hqdefault.jpg', '2020-10-31T13:04:22Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (15, 1, 'frgm9nsmy64', 'ქუთაისში , გორას უბანზე, ზონდერები თავს დაესხნენ ქუთაისის მერობის კანდიდატს ირაკლი კიკვაძეს', '', 'https://i.ytimg.com/vi/frgm9nsmy64/hqdefault.jpg', '2020-10-31T12:04:06Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (16, 1, 'wF0wc0xuVVg', 'Ղարաբաղում թուրք խաղաղապահների տեղակայումը անընդունելի է ԱՄՆ-ի համար.Թրամփի խորհրդական', '', 'https://i.ytimg.com/vi/wF0wc0xuVVg/hqdefault.jpg', '2020-10-31T10:51:19Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (17, 1, 'LF8ptr4-FWs', '&quot;Biz “Amnesty International” və “Human Rights Watch” təşkilatlarını Azərbaycana dəvət etmişik&quot;', '', 'https://i.ytimg.com/vi/LF8ptr4-FWs/hqdefault.jpg', '2020-10-31T10:38:33Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (18, 1, 'DTKD6D8Yjsk', 'Bihar Chunav : बाजपट्टी का कौन होगा बाजीगर, लोगों से सुनिए किसकी हो रही जय-जयकार | Bihar News', '', 'https://i.ytimg.com/vi/DTKD6D8Yjsk/hqdefault.jpg', '2020-10-31T10:30:34Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (19, 1, '3wxGUkkLw0k', 'الرئيس السيسي يشاهد فيلما تسجيليا بعنوان «طريق الأمل»', '', 'https://i.ytimg.com/vi/3wxGUkkLw0k/hqdefault.jpg', '2020-10-31T10:20:56Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'), (20, 1, 'uqM54LytL8k', 'Antisipasi Longsor, Dirikan Posko Jalan Darurat', '', 'https://i.ytimg.com/vi/uqM54LytL8k/hqdefault.jpg', '2020-10-31T10:09:29Z', '2020-11-01 03:20:27', '2020-11-01 03:20:27'); -- -- Indexes for dumped tables -- -- -- Indexes for table `videos` -- ALTER TABLE `videos` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `videos` -- ALTER TABLE `videos` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
use dev; CREATE TABLE IF NOT EXISTS users ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); INSERT INTO users (name, email) VALUES ('lauris', 'lauris@vavere.dev');
-- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: projetcdsi -- ------------------------------------------------------ -- Server version 10.3.16-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `apprenant` -- DROP TABLE IF EXISTS `apprenant`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `apprenant` ( `idApprenant` int(11) NOT NULL AUTO_INCREMENT, `nom` varchar(255) NOT NULL, `prenom` varchar(255) NOT NULL, `image` varchar(255) DEFAULT NULL, `lienLinkedin` varchar(255) DEFAULT NULL, `idFormation` int(11) NOT NULL, PRIMARY KEY (`idApprenant`), KEY `idFormation` (`idFormation`), CONSTRAINT `apprenant_ibfk_1` FOREIGN KEY (`idFormation`) REFERENCES `formation` (`idFormation`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `apprenant` -- LOCK TABLES `apprenant` WRITE; /*!40000 ALTER TABLE `apprenant` DISABLE KEYS */; INSERT INTO `apprenant` VALUES (1,'De Carvalho','Maria',NULL,NULL,1),(2,'Bellet','Dorian',NULL,NULL,1),(3,'Quantin','Florian',NULL,NULL,1),(4,'Kerthe','Nicolas',NULL,NULL,1),(5,'Thomas','Clement',NULL,NULL,1),(6,'Vanier','Clement',NULL,NULL,1),(7,'Diakite','Aissa',NULL,NULL,1),(8,'Delma','Eliezer',NULL,NULL,1); /*!40000 ALTER TABLE `apprenant` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `formation` -- DROP TABLE IF EXISTS `formation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `formation` ( `idFormation` int(11) NOT NULL AUTO_INCREMENT, `nom` varchar(255) DEFAULT NULL, `description` text DEFAULT NULL, PRIMARY KEY (`idFormation`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `formation` -- LOCK TABLES `formation` WRITE; /*!40000 ALTER TABLE `formation` DISABLE KEYS */; INSERT INTO `formation` VALUES (1,'CDSI1920','Concepteurs Des SystŠmes d\'Information'); /*!40000 ALTER TABLE `formation` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-02-24 9:25:35
create sequence SEQ_RESPONSE_BUTTON_URL start with 1000 cache 20; -- ============================================================ -- Table : RESPONSE_BUTTON_URL -- ============================================================ create table RESPONSE_BUTTON_URL ( BTN_ID NUMERIC not null, TEXT TEXT not null, URL TEXT not null, NEW_TAB bool not null, SMT_ID NUMERIC , constraint PK_RESPONSE_BUTTON_URL primary key (BTN_ID) ); comment on column RESPONSE_BUTTON_URL.BTN_ID is 'ID'; comment on column RESPONSE_BUTTON_URL.TEXT is 'Text'; comment on column RESPONSE_BUTTON_URL.URL is 'URL'; comment on column RESPONSE_BUTTON_URL.NEW_TAB is 'New tab'; comment on column RESPONSE_BUTTON_URL.SMT_ID is 'SmallTalk'; alter table RESPONSE_BUTTON_URL add constraint FK_A_SMALL_TALK_RESPONSE_BUTTONS_URL_SMALL_TALK foreign key (SMT_ID) references SMALL_TALK (SMT_ID); create index A_SMALL_TALK_RESPONSE_BUTTONS_URL_SMALL_TALK_FK on RESPONSE_BUTTON_URL (SMT_ID asc);
if (select count(*) from Courts) = 0 BEGIN insert into Courts (Name, FacilityId) values ('Court 1', 1) END
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jul 09, 2019 at 10:09 AM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `transporte` -- -- -------------------------------------------------------- -- -- Table structure for table `asiento` -- CREATE TABLE `asiento` ( `id` int(11) NOT NULL, `estado` enum('libre','ocupado') COLLATE utf8mb4_bin DEFAULT 'libre', `numero` int(11) NOT NULL, `bus_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -------------------------------------------------------- -- -- Table structure for table `bus` -- CREATE TABLE `bus` ( `id` int(11) NOT NULL, `placa` varchar(8) COLLATE utf8mb4_bin NOT NULL, `capacidad` int(11) NOT NULL DEFAULT '48' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `bus` -- INSERT INTO `bus` (`id`, `placa`, `capacidad`) VALUES (1, 'PER-001', 48), (2, 'PER-002', 48), (3, 'PER-003', 48), (4, 'PER-004', 48), (5, 'PER-005', 48), (6, 'PER-006', 48), (7, 'PER-007', 48), (8, 'PER-008', 48), (9, 'PER-009', 48), (10, 'PER-010', 48), (11, 'PER-011', 48), (12, 'PER-012', 48); -- -------------------------------------------------------- -- -- Table structure for table `ciudad` -- CREATE TABLE `ciudad` ( `id` int(11) NOT NULL, `nombre` varchar(24) COLLATE utf8mb4_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `ciudad` -- INSERT INTO `ciudad` (`id`, `nombre`) VALUES (1, 'Trujillo'), (2, 'Lima'), (3, 'Arequipa'), (4, 'Tacna'), (5, 'Cusco'), (6, 'Piura'), (7, 'Huancayo'), (8, 'Chiclayo'), (9, 'Chimbote'), (10, 'Iquitos'), (11, 'Juliaca'), (12, 'Ica'); -- -------------------------------------------------------- -- -- Table structure for table `cliente` -- CREATE TABLE `cliente` ( `id` int(11) NOT NULL, `nro_documento` varchar(8) COLLATE utf8mb4_bin NOT NULL, `nombres` varchar(64) COLLATE utf8mb4_bin NOT NULL, `apellidos` varchar(64) COLLATE utf8mb4_bin NOT NULL, `direccion` varchar(96) COLLATE utf8mb4_bin NOT NULL, `telefono` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL, `email` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL, `usuario` varchar(8) COLLATE utf8mb4_bin NOT NULL, `password` text COLLATE utf8mb4_bin NOT NULL, `pais_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -------------------------------------------------------- -- -- Table structure for table `embarque` -- CREATE TABLE `embarque` ( `id` int(11) NOT NULL, `fecha_salida` datetime NOT NULL, `fecha_llegada` datetime NOT NULL, `bus_id` int(11) DEFAULT NULL, `viaje_id` int(11) DEFAULT NULL, `servicio_id` int(11) DEFAULT '1', `precio` decimal(11,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -------------------------------------------------------- -- -- Table structure for table `pais` -- CREATE TABLE `pais` ( `id` int(11) NOT NULL, `nombre` varchar(24) COLLATE utf8mb4_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `pais` -- INSERT INTO `pais` (`id`, `nombre`) VALUES (1, 'Afganistán'), (2, 'Albania'), (3, 'Alemania'), (4, 'Andorra'), (5, 'Angola'), (6, 'Antigua y Barbuda'), (7, 'Arabia Saudita'), (8, 'Argelia'), (9, 'Argentina'), (10, 'Armenia'), (11, 'Australia'), (12, 'Austria'), (13, 'Azerbaiyán'), (14, 'Bahamas'), (15, 'Bangladés'), (16, 'Barbados'), (17, 'Baréin'), (18, 'Bélgica'), (19, 'Belice'), (20, 'Benín'), (21, 'Bielorrusia'), (22, 'Birmania'), (23, 'Bolivia'), (24, 'Bosnia y Herzegovina'), (25, 'Botsuana'), (26, 'Brasil'), (27, 'Brunéi'), (28, 'Bulgaria'), (29, 'Burkina Faso'), (30, 'Burundi'), (31, 'Bután'), (32, 'Cabo Verde'), (33, 'Camboya'), (34, 'Camerún'), (35, 'Canadá'), (36, 'Catar'), (37, 'Chile'), (38, 'China'), (39, 'Chipre'), (40, 'Ciudad del Vaticano'), (41, 'Colombia'), (42, 'Comoras'), (43, 'Corea del Norte'), (44, 'Corea del Sur'), (45, 'Costa de Marfil'), (46, 'Costa Rica'), (47, 'Croacia'), (48, 'Cuba'), (49, 'Dinamarca'), (50, 'Dominica'), (51, 'Ecuador'), (52, 'Egipto'), (53, 'El Salvador'), (54, 'Emiratos Árabes Unidos'), (55, 'Eritrea'), (56, 'Eslovaquia'), (57, 'Eslovenia'), (58, 'España'), (59, 'Estados Unidos'), (60, 'Estonia'), (61, 'Etiopía'), (62, 'Filipinas'), (63, 'Finlandia'), (64, 'Fiyi'), (65, 'Francia'), (66, 'Gabón'), (67, 'Gambia'), (68, 'Georgia'), (69, 'Ghana'), (70, 'Granada'), (71, 'Grecia'), (72, 'Guatemala'), (73, 'Guyana'), (74, 'Guinea'), (75, 'Guinea ecuatorial'), (76, 'Guinea-Bisáu'), (77, 'Haití'), (78, 'Honduras'), (79, 'Hungría'), (80, 'India'), (81, 'Indonesia'), (82, 'Irak'), (83, 'Irán'), (84, 'Irlanda'), (85, 'Islandia'), (86, 'Islas Marshall'), (87, 'Islas Salomón'), (88, 'Israel'), (89, 'Italia'), (90, 'Jamaica'), (91, 'Japón'), (92, 'Jordania'), (93, 'Kazajistán'), (94, 'Kenia'), (95, 'Kirguistán'), (96, 'Kiribati'), (97, 'Kuwait'), (98, 'Laos'), (99, 'Lesoto'), (100, 'Letonia'), (101, 'Líbano'), (102, 'Liberia'), (103, 'Libia'), (104, 'Liechtenstein'), (105, 'Lituania'), (106, 'Luxemburgo'), (107, 'Madagascar'), (108, 'Malasia'), (109, 'Malaui'), (110, 'Maldivas'), (111, 'Malí'), (112, 'Malta'), (113, 'Marruecos'), (114, 'Mauricio'), (115, 'Mauritania'), (116, 'México'), (117, 'Micronesia'), (118, 'Moldavia'), (119, 'Mónaco'), (120, 'Mongolia'), (121, 'Montenegro'), (122, 'Mozambique'), (123, 'Namibia'), (124, 'Nauru'), (125, 'Nepal'), (126, 'Nicaragua'), (127, 'Níger'), (128, 'Nigeria'), (129, 'Noruega'), (130, 'Nueva Zelanda'), (131, 'Omán'), (132, 'Países Bajos'), (133, 'Pakistán'), (134, 'Palaos'), (135, 'Panamá'), (136, 'Papúa Nueva Guinea'), (137, 'Paraguay'), (138, 'Perú'), (139, 'Polonia'), (140, 'Portugal'), (141, 'Reino Unido'), (142, 'República Centroafricana'), (143, 'República Checa'), (144, 'República de Macedonia'), (145, 'República del Congo'), (146, 'República Democrática de'), (147, 'República Dominicana'), (148, 'República Sudafricana'), (149, 'Ruanda'), (150, 'Rumanía'), (151, 'Rusia'), (152, 'Samoa'), (153, 'San Cristóbal y Nieves'), (154, 'San Marino'), (155, 'San Vicente y las Granad'), (156, 'Santa Lucía'), (157, 'Santo Tomé y Príncipe'), (158, 'Senegal'), (159, 'Serbia'), (160, 'Seychelles'), (161, 'Sierra Leona'), (162, 'Singapur'), (163, 'Siria'), (164, 'Somalia'), (165, 'Sri Lanka'), (166, 'Suazilandia'), (167, 'Sudán'), (168, 'Sudán del Sur'), (169, 'Suecia'), (170, 'Suiza'), (171, 'Surinam'), (172, 'Tailandia'), (173, 'Tanzania'), (174, 'Tayikistán'), (175, 'Timor Oriental'), (176, 'Togo'), (177, 'Tonga'), (178, 'Trinidad y Tobago'), (179, 'Túnez'), (180, 'Turkmenistán'), (181, 'Turquía'), (182, 'Tuvalu'), (183, 'Ucrania'), (184, 'Uganda'), (185, 'Uruguay'), (186, 'Uzbekistán'), (187, 'Vanuatu'), (188, 'Venezuela'), (189, 'Vietnam'), (190, 'Yemen'), (191, 'Yibuti'), (192, 'Zambia'), (193, 'Zimbabue'); -- -------------------------------------------------------- -- -- Table structure for table `pasaje` -- CREATE TABLE `pasaje` ( `id` int(11) NOT NULL, `fecha_reserva` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `cliente_id` int(11) DEFAULT NULL, `embarque_id` int(11) DEFAULT NULL, `asiento_id` int(11) DEFAULT NULL, `precio` decimal(11,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -------------------------------------------------------- -- -- Table structure for table `servicio` -- CREATE TABLE `servicio` ( `id` int(11) NOT NULL, `precio` decimal(11,2) NOT NULL, `nombre` varchar(24) COLLATE utf8mb4_bin NOT NULL, `descripcion` varchar(96) COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `servicio` -- INSERT INTO `servicio` (`id`, `precio`, `nombre`, `descripcion`) VALUES (1, '0.00', 'BÁSICO', 'servicio básico'), (2, '25.00', 'PREMIUN', 'servicio premiun'), (3, '50.00', 'VIP', 'servicio vip'); -- -------------------------------------------------------- -- -- Table structure for table `token` -- CREATE TABLE `token` ( `id` int(11) NOT NULL, `cliente_id` int(11) DEFAULT NULL, `token` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -------------------------------------------------------- -- -- Table structure for table `viaje` -- CREATE TABLE `viaje` ( `id` int(11) NOT NULL, `precio` decimal(11,2) NOT NULL, `origen_ciudad_id` int(11) NOT NULL, `destino_ciudad_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `viaje` -- INSERT INTO `viaje` (`id`, `precio`, `origen_ciudad_id`, `destino_ciudad_id`) VALUES (1, '80.00', 1, 7), (2, '80.00', 1, 8), (3, '80.00', 1, 9), (4, '120.00', 1, 10), (5, '120.00', 2, 3), (6, '120.00', 2, 5), (7, '80.00', 2, 7), (8, '80.00', 2, 9), (9, '60.00', 2, 12), (10, '120.00', 3, 2), (11, '80.00', 3, 4), (12, '100.00', 3, 5), (13, '60.00', 3, 11), (14, '60.00', 3, 12), (15, '80.00', 4, 3), (16, '80.00', 4, 11), (17, '120.00', 5, 2), (18, '100.00', 5, 3), (19, '120.00', 5, 7), (20, '80.00', 5, 11), (21, '80.00', 5, 12), (22, '80.00', 6, 8), (23, '120.00', 6, 10), (24, '80.00', 7, 1), (25, '80.00', 7, 2), (26, '120.00', 7, 5), (27, '80.00', 7, 9), (28, '100.00', 7, 10), (29, '80.00', 8, 6), (30, '80.00', 8, 1), (31, '120.00', 8, 10), (32, '80.00', 9, 1), (33, '80.00', 9, 2), (34, '80.00', 9, 7), (35, '120.00', 10, 1), (36, '120.00', 10, 6), (37, '100.00', 10, 7), (38, '120.00', 10, 8), (39, '60.00', 11, 3), (40, '80.00', 11, 4), (41, '80.00', 11, 5), (42, '60.00', 12, 2), (43, '60.00', 12, 3), (44, '80.00', 12, 5); -- -- Indexes for dumped tables -- -- -- Indexes for table `asiento` -- ALTER TABLE `asiento` ADD PRIMARY KEY (`id`), ADD KEY `bus_id` (`bus_id`); -- -- Indexes for table `bus` -- ALTER TABLE `bus` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ciudad` -- ALTER TABLE `ciudad` ADD PRIMARY KEY (`id`); -- -- Indexes for table `cliente` -- ALTER TABLE `cliente` ADD PRIMARY KEY (`id`), ADD KEY `pais_id` (`pais_id`); -- -- Indexes for table `embarque` -- ALTER TABLE `embarque` ADD PRIMARY KEY (`id`), ADD KEY `bus_id` (`bus_id`), ADD KEY `viaje_id` (`viaje_id`), ADD KEY `servicio_id` (`servicio_id`); -- -- Indexes for table `pais` -- ALTER TABLE `pais` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pasaje` -- ALTER TABLE `pasaje` ADD PRIMARY KEY (`id`), ADD KEY `cliente_id` (`cliente_id`), ADD KEY `embarque_id` (`embarque_id`), ADD KEY `asiento_id` (`asiento_id`); -- -- Indexes for table `servicio` -- ALTER TABLE `servicio` ADD PRIMARY KEY (`id`); -- -- Indexes for table `token` -- ALTER TABLE `token` ADD PRIMARY KEY (`id`), ADD KEY `token_ibfk_1` (`cliente_id`); -- -- Indexes for table `viaje` -- ALTER TABLE `viaje` ADD PRIMARY KEY (`id`), ADD KEY `origen_ciudad_id` (`origen_ciudad_id`), ADD KEY `destino_ciudad_id` (`destino_ciudad_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `asiento` -- ALTER TABLE `asiento` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `bus` -- ALTER TABLE `bus` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `ciudad` -- ALTER TABLE `ciudad` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `cliente` -- ALTER TABLE `cliente` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `embarque` -- ALTER TABLE `embarque` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `pais` -- ALTER TABLE `pais` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=194; -- -- AUTO_INCREMENT for table `pasaje` -- ALTER TABLE `pasaje` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `servicio` -- ALTER TABLE `servicio` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `token` -- ALTER TABLE `token` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `viaje` -- ALTER TABLE `viaje` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45; -- -- Constraints for dumped tables -- -- -- Constraints for table `asiento` -- ALTER TABLE `asiento` ADD CONSTRAINT `asiento_ibfk_1` FOREIGN KEY (`bus_id`) REFERENCES `bus` (`id`); -- -- Constraints for table `cliente` -- ALTER TABLE `cliente` ADD CONSTRAINT `cliente_ibfk_1` FOREIGN KEY (`pais_id`) REFERENCES `pais` (`id`); -- -- Constraints for table `embarque` -- ALTER TABLE `embarque` ADD CONSTRAINT `embarque_ibfk_1` FOREIGN KEY (`bus_id`) REFERENCES `bus` (`id`), ADD CONSTRAINT `embarque_ibfk_2` FOREIGN KEY (`viaje_id`) REFERENCES `viaje` (`id`), ADD CONSTRAINT `embarque_ibfk_3` FOREIGN KEY (`servicio_id`) REFERENCES `servicio` (`id`); -- -- Constraints for table `pasaje` -- ALTER TABLE `pasaje` ADD CONSTRAINT `pasaje_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `cliente` (`id`), ADD CONSTRAINT `pasaje_ibfk_2` FOREIGN KEY (`embarque_id`) REFERENCES `embarque` (`id`), ADD CONSTRAINT `pasaje_ibfk_3` FOREIGN KEY (`asiento_id`) REFERENCES `asiento` (`id`); -- -- Constraints for table `token` -- ALTER TABLE `token` ADD CONSTRAINT `token_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `cliente` (`id`); -- -- Constraints for table `viaje` -- ALTER TABLE `viaje` ADD CONSTRAINT `viaje_ibfk_1` FOREIGN KEY (`origen_ciudad_id`) REFERENCES `ciudad` (`id`), ADD CONSTRAINT `viaje_ibfk_2` FOREIGN KEY (`destino_ciudad_id`) REFERENCES `ciudad` (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/** * -------------------------------------------------------------------------------------------------------------------- * TIME A INICIO * -------------------------------------------------------------------------------------------------------------------- */ /** * TIME A * Tarefa #80154 */ CREATE SEQUENCE rhempenhofolhaexcecaoregra_rh128_sequencial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; CREATE TABLE rhempenhofolhaexcecaoregra( rh128_sequencial int4 NOT NULL default 0, rh128_descricao varchar(100) , CONSTRAINT rhempenhofolhaexcecaoregra_sequ_pk PRIMARY KEY (rh128_sequencial)); alter table rhempenhofolhaexcecaorubrica add column rh74_codele int4 default null, add column rh74_tipofolha int4 default 0, add column rh74_rhempenhofolhaexcecaoregra int4 default null; DROP INDEX if exists rhempenhofolhaexcecaorubrica_in; CREATE UNIQUE INDEX rhempenhofolhaexcecaorubrica_in ON rhempenhofolhaexcecaorubrica(rh74_instit,rh74_rubric,rh74_anousu,rh74_tipofolha); ALTER TABLE rhempenhofolhaexcecaorubrica ADD CONSTRAINT rhempenhofolhaexcecaorubrica_rhempenhofolhaexcecaoregra_fk FOREIGN KEY (rh74_rhempenhofolhaexcecaoregra) REFERENCES rhempenhofolhaexcecaoregra; ALTER TABLE rhempenhofolhaexcecaorubrica ADD CONSTRAINT rhempenhofolhaexcecaorubrica_ae_codele_fk FOREIGN KEY (rh74_codele, rh74_anousu) REFERENCES orcelemento; /** * Depara das exceções para empenhos */ insert into rhempenhofolhaexcecaoregra ( rh128_sequencial, rh128_descricao ) select rh74_sequencial, rh74_rubric || ' - ' || trim( rh27_descr ) || ' / ' || rh74_anousu from rhempenhofolhaexcecaorubrica inner join rhrubricas on rh74_rubric = rh27_rubric and rh74_instit = rh27_instit order by rh74_sequencial; update rhempenhofolhaexcecaorubrica set rh74_rhempenhofolhaexcecaoregra = rh74_sequencial; select setval( 'rhempenhofolhaexcecaoregra_rh128_sequencial_seq', ( select max( rh128_sequencial ) from rhempenhofolhaexcecaoregra ) ); /** * FIM TAREFA #80154 */ /** * TIME A * Tarefa #81921 */ CREATE SEQUENCE bancohoras_rh126_sequencial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; CREATE TABLE bancohoras( rh126_sequencial int8 NOT NULL default 0, rh126_regist int4 NOT NULL default 0, rh126_soma bool NOT NULL default 'f', rh126_data date NOT NULL default null, rh126_horas int4 NOT NULL default 0, rh126_minutos int4 NOT NULL default 0, rh126_observacao text , CONSTRAINT bancohoras_sequ_pk PRIMARY KEY (rh126_sequencial)); ALTER TABLE bancohoras ADD CONSTRAINT bancohoras_regist_fk FOREIGN KEY (rh126_regist) REFERENCES rhpessoal; CREATE INDEX bancohoras_regist_in ON bancohoras(rh126_regist); /** * FIM TAREFA #81921 */ /** * TAREFA 81917 */ /** COLUNA DE DATA PREVIDENCIA CFPESS **/ ALTER TABLE cfpess ADD COLUMN r11_datainiciovigenciarpps date default null; CREATE SEQUENCE regimeprevidenciainssirf_rh129_sequencial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; CREATE TABLE regimeprevidenciainssirf( rh129_sequencial int4 NOT NULL default 0, rh129_regimeprevidencia int4 NOT NULL default 0, rh129_codigo int8 NOT NULL default 0, rh129_instit int4 default 0, CONSTRAINT regimeprevidenciainssirf_sequ_pk PRIMARY KEY (rh129_sequencial)); ALTER TABLE regimeprevidenciainssirf ADD CONSTRAINT regimeprevidenciainssirf_codigo_instit_fk FOREIGN KEY (rh129_codigo,rh129_instit) REFERENCES inssirf; ALTER TABLE regimeprevidenciainssirf ADD CONSTRAINT regimeprevidenciainssirf_regimeprevidencia_fk FOREIGN KEY (rh129_regimeprevidencia) REFERENCES regimeprevidencia; -- INDICES CREATE INDEX regimeprevidenciainssirf_instit_in ON regimeprevidenciainssirf(rh129_instit); CREATE INDEX regimeprevidenciainssirf_codigo_in ON regimeprevidenciainssirf(rh129_codigo); CREATE UNIQUE INDEX regimeprevidenciainssirf_codigo_instit_un ON regimeprevidenciainssirf(rh129_codigo,rh129_instit); /** * Time A Tarefa #81921 */ alter table tipoasse add column h12_vinculaperiodoaquisitivo bool default false; CREATE SEQUENCE rhferiasassenta_rh131_sequencial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; CREATE TABLE rhferiasassenta( rh131_sequencial int4 NOT NULL default 0, rh131_assenta int4 NOT NULL default 0, rh131_rhferias int4 default 0, CONSTRAINT rhferiasassenta_sequ_pk PRIMARY KEY (rh131_sequencial) ); ALTER TABLE rhferiasassenta ADD CONSTRAINT rhferiasassenta_assenta_fk FOREIGN KEY (rh131_assenta) REFERENCES assenta; ALTER TABLE rhferiasassenta ADD CONSTRAINT rhferiasassenta_rhferias_fk FOREIGN KEY (rh131_rhferias) REFERENCES rhferias; CREATE INDEX rhferiasassenta_sequencial_in ON rhferiasassenta(rh131_sequencial); CREATE UNIQUE INDEX rhferiasassenta_assenta_rhferias_un ON rhferiasassenta(rh131_assenta,rh131_rhferias); /** * Fim tarefa #81921 */ /** * -------------------------------------------------------------------------------------------------------------------- * TIME C INICIO * -------------------------------------------------------------------------------------------------------------------- */ CREATE SEQUENCE avaliacaoclassificacao_ed335_sequencial_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1; CREATE TABLE avaliacaoclassificacao( ed335_sequencial int4 NOT NULL default 0, ed335_trocaserie int8 NOT NULL default 0, ed335_disciplina int8 NOT NULL default 0, ed335_avaliacao varchar(200) , CONSTRAINT avaliacaoclassificacao_sequ_pk PRIMARY KEY (ed335_sequencial)); ALTER TABLE avaliacaoclassificacao ADD CONSTRAINT avaliacaoclassificacao_trocaserie_fk FOREIGN KEY (ed335_trocaserie) REFERENCES trocaserie; ALTER TABLE avaliacaoclassificacao ADD CONSTRAINT avaliacaoclassificacao_disciplina_fk FOREIGN KEY (ed335_disciplina) REFERENCES disciplina; CREATE INDEX avaliacaoclassificacao_trocaserie_in ON avaliacaoclassificacao(ed335_trocaserie); CREATE INDEX avaliacaoclassificacao_disciplina_in ON avaliacaoclassificacao(ed335_disciplina); ALTER TABLE edu_parametros ADD COLUMN ed233_reclassificaetapaanterior bool default 'f'; ALTER TABLE historicomps ADD COLUMN ed62_observacao text; ALTER TABLE historicompsfora ADD COLUMN ed99_observacao text; ALTER TABLE matricula ADD COLUMN ed60_tipoingresso int4 default 1; ALTER TABLE matricula ADD CONSTRAINT matricula_tipoingresso_fk FOREIGN KEY (ed60_tipoingresso) REFERENCES tipoingresso; CREATE INDEX matricula_tipoingresso_in ON matricula(ed60_tipoingresso); /** * -------------------------------------------------------------------------------------------------------------------- * TIME C - FIM * -------------------------------------------------------------------------------------------------------------------- */
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 25, 2020 at 11:27 AM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `minionsbattle` -- -- -------------------------------------------------------- -- -- Table structure for table `history` -- CREATE TABLE `history` ( `Id` int(11) NOT NULL, `Winner` varchar(11) NOT NULL, `Loser` varchar(11) NOT NULL, `No_of_rounds` int(11) NOT NULL, `Winner_health` int(11) NOT NULL, `Loser_health` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `history` -- INSERT INTO `history` (`Id`, `Winner`, `Loser`, `No_of_rounds`, `Winner_health`, `Loser_health`) VALUES (6, 'THE EVIL', 'TIM', 9, 46, 0), (7, 'TIM', 'THE EVIL', 5, 63, 0), (8, 'TIM', 'THE EVIL', 9, 21, 0), (9, 'THE EVIL', 'TIM', 7, 40, 0), (10, 'THE EVIL', 'TIM', 9, 31, 0), (11, 'THE EVIL', 'TIM', 5, 28, 0), (12, 'THE EVIL', 'TIM', 5, 15, 0), (13, 'THE EVIL', 'TIM', 18, 10, 0), (14, 'TIM', 'THE EVIL', 16, 34, 0), (15, 'THE EVIL', 'TIM', 6, 39, 0), (16, 'TIM', 'THE EVIL', 5, 49, 0), (17, 'TIM', 'THE EVIL', 10, 47, 0), (18, 'THE EVIL', 'TIM', 8, 5, 0), (19, 'TIM', 'THE EVIL', 5, 56, 0), (20, 'THE EVIL', 'TIM', 8, 18, 0), (21, 'THE EVIL', 'TIM', 5, 19, 0), (22, 'THE EVIL', 'TIM', 10, 39, 0), (23, 'TIM', 'THE EVIL', 7, 19, 0), (24, 'TIM', 'THE EVIL', 11, 4, 0), (25, 'THE EVIL', 'TIM', 13, 13, 0), (26, 'THE EVIL', 'TIM', 5, 43, 0), (28, 'TIM', 'THE EVIL', 5, 60, 0), (29, 'TIM', 'THE EVIL', 7, 6, 0), (30, 'TIM', 'THE EVIL', 7, 50, 0), (31, 'THE EVIL', 'TIM', 5, 62, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `history` -- ALTER TABLE `history` ADD PRIMARY KEY (`Id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `history` -- ALTER TABLE `history` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- -- Table structure for table `contact_numbers` -- CREATE TABLE IF NOT EXISTS `contact_numbers` ( `contact_id` int(11) NOT NULL, `numberType` varchar(32) NOT NULL, `number` varchar(16) NOT NULL, KEY `id` (`contact_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Constraints for table `contact_numbers` -- ALTER TABLE `contact_numbers` ADD CONSTRAINT `contact_numbers_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE DATABASE MovieRental; USE MovieRental; CREATE TABLE User ( UserID INT NOT NULL, Email VARCHAR(255) NOT NULL, Password VARCHAR(255) NOT NULL, Address VARCHAR(255) NOT NULL, PRIMARY KEY (UserID) ); CREATE TABLE Director ( DirectorID INT NOT NULL, DirectorName VARCHAR(255) NOT NULL, PRIMARY KEY (DirectorID) ); CREATE TABLE Actor ( ActorID INT NOT NULL, ActorName VARCHAR(255) NOT NULL, PRIMARY KEY (ActorID) ); CREATE TABLE Genre ( GenreID VARCHAR(25) NOT NULL, GenreName VARCHAR(255) NOT NULL, PRIMARY KEY (GenreID) ); CREATE TABLE Movie ( MovieID INT NOT NULL, MovieName VARCHAR(255) NOT NULL, ReleaseDate DATE NOT NULL, Poster VARCHAR(255), GenreID VARCHAR(25) NOT NULL, DirectorID INT NOT NULL, PRIMARY KEY (MovieID), FOREIGN KEY (GenreID) REFERENCES Genre(GenreID), FOREIGN KEY (DirectorID) REFERENCES Director(DirectorID) ); CREATE TABLE Rating ( RatingID INT NOT NULL, Rating INT NOT NULL, Comment VARCHAR(255), UserID INT NOT NULL, MovieID INT NOT NULL, PRIMARY KEY (RatingID), FOREIGN KEY (MovieID) REFERENCES Movie(MovieID), FOREIGN KEY (UserID) REFERENCES User(UserID) ); CREATE TABLE WatchList ( UserID INT NOT NULL, MovieID INT NOT NULL, FOREIGN KEY (MovieID) REFERENCES Movie(MovieID), FOREIGN KEY (UserID) REFERENCES User(UserID) ); CREATE TABLE RentalHistory ( UserID INT NOT NULL, MovieID INT NOT NULL, DateRented DATE NOT NULL, DateReturned DATE, PRIMARY KEY (DateRented, MovieID, UserID), FOREIGN KEY (MovieID) REFERENCES Movie(MovieID), FOREIGN KEY (UserID) REFERENCES User(UserID) ); CREATE TABLE ActedIn ( MovieID INT NOT NULL, ActorID INT NOT NULL, FOREIGN KEY (MovieID) REFERENCES Movie(MovieID), FOREIGN KEY (ActorID) REFERENCES Actor(ActorID) );
/* 创建数据库 */ create database db_oldboy; use db_oldboy; /* 创建 表 t_student t_school t_course t_choose_course */ create table t_student( id int not null primary key auto_increment, name varchar(20) not null, password varchar(50) not null, age int(3) not null ); create table t_school( id int not null primary key auto_increment, name varchar(50) not null, address varchar(255) not null ); create table t_course( id int not null primary key auto_increment, name varchar(20) not null, price int(5) not null, period int(2) not null, school int not null, constraint fk_school foreign key(school) /*添加学校的外键*/ references t_school(id) ); create table t_choose_course( id int not null primary key auto_increment, id_student int not null, id_course int not null, constraint fk_student foreign key(id_student) /*添加学生的外键*/ references t_student(id), constraint fk_course foreign key(id_course) /*添加课程的外键*/ references t_course(id) ); /* 插入数据 */ insert into db_oldboy.t_student(name,password,age) values ('张三','123',20), ('李四','111',18) ; insert into db_oldboy.t_school(name,address) values ('oldboyBeijing','北京昌平'), ('oldboyShanghai','上海浦东') ; insert into db_oldboy.t_course(name,price,period,school) values ('Python全栈开发一期',20000,5,2), ('Linux运维一期',200,2,2), ('Python全栈开发20期',20000,5,1) ; insert into db_oldboy.t_choose_course(id_student,id_course) values (1,1), (2,2) ; /* 显示表结构 */ desc t_student; desc t_school; desc t_course; desc t_choose_course; /* 查询信息 */ select name from t_course where school = 1; select name from t_course where school = 2; select name from t_student where age>19; select name from t_course where period>4;
-- USER AUTHENTICATION -- Check if the user exists in our database SELECT USER_ID, SALT, PASSWORD FROM USER WHERE USERNAME = 'hkajur93'; -- Get the login and logout times of a particular user SELECT LOGIN_TIME, LOGOUT_TIME FROM USER U, LOGIN_INFO L WHERE L.USER_ID = U.USER_ID AND U.USERNAME = 'hkajur93'; -- SELECT * FROM Course C JOIN Section S JOIN section_days D WHERE C.id = S.courseId AND D.sectionId = S.id AND C.cname = 'CS100'; -- Checks if there is an overlap in the schedule -- If no overlap, it will return an empty set -- Otherwise, it will give the sections that cause conflict SELECT * FROM schedule_secs a JOIN schedule_secs b WHERE a.startTime <= b.endTime AND a.endTime >= b.startTime AND a.sectionId != b.sectionId; -- Get all the courses being taught in this semester SELECT DISTINCT(cname) FROM course JOIN section WHERE course.id = section.courseId; -- Get the highest rating professor from the list of sections SELECT a.sectionId FROM schedule_secs a JOIN schedule_secs b JOIN instructor i WHERE a.startTime <= b.endTime AND a.endTime >= b.startTime AND a.sectionId != b.sectionId AND a.instructorId = i.id AND i.rating NOT IN ( SELECT MAX(i2.rating) FROM instructor i2 JOIN schedule_secs s2 WHERE s2.instructorId = i2.id )
INSERT INTO users (username, first, last, email, password) VALUES ('SajidZ', 'Sajid', 'Zaman', 'finallyfreerec@gmail.com', 'finallyfreeproductions'); INSERT INTO users (username, first, last, email, password) VALUES ('AshCFO', 'Ash', 'NotSureL2', 'finallyfreerec@gmail.com', 'finallyfreeproductions'); INSERT INTO users (username, first, last, email, password) VALUES ('JeffY', 'Jeffrey', 'Yourman', 'jeffreyyourman@gmail.com', 'finallyfreeproductions'); INSERT INTO users (username, first, last, email, password) VALUES ('BorisBoris', 'Boris', 'NotSureLast', 'finallyfreerec@gmail.com', 'finallyfreeproductions'); INSERT INTO users (username, first, last, email, password) VALUES ('NickMarketing', 'Nick', 'NotSure', 'finallyfreerec@gmail.com', 'finallyfreeproductions');
select d.datname as Name, pg_catalog.pg_get_userbyid(d.datdba) as Owner, case when pg_catalog.has_database_privilege(d.datname, 'CONNECT') then pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) else 'No Access' end as Size from pg_catalog.pg_database d order by case when pg_catalog.has_database_privilege(d.datname, 'CONNECT') then pg_catalog.pg_database_size(d.datname) else null end desc -- nulls first limit 100 ;
insert into ps_referrer_discounts values (0,0); insert into ps_referrer_discounts values (1,2); insert into ps_referrer_discounts values (2,3); insert into ps_referrer_discounts values (5,5); insert into ps_referrer_discounts values (10,10); insert into ps_referrer_discounts values (20,15);
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64) -- -- Host: localhost Database: library -- ------------------------------------------------------ -- Server version 5.6.26-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `books` -- DROP TABLE IF EXISTS `books`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `books` ( `BooksID` int(11) NOT NULL AUTO_INCREMENT, `Title` varchar(50) DEFAULT NULL, `Author` varchar(100) DEFAULT NULL, `PublishDate` datetime DEFAULT NULL, `ISBN` int(11) NOT NULL, PRIMARY KEY (`BooksID`), UNIQUE KEY `ISBN_UNIQUE` (`ISBN`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `books` -- LOCK TABLES `books` WRITE; /*!40000 ALTER TABLE `books` DISABLE KEYS */; INSERT INTO `books` VALUES (3,'New book','John Hohn','2015-10-06 12:59:06',123456789),(4,'Another book','Pesho','2015-10-06 12:59:07',987654321); /*!40000 ALTER TABLE `books` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2015-10-06 13:06:01
-- -- PostgreSQL database dump -- -- Dumped from database version 10.3 -- Dumped by pg_dump version 10.3 -- Started on 2018-03-27 16:44:44 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; -- -- TOC entry 5 (class 2615 OID 16394) -- Name: webshop; Type: SCHEMA; Schema: -; Owner: postgres -- CREATE SCHEMA webshop; ALTER SCHEMA webshop OWNER TO postgres; SET default_tablespace = ''; SET default_with_oids = false; -- -- TOC entry 203 (class 1259 OID 16421) -- Name: order; Type: TABLE; Schema: webshop; Owner: postgres -- CREATE TABLE webshop."order" ( id integer NOT NULL, shoppingcart_id integer NOT NULL, customer_name character varying(40), address_street character varying(40), address_housenumber integer, address_zipcode character(6), address_city character varying(40), preferred_delivery_date date, preferred_delivery_time time without time zone ); ALTER TABLE webshop."order" OWNER TO postgres; -- -- TOC entry 202 (class 1259 OID 16419) -- Name: order_id_seq; Type: SEQUENCE; Schema: webshop; Owner: postgres -- CREATE SEQUENCE webshop.order_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE webshop.order_id_seq OWNER TO postgres; -- -- TOC entry 2827 (class 0 OID 0) -- Dependencies: 202 -- Name: order_id_seq; Type: SEQUENCE OWNED BY; Schema: webshop; Owner: postgres -- ALTER SEQUENCE webshop.order_id_seq OWNED BY webshop."order".id; -- -- TOC entry 198 (class 1259 OID 16397) -- Name: product; Type: TABLE; Schema: webshop; Owner: postgres -- CREATE TABLE webshop.product ( id integer NOT NULL, name character varying(40) NOT NULL, description character varying(400), price money ); ALTER TABLE webshop.product OWNER TO postgres; -- -- TOC entry 197 (class 1259 OID 16395) -- Name: product_id_seq; Type: SEQUENCE; Schema: webshop; Owner: postgres -- CREATE SEQUENCE webshop.product_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE webshop.product_id_seq OWNER TO postgres; -- -- TOC entry 2828 (class 0 OID 0) -- Dependencies: 197 -- Name: product_id_seq; Type: SEQUENCE OWNED BY; Schema: webshop; Owner: postgres -- ALTER SEQUENCE webshop.product_id_seq OWNED BY webshop.product.id; -- -- TOC entry 201 (class 1259 OID 16413) -- Name: shoppingcart; Type: TABLE; Schema: webshop; Owner: postgres -- CREATE TABLE webshop.shoppingcart ( id integer NOT NULL ); ALTER TABLE webshop.shoppingcart OWNER TO postgres; -- -- TOC entry 200 (class 1259 OID 16411) -- Name: shoppingcart_id_seq; Type: SEQUENCE; Schema: webshop; Owner: postgres -- CREATE SEQUENCE webshop.shoppingcart_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE webshop.shoppingcart_id_seq OWNER TO postgres; -- -- TOC entry 2829 (class 0 OID 0) -- Dependencies: 200 -- Name: shoppingcart_id_seq; Type: SEQUENCE OWNED BY; Schema: webshop; Owner: postgres -- ALTER SEQUENCE webshop.shoppingcart_id_seq OWNED BY webshop.shoppingcart.id; -- -- TOC entry 199 (class 1259 OID 16406) -- Name: shoppingcart_product; Type: TABLE; Schema: webshop; Owner: postgres -- CREATE TABLE webshop.shoppingcart_product ( product_id integer NOT NULL, shoppingcart_id integer NOT NULL, quantity integer ); ALTER TABLE webshop.shoppingcart_product OWNER TO postgres; -- -- TOC entry 2689 (class 2604 OID 16424) -- Name: order id; Type: DEFAULT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop."order" ALTER COLUMN id SET DEFAULT nextval('webshop.order_id_seq'::regclass); -- -- TOC entry 2687 (class 2604 OID 16400) -- Name: product id; Type: DEFAULT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.product ALTER COLUMN id SET DEFAULT nextval('webshop.product_id_seq'::regclass); -- -- TOC entry 2688 (class 2604 OID 16416) -- Name: shoppingcart id; Type: DEFAULT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.shoppingcart ALTER COLUMN id SET DEFAULT nextval('webshop.shoppingcart_id_seq'::regclass); -- -- TOC entry 2697 (class 2606 OID 16429) -- Name: order order_pkey; Type: CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop."order" ADD CONSTRAINT order_pkey PRIMARY KEY (id); -- -- TOC entry 2691 (class 2606 OID 16405) -- Name: product product_pkey; Type: CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.product ADD CONSTRAINT product_pkey PRIMARY KEY (id); -- -- TOC entry 2695 (class 2606 OID 16418) -- Name: shoppingcart shoppingcart_pkey; Type: CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.shoppingcart ADD CONSTRAINT shoppingcart_pkey PRIMARY KEY (id); -- -- TOC entry 2693 (class 2606 OID 16410) -- Name: shoppingcart_product shoppingcart_product_pkey; Type: CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.shoppingcart_product ADD CONSTRAINT shoppingcart_product_pkey PRIMARY KEY (shoppingcart_id, product_id); -- -- TOC entry 2698 (class 2606 OID 16430) -- Name: shoppingcart_product product_id; Type: FK CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.shoppingcart_product ADD CONSTRAINT product_id FOREIGN KEY (product_id) REFERENCES webshop.product(id); -- -- TOC entry 2699 (class 2606 OID 16435) -- Name: shoppingcart_product shoppingcart_id; Type: FK CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop.shoppingcart_product ADD CONSTRAINT shoppingcart_id FOREIGN KEY (shoppingcart_id) REFERENCES webshop.shoppingcart(id); -- -- TOC entry 2700 (class 2606 OID 16440) -- Name: order shoppingcart_id; Type: FK CONSTRAINT; Schema: webshop; Owner: postgres -- ALTER TABLE ONLY webshop."order" ADD CONSTRAINT shoppingcart_id FOREIGN KEY (shoppingcart_id) REFERENCES webshop.shoppingcart(id); -- Completed on 2018-03-27 16:44:44 -- -- PostgreSQL database dump complete --
-- ex01.sql -- 단일라인 주석 /* 다중라인 주석 하하하하... */ /* 데이터베이스 계정(관리자) 암호 - SYS - SYSTEM - java1234 Destination Folder: C:\oraclexe\ Oracle Home: C:\oraclexe\app\oracle\product\11.2.0\server\ Oracle Base:C:\oraclexe\ Port for 'Oracle Database Listener': 1521 Port for 'Oracle Services for Microsoft Transaction Server': 2030 Port for 'Oracle HTTP Listener': 8080 오라클, Oracle - 회사명, 제품명 - 데이터베이스(Database) -> 데이터베이스 관리 시스템(Database Management System, DBMS) -> 관계형 데이터베이스 관리 시스템(Relational DBMS, RDBMS) - 프로젝트하실 때 DBMS 뭐 쓰셨어요? -> Oracle 11g 사용했습니다. - 프로젝트하실 때 DB 클라언트는 뭐 쓰셨어요? -> SQL Developer 사용했습니다. 다운로드 1. OracleXE112_Win64.zip - 데이터베이스 프로그램(DMBS) 2. sqldeveloper-20.4.1.407.0006-x64.zip - 데이터베이스 클라이언트 프로그램 데이터, Data - 가공된 정보 데이터베이스, Database - 데이터의 집합 - 데이터의 집합을 지원하는 프로그램 - 오라클(Oracle) 데이터베이스 관리 시스템, Database Management System - 데이터베이스 + 추가 작업 -> 통합 시스템 - 오라클(Oracle) 관리 시스템의 필요성 -> 아래의 기능들을 지원 1. 데이터 무결성 - 데이터에 오류가 있으면 안된다. - 제약 조건(Constraint)를 사용한다. 2. 데이터 독립성 - 데이터베이스에 변화가 발생하더라도 관계된 응용 프로그램들은 영향을 받지 않는다. 3. 보안 - 데이터베이스내의 데이터를 함부로 접근 방지 - 소유주나 접근 권한이 있는 사용자만 접근 가능... 통제 가능 4. 데이터 중복 최소화 - 동일한 데이터가 여러곳에 여러번 저장되는 것을 방지한다. 5. 데이터 안정성 - 데이터 백업/복원 기능들 제공한다. DBMS 종류 1. 계층형 DBMS 2. 망형 DBMS 3. 관계형 DBMS > 현재 > 데이터를 표형태로 저장/관리 4. 객체지향형 DBMS 5. 객체관계형 DBMS 관계형 데이터베이스 관리 시스템 -> 제품 종류 1. Oracle - Oracle - 기업용 2. MS-SQL - Microsoft - 기업용 3. MySQL - Oracle - 개인용 + 기업용 4. MariaDB - MySQL 기반 - 무료 - 개인용 + 기업용 5. PostgreSQL - 포스트그레스큐엘 - 무료 - 개인용 + 기업용 6. DB2 - IBM - 메인프레임 7. Access - MS - 개인용 + 소규모 8. 티베로 - 티맥스(TMax) 9. SQLite - 경량 - 모바일 등.. Oracle(데이터베이스 서버) -> UI가 없는 프로그램 -> 서비스 데이터베이스 클라이언트 프로그램 -> UI가 없는 오라클에 접속을 해서 -> 조작을 도와주는 툴 1. SQL Developer - 무료 - Oracle 2. Toad - 유료 - 점유율 최상 3. SQLGate 4. DataGrip(JetBrain) - 30일 평가판 - 대학교 이메일(무료) 5. Eclipse 6. SQL*Plus - 오라클을 설치하면 자동으로 같이 설치되는 클라이언트 툴 - CLI(Command Line Interface) 선생님. 노트북. 세팅. 갑자기 오라클 안되요... ? -> SQL Developer -> DB 동작X 오라클 버전 - Oracle 11g Express Edition - Oracle 1.0 ~ 21c 오라클 에디션 - Express Edition - 무료. 상용 가능(개발용). 기능제한 - 11g XE, 18c XE - Enterprise Edition - 상용 오라클 설치 -> 오라클이 잘 동작하고 있는지??? -> 시작 or 종료?? 1. cmd > services.msc 2. OracleXXX - OracleServiceXE(실행 중) - 데이터베이스 프로그램 - OracleXETNSListener(실행 중) - 오라클과 클라이언트 프로그램을 연결시켜 주는 프로그램 Name: 서버주소.계정명 Name: localhost.system 사용자 이름: system 비밀번호: java1234 비밀번호 저장: 체크 호스트 이름: 오라클 서버 주소(도메인, IP) 포트: 1521 SID(서비스 이름): xe localhost -> 127.0.0.1 oracl1 oracl2 oracl3 열려 있는 파일 -> 스크립트 파일(*.sql), 워크 시크 파일(*.sql) -> 오라클(데이터베이스서버)와 대화를 하기 위한 작업 파일(자바 -> 소스파일(*.java)) -> 문장 단위 실행 스크립트 실행 방법 1. 실행할 명령어(문장)을 선택한다.(블럭잡기) - 마우스 - Shift + 방향키(Home,End) 2. 실행 - Ctrl + Enter 계정 1. 관리자 계정 - sys, system 2. 일반 사용자 계정 - 권한이 일부 제한되어 있는 계정 - 생성(나중에) - 학습용 계정 제공 > scott, hr(사용 금지 -> 해제) */ -- 계정이 잠겨있다. -> 활성화 -- alter user 계정명 account unlock; alter user hr account unlock; --User HR이(가) 변경되었습니다. -- 비밀번호 변경 alter user hr identified by java1234; --User HR이(가) 변경되었습니다. alter user hr account unlock identified by java1234; -- system vs hr -> ? -> 154 vs 7 select * from tabs; show user; -- 데이터베이스 서버 설치(오라클 서버) -> 데이터베이스 클라이언트 툴(SQL Developer) -> hr 계정 활성화 -> DB 서버 접속 /* DB 관련 직무 1. DBA - 데이터베이스 관리자 2. DB 프로그래머 - DB 작업 전문 3. 응용 프로그래머 - DB 작업 일부 localhost.hr - 테이블 - 뷰 - 인덱스 - 패키지 - 프로시저 ... .. .. 관계형 데이터베이스 - 데이터를 표형태로 저장/관리한다. - 데이터끼리의 관계를 관리한다. - 표(테이블)의 집합 테이블 - 열(컬럼)의 집합 > 테이블의 구조 > 스키마(Scheme) 열, Column - 컬럼, 필드(Field), 속성(Attribute), 특성(Property) - 세부 정보 행, Row - 행, 로우, 레코드(Record), 튜플(Tuple) - 테이블에 실체화된 데이터 1건 - Object(객체) 클라이언트 <-> 오라클 - SQL SQL, Structured Query Language - 구조화된 질의 언어 - 사용자(클라이언트 툴)가 관계형 데이터베이스와 대화할 때 사용하는 언어 - 자바에 비해 자연어에 가깝다. 1. DBMS 제작사와 독립적이다. - SQL은 모든 DBMS에 공통이다. 2. 표준 SQL(ANSI-SQL) - 모든 DBMS는 표준 SQL를 지원하도록 설계되어 있다. - SQL-86 ... SQL92... SQL-2011 3. 대화식 언어다. - 질문 > 답변 > 질문 > 답변 > 질문... SQL(오라클 기준) 1. ANSI SQL - 표준 SQL 2. PL/SQL - 자체 SQL - 오라클에서만 동작되는 명령어 ANSI SQL 종류 - 명령어들을 성격에 따라 분류 1. DDL - Data Definition Language - 데이터 정의어 - 구조를 만드는 언어 - 테이블, 뷰, 사용자, 인덱스 등의 객체(DB Object)를 생성,수정,삭제하는 명령어 a. create : 생성 b. drop : 삭제 c. alter : 수정 - 데이터베이스 관리자 - 데이터베이스 담당자 - 프로그래머(일부) 2. DML - Data Manipulation Language - 데이터 조작어 - 데이터베이스의 데이터를 추가,수정,삭제,조회하는 명령어 a. select : 읽기(************************************) b. insert : 추가 c. update : 수정 d. delete : 삭제 - 데이터베이스 관리자 - 데이터베이스 담당자 - 프로그래머(*******) 3. DCL - Data Control Language - 데이터 제어어 - 계정, 보안, 트랜잭션 등을 제어 a. commit b. rollback c. grant d. revoke - 데이터베이스 관리자 - 데이터베이스 담당자 - 프로그래머(일부) 4. DQL - Data Query Language - 데이터 질의어 - DML 중에 select만을 이렇게 따로 칭한다. 5. TCL - Transaction Control Language - DCL중에 commit, rollback만을 이렇게 따로 칭한다. 오라클 기본 인코딩 - ~ 8i : EUC-KR - 9i ~ : UTF-8 */ -- 현재 계정(HR)이 소유하고 있는 테이블 목록 보여주세요. -- SQL은 키워드의 대소문자를 구분하지 않는다. select * from tabs; -- 수업 SELECT * FROM tabs; -- 더 많이 사용 -- Alt + 홑따옴표 SELECT * FROM TABS; -- Ctrl + Space SELECT * FROM tabs;
DROP TABLE IF EXISTS STUDENT; CREATE TABLE STUDENT(NAME VARCHAR(100), AGE INT, SCORE NUMBER);
-- Zadanie 1 CREATE DOMAIN semestry AS varchar(6) NOT NULL CHECK (VALUE IN ('letni', 'zimowy')); CREATE SEQUENCE numer_semestru INCREMENT BY 1; SELECT setval('numer_semestru', MAX(semestr_id)) FROM semestr; ALTER TABLE semestr ADD COLUMN semestr semestry DEFAULT 'letni'; ALTER TABLE semestr ADD COLUMN rok char(9); UPDATE semestr SET semestr = split_part(nazwa, ' ', 2), rok = split_part(nazwa, ' ', 3); ALTER TABLE semestr DROP COLUMN nazwa; ALTER TABLE semestr ALTER semestr SET DEFAULT CASE WHEN EXTRACT(MONTH FROM current_date) <= 6 THEN 'letni' ELSE 'zimowy' END; ALTER TABLE semestr ALTER rok SET DEFAULT CASE WHEN EXTRACT(MONTH FROM current_date) <= 6 THEN EXTRACT(YEAR FROM current_date)-1||'/'||EXTRACT(YEAR FROM current_date) ELSE EXTRACT(YEAR FROM current_date)||'/'||EXTRACT(YEAR FROM current_date)+1 END; -- Zadanie 2 INSERT INTO semestr VALUES(nextval('numer_semestru'), 'zimowy', '2013/2014'); INSERT INTO semestr VALUES(nextval('numer_semestru'), 'letni', '2013/2014'); CREATE SEQUENCE numer_przedmiot_semestr INCREMENT BY 1; SELECT setval('numer_przedmiot_semestr', MAX(kod_przed_sem)) FROM przedmiot_semestr; CREATE SEQUENCE numer_grupy INCREMENT BY 1; SELECT setval('numer_grupy', MAX(kod_grupy)) FROM grupa; /* kopiowanie przedmiotów do roku 2013/2014 */ INSERT INTO przedmiot_semestr (WITH zimowe AS (SELECT przedmiot_semestr.* FROM przedmiot_semestr NATURAL JOIN przedmiot NATURAL JOIN semestr WHERE (przedmiot.rodzaj='o' OR przedmiot.rodzaj='p') AND semestr.semestr='zimowy' AND semestr.rok='2010/2011'), semestrZimowy AS (SELECT semestr_id FROM semestr WHERE semestr.rok='2013/2014' AND semestr.semestr='zimowy') SELECT nextval('numer_przedmiot_semestr'), semestrZimowy.semestr_id, zimowe.kod_przed, zimowe.strona_domowa, zimowe.angielski FROM zimowe CROSS JOIN semestrZimowy); INSERT INTO przedmiot_semestr (WITH letnie AS (SELECT przedmiot_semestr.* FROM przedmiot_semestr NATURAL JOIN przedmiot NATURAL JOIN semestr WHERE (przedmiot.rodzaj='o' OR przedmiot.rodzaj='p') AND semestr.semestr='letni' AND semestr.rok='2010/2011'), semestrLetni AS (SELECT semestr_id FROM semestr WHERE semestr.rok='2013/2014' AND semestr.semestr='letni') SELECT nextval('numer_przedmiot_semestr'), semestrLetni.semestr_id, letnie.kod_przed, letnie.strona_domowa, letnie.angielski FROM letnie CROSS JOIN semestrLetni); /* Dodajemy grupy */ ALTER TABLE grupa ALTER COLUMN kod_uz DROP NOT NULL; INSERT INTO grupa(kod_grupy, kod_przed_sem, max_osoby, rodzaj_zajec) (SELECT nextval('numer_grupy'), kod_przed_sem, 100, 'w' FROM przedmiot_semestr NATURAL JOIN semestr WHERE semestr.rok='2013/2014'); /* Wyszukujemy je*/ SELECT grupa FROM grupa NATURAL JOIN przedmiot_semestr NATURAL JOIN semestr WHERE semestr.rok='2013/2014'; -- Zadanie 3 CREATE TABLE pracownik( kod_uz INTEGER PRIMARY KEY NOT NULL, imie VARCHAR(15) NOT NULL, nazwisko VARCHAR(30) NOT NULL ); CREATE TABLE student( kod_uz INTEGER PRIMARY KEY NOT NULL, imie VARCHAR(15) NOT NULL, nazwisko VARCHAR(30) NOT NULL, semestr SMALLINT ); INSERT INTO pracownik (SELECT DISTINCT uzytkownik.kod_uz, uzytkownik.imie, uzytkownik.nazwisko FROM grupa NATURAL JOIN uzytkownik); INSERT INTO student (SELECT DISTINCT uzytkownik.* FROM wybor NATURAL JOIN uzytkownik); ALTER TABLE wybor DROP CONSTRAINT "fk_wybor_uz"; ALTER TABLE wybor ADD CONSTRAINT "fk_wybor_uz" FOREIGN KEY (kod_uz) REFERENCES student(kod_uz) DEFERRABLE; ALTER TABLE grupa DROP CONSTRAINT "fk_grupa_uz"; ALTER TABLE grupa ADD CONSTRAINT "fk_grupa_uz" FOREIGN KEY (kod_uz) REFERENCES pracownik(kod_uz) DEFERRABLE; DROP TABLE uzytkownik; -- Zadanie 4 CREATE DOMAIN rodzaje_zajec AS VARCHAR(1) NOT NULL CHECK (VALUE IN ('w', 'e', 's', 'c', 'C', 'p', 'P', 'r', 'R', 'g', 'l')); ALTER TABLE grupa ALTER COLUMN rodzaj_zajec TYPE rodzaje_zajec; CREATE VIEW obsada_zajec_view( prac_kod, prac_nazwisko, przed_kod, przed_nazwa, rodzaj_zajec, liczba_grup, liczba_studentow ) AS SELECT pracownik.kod_uz, pracownik.nazwisko, przedmiot.kod_przed, przedmiot.nazwa, grupa.rodzaj_zajec, COUNT(DISTINCT grupa.kod_grupy), COUNT(wybor.kod_uz) FROM pracownik NATURAL JOIN grupa NATURAL JOIN przedmiot_semestr NATURAL JOIN przedmiot JOIN wybor ON grupa.kod_grupy = wybor.kod_grupy GROUP BY pracownik.kod_uz, przedmiot.kod_przed, grupa.rodzaj_zajec; CREATE TABLE obsada_zajec_tab( prac_kod INTEGER, prac_nazwisko VARCHAR(30), przed_kod INTEGER, przed_nazwa TEXT, rodzaj_zajec rodzaje_zajec, liczba_grup INTEGER, liczba_studentow INTEGER ); INSERT INTO obsada_zajec_tab SELECT pracownik.kod_uz, pracownik.nazwisko, przedmiot.kod_przed, przedmiot.nazwa, grupa.rodzaj_zajec, COUNT(DISTINCT grupa.kod_grupy), COUNT(wybor.kod_uz) FROM pracownik NATURAL JOIN grupa NATURAL JOIN przedmiot_semestr NATURAL JOIN przedmiot JOIN wybor ON grupa.kod_grupy = wybor.kod_grupy GROUP BY pracownik.kod_uz, przedmiot.kod_przed, grupa.rodzaj_zajec; /* Zapytanie na perspektywie */ EXPLAIN ANALYZE( WITH ProPrzedLicz AS (SELECT prac_kod, prac_nazwisko, przed_kod, przed_nazwa, SUM(liczba_studentow) AS ile FROM obsada_zajec_view GROUP BY prac_kod, prac_nazwisko, przed_kod, przed_nazwa) SELECT ProPrzedLicz FROM ProPrzedLicz JOIN przedmiot ON ProPrzedLicz.przed_kod = przedmiot.kod_przed WHERE (przedmiot.rodzaj = 'o' OR przedmiot.rodzaj = 'p') ORDER BY ProPrzedLicz.ile DESC LIMIT 1); /* Zapytanie na tabeli */ EXPLAIN ANALYZE( WITH ProPrzedLicz AS (SELECT prac_kod, prac_nazwisko, przed_kod, przed_nazwa, SUM(liczba_studentow) AS ile FROM obsada_zajec_tab GROUP BY prac_kod, prac_nazwisko, przed_kod, przed_nazwa) SELECT ProPrzedLicz FROM ProPrzedLicz JOIN przedmiot ON ProPrzedLicz.przed_kod = przedmiot.kod_przed WHERE (przedmiot.rodzaj = 'o' OR przedmiot.rodzaj = 'p') ORDER BY ProPrzedLicz.ile DESC LIMIT 1); /* Na tabeli wyszlo turbo*/ -- Zadanie 5 CREATE TABLE firma( kod_firmy SERIAL PRIMARY KEY NOT NULL, nazwa TEXT NOT NULL, adres TEXT NOT NULL, kontakt TEXT NOT NULL ); INSERT INTO firma(nazwa, adres, kontakt) VALUES ('SNS', 'Wrocław', 'H.Kloss'), ('BIT', 'Kraków', 'R.Bruner'), ('MIT', 'Berlin', 'J.Kos'); CREATE TABLE oferta_praktyki( kod_oferty SERIAL PRIMARY KEY NOT NULL, kod_firmy INTEGER, semestr_id INTEGER, liczba_miejsc INTEGER CHECK (liczba_miejsc > 0), FOREIGN KEY (kod_firmy) REFERENCES firma(kod_firmy), FOREIGN KEY (semestr_id) REFERENCES semestr(semestr_id) ); INSERT INTO oferta_praktyki(kod_firmy, semestr_id, liczba_miejsc) SELECT kod_firmy, semestr_id, 3 FROM firma, semestr WHERE firma.nazwa = 'SNS' AND semestr.semestr = 'letni' AND semestr.rok = '2013/2014'; INSERT INTO oferta_praktyki(kod_firmy, semestr_id, liczba_miejsc) SELECT kod_firmy, semestr_id, 2 FROM firma, semestr WHERE firma.nazwa = 'MIT' AND semestr.semestr = 'letni' AND semestr.rok = '2013/2014'; CREATE TABLE praktyki( student INTEGER, opiekun INTEGER, oferta INTEGER, FOREIGN KEY (student) REFERENCES student(kod_uz), FOREIGN KEY (opiekun) REFERENCES pracownik(kod_uz), FOREIGN KEY (oferta) REFERENCES oferta_praktyki(kod_oferty) ); BEGIN TRANSACTION; INSERT INTO praktyki(student,oferta) SELECT kod_uz,kod_oferty FROM student s,oferta_praktyki o WHERE kod_uz = (SELECT MAX(kod_uz) FROM student WHERE semestr BETWEEN 6 AND 10 AND kod_uz NOT IN (SELECT student FROM praktyki)) AND kod_oferty = (SELECT MAX(kod_oferty) FROM oferta_praktyki WHERE liczba_miejsc > 0 AND semestr_id = (SELECT MAX(semestr_id) FROM semestr)); UPDATE oferta_praktyki SET liczba_miejsc = liczba_miejsc - 1 WHERE kod_oferty = (SELECT MAX(kod_oferty) FROM oferta_praktyki WHERE liczba_miejsc > 0 AND semestr_id = (SELECT MAX(semestr_id) FROM semestr)); COMMIT; /* Którzy studenci z semestrów 6 do 10 nie zaliczyli jeszcze praktyk*/ SELECT student FROM student WHERE student.semestr BETWEEN 6 AND 10 AND student.kod_uz NOT IN (SELECT student FROM praktyki); /* Liczba ofert na najwiekszy semestr w bazie*/ SELECT SUM(liczba_miejsc) FROM oferta_praktyki WHERE semestr_id >= ALL (SELECT p.semestr_id FROM oferta_praktyki p); DELETE FROM oferta_praktyki WHERE oferta_praktyki.kod_oferty NOT IN (SELECT oferta FROM praktyki); DELETE FROM firma WHERE firma.kod_firmy IN (SELECT f1.kod_firmy FROM oferta_praktyki f1 EXCEPT SELECT f2.kod_firmy FROM praktyki NATURAL JOIN oferta_praktyki f2); -- Zadanie 6 CREATE VIEW plan_zajec( student, semestr_id, przed_kod, termin, sala ) AS SELECT student.kod_uz, przedmiot_semestr.semestr_id, przedmiot_semestr.kod_przed, grupa.termin, grupa.sala FROM wybor NATURAL JOIN student JOIN grupa USING(kod_grupy) JOIN przedmiot_semestr USING(kod_przed_sem); SELECT plan_zajec.* FROM plan_zajec JOIN semestr USING(semestr_id) WHERE plan_zajec.student = 3298 AND semestr.semestr='letni' AND semestr.rok='2009/2010'; SELECT DISTINCT 162 AS pracownik, pz.przed_kod, pz.termin, pz.sala FROM plan_zajec pz JOIN przedmiot_semestr ps ON (pz.przed_kod=ps.kod_przed AND pz.semestr_id=ps.semestr_id) JOIN grupa USING(sala, termin, kod_przed_sem) JOIN semestr ON(pz.semestr_id = semestr.semestr_id) WHERE grupa.kod_uz = 162 AND semestr.semestr='letni' AND semestr.rok='2009/2010'; SELECT DISTINCT pz.sala, pz.termin, przedmiot.nazwa FROM plan_zajec pz NATURAL JOIN semestr JOIN przedmiot ON pz.przed_kod = przedmiot.kod_przed WHERE pz.sala = '25' AND semestr.semestr='letni' AND semestr.rok='2009/2010' ORDER BY termin ASC;
INSERT INTO `authority`(`name`, `id`) VALUES ('ROLE_ADMIN', 1); INSERT INTO `authority`(`name`, `id`) VALUES ('ROLE_USER', 2); INSERT INTO `user` (`id`, `username`, `password`, `date_created`, `email`) VALUES (1,'devel','$2a$10$vaFSgXEULxxJCGheBfG6j.pVzbf5GbPoQh1kskOismOKfhwtT2MGG','2019-06-10 10:00:00', 'jsg_sanchez@hotmail.com'); INSERT INTO `user_authority`(`authority_id`, `user_id`) VALUES (1, 1); INSERT INTO `user_authority`(`authority_id`, `user_id`) VALUES (2, 1);
with projects as ( select distinct period as project, repo, last_value(time) over projects_by_time as last_release_date, last_value(title) over projects_by_time as last_release_tag, last_value(description) over projects_by_time as last_release_desc from sannotations_shared where title != 'CNCF join date' window projects_by_time as ( partition by period order by time asc range between current row and unbounded following ) ), contributors as ( select r.repo_group, count(distinct e.actor_id) as contrib12, count(distinct e.actor_id) filter (where e.created_at >= now() - '6 months'::interval) as contrib6, count(distinct e.actor_id) filter (where e.created_at >= now() - '3 months'::interval) as contrib3, count(distinct e.actor_id) filter (where e.created_at >= now() - '6 months'::interval and e.created_at < now() - '3 months'::interval) as contribp3 from ( select repo_id, created_at, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at >= now() - '1 year'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, dup_created_at as created_at, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, dup_created_at as created_at, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e, gha_repos r where r.repo_group is not null and r.id = e.repo_id group by r.repo_group ), prev12_contributors as ( select distinct r.repo_group, e.actor_id from ( select repo_id, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at < now() - '1 year'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at < now() - '1 year'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at < now() - '1 year'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e, gha_repos r where r.repo_group is not null and r.id = e.repo_id group by r.repo_group, e.actor_id ), prev6_contributors as ( select distinct r.repo_group, e.actor_id from ( select repo_id, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at < now() - '6 months'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at < now() - '6 months'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at < now() - '6 months'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e, gha_repos r where r.repo_group is not null and r.id = e.repo_id group by r.repo_group, e.actor_id ), prev3_contributors as ( select distinct r.repo_group, e.actor_id from ( select repo_id, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at < now() - '3 months'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at < now() - '3 months'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at < now() - '3 months'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e, gha_repos r where r.repo_group is not null and r.id = e.repo_id group by r.repo_group, e.actor_id ), new12_contributors as ( select r.repo_group, count(distinct e.actor_id) as ncontrib12 from ( select repo_id, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at >= now() - '1 year'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e join gha_repos r on r.id = e.repo_id and r.repo_group is not null left join prev12_contributors pc on r.repo_group = pc.repo_group and e.actor_id = pc.actor_id where pc.actor_id is null group by r.repo_group ), new6_contributors as ( select r.repo_group, count(distinct e.actor_id) as ncontrib6, count(distinct e.actor_id) filter (where e.created_at < now() - '3 months'::interval) as ncontribp3 from ( select repo_id, created_at, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at >= now() - '6 months'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, dup_created_at as created_at, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at >= now() - '6 months'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, dup_created_at as created_at, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at >= now() - '6 months'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e join gha_repos r on r.id = e.repo_id and r.repo_group is not null left join prev6_contributors pc on r.repo_group = pc.repo_group and e.actor_id = pc.actor_id where pc.actor_id is null group by r.repo_group ), new3_contributors as ( select r.repo_group, count(distinct e.actor_id) as ncontrib3 from ( select repo_id, actor_id from gha_events where type in ('IssuesEvent', 'PullRequestEvent', 'PushEvent', 'CommitCommentEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent') and created_at >= now() - '3 months'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at >= now() - '3 months'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at >= now() - '3 months'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e join gha_repos r on r.id = e.repo_id and r.repo_group is not null left join prev3_contributors pc on r.repo_group = pc.repo_group and e.actor_id = pc.actor_id where pc.actor_id is null group by r.repo_group ), commits as ( select r.repo_group, count(distinct e.sha) as comm12, count(distinct e.sha) filter (where e.created_at >= now() - '6 months'::interval) as comm6, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as comm3, count(distinct e.sha) filter (where e.created_at >= now() - '6 months'::interval and e.created_at < now() - '3 months'::interval) as commp3, count(distinct e.actor_id) as acomm12, count(distinct e.actor_id) filter (where e.created_at >= now() - '6 months'::interval) as acomm6, count(distinct e.actor_id) filter (where e.created_at >= now() - '3 months'::interval) as acomm3, count(distinct e.actor_id) filter (where e.created_at >= now() - '6 months'::interval and e.created_at < now() - '3 months'::interval) as acommp3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, dup_actor_id as actor_id from gha_commits where dup_created_at >= now() - '1 year'::interval and (lower(dup_actor_login) {{exclude_bots}}) union select dup_repo_id as repo_id, sha, dup_created_at as created_at, author_id as actor_id from gha_commits where dup_author_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_author_login) {{exclude_bots}}) union select dup_repo_id as repo_id, sha, dup_created_at as created_at, committer_id as actor_id from gha_commits where dup_committer_login is not null and dup_created_at >= now() - '1 year'::interval and (lower(dup_committer_login) {{exclude_bots}}) ) e, gha_repos r where r.repo_group is not null and r.id = e.repo_id group by r.repo_group ), prs_opened as ( select r.repo_group, count(distinct pr.id) as pr12, count(distinct pr.id) filter (where pr.created_at >= now() - '6 months'::interval) as pr6, count(distinct pr.id) filter (where pr.created_at >= now() - '3 months'::interval) as pr3, count(distinct pr.id) filter (where pr.created_at >= now() - '6 months'::interval and pr.created_at < now() - '3 months'::interval) as prp3 from gha_pull_requests pr, gha_repos r where r.repo_group is not null and r.id = pr.dup_repo_id and pr.created_at >= now() - '1 year'::interval group by r.repo_group ), prs_closed as ( select r.repo_group, count(distinct pr.id) as pr12, count(distinct pr.id) filter (where pr.closed_at >= now() - '6 months'::interval) as pr6, count(distinct pr.id) filter (where pr.closed_at >= now() - '3 months'::interval) as pr3, count(distinct pr.id) filter (where pr.closed_at >= now() - '6 months'::interval and pr.closed_at < now() - '3 months'::interval) as prp3 from gha_pull_requests pr, gha_repos r where r.repo_group is not null and pr.closed_at is not null and r.id = pr.dup_repo_id and pr.closed_at >= now() - '1 year'::interval group by r.repo_group ), prs_merged as ( select r.repo_group, count(distinct pr.id) as pr12, count(distinct pr.id) filter (where pr.merged_at >= now() - '6 months'::interval) as pr6, count(distinct pr.id) filter (where pr.merged_at >= now() - '3 months'::interval) as pr3, count(distinct pr.id) filter (where pr.merged_at >= now() - '6 months'::interval and pr.merged_at < now() - '3 months'::interval) as prp3 from gha_pull_requests pr, gha_repos r where r.repo_group is not null and pr.merged_at is not null and r.id = pr.dup_repo_id and pr.merged_at >= now() - '1 year'::interval group by r.repo_group ), issues_opened as ( select r.repo_group, count(distinct i.id) as i12, count(distinct i.id) filter (where i.created_at >= now() - '6 months'::interval) as i6, count(distinct i.id) filter (where i.created_at >= now() - '3 months'::interval) as i3, count(distinct i.id) filter (where i.created_at >= now() - '6 months'::interval and i.created_at < now() - '3 months'::interval) as ip3 from gha_issues i, gha_repos r where r.repo_group is not null and i.is_pull_request = false and r.id = i.dup_repo_id and i.created_at >= now() - '1 year'::interval group by r.repo_group ), issues_closed as ( select r.repo_group, count(distinct i.id) as i12, count(distinct i.id) filter (where i.closed_at >= now() - '6 months'::interval) as i6, count(distinct i.id) filter (where i.closed_at >= now() - '3 months'::interval) as i3, count(distinct i.id) filter (where i.closed_at >= now() - '6 months'::interval and i.closed_at < now() - '3 months'::interval) as ip3 from gha_issues i, gha_repos r where r.repo_group is not null and i.is_pull_request = false and i.closed_at is not null and r.id = i.dup_repo_id and i.closed_at >= now() - '1 year'::interval group by r.repo_group ), issue_ratio as ( select io.repo_group, case ic.i3 when 0 then -1.0 else io.i3::float / ic.i3::float end as r3, case ic.ip3 when 0 then -1.0 else io.ip3::float / ic.ip3::float end as rp3 from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group ), recent_issues as ( select distinct id, user_id, created_at from gha_issues where created_at >= now() - '6 months'::interval ), tdiffs as ( select i2.updated_at - i.created_at as diff, r.repo_group from recent_issues i, gha_repos r, gha_issues i2 where i.id = i2.id and r.name = i2.dup_repo_name and (lower(i2.dup_actor_login) {{exclude_bots}}) and i2.event_id in ( select event_id from gha_issues sub where sub.dup_actor_id != i.user_id and sub.id = i.id and sub.updated_at > i.created_at + '30 seconds'::interval and sub.dup_type like '%Event' order by sub.updated_at asc limit 1 ) ), react_time as ( select repo_group, percentile_disc(0.15) within group (order by diff asc) as p15, percentile_disc(0.5) within group (order by diff asc) as med, percentile_disc(0.85) within group (order by diff asc) as p85 from tdiffs where repo_group is not null group by repo_group ), pr_ratio as ( select po.repo_group, case pc.pr3 when 0 then -1.0 else po.pr3::float / pc.pr3::float end as r3, case pc.prp3 when 0 then -1.0 else po.prp3::float / pc.prp3::float end as rp3 from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group ), commits_counts as ( select r.repo_group, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.dup_created_at >= now() - '3 months'::interval) as n3 from gha_commits e, gha_repos r where r.repo_group is not null and r.id = e.dup_repo_id and e.dup_created_at >= now() - '1 year'::interval and ( (lower(e.dup_actor_login) {{exclude_bots}}) or (lower(e.dup_author_login) {{exclude_bots}}) or (lower(e.dup_committer_login) {{exclude_bots}}) ) group by r.repo_group ), known_commits_actors_counts as ( select r.repo_group, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, dup_actor_id as actor_id from gha_commits where (lower(dup_actor_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and a.company_name != 'NotFound' and a.company_name != '(Unknown)' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group ), known_commits_authors_counts as ( select r.repo_group, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, author_id as actor_id from gha_commits where dup_author_login is not null and (lower(dup_author_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and a.company_name != 'NotFound' and a.company_name != '(Unknown)' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group ), known_commits_committers_counts as ( select r.repo_group, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, committer_id as actor_id from gha_commits where dup_committer_login is not null and (lower(dup_committer_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and a.company_name != 'NotFound' and a.company_name != '(Unknown)' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group ), company_commits_actors_counts as ( select r.repo_group, a.company_name, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, dup_actor_id as actor_id from gha_commits where (lower(dup_actor_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group, a.company_name ), company_commits_authors_counts as ( select r.repo_group, a.company_name, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, author_id as actor_id from gha_commits where dup_author_login is not null and (lower(dup_author_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group, a.company_name ), company_commits_committers_counts as ( select r.repo_group, a.company_name, count(distinct e.sha) as n12, count(distinct e.sha) filter (where e.created_at >= now() - '3 months'::interval) as n3 from ( select dup_repo_id as repo_id, sha, dup_created_at as created_at, committer_id as actor_id from gha_commits where dup_committer_login is not null and (lower(dup_committer_login) {{exclude_bots}}) and dup_created_at >= now() - '1 year'::interval ) e, gha_repos r, gha_actors_affiliations a where r.repo_group is not null and a.company_name != '' and r.id = e.repo_id and e.actor_id = a.actor_id and a.dt_from <= e.created_at and a.dt_to > e.created_at group by r.repo_group, a.company_name ), top_all_actors_3 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(a.n3) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_actors_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_known_actors_3 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(k.n3) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_actors_counts k, company_commits_actors_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_all_authors_3 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(a.n3) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_authors_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_known_authors_3 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(k.n3) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_authors_counts k, company_commits_authors_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_all_committers_3 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(a.n3) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_committers_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_known_committers_3 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n3) over companies_by_commits as c, first_value(k.n3) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_committers_counts k, company_commits_committers_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n3 desc range between unbounded preceding and current row ) ) i ), top_all_actors_12 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(a.n12) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_actors_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), top_known_actors_12 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(k.n12) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_actors_counts k, company_commits_actors_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), top_all_authors_12 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(a.n12) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_authors_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), top_known_authors_12 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(k.n12) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_authors_counts k, company_commits_authors_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), top_all_committers_12 as ( select i.repo_group, case i.a > 0 when true then round((i.c::numeric / i.a::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(a.n12) over companies_by_commits as a, first_value(c.company_name) over companies_by_commits as cname from commits_counts a, company_commits_committers_counts c where a.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), top_known_committers_12 as ( select i.repo_group, case i.k > 0 when true then round((i.c::numeric / i.k::numeric) * 100.0, 2)::text || '% ' || i.cname else '-' end as top from ( select distinct c.repo_group, first_value(c.n12) over companies_by_commits as c, first_value(k.n12) over companies_by_commits as k, first_value(c.company_name) over companies_by_commits as cname from known_commits_committers_counts k, company_commits_committers_counts c where k.repo_group = c.repo_group window companies_by_commits as ( partition by c.repo_group order by c.n12 desc range between unbounded preceding and current row ) ) i ), repo_groups as ( select distinct repo_group from gha_repos where repo_group is not null ) select 'phealth,' || project || ',ltag' as name, 'Releases: Last release', last_release_date, 0.0, last_release_tag from projects union select 'phealth,' || project || ',ldate' as name, 'Releases: Last release date', last_release_date, 0.0, to_char(last_release_date, 'MM/DD/YYYY') from projects union select 'phealth,' || project || ',ldesc' as name, 'Releases: Last release description', last_release_date, 0.0, last_release_desc from projects union select 'phealth,' || r.repo_group || ',lcomm' as name, 'Commits: Last commit date', max(c.dup_created_at), 0.0, to_char(max(c.dup_created_at), 'MM/DD/YYYY HH12:MI:SS pm') from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group is not null group by r.repo_group union select 'phealth,' || rg.repo_group || ',lcomm' as name, 'Commits: Last commit date', '1980-01-01 00:00:00', 0.0, '-' from repo_groups rg where (select count(*) from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group = rg.repo_group) = 0 union select 'phealth,' || r.repo_group || ',active' as name, 'Activity status', max(c.dup_created_at), 0.0, CASE WHEN DATE_PART('day', now() - max(c.dup_created_at)) > 90 THEN 'Inactive' ELSE 'Active' END from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group is not null group by r.repo_group union select 'phealth,' || rg.repo_group || ',active' as name, 'Activity status', '1980-01-01 00:00:00', 0.0, 'Unknown' from repo_groups rg where (select count(*) from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group = rg.repo_group) = 0 union select 'phealth,' || r.repo_group || ',lcommd' as name, 'Commits: Days since last commit', max(c.dup_created_at), 0.0, DATE_PART('day', now() - max(c.dup_created_at))::text || ' days' from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group is not null group by r.repo_group union select 'phealth,' || rg.repo_group || ',lcommd' as name, 'Commits: Days since last commit', '1980-01-01 00:00:00', 0.0, '-' from repo_groups rg where (select count(*) from gha_commits c, gha_repos r where c.dup_repo_id = r.id and r.repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',acomm3' as name, 'Committers: Number of committers in the last 3 months', now(), 0.0, acomm3::text from commits union select 'phealth,' || rg.repo_group || ',acomm3' as name, 'Committers: Number of committers in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',acomm6' as name, 'Committers: Number of committers in the last 6 months', now(), 0.0, acomm6::text from commits union select 'phealth,' || rg.repo_group || ',acomm6' as name, 'Committers: Number of committers in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',acomm12' as name, 'Committers: Number of committers in the last 12 months', now(), 0.0, acomm12::text from commits union select 'phealth,' || rg.repo_group || ',acomm12' as name, 'Committers: Number of committers in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',acommp3' as name, 'Committers: Number of committers in the last 3 months (previous 3 months)', now(), 0.0, acommp3::text from commits union select 'phealth,' || rg.repo_group || ',acommp3' as name, 'Committers: Number of committers in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',acomm' as name, 'Committers: Number of committers in the last 3 months vs. previous 3 months', now(), 0.0, case acomm3 > acommp3 when true then 'Up' else case acomm3 < acommp3 when true then 'Down' else 'Flat' end end from commits union select 'phealth,' || rg.repo_group || ',acomm' as name, 'Committers: Number of committers in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',comm3' as name, 'Commits: Number of commits in the last 3 months', now(), 0.0, comm3::text from commits union select 'phealth,' || rg.repo_group || ',comm3' as name, 'Commits: Number of commits in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',comm6' as name, 'Commits: Number of commits in the last 6 months', now(), 0.0, comm6::text from commits union select 'phealth,' || rg.repo_group || ',comm6' as name, 'Commits: Number of commits in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',comm12' as name, 'Commits: Number of commits in the last 12 months', now(), 0.0, comm12::text from commits union select 'phealth,' || rg.repo_group || ',comm12' as name, 'Commits: Number of commits in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',commp3' as name, 'Commits: Number of commits in the last 3 months (previous 3 months)', now(), 0.0, commp3::text from commits union select 'phealth,' || rg.repo_group || ',commp3' as name, 'Commits: Number of commits in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',comm' as name, 'Commits: Number of commits in the last 3 months vs. previous 3 months', now(), 0.0, case comm3 > commp3 when true then 'Up' else case comm3 < commp3 when true then 'Down' else 'Flat' end end from commits union select 'phealth,' || rg.repo_group || ',comm' as name, 'Commits: Number of commits in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from commits where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',contr3' as name, 'Contributors: Number of contributors in the last 3 months', now(), 0.0, contrib3::text from contributors union select 'phealth,' || rg.repo_group || ',contr3' as name, 'Contributors: Number of contributors in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',contr6' as name, 'Contributors: Number of contributors in the last 6 months', now(), 0.0, contrib6::text from contributors union select 'phealth,' || rg.repo_group || ',contr6' as name, 'Contributors: Number of contributors in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',contr12' as name, 'Contributors: Number of contributors in the last 12 months', now(), 0.0, contrib12::text from contributors union select 'phealth,' || rg.repo_group || ',contr12' as name, 'Contributors: Number of contributors in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',contrp3' as name, 'Contributors: Number of contributors in the last 3 months (previous 3 months)', now(), 0.0, contribp3::text from contributors union select 'phealth,' || rg.repo_group || ',contrp3' as name, 'Contributors: Number of contributors in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',contr' as name, 'Contributors: Number of contributors in the last 3 months vs. previous 3 months', now(), 0.0, case contrib3 > contribp3 when true then 'Up' else case contrib3 < contribp3 when true then 'Down' else 'Flat' end end from contributors union select 'phealth,' || rg.repo_group || ',contr' as name, 'Contributors: Number of contributors in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',opr3' as name, 'PRs: Number of PRs opened in the last 3 months', now(), 0.0, pr3::text from prs_opened union select 'phealth,' || rg.repo_group || ',opr3' as name, 'PRs: Number of PRs opened in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',opr6' as name, 'PRs: Number of PRs opened in the last 6 months', now(), 0.0, pr6::text from prs_opened union select 'phealth,' || rg.repo_group || ',opr6' as name, 'PRs: Number of PRs opened in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',opr12' as name, 'PRs: Number of PRs opened in the last 12 months', now(), 0.0, pr12::text from prs_opened union select 'phealth,' || rg.repo_group || ',opr12' as name, 'PRs: Number of PRs opened in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oprp3' as name, 'PRs: Number of PRs opened in the last 3 months (previous 3 months)', now(), 0.0, prp3::text from prs_opened union select 'phealth,' || rg.repo_group || ',oprp3' as name, 'PRs: Number of PRs opened in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',opr' as name, 'PRs: Number of PRs opened in the last 3 months vs. previous 3 months', now(), 0.0, case pr3 > prp3 when true then 'Up' else case pr3 < prp3 when true then 'Down' else 'Flat' end end from prs_opened union select 'phealth,' || rg.repo_group || ',opr' as name, 'PRs: Number of PRs opened in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cpr3' as name, 'PRs: Number of PRs closed in the last 3 months', now(), 0.0, pr3::text from prs_closed union select 'phealth,' || rg.repo_group || ',cpr3' as name, 'PRs: Number of PRs closed in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cpr6' as name, 'PRs: Number of PRs closed in the last 6 months', now(), 0.0, pr6::text from prs_closed union select 'phealth,' || rg.repo_group || ',cpr6' as name, 'PRs: Number of PRs closed in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cpr12' as name, 'PRs: Number of PRs closed in the last 12 months', now(), 0.0, pr12::text from prs_closed union select 'phealth,' || rg.repo_group || ',cpr12' as name, 'PRs: Number of PRs closed in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cprp3' as name, 'PRs: Number of PRs closed in the last 3 months (previous 3 months)', now(), 0.0, prp3::text from prs_closed union select 'phealth,' || rg.repo_group || ',cprp3' as name, 'PRs: Number of PRs closed in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cpr' as name, 'PRs: Number of PRs closed in the last 3 months vs. previous 3 months', now(), 0.0, case pr3 > prp3 when true then 'Up' else case pr3 < prp3 when true then 'Down' else 'Flat' end end from prs_closed union select 'phealth,' || rg.repo_group || ',cpr' as name, 'PRs: Number of PRs closed in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',mpr3' as name, 'PRs: Number of PRs merged in the last 3 months', now(), 0.0, pr3::text from prs_merged union select 'phealth,' || rg.repo_group || ',mpr3' as name, 'PRs: Number of PRs merged in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_merged where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',mpr6' as name, 'PRs: Number of PRs merged in the last 6 months', now(), 0.0, pr6::text from prs_merged union select 'phealth,' || rg.repo_group || ',mpr6' as name, 'PRs: Number of PRs merged in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_merged where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',mpr12' as name, 'PRs: Number of PRs merged in the last 12 months', now(), 0.0, pr12::text from prs_merged union select 'phealth,' || rg.repo_group || ',mpr12' as name, 'PRs: Number of PRs merged in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_merged where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',mprp3' as name, 'PRs: Number of PRs merged in the last 3 months (previous 3 months)', now(), 0.0, prp3::text from prs_merged union select 'phealth,' || rg.repo_group || ',mprp3' as name, 'PRs: Number of PRs merged in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_merged where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',mpr' as name, 'PRs: Number of PRs merged in the last 3 months vs. previous 3 months', now(), 0.0, case pr3 > prp3 when true then 'Up' else case pr3 < prp3 when true then 'Down' else 'Flat' end end from prs_merged union select 'phealth,' || rg.repo_group || ',mpr' as name, 'PRs: Number of PRs merged in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_merged where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ip15' as name, 'Issues: 15th percentile of time to respond to issues', now(), 0.0, p15::text from react_time union select 'phealth,' || rg.repo_group || ',ip15' as name, 'Issues: 15th percentile of time to respond to issues', now(), 0.0, '-' from repo_groups rg where (select count(*) from react_time where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',imed' as name, 'Issues: Median time to respond to issues', now(), 0.0, med::text from react_time union select 'phealth,' || rg.repo_group || ',imed' as name, 'Issues: Median time to respond to issues', now(), 0.0, '-' from repo_groups rg where (select count(*) from react_time where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ip85' as name, 'Issues: 85th percentile of time to respond to issues', now(), 0.0, p85::text from react_time union select 'phealth,' || rg.repo_group || ',ip85' as name, 'Issues: 85th percentile of time to respond to issues', now(), 0.0, '-' from repo_groups rg where (select count(*) from react_time where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',pro2c' as name, 'PRs: Opened to closed rate in the last 3 months vs. previous 3 months', now(), 0.0, case r3 < 0 or rp3 < 0 when true then '-' else case r3 > rp3 when true then 'Up' else case r3 < rp3 when true then 'Down' else 'Flat' end end end from pr_ratio union select 'phealth,' || rg.repo_group || ',pro2c' as name, 'PRs: Opened to closed rate in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from pr_ratio where repo_group = rg.repo_group) = 0 union select 'phealth,' || po.repo_group || ',pro2c3' as name, 'PRs: Opened to closed rate in the last 3 months', now(), 0.0, case pc.pr3 when 0 then '-' else round(po.pr3::numeric / pc.pr3::numeric, 2)::text end from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group union select 'phealth,' || rg.repo_group || ',pro2c3' as name, 'PRs: Opened to closed rate in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group and pc.repo_group = rg.repo_group) = 0 union select 'phealth,' || po.repo_group || ',pro2cp3' as name, 'PRs: Opened to closed rate in the last 3 months (previous 3 months)', now(), 0.0, case pc.prp3 when 0 then '-' else round(po.prp3::numeric / pc.prp3::numeric, 2)::text end from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group union select 'phealth,' || rg.repo_group || ',pro2cp3' as name, 'PRs: Opened to closed rate in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group and pc.repo_group = rg.repo_group) = 0 union select 'phealth,' || po.repo_group || ',pro2c6' as name, 'PRs: Opened to closed rate in the last 6 months', now(), 0.0, case pc.pr6 when 0 then '-' else round(po.pr6::numeric / pc.pr6::numeric, 2)::text end from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group union select 'phealth,' || rg.repo_group || ',pro2c6' as name, 'PRs: Opened to closed rate in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group and pc.repo_group = rg.repo_group) = 0 union select 'phealth,' || po.repo_group || ',pro2c12' as name, 'PRs: Opened to closed rate in the last 12 months', now(), 0.0, case pc.pr12 when 0 then '-' else round(po.pr12::numeric / pc.pr12::numeric, 2)::text end from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group union select 'phealth,' || rg.repo_group || ',pro2c12' as name, 'PRs: Opened to closed rate in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from prs_opened po, prs_closed pc where po.repo_group = pc.repo_group and pc.repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oi3' as name, 'Issues: Number of issues opened in the last 3 months', now(), 0.0, i3::text from issues_opened union select 'phealth,' || rg.repo_group || ',oi3' as name, 'Issues: Number of issues opened in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oi6' as name, 'Issues: Number of issues opened in the last 6 months', now(), 0.0, i6::text from issues_opened union select 'phealth,' || rg.repo_group || ',oi6' as name, 'Issues: Number of issues opened in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oi12' as name, 'Issues: Number of issues opened in the last 12 months', now(), 0.0, i12::text from issues_opened union select 'phealth,' || rg.repo_group || ',oi12' as name, 'Issues: Number of issues opened in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oip3' as name, 'Issues: Number of issues opened in the last 3 months (previous 3 months)', now(), 0.0, ip3::text from issues_opened union select 'phealth,' || rg.repo_group || ',oip3' as name, 'Issues: Number of issues opened in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',oi' as name, 'Issues: Number of issues opened in the last 3 months vs. previous 3 months', now(), 0.0, case i3 > ip3 when true then 'Up' else case i3 < ip3 when true then 'Down' else 'Flat' end end from issues_opened union select 'phealth,' || rg.repo_group || ',oi' as name, 'Issues: Number of issues opened in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ci3' as name, 'Issues: Number of issues closed in the last 3 months', now(), 0.0, i3::text from issues_closed union select 'phealth,' || rg.repo_group || ',ci3' as name, 'Issues: Number of issues closed in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ci6' as name, 'Issues: Number of issues closed in the last 6 months', now(), 0.0, i6::text from issues_closed union select 'phealth,' || rg.repo_group || ',ci6' as name, 'Issues: Number of issues closed in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ci12' as name, 'Issues: Number of issues closed in the last 12 months', now(), 0.0, i12::text from issues_closed union select 'phealth,' || rg.repo_group || ',ci12' as name, 'Issues: Number of issues closed in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',cip3' as name, 'Issues: Number of issues closed in the last 3 months (previous 3 months)', now(), 0.0, ip3::text from issues_closed union select 'phealth,' || rg.repo_group || ',cip3' as name, 'Issues: Number of issues closed in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ci' as name, 'Issues: Number of issues closed in the last 3 months vs. previous 3 months', now(), 0.0, case i3 > ip3 when true then 'Up' else case i3 < ip3 when true then 'Down' else 'Flat' end end from issues_closed union select 'phealth,' || rg.repo_group || ',ci' as name, 'Issues: Number of issues closed in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_closed where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',io2c' as name, 'Issues: Opened to closed rate in the last 3 months vs. previous 3 months', now(), 0.0, case r3 < 0 or rp3 < 0 when true then '-' else case r3 > rp3 when true then 'Up' else case r3 < rp3 when true then 'Down' else 'Flat' end end end from issue_ratio union select 'phealth,' || rg.repo_group || ',io2c' as name, 'Issues: Opened to closed rate in the last 3 months vs. previous 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issue_ratio where repo_group = rg.repo_group) = 0 union select 'phealth,' || io.repo_group || ',io2c3' as name, 'Issues: Opened to closed rate in the last 3 months', now(), 0.0, case ic.i3 when 0 then '-' else round(io.i3::numeric / ic.i3::numeric, 2)::text end from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group union select 'phealth,' || rg.repo_group || ',io2c3' as name, 'Issues: Opened to closed rate in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group and ic.repo_group = rg.repo_group) = 0 union select 'phealth,' || io.repo_group || ',io2cp3' as name, 'Issues: Opened to closed rate in the last 3 months (previous 3 months)', now(), 0.0, case ic.ip3 when 0 then '-' else round(io.ip3::numeric / ic.ip3::numeric, 2)::text end from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group union select 'phealth,' || rg.repo_group || ',io2cp3' as name, 'Issues: Opened to closed rate in the last 3 months (previous 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group and ic.repo_group = rg.repo_group) = 0 union select 'phealth,' || io.repo_group || ',io2c6' as name, 'Issues: Opened to closed rate in the last 6 months', now(), 0.0, case ic.i6 when 0 then '-' else round(io.i6::numeric / ic.i6::numeric, 2)::text end from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group union select 'phealth,' || rg.repo_group || ',io2c6' as name, 'Issues: Opened to closed rate in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group and ic.repo_group = rg.repo_group) = 0 union select 'phealth,' || io.repo_group || ',io2c12' as name, 'Issues: Opened to closed rate in the last 12 months', now(), 0.0, case ic.i12 when 0 then '-' else round(io.i12::numeric / ic.i12::numeric, 2)::text end from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group union select 'phealth,' || rg.repo_group || ',io2c12' as name, 'Issues: Opened to closed rate in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from issues_opened io, issues_closed ic where io.repo_group = ic.repo_group and ic.repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ncontr3' as name, 'Contributors: Number of new contributors in the last 3 months', now(), 0.0, ncontrib3::text from new3_contributors union select 'phealth,' || rg.repo_group || ',ncontr3' as name, 'Contributors: Number of new contributors in the last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from new3_contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ncontr6' as name, 'Contributors: Number of new contributors in the last 6 months', now(), 0.0, ncontrib6::text from new6_contributors union select 'phealth,' || rg.repo_group || ',ncontr6' as name, 'Contributors: Number of new contributors in the last 6 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from new6_contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ncontr12' as name, 'Contributors: Number of new contributors in the last 12 months', now(), 0.0, ncontrib12::text from new12_contributors union select 'phealth,' || rg.repo_group || ',ncontr12' as name, 'Contributors: Number of new contributors in the last 12 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from new12_contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || repo_group || ',ncontrp3' as name, 'Contributors: Number of new contributors in the last 3 months (last 3 months)', now(), 0.0, ncontribp3::text from new6_contributors union select 'phealth,' || rg.repo_group || ',ncontrp3' as name, 'Contributors: Number of new contributors in the last 3 months (last 3 months)', now(), 0.0, '-' from repo_groups rg where (select count(*) from new6_contributors where repo_group = rg.repo_group) = 0 union select 'phealth,' || n.repo_group || ',ncontr' as name, 'Contributors: Number of new contributors in the last 3 months vs. last 3 months', now(), 0.0, case n.ncontrib3 > p.ncontribp3 when true then 'Up' else case n.ncontrib3 < p.ncontribp3 when true then 'Down' else 'Flat' end end from new3_contributors n, new6_contributors p where n.repo_group = p.repo_group union select 'phealth,' || rg.repo_group || ',ncontr' as name, 'Contributors: Number of new contributors in the last 3 months vs. last 3 months', now(), 0.0, '-' from repo_groups rg where (select count(*) from new3_contributors n, new6_contributors p where n.repo_group = p.repo_group and p.repo_group = rg.repo_group) = 0 union select 'phealth,' || rg.repo_group || ',topcompknact3' as name, 'Companies: Percent of known commits pushers from top committing company (last 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_actors_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallact3' as name, 'Companies: Percent of all commits pushers from top committing company (last 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_actors_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompknauth3' as name, 'Companies: Percent of known commits authors from top committing company (last 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_authors_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallauth3' as name, 'Companies: Percent of all commits authors from top committing company (last 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_authors_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompkncom3' as name, 'Companies: Percent of known commits from top committing company (previous 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_committers_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallcom3' as name, 'Companies: Percent of all commits from top committing company (previous 3 months)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_committers_3 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompknact12' as name, 'Companies: Percent of known commits pushers from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_actors_12 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallact12' as name, 'Companies: Percent of all commits pushers from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_actors_12 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompknauth12' as name, 'Companies: Percent of known commits authors from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_authors_12 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallauth12' as name, 'Companies: Percent of all commits authors from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_authors_12 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompkncom12' as name, 'Companies: Percent of known commits from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_known_committers_12 t on rg.repo_group = t.repo_group union select 'phealth,' || rg.repo_group || ',topcompallcom12' as name, 'Companies: Percent of all commits from top committing company (last year)', now(), 0.0, coalesce(t.top, '-') from repo_groups rg left join top_all_committers_12 t on rg.repo_group = t.repo_group ;
CREATE TABLE `city` ( `cityId` int(11) NOT NULL AUTO_INCREMENT, `cityName` varchar(50) NOT NULL, `countryId` int(11) NOT NULL, PRIMARY KEY (`cityId`), KEY `FK_CITY_userId` (`countryId`), CONSTRAINT `FK_CITY_userId` FOREIGN KEY (`countryId`) REFERENCES `country` (`countryId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Name: Vo Van Viet -- ID: ITDSIU18043 --Homework1 --Problem 1: -- a. Create table Edges CREATE TABLE "Edges" ("Source" INTEGER, "Destination" INTEGER); -- b. Insert the tuples INSERT INTO Edges VALUES ('10','5'); INSERT INTO Edges VALUES ('6','25'); INSERT INTO Edges VALUES ('1','3'); INSERT INTO Edges VALUES ('4','4'); -- c. Return all tuples SELECT * FROM Edges; -- d. Return only column Source SELECT Source FROM Edges; -- e. Return tuples where Source > Destination SELECT * FROM Edges WHERE Source > Destination; -- f. Tricky Question INSERT INTO Edges VALUES ('-1','2000'); -- No, I didn't get the error. Because the range of INTEGER data type is from -2,147,483,648 to 2,147,483,647. '-1' and '2000' is within that interval. --Problem 2: create table MyRestaurants CREATE TABLE "MyRestaurants" ( "Name" varchar, "Type_of_Food" VARCHAR, "Distance" INTEGER, "Last_visit" VARCHAR(10), "Like_or_not" INTEGER ); --Problem 3: Insert the tuples INSERT INTO MyRestaurants VALUES ('Manwah','Hotpot','15','2020-02-28','1'); INSERT INTO MyRestaurants VALUES ('Haidilao','Hotpot','30','2019-11-25','1'); INSERT INTO MyRestaurants VALUES ('Gogi House','BBQ','10','2019-12-23','0'); INSERT INTO MyRestaurants VALUES ('Kichi Kichi','Hotpot','45','2020-03-07',NULL); INSERT INTO MyRestaurants VALUES ('King','BBQ','20','2019-10-06','0'); --Problem 4 --a. comma-separated form --print headers: .headers on .mode csv SELECT * FROM MyRestaurants; --not print headers: .headers off .mode csv SELECT * FROM MyRestaurants; --b. list form, delimited by "|" --print headers: .headers on .mode list .separator "|" SELECT * FROM MyRestaurants; --not print headers: .headers off .mode list .separator "|" SELECT * FROM MyRestaurants; --c. column form, width 15 --print headers: .headers on .mode column .width 15 15 15 15 15 SELECT * FROM MyRestaurants; --not print headers: .headers off .mode column .width 15 15 15 15 15 SELECT * FROM MyRestaurants; --Problem 5: --the name and distance of all restaurants within and including 20 minutes of your house --alphabetical order of name SELECT Name, Distance from MyRestaurants WHERE distance <=20 ORDER by Name ASC; --Problem 6: --the restaurants that you like but not visited more than 3 months SELECT * FROM MyRestaurants WHERE Like_or_not = 1 and date(Last_visit) < date('now', '-3 months');
/* Navicat MySQL Data Transfer Source Server : 127.0.0.1_3306 Source Server Version : 50527 Source Host : 127.0.0.1:33066 Source Database : todolist Target Server Type : MYSQL Target Server Version : 50527 File Encoding : 65001 Date: 2018-10-15 19:21:39 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `category` -- ---------------------------- DROP TABLE IF EXISTS `category`; CREATE TABLE `category` ( `id` int(5) unsigned NOT NULL AUTO_INCREMENT, `name` char(20) NOT NULL, `user_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of category -- ---------------------------- INSERT INTO `category` VALUES ('1', 'name1', '1'); INSERT INTO `category` VALUES ('3', 'ceshi1', '1'); -- ---------------------------- -- Table structure for `list` -- ---------------------------- DROP TABLE IF EXISTS `list`; CREATE TABLE `list` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '', `describe` text, `priority` tinyint(3) unsigned NOT NULL DEFAULT '0', `date` date NOT NULL, `state` tinyint(1) NOT NULL DEFAULT '0', `is_deleted` int(11) NOT NULL DEFAULT '0', `user_id` int(11) unsigned NOT NULL, `category_id` int(11) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of list -- ---------------------------- INSERT INTO `list` VALUES ('8', '2', '2', '2', '2012-01-01', '2', '1', '2', '1'); INSERT INTO `list` VALUES ('9', 'express-session 如何设置sessionID的过期时间', 'express官方“auth”这个登陆验证的例子中,会话期间登陆一次就行了。\n但是关闭浏览器后,sessionID也会跟着消失,要怎么给这个sessionID设置过期时间呢?\n以便下次打开浏览器,浏览时,不用再次登录。\n\n主要是这个sessionID是自动生成的。(默认名是connect.sid)\n(好像是,如果sessionID不存在的话,就自动生成一个,然后才能访问相对应的res.session.*)\n在sessionID生成后,可以用req.cookies.sessionID获取,\n但是设置就不行了:\nres.cookie(\'sessionID\', req.cookies.sessionID, { maxAge: 60000 });//无效', '2', '2018-10-11', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('10', '背100个单词', '', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('11', 'ceshi1', '2123', '2', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('12', '去爬山', '', '1', '2018-10-10', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('13', '123', '', '1', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('14', '12312332', '', '1', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('15', '最佳实践模板 上传', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('16', '阿斯顿和', '', '1', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('17', 'mysql数据库里面date的数据取出来格式和时间都不对了 timezone:\"08:00\"', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('18', '啊啊', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('19', '啊啊啊啊', '', '1', '2018-10-11', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('20', '买狗粮', '小红帽牌子的', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('21', '明天 测试', '', '1', '2018-10-13', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('22', '高优先级', '', '3', '2018-10-18', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('23', '明天 中级', '', '2', '2018-10-11', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('24', '明天中级', '', '2', '2018-10-13', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('25', '超出7天', '', '3', '2017-10-04', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('26', 'woshi gaoji', '', '3', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('27', '填充', '', '3', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('28', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('29', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('30', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('31', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('32', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('33', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('34', '填充', '', '1', '2018-10-12', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('35', '测试添加', '', '2', '2018-10-11', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('36', '胎哪家', '', '1', '2018-10-11', '0', '1', '11', '1'); INSERT INTO `list` VALUES ('37', 'fdj', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('38', 'fdj', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('39', '测试数据', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('40', '测试数据', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('41', '测试数据', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('42', '测试数据', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('43', '测试数据', '我是描述', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('44', 'ceshi2', '2', '3', '2018-10-10', '0', '0', '11', '1'); INSERT INTO `list` VALUES ('45', '测试数据', '我是修改', '3', '2018-10-10', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('46', '测试数据', '我是修改', '3', '2018-10-10', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('47', '测试数据', '我是修改', '3', '2018-10-10', '1', '0', '11', '1'); INSERT INTO `list` VALUES ('48', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('49', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('50', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('51', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('52', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('53', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('54', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '1'); INSERT INTO `list` VALUES ('55', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '6'); INSERT INTO `list` VALUES ('56', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '6'); INSERT INTO `list` VALUES ('57', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '6'); INSERT INTO `list` VALUES ('58', '测试数据', '我是修改', '3', '2018-10-10', '1', '1', '11', '6'); -- ---------------------------- -- Table structure for `user` -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` char(20) NOT NULL, `password` char(32) NOT NULL, `salt` char(3) NOT NULL, `email` char(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('4', 'fdj', '123', '123', '9077@qq.com'); INSERT INTO `user` VALUES ('5', 'fdj1', '1', '464', '2'); INSERT INTO `user` VALUES ('6', 'fdj1', '1', '725', '2@qq.com'); INSERT INTO `user` VALUES ('7', 'fdj1', '86b12ae393753cb3393d72f95f625571', '130', '1@qq.com'); INSERT INTO `user` VALUES ('8', 'fdj1', '14e6e73fe7897e4012969d570b63b65d', '694', '3@qq.com'); INSERT INTO `user` VALUES ('9', 'fd1', '9b56bc6e17b7435983e6969b015bc7fd', '852', '11@qq.com'); INSERT INTO `user` VALUES ('10', '121', '8fe144cdf973ffd6d477a14902440a47', '400', '123@a.com'); INSERT INTO `user` VALUES ('11', 'Imfdj', '377c05804120b67d089cbbdc8e3ad109', '032', '123@qq.com');
select * from LUNCHBOX_RESTO; DROP TABLE LUNCHBOX_RESTO; CREATE TABLE LUNCHBOX_RESTO ( RESTO_NUMBER NUMBER PRIMARY KEY, RESTO_TITLE VARCHAR2(100), RESTO_MENU VARCHAR2(100), RESTO_PRICE NUMBER, RESTO_CONTENT VARCHAR2(2024) ); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (1,'교대이층집','제육볶음',7000,'제육볶음2인분'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (2,'교동짬뽕', '짬뽕',7000,'가격이 준수한 영풍문고 옆 중국집'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (3,'굿모닝구내식당','백반',6000, '항상 달라지는 메뉴'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (4,'다담정식', '백반',7500, '5찬 고등어구이빼고 무한리필'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (5,'담소사골순대국','돈사골순대국',7000,'맛있다 든든하다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (6,'도미노피자', '콰트로치즈',7000,'쿠폰을 사용하면 인당7천원'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (7,'돈천동부대찌개','부대찌개',7500,'부대찌개에 돈까스넣지마세요'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (8,'라공방','마라탕',7000,'떨떠름한 그맛'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (9,'맘스터치','싸이버거',7000,'버거 나오는 속도가 엄청느리다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (10,'맛보래떡볶이','치즈떡볶이',7000,'치즈떡볶이 치즈양이 엄청나다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (11,'맥도날드','빅맥',7000,'빅맥,슈비,1955,상하이계열'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (12, '맹버칼','버섯칼국수','7000','휴가때 먹는 맛'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (13,'먹쇠고기','냉면셋트',6000,'가깝고 가성비좋다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (14,'미진','판메밀',9000,'4인기준 [판2비빔1전병1]'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (15,'버거킹','와퍼',7000,'버거킹은 버거킹'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (16,'북촌손만두','피냉면',6000,'가성비: 만두+냉면 < 만두국'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (17,'삼백집','콩나물국밥',7000,'깔끔하고 시원하다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (18,'서브웨이','BLT',6500,'한끼 식사 대용, 속이 편안하다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (19,'수제왕돈까스','돈까스',6500,'4층 계단을 오를 체력이 있으면...'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (20,'시골집','장터국밥',9000,'소해장국, 돈아깝지않다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (21,'신일분식','백반',6000,'할머니들이 해주시는 집밥'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (22,'신주쿠카레','카레라이스',5000,'베이스는 5000원이지만 토핑을 올리면..'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (23,'엽기떡볶이','오리지널볶이',7000,'종각점이 아니라 다른데 시켰습니다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (24,'오양식관','김치찌개',7500,'김치찌개에 계란말이추가가 좋음'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (25,'이가네감자탕','뼈해장국',7000,'맛있다, 아는맛'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (26,'일산닭한마리','닭칼국수',7000,'닭국물의 적당한 담백함에 칼국수'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (27,'제레미20','대만식면요리',8500,'맛있는데 가격대가높다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (28,'참토우','쭈꾸미정식',7000,'맛있다, 맵다!'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (29,'청계면관','고추간짜장',7000,'고추간짜장이 제일 인상적'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (30,'촌놈닭갈비','닭갈비정식',7000,'막국수에 숯불닭갈비'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (31,'카츠야','돈카츠',7000,'약속된 맛, 결제시 마다 1000원쿠폰 지급'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (32,'파파존스','아일리쉬포테토',7000,'도미노와는 다르지만 맛있다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (33,'한솥','치킨마요',5000,'어릴때부터 먹던 한솥도시락'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (34,'홍콩반점','짜장면',6000,'백종원 체인점'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (35,'황소고집','고기백반',7000,'맛있다, 양은 조금 아쉽다'); insert into LUNCHBOX_RESTO ( RESTO_NUMBER, RESTO_TITLE, RESTO_MENU, RESTO_PRICE, RESTO_CONTENT) values (36,'KFC','징거버거',7000,'치킨버거 오리진'); commit; select * from LUNCHBOX_RESTO;
SELECT p.FirstName, p.LastName, a.City, a.State FROM Person p LEFT JOIN Address a ON p.PersonId=a.PersonId;
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Sep 16, 2014 at 09:52 AM -- Server version: 5.5.39 -- PHP Version: 5.4.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `demo` -- -- -------------------------------------------------------- -- -- Table structure for table `registration` -- CREATE TABLE IF NOT EXISTS `registration` ( `id` int(10) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `registration` -- INSERT INTO `registration` (`id`, `name`, `email`, `password`) VALUES (1, 'lokesh', 'ikol.dvj@gmail.com', '8c9673069c3ebc3c64219502f7710a8e64c01b5f'), (2, 'ikol', 'loki034@hotmail.com', '8c9673069c3ebc3c64219502f7710a8e64c01b5f'), (3, 'ikol', 'loki@gmail.com', '8c9673069c3ebc3c64219502f7710a8e64c01b5f'), (4, 'loki034', 'ikol@gmail.com', '8c9673069c3ebc3c64219502f7710a8e64c01b5f'), (5, 'ikol034', 'l@gmail.com', '8c9673069c3ebc3c64219502f7710a8e64c01b5f'), (6, 'rs220', 'rs220@gmail.com', '128ca31f3e57e9450d0d8fd44696bac582cf5a2e'); -- -- Indexes for dumped tables -- -- -- Indexes for table `registration` -- ALTER TABLE `registration` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `registration` -- ALTER TABLE `registration` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
SELECT * FROM dbo.Employees
-- employee table CREATE TABLE employees ( id SERIAL PRIMARY KEY, first_name VARCHAR(80) NOT NULL, last_name VARCHAR(200) NOT NULL, title VARCHAR(80), employee_id VARCHAR(8) NOT NULL UNIQUE, annual_salary DECIMAL(10,2) NOT NULL, active BOOLEAN NOT NULL DEFAULT true ); -- get sum of only active employees SELECT first_name, active, SUM(annual_salary) AS salary_total FROM employees WHERE active = TRUE GROUP BY active, first_Name; SELECT SUM(annual_salary) FROM employees WHERE active = TRUE; -- toggle boolean value UPDATE employees SET active = NOT active WHERE id = 1;
ALTER TABLE VILKAR_RESULTAT ADD COLUMN BEHANDLING_ID BIGINT;
// Create an in-memory graph of the Game of Thrones graph // This graph looks at character - character interactions across all 5 seasons CALL gds.graph.create( 'interactions', 'Person', {INTERACTS: {orientation: 'UNDIRECTED'}} ) // Run betweenness centrality on the above graph CALL gds.betweenness.stream('interactions') YIELD nodeId, score RETURN gds.util.asNode(nodeId).name AS name, score ORDER BY score DESC // Run local clustering coefficient CALL gds.localClusteringCoefficient.stream('interactions') YIELD nodeId, localClusteringCoefficient RETURN gds.util.asNode(nodeId).name AS name, localClusteringCoefficient ORDER BY localClusteringCoefficient DESC
-- phpMyAdmin SQL Dump -- version 4.0.10.18 -- https://www.phpmyadmin.net -- -- Servidor: localhost:3306 -- Tiempo de generación: 24-02-2017 a las 04:39:19 -- Versión del servidor: 5.5.54-cll -- Versión de PHP: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de datos: `agiliza_project` -- DELIMITER $$ -- -- Procedimientos -- CREATE DEFINER=`agiliza`@`localhost` PROCEDURE `sp_cursos_letras`(in fecha_n int) BEGIN declare id int; declare des varchar(45); declare lim int; declare letras int; declare letra varchar(45); declare lt varchar(45); DECLARE i INT DEFAULT 0; declare lts varchar(45); declare id_c int; declare fecha int; declare id_profesor int; declare id_especialidad int; DECLARE fin INTEGER DEFAULT 0; DECLARE cursos_cursor CURSOR FOR SELECT id_curso, descripcion_curso, limite_curso, cantidad_letras, 'letra_curso' = 'A' FROM curso WHERE vigencia = 1; -- Condición de salida DECLARE CONTINUE HANDLER FOR NOT FOUND SET fin=1; DROP TEMPORARY TABLE IF EXISTS cursos_temp; CREATE TEMPORARY TABLE IF NOT EXISTS cursos_temp (id_curso_anual int, nombre_curso_anual varchar(45), fecha_curso_anual varchar(45), id_curso int, descripcion_curso varchar(45), limite_curso int, letra_curso varchar(45), id_profesor int, id_especialidad int, estado int); set lts = 'ABCDEFGHYJKLMNOPQRSTUVXYZ'; set fecha = fecha_n; OPEN cursos_cursor; get_cursos: LOOP FETCH cursos_cursor INTO id, des, lim, letras,letra; IF fin = 1 THEN LEAVE get_cursos; END IF; set i = 1; WHILE i <= letras DO set lt = SUBSTRING(lts,i,1); set id_c = (select id_curso_anual from curso_anual where id_curso = id and letra_curso = lt and fecha_curso_anual = fecha); if id_c is null then set id_c = 0; set id_profesor = 0; set id_especialidad = 1; else set id_profesor = (select curso_anual.id_profesor from curso_anual where id_curso_anual = id_c); set id_especialidad = (select curso_anual.id_especialidad from curso_anual where id_curso_anual = id_c); end if; insert into cursos_temp values(id_c,concat(des,' ',lt),fecha,id,des,letras,lt,id_profesor,id_especialidad,1); set i = i+1; END WHILE; END LOOP get_cursos; CLOSE cursos_cursor; select * from cursos_temp; END$$ DELIMITER ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `administrativo` -- CREATE TABLE IF NOT EXISTS `administrativo` ( `id_administrativo` int(11) NOT NULL AUTO_INCREMENT, `id_usuario` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_administrativo`), KEY `fk_admin_user_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; -- -- Volcado de datos para la tabla `administrativo` -- INSERT INTO `administrativo` (`id_administrativo`, `id_usuario`, `vigencia`) VALUES (3, 2, 1), (5, 24, 1), (6, 29, 1), (7, 1, 1), (8, 37, 1), (9, 41, 1), (10, 43, 1), (11, 46, 1), (12, 51, 1), (13, 52, 1), (14, 53, 1), (15, 54, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `alumno` -- CREATE TABLE IF NOT EXISTS `alumno` ( `id_alumno` int(11) NOT NULL AUTO_INCREMENT, `fecha_ingreso` date DEFAULT NULL, `fecha_egreso` date DEFAULT NULL, `nivel_alumno` int(11) DEFAULT NULL, `id_usuario` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', `asignado` tinyint(4) DEFAULT '0', PRIMARY KEY (`id_alumno`), KEY `fk_alumno_nivel_idx` (`nivel_alumno`), KEY `fk_alumno_user_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -- Volcado de datos para la tabla `alumno` -- INSERT INTO `alumno` (`id_alumno`, `fecha_ingreso`, `fecha_egreso`, `nivel_alumno`, `id_usuario`, `vigencia`, `asignado`) VALUES (2, NULL, NULL, 4, 3, 1, 1), (3, NULL, NULL, 5, 4, 1, 0), (4, NULL, NULL, 1, 5, 1, 0), (8, NULL, NULL, 2, 32, 1, 0), (9, NULL, NULL, 1, 33, 1, 0), (10, NULL, NULL, 1, 38, 1, 1), (11, NULL, NULL, 1, 39, 1, 0), (12, NULL, NULL, 1, 40, 1, 0), (13, NULL, NULL, 4, 44, 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `alumno_curso` -- CREATE TABLE IF NOT EXISTS `alumno_curso` ( `id_alumno_curso` int(11) NOT NULL AUTO_INCREMENT, `id_curso_anual` int(11) DEFAULT NULL, `id_alumno` int(11) DEFAULT NULL, PRIMARY KEY (`id_alumno_curso`), KEY `fk_alumno_curso_curso_anual_idx` (`id_curso_anual`), KEY `fk_alumno_curso_alumno_idx1` (`id_alumno`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Volcado de datos para la tabla `alumno_curso` -- INSERT INTO `alumno_curso` (`id_alumno_curso`, `id_curso_anual`, `id_alumno`) VALUES (1, 8, 2), (2, 8, 13), (9, 1, 10); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `apoderado` -- CREATE TABLE IF NOT EXISTS `apoderado` ( `id_apoderado` int(11) NOT NULL AUTO_INCREMENT, `id_usuario` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_apoderado`), KEY `fk_apoderado_user_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcado de datos para la tabla `apoderado` -- INSERT INTO `apoderado` (`id_apoderado`, `id_usuario`, `vigencia`) VALUES (2, 28, 1), (3, 42, 1), (4, 45, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `apoderado_alumno` -- CREATE TABLE IF NOT EXISTS `apoderado_alumno` ( `id_apoderado_alumno` int(11) NOT NULL AUTO_INCREMENT, `id_apoderado` int(11) DEFAULT NULL, `id_alumno` int(11) DEFAULT NULL, `id_year` int(11) DEFAULT NULL, PRIMARY KEY (`id_apoderado_alumno`), KEY `fk_apoderado_alumno_idx` (`id_apoderado`), KEY `fk_alumno_apoderado_idx` (`id_alumno`), KEY `fk_alumnoapd_year_idx` (`id_year`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcado de datos para la tabla `apoderado_alumno` -- INSERT INTO `apoderado_alumno` (`id_apoderado_alumno`, `id_apoderado`, `id_alumno`, `id_year`) VALUES (1, 2, 2, 2), (2, 2, 13, 2), (3, 3, 10, 2), (4, 3, 11, 2), (5, 3, 11, 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `asignatura` -- CREATE TABLE IF NOT EXISTS `asignatura` ( `id_asignatura` int(11) NOT NULL AUTO_INCREMENT, `nombre_asignatura` varchar(45) NOT NULL, `descripcion_asignatura` varchar(100) DEFAULT NULL, `id_especialidad` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_asignatura`), KEY `fk_asignatura_especialidad_idx` (`id_especialidad`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Volcado de datos para la tabla `asignatura` -- INSERT INTO `asignatura` (`id_asignatura`, `nombre_asignatura`, `descripcion_asignatura`, `id_especialidad`, `vigencia`) VALUES (1, 'Lenguaje', NULL, 1, 1), (2, 'Matemática', NULL, 1, 1), (3, 'Historia', NULL, 1, 1), (4, 'Biología', NULL, 1, 1), (5, 'Quimica', NULL, 1, 1), (6, 'Física', NULL, 1, 1), (7, 'Ed. Física', NULL, 1, 1), (8, 'Religión', NULL, 1, 1), (9, 'Tecnología', NULL, 1, 1), (10, 'Test', 'descripción de test', 1, 0), (11, 'D. Técnico', NULL, 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `asistencia` -- CREATE TABLE IF NOT EXISTS `asistencia` ( `id_asistencia` int(11) NOT NULL AUTO_INCREMENT, `id_detalle_periodo` int(11) DEFAULT NULL, `id_alumno_curso` int(11) DEFAULT NULL, `fecha_asistencia` datetime DEFAULT NULL, `estado_asistencia` varchar(45) DEFAULT NULL, PRIMARY KEY (`id_asistencia`), KEY `fk_asistencia_alumno_curso_idx` (`id_alumno_curso`), KEY `fk_asistencia_periodo_d_idx` (`id_detalle_periodo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; -- -- Volcado de datos para la tabla `asistencia` -- INSERT INTO `asistencia` (`id_asistencia`, `id_detalle_periodo`, `id_alumno_curso`, `fecha_asistencia`, `estado_asistencia`) VALUES (1, 53, 1, '2016-03-07 00:00:00', '0'), (2, 53, 1, '2016-03-08 00:00:00', 'true'), (3, 53, 1, '2016-03-09 00:00:00', 'false'), (4, 53, 1, '2016-03-10 00:00:00', '0'), (5, 53, 1, '2016-03-11 00:00:00', '0'), (6, 53, 2, '2016-03-07 00:00:00', '0'), (7, 53, 2, '2016-03-08 00:00:00', 'true'), (8, 53, 2, '2016-03-09 00:00:00', 'true'), (9, 53, 2, '2016-03-10 00:00:00', '0'), (10, 53, 2, '2016-03-11 00:00:00', '0'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `bloque` -- CREATE TABLE IF NOT EXISTS `bloque` ( `id_bloque` int(11) NOT NULL AUTO_INCREMENT, `hora_inicio` datetime DEFAULT NULL, `hora_fin` datetime DEFAULT NULL, `hora_inicio_mostrar` time DEFAULT NULL, `hora_fin_mostrar` time DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_bloque`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; -- -- Volcado de datos para la tabla `bloque` -- INSERT INTO `bloque` (`id_bloque`, `hora_inicio`, `hora_fin`, `hora_inicio_mostrar`, `hora_fin_mostrar`, `vigencia`) VALUES (1, '2016-03-06 08:15:00', '1900-09-05 09:00:00', '08:15:00', '09:00:00', 1), (2, '2016-07-04 09:00:00', '2016-07-04 09:45:00', '09:00:00', '09:45:00', 1), (3, '2016-08-04 10:00:00', '2016-08-04 10:45:00', '10:00:00', '10:45:00', 1), (4, '2016-07-04 10:45:00', '2016-07-04 11:30:00', '10:45:00', '11:30:00', 1), (5, '2016-08-04 11:45:00', '2016-08-04 12:30:00', '11:45:00', '12:30:00', 1), (6, '2016-09-01 12:30:00', '2016-09-01 13:15:00', '12:30:00', '13:15:00', 1), (7, '2016-10-03 14:15:00', '2016-10-03 15:00:00', '14:15:00', '15:00:00', 1), (8, '2016-10-03 15:00:00', '2016-10-03 15:45:00', '15:00:00', '15:45:00', 1), (9, '2016-10-03 16:00:00', '2016-10-03 16:45:00', '16:00:00', '16:45:00', 1), (10, '2016-10-03 16:45:00', '2016-10-03 17:30:00', '16:45:00', '17:30:00', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `carro_compra` -- CREATE TABLE IF NOT EXISTS `carro_compra` ( `id_carro_compra` int(11) NOT NULL AUTO_INCREMENT, `fecha_creacion` datetime DEFAULT NULL, `neto` int(11) DEFAULT NULL, `estado` tinyint(4) DEFAULT '1', `id_usuario` int(11) DEFAULT NULL, `forma_pago` varchar(45) DEFAULT NULL, `cantidad_cuotas` int(11) DEFAULT NULL, PRIMARY KEY (`id_carro_compra`), KEY `fk_carro_usuario_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ; -- -- Volcado de datos para la tabla `carro_compra` -- INSERT INTO `carro_compra` (`id_carro_compra`, `fecha_creacion`, `neto`, `estado`, `id_usuario`, `forma_pago`, `cantidad_cuotas`) VALUES (1, '2016-09-01 23:38:00', 113000, 0, 1, 'Tarjeta Credito', 2), (2, '2016-09-04 22:45:52', 25000, 0, 1, 'Tarjeta Credito', 1), (3, '2016-09-04 22:50:27', 9500, 0, 1, 'PayPal', 1), (4, '2016-09-15 18:17:06', 11500, 0, 1, 'PayPal', 1), (5, '2016-09-15 19:34:47', 25000, 0, 1, 'PayPal', 1), (6, '2016-09-15 19:43:04', 25000, 0, 1, 'PayPal', 1), (7, '2016-09-15 19:44:08', 25000, 0, 1, 'PayPal', 1), (8, '2016-09-15 19:45:49', 25000, 0, 1, 'PayPal', 1), (9, '2016-09-15 19:47:35', 25000, 0, 1, 'PayPal', 1), (10, '2016-09-15 19:48:51', 25000, 0, 1, 'PayPal', 1), (11, '2016-09-15 19:49:50', 25000, 0, 1, 'PayPal', 1), (12, '2016-09-15 19:53:50', 25000, 0, 1, 'PayPal', 1), (13, '2016-09-15 20:09:12', 25000, 0, 1, 'Tarjeta Credito', 6), (14, '2016-09-21 03:15:42', 25000, 0, 3, 'PayPal', 1), (15, '2016-09-21 03:18:15', 5000, 0, 3, 'PayPal', 1), (16, '2016-09-21 03:24:22', 6500, 0, 3, 'PayPal', 1), (17, '2016-09-21 03:27:35', 6500, 0, 3, 'PayPal', 1), (18, '2016-09-21 03:31:16', 3000, 0, 3, 'PayPal', 1), (19, '2016-09-21 03:32:14', 3000, 0, 3, 'PayPal', 1), (20, '2016-09-24 01:53:04', 25000, 0, 3, 'PayPal', 1), (21, '2016-09-24 02:18:19', 5000, 0, 3, 'PayPal', 1), (22, '2016-09-24 02:20:51', 6500, 0, 3, 'PayPal', 1), (23, '2016-09-24 02:27:46', 3000, 0, 3, 'PayPal', 1), (24, '2016-09-24 02:28:29', 3000, 0, 3, 'PayPal', 1), (25, '2016-09-24 02:29:26', 3000, 0, 3, 'PayPal', 1), (26, '2016-09-24 02:36:00', 3000, 0, 3, 'PayPal', 1), (27, '2016-09-24 02:37:26', 3000, 0, 3, 'PayPal', 1), (28, '2016-09-24 02:46:09', 3000, 0, 3, 'PayPal', 1), (29, '2016-09-24 02:47:51', 6500, 0, 3, 'PayPal', 1), (30, '2016-09-24 02:48:37', 3000, 0, 3, 'PayPal', 1), (31, '2016-09-24 02:49:22', 3000, 0, 3, 'PayPal', 1), (32, '2016-09-24 02:52:45', 3000, 0, 3, 'PayPal', 1), (33, '2016-09-24 02:55:10', 3000, 0, 3, 'PayPal', 1), (34, '2016-09-24 02:56:26', 3000, 0, 3, 'Tarjeta Credito', 5), (35, '2016-09-24 03:00:33', 3000, 0, 3, 'Tarjeta Credito', 1), (36, '2016-09-24 03:01:08', 8000, 0, 3, 'PayPal', 1), (37, '2016-09-24 03:02:22', 8000, 0, 3, 'Tarjeta Credito', 1), (38, '2016-09-24 03:06:21', 14500, 0, 3, 'PayPal', 1), (39, '2016-09-24 09:24:01', 3000, 0, 3, 'PayPal', 1), (40, '2016-09-24 09:26:33', 3000, 0, 3, 'PayPal', 1), (41, '2016-09-24 09:29:12', 6500, 0, 3, 'PayPal', 1), (42, '2016-09-24 09:31:51', 3000, 0, 3, 'PayPal', 1), (43, '2016-09-24 09:34:05', 6500, 0, 3, 'PayPal', 1), (44, '2016-09-24 10:10:49', 25000, 0, 3, 'PayPal', 1), (45, '2016-11-22 03:16:44', 5000, 1, 3, NULL, NULL), (46, '2016-11-24 16:38:09', 168000, 0, 2, 'PayPal', 1), (47, '2016-12-14 21:48:25', 50000, 0, 1, 'PayPal', 1), (48, '2016-12-27 19:35:20', 25000, 0, 1, 'PayPal', 1), (49, '2016-12-27 22:01:18', 34500, 1, 54, NULL, NULL), (50, '2017-01-29 18:47:59', 8000, 1, 2, NULL, NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categoria` -- CREATE TABLE IF NOT EXISTS `categoria` ( `id_categoria` int(11) NOT NULL AUTO_INCREMENT, `nombre_categoria` varchar(45) DEFAULT NULL, PRIMARY KEY (`id_categoria`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcado de datos para la tabla `categoria` -- INSERT INTO `categoria` (`id_categoria`, `nombre_categoria`) VALUES (1, 'Vestimenta'), (2, 'Accesorios'), (3, 'Útiles Escolares'), (4, 'Otros'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `curso` -- CREATE TABLE IF NOT EXISTS `curso` ( `id_curso` int(11) NOT NULL AUTO_INCREMENT, `descripcion_curso` varchar(100) NOT NULL, `limite_curso` int(11) DEFAULT NULL, `cantidad_letras` int(11) DEFAULT '1', `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_curso`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcado de datos para la tabla `curso` -- INSERT INTO `curso` (`id_curso`, `descripcion_curso`, `limite_curso`, `cantidad_letras`, `vigencia`) VALUES (1, '1° Medio', 30, 2, 1), (2, '2° Medio', 30, 2, 1), (3, '3° Medio', 30, 2, 1), (4, '4° Medio', 30, 2, 1), (5, 'Practica Profesional', 67, 1, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `curso_anual` -- CREATE TABLE IF NOT EXISTS `curso_anual` ( `id_curso_anual` int(11) NOT NULL AUTO_INCREMENT, `nombre_curso_anual` varchar(45) DEFAULT NULL, `fecha_curso_anual` int(11) DEFAULT NULL, `profesor_jefe` varchar(45) DEFAULT NULL, `id_curso` int(11) DEFAULT NULL, `id_especialidad` int(11) DEFAULT NULL, `id_profesor` int(11) DEFAULT NULL, `letra_curso` varchar(45) DEFAULT NULL, `estado` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_curso_anual`), KEY `fk_asignacion_curso_idx` (`id_curso`), KEY `fk_curso_anual_especialidad_idx` (`id_especialidad`), KEY `fk_curso_anual_profe_idx` (`id_profesor`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; -- -- Volcado de datos para la tabla `curso_anual` -- INSERT INTO `curso_anual` (`id_curso_anual`, `nombre_curso_anual`, `fecha_curso_anual`, `profesor_jefe`, `id_curso`, `id_especialidad`, `id_profesor`, `letra_curso`, `estado`) VALUES (1, '1° Medio A', 2016, NULL, 1, 1, 6, 'A', 1), (2, '1° Medio B', 2016, NULL, 1, 1, 7, 'B', 1), (3, '2° Medio A', 2016, NULL, 2, 1, 8, 'A', 1), (4, '2° Medio B', 2016, NULL, 2, 1, 9, 'B', 1), (5, '3° Medio A', 2016, NULL, 3, 2, 10, 'A', 1), (6, '3° Medio B', 2016, NULL, 3, 4, 11, 'B', 1), (7, '4° Medio A', 2016, NULL, 4, 2, 12, 'A', 1), (8, '4° Medio B', 2016, NULL, 4, 4, 6, 'B', 1), (9, '1° Medio C', 2016, NULL, 1, 1, 9, 'C', 1), (10, '1° Medio A', 2017, NULL, 1, 5, 6, 'A', 1), (11, '1° Medio B', 2017, NULL, 1, 1, 10, 'B', 1), (12, '2° Medio A', 2017, NULL, 2, 1, 10, 'A', 1), (13, '2° Medio B', 2017, NULL, 2, 1, 9, 'B', 1), (14, '3° Medio A', 2017, NULL, 3, 1, 8, 'A', 1), (15, '3° Medio B', 2017, NULL, 3, 1, 9, 'B', 1), (16, '4° Medio A', 2017, NULL, 4, 1, 9, 'A', 1), (17, '4° Medio B', 2017, NULL, 4, 1, 9, 'B', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_asignatura` -- CREATE TABLE IF NOT EXISTS `detalle_asignatura` ( `id_detalle_asignatura` int(11) NOT NULL AUTO_INCREMENT, `id_curso` int(11) DEFAULT NULL, `id_asignatura` int(11) DEFAULT NULL, `horas_asignatura` int(11) DEFAULT NULL, PRIMARY KEY (`id_detalle_asignatura`), KEY `fk_detalleasig_curso_idx` (`id_curso`), KEY `fk_detalleasig_asignatura_idx` (`id_asignatura`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=82 ; -- -- Volcado de datos para la tabla `detalle_asignatura` -- INSERT INTO `detalle_asignatura` (`id_detalle_asignatura`, `id_curso`, `id_asignatura`, `horas_asignatura`) VALUES (17, 2, 10, 8), (18, 3, 10, 12), (32, 1, 9, 2), (33, 2, 9, 2), (42, 1, 4, 2), (43, 2, 4, 2), (44, 1, 6, 2), (45, 2, 6, 2), (46, 1, 5, 2), (47, 2, 5, 2), (52, 1, 8, 2), (53, 2, 8, 2), (62, 1, 2, 0), (63, 2, 2, 4), (64, 3, 2, 4), (65, 4, 2, 4), (68, 1, 1, 4), (69, 2, 1, 4), (70, 3, 1, 4), (71, 4, 1, 4), (72, 1, 3, 4), (73, 2, 3, 4), (74, 3, 3, 2), (75, 4, 3, 2), (76, 1, 7, 2), (77, 2, 7, 2), (78, 3, 7, 2), (79, 4, 7, 2), (80, 1, 11, 2), (81, 2, 11, 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_carro` -- CREATE TABLE IF NOT EXISTS `detalle_carro` ( `id_detalle_carro` int(11) NOT NULL AUTO_INCREMENT, `id_carro` int(11) DEFAULT NULL, `id_implemento` int(11) DEFAULT NULL, `neto` int(11) DEFAULT NULL, `cantidad` int(11) DEFAULT NULL, PRIMARY KEY (`id_detalle_carro`), KEY `fk_detalle_carro_idx` (`id_carro`), KEY `fk_detalle_implemento_idx` (`id_implemento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=93 ; -- -- Volcado de datos para la tabla `detalle_carro` -- INSERT INTO `detalle_carro` (`id_detalle_carro`, `id_carro`, `id_implemento`, `neto`, `cantidad`) VALUES (34, 1, 1, 25000, 4), (35, 1, 2, 5000, 1), (36, 1, 6, 8000, 1), (37, 2, 1, 25000, 1), (38, 3, 3, 6500, 1), (39, 3, 4, 3000, 1), (40, 4, 2, 5000, 1), (41, 4, 3, 6500, 1), (42, 5, 1, 25000, 1), (43, 6, 1, 25000, 1), (44, 7, 1, 25000, 1), (45, 8, 1, 25000, 1), (46, 9, 1, 25000, 1), (47, 10, 1, 25000, 1), (48, 11, 1, 25000, 1), (49, 12, 1, 25000, 1), (50, 13, 1, 25000, 1), (51, 14, 1, 25000, 1), (52, 15, 2, 5000, 1), (53, 16, 3, 6500, 1), (54, 17, 3, 6500, 1), (55, 18, 4, 3000, 1), (56, 19, 4, 3000, 1), (57, 20, 1, 25000, 1), (58, 21, 2, 5000, 1), (59, 22, 3, 6500, 1), (60, 23, 4, 3000, 1), (61, 24, 4, 3000, 1), (62, 25, 4, 3000, 1), (63, 26, 4, 3000, 1), (64, 27, 4, 3000, 1), (65, 28, 4, 3000, 1), (66, 29, 3, 6500, 1), (67, 30, 4, 3000, 1), (68, 31, 4, 3000, 1), (69, 32, 4, 3000, 1), (70, 33, 4, 3000, 1), (71, 34, 4, 3000, 1), (72, 35, 4, 3000, 1), (73, 36, 6, 8000, 1), (74, 37, 6, 8000, 1), (75, 38, 5, 8000, 1), (76, 38, 3, 6500, 1), (77, 39, 4, 3000, 1), (78, 40, 4, 3000, 1), (79, 41, 3, 6500, 1), (80, 42, 4, 3000, 1), (81, 43, 3, 6500, 1), (82, 44, 1, 25000, 1), (83, 45, 2, 5000, 1), (84, 46, 6, 8000, 1), (85, 46, 2, 5000, 2), (86, 47, 1, 25000, 2), (87, 46, 1, 25000, 6), (88, 48, 1, 25000, 1), (89, 49, 1, 25000, 1), (90, 49, 3, 6500, 1), (91, 49, 4, 3000, 1), (92, 50, 6, 8000, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_curso_anual` -- CREATE TABLE IF NOT EXISTS `detalle_curso_anual` ( `id_detalle_curso_anual` int(11) NOT NULL AUTO_INCREMENT, `id_asignatura` int(11) DEFAULT NULL, `id_curso_anual` int(11) DEFAULT NULL, `id_profesor` int(11) DEFAULT NULL, PRIMARY KEY (`id_detalle_curso_anual`), KEY `fk_detalle_curso_asignatura_idx` (`id_asignatura`), KEY `fk_detalle_curso_curso_anual_idx` (`id_curso_anual`), KEY `fk_detalle_curso_profesor_idx` (`id_profesor`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=303 ; -- -- Volcado de datos para la tabla `detalle_curso_anual` -- INSERT INTO `detalle_curso_anual` (`id_detalle_curso_anual`, `id_asignatura`, `id_curso_anual`, `id_profesor`) VALUES (123, 1, 37, NULL), (124, 9, 37, NULL), (125, 4, 37, NULL), (126, 6, 37, NULL), (127, 5, 37, NULL), (128, 7, 37, NULL), (129, 8, 37, NULL), (130, 3, 37, NULL), (131, 2, 37, NULL), (132, 11, 37, NULL), (133, 10, 38, NULL), (134, 1, 38, NULL), (135, 9, 38, NULL), (136, 4, 38, NULL), (137, 6, 38, NULL), (138, 5, 38, NULL), (139, 7, 38, NULL), (140, 8, 38, NULL), (141, 3, 38, NULL), (142, 2, 38, NULL), (143, 11, 38, NULL), (144, 10, 39, NULL), (145, 1, 39, 7), (146, 7, 39, NULL), (147, 3, 39, NULL), (148, 2, 39, 6), (149, 1, 40, NULL), (150, 7, 40, NULL), (151, 3, 40, NULL), (152, 2, 40, NULL), (153, 9, 49, NULL), (154, 6, 49, NULL), (155, 3, 49, NULL), (156, 8, 49, NULL), (157, 5, 49, NULL), (158, 2, 49, 6), (159, 11, 49, NULL), (160, 7, 49, NULL), (161, 4, 49, NULL), (162, 1, 49, 7), (163, 11, 50, NULL), (164, 7, 50, NULL), (165, 4, 50, NULL), (166, 1, 50, NULL), (167, 9, 50, NULL), (168, 6, 50, NULL), (169, 3, 50, NULL), (170, 8, 50, NULL), (171, 5, 50, NULL), (172, 2, 50, NULL), (173, 3, 51, NULL), (174, 2, 51, NULL), (175, 7, 51, NULL), (176, 1, 51, NULL), (177, 2, 52, NULL), (178, 7, 52, NULL), (179, 1, 52, NULL), (180, 3, 52, NULL), (181, 1, 1, 7), (182, 2, 1, 13), (183, 3, 1, 11), (184, 4, 1, 14), (185, 5, 1, NULL), (186, 6, 1, 13), (187, 7, 1, NULL), (188, 8, 1, 8), (189, 9, 1, 10), (190, 11, 1, 9), (191, 1, 2, 7), (192, 2, 2, 13), (193, 3, 2, 11), (194, 4, 2, 14), (195, 5, 2, NULL), (196, 6, 2, 13), (197, 7, 2, NULL), (198, 8, 2, 8), (199, 9, 2, 10), (200, 11, 2, 9), (201, 1, 3, 7), (202, 2, 3, NULL), (203, 3, 3, 11), (204, 4, 3, 14), (205, 5, 3, NULL), (206, 6, 3, 12), (207, 7, 3, NULL), (208, 8, 3, 8), (209, 9, 3, 10), (210, 11, 3, 9), (211, 1, 4, 7), (212, 2, 4, 6), (213, 3, 4, 11), (214, 4, 4, 14), (215, 5, 4, NULL), (216, 6, 4, 12), (217, 7, 4, NULL), (218, 8, 4, 8), (219, 9, 4, 10), (220, 11, 4, 9), (221, 1, 5, 7), (222, 2, 5, 6), (223, 3, 5, 11), (224, 7, 5, NULL), (225, 1, 6, 7), (226, 2, 6, 6), (227, 3, 6, 11), (228, 7, 6, NULL), (229, 1, 7, 7), (230, 2, 7, 6), (231, 3, 7, 11), (232, 7, 7, NULL), (233, 1, 8, 7), (234, 2, 8, 6), (235, 3, 8, 11), (236, 7, 8, NULL), (237, 4, 9, 14), (238, 9, 9, 10), (239, 3, 9, 11), (240, 2, 9, NULL), (241, 5, 9, NULL), (242, 1, 9, NULL), (243, 11, 9, NULL), (244, 6, 9, NULL), (245, 8, 9, NULL), (246, 7, 9, NULL), (247, 1, 10, 7), (248, 6, 10, 13), (249, 5, 11, NULL), (250, 11, 10, NULL), (251, 3, 11, NULL), (252, 9, 11, NULL), (253, 2, 10, NULL), (254, 7, 11, NULL), (255, 5, 10, NULL), (256, 4, 11, NULL), (257, 3, 10, NULL), (258, 9, 10, NULL), (259, 8, 11, NULL), (260, 7, 10, NULL), (261, 1, 11, NULL), (262, 6, 11, NULL), (263, 4, 10, NULL), (264, 11, 11, NULL), (265, 8, 10, NULL), (266, 2, 11, NULL), (267, 4, 12, NULL), (268, 11, 13, NULL), (269, 8, 12, NULL), (270, 2, 13, NULL), (271, 1, 12, NULL), (272, 6, 12, NULL), (273, 5, 13, NULL), (274, 11, 12, NULL), (275, 3, 13, NULL), (276, 9, 13, NULL), (277, 2, 12, NULL), (278, 7, 13, NULL), (279, 5, 12, NULL), (280, 4, 13, NULL), (281, 3, 12, NULL), (282, 9, 12, NULL), (283, 8, 13, NULL), (284, 7, 12, NULL), (285, 1, 13, NULL), (286, 6, 13, NULL), (287, 3, 14, NULL), (288, 7, 14, NULL), (289, 1, 15, NULL), (290, 2, 15, NULL), (291, 1, 14, NULL), (292, 3, 15, NULL), (293, 2, 14, NULL), (294, 7, 15, NULL), (295, 3, 17, NULL), (296, 2, 16, NULL), (297, 7, 17, NULL), (298, 3, 16, NULL), (299, 7, 16, NULL), (300, 1, 17, NULL), (301, 2, 17, NULL), (302, 1, 16, NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_implemento` -- CREATE TABLE IF NOT EXISTS `detalle_implemento` ( `id_detalle_implemento` int(11) NOT NULL AUTO_INCREMENT, `talla` varchar(45) DEFAULT NULL, `id_implemento` int(11) DEFAULT NULL, `ruta_imagen_2` varchar(45) DEFAULT NULL, `ruta_imagen_3` varchar(45) DEFAULT NULL, `descripcion_detalle` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id_detalle_implemento`), KEY `fk_detalle_implemento_idx` (`id_implemento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Volcado de datos para la tabla `detalle_implemento` -- INSERT INTO `detalle_implemento` (`id_detalle_implemento`, `talla`, `id_implemento`, `ruta_imagen_2`, `ruta_imagen_3`, `descripcion_detalle`) VALUES (1, 'XS, S, M, L, XL y XXL', 2, '20160906225245.png', '20160906225258.png', '<div><span style="color: inherit;">&lt;h1&gt;Soy un H1&lt;/h1&gt;</span></div><span style="background-color: rgb(255, 0, 0);">aaa</span> <span style="font-weight: bold;">sdfsdf &nbsp;</span><span style="font-style: italic;">sdfsd</span><div><span style="font-style: italic;"><br></span></div><div><span style="font-style: italic;"><table class="table table-bordered"><tbody><tr><td>sdf</td><td>sdf</td><td>sdf</td></tr><tr><td>sdf</td><td>sdf</td><td>sdf</td></tr></tbody></table><br></span></div>'), (2, 'S', 1, '20160906225355.png', '20160906225406.png', 'Descripción'), (3, 'S', 3, '20160906230905.png', '20160906230157.png', 'test'), (4, 'Pequeña', 4, '20160906225753.png', '20160906225806.png', NULL), (5, NULL, 5, '20160906225723.png', '20160906225734.png', NULL), (6, NULL, 6, '20160906230219.png', '20160906230232.png', NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_orden` -- CREATE TABLE IF NOT EXISTS `detalle_orden` ( `id_detalle_orden` int(11) NOT NULL AUTO_INCREMENT, `id_orden` int(11) DEFAULT NULL, `id_material` int(11) DEFAULT NULL, `cantidad_material` int(11) DEFAULT NULL, `observacion` varchar(300) DEFAULT NULL, `proveedor_1` int(11) DEFAULT '0', `proveedor_2` int(11) DEFAULT '0', `proveedor_3` int(11) DEFAULT '0', `proveedor_4` int(11) DEFAULT '0', `proveedor_5` int(11) DEFAULT '0', `proveedor_seleccion` int(11) DEFAULT NULL, `proveedor_mostrar` varchar(45) DEFAULT NULL, `valor_menor` int(11) DEFAULT NULL, PRIMARY KEY (`id_detalle_orden`), KEY `fk_detalle_orden_idx` (`id_orden`), KEY `fk_detalle_material_idx` (`id_material`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=57 ; -- -- Volcado de datos para la tabla `detalle_orden` -- INSERT INTO `detalle_orden` (`id_detalle_orden`, `id_orden`, `id_material`, `cantidad_material`, `observacion`, `proveedor_1`, `proveedor_2`, `proveedor_3`, `proveedor_4`, `proveedor_5`, `proveedor_seleccion`, `proveedor_mostrar`, `valor_menor`) VALUES (7, 0, 1, 2, 'hgfdsa', 0, 0, 0, 0, 0, NULL, NULL, NULL), (8, 0, 2, 2, 'hgf', 0, 0, 0, 0, 0, NULL, NULL, NULL), (9, 0, 2, 2, 'sedgh', 0, 0, 0, 0, 0, NULL, NULL, NULL), (10, 0, 3, 2, 'sdfb', NULL, NULL, NULL, 0, 0, NULL, NULL, NULL), (11, 0, 2, 2, 'sedgh', 0, NULL, NULL, 0, 0, NULL, NULL, NULL), (12, 0, 3, 2, 'sdfb', 0, NULL, NULL, 0, 0, NULL, NULL, NULL), (13, 0, 2, 2, 'sedgh', 0, NULL, NULL, 0, 0, NULL, NULL, NULL), (14, 0, 3, 2, 'sdfb', 0, NULL, NULL, 0, 0, NULL, NULL, NULL), (15, 0, 1, 0, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL), (31, 1, 2, 2, 'test', 1200, 1300, 1320, 0, 0, NULL, NULL, NULL), (32, 1, 4, 3, 'test', 2300, 1800, 1300, 0, 0, NULL, NULL, NULL), (33, 2, 5, 1, 'Test', 30000, 28900, 45000, 32000, 0, NULL, NULL, NULL), (34, 2, 2, 3, 'Test', 1600, 1400, 1000, 2300, 0, NULL, NULL, NULL), (35, 2, 1, 5, 'Test', 800, 900, 890, 1200, 0, NULL, NULL, NULL), (36, 2, 3, 3, 'Test', 1300, 1500, 1800, 1000, 0, NULL, NULL, NULL), (37, 2, 4, 2, 'Test', 2100, 2300, 1800, 1990, 0, NULL, NULL, NULL), (38, 3, 2, 3, NULL, 400, 500, 0, 0, 0, NULL, NULL, NULL), (39, 3, 3, 3, NULL, 800, 1200, 0, 0, 0, NULL, NULL, NULL), (40, 4, 2, 2, 'hola soy una observaciónb', 1000, 800, 900, 1200, 0, NULL, NULL, NULL), (41, 5, 5, 4, NULL, 32000, 28700, 46700, 0, 0, NULL, NULL, NULL), (42, 5, 19, 2, NULL, 1200, 1300, 1300, 0, 0, NULL, NULL, NULL), (43, 5, 20, 2, NULL, 900, 1000, 800, 0, 0, NULL, NULL, NULL), (44, 5, 22, 7, NULL, 100, 200, 500, 0, 0, NULL, NULL, NULL), (45, 5, 17, 7, NULL, 3200, 4000, 4300, 0, 0, NULL, NULL, NULL), (46, 5, 10, 3, NULL, 9000, 12000, 6400, 0, 0, NULL, NULL, NULL), (47, 5, 13, 2, NULL, 4000, 7000, 5000, 0, 0, NULL, NULL, NULL), (48, 6, 2, 1, NULL, 1000, 1200, 0, 0, 0, NULL, NULL, NULL), (49, 7, 9, 6, NULL, 1500, 1700, 0, 0, 0, NULL, NULL, NULL), (50, 8, 3, 0, 'cv', 500, 320, 550, 0, 0, NULL, NULL, NULL), (51, 9, 3, 1, NULL, 500, 600, 0, 0, 0, NULL, NULL, NULL), (52, 10, 5, 1, NULL, 500, 5000, 0, 0, 0, NULL, NULL, NULL), (53, 11, 5, 3, NULL, 11333, 23423, 34234, 0, 0, NULL, NULL, NULL), (54, 11, 4, 2, NULL, 424323, 2344230, 342342, 0, 0, NULL, NULL, NULL), (55, 11, 8, 3, NULL, 4234, 2340, 234, 0, 0, NULL, NULL, NULL), (56, 11, 3, 2, NULL, 234234, 234, 34234, 0, 0, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_proveedores` -- CREATE TABLE IF NOT EXISTS `detalle_proveedores` ( `id_detalle_proveedores` int(11) NOT NULL AUTO_INCREMENT, `id_proveedor_material` int(11) DEFAULT NULL, `id_orden_material` int(11) DEFAULT NULL, PRIMARY KEY (`id_detalle_proveedores`), KEY `fk_detalle_p_orden_idx` (`id_orden_material`), KEY `fk_detalle_p_proveedor_idx` (`id_proveedor_material`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=106 ; -- -- Volcado de datos para la tabla `detalle_proveedores` -- INSERT INTO `detalle_proveedores` (`id_detalle_proveedores`, `id_proveedor_material`, `id_orden_material`) VALUES (60, 2, 1), (61, 5, 1), (62, 6, 1), (71, 2, 2), (72, 5, 2), (73, 6, 2), (74, 7, 2), (75, 2, 4), (76, 5, 4), (77, 6, 4), (78, 7, 4), (81, 2, 3), (82, 5, 3), (89, 2, 5), (90, 5, 5), (91, 6, 5), (92, 2, 6), (93, 5, 6), (94, 2, 7), (95, 5, 7), (96, 2, 8), (97, 5, 8), (98, 6, 8), (99, 2, 9), (100, 5, 9), (101, 2, 10), (102, 5, 10), (103, 2, 11), (104, 5, 11), (105, 6, 11); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `especialidad` -- CREATE TABLE IF NOT EXISTS `especialidad` ( `id_especialidad` int(11) NOT NULL AUTO_INCREMENT, `nombre_especialidad` varchar(45) NOT NULL, PRIMARY KEY (`id_especialidad`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Volcado de datos para la tabla `especialidad` -- INSERT INTO `especialidad` (`id_especialidad`, `nombre_especialidad`) VALUES (1, 'Plan General'), (2, 'Electricidad'), (3, 'Mecáníca Automotiz'), (4, 'Mecánica Industrial'), (5, 'Estructuras Metálicas'), (6, 'Terminación en Contrucción'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `horario` -- CREATE TABLE IF NOT EXISTS `horario` ( `id_horario` int(11) NOT NULL AUTO_INCREMENT, `id_curso_anual` int(11) DEFAULT NULL, `id_bloque` int(11) DEFAULT NULL, `dia_semana` varchar(45) DEFAULT NULL, `id_profesor` int(11) DEFAULT NULL, `id_asignatura` int(11) DEFAULT NULL, PRIMARY KEY (`id_horario`), KEY `fk_horario_curso_anual_idx` (`id_curso_anual`), KEY `fk_horario_bloque_idx` (`id_bloque`), KEY `fk_horario_profe_idx` (`id_profesor`), KEY `fk_horario_asignatura_idx` (`id_asignatura`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=706 ; -- -- Volcado de datos para la tabla `horario` -- INSERT INTO `horario` (`id_horario`, `id_curso_anual`, `id_bloque`, `dia_semana`, `id_profesor`, `id_asignatura`) VALUES (1, 39, 1, 'lunes', 6, 2), (2, 39, 2, 'lunes', 6, 2), (3, 39, 3, 'lunes', NULL, NULL), (4, 39, 4, 'lunes', NULL, NULL), (5, 39, 5, 'lunes', NULL, NULL), (6, 39, 6, 'lunes', NULL, NULL), (7, 39, 7, 'lunes', NULL, NULL), (8, 39, 8, 'lunes', NULL, NULL), (9, 39, 9, 'lunes', NULL, NULL), (10, 39, 10, 'lunes', NULL, NULL), (11, 39, 1, 'martes', 6, 2), (12, 39, 2, 'martes', 6, 2), (13, 39, 3, 'martes', NULL, NULL), (14, 39, 4, 'martes', NULL, NULL), (15, 39, 5, 'martes', NULL, NULL), (16, 39, 6, 'martes', NULL, NULL), (17, 39, 7, 'martes', NULL, NULL), (18, 39, 8, 'martes', NULL, NULL), (19, 39, 9, 'martes', NULL, NULL), (20, 39, 10, 'martes', NULL, NULL), (21, 39, 1, 'miercoles', NULL, NULL), (22, 39, 2, 'miercoles', NULL, NULL), (23, 39, 3, 'miercoles', NULL, NULL), (24, 39, 4, 'miercoles', NULL, NULL), (25, 39, 5, 'miercoles', NULL, NULL), (26, 39, 6, 'miercoles', NULL, NULL), (27, 39, 7, 'miercoles', NULL, NULL), (28, 39, 8, 'miercoles', NULL, NULL), (29, 39, 9, 'miercoles', NULL, NULL), (30, 39, 10, 'miercoles', NULL, NULL), (31, 39, 1, 'jueves', NULL, NULL), (32, 39, 2, 'jueves', NULL, NULL), (33, 39, 3, 'jueves', NULL, NULL), (34, 39, 4, 'jueves', NULL, NULL), (35, 39, 5, 'jueves', NULL, NULL), (36, 39, 6, 'jueves', NULL, NULL), (37, 39, 7, 'jueves', NULL, NULL), (38, 39, 8, 'jueves', NULL, NULL), (39, 39, 9, 'jueves', 7, 1), (40, 39, 10, 'jueves', 7, 1), (41, 39, 1, 'viernes', NULL, NULL), (42, 39, 2, 'viernes', NULL, NULL), (43, 39, 3, 'viernes', NULL, NULL), (44, 39, 4, 'viernes', NULL, NULL), (45, 39, 5, 'viernes', NULL, NULL), (46, 39, 6, 'viernes', NULL, NULL), (47, 39, 7, 'viernes', NULL, NULL), (48, 39, 8, 'viernes', NULL, NULL), (49, 39, 9, 'viernes', NULL, NULL), (50, 39, 10, 'viernes', NULL, NULL), (51, 39, NULL, 'pendientes', 7, 1), (52, 39, NULL, 'pendientes', 7, 1), (53, 39, NULL, 'pendientes', NULL, NULL), (54, 39, NULL, 'pendientes', NULL, NULL), (55, 39, NULL, 'pendientes', NULL, NULL), (56, 39, NULL, 'pendientes', NULL, NULL), (57, 39, NULL, 'pendientes', NULL, NULL), (58, 39, NULL, 'pendientes', NULL, NULL), (297, 1, 1, 'lunes', 9, 11), (298, 1, 2, 'lunes', 9, 11), (299, 1, 3, 'lunes', 12, 6), (300, 1, 4, 'lunes', 12, 6), (301, 1, 5, 'lunes', NULL, NULL), (302, 1, 6, 'lunes', NULL, NULL), (303, 1, 7, 'lunes', NULL, NULL), (304, 1, 8, 'lunes', NULL, NULL), (305, 1, 9, 'lunes', NULL, NULL), (306, 1, 10, 'lunes', NULL, NULL), (307, 1, 1, 'martes', 14, 4), (308, 1, 2, 'martes', 14, 4), (309, 1, 3, 'martes', NULL, NULL), (310, 1, 4, 'martes', NULL, NULL), (311, 1, 5, 'martes', NULL, NULL), (312, 1, 6, 'martes', NULL, NULL), (313, 1, 7, 'martes', NULL, NULL), (314, 1, 8, 'martes', NULL, NULL), (315, 1, 9, 'martes', 10, 9), (316, 1, 10, 'martes', 10, 9), (317, 1, 1, 'miercoles', 11, 3), (318, 1, 2, 'miercoles', NULL, NULL), (319, 1, 3, 'miercoles', 11, 3), (320, 1, 4, 'miercoles', NULL, NULL), (321, 1, 5, 'miercoles', NULL, NULL), (322, 1, 6, 'miercoles', NULL, NULL), (323, 1, 7, 'miercoles', NULL, NULL), (324, 1, 8, 'miercoles', NULL, NULL), (325, 1, 9, 'miercoles', NULL, NULL), (326, 1, 10, 'miercoles', NULL, NULL), (327, 1, 1, 'jueves', NULL, NULL), (328, 1, 2, 'jueves', NULL, NULL), (329, 1, 3, 'jueves', NULL, NULL), (330, 1, 4, 'jueves', NULL, NULL), (331, 1, 5, 'jueves', NULL, NULL), (332, 1, 6, 'jueves', NULL, NULL), (333, 1, 7, 'jueves', 8, 8), (334, 1, 8, 'jueves', NULL, NULL), (335, 1, 9, 'jueves', 8, 8), (336, 1, 10, 'jueves', NULL, NULL), (337, 1, 1, 'viernes', 7, 1), (338, 1, 2, 'viernes', 7, 1), (339, 1, 3, 'viernes', NULL, NULL), (340, 1, 4, 'viernes', NULL, NULL), (341, 1, 5, 'viernes', NULL, NULL), (342, 1, 6, 'viernes', NULL, NULL), (343, 1, 7, 'viernes', NULL, NULL), (344, 1, 8, 'viernes', NULL, NULL), (345, 1, 9, 'viernes', NULL, NULL), (346, 1, 10, 'viernes', NULL, NULL), (347, 1, NULL, 'pendientes', 7, 1), (348, 1, NULL, 'pendientes', 7, 1), (349, 1, NULL, 'pendientes', NULL, NULL), (350, 1, NULL, 'pendientes', NULL, NULL), (351, 8, 1, 'lunes', 11, 3), (352, 8, 2, 'lunes', 11, 3), (353, 8, 3, 'lunes', 6, 2), (354, 8, 4, 'lunes', NULL, NULL), (355, 8, 5, 'lunes', NULL, NULL), (356, 8, 6, 'lunes', NULL, NULL), (357, 8, 7, 'lunes', NULL, NULL), (358, 8, 8, 'lunes', NULL, NULL), (359, 8, 9, 'lunes', NULL, NULL), (360, 8, 10, 'lunes', NULL, NULL), (361, 8, 1, 'martes', 6, 2), (362, 8, 2, 'martes', NULL, NULL), (363, 8, 3, 'martes', NULL, NULL), (364, 8, 4, 'martes', NULL, NULL), (365, 8, 5, 'martes', NULL, NULL), (366, 8, 6, 'martes', NULL, NULL), (367, 8, 7, 'martes', NULL, NULL), (368, 8, 8, 'martes', NULL, NULL), (369, 8, 9, 'martes', NULL, NULL), (370, 8, 10, 'martes', NULL, NULL), (371, 8, 1, 'miercoles', 6, 2), (372, 8, 2, 'miercoles', 7, 1), (373, 8, 3, 'miercoles', 7, 1), (374, 8, 4, 'miercoles', 6, 2), (375, 8, 5, 'miercoles', NULL, NULL), (376, 8, 6, 'miercoles', NULL, NULL), (377, 8, 7, 'miercoles', NULL, NULL), (378, 8, 8, 'miercoles', NULL, NULL), (379, 8, 9, 'miercoles', NULL, NULL), (380, 8, 10, 'miercoles', NULL, NULL), (381, 8, 1, 'jueves', 7, 1), (382, 8, 2, 'jueves', NULL, NULL), (383, 8, 3, 'jueves', NULL, NULL), (384, 8, 4, 'jueves', NULL, NULL), (385, 8, 5, 'jueves', NULL, NULL), (386, 8, 6, 'jueves', NULL, NULL), (387, 8, 7, 'jueves', NULL, NULL), (388, 8, 8, 'jueves', NULL, NULL), (389, 8, 9, 'jueves', NULL, NULL), (390, 8, 10, 'jueves', NULL, NULL), (391, 8, 1, 'viernes', 7, 1), (392, 8, 2, 'viernes', NULL, NULL), (393, 8, 3, 'viernes', NULL, NULL), (394, 8, 4, 'viernes', NULL, NULL), (395, 8, 5, 'viernes', NULL, NULL), (396, 8, 6, 'viernes', NULL, NULL), (397, 8, 7, 'viernes', NULL, NULL), (398, 8, 8, 'viernes', NULL, NULL), (399, 8, 9, 'viernes', NULL, NULL), (400, 8, 10, 'viernes', NULL, NULL), (401, 8, NULL, 'pendientes', NULL, NULL), (402, 8, NULL, 'pendientes', NULL, NULL), (403, 8, NULL, 'pendientes', NULL, NULL), (404, 8, NULL, 'pendientes', NULL, NULL), (405, 8, NULL, 'pendientes', NULL, NULL), (406, 8, NULL, 'pendientes', NULL, NULL), (407, 8, NULL, 'pendientes', NULL, NULL), (408, 8, NULL, 'pendientes', NULL, NULL), (409, 8, NULL, 'pendientes', NULL, NULL), (410, 8, NULL, 'pendientes', NULL, NULL), (411, 7, 1, 'lunes', 11, 3), (412, 7, 2, 'lunes', 11, 3), (413, 7, 3, 'lunes', 7, 1), (414, 7, 4, 'lunes', NULL, NULL), (415, 7, 5, 'lunes', NULL, NULL), (416, 7, 6, 'lunes', NULL, NULL), (417, 7, 7, 'lunes', NULL, NULL), (418, 7, 8, 'lunes', NULL, NULL), (419, 7, 9, 'lunes', NULL, NULL), (420, 7, 10, 'lunes', NULL, NULL), (421, 7, 1, 'martes', 6, 2), (422, 7, 2, 'martes', 6, 2), (423, 7, 3, 'martes', NULL, NULL), (424, 7, 4, 'martes', NULL, NULL), (425, 7, 5, 'martes', NULL, NULL), (426, 7, 6, 'martes', NULL, NULL), (427, 7, 7, 'martes', NULL, NULL), (428, 7, 8, 'martes', NULL, NULL), (429, 7, 9, 'martes', NULL, NULL), (430, 7, 10, 'martes', NULL, NULL), (431, 7, 1, 'miercoles', 6, 2), (432, 7, 2, 'miercoles', 6, 2), (433, 7, 3, 'miercoles', NULL, NULL), (434, 7, 4, 'miercoles', NULL, NULL), (435, 7, 5, 'miercoles', NULL, NULL), (436, 7, 6, 'miercoles', NULL, NULL), (437, 7, 7, 'miercoles', NULL, NULL), (438, 7, 8, 'miercoles', NULL, NULL), (439, 7, 9, 'miercoles', NULL, NULL), (440, 7, 10, 'miercoles', NULL, NULL), (441, 7, 1, 'jueves', 7, 1), (442, 7, 2, 'jueves', 7, 1), (443, 7, 3, 'jueves', NULL, NULL), (444, 7, 4, 'jueves', NULL, NULL), (445, 7, 5, 'jueves', NULL, NULL), (446, 7, 6, 'jueves', NULL, NULL), (447, 7, 7, 'jueves', NULL, NULL), (448, 7, 8, 'jueves', NULL, NULL), (449, 7, 9, 'jueves', NULL, NULL), (450, 7, 10, 'jueves', NULL, NULL), (451, 7, 1, 'viernes', 7, 1), (452, 7, 2, 'viernes', NULL, NULL), (453, 7, 3, 'viernes', NULL, NULL), (454, 7, 4, 'viernes', NULL, NULL), (455, 7, 5, 'viernes', NULL, NULL), (456, 7, 6, 'viernes', NULL, NULL), (457, 7, 7, 'viernes', NULL, NULL), (458, 7, 8, 'viernes', NULL, NULL), (459, 7, 9, 'viernes', NULL, NULL), (460, 7, 10, 'viernes', NULL, NULL), (461, 7, NULL, 'pendientes', NULL, NULL), (462, 7, NULL, 'pendientes', NULL, NULL), (463, 7, NULL, 'pendientes', NULL, NULL), (464, 7, NULL, 'pendientes', NULL, NULL), (465, 7, NULL, 'pendientes', NULL, NULL), (466, 7, NULL, 'pendientes', NULL, NULL), (467, 7, NULL, 'pendientes', NULL, NULL), (468, 7, NULL, 'pendientes', NULL, NULL), (469, 7, NULL, 'pendientes', NULL, NULL), (470, 7, NULL, 'pendientes', NULL, NULL), (471, 2, 1, 'lunes', 9, 11), (472, 2, 2, 'lunes', 9, 11), (473, 2, 3, 'lunes', NULL, NULL), (474, 2, 4, 'lunes', NULL, NULL), (475, 2, 5, 'lunes', NULL, NULL), (476, 2, 6, 'lunes', NULL, NULL), (477, 2, 7, 'lunes', NULL, NULL), (478, 2, 8, 'lunes', NULL, NULL), (479, 2, 9, 'lunes', NULL, NULL), (480, 2, 10, 'lunes', NULL, NULL), (481, 2, 1, 'martes', 10, 9), (482, 2, 2, 'martes', 10, 9), (483, 2, 3, 'martes', NULL, NULL), (484, 2, 4, 'martes', NULL, NULL), (485, 2, 5, 'martes', NULL, NULL), (486, 2, 6, 'martes', NULL, NULL), (487, 2, 7, 'martes', NULL, NULL), (488, 2, 8, 'martes', NULL, NULL), (489, 2, 9, 'martes', NULL, NULL), (490, 2, 10, 'martes', NULL, NULL), (491, 2, 1, 'miercoles', 13, 6), (492, 2, 2, 'miercoles', 8, 8), (493, 2, 3, 'miercoles', 8, 8), (494, 2, 4, 'miercoles', NULL, NULL), (495, 2, 5, 'miercoles', NULL, NULL), (496, 2, 6, 'miercoles', NULL, NULL), (497, 2, 7, 'miercoles', NULL, NULL), (498, 2, 8, 'miercoles', NULL, NULL), (499, 2, 9, 'miercoles', NULL, NULL), (500, 2, 10, 'miercoles', NULL, NULL), (501, 2, 1, 'jueves', NULL, NULL), (502, 2, 2, 'jueves', NULL, NULL), (503, 2, 3, 'jueves', NULL, NULL), (504, 2, 4, 'jueves', NULL, NULL), (505, 2, 5, 'jueves', NULL, NULL), (506, 2, 6, 'jueves', NULL, NULL), (507, 2, 7, 'jueves', NULL, NULL), (508, 2, 8, 'jueves', NULL, NULL), (509, 2, 9, 'jueves', NULL, NULL), (510, 2, 10, 'jueves', NULL, NULL), (511, 2, 1, 'viernes', NULL, NULL), (512, 2, 2, 'viernes', NULL, NULL), (513, 2, 3, 'viernes', NULL, NULL), (514, 2, 4, 'viernes', NULL, NULL), (515, 2, 5, 'viernes', NULL, NULL), (516, 2, 6, 'viernes', NULL, NULL), (517, 2, 7, 'viernes', NULL, NULL), (518, 2, 8, 'viernes', NULL, NULL), (519, 2, 9, 'viernes', NULL, NULL), (520, 2, 10, 'viernes', NULL, NULL), (521, 2, NULL, 'pendientes', 13, 6), (522, 2, NULL, 'pendientes', 14, 4), (523, 2, NULL, 'pendientes', 14, 4), (524, 2, NULL, 'pendientes', 11, 3), (525, 2, NULL, 'pendientes', 11, 3), (526, 2, NULL, 'pendientes', 11, 3), (527, 2, NULL, 'pendientes', 11, 3), (528, 2, NULL, 'pendientes', 7, 1), (529, 2, NULL, 'pendientes', 7, 1), (530, 2, NULL, 'pendientes', 7, 1), (531, 2, NULL, 'pendientes', 7, 1), (532, 3, 1, 'lunes', 7, 1), (533, 3, 2, 'lunes', NULL, NULL), (534, 3, 3, 'lunes', 7, 1), (535, 3, 4, 'lunes', 10, 9), (536, 3, 5, 'lunes', 9, 11), (537, 3, 6, 'lunes', NULL, NULL), (538, 3, 7, 'lunes', NULL, NULL), (539, 3, 8, 'lunes', NULL, NULL), (540, 3, 9, 'lunes', NULL, NULL), (541, 3, 10, 'lunes', NULL, NULL), (542, 3, 1, 'martes', 11, 3), (543, 3, 2, 'martes', NULL, NULL), (544, 3, 3, 'martes', 7, 1), (545, 3, 4, 'martes', 14, 4), (546, 3, 5, 'martes', 8, 8), (547, 3, 6, 'martes', 11, 3), (548, 3, 7, 'martes', 11, 3), (549, 3, 8, 'martes', NULL, NULL), (550, 3, 9, 'martes', NULL, NULL), (551, 3, 10, 'martes', 8, 8), (552, 3, 1, 'miercoles', NULL, NULL), (553, 3, 2, 'miercoles', 12, 6), (554, 3, 3, 'miercoles', 9, 11), (555, 3, 4, 'miercoles', 7, 1), (556, 3, 5, 'miercoles', 10, 9), (557, 3, 6, 'miercoles', NULL, NULL), (558, 3, 7, 'miercoles', 12, 6), (559, 3, 8, 'miercoles', NULL, NULL), (560, 3, 9, 'miercoles', NULL, NULL), (561, 3, 10, 'miercoles', NULL, NULL), (562, 3, 1, 'jueves', NULL, NULL), (563, 3, 2, 'jueves', NULL, NULL), (564, 3, 3, 'jueves', 14, 4), (565, 3, 4, 'jueves', NULL, NULL), (566, 3, 5, 'jueves', NULL, NULL), (567, 3, 6, 'jueves', 11, 3), (568, 3, 7, 'jueves', NULL, NULL), (569, 3, 8, 'jueves', NULL, NULL), (570, 3, 9, 'jueves', NULL, NULL), (571, 3, 10, 'jueves', NULL, NULL), (572, 3, 1, 'viernes', NULL, NULL), (573, 3, 2, 'viernes', NULL, NULL), (574, 3, 3, 'viernes', NULL, NULL), (575, 3, 4, 'viernes', NULL, NULL), (576, 3, 5, 'viernes', NULL, NULL), (577, 3, 6, 'viernes', NULL, NULL), (578, 3, 7, 'viernes', NULL, NULL), (579, 3, 8, 'viernes', NULL, NULL), (580, 3, 9, 'viernes', NULL, NULL), (581, 3, 10, 'viernes', NULL, NULL), (582, 3, NULL, 'pendientes', NULL, NULL), (583, 3, NULL, 'pendientes', NULL, NULL), (584, 3, NULL, 'pendientes', NULL, NULL), (585, 3, NULL, 'pendientes', NULL, NULL), (586, 3, NULL, 'pendientes', NULL, NULL), (587, 3, NULL, 'pendientes', NULL, NULL), (588, 3, NULL, 'pendientes', NULL, NULL), (589, 3, NULL, 'pendientes', NULL, NULL), (590, 3, NULL, 'pendientes', NULL, NULL), (591, 3, NULL, 'pendientes', NULL, NULL), (592, 9, 1, 'lunes', 11, 3), (593, 9, 2, 'lunes', 11, 3), (594, 9, 3, 'lunes', NULL, NULL), (595, 9, 4, 'lunes', NULL, NULL), (596, 9, 5, 'lunes', NULL, NULL), (597, 9, 6, 'lunes', NULL, NULL), (598, 9, 7, 'lunes', NULL, NULL), (599, 9, 8, 'lunes', NULL, NULL), (600, 9, 9, 'lunes', NULL, NULL), (601, 9, 10, 'lunes', NULL, NULL), (602, 9, 1, 'martes', 11, 3), (603, 9, 2, 'martes', 11, 3), (604, 9, 3, 'martes', NULL, NULL), (605, 9, 4, 'martes', NULL, NULL), (606, 9, 5, 'martes', NULL, NULL), (607, 9, 6, 'martes', NULL, NULL), (608, 9, 7, 'martes', NULL, NULL), (609, 9, 8, 'martes', NULL, NULL), (610, 9, 9, 'martes', NULL, NULL), (611, 9, 10, 'martes', NULL, NULL), (612, 9, 1, 'miercoles', 10, 9), (613, 9, 2, 'miercoles', 10, 9), (614, 9, 3, 'miercoles', NULL, NULL), (615, 9, 4, 'miercoles', NULL, NULL), (616, 9, 5, 'miercoles', NULL, NULL), (617, 9, 6, 'miercoles', NULL, NULL), (618, 9, 7, 'miercoles', NULL, NULL), (619, 9, 8, 'miercoles', NULL, NULL), (620, 9, 9, 'miercoles', NULL, NULL), (621, 9, 10, 'miercoles', NULL, NULL), (622, 9, 1, 'jueves', 14, 4), (623, 9, 2, 'jueves', 14, 4), (624, 9, 3, 'jueves', NULL, NULL), (625, 9, 4, 'jueves', NULL, NULL), (626, 9, 5, 'jueves', NULL, NULL), (627, 9, 6, 'jueves', NULL, NULL), (628, 9, 7, 'jueves', NULL, NULL), (629, 9, 8, 'jueves', NULL, NULL), (630, 9, 9, 'jueves', NULL, NULL), (631, 9, 10, 'jueves', NULL, NULL), (632, 9, 1, 'viernes', NULL, NULL), (633, 9, 2, 'viernes', NULL, NULL), (634, 9, 3, 'viernes', NULL, NULL), (635, 9, 4, 'viernes', NULL, NULL), (636, 9, 5, 'viernes', NULL, NULL), (637, 9, 6, 'viernes', NULL, NULL), (638, 9, 7, 'viernes', NULL, NULL), (639, 9, 8, 'viernes', NULL, NULL), (640, 9, 9, 'viernes', NULL, NULL), (641, 9, 10, 'viernes', NULL, NULL), (642, 9, NULL, 'pendientes', NULL, NULL), (643, 9, NULL, 'pendientes', NULL, NULL), (644, 9, NULL, 'pendientes', NULL, NULL), (645, 9, NULL, 'pendientes', NULL, NULL), (646, 9, NULL, 'pendientes', NULL, NULL), (647, 9, NULL, 'pendientes', NULL, NULL), (648, 9, NULL, 'pendientes', NULL, NULL), (649, 9, NULL, 'pendientes', NULL, NULL), (650, 10, 1, 'lunes', NULL, NULL), (651, 10, 2, 'lunes', 7, 1), (652, 10, 3, 'lunes', 7, 1), (653, 10, 4, 'lunes', NULL, NULL), (654, 10, 5, 'lunes', NULL, NULL), (655, 10, 6, 'lunes', NULL, NULL), (656, 10, 7, 'lunes', NULL, NULL), (657, 10, 8, 'lunes', NULL, NULL), (658, 10, 9, 'lunes', NULL, NULL), (659, 10, 10, 'lunes', NULL, NULL), (660, 10, 1, 'martes', 13, 6), (661, 10, 2, 'martes', 13, 6), (662, 10, 3, 'martes', NULL, NULL), (663, 10, 4, 'martes', NULL, NULL), (664, 10, 5, 'martes', NULL, NULL), (665, 10, 6, 'martes', NULL, NULL), (666, 10, 7, 'martes', NULL, NULL), (667, 10, 8, 'martes', NULL, NULL), (668, 10, 9, 'martes', NULL, NULL), (669, 10, 10, 'martes', NULL, NULL), (670, 10, 1, 'miercoles', NULL, NULL), (671, 10, 2, 'miercoles', NULL, NULL), (672, 10, 3, 'miercoles', NULL, NULL), (673, 10, 4, 'miercoles', NULL, NULL), (674, 10, 5, 'miercoles', NULL, NULL), (675, 10, 6, 'miercoles', NULL, NULL), (676, 10, 7, 'miercoles', NULL, NULL), (677, 10, 8, 'miercoles', NULL, NULL), (678, 10, 9, 'miercoles', NULL, NULL), (679, 10, 10, 'miercoles', NULL, NULL), (680, 10, 1, 'jueves', NULL, NULL), (681, 10, 2, 'jueves', NULL, NULL), (682, 10, 3, 'jueves', NULL, NULL), (683, 10, 4, 'jueves', NULL, NULL), (684, 10, 5, 'jueves', NULL, NULL), (685, 10, 6, 'jueves', NULL, NULL), (686, 10, 7, 'jueves', NULL, NULL), (687, 10, 8, 'jueves', NULL, NULL), (688, 10, 9, 'jueves', NULL, NULL), (689, 10, 10, 'jueves', NULL, NULL), (690, 10, 1, 'viernes', NULL, NULL), (691, 10, 2, 'viernes', NULL, NULL), (692, 10, 3, 'viernes', NULL, NULL), (693, 10, 4, 'viernes', NULL, NULL), (694, 10, 5, 'viernes', 7, 1), (695, 10, 6, 'viernes', NULL, NULL), (696, 10, 7, 'viernes', NULL, NULL), (697, 10, 8, 'viernes', NULL, NULL), (698, 10, 9, 'viernes', NULL, NULL), (699, 10, 10, 'viernes', NULL, NULL), (700, 10, NULL, 'pendientes', 7, 1), (701, 10, NULL, 'pendientes', NULL, NULL), (702, 10, NULL, 'pendientes', NULL, NULL), (703, 10, NULL, 'pendientes', NULL, NULL), (704, 10, NULL, 'pendientes', NULL, NULL), (705, 10, NULL, 'pendientes', NULL, NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `implemento` -- CREATE TABLE IF NOT EXISTS `implemento` ( `id_implemento` int(11) NOT NULL AUTO_INCREMENT, `nombre_implemento` varchar(45) DEFAULT NULL, `descripcion_implemento` varchar(500) DEFAULT NULL, `id_categoria` int(11) DEFAULT NULL, `precio_implemento` int(11) DEFAULT NULL, `ruta_imagen` varchar(100) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', `stock_implemento` int(11) DEFAULT NULL, PRIMARY KEY (`id_implemento`), KEY `fk_implemento_categoria_idx` (`id_categoria`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Volcado de datos para la tabla `implemento` -- INSERT INTO `implemento` (`id_implemento`, `nombre_implemento`, `descripcion_implemento`, `id_categoria`, `precio_implemento`, `ruta_imagen`, `vigencia`, `stock_implemento`) VALUES (1, 'Buzo Deportivo', 'Un pantalón de buzo puede ser muy útil para la etapa de calentamiento o para realizar deporte.', 1, 25000, '20160906224917.png', 1, -8), (2, 'Corbata', 'Banda o cinta adornada con bordados o flecos de oro y plata que se anuda en forma de lazo.', 1, 5000, '20160906225235.png', 1, 14), (3, 'Insignia', 'Una insignia suele ser el emblema de una autoridad específica y generalmente de metal.', 2, 6500, '20160906230858.png', 1, 12), (4, 'Libreta', 'Diseñada especialmente para lograr el mejor dialogo con los educadores de nuestros niños.', 3, 3000, '20160906234051.png', 1, 13), (5, 'Polerón Curso', 'Conjunto deportivo de chaqueta o sudadera, suele ponerse sobre otras prendas.', 1, 8000, '20160906225712.png', 1, 19), (6, 'Polera', 'Prenda de vestir que cubre desde el cuello hasta la cintura, con cuello alto y mangas largas.', 1, 8000, '20160906234124.png', 1, 17); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `info_pago` -- CREATE TABLE IF NOT EXISTS `info_pago` ( `id_info_pago` int(11) NOT NULL AUTO_INCREMENT, `nombre_titular` varchar(45) DEFAULT NULL, `numero_cuenta` varchar(45) DEFAULT NULL, `codigo_cvc` varchar(45) DEFAULT NULL, `fecha_vencimiento` date DEFAULT NULL, `rut_comprador` varchar(45) DEFAULT NULL, `direccion` varchar(100) DEFAULT NULL, `id_carro_compra` int(11) DEFAULT NULL, `fecha_pago` datetime DEFAULT NULL, PRIMARY KEY (`id_info_pago`), KEY `fk_pago_carro_idx` (`id_carro_compra`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=55 ; -- -- Volcado de datos para la tabla `info_pago` -- INSERT INTO `info_pago` (`id_info_pago`, `nombre_titular`, `numero_cuenta`, `codigo_cvc`, `fecha_vencimiento`, `rut_comprador`, `direccion`, `id_carro_compra`, `fecha_pago`) VALUES (1, 'Cristian Canales', '4513680513300401', '123', '2017-02-01', NULL, 'Palmas de Mallorca 1763', 1, '2016-09-15 21:10:00'), (2, 'Cristian Canales', '4513680513300401', '123', '2012-02-01', NULL, 'Palmas de Mallorca 1763', 2, '2016-09-15 21:10:00'), (8, 'Diego San Martín Carvajal', '4513680513300401', '111', '2012-03-01', NULL, 'Villa San Francisco de Rauquen', 3, '2016-09-15 21:10:00'), (9, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 4, '2016-09-15 21:10:00'), (10, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 4, '2016-09-15 21:10:00'), (11, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 4, '2016-09-15 21:10:00'), (12, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 5, '2016-09-15 21:10:00'), (13, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 6, '2016-09-15 21:10:00'), (14, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 7, '2016-09-15 21:10:00'), (15, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 8, '2016-09-15 21:10:00'), (16, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 9, '2016-09-15 21:10:00'), (17, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 10, '2016-09-15 21:10:00'), (18, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 11, '2016-09-15 21:10:00'), (19, NULL, 'PayPal Code', NULL, NULL, NULL, NULL, 12, '2016-09-15 21:10:00'), (20, 'Cristian Canales', '4998471047263826', '111', '2015-02-01', NULL, 'Palmas de Mallorca 1763', 13, '2016-09-15 21:10:00'), (21, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 14, '2016-09-15 21:10:00'), (22, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 15, '2016-09-15 21:10:00'), (23, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 16, '2016-09-15 21:10:00'), (24, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 17, '2016-09-21 00:05:00'), (25, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 18, '2016-09-21 00:20:00'), (26, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 19, '2016-09-21 00:09:00'), (27, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 20, '2016-09-24 04:09:11'), (28, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 21, '2016-09-24 05:09:29'), (29, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 22, '2016-09-24 05:09:55'), (30, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 23, '2016-09-24 05:09:50'), (31, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 24, '2016-09-24 05:09:35'), (32, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 25, '2016-09-24 05:09:31'), (33, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 26, '2016-09-24 05:09:05'), (34, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 27, '2016-09-24 05:09:34'), (35, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 28, '2016-09-24 05:09:14'), (36, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 29, '2016-09-24 05:09:59'), (37, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 30, '2016-09-24 05:09:01'), (38, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 31, '2016-09-24 05:09:17'), (39, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 32, '2016-09-24 05:09:51'), (40, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 33, '2016-09-24 05:09:15'), (41, 'Cristian Canales', '4513680513300401', '100', '2012-03-01', '12111111-1', 'Palmas de Mallorca 1763', 34, '2016-09-24 02:09:29'), (42, 'Cristian Canales', '4513680513300401', '100', '2012-03-01', '12111111-1', 'Palmas de Mallorca 1763', 35, '2016-09-24 03:09:52'), (43, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 36, '2016-09-24 06:09:13'), (44, 'Cristian Canales', '4513680513300401', '100', '2012-03-01', '12111111-1', 'Palmas de Mallorca 1763', 37, '2016-09-24 03:09:22'), (45, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 38, '2016-09-24 12:09:01'), (46, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 39, '2016-09-24 12:09:10'), (47, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 40, '2016-09-24 12:09:42'), (48, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 41, '2016-09-24 12:09:25'), (49, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 42, '2016-09-24 12:09:08'), (50, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 43, '2016-09-24 12:09:12'), (51, NULL, 'PayPal Code', NULL, NULL, '12111111-1', NULL, 44, '2016-09-24 01:09:04'), (52, NULL, 'PayPal Code', NULL, NULL, '000000000', NULL, 47, '2016-12-27 06:12:35'), (53, NULL, 'PayPal Code', NULL, NULL, '000000000', NULL, 48, '2016-12-27 07:12:41'), (54, NULL, 'PayPal Code', NULL, NULL, '174945764', NULL, 46, '2016-12-27 10:12:45'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `libro` -- CREATE TABLE IF NOT EXISTS `libro` ( `id_libro` int(11) NOT NULL AUTO_INCREMENT, `codigo_libro` int(11) DEFAULT NULL, `rango_libro` varchar(45) DEFAULT NULL, `titulo_libro` varchar(100) DEFAULT NULL, `autor_libro` varchar(45) DEFAULT NULL, `editorial_libro` varchar(45) DEFAULT NULL, `estado_libro` varchar(45) DEFAULT NULL, `cantidad` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', `valor_unitario` int(11) DEFAULT NULL, `origen` varchar(45) DEFAULT NULL, `observacion` varchar(100) DEFAULT NULL, `fecha_recepcion` date DEFAULT NULL, PRIMARY KEY (`id_libro`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1303 ; -- -- Volcado de datos para la tabla `libro` -- INSERT INTO `libro` (`id_libro`, `codigo_libro`, `rango_libro`, `titulo_libro`, `autor_libro`, `editorial_libro`, `estado_libro`, `cantidad`, `vigencia`, `valor_unitario`, `origen`, `observacion`, `fecha_recepcion`) VALUES (1, 2109, '2109-2111', 'La ciudad y los perros', 'Mario vargas llosa', 'Winacocha', 'Bueno', 3, 1, 2000, 'R. propios', NULL, NULL), (2, 2112, '2112', 'Antologia de leyendas', 'Alfonso calderon', 'Universitaria', 'Bueno', 0, 1, 2000, 'R. propios', NULL, NULL), (3, 2113, '2113', 'Antologia poetica', 'Hugo montes', 'Santillana', 'Bueno', 0, 1, 2000, 'R. propios', NULL, NULL), (4, 2114, '2114-2127', 'Obra reunida poesia n', 'Oscar castro', 'Andes', 'Bueno', 13, 1, 3000, 'Donacion', NULL, NULL), (5, 2128, '2128-2141', 'Obra reunida poesia n', 'Oscar castro', 'Andes', 'Bueno', 13, 1, 3000, 'Donacion', NULL, NULL), (6, 2141, '2142', 'El teniente 1927-1940', 'Jose luis granese', 'Universidad', 'Bueno', 0, 1, 2000, 'Donacion', NULL, NULL), (7, 2143, '2143-2144', 'Fisica i y ii', 'Resnick', 'Continental', 'Bueno', 2, 1, 7000, 'Donacion', NULL, NULL), (8, 2145, '2145', 'Diccionario tecnico ingles-espa', 'Omega', 'Omega', 'Bueno', 0, 1, 20000, 'Donacion', NULL, NULL), (9, 2146, '2146', 'Diccionario de electronica ingles-espa', 'Omega', 'Omega', 'Bueno', 1, 1, 20000, 'Donacion', NULL, NULL), (10, 2147, '2147', 'Algebra curso de matematica', 'Fco. pros chile', 'No presenta', 'Bueno', 0, 1, 3000, 'Donacion', NULL, NULL), (11, 2148, '2148-2155', 'Escuela del tecnico mecanico', '', 'Lavor', 'Bueno', 8, 1, 10000, 'Donacion', NULL, NULL), (12, 2156, '2156-2157', 'Manual universal de la tecnica mecanica', 'Erik oberg', 'Lavor', 'Bueno', 2, 1, 10000, 'Donacion', NULL, NULL), (13, 2158, '2158', 'Secretos del cosmo', 'Colin a. roman', 'Salvat', 'Bueno', 1, 1, 6000, 'Donacion', NULL, NULL), (14, 2159, '2159', 'El enfemo imaginario', 'Moliere', 'Salvat', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (15, 2160, '2160', 'La busca', 'Pio barroja', 'Salvat', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (16, 2161, '2161-2163', 'Resumen de la historia de chile i-ii-iii', 'Francisco encina', 'Zig-zag', 'Bueno', 3, 1, 15000, 'Donacion', NULL, NULL), (17, 2164, '2164', 'Quien se ha llevado mi queso', 'Spenser johnson', 'Eurano', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (18, 2165, '2165', 'Niebla', 'Miguel unamuno', 'Universitaria', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (19, 2166, '2166', 'Cuentos de amor locura y muerte', 'Horacio quiroga', 'Prosa', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (20, 2167, '2167', 'La vida simplemente', 'Oscar castro', 'Andres bello', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (21, 2168, '2168', 'A orillas del rio piedras me sente y llore', 'Paulo coelo', 'Grijaldo', 'Bueno', 1, 1, 3000, 'Donacion', NULL, NULL), (22, 2169, '2169-2172', 'Tec. prac. para la tec. del automovil', 'Deutsche', 'Gtz', 'Bueno', 4, 1, 30000, 'Donacion', NULL, NULL), (23, 2173, '2173-2178', 'Tec. prac. para la tec. del automovil (solu)', 'Deutsche', 'Gtz', 'Bueno', 6, 1, 30000, 'Donacion', NULL, NULL), (24, 2179, '2179-2190', 'Mat. aplic. para la tec. del automovil', 'Deutsche', 'Gtz', 'Bueno', 12, 1, 30000, 'Donacion', NULL, NULL), (25, 2191, '2191-2193', 'Mat. aplic. para la tec. del automovil', 'Deutsche', 'Gtz', 'Bueno', 3, 1, 3000, 'R. propios', NULL, NULL), (26, 2194, '2194', 'Mat. aplic. para tecnicas mecanicas', 'Deutsche', 'Gtz', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (27, 2195, '2195', 'Conc. basico de matematicas moderno', 'Roberto hernandez', 'Codex', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (28, 2196, '2196', 'La europa del renacimiento', 'Bartolome', 'Anaya', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (29, 2197, '2197', 'La alta edad media', 'Julio valdion', 'Anaya', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (30, 2198, '2198', 'La evaluacion de valores y actitudes', 'Antonio bolivar', 'Anaya', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (31, 2199, '2199', 'Ecogeografia nueva geografia de chile', 'Pilar cereceda', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (32, 2200, '2200-2203', 'Aritmetica teorico-practico', 'Aurelio baldor', 'Centroamerica', 'Bueno', 4, 1, 3000, 'R. propios', NULL, NULL), (33, 2204, '2204-2205', 'Enciclopedia hispanica i y ii', 'Britannica', 'Britannica', 'Bueno', 2, 1, 10000, 'R. propios', NULL, NULL), (34, 2206, '2206-2221', 'Enciclopedia hispanica ', 'Britannica', 'Britannica', 'Bueno', 16, 1, 10000, 'R. propios', NULL, NULL), (35, 2222, '2222-2223', 'La fisica en sus apicaciones', 'Alberto maiztegui', 'Kapelusz', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (36, 2223, '2224', 'Atlas universal', 'Alejandro rios', 'Zig-zag', 'Bueno', 1, 1, 500000, 'R. propios', NULL, NULL), (37, 2225, '2225-2226', 'Atlas geografico militar de chile', 'Igm', 'Igm', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (38, 2227, '2227', 'Don quijote de la mancha iv', 'Miguel de cervantes', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (39, 2228, '2228', 'Atlas univ. de chile regionalizado', '', '', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (40, 2229, '2229-2232', 'Consultor matematico', 'Licenciado l. galdos', 'Cultural ca', 'Bueno', 4, 1, 5000, 'R. propios', NULL, NULL), (41, 2233, '2233-2235', 'Enciclopedia audiovisual-educativa', 'Oceano', 'Oceano', 'Bueno', 3, 1, 6000, 'R. propios', NULL, NULL), (42, 2236, '2236-2238', 'Tecnologia mecanica procesos y materiales', 'R.l. timings', 'Alfaomega', 'Bueno', 3, 1, 3000, 'R. propios', NULL, NULL), (43, 2239, '2239-2240', 'Historia de la literatura chilena i-ii', 'Maximino fernandez', 'Salesiana', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (44, 2241, '2241-2248', 'Historia de la tecnologia 1-5', 'Trevor williams', 'Xxi', 'Bueno', 8, 1, 2000, 'R. propios', NULL, NULL), (45, 2249, '2249-2252', 'El valle y la monta', 'Oscar castro', 'Del pacifico', 'Bueno', 4, 1, 2000, 'R. propios', NULL, NULL), (46, 2253, '2253', 'Diccionario de filosofia', 'Nicola abbagnano', 'Fce', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (47, 2254, '2254', 'Diccionario de la lengua espa', 'Cultura', 'Cultura', 'Bueno', 1, 1, 7000, 'R. propios', NULL, NULL), (48, 2255, '2255', 'Graduado escolar matematico', 'Ceac', 'Ceas', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (49, 2256, '2256', 'Geometria', 'Clemens', 'Addison wesley', 'Bueno', 1, 1, 4000, 'R. propios', NULL, NULL), (50, 2257, '2257', 'Para que no me olvides', 'Marcela serrano', 'Los andes', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (51, 2258, '2258', 'Breve historia de la quimica', 'Isaac asimov', 'Alianza', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (52, 2259, '2259', 'La iglesia de nuestra fe', 'Luis kosters', 'Tomas lj.', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (53, 2260, '2260', 'Ser mujer hoy y ma', 'Neva milicic', 'Sudamericana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (54, 2261, '2261', 'Reivindicacion etica de lasexualidad', 'Tony mifsud', 'San pablo', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (55, 2262, '2262', 'Tecnologia de los metales', 'Deutsche', 'Gtz', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (56, 2263, '2263', 'Las manos sucias', 'Jean paul saltre', 'Losada', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (57, 2264, '2264', 'Ciencias la reproduccion humana', 'Britannica', 'Britannica', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (58, 2265, '2265', 'Ser mujer hoy y ma', 'Neva milicic', 'Sudamericana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (59, 2266, '2266', 'Hungria pintoresca', 'Elemer de miklos', 'Zig- zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (60, 2267, '2267', 'Cuentos chilenos contemporaneos', 'Varios autores', 'Andres bello', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (61, 2268, '2268', 'Monta', 'Olga aguilera', '"o""higgins"', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (62, 2269, '2269', 'La revolucion de la independencia', 'Domingo amunathegui', 'Univ. chile', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (63, 2271, '2271', 'Instalaciones agricolas', 'Luis martinez perez', 'Ca', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (64, 2272, '2272', 'El medico a palos', 'Moliere', 'Edaf', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (65, 2273, '2273', 'El decameron', 'Boccacio', 'Cia. general', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (66, 2274, '2274', 'Al descubrimiento', 'Ierrekohleer', 'Limusa', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (67, 2275, '2275', 'Esbozo biograficos y pasatiempos mat.', 'Mariano matix', 'Marcombo', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (68, 2276, '2276', 'Poesia chilena contemporanea', 'Nain nomes', 'Andres bello', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (69, 2277, '2277', 'Doce cuentos peregrinos', 'G.g.marquez', 'Sudamericana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (70, 2278, '2278', 'Antologia del cuento moderno', 'Cesar ecchi', 'Universitaria', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (71, 2279, '2279', 'Cristo en torremolinos', 'Jose maria ', 'Del pacifico', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (72, 2280, '2280', 'Las migajas de la creacion', 'John lenianh', 'Alianza', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (73, 2281, '2281', 'La novela chilena los mitos degradados', 'Cdomil goic', 'Universitaria', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (74, 2282, '2282', 'Perico trepa por chile', 'Marcela paz', 'Universitaria', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (75, 2283, '2283', 'Quimica para ni', 'Jamice vancleave', 'Limusa', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (76, 2284, '2284', 'Chile 1970-1973', 'Sergio vitar', 'Phd', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (77, 2285, '2285', 'Tecnicas modernas de redaccion', 'Ma. de lourdes', 'Harla', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (78, 2286, '2286', 'Conversaciones con la narrativa chilena', 'Juan andres pi', 'Los andes', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (79, 2287, '2287', 'Historia de la tecnologia', 'Gregor william', 'Xxi', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (80, 2288, '2288', 'La energia en experiencia', 'Williams garcia', 'Aka', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (81, 2289, '2289', 'Por un aprendizaje contructivista', 'Montse benlloch', 'Visor', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (82, 2290, '2290', 'El desarrollo de la tecnologia', 'Fernando alba', 'Cep', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (83, 2291, '2291', 'La revolucion industrial', 'Antonio escudero', 'Anaya', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (84, 2292, '2292', 'Iso 9000', 'Luis felipe sousa', 'Erika', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (85, 2293, '2293', 'Como se comenta un libro literario', 'Fernando lazaro', 'Catedra', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (86, 2294, '2294', 'Tablas de la tecnica del automovil', 'G. hamm', 'Reverte', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (87, 2295, '2295', 'Peque', 'Albrecht timm', 'Guarrama', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (88, 2296, '2296', 'Historia de las tecnicas', 'Plucasse', 'Universitaria', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (89, 2297, '2297-2298', 'Mecanica de taller soldaduras y uniones', 'Cultural', 'Cultural', 'Bueno', 2, 1, 3000, 'R. propios', NULL, NULL), (90, 2299, '2299', 'Mec. de taller materiales metrologia', 'Cultural', 'Cultural', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (91, 2300, '2300', 'Mecanica de taller prensas', 'Cultural ', 'Cultural', 'Bueno', 1, 1, 4000, 'R. propios', NULL, NULL), (92, 2301, '2301-2302', 'Mec. de taller metro. ii,torno y fresadora', 'Cultural', 'Cultural', 'Bueno', 2, 1, 3000, 'R. propios', NULL, NULL), (93, 2303, '2303-2304', 'Mecanica de taller prensa', 'Cultural', 'Cultural', 'Bueno', 2, 1, 3000, 'R. propios', NULL, NULL), (94, 2305, '2305-2307', 'Manual de mantenimiento industrial ii-iv-v', 'Robert rosaler', 'Mcgraw-hill', 'Bueno', 3, 1, 4000, 'R. propios', NULL, NULL), (95, 2308, '2308-2310', 'Manual de soldadura electrca i-ii-iii', 'Massimo vladimiro', 'Ciencia y tecnica', 'Bueno', 3, 1, 3000, 'R. propios', NULL, NULL), (96, 2310, '2311', 'Manual de mecanica industrial solda. y mat.', 'Cultural', 'Cultural', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (97, 2312, '2312-2313', 'Manual de mec. indus. neumatica e hidraulica', 'Cultural', 'Cultural', 'Bueno', 2, 1, 3000, 'R. propios', NULL, NULL), (98, 2314, '2314', 'Man. de mec. indus. automat. y robotica', 'Cultural', 'Cultural', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (99, 2315, '2315', 'Man. de mec. indus. maq. y control numerico', 'Cultural', 'Cultural', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (100, 2316, '2316-2318', 'Resistencia de materiales', 'William nash', 'Mcgraw-hill', 'Bueno', 3, 1, 2000, 'R. propios', NULL, NULL), (101, 2319, '2319-2322', '1015 juegos y formas de jugadas de iniciacion', 'Gerald lasierra', 'Paidotrigo', 'Bueno', 4, 1, 2000, 'R. propios', NULL, NULL), (102, 2323, '2323-2324', 'Nueva guia de la ciencia', 'Isaac aasimo', 'Plaza y james', 'Bueno', 2, 1, 3000, 'R. propios', NULL, NULL), (103, 2325, '2325-2326', 'Ciencia e ingenieria de los materiales', 'William callister', 'Reverte', 'Bueno', 2, 1, 4000, 'R. propios', NULL, NULL), (104, 2327, '2327-2328', 'Nuevo testamento', 'Cristiano', 'Cristiano', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (105, 2329, '2329', 'Curso elemental para el trabajo de los met.', 'Bbf', 'Bbf', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (106, 2330, '2330', 'Hidraulica', 'Bbf', 'Bbf', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (107, 2331, '2331-2333', 'Refrigeracion', 'Juan antonio ramirez', 'Ca', 'Bueno', 3, 1, 4000, 'R. propios', NULL, NULL), (108, 2334, '2334-2336', 'Diccionario de enegia', 'V. daniel hunt', 'Marcomo', 'Bueno', 3, 1, 2000, 'R. propios', NULL, NULL), (109, 2337, '2337-2339', 'Arte rupestre precolombino en el tingui.', 'Victor leon vargas', 'Grafica esconpio', 'Bueno', 3, 1, 2000, 'R. propios', NULL, NULL), (110, 2340, '2340-2341', 'El proyectista de estrc. metalicas i-ii', 'Rnon. nast', 'Paraninfo', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (111, 2342, '2342', 'Manual de soldadura', '', '', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (112, 2343, '2343', 'Manual del industrial', 'Comp. de redact.', '', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (113, 2344, '2344', '101 esquemas de bobinas de corriente de agua', 'Jose ramirez', 'Ca', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (114, 2345, '2345', 'Dinamicas de grupo para la comunicacion', '', '', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (115, 2346, '2346', 'Iniciacion a los deportes de equipo', 'Domingo blazquez', 'Matinez roca', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (116, 2347, '2347', 'Manual del ingeniero mecanico', 'Baumeister', 'Mcgraw- hill', 'Bueno', 1, 1, 4000, 'R. propios', NULL, NULL), (117, 2348, '2348', 'Metrologia geometrica dimensional', 'Roberto galacia', 'Agt', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (118, 2349, '2349', 'Tecnologia moderna vol 14', 'Salvat', 'Salvat', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (119, 2350, '2350', 'Tratado general de soldarura', 'Paul schimpke', 'Gili', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (120, 2351, '2351', 'Psicologia y pedagogia', 'Luria acar', '', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (121, 2352, '2352', 'Formacion de palabras al espa', 'Mevyn ', 'Catedra', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (122, 2353, '2353', 'La escuela y el tecnico mecanico', 'Gerie g.', 'Lavor', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (123, 2354, '2354', 'Tecnologia de los metales', 'Hans appold', 'Reverte', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (124, 2355, '2355', 'Hechos consumados', 'Juan radrigan', 'Lom', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (125, 2356, '2356', 'Los generos literarios sistema e historia', 'Antonio garcia', 'Catedra', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (126, 2357, '2357', 'Tecnicas modernas de redaccion', 'M. de lourdes', 'Hala', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (127, 2358, '2358', 'Ingenieria didacticas en educ.matematicas', 'Michele artigue', 'Iberoamerica', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (128, 2359, '2359', 'Los arboles de oro', 'Ramon carnicer', 'Seix barral', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (129, 2360, '2360', 'Confesiones de escritores', 'Dthe paris review', 'El ateneo', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (130, 2361, '2361', 'El enfonque comunic. de la ens. de la lengua', 'Carlos lomas', 'Pai dos', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (131, 2362, '2362', 'Bodas de sangre ', 'Federico garcia lorca', 'Andres bello', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (132, 2363, '2363', 'El rey lear', 'Wiliam shakespiare', 'Castilia', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (133, 2364, '2364', 'Hombres del sur', 'Manuel rojas', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (134, 2365, '2365', 'Aborig. chilenos ', 'Horacio zapatero', 'Andres bello', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (135, 2366, '2366', 'Crimen y castigos', 'Fedor dostoyevski', 'Bruguera', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (136, 2367, '2367', 'Cien a', 'G.g. marquez', 'Origen', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (137, 2368, '2368', 'Don juan tenorio', 'Jose zorrilla', 'Ercilla', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (138, 2369, '2369', 'El velero en la botella', 'Jorge diaz ', 'Universitaria', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (139, 2370, '2370', 'Manual de la creatividad', 'R. marin', 'Vives', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (140, 2371, '2371', 'Ortog. y redaccion para secretarias', 'Maqueo ', 'Lirmusa', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (141, 2372, '2372', 'Terminos literarios', 'Consuelo garcia', 'Akal', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (142, 2373, '2373', 'La voragine', 'Jose rivera', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (143, 2374, '2374', 'Dinamica de grupo', 'Balduino', 'Andreola', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (144, 2375, '2375', 'Bombas y centrifugas', 'E. carnicer', 'Paraninfo', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (145, 2376, '2376', 'La escuela y el tecnico mecanico', 'I. lana', 'Labor', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (146, 2377, '2377', 'Curso de tec. y construc. mecanicas', 'Orlando', 'Igm', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (147, 2378, '2378', 'El roto', 'Joaquin eduards', 'Universitaria', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (148, 2379, '2379', 'Hijo de ladron', 'Manuel rojas ', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (149, 2380, '2380', 'Torneado', 'J. jacob', 'Tecnica', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (150, 2381, '2381', 'Ajuste', 'J. poblet', 'Tecnica', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (151, 2382, '2382', 'En nuestra tierra huasa del colchagua', 'Victor leon', 'Universitaria', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (152, 2383, '2383', 'Calculo profes para mec. ajusadores', 'Neimann', 'Jbw', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (153, 2384, '2384', 'Estampado y matrizado de metales', 'Montenzon', 'Montenzon', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (154, 2385, '2385', 'Carpinteria y ebanisteria', 'Groneman', 'Mc graw hill', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (155, 2386, '2386', 'Muebles tapizados', 'Mario del fabro', 'Ceac', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (156, 2387, '2387', 'Alambique', 'Grao', 'Grao', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (157, 2388, '2388', 'Lo que todo peque', 'Robet nelson', 'Alfaomega', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (158, 2389, '2389', 'Invitacion a la biologia', 'Panamericana', 'Panamericana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (159, 2390, '2390', 'Cartografia cultural de chile', 'Ocho libros', 'Ocho libros', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (160, 2391, '2391', 'Cezanne', 'Cezanne', 'Cercle', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (161, 2392, '2392', 'Opazo', 'Rodolfo opazo', 'Almagro', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (162, 2393, '2393', '100 gran angular', 'Emilio ortega', 'Cm', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (163, 2394, '2394', 'Manual de pedagogia teatral', 'Veronica garcia ', 'Los andes', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (164, 2395, '2395', 'La generacion del 98', 'Donald chaw', 'Catedra', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (165, 2396, '2396', 'Diccionario de la literatura chilena', 'Efrai n szmulewicz', 'Andres bello', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (166, 2397, '2397', 'Tecnologia de los procesos de soldadura', 'P. t. houlcroft', 'Ceac', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (167, 2398, '2398', 'Recibidores y pasillos', 'Juan decusa', 'Ceac', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (168, 2399, '2399', 'Aritmetica y raciones de algebra', 'Manuel lara', 'San francisco', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (169, 2400, '2400', 'Tecnicas y aprendizaje y estudio', 'Artus nogerol', 'Grau', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (170, 2401, '2401', 'Algebra y trigonometria con geometria', 'Virgilio gonzalez', 'Iberoamerica', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (171, 2402, '2402', 'Historia de las literat. antiguas y modernas', 'Ramon perez', 'Sopena', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (172, 2403, '2403', 'Inventado la empresa del xxi', 'Fernando flores', 'Dolmen', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (173, 2404, '2404', 'Cont. fundamentales de ddhh para la educ.', 'Lorena escalona', 'Andes', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (174, 2405, '2405', 'Los dd.hh. documentos basicos 2', 'Maximo pacheco', 'Juridica de chile', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (175, 2406, '2406', 'Control de riesgo de accidentes mayores', 'Alfaomega', 'Alfaomega', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (176, 2407, '2407', 'Seguridad e higiene de trabajo', 'Jose cortes', 'Alfaomega', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (177, 2408, '2408', 'Oliver twist', 'Charles dickens', 'Ercilla', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (178, 2409, '2409', 'Hamlet', 'W. shakespeare', 'Universitaria', 'Bueno', 1, 1, 1000, 'Rep. n 11', NULL, NULL), (179, 2410, '2410-2411', 'Poemas y antipoemas', 'Nicanor parra', 'Catedra', 'Bueno', 2, 1, 3000, 'Rep. n 48-49', NULL, NULL), (180, 2412, '2412', 'El se', 'Miguel angel asturias', 'Minelium', 'Bueno', 1, 1, 3000, 'Rep. n 73', NULL, NULL), (181, 2413, '2413', 'Cuentos de la selva', 'Horacio quiroga', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 98', NULL, NULL), (182, 2414, '2414', 'Rimas', 'Gustavo adolfo becqeer', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 100', NULL, NULL), (183, 2415, '2415', 'Antologia de un cuento chileno moderno', 'Alfonso calderon', 'Universitaria', 'Bueno', 1, 1, 4000, 'Rep. n 137', NULL, NULL), (184, 2416, '2416', 'Leonardo da vinci', 'Leonardio da vinci', 'Icarito', 'Bueno', 1, 1, 1000, 'Rep. n 232', NULL, NULL), (185, 2417, '2417', 'Cartas filosoficas', 'Voltaire', 'Ercilla', 'Bueno', 1, 1, 2000, 'Rep. n 288', NULL, NULL), (186, 2418, '2418', 'Fisiologia humana', 'Steiner- middleton', 'Universitaria', 'Bueno', 1, 1, 6000, 'Rep. n 296', NULL, NULL), (187, 2419, '2419', 'Antologia', ' gustavo adolfo becker', 'Salvat', 'Bueno', 1, 1, 1000, 'Rep. n 365', NULL, NULL), (188, 2420, '2420', 'Rebelde magnifica ', 'Matilde ladron de gevara', 'Losada', 'Bueno', 1, 1, 5000, 'Rep. n 384', NULL, NULL), (189, 2421, '2421', 'Los mejores sonetos', 'Pablo neruda', 'Andres bello', 'Bueno', 1, 1, 2000, 'Rep. n391', NULL, NULL), (190, 2422, '2422', 'Balmaceda', 'Cecilia garcia', 'Zig-zag', 'Bueno', 1, 1, 2000, 'Rep. n 395', NULL, NULL), (191, 2423, '2423', 'Dialogos escojidos', 'Platon', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep.n 514', NULL, NULL), (192, 2424, '2424-2425', 'Principito', 'A. desaint', 'Colicheuque', 'Bueno', 2, 1, 1000, 'Rep. n 527-528', NULL, NULL), (193, 2426, '2426', 'Hamlet', 'W. shakespeare', 'Salvat', 'Bueno', 1, 1, 4000, 'Rep. n 536', NULL, NULL), (194, 2427, '2427', 'La republica', 'Platon ', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 551', NULL, NULL), (195, 2428, '2428-2430', 'Antologia poetica g. mistral', 'Gabriela mistral', 'Tacora', 'Bueno', 3, 1, 2000, 'Rep. n 738-740', NULL, NULL), (196, 2431, '2431-2433', 'Antologia poetica ', 'Ruben dario', 'Ercilla', 'Bueno', 3, 1, 1000, 'Rep. n 819-821', NULL, NULL), (197, 2433, '2434', 'Abel sanchez', 'Miguel deunamuno', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 851', NULL, NULL), (198, 2435, '2435-2439', 'Don quijote de la mancha 1', 'Miguel de cervantes', 'Ercilla', 'Bueno', 5, 1, 2000, 'Rep. n 909-913', 'test', '2016-12-13'), (199, 2440, '2440-2445', 'Don quijote de la mancha 2', 'Miguel de cervantes', 'Ercilla', 'Bueno', 6, 1, 2000, 'Rep. n 933-938', NULL, NULL), (200, 2446, '2446', 'Don quijote de la mancha iv', 'Miguel de cervantes', 'Ercilla', 'Bueno', 1, 1, 2000, 'Rep. n 988', NULL, NULL), (201, 2447, '2447', 'El lazarillo de tornes', 'Anonimo', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 1040', NULL, NULL), (202, 2448, '2448', 'Niebla', 'Miguel deunamuno', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 1088', NULL, NULL), (203, 2449, '2449-2455', 'Niebla', 'Miguel deunamuno', 'Colicheuque', 'Bueno', 7, 1, 1000, 'Rep. n1091-1097', NULL, NULL), (204, 2456, '2456-2457', 'Poemas (poesia selecta)', 'J. mandriquez', 'Ercilla', 'Bueno', 2, 1, 2000, 'Rep. n 1150-1151', NULL, NULL), (205, 2458, '2458', 'Dibujo tecnico', 'Iven palma', 'Salesiana', 'Bueno', 1, 1, 4000, 'Rep.n 1490', NULL, NULL), (206, 2459, '2459', 'Sobre la educ. cristiana y la ens. de chile', 'Cristiana', 'Cristiana', 'Bueno', 1, 1, 4000, 'Rep. n 1534', NULL, NULL), (207, 2460, '2460', 'El tunel', 'Ernesto sabato', 'No presenta', 'Bueno', 1, 1, 1000, 'Rep. n 1550', NULL, NULL), (208, 2461, '2461-2463', 'Don quijote de la mancha', 'Miguel de cervantes', 'Zig-zag', 'Bueno', 3, 1, 2000, 'Rep. n 1554-1557', NULL, NULL), (209, 2464, '2464-2466', 'Dicc. sinonimos y antonimos', 'Zig-zag', 'Zig-zag', 'Bueno', 3, 1, 1000, 'Rep. n1569-1571', NULL, NULL), (210, 2467, '2467', 'Premios novel de la literatura', 'Victor gutierrez', 'Zig-zag', 'Bueno', 1, 1, 2000, 'Rep. n 1575', NULL, NULL), (211, 2468, '2468', 'Cultura mapuche', '', 'Pionero musical', 'Bueno', 1, 1, 1000, 'Rep. n 1592', NULL, NULL), (212, 2469, '2469', 'Aventura de robinson cruose', 'Daniel defoe', 'Zig-zag', 'Bueno', 1, 1, 1000, 'Rep. n 1597', NULL, NULL), (213, 2470, '2470', 'Algebra ( francisco prochile)', 'Francisco proschle', 'Ceres', 'Bueno', 1, 1, 3000, 'Rep. n 1601', NULL, NULL), (214, 2471, '2471-2472', 'Dicc. espa', 'Zig-zag', 'Zig-zag', 'Bueno', 2, 1, 2000, 'Rep. n1606-1607', NULL, NULL), (215, 2473, '2473', 'Las llaves del reino', 'A. j. cronin', 'Interamericana', 'Bueno', 1, 1, 5000, 'Rep. n 1616', NULL, NULL), (216, 2474, '2474', 'Edipo rey', 'Soclocles', 'Zig-zag', 'Bueno', 1, 1, 1000, 'Rep. n 1617', NULL, NULL), (217, 2475, '2475', 'Algebra (baldor)', 'Francisco proschle', 'Occidente', 'Bueno', 1, 1, 10000, 'Rep. n 1620', NULL, NULL), (218, 2476, '2476', 'Geometria', 'Ximena carre', 'Arrayan', 'Bueno', 1, 1, 15000, 'Rep. n 1621', NULL, NULL), (219, 2477, '2477-2478', 'Biografias escritores espa', '', 'Portada', 'Bueno', 2, 1, 2000, 'Rep. n 1630-1631', NULL, NULL), (220, 2479, '2479-2481', 'Biografias escritores universales', '', '', 'Bueno', 3, 1, 2000, 'Rep. n1643-1645', NULL, NULL), (221, 2482, '2482-2483', 'Grandes escritores universales', 'Mora gladys', 'Colec. apuntes', 'Bueno', 2, 1, 2000, 'Rep. n1656-1657', NULL, NULL), (222, 2484, '2484-2485', 'Edipo rey', 'Sofocles', 'Prosa', 'Bueno', 2, 1, 1000, 'Rep. n1696-1697', NULL, NULL), (223, 2486, '2486-2487', 'Romeo y julieta', 'William shakespeare', 'Colicheuque', 'Bueno', 2, 1, 1000, 'Rep. n1698-99', NULL, NULL), (224, 2488, '2488-2490', 'Historia de la musica', 'Pionero musical', 'Pionero musical', 'Bueno', 3, 1, 1000, 'Rep. n', NULL, NULL), (225, 2491, '2491', 'Algebra moderna tomo i', '', '', 'Bueno', 1, 1, 15000, 'Rep. n 1830', NULL, NULL), (226, 2492, '2492', 'Algebra (fco. prochile)', 'Francisco proschle', 'Occidente', 'Bueno', 1, 1, 3000, 'Rep. n 1838', NULL, NULL), (227, 2493, '2493', 'Dicc. de sinonimos', 'Occidente', 'Occidente', 'Bueno', 1, 1, 2000, 'Rep. n 1927', NULL, NULL), (228, 2494, '2494', 'Dicc. ilustrado de la lengua esp.', 'Zig-zag', 'Zig-zag', 'Bueno', 1, 1, 3000, 'Rep. n 1928', NULL, NULL), (229, 2495, '2495', 'Revista chilena de historia y geografia', 'Raul silva', 'Hs', 'Bueno', 1, 1, 10000, 'Rep. n 1996', NULL, NULL), (230, 2496, '2496', 'Leyendas y episodios nacionales', 'Aurelio diaz', 'Nascimiento', 'Bueno', 1, 1, 5000, 'Rep. n 2003', NULL, NULL), (231, 2497, '2497', 'Arte colonial', 'Enrique melcherts', 'Parera', 'Bueno', 1, 1, 6000, 'Rep. n 2014', NULL, NULL), (232, 2498, '2498', '20 pintores contemporaneos en chile', 'Pionero musical', 'Pionero musical', 'Bueno', 1, 1, 1000, 'Rep. n 2015', NULL, NULL), (233, 2499, '2499', 'De la tierra a la luna', 'Julio verne', 'Sopena', 'Bueno', 1, 1, 1000, 'Rep. n 2037', NULL, NULL), (234, 2500, '2500', 'Poesia prosa', 'Gabriela mistral', 'Pehuen', 'Bueno', 1, 1, 2000, 'Rep. n 2040', NULL, NULL), (235, 2501, '2501', 'Antologia poetica', 'Antonio machado', 'Ercilla', 'Bueno', 1, 1, 1000, 'Rep. n 2041', NULL, NULL), (236, 2502, '2502', 'La remolienda arturo y angel (c. de teatro)', 'Alejandro sieveking', 'Universitaria', 'Bueno', 1, 1, 5000, 'Rep. n 2055', NULL, NULL), (237, 2503, '2503', 'Chile a color', 'Antartica', 'Antartica', 'Bueno', 1, 1, 15000, 'Rep. n', NULL, NULL), (238, 2504, '2504', 'Algebra', 'Francisco proschle', 'Occidente', 'Bueno', 1, 1, 3000, 'Rep. n 2256', NULL, NULL), (239, 2505, '2505-2506', 'Libro jose gregorio argomedo', 'Victor leon', 'Sm', 'Bueno', 2, 1, 5000, 'Rep. n2232-2233', NULL, NULL), (240, 2507, '2507', 'Antologia de vicente huidobro', 'Vicente huidobro ', 'Zig-zag', 'Bueno', 1, 1, 3000, 'Rep. n2236', NULL, NULL), (241, 2508, '2508', 'Antologia fundamental de p. neruda', 'Pablo neruda', 'Pehuen', 'Bueno', 1, 1, 10000, 'Rep. n 2236', NULL, NULL), (242, 2509, '2509', 'Aediente paciencia', 'Antonio skarmeta', 'Sudamericana', 'Bueno', 1, 1, 2000, 'Rep. n 2237', NULL, NULL), (243, 2510, '2510', 'Casa de mu', 'Enrique ibsen', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 2242', NULL, NULL), (244, 2511, '2511', 'El patio', 'Jorge edwards', 'Sudamericana', 'Bueno', 1, 1, 3000, 'Rep. n 2255', NULL, NULL), (245, 2512, '2512', 'El tunel', 'Ernesto sabato', 'No presenta', 'Bueno', 1, 1, 2000, 'Rep. n 2257', NULL, NULL), (246, 2513, '2513', 'Heroes de nuestro tiempo (gandhi)', 'La tercera', 'La tercera', 'Bueno', 1, 1, 1000, 'Rep. n 2266', NULL, NULL), (247, 2514, '2514', 'Heroes de nuestro tiempo (sor teresa de c)', 'La tercera', 'La tercera', 'Bueno', 1, 1, 1000, 'Rep n 2271', NULL, NULL), (248, 2515, '2515', 'Manual de geogreafia de chile', '', '', 'Bueno', 1, 1, 15000, 'Rep. n 2277', NULL, NULL), (249, 2516, '2516', 'Nada menios que todo un hombre', 'Miguel de unamuno', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 2278', NULL, NULL), (250, 2517, '2517-2518', 'Narraciones extraordinarias', 'Edgar allan poe', 'Colicheuque', 'Bueno', 2, 1, 1000, 'Rep. n2279-2280', NULL, NULL), (251, 2519, '2519', 'Observador del cielo', 'Immanuel velikovsky', 'Edivision', 'Bueno', 1, 1, 5000, 'Rep. n 2282', NULL, NULL), (252, 2520, '2520', 'Psicologia', 'John cohen', 'Lavor', 'Bueno', 1, 1, 5000, 'Rep. n 2286', NULL, NULL), (253, 2521, '2521', 'El perfume', 'Patrick suskind', 'Bp', 'Bueno', 1, 1, 2000, 'Rep. n 2300', NULL, NULL), (254, 2522, '2522', 'Historia universal', 'Natalia navarrete', 'Occidente', 'Bueno', 1, 1, 15000, 'Rep. n 2304', NULL, NULL), (255, 2523, '2523', 'La casa de bernano alba', 'Federico garcia lorca', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 2307', NULL, NULL), (256, 2524, '2524', 'La ciudad anterior', 'Gonzalo contreras', 'Pbs', 'Bueno', 1, 1, 3000, 'Rep. n 2308', NULL, NULL), (257, 2525, '2525', 'Nociones elementales de administracion', 'Oscar johansen', 'Universitaria', 'Bueno', 1, 1, 2000, 'Rep. n 2319', NULL, NULL), (258, 2526, '2526', 'Para que no me olvides', 'Marcelaserrano', 'Alfaguara', 'Bueno', 1, 1, 3000, 'Rep. n 2320', NULL, NULL), (259, 2527, '2527', 'Pink floyd', 'Pionero musical', 'Pionero musical', 'Bueno', 1, 1, 1000, 'Rep. n 2323', NULL, NULL), (260, 2528, '2528', 'Papal vuh', 'Anonimo', 'Cgl', 'Bueno', 1, 1, 1000, 'Rep. n 2325', NULL, NULL), (261, 2529, '2529', 'Todos los fuegos el fuego', 'Julio cortazar', 'Edv', 'Bueno', 1, 1, 3000, 'Rep. n 2333', NULL, NULL), (262, 2530, '2530-2531', 'Cien a', 'G.garcia marquez', 'Latinas', 'Bueno', 2, 1, 3000, 'Rep. n2336-2337', NULL, NULL), (263, 2532, '2532', 'Chile a color geiografico', 'Antartica', 'Antartica', 'Bueno', 1, 1, 15000, 'Rep. n 2339', NULL, NULL), (264, 2533, '2533', 'Dicc. sinonimos y antonimos', 'Nauta', 'Nauta', 'Bueno', 1, 1, 1000, 'Rep. n 2340', NULL, NULL), (265, 2534, '2534', 'Enciclopedia visual del universo', 'Ceac', 'Ceac', 'Bueno', 1, 1, 3000, 'Rep. n 2343', NULL, NULL), (266, 2535, '2535', 'El arte de amar', 'E. fromm', 'Paidos', 'Bueno', 1, 1, 2000, 'Rep. n 2345', NULL, NULL), (267, 2536, '2536', 'Gracia y forastero', '', '', 'Bueno', 1, 1, 2000, 'Rep. n 2352', NULL, NULL), (268, 2537, '2537', 'Manual gramatica espa', 'Occidente', 'Occidente', 'Bueno', 1, 1, 2000, 'Rep. n 2358', NULL, NULL), (269, 2538, '2538', 'Romeo y julieta', 'William shakespeare', 'Colicheuque', 'Bueno', 1, 1, 1000, 'Rep. n 2363', NULL, NULL), (270, 2539, '2539', 'Siddharta', 'Hermann hesse', 'P&j', 'Bueno', 1, 1, 2000, 'Rep. n 2364', NULL, NULL), (271, 2540, '2540-2541', 'Dicc. de lalengua espa', 'Occidente', 'Occidente', 'Bueno', 2, 1, 5000, 'Rep. n2368-2369', NULL, NULL), (272, 2542, '2542', 'Fisica recreativa', 'Planeta ', 'Planeta', 'Bueno', 1, 1, 15000, 'Rep. n 2373', NULL, NULL), (273, 2543, '2543', 'Croniica de una muerte enunciada', 'G. garcia marquez', 'Laovejanegra', 'Bueno', 1, 1, 2000, 'Rep. n 2379', NULL, NULL), (274, 2544, '2544', 'Dicc. espa', 'Colicheuque', 'Colicheuque', 'Bueno', 1, 1, 2000, 'Rep. n 2380', NULL, NULL), (275, 2545, '2545', 'Al aleph', 'Jorge l. borges', 'Ercilla', 'Bueno', 1, 1, 2000, 'Rep. n 2381', NULL, NULL), (276, 2546, '2546', 'Dicc. enciclopedico (12 tomos)', 'Salvat', 'Salvat', 'Bueno', 1, 1, 2000, 'Rep. n 2383', NULL, NULL), (277, 2547, '2547', 'Biografias', 'Arte', 'Arte', 'Bueno', 1, 1, 1000, 'Rep. n 2384', NULL, NULL), (278, 2548, '2548', 'Dicc. de la lengua espa', 'Portada', 'Portada', 'Bueno', 1, 1, 2000, 'Rep. n 2411', NULL, NULL), (279, 2549, '2549-2551', 'Diccionario escolar de la lengua espa', 'Occidente', 'Occidente', 'Bueno', 3, 1, 2000, 'Rep. n2415-2417', NULL, NULL), (280, 2552, '2552-2553', 'Lampalabra huevon', 'Cosme portocarrero', 'Lom', 'Bueno', 2, 1, 1000, 'Rep. n2420-2421', NULL, NULL), (281, 2554, '2554-2555', 'Cuentos de urdemales', 'Anonimo', 'Colicheuque', 'Bueno', 2, 1, 2000, 'Rep. n2422-2423', NULL, NULL), (282, 2556, '2556', 'Dicc. tecnico ingles-espa', 'Larousse', 'Larousse', 'Bueno', 1, 1, 2000, 'Rep. n 2425', NULL, NULL), (283, 2557, '2557', 'Algebra', 'Francisco proschle', 'Occidente', 'Bueno', 1, 1, 3000, 'Rep. n 2428', NULL, NULL), (284, 2558, '2558-2559', 'Nociones elementales de administracion', 'Oscar johansen', 'Universitaria', 'Bueno', 2, 1, 2000, 'Rep. n2481-2483', NULL, NULL), (285, 2560, '2560', 'Prometeo encadenado', 'Esquilo', 'Olimpo', 'Bueno', 1, 1, 2000, 'Rep. n 2607', NULL, NULL), (286, 2561, '2561', 'Pantaleon y las visitadoras', 'Mario vargas llosa', 'Alfaguara', 'Bueno', 1, 1, 3000, 'Rep. n 2607', NULL, NULL), (287, 2562, '2562', 'Enciclopedia consulta', 'Godex', 'Godex', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (288, 2563, '2563-2565', 'Historia de la musica 3 tomos', 'Godex', 'Godex', 'Bueno', 3, 1, 4000, 'R. propios', NULL, NULL), (289, 2566, '2566', 'El jugador', 'Fedor dostoieski', 'Salvat', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (290, 2567, '2567', 'Presencia de san fernando', 'Josefina acevedo', 'Hgv', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (291, 2568, '2568', 'Transparencias liricas', 'Varios autores', 'No presenta', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (292, 2569, '2569', 'En la tierra que habito', 'Olga aguilera', 'Gcp', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (293, 2570, '2570', 'Electrones, oidos y mensajes', 'John pierce', 'Universitaria', 'Bueno', 1, 1, 4000, 'R. propios', NULL, NULL), (294, 2571, '2571-2586', 'El tesoro de la juventud', 'Portada', 'Portada', 'Bueno', 16, 1, 3000, 'Donacion', NULL, NULL), (295, 2587, '2587', 'Sonetos e la realidad y sue', 'Olga aguilera', 'Gcp', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (296, 2588, '2588', 'Dos a', 'Julio verne', 'Prosa', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (297, 2589, '2589', 'La tia tula', 'Miguel de unamuno', 'Salvat', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (298, 2590, '2590', 'Lanchas en la bahia', '', '', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (299, 2591, '2591', 'Cuentos de amor de locura y muerte', 'Horacio quiroga', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (300, 2592, '2592', 'Tratado de maquinas motrices', 'W. valera', 'Lgn', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (301, 2593, '2593', 'La ciudad y los perros', 'Mario vargas llosa', 'Ercilla', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (302, 2594, '2594', 'Colmillo blanco', 'Jack london', 'Colicheuque', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (303, 2595, '2595', 'Magisterio y nino', 'Gabriela mistral', 'Andres bello', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (304, 2596, '2596', 'Fisica general', 'Henry perkins', 'Hispanoamericana', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (305, 2597, '2597', 'Narraciones extraordinarias', 'E.a.poe', 'Salvat', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (306, 2598, '2598', 'Werther', 'Goethe', 'Salvat', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (307, 2599, '2599', 'El medico aconseja', 'Jose mascaro', 'Salvat', 'Bueno', 1, 1, 5000, 'Donacion', NULL, NULL), (308, 2600, '2600', 'Matematica apli. para tec. automoviles', 'Gtz', 'Gtz', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (309, 2601, '2601-2602', 'El vaso de leche y los mejores cuentos', 'Manuel rojas', 'Nascimiento', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (310, 2603, '2603', 'Volver al pais de los araucos', 'Raul mandrini', 'Sudamericana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (311, 2604, '2604', 'Autoretrato de chile', 'Nicomedes guzman', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (312, 2605, '2605', 'Formacion del tecnico mecanico', 'Rhein', 'No presenta', 'Bueno', 1, 1, 5000, 'Donacion', NULL, NULL), (313, 2606, '2606', 'Eloy', 'Carlosdroguett', 'Universitaria', 'Bueno', 1, 1, 5000, 'R. propios', NULL, NULL), (314, 2607, '2607', 'Antologia poetica', 'Vicente huidobro', 'Universitaria', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (315, 2608, '2608', 'Los de abajo', 'Mariano azuela', 'Tacora', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (316, 2609, '2609', 'Punta de rieles', 'Manuel rojas', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (317, 2610, '2610', 'Movimientos literarios', 'Gladys mora', 'Lo castillo', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (318, 2611, '2611-2613', 'Grandes escritores universales 1', 'Gladys mora', 'Lo castillo', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (319, 2614, '2614', 'Lkos cuentistas chilenos', 'Raul silva', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (320, 2615, '2615', 'Tecnico mecanico', 'Klingelnberg', 'Lavor', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (321, 2616, '2616', 'Popul uuh', 'Adrian recinos', 'Fce', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (322, 2617, '2617', 'Las doradas manzanas del sol', 'Ray bradbury', 'Minotauro', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (323, 2618, '2618', 'Cuentos 72 quimantu', 'Baldomero lillo', 'Quimaniu', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (324, 2619, '2619', 'La vida es sue', 'Calderon de la barca', 'Sopena', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (325, 2620, '2620', 'El ultimo grumete de la baquedano', 'Enesto langer', 'Lom', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (326, 2621, '2621', 'Los hombrecillos de los cuentos', '', '', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (327, 2622, '2622', 'El extranjero', 'Albert camus', 'Alianza', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (328, 2623, '2623', 'La amortajada', 'Maria luisa bombal', 'Universitaria', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (329, 2624, '2624', 'Martin rivas', 'Alberto blest gana', 'Andres bello', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (330, 2625, '2625', 'Leyendas y episoios nacionales', 'Joaquin diaz', 'Difusion chilena', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (331, 2626, '2626', 'Nieves y glaciares', 'Juan arguelles', 'Akal', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (332, 2627, '2627', 'Historias de las matematicas', 'Gtz', 'Gtz', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (333, 2628, '2628', 'Tec. mecanica practica 2 curso superior', '', '', 'Bueno', 1, 1, 15000, 'Donacion', NULL, NULL), (334, 2629, '2629-2633', 'Calculos prof. para mecan. ajustadores', 'Lowisch-niemann', 'Jb', 'Bueno', 5, 1, 1000, 'Mineduc', NULL, NULL), (335, 2634, '2634-2649', 'Enciclopedias monitor salvat', '', '', 'Bueno', 16, 1, 5000, 'Donacion', NULL, NULL), (336, 2650, '2650-2655', 'Enciclopedia ii guerra mundial', '', '', 'Bueno', 6, 1, 10000, 'Donacion', NULL, NULL), (337, 2656, '2656-2665', 'Enciclopeia del mar', '', '', 'Bueno', 10, 1, 3000, 'Donacion', NULL, NULL), (338, 2666, '2666-2667', 'Poesia religiosa', 'Teresa de jesus', 'Ercilla', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (339, 2668, '2668-2669', 'Cuentos ', 'Anton chejov', 'Ercilla', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (340, 2670, '2670-2672', 'Marianela', 'Benito perez galdos', 'Delfin', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (341, 2672, '2673', 'Los hermanos', 'H.g wells', 'Zig-zag', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (342, 2674, '2674-2676', 'Casa de mu', 'Enrique ibsen', 'Sopena', 'Bueno', 3, 1, 2000, 'R. propios', NULL, NULL), (343, 2677, '2677', 'Desolacion', 'Gabriela mistral', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (344, 2678, '2678', 'Mio cid', 'Anonimo', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (345, 2679, '2679-2684', 'Movimientos literarios', 'Gladys mora', 'Lo castillo', 'Bueno', 6, 1, 1000, 'R. propios', NULL, NULL), (346, 2685, '2685-2688', 'El burlador de sevilla', 'Tirso de molina', 'Ercilla', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (347, 2688, '2689', 'Poesia universal', 'Maria romero', 'Zig-zag', 'Bueno', 1, 1, 3000, 'R. propios', NULL, NULL), (348, 2690, '2690-2695', 'Fuente ovejuna', 'Lope de vega', 'Ercilla', 'Bueno', 6, 1, 1000, 'R. propios', NULL, NULL), (349, 2696, '2696', 'El cantar de roldan', 'Anonimo', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (350, 2697, '2697', 'La vida del buscon llamado do pablos', 'Francisco de quevedo', 'Salvat', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (351, 2698, '2698-2701', 'Lina y su sombra', 'Oscar castro', 'Del pacifico', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (352, 2701, '2702', 'Chilenos en california', 'Enrique bunster', 'Del pacifico', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (353, 2703, '2703-2706', 'La voragine', 'Jose rivera', 'Ercilla', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (354, 2706, '2707', 'Seleccion de fabulas', 'Juan ruiz', 'Santillana', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (355, 2708, '2708-2709', 'Lavida es sue', 'Calderon de la barca', 'Marcos sastre', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (356, 2710, '2710', 'La hoja roja', 'Miguel delibes', 'Salvat', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (357, 2711, '2711', 'La fortuna de los rougon', 'Emilio zola', 'Malaga', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (358, 2712, '2712', 'Cuentos de amor delocura y muerte', 'Horacio quiroga', 'Losada', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (359, 2713, '2713', 'Don seguno sombra', 'Ricardo guiraldes', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (360, 2714, '2714-2716', 'La vida es sue', 'Calderon de la barca', 'Ercilla', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (361, 2717, '2717-2720', 'Platero y yo', 'Juan jimenez', 'Losada', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (362, 2720, '2721', 'Recordando mi vida', 'Rafael cumsille', 'El detallista', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (363, 2722, '2722-2723', 'Pedro paramo', 'Juan rulfo', 'Fce', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (364, 2724, '2724', 'Antologia poetica,do', 'Federico garcia lorca', 'Santillana', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (365, 2725, '2725', 'On panta', 'Mariano latorre', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (366, 2726, '2726', 'Como se cuenta un cuento', 'G.garcia marquez', 'Voluntad', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (367, 2727, '2727-2729', 'La araucana', 'Alonso de ercilla', 'Universitaria', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (368, 2730, '2730-2733', 'El mejor alcalde el rey', 'Lope de vega', 'Universitaria', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (369, 2734, '2734', 'La muerte y la muerte de quincas berro d.', 'Jorge amado', 'Andres bello', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (370, 2735, '2735', 'El reino de este mundo', 'Alejo carpentier', 'Seix barral', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (371, 2736, '2736', 'Diez negritos', 'Agatha christine', 'Molino', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (372, 2737, '2737', 'El tempano de kanasaca', 'Francisco coloane', 'Universitaria', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (373, 2738, '2738', 'Castellano espa', 'Amado alonso', 'Losada', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (374, 2739, '2739', 'Puente en la selva', 'B. traven', 'Cge', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (375, 2740, '2740', 'La odisea', 'Homero', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (376, 2741, '2741', 'Amor el diario de daniel', 'Michel quoist', 'Herder', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (377, 2742, '2742-2743', 'Seleccion de fabulas', 'Juan ruiz', 'Santillana', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (378, 2744, '2744', 'Hijo de ladron', 'Manuel rojas', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (379, 2745, '2745', 'Gran se', 'Eduardo barrios', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (380, 2746, '2746', 'Viaje maravilloso de nils holgersson', 'Selma lagerloff', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (381, 2747, '2747-2748', 'La gitanilla', 'Miguel de cervantes', 'Del pacifico', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (382, 2748, '2749', 'Huasipungo', 'Jorge icaza', 'Losada', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (383, 2750, '2750-2752', 'Comarca de jazmin', 'Oscar castro', 'Del pacifico', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (384, 2753, '2753', 'Marianela', 'Benito perez galdos', 'E-c', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (385, 2754, '2754', 'Biografia de escritores espa', 'Gladys mora', 'Lo castillo', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (386, 2755, '2755', 'Apologia de socrates', 'Platon', 'Renacimiento', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (387, 2756, '2756', 'Don segunda sombra', 'Ricardo guiraldes', 'Andres bello', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (388, 2757, '2757', 'El si de las ni', 'Leandro fernandez', 'Andres bello', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (389, 2758, '2758', 'Tala', 'Gabriela mistral', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (390, 2759, '2759', 'Cabo de hornos', 'Francisco coloane', 'Orbe', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (391, 2760, '2760-2762', 'Poesia selecta', 'Varios autores', 'Ercilla', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (392, 2763, '2763-2766', 'La celestina', 'Fernando de rojas', 'Ercilla', 'Bueno', 4, 1, 1000, 'R. propios', NULL, NULL), (393, 2767, '2767', 'Articulos de costumbres', 'Mariano jose de larra', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (394, 2768, '2768', 'Mejor que el vino', 'Manuel rojas', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (395, 2769, '2769-2770', 'On juan tenorio', 'Jose zorrilla', 'Ercilla', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (396, 2771, '2771-2772', 'Libro de buen amor', 'Juan ruiz', 'Ercilla', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (397, 2773, '2773', 'Desolacion', 'Gabriela mistral', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (398, 2774, '2774', 'Antologia poetica de chilenos', 'Y. pino saavedra', 'No presenta', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (399, 2775, '2775', 'Antologia poetica', 'Varios autores', 'Santillana', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (400, 2776, '2776-2777', 'La perfecta casada', 'Fray luis de leon', 'Ercilla', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (401, 2778, '2778', 'De vivir corpus y otros cuentos', 'Gabriel miro', 'Losada', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (402, 2779, '2779', 'El embajador de cosmos', 'Antonio cardenas', 'Arancibia hnos.', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (403, 2780, '2780', 'Antonio azorin', 'Azorin ', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (404, 2781, '2781', 'Literatura espa', 'Ernesto livacic', 'Em', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (405, 2782, '2782-2783', 'Alsino', 'Pedro prado', 'Andres bello', 'Bueno', 2, 1, 2000, 'R. propios', NULL, NULL), (406, 2784, '2784', 'Monta', 'Voltaire ', 'Cge', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (407, 2785, '2785', 'El romancero', 'Carlos peltzer', 'Marcos sastre', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (408, 2786, '2786', 'Rojo y negro', 'Stendhal', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (409, 2787, '2787', 'El ruise', 'Oscar wilde', 'La nacion', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL); INSERT INTO `libro` (`id_libro`, `codigo_libro`, `rango_libro`, `titulo_libro`, `autor_libro`, `editorial_libro`, `estado_libro`, `cantidad`, `vigencia`, `valor_unitario`, `origen`, `observacion`, `fecha_recepcion`) VALUES (410, 2788, '2788', 'La vida simplemente', 'Oscar castro', 'No presenta', 'Bueno', 1, 1, 2000, 'R. propios', NULL, NULL), (411, 2789, '2789', 'Calculo infinitesimal', 'J. thompson', 'Hispanoamericana', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (412, 2790, '2790-2791', 'Revista chilena de literatura', 'Varios autores', 'Univ.de chile', 'Bueno', 2, 1, 1000, 'R. propios', NULL, NULL), (413, 2792, '2792', 'El hombre que rie', 'Victor hugo', 'Sopena', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (414, 2793, '2793', 'Cronicas marcianas', 'Ray bradbury', 'Minotauro', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (415, 2794, '2794-2818', 'Historia universal', '', '', 'Bueno', 25, 1, 1000, 'R. propios', NULL, NULL), (416, 2819, '2819-2821', 'Cultura de la prehistoria 3 tomos', '', '', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (417, 2822, '2822', 'La guerra y la paz', 'Leon tolstoi', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (418, 2823, '2823', 'Jose miguel balmaceda', 'Cecilia garcia', 'Zig-zag', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (419, 2824, '2824', 'Compendio de historia americana', '', '', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (420, 2825, '2825', 'Historia del pacifico', 'Hendrik willem', 'Ercilla', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (421, 2826, '2826', 'Ensayos', 'Eugenio orrego', 'Univ.de chile', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (422, 2827, '2827', 'La revolucion de 1891', 'Anibal bravo', 'No presenta', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (423, 2828, '2828', 'Historia del ferrocarril', 'Maria piedad alliende', 'Pehuen', 'Bueno', 1, 1, 1000, 'R. propios', NULL, NULL), (424, 2829, '2829', 'Soldadura y materiales i', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (425, 2830, '2830', 'Neumatica e hidraulica ii', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (426, 2831, '2831', 'Automatas y robotica iii', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (427, 2832, '2832', 'Maquinas y control numerico iv', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (428, 2833, '2833', 'Camiones y vehiculos pesados ', 'Gabriel cuesta', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (429, 2834, '2834', 'Guia practica de carpinteria i', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (430, 2835, '2835', 'Guia practica de carpinteria i i', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (431, 2836, '2836', 'Guia practica de carpinteria i i i', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (432, 2837, '2837', 'Guia practica de plomeria i', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (433, 2838, '2838', 'Guia practica de plomeria ii', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (434, 2839, '2839', 'Guia practica de plomeria iii', 'J. c. gil y otros', 'Cultural s.a.', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (435, 2840, '2840', 'Guia practica de electricidad y electronica i', 'Ricardo martin y otros', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (436, 2841, '2841', 'Guia practica de electricidad y electronica ii', 'Ricardo martin y otros', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (437, 2842, '2842', 'Guia practica de electricidad y electronica iii', 'Ricardo martin y otros', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (438, 2843, '2843', 'Manual del automovil electricidad y accesorios', 'D. hermogenes gil', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (439, 2844, '2844', 'Manual del automovil suspension y direccion', 'D. hermogenes gil', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (440, 2845, '2845', 'Manual del automovil el motor diesel ', 'D. hermogenes gil', 'Cultural s.a. ', 'Bueno', 1, 1, 1000, 'Donacion', NULL, NULL), (441, 2846, '2846', 'Manual del automovil el motor de gasolina', 'D. hermogenes gil', 'Cultural s.a. ', 'Bueno', 1, 1, 0, 'Donacion', NULL, NULL), (442, 2847, '2847', 'Historia de la tecnologia i', 'T. k. derry y otros', 'Siglo xxi', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (443, 2848, '2848', 'Historia de la tecnologia ii', 'T. k. derry y otros', 'Siglo xxi', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (444, 2849, '2849', 'Lanchas en la bahia', 'Manuel rojas', 'Zig - zag', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (445, 2850, '2850', 'Casa de mu', 'Enrique ibsen', 'Sopena s.a.', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (446, 2851, '2851', 'El general en su laberinto', 'Garcia marquez', 'Sudamericana', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (447, 2852, '2852', 'El lobo esterpario', 'Hermann hesse', 'Madrid', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (448, 2853, '2853', 'El arbol de judas', 'A. j. cronin', 'Selectas s. r. l.', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (449, 2854, '2854', 'Rese', 'S/a', 'S/e', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (450, 2855, '2855', 'Marianela', 'Benito perez galdos', 'Kapelusz', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (451, 2856, '2856', 'Hamlet', 'W. shakespeare', 'Colicheuque', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (452, 2857, '2857', 'Siddharta', 'Hermann hesse', 'Centro grafico', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (453, 2858, '2858', 'Juvenilla', 'M. cane', 'M. sastre', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (454, 2859, '2859', 'Coronacion', 'Jose donoso', 'Zig - zag', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (455, 2860, '2860', 'La araucana', 'A. de ercilla', 'Universitaria', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (456, 2861, '2861', 'El quijote de la mancha ii', 'M. de cervantes', 'La nacion', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (457, 2862, '2862-2866', 'El milagro de los andes', 'Balocchi y otros', 'America', 'Bueno', 5, 1, 0, 'R. propios', NULL, '2008-03-01'), (458, 2867, '2867', 'Matematicas modernas', 'Dolciani y otros', 'Cultural s.a.', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (459, 2868, '2868', 'Platero y yo', 'Juan ramon jimenez', 'Losada', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (460, 2869, '2869', 'El quijote de la mancha ii', 'M. de cervantes', 'La nacion', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (461, 2870, '2870', 'Bodas de sangre', 'F. garcia lorca', 'L. universal', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (462, 2871, '2871', 'Matematica aplicada para tecnica mecanica', 'D. gesellschaft', 'Gtz', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (463, 2872, '2872-2881', 'Mi tierra huasa', 'E. neiman', 'Los afines', 'Bueno', 10, 1, 0, 'R. propios', NULL, '2008-03-01'), (464, 2882, '2882-2883', 'La vida es sue', 'Calderon de la barca', 'Ercilla', 'Bueno', 2, 1, 0, 'R. propios', NULL, '2008-03-01'), (465, 2884, '2884', 'Quo vadis', 'E. sienkiewicz', 'Antartica', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (466, 2885, '2885', 'Trabajo y salario', 'J. folliet y otros', 'Del atlantico', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (467, 2886, '2886', 'Ventura de pedro de valdivia', 'Jaime eyzaguirre', 'Mineduc', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (468, 2887, '2887', 'De los apeninos a los andes', 'Edumundo de amicis', 'La nacion', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (469, 2888, '2888', 'La gitanilla', 'M. de cervantes', 'La nacion', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (470, 2889, '2889', 'Guia didactica de dibujo tecnico', 'S/a', 'Mineduc', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (471, 2890, '2890', 'El tesoro de sierra madre', 'B. traven', 'L.g.e. mexico', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (472, 2891, '2891', 'El gran teatro del mundo y el medico de su honra', 'Pedro calderon d.c.b.', 'Carabela', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (473, 2892, '2892', 'Almanaque 2008', 'S/a', 'Televisa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2008-04-01'), (474, 2893, '2893', 'Poesia selecta', 'J. manrique y otros', 'Ercilla', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (475, 2894, '2894', 'Poesia selecta', 'Luis de gongora y otro', 'Ercilla', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (476, 2895, '2895', 'Nada puede separarnos', 'Enrique neiman', 'Los afines', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (477, 2896, '2896', 'El pintor valenzuela llanos', 'J. v. badilla', 'Rumbos', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (478, 2897, '2897', 'La vida es sue', 'Calderon de la barca', 'Ercilla', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (479, 2898, '2898', 'Cuentos de pedro urdemales', 'Anonimo', 'Prosa s.a.', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (480, 2899, '2899', 'Por tierra del romance', 'Jose vargas badilla', 'Rumbos', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (481, 2900, '2900', 'La republica', 'Platon', 'Argentina', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (482, 2901, '2901', 'Manual del herrero', 'J.w.lillico', 'Gili', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (483, 2902, '2902', 'Para leer los medios (prensa, radio, cine y tv)', 'G. mitchel', 'Trillas', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (484, 2903, '2903', 'La araucana', 'A de ercilla', 'E. calpe', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (485, 2904, '2904', 'Historia de la blanca', 'L. goldschmied', 'Uteha', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (486, 2905, '2905', 'Comarza de jazmin', 'Oscar castro', 'Del pacifico', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (487, 2906, '2906', 'El libertador', 'Augusto mijares', 'Italgrafica', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (488, 2907, '2907', 'Guia del antiguo y nuevo testamento', 'E. zolli', 'Uteha', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (489, 2908, '2908', 'Aerodinamica 2', 'Ordo', 'Uteha', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (490, 2909, '2909', 'Mineria chilena', 'Cimm', 'Alfabeta', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (491, 2910, '2910', 'Antologia poetica', 'Oscar castro', 'Del pacifico', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (492, 2911, '2911', 'Principios y practica de la ense', 'J. johonnot', 'Apleton y cia', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (493, 2912, '2912', 'Huidobro. la marcha infinita', 'Volodia teitelboin', 'Sudamericana', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (494, 2913, '2913-2914', 'Cuadernos de teatro', 'Alejandro sieveking', 'Mineduc', 'Bueno', 2, 1, 0, 'R. propios', NULL, '2008-03-01'), (495, 2915, '2915', 'La region un enfoque desde el estudio de la geografia', 'Ana errazuriz y otro', 'Jordan s.a. ', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (496, 2916, '2916', 'En busca de mi cielo', 'Olga aguilera', 'G. colchagua', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (497, 2917, '2917', 'Vecindario de estrellas', 'J. vargas badilla', 'G. colchagua', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (498, 2918, '2918', 'Entre romances y sue', 'J. vargas badilla', 'U.c. valparaiso', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (499, 2919, '2919', 'Artes', 'J. olivari y otros', 'N/t', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (500, 2920, '2920', 'Historia del trabajo', 'Francois barnet', 'Universitaria', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (501, 2921, '2921-2923', 'Enciclopedia de la ciencia y la tecnologia i, ii, iii', 'S/n', 'Oceano', 'Bueno', 3, 1, 0, 'R. propios', NULL, '2008-03-01'), (502, 2924, '2924', 'Enciclopedia didactica de fisica y quimica', 'S/n', 'Oceano', 'Bueno', 1, 1, 0, 'Donacion', NULL, '2008-10-10'), (503, 2925, '2925', 'Enciclopedia didactica de gramatica', 'S/n', 'Oceano', 'Bueno', 2, 1, 0, 'Donacion', NULL, '2008-10-10'), (504, 2926, '2926', 'Enciclopedia didactica de matematicas', 'S/n', 'Oceano', 'Bueno', 1, 1, 0, 'Donacion', NULL, '2008-10-10'), (505, 2927, '2927-2931', 'Cuento contigo, i, ii, iii, iv, v', 'L. fontaine y otros', 'Planeta', 'Bueno', 5, 1, 0, 'Donacion', NULL, '2008-10-10'), (506, 2932, '2932-2934', 'Cultura ferroviaria de san fernando y sus ramales', 'Victor leon v. ', 'Geo black', 'Bueno', 3, 1, 0, 'Donacion', NULL, '2008-10-10'), (507, 2935, '2935', 'Grandes figuras de nuestra historia-rebeca matte', 'Ana m. larrain', 'Zig - zag ', 'Bueno', 1, 1, 0, 'Donacion', NULL, '2008-10-10'), (508, 2936, '2936', 'Grandes figuras de nuestra historia-j. m. balmaceda', 'Cecilia garcia g.', 'Zig - zag ', 'Bueno', 1, 1, 0, 'Donacion', NULL, '2008-10-10'), (509, 2937, '2937', 'Grandes figuras de nuestra historia - a. prat', 'Ana m. larrain', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (510, 2938, '2938', 'Grandes figuras de nuestra hstra- manuel rojas', 'Floridor perez', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (511, 2939, '2939', 'Grandes figuras de nuestra hstra- a. alessandri p.', 'Fca. alessandri', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (512, 2940, '2940', 'Grandes figuras de nuestra hstra-manuel rodriguez', 'Ana maria larrain', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (513, 2941, '2941', 'Grandes figuras de nuestra hstra- d. de almagro', 'Juan j. faundez', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (514, 2942, '2942', 'Grandes figuras de nuestra hstra-v. p. rosales', 'Jaime quezada', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (515, 2943, '2943', 'Grandes figuras de nuestra hstra-c. naval de i.', 'Jorge inostroza', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (516, 2944, '2944', 'Grandes figuras de nuestra hstra-c. de la concep. ', 'Jorge inostroza', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (517, 2945, '2945', 'Grandes figuras de nuestra hstra-b.vicu', 'Jaime quezada', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (518, 2946, '2946', 'Grandes figuras de nuestra hstra- pablo neruda', 'Floridor perez', 'Zig - zag ', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (519, 2947, '2947-2948', 'Grandes figuras de nuestra hstra- diego portales', 'Juan j. faundez', 'Zig - zag ', 'Bueno', 2, 1, 2000, 'Donacion', NULL, '2008-10-10'), (520, 2949, '2949', 'Apologia de socrates - platon', 'Platon ', 'Olimpo', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (521, 2950, '2950', 'Profecias de nostradamus', 'H. j. forman', 'Latinoamericano', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (522, 2951, '2951', 'El ruise', 'Oscar wilde', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (523, 2952, '2952', 'El fantasma de canterville', 'Oscar wilde', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (524, 2953, '2953-2955', 'Yu lan, el ni', 'Pear s. buck', 'Zig - zag', 'Bueno', 3, 1, 2000, 'Donacion', NULL, '2008-10-10'), (525, 2956, '2956', 'Los conquistadores de la antartica', 'Francisco coloane', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (526, 2957, '2957', 'El diario de ana frank', 'Ana frank', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (527, 2958, '2958', 'Cuentos de los derechos del ni', 'Saul schkolnik', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (528, 2959, '2959', 'Colmillo blanco', 'Jack london', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (529, 2960, '2960', 'Mac, el microbio desconocido', 'Hernan del solar', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (530, 2961, '2961-2962', 'Encuentro entgre triton y otras obras - teatro para ni', 'Manuel gallegos', 'Zig - zag', 'Bueno', 2, 1, 2000, 'Donacion', NULL, '2008-10-10'), (531, 2963, '2963', 'Cuentos de la selva', 'Horacio quiroga', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (532, 2964, '2964', 'Robinson crusoe', 'Daniel defoe', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (533, 2965, '2965', 'Un dia en la vida de: judith guerrera de la fe', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (534, 2966, '2966', 'Un dia en la vida de: efrain, amigo del ni', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (535, 2967, '2967', 'Un dia en la vida de: amaru, correo inca', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (536, 2968, '2968', 'Un dia en la vida de: arnaldo, caballero cruzado', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (537, 2969, '2969', 'Un dia en la vida de:eramiro, gte. de la esmeralda', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (538, 2970, '2970', 'Un dia en la vida de:s. , buscador de oro en california', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (539, 2971, '2971', 'Un dia en la vida de: juanita, peque', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (540, 2972, '2972', 'Un dia en la vida de: tonko, el alacalufe', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (541, 2973, '2973', 'Un dia en la vida de: makarina, bella de rapa nui', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (542, 2974, '2974', 'Un dia en la vida de: ak, pintor de cuevas', 'Barcells y ana m', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (543, 2975, '2975', '20,000 leguas de viaje submarino', 'Julio verne', 'Prosa s.a.', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (544, 2976, '2976', 'La quintrala', 'Magdalena petit', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (545, 2977, '2977', 'La iliada', 'Homero', 'Ercilla', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (546, 2978, '2978', 'Edipo rey', 'Sofocles', 'Colicheuque', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (547, 2979, '2979', 'Papaito piernas largas', 'J. webster', 'Colicheuque', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (548, 2980, '2980', 'Lautaro, joven libertador de arauco', 'F. alegria', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (549, 2981, '2981', 'Oliver twist', 'Ch. dickens', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (550, 2982, '2982', 'Bodas de sangre romancero gitano ', 'F. garcia lorca', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (551, 2983, '2983', 'Cuento de chile uno', 'Floridor perez', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (552, 2984, '2984', 'Los cuentos de mis hijos', 'Horacio quiroga', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (553, 2985, '2985', 'Palomita blanca', 'E. lafourcade', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (554, 2986, '2986', 'El principe y el mendigo', 'Manuel rojas', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (555, 2987, '2987', 'El hombre de la rosa y otros cuentos', 'Manuel rojas', 'Zig - zag', 'Bueno', 1, 1, 2000, 'Donacion', NULL, '2008-10-10'), (556, 2988, '2988', 'Diccionario enciclopedico ilustrado i a - ch', 'S/a', 'Sopena', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (557, 2989, '2989', 'Diccionario enciclopedico ilustrado ii d - ll', 'S/a', 'Sopena', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (558, 2990, '2990', 'Diccionario enciclopedico ilustrado iii m - r', 'S/a', 'Sopena', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (559, 2991, '2991', 'Diccionario enciclopedico ilustrado iv s- z', 'S/a', 'Sopena', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (560, 2992, '2992', 'Dise', 'Innova', 'Marcombo', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (561, 2993, '2993', 'Manual de instrucciones diccionario real academia', 'Rae', 'Espasa calpe', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (562, 2994, '2994', 'Virus en las computadoras', 'Ferreyra cortes', 'Computec', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (563, 2995, '2995', 'Actualizaciones y reparaciones de pc para inexpertos', ' rathbone', 'Megabyte', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (564, 2996, '2996-2997', 'Aprendamos computacion principios y aplicaciones', 'Roberts y otros', 'Universitaria', 'Bueno', 2, 1, 0, 'R. propios', NULL, '2008-03-01'), (565, 2998, '2998-3000', 'Diccionario de computacion biling', 'Freedman', 'Mc granw hill', 'Bueno', 3, 1, 0, 'R. propios', NULL, '2008-03-01'), (566, 3001, '3001-3002', 'Obtenga resultados con microsoft office 97', 'Mricrosoft', 'Mricrosoft', 'Bueno', 2, 1, 0, 'R. propios', NULL, '2008-03-01'), (567, 3003, '3003', 'Oxford dictionary of computing', 'Pyne y otros', 'Oxford ', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (568, 3004, '3004', 'Windows 95 10', 'Yraolagoitia', 'Paraninfo', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (569, 3005, '3005', 'Dise', 'Garcia arregui', 'Alfaomega', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (570, 3006, '3006', 'Autocad', 'Alconchel', 'Mac graw hill ', 'Bueno', 1, 1, 0, 'R. propios', NULL, '2008-03-01'), (571, 3007, '3007', 'Niebla', 'Miguel de unamuno', 'Olimpo', 'Bueno', 1, 1, 2000, 'R. propios', NULL, '2008-03-01'), (572, 3008, '3008', 'Peque', 'Valenzuela y otros', 'Marmol s.a. ', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (573, 3009, '3009', 'La caba', 'Beecher harriet', 'Ediciones sm', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (574, 3010, '3010', 'El delincuente, el vaso de leche y otros cuentos', 'Rojas manuel', 'Zig- zag', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (575, 3011, '3011', 'Fuerte bulnes chiloe cielos cubiertos', 'Maria a. requena', 'Zig- zag', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (576, 3012, '3012', 'Los cuentos de mi hijos', 'Horacio quiroga', 'Zig- zag', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (577, 3013, '3013', 'Manual explora y acampar', 'Elvio pero', 'Zig- zag', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (578, 3014, '3014', 'La cabeza en la bolsa', 'Marjorie pourchet', 'Salesianos s.a.', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (579, 3015, '3015', 'El ruise', 'Oscar wilde', 'Panamericana', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (580, 3016, '3016', 'El gato negro y otros cuentos de horror', 'Edgar allan poe', 'Instar s.a.', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (581, 3017, '3017', 'La vuelta al mundo en ochenta dias', 'Jules verne', 'Instar s.a. ', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (582, 3018, '3018', 'Los perros rojos - el ankus del rey', 'Rudyard kipling', 'Instar s.a. ', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (583, 3019, '3019', 'Folclor del carbon ', 'Oreste plath', 'Grijalbo', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (584, 3020, '3020', 'Geografia del mito y la leyenda chilenos', 'Oreste plath', 'Grijalbo', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (585, 3021, '3021', 'Pintura chilena contemporanea', 'Isabel aninat', 'Grijalbo', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (586, 3022, '3022', 'Los cien mejores poemas de amor de la lengua castellana', 'Pedro lastra y otros', 'Andres bello', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (587, 3023, '3023', 'Sandokan', 'Emilio salgari', 'Andres bello', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (588, 3024, '3024', 'Demian', 'Hermann hess', 'Ediciones del sur', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (589, 3025, '3025', 'Edipo rey', 'Sofocles', 'Ediciones del sur', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (590, 3026, '3026', 'El fantasma de canterville', 'Oscar wilde', 'Ediciones del sur', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (591, 3027, '3027', 'El lazarrillo de tormes', 'Anonimo', 'Ediciones del sur', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (592, 3028, '3028', 'Metamorfosis', 'Franz kafka', 'Ediciones del sur', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (593, 3029, '3029', 'Humanismo social', 'Alberto hurtado', 'Quebecor s.a.', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (594, 3030, '3030-3034', 'Atlas geografico de chile', 'Igm', 'Igm', 'Bueno', 5, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (595, 3035, '3035', 'Acercandonos al libro album - ver para leer', 'Cra', 'Mineduc', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (596, 3036, '3036', 'Chile sue', 'S. c. palacio moneda', 'Maval s.a. ', 'Bueno', 1, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (597, 3037, '3037', 'Sue', 'Oscar robles', 'O''higgins', 'Bueno', 1, 1, 2000, 'Donacion', NULL, NULL), (598, 3038, '3038-3047', 'Diccionarios ingles books bits', '', 'B&b', 'Bueno', 10, 1, 0, 'R. propios', NULL, '2009-04-14'), (599, 3048, '3048-3052', 'Coleccion cuento contigo tomos i al v', 'C. estudios publicos', 'Planeta', 'Bueno', 5, 1, 2000, 'Mineduc', NULL, '2008-12-13'), (600, 3053, '3053-3072', 'Diccionario espa', '', 'Sopena', 'Bueno', 20, 1, 0, 'R. propios', NULL, '2009-04-21'), (601, 3073, '3073', 'Dibujo tecnico para electrotecnica 1 curso basico cuaderno', 'Deutsche gesellschaft', '', 'Bueno', 1, 1, 30000, 'Donacion', NULL, NULL), (602, 3074, '3074', 'Tcnologia mecanica practica 2 curso superior', 'Deutsche gesellschaft', '', 'Bueno', 1, 1, 30000, 'Donacion', NULL, NULL), (603, 3075, '3075-3077', 'Introduccion al galvanismo', 'Heinz wehner', 'Marcombo s.a.', 'Bueno', 3, 1, 1000, 'R. propios', NULL, NULL), (604, 3077, '3078', 'Ctos. pedro urdemales', 'Ramon laval', 'Lom ediciones', 'Bueno', 1, 1, 2000, 'D. mineduc', NULL, NULL), (605, 3079, '3079-3081', 'Curso de electricidad general tomos i, ii y iii', 'R. auge', 'Paraninfo', 'Bueno', 3, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (606, 3082, '3082', 'Diccionario electronica', 'Sw. amos', 'Paraninfo', 'Bueno', 1, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (607, 3083, '3083', 'Dise', 'Macario garcia', 'Alfaomega', 'Bueno', 1, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (608, 3084, '3084', 'Electronica digital fundamental', 'Antonio hermosa', 'Marcombo', 'Bueno', 1, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (609, 3085, '3085', 'Electrotecnia', 'Jose gracia ', 'Paraninfo', 'Bueno', 1, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (610, 3086, '3086-3092', 'Enciclopedia electronica moderna', 'J. m. angulo', 'Paraninfo', 'Bueno', 7, 1, 2000, 'D. mineduc', NULL, '2009-05-12'), (611, 3093, '3093', 'Manual de seguridad y primeros auxilios', 'Hackett y robbins', 'Alfaomega', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (612, 3094, '3094', 'Mecanica', 'P. abbott', 'E. piramide', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (613, 3095, '3095', 'Mecanica de taller(soldaduras,uniones y caldereria', 'Varios autores', 'Cultural s.a.', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (614, 3096, '3096', 'Mecanica de taller (torno y fresadora)', 'Varios autores', 'Cultural s.a.', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (615, 3097, '3097', 'Nociones de calidad total', 'Mario gutierrez', 'Limusa', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (616, 3098, '3098-3099', 'Reparacion de averias electronicas (tomos i y ii)', 'James perozzo', 'Paraninfo', 'Bueno', 2, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (617, 3100, '3100', 'Soldadura aplicaciones y practica', 'Horwitz', 'Alfaomega', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (618, 3101, '3101', 'Tecnologia del hormigon', 'I.chileno del cemento', '', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (619, 3102, '3102', 'Tecnica y practica de la soldadura', 'Joseph w. giachino', 'Reverte s.a.', 'Bueno', 1, 1, 4000, 'D. mineduc', NULL, '2009-05-12'), (620, 3103, '3103-3104', 'Informe verdad historica y nuevo trato', 'Michelle bachelet', 'Comisionado', 'Bueno', 2, 1, 4000, 'D. mineduc.', NULL, NULL), (621, 3104, '3105', 'Se', 'Oscar robles v.', 'Imprenta o', 'Bueno', 1, 1, 4000, 'R.propios', NULL, '2009-08-10'), (622, 3106, '3106-3108', 'Guia tecnica', 'Conama', 'Bmz', 'Bueno', 3, 1, 4000, 'Donacion', NULL, '2009-08-10'), (623, 3109, '3109-3110', 'Reglamento sanitario', 'Conama', 'Bmz', 'Bueno', 2, 1, 4000, 'Donacion', NULL, '2009-08-11'), (624, 3111, '3111-3112', 'Guia para la elaboracion de planes de manejo de residuos peligrosos', 'Conama', 'Bmz', 'Bueno', 2, 1, 4000, 'Donacion', NULL, '2009-08-10'), (625, 3113, '3113-3114', 'Antologia gabriela mistral', 'Bicentenario', '', 'Bueno', 2, 1, 4000, 'Utp', NULL, '2009-10-20'), (626, 3115, '3115-3116', 'Antologia pablo neruda', 'Bicentenario', '', 'Bueno', 2, 1, 4000, 'Utp', NULL, '2009-10-20'), (627, 3117, '3117', 'Manual del automovil', 'Cultural', 'Cultural ', 'Bueno', 1, 1, 38000000, 'R.propios', NULL, '2010-04-13'), (628, 3118, '3118', 'Manual de motocicleta', 'Cultural', 'Cultural', 'Bueno', 1, 1, 15000, 'R.propios', NULL, '2010-04-13'), (629, 3119, '3119', 'Manual de electricidad', 'Cultural', 'Cultural', 'Bueno', 1, 1, 19000, 'R.propios', NULL, '2010-04-13'), (630, 3120, '3120', 'Manual de electronica', 'Cultural', 'Cultural', 'Bueno', 1, 1, 19000, 'R.propios', NULL, '2010-04-13'), (631, 3121, '3121', 'Manual de carpinteria', 'Cultural', 'Cultural', 'Bueno', 1, 1, 17000, 'R.propios', NULL, '2010-04-13'), (632, 3122, '3122', 'Manual de plomeria', 'Cultural', 'Cultural', 'Bueno', 1, 1, 17000, 'R.propios', NULL, '2010-04-13'), (633, 3123, '3123', 'Maestro alba', 'Cultural', 'Cultural', 'Bueno', 1, 1, 19000000, 'R.propios', NULL, '2010-04-13'), (634, 3124, '3124', 'Mecanica industrial', 'Cultural', 'Cultural', 'Bueno', 1, 1, 27000, 'R.propios', NULL, '2010-04-13'), (635, 3125, '3125', 'Tecnologia aplicada', 'Cultural', 'Cultural', 'Bueno', 1, 1, 15000, 'R.propios', NULL, '2010-04-13'), (636, 3126, '3126-3155', 'Atlas geografico de chile y el mundo ', 'Instituto cartog. latino', 'Vicens vives', 'Bueno', 30, 1, 0, 'Mineduc', NULL, '2011-07-11'), (637, 3156, '3156-3185', 'Diccionario de la lengua castellana', 'Dr. rodolfo oroz', 'Universitaria', 'Bueno', 30, 1, 0, 'Mineduc', NULL, '2011-07-11'), (638, 3185, '3186', 'La metamorfosis y otros relatos', 'Franz kafka', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (639, 3187, '3187- 3188', 'Historia general moderna', 'J. vicens vives', 'Vicens vives', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2011-07-11'), (640, 3190, '3190', 'Diez obras de fin de siglo', 'Ramon griffero', 'Frontera sur', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (641, 3191, '3191', 'Curso de matematicas elementales, algebra', 'Francisco pr', 'Edicion occidente', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (642, 3192, '3192', 'Historia ilustrada de chile', 'Walterio millar', 'Zig- zag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (643, 3193, '3193', 'Jugando con la luz', 'Pedro m. mejias', 'Nivola', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-12'), (644, 3194, '3194', 'Gregor mendel , el fundador de la genetica', 'Alberto gomis', 'Nivola', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (645, 3195, '3195', 'Tabla periodica de los elementos', 'Varios autores', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (646, 3196, '3196', 'Chile ( fisico- politico), ', 'Varios autores', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (647, 3197, '3197', 'La eneida', ' virgilio', 'Biblioteca edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (648, 3198, '3198', 'El cantar del mio cid', 'Anonimo', 'Biblioteca edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (649, 3199, '3199', 'Historia contemporanea de chile i', 'Gabriel zalazar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (650, 3200, '3200', 'Planisferio politico con bandera de plastico inc', 'Instituto geografico m.', 'Cultura', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (651, 3201, '3201', 'Mapas murales, america del sur', 'Varios autores', 'Vicens vives', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (652, 3202, '3202', 'Geografia global', 'Gustavo d. buzai', 'Lugar editorial', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (653, 3203, '3203', 'El amante sin rostro', 'Jorge marchant lazcano', 'Tajamar editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (654, 3204, '3204', 'Pedro paramo, el llano en llamas', 'Juan rulfo', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (655, 3205, '3205', 'Cuando era muchacho', 'Jose santos gonzalez v.', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (656, 3206, '3206', 'El ni', 'Luis rios barrueto', 'Pehuen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (657, 3207, '3207', 'El si de las ni', 'Leandro fernandez', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (658, 3208, '3208', 'Martin rivas', 'Alberto blest gana', 'Ediciones b', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (659, 3209, '3209', 'Leonardo y la mano que dibuja el futuro', 'Luca novelli', 'Editex', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (660, 3210, '3210', 'El arbol de la memoria y otros poemas', 'Jorge teillier', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (661, 3211, '3211', 'Historia contemporanea de chile ii', 'Gabriel zalazar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (662, 3212, '3212', 'Fisica i', 'Ricardo castro ', 'Santillana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (663, 3213, '3213', 'Quimica manual esencial', 'Mario avila garrido', 'Santillana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (664, 3214, '3214', 'Eloy', 'Carlos droguett', 'Tajamar editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (665, 3215, '3215', 'La era del imperio (1875- 1914)', 'Eric hbsbawm', 'Editorial planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (666, 3216, '3216', 'La era de la revolucion 1789-1848', 'Eric hobsbawm', 'Editorial planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (667, 3217, '3217', 'Canto general', 'Pablo neruda', 'Editorial planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (668, 3218, '3218', 'Retratos, el tiempo de las reformas y los descubrimientos', 'Gerardo vidal guzman', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (669, 3219, '3219', 'Atlas de la historia de chile', 'Osvaldo silva', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (670, 3220, '3220', 'De muerte', 'Armando uribe arce', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (671, 3221, '3221', 'La vida es sue', 'Pedro calderon de la bar', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (672, 3222, '3222', 'El retrato de dorian gray', 'Oscar wilde', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (673, 3223, '3223-3224', 'Nueva historia de chile desde los origenes hasta nuestros dias', 'Carlos aldunate, h. aran', 'Zigzag', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2011-07-11'), (674, 3225, '3225', 'El cepillo de dientes, el velero en la botella', 'Jorge diaz', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (675, 3226, '3226', 'Mi nombre es malarrosa', 'Hernan rivera letelier', 'Aguilar chilena edic', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (676, 3227, '3227', 'Conversacion en la catedral', 'Mario vargas llosa', 'Aguilar chilena edic', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (677, 3228, '3228', 'La casa verde', 'Mario vargas llosa', 'Aguilar chilena edic', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (678, 3229, '3229', 'Vida la ciencia de la biologia', 'Purves, william', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (679, 3230, '3230', 'Santiago de chile historia de una sociedad urbana', 'Armando de ramon', 'Catalonia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (680, 3231, '3231', 'La suma de los dias', 'Isabel allende', 'Sudamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (681, 3232, '3232', 'Ines del alma mia', 'Isabel allende', 'Sudamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (682, 3233, '3233', 'La libertad segun hannah arendt', 'Maite larrauri-max', 'Tandem ', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (683, 3234, '3234', 'Los hermanos karamasov', 'Fiodor dostoievski', 'Gradifco', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (684, 3235, '3235', 'Historia general moderna siglos xviii xx ', 'J. vicens vives', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (685, 3236, '3236', 'Historia de chile 188-1994', 'Simon collier', 'Anormi', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (686, 3237, '3237', 'El proceso', 'Franz kafka', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (687, 3238, '3238', 'Geografia general', 'Armando aguilar', 'Prentice hall', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (688, 3239, '3239', 'Narraciones extraordinarias', 'Edgar allan poe', 'Octaedro', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (689, 3240, '3240', 'Bioarqueologia', 'Bernardo arriaza', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (690, 3241, '3241', 'Pueblos originarios de chile', 'Fresia barrientosa', 'Nativa ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (691, 3242, '3242', 'Historia del arte', 'J.r. triadu tur', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (692, 3243, '3243', 'Quimica', 'Raymond chang', 'Mc graw hill', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (693, 3244, '3244', 'Tratado de geografia humana', 'Daniel hiernaux', 'Anthropos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (694, 3245, '3245', 'Historia de los griegos', 'Indro montanelli', 'Random house m.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (695, 3246, '3246', 'Historia de los chilenos iii', 'Sergio villalobos', 'Taurus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (696, 3247, '3247', 'Historia de los chilenos iv', 'Sergio villalobos', 'Taurus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (697, 3248, '3248', 'Manual de geografia chile, america y el mundo', 'Pilar cereceda', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (698, 3249, '3249', 'Civilizaciones prehispanicas de america', 'Osvaldo silva', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (699, 3250, '3250', 'Historia del mundo contemporaneo', 'J. arostegui sanchez', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (700, 3251, '3251', 'Historia contemporanea de chile iii', 'Gabriel zalazar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (701, 3252, '3252', 'Arte latinoamericano del siglo xx', ' rodrigo gutierrez v.', 'Prensas universit', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (702, 3253, '3253', 'Ciencias para el mundo', 'M. delibes de castro', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (703, 3254, '3254', 'Algebra y trigonometria', 'Sullivan', 'Pearson prentice h', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (704, 3255, '3255', 'Conocimientos fundamentales de matematicas', 'Elena de oteiza', 'Pearson educacion', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (705, 3256, '3256', 'Aritmetica', 'Baldor', 'Grupo e. patria', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (706, 3257, '3257', ' matematicas', 'L. galdos', 'Cultural', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (707, 3258, '3258', 'Fundamentos de fisica', 'Raymond serwey', 'Cengage learning', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (708, 3259, '3259', 'Biologia', 'Desalle- heithaus', 'Hol rinehart', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (709, 3260, '3260', 'La ciudad ausente', 'Ricardo piglia', 'Edi.zorro rojo', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (710, 3261, '3261', 'El camaleon y otros cuentos', 'Anton chejov', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (711, 3262, '3262', 'Poesia', 'Jorge manrique', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (712, 3263, '3263', 'Casa de mu', 'Henrik ibsen', 'Losada', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (713, 3264, '3264', 'Maria', 'Jorge isaacs', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (714, 3265, '3265', 'Antologia del cuento chileno', 'Alfonso calderon', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (715, 3266, '3266', 'Naturaleza muerta', 'Norbert schneider', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (716, 3267, '3267', 'Modernismo', 'Klaus- j', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (717, 3268, '3268', 'Chile arte actual', 'Gaspar galaz', 'Edic.universitarias', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (718, 3269, '3269', 'Experimentos cientificos', 'Janice vancleave', 'Limusa wiley', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (719, 3270, '3270', 'Quimica general', 'Ralph petrucci', 'P.prentice hall', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (720, 3271, '3271', 'Probabilidad y estadistica', 'Murray r. spiegel', 'Mc graw hill', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (721, 3272, '3272', 'Una verdad incomoda', 'Al gore', 'Gedisa ', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (722, 3273, '3273', 'Explicacion de todos mis tropiezos', 'Oscar bustamante', 'Uqbar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (723, 3274, '3274', 'Poemas para combatir la calvicie', 'Nicanor parra', 'Fondo cultura e.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (724, 3275, '3275', 'Las aventuras de sherlok holmes', 'Arthur conan d.', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (725, 3276, '3276', 'Historia contemporanea de chile v', 'Gabriel zalazar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (726, 3277, '3277', 'Breve historia de la filosofia', 'Humberto giannini', 'Catalonia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (727, 3278, '3278', 'Chile o una loca geografia', 'Benjamin subercaseaux', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (728, 3279, '3279', 'Apuntes de geo grafia fisica', 'Varios autores', 'Parramon', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (729, 3280, '3280', 'Historia de roma', 'Indro montanelli', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (730, 3281, '3281', '15 cuentos de amor y humor', 'Alfredo bryce e.', 'Peisa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (731, 3282, '3282', 'Ensayo sobre la ceguera', 'Jose saramago', 'Aguilar chilena edic.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (732, 3283, '3283', 'Hamlet', 'William shakespiare', 'Ediciones sm', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (733, 3284, '3284', 'Romeo y julieta', 'William shakespieare', 'Tinta fresca edic.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (734, 3285, '3285', 'Nociones elementales de administracion', 'Oscar johansen', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (735, 3286, '3286', 'Encuaderna tus libros', 'Karli frigge', 'Miguel a. salvatella', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (736, 3287, '3287', 'Poemas de amor', 'Raul zurita', 'Alianza edito. mago', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (737, 3288, '3288', 'El aleph', 'Jorge luis borges', 'Alianza editorial', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (738, 3289, '3289', 'Tragedias', 'Sofocles', 'Biblioteca edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (739, 3290, '3290', 'Historia de los chilenos tomo 2', 'Sergio villalobos', 'Taurus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (740, 3291, '3291', 'Cien a', 'Gabriel garcia marquez', 'Random house m.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (741, 3292, '3292', 'Ortega& gasset', 'Rudy & pepe pelayo', 'Literalia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (742, 3293, '3293', 'La voragine', 'Jose eustasio rivera', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (743, 3294, '3294', 'Altazor', 'Vicente huidobro', 'Andre bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (744, 3295, '3295', 'El fantasma de canterville', 'Oscar wilde', 'Tinta fresca', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (745, 3296, '3296', 'Reinas', 'Maren gootschalk', 'F.cultura econ. ', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (746, 3297, '3297', ' bodas de sangre, la casa de bernarda alba', 'Federico garcia lorca', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (747, 3298, '3298', 'Gaudi', 'Carme martin', 'Parramon', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (748, 3299, '3299', 'Cuentos de canterbury', 'Geoffrey chaucer', 'Gradifco', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (749, 3300, '3300', 'Confieso que he vivido', 'Pablo neruda', 'Pehuen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (750, 3301, '3301', 'La fuga', 'Pascal blanchet', 'Barbara fiore edic.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (751, 3302, '3302', 'Los detectives salvajes', 'Roberto bola', 'Anagrama', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (752, 3303, '3303', 'Hijo de ladron', 'Manuel rojas', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (753, 3304, '3304', 'Concurso intercentros de matematicas', 'Joaquin hernandez', 'Nivola', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (754, 3305, '3305', 'Bestiario', 'Julio cortazaar', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (755, 3306, '3306', 'Kavafis integro', ' miguel castillo didier', 'Tajamar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (756, 3307, '3307', 'Werther', 'Goethe j.w.', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (757, 3308, '3308', 'Talvez nunca, cronica nerudianas', 'Jose miguel varas', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (758, 3309, '3309', 'Explotados y benditos', 'Ascanio cavallo, c. diaz', 'Uqbar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (759, 3310, '3310', ' fisica conceptual', 'Paul g. hewitt', 'Addison wesley', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (760, 3311, '3311', 'Diccionariop abreviado oxford, de las religiones del mundo', 'John bowker', 'Paidos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (761, 3312, '3312', 'Canto de los rios que se aman', 'Raul zurita', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (762, 3313, '3313', 'Guia completa para organizar tu proyecto para la feria de cienc.', 'Bochonski', 'Limusa- wiley', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (763, 3314, '3314', 'Diccionario enciclopedico de quimica', 'Jacques angenault', 'Cecsa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (764, 3315, '3315', 'Fisica ii, para bachillerato', 'Eliezer braun', 'Trillas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (765, 3316, '3316', 'Una geografia humana renovada: lugares y regiones ', 'Abel albet', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (766, 3317, '3317', 'Quimica, conceptos y aplicaciones', 'John s. phillips', 'Mc graw hill', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (767, 3318, '3318', ' experimentos cientificos, sonido y audicion', 'Varios autores', 'Everest', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (768, 3319, '3319', ' historia de la pintura, del renacimiento a nuestros dias', 'Anna-carola kraube', 'K', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (769, 3320, '3320', ' surrealismo', ' leroy cathrin', ' taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (770, 3321, '3321', ' atlas de anatomia', ' anne m. gilroy', ' panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (771, 3322, '3322', ' artesanias para jugar', ' macarena barros', ' mis raices', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (772, 3323, '3323', 'Popol vuh', 'Anonimo', 'Fondo cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (773, 3324, '3324', 'Cubismo', 'Annie gantefuhrer-trier', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (774, 3325, '3325', 'Atlas historico', 'Joan roigobiol', 'Vicens vives', 'Bueno', 1, 1, 0, ' mineduc', NULL, '2011-07-11'), (775, 3326, '3326', 'Diccionario de mitologia griega y romana', 'Pierre grimal', 'Paidos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (776, 3327, '3327', 'Casa de campo', 'Jose donoso', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (777, 3328, '3328', 'Diccionario de las religiones', 'Mircea eliade, ioan. couli', 'Paidos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (778, 3329, '3329', 'Sobredosis', 'Alberto fuguet', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (779, 3330, '3330', 'Cari', 'Ines stranger', 'Cuarto propio', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (780, 3331, '3331', 'Cabo de hornos', 'Francisco coloane', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (781, 3332, '3332', 'Los pasos perdidos', 'Alejo carpentier', 'Losada', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (782, 3333, '3333', 'Historia de las ideas y de la cultura en chile', 'Bernardo subercaseux', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (783, 3334, '3334', 'Breve historia universal', 'Ricardo krebs', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (784, 3335, '3335', ' winston churchill y sus grandes batallas', 'Alan mcdonald', 'El rompecabezas', 'Bueno', 1, 1, 0, 'Miniduc', NULL, '2011-07-11'), (785, 3336, '3336', 'Leonardo da vinci', 'Antonio tello', 'Parramon', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (786, 3337, '3337', 'Charles chaplin', 'Pedro badran padaui', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'); INSERT INTO `libro` (`id_libro`, `codigo_libro`, `rango_libro`, `titulo_libro`, `autor_libro`, `editorial_libro`, `estado_libro`, `cantidad`, `vigencia`, `valor_unitario`, `origen`, `observacion`, `fecha_recepcion`) VALUES (787, 3338, '3338', 'Viaje de valparaiso a copiapo', 'Charles darwin', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (788, 3339, '3339', 'Discurso del metodo', 'Rene descartes', 'Pananmericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (789, 3340, '3340', 'Mapocho', 'Nona fernandez', 'Uqbar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (790, 3341, '3341', 'Historia del mundo', 'Carla rivera', 'Santillana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (791, 3342, '3342', 'Proyecto de obras completas', 'Roberto lire', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (792, 3343, '3343', 'La celestina', 'Fernando de rojas', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (793, 3344, '3344', 'Alma chilena', 'Carlos pezoa veliz', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (794, 3345, '3345', 'Antologia de obras de teatro', 'Egon wolff', 'Ril', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (795, 3346, '3346', 'Naufragios y rescates', 'Francisco coloane', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (796, 3347, '3347', 'Historia del siglo xx', 'Erichbsbawm', 'Critica', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (797, 3348, '3348', 'La era del capital 1848-1875', 'Eric hobsbawm', 'Critica', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (798, 3349, '3349', 'Historia de los chilenos', 'Sergio villalobos', 'Taurus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (799, 3350, '3350', 'Crimen y castigo', 'Fiodor dostoyevski', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (800, 3351, '3351', 'Periba', 'Lope de vega', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (801, 3352, '3352', 'Don juan tenorio', 'Jose zorrilla', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (802, 3353, '3353', 'Fausto', 'Johann w. goethe', 'Edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (803, 3354, '3354', 'Estadistica elemental', 'Robert johson', 'Cengage learning', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (804, 3355, '3355', 'Chile: cinco siglos de historia tomo i', 'Gonzalo vial', 'Zig-zag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (805, 3356, '3356', 'Chile: cinco siglos de historia tomo ii', 'Gonzalo vial', 'Zig- zag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (806, 3357, '3357', 'La odisea', 'Homero', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (807, 3358, '3358', 'Articulos', 'Mariano jose de larra', 'Catedra', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (808, 3359, '3359', 'Rimas y leyendas', 'Gustavo adolfo becquer', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (809, 3360, '3360', 'La guerra de los mundos', 'Herbert george wells', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (810, 3361, '3361', 'La segunda guerra mundial', 'Ricardo artola', 'Aianza', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (811, 3362, '3362', 'La noche de enfrente', 'Hernan del solas', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (812, 3363, '3363', 'Romancero gitano', 'Federico garcia lorca', 'Espasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (813, 3364, '3364', 'Novelas ejemplares', 'Miguel de cervantes', 'Edebe', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (814, 3365, '3365', 'Fisonomia hist', 'Jaime eyzaguirre', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (815, 3366, '3366', 'El burlador de sevilla y convidado de piedra', 'Tirso de molina', 'Zig-zag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (816, 3367, '3367', 'Kawesqar, hijos de la mujer sol', 'Paz errazuriz', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (817, 3368, '3368', 'El lugar sin limites', 'Jose donoso', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (818, 3369, '3369', 'El gaucho insufrible', 'Roberto bola', 'Anagrama', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (819, 3370, '3370', 'La iliada', 'Homero', 'Andres bello', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (820, 3371, '3371', 'El deseo, segun gilles deleuza', 'Maite larrauri', 'Tanoem', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (821, 3372, '3372', 'El gran arte', 'Rubem fonseca', 'Tajamar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (822, 3373, '3373', 'Prehistoria de chile', 'Grete mostny', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (823, 3374, '3374', 'Historia universal', 'Patricia jimenez r.', 'Santillana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (824, 3375, '3375', 'Historia de chile,desde la invasion incaica hasta nuestros dias', 'Armando de ramon', 'Catalonia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (825, 3376, '3376', 'Historia contemporanea de chile hombria y feminidad', 'Gabriel zalazar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (826, 3377, '3377', 'Historia universal', 'Secco ellauri', 'Bibliografica inter.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (827, 3378, '3378', 'La pintura en chile, desde la colonia hasta 1981', 'Milan ivelic, gaspar galaz', 'E. universitaria v.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (828, 3379, '3379', 'Imagenes de la identidad, la historia de chile en su patrimonio', 'Christian baez', 'Tajamar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (829, 3380, '3380', 'Atlas historico de chile', 'Instituto geografico m.', 'Igm', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (830, 3381, '3381', 'Warhol', 'Varios autores', 'Panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (831, 3382, '3382', 'Proyectos de exelencia para la feria de ciencias', 'Janice vancleave', 'Limusa-wiley', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (832, 3383, '3383', 'Algebra intermedia', 'R. david gustafson', 'Cengage learson', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (833, 3384, '3384', 'La biblia de la fisica y quimica', 'Varios autores', 'Lexus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (834, 3385, '3385', 'Biologia, la vida en la tierra', ' t.audesirk, g. audesirk', 'Prentice hall', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (835, 3386, '3386', 'Ecologia, conocer la casa de todos', 'Alicia hoffmann', 'Biblioteca americana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (836, 3387, '3387', 'Geografia humana', 'Juan romero', 'Ariel s.a.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (837, 3388, '3388', 'Geometria y trigonometria', 'J. baldor', 'Patria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (838, 3389, '3389', 'Historia de chile', 'S. villalobos, o. silva', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (839, 3390, '3390', 'Economia', 'Paul samuelson', 'Mc grau hill', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (840, 3391, '3391', 'Manual de historia de chile', 'Francisco frias v.', 'Zig- zag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (841, 3392, '3392', 'Impresionistas: la celebracion de la luz', 'Isabel kuhl', 'Parragon', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (842, 3393, '3393', 'Luz rabiosa', 'Rafael rubio', 'Camino del ciego', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (843, 3394, '3394', 'Un a', 'Juan emar', 'Tajamar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (844, 3395, '3395', 'Ayer', 'Juan emar', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (845, 3396, '3396', 'Poemas y antipoemas', 'Nicanor parra', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (846, 3397, '3397', 'Algebra, manual de preparacion pre- universitaria', 'Dto. creacion lexus', 'Lexus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (847, 3398, '3398', 'El mundo de la celula', 'Wayne m. becker', 'P. addison wesley', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (848, 3399, '3399', 'Grna atlas historico', 'Varios autores', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2011-07-11'), (849, 3400, '3400-3440', 'Atlas escolar de chile y el mundo, sopena', 'Varios autores', 'Libertad s.a.', 'Bueno', 40, 1, 0, 'R. propios', NULL, '2011-07-11'), (850, 3441, '3441-3545', 'Travesia literaria, antologia 2 medio', 'Varios autores', 'Alfaguara juvenil', 'Bueno', 104, 1, 0, 'Mineduc', NULL, '2012-12-26'), (851, 3546, '3546-3662', 'Relatos de este mundo y de otros', 'Varios autores', 'Tajamar', 'Bueno', 117, 1, 0, 'Mineduc', NULL, '2012-12-26'), (852, 3663, '3663-3761', 'Contextos antologia ilustrada de textos informativos', 'Varios autores', 'Planeta', 'Bueno', 99, 1, 0, 'Mineduc', NULL, '2012-12-26'), (853, 3762, '3762-3815', 'Palabras que cuentan el mundo', 'Varios autores', 'Alfaguara juvenil', 'Bueno', 54, 1, 0, 'Mineduc', NULL, '2012-12-26'), (854, 3816, '3816-3919', 'La vuelta al mundo en 100 textos, antologia literaria informativa', 'Varios autores', 'Planeta', 'Bueno', 104, 1, 0, 'Mineduc', NULL, '2012-12-26'), (855, 3919, '3919-4089', 'Voces del mundo, textos literarios e informativos', 'Maria magdalena browne', 'Pehuen ediciones', 'Bueno', 110, 1, 0, 'Mineduc', NULL, '2012-12-26'), (856, 4090, '4090-4194', 'Letras cardinales, antologia de obras literarias', 'Varios autores', 'Editorial universitaria', 'Bueno', 105, 1, 0, 'Mineduc', NULL, '2012-12-26'), (857, 4195, '4195-4315', 'Letras y mundo, antologia literaria e informativa', 'Varios autores', 'Alfaguara juvenil', 'Bueno', 121, 1, 0, 'Mineduc', NULL, '2012-12-26'), (858, 4316, '4316-4372', 'Palabras en cada puerta, antologia de obras literarias', 'M aria l perez david wall', 'Editorial universitaria', 'Bueno', 57, 1, 0, 'Mineduc', NULL, '2012-12-26'), (859, 4373, '4373-4489', 'La quinta pata, antologia literaria e informativa', 'Silvia aguilera florencia v', 'Lom ediciones', 'Bueno', 117, 1, 0, 'Mineduc', NULL, '2012-12-26'), (860, 4490, '4490-4512', 'Guia mis lecturas diarias, 1a 4 medio', 'Ministerio de educacion', 'Imprenta trama', 'Bueno', 23, 1, 0, 'Mineduc', NULL, '2012-12-26'), (861, 4513, '4513-4514', 'Los dias del fuego, las saga de los confines 3', 'Liliana bodoc', 'Suma', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (862, 4515, '4515-4519', 'El ni', 'John boyne', 'Salamandra', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (863, 4520, '4520-4529', 'Siddhartha', 'Hermann hesse', 'Contemporanea', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (864, 4530, '4530-4531', 'El qvixote de matta', 'Germana matta ferrari', 'Electa', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (865, 4532, '4532-4541', 'Un viejo que leia novelas de amor', 'Luis sepulveda', 'Maxi tusquets', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (866, 4542, '4542-4546', 'El viejo y el mar', 'Ernest hemingway', 'Debolsillo', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (867, 4547, '4547-4548', 'El baile', 'Irene nemirovsky', 'Salamandra', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (868, 4549, '4549-4550', 'Creasr lectores activos', 'Dianne l. monson', 'Visor', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (869, 4551, '4551-4552', 'Doce cuentos peregrinos', 'Gabriel garcia marquez', 'Debolsillo', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (870, 4553, '4553-4554', 'Relatos ', 'Rudyard kipling', 'Acantilado', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (871, 4555, '4555-4559', 'Ajedrez para ni', 'Murray chandler', 'Hispano europea', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (872, 4560, '4560-4564', 'America latina, epoca colonial', 'Gonzalo zaragoza', 'Anaya', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (873, 4565, '4565-4569', 'El curioso incidente del perro a medianoche', 'Mark haddon', 'Salamandra', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (874, 4570, '4570-4574', 'La fuga', 'Pascal blanchet', 'Barbara fiore', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (875, 4575, '4575-4579', 'El se', 'J.r.r. tolken', 'Minotauro', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (876, 4580, '4580-4584', 'El se', 'J.r.r. tolken', 'Minotauro', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (877, 4585, '4585-4589', 'El se', 'J.r.r. tolken', 'Minotauro', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (878, 4590, '4590-4596', 'Dark dude', 'Oscar hijuelos', 'Everest', 'Bueno', 7, 1, 0, 'Mineduc', NULL, '2013-05-15'), (879, 4597, '4597-4606', 'Marianela', 'Benito perez galdos', 'Andres bello', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (880, 4607, '4607-4616', 'Malinche', 'Laura esquibel', 'Suma', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (881, 4617, '4617-4618', 'Leseras', 'Catulo', 'Ediciones tacitas', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (882, 4619, '4619-4628', 'Preguntale a alicia', 'Anonimo', 'Salesianos impresores', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (883, 4629, '4629-4630', 'Magisterio y ni', 'Gabriela mistral', 'Andres bello', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (884, 4631, '4631-4640', 'La metamorfosis', 'Franz kafka', 'Ediciones era', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-05-15'), (885, 4641, '4641-4642', 'Las peliculas de mi vida', 'Alberto fuguet', 'Alfaguara juvenil', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (886, 4643, '4643-4644', 'Me llamo john lennon', 'Carmen gil', 'Parramon', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (887, 4645, '4645-4646', 'Luto en primavera', 'Guillermo blanco', 'Andres bello', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (888, 4647, '4647-4651', 'Hombres, maquinas y estrellas', 'Arturo aldunate phillips', 'Pehuen ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (889, 4651, '4652', 'La nube', 'Federico schopf', 'Cuarto propio', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (890, 4653, '4653-4654', 'La sombra del viento', 'Carlos ruiz zafon', 'Planeta', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (891, 4655, '4655-4659', 'Pantaleon y las visitadoras', 'Mario vargas llosa', 'Punto de lectura', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (892, 4660, '4660-4661', 'Lear rey y mendigo', 'Nicanor parra', 'Ediciones universi', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (893, 4662, '4662-4663', 'Violeta se fue a los cielos', 'Angel parra', 'Catalonia', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (894, 4664, '4664-4665', 'La mejor idea jamas pensada', 'Alvaro fischer', 'Ediciones b', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (895, 4666, '4666-4670', 'Confieso que he vivido', 'Pablo neruda', 'Pehuen ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (896, 4671, '4671-4672', 'Chile, cinco siglos de historia tomo 1 y 2', 'Gonzalo vial', 'Zigzag', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (897, 4673, '4673-4674', 'Chile, cinco siglos de historia tomo 1 y 2', 'Gonzalo vial', 'Zigzag', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (898, 4675, '4675-4676', 'Las cien mejores anecdotas de la 2 guerra mundial', 'Jesus hernandez', 'Meditaeditores', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (899, 4677, '4677-4681', 'Historia de la infancia en chilerepublicano', 'Jorge rojas flores', 'Salesianos impresores', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (900, 4682, '4682-4683', 'La pintura en chile', 'Milan ivelic', 'Ediciones universitarias', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (901, 4684, '4684-4688', 'Breve historia contemporanea de chile', 'Osvaldo silva', 'Lom ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (902, 4689, '4689-4690', 'Leonardo da vinci,,arte y ciencia del universo', 'Alessandro vessosi', 'Blume', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (903, 4691, '4691-4692', 'La revolucion industrial', 'Antonio escudero', 'Anaya ', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (904, 4983, '4983-4984', 'Historia de la ciencia y de la tecnologia', 'Silvia collini', 'Editex', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (905, 4695, '4695-4696', 'La mujer en la historia', 'Eulalia de vega', 'Anaya', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (906, 4697, '4697-4698', 'Historia del tiempo', 'Stephen w. hawking', 'Dracontos', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (907, 4699, '4699-4700', 'La historia de la tecnologia', 'Luca fraioli', 'Editex', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (908, 4701, '4701-4705', '¿ america latina moderna?', 'Jorge larra', 'Lom ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (909, 4706, '4706-4710', 'Historia contemporanea de chile i estado legitimidad', 'Gabriel salazar', 'Lom ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (910, 4711, '4711-4715', 'Historia contemporanea de chile, la econom', 'Gabriel salazar', 'Lom ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (911, 4716, '4716-4721', 'Historia contemporanea de chile,hombr', 'Gabriel salazar', 'Lom ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-05-15'), (912, 4722, '4722', 'Biodiversidad de chile, patrimonio y desafios', 'Conama', 'Ocholibros editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (913, 4723, '4723', 'Gu', 'Agust', 'Salesianos impresores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (914, 4724, '4724', 'Linneo, el principe de los bot', 'Antonio gonz', 'Nivola', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (915, 4725, '4725-4726', 'Aves de chile', 'Alvaro jaramillo', 'Lynx', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (916, 4726, '4727', 'Desaf', 'Joaqu', 'Nivola', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (917, 4728, '4728-4729', '100 cosas que debes saber sobre inventos', 'Duncan brwer', 'Signo editorial', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (918, 4730, '4730-4731', 'Historia de los inventos', 'Shobhit mahajan', 'Fullmann', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (919, 4732, '4732', 'Iconograf', 'Margarita cid lizondo', 'Ocholibros editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (920, 4733, '4733', 'Verdes raices, flora nativa y sus usos tradicionales', 'Javiera diaz', 'Editorial amanuta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (921, 4734, '4734-4735', 'Fundamentos de qu', 'Paula yurkanis', 'Pearson prentice hall', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (922, 4736, '4736-4737', 'Qu', 'John phillips', 'Mc graw hill', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (923, 4738, '4738-4739', 'Guinness world recors 2012', '', 'Planeta', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (924, 4740, '4740-4741', 'A la mesa con neruda', 'A', 'Liberalia', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (925, 4742, '4742-4743', 'Revisi', 'Jorge gonz', 'Ocholibros editores', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (926, 4744, '4744', 'Pintura chilena del siglo xix', 'Alberto valenzuela llanos', 'Origo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (927, 4745, '4745', 'Stanley kubrick, filmograf', 'Paul duncan', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (928, 4746, '4746-4750', 'Introducci', 'Enzo vald', 'Bibliograf', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (929, 4751, '4751-4755', 'Introducci', 'Enzo vald', 'Bibliograf', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (930, 4756, '4756-4757', '1000 ejercicios y juegos de gimnacia ritmica deportiva', 'Anna barta peregot', 'Paidotribo', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (931, 4758, '4758-4762', 'Dvd, p', 'Andr', '', 'Bueno', 6, 1, 0, 'Mineduc', NULL, '2013-05-15'), (932, 4763, '4763', 'Dvd, pelicula la lengua de las mariposas', 'Jos', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (933, 4764, '4764', 'Dvd, pelicula, la misi', '', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (934, 4765, '4765', 'Dvd, pelicula la madre', 'Vsevolod pudovkin', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (935, 4766, '4766-4767', 'Dvd, pelicula, la sociedad de los poetas muertos', 'Peter weir', '', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-05-15'), (936, 4767, '4768', 'Dvd documental la nostalgia de la luz', 'Patricio guzm', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-05-15'), (937, 4769, '4769-4893', 'Prisma, antolog', 'C', 'Piedra del sol', 'Bueno', 124, 1, 0, 'Mineduc', NULL, '2013-06-10'), (938, 4894, '4894-5121', 'Libertad bajo palabra, antolog', 'Ana mar', '', 'Bueno', 128, 1, 0, 'Mineduc', NULL, '2013-06-10'), (939, 5122, '5122-5245', 'Literoscopio, antolog', 'Fernanda arrau', 'Ediciones sm chile ', 'Bueno', 124, 1, 0, 'Mineduc', NULL, '2013-06-10'), (940, 5246, '5246-5307', 'Chile a trav', 'Juan andr', 'Alfaguara ediciones', 'Bueno', 62, 1, 0, 'Mineduc', NULL, '2013-06-10'), (941, 5308, '5308-5320', 'Gu', 'Ministerio de educaci', 'Imprenta trama', 'Bueno', 12, 1, 0, 'Mineduc', NULL, '2013-06-10'), (942, 5321, '5321-5336', 'Historia universal', 'Secco ellauri', 'Bibliograf', 'Bueno', 16, 1, 0, 'Mineduc', NULL, '2013-08-21'), (943, 5337, '5337-5343', 'Terremotos y tsunamis en chile', 'Pilar cereceda', 'Origo ediciones', 'Bueno', 7, 1, 0, 'Mineduc', NULL, '2013-08-22'), (944, 5344, '5344-5374', 'Cultura ciudadana', '', 'Ocholibros', 'Bueno', 30, 1, 0, 'Mineduc', NULL, '2013-08-23'), (945, 5375, '5375-5384', 'Diccionario pocket ingl', 'Michael mayor', 'Pearson', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-10-11'), (946, 5385, '5385-5386', 'Reflexiones sobre geometr', 'Francois baule', 'Ediciones la vasija', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (947, 5387, '5387-5388', 'F', 'Paul tippens', 'Mc graw hill', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (948, 5389, '5389-5390', 'Dios creo los n', 'Stephen hawking', 'Cr', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (949, 5391, '5391-5392', 'Matem', 'Douglas jimenez', 'Tajamar ediciones', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (950, 5393, '5393', 'Geometr', 'Dr j a baldor', 'Grupo edito patria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-10-11'), (951, 5394, '5394', 'Matem', 'Malba tahan', 'Pluma y papel edi', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-10-11'), (952, 5395, '5395-5396', 'Diccionario cient', 'Sergio premafera', 'Edici radio uni chil', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (953, 5397, '5397-5398', 'Historia del arte', 'J r triad', 'Vicens vives', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (954, 5399, '5399-5403', 'Historia del pueblo mapuche', 'Jos', 'Lom', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (955, 5404, '5404-5408', 'Historia contemporanea de chile ii', 'Gabriel salazar', 'Lom', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (956, 5409, '5409-5413', 'Historia de chile v', 'Gabriel salazar', 'Lom', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (957, 5414, '5414-5416', 'La mujer en la historia', 'Eulelia de la vega', 'Anaya', 'Bueno', 3, 1, 0, 'Mineduc', NULL, '2013-10-11'), (958, 5417, '5417-5421', 'America latina la independencia', 'Gonzalo zaragoza', 'Anaya', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (959, 5422, '5422-5426', 'La ruta de los volcanes', 'Guia ecoturistica', 'Pehuen', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (960, 5427, '5427-5428', 'Proyectos fascinantes', 'Sally hewitt', 'Panamericana', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (961, 5429, '5429-5438', 'Cuentos tomo 1 y 2', 'Edgar allan poe', 'Alianza editorial', 'Bueno', 12, 1, 0, 'Mineduc', NULL, '2013-10-11'), (962, 5439, '5439-5440', 'La saga de los confines 2 los dias de sombra', 'Liliana bodoc', 'Suma', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (963, 5441, '5441-5442', 'Un mundo para julius', 'Julio ortega', 'Catedra', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (964, 5443, '5443-5444', 'Decamer', 'Giovanni bocaccio', 'Catedra', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (965, 5445, '545-5454', 'La ', 'Mar', 'Biblioteca breve', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-10-11'), (966, 5455, '5455-5456', 'Victoria', 'Joseph conrad', 'Biblioteca conrad', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (967, 5457, '5457-5466', 'Rimas y leyendas', 'Gustavo adolfo becquer', 'Andr', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-10-11'), (968, 5467, '5467-5471', 'Eclipse', 'Stephenie meyer', 'Alfaguara ediciones', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (969, 5472, '5472-5481', 'Mala onda', 'Alberto fuget', 'Punto de lectura', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-10-11'), (970, 5482, '5482-5491', 'El cartero de neruda', 'Antonio skarmeta', 'Deblsillo', 'Bueno', 10, 1, 0, 'Mineduc', NULL, '2013-10-11'), (971, 5492, '5492-5493', 'El beso y otros cuentos', 'Anton chejov', 'Alianza editorial', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (972, 5494, '5494-5495', 'El dardo en la palabra', 'Fernando l', 'Deblsillo', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (973, 5496, '5496-5497', 'Momentos estelares de la humanidad', 'Stefan zweig', 'Acantilado', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (974, 5498, '5498-5502', 'El hombre invisible', 'H.c. wells', 'Riosdetinta', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (975, 5502, '5502-5507', 'El coronel no tiene quien le escriba', 'Gabriel garc', 'Deblsillo', 'Bueno', 5, 1, 0, 'Mineduc', NULL, '2013-10-11'), (976, 5508, '5508-55096', 'Vida y ', 'J.m. coetzee', 'Literatura mondadori', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (977, 5510, '5510-5511', 'Zara y el librero de bagdad', 'Fernando marias', 'Ediciones sm chile ', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2013-10-11'), (978, 5512, '5512', '50 flores nativas', 'Gazi garib', 'Galbooks', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-10-11'), (979, 5513, '5513', 'Subterra pelicula dvd', 'Marcelo ferrari', 'Tranvideo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2013-10-11'), (980, 5514, '5514-5515', 'Voces a toda m', 'V', 'Geo blace', 'Bueno', 2, 1, 0, 'Donaci', NULL, '2014-04-29'), (981, 5516, '5516-', 'C', 'Juan colombo campbell', 'Editorial jur', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (982, 5517, '5517-', 'El santiago que se fu', 'Oreste plath', 'World color', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (983, 5518, '5518-', 'Galileo galilei', 'Arturo uslar pietri', 'Tajamar ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (984, 5519, '5519-', '"chile avanza en un mundo convulsionado ""el mercurio"""', 'El mercurio', 'El mercurio aguilar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (985, 5520, '5520-5521', 'Nuestros pintores contemporaneos', 'Paula guzm', 'Ley de donaciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (986, 5522, '5522-', 'Arqueolog', 'Aedeen cremin', 'Blume', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (987, 5523, '5523-', 'Fundamentos de f', 'Serway/vuille', 'Cengage learning', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (988, 5524, '5524-', 'Matem', 'Douglas jimenez', 'Tajamar ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (989, 5525, '5525-', '50 teorias psicol', 'Christian jarret', 'Blume', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (990, 5526, '5526-', 'Internet para docentes', 'Luis angulo aguirre', 'Editorial macro', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (991, 5527, '5527-', 'Discriominaci', 'Guitt', 'Trillas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (992, 5528, '5528-', 'Cine negro', 'Alaint silver/james ursini', 'Tasch', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (993, 5529, '5529-', 'Almanaque mundial 2010', 'Carlos huigo jimenez', 'Televisa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (994, 5530, '5530-', 'Guinness world records', 'Varios autores', 'Guiness world records', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (995, 5531, '5531-5532', 'Atlas geogr', 'Instituto cartogr', 'Vicens vives', 'Bueno', 2, 1, 0, 'Mineduc', NULL, '2014-11-26'), (996, 5533, '5533-', 'Blacksad', 'Juan d', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (997, 5534, '5534-', 'Gabinete de papel', 'Gonzalo mill', 'Ediciones diego p', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (998, 5535, '5535-', 'Cabra lesa', 'Daniela gonz', 'Ril', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (999, 5536, '5536-', 'Paula', 'Isabel allende', 'Deblsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1000, 5537, '5537-', 'El inutil', 'Joaquin edwards bello', ' pfeiffer', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1001, 5538, '5538-', 'El hombre blando', 'Gregory cohen', 'Desatanudos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1002, 5539, '5539-', 'Antolog', 'Pablo neruda', 'Biblioteca edaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1003, 5540, '5540-', 'El grotesco criollo: disc', 'Disc', 'Ediciones colihue', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1004, 5541, '5541-', 'Cabeza y orquideas', 'Karina pacheco', 'Borrador', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1005, 5542, '5542-', 'Relatos de humor', 'Montserrat amores-', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1006, 5543, '5543-', 'Illustration now 3', 'Julio wiedermann', 'Tasch', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1007, 5544, '5544-', 'Harry potter, y el misterio del principe', 'Jk rowling', 'Salamandra', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1008, 5545, '5545-', 'Historias de san peterburgo', 'Nikolai gogol', 'Alianza editorial', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1009, 5546, '5546-', 'Cuentos zen', 'Jon j. muth', 'Scholastic', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1010, 5547, '5547-', 'Write source', 'Dave kemper', 'Great sours', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1011, 5548, '5548-', 'Cl', 'Grinor rojo', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1012, 5549, '5549-', 'El caballo fantasma', 'Cornelia funke', 'Fondo de cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1013, 5550, '5550-5552', 'El tunel', 'Ernesto sabato', 'Editorial planeta', 'Bueno', 3, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1014, 5553, '5553-', 'El fantasma de karl marx', 'Roman de calan', 'Errata naturae', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1015, 5554, '5554-', 'Los hombres de muchaca', 'Mariela rodr', 'Casals', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1016, 5556, '5556-', 'Cuentos completos', 'Graham green', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1017, 5557, '5557-', 'Matem', 'Patricia iba', 'Cengage learning', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1018, 5558, '5558-', 'Dvd violeta se fue a los cielos', 'Angel parra', 'Andr', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1019, 5559, '5559-', 'Dvd subterra', 'Marcelo ferrari', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1020, 5560, '5560-', 'Dvd centenario, museo nacional de las bellas artes', 'Solo por las ni', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1021, 5561, '5561-', 'Diccionario de la lengua espa', 'Rodolfo oroz', 'Universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1022, 5562, '5562-5565', 'Tableros de ajedrez', '', '', 'Bueno', 4, 1, 0, 'Mineduc', NULL, '2014-11-26'), (1023, 5566, '5566', 'La sobervia juventud', 'Pablo simonetti', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1024, 5567, '5567', 'El evangelio de venus', 'Alonso palomares', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1025, 5568, '5568', 'En la isla', 'Nicol', 'Ceibo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1026, 5569, '5569', 'American illustrators for kids', 'Julia schonlau', 'Monsa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1027, 5570, '5570', 'Doumtoum', 'Noel lang rodrigo garc', 'Dibbuks', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1028, 5571, '5571', 'Shakespiare macbeth', 'Jos', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1029, 5572, '5572', 'Calugas', 'Gabriela richards', 'Ceibo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1030, 5573, '5573', 'La nieta del se', 'Philippe claudel', 'Letras de bolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1031, 5574, '5574', 'El', 'Maximiliano figueroa', 'Diego portales', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1032, 5575, '5575', 'Poco hombre', 'Pedro lemebel', 'Diego portales', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1033, 5576, '5576', 'Diario de valparaiso', 'Al', 'Ril ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1034, 5577, '5577', 'Sabiduria chilena de tradicion oral', 'Gaston soublette', 'Ediciones uc', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1035, 5578, '5578', 'La musica originaria', 'Rafael diaz silva', 'Ediciones uc', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1036, 5579, '5579', 'L', 'Armando bucchi cariola', 'Fondos cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1037, 5580, '5580', 'Lexico seg', 'Armando bucchi cariola', 'Fondos cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1038, 5581, '5581', 'Maravillas de la naturaleza', 'Naumann & global', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1039, 5582, '5582', 'La quintrala y otros malos de adentro', 'Benjam', 'Diego portales', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1040, 5583, '5583', 'Literatura norteamericana', 'Bret harte', 'Larsen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1041, 5584, '5584', 'Franny y zooey', 'J. d. salinger', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1042, 5585, '5585', 'Literatura de los pueblos originarios', 'Luis hern', 'Larsen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1043, 5586, '5586', 'Voltaire enamorado', 'Nancy mitford', 'Duomo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1044, 5587, '5587', 'Polvo de huesos', 'Rosabetty mu', 'Ediciones t', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1045, 5588, '5588', 'An', 'Oscar nail kr', 'Ril editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1046, 5589, '5589', 'Federico si o si poeta', 'Josefina rillon', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1047, 5590, '5590', 'Cartas a barbara', 'Leo meter', 'L', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1048, 5591, '5591', 'Santiago en 100 palabras', 'Mario verdugo', 'Edicciones sara claro', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1049, 5592, '5592', 'Sobre la iondependencia en chile', 'Eduardo cavieres figueroa', 'E universitarias valp', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1050, 5593, '5593', 'Pr', 'Luis merino, rodrigo torres', 'Ril ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1051, 5594, '5594', '20 a', 'Unidad de curriculum y evaluaci', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1052, 5595, '5595', 'Clima extremo', 'Margaret hynes', 'Editorial panamericana', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1053, 5596, '5596', 'Chile 1973-1990', 'Hoppe-l', 'P', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1054, 5597, '5597', 'Chile en el siglo xxi', 'Laetitia boussard', 'Piso diez', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1055, 5598, '5598', 'Incorporaci', 'Sergio villalobos', 'Catalonia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1056, 5599, '5599', 'Valparaiso mas alla de la postal', 'Claudio abarca lobos', 'E. universitarias', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1057, 5600, '5600', 'Homeostasis', 'Felipe monsdalve', 'Grijalbo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1058, 5601, '5601', 'Chicas bailarinas', 'Margaret atwood', 'Lumen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1059, 5602, '5602', 'La columna de hierro', 'Taylor caldwell', 'Oceano', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1060, 5603, '5603', 'Lola hoffmann la revoluci', 'Leonora calder', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1061, 5604, '5604', '359 delicados con filtro', 'Pedro serrano y carlos l', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1062, 5605, '5605', 'Amapolas el delirio de la flor del olvido', 'Libero amarlic', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1063, 5606, '5606', 'Gabriela mistral los poetas te han elegido', 'M', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1064, 5607, '5607', 'Algun dia nos lo contaremos todo', 'Daniela krien', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1065, 5608, '5608', 'Selecci', 'Nicolas guillen', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1066, 5609, '5609', 'Cuentos italianos', 'Elena martinez', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1067, 5610, '5610', 'Reducciones', 'Jaime luis huenun', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1068, 5611, '5611', 'El dominico blanco', 'Gustav meyrink', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1069, 5612, '5612', 'Llegamos para quedarnos', 'Francisco figueroa', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1070, 5613, '5613', 'Plauto comedia de la olla anfitri', 'Jaime vel', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1071, 5614, '5614', 'La locura de macario', 'Marisela aguilar', 'El naranjo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1072, 5615, '5615', 'Simbologia prehispanica del choapa', 'Jorge colvin', 'Ediciones bodeg', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1073, 5616, '5616', 'Un pais mental 100 poemas chinos', 'Miguel angel petrecca', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1074, 5617, '5617', 'Diccionario enciclopedico de la regi', 'Omar mella fuentes', 'Ngehuin', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1075, 5618, '5618', 'Ejercicios de razonamientos matem', 'Cesar flores', 'Universidad de concepciom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1076, 5619, '5619', 'Escombro simbolico y espacio publico', 'Hilda basoalto', 'Consejo nacional cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1077, 5620, '5620', 'Angelson h y el ultimatum', 'Kim fupz aakenson', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1078, 5621, '5621', 'Teatro 1', 'Juan radrig', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1079, 5622, '5622', 'Juegos que agudizan el ingenio', 'Jorge batliori', 'Narcea', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1080, 5623, '5623', 'La resilencia en entornos socioeducativos', 'Anna for', 'Narcea', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1081, 5624, '5624', 'Reflejo', 'Jeannie baker', 'Interm', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1082, 5625, '5625', 'Carmilla', 'Joseph sheridan le fanu', 'Fondo de cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1083, 5626, '5626', 'Diccionario enciclopedico acontecimientos historicos', 'Omar mella fuentes', 'Ngehuin', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1084, 5627, '5627', 'Por amor a la f', 'Walter lewin', 'Debate', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1085, 5628, '5628', 'European illustrators for kids', 'Julia schonlau', 'Monsa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1086, 5629, '5629', 'El arte de la cocina francesa julia child', 'Louisette bertholl', 'Debate', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1087, 5630, '5630', 'Historias y an', ' nora y stefan koldehoff', 'Robinbook', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1088, 5631, '5631', 'La reina descsalza', 'Ildefonso falcones', 'Grijalbo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1089, 5632, '5632', 'El ni', 'Nicolas candia', 'Eirl', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1090, 5633, '5633', 'Breve historia utop', 'Rafael herrera guillen', 'Nowtilus', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1091, 5634, '5634', 'Bar abierto', 'Hern', 'E universitarias valp', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1092, 5635, '5635', 'Psicomagia', 'Alejandro jodorowky', 'Ediciones siruela', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1093, 5636, '5636', 'Altazor', 'Vicente huidobro', 'Edi uni diego por.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1094, 5637, '5637', 'Street art', 'Benke carlsson', 'Ed gustavo gili', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1095, 5638, '5638', 'Ultimos poemas', 'Vicente huidobro', 'E universidad diego p', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1096, 5639, '5639', 'Zurita', 'Ra', 'E universitarias d port', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1097, 5640, '5640', 'La oscuridad que nos lleva', 'Tulio espinoza', 'Cuarto propio', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1098, 5641, '5641', 'Don juan tenorio', 'Jos', 'Everest', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1099, 5642, '5642', 'Romance del duende que me escribe las novelas', 'Hern', 'Prisa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1100, 5643, '5643', 'Me llamo garri gasparov', 'Manuel margarido', 'Parram', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1101, 5644, '5644', 'Viaje sentimental', 'Laurence sterne', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1102, 5645, '5645', 'Los mayas y sus raices de agua', 'Andr', 'Nostra', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1103, 5646, '5646', 'El libro de los valores', 'Julio orosco, sandra ardila', 'Tajamar ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1104, 5647, '5647', 'Vinos de chile', 'Harriet nahrwold', 'Contrapunto', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1105, 5648, '5648', 'Tarde o temprano', 'Thomas hardy', 'Pfeifter', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1106, 5649, '5649', 'Parcxco', 'Jordi sierra', 'Anaya', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1107, 5650, '5650', 'Antes de que yo muera', 'Germ', 'Uni. diego portales', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1108, 5651, '5651', 'Volver a los 17', 'Oscar contardo', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1109, 5652, '5652', 'El templo', 'Matthew reillly', 'La factoria de las ideas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1110, 5653, '5653', 'F', 'Rafael alem', 'Laetoli', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1111, 5654, '5654', 'Dynamuss', 'Luis felipe torres', 'Chancacazo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1112, 5655, '5655', 'Mala indole cuentos aceptados y aceptables', 'Javier marias', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1113, 5656, '5656', 'Telegraph avenue', 'Michael chabon', 'Mondadori', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1114, 5657, '5657', 'Locke&key. bienvenidos a lovecraft', 'Joe hill', 'Eirl', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1115, 5658, '5658', 'Boom', 'Mo yan', 'Kailas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1116, 5659, '5659', 'El tungsteno', 'C', 'Montesinos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1117, 5660, '5660', 'Huidobro antolog', 'Jos', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1118, 5661, '5661', 'Y entonces estaban ellas', 'Elisabet prudant soto', 'Ceibo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1119, 5662, '5662', 'El sol de los scorta', 'Laurent gaud', 'Salamandra', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1120, 5663, '5663', 'Perros y clarinetes', 'Sebasdti', 'La c', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1121, 5664, '5664', 'Obras reunidas', 'Jenaro prieto', 'Universidad de la frontera', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1122, 5665, '5665', '50 animales que han cambiado el curso de la historia', 'Eric chaline', 'Librero', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1123, 5666, '5666', 'El palin juego tradicional de la cultura mapuche', 'Carlos l', 'E universitarias valp', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1124, 5667, '5667', 'Mapuche ', 'Jos', 'Catalonia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1125, 5668, '5668', 'La se', 'Virguinia woolf', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1126, 5669, '5669', 'El jard', 'Kate morton', 'Punto de lectura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1127, 5670, '5670', 'Siddhartha', 'Hermann hesse', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1128, 5671, '5671', 'Siempre estar', 'Andr', 'Bru', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1129, 5672, '5672', 'Goobye columbus', 'Philip roth', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1130, 5673, '5673', 'El soneto chileno', 'Juan cristobal moreno', 'E tacitas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1131, 5674, '5674', 'Mi cuerpo es una celda', 'Andr', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1132, 5675, '5675', 'Aqu', 'Paul auster', 'Mondadori', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1133, 5676, '5676', 'Dal', 'Robrt descharnes, gilles nerer', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1134, 5677, '5677', 'El socio', 'Jenaro prieto', 'Origo ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1135, 5678, '5678', 'El escritor sin fronteras', 'Mariano jose v', 'Manon', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1136, 5679, '5679', 'El cantar del mio cid', 'An', 'Origo ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1137, 5680, '5680', 'Space invaders', 'Nona fern', 'Alquimia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1138, 5681, '5681', 'El beso m', 'Mathias malzieu', 'Random grupo editorial', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1139, 5682, '5682', 'El nuevo libro del abc', 'Karl philipp moritz', 'Barbara flore', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1140, 5683, '5683', 'Corre historias vividas', 'Dean karmazes', 'Paldotribo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1141, 5684, '5684', 'Didacticas de las operaciones mentales: juzgar', 'Alberto gromi', 'Narcea', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1142, 5685, '5685', 'Silencio. nace una semilla', 'Manuel jofr', 'Piso diez', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1143, 5686, '5686', 'Intervenci', 'Rosa santiba', 'Grao', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1144, 5687, '5687', 'El rey banal', 'Antonie ozamam', 'Dibbuks', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1145, 5688, '5688', 'Hab', 'Gabriel gellon', 'Siglo 21', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1146, 5689, '5689', 'El teorema del patito feo', 'Luis javier plata', 'Siglo 21', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1147, 5690, '5690', 'Silencio. nace una semilla', 'Manuel jofr', 'Piso diez', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1148, 5691, '5691', 'El detective ausente', 'David blanco laserna', 'Anaya', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1149, 5692, '5692', 'El valle del terror, los misterios de sherlock holmes', 'Arthur conan doyle', 'Claridad', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1150, 5693, '5693', 'Francisco, el pa', 'Isabel g', 'Khaf', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1151, 5694, '5694', 'Diez cuentos para dormir mal', 'Ricardo rosas', 'Chancacazo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1152, 5695, '5695', 'Un color surgido desde el espacio', 'H.p.lovecraft', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1153, 5696, '5696', 'Predadores de silencio', 'Daniel bautista', 'Edelvives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1154, 5697, '5697', 'La historia del amor', 'Nicole krauss', 'Salamandra', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1155, 5698, '5698', 'Noticias sobre ti misma', 'Fatima sime', 'Cuarto propio', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1156, 5699, '5699', 'Qu', 'F. javier mart', 'Catarata', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1157, 5700, '5700', 'Reglamento de basquetbol', 'Escuela argentina de arbitros', 'Stadium', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1158, 5701, '5701', 'El principito', 'Antoine de saint exupery', 'Origo ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1159, 5702, '5702', 'Bacon & friends', 'Josep busquet', 'Diabolo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1160, 5703, '5703', 'Elaboraci', 'Susana pardo', 'Noveduc', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1161, 5704, '5704', 'Las verdaderas historias de l arte', 'Sylvain coissard', 'Oceano', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1162, 5705, '5705', 'Fogwill la gran ventana de los sue', 'Rodolfo fogwill', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1163, 5706, '5706', 'Contarlo todo', 'Jeremias gamboa', 'Mondadori', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1164, 5707, '5707', 'Noche de invierno', 'Valerio massimo', 'Grijalbo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1165, 5708, '5708', 'Adis a las armas', 'Ernest hemingway', 'Lumen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1166, 5709, '5709', 'El contrato social', 'Jean jacques rousseau', 'Herder', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1167, 5710, '5710', 'Eleanor &park', 'Rainbow rowell', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1168, 5711, '5711', 'Fuenzalida', 'Nona fernandez', 'Mondadori', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1169, 5712, '5712', 'El francotirador paciente', 'Arturo p', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1170, 5713, '5713', 'Duchamp', 'Janis mink', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1171, 5714, '5714', 'Enciclopedia completa de la guitarra', 'Nick freeth', 'Parram', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1172, 5715, '5715', 'El espejo de agua, ecuatorial', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1173, 5716, '5716', 'Poemas articos', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1174, 5717, '5717', 'Altazor', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1175, 5718, '5718', 'Temblor de cielo', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1176, 5719, '5719', 'Ultimos poemas', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'); INSERT INTO `libro` (`id_libro`, `codigo_libro`, `rango_libro`, `titulo_libro`, `autor_libro`, `editorial_libro`, `estado_libro`, `cantidad`, `vigencia`, `valor_unitario`, `origen`, `observacion`, `fecha_recepcion`) VALUES (1177, 5720, '5720', 'Mio cid campeador', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1178, 5721, '5721', 'Cagliostro', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1179, 5722, '5722', 'Ombligo, vital, total, acxtual', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1180, 5723, '5723', 'El oxigeno invisible', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1181, 5724, '5724', 'A la interperie', 'Vicente huidobro', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1182, 5725, '5725', 'Dvd vida yconciencia lo que tenemos en mente', 'Las minas producciones', '', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2015-09-03'), (1183, 5726, '5726-5729', 'La cuesti', 'Cristi', 'Consejo nacional cultura', 'Bueno', 4, 1, 0, 'Donaci', NULL, '2016-08-04'), (1184, 5730, '5730', 'Muchos gatos para un solo crimen', 'Ram', 'Lom', 'Bueno', 1, 1, 0, 'Donaci', NULL, '2016-08-04'), (1185, 5731, '5731', 'Nunca seremos estrella de rock', 'Jordi sierra', 'Alfaguara ediciones', 'Bueno', 1, 1, 0, 'Donaci', NULL, '2016-08-04'), (1186, 5732, '5732', 'Nuestro modo de vida', 'Fogwill', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1187, 5733, '5733', 'Mentira', 'Care santos', 'Edeb', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1188, 5734, '5734', 'Como sombras y sue', 'Luis zapata', 'Edic cal y arena', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1189, 5735, '5735', 'Vidas rotas', 'William c. gordon', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1190, 5736, '5736', 'Sombras de la plaza mayor', 'Rosa huertas', 'Edelvives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1191, 5737, '5737', 'Ante la ley', 'Franz kafka', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1192, 5738, '5738', 'Parias zugun', 'Adriana pinda', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1193, 5739, '5739', 'Una fantas', 'Julio verne', 'Sd ediciones', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1194, 5740, '5740', 'Un mundo propio', 'Graham greene', 'Ediciones la rota', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1195, 5741, '5741', 'Oki tripulante de terremotos', 'Juan carlos quezadas', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1196, 5742, '5742', 'Luis oyarz', 'Oscar contardo', 'Edic uni diego portales', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1197, 5743, '5743', 'Trentrenfil', 'Alberto trivero', 'Ediciones t', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1198, 5744, '5744', 'Formas breves', 'Ricardo piglia', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1199, 5745, '5745', 'El ojo en la nuca', 'Ilian stavans', 'Anagrama', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1200, 5746, '5746', 'Historia de pat hobby', 'Francis scott fitzgerald', 'Lonm', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1201, 5747, '5747', 'El matorral crategus', 'Branny cardoch', 'Editorial forja', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1202, 5748, '5748', 'Igualdad', 'Agust', 'Manifiestos', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1203, 5749, '5749', 'Leonardo da vinci, obra gr', 'Johannes nathan', 'Taschen', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1204, 5750, '5750', 'William shakespiare, romances , obras completas', 'William shakespiare', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1205, 5751, '5751', 'Global y roto', 'Bernardo santos', 'Amargord', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1206, 5752, '5752', 'Abecedario de p', 'Yord', 'Autom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1207, 5753, '5753', 'Kafkas', 'Luis gusm', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1208, 5754, '5754', 'Analectas', 'Confusio', 'Kailas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1209, 5755, '5755', 'Album del santa luc', 'Soledad ch', 'Planeta sostenible', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1210, 5756, '5756', 'La vida y otras geograf', 'Mario benedetti', 'Edelvives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1211, 5757, '5757', 'Obra poetica , juan mar', 'Francisco martinovich', 'Cuarto propio', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1212, 5758, '5758', 'Emergencias', 'Diamela eltit', 'Planeta sostenible', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1213, 5759, '5759', 'Cuentos escogidos', 'Guillermo blanco', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1214, 5760, '5760', 'Ampliaci', 'Patricio alvarado', 'Alquimia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1215, 5761, '5761', 'El mapa roto', 'Wenuan escalona', 'Del aire', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1216, 5762, '5762', 'Ejercicios de encuadre', 'Carlos araya d', 'Cuneta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1217, 5763, '5763', 'Volverse palestina', 'Lina meruane', 'Random house', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1218, 5764, '5764', 'Kalim', 'Ángel burgos', 'Bambu', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1219, 5765, '5765', 'El sangrador', 'Patricio jara', 'Planeta sostenible', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1220, 5766, '5766', 'Herramientas para ense', 'Silvina marsimian', 'Aique', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1221, 5767, '5767', 'Un sistema gr', 'Rosa llop', 'Gustavo gili', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1222, 5768, '5768', 'La casa del sordo', 'Sim', 'La pollera', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1223, 5769, '5769', 'Desolaci', 'Gabriela mistral', 'Universidad diego port.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1224, 5770, '5770', 'Stendhal el arca y el fantasma', 'Estaher saura', 'Gadir', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1225, 5771, '5771', 'La historia del cine', 'Roman gubern', 'Anagrama', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1226, 5772, '5772', 'Los humanos', 'Matt haig', 'Roca', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1227, 5773, '5773', 'Est', 'Alberto mayol, tom', ' fund. chile moviliz.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1228, 5774, '5774', 'El gran libro de las abejas', 'Jutta gay, inga menkhoff', 'Fackeltr', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1229, 5775, '5775', 'Barba empapada de sangre', 'Daniel galera', 'Random house', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1230, 5776, '5776', 'La trilog', 'Suzy lee', 'Barbara fiore', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1231, 5777, '5777', 'Como escribir el gui', 'Miguel casamayor', 'Robin book', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1232, 5778, '5778', 'Hay un dinosaurio en mi sopa!', 'Alvaro chaos cador', 'Fondo cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1233, 5779, '5779', 'Tanguy y laverdure', 'Jean-michel charlier', 'Ponent mqn', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1234, 5780, '5780', 'Mobydick', 'Oliver jouvray, pierre alary', 'Dib-buks', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1235, 5781, '5781', 'Ciudades de papel', 'John green', 'Random house', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1236, 5782, '5782', 'Quai d''orsay , cr', 'Lanzac blain', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1237, 5783, '5783', 'Temporal', 'Nicanor parra', 'Universidad diego port.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-09'), (1238, 5784, '5784', 'Heablemos de dineros', 'Gloria ayala person', 'Aguilar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1239, 5785, '5785', 'Un alma valiente', 'Nick vujicic', 'Aguilar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1240, 5786, '5786', 'Heavy metal', 'Andr', 'Robin book', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1241, 5787, '5787', 'Historias insolitas de la copa libertadores', 'Luciano wernicke', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1242, 5788, '5788', 'De bielsa a sampaoli', 'Rodrigoastorga', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1243, 5789, '5789', 'Bal', 'Juan villoro', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1244, 5790, '5790', 'Los mejores de america', 'Antonio mart', 'Uqbar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1245, 5791, '5791', 'Snoopy y el var', 'Charles m. schulz', 'Kraken', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1246, 5792, '5792', 'Cocina en familia', 'Carlo von m', 'Zigzag', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1247, 5793, '5793', 'El socio', 'Jenaro prieto', 'Universidad diego port.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1248, 5794, '5794', 'Lo mejor de octavio paz', 'Octavio paz', 'Seix barral', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1249, 5795, '5795', 'Bernard prince', 'Hermann y greg', 'Ponent mqn', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1250, 5796, '5796', 'Trent ', 'Leo rodolphe', 'Ponent mqn', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1251, 5797, '5797', 'El cantar de heike v.1', 'Jin taira, rumi sato', 'Satori', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1252, 5798, '5798', 'Los a', 'Carlos reyes,rodrigo elg', 'Hueders', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1253, 5799, '5799', 'Tanguy y laverdure', 'J.m. charlier ', 'Ponent mqn', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1254, 5800, '5800', 'Buddy longway', 'Derib', 'Dargaud- lombard', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1255, 5801, '5801', 'Recors guinness world 2015', 'Officially amazing', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1256, 5802, '5802', 'La ira de los angeles', 'John connolly', 'Tusquets, editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1257, 5803, '5803', 'How to invent', 'Lynn huggins-cooper', 'Qeb publishing', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1258, 5804, '5804', 'Macanudo 10', 'Ricardo liniers', 'Catalunia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1259, 5805, '5805', 'Don quijote de la mancha', 'Miguel de cervantes', 'Vicens vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1260, 5806, '5806', 'De animales a dioses', 'Yuval noah harari', 'Debate', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1261, 5807, '5807', 'Contrapunto', 'Aldous huxley', 'Edhasa', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1262, 5808, '5808', 'Itni', 'Iitni', 'Ocholibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1263, 5809, '5809', 'Tus pies toco en la sombra', 'Pablo neruda', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1264, 5810, '5810', 'Luis fernando rojas obra gr', 'Carola ureta, pedro a.', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1265, 5811, '5811', 'La mosca, acoso en las aulas', 'Gemma pasqual', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1266, 5812, '5812', 'El mundo de afuera', 'Jorge franco', 'Alfaguara', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1267, 5813, '5813', 'La hermana menor', 'Raymond chandler', 'Debolsillo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1268, 5814, '5814', 'Las 100 poesias de amor de la lengua castellana', 'J. francisco pe', 'Amargord', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1269, 5815, '5815', 'Las manos de juliette', 'Jahereh mafi', 'Fondo cultura', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1270, 5816, '5816', 'Underground', 'Haruki murakami', 'Tusquets, editores', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1271, 5817, '5817', 'Seg', 'Juan agust', 'Cuneta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1272, 5818, '5818', 'Preparativos para un viaje a kiev', 'Camilo marks', 'Random house', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1273, 5819, '5819', 'Bosques horizontales', 'Santiago barcaza', 'Ediciones t', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1274, 5820, '5820', 'Diario de un demente, la aut', 'Lu xun', 'Kailas', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1275, 5821, '5821', 'Un dia en la vida de conrad green', 'Ring lardner', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1276, 5822, '5822', 'El regate', 'Sergio rodr', 'Anagrama', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1277, 5823, '5823', 'Distancia de rescate', 'Samanta schweblin', 'Random house', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1278, 5824, '5824', 'El infierno de las mu', 'Jos', 'Uqbar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1279, 5825, '5825', 'Blue jeans, puedo so', 'Francisco de paula fernandez', 'Planeta', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1280, 5826, '5826', 'Virtual life, visi', 'Mario escobar', 'Edi. luis vives', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1281, 5827, '5827', 'Finis t', 'Alexis figueroa aracena', 'Lom', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-10'), (1282, 5828, '5828', 'Una partida de ajedrez', 'Stefan zweig', 'Godot', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1283, 5829, '5829', 'La musica como pensamiento', 'Mark evan bonds', 'Acantilado', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1284, 5830, '5830', 'Gabo no contado', 'Dar', 'Aguilar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1285, 5831, '5831', 'Pablo de rokha y la revista multitud', 'Daniel rozas', 'Copygraph', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1286, 5832, '5832', 'La gl', 'Anna starobinets', 'Ediciones nevsky', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1287, 5833, '5833', 'Fronteras del conocimiento', 'Carlos alberto marmelada', 'Sekotia', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1288, 5834, '5834', 'Los agujeros negros', 'Jos', 'Catarata', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1289, 5835, '5835', 'Agujeros negros en el universo', 'Paulina lira, patricia arevalo', 'Edi universitaria', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1290, 5836, '5836', 'Qu', 'Walter sosa escudero', 'Siglo veintiuno', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1291, 5837, '5837', 'Mas alla de la contienda', 'Roman rolland', 'Nordicalibros', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1292, 5838, '5838', 'Ojo en tinta', 'Patricio contreras', 'Cinco ases', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1293, 5839, '5839', 'Apuntes al margen', 'Carla cordua', 'Universidad diego port.', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1294, 5840, '5840', 'Hotel nube en el mudo coraz', 'Jorge teillier', 'Tajamar', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1295, 5841, '5841', 'Fr', 'Carmen ibarlucea paredes', 'Amargord', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1296, 5842, '5842', 'Rebeli', 'Marisol ortiz de z', 'Bambu', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1297, 5843, '5843', 'Ultimate explorer guide for kids', 'Justin miles', 'Marshall', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1298, 5844, '5844', 'Ciencia oscura', 'Rick remender', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1299, 5845, '5845', 'Esteban', 'Matthieu bonhomme', 'Norma', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1300, 5846, '5846', 'Mi vecino miyazaki', 'Alvaro lopez martin', 'Diabolo', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-11'), (1301, 5847, '5847-5849', 'Cielo , mar y tierra', 'Gabriela mistral', 'Biblioteca nacional', 'Bueno', 3, 1, 0, 'Mineduc', NULL, '2016-08-18'), (1302, 5849, '5850', 'Gabriela mistral, unica y diversa', 'Pedro pablo zegers', 'Biblioteca nacional', 'Bueno', 1, 1, 0, 'Mineduc', NULL, '2016-08-18'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `material` -- CREATE TABLE IF NOT EXISTS `material` ( `id_material` int(11) NOT NULL AUTO_INCREMENT, `codigo_material` varchar(45) DEFAULT NULL, `descripcion_material` varchar(100) DEFAULT NULL, `unidad_medida` varchar(45) DEFAULT NULL, `marca_material` varchar(45) DEFAULT NULL, `modelo_material` varchar(45) DEFAULT NULL, `medida_material` varchar(45) DEFAULT NULL, `stock_material` int(11) DEFAULT NULL, `id_tipo_material` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_material`), KEY `fk_material_seccion_idx` (`id_tipo_material`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ; -- -- Volcado de datos para la tabla `material` -- INSERT INTO `material` (`id_material`, `codigo_material`, `descripcion_material`, `unidad_medida`, `marca_material`, `modelo_material`, `medida_material`, `stock_material`, `id_tipo_material`, `vigencia`) VALUES (1, '56756', 'Desatornillador', 'Uni', 'Redline', 'Pequeño', '4 Pulgadas', 10, 1, 1), (2, '34534', 'Martillo', 'Uni', 'Stanley', 'Portable', '15cm', NULL, 1, 1), (3, '34681', 'Alicate', 'Uni', 'Stanley', 'Portable', '10cm.', NULL, 1, 1), (4, '34567', 'Pie de Metro', 'Uni', 'Stanley', 'asdf', '15cm x 5cm', NULL, 1, 1), (5, '78012398432', 'Taladro', 'Uni', 'Bosch', 'Portable', '17x43x10', NULL, 1, 1), (6, '1', 'Aluminio', 'Metro', '.', '.', '30 mm', NULL, NULL, 1), (7, '2', 'Machos', 'Juego', 'Totem', '.', '1/4"x20 UNC', NULL, NULL, 1), (8, '1000', 'Aluminio', 'Metro', '', '', '30mm', NULL, 1, 1), (9, '2000', 'Machos', 'Juego', 'Totem', '', '1/4"x20UNC', NULL, 1, 1), (10, '2001', 'Micrometro Interior', 'Uni', 'Mitutoyo', '', '25-50mm', NULL, 1, 1), (11, '3000', 'Lija para Acero', 'Pliego', 'Norton', '', 'Grano 100', NULL, 1, 1), (12, '2002', 'Acero Rapido', 'Uni', '', '', '1/2" x 1/2" x 3"', NULL, 1, 1), (13, '2003', 'Acero Rapido', 'Uni', '', '', '3/8" x 3/8" x 6"', NULL, 1, 1), (14, '2004', 'Broca Centro', 'Uni', '', '', '4mm x 10mm', NULL, 1, 1), (15, '2005', 'Fresa de punta plana, cuatro puntas', 'Uni', 'Addison', 'Normal', '14mm', NULL, 1, 1), (16, '4000', 'Aceite de corte soluble', 'Litro', 'Wurth', 'Woc', '', NULL, 1, 1), (17, '3001', 'Disco de corte', 'Uni', 'Wurth', '', '4 1/2"', NULL, 1, 1), (18, '5000', 'Escobillon plastico', 'Uni', 'Clorinda', 'Con mango', 'Grande', NULL, 1, 1), (19, '5001', 'Escobillon', 'Uni', 'Clorinda', 'Con Mango', 'Mediano', NULL, 1, 1), (20, '5002', 'Escoba de rama', 'Uni', '', '4 Hebras', '', NULL, 1, 1), (21, '2006', 'Tornillo Mecanico', 'Uni', 'Luque', 'Base fija', '5"', NULL, 1, 1), (22, '5003', 'Waipe', 'Bolsa', '', '', '1 Kg', NULL, 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `matricula` -- CREATE TABLE IF NOT EXISTS `matricula` ( `id_matricula` int(11) NOT NULL AUTO_INCREMENT, `numero_matricula` int(11) DEFAULT NULL, `id_alumno` int(11) DEFAULT NULL, `id_apoderado` int(11) DEFAULT NULL, `fecha_matricula` datetime DEFAULT NULL, `id_year` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_matricula`), KEY `fk_matricula_alumno_idx` (`id_alumno`), KEY `fk_matricula_apoderado_idx` (`id_apoderado`), KEY `fk_matricula_year_idx` (`id_year`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcado de datos para la tabla `matricula` -- INSERT INTO `matricula` (`id_matricula`, `numero_matricula`, `id_alumno`, `id_apoderado`, `fecha_matricula`, `id_year`, `vigencia`) VALUES (1, NULL, 2, 2, '2016-12-25 23:18:56', 2, 1), (2, NULL, 13, 2, '2016-12-25 23:54:33', 2, 1), (3, NULL, 10, 3, '2016-12-27 18:14:04', 2, 1), (4, NULL, 11, 3, '2016-12-27 18:14:27', 2, 1), (5, NULL, 11, 3, '2016-12-27 18:14:28', 2, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `nota` -- CREATE TABLE IF NOT EXISTS `nota` ( `id_nota` int(11) NOT NULL AUTO_INCREMENT, `nota` int(11) NOT NULL, `posicion_nota` int(11) DEFAULT NULL, `id_alumno_curso` int(11) DEFAULT NULL, `id_detalle_periodo` int(11) DEFAULT NULL, PRIMARY KEY (`id_nota`), KEY `fk_nota_alumno_curso_idx` (`id_alumno_curso`), KEY `fk_nota_periodo_detalle_idx` (`id_detalle_periodo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Volcado de datos para la tabla `nota` -- INSERT INTO `nota` (`id_nota`, `nota`, `posicion_nota`, `id_alumno_curso`, `id_detalle_periodo`) VALUES (1, 55, 1, 1, 53), (2, 70, 2, 1, 53), (3, 43, 1, 2, 53), (4, 45, 2, 2, 53), (5, 55, 1, 9, 1), (6, 55, 2, 9, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `orden_material` -- CREATE TABLE IF NOT EXISTS `orden_material` ( `id_orden_material` int(11) NOT NULL AUTO_INCREMENT, `correlativo_orden` int(11) DEFAULT NULL, `id_responsable` int(11) DEFAULT NULL, `id_sector` int(11) DEFAULT NULL, `fecha_orden_material` date DEFAULT NULL, `id_plan_cuenta` int(11) DEFAULT NULL, `fecha_creacion` datetime DEFAULT NULL, `fecha_modificacion` datetime DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', `estado_orden` varchar(45) DEFAULT NULL, `descripcion_rechazo` varchar(300) DEFAULT NULL, `cantidad_proveedores` int(11) DEFAULT NULL, PRIMARY KEY (`id_orden_material`), KEY `fk_orden_profesor_idx` (`id_responsable`), KEY `fk_orden_plan_cuenta_idx` (`id_plan_cuenta`), KEY `kf_orden_sector_idx` (`id_sector`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Volcado de datos para la tabla `orden_material` -- INSERT INTO `orden_material` (`id_orden_material`, `correlativo_orden`, `id_responsable`, `id_sector`, `fecha_orden_material`, `id_plan_cuenta`, `fecha_creacion`, `fecha_modificacion`, `vigencia`, `estado_orden`, `descripcion_rechazo`, `cantidad_proveedores`) VALUES (1, 1, 10, 1, '2016-12-01', 1, '2016-12-06 02:03:09', '2016-12-06 02:03:09', 1, 'Análisis Comparativo', NULL, 3), (2, 2, 6, 5, '2016-12-06', 1, '2016-12-06 05:19:54', '2016-12-06 05:19:54', 1, 'Análisis Comparativo', NULL, 4), (3, 3, 10, 1, '2016-12-10', 1, '2016-12-10 09:14:49', '2016-12-10 09:14:49', 1, 'Análisis Comparativo', NULL, 2), (4, 4, 10, 1, '2016-12-10', 1, '2016-12-10 09:15:32', '2016-12-10 09:15:32', 1, 'Análisis Comparativo', NULL, 4), (5, 5, 9, 2, '2016-12-14', 1, '2016-12-26 02:47:02', '2016-12-26 02:47:02', 1, 'Análisis Comparativo', NULL, 3), (6, 6, 6, 5, '2016-12-26', 1, '2016-12-26 02:55:50', '2016-12-26 02:55:50', 1, 'Análisis Comparativo', NULL, 2), (7, 7, 8, 3, '2016-12-26', 1, '2016-12-26 03:49:34', '2016-12-26 03:49:34', 1, 'Análisis Comparativo', NULL, 2), (8, 8, 9, 2, '2016-12-27', 2, '2016-12-27 18:48:14', '2016-12-27 18:48:14', 1, 'Análisis Comparativo', NULL, 3), (9, 9, 9, 2, '2016-12-27', 1, '2016-12-27 19:38:52', '2016-12-27 19:38:52', 1, 'Análisis Comparativo', NULL, 2), (10, 10, 10, 1, '2016-12-27', 1, '2016-12-27 22:12:14', '2016-12-27 22:12:14', 1, 'Análisis Comparativo', NULL, 2), (11, 11, 9, 2, '2017-01-29', 1, '2017-01-29 18:49:40', '2017-01-29 18:49:40', 1, 'Análisis Comparativo', NULL, 3); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pedido` -- CREATE TABLE IF NOT EXISTS `pedido` ( `id_pedido` int(11) NOT NULL AUTO_INCREMENT, `id_implemento` int(11) DEFAULT NULL, `cantidad` int(11) DEFAULT NULL, `precio_producto` int(11) DEFAULT NULL, `neto` int(11) DEFAULT NULL, `id_proveedor` int(11) DEFAULT NULL, PRIMARY KEY (`id_pedido`), KEY `fk_pedido_implemento_idx` (`id_implemento`), KEY `fk_pedido_proveedor_idx` (`id_proveedor`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ; -- -- Volcado de datos para la tabla `pedido` -- INSERT INTO `pedido` (`id_pedido`, `id_implemento`, `cantidad`, `precio_producto`, `neto`, `id_proveedor`) VALUES (1, 1, 10, 10000, 100000, 5), (2, 1, 10, 25000, 250000, 1), (3, 1, 2, 25000, 50000, 4), (4, 1, 10, 25000, 250000, 1), (5, 1, 10, 25000, 250000, 1), (6, 1, 10, 25000, 250000, 1), (7, 1, 10, 25000, 250000, 1), (8, 1, 10, 25000, 250000, 1), (9, 1, 10, 25000, 250000, 1), (10, 1, 10, 25000, 250000, 1), (11, 1, 10, 25000, 250000, 1), (12, 1, 10, 25000, 250000, 1), (13, 1, 10, 25000, 250000, 1), (14, 1, 10, 25000, 250000, 1), (15, 1, 10, 25000, 250000, 1), (16, 1, 10, 25000, 250000, 1), (17, 1, 10, 25000, 250000, 1), (18, 1, 10, 25000, 250000, 1), (19, 1, 10, 25000, 250000, 1), (20, 1, 10, 25000, 250000, 1), (21, 1, 10, 25000, 250000, 1), (22, 1, 10, 25000, 250000, 1), (23, 1, 10, 25000, 250000, 1), (24, 1, 10, 25000, 250000, 1), (25, 1, 10, 25000, 250000, 1), (26, 1, 10, 25000, 250000, 1), (27, 1, 10, 25000, 250000, 1), (28, 1, 10, 25000, 250000, 1), (29, 1, 10, 25000, 250000, 1), (30, 1, 10, 25000, 250000, 1), (31, 1, 10, 25000, 250000, 1), (32, 1, 10, 25000, 250000, 1), (33, 1, 10, 25000, 250000, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `periodo` -- CREATE TABLE IF NOT EXISTS `periodo` ( `id_periodo` int(11) NOT NULL AUTO_INCREMENT, `fecha_inicio` date DEFAULT NULL, `fecha_fin` date DEFAULT NULL, `nombre_periodo` varchar(45) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_periodo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Volcado de datos para la tabla `periodo` -- INSERT INTO `periodo` (`id_periodo`, `fecha_inicio`, `fecha_fin`, `nombre_periodo`, `vigencia`) VALUES (1, '2016-03-06', '2016-07-14', 'Primer periodo', 1), (2, '2016-07-24', '2016-12-29', 'Segundo periodo', 1), (3, '2016-11-30', '2016-11-30', 'test', 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `periodo_asignatura_anual` -- CREATE TABLE IF NOT EXISTS `periodo_asignatura_anual` ( `id_periodo_asignatura_anual` int(11) NOT NULL AUTO_INCREMENT, `id_periodo` int(11) DEFAULT NULL, `id_detalle_curso_anual` int(11) DEFAULT NULL, `cantidad_notas` int(11) DEFAULT NULL, PRIMARY KEY (`id_periodo_asignatura_anual`), KEY `fk_detalle_periodo_idx` (`id_periodo`), KEY `fk_detalle_curso_anual_idx` (`id_detalle_curso_anual`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=199 ; -- -- Volcado de datos para la tabla `periodo_asignatura_anual` -- INSERT INTO `periodo_asignatura_anual` (`id_periodo_asignatura_anual`, `id_periodo`, `id_detalle_curso_anual`, `cantidad_notas`) VALUES (1, 1, 181, 2), (2, 1, 182, 2), (3, 1, 183, 2), (4, 1, 184, 2), (5, 1, 185, 2), (6, 1, 186, 2), (7, 1, 187, 2), (8, 1, 188, 2), (9, 1, 189, 2), (10, 1, 190, 2), (11, 1, 191, 2), (12, 1, 192, 2), (13, 1, 193, 2), (14, 1, 194, 2), (15, 1, 195, 2), (16, 1, 196, 2), (17, 1, 197, 2), (18, 1, 198, 2), (19, 1, 199, 2), (20, 1, 200, 2), (21, 1, 201, 2), (22, 1, 202, 2), (23, 1, 203, 2), (24, 1, 204, 2), (25, 1, 205, 2), (26, 1, 206, 2), (27, 1, 207, 2), (28, 1, 208, 2), (29, 1, 209, 2), (30, 1, 210, 2), (31, 1, 211, 2), (32, 1, 212, 2), (33, 1, 213, 2), (34, 1, 214, 2), (35, 1, 215, 2), (36, 1, 216, 2), (37, 1, 217, 2), (38, 1, 218, 2), (39, 1, 219, 2), (40, 1, 220, 2), (41, 1, 221, 2), (42, 1, 222, 2), (43, 1, 223, 2), (44, 1, 224, 2), (45, 1, 225, 2), (46, 1, 226, 2), (47, 1, 227, 2), (48, 1, 228, 2), (49, 1, 229, 3), (50, 1, 230, 2), (51, 1, 231, 2), (52, 1, 232, 2), (53, 1, 233, 2), (54, 1, 234, 2), (55, 1, 235, 2), (56, 1, 236, 2), (57, 2, 181, 2), (58, 2, 182, 2), (59, 2, 183, 2), (60, 2, 184, 2), (61, 2, 185, 2), (62, 2, 186, 2), (63, 2, 187, 2), (64, 2, 188, 2), (65, 2, 189, 2), (66, 2, 190, 2), (67, 2, 191, 2), (68, 2, 192, 2), (69, 2, 193, 2), (70, 2, 194, 2), (71, 2, 195, 2), (72, 2, 196, 2), (73, 2, 197, 2), (74, 2, 198, 2), (75, 2, 199, 2), (76, 2, 200, 2), (77, 2, 201, 2), (78, 2, 202, 2), (79, 2, 203, 2), (80, 2, 204, 2), (81, 2, 205, 2), (82, 2, 206, 2), (83, 2, 207, 2), (84, 2, 208, 2), (85, 2, 209, 2), (86, 2, 210, 2), (87, 2, 211, 2), (88, 2, 212, 2), (89, 2, 213, 2), (90, 2, 214, 2), (91, 2, 215, 2), (92, 2, 216, 2), (93, 2, 217, 2), (94, 2, 218, 2), (95, 2, 219, 2), (96, 2, 220, 2), (97, 2, 221, 2), (98, 2, 222, 2), (99, 2, 223, 2), (100, 2, 224, 2), (101, 2, 225, 2), (102, 2, 226, 2), (103, 2, 227, 2), (104, 2, 228, 2), (105, 2, 229, 2), (106, 2, 230, 2), (107, 2, 231, 2), (108, 2, 232, 2), (109, 2, 233, 2), (110, 2, 234, 2), (111, 2, 235, 2), (112, 2, 236, 2), (113, 3, 181, 2), (114, 3, 182, 2), (115, 3, 183, 2), (116, 3, 184, 2), (117, 3, 185, 2), (118, 3, 186, 2), (119, 3, 187, 2), (120, 3, 188, 2), (121, 3, 189, 2), (122, 3, 190, 2), (123, 3, 191, 2), (124, 3, 192, 2), (125, 3, 193, 2), (126, 3, 194, 2), (127, 3, 195, 2), (128, 3, 196, 2), (129, 3, 197, 2), (130, 3, 198, 2), (131, 3, 199, 2), (132, 3, 200, 2), (133, 3, 201, 2), (134, 3, 202, 2), (135, 3, 203, 2), (136, 3, 204, 2), (137, 3, 205, 2), (138, 3, 206, 2), (139, 3, 207, 2), (140, 3, 208, 2), (141, 3, 209, 2), (142, 3, 210, 2), (143, 3, 211, 2), (144, 3, 212, 2), (145, 3, 213, 2), (146, 3, 214, 2), (147, 3, 215, 2), (148, 3, 216, 2), (149, 3, 217, 2), (150, 3, 218, 2), (151, 3, 219, 2), (152, 3, 220, 2), (153, 3, 221, 2), (154, 3, 222, 2), (155, 3, 223, 2), (156, 3, 224, 2), (157, 3, 225, 2), (158, 3, 226, 2), (159, 3, 227, 2), (160, 3, 228, 2), (161, 3, 229, 2), (162, 3, 230, 2), (163, 3, 231, 2), (164, 3, 232, 2), (165, 3, 233, 2), (166, 3, 234, 2), (167, 3, 235, 2), (168, 3, 236, 2), (169, 1, 237, 2), (170, 1, 238, 2), (171, 1, 239, 2), (172, 1, 240, 2), (173, 1, 241, 2), (174, 1, 242, 2), (175, 1, 243, 2), (176, 1, 244, 2), (177, 1, 245, 2), (178, 1, 246, 2), (179, 2, 237, 2), (180, 2, 238, 2), (181, 2, 239, 2), (182, 2, 240, 2), (183, 2, 241, 2), (184, 2, 242, 2), (185, 2, 243, 2), (186, 2, 244, 2), (187, 2, 245, 2), (188, 2, 246, 2), (189, 3, 237, 2), (190, 3, 238, 2), (191, 3, 239, 2), (192, 3, 240, 2), (193, 3, 241, 2), (194, 3, 242, 2), (195, 3, 243, 2), (196, 3, 244, 2), (197, 3, 245, 2), (198, 3, 246, 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `permisos` -- CREATE TABLE IF NOT EXISTS `permisos` ( `id_premisos` int(11) NOT NULL AUTO_INCREMENT, `id_administrativo` int(11) DEFAULT NULL, `id_usuario` int(11) DEFAULT NULL, `matricula` tinyint(4) DEFAULT '0', `usuarios` tinyint(4) DEFAULT '0', `asignaciones` tinyint(4) DEFAULT '0', `mi_registro` tinyint(4) DEFAULT '0', `registros` tinyint(4) DEFAULT '0', `horario` tinyint(4) DEFAULT '0', `planificacion` tinyint(4) DEFAULT '0', `implementos` tinyint(4) DEFAULT '0', `talleres` tinyint(4) DEFAULT '0', `internado` tinyint(4) DEFAULT '0', `administracion` tinyint(4) DEFAULT '0', `biblioteca` tinyint(4) DEFAULT '0', `tienda` tinyint(4) DEFAULT '0', `moderacion` tinyint(4) DEFAULT '0', PRIMARY KEY (`id_premisos`), KEY `fk_permisos_admin_idx` (`id_administrativo`), KEY `fk_permisos_user_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=43 ; -- -- Volcado de datos para la tabla `permisos` -- INSERT INTO `permisos` (`id_premisos`, `id_administrativo`, `id_usuario`, `matricula`, `usuarios`, `asignaciones`, `mi_registro`, `registros`, `horario`, `planificacion`, `implementos`, `talleres`, `internado`, `administracion`, `biblioteca`, `tienda`, `moderacion`) VALUES (3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (5, 5, 24, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0), (6, 6, 29, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (7, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0), (8, NULL, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (9, NULL, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (10, NULL, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (11, NULL, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (12, NULL, 19, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), (13, NULL, 20, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), (14, NULL, 21, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), (15, NULL, 22, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), (19, NULL, 23, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0), (20, NULL, 32, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (21, NULL, 33, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (25, NULL, 37, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0), (26, NULL, 38, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (27, NULL, 39, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (28, NULL, 40, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (29, NULL, 41, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0), (30, NULL, 42, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0), (31, NULL, 43, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0), (32, NULL, 44, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (33, NULL, 45, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0), (34, NULL, 46, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0), (35, NULL, 47, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), (36, NULL, 48, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0), (37, NULL, 49, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0), (38, NULL, 50, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0), (39, NULL, 51, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0), (40, NULL, 52, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1), (41, NULL, 53, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0), (42, NULL, 54, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `plan_cuenta` -- CREATE TABLE IF NOT EXISTS `plan_cuenta` ( `id_plan_cuenta` int(11) NOT NULL AUTO_INCREMENT, `nombre_plan_cuenta` varchar(45) DEFAULT NULL, `descripcion_plan_cuenta` varchar(300) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_plan_cuenta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcado de datos para la tabla `plan_cuenta` -- INSERT INTO `plan_cuenta` (`id_plan_cuenta`, `nombre_plan_cuenta`, `descripcion_plan_cuenta`, `vigencia`) VALUES (1, 'Nombre 1', 'Aquí debe poner una descripción de esta cuenta.', 1), (2, 'Nombre 2', 'Aquí debe poner una descripción de esta cuenta.', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `profesor` -- CREATE TABLE IF NOT EXISTS `profesor` ( `id_profesor` int(11) NOT NULL AUTO_INCREMENT, `horas_profesor` int(11) DEFAULT NULL, `id_usuario` int(11) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_profesor`), KEY `fk_profe_user_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ; -- -- Volcado de datos para la tabla `profesor` -- INSERT INTO `profesor` (`id_profesor`, `horas_profesor`, `id_usuario`, `vigencia`) VALUES (6, 45, 19, 1), (7, 30, 20, 1), (8, 30, 21, 1), (9, 30, 22, 1), (10, 30, 23, 1), (11, 10, 47, 1), (12, 10, 48, 1), (13, 20, 49, 1), (14, 10, 50, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `profesor_asignaturas` -- CREATE TABLE IF NOT EXISTS `profesor_asignaturas` ( `id_profesor_asignaturas` int(11) NOT NULL AUTO_INCREMENT, `id_profesor` int(11) DEFAULT NULL, `id_asignatura` int(11) DEFAULT NULL, PRIMARY KEY (`id_profesor_asignaturas`), KEY `fk_dicta_profesor_idx` (`id_profesor`), KEY `fk_dicta_asignatura_idx` (`id_asignatura`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=47 ; -- -- Volcado de datos para la tabla `profesor_asignaturas` -- INSERT INTO `profesor_asignaturas` (`id_profesor_asignaturas`, `id_profesor`, `id_asignatura`) VALUES (34, 6, 2), (35, 7, 1), (37, 12, 6), (38, 11, 3), (40, 8, 8), (41, 13, 2), (42, 13, 6), (43, 10, 9), (44, 9, 11), (45, 14, 2), (46, 14, 4); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedor` -- CREATE TABLE IF NOT EXISTS `proveedor` ( `id_proveedor` int(11) NOT NULL AUTO_INCREMENT, `razon_social` varchar(45) DEFAULT NULL, `rut_proveedor` varchar(45) DEFAULT NULL, `direccion_proveedor` varchar(100) DEFAULT NULL, `contacto_proveedor` varchar(45) DEFAULT NULL, `telefono_proveedor` varchar(45) DEFAULT NULL, `correo_proveedor` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_proveedor`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcado de datos para la tabla `proveedor` -- INSERT INTO `proveedor` (`id_proveedor`, `razon_social`, `rut_proveedor`, `direccion_proveedor`, `contacto_proveedor`, `telefono_proveedor`, `correo_proveedor`) VALUES (1, 'Agiliza Desarollo', '99999999-1', 'alguna #123', 'Yilo', '999999', 'ccanalesdote@gmail.com'), (2, 'Prueba', '11111111-1', 'Alguna #123', 'Test', '111111', 'prueba@agiliza.com'), (3, 'Prueba', '22222222-2', 'Alguna #123', 'Test', '222222', 'prueba@agiliza.com'), (4, 'Alvaro', '18722151-k', 'Alguna', 'Alvarito', '111111', 'cabreracornejoa@gmail.com'), (5, 'Donde Marco', '17746456-2', 'Alguna', 'Narco', '222222', 'm.esparzavalderrama@gmail.com'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedor_material` -- CREATE TABLE IF NOT EXISTS `proveedor_material` ( `id_proveedor_material` int(11) NOT NULL AUTO_INCREMENT, `rut_proveedor_material` varchar(45) DEFAULT NULL, `razon_social` varchar(100) DEFAULT NULL, `direccion_proveedor_material` varchar(150) DEFAULT NULL, `telefono_proveedor_material` varchar(45) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_proveedor_material`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Volcado de datos para la tabla `proveedor_material` -- INSERT INTO `proveedor_material` (`id_proveedor_material`, `rut_proveedor_material`, `razon_social`, `direccion_proveedor_material`, `telefono_proveedor_material`, `vigencia`) VALUES (1, '71111111-1', 'Ferretería Ejemplo', 'Alguna #123', '77777777', 0), (2, '71111111-1', 'Ferretería 1', 'Alguna #123', '711111', 1), (3, '71111111-1', 'Ferretería Ejemplo', 'Alguna #123', '22222222', 0), (4, '71111111-1', 'Ferretería Ejemplo', 'Alguna #123', '55555', 0), (5, '72111111-1', 'Ferretería 2', 'Alguna #123', '721111', 1), (6, '73111111-1', 'Ferretería 3', 'Alguna #123', '731111', 1), (7, '74111111-1', 'Ferretería 4', 'Alguna #123', '741111', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `reserva` -- CREATE TABLE IF NOT EXISTS `reserva` ( `id_reserva` int(11) NOT NULL AUTO_INCREMENT, `id_alumno` int(11) DEFAULT NULL, `id_libro` int(11) DEFAULT NULL, `fecha_reserva` date DEFAULT NULL, `fecha_devolucion` date DEFAULT NULL, `estado` varchar(45) DEFAULT NULL, PRIMARY KEY (`id_reserva`), KEY `fk_reserva_alumno_idx` (`id_alumno`), KEY `fk_reserva_libro_idx` (`id_libro`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -- Volcado de datos para la tabla `reserva` -- INSERT INTO `reserva` (`id_reserva`, `id_alumno`, `id_libro`, `fecha_reserva`, `fecha_devolucion`, `estado`) VALUES (1, 2, 1, '2016-12-17', '2016-12-22', 'completo'), (2, 2, 3, '2016-12-17', '2016-12-24', 'perdido'), (3, 3, 7, '2016-12-17', '2016-12-20', 'completo'), (4, 3, 8, '2016-12-17', '2016-12-20', 'completo'), (5, 2, 460, '2016-12-19', '2016-12-24', 'completo'), (6, 4, 4, '2016-12-19', '2016-12-20', 'perdido'), (7, 4, 5, '2016-12-20', '2016-12-23', 'prestado'), (8, 4, 6, '2016-12-20', '2016-12-25', 'prestado'), (9, 10, 8, '2016-12-24', '2016-12-28', 'perdido'), (10, 2, 1, '2016-12-27', '2016-12-28', 'completo'), (11, 4, 4, '2016-12-27', '2016-12-29', 'completo'), (12, 3, 2, '2016-12-27', '2016-12-28', 'perdido'), (13, 3, 10, '2017-01-29', '2017-02-02', 'prestado'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rol` -- CREATE TABLE IF NOT EXISTS `rol` ( `id_rol` int(11) NOT NULL AUTO_INCREMENT, `nombre_rol` varchar(45) DEFAULT NULL, `alias_rol` varchar(45) DEFAULT NULL, PRIMARY KEY (`id_rol`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcado de datos para la tabla `rol` -- INSERT INTO `rol` (`id_rol`, `nombre_rol`, `alias_rol`) VALUES (1, 'Administrador', 'adm'), (2, 'Alumno', 'alm'), (3, 'Profesor', 'prf'), (4, 'Apoderado', 'apd'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rol_usuario` -- CREATE TABLE IF NOT EXISTS `rol_usuario` ( `id_usuario` int(11) NOT NULL, `id_rol` int(11) NOT NULL, PRIMARY KEY (`id_rol`,`id_usuario`), KEY `fk_rol_usuario_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `rol_usuario` -- INSERT INTO `rol_usuario` (`id_usuario`, `id_rol`) VALUES (1, 1), (2, 1), (3, 2), (4, 2), (5, 2), (19, 3), (20, 3), (21, 3), (22, 3), (23, 3), (24, 1), (28, 4), (29, 1), (32, 2), (33, 2), (37, 1), (38, 2), (39, 2), (40, 2), (41, 1), (42, 4), (43, 1), (44, 2), (45, 4), (46, 1), (47, 3), (48, 3), (49, 3), (50, 3), (51, 1), (52, 1), (53, 1), (54, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sector` -- CREATE TABLE IF NOT EXISTS `sector` ( `id_sector` int(11) NOT NULL, `nombre_sector` varchar(45) DEFAULT NULL, `responsable_sector` int(11) DEFAULT NULL, PRIMARY KEY (`id_sector`), KEY `fk_especialidad_profesor_idx` (`responsable_sector`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `sector` -- INSERT INTO `sector` (`id_sector`, `nombre_sector`, `responsable_sector`) VALUES (1, 'Terminación en Contrucciones', 10), (2, 'Mecánica Industrial', 9), (3, 'Contrucciones Metalicas', 8), (4, 'Mecánica Automotriz', 7), (5, 'Electricidad', 6); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipo_material` -- CREATE TABLE IF NOT EXISTS `tipo_material` ( `id_tipo_material` int(11) NOT NULL AUTO_INCREMENT, `codigo_tipo_material` int(11) DEFAULT NULL, `nombre_tipo_material` varchar(45) DEFAULT NULL, `vigencia` tinyint(4) DEFAULT '1', PRIMARY KEY (`id_tipo_material`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcado de datos para la tabla `tipo_material` -- INSERT INTO `tipo_material` (`id_tipo_material`, `codigo_tipo_material`, `nombre_tipo_material`, `vigencia`) VALUES (1, 1020, 'Herramientas', 1), (2, 1021, 'Consumo', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario` -- CREATE TABLE IF NOT EXISTS `usuario` ( `id_usuario` int(11) NOT NULL AUTO_INCREMENT, `rut_usuario` varchar(45) DEFAULT NULL, `nombres_usuario` varchar(100) DEFAULT NULL, `apellido_paterno` varchar(45) DEFAULT NULL, `apellido_materno` varchar(45) DEFAULT NULL, `email_usuario` varchar(45) DEFAULT NULL, `hash_usuario` varchar(100) DEFAULT NULL, `direccion_usuario` varchar(45) DEFAULT NULL, `sexo_usuario` varchar(45) DEFAULT NULL, `fecha_creacion` datetime DEFAULT NULL, `fecha_ultimo_login` datetime DEFAULT NULL, `telefono_usuario` bigint(20) DEFAULT NULL, `tipo_usuario` varchar(45) DEFAULT NULL, `main_page` varchar(45) DEFAULT NULL, `pass_temp` varchar(45) DEFAULT NULL, `imagen_url` varchar(100) DEFAULT 'default.png', `link_temporal` varchar(45) DEFAULT NULL, PRIMARY KEY (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=55 ; -- -- Volcado de datos para la tabla `usuario` -- INSERT INTO `usuario` (`id_usuario`, `rut_usuario`, `nombres_usuario`, `apellido_paterno`, `apellido_materno`, `email_usuario`, `hash_usuario`, `direccion_usuario`, `sexo_usuario`, `fecha_creacion`, `fecha_ultimo_login`, `telefono_usuario`, `tipo_usuario`, `main_page`, `pass_temp`, `imagen_url`, `link_temporal`) VALUES (1, '000000000', 'Admin', 'Sys', '#', 'contacto@agiliza.xyz', '$2a$10$GsnAvrhNBhEdC346IStwZejJrfrk0P4I/S0b8rTr8Ja1wEeTTQUTG', 'Desconocida #000', 'Masculino', NULL, '2016-12-27 19:27:04', 56900000000, 'Administrador', 'inicio.panel', '1', '20161124022050.png', NULL), (2, '174945764', 'Cristian Hernán', 'Canales', 'Dote', 'ccanales@agiliza.xyz', '$2a$10$8F7s3nnJZtmXrexzvy0UZeVq3HkCwJuEQ4Pjf8D9frLTKy9Mc0Sq6', 'Palmas de Mallorca #1763', 'Masculino', '2016-08-24 03:31:44', '2017-02-22 14:18:45', 951036575, 'Administrador', 'inicio.panel', '7811', '20161227205227.png', NULL), (3, '178492004', 'Juan Hernán', 'Figueroa', 'Cabrera', 'juan@agiliza.cl', '$2a$10$8F7s3nnJZtmXrexzvy0UZeVq3HkCwJuEQ4Pjf8D9frLTKy9Mc0Sq6', 'alguna #123', 'Masculino', '2016-08-24 22:39:13', '2016-12-26 17:17:30', 912345678, 'Alumno', 'inicio.panel', 'MvA2Z051', '1482882344.png', NULL), (4, '195662029', 'Javiera Sofía', 'Peñaloza', 'Gonzáles', 'javiera@agiliza.cl', '$2a$10$wOBShYJLf4I97psRbfA62.635MIophlqniRIfe8brrrdrAO/lahVe', 'alguna #123', 'Femenino', '2016-08-24 22:42:41', NULL, 56913111111, 'Alumno', 'inicio.panel', 'slD4E50O', 'default.png', NULL), (5, '198963860', 'Jorge Bastian', 'Fuenzalida', 'Perez', 'jorge@agiliza.cl', '$2a$10$Ig7qJfN74d0KLeJC6DtKqe8PuD6Bl.4VCNgrpBkqqROh6.fmdZaE2', 'alguna #123', 'Masculino', '2016-08-24 23:04:58', '2016-12-27 01:45:51', 56914111111, 'Alumno', 'inicio.panel', 'w2V2lesQ', 'default.png', NULL), (19, '137323907', 'Daniel', 'Lillo', 'Madariaga', 'daniellillo@agiliza.xyz', '$2a$10$2.YGJs95wdfbppzzPGCB.O39lLY74tReoEGJTsIEpzv2oScA.3JDq', 'Alguna #123', 'Masculino', '2016-11-21 21:58:53', '2016-12-23 16:31:19', 56911111111, 'Profesor', 'inicio.panel', 'uRzgdB3S', 'default.png', NULL), (20, '152796099', 'Jose', 'Gerrero', 'Torres', 'joseguerrero@agiliza.xyz', '$2a$10$7kuuY67vRA6EGY6xJXt8kuM/BHhmBjWfn/uyKtyb36MjdjBYm1blG', 'Alguna #123', 'Masculino', '2016-11-21 22:28:49', NULL, 56911111111, 'Profesor', 'inicio.panel', 'Ybucx1Ie', 'default.png', NULL), (21, '62881437', 'José', 'De la Cruz', 'Robledo', 'josedelacruz@agiliza.xyz', '$2a$10$wsnOZYpsKvRCH3o4C83pae9DgjQQRmYipZaqqWJsZb2yMtxD3ZQAm', 'Alguna #123', 'Masculino', '2016-11-21 23:49:10', '2016-11-22 03:07:51', 56911111111, 'Profesor', 'inicio.panel', 'dX7RJW9A', 'default.png', NULL), (22, '152796099', 'Juan', 'Meneses', 'Mella', 'juanmeneses@agiliza.xyz', '$2a$10$ClK/0uqF7xzVqnnWoJlW3OAmMcyNp5NVIHuPIoQPQLzqga1M5Y8S2', 'Alguna #123', 'Masculino', '2016-11-21 23:50:03', NULL, 56911111111, 'Profesor', 'inicio.panel', 'HC10QcAx', 'default.png', NULL), (23, '57989114', 'Fernando', 'Lopez', 'Gonzales', 'fernandolopez@agiliza.xwz', '$2a$10$Y.fp/xs/DIUGWIc5SITG7uT6U9B4EsPZfAyRO4IKGzk.yiIK1YhQy', 'Alguna #123', 'Masculino', '2016-11-21 23:50:42', NULL, 56911111111, 'Profesor', 'inicio.panel', 'xtKII3c4', 'default.png', NULL), (24, '117896145', 'Francisca Ignacia', 'Salazar', 'Valdés', 'francisca@gmail.com', '$2a$10$n0J/7e6JjGIdRqcgDSEPn.14S7dQsNnQa5IjLuBXBZI9Ada/1fImC', 'Alguna #123', 'Femenino', '2016-11-22 02:23:23', NULL, 56991010716, 'Administrador', 'inicio.panel', 'Ny7QeB2F', 'default.png', NULL), (28, '9544752K', 'Mariano Heriberto', 'Canales', 'Pavez', 'marianocanales@agiliza.xyz', '$2a$10$GsnAvrhNBhEdC346IStwZejJrfrk0P4I/S0b8rTr8Ja1wEeTTQUTG', 'Alguna #123', 'Masculino', '2016-11-22 03:03:33', '2016-12-19 21:46:51', 56922222222, 'Apoderado', 'inicio.panel', 'zfHFCIBM', '1482194409.png', NULL), (29, '140109479', 'Marco', 'Esparza', 'Valderrama', 'marcoesparza@agiliza.xyz', '$2a$10$v.r/4qDYvqkM3HVmhVVyOuBb5MaRl6rlhHfuhsmzfaInhWN7aE8dm', 'Alguna #123', 'Masculino', '2016-11-24 00:41:45', '2017-01-06 17:43:38', 56911111111, 'Administrador', 'inicio.panel', 'kadath', '20161220144638.png', ''), (32, '180165134', 'Jorge Ignacio', 'Jara', 'Guerrero', 'yilo.anm@gmail.com', '$2a$10$GsnAvrhNBhEdC346IStwZejJrfrk0P4I/S0b8rTr8Ja1wEeTTQUTG', 'Alguna #123', 'Masculino', '2016-11-26 18:06:44', '2016-12-19 21:39:29', 56922222222, 'Alumno', 'inicio.panel', '1', '1482194336.png', ''), (33, '198405787', 'Daniel Alonso', 'Matus', 'Peñaloza', 'pedro@gmail.com', '$2a$10$Q4kDpG6OOSApMDiPKbHw0.SCytP82DgtEpWQGYjRofHs069ntb3HW', 'Alguna #123', 'Masculino', '2016-11-26 18:09:25', NULL, 56911111111, 'Alumno', 'inicio.panel', 'jHO7gJFT', 'default.png', NULL), (37, '123436008', 'Marcelo Esteban', 'Chebi', 'Quintul', 'finanzasa21@gmail.com', '$2a$10$V307j98XvNDsRUAkEYBb4elazKh4e1Utl3/3qxt02NjoNYXwthYPG', 'Manso de Velasco 761', 'Masculino', '2016-11-25 15:43:28', '2016-11-28 00:52:51', 722711944, 'Administrador', 'inicio.panel', 'industrial', 'default.png', NULL), (38, '22349479K', 'Felipe', 'Soto', 'Hidalgo', 'comunidadaee@gmail.com', '$2a$10$sCfrANmZIOrUuzPDpSp4yut/EF7Hbfcer7jPhpu9cW8gd3OTFhDlO', 'Alguna #123', 'Masculino', '2016-12-17 03:30:57', NULL, 56911111111, 'Alumno', 'inicio.panel', '9zFv5ssT', 'default.png', NULL), (39, '17083206K', 'Marcos', 'Lopez', 'Undurraga', 'm.esparzarvalderrama@gmail.com', '$2a$10$3dc9uGHwc6HtPtwDRNQXWOlgzy7nrP4CcA8UtUzqn7naGZVuJmoxO', 'Alguna #123', 'Masculino', '2016-12-17 10:47:13', NULL, 123456789, 'Alumno', 'inicio.panel', 'GiWEQr8k', 'default.png', NULL), (40, '18965328K', 'David Ignacio', 'Fernandez', 'Vargas', 'inaho.kaizuka.mod@gmail.com', '$2a$10$ne4.Py67VTWvU9nhfKif.ub1zJOzLOWrOSHDyCRRqXSXTBYqQ0tTq', 'Alguna #123', 'Masculino', '2016-12-17 23:59:05', NULL, 56911111111, 'Alumno', 'inicio.panel', '9CTZmLOs', 'default.png', NULL), (41, '142610795', 'Maria Pilar', 'Lineros', 'Ramirez', 'pilarlineros.74@gmail.com', '$2a$10$/fLw0ePl87eLWy72quBxMOVxxqlbTgDvIc226Pfy5jcjsnCwBSaUS', 'alguna', 'Femenino', '2016-12-19 15:15:48', '2016-12-19 15:18:43', 12345678, 'Administrador', 'inicio.panel', 'marianita', 'default.png', NULL), (42, '90559206', 'Luis Antonio', 'Esparza', 'Cabezas', 'cradle.of.filth_287@hotmail.com', '$2a$10$2rlwJ193EMU7cZkGjBIJM.8OGf.z1twEdQmpGJ3gcuhacQ6UofDLa', 'Alguna #123', 'Masculino', '2016-12-23 14:30:52', NULL, 12345678, 'Apoderado', 'inicio.panel', '5JUeS7Pm', 'default.png', NULL), (43, '177462330', 'Pedro Antonio', 'Pavez', 'Videla', 'pedro1990.pp@gmail.com', '$2a$10$HWnIZgU2W83CKhjnXVW9rOf.MqQWx1/mWO3TrwqJ/RjEwtNP5LN9u', 'Alguna #123', 'Masculino', '2016-12-23 22:25:48', '2016-12-24 12:31:54', 11111111, 'Administrador', 'inicio.panel', 'yugo', '20161223223147.png', NULL), (44, '201781280', 'Felipe', 'Yañez', 'Videla', 'elbestia@gmail.com', '$2a$10$uDsThO9nP8PSJHKdVI/adeetJfgb9AYRMPIEYobEZa0YX4sku2bO2', 'La tinaja s/n', 'Masculino', '2016-12-23 22:40:11', '2016-12-26 17:05:13', 76734528, 'Alumno', 'inicio.panel', 'JOyTTYgX', 'default.png', NULL), (45, '95290027', 'Andrea', 'Vidal', 'Pereira', 'muyloca@gmail.com', '$2a$10$rh/XJMok0dVJgKiXJsoHIOKtYbYInhWvuOTKppDVX7UgJ/5PW1ef.', 'san fernando s/n', 'Femenino', '2016-12-23 22:41:36', NULL, 89632781, 'Apoderado', 'inicio.panel', 'VtGaGBlQ', 'default.png', NULL), (46, '177466956', 'Andrés', 'Riveros', 'Marambio', 'androqk@gmail.com', '$2a$10$nJ7VS6kt5DAwE34W5.FBeO03Yelzun7cVP0NRK/Nb5bXZIKX7/7QO', 'Los Palacios s/n', 'Masculino', '2016-12-23 22:43:57', '2016-12-24 10:20:24', 11111111, 'Administrador', 'inicio.panel', '9DO9i80n', 'default.png', NULL), (47, '96625200', 'Arturo', 'Pratt', 'chacon', 'alabordaje@gmail.com', '$2a$10$kp6mp0/KRjScmOdkqFA9A.rUZ.B1.Z71iMyTFu/BfCrvnirSJ0CcW', 'Iquique, bajo el mar s/n', 'Masculino', '2016-12-23 23:04:01', NULL, 736346392, 'Profesor', 'inicio.panel', 'dtnLzjuj', 'default.png', NULL), (48, '88074521', 'Isaac', 'Newton', 'Perez', 'manzana@gmail.com', '$2a$10$v8BiF0eyqf8GUrsqHnon8.xuGpXrjvq3Ji85BLln7BFXU9ZaT2eDa', 'Francia', 'Masculino', '2016-12-23 23:06:32', NULL, 634462923, 'Profesor', 'inicio.panel', 'yTL4aBe3', 'default.png', NULL), (49, '15890747K', 'Albert', 'Einstein', 'Maturana', 'matematicaforever@gmail.com', '$2a$10$S2JcKlqoXrNd/.vqw4.yXu9alWRhEYiXzvxQCqO.5DHfsZDZgXCfW', 'El trapiche', 'Masculino', '2016-12-23 23:09:02', NULL, 344375863, 'Profesor', 'inicio.panel', 'Bfagohho', 'default.png', NULL), (50, '184334232', 'José Andrés', 'Aguirre', 'Pinto', 'eltato@gmail.com', '$2a$10$QWsQZBHYlo2JuOAbwv/8Luw.INRCajQ7R/3CtbK45fYkoDFPX5RDW', 'Rancagua', 'Masculino', '2016-12-23 23:13:20', NULL, 553782963, 'Profesor', 'inicio.panel', 'JIuzr3Gc', 'default.png', NULL), (51, '19683821K', 'Diego', 'San Martin', 'Carvajal', 'dsanmartin09@gmail.com', '$2a$10$fsdTi3f/HUchxQcEUQglieYcq.Kf9uHa0cRZI/iiDMjBKnQh0o3Pa', 'Villa San Francisco de Rauquen', 'Masculino', '2016-12-24 01:01:51', '2016-12-24 01:14:42', 111111111, 'Administrador', 'inicio.panel', 'julio90', 'default.png', NULL), (52, '18722151K', 'Alvaro Fabian', 'Cabrera', 'Cornejo', 'cabreracornejoa@gmail.com', '$2a$10$qsYj7FqMPOjW8rkBgs4IQ.Wleso8JQ/hJ2DtFkEfQBkGZjFP.dyxy', 'Villa Las Frutas, Las Frambuesas #126', 'Masculino', '2016-12-24 12:37:18', '2017-01-07 21:02:38', 975352432, 'Administrador', 'inicio.panel', '1111', '20161224123851.png', NULL), (53, '176871059', 'Valeria Andrea', 'Urzua', 'Ubilla', 'valeriaurzuaubilla@gmail.com', '$2a$10$SoVxzJ0zMjKmsNchVmiYPu1S0e/144ZIbs0ZnDSQOCjgDB3J.ZR3q', 'Alguna #123', 'Femenino', '2016-12-24 15:02:13', '2016-12-24 15:14:07', 12345678, 'Administrador', 'inicio.panel', 'aQyt0Snu', 'default.png', NULL), (54, '135705713', 'Rodrigo', 'Pedrero', 'Cadiz', 'rodpedrero@gmail.com', '$2a$10$mToEUn2wuPicYnJKcu9B/uCZWvwyFt7QGGfrjFeGS0hU46G..Qs9m', 'Alguna #123', 'Masculino', '2016-12-27 21:36:41', '2016-12-27 21:48:13', 123456789, 'Administrador', 'inicio.panel', '5OYgN0lJ', '20161227215544.png', NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario_token` -- CREATE TABLE IF NOT EXISTS `usuario_token` ( `idusuario_token` int(11) NOT NULL AUTO_INCREMENT, `token` text, `id_usuario` int(11) DEFAULT NULL, PRIMARY KEY (`idusuario_token`), KEY `fk_token_usuario_idx` (`id_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Volcado de datos para la tabla `usuario_token` -- INSERT INTO `usuario_token` (`idusuario_token`, `token`, `id_usuario`) VALUES (3, 'd_FpBmrAvJ0:APA91bE5-SVFPPgxpRjO7Ydglq0XcKH10AqMwh4kri_-xzoV2xlw5ve8HNc6RIjVpqHq4ZUoibIXVYXShqHlbEY0-xTYLsSfWvSoe-qLMxHiqSGrUP8dUdE6pQSmGSZd__D-drKfCn18', 28), (5, 'cyCnWt0q06c:APA91bHB8toPdJBe64bJpBifq7GmagLuQkfpEmvRQsP8IkSSYU1cZsRWAFclift11P_vZDvCZN_vJLSx2RWGB6GNUehjo5XEeCzGgfaNZn86SSOSfTtYtqvT7jfRWEtG18YAUY5Zup-y', 3), (6, 'fhvgaSzVG18:APA91bG-iYWF2zxSsxZVaDP-dd1sAVr2HuXdbYZE_e1jB2kHVCzQ7Gwu3pt8s0RVULaSNdixYq62yjRHFuSdzD3edF4wjFWwTdQz7yopYGG6Xecb9k7vv5ZCUKzuXOmxwQ8LIBJijj3J', 3); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `year` -- CREATE TABLE IF NOT EXISTS `year` ( `id_year` int(11) NOT NULL AUTO_INCREMENT, `nombre_year` varchar(45) DEFAULT NULL, `year` int(11) DEFAULT NULL, `asistente` tinyint(4) DEFAULT '0', `dias_asistencia` int(11) DEFAULT NULL, `estado` tinyint(4) DEFAULT '0', PRIMARY KEY (`id_year`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Volcado de datos para la tabla `year` -- INSERT INTO `year` (`id_year`, `nombre_year`, `year`, `asistente`, `dias_asistencia`, `estado`) VALUES (1, 'Año 2015', 2015, 0, NULL, 0), (2, 'Año 2016', 2016, 0, NULL, 0), (3, 'Año 2017', 2017, 0, NULL, 1); -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `administrativo` -- ALTER TABLE `administrativo` ADD CONSTRAINT `fk_admin_user` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `alumno` -- ALTER TABLE `alumno` ADD CONSTRAINT `fk_alumno_nivel` FOREIGN KEY (`nivel_alumno`) REFERENCES `curso` (`id_curso`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_alumno_user` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `alumno_curso` -- ALTER TABLE `alumno_curso` ADD CONSTRAINT `fk_alumno_curso_alumno` FOREIGN KEY (`id_alumno`) REFERENCES `alumno` (`id_alumno`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_alumno_curso_curso_anual` FOREIGN KEY (`id_curso_anual`) REFERENCES `curso_anual` (`id_curso_anual`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `apoderado` -- ALTER TABLE `apoderado` ADD CONSTRAINT `fk_apoderado_user` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `apoderado_alumno` -- ALTER TABLE `apoderado_alumno` ADD CONSTRAINT `fk_alumnoapd_year` FOREIGN KEY (`id_year`) REFERENCES `year` (`id_year`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_alumno_apoderado` FOREIGN KEY (`id_alumno`) REFERENCES `alumno` (`id_alumno`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_apoderado_alumno` FOREIGN KEY (`id_apoderado`) REFERENCES `apoderado` (`id_apoderado`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `asignatura` -- ALTER TABLE `asignatura` ADD CONSTRAINT `fk_asignatura_especialidad` FOREIGN KEY (`id_especialidad`) REFERENCES `especialidad` (`id_especialidad`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `asistencia` -- ALTER TABLE `asistencia` ADD CONSTRAINT `fk_asistencia_alumno_curso` FOREIGN KEY (`id_alumno_curso`) REFERENCES `alumno_curso` (`id_alumno_curso`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_asistencia_periodo_d` FOREIGN KEY (`id_detalle_periodo`) REFERENCES `periodo_asignatura_anual` (`id_periodo_asignatura_anual`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `carro_compra` -- ALTER TABLE `carro_compra` ADD CONSTRAINT `fk_carro_usuario` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `curso_anual` -- ALTER TABLE `curso_anual` ADD CONSTRAINT `fk_curso_anual_curso` FOREIGN KEY (`id_curso`) REFERENCES `curso` (`id_curso`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_curso_anual_especialidad` FOREIGN KEY (`id_especialidad`) REFERENCES `especialidad` (`id_especialidad`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_curso_anual_profe` FOREIGN KEY (`id_profesor`) REFERENCES `profesor` (`id_profesor`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `detalle_asignatura` -- ALTER TABLE `detalle_asignatura` ADD CONSTRAINT `fk_detalleasig_asignatura` FOREIGN KEY (`id_asignatura`) REFERENCES `asignatura` (`id_asignatura`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_detalleasig_curso` FOREIGN KEY (`id_curso`) REFERENCES `curso` (`id_curso`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `detalle_carro` -- ALTER TABLE `detalle_carro` ADD CONSTRAINT `fk_detallecarro_implemento` FOREIGN KEY (`id_implemento`) REFERENCES `implemento` (`id_implemento`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `fk_detalle_carro_compra` FOREIGN KEY (`id_carro`) REFERENCES `carro_compra` (`id_carro_compra`) ON DELETE CASCADE ON UPDATE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
------------------------ -- Academic History -- ------------------------ CREATE TABLE academicdegree ( -- No. 1 id SERIAL, uid int4 NOT NULL CONSTRAINT ad_ref_uid REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE, did int4 NOT NULL CONSTRAINT ad_ref_did REFERENCES degrees(id) ON UPDATE CASCADE DEFERRABLE, subtitle char(10) NULL, -- Iniciales como Sr., M. en C., Dr., etc degree char(255) NOT NULL,-- Nombre del posgrado o carrera university char(255) NOT NULL, -- Universidad faculty char(255) NOT NULL, -- Escuela o facultad donde estudio datebegin int4 NULL, -- Año de ingreso dateend int4 NULL, -- Año de egreso titleholder bool DEFAULT 'f' NOT NULL, -- Titulado datetitle int4 NULL, -- Año de obtención del grado gotdegreetype int2 NOT NULL CONSTRAINT ad_ref_gotdegreetype -- Tipo de obtención REFERENCES gotdegreetype(id) -- del grado: tesis, ON UPDATE CASCADE -- promedio, ceneval, etc DEFERRABLE, thesis text NULL, estid char(20) NULL, -- Matrícula professionalid char(30) NULL, -- Cedula profesional average float NULL, percentaje int4 NULL, dbuser text DEFAULT CURRENT_USER, dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE (uid, degree, university, faculty) ); ---------------- -- Log tables -- ---------------- CREATE TABLE academicdegree_logs ( -- No. 2 id int4, uid int4 NOT NULL, did int4 NOT NULL, subtitle char(10) NULL, degree char(255) NOT NULL, university char(255) NOT NULL, faculty char(255) NOT NULL, datebegin int4 NULL, dateend int4 NULL, titleholder bool DEFAULT 'f' NOT NULL, datetitle int4 NULL, gotdegreetype int2 NOT NULL, thesis text NULL, estid char(20) NULL, professionalid char(30) NULL, average float NULL, percentaje int4 NULL, dbuser text DEFAULT CURRENT_USER, dbtimestamp timestamp DEFAULT CURRENT_TIMESTAMP, dbmodtype char(1) ); ----------- -- Rules -- ----------- CREATE RULE academicdegree_update AS -- UPDATE rule ON UPDATE TO academicdegree DO INSERT INTO academicdegree_logs( id, uid, did, subtitle, degree, university, faculty, datebegin, dateend, titleholder, datetitle, gotdegreetype, thesis, estid, professionalid, average, percentaje, dbmodtype ) VALUES ( old.id, old.uid, old.did, old.subtitle, old.degree, old.university, old.faculty, old.datebegin, old.dateend, old.titleholder, old.datetitle, old.gotdegreetype, old.thesis, old.estid, old.professionalid, old.average, old.percentaje, 'U' ); CREATE RULE academicdegree_delete AS -- DELETE rule ON UPDATE TO academicdegree DO INSERT INTO academicdegree_logs( id, uid, did, subtitle, degree, university, faculty, datebegin, dateend, titleholder, datetitle, gotdegreetype, thesis, estid, professionalid, average, percentaje, dbmodtype ) VALUES ( old.id, old.uid, old.did, old.subtitle, old.degree, old.university, old.faculty, old.datebegin, old.dateend, old.titleholder, old.datetitle, old.gotdegreetype, old.thesis, old.estid, old.professionalid, old.average, old.percentaje, 'D' );