blob_id
stringlengths 40
40
| language
stringclasses 1
value | repo_name
stringlengths 5
133
| path
stringlengths 3
276
| src_encoding
stringclasses 33
values | length_bytes
int64 23
9.61M
| score
float64 2.52
5.28
| int_score
int64 3
5
| detected_licenses
listlengths 0
44
| license_type
stringclasses 2
values | text
stringlengths 23
9.43M
| download_success
bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
17ff3f199898ceaaea647cbc1e02c04292acb235
|
SQL
|
leaveslvmoon/basic
|
/src/main/resources/sql/role.sql
|
UTF-8
| 333
| 3.5
| 4
|
[] |
no_license
|
#sql("getRoleList")
select r.*, s.name as sname from sys_role r left join sys_menu s on r.menuId = s.id
where FIND_IN_SET(r.id,getRoleChildLst(#(map.id)))
and r.name like '%#(map.name)%'
#if(map.status!=null&&map.status!="")
and r.status = #(map.status)
#end
order by
#if(map.sort!=null) #(map.sort) #(map.order),#end
r.id desc
#end
| true
|
0494d9d9562b57fd886c88f2f0f72a685df51cf5
|
SQL
|
Michel0288/Meal-Planner-v1.2
|
/meal_planner.sql
|
UTF-8
| 3,276
| 4.46875
| 4
|
[] |
no_license
|
DROP DATABASE IF EXISTS mealplanner;
CREATE DATABASE mealplanner;
USE mealplanner;
DROP TABLE IF EXISTS account;
CREATE TABLE account(
account_id INT NOT NULL unique AUTO_INCREMENT ,
firstname VARCHAR(50) NOT NULL,
lastname VARCHAR(50) NOT NULL,
username VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
age INT NOT NULL,
gender VARCHAR (6) NOT NULL,
height VARCHAR(15),
weight INT NOT NULL,
allergies VARCHAR (50),
dietarylifestyle VARCHAR(50),
goal VARCHAR(50),
photo VARCHAR(200),
PRIMARY KEY(account_id)
);
DROP TABLE IF EXISTS recipe;
CREATE TABLE recipe(
recipe_id INT NOT NULL unique AUTO_INCREMENT,
recipe_name VARCHAR(200),
preparation_time INT,
meal_type VARCHAR(50),
servings INT,
photo VARCHAR(200),
totalcalories INT,
dateadded DATE DEFAULT NOW(),
PRIMARY KEY(recipe_id)
);
DROP TABLE IF EXISTS ingredients;
CREATE TABLE ingredients(
ingredient_id INT NOT NULL unique AUTO_INCREMENT,
ingredient_name VARCHAR(200),
calories_count INT,
measurement VARCHAR(500),
recipe_id INT NOT NULL,
PRIMARY KEY(ingredient_id),
foreign key(recipe_id) references recipe(recipe_id)
);
DROP TABLE IF EXISTS instructions;
CREATE TABLE instructions(
instruction_id INT NOT NULL unique AUTO_INCREMENT,
step_no INT,
instruction VARCHAR(5000),
recipe_id INT NOT NULL,
PRIMARY KEY(instruction_id),
foreign key(recipe_id) references recipe(recipe_id)
);
DROP TABLE IF EXISTS meal_plan;
CREATE TABLE meal_plan(
mealplan_id INT NOT NULL unique AUTO_INCREMENT,
meal_week DATE,
recipe_id INT NOT NULL,
account_id INT NOT NULL,
foreign key(recipe_id) references recipe(recipe_id) ON DELETE CASCADE ON UPDATE CASCADE,
foreign key(account_id) references account(account_id)
);
DROP TABLE IF EXISTS kitchen_stock;
CREATE TABLE kitchen_stock(
stock_id INT NOT NULL unique AUTO_INCREMENT,
stock_name VARCHAR(200),
quantity INT,
PRIMARY KEY(stock_id)
);
DROP PROCEDURE IF EXISTS FindIngredients;
DELIMITER //
CREATE PROCEDURE FindIngredients(IN id INT)
BEGIN
SELECT * FROM ingredients WHERE recipe_id = id;
END //
DELIMITER ;
DROP PROCEDURE IF EXISTS CalculateTotalCalories;
DELIMITER //
CREATE PROCEDURE CalculateTotalCalories(IN id INT)
BEGIN
SELECT calories_count,SUM(calories_count) AS totalcalories FROM ingredients WHERE recipe_id = id GROUP BY recipe_id;
UPDATE recipe set totalcalories = (SELECT SUM(calories_count) FROM ingredients WHERE recipe_id = id GROUP BY recipe_id) WHERE recipe_id = id;
END //
DELIMITER ;
DROP PROCEDURE IF EXISTS SearchFilter;
DELIMITER //
CREATE PROCEDURE SearchFilter(IN searchitem VARCHAR(100))
BEGIN
SELECT * FROM recipe WHERE recipe_name like CONCAT('%',searchitem,'%') OR totalcalories <= searchitem OR meal_type like CONCAT('%',searchitem,'%');
END //
DELIMITER ;
DROP PROCEDURE IF EXISTS supermarketlist;
DELIMITER //
CREATE PROCEDURE supermarketlist(IN id INT)
BEGIN
SELECT ingredient_name, measurement FROM ingredients JOIN recipe ON recipe.recipe_id=ingredients.recipe_id JOIN meal_plan on meal_plan.recipe_id = recipe.recipe_id WHERE meal_plan.account_id= id and ingredient_name NOT IN (SELECT stock_name FROM kitchen_stock);
END //
DELIMITER ;
| true
|
f409c574882d44c9100d87c4922e3038ae4d91af
|
SQL
|
Jimwi/gateway-generic
|
/docs/table.sql
|
UTF-8
| 3,254
| 3.375
| 3
|
[
"MIT"
] |
permissive
|
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for biz_binding
-- ----------------------------
DROP TABLE IF EXISTS `biz_binding`;
CREATE TABLE `biz_binding` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`biz_code` varchar(255) NOT NULL DEFAULT '',
`method_code` varchar(255) NOT NULL DEFAULT '',
`binding_status` varchar(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `key_method_code` (`method_code`),
KEY `unique_key_biz_code_method_code` (`biz_code`,`method_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for biz_info
-- ----------------------------
DROP TABLE IF EXISTS `biz_info`;
CREATE TABLE `biz_info` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`biz_code` varchar(255) NOT NULL DEFAULT '',
`biz_name` varchar(255) NOT NULL DEFAULT '',
`biz_status` varchar(3) NOT NULL DEFAULT '0',
`remark` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_biz_code` (`biz_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for biz_key
-- ----------------------------
DROP TABLE IF EXISTS `biz_key`;
CREATE TABLE `biz_key` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`biz_code` varchar(255) NOT NULL DEFAULT '',
`key_group` varchar(255) NOT NULL DEFAULT '',
`encrypt_type` varchar(255) NOT NULL DEFAULT '',
`encrypt_key` varchar(4096) NOT NULL DEFAULT '' COMMENT '1. encrypt_type = RSA encrypt_key = my privateKey ',
`decrypt_key` varchar(4096) NOT NULL DEFAULT '' COMMENT '1. encrypt_type = RSA encrypt_key = partner’s publicKey ',
`sign_type` varchar(255) NOT NULL DEFAULT '',
`sign_key` varchar(2048) NOT NULL DEFAULT '',
`key_status` varchar(3) NOT NULL DEFAULT '0',
`remark` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_key_biz_code` (`biz_code`,`key_group`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for method_info
-- ----------------------------
DROP TABLE IF EXISTS `method_info`;
CREATE TABLE `method_info` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`method_code` varchar(255) NOT NULL DEFAULT '',
`method_name` varchar(255) NOT NULL DEFAULT '',
`rpc_type` varchar(50) NOT NULL DEFAULT '',
`param_type` varchar(255) NOT NULL DEFAULT '',
`return_type` varchar(255) NOT NULL DEFAULT '',
`method_group` varchar(50) NOT NULL DEFAULT '',
`method_version` varchar(50) NOT NULL DEFAULT '',
`method_status` varchar(3) NOT NULL DEFAULT '0',
`remark` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_service_code` (`method_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;
| true
|
a62791001444d55f84ebb5858cf30d52ccf8c8ce
|
SQL
|
MaximDragosAndrei/fiimem
|
/exportins.sql
|
UTF-8
| 20,486
| 3.171875
| 3
|
[] |
no_license
|
CREATE or replace DIRECTORY NUME as 'C:\Users\Asus\Desktop\PSGBD proiect';
GRANT READ ON DIRECTORY NUME TO PUBLIC;
set serveroutput on;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_mid number(10,0);
v_surname varchar2(200);
v_firstname varchar2(200);
v_username varchar2(200);
v_email varchar2(200);
v_address varchar2(200);
v_password varchar2(200);
v_NUMRows integer;
v_count integer:=1;
v_phone number(13,0);
v_fictiv number(1,0);
v_bithdate timestamp(9);
v_deceaseddate timestamp(9);
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'MEMBERS') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select mid from Members order by mid asc) loop
stmt_str := 'select * from Members where mid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.mid);
dbms_sql.define_column(v_CursorID, 1, v_mid);
dbms_sql.define_column(v_CursorID, 2, v_surname,200);
dbms_sql.define_column(v_CursorID, 3, v_firstname, 200);
dbms_sql.define_column(v_CursorID, 4, v_username, 200);
dbms_sql.define_column(v_CursorID, 5, v_email,200);
dbms_sql.define_column(v_CursorID, 6, v_address, 200);
dbms_sql.define_column(v_CursorID, 7, v_phone);
dbms_sql.define_column(v_CursorID, 8, v_password,13);
dbms_sql.define_column(v_CursorID, 9, v_fictiv);
dbms_sql.define_column(v_CursorID, 10, v_bithdate);
dbms_sql.define_column(v_CursorID, 11, v_deceaseddate);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_mid);
dbms_sql.column_value(v_CursorID,2,v_surname);
dbms_sql.column_value(v_CursorID,3,v_firstname);
dbms_sql.column_value(v_CursorID,4,v_username);
dbms_sql.column_value(v_CursorID,5,v_email);
dbms_sql.column_value(v_CursorID,6,v_address);
dbms_sql.column_value(v_CursorID,7,v_phone);
dbms_sql.column_value(v_CursorID,8,v_password);
dbms_sql.column_value(v_CursorID,9,v_fictiv);
dbms_sql.column_value(v_CursorID,10,v_bithdate);
dbms_sql.column_value(v_CursorID,11,v_deceaseddate);
v_surname := chr(39)||v_surname||chr(39);
v_firstname := chr(39)||v_firstname||chr(39);
v_username :=chr(39)||v_username||chr(39);
v_email := chr(39)||v_email||chr(39);
v_address := chr(39)||v_address||chr(39);
v_password :=chr(39)||v_password||chr(39);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_mid||', '||v_surname||', '||v_firstname||', '||v_username||', '||v_email||', '||v_address||', '||v_phone||', '||v_password||', '||v_fictiv||', '||v_bithdate||', '||v_deceaseddate||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_mid number(10,0);
v_mid2 number(10,0);
v_relationship number(1,0);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export1.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'GENTREE') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select mid from GENTREE order by mid asc) loop
stmt_str := 'select * from Gentree where mid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.mid);
dbms_sql.define_column(v_CursorID, 1, v_mid);
dbms_sql.define_column(v_CursorID, 2, v_mid2);
dbms_sql.define_column(v_CursorID, 3, v_relationship);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_mid);
dbms_sql.column_value(v_CursorID,2,v_mid2);
dbms_sql.column_value(v_CursorID,3,v_relationship);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_mid||', '||v_mid2||', '||v_relationship||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_mid number(10,0);
v_hid number(10,0);
v_logindate timestamp(9);
v_logoutdate timestamp(9);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export2.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'HISTORY') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select mid from History order by mid asc) loop
stmt_str := 'select * from HISTORY where mid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.mid);
dbms_sql.define_column(v_CursorID, 1, v_mid);
dbms_sql.define_column(v_CursorID, 2, v_hid);
dbms_sql.define_column(v_CursorID, 3, v_logindate);
dbms_sql.define_column(v_CursorID, 4, v_logoutdate);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_mid);
dbms_sql.column_value(v_CursorID,2,v_hid);
dbms_sql.column_value(v_CursorID,3,v_logindate);
dbms_sql.column_value(v_CursorID,4,v_logoutdate);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_mid||', '||v_hid||', '||v_logindate||', '||v_logoutdate||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_fid number(10,0);
v_membersmid number(10,0);
v_address varchar2(200);
v_name varchar2(200);
v_format varchar2(200);
v_files blob;
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export3.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'FILES') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select membersmid from Files order by membersmid asc) loop
stmt_str := 'select * from Files where membersmid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.membersmid);
dbms_sql.define_column(v_CursorID, 1, v_fid);
dbms_sql.define_column(v_CursorID, 2, v_membersmid);
dbms_sql.define_column(v_CursorID, 3, v_address,200);
dbms_sql.define_column(v_CursorID, 4, v_name,200);
dbms_sql.define_column(v_CursorID, 5, v_format,200);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_fid);
dbms_sql.column_value(v_CursorID,2,v_membersmid);
dbms_sql.column_value(v_CursorID,3,v_address);
dbms_sql.column_value(v_CursorID,4,v_name);
dbms_sql.column_value(v_CursorID,5,v_format);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_fid||', '||v_membersmid||', '||v_address||', '||v_name||', '||v_format||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_mid number(10,0);
v_tid number(10,0);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export4.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'MEMBERS_TAGS') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select mid from Members_Tags order by mid asc) loop
stmt_str := 'select * from Members_Tags where mid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.mid);
dbms_sql.define_column(v_CursorID, 1, v_mid);
dbms_sql.define_column(v_CursorID, 2, v_tid);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_mid);
dbms_sql.column_value(v_CursorID,2,v_tid);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_mid||', '||v_tid||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_pid number(10,0);
v_rights varchar2(255);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export5.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'PRIVACY') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select pid from Privacy order by pid asc) loop
stmt_str := 'select * from Privacy where pid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.pid);
dbms_sql.define_column(v_CursorID, 1, v_pid);
dbms_sql.define_column(v_CursorID, 2, v_rights,200);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_pid);
dbms_sql.column_value(v_CursorID,2,v_rights);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_pid||', '||v_rights||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_pid number(10,0);
v_fid number(10,0);
v_filesmembersmid number(10,0);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export6.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'PRIVACY_FILES') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select pid from Privacy_Files order by pid asc) loop
stmt_str := 'select * from Privacy_Files where pid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.pid);
dbms_sql.define_column(v_CursorID, 1, v_pid);
dbms_sql.define_column(v_CursorID, 2, v_fid);
dbms_sql.define_column(v_CursorID, 2, v_filesmembersmid);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_pid);
dbms_sql.column_value(v_CursorID,2,v_fid);
dbms_sql.column_value(v_CursorID,2,v_filesmembersmid);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_pid||', '||v_fid||', '||v_filesmembersmid||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_pid number(10,0);
v_mid number(10,0);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export7.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'PRIVACY_MEMBERS') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select pid from Privacy_Members order by pid asc) loop
stmt_str := 'select * from Privacy_Members where pid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.pid);
dbms_sql.define_column(v_CursorID, 1, v_pid);
dbms_sql.define_column(v_CursorID, 2, v_mid);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_pid);
dbms_sql.column_value(v_CursorID,2,v_mid);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_pid||', '||v_mid||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_tid number(10,0);
v_name varchar2(255);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','export8.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'TAGS') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select tid from Tags order by tid asc) loop
stmt_str := 'select * from Tags where tid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.tid);
dbms_sql.define_column(v_CursorID, 1, v_tid);
dbms_sql.define_column(v_CursorID, 2, v_name,200);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_tid);
dbms_sql.column_value(v_CursorID,2,v_name);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_tid||', '||v_name||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
set SERVEROUTPUT ON;
declare
stmt_str varchar2(200);
v_col varchar2(300);
v_table varchar2(300);
v_column_list varchar2(300);
v_CursorID number;
v_tid number(10,0);
v_fid number(10,0);
v_filesmembersmid number(10,0);
v_NUMRows integer;
v_count integer:=1;
out_file utl_file.file_type;
begin
out_file := utl_file.fopen('NUME','exportp.sql','w');
v_CursorID := dbms_sql.open_cursor;
for v_linie in (select table_name from user_tables where table_name in 'TAGS_FILES') loop
for v_col in (select column_name, data_type from user_tab_cols where table_name=v_linie.table_name) loop
v_column_list:=v_column_list||', '||v_col.column_name;
v_column_list := ltrim(v_column_list,', ');
end loop;
for v_student in (select tid from Tags_Files order by tid asc) loop
stmt_str := 'select * from Tags_Files where tid = :id_value';
dbms_sql.parse(v_CursorID, stmt_str, dbms_sql.v7);
dbms_sql.bind_variable(v_CursorID, 'id_value', v_student.tid);
dbms_sql.define_column(v_CursorID, 1, v_tid);
dbms_sql.define_column(v_CursorID, 2, v_fid);
dbms_sql.define_column(v_CursorID, 2, v_filesmembersmid);
v_NumRows := dbms_sql.execute(v_CursorID);
loop
if dbms_sql.fetch_rows(v_CursorID)=0 then
exit;
end if;
dbms_sql.column_value(v_CursorID,1,v_tid);
dbms_sql.column_value(v_CursorID,2,v_fid);
dbms_sql.column_value(v_CursorID,2,v_filesmembersmid);
utl_file.put_line(out_file,v_count||' insert into '||v_linie.table_name||' ('||v_column_list||') values ('||v_tid||', '||v_fid||', '||v_filesmembersmid||')');
v_count:=v_count+1;
end loop;
end loop;
v_column_list := ltrim(v_column_list,', ');
dbms_output.put_line(v_column_list);
end loop;
dbms_sql.close_cursor(v_CursorID);
utl_file.fclose(out_file);
end;
/
| true
|
99f0e92e023314194d6e78b25eb973db9980b0d0
|
SQL
|
KaiCilliers/sql-mosh-course
|
/Retrieving Data From a Single Table/IS NULL Operator.sql
|
UTF-8
| 202
| 3.234375
| 3
|
[] |
no_license
|
-- SELECT *
-- FROM customers
-- WHERE phone IS NULL
-- WHERE phone IS NOT NULL
-- Exercise
-- Get the orders that are not shipped
SELECT *
FROM orders
WHERE shipped_date IS NULL
OR shipper_id IS NULL
| true
|
a761d3d637746d2426c83931748dae4bbefbdfb7
|
SQL
|
lckuiper/Hangfire.MySql
|
/src/Resources/install.sql
|
UTF-8
| 4,076
| 3.40625
| 3
|
[] |
no_license
|
/*
install.sql
Hangfire.MySql
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `Counter`
-- ----------------------------
CREATE TABLE `Counter` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Key` varchar(100) NOT NULL,
`Value` int(11) NOT NULL,
`ExpireAt` date DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `IX_Counter_Key` (`Key`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `DistributedLock`
-- ----------------------------
CREATE TABLE `DistributedLock` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Resource` varchar(100) DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_DistributedLock_Resource` (`Resource`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `Hash`
-- ----------------------------
CREATE TABLE `Hash` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Key` varchar(100) NOT NULL,
`Field` varchar(40) NOT NULL,
`Value` longtext,
`ExpireAt` datetime DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_Hash_Key_Field` (`Key`,`Field`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `Job`
-- ----------------------------
CREATE TABLE `Job` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`StateId` int(11) DEFAULT NULL,
`StateName` varchar(20) DEFAULT NULL,
`InvocationData` longtext NOT NULL,
`Arguments` longtext NOT NULL,
`CreatedAt` datetime NOT NULL,
`ExpireAt` datetime DEFAULT NULL,
`FetchedAt` datetime DEFAULT NULL,
`StateReason` longtext,
`StateData` longtext,
PRIMARY KEY (`Id`),
KEY `IX_Job_StateName` (`StateName`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `JobParameter`
-- ----------------------------
CREATE TABLE `JobParameter` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`JobId` int(11) NOT NULL,
`Name` varchar(40) NOT NULL,
`Value` longtext,
PRIMARY KEY (`Id`),
KEY `FK_JobParameter_Job` (`JobId`),
CONSTRAINT `FK_JobParameter_Job` FOREIGN KEY (`JobId`) REFERENCES `Job` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `JobQueue`
-- ----------------------------
CREATE TABLE `JobQueue` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`JobId` int(11) NOT NULL,
`Queue` varchar(20) NOT NULL,
`FetchedAt` datetime DEFAULT NULL,
`FetchToken` varchar(36) DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_JobQueue_FetchToken` (`FetchToken`),
KEY `FK_JobQueue_Job` (`JobId`),
CONSTRAINT `FK_JobQueue_Job` FOREIGN KEY (`JobId`) REFERENCES `Job` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `JobState`
-- ----------------------------
CREATE TABLE `JobState` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`JobId` int(11) NOT NULL,
`Name` varchar(20) NOT NULL,
`Reason` varchar(100) DEFAULT NULL,
`CreatedAt` datetime NOT NULL,
`Data` longtext,
PRIMARY KEY (`Id`),
KEY `FK_JobState_Job` (`JobId`),
CONSTRAINT `FK_JobState_Job` FOREIGN KEY (`JobId`) REFERENCES `Job` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `Server`
-- ----------------------------
CREATE TABLE `Server` (
`Id` varchar(50) NOT NULL,
`Data` longtext NOT NULL,
`LastHeartbeat` datetime DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `Set`
-- ----------------------------
CREATE TABLE `Set` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Key` varchar(100) NOT NULL,
`Value` varchar(256) NOT NULL,
`Score` float NOT NULL,
`ExpireAt` date DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_Set_Key_Value` (`Key`,`Value`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
| true
|
72e049b1f0d9ff4392b0e33b895ffbecafd2ec6b
|
SQL
|
MeisamMulla/cs50-problem-sets
|
/pset7/movies/8.sql
|
UTF-8
| 154
| 3.359375
| 3
|
[] |
no_license
|
SELECT
people.name
FROM
people
JOIN stars ON stars.movie_id = movies.id
JOIN movies ON movies.id = stars.movie_id
WHERE
movies.title LIKE "Toy Story"
| true
|
b1b5d3866b8d434a4627ab25707bff3cfba39a62
|
SQL
|
ProyectoReportes/Proyecto
|
/BD_10Agosto/bdReportes.sql
|
UTF-8
| 4,632
| 3.09375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-08-2014 a las 08:23:27
-- Versión del servidor: 5.6.17
-- Versión de PHP: 5.5.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 */;
--
-- Base de datos: `bdreportes`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_apchck`
--
CREATE TABLE IF NOT EXISTS `tbl_apchck` (
`cchkno` varchar(10) NOT NULL,
`cvend` varchar(10) NOT NULL,
`cpayto` varchar(40) NOT NULL,
`cchktype` varchar(1) NOT NULL,
`cbankno` varchar(10) NOT NULL,
`ctogl` varchar(10) NOT NULL,
`dcheck` datetime NOT NULL,
`dcreate` datetime NOT NULL,
`lcancel` tinyint(4) NOT NULL,
`lhold` tinyint(4) NOT NULL,
`nchkamt` decimal(16,2) NOT NULL,
`nxchgrate` decimal(16,2) NOT NULL,
`nbchkamt` decimal(16,2) NOT NULL,
PRIMARY KEY (`cchkno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_departamento`
--
CREATE TABLE IF NOT EXISTS `tbl_departamento` (
`id_departamento` int(11) NOT NULL AUTO_INCREMENT,
`nombre_departamento` varchar(45) NOT NULL,
PRIMARY KEY (`id_departamento`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_oficina`
--
CREATE TABLE IF NOT EXISTS `tbl_oficina` (
`id_oficina` smallint(6) NOT NULL,
`direccion` varchar(45) DEFAULT NULL,
`telefono` varchar(45) DEFAULT NULL,
`id_region` smallint(6) NOT NULL,
PRIMARY KEY (`id_oficina`),
UNIQUE KEY `id_region_UNIQUE` (`id_region`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_region`
--
CREATE TABLE IF NOT EXISTS `tbl_region` (
`id_region` smallint(6) NOT NULL AUTO_INCREMENT,
`nombre_region` varchar(45) NOT NULL,
PRIMARY KEY (`id_region`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_rol`
--
CREATE TABLE IF NOT EXISTS `tbl_rol` (
`id_rol` smallint(6) NOT NULL,
`descripcion` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id_rol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `tbl_rol`
--
INSERT INTO `tbl_rol` (`id_rol`, `descripcion`) VALUES
(1, 'Admin'),
(2, 'TI'),
(3, 'Contabilidad');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_rol_usuario`
--
CREATE TABLE IF NOT EXISTS `tbl_rol_usuario` (
`id_usuario` varchar(45) NOT NULL,
`id_rol` smallint(6) NOT NULL,
PRIMARY KEY (`id_usuario`,`id_rol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `tbl_rol_usuario`
--
INSERT INTO `tbl_rol_usuario` (`id_usuario`, `id_rol`) VALUES
('1', 1),
('2', 2),
('3', 3);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tbl_usuarios`
--
CREATE TABLE IF NOT EXISTS `tbl_usuarios` (
`id_usuario` varchar(45) NOT NULL,
`prnombre` varchar(50) NOT NULL,
`sgnombre` varchar(50) DEFAULT NULL,
`prapellido` varchar(50) NOT NULL,
`sgapellido` varchar(50) DEFAULT NULL,
`clave` varchar(30) NOT NULL,
`fecha_creacion` datetime DEFAULT NULL,
`fecha_ultimo_ingreso` datetime DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_usuario`),
UNIQUE KEY `id_usuario_UNIQUE` (`id_usuario`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `tbl_usuarios`
--
INSERT INTO `tbl_usuarios` (`id_usuario`, `prnombre`, `sgnombre`, `prapellido`, `sgapellido`, `clave`, `fecha_creacion`, `fecha_ultimo_ingreso`, `email`) VALUES
('1', 'Osly', 'Jonathan', 'Salinas', 'Padilla', 'mapper', '2014-08-01 00:00:00', '2014-08-10 00:00:00', 'ojsalinas@ministerio.com'),
('2', 'Transito', 'Josue', 'Matamoros', 'Zuniga', 'transito', '2014-08-01 00:00:00', '2014-08-10 00:00:00', 'transito@ministerio.com'),
('3', 'Juan', 'Mekelele', 'Ramirez', 'Ruiz', 'juan', '2014-08-01 00:00:00', '2014-08-10 00:00:00', 'juan@ministerio.com');
/*!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 */;
| true
|
8d4a02491c6d91fcab59f8b27529db2673b72d81
|
SQL
|
diegombt/data_analytics_uptc
|
/sqlite/Consultas - 25-Ago-2021.sql
|
UTF-8
| 3,777
| 4.28125
| 4
|
[] |
no_license
|
-- DataSet → Fifa19
------------------------------------------------------------------------------------------------------------
-- Consulta de ejemplo
------------------------------------------------------------------------------------------------------------
select iden, id, name, age, photo, nationality, overall, position, wage
from fifa19
where (nationality in ('Colombia', 'Ecuador', 'Argentina', 'Brazil')
and position in ('RF', 'CAM', 'CB', 'CDF'))
or (nationality = ('United States')
and wage between 50000 and 100000)
order by overall desc, age desc
------------------------------------------------------------------------------------------------------------
-- 1. Seleccionar el nombre, edad, nacionalidad, overall y wage de los jugadores ordenado de mayor a menor wage y limitarlo a 100 registros
select name, age, nationality, overall, wage
from fifa19
order by wage desc
limit 100
------------------------------------------------------------------------------------------------------------
-- 2. Hacer lo mismo, pero para los jugadores en las posiciones LW, CF, RW
select name, age, nationality, overall, wage
from fifa19
where position in ('LW', 'CF', 'RW')
order by wage desc
limit 100
------------------------------------------------------------------------------------------------------------
-- 3. Seleccionar overall y position para el top 50 jugadores con mejor Acceleration
select name, overall, position, acceleration
from fifa19
where acceleration is not null
and acceleration <> ''
order by acceleration desc
limit 50;
------------------------------------------------------------------------------------------------------------
-- 4. Cual es el top 5 de los jugadores menores de 18 años con mejor wage
select name, club, wage, overall, age
from fifa19
where age < 18
order by wage desc
limit 5
------------------------------------------------------------------------------------------------------------
-- 5. Cual es el top 5 de los jugadores sobre los 35 años con mejor overall
select name, club, wage, overall, age
from fifa19
where age >= 35
order by overall desc
limit 5
------------------------------------------------------------------------------------------------------------
-- 6. Seleccione 5 clubes y liste el nombre, wage y overall de todos sus jugadores, ordenado por overall de menor a mayor
select club, name, wage, overall
from fifa19
where club in (select distinct club from fifa19 limit 5)
order by club, overall;
-- Lo mismo pero más raro y con un CTE
with five_clubes as (select distinct club from fifa19 limit 5)
select club, name, wage, overall
from fifa19
where club in (select club from five_clubes)
union
select *
from (select club, name, wage, overall
from fifa19
where club not in (select club from five_clubes) -- Agrego un NOT IN
limit 1
) o -- Agrego la subconsulta solo como ejemplo
order by club, overall;
------------------------------------------------------------------------------------------------------------
-- 7. Cual es el top 10 de jugadores cuyo potential es alto pero tienen con wage por debajo de la media general
select name, potential, wage, club, overall, nationality
from fifa19
where wage < (select avg(wage) from fifa19)
order by potential desc;
------------------------------------------------------------------------------------------------------------
-- Funciones de agregación
select club
,nationality
,avg(overall) as avg_overall
,avg(wage) as avg_wage
,count(*) as players
,min(wage) as min_wage
,max(wage) as max_wage
,sum(wage) as total_wage
from fifa19
where club like '%club%'
group by club, nationality
order by club, total_wage desc;
| true
|
2732946f900b1174d3dd5621d52004665a9d8631
|
SQL
|
dretorrente/hjk_inventory
|
/hjk_inv.sql
|
UTF-8
| 4,496
| 3.28125
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 20, 2017 at 08:42 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.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: `hjk_inv`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`id`, `name`, `created`) VALUES
(1, 'Metal', '2017-10-21 00:59:59');
-- --------------------------------------------------------
--
-- Table structure for table `logs`
--
CREATE TABLE `logs` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `logs`
--
INSERT INTO `logs` (`id`, `name`, `created`) VALUES
(1, 'Category Metal has been added', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `medias`
--
CREATE TABLE `medias` (
`id` int(11) NOT NULL,
`file_name` varchar(255) NOT NULL,
`file_type` varchar(255) NOT NULL,
`created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`quantity` int(11) DEFAULT NULL,
`buy_price` decimal(25,0) DEFAULT NULL,
`sale_price` decimal(25,0) DEFAULT NULL,
`category_id` int(11) NOT NULL,
`media_id` int(11) DEFAULT NULL,
`created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sales`
--
CREATE TABLE `sales` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`price` decimal(25,0) NOT NULL,
`created` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`image` varchar(255) DEFAULT NULL,
`last_login` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `image`, `last_login`) VALUES
(1, 'admin', 'f883102ac89cc3e75ed3ac120312b370c1658612', NULL, '2017-10-21 00:58:38');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `logs`
--
ALTER TABLE `logs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `medias`
--
ALTER TABLE `medias`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sales`
--
ALTER TABLE `sales`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `logs`
--
ALTER TABLE `logs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `medias`
--
ALTER TABLE `medias`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sales`
--
ALTER TABLE `sales`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
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 */;
| true
|
1ac84540f26fbab02b507273cebbd07f9cf29ac5
|
SQL
|
EringiV3/learn-sql
|
/c/50.sql
|
UTF-8
| 174
| 2.640625
| 3
|
[] |
no_license
|
select
substring(職業コード, 1, 1),
max(HP),
min(HP),
avg(HP),
max(MP),
min(MP),
avg(MP)
from
パーティー
group by
substring(職業コード, 1, 1)
| true
|
b6ae63e693d5e50b7d166262e18f87a74bed112a
|
SQL
|
reyesdmusic/Employee-Tracker
|
/seed.sql
|
UTF-8
| 3,086
| 3.53125
| 4
|
[] |
no_license
|
DROP DATABASE IF EXISTS employeesDB;
CREATE DATABASE employeesDB;
USE employeesDB;
CREATE TABLE employee(
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
role_id INT NOT NULL,
manager_id INT NULL,
PRIMARY KEY (id)
);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Tony", "Albertson", 1, 4);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Toby", "McDermott", 1, 4);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Olga", "Pavlova", 1, 4);
INSERT INTO employee (first_name, last_name, role_id)
VALUES ("Maria","De la Costa", 2);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Alex", "Bienvenue", 3, 8);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Miguel", "Suarez", 3, 8);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Rebekah", "Glass", 3, 8);
INSERT INTO employee (first_name, last_name, role_id)
VALUES ("Richard", "Smith", 4);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Christina", "Lang", 5, 12);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Michael", "Zhou", 5, 12);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Monica", "Brighton", 5, 12);
INSERT INTO employee (first_name, last_name, role_id)
VALUES ("Ralph", "Vaughan Williams", 6);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Mahler", "Gustav", 7, 16);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Sondheim", "Stephen", 7, 16);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ("Guillermina", "Barroso-Orozco", 7, 16);
INSERT INTO employee (first_name, last_name, role_id)
VALUES ("Ignacio", "Barroso", 8);
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO department (name)
VALUES ("Sales");
INSERT INTO department (name)
VALUES ("Legal");
INSERT INTO department (name)
VALUES ("Finance");
INSERT INTO department (name)
VALUES ("Engineering");
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NOT NULL,
salary DECIMAL(10, 2) NOT NULL,
department_id INT NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO role (title, salary, department_id)
VALUES ("Sales Person", 55000, 1);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Sales Lead", 65000, 1);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Software Engineer", 65000, 4);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Lead Engineer", 100000, 4);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Accountant", 70000, 3);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Account Manager", 110000, 3);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Junior Legal", 100000, 2);
INSERT INTO role (id, title, salary, department_id)
VALUES ("Legal Team Lead", 150000, 2);
| true
|
ae69d9a0ca6b526f1aa1812f86c3a5daf1e2c6a5
|
SQL
|
Ming-JU/ORACLE_SQL
|
/0104연습.sql
|
UHC
| 2,851
| 4.28125
| 4
|
[] |
no_license
|
--ADVANCED SQL
--6 Լ
--1
SELECT DEPTNO, SUM(SAL) AS SUM_SAL
FROM EMP
GROUP BY DEPTNO
UNION ALL
SELECT NULL, SUM(SAL)
FROM EMP
ORDER BY DEPTNO; -- ü հ赵
SELECT DEPTNO, SUM(SAL) AS SUM_SAL
FROM EMP
GROUP BY ROLLUP(DEPTNO);
SELECT DEPTNO, JOB, SUM(SAL)
FROM EMP
GROUP BY CUBE(DEPTNO, JOB)
ORDER BY DEPTNO, JOB;
--2
SELECT DEPTNO, JOB, SUM(SAL)
FROM EMP
GROUP BY DEPTNO, ROLLUP(JOB); --DEPTNO GROUPING
--߰
SELECT TO_CHAR(HIREDATE,'YYYY') AS YEAR,DEPTNO,JOB,SUM(SAL),
GROUPING_ID(TO_CHAR(HIREDATE,'YYYY'),DEPTNO,JOB) AS EXPRESSION
FROM EMP
GROUP BY ROLLUP(TO_CHAR(HIREDATE, 'YYYY')), CUBE(DEPTNO, JOB)
ORDER BY EXPRESSION, YEAR, DEPTNO, JOB;
--3
SELECT DEPTNO, EMPNO, ENAME, SUM(SAL) AS SAL
FROM EMP
GROUP BY DEPTNO, ROLLUP((EMPNO,ENAME)); -- Ұ
SELECT deptno, empno, ename, SUM(sal) AS sal
FROM emp
GROUP BY ROLLUP(deptno, (empno,ename)) ; -- üհ赵 °
--4
SELECT deptno, empno, ename,
DECODE(grouping_id(1,deptno),3,ROUND(AVG(sal),2),SUM(sal)) AS sal --3϶ SUM
FROM emp
WHERE deptno = 30
GROUP BY ROLLUP(1,(deptno,empno,ename));
/*
(1,(deptno,empno,ename)) --
(1)--μ ձ
()--ü ϳ
grouping_id(1,deptno)
0 0 => 0 -SUM
0 1 => 1 -SUM
1 1 => 3 -AVG
*/
SELECT deptno, job, SUM(sal),
GROUPING(deptno), GROUPING(job), GROUPING_ID(deptno,job)
FROM emp
GROUP BY CUBE(deptno,job)
ORDER BY 6 ;
SELECT DECODE(GROUPING(1), 0, SUM(sal), AVG(sal)) AS COMPUTE
FROM emp
GROUP BY ROLLUP(1) ;
--5
SELECT DEPTNO, EMPNO
DECODE(GROUPING_ID(1,DEPTNO,2,EMPNO),1,'DEPT_SUM', 3,'DEPT_AVG',
7,'TOTAL_SUM',15,'TOTAL_AVG',
ENAME) AS ENAME,
DECODE(GROUPING_ID(1,DEPTNO,2,EMPNO),1,SUM(SAL), 3,ROUND(AVG(SAL),1),
7,SUM(SAL), 15,ROUND(AVG(SAL),1),
SUM(SAL)) AS SAL
FROM EMP
GROUP BY ROLLUP(1,DEPTNO,2,(EMPNO,ENAME));
SELECT deptno, empno,
DECODE(grouping_id(1,deptno,2,empno), 1,'DEPT_SUM', 3,'DEPT_AVG',
7,'TOTAL_SUM', 15,'TOTAL_AVG',
ename) AS ename,
DECODE(grouping_id(1,deptno,2,empno), 1,SUM(sal), 3,ROUND(AVG(sal),1),
7,SUM(sal), 15,ROUND(AVG(sal),1),
SUM(sal)) AS sal
FROM emp
GROUP BY ROLLUP(1,deptno,2,(empno,ename));
--6
| true
|
faf1e132f02b57f87056c18d7901cee16d2b59aa
|
SQL
|
hardlywave/KBD
|
/sql1/scripts/queries/querie_4.sql
|
UTF-8
| 281
| 3.53125
| 4
|
[] |
no_license
|
SELECT DISTINCT s.subject_code_number, s.name_subject
FROM subject AS s
LEFT JOIN teacher_student_group AS tsg ON tsg.subject_code_number = s.subject_code_number
left join teacher AS t on tsg.personal_number = t.personal_number
WHERE t.last_name = 'Костин';
| true
|
8d8372e1fc9ee9077500930043d2f2ceb3573d31
|
SQL
|
qingchen191/workspace
|
/mysqlSelect.sql
|
UTF-8
| 1,826
| 3.640625
| 4
|
[] |
no_license
|
SELECT * FROM qingchen_171.wqtab order by idwqtab desc limit 0,100;
SELECT * FROM qingchen_171.wqtab where type='click' order by idwqtab desc limit 0,40;
'2013-06-29 16:44:12'
SELECT * FROM qingchen_171.wqtab where addtime > '2013-06-29' and type = 'click' and game = '%E4%BF%9D%E5%8D%AB%E9%92%93%E9%B1%BC%E5%B2%9B';
SELECT hour(addtime),count(*) FROM qingchen_171.wqtab where game='%E4%BF%9D%E5%8D%AB%E9%92%93%E9%B1%BC%E5%B2%9B' and addtime > '2013-06-30' and type = 'view' group by hour(addtime);
SELECT hour(addtime),count(*) FROM qingchen_171.wqtab where game='%E4%BF%9D%E5%8D%AB%E9%92%93%E9%B1%BC%E5%B2%9B' and date_format(addtime,'%Y-%m-%d') = '2013-07-10' and type = 'click' group by hour(addtime);
SELECT game,type,count(*),count(*)*0.3 amount FROM qingchen_171.wqtab where date_format(addtime,'%Y-%m-%d') = '2013-06-30' group by game,type;
select g.chnname,v.cnt,c.cnt,c.amount from
(select game,count(*) cnt from wqtab where type = 'view' and date_format(addtime,'%Y-%m-%d') = '2013-07-11' group by game) v,
(select game,count(*) cnt,count(*)*0.3 amount from wqtab where type = 'click' and date_format(addtime,'%Y-%m-%d') = '2013-07-11' group by game) c,
wqgames g
where v.game = c.game and c.game = g.name
and g.chnname = '太空竞速';
select v.game,v.cnt,c.cnt,c.amount from
(select game,count(*) cnt from wqtab where type = 'view' and addtime > '2013-07-03 20:00:00' and addtime < '2013-07-03 22:00:00' group by game) v,
(select game,count(*) cnt,count(*)*0.3 amount from wqtab where type = 'click' and addtime > '2013-07-03 20:00:00' and addtime < '2013-07-03 22:00:00' group by game) c,
wqgames g
where v.game = c.game and c.game = g.name
2013-07-03 18:39:07
SELECT game,type,count(*),count(*)*0.3 amount FROM qingchen_171.wqtab where addtime > '2013-07-01' group by game,type order by type,game;
| true
|
561cc95d77dd9cfadd72efa785c32d0ecf815409
|
SQL
|
ricksonre/ThePotatoZone-304
|
/lab_9/lab_9.sql
|
UTF-8
| 1,964
| 4.34375
| 4
|
[] |
no_license
|
drop view customerandorders;
--Question 1 - Views and Security
-- 1
create view customerandorders as
select c.*, s.orderId, s.OrderDate, s.TotalAmount,
o.productId, o.quantity, o.price
from customer as c
left join ordersummary as s
on c.customerId = s.customerId
left join orderproduct as o
on s.orderId = o.orderId
where c.state = 'AL';
-- 2
-- the view is not updatable because it
-- does not select information from a single table
-- it uses join to get from multiples
--3
grant
select on product
to MANAGER
grant
update, insert on customer
to MANAGER;
-- 4
grant
select
on customerandorders
to MANAGER
-- does it grant only ???
--Question 2 - Triggers
--1
CREATE TRIGGER updateordersummary
AFTER UPDATE ON orderproduct
REFERENCING
NEW ROW AS UpdatedR
OLD ROW AS OldR
UPDATE ordersummary SET totalAmount = totalAmount +(UpdatedR.quantity*UpdatedR.price)-(OldR.quantity*OldR.price) WHERE UpdatedR.orderId = ordersummary.orderId
CREATE TRIGGER insertordersummary
AFTER INSERT ON orderproduct
REFERENCING
NEW ROW AS UpdatedR
FOR EACH ROW
UPDATE ordersummary SET totalAmount = totalAmount +UpdatedR.quantity*UpdatedR.price WHERE UpdatedR.orderId = ordersummary.orderId
CREATE TRIGGER deleteordersummary
AFTER DELETE ON orderproduct
REFERENCING
OLD ROW AS OldR
FOR EACH ROW
UPDATE ordersummary SET totalAmount = totalAmount -OldR.quantity*OldR.price WHERE OldR.orderId = ordersummary.orderId
--2
CREATE TRIGGER deletecustomerordersum
BEFORE DELETE ON customer
REFERENCING
OLD ROW AS OldR
FOR EACH ROW
DELETE FROM ordersummary WHERE OldR.customerId = ordersummary.customerId
CREATE TRIGGER deletecustomerorderprod
BEFORE DELETE ON ordersummary
REFERENCING
OLD ROW AS OldR
FOR EACH ROW
DELETE FROM orderproduct WHERE OldR.orderId = orderproduct.orderId
| true
|
c97a6d0fa32c7a390ea8499ceadf9aed8e8bb966
|
SQL
|
koreahong/SQL-Tableau
|
/깃허브(Github)/CHAPTER 08/5. (CHAPTER 08 요약) 데이터 시각화에 필요한 Tableau/5-1. Tableau에 숨겨진 SQL/Tableau에 숨겨진 SQL.sql
|
UHC
| 1,031
| 4.375
| 4
|
[] |
no_license
|
USE EDU
--[Car_order] [Car_member] LEFT JOIN
SELECT *
FROM [Car_order] A
LEFT
JOIN [Car_member] B
ON A.mem_no = B.mem_no
-- ȸ(SELECT) Բ Ǵ
SELECT YEAR(join_date) AS Կ
,gender
,COUNT(DISTINCT A.mem_no) AS ڼ
FROM [Car_order] A
LEFT
JOIN [Car_member] B
ON A.mem_no = B.mem_no
WHERE YEAR(order_date) = '2021'
GROUP
BY YEAR(join_date)
,gender
HAVING COUNT(DISTINCT A.mem_no) >= 50
ORDER
BY 1,2
--ٽ Ÿ
SELECT CASE WHEN age >= 30 AND age < 40 THEN '30(ٽɰ)'
WHEN age >= 20 AND age < 30 THEN '20(Ÿٰ)'
ELSE ' ' END AS з
,COUNT(DISTINCT A.mem_no) AS ڼ
FROM [Car_order] A
LEFT
JOIN [Car_member] B
ON A.mem_no = B.mem_no
GROUP
BY CASE WHEN age >= 30 AND age < 40 THEN '30(ٽɰ)'
WHEN age >= 20 AND age < 30 THEN '20(Ÿٰ)'
ELSE ' ' END
| true
|
8dbeddcf0799d6a2a8394b7840c35e88e1da68bc
|
SQL
|
emilia98/SoftUni-CSharp-DB
|
/DB-Basics-MSSQL-Server/Exams/Databases Sample Exam/03.Ads_With_Yes_No_Images.sql
|
UTF-8
| 1,115
| 2.59375
| 3
|
[
"MIT"
] |
permissive
|
USE "Ads";
SELECT
Title,
[Date],
CASE
WHEN ImageDataURL IS NULL THEN 'no'
ELSE 'yes'
END AS "Has Image"
FROM
"Ads"
ORDER BY
Id ASC;
/*
Title Date Has Image
Just a Joke 2014-12-24 23:53:17.000 no
2 bed apartment to let 2014-12-24 20:21:11.000 no
BMW 320 for Sale 2014-12-26 12:37:50.000 yes
iPhone 4S for Sale 2014-12-27 01:56:47.000 yes
Job as Housekeeper 2014-12-30 23:43:30.000 no
Ford Mondeo Zetec 1.8TDCI, 2009 2015-01-01 09:08:38.000 yes
Afterschool Bus Driver 2014-12-27 17:11:00.000 no
Nikon D5100 DSLR c/w 18-55mm Lens + Kit 2014-12-23 19:04:27.000 yes
iPad 4 128GB 4G 2014-12-31 05:18:41.000 yes
Skandika Vancouver 6 Tent 2014-12-26 11:42:40.000 yes
Free cat. Great hunter 2014-12-24 17:38:58.000 no
Free cat 2014-12-26 05:14:30.000 no
Free dog 2015-01-01 20:07:33.000 no
Free MP3 Player 2014-12-24 05:15:37.000 no
3 bed apartment to let 2014-12-26 17:16:24.000 yes
Free porno 2015-01-02 11:33:00.000 no
2012 Nissan Altima 3.5 SR 2dr Coupe CVT 2015-02-02 22:44:00.000 no
Lexus SC 430 Gold (2006) 2015-02-19 17:36:00.000 yes
Pharmacy Technician Job (Walgreens) 2015-01-31 12:00:00.000 no
*/
| true
|
5d33240624b297dfefb2f1e11c3209d1a75e8c88
|
SQL
|
Symplicity/subdivision-list
|
/data/en/sqlite/subdivisions_ZW.sqlite.sql
|
UTF-8
| 1,162
| 2.6875
| 3
|
[
"MIT"
] |
permissive
|
CREATE TABLE subdivision_ZW (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-BU', 'Bulawayo', 'city');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-HA', 'Harare', 'city');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MA', 'Manicaland Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MC', 'Mashonaland Central Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-ME', 'Mashonaland East Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MW', 'Mashonaland West Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MV', 'Masvingo', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MN', 'Matabeleland North Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MS', 'Matabeleland South Province', 'province');
INSERT INTO "subdivision_ZW" ("id", "name", "level") VALUES ('ZW-MI', 'Midlands', 'province');
| true
|
e169c480f374b09005a221735327a32a05afb8b0
|
SQL
|
carbon8/Sportscar-Standings
|
/App_Data/Install/SQL Folder/Objects/CMS_SMTPServerSite.sql
|
UTF-8
| 743
| 3.296875
| 3
|
[] |
no_license
|
CREATE TABLE [CMS_SMTPServerSite] (
[ServerID] [int] NOT NULL,
[SiteID] [int] NOT NULL
)
ALTER TABLE [CMS_SMTPServerSite]
ADD
CONSTRAINT [PK_CMS_SMTPServerSite]
PRIMARY KEY
CLUSTERED
([ServerID], [SiteID])
ALTER TABLE [CMS_SMTPServerSite]
WITH CHECK
ADD CONSTRAINT [FK_CMS_SMTPServerSite_CMS_Site]
FOREIGN KEY ([SiteID]) REFERENCES [CMS_Site] ([SiteID])
ALTER TABLE [CMS_SMTPServerSite]
CHECK CONSTRAINT [FK_CMS_SMTPServerSite_CMS_Site]
ALTER TABLE [CMS_SMTPServerSite]
WITH CHECK
ADD CONSTRAINT [FK_CMS_SMTPServerSite_CMS_SMTPServer]
FOREIGN KEY ([ServerID]) REFERENCES [CMS_SMTPServer] ([ServerID])
ALTER TABLE [CMS_SMTPServerSite]
CHECK CONSTRAINT [FK_CMS_SMTPServerSite_CMS_SMTPServer]
| true
|
a111c579b874932494d04f472dfa19fb6eab8d0a
|
SQL
|
YifanEvaWang/Car-Database-Management-System
|
/src/DB-ERD-SCRIPT/triggers_and_procedures/PartsG4_PROC_PART_UPDATE_G4.sql
|
UTF-8
| 1,994
| 4.0625
| 4
|
[] |
no_license
|
DELIMITER //
CREATE PROCEDURE `PROC_PART_UPDATE_G4`(IN inPartNoG4 INT(11), IN inPartNameG4 VARCHAR(255), IN inPartDescriptionG4 VARCHAR(255), IN inCurrentPriceG4 DECIMAL(19,4), IN inQtyG4 INT(11), inMinQtyG4 int(11))
BEGIN
-- DECLARE THE VARIABLES FOR THE QUANTITY CALCULATION.
DECLARE CURR_QTY INT;
DECLARE MIN_QTY INT;
-- DEFINE AN ERROR HANDLING. FIRST ROLLBACK THEN RETHROW THE ERROR TO THE REQUESTOR APPLICATION.
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
BEGIN
ROLLBACK;
RESIGNAL;
END;
-- TRANSACTION
START TRANSACTION;
IF ISNULL(inPartNameG4) OR ISNULL(inPartDescriptionG4) OR ISNULL(inCurrentPriceG4) OR ISNULL(inQtyG4) OR ISNULL(inMinQtyG4) THEN
-- USER DEFINED ERROR (NULL VALUE IS NOT ACCEPTED).
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT='Null value is not accepted.';
ELSEIF (SIGN(inQtyG4) < 0) OR (SIGN(inMinQtyG4) < 0) THEN
-- USER DEFINED ERROR (QTY OR MINQTY CANNOT BE LESS THAN ZERO).
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT='QTY and minQTY cannot be less than zero.';
ELSE
-- UPDATE THE INFORMATION IN THE PARTSG4 TABLE.
UPDATE PartsG4 SET partNameG4=inPartNameG4, partDescriptionG4=inPartDescriptionG4,
currentPriceG4=inCurrentPriceG4, qtyG4=inQtyG4, minQtyG4=inMinQtyG4 WHERE partNoG4=inPartNoG4;
-- RECALCULATE AND UPDATE THE REORDER FLAG.
SELECT qtyG4 INTO CURR_QTY FROM PartsG4 WHERE partNoG4 = inPartNoG4;
SELECT minQtyG4 INTO MIN_QTY FROM PartsG4 WHERE partNoG4 = inPartNoG4;
IF (CURR_QTY < MIN_QTY) THEN
-- MARK THE PART TO BE REORDERED SINCE THE CURRENT QUANTITY IS BELOW THE MANDATORY THRESHOLD.
UPDATE PartsG4 SET reorderG4 = 1 WHERE partNoG4 = inPartNoG4;
ELSE
-- MARK THE PART NOT TO BE REORDERED.
UPDATE PartsG4 SET reorderG4 = 0 WHERE partNoG4 = inPartNoG4;
END IF;
-- RETURN THE UPDATED INFORMATION BACK TO THE REQUESTOR.
SELECT * FROM PartsG4 WHERE partNoG4=inPartNoG4;
END IF;
-- COMMIT THE ENTIRE CHANGE.
COMMIT;
END //
DELIMITER ;
| true
|
0823a75c3409c6a5fa08140f71e7227c630e2738
|
SQL
|
morph3o/MotelManager
|
/PostgreSQL/last/02_CT_PRODUCTO_psql.sql
|
UTF-8
| 812
| 3.4375
| 3
|
[] |
no_license
|
-- Converted by db_converter
START TRANSACTION;
SET standard_conforming_strings=off;
SET escape_string_warning=off;
SET CONSTRAINTS ALL DEFERRED;
CREATE TABLE "producto" (
"id" integer NOT NULL,
"id_prod" integer NOT NULL,
"nm_prod" varchar(400) NOT NULL,
"tipo_prod" varchar(400) NOT NULL,
"marca" varchar(200) NOT NULL,
"cant_prod" integer DEFAULT NULL,
"imagen" varchar(800) NOT NULL,
"detalle" varchar(800) NOT NULL,
PRIMARY KEY ("id"),
UNIQUE ("id_prod")
);
-- Post-data save --
COMMIT;
START TRANSACTION;
-- Typecasts --
-- Foreign keys --
-- Sequences --
CREATE SEQUENCE producto_id_seq;
SELECT setval('producto_id_seq', max(id)) FROM "producto";
ALTER TABLE "producto" ALTER COLUMN "id" SET DEFAULT nextval('producto_id_seq');
-- Full Text keys --
COMMIT;
| true
|
61a4d6b695357ef4d8d6a5a43a1262ceaa529075
|
SQL
|
DimolSPA/Dimol-Fix-Carteras
|
/Dimol.Carteras/Dimol.Carteras.Database/dbo/Stored Procedures/Procs2/Find_Cartera_Clientes.sql
|
UTF-8
| 261
| 2.640625
| 3
|
[] |
no_license
|
Create Procedure Find_Cartera_Clientes(@ctc_codemp integer, @ctc_pclid integer, @ctc_ctcid integer) as
select count(ctc_ctcid)
from cartera_clientes
where ctc_codemp = @ctc_codemp and
ctc_pclid = @ctc_pclid and
ctc_ctcid = @ctc_ctcid
| true
|
1ff69f6e3b3e62fbc561e66156502ccb14be6aeb
|
SQL
|
ferrolho/feup-ldso
|
/mini-apps/lyrics-mini-app/conf/evolutions/default/3.sql
|
UTF-8
| 274
| 2.984375
| 3
|
[
"Apache-2.0"
] |
permissive
|
# --- !Ups
create table "musics" (
"id" bigint generated by default as identity(start with 1) not null primary key,
"album_id" bigint not null references "albums",
"title" varchar not null,
"lyrics" varchar not null
);
# --- !Downs
drop table "musics" if exists;
| true
|
1122d31efb576a6df50166bc0de28cdde0938d07
|
SQL
|
chaochao1/BI_framework_oracle
|
/ETL_MD_ETL_LOG_DETAIL.prc
|
UTF-8
| 1,276
| 3.421875
| 3
|
[] |
no_license
|
/* by chaochao
created at 2018-12-29
This is the log etl for the framework, every etl script should run in it.
Every execution will insert one record to our detail table.
用于插入每次etl运行信息的etl日志脚本。
*/
CREATE OR REPLACE
PROCEDURE etl_md_etl_log_detail(
v_etl_number INT,
v_etl_name VARCHAR2,
v_error_code VARCHAR2,
v_error_message VARCHAR2,
v_insert INT,
v_update INT,
v_delete INT
) AS
BEGIN
INSERT INTO dw_log_detail(
etl_number,
etl_name,
error_code,
error_message,
v_insert,
v_update,
v_delete,
create_time
)
VALUES
(
v_etl_number,
v_etl_name,
v_error_code,
v_error_message,
v_insert,
v_update,
v_delete,
SYSDATE
) ; COMMIT ;
END etl_md_etl_log_detail ;
/*
create table dw_log_detail(
id int constraint pk_id primary key,
etl_number int,
etl_name varchar2(2000),
error_code varchar2(50),
error_message varchar2(1000),
v_insert int,
v_update int,
v_delete int,
create_time DATE,
primary key(ID)
);
create sequence dw_log_detail_eid_SEQ MINVALUE 1 NOMAXVALUE INCREMENT BY 1 START WITH 1 NOCACHE;
create or replace Trigger dw_log_detail_ins_trg before insert on dw_log_detail for each row when (new.eid is null)
BEGIN
select dw_log_detail_eid_SEQ.nextval into :new.eid from dual;
END;
*/
| true
|
882208b0d2eb4d88de65930efbb280b4db6bb0fe
|
SQL
|
MG-RAST/CV-service
|
/schema/schema.sql
|
UTF-8
| 323
| 2.71875
| 3
|
[] |
no_license
|
GRANT ALL PRIVILEGES ON CVSERVICE.* TO 'cvservice'@'localhost' IDENTIFIED BY 'cvservice';
USE CVSERVICE;
CREATE TABLE IF NOT EXISTS terms (id INT NOT NULL AUTO_INCREMENT, name text, PRIMARY KEY (id));
CREATE TABLE IF NOT EXISTS synonyms (id INT NOT NULL, synonym text);
GRANT ALL PRIVILEGES ON *.* TO 'cvservice'@'%' ;
| true
|
5305da561b05a43a7ae9ae75e37b6c285bc64bd4
|
SQL
|
chrajesh/LibraryManagementSystem
|
/library(2).sql
|
UTF-8
| 11,622
| 3.171875
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 24, 2014 at 06:54 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
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: `library`
--
-- --------------------------------------------------------
--
-- Table structure for table `bookentry`
--
CREATE TABLE IF NOT EXISTS `bookentry` (
`accNo` int(11) NOT NULL DEFAULT '0',
`title` varchar(45) NOT NULL,
`author` varchar(45) NOT NULL,
`subject` varchar(45) NOT NULL,
`edition` varchar(45) NOT NULL,
`publication` varchar(45) NOT NULL,
`price` int(11) NOT NULL,
`isbn` varchar(45) NOT NULL,
`totalCount` int(11) DEFAULT NULL,
`issuedCount` int(11) DEFAULT NULL,
PRIMARY KEY (`accNo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `bookentry`
--
INSERT INTO `bookentry` (`accNo`, `title`, `author`, `subject`, `edition`, `publication`, `price`, `isbn`, `totalCount`, `issuedCount`) VALUES
(1, 'c programming by balaguruswamy', 'balaguruswamy', 'computers', '1', 'pearson', 200, '1234-5678-8910', 10, 4),
(2, 'let us c', 'yeswanth kanithkar', 'computers', '1', 'pearson', 300, '1234-5678-8910', 15, 1),
(3, 'head first java', 'james gosling', 'computers', '3', 'headfirst', 450, '1234-567-1234', 5, 2),
(4, 'object oriented programming', 'Balaguruswamy', 'computers', '5', 'pearson', 500, '34213-423-2132', 2, 2),
(5, 'Organigational Behaviour', 'Mogli', 'Management', '2', 'pearson', 210, '11-20-1223', 6, 4),
(6, 'Commutative Algebra', 'Ramanujan', 'Maths', '5', 'indian', 410, '132-34-56', 10, 2),
(7, 'physics experiment-2', 'cv.raman', 'physics', '2', 'indian', 315, '111-22-33-0', 7, 2),
(8, 'Data structures', 'kanithkar', 'computers', '2', 'pearson', 220, '22-02-331', 5, 1),
(9, 'Elements Of The Theory Of Computation', 'Harry R Lewis', 'Theory Of Computation', '1', 'pearson', 310, '10:0-07-107283-7', 10, 1),
(10, 'Introduction to Automata Theory', 'Hopcroft.J.E', 'Theory Of Computation', '2', 'Higher Education', 212, '13:978-07-10783-0', 5, 0),
(11, 'Computer Graphics', 'Donald Hearn', 'computers', 'C Version', 'pearson', 250, '11:00-20-03451', 9, 1),
(12, 'An Object Oriented Approach with C++', 'Bill Zoellick and Greg Riccardi', 'File Structures', '5', 'pearson', 350, '12:11-230-34671', 3, 3),
(13, 'Management Accounts', 'Michael J.Folk', 'Accounts', '4', 'Higher Education', 415, '10:11-138-001-0', 5, 2),
(14, 'Fundamentals Of Algorithms', 'kanithkar', 'Design And Analysis Of Algorithms', '2', 'Himalayas', 225, '5:01-34-267-1', 3, 3),
(15, 'OOSE', 'yeswanth kanithkar', 'computers', '2nd', 'pearson', 350, '22-02-331', 5, 1);
-- --------------------------------------------------------
--
-- Table structure for table `clerkinfo`
--
CREATE TABLE IF NOT EXISTS `clerkinfo` (
`id` int(11) NOT NULL DEFAULT '0',
`fullName` varchar(100) DEFAULT NULL,
`qualification` varchar(50) DEFAULT NULL,
`address` varchar(200) DEFAULT NULL,
`emailId` varchar(50) DEFAULT NULL,
`contactNo` varchar(10) DEFAULT NULL,
`gender` varchar(1) DEFAULT NULL,
`usersTableClerkId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `clerkinfo`
--
INSERT INTO `clerkinfo` (`id`, `fullName`, `qualification`, `address`, `emailId`, `contactNo`, `gender`, `usersTableClerkId`) VALUES
(1, 'rajesh', 'asdfasdf', 'asdfadsf', 'asdfadsf', 'asdfadsf', 'm', 2),
(2, 'bharathi', 'mca', 'chengalaraopeta', 'bharathidevi29@gmail.com', '9885626037', 'F', 3),
(3, 'N.Kiran Kumar', 'Bcom', 'ChengalaRaopeta,\r\nVisakhapatnam-1', 'kiran.nistala@gmail.com', '9885953153', 'm', 4);
-- --------------------------------------------------------
--
-- Table structure for table `issues`
--
CREATE TABLE IF NOT EXISTS `issues` (
`id` int(11) DEFAULT NULL,
`stuid` int(11) DEFAULT NULL,
`bookid` int(11) DEFAULT NULL,
`status` int(1) DEFAULT NULL,
`isstudent` int(1) DEFAULT NULL,
`clerkid` int(11) DEFAULT NULL,
`startdate` date DEFAULT NULL,
`enddate` date DEFAULT NULL,
`fine` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `issues`
--
INSERT INTO `issues` (`id`, `stuid`, `bookid`, `status`, `isstudent`, `clerkid`, `startdate`, `enddate`, `fine`) VALUES
(1, 1, 1, 0, 1, 2, '2014-03-10', '2014-04-09', 30),
(2, 2, 1, 0, 1, 2, '2014-03-10', '2014-04-09', 30),
(3, 3, 4, 1, 1, 3, '2014-03-10', NULL, 0),
(4, 1, 4, 1, 1, 3, '2014-04-06', NULL, 0),
(5, 5, 6, 0, 1, 1, '2014-04-07', '2014-04-19', 0),
(6, 7, 6, 0, 0, 1, '2014-04-07', '2014-04-19', 0),
(7, 6, 5, 0, 1, 1, '2014-04-07', '2014-04-24', 17),
(8, 4, 14, 1, 0, 1, '2014-04-07', NULL, 0),
(9, 3, 14, 1, 1, 1, '2014-04-07', NULL, 0),
(10, 5, 14, 1, 1, 1, '2014-04-07', NULL, 0),
(11, 6, 13, 0, 0, 1, '2014-04-07', '2014-04-09', 0),
(12, 5, 3, 1, 0, 1, '2014-04-07', NULL, 0),
(13, 7, 13, 1, 1, 1, '2014-04-07', NULL, 0),
(14, 8, 7, 1, 1, 1, '2014-04-07', NULL, 0),
(15, 4, 9, 1, 1, 1, '2014-04-07', NULL, 0),
(16, 1, 12, 0, 1, 1, '2014-04-08', '2014-04-09', 0),
(17, 6, 1, 0, 0, 1, '2014-04-08', '2014-04-09', 0),
(18, 6, 11, 0, 0, 1, '2014-04-08', '2014-04-09', 0),
(19, 6, 5, 1, 0, 1, '2014-04-08', NULL, 0),
(20, 6, 7, 1, 0, 1, '2014-04-08', NULL, 0),
(21, 6, 8, 1, 1, 1, '2014-04-08', NULL, 0),
(22, 6, 2, 1, 0, 1, '2014-04-09', NULL, 0),
(23, 1, 1, 0, 1, 1, '2014-04-09', '2014-04-09', 0),
(24, 2, 3, 1, 1, 1, '2014-04-09', NULL, 0),
(25, 5, 12, 1, 1, 1, '2014-04-15', NULL, 0),
(26, 3, 15, 1, 1, 1, '2014-04-22', NULL, 0),
(27, 2, 12, 1, 0, 1, '2014-04-22', NULL, 0),
(28, 3, 5, 1, 0, 1, '2014-04-20', NULL, 0);
-- --------------------------------------------------------
--
-- Table structure for table `pages`
--
CREATE TABLE IF NOT EXISTS `pages` (
`id` int(11) NOT NULL,
`pagename` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pages`
--
INSERT INTO `pages` (`id`, `pagename`) VALUES
(1, 'CreateClerk'),
(2, 'StudentEntry'),
(3, 'StaffEntry'),
(4, 'BookEntry'),
(5, 'Issues'),
(6, 'Returns'),
(9, 'AllReports');
-- --------------------------------------------------------
--
-- Table structure for table `returns`
--
CREATE TABLE IF NOT EXISTS `returns` (
`Accno` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `staffentry`
--
CREATE TABLE IF NOT EXISTS `staffentry` (
`mcode` int(11) NOT NULL,
`Name` varchar(45) NOT NULL,
`Contact` varchar(45) NOT NULL,
`Email` varchar(45) NOT NULL,
`Qualification` varchar(45) NOT NULL,
`desig` varchar(45) NOT NULL,
`Department` varchar(45) NOT NULL,
`Address` varchar(100) NOT NULL,
`Gender` varchar(45) NOT NULL,
`DOB` varchar(45) NOT NULL,
`DOJ` varchar(45) NOT NULL,
PRIMARY KEY (`mcode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `staffentry`
--
INSERT INTO `staffentry` (`mcode`, `Name`, `Contact`, `Email`, `Qualification`, `desig`, `Department`, `Address`, `Gender`, `DOB`, `DOJ`) VALUES
(1, 'rajesh', '9642566568', 'asdfasdfsdf', 'Mtech', 'faculty', 'Computer Science', 'telakalaveedhi\r\nvsp', 'm', '13-7-1990', '12-09-2011'),
(2, 'kiran', '9642566568', 'kiran.nistala@gmail.com', 'mcom', 'Asst.Professor', 'physics', 'visakhapatnam', 'm', '28-08-1985', '28-08-2010'),
(3, 'B.v.p.Latha', '9885953153', 'lathabvp@gmail.com', 'Mtech', 'Asst.Professor', 'Computerscience', 'Doctors colony\r\nVisakhapatnam', 'F', '16-08-1984', '12-06-2009'),
(4, 'M.A.Prasad', '9988776655', 'prasadma@gamail.com', 'Mtech', 'Asst.Professor', 'Computer Science', 'Chaitanya nagar\r\nVsp', 'm', '15-09-1980', '12-06-2004'),
(5, 'U.Padma Mohan', '9885626037', 'Padmamohan@gmail.com', 'Phd', 'Head of Dept', 'Computer Science', 'Doctors colony\r\nVisakhapatnam', 'F', '15-8-1979', '12-06-2000'),
(6, 'Harikrishna', '9885953153', 'harikrishna123@gmail.com', 'M.Com.', 'faculty', 'Arts dept', 'mdp\r\nvsp', 'm', '30-1-1975', '24-6-2004'),
(7, 'virendranath', '9988512341', 'veeru@gmail.com', 'Mphil', 'Lecturer', 'Maths dept', 'eenadu\r\nvsp', 'm', '12-4-1978', '13-6-2006'),
(8, 'Sharukhan', '9988776656', 'sharukh@gamil.com', 'Mphil', 'faculty', 'Chemistry', 'Doctors colony\r\nvsp', 'm', '12-6-81', '15-8-2010'),
(9, 'Harish', '9988512342', 'harish34@gmail.com', 'Mtech', 'Asst.Profficer', 'Computer Science', 'seethammadhara\r\nVsp', 'm', '13-4-1982', '13-6-2006'),
(10, 'pravallika', '1245252', 'pravallika@gmail.com', 'Mtech', 'Asst.Profficer', 'Computer Science', 'rayagada', 'F', '20-05-1989', '15-6-2009'),
(11, 'K.Sathish', '9642566568', 'sathish33@gmail.com', 'M.TECH', 'Asst.Professor', 'Computer Science', 'Maddilapalem,\r\nvisakhapatnam', 'm', '12-06-1983', '15-08-2006');
-- --------------------------------------------------------
--
-- Table structure for table `studententry`
--
CREATE TABLE IF NOT EXISTS `studententry` (
`mcode` int(11) NOT NULL,
`Name` varchar(45) NOT NULL,
`Branch` varchar(45) NOT NULL,
`Contact` varchar(20) NOT NULL,
`batch` varchar(45) NOT NULL,
`emailId` varchar(45) NOT NULL,
`admNo` varchar(20) NOT NULL,
`Address` varchar(45) NOT NULL,
`Gender` varchar(45) NOT NULL,
`DOB` varchar(45) NOT NULL,
PRIMARY KEY (`mcode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `studententry`
--
INSERT INTO `studententry` (`mcode`, `Name`, `Branch`, `Contact`, `batch`, `emailId`, `admNo`, `Address`, `Gender`, `DOB`) VALUES
(1, 'rajesh', 'mca', '9885953153', '2011-2013', 'rajesh.chaganti18@gmail.com', '123123', 'asdfadsfadsf', 'm', '28-03-1990'),
(2, 'K.Gayatri', 'Mca', '9988553344', '2011-2014', 'gayatrik@gmail.com', '111', 'chaitanyanagar\r\nvisakhapatnam', 'F', '12-3-1992'),
(3, 'k.Bharathi Devi', 'Mca', '9885953153', '2011-2014', 'bharathidevi29@gmail.com', '333', 'Dr.No:20-134-1\r\nkotha agraharam\r\nvisakha-1', 'F', '12-6-1989'),
(4, 'chaturay', 'msc', '9948162740', '2011-2014', 'chaturya.nishtala@gmail.com', '136', 'changalaraopeta\r\nvsp', 'F', '15-12-1990'),
(5, 'Sathvika', 'msc.maths', '9885953153', '2009-2011', 'sathvika.nishtala@gmail.com', '192', 'mvp colony\r\nvsp', 'F', '16-09-1989'),
(6, 'Raghuramrajan', 'Mcom', '9988553344', '2011-2014', 'raghu.rr@gmail.com', '201', 'mdp\r\nvsp-13', 'm', '14-04-1990'),
(7, 'Aswini', 'computerscience', '9988512341', '2011-2014', 'aswini.123@gmail.com', '2593', 'Burujupeta,\r\nVisakhapatnam-1', 'F', '29-11-1991');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL,
`username` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`role` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `role`) VALUES
(1, 'admin', 'admin123', 1),
(2, 'rajesh', '123456', 2),
(3, 'bharathi', 'chaturya', 2),
(4, 'Kiran', 'vagdevi', 2);
-- --------------------------------------------------------
--
-- Table structure for table `userspagesmapping`
--
CREATE TABLE IF NOT EXISTS `userspagesmapping` (
`id` int(11) DEFAULT NULL,
`pageId` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `userspagesmapping`
--
INSERT INTO `userspagesmapping` (`id`, `pageId`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(2, 2),
(2, 3),
(2, 4),
(2, 5),
(2, 6),
(1, 9);
/*!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 */;
| true
|
dbcbe8b164bec67bdc46b7ae44ce9f92cb8fb02f
|
SQL
|
FanZhuofz/SQL
|
/0726存储过程(游标)/pp4.sql
|
UTF-8
| 1,041
| 3.71875
| 4
|
[] |
no_license
|
DELIMITER $$
USE `pubs10`$$
DROP PROCEDURE IF EXISTS `pp4`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `pp4`()
BEGIN
-- 定义变量
DECLARE cnt INT DEFAULT 0;
DECLARE i INT DEFAULT 1;
DECLARE aid VARCHAR(20);
-- 删除linshi_1表,清空cntauthors表
DROP TABLE IF EXISTS linshi_1;
DELETE FROM cntauthors;
-- 查询作者总数(不重复),将序号和作者id存储在linshi_1表里
SET @a=0;
CREATE TABLE linshi_1 SELECT @a:=@a+1 AS xh,au_id FROM (SELECT DISTINCT au_id FROM AUTHORS) a;
-- create table linshi_1 SELECT @a:=@a+1 AS xh,au_id FROM titleauthor GROUP BY au_id; -- 运用group by语句也可以
-- select * from linshi_1;
-- 查询linshi_1表里的作者总数
SELECT COUNT(1) INTO cnt FROM linshi_1;
-- 遍历linshi_1表,将作者id赋给pp3()存储结构
WHILE i<=cnt DO
SELECT au_id INTO aid FROM linshi_1 WHERE xh=i;
CALL pp3(aid,1);
SET i=i+1;
END WHILE;
-- 查询并显示cntauthors表数据
SELECT * FROM cntauthors;
END$$
DELIMITER ;
| true
|
342cbca91c710ae541c97f6e8bf3a19294b95ebe
|
SQL
|
jhchie93/test
|
/02_WHERE절 사용하기.sql
|
UTF-8
| 3,251
| 4.21875
| 4
|
[] |
no_license
|
--WHERE절
SELECT *
FROM employees
WHERE salary > 14000;
SELECT *
FROM employees
WHERE last_name = 'King';
SELECT *
FROM employees
WHERE hire_date < '02/06/10'; -- 날짜를 비교, 고용일이 2002년 6월 10일 이전
--예제1
SELECT *
FROM employees
WHERE employee_id = 100;
--예제2
SELECT *
FROM employees
WHERE first_name = 'David';
--예제3
SELECT *
FROM employees
WHERE employee_id <= 105;
--예제4
SELECT *
FROM job_history
WHERE start_date > '06/03/03';
--예제5
SELECT *
FROM departments
WHERE location_id != 1700;
-- 논리 연산자 AND OR NOT
SELECT last_name, department_id, salary
FROM employees
WHERE department_id = 60 OR (department_id = 80 AND salary > 10000);
SELECT *
FROM employees
WHERE NOT ( hire_date > '04/01/01' or salary > 5000);
--예제1
SELECT *
FROM employees
WHERE salary > 4000 AND job_id = 'IT_PROG';
SELECT *
FROM employees
WHERE salary > 4000 AND (job_id = 'IT_PROG' OR job_id = 'FI_ACCOUNT');
--IN 연산자 ()안의 값과 같을 때 OR
SELECT *
FROM employees
WHERE salary IN (4000, 3000, 2700);
--예제1
SELECT *
FROM employees
WHERE salary IN (10000, 17000, 24000);
SELECT *
FROM employees
WHERE department_id NOT IN (30, 50, 80, 100, 110);
--BETWEEN
SELECT *
FROM employees
WHERE salary BETWEEN 9000 AND 10000;
--예제1
SELECT *
FROM employees
WHERE salary BETWEEN 10000 AND 20000;
--예제2
SELECT *
FROM employees
WHERE hire_date BETWEEN '04/01/01' AND '04/12/30';
--예제3
SELECT *
FROM employees
WHERE salary NOT BETWEEN 7000 AND 17000;
--LIKE 연산자
SELECT * FROM employees WHERE last_name LIKE 'B%'; --대문자 B로 시작, 뒤는 상관없음.
SELECT * FROM employees WHERE last_name LIKE '%b%'; --문자열 중간에 b가 있으면 전부 출력
SELECT * FROM employees WHERE last_name LIKE '____y'; --언더바는 정확한 자리수를 표현
--예제1
SELECT * FROM employees WHERE job_id LIKE '%AD%';
--예제2
SELECT * FROM employees WHERE job_id Like '%AD___';
--예제3
SELECT * FROM employees WHERE phone_number LIKE '%1234';
--예제4
SELECT * FROM employees WHERE phone_number NOT LIKE '%3%' AND phone_number LIKE '%9';
--예제5
SELECT * FROM employees WHERE job_id LIKE '%MGR%' OR job_id LIKE '%ASST%';
--IS NULL 연산자
SELECT * FROM employees WHERE commission_pct IS NULL;
SELECT * FROM employees WHERE commission_pct IS NOT NULL;
--ORDER BY 명령
SELECT * FROM employees ORDER BY employee_id DESC;
SELECT * FROM employees ORDER BY employee_id ASC; --ASC는 생략 가능/기본값
--정렬 열이 2개 이상일때 첫번째 열로 정렬후 두번째 열 정렬
SELECT department_id, employee_id, first_name, last_name
FROM employees
ORDER BY department_id, employee_id;
--별칭으로 정렬
SELECT department_id, last_name, salary*12 연봉
FROM employees ORDER BY 연봉 DESC;
--예제1
SELECT employee_id, first_name, last_name
FROM employees
ORDER BY employee_id DESC;
--예제2
SELECT employee_id, job_id, first_name, last_name, salary
FROM employees
WHERE job_id Like '%CLERK%'
ORDER BY salary DESC;
--예제3
SELECT department_id 부서번호, employee_id 직원번호, first_name || ' ' || last_name 직원이름, salary
FROM employees
WHERE employee_id BETWEEN 120 AND 150
ORDER BY 부서번호 DESC, salary DESC;
| true
|
bf78f77cebce1b27eb97ceeaa5efb60630c6b3b7
|
SQL
|
RahulRajasekharuni/MySQL-for-Data-Analytics-and-Business-Intelligence
|
/SQL - Subqueries.sql
|
UTF-8
| 2,245
| 4.71875
| 5
|
[] |
no_license
|
select *
from dept_manager;
#sub query example
select *
from employees e
where e.emp_no in (
select dm.emp_no
from dept_manager dm);
#just show all records from employees table and inner join with dept_manager table to show records that match in both tables
select e.* from employees e
join dept_manager dm on e.emp_no = dm.emp_no;
/* Sub-query used to show employees in the employees table AND in the dept_manager table */
select *
from employees e
where e.emp_no in (
select dm.emp_no
from dept_manager dm);
#select all managers hired betweem 1990 and 95
select *
from employees e
where e.emp_no in (
select dm.emp_no
from dept_manager dm)
and e.hire_date between '1990-01-01' and '1995-01-01';
SELECT *
FROM dept_manager
WHERE emp_no IN (
SELECT emp_no
FROM employees
WHERE hire_date BETWEEN '1990-01-01' AND '1995-01-01');
/* Sub-query used to show employees in the employees table AND in the dept_manager table using exists function */
select *
from employees e
where exists (
select *
from dept_manager dm
where dm.emp_no = e.emp_no);
# Select the entire information for all employees whose job title is “Assistant Engineer”.
select *
from employees e
where exists(
select *
from titles t
where t.title = 'Assistant Engineer' and e.emp_no = t.emp_no);
/# assign employee number 110022 as a manger to all employees from 10001 to 10020, and employee number 110039 as a manager to all employees from 10021 to 10040#/
Select A.*
from
(select e.emp_no as employee_ID, min(de.dept_no) as department_code, #min department code is selected to ensure only one departmnt number is shown in output
(select emp_no
from dept_manager
where emp_no = 110022) as manager_ID
From employees e
join dept_emp de on e.emp_no = de.emp_no
where e.emp_no <= 10020
group by e.emp_no
order by e.emp_no) as A
union Select B.*
from
(select e.emp_no as employee_ID, min(de.dept_no) as department_code, #min department code is selected to ensure only one departmnt number is shown in output
(select emp_no
from dept_manager
where emp_no = 110039) as manager_ID
From employees e
join dept_emp de on e.emp_no = de.emp_no
where e.emp_no between 10021 and 10040
group by e.emp_no
order by e.emp_no) as B
| true
|
c91abcba58c85b0769eb74a9688fe35e4c48eb6f
|
SQL
|
nesmaElsherif/yourCart
|
/yourcart.sql
|
UTF-8
| 11,901
| 3.140625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 10, 2017 at 01:18 PM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.6.28
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: `yourcart`
--
-- --------------------------------------------------------
--
-- Table structure for table `ads`
--
CREATE TABLE `ads` (
`id` int(11) NOT NULL,
`image` varchar(200) CHARACTER SET latin1 NOT NULL,
`url` varchar(100) CHARACTER SET latin1 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `ads`
--
INSERT INTO `ads` (`id`, `image`, `url`) VALUES
(2, 'upload/1488842019089shipping.jpg', 'https://www.google.com.eg/'),
(3, 'upload/1488842050196Nokia-3310_Front_Full_2.jpg', 'https://www.google.com.eg/');
-- --------------------------------------------------------
--
-- Table structure for table `cart`
--
CREATE TABLE `cart` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `cart`
--
INSERT INTO `cart` (`id`, `user_id`, `product_id`, `quantity`) VALUES
(8, 5, 659, 2),
(9, 5, 660, 2),
(12, 10, 660, 2),
(13, 10, 658, 1),
(14, 10, 661, 1);
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE `category` (
`id` int(11) NOT NULL,
`name` varchar(25) CHARACTER SET latin1 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`) VALUES
(1, 'Mobile'),
(2, 'labtop'),
(3, 'Man Clothes'),
(4, 'Woman Clothes'),
(5, 'new Cat');
-- --------------------------------------------------------
--
-- Table structure for table `charge`
--
CREATE TABLE `charge` (
`id` int(11) NOT NULL,
`card_number` tinytext CHARACTER SET latin1 NOT NULL,
`value` int(11) NOT NULL,
`used` tinyint(1) NOT NULL,
`taken` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `charge`
--
INSERT INTO `charge` (`id`, `card_number`, `value`, `used`, `taken`) VALUES
(4, '4e2c5f926c537288', 200, 1, 1),
(5, '334e4b347e103232', 200, 0, 0),
(6, '863a52a7a4472295', 500, 1, 1),
(7, '759494455b892267', 500, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`comment` text CHARACTER SET latin1 NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
-- --------------------------------------------------------
--
-- Table structure for table `history`
--
CREATE TABLE `history` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`date` varchar(25) CHARACTER SET latin1 NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `history`
--
INSERT INTO `history` (`id`, `user_id`, `product_id`, `date`, `quantity`) VALUES
(1, 1, 13, '20-12-2017', 3),
(2, 15, 660, '2017-03-09T01:50:27.776', 2),
(3, 15, 660, '2017-03-09T01:52:26.675', 1),
(4, 15, 661, '2017-03-09T02:05:27.348', 1),
(5, 10, 659, '2017-03-09T02:26:24.112', 3),
(6, 15, 659, '2017-03-09T02:26:31.573', 3),
(7, 15, 660, '2017-03-09T13:49:12.357', 1),
(8, 15, 660, '2017-03-09T15:24:50.399', 1);
-- --------------------------------------------------------
--
-- Table structure for table `product`
--
CREATE TABLE `product` (
`id` int(11) NOT NULL,
`name` varchar(50) CHARACTER SET latin1 NOT NULL,
`price` double NOT NULL,
`quantity` int(11) NOT NULL,
`model` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`descriptin` text CHARACTER SET latin1,
`date` varchar(20) CHARACTER SET latin1 NOT NULL,
`photo` varchar(100) CHARACTER SET latin1 DEFAULT 'upload/yourCart.png',
`category_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`id`, `name`, `price`, `quantity`, `model`, `descriptin`, `date`, `photo`, `category_id`) VALUES
(13, 'mohamed', 13, 3, 'nono', 'das', '13/12/2016', 'upload/yourCart.png', 1),
(656, 'new Product', 12.6, 3, 'NoModel', 'Good', '2017-03-04', 'upload/1488585388828java.png', 2),
(657, 'last', 13.5, 3, 'Nokia', 'mmm', '2017-03-04', 'upload/yourCart.png', 1),
(658, 'test2', 12, 23, '543', 'sdsdv', '2017-03-04', 'upload/yourCart.png', 2),
(659, 'sfa', 23, 17, '', '', '2017-03-04', 'upload/yourCart.png', 1),
(660, 'nokia 3310 new', 120, 292, 'Nokia', 'good mobile new', '2017-03-04', 'upload/1488650753165Nokia-3310_Front_Full_2.jpg', 3),
(661, '3', 3, 15, '3', '3', '2017-03-05', 'upload/1488696641611github-6-xxl.png', 1);
-- --------------------------------------------------------
--
-- Table structure for table `slides`
--
CREATE TABLE `slides` (
`id` int(11) NOT NULL,
`title` varchar(100) CHARACTER SET latin1 NOT NULL,
`subtitle` varchar(100) CHARACTER SET latin1 NOT NULL,
`description` text CHARACTER SET latin1 NOT NULL,
`image` varchar(200) CHARACTER SET latin1 NOT NULL,
`product_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `slides`
--
INSERT INTO `slides` (`id`, `title`, `subtitle`, `description`, `image`, `product_id`) VALUES
(1, 'new Nokia', 'Arrive now to egypt', 'good mobile new', 'upload/1488650753165Nokia-3310_Front_Full_2.jpg', 660),
(2, 'Hi slide', 'lorem lorem lorem ', 'lorem lorem lorem lorem lorem lorem ', 'upload/1488696641611github-6-xxl.png', 661);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(50) CHARACTER SET latin1 NOT NULL,
`email` varchar(50) CHARACTER SET latin1 NOT NULL,
`address` varchar(50) CHARACTER SET latin1 NOT NULL,
`job` varchar(20) CHARACTER SET latin1 NOT NULL,
`password` varchar(200) CHARACTER SET latin1 NOT NULL,
`creaditCard` varchar(50) CHARACTER SET latin1 NOT NULL,
`cash` double NOT NULL,
`role` varchar(50) CHARACTER SET latin1 NOT NULL,
`photo` varchar(200) CHARACTER SET latin1 NOT NULL DEFAULT 'upload/profile.jpg'
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `address`, `job`, `password`, `creaditCard`, `cash`, `role`, `photo`) VALUES
(1, 'mohamed', 'mohamed.motyim33@gmail.com', 'alexandria', 'java dev', 'c2a2c8637590d5dd61c457cc1724ecdfa2c47062ec9c584613c099caabbd1ea8d3e4116a8d62e9fe07722dbe6ff382bec09c10fa4019723ae3f1b1286a186684', '1234-1234-1234-1234', 500, 'admin', 'upload/profile.jpg'),
(5, 'osama', 'osama@mos.com', 'giza', 'java dev', '123', '4444-4444-4444-4444', 0, 'user', 'upload/profile.jpg'),
(10, 'motyim', 'mohamed.motyim@gmail.com', 'alexandria', 'java Developer', 'c2a2c8637590d5dd61c457cc1724ecdfa2c47062ec9c584613c099caabbd1ea8d3e4116a8d62e9fe07722dbe6ff382bec09c10fa4019723ae3f1b1286a186684', '8888-8888-8888-8888', 1034, 'user', 'upload/1488576281799logo.png'),
(11, 'zzzz', 'zzzzzz@zcz.com', 'asf', 'asf', '1212', '2323-2323-2323-2323', 725, 'user', 'upload/profile.jpg'),
(12, 'kasjfkl', 'sajdjsalk@asjkl.xom', 'asdsad', 'asdasd', '123', '4747-4747-4747-4747', 0, 'user', 'upload/1489086926042Capture.PNG'),
(13, 'ahmed', 'ahmed@gmail.com', 'alexandria', 'asdasd', '123', '1478-1596-1235-1485', 488, 'user', 'upload/profile.jpg'),
(14, 'ahmed2', 'ahmed2@gmail.com', 'alexandria', 'google', '123', '1596-6875-9856-5423', 899, 'user', 'upload/profile.jpg'),
(15, 'omar', 'omar@google.com', 'alexandria', 'ad', '56b10badea2ca8551450c570fb7fd12ef475831ee050a9ba75920b529550fba7ad5366bc3e623cf3811e194887feb60a49470330b17fc438d7aa6866366e97e8', '1236-9874-8532-6521', 960, 'user', 'upload/profile.jpg');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ads`
--
ALTER TABLE `ads`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cart`
--
ALTER TABLE `cart`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `product_id` (`product_id`);
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`),
ADD KEY `id` (`id`);
--
-- Indexes for table `charge`
--
ALTER TABLE `charge`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`),
ADD KEY `product_id` (`product_id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `history`
--
ALTER TABLE `history`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `product_id` (`product_id`);
--
-- Indexes for table `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`id`),
ADD KEY `id` (`id`),
ADD KEY `catagory_id` (`category_id`);
--
-- Indexes for table `slides`
--
ALTER TABLE `slides`
ADD PRIMARY KEY (`id`),
ADD KEY `product_id` (`product_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `creaditCard` (`creaditCard`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ads`
--
ALTER TABLE `ads`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `cart`
--
ALTER TABLE `cart`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `charge`
--
ALTER TABLE `charge`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `history`
--
ALTER TABLE `history`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `product`
--
ALTER TABLE `product`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=662;
--
-- AUTO_INCREMENT for table `slides`
--
ALTER TABLE `slides`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `cart`
--
ALTER TABLE `cart`
ADD CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `history`
--
ALTER TABLE `history`
ADD CONSTRAINT `history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `history_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `product`
--
ALTER TABLE `product`
ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `slides`
--
ALTER TABLE `slides`
ADD CONSTRAINT `slides_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) 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 */;
| true
|
92e9c622074abe2312c420d4d5dbabfcbee9d650
|
SQL
|
Donmohaa1/Soulmate
|
/database/moi_single.sql
|
UTF-8
| 2,227
| 2.859375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 18, 2018 at 02:43 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.8
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: `moi_single`
--
-- --------------------------------------------------------
--
-- Table structure for table `register`
--
CREATE TABLE `register` (
`id` int(11) NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`age` varchar(55) NOT NULL,
`height` varchar(55) NOT NULL,
`residence` varchar(55) NOT NULL,
`complextion` varchar(55) NOT NULL,
`email` varchar(255) NOT NULL,
`phonenumber` bigint(11) NOT NULL,
`image` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`firstname` varchar(255) DEFAULT NULL,
`lastname` varchar(255) DEFAULT NULL,
`age` varchar(55) DEFAULT NULL,
`height` varchar(55) DEFAULT NULL,
`residence` varchar(55) DEFAULT NULL,
`complextion` varchar(55) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`phonenumber` bigint(11) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL,
`description` longtext,
`password` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `firstname`, `lastname`, `age`, `height`, `residence`, `complextion`, `email`, `phonenumber`, `image`, `description`, `password`) VALUES
(0, 'ali', 'moha', '23', '6"', 'diamond', 'chocolate', 'ali@gmail.com', 723456667, NULL, NULL, '202cb962ac59075b964b07152d234b70');
/*!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 */;
| true
|
cc3b693e83b59f64b0413c3b0d759626c62bbb3c
|
SQL
|
Yizhiping/WareHouseMangement
|
/Db/warehousemanagement.sql
|
UTF-8
| 10,283
| 3.03125
| 3
|
[] |
no_license
|
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50553
Source Host : localhost:3306
Source Database : warehousemanagement
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-06-19 08:11:26
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `customermapping`
-- ----------------------------
DROP TABLE IF EXISTS `customermapping`;
CREATE TABLE `customermapping` (
`Customer` char(255) NOT NULL,
`Item` char(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of customermapping
-- ----------------------------
INSERT INTO `customermapping` VALUES ('ARRIS', '');
INSERT INTO `customermapping` VALUES ('ARRIS', '');
-- ----------------------------
-- Table structure for `events`
-- ----------------------------
DROP TABLE IF EXISTS `events`;
CREATE TABLE `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`eventType` char(255) NOT NULL,
`FunId` char(255) NOT NULL,
`Description` char(255) NOT NULL,
`eTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`uid` char(255) NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of events
-- ----------------------------
-- ----------------------------
-- Table structure for `fun`
-- ----------------------------
DROP TABLE IF EXISTS `fun`;
CREATE TABLE `fun` (
`Code` char(255) DEFAULT NULL,
`Name` char(255) DEFAULT NULL,
`method` varchar(255) DEFAULT NULL,
UNIQUE KEY `FunID` (`Code`),
UNIQUE KEY `NameId` (`Name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of fun
-- ----------------------------
INSERT INTO `fun` VALUES ('FID_5cff83f8a8e50', '用戶查詢', null);
INSERT INTO `fun` VALUES ('FID_5cff83f3cc78b', '用戶創建', '');
INSERT INTO `fun` VALUES ('FID_5cff84009828e', '用戶修改', null);
INSERT INTO `fun` VALUES ('FID_5cff834f54be2', '儲位刪除', 'shelfDel');
INSERT INTO `fun` VALUES ('FID_5cff8348c6aa5', '儲位修改', null);
INSERT INTO `fun` VALUES ('FID_5cff8342a909e', '儲位創建', 'shelfAdd');
INSERT INTO `fun` VALUES ('FID_5cff832418531', '儲位查詢', null);
INSERT INTO `fun` VALUES ('FID_5cff8405c3b06', '用戶刪除', null);
INSERT INTO `fun` VALUES ('FID_5d034aaca2804', '貨物入庫', null);
INSERT INTO `fun` VALUES ('FID_5d034ab318e54', '貨物出庫', null);
INSERT INTO `fun` VALUES ('FID_5d034abc98b6d', '貨物轉移', null);
INSERT INTO `fun` VALUES ('FID_5d034ac30a39c', '貨物查詢', null);
-- ----------------------------
-- Table structure for `goods`
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`PalletId` char(255) NOT NULL,
`Model` char(255) NOT NULL,
`Item` char(255) NOT NULL,
`SO` char(255) NOT NULL,
`Qty` char(255) NOT NULL,
`Customer` char(255) DEFAULT NULL,
`ShelfId` char(255) NOT NULL,
`Uid` char(255) DEFAULT NULL,
`Datein` datetime NOT NULL,
`ModifyTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`),
UNIQUE KEY `palletId` (`PalletId`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of goods
-- ----------------------------
-- ----------------------------
-- Table structure for `goods_shipped`
-- ----------------------------
DROP TABLE IF EXISTS `goods_shipped`;
CREATE TABLE `goods_shipped` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`PalletId` char(255) NOT NULL,
`Model` char(255) NOT NULL,
`Item` char(255) NOT NULL,
`SO` char(255) NOT NULL,
`Qty` char(255) NOT NULL,
`Customer` char(255) DEFAULT NULL,
`UidIn` char(255) NOT NULL,
`UidOut` char(255) NOT NULL,
`Datein` datetime NOT NULL,
`DateOut` datetime NOT NULL,
`ModifyTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`),
UNIQUE KEY `palletId` (`PalletId`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of goods_shipped
-- ----------------------------
INSERT INTO `goods_shipped` VALUES ('23', 'Z21924404', 'IPC4100', '90B3-9A10010', 'W000802765', '360', '', 'admin', 'admin', '2019-06-18 17:07:10', '2019-06-18 18:09:29', '2019-06-18 18:09:29');
INSERT INTO `goods_shipped` VALUES ('24', 'Z11924402', 'DCX4400', '90B3-A710010', 'W000804169', '400', '', 'admin', 'admin', '2019-06-18 17:07:26', '2019-06-18 18:09:29', '2019-06-18 18:09:29');
INSERT INTO `goods_shipped` VALUES ('25', 'W000800084-025', 'TG2482A', '90B2AA100010', 'W000800084', '120', '', 'admin', 'admin', '2019-06-18 17:07:40', '2019-06-18 18:09:29', '2019-06-18 18:09:29');
INSERT INTO `goods_shipped` VALUES ('28', 'W000804970-012', 'CM8200B', '90B2-9410020', 'W000804970', '270', '', 'admin', 'admin', '2019-06-18 17:05:05', '2019-06-18 18:09:11', '2019-06-18 18:09:11');
-- ----------------------------
-- Table structure for `rfid`
-- ----------------------------
DROP TABLE IF EXISTS `rfid`;
CREATE TABLE `rfid` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rid` char(255) NOT NULL,
`fid` char(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=113 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of rfid
-- ----------------------------
INSERT INTO `rfid` VALUES ('74', 'RID_5cff6e263d96a', 'FID_5cff83f8a8e50');
INSERT INTO `rfid` VALUES ('75', 'RID_5cff6e263d96a', 'FID_5d034aaca2804');
INSERT INTO `rfid` VALUES ('76', 'RID_5cff6e263d96a', 'FID_5d034ac30a39c');
INSERT INTO `rfid` VALUES ('77', 'RID_5cff6e263d96a', 'FID_5d034abc98b6d');
INSERT INTO `rfid` VALUES ('78', 'RID_5cff6e2bc2b8f', 'FID_5cff83f8a8e50');
INSERT INTO `rfid` VALUES ('79', 'RID_5cff6e2bc2b8f', 'FID_5d034aaca2804');
INSERT INTO `rfid` VALUES ('80', 'RID_5cff6e2bc2b8f', 'FID_5d034ac30a39c');
INSERT INTO `rfid` VALUES ('81', 'RID_5cff6e2bc2b8f', 'FID_5d034abc98b6d');
INSERT INTO `rfid` VALUES ('82', 'RID_5cff6e1e88eba', 'FID_5cff8348c6aa5');
INSERT INTO `rfid` VALUES ('83', 'RID_5cff6e1e88eba', 'FID_5cff834f54be2');
INSERT INTO `rfid` VALUES ('84', 'RID_5cff6e1e88eba', 'FID_5cff8342a909e');
INSERT INTO `rfid` VALUES ('85', 'RID_5cff6e1e88eba', 'FID_5cff832418531');
INSERT INTO `rfid` VALUES ('86', 'RID_5cff6e1e88eba', 'FID_5cff84009828e');
INSERT INTO `rfid` VALUES ('87', 'RID_5cff6e1e88eba', 'FID_5cff8405c3b06');
INSERT INTO `rfid` VALUES ('88', 'RID_5cff6e1e88eba', 'FID_5cff83f3cc78b');
INSERT INTO `rfid` VALUES ('89', 'RID_5cff6e1e88eba', 'FID_5cff83f8a8e50');
INSERT INTO `rfid` VALUES ('90', 'RID_5cff6e1e88eba', 'FID_5d034aaca2804');
-- ----------------------------
-- Table structure for `role`
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`Code` char(255) NOT NULL,
`Name` char(255) NOT NULL,
UNIQUE KEY `RoleID` (`Code`),
UNIQUE KEY `NameId` (`Name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('RID_5cff6e2bc2b8f', '出庫員');
INSERT INTO `role` VALUES ('RID_5cff6e263d96a', '入庫員');
INSERT INTO `role` VALUES ('RID_5cff6e1e88eba', '管理員');
INSERT INTO `role` VALUES ('RID_5cff6de180417', '入賬員');
INSERT INTO `role` VALUES ('RID_5d03e3287e235', '測試角色');
-- ----------------------------
-- Table structure for `shelfs`
-- ----------------------------
DROP TABLE IF EXISTS `shelfs`;
CREATE TABLE `shelfs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ShelfID` char(255) DEFAULT NULL,
`Description` char(255) DEFAULT NULL,
UNIQUE KEY `id` (`id`),
UNIQUE KEY `shelfID` (`ShelfID`)
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of shelfs
-- ----------------------------
INSERT INTO `shelfs` VALUES ('21', '5A0101G', '');
INSERT INTO `shelfs` VALUES ('20', '5A0101F', '');
INSERT INTO `shelfs` VALUES ('19', '5A0101E', '');
INSERT INTO `shelfs` VALUES ('30', '5A0101A', '');
INSERT INTO `shelfs` VALUES ('26', '5A0101C', '');
INSERT INTO `shelfs` VALUES ('23', '5A0101H', '');
INSERT INTO `shelfs` VALUES ('27', '5A0101D', '');
INSERT INTO `shelfs` VALUES ('32', '5A0101I', '');
INSERT INTO `shelfs` VALUES ('31', '5A0101B', '');
-- ----------------------------
-- Table structure for `urid`
-- ----------------------------
DROP TABLE IF EXISTS `urid`;
CREATE TABLE `urid` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` char(255) NOT NULL,
`rid` char(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=83 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of urid
-- ----------------------------
INSERT INTO `urid` VALUES ('63', 'admin', 'RID_5cff6e2bc2b8f');
INSERT INTO `urid` VALUES ('64', 'admin', 'RID_5cff6e263d96a');
INSERT INTO `urid` VALUES ('65', 'admin', 'RID_5cff6e1e88eba');
INSERT INTO `urid` VALUES ('66', 'admin', 'RID_5cff6de180417');
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Uid` char(11) NOT NULL,
`UName` char(255) NOT NULL,
`PassWord` char(255) NOT NULL,
`Mail` char(255) DEFAULT NULL,
`Descirption` char(255) DEFAULT NULL,
`LastLoginTime` datetime DEFAULT NULL,
`LoginTimes` int(11) DEFAULT NULL,
`LastLoginIP` char(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `RowId` (`id`),
UNIQUE KEY `Uid` (`Uid`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('3', 'admin', 'admin', '$2y$10$X29HAmu7Dpps7/jiJHfBTeOVdymfHBJRvJ3K7DlqIwJg98AE.aGhO', 'admin', 'admin', '2019-06-18 18:08:11', null, '192.168.43.1');
INSERT INTO `users` VALUES ('9', 'S09264888', '易志平', '$2y$10$FoEwJGsfZmAUUJTTz4Jl2OatagI8F6M90KLDGumrNTv6VW3s1vQAm', '', '', '2019-06-18 15:30:19', null, '127.0.0.1');
| true
|
c7a72151457b487616586cd23dea3d9b202af53f
|
SQL
|
zarkoAment/spring_poc
|
/src/main/resources/schema-h2.sql
|
UTF-8
| 165
| 2.515625
| 3
|
[] |
no_license
|
DROP TABLE IF EXISTS customer;
CREATE TABLE customer (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, created_date DATE);
| true
|
c3388916b941fa35f866b7d286836ab79ba0f0d1
|
SQL
|
bobbruno/zipfiantech1
|
/zipfiantech1/src/Q3.sql
|
UTF-8
| 317
| 3.953125
| 4
|
[] |
no_license
|
select SP.Name
from SalesPerson SP
where exists (select 'x'
from Orders O
where O.salesperson_id = SP.ID
group by O.salesperson_id
having count(O.Number)>1)
select SP.Name
from SalesPerson SP
where SP.ID in (select O.salesperson_id
from Orders O
group by O.salesperson_id)
| true
|
d91f7e5b47e4c7c5080991cc7dc9de8aab0f734e
|
SQL
|
ljca/mybackup
|
/src_note/develop/others/db/sql/Oracle/matersale.sql
|
UTF-8
| 985
| 3.1875
| 3
|
[] |
no_license
|
prompt PL/SQL Developer import file
prompt Created on 2016年5月25日 星期三 by kyzs
set feedback off
set define off
prompt Creating CUS_CUSTOMER...
create table CUS_CUSTOMER
(
id NUMBER not null,
cus_id NUMBER not null,
cus_name NVARCHAR2(100) not null,
cus_addr NVARCHAR2(500)
)
tablespace PROJECT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table CUS_CUSTOMER
add constraint PK_CUS_ID primary key (ID, CUS_ID)
using index
tablespace PROJECT
pctfree 10
initrans 2
maxtrans 255;
prompt Disabling triggers for CUS_CUSTOMER...
alter table CUS_CUSTOMER disable all triggers;
prompt Deleting CUS_CUSTOMER...
delete from CUS_CUSTOMER;
commit;
prompt Loading CUS_CUSTOMER...
prompt Table is empty
prompt Enabling triggers for CUS_CUSTOMER...
alter table CUS_CUSTOMER enable all triggers;
set feedback on
set define on
prompt Done.
| true
|
ced687b2fddbef61f55088135cf65bfea5d79f71
|
SQL
|
mengyuan0526/wmy-python-homework
|
/SQL_exercise/SQL_exercise_04/4_questions.sql
|
UTF-8
| 1,384
| 4.21875
| 4
|
[] |
no_license
|
-- Movie_theatres
-- 4.1 Select the title of all movies.
Select title from movies;
-- 4.2 Show all the distinct ratings in the database.
Select distinct rating from movies;
-- 4.3 Show all unrated movies.
Select * from movies where rating is null;
-- 4.4 Select all movie theaters that are not currently showing a movie.
Select name from MovieTheaters where movie is null;
-- 4.5 Select all data from all movie theaters
-- and, additionally, the data from the movie that is being shown in the theater (if one is being shown).
Select * from MovieTheaters a inner join movies b on a.movie=b.code where a.movie is not null;
-- 4.6 Select all data from all movies and, if that movie is being shown in a theater, show the data from the theater.
Select * from movies a inner join MovieTheaters b on a.code=b.movie where b.movie is not null;
-- 4.7 Show the titles of movies not currently being shown in any theaters.
Select title from movies a inner join MovieTheaters b on a.code=b.movie where b.movie is null;
-- 4.8 Add the unrated movie "One, Two, Three".
insert into movies (code,title,rating) values(9,'One, Two, Three',null)
-- 4.9 Set the rating of all unrated movies to "G".
update movies Set rating='G' where rating is null;
-- 4.10 Remove movie theaters projecting movies rated "NC-17".
DELETE FROM movietheaters WHERE movie= (SELECT code FROM movies WHERE rating='NC-17');
| true
|
0ef5a8751f479bba0f7f114e88700b248295f9fa
|
SQL
|
ptomulik/veetou
|
/share/oracle/packages/veetou/tables/ko/ko_protocol_map_j.ddl
|
UTF-8
| 2,212
| 3.359375
| 3
|
[] |
no_license
|
CREATE TABLE v2u_ko_protocol_map_j
OF V2u_Ko_Protocol_Map_J_t
(
CONSTRAINT v2u_ko_protocol_map_j_pk
PRIMARY KEY ( job_uuid
, semester_id
, specialty_id
, subject_id
, classes_type
, student_id
, map_id )
-- , CONSTRAINT v2u_ko_protocol_map_j_f0
-- FOREIGN KEY (job_uuid)
-- REFERENCES v2u_ko_jobs(job_uuid)
-- , CONSTRAINT v2u_ko_protocol_map_j_f1
-- FOREIGN KEY (subject_id, job_uuid)
-- REFERENCES v2u_ko_protocols(id, job_uuid)
-- , CONSTRAINT v2u_ko_protocol_map_j_f2
-- FOREIGN KEY (specialty_id, job_uuid)
-- REFERENCES v2u_ko_specialties(id, job_uuid)
-- , CONSTRAINT v2u_ko_protocol_map_j_f3
-- FOREIGN KEY (semester_id, job_uuid)
-- REFERENCES v2u_ko_semesters(id, job_uuid)
-- , CONSTRAINT v2u_ko_protocol_map_j_f4
-- FOREIGN KEY (map_id)
-- REFERENCES v2u_protocol_map(id)
-- , CONSTRAINT v2u_ko_protocol_map_j_f5
-- FOREIGN KEY (job_uuid, subject_id, specialty_id, semester_id)
-- REFERENCES v2u_ko_protocol_semesters_j(job_uuid, subject_id, specialty_id, semester_id)
)
OBJECT IDENTIFIER IS PRIMARY KEY;
/
CREATE INDEX v2u_ko_protocol_map_j_idx1
ON v2u_ko_protocol_map_j( job_uuid
, semester_id
, specialty_id
, subject_id
, classes_type
, student_id
, selected );
/
--CREATE INDEX v2u_ko_protocol_map_j_idx2
-- ON v2u_ko_protocol_map_j(reason);
--/
--CREATE INDEX v2u_ko_protocol_map_j_idx3
-- ON v2u_ko_protocol_map_j(selected, reason);
--/
--CREATE INDEX v2u_ko_protocol_map_j_idx4
-- ON v2u_ko_protocol_map_j(job_uuid, subject_id, specialty_id, semester_id);
--/
--CREATE INDEX v2u_ko_protocol_map_j_idx5
-- ON v2u_ko_protocol_map_j(job_uuid, subject_id, specialty_id, semester_id, selected);
--/
-- vim: set ft=sql ts=4 sw=4 et:
| true
|
ac99db0c99b503b7030c463b1f57d1751b95f8b7
|
SQL
|
christian130/SCAYA
|
/BD/dump(4).sql
|
UTF-8
| 157,103
| 2.96875
| 3
|
[
"Apache-2.0"
] |
permissive
|
<br />
<b>Strict Standards</b>: Only variables should be assigned by reference in <b>/opt/lappstack-5.4.7-0/apps/phppgadmin/htdocs/classes/database/Connection.php</b> on line <b>23</b><br />
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: cbiometrico; Type: COMMENT; Schema: -; Owner: cbiometrico
--
COMMENT ON DATABASE cbiometrico IS 'Base de Datos para el sistema web biometrico';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = true;
--
-- Name: att_departamentos; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE att_departamentos (
id integer NOT NULL,
nombre character varying(200) NOT NULL
);
ALTER TABLE ONLY att_departamentos ALTER COLUMN id SET STATISTICS 0;
ALTER TABLE ONLY att_departamentos ALTER COLUMN nombre SET STATISTICS 0;
ALTER TABLE public.att_departamentos OWNER TO cbiometrico;
--
-- Name: att_departamentos_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE att_departamentos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.att_departamentos_id_seq OWNER TO cbiometrico;
--
-- Name: att_departamentos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE att_departamentos_id_seq OWNED BY att_departamentos.id;
--
-- Name: att_departamentos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('att_departamentos_id_seq', 4, true);
--
-- Name: att_devices; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE att_devices (
id integer NOT NULL,
nombre character varying(50) NOT NULL,
ip character varying(20) NOT NULL,
puerto character varying(5),
descripcion character varying(500)
);
ALTER TABLE public.att_devices OWNER TO cbiometrico;
--
-- Name: att_devices_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE att_devices_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.att_devices_id_seq OWNER TO cbiometrico;
--
-- Name: att_devices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE att_devices_id_seq OWNED BY att_devices.id;
--
-- Name: att_devices_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('att_devices_id_seq', 5, true);
--
-- Name: att_horarios; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE att_horarios (
id integer NOT NULL,
nombre character varying(50) NOT NULL,
idefault boolean DEFAULT false NOT NULL,
imorning boolean NOT NULL,
mor_in time without time zone,
mor_maxdelay smallint DEFAULT 0,
mor_out time without time zone,
mor_minout smallint DEFAULT 0,
itarde boolean NOT NULL,
tard_in time without time zone,
tard_maxdelay smallint DEFAULT 0 NOT NULL,
tard_out time without time zone,
tard_minout smallint DEFAULT 0 NOT NULL,
ialmuerzo boolean DEFAULT true NOT NULL,
alm_tiempo smallint DEFAULT 0 NOT NULL,
alm_cuadrar boolean DEFAULT true NOT NULL,
ihediurna boolean DEFAULT false NOT NULL,
hediurna time without time zone DEFAULT '16:00:00'::time without time zone,
ihenocturna boolean DEFAULT false NOT NULL,
henocturna time without time zone DEFAULT '19:00:00'::time without time zone
);
ALTER TABLE ONLY att_horarios ALTER COLUMN id SET STATISTICS 0;
ALTER TABLE ONLY att_horarios ALTER COLUMN nombre SET STATISTICS 0;
ALTER TABLE ONLY att_horarios ALTER COLUMN idefault SET STATISTICS 0;
ALTER TABLE public.att_horarios OWNER TO cbiometrico;
--
-- Name: att_horarios_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE att_horarios_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.att_horarios_id_seq OWNER TO cbiometrico;
--
-- Name: att_horarios_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE att_horarios_id_seq OWNED BY att_horarios.id;
--
-- Name: att_horarios_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('att_horarios_id_seq', 6, true);
--
-- Name: att_logs; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE att_logs (
id integer NOT NULL,
att_persona_id integer NOT NULL,
fecha date NOT NULL,
hora time without time zone NOT NULL,
hashcode character varying(60) NOT NULL,
att_device_id integer NOT NULL,
att_horario_id integer NOT NULL
);
ALTER TABLE ONLY att_logs ALTER COLUMN id SET STATISTICS 0;
ALTER TABLE ONLY att_logs ALTER COLUMN att_persona_id SET STATISTICS 0;
ALTER TABLE public.att_logs OWNER TO cbiometrico;
--
-- Name: att_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE att_logs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.att_logs_id_seq OWNER TO cbiometrico;
--
-- Name: att_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE att_logs_id_seq OWNED BY att_logs.id;
--
-- Name: att_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('att_logs_id_seq', 31109, true);
--
-- Name: att_personas; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE att_personas (
gid integer DEFAULT nextval(('"public"."att_personas_gid_seq"'::text)::regclass) NOT NULL,
id integer NOT NULL,
nombre character varying(150) NOT NULL,
cedula integer NOT NULL,
icontrato boolean DEFAULT false NOT NULL,
att_horario_id integer NOT NULL,
iactivo boolean DEFAULT true NOT NULL,
att_departamento_id integer NOT NULL,
att_device_id integer NOT NULL,
device_manager boolean DEFAULT false NOT NULL,
img character varying(500)
);
ALTER TABLE public.att_personas OWNER TO cbiometrico;
--
-- Name: att_personas_gid_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE att_personas_gid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.att_personas_gid_seq OWNER TO cbiometrico;
--
-- Name: att_personas_gid_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('att_personas_gid_seq', 157, true);
--
-- Name: departamentos; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE departamentos (
id integer NOT NULL,
departamento character varying(150) NOT NULL
);
ALTER TABLE public.departamentos OWNER TO cbiometrico;
--
-- Name: departamentos_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE departamentos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.departamentos_id_seq OWNER TO cbiometrico;
--
-- Name: departamentos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE departamentos_id_seq OWNED BY departamentos.id;
--
-- Name: departamentos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('departamentos_id_seq', 31, true);
--
-- Name: fechas; Type: VIEW; Schema: public; Owner: cbiometrico
--
CREATE VIEW fechas AS
SELECT DISTINCT att_logs.fecha, date_part('dow'::text, att_logs.fecha) AS dia FROM att_logs, att_personas WHERE (att_logs.att_persona_id = att_personas.id) ORDER BY att_logs.fecha DESC;
ALTER TABLE public.fechas OWNER TO cbiometrico;
--
-- Name: file_indexing; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE file_indexing (
id integer NOT NULL,
id_listing_files integer NOT NULL,
contador integer NOT NULL
);
ALTER TABLE public.file_indexing OWNER TO cbiometrico;
--
-- Name: file_indexing_contador_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE file_indexing_contador_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.file_indexing_contador_seq OWNER TO cbiometrico;
--
-- Name: file_indexing_contador_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE file_indexing_contador_seq OWNED BY file_indexing.contador;
--
-- Name: file_indexing_contador_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('file_indexing_contador_seq', 1, false);
--
-- Name: file_indexing_id_listing_files_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE file_indexing_id_listing_files_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.file_indexing_id_listing_files_seq OWNER TO cbiometrico;
--
-- Name: file_indexing_id_listing_files_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE file_indexing_id_listing_files_seq OWNED BY file_indexing.id_listing_files;
--
-- Name: file_indexing_id_listing_files_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('file_indexing_id_listing_files_seq', 1, false);
--
-- Name: file_indexing_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE file_indexing_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.file_indexing_id_seq OWNER TO cbiometrico;
--
-- Name: file_indexing_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE file_indexing_id_seq OWNED BY file_indexing.id;
--
-- Name: file_indexing_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('file_indexing_id_seq', 1, false);
--
-- Name: listing_files; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE listing_files (
id integer NOT NULL,
path character varying(300),
description character varying(300)
);
ALTER TABLE public.listing_files OWNER TO cbiometrico;
--
-- Name: listing_files_id_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE listing_files_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.listing_files_id_seq OWNER TO cbiometrico;
--
-- Name: listing_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cbiometrico
--
ALTER SEQUENCE listing_files_id_seq OWNED BY listing_files.id;
--
-- Name: listing_files_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('listing_files_id_seq', 12, true);
SET default_with_oids = false;
--
-- Name: seguridad_bitacora; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_bitacora (
idbitacora integer DEFAULT nextval(('"public"."seguridad_bitacora_idbitacora_seq"'::text)::regclass) NOT NULL,
fecha date NOT NULL,
hora time(0) without time zone NOT NULL,
entidad character varying(100),
nro_registro character varying(20),
actividad text NOT NULL,
ip character varying(20) NOT NULL,
idusuario integer NOT NULL,
programa character varying(100)
);
ALTER TABLE ONLY seguridad_bitacora ALTER COLUMN idbitacora SET STATISTICS 0;
ALTER TABLE public.seguridad_bitacora OWNER TO cbiometrico;
--
-- Name: seguridad_bitacora_idbitacora_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_bitacora_idbitacora_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_bitacora_idbitacora_seq OWNER TO cbiometrico;
--
-- Name: seguridad_bitacora_idbitacora_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_bitacora_idbitacora_seq', 2557, true);
--
-- Name: seguridad_modulos; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_modulos (
idmodulo integer DEFAULT nextval(('"public"."seguridad_modulos_idmodulo_seq"'::text)::regclass) NOT NULL,
modulo character varying(50) NOT NULL,
orden_modulo integer NOT NULL
);
ALTER TABLE ONLY seguridad_modulos ALTER COLUMN idmodulo SET STATISTICS 0;
ALTER TABLE public.seguridad_modulos OWNER TO cbiometrico;
--
-- Name: seguridad_modulos_idmodulo_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_modulos_idmodulo_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_modulos_idmodulo_seq OWNER TO cbiometrico;
--
-- Name: seguridad_modulos_idmodulo_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_modulos_idmodulo_seq', 7, true);
--
-- Name: seguridad_privilegios; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_privilegios (
idprivilegio integer DEFAULT nextval(('"public"."seguridad_privilegios_idprivilegio_seq"'::text)::regclass) NOT NULL,
privilegio character varying(30) NOT NULL
);
ALTER TABLE ONLY seguridad_privilegios ALTER COLUMN idprivilegio SET STATISTICS 0;
ALTER TABLE ONLY seguridad_privilegios ALTER COLUMN privilegio SET STATISTICS 0;
ALTER TABLE public.seguridad_privilegios OWNER TO cbiometrico;
--
-- Name: seguridad_privilegios_idprivilegio_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_privilegios_idprivilegio_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_privilegios_idprivilegio_seq OWNER TO cbiometrico;
--
-- Name: seguridad_privilegios_idprivilegio_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_privilegios_idprivilegio_seq', 7, true);
--
-- Name: seguridad_programas; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_programas (
idprograma integer DEFAULT nextval(('"public"."seguridad_programas_idprograma_seq"'::text)::regclass) NOT NULL,
programa character varying(300) NOT NULL,
orden_programa integer NOT NULL,
direccion_archivo character varying(250) NOT NULL,
direccion_imagen character varying(250),
descripcion_programa character varying(250),
idseccion integer NOT NULL
);
ALTER TABLE ONLY seguridad_programas ALTER COLUMN idprograma SET STATISTICS 0;
ALTER TABLE public.seguridad_programas OWNER TO cbiometrico;
--
-- Name: seguridad_programas_idprograma_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_programas_idprograma_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_programas_idprograma_seq OWNER TO cbiometrico;
--
-- Name: seguridad_programas_idprograma_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_programas_idprograma_seq', 26, true);
--
-- Name: seguridad_secciones; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_secciones (
idseccion integer DEFAULT nextval(('"public"."seguridad_secciones_idseccion_seq"'::text)::regclass) NOT NULL,
seccion character varying(50) NOT NULL,
direccion_imagen character varying(250),
orden_seccion integer NOT NULL,
idsubmodulo integer NOT NULL
);
ALTER TABLE ONLY seguridad_secciones ALTER COLUMN idseccion SET STATISTICS 0;
ALTER TABLE public.seguridad_secciones OWNER TO cbiometrico;
--
-- Name: seguridad_secciones_idseccion_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_secciones_idseccion_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_secciones_idseccion_seq OWNER TO cbiometrico;
--
-- Name: seguridad_secciones_idseccion_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_secciones_idseccion_seq', 17, true);
--
-- Name: seguridad_submodulos; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_submodulos (
idsubmodulo integer DEFAULT nextval(('"public"."seguridad_submodulos_idsubmodulo_seq"'::text)::regclass) NOT NULL,
submodulo character varying(50) NOT NULL,
orden_submodulo integer NOT NULL,
idmodulo integer NOT NULL
);
ALTER TABLE ONLY seguridad_submodulos ALTER COLUMN idsubmodulo SET STATISTICS 0;
ALTER TABLE public.seguridad_submodulos OWNER TO cbiometrico;
--
-- Name: seguridad_submodulos_idsubmodulo_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_submodulos_idsubmodulo_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_submodulos_idsubmodulo_seq OWNER TO cbiometrico;
--
-- Name: seguridad_submodulos_idsubmodulo_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_submodulos_idsubmodulo_seq', 8, true);
--
-- Name: seguridad_usuarios; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_usuarios (
idusuario integer DEFAULT nextval(('"public"."seguridad_usuarios_idusuario_seq"'::text)::regclass) NOT NULL,
cedula character varying(10) NOT NULL,
usuario character varying(20) NOT NULL,
contrasena character varying(50) NOT NULL,
estatus character varying(8) NOT NULL,
fecha_registro date NOT NULL,
idtemp character varying(50)
);
ALTER TABLE ONLY seguridad_usuarios ALTER COLUMN idusuario SET STATISTICS 0;
ALTER TABLE public.seguridad_usuarios OWNER TO cbiometrico;
--
-- Name: seguridad_usuarios_idusuario_seq; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_usuarios_idusuario_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_usuarios_idusuario_seq OWNER TO cbiometrico;
--
-- Name: seguridad_usuarios_idusuario_seq; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_usuarios_idusuario_seq', 13, true);
--
-- Name: seguridad_usuarios_programas_privilegios; Type: TABLE; Schema: public; Owner: cbiometrico; Tablespace:
--
CREATE TABLE seguridad_usuarios_programas_privilegios (
idusuarios_programas_privilegios integer DEFAULT nextval(('"public"."seguridad_usuarios_programas_privilegios_idusuarios_programas_privilegios_seq"'::text)::regclass) NOT NULL,
idusuario integer NOT NULL,
idprograma integer NOT NULL,
idprivilegio integer NOT NULL
);
ALTER TABLE public.seguridad_usuarios_programas_privilegios OWNER TO cbiometrico;
--
-- Name: seguridad_usuarios_programas_privilegios_idusuarios_programas_p; Type: SEQUENCE; Schema: public; Owner: cbiometrico
--
CREATE SEQUENCE seguridad_usuarios_programas_privilegios_idusuarios_programas_p
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 2147483647
CACHE 1;
ALTER TABLE public.seguridad_usuarios_programas_privilegios_idusuarios_programas_p OWNER TO cbiometrico;
--
-- Name: seguridad_usuarios_programas_privilegios_idusuarios_programas_p; Type: SEQUENCE SET; Schema: public; Owner: cbiometrico
--
SELECT pg_catalog.setval('seguridad_usuarios_programas_privilegios_idusuarios_programas_p', 1456, true);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY att_departamentos ALTER COLUMN id SET DEFAULT nextval('att_departamentos_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY att_devices ALTER COLUMN id SET DEFAULT nextval('att_devices_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY att_horarios ALTER COLUMN id SET DEFAULT nextval('att_horarios_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY att_logs ALTER COLUMN id SET DEFAULT nextval('att_logs_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY departamentos ALTER COLUMN id SET DEFAULT nextval('departamentos_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY file_indexing ALTER COLUMN id SET DEFAULT nextval('file_indexing_id_seq'::regclass);
--
-- Name: id_listing_files; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY file_indexing ALTER COLUMN id_listing_files SET DEFAULT nextval('file_indexing_id_listing_files_seq'::regclass);
--
-- Name: contador; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY file_indexing ALTER COLUMN contador SET DEFAULT nextval('file_indexing_contador_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: cbiometrico
--
ALTER TABLE ONLY listing_files ALTER COLUMN id SET DEFAULT nextval('listing_files_id_seq'::regclass);
--
-- Data for Name: att_departamentos; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO att_departamentos VALUES (2, 'Departamento Técnico');
INSERT INTO att_departamentos VALUES (3, 'Departamento Administrativo');
INSERT INTO att_departamentos VALUES (1, 'Informática y Sistemas');
INSERT INTO att_departamentos VALUES (4, 'Gerencia General');
--
-- Data for Name: att_devices; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO att_devices VALUES (5, 'Biometrico1', '192.168.1.106', '8000', 'Unidad Biometrica de FBG');
--
-- Data for Name: att_horarios; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO att_horarios VALUES (5, 'Horario General de Oficina', false, true, '08:00:00', 15, '12:00:00', 0, true, '13:00:00', 5, '17:00:00', 0, true, 60, true, true, '16:00:00', true, '19:00:00');
INSERT INTO att_horarios VALUES (1, 'Horario Técnico', true, true, '08:00:00', 15, '12:00:00', 0, false, '13:00:00', 5, '17:00:00', 0, true, 60, true, true, '16:00:00', true, '19:00:00');
INSERT INTO att_horarios VALUES (6, 'Horario Yolanda', false, true, '09:30:00', 15, '12:00:00', 0, false, NULL, 0, '16:30:00', 0, true, 0, true, false, '16:00:00', false, '19:00:00');
--
-- Data for Name: att_logs; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO att_logs VALUES (31050, 3, '2012-10-30', '09:17:00', 'd538ddb6fb5ae3b5c24c776a631b0617229eb9b5', 5, 6);
INSERT INTO att_logs VALUES (31051, 4, '2012-10-30', '10:34:00', '80f30bc8ce222679607838254f9c2bcc15906a02', 5, 1);
INSERT INTO att_logs VALUES (31052, 4, '2012-10-30', '13:05:00', 'e41449b2f837fffd543e90f2f16bac377838e5d2', 5, 1);
INSERT INTO att_logs VALUES (31053, 2, '2012-10-30', '13:05:00', 'da293baacb787031cf1610be6441942fc2eea340', 5, 1);
INSERT INTO att_logs VALUES (31054, 10, '2012-10-30', '13:47:00', 'aa581a6d012c6fcb1d6648cd50134de6d5949bae', 5, 5);
INSERT INTO att_logs VALUES (31055, 3, '2012-10-30', '17:18:00', 'eccda81539c47458af1917260ca73647d2a0ba44', 5, 6);
INSERT INTO att_logs VALUES (31056, 8, '2012-10-30', '17:19:00', 'a006a993cbd20c06d9a8f88ecde04b3e46952bff', 5, 6);
INSERT INTO att_logs VALUES (31057, 2, '2012-10-30', '17:26:00', '0cc8a11ef56c9349e03715e8fbcfc18b2e180d0f', 5, 1);
INSERT INTO att_logs VALUES (31058, 4, '2012-10-30', '17:36:00', '780728823658d99a79a821cc7293d43dcf0c103a', 5, 1);
INSERT INTO att_logs VALUES (31059, 10, '2012-10-30', '18:04:00', '5f4deb7ce2491d54f108f7bdd2604b48f4895eee', 5, 5);
INSERT INTO att_logs VALUES (31060, 9, '2012-10-30', '18:04:00', '55a72d24b7f727d3a3d941ef681e411120a6b30d', 5, 5);
INSERT INTO att_logs VALUES (31061, 5, '2012-10-30', '18:04:00', '2663d9c6caf789b624770e3751edcaa3915bd654', 5, 5);
INSERT INTO att_logs VALUES (31062, 5, '2012-10-31', '07:29:00', '7420f8924da7cd75cfa530dc158a3daa3777427a', 5, 5);
INSERT INTO att_logs VALUES (31063, 6, '2012-10-31', '08:10:00', 'c4cd9c870e084e73d8cdcb2285b16d36cacfedb5', 5, 1);
INSERT INTO att_logs VALUES (31064, 4, '2012-10-31', '08:45:00', 'dc9306b46355f3209f72352f24e4f53d5ec209fb', 5, 1);
INSERT INTO att_logs VALUES (31065, 2, '2012-10-31', '09:40:00', '1e4dc5a80b01fc8606344bb0968a6eb31dab50e6', 5, 1);
INSERT INTO att_logs VALUES (31066, 3, '2012-10-31', '09:41:00', '4f7231fa7c17c9665d8bc716a72b399a97b906d8', 5, 6);
INSERT INTO att_logs VALUES (31067, 8, '2012-10-31', '13:28:00', '52e4523a4df475606edcf4c4aa55501665ef1a3a', 5, 6);
INSERT INTO att_logs VALUES (31068, 9, '2012-10-31', '13:29:00', 'd7b49e53b56b5228f3f0dab4da1e226431030114', 5, 5);
INSERT INTO att_logs VALUES (31069, 10, '2012-10-31', '14:28:00', '29628bfd962c2060b05db4ee95ebd3bba93a0e04', 5, 5);
INSERT INTO att_logs VALUES (31070, 2, '2012-10-31', '16:44:00', '03e7d2d6bb44d056b4276fc329eb99e5f41e529d', 5, 1);
INSERT INTO att_logs VALUES (31071, 8, '2012-10-31', '17:12:00', '4a55e2d011f226e9fae11ac4f225755f8071d07b', 5, 6);
INSERT INTO att_logs VALUES (31072, 10, '2012-10-31', '18:55:00', 'a99e2135f0dcd4ce3fd0b3074bef756954e56304', 5, 5);
INSERT INTO att_logs VALUES (31073, 5, '2012-10-31', '18:56:00', '073bc68574a8fef9c8139809ebebfa7388b54b5d', 5, 5);
INSERT INTO att_logs VALUES (31074, 9, '2012-10-31', '18:56:00', '6530e5c631f5414b4cb511004e14eb959624edd5', 5, 5);
INSERT INTO att_logs VALUES (31075, 7, '2012-11-01', '07:59:00', 'e8540380cbab16762fbefd09cf3adb393ca92e4f', 5, 1);
INSERT INTO att_logs VALUES (31076, 5, '2012-11-01', '08:25:00', '9a53c2aa67254e21b082938ea0b0fa7daa3a62ad', 5, 5);
INSERT INTO att_logs VALUES (31077, 4, '2012-11-01', '08:27:00', 'd96c7622353c3adfd1a5aa6055d8d8a01c3103c6', 5, 1);
INSERT INTO att_logs VALUES (31078, 3, '2012-11-01', '09:11:00', 'cf53cea9a47487b3e72f90a52997376f32637c0f', 5, 6);
INSERT INTO att_logs VALUES (31079, 6, '2012-11-01', '09:22:00', 'b4a924f6a5b89408c3ceb5619aa86712805a38cc', 5, 1);
INSERT INTO att_logs VALUES (31080, 4, '2012-11-01', '10:52:00', 'ca117aff5dc2ad40a5b2472c0091c6dcaebf9269', 5, 1);
INSERT INTO att_logs VALUES (31081, 10, '2012-11-01', '12:25:00', '6d37f88e277b338ea66bf119d45889717392e5a9', 5, 5);
INSERT INTO att_logs VALUES (31082, 8, '2012-11-01', '12:36:00', '22ae662d8d479d007e1aabe0330cab5f8ac03820', 5, 6);
INSERT INTO att_logs VALUES (31083, 9, '2012-11-01', '13:50:00', '51c61b0b8c0952510d2e580a1f6dd99f35c7262b', 5, 5);
INSERT INTO att_logs VALUES (31084, 8, '2012-11-01', '17:21:00', 'defceaa25c5a14bc8bd40f7b2dbaeb99b8141727', 5, 6);
INSERT INTO att_logs VALUES (31085, 3, '2012-11-01', '17:22:00', 'a96d611a07138e11d669079d1a5ec3a44a4ff93a', 5, 6);
INSERT INTO att_logs VALUES (31086, 6, '2012-11-01', '17:23:00', '12636498562d809feda22ea24e4c24de5c29b6b6', 5, 1);
INSERT INTO att_logs VALUES (31087, 2, '2012-11-01', '17:33:00', 'd4557a7d91c9aa588f09507da67817df83931c2f', 5, 1);
INSERT INTO att_logs VALUES (31088, 10, '2012-11-01', '18:16:00', '850e76ed7d50b9d6be17435334e7903f3a64a0ce', 5, 5);
INSERT INTO att_logs VALUES (31089, 5, '2012-11-02', '07:41:00', 'da0125ead8720382c4c1a43d9635e7cfa3220554', 5, 5);
INSERT INTO att_logs VALUES (31090, 4, '2012-11-02', '08:07:00', 'e9db3f45f9a0dd26ec4cdcb9f8c766a4f613cf48', 5, 1);
INSERT INTO att_logs VALUES (31091, 4, '2012-11-02', '08:08:00', '40c682796f751bab777c8fa5a0acc374e621c6c2', 5, 1);
INSERT INTO att_logs VALUES (31092, 2, '2012-11-02', '08:11:00', 'c333c21047deac6b9c043647cfcafb8ba8fe08e6', 5, 1);
INSERT INTO att_logs VALUES (31093, 7, '2012-11-02', '08:14:00', '90f9eb0f21a2a8b7c50cdea60caa40d59bb895d5', 5, 1);
INSERT INTO att_logs VALUES (31094, 6, '2012-11-02', '08:14:00', '029db09c176841148ba38a3ee17db11ab0516f16', 5, 1);
INSERT INTO att_logs VALUES (31095, 3, '2012-11-02', '09:04:00', '7c88fcb1bd5cfb996460059c78347e2506f6d911', 5, 6);
INSERT INTO att_logs VALUES (31096, 10, '2012-11-02', '14:34:00', 'b9d8a862ad2b7f32f3c9da9c3b7ff46b9e47b7ab', 5, 5);
INSERT INTO att_logs VALUES (31097, 9, '2012-11-02', '15:12:00', '9c06018aa42f3bf2b9bd83b2621b43add93204da', 5, 5);
INSERT INTO att_logs VALUES (31098, 3, '2012-11-02', '16:00:00', 'c2fa77ce3b3eb10182d86730367e2d4bab9f2043', 5, 6);
INSERT INTO att_logs VALUES (31099, 7, '2012-11-02', '16:00:00', '90aada949cd3cad0c1c0948d45ef677c02c9ba34', 5, 1);
INSERT INTO att_logs VALUES (31100, 4, '2012-11-02', '17:50:00', '2e4bc06244cc26922cdf017f4170ce3f50b13870', 5, 1);
INSERT INTO att_logs VALUES (31101, 2, '2012-11-02', '18:07:00', '9ce15329b503be89f04046578c615c32ef1302e9', 5, 1);
INSERT INTO att_logs VALUES (31102, 10, '2012-11-02', '19:49:00', 'b2fd2f1daa0363d0dd0b366e4ad959b4e6c8750a', 5, 5);
INSERT INTO att_logs VALUES (31103, 9, '2012-11-02', '19:50:00', '8c66704c9837d58ecc13534a79665c78382a0827', 5, 5);
INSERT INTO att_logs VALUES (31104, 5, '2012-11-02', '19:50:00', '014ed6e76f9f692c18b52edbf93053ac08ffbf63', 5, 5);
INSERT INTO att_logs VALUES (31105, 5, '2012-11-05', '07:21:00', 'dec5754f49b8c8b735bb8d62a35984007e828d26', 5, 5);
INSERT INTO att_logs VALUES (31106, 4, '2012-11-05', '08:05:00', '1f1642524417a0e00dd28ab814caf6eb1542930a', 5, 1);
INSERT INTO att_logs VALUES (31107, 7, '2012-11-05', '08:05:00', '268da32a9661537da90386e193a40b4458048b4f', 5, 1);
INSERT INTO att_logs VALUES (31108, 2, '2012-11-05', '08:44:00', 'ae96d73695e575483ecfa77730d61fddcb9a9d92', 5, 1);
INSERT INTO att_logs VALUES (31109, 3, '2012-11-05', '10:10:00', 'ceb41eae602a01bd7ed939a62bb42720398b39ef', 5, 6);
--
-- Data for Name: att_personas; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO att_personas VALUES (148, 1, 'LUIS FRANQUIZ', 9420867, true, 1, true, 1, 1, true, NULL);
INSERT INTO att_personas VALUES (150, 8, 'YULIETH MENDOZA', 18734582, true, 6, true, 3, 5, true, NULL);
INSERT INTO att_personas VALUES (151, 5, 'THAIS MENDOZA', 11025797, true, 5, true, 4, 5, true, NULL);
INSERT INTO att_personas VALUES (152, 9, 'ISRAEL FRANQUIZ', 27235515, true, 5, true, 3, 5, true, NULL);
INSERT INTO att_personas VALUES (153, 10, 'MOISES FRANQUIZ', 999999999, true, 5, true, 3, 5, true, NULL);
INSERT INTO att_personas VALUES (154, 4, 'NESTOR MONTAñO', 17311603, true, 1, true, 1, 5, true, NULL);
INSERT INTO att_personas VALUES (155, 6, 'JONATHAN MERLANO', 23184005, true, 1, true, 2, 5, true, NULL);
INSERT INTO att_personas VALUES (156, 7, 'DELKIMET MERLANO', 22964529, true, 1, true, 2, 5, true, NULL);
INSERT INTO att_personas VALUES (157, 3, 'YOLANDA', 4315160, true, 6, true, 3, 5, true, NULL);
INSERT INTO att_personas VALUES (149, 2, 'CHRISTIAN VIVAS', 17176888, true, 1, true, 1, 5, true, NULL);
--
-- Data for Name: departamentos; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO departamentos VALUES (1, 'Informática y Sistemas');
INSERT INTO departamentos VALUES (2, 'Satrim');
INSERT INTO departamentos VALUES (3, 'Catastro');
INSERT INTO departamentos VALUES (4, 'Ingeniería Municipal');
INSERT INTO departamentos VALUES (5, 'Archivo');
INSERT INTO departamentos VALUES (6, 'Bienes');
INSERT INTO departamentos VALUES (7, 'Compras');
INSERT INTO departamentos VALUES (8, 'Servicios Generales ');
INSERT INTO departamentos VALUES (9, 'Sindicato');
INSERT INTO departamentos VALUES (10, 'Transporte');
INSERT INTO departamentos VALUES (11, 'Administración');
INSERT INTO departamentos VALUES (12, 'Atención Ciudadana ');
INSERT INTO departamentos VALUES (13, 'Central Telefonica');
INSERT INTO departamentos VALUES (14, 'Biblioteca');
INSERT INTO departamentos VALUES (15, 'Sindicatura');
INSERT INTO departamentos VALUES (16, 'Sacumg');
INSERT INTO departamentos VALUES (17, 'Despacho');
INSERT INTO departamentos VALUES (18, 'Presupuesto');
INSERT INTO departamentos VALUES (19, 'Relaciones Publicas');
INSERT INTO departamentos VALUES (20, 'Obras Municipales');
INSERT INTO departamentos VALUES (21, 'Consejo Local');
INSERT INTO departamentos VALUES (22, 'Asuntos Legales');
INSERT INTO departamentos VALUES (23, 'Recursos Humanos');
INSERT INTO departamentos VALUES (24, 'Caja de Ahorro');
INSERT INTO departamentos VALUES (25, 'Enfermería');
INSERT INTO departamentos VALUES (26, 'Auditoria Interna');
INSERT INTO departamentos VALUES (27, 'Oficina Tecnica Municipal');
INSERT INTO departamentos VALUES (28, 'Parroquialización');
INSERT INTO departamentos VALUES (29, 'Fondo de Gestión Social');
INSERT INTO departamentos VALUES (30, 'Omdecu');
INSERT INTO departamentos VALUES (31, 'Concejales');
--
-- Data for Name: file_indexing; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
--
-- Data for Name: listing_files; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO listing_files VALUES (6, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/1e9567ab1e72b9ef8c31c74797eb30f9svnmanager-1.09.zip', '2012-11-05:11:40:02:0000000.65624900 1352144402 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (7, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/f20dee4bdf479efe718753d56836fbb4svnmanager-1.09.zip', '2012-11-05:11:40:11:0000000.38453600 1352144411 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (8, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/132b7401b1cc0f2ca72384811cc33931svnmanager-1.09.zip', '2012-11-05:11:40:20:0000000.26004200 1352144420 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (9, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/8208d6351f81c6d3f7d2832ed247dab0svnmanager-1.09.zip', '2012-11-05:11:40:29:0000000.11305400 1352144429 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (10, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/d0a6fbd88ff76a79ac8a1776e61905f5jkkjj.csv', '2012-11-05:12:00:19:0000000.07348300 1352145619 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (11, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/96ee85b9839081ee9fb8a9f6c909ee32jkkjj.csv', '2012-11-05:12:34:23:0000000.73112300 1352147663 Direccion IP del usuario127.0.0.1');
INSERT INTO listing_files VALUES (12, '/opt/lappstack-5.4.7-0/apache2/htdocs/uploads/132b7401b1cc0f2ca72384811cc33931jkkjj.csv', '2012-11-05:13:16:20:0000000.31341700 1352150180 Direccion IP del usuario127.0.0.1');
--
-- Data for Name: seguridad_bitacora; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_bitacora VALUES (2170, '2012-10-24', '13:23:38', 'seguridad_programas', '', 'Se agrego el programa: Descarga de Datos de órden: 99', '127.0.0.1', 1, 'programas_form.php');
INSERT INTO seguridad_bitacora VALUES (2171, '2012-10-24', '13:25:34', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: admin', '127.0.0.1', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2172, '2012-10-24', '13:25:34', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: admin', '127.0.0.1', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2173, '2012-10-24', '13:25:34', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: admin', '127.0.0.1', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2174, '2012-10-24', '13:25:34', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: admin', '127.0.0.1', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2175, '2012-10-24', '13:25:34', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: admin', '127.0.0.1', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2176, '2012-10-25', '08:41:55', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2177, '2012-10-25', '12:44:42', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2178, '2012-10-26', '12:11:22', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2179, '2012-10-27', '16:09:55', '', '', 'Apertura de Sesión', '::1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2180, '2012-10-27', '16:12:30', '', '', 'Apertura de Sesión', '::1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2181, '2012-10-30', '13:42:13', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2182, '2012-10-30', '13:42:39', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2183, '2012-10-30', '13:47:12', '', '', 'Apertura de Sesión', '192.168.1.100', 1, '');
INSERT INTO seguridad_bitacora VALUES (2184, '2012-10-30', '14:01:18', '', '', 'Apertura de Sesión', '192.168.1.105', 1, '');
INSERT INTO seguridad_bitacora VALUES (2185, '2012-10-30', '14:05:37', 'seguridad_usuarios_programas_privilegios', '', 'Se eliminaron todos los privilegios del programa: Grafico de Retrasos e Inasistencias, para el usuario: bkaren', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2186, '2012-10-30', '14:06:11', 'seguridad_usuarios_programas_privilegios', '', 'Se eliminaron todos los privilegios del programa: Admon. Accesos, para el usuario: bkaren', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2187, '2012-10-30', '14:12:05', '', '', 'Apertura de Sesión', '190.142.53.177', 1, '');
INSERT INTO seguridad_bitacora VALUES (2188, '2012-10-30', '14:12:40', 'seguridad_usuarios', '6', 'Se elimino el usuario: con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2189, '2012-10-30', '14:12:51', 'seguridad_usuarios', '9', 'Se elimino el usuario: con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2190, '2012-10-30', '14:13:01', 'seguridad_usuarios', '8', 'Se elimino el usuario: con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2191, '2012-10-30', '14:13:14', 'seguridad_usuarios', '10', 'Se elimino el usuario: con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2192, '2012-10-30', '14:13:26', 'seguridad_usuarios', '5', 'Se elimino el usuario: con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2193, '2012-10-30', '14:13:41', 'seguridad_usuarios', '7', 'Se elimino el usuario: con estátus: Inactivo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2194, '2012-10-30', '14:14:08', 'seguridad_usuarios', '1', 'Se modifico el usuario existente', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2195, '2012-10-30', '14:14:19', 'seguridad_usuarios', '1', 'Se modifico el usuario existente', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2196, '2012-10-30', '14:25:33', 'seguridad_usuarios', '1', 'Se modifico el usuario existente', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2197, '2012-10-30', '14:27:18', 'seguridad_usuarios', '', 'Se agrego el usuario: luisf con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2198, '2012-10-30', '14:28:28', 'seguridad_usuarios', '', 'Se agrego el usuario: mnestor con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2199, '2012-10-30', '14:28:58', 'seguridad_usuarios', '', 'Se agrego el usuario: thais con estátus: Activo', '190.142.53.177', 1, 'usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2200, '2012-10-30', '14:29:46', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2201, '2012-10-30', '14:29:51', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2202, '2012-10-30', '14:29:55', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2203, '2012-10-30', '14:30:00', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2204, '2012-10-30', '14:30:04', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2205, '2012-10-30', '14:30:09', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2206, '2012-10-30', '14:30:13', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2207, '2012-10-30', '14:30:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2208, '2012-10-30', '14:30:23', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2209, '2012-10-30', '14:30:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2210, '2012-10-30', '14:30:32', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2211, '2012-10-30', '14:30:36', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2212, '2012-10-30', '14:30:41', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2213, '2012-10-30', '14:30:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2214, '2012-10-30', '14:30:50', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2215, '2012-10-30', '14:30:54', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2216, '2012-10-30', '14:30:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2217, '2012-10-30', '14:31:03', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2218, '2012-10-30', '14:31:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2219, '2012-10-30', '14:31:12', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2220, '2012-10-30', '14:31:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2222, '2012-10-30', '14:31:21', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '190.142.53.177', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2221, '2012-10-30', '14:31:24', '', '', 'Apertura de Sesión', '192.168.1.105', 1, '');
INSERT INTO seguridad_bitacora VALUES (2223, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2224, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2225, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2226, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2227, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2228, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2229, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2230, '2012-10-30', '14:40:16', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2231, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2232, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2233, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2234, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2235, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2236, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2237, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2238, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2239, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2240, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2241, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2242, '2012-10-30', '14:40:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2243, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2244, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2245, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2246, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2247, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2248, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2249, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2250, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2251, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2252, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2253, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2254, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2255, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2256, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2257, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2258, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2259, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2260, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2261, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2262, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2263, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2264, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2265, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2266, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2267, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2268, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2269, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2270, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2271, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2272, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2273, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2274, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2275, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2276, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2277, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2278, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2279, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2280, '2012-10-30', '14:40:26', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2281, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2282, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2283, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2284, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2285, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2286, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2287, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2288, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2289, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2290, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2291, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2292, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2293, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2294, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2295, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2296, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2297, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2298, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2299, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2300, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2301, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2302, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2303, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2304, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2305, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2306, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2307, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2308, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2309, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2310, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2311, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2312, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2313, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2314, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2315, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2316, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2317, '2012-10-30', '14:40:27', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2318, '2012-10-30', '14:40:58', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2319, '2012-10-30', '14:40:58', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2320, '2012-10-30', '14:40:58', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2321, '2012-10-30', '14:40:58', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2322, '2012-10-30', '14:40:58', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2323, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2324, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2325, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2326, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2327, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2328, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2329, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2330, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2331, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2332, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2333, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2334, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2335, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2336, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2337, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2338, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2339, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2340, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2341, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2342, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2343, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2344, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2345, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2346, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2347, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2348, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2349, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2350, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2351, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2352, '2012-10-30', '14:40:59', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: thais', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2353, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2354, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2355, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2356, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2357, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2358, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2359, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2360, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2361, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2362, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2363, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2364, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2365, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2366, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2367, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2368, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2369, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2370, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2371, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2372, '2012-10-30', '14:41:17', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2373, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2374, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2375, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2376, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2377, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2378, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2379, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2380, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2381, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2382, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2383, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2384, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2385, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2386, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2387, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2388, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2389, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2390, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2391, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2392, '2012-10-30', '14:51:05', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2393, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2394, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2395, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2396, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2397, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2398, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2399, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2400, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2401, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2402, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2403, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2404, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2405, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2406, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2407, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2408, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2409, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2410, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2411, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2412, '2012-10-30', '14:51:08', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2413, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2414, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2415, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2416, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2417, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2418, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2419, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2420, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2421, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2422, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2423, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2424, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2425, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2426, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2427, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2428, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2429, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2430, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2431, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2432, '2012-10-30', '14:51:44', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2433, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2434, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2435, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2436, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2437, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2438, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2439, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2440, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2441, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2442, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2443, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2444, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2445, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2446, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2447, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2448, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2449, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2450, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2451, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2452, '2012-10-30', '14:51:45', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: mnestor', '192.168.1.105', 1, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2453, '2012-10-30', '14:52:22', '', '', 'Cierre de Sesión', '192.168.1.105', 1, '');
INSERT INTO seguridad_bitacora VALUES (2454, '2012-10-30', '14:52:38', '', '', 'Apertura de Sesión', '192.168.1.105', 12, '');
INSERT INTO seguridad_bitacora VALUES (2455, '2012-10-30', '14:52:48', '', '', 'Cierre de Sesión', '192.168.1.105', 12, '');
INSERT INTO seguridad_bitacora VALUES (2456, '2012-10-30', '14:52:54', '', '', 'Apertura de Sesión', '192.168.1.105', 13, '');
INSERT INTO seguridad_bitacora VALUES (2457, '2012-10-30', '14:53:38', '', '', 'Cierre de Sesión', '192.168.1.105', 13, '');
INSERT INTO seguridad_bitacora VALUES (2458, '2012-10-30', '14:53:48', '', '', 'Apertura de Sesión', '192.168.1.105', 11, '');
INSERT INTO seguridad_bitacora VALUES (2459, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2460, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2461, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2462, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2463, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2464, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2465, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2466, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2467, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2468, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2469, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2470, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2471, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2472, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2473, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2474, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2475, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2476, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2477, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2478, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2479, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2480, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2481, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2482, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2483, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2484, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2485, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2486, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2487, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2488, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2489, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2490, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2491, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2492, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2493, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2494, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2495, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2496, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2497, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2498, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2499, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2500, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2501, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2502, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2503, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2504, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2505, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2506, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2507, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2508, '2012-10-30', '14:54:18', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2509, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2510, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2511, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2512, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2513, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2514, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2515, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2516, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2517, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2518, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2519, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2520, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2521, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2522, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2523, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2524, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2525, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2526, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2527, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2528, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2529, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Agregar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2530, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Consultar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2531, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Eliminar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2532, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Imprimir, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2533, '2012-10-30', '14:54:19', 'seguridad_usuarios_programas_privilegios', '', 'Se agrego el privilegio: Modificar, para el usuario: luisf', '192.168.1.105', 11, 'privilegios_usuarios_form.php');
INSERT INTO seguridad_bitacora VALUES (2534, '2012-10-30', '14:54:26', '', '', 'Cierre de Sesión', '192.168.1.105', 11, '');
INSERT INTO seguridad_bitacora VALUES (2535, '2012-10-30', '15:20:16', '', '', 'Apertura de Sesión', '192.168.1.100', 13, '');
INSERT INTO seguridad_bitacora VALUES (2536, '2012-10-30', '15:22:15', '', '', 'Apertura de Sesión', '192.168.1.100', 11, '');
INSERT INTO seguridad_bitacora VALUES (2537, '2012-10-30', '15:25:38', '', '', 'Cierre de Sesión', '192.168.1.100', 11, '');
INSERT INTO seguridad_bitacora VALUES (2538, '2012-10-31', '07:45:11', '', '', 'Apertura de Sesión', '192.168.1.104', 11, '');
INSERT INTO seguridad_bitacora VALUES (2539, '2012-10-31', '13:04:26', '', '', 'Apertura de Sesión', '190.39.169.146', 11, '');
INSERT INTO seguridad_bitacora VALUES (2540, '2012-11-01', '13:43:33', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2541, '2012-11-02', '06:13:40', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2542, '2012-11-02', '07:22:31', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2543, '2012-11-02', '07:24:18', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2544, '2012-11-02', '07:24:42', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2545, '2012-11-02', '07:24:55', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2546, '2012-11-02', '07:30:27', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2547, '2012-11-02', '08:23:36', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2548, '2012-11-02', '11:54:49', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2549, '2012-11-05', '07:16:33', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2550, '2012-11-05', '13:15:56', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2551, '2012-11-06', '05:16:05', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2552, '2012-11-06', '11:04:52', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2553, '2012-11-06', '11:06:46', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2554, '2012-11-06', '11:10:39', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2555, '2012-11-06', '11:10:43', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2556, '2012-11-06', '11:15:40', '', '', 'Apertura de Sesión', '127.0.0.1', 1, '');
INSERT INTO seguridad_bitacora VALUES (2557, '2012-11-06', '11:18:23', '', '', 'Cierre de Sesión', '127.0.0.1', 1, '');
--
-- Data for Name: seguridad_modulos; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_modulos VALUES (7, 'SCAYA', 1);
INSERT INTO seguridad_modulos VALUES (1, 'OPCIONES', 2);
--
-- Data for Name: seguridad_privilegios; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_privilegios VALUES (1, 'Agregar');
INSERT INTO seguridad_privilegios VALUES (2, 'Modificar');
INSERT INTO seguridad_privilegios VALUES (3, 'Eliminar');
INSERT INTO seguridad_privilegios VALUES (4, 'Imprimir');
INSERT INTO seguridad_privilegios VALUES (5, 'Consultar');
--
-- Data for Name: seguridad_programas; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_programas VALUES (4, 'Registro de Módulos', 1, '../../seguridad/registro_modulos/configuracion_menu_form.php', '/imagenes/seguridad/iconos/addremoveprograms.png', ' Registro de Módulos para la Configuración del Menú', 1);
INSERT INTO seguridad_programas VALUES (3, 'Registro de Sucesos del Sistema', 1, '../../seguridad/registro_sucesos/bitacora_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Gestor de Reportes del Registro Suceos del Sistema', 3);
INSERT INTO seguridad_programas VALUES (14, 'Horas Extras entre fechas', 1, '../../seca/reportes/horas_extras_fechas/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Calculo de Horas extras entre Fechas', 14);
INSERT INTO seguridad_programas VALUES (15, 'Horas Extras Compacto', 2, '../../seca/reportes/he_fechas_comp/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Reporte Compacto de Horas Extras', 14);
INSERT INTO seguridad_programas VALUES (12, 'Carga de Archivos', 1, '../../seca/mantenimientos/carga_asist_file/carga_asistencia_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Carga Archivos de Info del Biometrico', 12);
INSERT INTO seguridad_programas VALUES (13, 'Asistencia de una Fecha', 1, '../../seca/reportes/asist_fecha/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Asistencia tomada en una fecha', 13);
INSERT INTO seguridad_programas VALUES (19, 'Admon. Accesos', 2, '../../seca/mantenimientos/adm_accesos/accesos_form.php', '/imagenes/seguridad/iconos/programas.gif', '', 12);
INSERT INTO seguridad_programas VALUES (18, 'Admon. Equipos', 1, '../../seca/mantenimientos/adm_devices/devices_form.php', '/imagenes/seguridad/iconos/programas.gif', '', 11);
INSERT INTO seguridad_programas VALUES (20, 'Asistencia entre Fechas', 2, '../../seca/reportes/asist_entrefch/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Reportes de Asistencia de Personal entre Fechas', 13);
INSERT INTO seguridad_programas VALUES (21, 'Grafico de Horas Extras', 1, '../../seca/reportes/grafico_he_fechas/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Grafico de Horas Extras de Personal Entre Fechas', 17);
INSERT INTO seguridad_programas VALUES (22, 'Inasistencias y Retardos', 3, '../../seca/reportes/retardos_fechas/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Inasistencias y Retardos del personal entre fechas', 14);
INSERT INTO seguridad_programas VALUES (23, 'Grafico de Retrasos e Inasistencias', 2, '../../seca/reportes/graf_ret_fechas/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Escala de Inasistencias y Retardos por departamento', 17);
INSERT INTO seguridad_programas VALUES (24, 'Control de Asistencia entre Fechas Para un solo Empleado o Funcionario', 12, '../../seca/reportes/asist_fecha_perso/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', '', 13);
INSERT INTO seguridad_programas VALUES (25, 'Horas Extras Compacto Personalizado', 33, '../../seca/reportes/he_fechas_comp_perso/consulta_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Horas extras personalizado para un solo empleado en detalle', 14);
INSERT INTO seguridad_programas VALUES (17, 'Admon. Horarios', 2, '../../seca/mantenimientos/adm_horarios/horarios_form.php', '/imagenes/seguridad/iconos/programas.gif', 'Maneja y Administra los Horarios Disponible', 10);
INSERT INTO seguridad_programas VALUES (16, 'Ficha de Personal', 1, '../../seca/mantenimientos/adm_personal/personal_form.php', '/imagenes/seguridad/iconos/programas.gif', '', 10);
INSERT INTO seguridad_programas VALUES (26, 'Descarga de Datos', 99, '../../seca/mantenimientos/adm_descargadatos/form.php', '/imagenes/seguridad/iconos/programas.gif', '', 11);
INSERT INTO seguridad_programas VALUES (5, 'Registro de Usuarios', 3, '../../seguridad/registro_privilegios_usuarios/configuracion_usuarios_form.php', '/imagenes/seguridad/iconos/users.png', 'Registro de Privilegios de Usuarios sobre los Programas', 2);
INSERT INTO seguridad_programas VALUES (1, 'Administrar Roles de Usuario', 1, '../../seguridad/registro_privilegios/privilegios_form.php', '/imagenes/seguridad/iconos/user_roles.png', 'Mantenimiento de Privilegios', 2);
--
-- Data for Name: seguridad_secciones; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_secciones VALUES (1, 'Configuración del Menú', NULL, 1, 1);
INSERT INTO seguridad_secciones VALUES (2, 'Configuración de Usuarios', NULL, 2, 1);
INSERT INTO seguridad_secciones VALUES (3, 'Sucesos del Sistema', NULL, 1, 5);
INSERT INTO seguridad_secciones VALUES (10, 'Personal', '', 1, 6);
INSERT INTO seguridad_secciones VALUES (11, 'Equipos', '', 2, 6);
INSERT INTO seguridad_secciones VALUES (12, 'Control Acceso', '', 3, 6);
INSERT INTO seguridad_secciones VALUES (13, 'Asistencia', '', 2, 7);
INSERT INTO seguridad_secciones VALUES (17, 'Graficos', '', 1, 8);
INSERT INTO seguridad_secciones VALUES (14, 'Dir. Recursos Humanos', '', 2, 7);
--
-- Data for Name: seguridad_submodulos; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_submodulos VALUES (6, 'Registro', 1, 7);
INSERT INTO seguridad_submodulos VALUES (7, 'Reportes', 2, 7);
INSERT INTO seguridad_submodulos VALUES (8, 'Graficos', 3, 7);
INSERT INTO seguridad_submodulos VALUES (5, 'Auditoria', 2, 1);
INSERT INTO seguridad_submodulos VALUES (1, 'Configuración del Sistema', 1, 1);
--
-- Data for Name: seguridad_usuarios; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_usuarios VALUES (12, '17311603', 'mnestor', '827ccb0eea8a706c4c34a16891f84e7b', 'Activo', '2012-10-30', '');
INSERT INTO seguridad_usuarios VALUES (13, '11025797', 'thais', '81dc9bdb52d04dc20036dbd8313ed055', 'Activo', '2012-10-30', '0cf936f8bd2e96644eb54d1af13c6ba7');
INSERT INTO seguridad_usuarios VALUES (11, '9420867', 'luisf', '81dc9bdb52d04dc20036dbd8313ed055', 'Activo', '2012-10-30', '768282262cd494b82c925e31ef2dcf3a');
INSERT INTO seguridad_usuarios VALUES (1, '0000000', 'admin', '827ccb0eea8a706c4c34a16891f84e7b', 'Activo', '2009-04-24', '');
--
-- Data for Name: seguridad_usuarios_programas_privilegios; Type: TABLE DATA; Schema: public; Owner: cbiometrico
--
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1124, 1, 26, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1125, 1, 26, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1126, 1, 26, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1127, 1, 26, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1128, 1, 26, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (3, 1, 7, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1362, 12, 1, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1363, 12, 1, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1364, 12, 1, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1365, 12, 1, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1366, 12, 1, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1367, 12, 4, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1368, 12, 4, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1369, 12, 4, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1370, 12, 4, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1371, 12, 4, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1372, 12, 3, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1373, 12, 3, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1374, 12, 3, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1375, 12, 3, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1376, 12, 3, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1377, 12, 5, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1378, 12, 5, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1379, 12, 5, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1380, 12, 5, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1381, 12, 5, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1152, 11, 1, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1153, 11, 1, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1154, 11, 1, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1155, 11, 1, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1156, 11, 1, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1157, 11, 4, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1158, 11, 4, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1159, 11, 4, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1160, 11, 4, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1161, 11, 4, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1162, 11, 3, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1163, 11, 3, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1164, 11, 3, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1165, 11, 3, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1166, 11, 3, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1167, 11, 5, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1168, 11, 5, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1169, 11, 5, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1170, 11, 5, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1171, 11, 5, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1172, 12, 14, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1173, 12, 14, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1174, 12, 14, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1175, 12, 14, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1176, 12, 14, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1177, 12, 15, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1178, 12, 15, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1179, 12, 15, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1180, 12, 15, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1181, 12, 15, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1182, 12, 12, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1183, 12, 12, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1184, 12, 12, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1185, 12, 12, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1186, 12, 12, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1187, 12, 13, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1188, 12, 13, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1189, 12, 13, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1190, 12, 13, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1191, 12, 13, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1192, 12, 19, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1193, 12, 19, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1194, 12, 19, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1195, 12, 19, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1196, 12, 19, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1197, 12, 18, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1198, 12, 18, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1199, 12, 18, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1200, 12, 18, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1201, 12, 18, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1202, 12, 20, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1203, 12, 20, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1204, 12, 20, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1205, 12, 20, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1206, 12, 20, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1207, 12, 21, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1208, 12, 21, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1209, 12, 21, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1210, 12, 21, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1211, 12, 21, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1212, 12, 22, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1213, 12, 22, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1214, 12, 22, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1215, 12, 22, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1216, 12, 22, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1217, 12, 23, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1218, 12, 23, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1219, 12, 23, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1220, 12, 23, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1221, 12, 23, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1222, 12, 24, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1223, 12, 24, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1224, 12, 24, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1225, 12, 24, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1226, 12, 24, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1227, 12, 25, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1228, 12, 25, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1229, 12, 25, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1230, 12, 25, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1231, 12, 25, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1232, 12, 17, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1233, 12, 17, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1234, 12, 17, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1235, 12, 17, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1236, 12, 17, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1237, 12, 16, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1238, 12, 16, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1239, 12, 16, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1240, 12, 16, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1241, 12, 16, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1242, 12, 26, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1243, 12, 26, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1244, 12, 26, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1245, 12, 26, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1246, 12, 26, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1247, 13, 14, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1248, 13, 14, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1249, 13, 14, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1250, 13, 14, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1251, 13, 14, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1252, 13, 15, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1253, 13, 15, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1254, 13, 15, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1255, 13, 15, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1256, 13, 15, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1257, 13, 13, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1258, 13, 13, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1259, 13, 13, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1260, 13, 13, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1261, 13, 13, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1262, 13, 20, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1263, 13, 20, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1264, 13, 20, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1265, 13, 20, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1266, 13, 20, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1267, 13, 22, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1268, 13, 22, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1269, 13, 22, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1270, 13, 22, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1271, 13, 22, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1272, 13, 24, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1273, 13, 24, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1274, 13, 24, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1275, 13, 24, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1276, 13, 24, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1277, 13, 25, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1278, 13, 25, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1279, 13, 25, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1280, 13, 25, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1281, 13, 25, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1382, 11, 14, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1383, 11, 14, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1384, 11, 14, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1385, 11, 14, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1386, 11, 14, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1387, 11, 15, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1388, 11, 15, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1389, 11, 15, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1390, 11, 15, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1391, 11, 15, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1392, 11, 12, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1393, 11, 12, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1394, 11, 12, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1395, 11, 12, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1396, 11, 12, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1397, 11, 13, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1398, 11, 13, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1399, 11, 13, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1400, 11, 13, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1401, 11, 13, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1402, 11, 19, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1403, 11, 19, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1404, 11, 19, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1405, 11, 19, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1406, 11, 19, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1407, 11, 18, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1408, 11, 18, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1409, 11, 18, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1410, 11, 18, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1411, 11, 18, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1412, 11, 20, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1413, 11, 20, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1414, 11, 20, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1415, 11, 20, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1416, 11, 20, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1417, 11, 21, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1418, 11, 21, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1419, 11, 21, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1420, 11, 21, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1421, 11, 21, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1422, 11, 22, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1423, 11, 22, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1424, 11, 22, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1425, 11, 22, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1426, 11, 22, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1427, 11, 23, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1428, 11, 23, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1429, 11, 23, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1430, 11, 23, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1431, 11, 23, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1432, 11, 24, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1433, 11, 24, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1434, 11, 24, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1435, 11, 24, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1436, 11, 24, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1014, 1, 14, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1015, 1, 14, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1016, 1, 14, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1017, 1, 14, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1018, 1, 14, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1019, 1, 15, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1020, 1, 15, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1021, 1, 15, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1022, 1, 15, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1023, 1, 15, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1024, 1, 12, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1025, 1, 12, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1026, 1, 12, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1027, 1, 12, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1028, 1, 12, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1029, 1, 13, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1030, 1, 13, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1031, 1, 13, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1032, 1, 13, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1033, 1, 13, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1034, 1, 17, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1035, 1, 17, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1036, 1, 17, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1037, 1, 17, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1038, 1, 17, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1039, 1, 19, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1040, 1, 19, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1041, 1, 19, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1042, 1, 19, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1043, 1, 19, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1044, 1, 16, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1045, 1, 16, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1046, 1, 16, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1047, 1, 16, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1048, 1, 16, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1049, 1, 18, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1050, 1, 18, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1051, 1, 18, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1052, 1, 18, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1053, 1, 18, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1054, 1, 20, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1055, 1, 20, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1056, 1, 20, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1057, 1, 20, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1058, 1, 20, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1059, 1, 21, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1060, 1, 21, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1061, 1, 21, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1062, 1, 21, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1063, 1, 21, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1064, 1, 22, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1065, 1, 22, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1066, 1, 22, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1067, 1, 22, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1068, 1, 22, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1069, 1, 23, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1070, 1, 23, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1071, 1, 23, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1072, 1, 23, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1073, 1, 23, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1074, 1, 24, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1075, 1, 24, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1076, 1, 24, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1077, 1, 24, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1078, 1, 24, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1079, 1, 25, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1080, 1, 25, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1081, 1, 25, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1082, 1, 25, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1083, 1, 25, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1104, 1, 1, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1105, 1, 1, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1106, 1, 1, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1107, 1, 1, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1108, 1, 1, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1109, 1, 4, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1110, 1, 4, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1111, 1, 4, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1112, 1, 4, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1113, 1, 4, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1114, 1, 3, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1115, 1, 3, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1116, 1, 3, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1117, 1, 3, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1118, 1, 3, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1119, 1, 5, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1120, 1, 5, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1121, 1, 5, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1122, 1, 5, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1123, 1, 5, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1437, 11, 25, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1438, 11, 25, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1439, 11, 25, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1440, 11, 25, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1441, 11, 25, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1442, 11, 17, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1443, 11, 17, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1444, 11, 17, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1445, 11, 17, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1446, 11, 17, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1447, 11, 16, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1448, 11, 16, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1449, 11, 16, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1450, 11, 16, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1451, 11, 16, 2);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1452, 11, 26, 1);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1453, 11, 26, 5);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1454, 11, 26, 3);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1455, 11, 26, 4);
INSERT INTO seguridad_usuarios_programas_privilegios VALUES (1456, 11, 26, 2);
--
-- Name: att_departamentos_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_departamentos
ADD CONSTRAINT att_departamentos_pkey PRIMARY KEY (id);
--
-- Name: att_devices_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_devices
ADD CONSTRAINT att_devices_pkey PRIMARY KEY (id);
--
-- Name: att_horarios_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_horarios
ADD CONSTRAINT att_horarios_pkey PRIMARY KEY (id);
--
-- Name: att_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_logs
ADD CONSTRAINT att_logs_pkey PRIMARY KEY (id);
--
-- Name: att_personas_cedula_key; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_personas
ADD CONSTRAINT att_personas_cedula_key UNIQUE (cedula);
--
-- Name: att_personas_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY att_personas
ADD CONSTRAINT att_personas_pkey PRIMARY KEY (gid);
--
-- Name: departamentos_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY departamentos
ADD CONSTRAINT departamentos_pkey PRIMARY KEY (id);
--
-- Name: pkey_listing_files; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY listing_files
ADD CONSTRAINT pkey_listing_files PRIMARY KEY (id);
--
-- Name: pkeyfile_indexing; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY file_indexing
ADD CONSTRAINT pkeyfile_indexing PRIMARY KEY (id);
--
-- Name: seguridad_bitacora_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_bitacora
ADD CONSTRAINT seguridad_bitacora_pkey PRIMARY KEY (idbitacora);
--
-- Name: seguridad_modulos_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_modulos
ADD CONSTRAINT seguridad_modulos_pkey PRIMARY KEY (idmodulo);
--
-- Name: seguridad_privilegios_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_privilegios
ADD CONSTRAINT seguridad_privilegios_pkey PRIMARY KEY (idprivilegio);
--
-- Name: seguridad_programas_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_programas
ADD CONSTRAINT seguridad_programas_pkey PRIMARY KEY (idprograma);
--
-- Name: seguridad_secciones_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_secciones
ADD CONSTRAINT seguridad_secciones_pkey PRIMARY KEY (idseccion);
--
-- Name: seguridad_submodulos_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_submodulos
ADD CONSTRAINT seguridad_submodulos_pkey PRIMARY KEY (idsubmodulo);
--
-- Name: seguridad_usuarios_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_usuarios
ADD CONSTRAINT seguridad_usuarios_pkey PRIMARY KEY (idusuario);
--
-- Name: seguridad_usuarios_programas_privilegios_pkey; Type: CONSTRAINT; Schema: public; Owner: cbiometrico; Tablespace:
--
ALTER TABLE ONLY seguridad_usuarios_programas_privilegios
ADD CONSTRAINT seguridad_usuarios_programas_privilegios_pkey PRIMARY KEY (idusuarios_programas_privilegios);
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
| true
|
4b7a148d23d029fd3261d302400589b4b5bc0f43
|
SQL
|
brad/bid4it
|
/core/install/dbconfig.sql
|
UTF-8
| 1,784
| 3.046875
| 3
|
[] |
no_license
|
DROP TABLE IF EXISTS `__fields__`;
CREATE TABLE IF NOT EXISTS `__fields__` (
`fields_id` INT(11) AUTO_INCREMENT PRIMARY KEY,
`table` VARCHAR(64) NOT NULL,
`name` VARCHAR(64) NOT NULL,
`widget:type` VARCHAR(64),
`widget:label` VARCHAR(128),
`widget:description` TEXT,
`visibility:list` VARCHAR(15),
`vocabulary` VARCHAR(64),
`atts:style` VARCHAR(255),
`file` VARCHAR(128)
);
DROP TABLE IF EXISTS `__properties__`;
CREATE TABLE IF NOT EXISTS `__properties__` (
`parent_id` INT(11) NOT NULL,
`parent_type` ENUM('fields','actions','relationships','valuelists','table'),
`property_name` VARCHAR(128) NOT NULL,
`property_value` TEXT,
PRIMARY KEY (`parent_id`,`parent_type`,`property_name`)
);
DROP TABLE IF EXISTS `__valuelists__`;
CREATE TABLE IF NOT EXISTS `__valuelists__` (
`valuelists_id` INT(11) AUTO_INCREMENT PRIMARY KEY,
`table` VARCHAR(64) NOT NULL,
`name` VARCHAR(64) NOT NULL,
`__sql__` TEXT,
`file` VARCHAR(128)
);
DROP TABLE IF EXISTS `__relationships__`;
CREATE TABLE IF NOT EXISTS `__relationships__` (
`relationships_id` INT(11) AUTO_INCREMENT PRIMARY KEY,
`table` VARCHAR(64) NOT NULL,
`name` VARCHAR(64) NOT NULL,
`__sql__` TEXT,
`file` VARCHAR(128)
);
DROP TABLE IF EXISTS `__actions__`;
CREATE TABLE IF NOT EXISTS `__actions__` (
`actions_id` INT(11) AUTO_INCREMENT PRIMARY KEY,
`table` VARCHAR(64) NOT NULL,
`name` VARCHAR(64) NOT NULL,
`label` VARCHAR(128),
`description` TEXT,
`icon` VARCHAR(128),
`category` VARCHAR(64),
`accessKey` VARCHAR(2),
`condition` VARCHAR(255),
`permission` VARCHAR(64),
`file` VARCHAR(128)
);
DROP TABLE IF EXISTS `__table__`;
CREATE TABLE IF NOT EXISTS `__table__` (
`table_id` INT(11) AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(128),
`label` VARCHAR(128),
`description` TEXT);
| true
|
ad9a1f18d74897284105071de8f451378cb36fdb
|
SQL
|
Nikolov-A/365-Data-Science
|
/1. SQL/2. SQL SELECT Statement/AND.sql
|
UTF-8
| 199
| 3.0625
| 3
|
[] |
no_license
|
### ASSIGNMENT ###
/*
------ 1 ------
Retrieve a list with all female employees whose first name is Kellie.
*/
SELECT
*
FROM
employees
WHERE
first_name = 'Kellie' AND gender = 'F';
| true
|
740808004e690ebfc6d0669a77842d15b398643d
|
SQL
|
aAuguets/BasesDeDades
|
/P2/sensorsCreation.sql
|
UTF-8
| 5,083
| 3.03125
| 3
|
[] |
no_license
|
/*
sqlite3 sensors.bd < sensorsCreation.sql >out.txt
*/
DROP TABLE IF EXISTS sensors;
DROP TABLE IF EXISTS calib_temp;
DROP TABLE IF EXISTS calib_light;
CREATE TABLE IF NOT EXISTS sensors (
id INTEGER PRIMARY KEY AUTOINCREMENT,
result_time DATETIME,
epoch INT,
nodeid INT,
light INT,
temp INT,
voltage INT) ;
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 09:10:18',639,1,555,26,400);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:20:10',653,1,556,12,420);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:30:11',683,1,557,38,430);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:33:15',712,1,558,15,433);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:40:23',715,1,560,0,512);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 12:42:28',725,1,562,27,323);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),727,1,555,20,401);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),729,1,566,12,333);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),732,1,568,13,0);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 09:10:18',639,2,555,0,325);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:20:10',653,2,556,5,386);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:30:11',683,2,557,10,402);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:33:15',712,2,558,11,415);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:40:23',715,2,560,12,411);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 12:42:28',725,2,562,13,450);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),727,2,564,14,300);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),729,2,566,15,400);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),734,2,568,16,408);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 09:10:18',639,3,555,-2,418);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:20:10',653,3,556,0,300);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 10:30:11',683,3,557,2,0);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:33:15',712,3,558,4,420);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 11:40:23',715,3,560,10,478);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES ('2015-03-05 12:42:28',725,3,562,12,499);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),727,3,564,13,501);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),729,3,566,14,512);
INSERT INTO sensors (result_time,epoch,nodeid,light,temp,voltage) VALUES (DATETIME('now'),729,3,568,15,534);
CREATE TABLE calib_temp as select temp, avg(temp)+temp as calib from sensors group by temp;
CREATE TABLE calib_light as select light, avg(light)+light as calib from sensors group by light;
.mode column
.header on
.print "\n Exercici 1:\n"
select id, result_time from sensors where light > 550;
.print "\n Exercici 2:\n---CAP SENSOR TE DADES DAQUESTES HORES, POSEM DESDE LES 11 FINS LES 12---\n"
select avg(light) from sensors where nodeid=1 and time(result_time) between "11:00:00" and "12:00:00";
.print "\n Exercici 3:\n"
select avg(light), avg(temp) from sensors where voltage < 418 and time(result_time) between "09:00:00" and "12:00:00";
.print "\n Exercici 4:\n"
/*
select temp from sensors where nodeid = 2 group by strftime("%H", result_time) having time(result_time) between "08:00:00" and "12:00:00";
.print "\n"*/
select calib from calib_temp where temp in
(select temp from sensors where nodeid = 2 and time(result_time) between "08:00:00" and "12:00:00" group by (result_time));
.print "\n Exercici 5:\n"
/*
taula de dades entrants a la hora concreta pels sensors 1 i 2.
select result_time, min(epoch) as epoch1, max(epoch) as epoch2 from sensors
where nodeid = 1 or nodeid = 2 group by result_time;
.print "\n"*/
select result_time, epoch1, epoch2, epoch2 - epoch1 as computation from
(select result_time, min(epoch) as epoch1, max(epoch) as epoch2 from sensors
where nodeid = 1 or nodeid = 2 group by result_time) where epoch2 - epoch1 >= 1;
.print "\n Exercici 6:\n"
select epoch from(select epoch, count(nodeid) as n from sensors group by epoch) where n != 3;
| true
|
be51dc987f205de70ceaef8f498871fa8b1ac393
|
SQL
|
xxxoast/citic_bank
|
/proof4.sql
|
UTF-8
| 654
| 3.40625
| 3
|
[] |
no_license
|
SELECT * FROM citic_bank.reserve_trade_all_debt
where opponent_account_name like '%财付通%'
and
origin_account_number <> '7440810182200001028'
INTO OUTFILE "/tmp/caifutong转入.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
SELECT
origin_account_number,
origin_account_name,
COUNT(1),
CAST(SUM(turnover) AS UNSIGNED) '交易量',
opponent_account_number,
opponent_account_name,
opponent_bank_name
FROM
citic_bank.reserve_trade_all_debt
WHERE
opponent_account_name LIKE '%财付通%'
AND origin_account_number <> '7440810182200001028'
GROUP BY origin_account_number
| true
|
eba9040faaf0b82f3bf37bbc62ed0947bdf3cfac
|
SQL
|
jgarzonext/plsql-testing
|
/script_plsql/bd_iaxis/script/indices/PROVMAT_CIERRE_CONF_PK.sql
|
UTF-8
| 367
| 2.578125
| 3
|
[] |
no_license
|
--------------------------------------------------------
-- DDL for Index PROVMAT_CIERRE_CONF_PK
--------------------------------------------------------
CREATE UNIQUE INDEX "AXIS"."PROVMAT_CIERRE_CONF_PK" ON "AXIS"."PROVMAT_CIERRE_CONF" ("SSEGURO", "NRIESGO", "CGARANT", "FCALCUL")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
TABLESPACE "AXIS" ;
| true
|
f0e84bb74735df1f0fec066b38f82af68aa1d972
|
SQL
|
kingwang317/it4fun-groupon
|
/fuel/modules/codekind/install/codekind.sql
|
UTF-8
| 1,496
| 2.671875
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 2.10.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 27, 2010 at 02:53 PM
-- Server version: 5.0.45
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `fuel`
--
-- --------------------------------------------------------
--
-- Table structure for table `mod_codekind`
--
CREATE TABLE `mod_codekind` (
`codekind_id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
`codekind_name` varchar(20) DEFAULT NULL,
`codekind_key` varchar(20) DEFAULT NULL,
`codekind_desc` varchar(20) DEFAULT NULL,
`codekind_value1` varchar(20) DEFAULT NULL,
`codekind_value2` varchar(20) DEFAULT NULL,
`codekind_value3` varchar(20) DEFAULT NULL,
`modi_time` datetime DEFAULT NULL,
`lang_code` varchar(5) DEFAULT NULL,
PRIMARY KEY (`codekind_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `mod_code`
--
CREATE TABLE `mod_code` (
`code_id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
`codekind_key` varchar(20) DEFAULT NULL,
`code_name` varchar(20) DEFAULT NULL,
`code_key` varchar(20) DEFAULT NULL,
`code_value1` varchar(20) DEFAULT NULL,
`code_value2` varchar(20) DEFAULT NULL,
`code_value3` varchar(20) DEFAULT NULL,
`parent_id` bigint(10) DEFAULT NULL,
`modi_time` datetime DEFAULT NULL,
`lang_code` varchar(5) DEFAULT NULL,
PRIMARY KEY (`code_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
| true
|
f630f0a674daca248361d4d5e759c44378614293
|
SQL
|
yaodehaung/MySQLTutorial
|
/solutions/ch14/ch14_01.sql
|
UTF-8
| 784
| 3.3125
| 3
|
[] |
no_license
|
================ Stored Procedure: mylab.MYHANDLER ================
DELIMITER $$
DROP PROCEDURE IF EXISTS mylab.MYHANDLER $$
CREATE PROCEDURE mylab.MYHANDLER ( p_name VARCHAR(30), p_owner VARCHAR(30),
p_species VARCHAR(30), p_gender CHAR(1),
p_birth DATE )
BEGIN
DECLARE EXIT HANDLER FOR 1048
BEGIN
SELECT 'Cannot be null!!' AS Error;
END;
INSERT INTO pet VALUES (0, p_name, p_owner, p_species, p_gender, p_birth);
SELECT * FROM pet WHERE id = LAST_INSERT_ID();
END $$
DELIMITER ;
=================================================================
CALL MYHANDLER('Nancy', 'Bruce', 'Cat', 'm', '2000-3-12')
CALL MYHANDLER(NULL, 'Simon', 'Snake', 'm', '2000-2-21')
| true
|
3fbb96bf531a3b788cf330aec7ee9acef7769baa
|
SQL
|
MonkeyC97/textdemo
|
/test2.sql
|
UTF-8
| 12,970
| 3.1875
| 3
|
[] |
no_license
|
-- MySQL dump 10.13 Distrib 5.7.26, for macos10.14 (x86_64)
--
-- Host: localhost Database: test2
-- ------------------------------------------------------
-- Server version 5.7.26
/*!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 */;
--
-- Current Database: `test2`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test2` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `test2`;
--
-- Table structure for table `stu`
--
DROP TABLE IF EXISTS `stu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stu` (
`id` int(11) DEFAULT NULL,
`name` varchar(60) DEFAULT NULL,
`password` char(32) DEFAULT NULL COMMENT '密码是32位的md5值',
`birthday` date DEFAULT NULL COMMENT '生日'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `stu`
--
LOCK TABLES `stu` WRITE;
/*!40000 ALTER TABLE `stu` DISABLE KEYS */;
INSERT INTO `stu` VALUES (1,'hc','hc1997','1997-06-26'),(2,'dr','c','1998-02-28'),(3,'yyh','e','1998-05-25'),(4,'hsr',NULL,NULL),(5,'dsy','xihuanJJ2!','1998-02-02'),(6,'zht','zhtdsb','1998-05-23'),(7,'wyz',NULL,NULL),(8,'wl',NULL,NULL);
/*!40000 ALTER TABLE `stu` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt1`
--
DROP TABLE IF EXISTS `tt1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt1` (
`id` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt1`
--
LOCK TABLES `tt1` WRITE;
/*!40000 ALTER TABLE `tt1` DISABLE KEYS */;
INSERT INTO `tt1` VALUES (1),(-128),(127),(127),(-128);
/*!40000 ALTER TABLE `tt1` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt10`
--
DROP TABLE IF EXISTS `tt10`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt10` (
`id` int(11) DEFAULT NULL,
`name` varchar(10) NOT NULL DEFAULT '中国'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt10`
--
LOCK TABLES `tt10` WRITE;
/*!40000 ALTER TABLE `tt10` DISABLE KEYS */;
INSERT INTO `tt10` VALUES (1,'中国');
/*!40000 ALTER TABLE `tt10` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt11`
--
DROP TABLE IF EXISTS `tt11`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt11` (
`id` int(11) DEFAULT NULL COMMENT '序号',
`name` varchar(10) DEFAULT NULL COMMENT '人的姓名'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt11`
--
LOCK TABLES `tt11` WRITE;
/*!40000 ALTER TABLE `tt11` DISABLE KEYS */;
/*!40000 ALTER TABLE `tt11` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt12`
--
DROP TABLE IF EXISTS `tt12`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt12` (
`id` int(10) unsigned zerofill DEFAULT NULL,
`age` tinyint(3) unsigned DEFAULT NULL COMMENT '年龄'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt12`
--
LOCK TABLES `tt12` WRITE;
/*!40000 ALTER TABLE `tt12` DISABLE KEYS */;
INSERT INTO `tt12` VALUES (0000000001,80),(0000000002,77),(0000000003,60);
/*!40000 ALTER TABLE `tt12` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt13`
--
DROP TABLE IF EXISTS `tt13`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt13` (
`id` int(11) NOT NULL,
`name` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt13`
--
LOCK TABLES `tt13` WRITE;
/*!40000 ALTER TABLE `tt13` DISABLE KEYS */;
INSERT INTO `tt13` VALUES (1,'b');
/*!40000 ALTER TABLE `tt13` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt14`
--
DROP TABLE IF EXISTS `tt14`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt14` (
`id` int(11) DEFAULT NULL,
`name` varchar(32) NOT NULL,
`age` int(11) NOT NULL,
PRIMARY KEY (`name`,`age`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt14`
--
LOCK TABLES `tt14` WRITE;
/*!40000 ALTER TABLE `tt14` DISABLE KEYS */;
/*!40000 ALTER TABLE `tt14` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt15`
--
DROP TABLE IF EXISTS `tt15`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt15` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt15`
--
LOCK TABLES `tt15` WRITE;
/*!40000 ALTER TABLE `tt15` DISABLE KEYS */;
INSERT INTO `tt15` VALUES (1,'hc'),(2,'wangfan');
/*!40000 ALTER TABLE `tt15` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt16`
--
DROP TABLE IF EXISTS `tt16`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt16` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(10) DEFAULT NULL,
`sex` enum('男','女') DEFAULT NULL,
`age` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `age` (`age`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt16`
--
LOCK TABLES `tt16` WRITE;
/*!40000 ALTER TABLE `tt16` DISABLE KEYS */;
INSERT INTO `tt16` VALUES (1,'hc','男',80),(3,NULL,'女',18);
/*!40000 ALTER TABLE `tt16` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt2`
--
DROP TABLE IF EXISTS `tt2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt2` (
`id` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt2`
--
LOCK TABLES `tt2` WRITE;
/*!40000 ALTER TABLE `tt2` DISABLE KEYS */;
INSERT INTO `tt2` VALUES (0),(255);
/*!40000 ALTER TABLE `tt2` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt3`
--
DROP TABLE IF EXISTS `tt3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt3` (
`id` int(11) DEFAULT NULL,
`num` bit(8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt3`
--
LOCK TABLES `tt3` WRITE;
/*!40000 ALTER TABLE `tt3` DISABLE KEYS */;
INSERT INTO `tt3` VALUES (10,_binary '\n'),(11,_binary 'A');
/*!40000 ALTER TABLE `tt3` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt4`
--
DROP TABLE IF EXISTS `tt4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt4` (
`id` int(11) DEFAULT NULL,
`num` float(4,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt4`
--
LOCK TABLES `tt4` WRITE;
/*!40000 ALTER TABLE `tt4` DISABLE KEYS */;
INSERT INTO `tt4` VALUES (1,99.96),(1,99.46),(1,99.99),(1,99.99),(1,99.99),(1,99.94);
/*!40000 ALTER TABLE `tt4` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt6`
--
DROP TABLE IF EXISTS `tt6`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt6` (
`t1` float(10,8) DEFAULT NULL,
`t2` decimal(10,8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt6`
--
LOCK TABLES `tt6` WRITE;
/*!40000 ALTER TABLE `tt6` DISABLE KEYS */;
INSERT INTO `tt6` VALUES (34.12345505,34.12345678);
/*!40000 ALTER TABLE `tt6` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt7`
--
DROP TABLE IF EXISTS `tt7`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt7` (
`t1` char(2) DEFAULT NULL,
`t2` varchar(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt7`
--
LOCK TABLES `tt7` WRITE;
/*!40000 ALTER TABLE `tt7` DISABLE KEYS */;
INSERT INTO `tt7` VALUES ('av','av'),('av','av'),('中国','中国'),('中国','中国');
/*!40000 ALTER TABLE `tt7` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt8`
--
DROP TABLE IF EXISTS `tt8`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt8` (
`t1` date DEFAULT NULL,
`t2` datetime DEFAULT NULL,
`t3` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt8`
--
LOCK TABLES `tt8` WRITE;
/*!40000 ALTER TABLE `tt8` DISABLE KEYS */;
INSERT INTO `tt8` VALUES ('2019-05-09','2019-05-08 00:00:00','2019-05-10 11:38:26'),('2019-05-08','2019-05-08 19:39:20','2019-05-10 00:00:00');
/*!40000 ALTER TABLE `tt8` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tt9`
--
DROP TABLE IF EXISTS `tt9`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tt9` (
`id` int(11) DEFAULT NULL,
`name` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tt9`
--
LOCK TABLES `tt9` WRITE;
/*!40000 ALTER TABLE `tt9` DISABLE KEYS */;
/*!40000 ALTER TABLE `tt9` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `votes`
--
DROP TABLE IF EXISTS `votes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `votes` (
`id` int(11) DEFAULT NULL,
`name` varchar(10) DEFAULT NULL,
`hobby` set('唱','跳','rap','篮球') DEFAULT NULL,
`sex` enum('男','女') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `votes`
--
LOCK TABLES `votes` WRITE;
/*!40000 ALTER TABLE `votes` DISABLE KEYS */;
INSERT INTO `votes` VALUES (1,'hc','唱','男'),(1,'cxk','篮球','女'),(2,'cxk','唱,跳,rap,篮球','女');
/*!40000 ALTER TABLE `votes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `votes1`
--
DROP TABLE IF EXISTS `votes1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `votes1` (
`id` int(11) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL,
`hobby` set('吃','喝','嫖','赌') DEFAULT NULL,
`gender` enum('男','女') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `votes1`
--
LOCK TABLES `votes1` WRITE;
/*!40000 ALTER TABLE `votes1` DISABLE KEYS */;
INSERT INTO `votes1` VALUES (1,'王凡','吃,喝,嫖,赌','男'),(2,'侯昌','吃,喝','男'),(3,'王亮','吃,喝,嫖,赌','男'),(4,'赵沛轩','吃,嫖','男'),(5,'宋拓','吃,嫖','男');
/*!40000 ALTER TABLE `votes1` 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 2019-05-10 21:31:21
| true
|
16ce0e1c6f73c0cb24ad263b926ea2d2aedecb23
|
SQL
|
Madi0110/midtermEE
|
/db-init.sql
|
UTF-8
| 791
| 4.25
| 4
|
[] |
no_license
|
CREATE TABLE IF NOT EXISTS users (
user_id INTEGER NOT NULL PRIMARY KEY,
user_login TEXT NOT NULL,
user_password TEXT NOT NULL,
user_fname TEXT,
user_lname TEXT
);
CREATE TABLE IF NOT EXISTS news (
news_id INTEGER NOT NULL PRIMARY KEY,
news_title TEXT NOT NULL,
news_body TEXT NOT NULL,
news_author INTEGER,
FOREIGN KEY (news_author)
REFERENCES users (user_id)
ON UPDATE CASCADE
ON DELETE SET NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_users_login ON users (user_login);
------------------------------
INSERT INTO users(user_login, user_password, user_fname, user_lname)
VALUES (?, ?, ?, ?);
INSERT INTO news(news_title, news_body, news_author)
VALUES (?, ?, ?);
SELECT * FROM users WHERE user_id = ? LIMIT 1;
| true
|
88814e3ea6b961096d239087ab32d44618c508dc
|
SQL
|
mbdavis313/Bamazon-Storefront-Homework
|
/bamazon_db.sql
|
UTF-8
| 2,135
| 3.515625
| 4
|
[] |
no_license
|
-- Drops the animals_db if it exists currently --
DROP DATABASE IF EXISTS bamazon_db;
-- Creates the "animals_db" database --
CREATE DATABASE bamazon_db;
-- Makes it so all of the following code will affect animals_db --
USE bamazon_db;
-- Creates the table "people" within animals_db --
CREATE TABLE products (
-- Makes a string column called "name" which cannot contain null --
item_id INT NOT NULL AUTO_INCREMENT,
-- Makes a boolean column called "has_pet" which cannot contain null --
product_name VARCHAR(30),
-- Makes a sting column called "pet_name" --
department_name VARCHAR(30),
-- Makes an numeric column called "pet_age" --
price DECIMAL(19,2),
stock_quantity INT,
PRIMARY KEY (item_id)
);
-- Creates new rows containing data in all named columns --
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Davis Electric Cycle", "Recreation", 1500.00, 10);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("CAD CAM Computers", "Engineering", 175000.00, 26);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Omron", "Sensors", 750.00, 37);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("SCADA Systems", "Controllers", 5000.00, 73);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("CO2 Automotive", "Safety", 2305.00, 365);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("UWH2ODetMonSys", "Safety", 275.00, 500);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Travel Safe System", "Safety", 150.00, 25);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Universal Field Service Pack", "Engineering", 367.00, 46);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("ELANTest", "Engineering", 6.00, 129);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("DMMF-AI", "Mind Mapping", 50.00, 36);
| true
|
554571a6e697fbc7fb859e893091cae2f8ae232e
|
SQL
|
JananiMalshika/PHP-Project
|
/zeedb.sql
|
UTF-8
| 5,590
| 3.140625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 22, 2020 at 08:21 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
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: `zeedb`
--
-- --------------------------------------------------------
--
-- Table structure for table `apartment`
--
CREATE TABLE `apartment` (
`aID` text NOT NULL,
`Location` text NOT NULL,
`Floors` int(11) NOT NULL,
`Bedrooms` int(11) NOT NULL,
`Bathrooms` int(11) NOT NULL,
`Size` int(11) NOT NULL,
`Amount` int(11) NOT NULL,
`Description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `apartment`
--
INSERT INTO `apartment` (`aID`, `Location`, `Floors`, `Bedrooms`, `Bathrooms`, `Size`, `Amount`, `Description`) VALUES
('A001', 'Malabe', 10, 3, 2, 45, 2500000, 'Apartment in Malabe'),
('A002', 'Kandy', 8, 4, 4, 50, 1000000, 'Apartment in KAndy'),
('A003', 'Matara', 15, 4, 3, 35, 1850000, 'Apartment in Matara');
-- --------------------------------------------------------
--
-- Table structure for table `feedback`
--
CREATE TABLE `feedback` (
`cid` int(20) NOT NULL,
`cname` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`msg` varchar(400) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `feedback`
--
INSERT INTO `feedback` (`cid`, `cname`, `email`, `msg`) VALUES
(1001, 'Saman', 'saman@gmail.com', 'Good'),
(1002, 'Kasun', 'kasun@gmail.com', 'Nice work!!!'),
(1003, 'kamal', 'kamal@gmail.com', 'Goooooooooood!'),
(1004, 'Janai', 'malsika@gmail.com', 'Nice!!!');
-- --------------------------------------------------------
--
-- Table structure for table `housenew`
--
CREATE TABLE `housenew` (
`HID` int(20) NOT NULL,
`perch` int(100) NOT NULL,
`price` int(100) NOT NULL,
`elect` varchar(100) NOT NULL,
`floor` int(100) NOT NULL,
`room` int(100) NOT NULL,
`bathroom` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `housenew`
--
INSERT INTO `housenew` (`HID`, `perch`, `price`, `elect`, `floor`, `room`, `bathroom`) VALUES
(1001, 25, 250000, 'YES', 2, 4, 3),
(1002, 20, 500000, 'YES', 1, 2, 2),
(1003, 28, 400000, 'YES', 4, 4, 3),
(1004, 25, 2500000, 'YES', 2, 4, 5);
-- --------------------------------------------------------
--
-- Table structure for table `land`
--
CREATE TABLE `land` (
`landID` int(11) NOT NULL,
`location` varchar(100) NOT NULL,
`area` int(100) NOT NULL,
`price` int(100) NOT NULL,
`power` varchar(100) NOT NULL,
`water` varchar(100) NOT NULL,
`wide` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `land`
--
INSERT INTO `land` (`landID`, `location`, `area`, `price`, `power`, `water`, `wide`) VALUES
(101, 'Matara', 85, 200850, 'YES', 'YES', 110),
(102, 'Malabe', 50, 690000, 'YES', 'YES', 95),
(103, 'Colombo6', 30, 820000, 'YES', 'Tap', 6),
(104, 'Kaduwela', 50, 68000, 'single', 'Tap water', 25);
-- --------------------------------------------------------
--
-- Table structure for table `register`
--
CREATE TABLE `register` (
`ID` int(11) NOT NULL,
`f_name` varchar(50) NOT NULL,
`l_name` varchar(50) NOT NULL,
`gender` enum('male','female') NOT NULL,
`DoB` varchar(50) NOT NULL,
`address_no` varchar(11) NOT NULL,
`street` varchar(50) NOT NULL,
`city` varchar(50) NOT NULL,
`po_code` int(11) NOT NULL,
`p_no` char(10) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `register`
--
INSERT INTO `register` (`ID`, `f_name`, `l_name`, `gender`, `DoB`, `address_no`, `street`, `city`, `po_code`, `p_no`, `email`, `password`) VALUES
(48, 'Janani12', 'Malsika', 'female', '1998-JUL-13', '41', 'main street', 'Nugegoda', 12000, '077123456', 'malsika@gmail.com', '123Mm'),
(50, 'Chamath', 'Bandara', 'male', '1999-FEB-16', '25/8', 'Vijaya street', 'Gampaha', 12500, '0778541236', 'chamath@gmail.com', 'Chamath123'),
(51, 'Kasun', 'Disanayaka', 'male', '1998-AUG-12', '74', 'Piris road', 'Dehiwala', 12500, '0768542147', 'kasun@gmail.com', 'Kasun123'),
(52, 'Kamala', 'Disanayaka', 'female', '1889-DEC-15', '12', 'Silvester rd', 'Kandy', 45000, '0768542147', 'kamala@gmail.com', 'Kamala123'),
(53, 'Nisal', 'Krishan', 'male', '1992-JUN-18', '78', 'Main street', 'Nawala', 74000, '0714525874', 'nisal@gmail.com', 'Nisal123');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`cid`),
ADD KEY `cid` (`cid`);
--
-- Indexes for table `housenew`
--
ALTER TABLE `housenew`
ADD PRIMARY KEY (`HID`);
--
-- Indexes for table `land`
--
ALTER TABLE `land`
ADD PRIMARY KEY (`landID`);
--
-- Indexes for table `register`
--
ALTER TABLE `register`
ADD PRIMARY KEY (`ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `housenew`
--
ALTER TABLE `housenew`
MODIFY `HID` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1005;
--
-- AUTO_INCREMENT for table `register`
--
ALTER TABLE `register`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;
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 */;
| true
|
b3eb81cdfcf1f74d62ad522849b633bbce8ec5b4
|
SQL
|
paddyhudson/codeclan_homework_PaddyHudson
|
/week_03/day_1/sql_hwk_1.sql
|
UTF-8
| 2,128
| 4.1875
| 4
|
[] |
no_license
|
/* MVP 1 */
SELECT *
FROM employees
WHERE department = 'Human Resources';
/* MVP 2 */
SELECT first_name, last_name, country
FROM employees
WHERE department = 'Legal';
/* MVP 3 */
SELECT count(*) AS count_portugal
FROM employees
WHERE country = 'Portugal';
/* MVP 4 */
SELECT count(*) AS count_portugal_spain
FROM employees
WHERE country IN ('Portugal', 'Spain');
/* MVP 5 */
SELECT count(*) AS missing_local_acc
FROM pay_details
WHERE local_account_no IS NULL;
/* MVP 6 */
SELECT count(*) AS missing_local_acc_iban
FROM pay_details
WHERE local_account_no IS NULL
AND iban IS NULL;
/* MVP 7 */
SELECT first_name, last_name
FROM employees
ORDER BY last_name NULLS LAST;
/* MVP 8 */
SELECT first_name, last_name, country
FROM employees
ORDER BY country, last_name NULLS LAST;
/* MVP 9 */
SELECT *
FROM employees
ORDER BY salary DESC NULLS last
LIMIT 10;
/* MVP 10 */
SELECT first_name, last_name, salary
FROM employees
WHERE country = 'Hungary'
ORDER BY salary
LIMIT 1;
/* MVP 11 */
SELECT count(*) AS count_first_name_F
FROM employees
WHERE first_name ILIKE 'F%';
/* MVP 12 */
SELECT *
FROM employees
WHERE email ILIKE '%yahoo%';
/* MVP 13 */
SELECT count(*) AS pension_enrolled_not_fra_ger
FROM employees
WHERE pension_enrol IS TRUE
AND country NOT IN ('France', 'Germany');
/* MVP 14 */
SELECT max(salary) AS max_engineering_fte1_salary
FROM employees
WHERE department = 'Engineering'
AND fte_hours = 1;
/* MVP 15 */
SELECT first_name, last_name, fte_hours, salary,
fte_hours*salary AS effective_yearly_salary
FROM employees
/* EXT 16 */
SELECT CONCAT(first_name, ' ', last_name, ' - ', department) AS badge_label
FROM employees
WHERE first_name||last_name||department IS NOT NULL;
/* EXT 17 */
SELECT CONCAT(
first_name,
' ',
last_name,
' - ',
department,
' (Joined ',
EXTRACT (YEAR FROM start_date),
')'
) AS badge_label
FROM employees
WHERE first_name||last_name||department||start_date IS NOT NULL;
/* EXT 18 */
SELECT first_name,
last_name,
salary,
CASE WHEN salary < 40000 THEN 'Low'
WHEN salary IS NULL THEN NULL
ELSE 'High'
END AS salary_class
FROM employees;
| true
|
1b203c738864342d05d77e9bbcfb61a3521d15a0
|
SQL
|
danieldiamond/gitlab-analytics
|
/transform/snowflake-dbt/models/staging/sheetload/sheetload_osat.sql
|
UTF-8
| 598
| 3.453125
| 3
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
WITH bamboohr AS (
SELECT *
FROM {{ ref('bamboohr_id_employee_number_mapping') }}
), source AS (
SELECT *
FROM {{ ref('sheetload_osat_source') }}
), final AS (
SELECT
source.completed_date,
DATE_TRUNC(month, bamboohr.hire_date) AS hire_month,
source.division,
source.satisfaction_score,
source.recommend_to_friend,
source.buddy_experience_score
FROM source
LEFT JOIN bamboohr
ON source.employee_name = CONCAT(bamboohr.first_name, ' ', bamboohr.last_name)
WHERE source.completed_date IS NOT NULL
)
SELECT *
FROM final
| true
|
1d9d579c0f4a48f55b37fb90e20df1e2ee7160fb
|
SQL
|
jucariasar/Banco_de_Herramientas
|
/Modelos_de_Bases_de_Datos/Creación_de_Tablas.sql
|
UTF-8
| 7,645
| 3.96875
| 4
|
[] |
no_license
|
/*Creación de la base de datos banco_herramientas*/
CREATE DATABASE banco_herramientas;
/*Se crea la relación regional con todos sus atributos*/
CREATE TABLE regional(
codigo INT PRIMARY KEY,
nombre VARCHAR(30) UNIQUE NOT NULL
);
/*Se crea la relación centro con todos sus atributos y claves foraneas*/
CREATE TABLE centro(
codigo INT PRIMARY KEY,
nombre VARCHAR(60) NOT NULL,
codigo_regional INT NOT NULL,
FOREIGN KEY(codigo_regional) REFERENCES regional(codigo)
);
/*Se crea la relación area con todos sus atributos y claves foraneas*/
CREATE TABLE area(
nombre VARCHAR(60),
codigo_centro INT,
PRIMARY KEY(nombre, codigo_centro),
FOREIGN KEY(codigo_centro) REFERENCES centro(codigo)
);
/*Se crea la relación programa con todos los atribudos descritos en el modelo E-R*/
CREATE TABLE programa(
codigo INT,
version INT,
nombre VARCHAR(100) NOT NULL,
PRIMARY KEY(codigo, version)
);
/*Se crea la relación ficha tal cual se especifica en el modelo relacional*/
CREATE TABLE ficha(
codigo BIGINT UNSIGNED PRIMARY KEY,
nombre_area VARCHAR(60) NOT NULL,
codigo_centro INT NOT NULL,
codigo_programa INT NOT NULL,
version_programa INT NOT NULL,
FOREIGN KEY(nombre_area, codigo_centro) REFERENCES area(nombre, codigo_centro),
FOREIGN KEY(codigo_programa, version_programa) REFERENCES programa(codigo, version)
);
/*Se crea la relación persona tal cual se especifica en el modelo relacional*/
CREATE TABLE usuario(
carne BIGINT UNSIGNED PRIMARY KEY,
nombres VARCHAR(60) NOT NULL,
apellidos VARCHAR(60) NOT NULL,
telefono_1 VARCHAR(15) NOT NULL,
telefono_2 VARCHAR(15),
email VARCHAR(80) UNIQUE NOT NULL,
passwd CHAR(40) BINARY NOT NULL,
tipo VARCHAR(30) NOT NULL
);
/*Relación que almacena las fotos de los usuarios*/
CREATE TABLE foto_usuario(
id_usuario BIGINT UNSIGNED PRIMARY KEY,
nombre VARCHAR(60) NOT NULL,
contenido MEDIUMBLOB NOT NULL,
tipo VARCHAR(50) NOT NULL,
FOREIGN KEY(id_usuario) REFERENCES usuario(carne)
);
/*Relación para guardar los estados de los aprendices*/
CREATE TABLE estado_aprendiz(
descripcion VARCHAR(20) PRIMARY KEY
);
/*Se creal la relación aprendiz segun lo especificado en el modelo relacional*/
CREATE TABLE aprendiz(
carne BIGINT UNSIGNED PRIMARY KEY,
codigo_ficha BIGINT UNSIGNED NOT NULL,
estado VARCHAR(20) NOT NULL,
FOREIGN KEY(carne) REFERENCES usuario(carne),
FOREIGN KEY(codigo_ficha) REFERENCES ficha(codigo),
FOREIGN KEY(estado) REFERENCES estado_aprendiz(descripcion)
);
/*Relación para almacenar los tipos de empleado en la institución*/
CREATE TABLE tipo_labor(
descripcion VARCHAR(30) PRIMARY KEY
);
/*Se crea la relación empleado tal cual como se especifica en el modelo relacional*/
CREATE TABLE empleado(
supervisor BIGINT UNSIGNED,
carne BIGINT UNSIGNED PRIMARY KEY,
tipo_labor VARCHAR(30) NOT NULL,
tipo VARCHAR(20) NOT NULL,
FOREIGN KEY(supervisor) REFERENCES empleado(carne),
FOREIGN KEY(carne) REFERENCES usuario(carne),
FOREIGN KEY(tipo_labor) REFERENCES tipo_labor(descripcion)
);
/*Se crea la relación para empleados de planta*/
CREATE TABLE planta(
grado INT,
fecha_vinculacion DATE,
carne BIGINT UNSIGNED PRIMARY KEY,
FOREIGN KEY(carne) REFERENCES usuario(carne)
);
/*Se crea la relación para empleados contratistas*/
CREATE TABLE contratista(
numero_contrato INT,
fecha_inicio DATE,
fecha_fin DATE,
carne BIGINT UNSIGNED PRIMARY KEY,
FOREIGN KEY(carne) REFERENCES usuario(carne)
);
/*Relación que guarda los roles*/
CREATE TABLE roll(
descripcion VARCHAR(30) PRIMARY KEY
);
/*Relación de intersección para perfiles de empleados*/
CREATE TABLE perfil(
carne_empleado BIGINT UNSIGNED,
roll VARCHAR(30),
PRIMARY KEY(carne_empleado, roll),
FOREIGN KEY(carne_empleado) REFERENCES empleado(carne),
FOREIGN KEY(roll) REFERENCES roll(descripcion)
);
/*Categoria de los elementos*/
CREATE TABLE categoria(
descripcion VARCHAR(30) PRIMARY KEY
);
/*Creación de relacion elemento*/
CREATE TABLE elemento(
codigo BIGINT UNSIGNED,
nombre VARCHAR(100) NOT NULL,
ubicacion VARCHAR(100) NOT NULL,
valor_unidad BIGINT UNSIGNED NOT NULL,
observacion VARCHAR(100),
nombre_area VARCHAR(60),
codigo_centro INT,
categoria VARCHAR(30),
tipo VARCHAR(30) NOT NULL,
PRIMARY KEY(codigo, nombre_area, codigo_centro),
FOREIGN KEY(nombre_area, codigo_centro) REFERENCES area(nombre, codigo_centro),
FOREIGN KEY(categoria) REFERENCES categoria(descripcion)
);
/*Relación para almacenar las fotos de los elementos*/
CREATE TABLE foto_elemento(
id BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
nombre VARCHAR(60) NOT NULL,
contenido MEDIUMBLOB NOT NULL,
tipo VARCHAR(50) NOT NULL,
PRIMARY KEY(id, nombre_area, codigo_centro),
FOREIGN KEY(id, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro)
);
/*Relación que almacena el estado de los elementos devolutivos*/
CREATE TABLE estado_devolutivo(
descripcion VARCHAR(30) PRIMARY KEY
);
/*Creación de relación elemento devolutivo*/
CREATE TABLE devolutivo(
codigo BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
estado VARCHAR(20) NOT NULL,
PRIMARY KEY(codigo, nombre_area, codigo_centro),
FOREIGN KEY(codigo, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro),
FOREIGN KEY(estado) REFERENCES estado_devolutivo(descripcion)
);
/**/
CREATE TABLE consumo(
cantidad_total INT NOT NULL,
cantidad_prestada INT NOT NULL,
codigo BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
PRIMARY KEY(codigo, nombre_area, codigo_centro),
FOREIGN KEY(codigo, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro)
);
/*Revisar esta realación y consultar si una clave foranea tiene que apuntar a todos las claves primarias
de la otra relación o se puede hacer como en esta que codigo_elemento*/
CREATE TABLE cuentadante(
codigo_elemento BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
carne_empleado BIGINT UNSIGNED,
PRIMARY KEY(codigo_elemento, nombre_area, codigo_centro, carne_empleado),
FOREIGN KEY(codigo_elemento, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro),
FOREIGN KEY(carne_empleado) REFERENCES empleado(carne)
);
/*Relacion reserva*/
CREATE TABLE reserva(
fecha_reserva DATE NOT NULL,
fecha_vencimiento DATE NOT NULL,
cantidad_reservada INT NOT NULL,
codigo_elemento BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
carne_empleado BIGINT UNSIGNED,
observacion VARCHAR(100),
PRIMARY KEY(codigo_elemento, nombre_area, codigo_centro, carne_empleado),
FOREIGN KEY(codigo_elemento, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro),
FOREIGN KEY(carne_empleado) REFERENCES empleado(carne)
);
/*Relación prestamos*/
CREATE TABLE prestamo(
fecha_prestamo DATE NOT NULL,
fecha_vencimiento DATE NOT NULL,
cantidad_prestada INT NOT NULL,
codigo_elemento BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
carne_usuario BIGINT UNSIGNED,
observacion VARCHAR(100),
PRIMARY KEY(codigo_elemento, nombre_area, codigo_centro, carne_usuario),
FOREIGN KEY(codigo_elemento, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro),
FOREIGN KEY(carne_usuario) REFERENCES empleado(carne)
);
/*Relación mora*/
CREATE TABLE mora(
fecha_prestamo DATE NOT NULL,
cantidad_prestada INT NOT NULL,
codigo_elemento BIGINT UNSIGNED,
nombre_area VARCHAR(60),
codigo_centro INT,
carne_usuario BIGINT UNSIGNED,
observacion VARCHAR(100),
PRIMARY KEY(codigo_elemento, nombre_area, codigo_centro, carne_usuario),
FOREIGN KEY(codigo_elemento, nombre_area, codigo_centro) REFERENCES elemento(codigo, nombre_area, codigo_centro),
FOREIGN KEY(carne_usuario) REFERENCES empleado(carne)
);
| true
|
f25f1401ac8267737c12697c3c6425b9c50456e1
|
SQL
|
iuthub/design-project-twin-2
|
/kitob.sql
|
UTF-8
| 6,730
| 3.1875
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: May 9 2018 г., 16:31
-- Версия сервера: 5.5.25
-- Версия PHP: 5.3.13
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 */;
--
-- База данных: `kitob`
--
-- --------------------------------------------------------
--
-- Структура таблицы `bolimlar`
--
CREATE TABLE IF NOT EXISTS `bolimlar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
--
-- Дамп данных таблицы `bolimlar`
--
INSERT INTO `bolimlar` (`id`, `name`) VALUES
(111, 'Fairy-tales'),
(222, 'Story'),
(333, 'Folktale'),
(444, 'World Literature'),
(555, 'Uzbek Liturature'),
(666, 'New Uzbek Literature'),
(777, 'Electronic textbooks'),
(888, 'Folklore creativity');
-- --------------------------------------------------------
--
-- Структура таблицы `kitoblar`
--
CREATE TABLE IF NOT EXISTS `kitoblar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`url` varchar(100) NOT NULL,
`nomi` varchar(200) NOT NULL,
`mualif` varchar(100) NOT NULL,
`short` varchar(300) NOT NULL,
`text` text NOT NULL,
`img` varchar(100) NOT NULL,
`yil` int(11) NOT NULL,
`b_id` int(11) NOT NULL,
`read` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
--
-- Дамп данных таблицы `kitoblar`
--
INSERT INTO `kitoblar` (`id`, `url`, `nomi`, `mualif`, `short`, `text`, `img`, `yil`, `b_id`, `read`) VALUES
(111, 'fayl_Malikai_ayyor_-_21.02.2014_16-29-02.pdf', 'Malikai ayyor', 'Aliev T', 'Chambil says the land of Gurgaon. What is a tambourine? Chambil is like Chambil: sixty oblongs, seventy-eighths, eighty cranes, and nine-sided Chambil.', 'Chambil says the land of Gurgaon. What is a tambourine? Chambil is like Chambil: sixty oblongs, seventy-eighths, eighty cranes, and nine-sided Chambil. In Cambil there are a number of Grooglu, Forty-six captains, four-quadruple hawkish hawks, and Sokibulbul. The gourmet was considered as a mustard, and the shot went through the stone.\r\n', '1.jpg', 2015, 8, 7),
(222, 'fayl_Manas_-_12.02.2014_9-41-25.pdf', 'Manas', 'Suyunov M', 'Manas is name is always blessed for the Kurds. Manas is the great epic of sacred words.', 'Manas is name is always blessed for the Kurds. Manas is the great epic of sacred words. The history, joy and affluence of the hand, the well-being and the evil, the beautiful fate are reflected in it. The dreams, the wishes that have not come to an end, the pain of the elite, are like a spoonful of spells,', '2.jpg', 2015, 8, 2),
(333, 'fayl_tishing_-_19.11.2015_16-30-55.pdf', 'Tishing sog` vaqting chog`', 'M. Miryoqubov', 'This book, Mirjamol Miryokubov, is a product of the dentist, in which he talked about the most important person - the teeth.', ' This book, Mirjamol Miryokubov, is a product of the dentist, in which he talked about the most important person - the teeth.', '3.jpg', 2015, 6, 0),
(444, 'fayl_bolalar_uchun.pdf', 'Bolalar uchun she''rlar', 'Olqor Damin', 'Men salomman, Salomman.\r\nOlamday keng Olamman.', 'Men salomman, Salomman.\r\nOlamday keng Olamman.\r\nMeni aytib Yurganni\r\nOdam qila Olaman!', '4.jpg', 2014, 6, 0),
(555, 'fayl_Arvona_-_13.02.2014_10-29-45.pdf', 'Arvona', 'Yo''q', 'There are many works about native land, the Motherland. But her motherland was the home of Camila Arvon.', 'There are many works about native land, the Motherland. But her motherland was the home of Camila Arvon. A reader who reads the spittle of the Arden into the heart falls into the eye of the reader two tears. The famous Kazakh writer Thobo Do`sanov is Arvona prose is in the heart of the country.', '5.jpg', 1995, 3, 1),
(666, 'fayl_Konfutsiy_-_05.09.2013_15-02-33.pdf', 'Muhokama va bayon', 'Konfutsiy', 'Confucius is one of the globally recognized geniuses of humanity. ', 'Confucius is one of the globally recognized geniuses of humanity. Although a Chinese philosopher and thinker has been trained and established on the soil of his homeland, years will have a profound effect on the socio-political, literary-cultural and moral-philosophical thinking of many nations around the world.\r\n', '6.jpg', 2015, 3, 0),
(777, 'fayl_qambar_ota1_-_27.10.2015_12-03-47.pdf', 'Toshpolvon va Ishpolvon haqida ertak', 'Qambar ota', 'Kambar Ata is childhood is much closer to children than "father". Because all the poetry rhythms in the heart of the childhood were matured by the spontaneous childhood', 'Kambar Ata is childhood is much closer to children than "father". Because all the poetry rhythms in the heart of the childhood were matured by the spontaneous childhood. That is why her poems are fast-hearted. Long stored in memory. It extends the imagination of children. He remembers the forgotten childhood of adults. Forget about a momentary moments of life, drown in poetry, strengthen your spirit.', '76411.jpg', 2015, 5, 1),
(888, 'fayl_rumiy.docx', 'Amir Arslon Rumiy', 'Xalq', 'The poem "Amir Arslon Rumi" is from Arabic in the Fifth to the nineteenth century in Arabic, Turkish, Persian', 'The poem "Amir Arslon Rumi" is a story about love and devotion that has been widespread among the Arab, Turkish, Persian-speaking peoples from the seventeenth to the nineteenth century. Historical events in the game are mixed with fantastic events.\r\n', '9001rumiy.png', 2015, 5, 1),
(999, 'fayl_krilov_-_12.10.2015_15-55-58.pdf', 'Ninachi bilan chumoli', 'Krilov I', 'In this book, translations of I.Krilov is "Ninja and Ant", all of which are well-known, have been translated from Uzbek literature.', 'This book contains translations from Uzbek writers, which are well-known to all of us, Krylov, "The Ninja and the Ant." We hope that this book will appeal to our readers.', '21721.jpg', 1990, 4, 0),
(899, 'fayl_gena_-_28.09.2015_15-53-49.pdf', 'Gena degan timsoh', 'Uspenskiy E', 'Did you hear that a crocodile is a friend of children and animals, and a puppet has experienced some awesome adventures?', 'Did you hear that a crocodile is a friend of children and animals, and a puppet has experienced some awesome adventures? Here are some interesting, exciting stories in this book. Well, lets go together in the world of these wonderful things..', '34IMG.jpg', 2015, 4, 1);
/*!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 */;
| true
|
6812e171c2ad1eeedc9615e6fb9ed0c04d8118d8
|
SQL
|
yzhengk/Stevens-Institute-of-Technology
|
/FE 513/L4_Database I/demo-L4.sql
|
UTF-8
| 3,647
| 4.34375
| 4
|
[] |
no_license
|
/********
L4- Database Session I
Author: Xingjia Zhang
Content:
1. create table, alter drop table, insert data into table
2. select query
3. filtering data
4. grouping data
**********/
/********* create/drop database *****/
create database test;
drop database if exists test;# check existence of the database before dropping
-- if see error:unable to drop database because of some auto connections to DB, run the following query first, then drop database.
REVOKE CONNECT ON DATABASE dbtest FROM public;
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'dbtest';
/************* create table *****************/
create table branch2(branch_name varchar(30), branch_city varchar(30), assets integer)
create table branch(branch_name varchar(30) not null, branch_city varchar(15),assets integer); -- add constraints: not null
drop table if exists branch
alter table branch2 add branch_zipcode char(6)
alter table branch2 drop branch_zipcode
create table branch(branch_name char(30) not null,branch_city char(15),assets integer);
insert into branch(branch_name,branch_city,assets) values ('Bank of America', 'Los Angeles',3000);
insert into branch(branch_name,branch_city,assets) values ('JPMorgan Chase', 'New York',1400);
insert into branch(branch_name,branch_city,assets) values ('Wells Fargo', 'Orlando',2100);
insert into branch(branch_name,branch_city,assets)values ('Bank of America', 'Los Angeles',3000),('JPMorgan Chase', 'New York',1400), ('Wells Fargo', 'Orlando',2100);
/******* load data **********/
drop table if exists address;
CREATE TABLE address (
address_id integer NOT NULL,
address character varying(50) NOT NULL,
address2 character varying(50),
district character varying(20) NOT NULL,
city_id smallint NOT NULL,
postal_code character varying(10),
phone character varying(20) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
-- \COPY address (address_id, address, address2, district, city_id, postal_code, phone, last_update) FROM '$$PATH$$/2171.dat'; // type this line in console
/****** select query *****/
select * from address--select all from address
select address,city_id, phone from address--select specific columns
select address, city_id from address order by city_id -- order results by city_id
select * from address where city_id>400 -- filter rows
select address, city_id from address where city_id>400 and EXTRACT(month FROM last_update)=2 -- use "and" operator to add more filters in where expression
select distinct address from address where city_id>400 and EXTRACT(month FROM last_update)=2 -- use "distinct" to remove duplicate rows
select city_id from address order by city_id desc limit 10 -- limit number of rows in output
select phone,city_id,last_update from address where city_id in (300,400,500,600)
select phone, city_id from address where city_id between 300 and 400
select * from address where phone like '38%'
select * from address where phone like '_8%'
/************ grouping data ***********/
select count(*) as cnt from address -- rename selcted column with "as"
select count(*) as cnt, city_id from address group by city_id order by cnt desc
select count(*) as cnt, city_id from address group by city_id having city_id>300 order by cnt desc -- select records with city_id larger than 300 -method1
select count(*) as cnt, city_id from address where city_id>300 group by city_id order by cnt desc -- select records with city_id larger than 300 -method2
select count(*), city_id from address group by city_id having count(*)>1 -- select records with same city_id
| true
|
f6ece7cfd39d9e295fdd2aab1cd5cce8094a9444
|
SQL
|
dbconrado/uemgeventos
|
/uemgeventos/WebContent/META-INF/script_banco.sql
|
UTF-8
| 6,340
| 3.453125
| 3
|
[] |
no_license
|
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema uemgeventos
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema uemgeventos
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `uemgeventos` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `uemgeventos` ;
-- -----------------------------------------------------
-- Table `uemgeventos`.`evento`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`evento` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '',
`nome` VARCHAR(255) NOT NULL COMMENT '',
`data_inicio` DATE NULL COMMENT '',
`data_termino` DATE NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`atividade`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`atividade` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '',
`aceita_inscricao` TINYINT(1) NOT NULL COMMENT '',
`carga_horaria` INT NOT NULL COMMENT '',
`responsavel` VARCHAR(255) NOT NULL COMMENT '',
`nome` VARCHAR(255) NOT NULL COMMENT '',
`vagas` INT NULL COMMENT '',
`evento_id` INT NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '',
INDEX `fk_atividade_evento1_idx` (`evento_id` ASC) COMMENT '',
CONSTRAINT `fk_atividade_evento1`
FOREIGN KEY (`evento_id`)
REFERENCES `uemgeventos`.`evento` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`ocorrencia`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`ocorrencia` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '',
`data` DATE NOT NULL COMMENT '',
`horario_inicio` TIME NOT NULL COMMENT '',
`horario_termino` TIME NOT NULL COMMENT '',
`local` VARCHAR(255) NOT NULL COMMENT '',
`atividade_id` INT NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '',
INDEX `fk_ocorrencia_atividade_idx` (`atividade_id` ASC) COMMENT '',
CONSTRAINT `fk_ocorrencia_atividade`
FOREIGN KEY (`atividade_id`)
REFERENCES `uemgeventos`.`atividade` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`pessoa`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`pessoa` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '',
`nome` VARCHAR(255) NOT NULL COMMENT '',
`email` VARCHAR(255) NOT NULL COMMENT '',
`telefone` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`inscricao`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`inscricao` (
`pessoa_id` INT NOT NULL COMMENT '',
`atividade_id` INT NOT NULL COMMENT '',
`comissao` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`pessoa_id`, `atividade_id`) COMMENT '',
INDEX `fk_pessoa_has_atividade_atividade1_idx` (`atividade_id` ASC) COMMENT '',
INDEX `fk_pessoa_has_atividade_pessoa1_idx` (`pessoa_id` ASC) COMMENT '',
CONSTRAINT `fk_pessoa_has_atividade_pessoa1`
FOREIGN KEY (`pessoa_id`)
REFERENCES `uemgeventos`.`pessoa` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_pessoa_has_atividade_atividade1`
FOREIGN KEY (`atividade_id`)
REFERENCES `uemgeventos`.`atividade` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`frequencia`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`frequencia` (
`inscricao_pessoa_id` INT NOT NULL COMMENT '',
`inscricao_atividade_id` INT NOT NULL COMMENT '',
PRIMARY KEY (`inscricao_pessoa_id`, `inscricao_atividade_id`) COMMENT '',
CONSTRAINT `fk_frequencia_inscricao1`
FOREIGN KEY (`inscricao_pessoa_id` , `inscricao_atividade_id`)
REFERENCES `uemgeventos`.`inscricao` (`pessoa_id` , `atividade_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`registro`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`registro` (
`frequencia_inscricao_pessoa_id` INT NOT NULL COMMENT '',
`frequencia_inscricao_atividade_id` INT NOT NULL COMMENT '',
`hora_entrada` TIMESTAMP NULL COMMENT '',
`hora_saida` TIMESTAMP NULL COMMENT '',
PRIMARY KEY (`frequencia_inscricao_pessoa_id`, `frequencia_inscricao_atividade_id`) COMMENT '',
CONSTRAINT `fk_registro_frequencia1`
FOREIGN KEY (`frequencia_inscricao_pessoa_id` , `frequencia_inscricao_atividade_id`)
REFERENCES `uemgeventos`.`frequencia` (`inscricao_pessoa_id` , `inscricao_atividade_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `uemgeventos`.`teste`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `uemgeventos`.`teste` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '',
`campo` VARCHAR(45) NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '')
ENGINE = InnoDB;
-----------
-- CRIANDO USUARIO
-----------
GRANT ALL PRIVILEDGES ON `uemgeventos`.* TO `eventos_user`@`localhost` IDENTIFIED BY `@eventos123`;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true
|
c834d2b41c5dcbf2ef61392ad478554fb31dbba0
|
SQL
|
bcgov/gcpe-hub
|
/Hub.Legacy/Gcpe.Hub.Database/calendar/Tables/PremierRequested.sql
|
UTF-8
| 511
| 2.984375
| 3
|
[
"Apache-2.0"
] |
permissive
|
CREATE TABLE [calendar].[PremierRequested] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (50) NULL,
[IsActive] BIT CONSTRAINT [DF_PremierRequested_IsActive] DEFAULT ((1)) NOT NULL,
[SortOrder] INT NULL,
[TimeStamp] ROWVERSION NOT NULL,
[RowGuid] UNIQUEIDENTIFIER CONSTRAINT [DF_PremierRequested_RowGuid] DEFAULT (newid()) NOT NULL,
CONSTRAINT [PK_PremierRequested] PRIMARY KEY CLUSTERED ([Id] ASC)
);
| true
|
312e8dcc9e192fe1ad76095c0ed42728379dd34b
|
SQL
|
maxprofs-llcio/addon
|
/sprocs/APACH_PAYMENT_HDR.prc
|
UTF-8
| 5,324
| 2.6875
| 3
|
[] |
no_license
|
rem -------------------------------------------------------------------------
rem --- Program: APACH_PAYMENT_HDR.prc
rem --- Description: Stored Procedure to create a jasper-based ACH Payment report
rem
rem --- AddonSoftware
rem --- Copyright BASIS International Ltd. All Rights Reserved.
rem -------------------------------------------------------------------------
seterr sproc_error
declare BBjStoredProcedureData sp!
declare BBjRecordSet rs!
declare BBjRecordData data!
rem --- Get the infomation object for the Stored Procedure
sp! = BBjAPI().getFileSystem().getStoredProcedureData()
rem --- Get 'IN' SPROC parameters
firm_id$ = sp!.getParameter("FIRM_ID")
ap_type$ = sp!.getParameter("AP_TYPE")
check_no$ = sp!.getParameter("CHECK_NO")
vendor_id$=sp!.getParameter("VENDOR_ID")
vend_mask$ = sp!.getParameter("VEND_MASK")
amt_mask$ = sp!.getParameter("AMT_MASK")
barista_wd$ = sp!.getParameter("BARISTA_WD")
chdir barista_wd$
rem --- Create the memory record set for return to jasper
dataTemplate$ = "vendor_id:C(1*),vendor_name:C(30),address1:C(30),address2:C(30),address3:C(30),"
dataTemplate$ = dataTemplate$ + "check_no:C(1*),check_date:C(1*),check_amt:C(1*),"
dataTemplate$ = dataTemplate$ + "sent_to1:C(1*),sent_to2:C(1*)"
rs! = BBJAPI().createMemoryRecordSet(dataTemplate$)
rem --- open files
files=2,begfile=1,endfile=files
dim files$[files],options$[files],ids$[files],templates$[files],channels[files]
files$[1]="apm-01",ids$[1]="APM_VENDMAST"
files$[2]="apm_payaddr",ids$[2]="APM_PAYADDR"
call pgmdir$+"adc_fileopen.aon",action,begfile,endfile,files$[all],options$[all],ids$[all],templates$[all],channels[all],batch,status
if status then
seterr 0
x$=stbl("+THROWN_ERR","TRUE")
throw "File open error.",1001
endif
apm01_dev=channels[1]
apmPayAddr_dev=channels[2]
dim apm01a$:templates$[1]
dim apmPayAddr$:templates$[2]
rem --- Format Vendor Address
dim address$(3*30)
find record (apm01_dev,key=firm_id$+vendor_id$,dom=*next) apm01a$
address$(1)=apm01a.addr_line_1$+apm01a.addr_line_2$+apm01a.city$+apm01a.state_code$+apm01a.zip_code$+apm01a.cntry_id$
vend_name$= apm01a.vendor_name$
start_block = 1
if start_block
find record (apmPayAddr_dev,key=firm_id$+vendor_id$,dom=*endif) apmPayAddr$
address$(1)= apmPayAddr.addr_line_1$+apmPayAddr.addr_line2$+apmPayAddr.city$+apmPayAddr.state_code$+apmPayAddr.zip_code$+apmPayAddr.cntry_id$
vend_name$= apmPayAddr.vendor_name$
endif
call pgmdir$+"adc_address.aon",address$,24,3,9,30
rem --- Get check date and amount
sql_prep$=""
sql_prep$=sql_prep$+"SELECT check_date "
sql_prep$=sql_prep$+" ,chk_amt "
sql_prep$=sql_prep$+"FROM APW_CHKJASPERPRN "
sql_prep$=sql_prep$+"WHERE firm_id='"+firm_id$+"' "
sql_prep$=sql_prep$+" AND ap_type='"+ap_type$+"' "
sql_prep$=sql_prep$+" AND check_no='"+check_no$+"' "
sql_prep$=sql_prep$+" AND section_type='C' "
sql_chan=sqlunt
sqlopen(sql_chan,mode="PROCEDURE",err=*next)stbl("+DBNAME")
sqlprep(sql_chan)sql_prep$
dim read_tpl$:sqltmpl(sql_chan)
sqlexec(sql_chan)
read_tpl$ = sqlfetch(sql_chan)
rem --- put data into recordset
data! = rs!.getEmptyRecordData()
data!.setFieldValue("VENDOR_ID",fnmask$(vendor_id$,vend_mask$))
data!.setFieldValue("VENDOR_NAME",vend_name$)
data!.setFieldValue("ADDRESS1", address$(1,30))
data!.setFieldValue("ADDRESS2", address$(31,30))
data!.setFieldValue("ADDRESS3", address$(61,30))
data!.setFieldValue("CHECK_NO", check_no$)
data!.setFieldValue("CHECK_DATE", fndate$(read_tpl.check_date$))
data!.setFieldValue("CHECK_AMT", str(read_tpl.chk_amt:amt_mask$))
data!.setFieldValue("SENT_TO1", apm01a.bank_name$)
bnkAcctNo$=cvs(apm01a.bnk_acct_no$,2)
if len(bnkAcctNo$)>4 then
bnkAcctNo$=pad(bnkAcctNo$(len(bnkAcctNo$)-3),len(bnkAcctNo$),"R","x")
else
bnkAcctNo$=pad(bnkAcctNo$,6,"R","x")
endif
data!.setFieldValue("SENT_TO2", bnkAcctNo$)
rs!.insert(data!)
rem --- close files
close(apm01_dev,err=*next)
close(apmPayAddr_dev,err=*next)
sp!.setRecordSet(rs!)
goto std_exit
rem --- Date/time handling functions
def fndate$(q$)
q1$=""
q1$=date(jul(num(q$(1,4)),num(q$(5,2)),num(q$(7,2)),err=*next),err=*next)
if q1$="" q1$=q$
return q1$
fnend
def fnyy$(q$)=q$(3,2)
def fnclock$(q$)=date(0:"%hz:%mz %p")
def fntime$(q$)=date(0:"%Hz%mz")
rem --- fnmask$: Alphanumeric Masking Function (formerly fnf$)
def fnmask$(q1$,q2$)
if cvs(q1$,2)="" return ""
if q2$="" q2$=fill(len(q1$),"0")
return str(-num(q1$,err=*next):q2$,err=*next)
q=1
q0=0
while len(q2$(q))
if pos(q2$(q,1)="-()") q0=q0+1 else q2$(q,1)="X"
q=q+1
wend
if len(q1$)>len(q2$)-q0 q1$=q1$(1,len(q2$)-q0)
return str(q1$:q2$)
fnend
sproc_error:rem --- SPROC error trap/handler
rd_err_text$="", err_num=err
if tcb(2)=0 and tcb(5) then rd_err_text$=pgm(tcb(5),tcb(13),err=*next)
x$=stbl("+THROWN_ERR","TRUE")
throw "["+pgm(-2)+"] "+str(tcb(5))+": "+rd_err_text$,err_num
std_exit:
end
| true
|
3a789036febb9e669011721d311d56865a13070e
|
SQL
|
lcny0606/lottery
|
/lottery.sql
|
UTF-8
| 774
| 2.9375
| 3
|
[] |
no_license
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50709
Source Host : localhost:3306
Source Database : lottery
Target Server Type : MYSQL
Target Server Version : 50709
File Encoding : 65001
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `lucky_member`
-- ----------------------------
DROP TABLE IF EXISTS `lucky_member`;
CREATE TABLE `lucky_member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 DEFAULT NULL COMMENT '姓名',
`pic` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '照片',
`prize` varchar(10) DEFAULT '0' COMMENT '奖项',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=34 DEFAULT CHARSET=latin1;
| true
|
16848b31cf8c9da3a419d67e8ae55a962e72116e
|
SQL
|
bisnukundu/price_compare_website
|
/Database/price_compare.sql
|
UTF-8
| 10,328
| 2.8125
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 13, 2020 at 09:01 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.3.22
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: `price_compare`
--
-- --------------------------------------------------------
--
-- Table structure for table `banar`
--
CREATE TABLE `banar` (
`id` int(11) NOT NULL,
`banar1` varchar(255) NOT NULL,
`banar2` varchar(255) NOT NULL,
`banar3` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `banar`
--
INSERT INTO `banar` (`id`, `banar1`, `banar2`, `banar3`) VALUES
(19, '1606745154food-collage-various-fruits-vegetables-260nw-1114876307.jpg', '1606745154fresh-food-groceries-tray-box-wood-tabletop-banner-background_8087-2719.jpg', '1606745154banner_136 (1).png');
-- --------------------------------------------------------
--
-- Table structure for table `giantmall`
--
CREATE TABLE `giantmall` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`price` float NOT NULL,
`img` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `giantmall`
--
INSERT INTO `giantmall` (`id`, `title`, `price`, `img`) VALUES
(15, 'Chicken', 5.99, '16067395695f859812e5f14.jpg'),
(16, 'Chili', 10.89, '16067402305f85a61655624.jpg'),
(17, 'Banana', 3.99, '16067402745e888cd63c6f7.jpg'),
(18, 'Tomato', 5.8, '16068206435e888d16e45f7.jpg'),
(19, 'Papaya', 2.2, '16068207525f859c2e5ac95.jpg'),
(20, 'Granny-Smith Apple', 8.6, '16068217955e888cf6868fe.jpg'),
(21, 'Lemon', 5.15, '16068212585e888d0736677.jpg'),
(22, 'Plum', 12.5, '16068213745f85958ec8c5c.jpg'),
(23, 'Carrots', 4.25, '16068214875f8595fb5173e.jpg'),
(24, 'Pink-Lady Apple', 7.35, '16068220235f8596b391cc6.jpg'),
(25, 'Pineapple', 2.1, '16068221815f859a681cc45.jpg'),
(26, 'Mandarin Orange', 10.5, '16068305705f8598f93a9f5.jpg'),
(27, 'Grapefruit', 5.65, '16068307895f8599592d9a4.jpg'),
(28, 'Pomegranate', 8.25, '16068309115f8599cb6a9a5.jpg'),
(29, 'Peach', 5.85, '16068310295f859b3eb8f2c.jpg'),
(30, 'Passion', 6.15, '16068311065f859bca4711b.jpg'),
(31, 'Honeydew', 1.9, '16068311955f85ad7b3eec6.jpg'),
(32, 'Watermelon', 1.55, '16068312665f85ad05aa305.jpg'),
(33, 'Mango', 12.6, '16068313285f85acc7a812b.jpg'),
(34, 'Lime ', 12.2, '16068314145f85ac5f61ec1.jpg'),
(35, 'Kiwi', 19.6, '16068314835f85abd542228.jpg'),
(36, 'Asparagus', 21.2, '16068316015f85a8c1c0814.jpg'),
(37, 'Garlic', 7.85, '16068317065f85a5a03f858.jpg'),
(38, 'Eggplant', 8.35, '16068318535f85a767d9e65.jpg'),
(39, 'Ginger', 9.25, '16068319415f85a53fc20ad.jpg'),
(40, 'Mushroom', 5.2, '16068319995f85a4cd9b3d0.jpg'),
(41, 'Bell-Paper', 13.2, '16068320975f85a39ae880f.jpg'),
(42, 'Potato', 2.59, '16068321715f85a291b04b0.jpg'),
(43, 'Sweet-Potato', 4.25, '16068322235f85a2056a38f.jpg'),
(44, 'Red-Beet', 8.6, '16068323045f85a1641985d.jpg'),
(45, 'Zucchini', 4.35, '16068323885f85a0d6d9fd0.jpg'),
(46, 'Avocado', 19.3, '16068324725f859f52dce7e.jpg'),
(47, 'Leek', 7.5, '16068325475f859e9a82577.jpg'),
(48, 'Cucumber', 4.8, '16068326075f859d99e171d.jpg'),
(49, 'Cabbage', 1.8, '16068326895f859d238e936.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `heromarket`
--
CREATE TABLE `heromarket` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`price` float NOT NULL,
`img` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `heromarket`
--
INSERT INTO `heromarket` (`id`, `title`, `price`, `img`) VALUES
(14, 'Chicken', 7, '16068195465f859812e5f14.jpg'),
(15, 'Chili', 9.8, '16068195995f85a61655624.jpg'),
(16, 'Banana', 3.2, '16068196525e888cd63c6f7.jpg'),
(17, 'Tomato', 4.5, '16068206955e888d16e45f7.jpg'),
(18, 'Papaya', 2, '16068207895f859c2e5ac95.jpg'),
(19, 'Granny-Smith Apple', 6.95, '16068218365e888cf6868fe.jpg'),
(20, 'Lemon', 3.95, '16068213005e888d0736677.jpg'),
(21, 'Plum', 14.25, '16068214365f85958ec8c5c.jpg'),
(22, 'Carrots', 4.65, '16068215295f8595fb5173e.jpg'),
(23, 'Pink-Lady Apple', 8.65, '16068220975f8596b391cc6.jpg'),
(25, 'Mandarin Orange', 9.45, '16068306405f8598f93a9f5.jpg'),
(26, 'Grapefruit', 6.85, '16068307925f8599592d9a4.jpg'),
(27, 'Pomegranate', 6.95, '16068309005f8599cb6a9a5.jpg'),
(28, 'Peach', 4.85, '16068310245f859b3eb8f2c.jpg'),
(29, 'Passion', 7.15, '16068311105f859bca4711b.jpg'),
(30, 'Honeydew', 1.8, '16068311995f85ad7b3eec6.jpg'),
(31, 'Watermelon', 1.35, '16068312625f85ad05aa305.jpg'),
(32, 'Mango', 10.95, '16068313255f85acc7a812b.jpg'),
(33, 'Lime ', 10.5, '16068314125f85ac5f61ec1.jpg'),
(34, 'Kiwi', 18.75, '16068314795f85abd542228.jpg'),
(35, 'Asparagus', 7.55, '16068316045f85a8c1c0814.jpg'),
(36, 'Garlic', 9.85, '16068317045f85a5a03f858.jpg'),
(37, 'Eggplant', 7, '16068318515f85a767d9e65.jpg'),
(38, 'Ginger', 7.95, '16068319395f85a53fc20ad.jpg'),
(39, 'Mushroom', 5.7, '16068319975f85a4cd9b3d0.jpg'),
(40, 'Bell-Paper', 13.9, '16068321005f85a39ae880f.jpg'),
(41, 'Potato', 1.86, '16068321685f85a291b04b0.jpg'),
(42, 'Sweet-Potato', 2.95, '16068322195f85a2056a38f.jpg'),
(43, 'Red-Beet', 7.95, '16068322975f85a1641985d.jpg'),
(44, 'Zucchini', 4.26, '16068323855f85a0d6d9fd0.jpg'),
(45, 'Avocado', 19.86, '16068324755f859f52dce7e.jpg'),
(46, 'Leek', 7, '16068325455f859e9a82577.jpg'),
(47, 'Cucumber', 4.55, '16068326045f859d99e171d.jpg'),
(48, 'Cabbage', 2, '16068326905f859d3adb9e4.jpg'),
(49, 'Pineapple', 1.95, '16068327495f859a681cc45.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tesco`
--
CREATE TABLE `tesco` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`price` float NOT NULL,
`img` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tesco`
--
INSERT INTO `tesco` (`id`, `title`, `price`, `img`) VALUES
(11, 'Chicken', 6.5, '16068195165f859812e5f14.jpg'),
(12, 'Chili', 11, '16068195755f85a61655624.jpg'),
(13, 'Banana', 4.2, '16068196315e888cd63c6f7.jpg'),
(14, 'Tomato', 5.6, '16068206745e888d16e45f7.jpg'),
(15, 'Papaya', 2.3, '16068207695f859c2e5ac95.jpg'),
(16, 'Granny-Smith Apple', 7.5, '16068218115e888cf6868fe.jpg'),
(17, 'Lemon', 4.25, '16068212835e888d0736677.jpg'),
(18, 'Plum', 14.25, '16068213915f85958ec8c5c.jpg'),
(19, 'Carrots', 4.15, '16068215125f8595fb5173e.jpg'),
(20, 'Pink-Lady Apple', 8.4, '16068220645f8596b391cc6.jpg'),
(21, 'Pineapple', 1.85, '16068222165f859a681cc45.jpg'),
(23, 'Mandarin Orange', 9.55, '16068306125f8598f93a9f5.jpg'),
(24, 'Grapefruit', 6.45, '16068307855f8599592d9a4.jpg'),
(25, 'Pomegranate', 7.85, '16068309075f8599cb6a9a5.jpg'),
(26, 'Peach', 6.95, '16068310275f859b3eb8f2c.jpg'),
(27, 'Passion', 5.95, '16068311085f859bca4711b.jpg'),
(28, 'Honeydew', 2.1, '16068311975f85ad7b3eec6.jpg'),
(29, 'Watermelon', 1.45, '16068312645f85ad05aa305.jpg'),
(30, 'Mango', 11.35, '16068313275f85acc7a812b.jpg'),
(31, 'Lime ', 11.6, '16068314105f85ac5f61ec1.jpg'),
(32, 'Kiwi', 18.5, '16068314815f85abd542228.jpg'),
(33, 'Asparagus', 19.9, '16068316025f85a8c1c0814.jpg'),
(34, 'Garlic', 8.5, '16068317035f85a5a03f858.jpg'),
(35, 'Eggplant', 8.99, '16068318525f85a767d9e65.jpg'),
(36, 'Ginger', 8.75, '16068319405f85a53fc20ad.jpg'),
(37, 'Mushroom', 4.9, '16068319985f85a4cd9b3d0.jpg'),
(38, 'Bell-Paper', 14.2, '16068321025f85a39ae880f.jpg'),
(39, 'Potato', 5.45, '16068321695f85a291b04b0.jpg'),
(40, 'Sweet-Potato', 3.25, '16068322225f85a2056a38f.jpg'),
(41, 'Red-Beet', 8.3, '16068323025f85a1641985d.jpg'),
(42, 'Zucchini', 3.95, '16068323875f85a0d6d9fd0.jpg'),
(43, 'Avocado', 20.3, '16068324745f859f52dce7e.jpg'),
(44, 'Leek', 6.98, '16068325465f859e9a82577.jpg'),
(45, 'Cucumber', 3.9, '16068326065f859d99e171d.jpg'),
(46, 'Cabbage', 1.9, '16068326875f859d3adb9e4.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` text NOT NULL,
`email` varchar(255) NOT NULL,
`role` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `username`, `password`, `email`, `role`) VALUES
(20, 'Sujon Kumar Shil', 'sujon', '$2y$10$f/LQfsOPs5DOzJa4VAwWHOXVcfwwYf2tJSDuvLAHgeVvUYyanl38a', 'skssujon90@gmail.com', 0),
(21, 'Tesco Authority', 'Tesco', '$2y$10$2cYoEylw/JeLuKc9ER5xyeqyyaE4ZOoQYiYkFTdQkMXwMVSGSBqK2', 'tesco@gmail.com', 1),
(24, 'Hero Authority', 'Hero market', '$2y$10$CXIFj8IpyIkidLxcfIKuleOUWFUM6KRYE6pdAtqpzwekSkdXMg.lK', 'heromarket@gmail.com', 2),
(25, 'Giant Authority', 'Giant', '$2y$10$MGMtBws/2rDI/HOCeNavV.cYQDyIYwjyu/tBVRhJ1xVJbxLWpZ20q', 'giant@gmail.com', 3);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `banar`
--
ALTER TABLE `banar`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `giantmall`
--
ALTER TABLE `giantmall`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `heromarket`
--
ALTER TABLE `heromarket`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tesco`
--
ALTER TABLE `tesco`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `banar`
--
ALTER TABLE `banar`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `giantmall`
--
ALTER TABLE `giantmall`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;
--
-- AUTO_INCREMENT for table `heromarket`
--
ALTER TABLE `heromarket`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;
--
-- AUTO_INCREMENT for table `tesco`
--
ALTER TABLE `tesco`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
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 */;
| true
|
adb0416b1fbefbb2c629189bba90f3941d2ede57
|
SQL
|
leeo-123/PC_project
|
/ym.sql
|
UTF-8
| 5,651
| 2.90625
| 3
|
[] |
no_license
|
SET NAMES UTF8;
DROP DATABASE IF EXISTS ym;
CREATE DATABASE ym CHARSET=UTF8;
USE ym;
/**用户信息**/
CREATE TABLE ym_user(
uid INT PRIMARY KEY AUTO_INCREMENT,
uname VARCHAR(32),
upwd VARCHAR(32)
);
/**用户信息**/
INSERT INTO ym_user VALUES
(NULL, 'dingding', '123456'),
(NULL, 'dangdang', '123456'),
(NULL, 'doudou', '123456'),
(NULL, 'yaya', '123456');
/**创建首页商品表**/
CREATE TABLE `ym_index_product` (
`lid` int(11) NOT NULL,
`title` varchar(64) DEFAULT NULL,
`etitle` varchar(64) DEFAULT NULL,
`details` varchar(128) DEFAULT NULL,
`pic1` varchar(128) DEFAULT NULL,
`pic2` varchar(128) DEFAULT NULL,
`pic3` varchar(128) DEFAULT NULL,
`price1` decimal(10,2) DEFAULT NULL,
`price2` decimal(10,2) DEFAULT NULL,
`href` varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 插入之前先把表清空(truncate) `xz_index_product`
--
TRUNCATE TABLE `ym_index_product`;
--
-- 转存表中的数据 `xz_index_product`
--
INSERT INTO `ym_index_product` (`lid`, `title`,`etitle`, `details`, `pic1`,`pic2`,`pic3`, `price1`,`price2`, `href`) VALUES
(1, '雅诗兰黛', 'ESTEE LAUDER' ,'新款蓝光眼霜和肌透精华套装' , 'img/details/p1_1.png', 'img/details/p1_2.png', 'img/details/p1_3.png', '126.00','880.74', '/product_details.html?lid=1'),
(2, '资生堂', 'SHISEIDO' ,'资生堂安耐防晒 SPF50+ 60ml' , 'img/details/p2_1.png', 'img/details/p2_2.png', 'img/details/p2_3.png', '26.88','187.89', '/product_details.html?lid=2'),
(3, '雅诗兰黛', 'ESTEE LAUDER' ,'雅诗兰黛 特润修护及透精华露' , 'img/details/p3_1.png', 'img/details/p3_2.png', 'img/details/p3_3.png', '78.00','545.22', '/product_details.html?lid=3'),
(4, '海蓝之谜', 'LA MER' ,'海蓝之谜经典精华面霜30ml' , 'img/details/p4_1.png', 'img/details/p4_2.png', 'img/details/p4_3.png', '130.00','908.70', '/product_details.html?lid=4'),
(5, 'NARS', 'NARS' ,'NARS遮瑕膏CHANTILL' , 'img/details/p5_1.png', 'img/details/p5_2.png', 'img/details/p5_3.png', '17.18','120.09', '/product_details.html?lid=5'),
(6, '乔治阿玛尼', 'GIORGIO ARMANI' ,'阿玛尼 红管 哑光唇釉' , 'img/details/p6_1.png', 'img/details/p6_2.png', 'img/details/p6_3.png', '26.16','154.90', '/product_details.html?lid=6'),
(7, '波比波郎', 'BOBBI BROWN' ,'波比波郎 控油净澈精华' , 'img/details/p7_1.png', 'img/details/p7_2.png', 'img/details/p7_3.png', '31.19','218.02', '/product_details.html?lid=7'),
(8, 'Refa', 'Refa' ,'REFA 脸部按摩仪 经典版' , 'img/details/p8_1.png', 'img/details/p8_2.png', 'img/details/p8_3.png', '185.17','1294.34', '/product_details.html?lid=8'),
(9, '迪奥', 'DIOR' ,'迪奥烈焰蓝金唇膏' , 'img/details/p9_1.png', 'img/details/p9_2.png', 'img/details/p9_3.png', '22.01','153.85', '/product_details.html?lid=9'),
(10, '海蓝之谜', 'LA MER' ,'海蓝之谜护手霜' , 'img/details/p10_1.png', 'img/details/p10_2.png', 'img/details/p10_3.png', '57.21','399.90', '/product_details.html?lid=10'),
(11, '纪梵希', 'GIVENCHY' ,'纪梵希 小羊皮口红' , 'img/details/p11_1.png', 'img/details/p11_2.png', 'img/details/p11_3.png', '23.17','161.96', '/product_details.html?lid=11'),
(12, '科颜氏', 'KIEHL S' ,'科颜氏维生素C紧肤精华乳' , 'img/details/p12_1.png', 'img/details/p12_2.png', 'img/details/p12_3.png', '70.65','493.84', '/product_details.html?lid=12'),
(13, '雅诗兰黛', 'ESTEE LAUDER' ,'新款蓝光眼霜和肌透精华套装' , 'img/details/p1_1.png', 'img/details/p1_2.png', 'img/details/p1_3.png', '126.00','880.74', '/product_details.html?lid=1'),
(14, '资生堂', 'SHISEIDO' ,'资生堂安耐防晒 SPF50+ 60ml' , 'img/details/p2_1.png', 'img/details/p2_2.png', 'img/details/p2_3.png', '26.88','187.89', '/product_details.html?lid=2'),
(15, '雅诗兰黛', 'ESTEE LAUDER' ,'雅诗兰黛 特润修护及透精华露' , 'img/details/p3_1.png', 'img/details/p3_2.png', 'img/details/p3_3.png', '78.00','545.22', '/product_details.html?lid=3'),
(16, '海蓝之谜', 'LA MER' ,'海蓝之谜经典精华面霜30ml' , 'img/details/p4_1.png', 'img/details/p4_2.png', 'img/details/p4_3.png', '130.00','908.70', '/product_details.html?lid=4'),
(17, 'NARS', 'NARS' ,'NARS遮瑕膏CHANTILL' , 'img/details/p5_1.png', 'img/details/p5_2.png', 'img/details/p5_3.png', '17.18','120.09', '/product_details.html?lid=5'),
(18, '乔治阿玛尼', 'GIORGIO ARMANI' ,'阿玛尼 红管 哑光唇釉' , 'img/details/p6_1.png', 'img/details/p6_2.png', 'img/details/p6_3.png', '26.16','154.90', '/product_details.html?lid=6'),
(19, '波比波郎', 'BOBBI BROWN' ,'波比波郎 控油净澈精华' , 'img/details/p7_1.png', 'img/details/p7_2.png', 'img/details/p7_3.png', '31.19','218.02', '/product_details.html?lid=7'),
(20, 'Refa', 'Refa' ,'REFA 脸部按摩仪 经典版' , 'img/details/p8_1.png', 'img/details/p8_2.png', 'img/details/p8_3.png', '185.17','1294.34', '/product_details.html?lid=8'),
(21, '迪奥', 'DIOR' ,'迪奥烈焰蓝金唇膏' , 'img/details/p9_1.png', 'img/details/p9_2.png', 'img/details/p9_3.png', '22.01','153.85', '/product_details.html?lid=9'),
(22, '海蓝之谜', 'LA MER' ,'海蓝之谜护手霜' , 'img/details/p10_1.png', 'img/details/p10_2.png', 'img/details/p10_3.png', '57.21','399.90', '/product_details.html?lid=10'),
(23, '纪梵希', 'GIVENCHY' ,'纪梵希 小羊皮口红' , 'img/details/p11_1.png', 'img/details/p11_2.png', 'img/details/p11_3.png', '23.17','161.96', '/product_details.html?lid=11'),
(24, '科颜氏', 'KIEHL S' ,'科颜氏维生素C紧肤精华乳' , 'img/details/p12_1.png', 'img/details/p12_2.png', 'img/details/p12_3.png', '70.65','493.84', '/product_details.html?lid=12');
| true
|
29d31a8645360fa2f38e744ace38844c76889e0e
|
SQL
|
erikcedillo/bamazon
|
/bamazon.sql
|
UTF-8
| 756
| 3.390625
| 3
|
[] |
no_license
|
-- WHAT THE DATABASE IS CALLED AND BEING CREATED
DROP DATABASE IF EXISTS bamazonDB;
CREATE DATABASE bamazonDB;
USE bamazonDB;
-- THIS IS THE TABLE AND WHATS INSIDE OF IT
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
product_name VARCHAR(65) NOT NULL,
department_name VARCHAR(45) NOT NULL,
price DECIMAL(30,2) NOT NULL,
stock_quantity INT(30) NOT NULL
);
-- ALL THE PRODUCTS
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES
("Laptop", "Electronics", 309.99, 37),
("Xbox One X", "Electronics", 159.99, 22),
("Mexican Candy", "Grocery", 11.99, 62),
("Popcorn", "Grocery", 10.99, 37),
("Biggie Smalls", "Music", 12.99, 62),
("2pac", "Music", 11.99, 6);
SELECT * FROM products;
| true
|
b3287c4bd1706a54f2eb7ef51fd723bdbdf26e4d
|
SQL
|
danilobatistaqueiroz/struts_crud
|
/src/main/sql/DataBase.sql
|
UTF-8
| 1,275
| 3.53125
| 4
|
[] |
no_license
|
CREATE DATABASE dbusiness;
USE dbusiness;
/*
SQLITE
Drop table Product;
Drop table Category;
Drop table Product_Category;
Drop table User;
Drop table Country;
Drop table Purchase;
CREATE TABLE Product (
Id Integer Primary Key AUTOINCREMENT ,
Name Varchar(20) Not null ,
Price Decimal(15,2)
);
CREATE TABLE Category (
Id Integer Primary Key AUTOINCREMENT ,
Name varchar(20) Not null ,
Description Varchar(50) null
);
CREATE TABLE Product_Category (
Product_Id Integer not null,
Category_Id Integer not null,
PRIMARY KEY (Product_id, Category_id),
FOREIGN KEY(Product_Id) REFERENCES Product(Id),
FOREIGN KEY(Category_Id) REFERENCES Category(Id)
);
CREATE TABLE User(
Id Integer Primary key AUTOINCREMENT ,
Login Varchar (30) NOT NULL,
Name Varchar(80) NOT NULL ,
Age INT(3) NULL,
Phone Varchar(14) NULL ,
Email Varchar(60) NOT NULL,
Password Varchar(255) NOT NULL,
Country_Id Integer Null,
FOREIGN KEY(Country_Id) REFERENCES Country(Id)
);
CREATE TABLE Country(
Id Integer Primary key AUTOINCREMENT ,
Name Varchar(80) NOT NULL
);
Create Table Purchase (
Id Integer Primary Key AutoIncrement,
Date DateTime not null,
Total_Price double not null,
Paid integer not null,
User_Id integer not null,
FOREIGN KEY(User_Id) REFERENCES User(Id)
);
*/
| true
|
74d213418a7d808bd0ea2df9fee960bee91ee744
|
SQL
|
danh1999yb/duyanh
|
/SQL/Assignment 4/Testing_System_Assignment_4.sql
|
UTF-8
| 13,622
| 4.0625
| 4
|
[] |
no_license
|
DROP DATABASE IF EXISTS TestingSystem;
CREATE DATABASE TestingSystem;
USE TestingSystem;
DROP TABLE IF EXISTS Department;
CREATE TABLE Department (
DepartmentID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
DepartmentName NVARCHAR(50) NOT NULL UNIQUE KEY
);
SELECT
*
FROM
Department;
DROP TABLE IF EXISTS Position;
CREATE TABLE `Position` (
PositionID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
PositionName ENUM('Dev', 'Test', 'Scrum Master', 'PM') NOT NULL UNIQUE KEY
);
DROP TABLE IF EXISTS `Account`;
CREATE TABLE `Account` (
AccountID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Email VARCHAR(50) NOT NULL UNIQUE KEY,
Username VARCHAR(50) NOT NULL UNIQUE KEY,
FullName NVARCHAR(50) NOT NULL,
DepartmentID TINYINT UNSIGNED NOT NULL,
PositionID TINYINT UNSIGNED NOT NULL,
CreateDate DATETIME,
FOREIGN KEY (DepartmentID)
REFERENCES Department (DepartmentID),
FOREIGN KEY (PositionID)
REFERENCES `Position` (PositionID)
);
DROP TABLE IF EXISTS `Group`;
CREATE TABLE `Group` (
GroupID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
GroupName NVARCHAR(50) NOT NULL UNIQUE KEY,
CreatorID TINYINT UNSIGNED,
CreateDate DATETIME,
FOREIGN KEY (CreatorID)
REFERENCES `Account` (AccountId)
);
DROP TABLE IF EXISTS GroupAccount;
CREATE TABLE GroupAccount (
GroupID TINYINT UNSIGNED NOT NULL,
AccountID TINYINT UNSIGNED NOT NULL,
JoinDate DATETIME,
PRIMARY KEY (GroupID , AccountID),
FOREIGN KEY (GroupID)
REFERENCES `Group` (GroupID),
FOREIGN KEY (AccountID)
REFERENCES `Account` (AccountID)
);
DROP TABLE IF EXISTS TypeQuestion;
CREATE TABLE TypeQuestion (
TypeID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
TypeName ENUM('Essay', 'Multiple-Choice') NOT NULL UNIQUE KEY
);
DROP TABLE IF EXISTS CategoryQuestion;
CREATE TABLE CategoryQuestion (
CategoryID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
CategoryName NVARCHAR(50) NOT NULL UNIQUE KEY
);
DROP TABLE IF EXISTS Question;
CREATE TABLE Question (
QuestionID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Content NVARCHAR(100) NOT NULL,
CategoryID TINYINT UNSIGNED NOT NULL,
TypeID TINYINT UNSIGNED NOT NULL,
CreatorID TINYINT UNSIGNED NOT NULL,
CreateDate DATETIME ,
FOREIGN KEY (CategoryID)
REFERENCES CategoryQuestion (CategoryID),
FOREIGN KEY (TypeID)
REFERENCES TypeQuestion (TypeID),
FOREIGN KEY (CreatorID)
REFERENCES `Account` (AccountId)
);
DROP TABLE IF EXISTS Exam;
CREATE TABLE Exam (
ExamID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`Code` CHAR(10) NOT NULL,
Title NVARCHAR(50) NOT NULL,
CategoryID TINYINT UNSIGNED NOT NULL,
Duration TINYINT UNSIGNED NOT NULL,
CreatorID TINYINT UNSIGNED NOT NULL,
CreateDate DATETIME ,
FOREIGN KEY (CategoryID)
REFERENCES CategoryQuestion (CategoryID),
FOREIGN KEY (CreatorID)
REFERENCES `Account` (AccountId)
);
DROP TABLE IF EXISTS ExamQuestion;
CREATE TABLE ExamQuestion (
ExamID TINYINT UNSIGNED NOT NULL,
QuestionID TINYINT UNSIGNED NOT NULL,
FOREIGN KEY (QuestionID)
REFERENCES Question (QuestionID),
FOREIGN KEY (ExamID)
REFERENCES Exam (ExamID),
PRIMARY KEY (ExamID , QuestionID)
);
DROP TABLE IF EXISTS Answer;
CREATE TABLE Answer (
AnswerID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Content NVARCHAR(100) NOT NULL,
QuestionID TINYINT UNSIGNED NOT NULL,
isCorrect BIT DEFAULT 1,
FOREIGN KEY (QuestionID)
REFERENCES Question (QuestionID)
);
INSERT INTO Department(DepartmentName)
VALUES
(N'Marketing' ),
(N'Sale' ),
(N'Bảo vệ' ),
(N'Nhân sự' ),
(N'Kỹ thuật' ),
(N'Tài chính' ),
(N'Phó giám đốc'),
(N'Giám đốc' ),
(N'Thư kí' ),
(N'No person' ),
(N'Bán hàng' );
INSERT INTO Position (PositionName )
VALUES ('Dev' ),
('Test' ),
('Scrum Master'),
('PM' )
;
INSERT INTO `Account`(Email , Username , FullName , DepartmentID , PositionID, CreateDate)
VALUES ('Email1@gmail.com' , 'duyanh' ,'Nguyen Phan Duy Anh' , '5' , '1' ,'2021-03-03'),
('Email2@gmail.com' , 'ducanh' ,'Nguyen Duc Anh' , '1' , '2' ,'2021-03-05'),
('Email3@gmail.com' , 'hoanglong' ,'Ha Hoang Long' , '2' , '2' ,'2021-03-08'),
('Email4@gmail.com' , 'duyduc' ,'Nguyen Duy Duc' , '3' , '4' ,'2021-03-04'),
('Email5@gmail.com' , 'nguyenhoa' ,'Nguyen Thi Hoa' , '4' , '4' ,'2022-03-02'),
('Email6@gmail.com' , 'thiuyen' ,'Nguyen Thi Uyen' , '6' , '3' ,'2021-04-14'),
('Email7@gmail.com' , 'thanhcong' ,'Pham Thanh Cong' , '2' , '2' ,'2021-06-24'),
('Email8@gmail.com' , 'viethoang' ,'Le Viet Hoang' , '8' , '1' ,'2021-04-21'),
('Email9@gmail.com' , 'thutrang' ,'Nguyen Thu Trang' , '2' , '2' ,'2021-04-22'),
('Email10@gmail.com', 'ngoclinh' ,'Phan Ngoc Linh' , '10' , '1' ,'2021-04-30'),
('Email11@gmail.com', 'thuha' ,'Nguyen Thu Ha' , '10' , '1' ,'2021-01-30'),
('Email12@gmail.com', 'caothanh' ,'Cao Trung Thanh' , '10' , '1' ,'2021-08-30');
INSERT INTO `Group` ( GroupName , CreatorID , CreateDate )
VALUES (N'Testing System' , 5 ,'2019-03-05'),
(N'Development' , 1 ,'2020-03-07'),
(N'VTI Sale 01' , 2 ,'2020-03-09'),
(N'VTI Sale 02' , 3 ,'2020-03-10'),
(N'VTI Sale 03' , 4 ,'2020-03-28'),
(N'VTI Creator' , 6 ,'2020-04-06'),
(N'VTI Marketing 01', 7 ,'2020-04-07'),
(N'Management' , 8 ,'2020-04-08'),
(N'Chat with love' , 9 ,'2020-04-09'),
(N'Vi Ti Ai' , 10 ,'2020-04-10');
INSERT INTO `GroupAccount` ( GroupID , AccountID , JoinDate )
VALUES ( 1 , 1 ,'2019-03-05'),
( 1 , 2 ,'2020-03-07'),
( 3 , 3 ,'2020-03-09'),
( 3 , 4 ,'2020-03-10'),
( 5 , 5 ,'2020-03-28'),
( 1 , 3 ,'2020-04-06'),
( 1 , 7 ,'2020-04-07'),
( 8 , 3 ,'2020-04-08'),
( 1 , 9 ,'2020-04-09'),
( 10 , 10 ,'2020-04-10');
INSERT INTO TypeQuestion (TypeName )
VALUES ('Essay' ),
('Multiple-Choice' );
INSERT INTO CategoryQuestion (CategoryName )
VALUES ('Java' ),
('ASP.NET' ),
('ADO.NET' ),
('SQL' ),
('Postman' ),
('Ruby' ),
('Python' ),
('C++' ),
('C Sharp' ),
('PHP' );
INSERT INTO Question(Content , CategoryID, TypeID , CreatorID , CreateDate )
VALUES (N'Câu hỏi về Java' , 1 , '1' , '2' ,'2020-04-05'),
(N'Câu Hỏi về PHP' , 10 , '2' , '2' ,'2020-04-05'),
(N'Hỏi về C#' , 9 , '2' , '3' ,'2020-04-06'),
(N'Hỏi về Ruby' , 6 , '1' , '4' ,'2020-04-06'),
(N'Hỏi về Postman' , 5 , '1' , '5' ,'2020-04-06'),
(N'Hỏi về ADO.NET' , 3 , '2' , '6' ,'2020-04-06'),
(N'Hỏi về ASP.NET' , 2 , '1' , '7' ,'2020-04-06'),
(N'Hỏi về C++' , 8 , '1' , '8' ,'2020-04-07'),
(N'Hỏi về SQL' , 4 , '2' , '9' ,'2020-04-07'),
(N'alo Python' , 7 , '1' , '10' ,'2020-04-07');
INSERT INTO Answer ( Content , QuestionID , isCorrect )
VALUES (N'Trả lời 01' , 1 , 0 ),
(N'Trả lời 02' , 1 , 1 ),
(N'Trả lời 03' , 1 , 0 ),
(N'Trả lời 04' , 1 , 1 ),
(N'Trả lời 05' , 2 , 1 ),
(N'Trả lời 06' , 3 , 1 ),
(N'Trả lời 07' , 4 , 0 ),
(N'Trả lời 08' , 8 , 0 ),
(N'Trả lời 09' , 9 , 1 ),
(N'Trả lời 10' , 10 , 1 );
INSERT INTO Exam (`Code` , Title , CategoryID , Duration , CreatorID , CreateDate )
VALUES ('VTIQ001' , N'Đề thi C#' , 1 , 30 , '5' ,'2019-04-05'),
('VTIQ002' , N'Đề thi PHP' ,10 , 60 , '2' ,'2019-04-05'),
('VTIQ003' , N'Đề thi C++' , 9 ,120 , '2' ,'2019-04-07'),
('VTIQ004' , N'Đề thi Java' , 6 , 60 , '3' ,'2020-04-08'),
('VTIQ005' , N'Đề thi Ruby' , 5 , 120 , '4' ,'2020-04-10'),
('VTIQ006' , N'Đề thi Postman' , 3 ,60 , '6' ,'2020-04-05'),
('VTIQ007' , N'Đề thi SQL' , 2 ,60 , '7' ,'2020-04-05'),
('VTIQ008' , N'Đề thi Python' , 8 ,60 , '8' ,'2020-04-07'),
('VTIQ009' , N'Đề thi ADO.NET' , 4 ,90 , '9' ,'2020-04-07'),
('VTIQ010' , N'Đề thi ASP.NET' , 7 ,90 , '10' ,'2020-04-08');
INSERT INTO ExamQuestion(ExamID , QuestionID )
VALUES ( 1 , 5 ),
( 2 , 10 ),
( 3 , 4 ),
( 4 , 3 ),
( 5 , 7 ),
( 6 , 10 ),
( 7 , 2 ),
( 8 , 10 ),
( 9 , 9 ),
( 10 , 8 );
-- E xercise 1: Join
-- Question 1: Viết lệnh để lấy ra danh sách nhân viên và thông tin phòng ban của họ
SELECT *
FROM `Account` a
JOIN Department d ON a.DepartmentID = d.DepartmentID;
-- Question 2: Viết lệnh để lấy ra thông tin các account được tạo sau ngày 20/12/2010
SELECT *
FROM `Account`
WHERE CreateDate > '2010-12-20';
-- Question 3: Viết lệnh để lấy ra tất cả các developer
SELECT AccountID,Username, FullName , PositionName
FROM `Account`a
JOIN Position p ON a.PositionID = p.PositionID
;
-- Question 4: Viết lệnh để lấy ra danh sách các phòng ban có >3 nhân viên
SELECT *, count(a.DepartmentID) AS So_NV
FROM `Account` a
INNER JOIN Department d ON a.DepartmentID = d.DepartmentID
GROUP BY a.DepartmentID
HAVING count(a.DepartmentID) > 3;
-- Question 5: Viết lệnh để lấy ra danh sách câu hỏi được sử dụng trong đề thi nhiều nhất
SELECT q.QuestionID, q.Content, count(q.QuestionID)
FROM Question q
INNER JOIN examquestion e ON q.QuestionID = e.QuestionID
GROUP BY e.QuestionID
HAVING count(e.QuestionID) = ( SELECT max(duyanh) FROM (SELECT count(QuestionID) AS duyanh
FROM examquestion
GROUP BY QuestionID ) AS DA)
;
-- Question 6: Thông kê mỗi category Question được sử dụng trong bao nhiêu Question
SELECT count(QuestionID), cq.CategoryName, q.CategoryID
FROM categoryquestion cq
INNER JOIN question q ON cq.CategoryID = q.CategoryID
GROUP BY q.QuestionID
HAVING count(q.QuestionID);
-- Question 7: Thông kê mỗi Question được sử dụng trong bao nhiêu Exam
SELECT q.QuestionID, q.Content , count(eq.QuestionID) AS question_of_exam
FROM Question q
JOIN examquestion eq ON q.QuestionID = eq.QuestionID
GROUP BY eq.QuestionID
HAVING count(eq.QuestionID)
;
-- Question 8: Lấy ra Question có nhiều câu trả lời nhất-
SELECT q.QuestionID, q.Content, a.Content, count(a.Content) AS ANSWER_MAX
FROM Question q
JOIN answer a ON q.QuestionID = a.QuestionID
GROUP BY a.QuestionID
HAVING count(a.QuestionID)
LIMIT 1
;
-- Question 9: Thống kê số lượng account trong mỗi group
SELECT a.AccountID , a.FullName, ga.GroupID, count(a.AccountID) AS account_of_group
FROM `Account` a
JOIN groupaccount ga ON a.AccountID = ga.AccountID
GROUP BY a.AccountID
;
-- Question 10: Tìm chức vụ có ít người nhất
SELECT a.PositionID, p.PositionName, count(a.PositionID) AS position_min_account
FROM position p
JOIN `Account` a ON p.PositionID = a.PositionID
GROUP BY a.PositionID
ORDER BY PositionID DESC
LIMIT 1;
-- Question 11: Thống kê mỗi phòng ban có bao nhiêu dev, test, scrum master, PM
SELECT a.PositionID, p.PositionName, a.AccountID, a.FullName, count(d.DepartmentID ) AS So_luong
FROM `Account` a
JOIN position p ON p.PositionID = a.PositionID
JOIN department d ON a.DepartmentID = d.DepartmentID
GROUP BY p.PositionName
;
-- Question 12: Lấy thông tin chi tiết của câu hỏi bao gồm: thông tin cơ bản của question, loại câu hỏi, ai là người tạo ra câu hỏi, câu trả lời là gì, …
SELECT q.QuestionID, tq.TypeName , a.Content, ac.FullName AS nguoi_tao
-- , q.CreatorID
FROM Question q
JOIN typequestion tq ON q.TypeID = tq.TypeID
JOIN Answer a ON q.QuestionID = a.QuestionID
JOIN `Account` ac ON q.CreatorID = ac.AccountID
;
-- Question 13: Lấy ra số lượng câu hỏi của mỗi loại tự luận hay trắc nghiệm
SELECT q.QuestionID, t.TypeName , count(t.TypeName) AS so_luong
FROM typequestion t
JOIN Question q ON t.TypeID = q.TypeID
GROUP BY t.TypeName
;
-- Question 14:Lấy ra group không có account nào
SELECT *
FROM `Group` g
LEFT JOIN groupaccount ga ON g.GroupID = ga.GroupID
WHERE ga.GroupID IS NULL;
-- Question 15: Lấy ra group không có account nào-
-- Question 16: Lấy ra question không có answer nào
SELECT *
FROM Question q
LEFT JOIN answer a ON q.QuestionID = a.QuestionID
WHERE a.QuestionID IS NULL;
-- Exercise 2: Union
/* 1Question 17:
a) Lấy các account thuộc nhóm thứ 1
b) Lấy các account thuộc nhóm thứ 2
c) Ghép 2 kết quả từ câu a) và câu b) sao cho không có record nào trùng nhau
*/
SELECT *
FROM `Account` a
JOIN Position p ON a.PositionID = p.PositionID
WHERE p.PositionID = 1
UNION
SELECT *
FROM `Account` a
JOIN Position p ON a.PositionID = p.PositionID
WHERE p.PositionID = 2
;
/*
Question 18:
a) Lấy các group có lớn hơn 5 thành viên
b) Lấy các group có nhỏ hơn 7 thành viên
c) Ghép 2 kết quả từ câu a) và câu b)
*/
SELECT *, count(ga.GroupID) AS so_luong
FROM `Group` g
JOIN groupaccount ga ON g.GroupID = ga.GroupID
GROUP BY ga.GroupID
HAVING count(ga.GroupID) > 2
UNION
SELECT *, count(ga.GroupID) AS so_luong
FROM `Group` g
JOIN groupaccount ga ON g.GroupID = ga.GroupID
GROUP BY g.GroupID
HAVING count(ga.GroupID) < 7;
| true
|
40248894f5b604213880733b242199885758691d
|
SQL
|
tulu1688/UdemyStuffs
|
/SQL-Traning/sample_store_procedure_insertdb_2.sql
|
UTF-8
| 1,960
| 3.640625
| 4
|
[] |
no_license
|
USE payment;
DROP PROCEDURE `add_tr_order`;
CALL `payment`.`add_tr_order`(100);
select count(*) from payment.tr_order;
truncate payment.tr_order;
--------------------------------------
-- Create procedure
--------------------------------------
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `add_tr_order`(in num int)
BEGIN
declare i int default 1;
while i <= num do
INSERT INTO `payment`.`tr_order`
(
`order_id`,
`ext_transaction_id`,
`payment_method_name`,
`payment_method_ref`,
`service_id`,
`service_name`,
`command_id`,
`command_name`,
`service_command_id`,
`initiator_user_id`,
`initiator_user_type`,
`initiator_sof_id`,
`initiator_sof_type_id`,
`payer_user_id`,
`payer_user_type`,
`payer_user_ref_type`,
`payer_user_ref_value`,
`payer_sof_id`,
`payer_sof_type_id`,
`payee_user_id`,
`payee_user_type`,
`payee_user_ref_type`,
`payee_user_ref_value`,
`payee_sof_id`,
`payee_sof_type_id`,
`currency`,
`ref_order_id`,
`amount`,
`fee`,
`bonus`,
`settlement_amount`,
`product_name`,
`product_ref1`,
`product_ref2`,
`product_ref3`,
`product_ref4`,
`product_ref5`,
`state`,
`status`,
`notification_status`,
`is_deleted`,
`created_timestamp`,
`last_updated_timestamp`
)
VALUES
(
i,
i,
'payment_method_name',
'payment_method_ref',
i,
'service_name',
i,
'command_name',
i,
i,
'initiator_user_type',
i,
i,
i,
'payer_user_type',
'payer_user_ref_type',
'payer_user_ref_value',
i,
i,
i,
'payee_user_type',
'payee_user_ref_type',
'payee_user_ref_value',
i,
i,
'CUR',
'ref_order_id',
i,
i,
i,
i,
'product_name',
'product_ref1',
'product_ref2',
'product_ref3',
'product_ref4',
'product_ref5',
'state',
1,
1,
1,
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
);
set i = i + 1;
end while;
END
//
DELIMITER ;
| true
|
0b6d12b990e7d40164e4ff69b1848e57a87e5183
|
SQL
|
forteleaf/gym
|
/.svn/pristine/0b/0b6d12b990e7d40164e4ff69b1848e57a87e5183.svn-base
|
UTF-8
| 196
| 2.625
| 3
|
[] |
no_license
|
create table ifboard
(
ifnum number(6) primary key,
id varchar2(30) references users(id),
title varchar2(50),
content clob,
hit number(10),
regdate date
);
CREATE SEQUENCE if_seq;
| true
|
dedc58b7bd1f1acfce29082c3b819a12dc842b27
|
SQL
|
villdimova/SoftUni-MicrosoftSQLServer
|
/IndicesAndDataAggregation/18. Third Highest Salary.sql
|
UTF-8
| 208
| 3.921875
| 4
|
[
"MIT"
] |
permissive
|
SELECT DISTINCT hs.DepartmentID,
hs.Salary
FROM
(SELECT DepartmentID,
Salary,
DENSE_RANK() OVER (PARTITION BY DepartmentID ORDER BY Salary DESC) AS Ranked
FROM Employees)AS hs
WHERE Ranked=3
| true
|
0b2ff2cdbe5f12d48ccdb8b1b2817d0f05c29f80
|
SQL
|
sprokushev/Delphi
|
/MASTER/_DATABASE/Constraints/KLS_USL_OPL_NonFK.sql
|
UTF-8
| 379
| 3.234375
| 3
|
[] |
no_license
|
--
-- Non Foreign Key Constraints for Table KLS_USL_OPL
--
ALTER TABLE MASTER.KLS_USL_OPL ADD (
CHECK ("NAME" IS NOT NULL)
DISABLE NOVALIDATE);
ALTER TABLE MASTER.KLS_USL_OPL ADD (
CHECK ("KOL_DN" IS NOT NULL)
DISABLE NOVALIDATE);
ALTER TABLE MASTER.KLS_USL_OPL ADD (
CONSTRAINT USL_OPL_PK
PRIMARY KEY
(ID)
USING INDEX MASTER.USL_OPL_PK
ENABLE VALIDATE);
| true
|
36d8564e0e4df405e2347e1f6bae2de09bda1ce6
|
SQL
|
borjabrisson/WxAF
|
/docs/user/contactos.sql
|
UTF-8
| 1,854
| 3.609375
| 4
|
[] |
no_license
|
-- /*SuperType*/
select "Contacts BD" as step;
Create Table SuperType (
ID integer unsigned auto_increment primary key
) engine InnoDB, default character set utf8;
Create Table Company(
ID integer unsigned auto_increment,
name varchar(50),
address varchar (35),
email varchar(20),
CIF varchar(10),
web varchar(12),
contact varchar(15),
Constraint PK_Company Primary key (ID),
foreign key (ID) references SuperType(ID) On Delete Cascade On Update Cascade
) engine InnoDB, default character set utf8;
-- /*Abogado*/
Create Table Lawyers(
ID integer unsigned,
lawyerNumber integer unsigned,
name varchar(30),
surnames varchar(40),
address varchar (35),
email varchar(30),
Constraint Unique_Lawyer_Number unique(lawyerNumber),
-- Atención!!: Hay que revisar que el null no de problemas con el unique: DONE: El null como tal no influye, pero si el "".
Constraint PK_lawyer Primary key (ID),
foreign key (ID) references SuperType(ID) On Delete Cascade On Update Cascade
) engine InnoDB, default character set utf8;
-- /*Procurador*/
Create Table Attorneys(
ID integer unsigned,
attorneyNumber integer unsigned,
name varchar(30),
surnames varchar(40),
address varchar (35),
email varchar(30),
Constraint Unique_Attorney_Number unique (attorneyNumber),
Constraint PK_attorney Primary key (ID),
foreign key (ID) references SuperType(ID) On Delete Cascade On Update Cascade
) engine InnoDB, default character set utf8;
-- /*CLiente*/
Create Table Clients (
ID integer unsigned,
DNI char(9) ,
name varchar(30),
surnames varchar(40),
address varchar (35),
email varchar(30),
Constraint Unique_DNI unique(DNI),
Constraint PK_Clients Primary key (ID),
foreign key (ID) references SuperType(ID) On Delete Cascade On Update Cascade
) engine InnoDB, default character set utf8;
-- -- Tablas relacionales (Relaciones multiples)
| true
|
5962d66d90c37ce75cc39cd6d1adb7915a45a366
|
SQL
|
albertomattos/SQL_gerais
|
/Custo médio.sql
|
UTF-8
| 166
| 2.765625
| 3
|
[] |
no_license
|
select t.tipo_prd, t.codigo, t.descricao, t.custo_med from faprdcad t where t.tipo_prd in
(select tipo_prd from fatipcad where pre_class = 'MAT' and faturavel = 'S')
| true
|
ea93b8e7be0cf39b4fc41d0499cb29bd7097e7d5
|
SQL
|
ArielJiang0520/Smart_Walking_Advisor
|
/data builder/sql/schema.sql
|
UTF-8
| 779
| 3.53125
| 4
|
[] |
no_license
|
USE `cs125`;
Create TABLE IF NOT EXISTS `User`(
`uid` VARCHAR(2),
PRIMARY KEY (`uid`)
);
Create TABLE IF NOT exists `Location History`(
`uid` VARCHAR(2),
`start_time` DATETIME,
`end_time` DATETIME NOT NULL,
`location` VARCHAR(100) NOT NULL,
PRIMARY KEY (`uid`,`start_time`),
FOREIGN KEY(`uid`) REFERENCES User(`uid`) ON DELETE CASCADE
);
Create TABLE IF NOT exists `Calendar`(
`uid` VARCHAR(2),
`start_time` DATETIME,
`end_time` DATETIME NOT NULL,
`location` VARCHAR(100),
PRIMARY KEY (`uid`,`start_time`),
FOREIGN KEY(`uid`) REFERENCES User(`uid`) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `Location Index`(
`location_name` VARCHAR(100),
`lat` INT NOT NULL,
`long` INT NOT NULL,
PRIMARY KEY (`location_name`)
);
| true
|
cf505d12fe4b9966c0aa872c31e3b2e9dade42c6
|
SQL
|
sanduDisala/Information-Technology-Project
|
/Final ITP Integrated/Final ITP/Main/Modules/Inventory/SQL Scripts/Just_For_Testing_Part_2.sql
|
UTF-8
| 3,126
| 3.09375
| 3
|
[] |
no_license
|
select * from tbl_user
select * from tbl_orders
select * from tbl_stocks
select * from tbl_ordered_Item_details
select * from tbl_inventory --not needed
select * from tbl_suppliers
select * from tbl_supplier_brands
select * from tbl_items
select * from tbl_warehouse_activities
select * from Vehicle_Request_Details
select * from vehicle_details
INSERT INTO Vehicle_Request_Details VALUES(1,'Lorry',12345,'2017-01-01','09:00:00','Colombo','Malabe')
INSERT INTO Vehicle_Request_Details VALUES(2,'Container',12346,'2017-01-02','09:00:00','Jaffna','Malabe')
INSERT INTO Vehicle_Request_Details VALUES(3,'Tipper',12347,'2017-01-03','09:00:00','Malabe','Jafna')
INSERT INTO Vehicle_Request_Details VALUES(4,'Truck',12348,'2017-01-04','09:00:00','Jaffna','Colombo')
INSERT INTO Vehicle_Request_Details VALUES(5,'Lorry',12349,'2017-01-05','09:00:00','Colombo','Malabe')
INSERT INTO tbl_warehouse_activities VALUES('asssd',1,'Stock','In','date')
insert into tbl_ordered_Item_details values('ORL1','PIS003',440,30800)
INSERT INTO tbl_user VALUES('C0001','Kumara.H','123456','Inventory Manager')
DROP TABLE tbl_warehouse_activities
DROP TABLE Vehicle_Request_Details
insert into tbl_suppliers values('S0001','Sinhagiri')
insert into tbl_suppliers values('S0002','Singer')
insert into tbl_supplier_brands values('S0001','Panasonic')
insert into tbl_supplier_brands values('S0001','Samsung')
insert into tbl_supplier_brands values('S0002','LG')
insert into tbl_supplier_brands values('S0002','Lenovo')
insert into tbl_items(Supplier_ID,Model,Brand,Unit_Price,Category,Type) values ('S0001','ABCX','Panasonic',50,'Indoor Equipment','Screen')
insert into tbl_items(Supplier_ID,Model,Brand,Unit_Price,Category,Type) values ('S0001','ABCC','Panasonic',50,'Indoor Equipment','Screen')
insert into tbl_items(Supplier_ID,Model,Brand,Unit_Price,Category,Type) values ('S0002','BCDX','Lenovo',60,'Outdoor Screens','Screen')
insert into tbl_items(Supplier_ID,Model,Brand,Unit_Price,Category,Type) values ('S0002','CDFA','LG',70,'Indoor Screens','Screen')
insert into tbl_items(Supplier_ID,Model,Brand,Unit_Price,Category,Type) values ('S0001','BABG','Samsung',80,'Indoor Screens','Screen')
insert into vehicle_details VALUES(1,12345,'Lorry','Batta','Demo',2,'Diesel')
insert into vehicle_details VALUES(2,12346,'Container','Renault','Renault',2,'Diesel')
insert into vehicle_details VALUES(3,12347,'Tipper','Mitsubishi','Mitsubhishi',2,'Diesel')
insert into vehicle_details VALUES(4,12348,'Truck','Hyundai','Hyundai',2,'Diesel')
insert into vehicle_details VALUES(5,12349,'Lorry','Toyota','Toyota',2,'Diesel')
SELECT * FROM vehicle_details
SELECT * FROM tbl_warehouse_activities
SELECT * FROM Vehicle_Details
SELECT * FROM Vehicle_Request_Details
insert into Vehicle_Request_Details VALUES(1,'Lorry',12345,'2017-01-01','18:0:00','Colombo','Malabe')
SELECT Stock_ID FROM tbl_stocks
UPDATE tbl_orders SET Full_Arrived = 1 WHERE Order_ID = 'ORLB1'
UPDATE tbl_orders SET Full_Arrived = 1 WHERE Order_ID = 'ORLC1'
UPDATE tbl_orders SET Full_Arrived = 1 WHERE Order_ID = 'ORPA1'
UPDATE tbl_orders SET Full_Arrived = 1 WHERE Order_ID = 'ORSB1'
| true
|
4a266eb3aaa04b8bc1d8cc85e042255e31113a6d
|
SQL
|
seallred/ibmSrDbXsr
|
/sqlXsr/viewPmrRetryReport.sql
|
UTF-8
| 770
| 3.21875
| 3
|
[] |
no_license
|
-- PmrRetryMonitor
-- Watch for issues with the retry process.
-- Retry runs on v30015, so it's best to run the sql and point XAT to p3
select pr.create_datetime, pr.src_node, pr.create_user, prri.submit_type, pr.entitled, pr.src_tran_id,
pr.pmr_num, pr.branch, pr.retain_cntry_code, ic.description, rcc.retain_node, pr.retry_cnt,
pr.stage, prri.queue, prri.center, prri.severity
from xsr.pmr_retry pr
inner join xsr.pmr_retry_retain_info prri on pr.src_tran_id=prri.src_tran_id
inner join xsr.retain_cntry_code rcc on pr.retain_cntry_code=rcc.retain_cntry_code
left outer join cam.iso_cntry ic on pr.retain_cntry_code=ic.retain_cntry_code
where ic.description not in ('Jersey', 'Guernsey') or ic.description is null
order by pr.create_datetime desc
with ur;
| true
|
cd479bf9daec0a8242ac41ae787639fa34084454
|
SQL
|
rashedcs/LAB
|
/DBMS/Lab 2/query 1.sql
|
UTF-8
| 152
| 3.15625
| 3
|
[] |
no_license
|
--Find the customers of the bank who have an account but not a loan
(select customer_name
from depositor)
except
(select customer_name
from borrower);
| true
|
408f0dd04eafd108f38a2d7fb97144892e632f7b
|
SQL
|
anderson755/anderson755
|
/id17320712_zoologico.sql
|
UTF-8
| 10,133
| 3.078125
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 27-07-2021 a las 22:44:40
-- Versión del servidor: 10.3.16-MariaDB
-- Versión de PHP: 7.3.23
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: `id17320712_zoologico`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Cuidadores`
--
CREATE TABLE `Cuidadores` (
`idCuidadores` int(11) NOT NULL,
`nombre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`dirección` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`telefono` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`fecha_ingreso_parque` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`fechacuidadorespecies` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`cuidadorespecies` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`sexo_cuidador` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `especies`
--
CREATE TABLE `especies` (
`idespecies` int(11) NOT NULL,
`nombre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`nombre_cientifico` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`descripcion_general` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`habitat_natural` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`Cuidadores_idCuidadores` int(11) NOT NULL,
`sexo_especie` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `especies_has_Hábitats`
--
CREATE TABLE `especies_has_Hábitats` (
`especies_idespecies` int(11) NOT NULL,
`Hábitats_idHábitats` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `especies_has_zona`
--
CREATE TABLE `especies_has_zona` (
`especies_idespecies` int(11) NOT NULL,
`zona_idzona` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Guías`
--
CREATE TABLE `Guías` (
`idGuías` int(11) NOT NULL,
`nombre` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`dirrecion` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`telefono` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`fecha_inicio_trabajo` date NOT NULL,
`guias_itinerarios` date NOT NULL,
`guia_hora_asignado_itinerario` date NOT NULL,
`sexo_guia` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Guías_has_Itinerarios`
--
CREATE TABLE `Guías_has_Itinerarios` (
`Guías_idGuías` int(11) NOT NULL,
`Itinerarios_idItinerarios` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Hábitats`
--
CREATE TABLE `Hábitats` (
`idHábitats` int(11) NOT NULL,
`nombre_habitat` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`clima` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`vegetacion` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`predominantes` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`continentes` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Hábitats_has_especies`
--
CREATE TABLE `Hábitats_has_especies` (
`Hábitats_idHábitats` int(11) NOT NULL,
`especies_idespecies` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Itinerarios`
--
CREATE TABLE `Itinerarios` (
`idItinerarios` int(11) NOT NULL,
`codigode_Itinerario` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`duración _recorrido` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`longitud_itinerario` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`maxvicitante` int(11) NOT NULL,
`numvicitaespecies` int(11) NOT NULL,
`recorrido_de_zonas_del_parque` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`zonarecorrida` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `zona`
--
CREATE TABLE `zona` (
`idzona` int(11) NOT NULL,
`nombre_zona` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`extencion_ocupa` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`el_zoologico` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `zona_has_Itinerarios`
--
CREATE TABLE `zona_has_Itinerarios` (
`zona_idzona` int(11) NOT NULL,
`Itinerarios_idItinerarios` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `Cuidadores`
--
ALTER TABLE `Cuidadores`
ADD PRIMARY KEY (`idCuidadores`);
--
-- Indices de la tabla `especies`
--
ALTER TABLE `especies`
ADD PRIMARY KEY (`idespecies`),
ADD KEY `fk_especies_Cuidadores1` (`Cuidadores_idCuidadores`);
--
-- Indices de la tabla `especies_has_Hábitats`
--
ALTER TABLE `especies_has_Hábitats`
ADD PRIMARY KEY (`especies_idespecies`,`Hábitats_idHábitats`),
ADD KEY `fk_especies_has_Hábitats_Hábitats1` (`Hábitats_idHábitats`);
--
-- Indices de la tabla `especies_has_zona`
--
ALTER TABLE `especies_has_zona`
ADD PRIMARY KEY (`especies_idespecies`,`zona_idzona`),
ADD KEY `fk_especies_has_zona_zona1` (`zona_idzona`);
--
-- Indices de la tabla `Guías`
--
ALTER TABLE `Guías`
ADD PRIMARY KEY (`idGuías`);
--
-- Indices de la tabla `Guías_has_Itinerarios`
--
ALTER TABLE `Guías_has_Itinerarios`
ADD PRIMARY KEY (`Guías_idGuías`,`Itinerarios_idItinerarios`),
ADD KEY `fk_Guías_has_Itinerarios_Itinerarios1` (`Itinerarios_idItinerarios`);
--
-- Indices de la tabla `Hábitats`
--
ALTER TABLE `Hábitats`
ADD PRIMARY KEY (`idHábitats`);
--
-- Indices de la tabla `Hábitats_has_especies`
--
ALTER TABLE `Hábitats_has_especies`
ADD PRIMARY KEY (`Hábitats_idHábitats`,`especies_idespecies`),
ADD KEY `fk_Hábitats_has_especies_especies1` (`especies_idespecies`);
--
-- Indices de la tabla `Itinerarios`
--
ALTER TABLE `Itinerarios`
ADD PRIMARY KEY (`idItinerarios`);
--
-- Indices de la tabla `zona`
--
ALTER TABLE `zona`
ADD PRIMARY KEY (`idzona`);
--
-- Indices de la tabla `zona_has_Itinerarios`
--
ALTER TABLE `zona_has_Itinerarios`
ADD PRIMARY KEY (`zona_idzona`,`Itinerarios_idItinerarios`),
ADD KEY `fk_zona_has_Itinerarios_Itinerarios1` (`Itinerarios_idItinerarios`);
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `especies`
--
ALTER TABLE `especies`
ADD CONSTRAINT `fk_especies_Cuidadores1` FOREIGN KEY (`Cuidadores_idCuidadores`) REFERENCES `Cuidadores` (`idCuidadores`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `especies_has_Hábitats`
--
ALTER TABLE `especies_has_Hábitats`
ADD CONSTRAINT `fk_especies_has_Hábitats_Hábitats1` FOREIGN KEY (`Hábitats_idHábitats`) REFERENCES `Hábitats` (`idHábitats`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_especies_has_Hábitats_especies1` FOREIGN KEY (`especies_idespecies`) REFERENCES `especies` (`idespecies`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `especies_has_zona`
--
ALTER TABLE `especies_has_zona`
ADD CONSTRAINT `fk_especies_has_zona_especies` FOREIGN KEY (`especies_idespecies`) REFERENCES `especies` (`idespecies`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_especies_has_zona_zona1` FOREIGN KEY (`zona_idzona`) REFERENCES `zona` (`idzona`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `Guías_has_Itinerarios`
--
ALTER TABLE `Guías_has_Itinerarios`
ADD CONSTRAINT `fk_Guías_has_Itinerarios_Guías1` FOREIGN KEY (`Guías_idGuías`) REFERENCES `Guías` (`idGuías`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_Guías_has_Itinerarios_Itinerarios1` FOREIGN KEY (`Itinerarios_idItinerarios`) REFERENCES `Itinerarios` (`idItinerarios`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `Hábitats_has_especies`
--
ALTER TABLE `Hábitats_has_especies`
ADD CONSTRAINT `fk_Hábitats_has_especies_Hábitats1` FOREIGN KEY (`Hábitats_idHábitats`) REFERENCES `Hábitats` (`idHábitats`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_Hábitats_has_especies_especies1` FOREIGN KEY (`especies_idespecies`) REFERENCES `especies` (`idespecies`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `zona_has_Itinerarios`
--
ALTER TABLE `zona_has_Itinerarios`
ADD CONSTRAINT `fk_zona_has_Itinerarios_Itinerarios1` FOREIGN KEY (`Itinerarios_idItinerarios`) REFERENCES `Itinerarios` (`idItinerarios`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_zona_has_Itinerarios_zona1` FOREIGN KEY (`zona_idzona`) REFERENCES `zona` (`idzona`) ON DELETE NO ACTION ON UPDATE NO ACTION;
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 */;
| true
|
74b24c01b4083f6669212abd61e47d57c29911d3
|
SQL
|
thongnbui/MIDS2016
|
/205/exercise_1/investigations/best_states/best_states.sql
|
UTF-8
| 208
| 3.140625
| 3
|
[] |
no_license
|
drop table best_state;
create table best_state as
select state, sum(score) total_score, avg(score) avg_score
from hospital_score h
group by state
order by avg_score desc
limit 10;
select * from best_state;
| true
|
6af347c2132ef2703719f68208908398cfc36fb5
|
SQL
|
ontop/ontop-examples
|
/iswc-2018-optional/sql/bsbm1M/Q10.sql
|
UTF-8
| 2,202
| 3.8125
| 4
|
[
"Apache-2.0"
] |
permissive
|
SELECT DISTINCT
v0123.product,
COALESCE(lang_en, lang_zh, lang_de, lang_fr) AS lang,
COALESCE(review_en_id, review_zh_id, review_de_id, review_fr_id) AS review_id
FROM
(
SELECT
v012.product AS product,
review_en_id,
lang_en,
review_zh_id,
lang_zh,
review_de_id,
lang_de
FROM
(SELECT
v01.product AS product,
review_en_id,
lang_en,
review_zh_id,
lang_zh
FROM
(
SELECT
v0.product AS product,
v1.review_en_id AS review_en_id,
v1.language AS lang_en,
v1.text AS review_en
FROM (SELECT review.product
FROM review
WHERE (review.language = 'en' OR review.language = 'zh' OR review.language = 'de' OR review.language = 'fr'
AND product < 1000)
) v0
LEFT JOIN
(SELECT
review.product,
review.nr AS review_en_id,
review.language,
review.text
FROM review
WHERE (review.language = 'en'
AND product < 1000)
) v1
ON v0.product = v1.product
) v01
LEFT JOIN
(SELECT
review.product,
review.nr AS review_zh_id,
review.language AS lang_zh,
review.text AS review_zh
FROM review
WHERE (review.language = 'zh'
AND product < 1000)
) v2
ON v01.product = v2.product) v012
LEFT JOIN
(SELECT
review.product,
review.nr AS review_de_id,
review.language AS lang_de,
review.text AS review_de
FROM review
WHERE (review.language = 'de'
AND product < 1000)) v3
ON (v012.product = v3.product)) v0123
LEFT JOIN
(SELECT
review.product,
review.nr AS review_fr_id,
review.language AS lang_fr,
review.text AS review_fr
FROM review
WHERE (review.language = 'fr'
AND product < 1000)) v4
ON (v0123.product = v4.product);
| true
|
f209ac15baddd193df528943431f79563cec1666
|
SQL
|
Psi-team/SearchFoodBackend
|
/src/main/resources/schema.sql
|
UTF-8
| 5,100
| 3.859375
| 4
|
[] |
no_license
|
/* sudo mysql -u 'user' -p */
/*
CREATE DATABASE IF NOT EXISTS SearchFood;
USE SearchFood;
*/
/* Create the user table */
/* CHAR() 是固定字元存取,VARCHAR()是以實際字元存取,
* VARCHAR()雖然比較省空間,但若要修改可能會被擷取分段擺放
* VARCHAR()也不能有給定太大的空間,雖然是以實際字元數量儲存,但是Query是會以定義的數量來搜尋,因此太大的空間會消耗記憶體空間 */
CREATE TABLE IF NOT EXISTS Users(
userId INT NOT NULL AUTO_INCREMENT,
username VARCHAR(20) NOT NULL,
mail VARCHAR(25) NOT NULL,
passwd CHAR(10) NOT NULL,
sexual INT NOT NULL,
birthyear YEAR NOT NULL,
age TINYINT DEFAULT ( YEAR(CURRENT_DATE) - birthyear ),
PRIMARY KEY( userId ),
UNIQUE KEY mail ( mail ),
UNIQUE KEY username ( username )
);
/* Create the User token */
CREATE TABLE IF NOT EXISTS Token(
mail VARCHAR(25) NOT NULL,
username VARCHAR(20) NOT NULL,
token VARCHAR(80) NOT NULL,
login_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
navigator_type VARCHAR(20) NOT NULL,
PRIMARY KEY( mail, navigator_type ),
FOREIGN KEY( mail ) REFERENCES Users( mail ),
FOREIGN KEY( username ) REFERENCES Users( username )
);
/* Create the Store information */
/* 當設定欄位的編碼時,不能使用NOT NULL語法 */
CREATE TABLE IF NOT EXISTS StoreInfo(
storeid INT NOT NULL AUTO_INCREMENT,
storename VARCHAR(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
city CHAR(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
district CHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
address VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
tel CHAR(10) NOT NULL,
/*created_date DATE NULL DEFAULT (CURRENT_DATE), */ /* 時間格式預設當天日期, CURRENT_DATE一定要用() */
createdAt TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
creator VARCHAR(20) NOT NULL,
click_week INT(3) DEFAULT '0',
click_cum INT(4) DEFAULT '0',
lat_long JSON NOT NULL,
rating FLOAT DEFAULT '0.0',
logo VARCHAR(150) NULL,
images VARCHAR(150) NULL,
slogan VARCHAR(50) NULL,
tags VARCHAR(150) NOT NULL,
PRIMARY KEY( storeId, storename, city, district, address ),
/*UNIQUE KEY store_name ( store_name, city, district, address ), */
UNIQUE KEY city ( city, district, address ),
FOREIGN KEY( creator ) REFERENCES Users( username )
);
/* Create the food table */
CREATE TABLE IF NOT EXISTS ReferedTable(
id INT NOT NULL AUTO_INCREMENT,
value VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
types VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
class VARCHAR(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
PRIMARY KEY( id )
);
/* Create BusinessHours */
CREATE TABLE IF NOT EXISTS BusinessHours(
storeId INT NOT NULL,
mon CHAR(11) NULL,
tue CHAR(11) NULL,
wed CHAR(11) NULL,
thu CHAR(11) NULL,
fri CHAR(11) NULL,
sat CHAR(11) NULL,
sun CHAR(11) NULL,
PRIMARY KEY( storeId ),
FOREIGN KEY( storeId ) REFERENCES StoreInfo( storeId )
);
/* Create the StoreTypes table */
CREATE TABLE IF NOT EXISTS StoresMenu(
storeId INT NOT NULL,
foodId INT NOT NULL,
PRIMARY KEY( storeId, foodId ),
FOREIGN KEY( storeId ) REFERENCES StoreInfo( storeId ),
FOREIGN KEY( foodId ) REFERENCES ReferedTable( id )
);
/* Create the comments of Store */
CREATE TABLE IF NOT EXISTS StoreComment(
storeId INT NOT NULL,
username VARCHAR(20) NOT NULL,
star FLOAT NOT NULL,
price VARCHAR(20) NOT NULL,
commentAt TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
comments TINYTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
picture VARCHAR(150) NULL,
PRIMARY KEY( username, storeId ),
FOREIGN KEY( username ) REFERENCES Users( username ),
FOREIGN KEY( storeId ) REFERENCES StoreInfo( storeId )
/* The use of composite primary key, so you need a composite foreign key. */
/*FOREIGN KEY( store_name, city, district, address ) REFERENCES StoreInfo( store_name, city, district, address ) */
);
/* Records the click time a day to specific storeId */
CREATE TABLE IF NOT EXISTS ClickRecords(
username VARCHAR(20) NOT NULL,
storeId INT NOT NULL,
FOREIGN KEY( username ) REFERENCES Users( username ),
FOREIGN KEY( storeId ) REFERENCES StoreInfo( storeId ),
UNIQUE KEY records ( username, storeId )
);
/* saving the images of stores */
CREATE TABLE IF NOT EXISTS StoreImages(
storeId INT NOT NULL,
picUrl VARCHAR(150) NULL,
FOREIGN KEY( storeId ) REFERENCES StoreInfo( storeId )
);
/* auto delete data when a new day starts */
/* ref: https://noter.tw/2306/mysql%E6%8E%92%E7%A8%8Bevent-scheduler/ Not DELETE EVENTS but DROP EVENTS */
CREATE EVENT AutoCleanDay
ON SCHEDULE EVERY 1 DAY STARTS DATE(CURRENT_TIMESTAMP) + 1
DO
DELETE FROM ClickRecords;
| true
|
b29303a198139bcfb6ae21dff5274a0269cb34a4
|
SQL
|
rumblysam/greatbay
|
/greatbay_DB.sql
|
UTF-8
| 303
| 2.96875
| 3
|
[] |
no_license
|
CREATE DATABASE IF NOT EXISTS greatbay_db;
USE greatbay_db;
CREATE TABLE IF NOT EXISTS auctions(
id integer not null auto_increment,
itemName varchar(50) not null,
category varchar(50) not null,
startingBid integer default 0,
highestbid integer default 0,
primary key (id)
);
| true
|
88e3b6cdc2a27f06fd57ffbdd369711bedff60a4
|
SQL
|
emmanuel-garza/data-sciencie-study
|
/sql/insight-practice-db/medium/medium_p11.sql
|
UTF-8
| 407
| 4.25
| 4
|
[] |
no_license
|
/*
11. Show all Customers who have never placed an order with Employee 4.(16 rows)
*/
/*
Alternate solution: Do a union of 2 queties:
1) Customers who have never placed an order
2) Customers who have placed orders, but have never placed order with 4)
*/
SELECT
*
FROM
customers
WHERE
customers.customerid NOT IN
(SELECT DISTINCT
tmp.customerid
FROM
orders AS tmp
WHERE
tmp.employeeid = 4)
| true
|
29e20beccf4e4f751491f2bafb673d5fca3d0f6e
|
SQL
|
mstig/Bamazon
|
/bamazon_Schema.sql
|
UTF-8
| 737
| 3.53125
| 4
|
[] |
no_license
|
DROP DATABASE IF EXISTS bamazon_db;
CREATE DATABASE bamazon_db;
USE bamazon_db;
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(50) NOT NULL,
department_name VARCHAR(50) NOT NULL,
price DECIMAL(10,2) NOT NULL,
stock_quantity INT(5) NOT NULL,
PRIMARY KEY (item_id)
);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES
("Electric Guitar", "Instruments", 499.99, 15),
("Acoustic Guitar", "Instruments", 399.99, 20),
("Drumset", "Musical Instruments", 599.99, 10),
("iPhone 11", "Technology", 9999.99, 6),
("Desktop PC", "Technology", 799.99, 10),
("Sofa", "Furniture", 450.00, 25),
("Kitchen Table", "Furniture", 315.00, 30);
SELECT * FROM products;
| true
|
1093fe2d8a6bbc9f0d7652df9c2790a1aaa74e69
|
SQL
|
jsbinh/dollar
|
/dollarflowsystem.sql
|
UTF-8
| 2,164
| 2.84375
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 17, 2014 at 06:30 AM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
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: `dollarflowsystem`
--
-- --------------------------------------------------------
--
-- Table structure for table `partner`
--
CREATE TABLE IF NOT EXISTS `partner` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`fullname` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`city` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`country` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`skype` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`facebook` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`sponsor` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `email`, `sponsor`) VALUES
(1, 'admin', 'admin', 'hcbinh@gmail.com', '');
/*!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 */;
| true
|
fc05c185fdc57c37da59035b49305a57bf3e589e
|
SQL
|
hllylyns/kyzmt
|
/db/join_invitees_on_events.sql
|
UTF-8
| 90
| 2.515625
| 3
|
[] |
no_license
|
select *
from users
join invitees
on users.id = invitees.users_id
where events_id = $1;
| true
|
a11b8e24688a84a0fb6a84eb04d4a1ef68e2e901
|
SQL
|
Neotrixsx/Application_Dashboard
|
/SQL(Database)/appdash.main.sql
|
UTF-8
| 4,279
| 3.1875
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 27, 2018 at 05:44 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
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: `appdash`
--
-- --------------------------------------------------------
--
-- Table structure for table `admininfo`
--
CREATE TABLE `admininfo` (
`userid` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(20) NOT NULL,
`link` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admininfo`
--
INSERT INTO `admininfo` (`userid`, `username`, `password`, `link`) VALUES
(1, 'a@a.a', '123', 'dashboard.html');
-- --------------------------------------------------------
--
-- Table structure for table `application_category`
--
CREATE TABLE `application_category` (
`category_id` int(11) NOT NULL,
`category_name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `application_category`
--
INSERT INTO `application_category` (`category_id`, `category_name`) VALUES
(1, 'Art & Design'),
(2, 'Auto & Vehicles'),
(3, 'Beauty'),
(4, 'Books & Reference'),
(5, 'Business'),
(6, 'Comics'),
(7, 'Communication'),
(8, 'Education'),
(9, 'Dating'),
(10, 'Entertainment'),
(11, 'Events'),
(12, 'Finance'),
(13, 'Food & Drink'),
(14, 'Health & Fitness'),
(15, 'House & Home'),
(16, 'Libraries & Demo'),
(17, 'Lifestyle'),
(18, 'Maps & Navigation'),
(19, 'Medical'),
(20, 'Music & Audio'),
(21, 'News & Magazines'),
(22, 'Parenting'),
(23, 'Personalization'),
(24, 'Photography'),
(25, 'Productivity'),
(26, 'Shopping'),
(27, 'Social'),
(28, 'Sports'),
(29, 'Tools'),
(30, 'Travel & Local'),
(31, 'Video Players & Editors'),
(32, 'Weather');
-- --------------------------------------------------------
--
-- Table structure for table `application_type`
--
CREATE TABLE `application_type` (
`application_type_id` int(11) NOT NULL,
`application_type_name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `application_type`
--
INSERT INTO `application_type` (`application_type_id`, `application_type_name`) VALUES
(1, 'Application'),
(2, 'Game');
-- --------------------------------------------------------
--
-- Table structure for table `app_main_detail`
--
CREATE TABLE `app_main_detail` (
`list_id` int(11) NOT NULL,
`app_id` varchar(50) NOT NULL,
`app_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Indexes for table `admininfo`
--
ALTER TABLE `admininfo`
ADD PRIMARY KEY (`userid`) USING BTREE;
--
-- Indexes for table `application_category`
--
ALTER TABLE `application_category`
ADD PRIMARY KEY (`category_id`);
--
-- Indexes for table `application_type`
--
ALTER TABLE `application_type`
ADD PRIMARY KEY (`application_type_id`),
ADD UNIQUE KEY `application_type_id` (`application_type_id`);
--
-- Indexes for table `app_main_detail`
--
ALTER TABLE `app_main_detail`
ADD PRIMARY KEY (`list_id`),
ADD UNIQUE KEY `app_id` (`app_id`);
--
-- AUTO_INCREMENT for table `admininfo`
--
ALTER TABLE `admininfo`
MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `application_category`
--
ALTER TABLE `application_category`
MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `application_type`
--
ALTER TABLE `application_type`
MODIFY `application_type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `app_main_detail`
--
ALTER TABLE `app_main_detail`
MODIFY `list_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
/*!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 */;
| true
|
7c0e675cdc03fb64d58a7de405b49ca658436eff
|
SQL
|
lsytj0413/myinctl
|
/test/user_accounts.sql
|
UTF-8
| 1,695
| 4.15625
| 4
|
[
"MIT"
] |
permissive
|
CREATE TABLE `user_accounts` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'User Name',
`gender` ENUM('UNKNOWN', 'Male', 'Female') DEFAULT 'UNKNOWN' COMMENT 'User Gender',
`gender2` ENUM('Male', 'Female') DEFAULT 'Male',
`email` VARCHAR(20) NOT NULL DEFAULT '' COMMENT 'User Email',
`create_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(`id`) COMMENT 'Primary Key id',
UNIQUE INDEX idx_user_email_name(`email`, `name`) COMMENT 'UNIQUE INDEX email & name'
) ENGINE=InnoDB ROW_FORMAT=Compact DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='User Accounts Information' MAX_ROWS=10 MIN_ROWS=1 /* KEY_BLOCK_SIZE=16 */ /*PARTITION by KEY(`id`) PARTITIONS 10*/;
-- If we use the ROW_FORMAT option, the KEY_BLOCK_SIZE must not be used.
-- And current we only support COMPACT row format.
insert into user_accounts(id, name, gender, gender2, email)
values
(1, "name1", "Male", "Male", "email1"),
(2, "name2", "Male", "Male", "email2"),
(3, "name3", "Female", "Female", "email3");
delimiter $$$
create procedure batch_insert_accounts()
begin
declare i bigint default 0;
declare user_name VARCHAR(32);
declare user_email VARCHAR(20);
set i = 10;
start transaction;
while i < 80000 do
set user_name=CONCAT('name_', i);
set user_email=CONCAT('email_', i);
insert into user_accounts(id, name, gender, gender2, email)
values
(i, user_name, "Male", "Male", user_email);
set i = i+1;
end while;
commit;
end$$$
delimiter ;
call batch_insert_accounts();
drop procedure batch_insert_accounts;
| true
|
d85f880d99b7162cda82cba7e16493585b130c03
|
SQL
|
bosijiazu/dormitory
|
/src/main/webapp/sql/xsgl_zbglqxbm.sql
|
UTF-8
| 757
| 2.71875
| 3
|
[] |
no_license
|
CREATE TABLE XSGL_ZBGLQXBM (
ID int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
XH varchar(64) NOT NULL COMMENT '学号',
BT varchar(40) DEFAULT NULL COMMENT '标题',
QJSY varchar(255) DEFAULT NULL COMMENT '请假事由',
ZBKSSJ datetime DEFAULT NULL COMMENT '值班开始时间',
ZBJSSJ datetime DEFAULT NULL COMMENT '值班结束时间',
ZDRQ datetime DEFAULT NULL COMMENT '制定日期',
ZDR varchar(20) DEFAULT NULL COMMENT '制定人',
SXZT varchar(20) DEFAULT NULL COMMENT '生效状态',
JG varchar(40) DEFAULT NULL COMMENT '机构',
ZBLX varchar(20) DEFAULT NULL COMMENT '值班类型',
GH varchar(64) DEFAULT NULL COMMENT '工号',
PRIMARY KEY (ID)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='值班管理(全校/部门)';
| true
|
f6d2f6d5652c3d639b668a897fb11b6506cc3edd
|
SQL
|
zmajnex/lara-ecommerce-starter-example
|
/database/dump/laracms_db.sql
|
UTF-8
| 19,791
| 3.296875
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Час створення: Вер 16 2016 р., 06:24
-- Версія сервера: 5.6.17-log
-- Версія PHP: 7.0.0
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 */;
--
-- База даних: `laracms_db`
--
-- --------------------------------------------------------
--
-- Структура таблиці `categories`
--
DROP TABLE IF EXISTS `categories`;
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`),
UNIQUE KEY `slug` (`slug`),
KEY `deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `categories`
--
INSERT INTO `categories` (`id`, `title`, `slug`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Товари', 'tovari', '2016-09-04 14:46:34', '2016-09-04 14:46:34', NULL),
(2, 'Авто запчастини', 'avto-zapchastini', '2016-09-04 14:47:17', '2016-09-04 14:47:17', NULL),
(3, 'Проекти для реставрації', 'proekti-dlya-restavratsii', '2016-09-06 15:44:59', '2016-09-06 15:44:59', NULL);
-- --------------------------------------------------------
--
-- Структура таблиці `category_relations`
--
DROP TABLE IF EXISTS `category_relations`;
CREATE TABLE IF NOT EXISTS `category_relations` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`child_category_id` int(10) UNSIGNED NOT NULL,
`parent_category_id` int(10) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `child_category_id_2` (`child_category_id`,`parent_category_id`),
KEY `child_category_id` (`child_category_id`),
KEY `parent_category_id` (`parent_category_id`),
KEY `created_at` (`created_at`),
KEY `updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Структура таблиці `currency_rate`
--
DROP TABLE IF EXISTS `currency_rate`;
CREATE TABLE IF NOT EXISTS `currency_rate` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`usd` double NOT NULL,
`uah` double NOT NULL,
`eur` double NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `created_at` (`created_at`),
KEY `updated_at` (`updated_at`),
KEY `deleted_at` (`deleted_at`),
KEY `usd` (`usd`),
KEY `uah` (`uah`),
KEY `eur` (`eur`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
--
-- Дамп даних таблиці `currency_rate`
--
INSERT INTO `currency_rate` (`id`, `usd`, `uah`, `eur`, `created_at`, `updated_at`, `deleted_at`) VALUES
(2, 26.45, 1, 29.55, '2016-09-05 08:11:50', '2016-09-05 08:11:50', NULL);
-- --------------------------------------------------------
--
-- Структура таблиці `images`
--
DROP TABLE IF EXISTS `images`;
CREATE TABLE IF NOT EXISTS `images` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
`img_600_url` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
`origin_url` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `images`
--
INSERT INTO `images` (`id`, `title`, `img_600_url`, `origin_url`, `created_at`, `updated_at`, `deleted_at`) VALUES
(8, 'My first image', '/images/2016/9/3/photo-1472890293-600.jpg', '/images/2016/9/3/photo-1472890293-hd.jpg', '2016-09-03 05:11:33', '2016-09-03 05:11:33', NULL),
(9, 'Bike', '/images/2016/9/3/photo-1472890642-600.jpg', '/images/2016/9/3/photo-1472890642-hd.jpg', '2016-09-03 05:17:22', '2016-09-03 05:17:22', NULL),
(10, 'pc keyboard', '/images/2016/9/3/photo-1472914017-600.png', '/images/2016/9/3/photo-1472914017-hd.png', '2016-09-03 11:46:58', '2016-09-03 11:46:58', NULL),
(11, '', '/images/2016/9/6/photo-1473184240-600.jpg', '/images/2016/9/6/photo-1473184240-hd.jpg', '2016-09-06 14:50:40', '2016-09-06 14:50:40', NULL),
(12, '', '/images/2016/9/6/photo-1473184244-600.jpg', '/images/2016/9/6/photo-1473184244-hd.jpg', '2016-09-06 14:50:44', '2016-09-06 14:50:44', NULL),
(13, '', '/images/2016/9/6/photo-1473184248-600.jpg', '/images/2016/9/6/photo-1473184248-hd.jpg', '2016-09-06 14:50:48', '2016-09-06 14:50:48', NULL),
(14, '', '/images/2016/9/6/photo-1473184255-600.jpg', '/images/2016/9/6/photo-1473184255-hd.jpg', '2016-09-06 14:50:55', '2016-09-06 14:50:55', NULL),
(15, '', '/images/2016/9/6/photo-1473184259-600.jpg', '/images/2016/9/6/photo-1473184259-hd.jpg', '2016-09-06 14:50:59', '2016-09-06 14:50:59', NULL),
(16, '', '/images/2016/9/9/photo-1473420266-600.jpg', '/images/2016/9/9/photo-1473420266-hd.jpg', '2016-09-09 08:24:27', '2016-09-09 08:24:27', NULL),
(17, '', '/images/2016/9/9/photo-1473420271-600.jpg', '/images/2016/9/9/photo-1473420271-hd.jpg', '2016-09-09 08:24:31', '2016-09-09 08:24:31', NULL),
(18, '', '/images/2016/9/9/photo-1473420275-600.jpg', '/images/2016/9/9/photo-1473420275-hd.jpg', '2016-09-09 08:24:35', '2016-09-09 08:24:35', NULL),
(19, '', '/images/2016/9/9/photo-1473422200-600.jpg', '/images/2016/9/9/photo-1473422200-hd.jpg', '2016-09-09 08:56:40', '2016-09-09 08:56:40', NULL),
(20, '', '/images/2016/9/9/photo-1473422204-600.jpg', '/images/2016/9/9/photo-1473422204-hd.jpg', '2016-09-09 08:56:44', '2016-09-09 08:56:44', NULL),
(21, '', '/images/2016/9/9/photo-1473422208-600.jpg', '/images/2016/9/9/photo-1473422208-hd.jpg', '2016-09-09 08:56:48', '2016-09-09 08:56:48', NULL),
(22, '', '/images/2016/9/9/photo-1473422211-600.jpg', '/images/2016/9/9/photo-1473422211-hd.jpg', '2016-09-09 08:56:52', '2016-09-09 08:56:52', NULL),
(23, '', '/images/2016/9/9/photo-1473422216-600.jpg', '/images/2016/9/9/photo-1473422216-hd.jpg', '2016-09-09 08:56:56', '2016-09-09 08:56:56', NULL);
-- --------------------------------------------------------
--
-- Структура таблиці `migrations`
--
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE IF NOT EXISTS `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `migrations`
--
INSERT INTO `migrations` (`migration`, `batch`) VALUES
('2014_10_12_000000_create_users_table', 1),
('2014_10_12_100000_create_password_resets_table', 1),
('2016_09_01_152308_create_categories_table', 1),
('2016_09_01_152308_create_category_relations_table', 1),
('2016_09_01_152308_create_images_table', 1),
('2016_09_01_152308_create_product_images_table', 1),
('2016_09_01_152308_create_products_table', 1),
('2016_09_01_152310_add_foreign_keys_to_category_relations_table', 1),
('2016_09_01_152310_add_foreign_keys_to_product_images_table', 1),
('2016_09_01_152310_add_foreign_keys_to_products_table', 1),
('2016_09_02_164544_create_categories_table', 2),
('2016_09_02_164544_create_category_relations_table', 2),
('2016_09_02_164544_create_images_table', 2),
('2016_09_02_164544_create_password_resets_table', 2),
('2016_09_02_164544_create_product_images_table', 2),
('2016_09_02_164544_create_products_table', 2),
('2016_09_02_164544_create_users_table', 2),
('2016_09_02_164546_add_foreign_keys_to_category_relations_table', 2),
('2016_09_02_164546_add_foreign_keys_to_product_images_table', 2),
('2016_09_02_164546_add_foreign_keys_to_products_table', 2),
('2016_09_03_082359_create_categories_table', 3),
('2016_09_03_082359_create_category_relations_table', 3),
('2016_09_03_082359_create_images_table', 3),
('2016_09_03_082359_create_password_resets_table', 3),
('2016_09_03_082359_create_product_images_table', 3),
('2016_09_03_082359_create_products_table', 3),
('2016_09_03_082359_create_users_table', 3),
('2016_09_03_082400_add_foreign_keys_to_category_relations_table', 3),
('2016_09_03_082400_add_foreign_keys_to_product_images_table', 3),
('2016_09_03_082400_add_foreign_keys_to_products_table', 3),
('2016_09_03_145643_create_categories_table', 4),
('2016_09_03_145643_create_category_relations_table', 4),
('2016_09_03_145643_create_images_table', 4),
('2016_09_03_145643_create_password_resets_table', 4),
('2016_09_03_145643_create_product_images_table', 4),
('2016_09_03_145643_create_products_table', 4),
('2016_09_03_145643_create_users_table', 4),
('2016_09_03_145644_add_foreign_keys_to_category_relations_table', 4),
('2016_09_03_145644_add_foreign_keys_to_product_images_table', 4),
('2016_09_03_145644_add_foreign_keys_to_products_table', 4),
('2016_09_05_081537_create_categories_table', 5),
('2016_09_05_081537_create_category_relations_table', 5),
('2016_09_05_081537_create_images_table', 5),
('2016_09_05_081537_create_password_resets_table', 5),
('2016_09_05_081537_create_product_images_table', 5),
('2016_09_05_081537_create_products_table', 5),
('2016_09_05_081537_create_users_table', 5),
('2016_09_05_081539_add_foreign_keys_to_category_relations_table', 5),
('2016_09_05_081539_add_foreign_keys_to_product_images_table', 5),
('2016_09_05_081539_add_foreign_keys_to_products_table', 5),
('2016_09_05_084840_create_categories_table', 6),
('2016_09_05_084840_create_category_relations_table', 6),
('2016_09_05_084840_create_images_table', 6),
('2016_09_05_084840_create_password_resets_table', 6),
('2016_09_05_084840_create_product_images_table', 6),
('2016_09_05_084840_create_products_table', 6),
('2016_09_05_084840_create_users_table', 6),
('2016_09_05_084842_add_foreign_keys_to_category_relations_table', 6),
('2016_09_05_084842_add_foreign_keys_to_product_images_table', 6),
('2016_09_05_084842_add_foreign_keys_to_products_table', 6),
('2016_09_06_104628_create_categories_table', 7),
('2016_09_06_104628_create_category_relations_table', 7),
('2016_09_06_104628_create_currency_rate_table', 7),
('2016_09_06_104628_create_images_table', 7),
('2016_09_06_104628_create_password_resets_table', 7),
('2016_09_06_104628_create_product_images_table', 7),
('2016_09_06_104628_create_products_table', 7),
('2016_09_06_104628_create_users_table', 7),
('2016_09_06_104630_add_foreign_keys_to_category_relations_table', 7),
('2016_09_06_104630_add_foreign_keys_to_product_images_table', 7),
('2016_09_06_104630_add_foreign_keys_to_products_table', 7),
('2016_09_16_061256_create_categories_table', 8),
('2016_09_16_061256_create_category_relations_table', 8),
('2016_09_16_061256_create_currency_rate_table', 8),
('2016_09_16_061256_create_images_table', 8),
('2016_09_16_061256_create_password_resets_table', 8),
('2016_09_16_061256_create_product_images_table', 8),
('2016_09_16_061256_create_products_table', 8),
('2016_09_16_061256_create_users_table', 8),
('2016_09_16_061258_add_foreign_keys_to_category_relations_table', 8),
('2016_09_16_061258_add_foreign_keys_to_product_images_table', 8),
('2016_09_16_061258_add_foreign_keys_to_products_table', 8);
-- --------------------------------------------------------
--
-- Структура таблиці `password_resets`
--
DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE IF NOT EXISTS `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`),
KEY `password_resets_token_index` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Структура таблиці `products`
--
DROP TABLE IF EXISTS `products`;
CREATE TABLE IF NOT EXISTS `products` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`category_id` int(10) UNSIGNED NOT NULL,
`title` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
`slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`status` enum('public','archive','private','') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'private',
`price_usd` double DEFAULT NULL,
`price_uah` double DEFAULT NULL,
`price_eur` double DEFAULT NULL,
`selected_currency` enum('usd','uah','eur') COLLATE utf8_unicode_ci DEFAULT NULL,
`condition` enum('new','used') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'used',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `slug` (`slug`),
KEY `category_id` (`category_id`),
KEY `deleted_at` (`deleted_at`),
KEY `status` (`status`),
KEY `price_usd` (`price_usd`),
KEY `price_uah` (`price_uah`),
KEY `price_eur` (`price_eur`),
KEY `selected_currency` (`selected_currency`),
KEY `condition` (`condition`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `products`
--
INSERT INTO `products` (`id`, `category_id`, `title`, `description`, `slug`, `status`, `price_usd`, `price_uah`, `price_eur`, `selected_currency`, `condition`, `created_at`, `updated_at`, `deleted_at`) VALUES
(14, 2, 'Harley Davidson WJ 600cc Sports Engine from 1922', '', 'harley-davidson-wj-600cc-sports-engine-from-1922', 'public', 4189.5085066163, 110812.5, 3750, 'eur', 'used', '2016-09-06 14:46:56', '2016-09-06 14:46:56', NULL),
(17, 2, 'Harley Davidson WJ 600cc Sports Engine from 1923', '', 'harley-davidson-wj-600cc-sports-engine-from-1923', 'public', 4189.5085066163, 110812.5, 3750, 'eur', 'used', '2016-09-06 14:46:56', '2016-09-07 15:01:31', NULL),
(18, 2, ' Lucas/Butlers WD REAR TAIL light', '', 'lucasbutlers-wd-rear-tail-light1473420379', 'public', 167.58034026465, 4432.5, 150, 'eur', 'used', '2016-09-09 08:26:19', '2016-09-09 08:26:19', NULL),
(19, 2, ' Lucas/Butlers WD REAR TAIL light', '', 'lucasbutlers-wd-rear-tail-light', 'public', 167.58034026465, 4432.5, 150, 'eur', 'used', '2016-09-09 08:26:35', '2016-09-09 08:26:45', '2016-09-09 08:26:45'),
(20, 2, 'Puch SV175 petrol tank', '', 'puch-sv175-petrol-tank', 'public', 217.85444234405, 5762.25, 195, 'eur', 'used', '2016-09-09 08:57:38', '2016-09-09 08:57:38', NULL),
(21, 2, 'rrrrrrrrrrrrrrrrrrr', 'rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'rrrrrrrrrrrrrrrrrrr', 'public', 4, 105.8, 3.580372250423, 'usd', 'new', '2016-09-13 07:49:12', '2016-09-16 03:22:29', '2016-09-16 03:22:29');
-- --------------------------------------------------------
--
-- Структура таблиці `product_images`
--
DROP TABLE IF EXISTS `product_images`;
CREATE TABLE IF NOT EXISTS `product_images` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`product_id` int(10) UNSIGNED NOT NULL,
`image_id` int(10) UNSIGNED NOT NULL,
`media_type` enum('App\\Product') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'App\\Product',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_id_2` (`product_id`,`image_id`),
KEY `product_id` (`product_id`),
KEY `image_id` (`image_id`),
KEY `media_type` (`media_type`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `product_images`
--
INSERT INTO `product_images` (`id`, `product_id`, `image_id`, `media_type`, `created_at`, `updated_at`) VALUES
(1, 14, 11, 'App\\Product', '2016-09-06 14:52:08', '2016-09-06 14:52:08'),
(2, 14, 12, 'App\\Product', '2016-09-06 14:52:13', '2016-09-06 14:52:13'),
(3, 14, 13, 'App\\Product', '2016-09-06 14:52:18', '2016-09-06 14:52:18'),
(4, 14, 14, 'App\\Product', '2016-09-06 14:52:23', '2016-09-06 14:52:23'),
(5, 14, 15, 'App\\Product', '2016-09-06 14:52:28', '2016-09-06 14:52:28'),
(6, 17, 9, 'App\\Product', '2016-09-07 14:51:19', '2016-09-07 14:51:19'),
(7, 18, 16, 'App\\Product', '2016-09-09 08:27:23', '2016-09-09 08:27:23'),
(8, 18, 17, 'App\\Product', '2016-09-09 08:27:28', '2016-09-09 08:27:28'),
(9, 18, 18, 'App\\Product', '2016-09-09 08:27:33', '2016-09-09 08:27:33'),
(10, 20, 19, 'App\\Product', '2016-09-09 08:57:57', '2016-09-09 08:57:57'),
(11, 20, 20, 'App\\Product', '2016-09-09 08:58:01', '2016-09-09 08:58:01'),
(12, 20, 21, 'App\\Product', '2016-09-09 08:58:07', '2016-09-09 08:58:07'),
(13, 20, 22, 'App\\Product', '2016-09-09 08:58:12', '2016-09-09 08:58:12'),
(14, 20, 23, 'App\\Product', '2016-09-09 08:58:18', '2016-09-09 08:58:18');
-- --------------------------------------------------------
--
-- Структура таблиці `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`role` enum('default','admin') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
`password` varchar(255) 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,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`),
KEY `role` (`role`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп даних таблиці `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `role`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Yan Datsyuk', 'yanek2357111317232931@gmail.com', 'admin', '$2y$10$mOZfQBljFeHX8Klm7FDNK.TbgtKbsBiLJE6wH2qE9bTZxxl0HZDL6', NULL, '2016-09-13 13:42:41', '2016-09-13 13:42:41');
--
-- Індекси збережених таблиць
--
--
-- Індекси таблиці `products`
--
ALTER TABLE `products` ADD FULLTEXT KEY `title` (`title`);
--
-- Обмеження зовнішнього ключа збережених таблиць
--
--
-- Обмеження зовнішнього ключа таблиці `category_relations`
--
ALTER TABLE `category_relations`
ADD CONSTRAINT `category_relations_ibfk_1` FOREIGN KEY (`child_category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `category_relations_ibfk_2` FOREIGN KEY (`parent_category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Обмеження зовнішнього ключа таблиці `products`
--
ALTER TABLE `products`
ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Обмеження зовнішнього ключа таблиці `product_images`
--
ALTER TABLE `product_images`
ADD CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `product_images_ibfk_2` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`) 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 */;
| true
|
f84f0ecdcb9f2738eac38d073fa3f52bdfa73536
|
SQL
|
Allenjun/learning
|
/learning-boot/learning-boot-security/src/main/resources/db/migration/V1.1__init.sql
|
UTF-8
| 4,389
| 3.59375
| 4
|
[] |
no_license
|
create table sys_user
(
user_id bigint(20) not null auto_increment
comment '用户ID',
dept_id bigint(20) default null
comment '部门ID',
user_name varchar(30) not null
comment '用户账号',
nick_name varchar(30) not null
comment '用户昵称',
user_type varchar(2) default '00'
comment '用户类型(00系统用户)',
email varchar(50) default ''
comment '用户邮箱',
phonenumber varchar(11) default ''
comment '手机号码',
sex char(1) default '0'
comment '用户性别(0男 1女 2未知)',
avatar varchar(100) default ''
comment '头像地址',
password varchar(100) default ''
comment '密码',
status char(1) default '0'
comment '帐号状态(0正常 1停用)',
del_flag char(1) default '0'
comment '删除标志(0代表存在 2代表删除)',
login_ip varchar(50) default ''
comment '最后登陆IP',
login_date datetime comment '最后登陆时间',
create_by varchar(64) default ''
comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default ''
comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default null
comment '备注',
primary key (user_id)
) engine = innodb
auto_increment = 100
comment
= '用户信息表';
create table sys_role
(
role_id bigint(20) not null auto_increment
comment '角色ID',
role_name varchar(30) not null
comment '角色名称',
role_key varchar(100) not null
comment '角色权限字符串',
role_sort int(4) not null
comment '显示顺序',
data_scope char(1) default '1'
comment '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)',
status char(1) not null
comment '角色状态(0正常 1停用)',
del_flag char(1) default '0'
comment '删除标志(0代表存在 2代表删除)',
create_by varchar(64) default ''
comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default ''
comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default null
comment '备注',
primary key (role_id)
) engine = innodb
auto_increment = 100
comment
= '角色信息表';
create table sys_user_role
(
user_id bigint(20) not null
comment '用户ID',
role_id bigint(20) not null
comment '角色ID',
primary key (user_id, role_id)
) engine = innodb
comment
= '用户和角色关联表';
create table sys_menu
(
menu_id bigint(20) not null auto_increment
comment '菜单ID',
menu_name varchar(50) not null
comment '菜单名称',
parent_id bigint(20) default 0
comment '父菜单ID',
order_num int(4) default 0
comment '显示顺序',
path varchar(200) default ''
comment '路由地址',
component varchar(255) default null
comment '组件路径',
is_frame int(1) default 1
comment '是否为外链(0是 1否)',
menu_type char(1) default ''
comment '菜单类型(M目录 C菜单 F按钮)',
visible char(1) default 0
comment '菜单状态(0显示 1隐藏)',
perms varchar(100) default null
comment '权限标识',
icon varchar(100) default '#'
comment '菜单图标',
create_by varchar(64) default ''
comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default ''
comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default ''
comment '备注',
primary key (menu_id)
) engine = innodb
auto_increment = 2000
comment
= '菜单权限表';
create table sys_role_menu
(
role_id bigint(20) not null
comment '角色ID',
menu_id bigint(20) not null
comment '菜单ID',
primary key (role_id, menu_id)
) engine = innodb
comment
= '角色和菜单关联表';
| true
|
18c912dda4262eadb53f5c41df995e5da6a1306b
|
SQL
|
alexanderaboutanos/22.2.15
|
/queries_products.sql
|
UTF-8
| 1,914
| 4
| 4
|
[] |
no_license
|
-- Comments in SQL Start with dash-dash --
-- Add a product to the table with the name of “chair”, price of 44.00, and can_be_returned of false.
INSERT INTO products (name, price, can_be_returned)
VALUES ('chair', 44.00, false);
-- Add a product to the table with the name of “stool”, price of 25.99, and can_be_returned of true.
INSERT INTO products (name, price, can_be_returned)
VALUES ('stool', 25.99, true);
-- Add a product to the table with the name of “table”, price of 124.00, and can_be_returned of false.
INSERT INTO products (name, price, can_be_returned)
VALUES ('table', 124.00, false);
-- Display all of the rows and columns in the table.
SELECT *
FROM products;
-- Display all of the names of the products.
SELECT name
FROM products;
-- Display all of the names and prices of the products.
SELECT name, price
FROM products;
-- Add a new product - make up whatever you would like!
INSERT INTO products (name, price, can_be_returned)
VALUES ('AR15', 1500.00, false);
-- Display only the products that can_be_returned.
SELECT *
FROM products
WHERE can_be_returned;
-- Display only the products that have a price less than 44.00.
SELECT *
FROM products
WHERE price < 44.00;
-- Display only the products that have a price in between 22.50 and 99.99.
SELECT *
FROM products
WHERE price < 44.00 AND price > 22.50;
-- There’s a sale going on: Everything is $20 off! Update the database accordingly.
UPDATE products
SET price = price-20
-- Because of the sale, everything that costs less than $25 has sold out. Remove all products whose price meets this criteria.
DELETE FROM products
WHERE price < 25.00;
-- And now the sale is over. For the remaining products, increase their price by $20.
UPDATE
SET price = price+20
-- There is a new company policy: everything is returnable. Update the database accordingly.
UPDATE products
SET can_be_returned = true ;
| true
|
3a330a4b5ebbd89983d41e3b696ce1a0aeb0e2a0
|
SQL
|
robertocuyar/database-exercises
|
/join_exercises.sql
|
UTF-8
| 1,879
| 4.25
| 4
|
[] |
no_license
|
USE employees;
SELECT d.dept_name AS 'Department Name', CONCAT(e.first_name, ' ', e.last_name) AS 'Department Manager'
FROM employees as e
JOIN dept_manager as dm
ON e.emp_no = dm.emp_no
JOIN departments as d
ON dm.dept_no = d.dept_no
WHERE to_date = '9999-01-01' AND e.gender = 'F'
ORDER BY d.dept_name;
SELECT d.dept_name AS 'Department Name', CONCAT(e.first_name, ' ', e.last_name) AS 'Department Manager'
FROM employees as e
JOIN dept_manager as dm
ON e.emp_no = dm.emp_no
JOIN departments as d
ON dm.dept_no = d.dept_no
WHERE to_date = '9999-01-01'
ORDER BY d.dept_name;
SELECT t.title AS 'Title', COUNT(de.dept_no) AS COUNT
FROM titles AS t
JOIN dept_emp de on t.emp_no = de.emp_no
WHERE t.to_date = '9999-01-01' AND de.dept_no = 'd009'AND de.to_date = '9999-01-01'
GROUP BY (t.title);
SELECT * FROM dept_emp d
JOIN employees e on d.emp_no = e.emp_no
JOIN dept_manager dm on e.emp_no = dm.emp_no
WHERE dm.dept_no = 'd009'
ORDER BY dm.to_date DESC;
SELECT d.dept_name AS 'Department Name', CONCAT(e.first_name, ' ', e.last_name) AS 'Department Manager',
s.salary AS 'Salary'
FROM employees as e
JOIN dept_manager as dm
ON e.emp_no = dm.emp_no
JOIN departments as d
ON dm.dept_no = d.dept_no
JOIN salaries s on dm.emp_no = s.emp_no
WHERE dm.to_date = '9999-01-01' AND s.to_date = '9999-01-01'
ORDER BY d.dept_name;
SELECT CONCAT(e.first_name, ' ', e.last_name) AS 'Employee Name',
de.dept_name AS 'Department Name',
CONCAT(m.first_name, ' ', m.last_name) AS 'Department Manager'
FROM employees as e
JOIN dept_emp AS d
ON e.emp_no = d.emp_no
JOIN departments as de
ON d.dept_no = de.dept_no
JOIN dept_manager dm on de.dept_no = dm.dept_no
JOIN employees m on m.emp_no = dm.emp_no
WHERE d.to_date = '9999-01-01' AND dm.to_date = '9999-01-01';
| true
|
9dc9618a95d149a693eb303b4c3b83753d12ccb1
|
SQL
|
dncontin/Tutorials
|
/SQL & MySQLTutorial/Joining Accross Databases.sql
|
UTF-8
| 135
| 2.875
| 3
|
[] |
no_license
|
USE sql_inventory;
SELECT oi.product_id, name, quantity
FROM sql_store.order_items oi
JOIN products p ON oi.product_id = p.product_id;
| true
|
75eeda1429ea04ddcfa0706a57fcf92456440858
|
SQL
|
ssavvides/tpch-spark
|
/dbgen/variants/14a.sql
|
UTF-8
| 416
| 3.109375
| 3
|
[
"MIT"
] |
permissive
|
-- $ID$
-- TPC-H/TPC-R Promotion Effect Query (Q14)
-- Variant A
-- Approved March 1998
:x
:o
select
100.00 * sum(decode(substring(p_type from 1 for 5), 'PROMO',
l_extendedprice * (1-l_discount), 0)) /
sum(l_extendedprice * (1-l_discount)) as promo_revenue
from
lineitem,
part
where
l_partkey = p_partkey
and l_shipdate >= date ':1'
and l_shipdate < date ':1' + interval '1' month;
:n -1
| true
|
71ef2ec29b3a0817e03029fd47c1ad0a3d387966
|
SQL
|
royalchan2436/SQL-Query
|
/q2.sql
|
UTF-8
| 1,477
| 4.375
| 4
|
[] |
no_license
|
SET search_path TO artistdb;
/*Create view to find the sales for albums which include songs that are
collaberated between two differrnt artists. */
CREATE VIEW Collab AS
SELECT DISTINCT be.album_id, al.artist_id, al.sales
FROM Collaboration co INNER JOIN BelongsToAlbum be ON co.song_id = be.song_id
INNER JOIN Album al ON be.album_id = al.album_id ;
/*Create view to find the sales for albums which includes only songs that
are done by individual artist. */
CREATE VIEW Indep AS
SELECT DISTINCT album_id, artist_id, sales
FROM Album
EXCEPT (SELECT * FROM collab);
/*Create view to find the average album sales for which artist has collaboration
with another artist. */
CREATE VIEW AveCollab AS
SELECT DISTINCT avg(sales) AS avg_sales, artist_id
FROM Collab
GROUP BY artist_id;
/*Create view to find the average album sales for which artist has done
individually. */
CREATE VIEW AveIndep AS
SELECT DISTINCT avg(sales) AS avg_sales, artist_id
FROM Indep
GROUP BY artist_id;
/*Find the artists' names and average sales for collaboration albums in
which the average album sales for collaboration is higher. */
SELECT DISTINCT a.name AS artists, c.avg_sales AS avg_collab_sales
FROM AveCollab c INNER JOIN AveIndep i ON c.artist_id = i.artist_id
INNER JOIN Artist a ON a. artist_id = c.artist_id
WHERE c.avg_sales > i.avg_sales
ORDER BY a.name ASC ;
/*Drop Views*/
DROP VIEW AveIndep CASCADE;
DROP VIEW AveCollab CASCADE;
DROP VIEW Indep CASCADE;
DROP VIEW Collab CASCADE;
| true
|
2a26fe3308da63823c69dc84599dff598e33626b
|
SQL
|
cephalization11/ETL-CDMBuilder
|
/source/Builders/org.ohdsi.cdm.builders.hcup/HCUP/Lookups/DRG.sql
|
UTF-8
| 389
| 3.625
| 4
|
[
"Apache-2.0"
] |
permissive
|
SELECT distinct old_drg.concept_code AS source_code, new_drg.concept_id AS target_concept_id
FROM concept old_drg
INNER JOIN concept_relationship
ON old_drg.concept_id = concept_id_1
INNER JOIN concept new_drg
ON new_drg.concept_id = concept_id_2
WHERE old_drg.vocabulary_id = 'DRG'
AND relationship_id = 'Maps to'
AND new_drg.standard_concept = 'S'
AND new_drg.vocabulary_id = 'DRG'
| true
|
5628ef3391cfee2700230b51c1575195bce7c040
|
SQL
|
programoworm/MSc_Assignments
|
/sem1/plsql/test.sql
|
UTF-8
| 3,315
| 3.84375
| 4
|
[] |
no_license
|
declare
msg varchar2(20):='Hello RB';
begin
dbms_output.put_line(msg);
end;
/
--Armstrong number
declare
x number(5):=&x;
otemp x%type:=x;
num x%type:=0;
temp number(1);
begin
--otemp:=x;
while x!=0 loop
--if x=1 then
-- num:=num+1;
-- exit;
--end if;
temp:=mod(x,10);
dbms_output.put_line(temp);
num:=num + temp**3;
x:=trunc(x/10);
end loop;
if otemp=num then
dbms_output.put_line(num||' Armstrong');
else
dbms_output.put_line(num||' Not Armstrong');
end if;
end;
/
--
INSERT INTO CUSTOMERS VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000.00 );
INSERT INTO CUSTOMERS VALUES (2, 'Khilan', 25, 'Delhi', 1500.00 );
INSERT INTO CUSTOMERS VALUES (3, 'kaushik', 23, 'Kota', 2000.00 );
INSERT INTO CUSTOMERS VALUES (4, 'Chaitali', 25, 'Mumbai', 6500.00 );
INSERT INTO CUSTOMERS VALUES (5, 'Hardik', 27, 'Bhopal', 8500.00 );
INSERT INTO CUSTOMERS VALUES (6, 'Komal', 22, 'MP', 4500.00 );
declare
cursor c_customers is select salary,name from customers;-- where salary<5000 for update;-- of salary;
c_salary customers.salary%type;
c_name customers.name%type;
incr_sal number(5);
begin
open c_customers;
loop
fetch c_customers into c_salary,c_name;
exit when c_customers%notfound;
if c_salary<5000 then
incr_sal:=500;
else
incr_sal:=100;
end if;
update customers
set salary=salary+incr_sal
where customers.salary=c_salary;
end loop;
close c_customers;
end;
/
open c_customers;
loop
fetch c_customers into c_salary,c_name;
exit when c_customers%notfound;
c_salary:=c_salary+500;
end loop;
update customers
set customers.salary=customers.salary+500
where current of c_customers;
close c_customers;
for customers_rec in c_customers loop
if customers_rec.salary<5000
incr_sal:=500;
else
incr_sal:=100;
end if;
update customers
set salary=salary+incr_sal;
where current of c_customers;
end loop;
========================================
declare
x number:=&x;
s number:=0;
d number;
temp number;
begin
temp:=x;
while x!=0 loop
d:=mod(x,10);
s:=s+d**3;
x:=trunc(x/10);
end loop;
if s=temp then
dbms_output.put_line('Armstrong');
else
dbms_output.put_line('Not Armstrong');
end if;
end;
/
========================================
create table square(
n number primary,
sq number
);
declare
i number;
n number:=&n;
p number;
cursor c_square is select n,sq from square;
sq_rec c_square%rowtype;
begin
for i in 1..n loop
p:=i**2;
insert into square values(i,p);
end loop;
dbms_output.put_line('Number Square');
open c_square;
loop
fetch c_square into sq_rec;
exit when c_square%notfound;
dbms_output.put_line(sq_rec.n||' '||sq_rec.sq);
end loop;
end;
/
========================================
create table customer(
c_id number(3),
c_name varchar2(25),
purched number(5)
);
declare
i number;
n number:=&n;
price number(5);
id number(3);
--cust varchar2:='cust';
begin
id:=100;
price:=10000;
for i in 1..n loop
price:=price-910;
insert into customer values(id,'cust'||i,price);
id:=id+1;
end loop;
end;
/
select * from customer;
=========================================
--declare
--p number;
create or replace function fact(num number)
return number
is
f number;
begin
if num<=1 then
f:=1;
else
f:=num*fact(num-1);
end if;
return f;
end;
begin
p:=fact(6);
dbms_output.put_line(p);
end;
/
| true
|
0ea2183b31fe716db1888c4bae6eca1e1dec80c8
|
SQL
|
sdss/sdssdb
|
/schema/sdss5db/catalogdb/gaia/dr3/qso_candidates/qso_candidates_create_table.sql
|
UTF-8
| 4,533
| 3.21875
| 3
|
[
"BSD-3-Clause"
] |
permissive
|
-- This create table statements is based on the below link.
-- https://gea.esac.esa.int/archive/documentation/GDR3/Gaia_archive/chap_datamodel/sec_dm_extra--galactic_tables/ssec_dm_qso_candidates.html
create table catalogdb.gaia_dr3_qso_candidates(
solution_id bigint, -- Solution Identifier (long)
source_id bigint, -- Unique source identifier (unique within a particular Data Release) (long)
astrometric_selection_flag boolean, -- Flag indicating if the source is part of the astrometric selection (boolean)
gaia_crf_source boolean, -- Flag indicative of whether the source was used define the Gaia-CRF3 (boolean)
vari_best_class_name text, -- Name of best class, see table vari_classifier_class_definition for details of the class (string)
vari_best_class_score real, -- Score of the best class (float)
fractional_variability_g real, -- Fractional variability in the G band (float)
structure_function_index real, -- Index of the first-order structure function in the G band (float)
structure_function_index_scatter double precision, -- Standard deviation of the index of the structure function (double)
qso_variability real, -- Quasar variability metric in the G band (float)
non_qso_variability real, -- Non-quasar variability metric in the G band (float)
vari_agn_membership_score double precision, -- Membership score (0=lowest,1=highest) of source to be of AGN type (double)
classprob_dsc_combmod_quasar real, -- Probability from DSC-Combmod of being a quasar (data used: BP/RP spectrum, photometry, astrometry) (float)
classprob_dsc_combmod_galaxy real, -- Probability from DSC-Combmod of being a galaxy (data used: BP/RP spectrum, photometry, astrometry) (float)
classlabel_dsc text, -- Class assigned by DSC based on the probability from its Combmod classifier (string)
classlabel_dsc_joint text, -- Class assigned by DSC based on the probability from its Specmod and Allosmod classifiers (string)
classlabel_oa text, -- Class assigned by OA the neuron that represents the source (string)
redshift_qsoc real, -- Redshift from QSOC (float)
redshift_qsoc_lower real, -- Redshift lower confidence level from QSOC (float)
redshift_qsoc_upper real, -- Redshift upper confidence level from QSOC (float)
ccfratio_qsoc real, -- Value of the cross-correlation function used to derive the redshift from QSOC, relative to the maximum value (float)
zscore_qsoc real, -- Redshift zscore from QSOC (float)
flags_qsoc bigint, -- Processing flags for the analysis based on BP/RP Spectra from QSOC (long)
n_transits integer, -- Number of transits used for the morphological analysis (int)
intensity_quasar double precision, -- Fitted intensity of the quasar at its centre (double, Flux[e− s−1])
intensity_quasar_error double precision, -- Error on the fitted intensity of the quasar at its centre (double, Flux[e− s−1])
intensity_hostgalaxy double precision, -- Fitted intensity of the host galaxy at the effective radius (double, Flux[e− s−1])
intensity_hostgalaxy_error double precision, -- Error on the fitted intensity of the host galaxy at effective radius (double, Flux[e− s−1])
radius_hostgalaxy double precision, -- Fitted effective radius of the host galaxy (double, Angle[mas])
radius_hostgalaxy_error double precision, -- Error on the fitted effective radius of the host galaxy (double, Angle[mas])
sersic_index real, -- Fitted sersic Index (float)
sersic_index_error real, -- Error on the fitted sersic Index (float)
ellipticity_hostgalaxy double precision, -- Fitted ellipticity of the host galaxy (double)
ellipticity_hostgalaxy_error double precision, -- Error on the fitted ellipticity of the host galaxy (double)
posangle_hostgalaxy double precision, -- Fitted position angle of the host galaxy (double, Angle[deg])
posangle_hostgalaxy_error double precision, -- Error on the fitted position angle of the host galaxy (double, Angle[deg])
host_galaxy_detected boolean, -- Flag indicating whether a host galaxy has been detected (boolean)
l2_norm double precision, -- L2 norm for the fitted Sersic profile (double)
morph_params_corr_vec text, -- Vector form of the upper triangle of the correlation matrix for the fitted morphological parameters (double[15] array)
host_galaxy_flag smallint, -- Flag indicative of processing or scientific quality for the morphological parameters fitting (byte)
source_selection_flags integer -- Bit indicative of whether the input data from a given module met the source list eligibility criteria for the source of interest (int)
);
| true
|
0d623300668ec0556a9bc2972b30584adb48ddc7
|
SQL
|
tomasz-sroka/dbrx-repository
|
/sprepinss.sql
|
UTF-8
| 32,575
| 2.71875
| 3
|
[] |
no_license
|
Rem
Rem $Header: sprepins.sql 17-apr-2002.16:59:29 vbarrier Exp $
Rem
Rem sprepins.sql
Rem
Rem Copyright (c) 2001, 2002, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem sprepins.sql - StatsPack Report Instance
Rem
Rem DESCRIPTION
Rem SQL*Plus command file to report on differences between
Rem values recorded in two snapshots.
Rem
Rem This script requests the user for the dbid and instance number
Rem of the instance to report on, before producing the standard
Rem Statspack report.
Rem
Rem NOTES
Rem Usually run as the STATSPACK owner, PERFSTAT
Rem
Rem MODIFIED (MM/DD/YY)
Rem vbarrier 03/20/02 - Module in SQL reporting + 2188360
Rem vbarrier 03/05/02 - Segment Statistics
Rem spommere 02/14/02 - cleanup RAC stats that are no longer needed
Rem spommere 02/08/02 - 2212357
Rem cdialeri 02/07/02 - 2218573
Rem cdialeri 01/30/02 - 2184717
Rem cdialeri 01/09/02 - 9.2 - features 2
Rem ykunitom 12/21/01 - 1396578: fixed '% Non-Parse CPU'
Rem cdialeri 12/19/01 - 9.2 - features 1
Rem cdialeri 09/20/01 - 1767338,1910458,1774694
Rem cdialeri 04/26/01 - Renamed from spreport.sql
Rem cdialeri 03/02/01 - 9.0
Rem cdialeri 09/12/00 - sp_1404195
Rem cdialeri 07/10/00 - 1349995
Rem cdialeri 06/21/00 - 1336259
Rem cdialeri 04/06/00 - 1261813
Rem cdialeri 03/28/00 - sp_purge
Rem cdialeri 02/16/00 - 1191805
Rem cdialeri 11/01/99 - Enhance, 1059172
Rem cgervasi 06/16/98 - Remove references to wrqs
Rem cmlim 07/30/97 - Modified system events
Rem gwood.uk 02/30/94 - Modified
Rem densor.uk 03/31/93 - Modified
Rem cellis.uk 11/15/89 - Created
Rem
clear break compute;
repfooter off;
ttitle off;
btitle off;
set timing off veri off space 1 flush on pause off termout on numwidth 10;
set echo off feedback off pagesize 60 linesize 80 newpage 1 recsep off;
set trimspool on trimout on;
define top_n_events = 8;
define top_n_sql = 65;
define top_n_segstat = 5;
define num_rows_per_hash=5;
--
-- Request the DB Id and Instance Number, if they are not specified
column instt_num heading "Inst Num" format 99999;
column instt_name heading "Instance" format a12;
column dbb_name heading "DB Name" format a12;
column dbbid heading "DB Id" format 9999999999 just c;
column host heading "Host" format a12;
prompt
prompt
prompt Instances in this Statspack schema
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select distinct
dbid dbbid
, instance_number instt_num
, db_name dbb_name
, instance_name instt_name
, host_name host
from stats$database_instance;
prompt
prompt Using &&dbid for database Id
prompt Using &&inst_num for instance number
--
-- Set up the binds for dbid and instance_number
variable dbid number;
variable inst_num number;
begin
:dbid := &dbid;
:inst_num := &inst_num;
end;
/
--
-- Ask for the snapshots Id's which are to be compared
set termout on;
column instart_fmt noprint;
column inst_name format a12 heading 'Instance';
column db_name format a12 heading 'DB Name';
column snap_id format 999990 heading 'Snap|Id';
column snapdat format a17 heading 'Snap Started' just c;
column lvl format 99 heading 'Snap|Level';
column commnt format a22 heading 'Comment';
break on inst_name on db_name on host on instart_fmt skip 1;
ttitle lef 'Completed Snapshots' skip 2;
select to_char(s.startup_time,' dd Mon "at" HH24:mi:ss') instart_fmt
, di.instance_name inst_name
, di.db_name db_name
, s.snap_id snap_id
, to_char(s.snap_time,'dd Mon YYYY HH24:mi') snapdat
, s.snap_level lvl
, substr(s.ucomment, 1,60) commnt
from stats$snapshot s
, stats$database_instance di
where s.dbid = :dbid
and di.dbid = :dbid
and s.instance_number = :inst_num
and di.instance_number = :inst_num
and di.dbid = s.dbid
and di.instance_number = s.instance_number
and di.startup_time = s.startup_time
order by db_name, instance_name, snap_id;
clear break;
ttitle off;
prompt
prompt
prompt Specify the Begin and End Snapshot Ids
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt Begin Snapshot Id specified: &&begin_snap
prompt
prompt End Snapshot Id specified: &&end_snap
prompt
--
-- Set up the snapshot-related binds, and additional instance info
set termout off;
variable bid number;
variable eid number;
begin
:bid := &&begin_snap;
:eid := &&end_snap;
end;
/
column para new_value para;
column versn new_value versn;
column host_name new_value host_name;
column db_name new_value db_name;
column inst_name new_value inst_name;
column btime new_value btime;
column etime new_value etime;
select parallel para
, version versn
, host_name host_name
, db_name db_name
, instance_name inst_name
, to_char(snap_time, 'YYYYMMDD HH24:MI:SS') btime
from stats$database_instance di
, stats$snapshot s
where s.snap_id = :bid
and s.dbid = :dbid
and s.instance_number = :inst_num
and di.dbid = s.dbid
and di.instance_number = s.instance_number
and di.startup_time = s.startup_time;
select to_char(snap_time, 'YYYYMMDD HH24:MI:SS') etime
from stats$snapshot s
where s.snap_id = :eid
and s.dbid = :dbid
and s.instance_number = :inst_num;
variable para varchar2(9);
variable versn varchar2(10);
variable host_name varchar2(64);
variable db_name varchar2(20);
variable inst_name varchar2(20);
variable btime varchar2(25);
variable etime varchar2(25);
begin
:para := '¶';
:versn := '&versn';
:host_name := '&host_name';
:db_name := '&db_name';
:inst_name := '&inst_name';
:btime := '&btime';
:etime := '&etime';
end;
/
set termout on;
--
-- Verify begin and end snapshot Ids exist for the database, and that
-- there wasn't an instance shutdown in between the two snapshots
-- being taken.
set heading off;
select 'ERROR: Database/Instance does not exist in STATS$DATABASE_INSTANCE'
from dual
where not exists
(select null
from stats$database_instance
where instance_number = :inst_num
and dbid = :dbid);
select 'ERROR: Begin Snapshot Id specified does not exist for this database/instance'
from dual
where not exists
(select null
from stats$snapshot b
where b.snap_id = :bid
and b.dbid = :dbid
and b.instance_number = :inst_num);
select 'ERROR: End Snapshot Id specified does not exist for this database/instance'
from dual
where not exists
(select null
from stats$snapshot e
where e.snap_id = :eid
and e.dbid = :dbid
and e.instance_number = :inst_num);
select 'WARNING: timed_statitics setting changed between begin/end snaps: TIMINGS ARE INVALID'
from dual
where not exists
(select null
from stats$parameter b
, stats$parameter e
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.name = e.name
and b.name = 'timed_statistics'
and b.value = e.value);
select 'ERROR: Snapshots chosen span an instance shutdown: RESULTS ARE INVALID'
from dual
where not exists
(select null
from stats$snapshot b
, stats$snapshot e
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.startup_time = e.startup_time);
select 'ERROR: Session statistics are for different sessions: RESULTS NOT PRINTED'
from dual
where not exists
(select null
from stats$snapshot b
, stats$snapshot e
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.session_id = e.session_id
and b.serial# = e.serial#);
set heading on;
--
--
set newpage 1 heading on;
--
-- Call statspack to calculate certain statistics
--
set heading off;
variable lhtr number;
variable bfwt number;
variable tran number;
variable chng number;
variable ucal number;
variable urol number;
variable ucom number;
variable rsiz number;
variable phyr number;
variable phyrd number;
variable phyrdl number;
variable phyw number;
variable prse number;
variable hprs number;
variable recr number;
variable gets number;
variable rlsr number;
variable rent number;
variable srtm number;
variable srtd number;
variable srtr number;
variable strn number;
variable call number;
variable lhr number;
variable sp varchar2(512);
variable bc varchar2(512);
variable lb varchar2(512);
variable bs varchar2(512);
variable twt number;
variable logc number;
variable prscpu number;
variable prsela number;
variable tcpu number;
variable exe number;
variable bspm number;
variable espm number;
variable bfrm number;
variable efrm number;
variable blog number;
variable elog number;
variable bocur number;
variable eocur number;
variable dmsd number;
variable dmfc number;
variable dmsi number;
variable pmrv number;
variable pmpt number;
variable npmrv number;
variable npmpt number;
variable dbfr number;
variable dpms number;
variable dnpms number;
variable glsg number;
variable glag number;
variable glgt number;
variable glsc number;
variable glac number;
variable glct number;
variable glrl number;
variable gcdfr number;
variable gcge number;
variable gcgt number;
variable gccv number;
variable gcct number;
variable gccrrv number;
variable gccrrt number;
variable gccurv number;
variable gccurt number;
variable gccrsv number;
variable gccrbt number;
variable gccrft number;
variable gccrst number;
variable gccusv number;
variable gccupt number;
variable gccuft number;
variable gccust number;
variable msgsq number;
variable msgsqt number;
variable msgsqk number;
variable msgsqtk number;
variable msgrq number;
variable msgrqt number;
begin
STATSPACK.STAT_CHANGES
( :bid, :eid
, :dbid, :inst_num
, :para -- End of IN arguments
, :lhtr, :bfwt
, :tran, :chng
, :ucal, :urol
, :rsiz
, :phyr, :phyrd
, :phyrdl
, :phyw, :ucom
, :prse, :hprs
, :recr, :gets
, :rlsr, :rent
, :srtm, :srtd
, :srtr, :strn
, :lhr, :bc
, :sp, :lb
, :bs, :twt
, :logc, :prscpu
, :tcpu, :exe
, :prsela
, :bspm, :espm
, :bfrm, :efrm
, :blog, :elog
, :bocur, :eocur
, :dmsd, :dmfc -- Begin of RAC
, :dmsi
, :pmrv, :pmpt
, :npmrv, :npmpt
, :dbfr
, :dpms, :dnpms
, :glsg, :glag
, :glgt, :glsc
, :glac, :glct
, :glrl, :gcdfr
, :gcge, :gcgt
, :gccv, :gcct
, :gccrrv, :gccrrt
, :gccurv, :gccurt
, :gccrsv
, :gccrbt, :gccrft
, :gccrst, :gccusv
, :gccupt, :gccuft
, :gccust
, :msgsq, :msgsqt
, :msgsqk, :msgsqtk
, :msgrq, :msgrqt -- End RAC
);
:call := :ucal + :recr;
end;
/
--
-- Summary Statistics
--
--
-- Print database, instance, parallel, release, host and snapshot
-- information
prompt STATSPACK Summary for
set heading on;
column inst_num heading "Inst Num" new_value inst_num format 99999;
column inst_name heading "Instance" new_value inst_name format a12;
column db_name heading "DB Name" new_value db_name format a12;
column dbid heading "DB Id" new_value dbid format 9999999999 just c;
column host_name heading "Host" format a12 print;
column para heading "Cluster" format a7 print;
column versn heading "Release" format a11 print;
select :db_name db_name
, :dbid dbid
, :inst_name inst_name
, :inst_num inst_num
, :versn versn
, :para para
, :host_name host_name
from sys.dual;
--
-- Print snapshot information
column inst_num noprint
column instart_fmt new_value INSTART_FMT noprint;
column instart new_value instart noprint;
column session_id new_value SESSION noprint;
column ela new_value ELA noprint;
column btim new_value btim heading 'Start Time' format a19 just c;
column etim new_value etim heading 'End Time' format a19 just c;
column bid format 999990;
column eid format 999990;
column dur heading 'Duration(mins)' format 999,990.00 just r;
column scnds heading 'Duration(secs)' format 999,990 just r;
column sess_id new_value sess_id noprint;
column serial new_value serial noprint;
column bbgt new_value bbgt noprint;
column ebgt new_value ebgt noprint;
column bdrt new_value bdrt noprint;
column edrt new_value edrt noprint;
column bet new_value bet noprint;
column eet new_value eet noprint;
column bsmt new_value bsmt noprint;
column esmt new_value esmt noprint;
column bvc new_value bvc noprint;
column evc new_value evc noprint;
column bpc new_value bpc noprint;
column epc new_value epc noprint;
column bspr new_value bspr noprint;
column espr new_value espr noprint;
column bslr new_value bslr noprint;
column eslr new_value eslr noprint;
column bsbb new_value bsbb noprint;
column esbb new_value esbb noprint;
column bsrl new_value bsrl noprint;
column esrl new_value esrl noprint;
column bsiw new_value bsiw noprint;
column esiw new_value esiw noprint;
column bcrb new_value bcrb noprint;
column ecrb new_value ecrb noprint;
column bcub new_value bcub noprint;
column ecub new_value ecub noprint;
column blog format 999,999;
column elog format 999,999;
column ocs format 99,999.0;
column comm format a19 trunc;
column nl newline;
set heading off;
select ' Snap Id Snap Time Sessions Curs/Sess Comment' nl
, ' ------- ------------------ --------- --------- -------------------' nl
, 'Begin Snap:' nl, b.snap_id bid
, to_char(b.snap_time, 'dd-Mon-yy hh24:mi:ss') btim
, :blog blog
, :bocur/:blog ocs
, b.ucomment comm
, ' End Snap:' nl
, e.snap_id eid
, to_char(e.snap_time, 'dd-Mon-yy hh24:mi:ss') etim
, :elog elog
, :eocur/:elog ocs
, e.ucomment comm
, ' Elapsed: ' nl
, round(((e.snap_time - b.snap_time) * 1440 * 60), 0)/60 dur -- mins
, '(mins)'
, ' ' nl
, round(((e.snap_time - b.snap_time) * 1440 * 60), 0) scnds -- secs
, '(secs)'
, b.instance_number inst_num
, to_char(b.startup_time, 'dd-Mon-yy hh24:mi:ss') instart_fmt
, b.session_id
, round(((e.snap_time - b.snap_time) * 1440 * 60), 0) ela -- secs
, to_char(b.startup_time,'YYYYMMDD HH24:MI:SS') instart
, e.session_id sess_id
, e.serial# serial
, b.buffer_gets_th bbgt
, e.buffer_gets_th ebgt
, b.disk_reads_th bdrt
, e.disk_reads_th edrt
, b.executions_th bet
, e.executions_th eet
, b.sharable_mem_th bsmt
, e.sharable_mem_th esmt
, b.version_count_th bvc
, e.version_count_th evc
, b.parse_calls_th bpc
, e.parse_calls_th epc
, b.seg_phy_reads_th bspr
, e.seg_phy_reads_th espr
, b.seg_log_reads_th bslr
, e.seg_log_reads_th eslr
, b.seg_buff_busy_th bsbb
, e.seg_buff_busy_th esbb
, b.seg_rowlock_w_th bsrl
, e.seg_rowlock_w_th esrl
, b.seg_itl_waits_th bsiw
, e.seg_itl_waits_th esiw
, b.seg_cr_bks_sd_th bcrb
, e.seg_cr_bks_sd_th ecrb
, b.seg_cu_bks_sd_th bcub
, e.seg_cu_bks_sd_th ecub
from stats$snapshot b
, stats$snapshot e
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.startup_time = e.startup_time
and b.snap_time < e.snap_time;
set heading on;
variable btim varchar2 (20);
variable etim varchar2 (20);
variable ela number;
variable instart varchar2 (18);
variable bbgt number;
variable ebgt number;
variable bdrt number;
variable edrt number;
variable bet number;
variable eet number;
variable bsmt number;
variable esmt number;
variable bvc number;
variable evc number;
variable bpc number;
variable epc number;
begin
:btim := '&btim';
:etim := '&etim';
:ela := &ela;
:instart := '&instart';
:bbgt := &bbgt;
:ebgt := &ebgt;
:bdrt := &bdrt;
:edrt := &edrt;
:bet := &bet;
:eet := &eet;
:bsmt := &bsmt;
:esmt := &esmt;
:bvc := &bvc;
:evc := &evc;
:bpc := &bpc;
:epc := &epc;
end;
/
--
--
set heading off;
--
-- Cache Sizes
column dscr format a28 newline;
column val format a10 just r;
select 'Cache Sizes (end)' dscr
, '~~~~~~~~~~~~~~~~~' dscr
, ' Buffer Cache:' dscr
, lpad(to_char(round(:bc/1024/1024),'999,999') || 'M', 10) val
, ' Std Block Size:'
, lpad(to_char((:bs/1024) ,'999') || 'K',10) val
, ' Shared Pool Size:' dscr
, lpad(to_char(round(:sp/1024/1024),'999,999') || 'M',10) val
, ' Log Buffer:'
, lpad(to_char(round(:lb/1024) ,'999,999') || 'K', 10) val
from sys.dual;
--
-- Load Profile
column dscr format a28 newline;
column val format 9,999,999,999,990.99;
column sval format 99,990.99;
column svaln format 99,990.99 newline;
column totcalls new_value totcalls noprint
column pctval format 990.99;
column bpctval format 99990.99;
select 'Load Profile'
,'~~~~~~~~~~~~ Per Second Per Transaction'
,' --------------- ---------------'
,' Redo size:' dscr, round(:rsiz/:ela,2) val
, round(:rsiz/:tran,2) val
,' Logical reads:' dscr, round(:gets/:ela,2) val
, round(:gets/:tran,2) val
,' Block changes:' dscr, round(:chng/:ela,2) val
, round(:chng/:tran,2) val
,' Physical reads:' dscr, round(:phyr/:ela,2) val
, round(:phyr/:tran,2) val
,' Physical writes:' dscr, round(:phyw/:ela,2) val
, round(:phyw/:tran,2) val
,' User calls:' dscr, round(:ucal/:ela,2) val
, round(:ucal/:tran,2) val
,' Parses:' dscr, round(:prse/:ela,2) val
, round(:prse/:tran,2) val
,' Hard parses:' dscr, round(:hprs/:ela,2) val
, round(:hprs/:tran,2) val
,' Sorts:' dscr, round((:srtm+:srtd)/:ela,2) val
, round((:srtm+:srtd)/:tran,2) val
,' Logons:' dscr, round(:logc/:ela,2) val
, round(:logc/:tran,2) val
,' Executes:' dscr, round(:exe/:ela,2) val
, round(:exe/:tran,2) val
,' Transactions:' dscr, round(:tran/:ela,2) val
, ' ' dscr
,' % Blocks changed per Read:' dscr, round(100*:chng/:gets,2) pctval
,' Recursive Call %:' , round(100*:recr/:call,2) bpctval
,' Rollback per transaction %:' dscr, round(100*:urol/:tran,2) pctval
,' Rows per Sort:' , decode((:srtm+:srtd)
,0,to_number(null)
,round(:srtr/(:srtm+:srtd),2)) bpctval
from sys.dual;
--
-- Instance Efficiency Percentages
column ldscr format a50
column nl format a60 newline;
select 'Instance Efficiency Percentages (Target 100%)' ldscr
,'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' ldscr
,' Buffer Nowait %:' dscr
, round(100*(1-:bfwt/:gets),2) pctval
,' Redo NoWait %:'
, decode(:rent,0,to_number(null), round(100*(1-:rlsr/:rent),2)) pctval
,' Buffer Hit %:' dscr
, round(100*(1-(:phyr-:phyrd-nvl(:phyrdl,0))/:gets),2) pctval
,' In-memory Sort %:'
, decode((:srtm+:srtd),0,to_number(null),
round(100*:srtm/(:srtd+:srtm),2)) pctval
,' Library Hit %:' dscr
, round(100*:lhtr,2) pctval
,' Soft Parse %:'
, round(100*(1-:hprs/:prse),2) pctval
,' Execute to Parse %:' dscr
, round(100*(1-:prse/:exe),2) pctval
,' Latch Hit %:'
, round(100*(1-:lhr),2) pctval
,'Parse CPU to Parse Elapsd %:' dscr
, decode(:prsela, 0, to_number(null)
, round(100*:prscpu/:prsela,2)) pctval
,' % Non-Parse CPU:'
, decode(:tcpu, 0, to_number(null)
, round(100*(1-(:prscpu/:tcpu)),2)) pctval
from sys.dual;
--
--
set heading on;
--
-- Top Wait Events
col idle noprint;
col event format a44 heading 'Top 8 Timed Events|~~~~~~~~~~~~~~~~~~|Event';
col waits format 999,999,990 heading 'Waits';
col time format 99,999,990 heading 'Time (s)';
col pctwtt format 999.99 heading '% Total|Ela Time';
col total_wt_tm format 999,999,990 heading 'Total Wait Time'
select event
, waits
, time
, pctwtt
from (select event, waits, time, pctwtt
from (select e.event event
, e.total_waits - nvl(b.total_waits,0) waits
, (e.time_waited_micro - nvl(b.time_waited_micro,0))/1000000 time
, decode(:twt + :tcpu*10000, 0, 0,
100
* (e.time_waited_micro - nvl(b.time_waited_micro,0))
/ (:twt + :tcpu*10000)
) pctwtt
from stats$system_event b
, stats$system_event e
where b.snap_id(+) = :bid
and e.snap_id = :eid
and b.dbid(+) = :dbid
and e.dbid = :dbid
and b.instance_number(+) = :inst_num
and e.instance_number = :inst_num
and b.event(+) = e.event
and e.total_waits > nvl(b.total_waits,0)
and e.event not in (select event from stats$idle_event)
union all
select 'CPU time' event
, to_number(null) waits
, :tcpu/100 time
, decode(:twt + :tcpu*10000, 0, 0,
100
* :tcpu*10000
/ (:twt + :tcpu*10000)
) pctwait
from dual
where :tcpu > 0
)
order by time desc, waits desc
)
where rownum <= &&top_n_events;
set heading off
select 'Total non-idle wait time for interval : ' || round(avg(:twt)/1000000) || ' seconds' total_wt_tm
from stats$system_event b
, stats$system_event e
where b.snap_id(+) = :bid
and e.snap_id = :eid
and b.dbid(+) = :dbid
and e.dbid = :dbid
and b.instance_number(+) = :inst_num
and e.instance_number = :inst_num
and b.event(+) = e.event
and e.total_waits > nvl(b.total_waits,0)
and e.event not in
( select event
from stats$idle_event
);
prompt
set heading on
whenever sqlerror exit;
--
-- Instance Activity Statistics
column st format a33 heading 'CPU Used' trunc;
column dif format 999,999,999,990 heading 'Total (sec)';
column ps format 9,999,990.9 heading 'cs per Sec';
column pt format 9,999,990.9 heading 'per Trans';
select substr(b.name,1,8) st
, to_number(decode(instr(b.name,'current')
,0,e.value - b.value,null)/100) dif
, to_number(decode(instr(b.name,'current')
,0,round((e.value - b.value)
/:ela,2),null)) ps
, to_number(decode(instr(b.name,'current')
,0,round((e.value - b.value)
/:tran,2),null)) pt
from stats$sysstat b
, stats$sysstat e
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.name = e.name
and e.value >= b.value
and e.value > 0
and b.name like 'CPU used by this session'
;
--
-- Session Wait Events
ttitle lef 'Session Wait Events for ' -
'DB: ' db_name ' Instance: ' inst_name ' '-
'Snaps: ' format 999999 begin_snap ' -' format 999999 end_snap -
skip 1 -
lef 'Session Id: ' sess_id ' Serial#: ' serial -
skip 1 -
lef '-> ordered by wait time desc, waits desc (idle events last)' -
skip 2;
select e.event
, e.total_waits - nvl(b.total_waits,0) waits
, e.total_timeouts - nvl(b.total_timeouts,0) timeouts
, (e.time_waited_micro - nvl(b.time_waited_micro,0))/1000000 time
, decode ((e.total_waits - nvl(b.total_waits, 0)),
0, to_number(NULL),
((e.time_waited_micro - nvl(b.time_waited_micro,0))/1000)
/ (e.total_waits - nvl(b.total_waits,0)) ) wt
, (e.total_waits - nvl(b.total_waits,0))/:tran txwaits
, decode(i.event, null, 0, 99) idle
from stats$session_event b
, stats$session_event e
, stats$idle_event i
, stats$snapshot bs
, stats$snapshot es
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and b.event = e.event
and e.total_waits > nvl(b.total_waits,0)
and i.event(+) = e.event
and bs.snap_id = b.snap_id
and es.snap_id = e.snap_id
and bs.dbid = b.dbid
and es.dbid = b.dbid
and bs.dbid = e.dbid
and es.dbid = e.dbid
and bs.instance_number = b.instance_number
and es.instance_number = b.instance_number
and bs.instance_number = e.instance_number
and es.instance_number = e.instance_number
and bs.session_id = es.session_id
and bs.serial# = es.serial#
order by idle, time desc, waits desc;
--
-- Session Statistics
ttitle lef 'Session Statistics for ' -
'DB: ' db_name ' Instance: ' inst_name ' '-
'Snaps: ' format 999999 begin_snap ' -' format 999999 end_snap -
skip 1 -
lef 'Session Id: ' sess_id ' Serial#: ' serial -
skip 2;
repfooter center -
'-------------------------------------------------------------';
select lower(substr(ss.name,1,38)) st
, to_number(decode(instr(ss.name,'current')
,0,e.value - b.value,null)) dif
, to_number(decode(instr(ss.name,'current')
,0,round((e.value - b.value)
/:ela,2),null)) ps
, to_number(decode(instr(ss.name,'current')
,0,decode(:strn,
0, round(e.value - b.value),
round((e.value - b.value)
/:strn,2),null))) pt
from stats$sesstat b
, stats$sesstat e
, stats$sysstat ss
, stats$snapshot bs
, stats$snapshot es
where b.snap_id = :bid
and e.snap_id = :eid
and b.dbid = :dbid
and e.dbid = :dbid
and b.instance_number = :inst_num
and e.instance_number = :inst_num
and ss.snap_id = :eid
and ss.dbid = :dbid
and ss.instance_number = :inst_num
and b.statistic# = e.statistic#
and ss.statistic# = e.statistic#
and e.value > b.value
and bs.snap_id = b.snap_id
and es.snap_id = e.snap_id
and bs.dbid = b.dbid
and es.dbid = b.dbid
and bs.dbid = e.dbid
and es.dbid = e.dbid
and bs.dbid = ss.dbid
and es.dbid = ss.dbid
and bs.instance_number = b.instance_number
and es.instance_number = b.instance_number
and bs.instance_number = ss.instance_number
and es.instance_number = ss.instance_number
and bs.instance_number = e.instance_number
and es.instance_number = e.instance_number
and bs.session_id = es.session_id
and bs.serial# = es.serial#
order by st;
prompt
prompt End of Report
prompt
set termout off;
clear columns sql;
ttitle off;
btitle off;
repfooter off;
set linesize 78 termout on feedback 6;
undefine begin_snap
undefine end_snap
undefine dbid
undefine inst_num
undefine report_name
undefine top_n_sql
undefine top_n_events
undefine btime
undefine etime
whenever sqlerror continue;
-- for Terry's profile
set linesize 132
--
-- End of script file;
| true
|
b4999caf2dabb2c0f8ec3ef6641bec814aad9d6e
|
SQL
|
YeonggilGo/Salendar
|
/backend/salendar/sql/User.sql
|
UTF-8
| 601
| 3.203125
| 3
|
[] |
no_license
|
use salendar;
drop table if exists user;
CREATE TABLE User
(
`usrNo` INT NOT NULL AUTO_INCREMENT COMMENT '사용자 일련번호',
`usrPwd` VARCHAR(20) NULL COMMENT '비밀번호',
`usrNick` VARCHAR(15) NULL COMMENT '닉네임',
`usrEmail` VARCHAR(30) NULL COMMENT '이메일',
`usrFollowing` INT NULL COMMENT '팔로우 매장',
`usrImgUrl` VARCHAR(30) NULL COMMENT '사용자 프로필',
PRIMARY KEY (usrNo)
);
select * from comment;
select * from user;
select * from board;
| true
|
1adbd7c86b5846e4ff633533430552878463c2e7
|
SQL
|
pjcevans/openprescribing
|
/openprescribing/frontend/management/commands/measure_sql/global_deciles_practices.sql
|
UTF-8
| 1,424
| 3.375
| 3
|
[
"MIT"
] |
permissive
|
SELECT
month,
MAX(p_10th) AS practice_10th,
MAX(p_20th) AS practice_20th,
MAX(p_30th) AS practice_30th,
MAX(p_40th) AS practice_40th,
MAX(p_50th) AS practice_50th,
MAX(p_60th) AS practice_60th,
MAX(p_70th) AS practice_70th,
MAX(p_80th) AS practice_80th,
MAX(p_90th) AS practice_90th,
SUM(denominator) AS denominator,
SUM(numerator) AS numerator
{extra_select_sql}
FROM (
SELECT
*,
PERCENTILE_CONT(0.1) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_10th,
PERCENTILE_CONT(0.2) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_20th,
PERCENTILE_CONT(0.3) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_30th,
PERCENTILE_CONT(0.4) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_40th,
PERCENTILE_CONT(0.5) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_50th,
PERCENTILE_CONT(0.6) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_60th,
PERCENTILE_CONT(0.7) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_70th,
PERCENTILE_CONT(0.8) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_80th,
PERCENTILE_CONT(0.9) OVER (PARTITION BY month ORDER BY calc_value ASC) AS p_90th
FROM {measures}.practice_data_{measure_id}
WHERE calc_value IS NOT NULL AND NOT IS_NAN(calc_value)) a,
(SELECT
*,
FROM {measures}.practice_data_{measure_id}
WHERE calc_value IS NULL OR IS_NAN(calc_value)) b
GROUP BY month
| true
|
556511e83810953be0640cf55558f06c1eb4ec7e
|
SQL
|
teeweee/JS2021two
|
/JS-003/university2.sql
|
UTF-8
| 8,034
| 3.265625
| 3
|
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 20, 2021 at 05:01 PM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.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: `university`
--
-- --------------------------------------------------------
--
-- Table structure for table `faculty`
--
CREATE TABLE `faculty` (
`Id_Faculty` bigint(20) NOT NULL,
`Name` varchar(50) NOT NULL,
`Address` varchar(100) DEFAULT NULL,
`Id_Rector` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `faculty`
--
INSERT INTO `faculty` (`Id_Faculty`, `Name`, `Address`, `Id_Rector`) VALUES
(2, 'Information Tehnologie', 'Liepaja street 2', 1),
(5, 'Social Science', 'Riga 2', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `lectors`
--
CREATE TABLE `lectors` (
`Id_Lector` bigint(20) NOT NULL,
`Name` varchar(50) NOT NULL,
`Surname` varchar(50) NOT NULL,
`Phone` varchar(10) NOT NULL,
`Mail` varchar(70) NOT NULL,
`Gender` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `lectors`
--
INSERT INTO `lectors` (`Id_Lector`, `Name`, `Surname`, `Phone`, `Mail`, `Gender`) VALUES
(1, 'Ilze', 'Straupe', '25412541', 'ilze@straupe.com', 'Female'),
(3, 'Janis', 'Straupe', '25632563', 'janis@straupe.com', 'Male');
-- --------------------------------------------------------
--
-- Table structure for table `map_student_subject`
--
CREATE TABLE `map_student_subject` (
`Id_stud_sub` bigint(20) NOT NULL,
`Id_Subject` bigint(20) NOT NULL,
`Id_Student` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `map_student_subject`
--
INSERT INTO `map_student_subject` (`Id_stud_sub`, `Id_Subject`, `Id_Student`) VALUES
(1, 1, 2),
(3, 1, 3),
(4, 2, 3);
-- --------------------------------------------------------
--
-- Table structure for table `map_subject_lector`
--
CREATE TABLE `map_subject_lector` (
`Id_map_sub_lec` bigint(20) NOT NULL,
`Id_Lector` bigint(20) NOT NULL,
`Id_Subject` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `map_subject_lector`
--
INSERT INTO `map_subject_lector` (`Id_map_sub_lec`, `Id_Lector`, `Id_Subject`) VALUES
(1, 1, 3),
(2, 3, 1);
-- --------------------------------------------------------
--
-- Table structure for table `rector`
--
CREATE TABLE `rector` (
`Id_Rector` bigint(20) NOT NULL,
`Name` varchar(50) NOT NULL,
`Surname` varchar(50) NOT NULL,
`Age` int(100) NOT NULL,
`Gender` varchar(10) NOT NULL,
`Telephone` varchar(15) NOT NULL,
`Mail` varchar(70) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `rector`
--
INSERT INTO `rector` (`Id_Rector`, `Name`, `Surname`, `Age`, `Gender`, `Telephone`, `Mail`) VALUES
(1, 'Maris', 'Rungainis', 32, 'Male', '21451452', 'maris.rungainis@gmail.com'),
(2, 'John', 'Smith', 25, 'Male', '25362563', 'John@mail.com'),
(3, 'Anna', 'Smith', 25, 'Male', '25362563', 'Anna@mail.com');
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE `student` (
`Id_Student` bigint(20) NOT NULL,
`Name` varchar(50) NOT NULL,
`Surname` varchar(50) NOT NULL,
`Gender` varchar(10) NOT NULL,
`Age` int(100) NOT NULL,
`Id_faculty` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `student`
--
INSERT INTO `student` (`Id_Student`, `Name`, `Surname`, `Gender`, `Age`, `Id_faculty`) VALUES
(2, 'Karlis', 'Smits', 'Male', 20, 2),
(3, 'Sintia', 'Smits', 'Female', 18, 2),
(5, 'Elin', 'Smite', 'Female', 21, 5),
(7, 'Olga', 'Ose', 'Female', 25, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `subjects`
--
CREATE TABLE `subjects` (
`Id_Subject` bigint(20) NOT NULL,
`Name` varchar(50) NOT NULL,
`Hours` int(120) NOT NULL,
`CreditPoints` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `subjects`
--
INSERT INTO `subjects` (`Id_Subject`, `Name`, `Hours`, `CreditPoints`) VALUES
(1, 'Javascript', 100, 8),
(2, 'Git', 4, 1),
(3, 'Database', 4, 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `faculty`
--
ALTER TABLE `faculty`
ADD PRIMARY KEY (`Id_Faculty`),
ADD KEY `Id_Rector` (`Id_Rector`);
--
-- Indexes for table `lectors`
--
ALTER TABLE `lectors`
ADD PRIMARY KEY (`Id_Lector`);
--
-- Indexes for table `map_student_subject`
--
ALTER TABLE `map_student_subject`
ADD PRIMARY KEY (`Id_stud_sub`),
ADD KEY `Id_Subject` (`Id_Subject`,`Id_Student`),
ADD KEY `Id_Student` (`Id_Student`);
--
-- Indexes for table `map_subject_lector`
--
ALTER TABLE `map_subject_lector`
ADD PRIMARY KEY (`Id_map_sub_lec`),
ADD KEY `Id_Lector` (`Id_Lector`,`Id_Subject`),
ADD KEY `Id_Subject` (`Id_Subject`);
--
-- Indexes for table `rector`
--
ALTER TABLE `rector`
ADD PRIMARY KEY (`Id_Rector`);
--
-- Indexes for table `student`
--
ALTER TABLE `student`
ADD PRIMARY KEY (`Id_Student`),
ADD KEY `Id_faculty` (`Id_faculty`);
--
-- Indexes for table `subjects`
--
ALTER TABLE `subjects`
ADD PRIMARY KEY (`Id_Subject`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `faculty`
--
ALTER TABLE `faculty`
MODIFY `Id_Faculty` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `lectors`
--
ALTER TABLE `lectors`
MODIFY `Id_Lector` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `map_student_subject`
--
ALTER TABLE `map_student_subject`
MODIFY `Id_stud_sub` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `map_subject_lector`
--
ALTER TABLE `map_subject_lector`
MODIFY `Id_map_sub_lec` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rector`
--
ALTER TABLE `rector`
MODIFY `Id_Rector` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `student`
--
ALTER TABLE `student`
MODIFY `Id_Student` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `subjects`
--
ALTER TABLE `subjects`
MODIFY `Id_Subject` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `faculty`
--
ALTER TABLE `faculty`
ADD CONSTRAINT `faculty_ibfk_1` FOREIGN KEY (`Id_Rector`) REFERENCES `rector` (`Id_Rector`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `map_student_subject`
--
ALTER TABLE `map_student_subject`
ADD CONSTRAINT `map_student_subject_ibfk_1` FOREIGN KEY (`Id_Subject`) REFERENCES `subjects` (`Id_Subject`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `map_student_subject_ibfk_2` FOREIGN KEY (`Id_Student`) REFERENCES `student` (`Id_Student`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `map_subject_lector`
--
ALTER TABLE `map_subject_lector`
ADD CONSTRAINT `map_subject_lector_ibfk_1` FOREIGN KEY (`Id_Lector`) REFERENCES `lectors` (`Id_Lector`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `map_subject_lector_ibfk_2` FOREIGN KEY (`Id_Subject`) REFERENCES `subjects` (`Id_Subject`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `student`
--
ALTER TABLE `student`
ADD CONSTRAINT `student_ibfk_1` FOREIGN KEY (`Id_faculty`) REFERENCES `faculty` (`Id_Faculty`) ON DELETE NO ACTION ON UPDATE NO ACTION;
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 */;
| true
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.