text
stringlengths
6
9.38M
DROP DATABASE IF EXISTS bamazon_db; CREATE DATABASE bamazon_db; USE bamazon_db; CREATE TABLE products ( items_id INT AUTO_INCREMENT NOT NULL, product_name VARCHAR (100) NOT NULL, department_name VARCHAR (30), price FLOAT NOT NULL, stock_quantity INT NOT NULL, PRIMARY KEY (items_id) );
select COLUMN_NAME ,NUM_DISTINCT --,LOW_VALUE --,HIGH_VALUE ,DENSITY ,NUM_NULLS ,NUM_BUCKETS ,LAST_ANALYZED ,SAMPLE_SIZE ,GLOBAL_STATS ,USER_STATS ,AVG_COL_LEN ,HISTOGRAM from dba_tab_col_statistics where table_name=upper('&1') order by column_name;
SELECT * FROM DICTIONARY; SELECT * FROM DICT; SELECT TABLE_NAME FROM USER_TABLES;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: localhost Database: demo -- ------------------------------------------------------ -- Server version 5.6.37-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `fq` -- DROP TABLE IF EXISTS `fq`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `fq` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `Question` varchar(500) NOT NULL, `Answer` varchar(1000) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `fq` -- LOCK TABLES `fq` WRITE; /*!40000 ALTER TABLE `fq` DISABLE KEYS */; INSERT INTO `fq` VALUES (1,'網路訂不到,現場購票卻有?','1.查本局座位之分配,主要係考量座位運用效益,故售票系統於進行原始配位時,即儘量以中長途旅客為主,另考量短途旅運需求多為臨時性需求,故售票系統設定於乘車日前3天,長途座位尚有剩餘時,始開放座位截短發售功能,供短途旅客購訂票。故旅客若於系統尚未開放截短期間上網訂票,是有可能發生上述情事。本局建議可於乘車前3日時,再次利用語音/網路訂票系統訂票。 \r\n2.又目前本局售票系統係全省連線售票,座位庫料檔即時更新,現場可售座位,亦隨時因旅客退換票而有所異動。 '),(2,' 網路付款完成後最晚取票時間,是否一定要於搭乘班次開車前30分鐘,至車站售票窗口完成取票?','購票乘車或取票乘車應考量排隊人潮及上下月台時間,建議您及早至車站取票,以避免過於匆忙發生危險。'),(3,'為什麼取票,座位有時會不在一起呢?','本局客座劃座原則依序為:(一)相鄰座位;(二)相同車廂;(三)零散座位。訂票後,座位即依上述原則劃定,若僅剩零散座位,則無法提供相鄰座位。如座位不符需求,乘車前可洽車站售票人員,就旅客退票相鄰剩餘座位提供協助。'),(4,' 高級列車(含自強、莒光、復興號)停靠站標準為何?',' 規劃列車停靠,主要係衡量各站經濟發展情形、旅客流量、乘車人數多寡及營運收入,並考量列車等級、運轉條件及長短途各類不同旅客需求予以決定,如以西線為例,其停靠標準原則如下: \r\n(1)自強號: \r\n直達車(始發站開車後至終點站沿途停靠四至五站)。 \r\n半直達車(始發站開車後至終點站沿途停靠約八站左右)。 \r\n非直達車(始發站開車後至終點站沿途停靠十三至十六站)。 \r\n(2)莒光號:停靠十八至二十一站。 \r\n(3)復興號:停靠三十站左右。 \r\n註:基於業務考量(例如疏解自強號擁擠程度),部分復興號、莒光號或區間列車以半直達方式行駛。'); /*!40000 ALTER TABLE `fq` 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 2017-09-07 0:04:48
--# first highest salary select id, name, max(salary) from emp; --# seconds highest salary select id, name, max(salary) from emp where salary not in (select max(salary) from emp); --// for any nth highest salary from emp;;;; // select id, name, salary from emp e1 where n -1=(select count(distinct salary) from emp e2 where e2.salary > e1.salary); --# example 4th highest salary select id, name, salary from emp e1 where 4-1 = (select count(distinct salary) from emp e2 where e2.salary > e1.salary); -- # To find the Duplicate record in table select * from emp out where (select count(*) from emp inr where inr.emp_id = out.emp_id) > 1 --# get the employee who salary is greater than the his manager salary select id, name, salary from emp e, emp m where e.manager_id = m.emp_id and e.salary > m.salary; --# list out the workers in a deportment in decreasing order from select deportment, count(workers_id) no_of_workers from workers group by deportment order by no_of_workers DESC; --# difference between the UNION and UNION ALL --union--> will remove any duplicates from date table --union all --> will not remove any duplicates from date table drop table hotel; create table hotel(ssn int not null, cname text not null, address text null, start_date date not null, end_date date null,room_type char(9) null); insert into hotel values(12,'Ram','kurnool','01-02-2019','01-03-2019','A/c'); insert into hotel values(13,'Sai','kurnool','01-02-2019','31-12-2019','Normal'); insert into hotel values(14,'Ram','Tirupati','01-02-2019','01-03-2020','A/c'); insert into hotel values(12,'Sam','Hyderabad','01-04-2019'); insert into hotel values(12,'John','Bangalore','01-05-2019'); select * from hotel; select count(end_date-start_date) from hotel; update hotel set end_date = '2020-05-13' where end_date is null; select sum(extract(year from age(end_date,start_date))) years, sum(extract(month from age(end_date,start_date))) months, sum(extract(day from age(end_date,start_date))) days from hotel; select sum(extract(year from age(end_date,start_date)))*1200000 amount_years, sum(extract(month from age(end_date,start_date)))*100000 amount_months, sum(extract(day from age(end_date,start_date)))*3300 amount_days from hotel; select (sum(extract(year from age(end_date,start_date)))*1200000 + sum(extract(month from age(end_date,start_date)))*100000 + sum(extract(day from age(end_date,start_date)))*3300) total_amount from hotel; ################################################################################################################ create schema postgres_prac; set search_path to postgres_prac; CREATE TABLE dept ( deptno int NOT NULL CONSTRAINT dept_pk PRIMARY KEY, dname VARCHAR(14) CONSTRAINT dept_dname_uq UNIQUE, loc VARCHAR(13)); CREATE TABLE emp ( empno int NOT NULL CONSTRAINT emp_pk PRIMARY KEY, ename VARCHAR(10), job VARCHAR(9), mgr int, hiredate DATE, sal decimal(7,2) CONSTRAINT emp_sal_ck CHECK (sal > 0), comm decimal(7,2), deptno int CONSTRAINT emp_ref_dept_fk REFERENCES dept(deptno) ); INSERT INTO dept VALUES (10,'ACCOUNTING','NEW YORK'); INSERT INTO dept VALUES (20,'RESEARCH','DALLAS'); INSERT INTO dept VALUES (30,'SALES','CHICAGO'); INSERT INTO dept VALUES (40,'OPERATIONS','BOSTON'); select * from dept; INSERT INTO emp VALUES (7369,'SMITH','CLERK',7902,'17-DEC-80',800,NULL,20); INSERT INTO emp VALUES (7499,'ALLEN','SALESMAN',7698,'20-FEB-81',1600,300,30); INSERT INTO emp VALUES (7521,'WARD','SALESMAN',7698,'22-FEB-81',1250,500,30); INSERT INTO emp VALUES (7566,'JONES','MANAGER',7839,'02-APR-81',2975,NULL,20); INSERT INTO emp VALUES (7654,'MARTIN','SALESMAN',7698,'28-SEP-81',1250,1400,30); INSERT INTO emp VALUES (7698,'BLAKE','MANAGER',7839,'01-MAY-81',2850,NULL,30); INSERT INTO emp VALUES (7782,'CLARK','MANAGER',7839,'09-JUN-81',2450,NULL,10); INSERT INTO emp VALUES (7788,'SCOTT','ANALYST',7566,'19-APR-87',3000,NULL,20); INSERT INTO emp VALUES (7839,'KING','PRESIDENT',NULL,'17-NOV-81',5000,NULL,10); INSERT INTO emp VALUES (7844,'TURNER','SALESMAN',7698,'08-SEP-81',1500,0,30); INSERT INTO emp VALUES (7876,'ADAMS','CLERK',7788,'23-MAY-87',1100,NULL,20); INSERT INTO emp VALUES (7900,'JAMES','CLERK',7698,'03-DEC-81',950,NULL,30); INSERT INTO emp VALUES (7902,'FORD','ANALYST',7566,'03-DEC-81',3000,NULL,20); INSERT INTO emp VALUES (7934,'MILLER','CLERK',7782,'23-JAN-82',1300,NULL,10); select sum(sal) from emp; select empno,ename,max(sal) from emp group by empno; select empno,ename,sal from emp e1 where 0 = (select count(distinct sal) from emp e2 where e2.sal > e1.sal); select e.empno, e.ename, e.sal, m.mgr, m.ename mgr_name, m.sal mgr_sal from emp e,emp m where e.mgr = m.empno and e.sal > m.sal; select e.deptno, count(e.empno) no_of_employee from emp e group by e.deptno order by no_of_employee DESC; CREATE TABLE PLAYER ( ID INT, FIRST VARCHAR(25), YEAR INT ); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (1, "Santo", 1977); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (2, "Santo", 1978); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (3, "Santo", 1979); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (4, "Santo", 1980); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (5, "Santo", 1993); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (6, "Santo", 1994); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (7, "Santo", 1994); INSERT INTO PLAYER (ID, FIRST, YEAR) VALUES (12, "sa", 1992); SELECT * FROM PLAYER select DISTINCT(FIRST) from player where FIRST IN (select p1.first from player p1 inner join player p2 on p1.year = p2.year+1 inner join player p3 on p2.year = p3.year+1 and p1.first = p2.first and p2.first=p3.first);
----실전문제 ----1 --create table t_tbl1( --t_empno number(4) not null, --t_ename varchar2(10), --t_job varchar2(9), --t_mgr number(4), --t_hiredate date, --t_sal number(7,2), --t_comm number(7,2), --t_deptno number(2), --constraint t_tbl1_kp primary key(t_empno)); -- ----3 --insert into t_tbl1 values ('7369', 'smith', 'clerk', 7902,to_date('1980-12-17','yyyy-mm-dd'), 800, null, 20); --insert into t_tbl1 values ('7566', 'jones', 'manager', 7839,to_date('1981-04-02','yyyy-mm-dd'), 2975, null, 20); --insert into t_tbl1 values ('7788', 'scott', 'analyst', 7566,to_date('1987-07-13','yyyy-mm-dd'), 3000, null, 20); --insert into t_tbl1 values ('7876', 'adams', 'clerk', 7788,to_date('1987-07-13','yyyy-mm-dd'), 1100, null, 20); --insert into t_tbl1 values ('7902', 'ford', 'analyst', 7566,to_date('1981-12-03','yyyy-mm-dd'), 3000, null, 20); -- ----5 --create table t_emp10( --t_empno number(4) not null, --t_ename varchar2(10), --t_job varchar2(9), --t_mgr number(4), --t_hiredate date, --t_sal number(7,2), --t_comm number(7,2), --t_deptno number(2), --constraint t_emp10_pk primary key(t_empno)); -- --insert into t_emp10 values ('7782', 'clark', 'manager', 7902,to_date('1981-06-09','yyyy-mm-dd'), 2450, null, 10); --insert into t_emp10 values ('7839', 'king', 'president', null,to_date('1981-11-17','yyyy-mm-dd'), 5000, null, 10); --insert into t_emp10 values ('7934', 'miller', 'clerk', 7782,to_date('1982-01-23','yyyy-mm-dd'), 1300, null, 10); -- ----7 --alter table t_tbl1 --add (t_gender char(1)); -- ----9 --alter table t_tbl1 --modify(t_gender varchar2(10)); -- ----11 --truncate table t_tbl1; -- ----13 --create table t_emp3( --t_empno number(4) not null, --t_ename varchar2(10), --t_job varchar2(9), --t_mgr number(4), --t_hiredate date, --t_sal number(7,2), --t_comm number(7,2), --t_deptno number(2), --constraint t_emp3_pk primary key(t_empno)); -- ----15 --select * --from USER_CONSTRAINTS --where table_name='T_TBL1'; -- ----17 --create table t_emp2( --t_empno number(4) not null, --t_ename varchar2(10), --t_job varchar2(9), --t_mgr number(4), --t_hiredate date, --t_sal number(7,2), --t_comm number(7,2), --t_deptno number(2) --constraint t_emp2_fk references dept(deptno), --constraint t_emp2_pk primary key(t_empno)); -- --alter table t_emp2 --enable CONSTRAINT t_emp2_fk; -- ----19 --drop table t_emp2; -- ----21 --create or replace view v_emp20 --as select * -- from emp -- where deptno = '20'; -- -- --select * --from v_emp20; -- ----22 --create or replace view v_emp_dept --as select empno,ename,dname -- from emp, dept -- where emp.deptno =dept.deptno; ----23 --SELECT * --from v_emp_dept; -- ----25 --select empno, ename, hiredate --from (select empno, ename, hiredate -- from emp -- where hiredate is not null -- order by hiredate desc) --where rownum < = 5; -- ----27 --select dname --from (select dname,avg(sal) -- from emp,dept -- where emp.deptno = dept.deptno -- group by dname -- order by 2 desc) --where rownum <= 2; -- -- -- ----연습문제 --create table customer( --c_code varchar2(4) not null, --c_name varchar2(30), --c_ceo varchar2(12), --c_addr VARCHAR2(100), --c_phone varchar(13), --constraint customer_pk primary key(c_code)); -- --create table trade( --t_seq number not null, --p_code char(3), --c_code varchar2(4), --t_date date, --t_qty number, --t_cost number, --t_tax number, --constraint trade_pk primary key(t_seq)); -- --create table product( --p_code char(3) not null, --c_name varchar2(30), --p_cost number, --p_group varchar2(30), --constraint product_pk primary key(p_code)); -- --CREATE TABLE STOCK( --P_CODE CHAR(3) not null, --S_QTY NUMBER not null, --S_LASTDATE DATE, --CONSTRAINT P_STK_PK PRIMARY KEY(P_CODE)); -- ----3 --insert into product values ('101','19인치 모니터',150000,'모니터'); --insert into product values ('102','22인치 모니터',200000,'모니터'); --insert into product values ('103','25인치 모니터',260000,'모니터'); --insert into product values ('201','유선마우스',7000,'마우스'); --insert into product values ('202','무선마우스',18000,'마우스'); --insert into product values ('301','유선키보드',8000,'키보드'); --insert into product values ('302','무선키보드',22000,'키보드'); --insert into product values ('401','2채널 스피커',10000,'스피커'); --insert into product values ('402','5.1채널 스피커',120000,'스피커'); -- ----5생성함 -- ----7 --insert into trade --values (61, '131', '101', to_date('2016-04-01', 'yyyy-mm-dd'),10, 150000, 150000); --insert into trade --values (5, '102', '102', to_date('2016-04-26', 'yyyy-mm-dd'),8, 200000, 160000); --insert into trade --values (8, '103', '101', to_date('2016-05-20', 'yyyy-mm-dd'),2, 260000, 52000); --insert into trade --values (3, '201', '103', to_date('2016-04-13', 'yyyy-mm-dd'),7, 7000, 4900); --insert into trade --values (2, '201', '101', to_date('2016-04-12', 'yyyy-mm-dd'),5, 7000, 3500); --insert into trade --values (9, '202', '104', to_date('2016-06-02', 'yyyy-mm-dd'),8, 18000, 14400); --insert into trade --values (6, '301', '103', to_date('2016-05-02', 'yyyy-mm-dd'),12, 8000, 9600); --insert into trade --values (10, '302', '103', to_date('2016-06-09', 'yyyy-mm-dd'),9, 22000, 19800); --insert into trade --values (4, '401', '104', to_date('2016-04-20', 'yyyy-mm-dd'),15, 10000, 15000); --insert into trade --values (11, '401', '105', to_date('2016-06-15', 'yyyy-mm-dd'),20, 10000, 20000); --insert into trade --values (7, '402', '102', to_date('2016-05-08', 'yyyy-mm-dd'),5, 120000, 60000); -- ----9 생성함 -- ----11 --insert into customer values('101','늘푸른회사','김수종','경기도 안산시', '010-1234-5678'); --insert into customer values('102','사랑과바다','박나리','경기도 평택시', '010-1122-3344'); --insert into customer values('103','대한회사','이민수','서울시 구로구', '010-3785-8809'); --insert into customer values('104','하얀기판','허진수','경상북도 포항시', '010-8569-3468'); --insert into customer values('105','한마음한뜻','하민우','인천시 남동구', '010-9455-6033'); -- ----13 생성함 -- ----15 --insert into stock values ('101', 50, to_date('2016-04-01', 'yyyy-mm-dd')); --insert into stock values ('102', 20, to_date('2016-04-26', 'yyyy-mm-dd')); --insert into stock values ('103', 5, to_date('2016-05-20', 'yyyy-mm-dd')); --insert into stock values ('201', 2, to_date('2016-04-13', 'yyyy-mm-dd')); --insert into stock values ('202', 15, to_date('2016-06-02', 'yyyy-mm-dd')); --insert into stock values ('301', 0, to_date('2016-05-02', 'yyyy-mm-dd')); --insert into stock values ('302', 20, to_date('2016-06-09', 'yyyy-mm-dd')); --insert into stock values ('401', 10, to_date('2016-06-15', 'yyyy-mm-dd')); --insert into stock values ('402', 7, to_date('2016-05-08', 'yyyy-mm-dd')); -- ----17 --alter table product --add (비고 char(5)); --select * --from product; -- ----19 비고열의 구조 변경 --alter table product --modify(비고 varchar2(10)); --desc product; -- ----21 비고열 삭제 --alter table product --drop(비고); -- ----23 product 테이블 이름 변경 --rename product to product1; -- ----25 product 내의 모든 데이터 삭제 --truncate table product1; -- ----27 상품정보 테이블 삭제 --drop table product1; --rollback; -- ----29 --alter table stock --add constraint f_p_code foreign key (p_code) --reference product(p_code); -- ----31 --create or replace view v_trade --as select * from trade; -- --select * --from v_trade;
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 22, 2021 at 04:27 AM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.2.34 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: `x` -- -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE `students` ( `id` text NOT NULL, `std_id` varchar(11) NOT NULL, `name` text NOT NULL, `last_name` text NOT NULL, `height` double NOT NULL, `weight` double NOT NULL, `batch` text NOT NULL, `description` text NOT NULL, `address` text NOT NULL, `city` text NOT NULL, `province` text NOT NULL, `country` text NOT NULL, `phone` text NOT NULL, `email` text NOT NULL, `website` varchar(255) NOT NULL, `MAD100` double NOT NULL, `MAD105` double NOT NULL, `MAD110` double NOT NULL, `MAD120` double NOT NULL, `MAD125` double NOT NULL, `MAD200` double NOT NULL, `MAD225` double NOT NULL, `status` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `students` -- INSERT INTO `students` (`id`, `std_id`, `name`, `last_name`, `height`, `weight`, `batch`, `description`, `address`, `city`, `province`, `country`, `phone`, `email`, `website`, `MAD100`, `MAD105`, `MAD110`, `MAD120`, `MAD125`, `MAD200`, `MAD225`, `status`) VALUES ('1', 'A00012345', 'Rajesh', 'Bandi', 1.75, 80, 'Mad Sep 2020', 'Rajesh is a professor...', '1234 King St W', 'Toronto', 'ON', 'CA', '64777777', 'rk@professorrk.com', '', 90, 77, 88, 87, 95, 80, 78, 1); 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 */;
-- MySQL dump 10.13 Distrib 8.0.16, for macos10.14 (x86_64) -- -- Host: localhost Database: Bank -- ------------------------------------------------------ -- Server version 8.0.16 /*!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 */; SET NAMES utf8 ; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `Customer` -- DROP TABLE IF EXISTS `Customer`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `Customer` ( `accno` int(11) NOT NULL, `firstname` varchar(45) DEFAULT NULL, `lastname` varchar(45) DEFAULT NULL, `dob` varchar(45) DEFAULT NULL, `gender` varchar(45) DEFAULT NULL, `mobileno` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, `assigndate` varchar(45) DEFAULT NULL, `validitydate` varchar(45) DEFAULT NULL, `status` varchar(45) DEFAULT NULL, `password` varchar(45) DEFAULT NULL, `pin` varchar(45) DEFAULT NULL, PRIMARY KEY (`accno`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Customer` -- LOCK TABLES `Customer` WRITE; /*!40000 ALTER TABLE `Customer` DISABLE KEYS */; INSERT INTO `Customer` VALUES (100,'Anvesh','Gupta','22-02-2000','Male','9826944324','anveshkvk@gmail.com','09-07-18','09-07-19','Valid','qwerty','4567'),(123,'akash','tiwari','24-10-02','Male','9414584833','akshatgghs@gmail.com','23-04-19','23-04-20','Valid','123','123'),(200,'Sanjeev','Gupta','02-05-72','Male','9826944324','Sanjeev.phed@gmail.com','08-07-19','08-07-20','Valid','Anvesh1234','7890'),(300,'Seema ','Kaushal','3-02-75','Male','7999524161','seemakau@gmail.com','23-04-19','23-04-20','Valid','qwerty','3456'),(400,'Akshat','Gupta','24-10-02','Male','9414584833','akshatgghs@gmail.com','23-04-19','23-04-20','Valid','qwerty','5678'),(500,'Akash','Sharma','12-07-00','Male','1234567890','akashsh@gmail.com','12-02-10','12-02-11','Expired','asdfg','3409'); /*!40000 ALTER TABLE `Customer` 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-07-12 9:22:49
CREATE TABLE `web-task`.`CLIENT_CONNECTIONS`( 'id' int(11) UNSIGNED NOT NULL AUTO_INCREMENT, 'connectionSource' varchar(12) NOT NULL DEFAULT '', 'connectionTime' DATE NOT NULL, 'clientAgent' varchar(100) NOT NULL DEFAULT '', CONSTRAINT PRIMARY KEY ('id') )
alter table cab add checked_counter int;
-- Mar 6, 2008 9:59:53 PM COT -- [ 1909248 ] Translation columns different from original UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2008-03-06 21:59:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14614 ; insert into t_alter_column values('r_mailtext_trl','MailHeader','VARCHAR(2000)',null,'NULL') ; insert into t_alter_column values('r_mailtext_trl','MailHeader',null,'NULL',null) ; UPDATE AD_Column SET FieldLength=0, IsMandatory='N',Updated=TO_TIMESTAMP('2008-03-06 22:16:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15268 ; insert into t_alter_column values('cm_container_element_trl','ContentHTML','TEXT',null,'NULL') ; insert into t_alter_column values('cm_container_element_trl','ContentHTML',null,'NULL',null) ; UPDATE AD_Column SET FieldLength=0, IsMandatory='N',Updated=TO_TIMESTAMP('2008-03-06 22:17:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15380 ; insert into t_alter_column values('cm_cstage_element_trl','ContentHTML','TEXT',null,'NULL') ; insert into t_alter_column values('cm_cstage_element_trl','ContentHTML',null,'NULL',null) ; UPDATE AD_Column SET FieldLength=510,Updated=TO_TIMESTAMP('2008-03-06 22:19:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1410 ; UPDATE AD_Column SET FieldLength=510,Updated=TO_TIMESTAMP('2008-03-06 22:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3330 ; insert into t_alter_column values('m_product_trl','Name','VARCHAR(510)',null,'NULL') ; UPDATE AD_Column SET FieldLength=60,Updated=TO_TIMESTAMP('2008-03-06 22:26:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1410 ; UPDATE AD_Column SET FieldLength=60,Updated=TO_TIMESTAMP('2008-03-06 22:26:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3330 ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:26:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2596 ; insert into t_alter_column values('ad_element','AD_Org_ID','NUMERIC(10)',null,'NULL') ; insert into t_alter_column values('ad_element','AD_Org_ID',null,'NOT NULL',null) ; insert into t_alter_column values('ad_element','Created','TIMESTAMP',null,'NULL') ; insert into t_alter_column values('ad_element','Created','TIMESTAMP',null,'NULL') ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:28:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2599 ; insert into t_alter_column values('ad_element','CreatedBy','NUMERIC(10)',null,'NULL') ; insert into t_alter_column values('ad_element','CreatedBy',null,'NOT NULL',null) ; insert into t_alter_column values('ad_element','Name','VARCHAR(60)',null,'NULL') ; insert into t_alter_column values('ad_element','Name',null,'NOT NULL',null) ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:28:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2601 ; insert into t_alter_column values('ad_element','UpdatedBy','NUMERIC(10)',null,'NULL') ; insert into t_alter_column values('ad_element','UpdatedBy',null,'NOT NULL',null) ; UPDATE AD_Column SET FieldLength=60,Updated=TO_TIMESTAMP('2008-03-06 22:30:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14613 ; UPDATE AD_Column SET FieldLength=0,Updated=TO_TIMESTAMP('2008-03-06 22:30:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15380 ; UPDATE AD_Column SET FieldLength=0,Updated=TO_TIMESTAMP('2008-03-06 22:31:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15268 ; UPDATE AD_Column SET FieldLength=0,Updated=TO_TIMESTAMP('2008-03-06 22:31:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15268 ; UPDATE AD_Column SET FieldLength=0,Updated=TO_TIMESTAMP('2008-03-06 22:32:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15366 ; UPDATE AD_Column SET FieldLength=0,Updated=TO_TIMESTAMP('2008-03-06 22:32:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15257 ; UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2008-03-06 22:34:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15394 ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15588 ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:34:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15589 ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:35:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15307 ; UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2008-03-06 22:35:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=15308 ;
-- PART 2: DDL ALTER TABLE developers ADD tech_lead_id uuid REFERENCES developers (id);
Drop sequence OID_A; Drop sequence OID_V; Drop sequence OID_Mat; Drop sequence OID_Asig; Drop sequence OID_EHD; Drop sequence OID_M; Drop sequence OID_P; Drop sequence OID_S; Drop sequence OID_T; Drop sequence OID_U; Drop sequence OID_Z; Drop sequence OID_F; Drop sequence SEC_asignaturas; Drop sequence SEC_eshijode; Drop sequence SEC_facturas; Drop sequence SEC_matriculas; Drop sequence SEC_modalidades; Drop sequence SEC_salarios; Drop sequence SEC_usuarios; Drop sequence SEC_valoraciones; Drop sequence SEC_zonaresidencias;
CREATE ROLE [PASNotificationServices]
/*==============================================================*/ /* DBMS name: Sybase SQL Anywhere 11 */ /* Created on: 2014/6/17 16:05:02 */ /*==============================================================*/ /*==============================================================*/ /* Table: t_lottery_partner_user */ /*==============================================================*/ drop table if exists t_lottery_partner_user; create table t_lottery_partner_user ( id bigint not null auto_increment comment 'ID', userId bigint not null comment '用户ID', partnerId varchar(64) not null comment '渠道ID', partnerSecond varchar(64) null comment '二级渠道', partnerThird varchar(64) null comment '三级渠道', partnerFourth varchar(64) null comment '四级渠道', primary key (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '渠道商与用户关联关系表'; /*==============================================================*/ /* Table: t_lottery_withdraw_apply */ /*==============================================================*/ drop table if exists t_lottery_withdraw_apply; create table t_lottery_withdraw_apply ( applyId bigint not null auto_increment comment '提现申请ID', userId bigint not null comment '用户ID', realName varchar(64) null comment '用户姓名', partnerId varchar(64) not null comment '渠道ID', serialNumber varchar(64) not null comment '流水号', withdrawAccountId bigint null comment '提款帐号ID', withdrawAmount bigint null comment '提款金额', totalAmount bigint null comment '提款前总金额', auditState smallint not null default 1 comment '审核状态: 1未审核 2审核通过 3审核不通过', auditRemark varchar(256) null comment '审核备注', auditTime datetime null comment '审核时间', auditId bigint null comment '审核人ID', auditName varchar(64) null comment '审核人昵称', partnerApplyId varchar(64) not null comment '提现请求合作商的id', withdrawMsgId varchar(64) null DEFAULT '0' comment '提现任务信息id', createTime datetime not null comment '创建时间', lastUpdateTime timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '最后更新时间', primary key (applyId), unique key partnerApplyId(partnerId, partnerApplyId) )ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '提现申请表'; create index t_lottery_withdraw_apply_userId_index on t_lottery_withdraw_apply(userId); create index t_lottery_withdraw_apply_sn_index on t_lottery_withdraw_apply(serialNumber); /*==============================================================*/ /* Table: t_lottery_user_preapply */ /*==============================================================*/ drop table if exists t_lottery_user_preapply; create table t_lottery_user_preapply ( preApplyId bigint not null auto_increment comment '预申请ID', partnerId varchar(64) not null comment '渠道ID', userId bigint not null comment '用户ID', partnerUniqueNo varchar(64) not null comment '渠道订单唯一号', preMoney bigint not null comment '预存款金额', status smallint not null default 1 comment '申请状态: 1 待审核 2审核通过 3审核未通过', createTime datetime not null comment '创建时间', lastUpdateTime timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '最后更新时间', primary key (preApplyId), unique key partnerUniqueNo(partnerId, partnerUniqueNo) )ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '用户预申请表'; create index t_lottery_user_preapply_userId_index on t_lottery_user_preapply(userId); create index t_lottery_user_preapply_partnerNo_index on t_lottery_user_preapply(partnerUniqueNo); drop table if exists t_lottery_user_id; create table t_lottery_user_id( id bigint not null auto_increment comment '用户ID', tableName varchar(64) not null unique comment '表描述', primary key (id) ) DEFAULT CHARSET=utf8 comment '用户ID生成表'; drop table if exists t_lottery_handsel_daily_count; create table t_lottery_handsel_daily_count ( day DATE NOT NULL DEFAULT '0000-00-00' COMMENT '统计时间', totalHandsel bigint not null default 0 comment '派发的彩金数额', totalInvalidHandsel bigint not null default 0 comment '失效的彩金数额', primary key (day) ) DEFAULT CHARSET=utf8 comment '彩金按日统计表';
with commits_data as ( select r.repo_group as repo_group, c.sha, aa.company_name as company from gha_repos r, gha_commits c, gha_actors_affiliations aa where aa.actor_id = c.dup_actor_id and aa.dt_from <= c.dup_created_at and aa.dt_to > c.dup_created_at and c.dup_repo_id = r.id and c.dup_repo_name = r.name and {{period:c.dup_created_at}} and (lower(c.dup_actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select r.repo_group as repo_group, c.sha, aa.company_name as company from gha_repos r, gha_commits c, gha_actors_affiliations aa where aa.actor_id = c.author_id and aa.dt_from <= c.dup_created_at and aa.dt_to > c.dup_created_at and c.dup_repo_id = r.id and c.dup_repo_name = r.name and c.author_id is not null and {{period:c.dup_created_at}} and (lower(c.dup_author_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select r.repo_group as repo_group, c.sha, aa.company_name as company from gha_repos r, gha_commits c, gha_actors_affiliations aa where aa.actor_id = c.committer_id and aa.dt_from <= c.dup_created_at and aa.dt_to > c.dup_created_at and c.dup_repo_id = r.id and c.dup_repo_name = r.name and c.committer_id is not null and {{period:c.dup_created_at}} and (lower(c.dup_committer_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select r.repo_group as repo_group, cr.sha, aa.company_name as company from gha_repos r, gha_commits_roles cr, gha_actors_affiliations aa where aa.actor_id = cr.actor_id and aa.dt_from <= cr.dup_created_at and aa.dt_to > cr.dup_created_at and cr.dup_repo_id = r.id and cr.dup_repo_name = r.name and cr.actor_id is not null and cr.actor_id != 0 and cr.role = 'Co-authored-by' and {{period:cr.dup_created_at}} and (lower(cr.actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) ), data as ( select aa.company_name as company, r.repo_group, 'contributions' as metric, e.id from gha_events e, gha_repos r, gha_actors_affiliations aa where r.name = e.dup_repo_name and r.id = e.repo_id and e.actor_id = aa.actor_id and aa.dt_from <= e.created_at and aa.dt_to > e.created_at and e.type in ( 'IssuesEvent', 'PullRequestEvent', 'PushEvent', 'PullRequestReviewCommentEvent', 'IssueCommentEvent', 'CommitCommentEvent', 'ForkEvent', 'WatchEvent', 'PullRequestReviewEvent' ) and {{period:e.created_at}} and (lower(e.dup_actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, case e.type when 'PushEvent' then 'pushes' when 'PullRequestReviewCommentEvent' then 'review_comments' when 'PullRequestReviewEvent' then 'reviews' when 'IssueCommentEvent' then 'issue_comments' when 'CommitCommentEvent' then 'commit_comments' end as metric, e.id from gha_events e, gha_repos r, gha_actors_affiliations aa where r.name = e.dup_repo_name and r.id = e.repo_id and aa.actor_id = e.actor_id and aa.dt_from <= e.created_at and aa.dt_to > e.created_at and e.type in ( 'PushEvent', 'PullRequestReviewCommentEvent', 'PullRequestReviewEvent', 'IssueCommentEvent', 'CommitCommentEvent' ) and {{period:e.created_at}} and (lower(e.dup_actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'active_repos' as metric, e.repo_id as id from gha_events e, gha_repos r, gha_actors_affiliations aa where r.name = e.dup_repo_name and r.id = e.repo_id and aa.actor_id = e.actor_id and aa.dt_from <= e.created_at and aa.dt_to > e.created_at and {{period:e.created_at}} and (lower(e.dup_actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'comments' as metric, c.id from gha_repos r, gha_comments c, gha_actors_affiliations aa where r.name = c.dup_repo_name and r.id = c.dup_repo_id and aa.actor_id = c.user_id and aa.dt_from <= c.created_at and aa.dt_to > c.created_at and {{period:c.created_at}} and (lower(c.dup_user_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'issues' as metric, i.id from gha_repos r, gha_issues i, gha_actors_affiliations aa where r.name = i.dup_repo_name and r.id = i.dup_repo_id and aa.actor_id = i.user_id and aa.dt_from <= i.created_at and aa.dt_to > i.created_at and {{period:i.created_at}} and i.is_pull_request = false and (lower(i.dup_user_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'prs' as metric, i.id from gha_repos r, gha_issues i, gha_actors_affiliations aa where r.name = i.dup_repo_name and r.id = i.dup_repo_id and aa.actor_id = i.user_id and aa.dt_from <= i.created_at and aa.dt_to > i.created_at and {{period:i.created_at}} and i.is_pull_request = true and (lower(i.dup_user_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'merged_prs' as metric, i.id from gha_repos r, gha_pull_requests i, gha_actors_affiliations aa where r.name = i.dup_repo_name and r.id = i.dup_repo_id and aa.actor_id = i.user_id and i.merged_at is not null and aa.dt_from <= i.merged_at and aa.dt_to > i.merged_at and {{period:i.merged_at}} and (lower(i.dup_user_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) union select aa.company_name as company, r.repo_group, 'events' as metric, e.id from gha_repos r, gha_events e, gha_actors_affiliations aa where r.name = e.dup_repo_name and r.id = e.repo_id and aa.actor_id = e.actor_id and aa.dt_from <= e.created_at and aa.dt_to > e.created_at and {{period:e.created_at}} and (lower(e.dup_actor_login) {{exclude_bots}}) and aa.company_name in (select companies_name from tcompanies) ) select 'hcom_contrib,' || company || '_' || metric as company_contrib, repo_group, round(hll_cardinality(hll_add_agg(hll_hash_bigint(id)))) as contribs from data group by repo_group, company, metric union select 'hcom_contrib,' || company || '_' || metric as company_contrib, 'All', round(hll_cardinality(hll_add_agg(hll_hash_bigint(id)))) from data group by company, metric union select 'hcom_contrib,' || company || '_commits' as company_contrib, repo_group, round(hll_cardinality(hll_add_agg(hll_hash_text(sha)))) as contribs from commits_data group by repo_group, company union select 'hcom_contrib,' || company || '_commits' as company_contrib, 'All', round(hll_cardinality(hll_add_agg(hll_hash_text(sha)))) from commits_data group by company ;
USE astronomy; INSERT INTO constellations ( name) VALUES ( 'Leo' ); select LAST_INSERT_ID() into @leo_id; INSERT INTO constellations ( name) VALUES ( 'Lyra' ); select LAST_INSERT_ID() into @lyra_id; INSERT INTO constellations ( name) VALUES ( 'Ursa Minor' ); select LAST_INSERT_ID() into @ursaminor_id; INSERT INTO skyobjects (name, url, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Vega', 'http://en.wikipedia.org/wiki/Vega', '18', '36', '56.33635', '1.0', '38', '47', '1.282' ); select LAST_INSERT_ID() into @vega_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @vega_id, @lyra_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Kochab', '14', '50', '42.32580', '1.0', '74', '09', '19.8142' ); select LAST_INSERT_ID() into @kochab_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @kochab_id, @ursaminor_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Denebola', '11', '49', '3.57834', '1.0', '14.0', '34', '19.4090' ); select LAST_INSERT_ID() into @denebola_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @denebola_id, @leo_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Messier 105', '10', '47', '49.6', '1.0', '12.0', '34.0', '54.0' ); select LAST_INSERT_ID() into @messier105_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @messier105_id, @leo_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Messier 96', '10', '46', '45.7', '1.0', '11.0', '49.0', '12.0' ); select LAST_INSERT_ID() into @messier96_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @messier96_id, @leo_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Messier 95', '10', '43', '57.7', '1.0', '11.0', '42.0', '14.0' ); select LAST_INSERT_ID() into @messier95_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @messier95_id, @leo_id ); INSERT INTO skyobjects (name, raHrs, raMin, raSec, decSign, decDeg, decMin, decSec) VALUES ( 'Messier 65', '11.0', '18.0', '55.9', '1.0', '13.0', '5.0', '32.0' ); select LAST_INSERT_ID() into @messier65_id; INSERT INTO skyobject_membership ( skyobjects_id, constellations_id ) VALUES ( @messier65_id, @leo_id );
create table product ( id varchar(32) primary key, code varchar (255) not null, name varchar (255) not null, quantity int not null, price decimal (18,2) not null )
CREATE DATABASE lab14_301d70_normal WITH TEMPLATE lab14_301d70; CREATE TABLE AUTHORS (id SERIAL PRIMARY KEY, name VARCHAR(255)); INSERT INTO authors(name) SELECT DISTINCT author FROM books; ALTER TABLE books ADD COLUMN author_id INT; UPDATE books SET author_id=author.id FROM (SELECT * FROM authors) AS author WHERE books.author = author.name; ALTER TABLE books DROP COLUMN author; ALTER TABLE books ADD CONSTRAINT fk_authors FOREIGN KEY (author_id) REFERENCES authors(id);
/* Navicat MySQL Data Transfer Source Server : 税务云平台 Source Server Type : MySQL Source Server Version : 50727 Source Host : 192.168.248.157:3306 Source Schema : cloudgo-business Target Server Type : MySQL Target Server Version : 50727 File Encoding : 65001 Date: 15/10/2019 21:30:56 */ SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS `CG_CREDIT_LIST`; CREATE TABLE `CG_CREDIT_LIST` ( `F_GUID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'guid', `F_MDLB` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名单类别:4:重点关注名单;8:失信黑名单;2:守信红名单;0:信息概览;1:行政许可;3:行政处罚', `F_ZTLX` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主体类型(法人) / 企业名称', `F_ZCH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注册号', `F_FRDB` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人代表/企业法人姓名/法人信息', `F_LRYY` blob NULL COMMENT '列入名单原因/法律生效文书确定的义务/失信行为情况/内容许可', `F_SJLB` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据类别', `F_SJLY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源', `F_XH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '序号', `F_ZZJGDM` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组织机构代码', `F_ZM` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '罪名', `F_AH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '案号', `F_PJZCJG` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '判决作出机构/作出执行依据单位/认定部门', `F_DYMC` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地域名称(省份)/注册地址', `F_LRBM` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列入部门/信息报送机关/登记机关/许可机关', `F_BZ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', `F_RKSJ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '入库时间/评价年度/许可决定日期', `F_ZXYJWH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行依据文号/文件名/行政许可决定书文号', `F_LXQK` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被执行人的履行情况', `F_JTQX` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '失信被执行人具体情形', `F_FBSJ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发布时间/设立日期/列入日期/成立日期/许可截至日期', `F_LASJ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '立案时间', `F_YLXBF` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '已履行部分', `F_WLXBF` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '未履行部分', `F_ZXGXRQ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最新更新日期', `F_SJJE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '涉及金额', `F_SJGXSJ` timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '数据更新时间', `F_QYMC` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业名称/单位名称/对象名称', `F_DBRZCH` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '代表人注册号', `F_BZXRMC` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被执行人名称/主要负责人/纳税人名称', `F_ZXFY` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行法院', `F_SHXYDM` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '统一社会信用代码', `F_NRLY` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '纳入理由/审核类型', `F_MDMC` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名单名称/地方编码', `F_SXQYDZ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '失信企业地址', `F_FROM` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 eg:信用中国', `F_QYLX` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业类型', `F_CFYJ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cf_YJ', `F_YXQ` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cf_YXQ', `F_FLOWNO` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'flowno', `F_RPST` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'repairState' ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
insert into CURSOS values (0, 'Computacao') insert into CURSOS values (1, 'Artes') insert into CURSOS values (2, 'Medicina') insert into CURSOS values (3, 'Direito') insert into CURSOS values (4, 'Letras') select * from Cursos insert into ALUNOS values (0, 'João', 20) insert into ALUNOS values (1, 'Pedro', 21) insert into ALUNOS values (2, 'Lucas', 22) insert into ALUNOS values (3, 'Amarildo', 22) insert into ALUNOS values (4, 'Victor', 21) insert into ALUNOS values (5, 'Thais', 20) insert into ALUNOS values (6, 'Alisson', 20) insert into ALUNOS values (7, 'Maria', 22) insert into ALUNOS values (8, 'Luisa', 23) insert into ALUNOS values (9, 'Claudia', 22) insert into ALUNOS values (10, 'Andressa', 27) insert into ALUNOS values (11, 'Bianca', 22) insert into ALUNOS values (12, 'Carlos', 20) insert into ALUNOS values (13, 'Leticia', 20) insert into ALUNOS values (14, 'Bilbo', 21) insert into ALUNOS values (15, 'Sandro', 21) insert into ALUNOS values (16, 'Saori', 20) insert into ALUNOS values (17, 'Kepler', 20) insert into ALUNOS values (18, 'Verissimo', 18) insert into ALUNOS values (19, 'Lorena', 19) insert into ALUNOS values (20, 'Sara', 22) select * from ALUNOS where idade = 22 insert into TURMAS values (0, 0, 'Banco de dados'); insert into TURMAS values (1, 0, 'Grafos'); insert into TURMAS values (2, 0, 'Computação Gráfica'); insert into TURMAS values (3, 0, 'Inteligencia A'); insert into TURMAS values (4, 1, 'Pintura de Quadros'); insert into TURMAS values (5, 1, 'Historia da arte'); insert into TURMAS values (6, 2, 'Anatomia'); insert into TURMAS values (7, 2, 'Cardiologia'); insert into TURMAS values (8, 3, 'Civil'); insert into TURMAS values (9, 3, 'Trabalhista'); insert into TURMAS values (10, 4, 'Inglês'); insert into TURMAS values (11, 4, 'Espanhol'); select * from TURMAS insert into ALUNO_TURMA values (0, 0) insert into ALUNO_TURMA values (0, 1) insert into ALUNO_TURMA values (0, 2) insert into ALUNO_TURMA values (0, 3) insert into ALUNO_TURMA values (1, 0) insert into ALUNO_TURMA values (1, 1) insert into ALUNO_TURMA values (1, 5) insert into ALUNO_TURMA values (1, 3) insert into ALUNO_TURMA values (1, 4) insert into ALUNO_TURMA values (2, 3) insert into ALUNO_TURMA values (2, 4) insert into ALUNO_TURMA values (3, 1) insert into ALUNO_TURMA values (3, 5) insert into ALUNO_TURMA values (4, 6) insert into ALUNO_TURMA values (4, 7) insert into ALUNO_TURMA values (4, 8) insert into ALUNO_TURMA values (5, 6) insert into ALUNO_TURMA values (5, 7) insert into ALUNO_TURMA values (6, 9) insert into ALUNO_TURMA values (6, 11) insert into ALUNO_TURMA values (7, 9) insert into ALUNO_TURMA values (7, 10) insert into ALUNO_TURMA values (7, 11) insert into ALUNO_TURMA values (8, 12) insert into ALUNO_TURMA values (8, 13) insert into ALUNO_TURMA values (8, 14) insert into ALUNO_TURMA values (8, 15) insert into ALUNO_TURMA values (8, 16) insert into ALUNO_TURMA values (9, 14) insert into ALUNO_TURMA values (9, 15) insert into ALUNO_TURMA values (9, 16) insert into ALUNO_TURMA values (10, 17) insert into ALUNO_TURMA values (10, 18) insert into ALUNO_TURMA values (10, 19) insert into ALUNO_TURMA values (11, 20) select * from aluno_TURMA select c.descricao, a.nome from ALUNOS a, ALUNO_TURMA b, TURMAS c where a.matricula=b.matricula_aluno and b.id_turma=1 and c.id_turma=b.id_turma order by a.nome select c.descricao, d.nome from TURMAS c inner join (select a.nome, b.id_turma from ALUNOS a inner join ALUNO_TURMA b on a.matricula=b.matricula_aluno) d on d.id_turma=c.id_turma order by c.id_turma , d.nome
CREATE DATABASE chat; USE chat; CREATE TABLE messages ( id int NOT NULL AUTO_INCREMENT, userid int NOT NULL, text VARCHAR(200) NOT NULL, roomname VARCHAR(20), PRIMARY KEY(ID) ); CREATE TABLE users ( id int NOT NULL AUTO_INCREMENT, username VARCHAR(40) NOT NULL, PRIMARY KEY(ID) ); -- CREATE TABLE users ( -- userid INT(30) AUTO_INCREMENT PRIMARY KEY, -- username VARCHAR(30) NOT NULL -- ); -- CREATE TABLE rooms ( -- roomID INT(30) AUTO_INCREMENT PRIMARY KEY, -- roomname VARCHAR(15) NOT NULL -- ); -- CREATE TABLE messages ( -- /* Describe your table here.*/ -- messageID INT(30) AUTO_INCREMENT PRIMARY KEY, -- message VARCHAR(300) NOT NULL, -- userID INT(30) REFERENCES users(userID), -- roomID INT(30) REFERENCES rooms(roomID) -- ); /* Execute this file from the command line by typing: * mysql -u root < server/schema.sql * to create the database and the tables.*/
CREATE OR REPLACE TRIGGER TRIGGER_5_TITULARES BEFORE INSERT OR UPDATE ON JUGADOR FOR EACH ROW DECLARE v_num_titulares NUMBER(2); BEGIN SELECT COUNT(*) INTO v_num_titulares FROM JUGADOR WHERE titularidad = 1; IF INSERTING THEN IF(v_num_titulares >= 5 AND :new.titularidad = 1) THEN RAISE_APPLICATION_ERROR(-20008, 'Solo puede haber 5 titulares en la plantilla'); END IF; ELSIF UPDATING THEN IF(v_num_titulares = 5 AND :old.titularidad = 0 AND :new.titularidad = 1) THEN RAISE_APPLICATION_ERROR(-20008, 'Solo puede haber 5 titulares en la plantilla'); END IF; END IF; END TRIGGER_5_TITULARES; --ELSIF NOT TESTED, WORKS WITH IF
--添加菜单 DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_sys_res WHERE res_name='贸易融资还款申请' and sys_code='cms'; IF VN_COUNT < 1 THEN insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) values ((select max(RES_CODE) + 1 from bt_sys_res), '贸易融资还款申请', 'cms', (select max(res_code) from bt_sys_res where res_name='贸易融资' and sys_code='cms' and res_url is null), '/cms/financ_add.jsp?flag=repayadd', '0', '0', '0', '0', 17, '', '', '', '', '', '', null, null, null, null, null, 2, ''); END IF; COMMIT; END; / DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_sys_res WHERE res_name='贸易融资还款修改' and sys_code='cms'; IF VN_COUNT < 1 THEN insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) values ((select max(RES_CODE) + 1 from bt_sys_res), '贸易融资还款修改', 'cms', (select max(res_code) from bt_sys_res where res_name='贸易融资' and sys_code='cms' and res_url is null), '/cms/financ_add.jsp?flag=repaysave', '0', '0', '0', '0', 18, '', '', '', '', '', '', null, null, null, null, null, 2, ''); END IF; COMMIT; END; / DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_sys_res WHERE res_name='贸易融资还款打回' and sys_code='cms'; IF VN_COUNT < 1 THEN insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) values ((select max(RES_CODE) + 1 from bt_sys_res), '贸易融资还款打回', 'cms', (select max(res_code) from bt_sys_res where res_name='贸易融资' and sys_code='cms' and res_url is null), '/cms/financ_add.jsp?flag=repaycallback', '0', '0', '0', '0', 19, '', '', '', '', '', '', null, null, null, null, null, 2, ''); END IF; COMMIT; END; / DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_sys_res WHERE res_name='贸易融资还款补录' and sys_code='cms'; IF VN_COUNT < 1 THEN insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE) values ((select max(RES_CODE) + 1 from bt_sys_res), '贸易融资还款补录', 'cms', (select max(res_code) from bt_sys_res where res_name='贸易融资' and sys_code='cms' and res_url is null), '/cms/financ_add.jsp?flag=repayrecord', '0', '0', '0', '0', 20, '', '', '', '', '', '', null, null, null, null, null, 2, ''); END IF; COMMIT; END; / --添加审批流 DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM bt_approve_business WHERE BUSINESS_CODE='cms_tradefin3'; IF VN_COUNT < 1 THEN insert into bt_approve_business (BUSINESS_CODE, SYS_CODE, BUSINESS_NAME, BUSINESS_LEVEL, TABLE_NAME, MONEY_FIELD, NEXT_CHECKER_FIELD, BILL_CODE_FIELD, URL1, CLASS_PATH) values ('cms_tradefin3', 'cms', '贸易融资还款', 'A,B,C', 'financ_loan_repay', 'repay_money', 'next_checker', 'bill_code', '../finance/TradeFinancingRepayShowInclude.jsp', 'com.byttersoft.cms.form.TradeFinancingRepayForm'); END IF; COMMIT; END; / --添加编号生成 DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM BT_KEY_GENERATOR WHERE TABLENAME='FINANC_LOAN_REPAY' and KEYALISENAME='TradeFinancingRepayCode'; IF VN_COUNT < 1 THEN INSERT INTO BT_KEY_GENERATOR (ID, TABLENAME, KEYALISENAME, CUSTGENCLASS, GENSTRATE) VALUES (NVL((SELECT MAX(ID) FROM BT_KEY_GENERATOR), 0) + 1, 'FINANC_LOAN_REPAY', 'TradeFinancingRepayCode', 'com.byttersoft.cms.service.TradeFinancingRepayKeyGenerator', 'cu'); END IF; COMMIT; END; /
-- -------------------------------------------------------- -- -- Table structure for table `nepse_company_type` -- DROP TABLE IF EXISTS `nepse_company_type`; CREATE TABLE `nepse_company_type` ( `type_id` int(5) NOT NULL, `type_name` varchar(25) NOT NULL, `status` bit(1) NOT NULL DEFAULT b'1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `nepse_company_type` -- INSERT INTO `nepse_company_type` (`type_id`, `type_name`, `status`) VALUES (1, 'Hotels', b'1'), (2, 'Banking', b'1'), (3, 'Insurance', b'1'), (4, 'Hydropower', b'1'), (5, 'Microfinance', b'1'), (6, 'Finance', b'1'), (7, 'Mutual Fund', b'1'), (8, 'Others', b'1'), (9, 'Production', b'1');
--PROBLEM 05 --Extract from the database, all travel cards. Sort the results by card number ascending. --Required Columns --• CardNumber --• JobDuringJourney SELECT CardNumber ,JobDuringJourney FROM TravelCards ORDER BY CardNumber
INSERT INTO kstream.roles (name) VALUES ('admin'); SET @adminRoleId = LAST_INSERT_ID(); INSERT INTO kstream.roles (name) VALUES ('user'); SET @userRoleId = LAST_INSERT_ID(); INSERT INTO kstream.users (username, password, email, disabled, last_login) VALUES ('kayani', '$2a$10$QVLzEvKS1AGoTmM4sl.wbe0hki9MOah6FEU5/T8WqUy6CLVk3qG7S', 'kayani.u@gmail.com', 0, NOW()); SET @userId = LAST_INSERT_ID(); INSERT INTO kstream.users (username, password, email, disabled, last_login) VALUES ('admin', '$2a$10$uPTCvDJ/9IXV2QT01/hgNuQaW3n3L9qJtaCLFYV4EivJPpyHRT.vm', 'saltan23@gmail.com', 0, NOW()); SET @adminId = LAST_INSERT_ID(); INSERT INTO kstream.user_roles (user_id, role_id) VALUES (@userId, @userRoleId), (@adminId, @adminRoleId);
DROP DATABASE IF EXISTS `pyrates`; CREATE DATABASE IF NOT EXISTS `pyrates`; USE `pyrates`; DROP TABLE IF EXISTS `famous_pyrates`; CREATE TABLE IF NOT EXISTS `famous_pyrates`( id TINYINT PRIMARY KEY AUTO_INCREMENT NOT NULL, name VARCHAR(50) UNIQUE NOT NULL DEFAULT "no_name", surname VARCHAR(50) NOT NULL DEFAULT "no_surname", nickname VARCHAR(50) NOT NULL DEFAULT "no_nickname", birth_place VARCHAR(50) NOT NULL DEFAULT 'no_city', death_place VARCHAR(50) NOT NULL DEFAULT 'no_city', birth_date DATE NOT NULL DEFAULT '1000-01-01', death_date DATE NOT NULL DEFAULT '1000-01-01', sex ENUM("F","M","A","G") NOT NULL DEFAULT "F" ); CREATE TABLE IF NOT EXISTS `ships`( id TINYINT PRIMARY KEY AUTO_INCREMENT NOT NULL, name VARCHAR(50) /*UNIQUE*/ NOT NULL DEFAULT "no_name", owner_id TINYINT NOT NULL DEFAULT 0, quantity TINYINT NOT NULL DEFAULT 1 ); INSERT INTO `ships` (name, owner_id) VALUES ("Man'o war", 1 ) ON DUPLICATE KEY UPDATE quantity = quantity + 1; INSERT INTO `ships` (name, owner_id) VALUES ("Man'o war", 1 ) ON DUPLICATE KEY UPDATE quantity = quantity + 1; INSERT INTO `ships` (name, owner_id) VALUES ("Man'o war", 1 ) ON DUPLICATE KEY UPDATE quantity = quantity + 1; INSERT INTO `famous_pyrates` (`name` , `surname` ,`nickname` ,`birth_place` ,`death_place` ,`birth_date` , `death_date`, `sex` ) VALUES ("Teach", "Edward" ,"Black Beard" ,"Bristol" ,"Ocracoke" ,"1680-01-01" , "1718-11-22", "A"), ("Vane" , "Charles" ,"?" ,"London" ,"Port Royal" ,"1680-01-01" , "1721-03-29", "M"), ("Kidd" , "William" ,"?" ,"Greenock" ,"Wapping" ,"1645-01-01" , "1701-05-23", "G"); ALTER TABLE `ships` ADD `is_unique_ship` ENUM("1","0") NOT NULL DEFAULT "0" AFTER `name`; ALTER TABLE `famous_pyrates` MODIFY `name` VARCHAR(30) UNIQUE NOT NULL DEFAULT "no_name";
select --customer_segment, count(distinct customer_id)customer_cnt, count(distinct order_id)order_cnt FROM( select case when segment_group = 'HighestValue' and value_90_days > 1500 then 'Purple' when segment_group = 'HighestValue' then 'Green' when segment_group = 'Medium' then 'Orange' else segment_group end as customer_segment, mo.customer_id, order_id::varchar(255) from analytics.merch_order mo /*ADD 90 day value*/ LEFT JOIN( SELECT customer_id, year(run_dt) as year, week(run_dt) as wk, value_90_days FROM analytics.marketing_engagement_segments WHERE segment_group = 'HighestValue' and value_90_days > 1500 and run_dt > '2013-11-01' GROUP BY 1,2,3,4 )me on me.customer_id=mo.customer_id and me.wk = mo.retail_week and me.year = mo.retail_year /*FILTER FOR ONLY 1 ORDER*/ JOIN( SELECT custaccount, count(distinct salesid) order_cnt FROM ANALYTICS.Salesline_based_shipping where datetime_order between '2014-01-01' and '2014-04-01' GROUP BY 1 HAVING count(distinct salesid) = 1)mo2 on mo2.custaccount = mo.customer_id /*QUERY CONTINUES*/ WHERE retail_year = 2014 )q1 /*)duplicatecheck group by 1,2 having count(*) > 1*/
USE dict_term; INSERT INTO admin VALUES ("lvribeiro", "Lucas Ribeiro", "11235813", 1); INSERT INTO admin VALUES ("gord", "Otávio Goes", "73213712", 1); INSERT INTO admin VALUES ("vcamargo", "Vitor Bueno", "1234", 1); INSERT INTO gramatica VALUES('sf', 'substantivo feminino'); INSERT INTO gramatica VALUES('sm', 'substantivo masculino'); INSERT INTO gramatica VALUES('adj', 'adjetivo'); INSERT INTO tipo VALUES('categoria 1', 'teste'); INSERT INTO tipo VALUES('categoria 2', 'teste'); INSERT INTO termo VALUES ('termo 1', 'sf', 't1', 'variante 1; variante 2', 'fra1; fas2', 'teste definicao', 'teste contexto', 'teste nota', 'termo uno', 'vcamargo', 'categoria 1'); INSERT INTO termo VALUES ('termo 2', 'sm', 't2', 'variante 3; variante 4', 'fra3; fas4', 'teste definicao', 'teste contexto', 'teste nota', 'termo do', 'vcamargo', 'categoria 1'); INSERT INTO termo VALUES ('termo 3', 'sf', 't3', 'variante 1; variante 3', 'fra1; fas3', 'teste definicao', 'teste contexto', 'teste nota', 'termo tres', 'vcamargo', 'categoria 2'); INSERT INTO termo VALUES ('termo 4', 'sm', 't4', 'variante 2; variante 4', 'fra2; fas4', 'teste definicao', 'teste contexto', 'teste nota', 'termo cuatro', 'vcamargo', 'categoria 2'); INSERT INTO termo VALUES ('termo 5', 'adj', 't5', 'var 5; var 4', 'fr3', 'teste', 'te', 'tes', 'termo cinco', 'vcamargo', 'categoria 1');
ALTER TABLE via_activity ADD (Reminder smallint DEFAULT NULL); ALTER TABLE via_activity ADD (ReminderSent NUMBER(1,0) DEFAULT NULL); ALTER TABLE via_activity ADD (IsNewVia NUMBER(1,0) DEFAULT NULL); ALTER TABLE via_activity ADD (EnrollmentType smallint DEFAULT NULL); UPDATE via_activity SET EnrollmentType = 0 ; UPDATE via_activity SET EnrollmentType = 2 WHERE ActivityID IN(SELECT DISTINCT ActivityID FROM via_activitygroups);
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 18, 2020 at 01:03 PM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ungfood` -- -- -------------------------------------------------------- -- -- Table structure for table `usertable` -- CREATE TABLE `usertable` ( `id` int(11) NOT NULL, `ChooseType` text COLLATE utf8_unicode_ci NOT NULL, `Name` text COLLATE utf8_unicode_ci NOT NULL, `User` text COLLATE utf8_unicode_ci NOT NULL, `Password` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `usertable` -- INSERT INTO `usertable` (`id`, `ChooseType`, `Name`, `User`, `Password`) VALUES (1, 'User', 'TestName1', 'user1', '1'), (2, 'User', 'TestName2', 'user2', '1234'), (3, 'User', 'TestName3', 'user3', '1234'), (4, 'Shop', 'สมชาย', 'Shop1', '1'), (5, 'User', 'สมหญิง', 'test2', '1'), (6, 'User', 'test3', 'test3', '1'), (7, 'Rider', 'test4', 'Rider1', '1'), (8, 'Shop', 'test5', 'test5', '1'), (9, 'User', 'test6', 'test6', '1'); -- -- Indexes for dumped tables -- -- -- Indexes for table `usertable` -- ALTER TABLE `usertable` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `usertable` -- ALTER TABLE `usertable` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select "*** ID, name, and GPA of students who applied in CS ***"; select "*** GPA of students who applied in CS ***"; select "*** ID of students who have applied in CS but not in EE ***"; select "*** colleges with another college in the same state ***"; select "*** colleges with highest enrollment ***"; select "*** students with highest GPA ***";
create database shirts_db; use shirts_db; create table shirts( shirt_id int not null auto_increment, article varchar(25), color varchar(25), shirt_size varchar(3), last_worn int, Primary key(shirt_id)); insert into shirts values (1,'t-shirt', 'white', 'S', 10), (2,'t-shirt', 'green', 'S', 200), (3,'polo shirt', 'black', 'M', 10), (4,'tank top', 'blue', 'S', 50), (5,'t-shirt', 'pink', 'S', 0), (6,'polo shirt', 'red', 'M', 5), (7,'tank top', 'white', 'S', 200), (8,'tank top', 'blue', 'M', 15) ; insert into shirts (shirt_id,color,article,shirt_size,last_worn) values (9, "purple", "polo shirt", "M",50); select article,color from shirts; select article,color,shirt_size,last_worn from shirts where shirt_size = "M"; update shirts set shirt_size = "L" where article = "polo shirt"; update shirts set last_worn = 0 where last_worn = 15; update shirts set shirt_size = "XS" , color = "off white" where color = "white"; delete from shirts where last_worn = 200; delete from shirts where article = "tank top"; delete from shirts;
CREATE PROCEDURE sp_Amend_PO (@PONumber Int,@OldPONumber Int,@OldDocID Int,@OldDocRef nvarchar(255)) as Begin Update POAbstract set Status = (isnull(status,0) | 136) where PONumber = @OldPONumber Update POAbstract set Status = IsNull(Status,0) | 8 where PONumber = @PONumber Update POAbstract set POIDReference=@OldPONumber,DocumentID=@OldDocID,DocumentReference=@OldDocRef Where PONumber=@PONumber End
-- SPDX-License-Identifier: Apache-2.0 -- Copyright Contributors to the ODPi Egeria project. create database "LocationDatabase" encoding 'UTF8'; \c "LocationDatabase"; drop table IF EXISTS "WorkLocation" ; CREATE TABLE "WorkLocation" ( "WLID" INT NOT NULL, "WLName" VARCHAR(40) NOT NULL, "ADDR1" VARCHAR(40), "ADDR2" VARCHAR(40), "ADDR3" VARCHAR(40), "ADDR4" VARCHAR(40), "ADDR5" VARCHAR(40), "ADDR6" VARCHAR(40), "ADDR7" VARCHAR(40) ) ; \copy "WorkLocation" from '../LocationDatabase-WorkLocation.csv' with csv header DELIMITER ';' ;
-- 1. Monte uma query que exiba a diferença de dias entre '2030-01-20' e hoje. SELECT DATEDIFF('2030-01-20',CURRENT_DATE()) AS 'Diferença entre 20/01/2030 e hoje'; -- 2. Monte uma query que exiba a diferença de horas entre '10:25:45' e '11:00:00'. SELECT TIMEDIFF('11:00:00','10:25:45') AS 'Diferença entre 10:25:45 e 11:00:00';
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50559 Source Host : localhost:3306 Source Database : nterp Target Server Type : MYSQL Target Server Version : 50559 File Encoding : 65001 Date: 2018-09-26 21:48:04 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for gongyingshangwanglai -- ---------------------------- DROP TABLE IF EXISTS `gongyingshangwanglai`; CREATE TABLE `gongyingshangwanglai` ( `uuid` int(11) NOT NULL AUTO_INCREMENT, `fukuanleixing` varchar(20) DEFAULT NULL, `gongyingshangmingcheng` varchar(255) DEFAULT NULL, `shiyou` varchar(255) DEFAULT NULL, `zhifufangshi` varchar(255) DEFAULT NULL, `fapiaoxinxi` varchar(255) DEFAULT NULL, `fapiaoshuilv` varchar(255) DEFAULT NULL, `hetongzongjine` double DEFAULT NULL, `yifukuanjine` double DEFAULT NULL, `fukuanriqi` date DEFAULT NULL, `rukuzongjine` double DEFAULT NULL, `zhuangtai` varchar(255) DEFAULT NULL, `shenqingriqi` date DEFAULT NULL, `bumen` varchar(255) DEFAULT NULL, `jingbanren` varchar(255) DEFAULT NULL, PRIMARY KEY (`uuid`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of gongyingshangwanglai -- ---------------------------- INSERT INTO `gongyingshangwanglai` VALUES ('1', null, '1', null, null, null, null, '1', null, null, null, null, null, null, null);
create procedure sp_acc_insertmanualjournalnewreference(@ReferenceNo nVarchar(15), @Amount Decimal(18,6),@PrefixType Int ,@Remarks nvarchar(255),@TransactionID Int, @DocumentID Int,@AccountID Int,@DocumentDate DateTime,@RefID Int = 0) as Insert ManualJournal(ReferenceNo, Amount, Balance, PrefixType, Remarks, TransactionID, DocumentID, AccountID, DocumentDate, ReferenceID) Values (@ReferenceNo, @Amount, @Amount, @PrefixType, @Remarks, @TransactionID, @DocumentID, @AccountID, @DocumentDate, @RefID) Select @@Identity
-- ******************************************************************************** -- Generated by: Select Database Schema File Generator -- Model: \\Enabler\SRV-WIN-UTV-02\Prosjekter\Passopp sp°rreskjema\0 -- Filename: C:\ojn2\kunnskapssenteret\questionarebank\skjemabank.sql -- Database: SQLSERVER -- Mapping: Default -- Date: 01. Oct 2008 -- ******************************************************************************** CREATE TABLE tblundersokelseseier ( undersokelseseierid serial NOT NULL, eiernavn TEXT NULL, PRIMARY KEY ( undersokelseseierid ) ); CREATE TABLE tbllitteraturreferanse ( littrefid serial NOT NULL, sporreskjemaid INT NOT NULL, undersokelseid INT NOT NULL, referanse TEXT NULL, PRIMARY KEY ( littrefid ) ); CREATE TABLE tbltema ( temaid serial NOT NULL, tematekst TEXT NULL, tematittel TEXT NULL, PRIMARY KEY ( temaid ) ); CREATE TABLE tblnokkelord ( informantid serial NOT NULL, nokkelord TEXT NULL, PRIMARY KEY ( informantid ) ); CREATE TABLE tblsvarskala ( svarskalaid serial NOT NULL, inputtypeid INT NOT NULL, antsvarkategorier INT NULL, anker1 TEXT NULL, anker2 TEXT NULL, laveste INT NULL, hoyeste INT NULL, intervall INT NULL, PRIMARY KEY ( svarskalaid ) ); CREATE TABLE tblindeks ( indeksid serial NOT NULL, subindeks INT NULL, sporreskjemaid INT NULL, indeksnummer INT NULL, indekstekst TEXT NULL, formel TEXT NULL, PRIMARY KEY ( indeksid ) ); CREATE TABLE tblundersokelse ( undersokelseid serial NOT NULL, sporreskjemaid INT NOT NULL, undersokelseseierid INT NOT NULL, undersokelesesnavn TEXT NULL, arstall INT NULL, publiseringdato timestamp without time zone NULL, datainnsamlingsar INT NULL, hensikt TEXT NULL, PRIMARY KEY ( undersokelseid ) ); CREATE TABLE tblskjemakonto ( kontoid serial NOT NULL, kontonavn TEXT NULL, opprettetdato timestamp without time zone NULL, PRIMARY KEY ( kontoid ) ); CREATE TABLE tblsvarlinje ( svarlinjeid serial NOT NULL, sporsmalid INT NOT NULL, svarskalaid INT NOT NULL, altsvartekst TEXT NULL, svarrekkefolge INT NULL, maxverdi INT NULL, minverdi INT NULL, notatfelt TEXT NULL, nesteSporsmalnr INT NULL, PRIMARY KEY ( svarlinjeid ) ); CREATE TABLE tblskjemakommentar ( skjemakommentarid serial NOT NULL, sporreskjemaid INT NOT NULL, kommentartekst TEXT NULL, kommentardato timestamp without time zone NULL, PRIMARY KEY ( skjemakommentarid ) ); CREATE TABLE tblskjemalinje ( skjemalinjeid serial NOT NULL, sporreskjemaid INT NOT NULL, sporsmalid INT NOT NULL, skjemakommentar TEXT NULL, sporsmalnummer INT NULL, obligatorisk INT NULL, PRIMARY KEY ( skjemalinjeid ) ); CREATE TABLE tblinstitusjon ( institusjonid serial NOT NULL, foretakid INT NOT NULL, undersokelseid INT NOT NULL, institusjonstypeid INT NOT NULL, insitusjonsnavn TEXT NULL, addresse TEXT NULL, avdelingtelefon TEXT NULL, institusjonsdato CHAR (25) NULL, PRIMARY KEY ( institusjonid ) ); -- WARNING: Default Datatype of CHAR (25) used for empty datatype CREATE TABLE tblinputtype ( inputtypeid serial NOT NULL, feltbeskrivelse TEXT NULL, PRIMARY KEY ( inputtypeid ) ); CREATE TABLE tblsporsmalinje ( sporsmalid INT NOT NULL, temaid INT NOT NULL, PRIMARY KEY ( sporsmalid, temaid ) ); CREATE TABLE tblsporsmal ( sporsmalid serial NOT NULL, partid INT NULL, sporsmaltekst TEXT NOT NULL, kortversjontekst TEXT NULL, notater TEXT NULL, visnotater INT NULL, PRIMARY KEY ( sporsmalid ) ); CREATE TABLE tbltemalinje ( temaid INT NOT NULL, indeksid INT NOT NULL, PRIMARY KEY ( temaid, indeksid ) ); CREATE TABLE tbleier ( eierid serial NOT NULL, eiernavn TEXT NULL, eiersted TEXT NULL, PRIMARY KEY ( eierid ) ); CREATE TABLE tblsporreskjema ( sporreskjemaid serial NOT NULL, instrumentid INT NULL, kontoid INT NULL, eierid INT NULL, skjemanavn TEXT NULL, skjemadato timestamp without time zone NULL, kommentarskjema TEXT NULL, skjemakode VARCHAR (10) NULL, instrumentflag VARCHAR (3) NULL, PRIMARY KEY ( sporreskjemaid ) ); CREATE TABLE tblinstitusjonstype ( institusjonstypeid serial NOT NULL, institusjonstype TEXT NULL, PRIMARY KEY ( institusjonstypeid ) ); CREATE TABLE tblforetak ( foretakid serial NOT NULL, foretaknavn TEXT NOT NULL, foretaksadresse TEXT NULL, telefon TEXT NULL, epost TEXT NULL, regionid INT NOT NULL, foretakdato timestamp without time zone NULL, PRIMARY KEY ( foretakid ) ); CREATE TABLE tblregion ( regionid serial NOT NULL, regionnavn TEXT NOT NULL, PRIMARY KEY ( regionid ) ); CREATE TABLE tblbruker ( brukerid serial NOT NULL, epost TEXT NOT NULL, passord TEXT NOT NULL, PRIMARY KEY ( brukerid ) ); CREATE TABLE tblavdelingkontolinje ( institusjonid INT NOT NULL, kontoid INT NOT NULL, PRIMARY KEY ( institusjonid, kontoid ) ); CREATE TABLE tblkontobrukerlinje ( kontoid INT NOT NULL, brukerid INT NOT NULL, PRIMARY KEY ( kontoid, brukerid ) ); CREATE TABLE tblnokkelordlinje ( informantid INT NOT NULL, undersokelseid INT NOT NULL, PRIMARY KEY ( informantid, undersokelseid ) ); CREATE TABLE tblnokkelordskjemalinje ( informantid INT NOT NULL, sporreskjemaid INT NOT NULL, PRIMARY KEY ( informantid, sporreskjemaid ) ); CREATE TABLE tblindekslinje ( indeksid INT NOT NULL, sporsmalid INT NOT NULL, PRIMARY KEY ( indeksid, sporsmalid ) ); ALTER TABLE tblindekslinje ADD CONSTRAINT indekssporsmal FOREIGN KEY ( indeksid ) REFERENCES tblindeks ( indeksid ); ALTER TABLE tblindekslinje ADD CONSTRAINT sporsmalindeks FOREIGN KEY ( sporsmalid ) REFERENCES tblsporsmal ( sporsmalid ); ALTER TABLE tblnokkelordlinje ADD CONSTRAINT nokkelundersokelse FOREIGN KEY ( informantid ) REFERENCES tblnokkelord ( informantid ); ALTER TABLE tblnokkelordlinje ADD CONSTRAINT undersokelsenokkel FOREIGN KEY ( undersokelseid ) REFERENCES tblundersokelse ( undersokelseid ); ALTER TABLE tblnokkelordskjemalinje ADD CONSTRAINT nokkelskjema FOREIGN KEY ( informantid ) REFERENCES tblnokkelord ( informantid ); ALTER TABLE tblnokkelordskjemalinje ADD CONSTRAINT skjemanokkel FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tbllitteraturreferanse ADD CONSTRAINT skjemareferanse FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tbllitteraturreferanse ADD CONSTRAINT undersokelsereferanse FOREIGN KEY ( undersokelseid ) REFERENCES tblundersokelse ( undersokelseid ); ALTER TABLE tblsvarskala ADD CONSTRAINT inputtype FOREIGN KEY ( inputtypeid ) REFERENCES tblinputtype ( inputtypeid ); ALTER TABLE tblindeks ADD CONSTRAINT skjemaindeks FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tblindeks ADD CONSTRAINT subindeks FOREIGN KEY ( subindeks ) REFERENCES tblindeks ( indeksid ); ALTER TABLE tblundersokelse ADD CONSTRAINT delav FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tblundersokelse ADD CONSTRAINT undersokelseeier FOREIGN KEY ( undersokelseseierid ) REFERENCES tblundersokelseseier ( undersokelseseierid ); ALTER TABLE tblsvarlinje ADD CONSTRAINT sporsmalsvar FOREIGN KEY ( sporsmalid ) REFERENCES tblsporsmal ( sporsmalid ); ALTER TABLE tblsvarlinje ADD CONSTRAINT svarsporsmal FOREIGN KEY ( svarskalaid ) REFERENCES tblsvarskala ( svarskalaid ); ALTER TABLE tblskjemakommentar ADD CONSTRAINT skjemakommentar FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tblskjemalinje ADD CONSTRAINT skjemasporsmal FOREIGN KEY ( sporreskjemaid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tblskjemalinje ADD CONSTRAINT sporsmalskjema FOREIGN KEY ( sporsmalid ) REFERENCES tblsporsmal ( sporsmalid ); ALTER TABLE tblinstitusjon ADD CONSTRAINT foretakavdeling FOREIGN KEY ( foretakid ) REFERENCES tblforetak ( foretakid ); ALTER TABLE tblinstitusjon ADD CONSTRAINT gjennomforti FOREIGN KEY ( undersokelseid ) REFERENCES tblundersokelse ( undersokelseid ); ALTER TABLE tblinstitusjon ADD CONSTRAINT institusjonstype FOREIGN KEY ( institusjonstypeid ) REFERENCES tblinstitusjonstype ( institusjonstypeid ); ALTER TABLE tblsporsmalinje ADD CONSTRAINT sporsmaltema FOREIGN KEY ( sporsmalid ) REFERENCES tblsporsmal ( sporsmalid ); ALTER TABLE tblsporsmalinje ADD CONSTRAINT temasporsmal FOREIGN KEY ( temaid ) REFERENCES tbltema ( temaid ); ALTER TABLE tblsporsmal ADD CONSTRAINT part FOREIGN KEY ( partid ) REFERENCES tblsporsmal ( sporsmalid ); ALTER TABLE tbltemalinje ADD CONSTRAINT indekstema FOREIGN KEY ( indeksid ) REFERENCES tblindeks ( indeksid ); ALTER TABLE tbltemalinje ADD CONSTRAINT temaindeks FOREIGN KEY ( temaid ) REFERENCES tbltema ( temaid ); ALTER TABLE tblsporreskjema ADD CONSTRAINT instrument FOREIGN KEY ( instrumentid ) REFERENCES tblsporreskjema ( sporreskjemaid ); ALTER TABLE tblsporreskjema ADD CONSTRAINT skjemaeier FOREIGN KEY ( eierid ) REFERENCES tbleier ( eierid ); ALTER TABLE tblsporreskjema ADD CONSTRAINT skjemakonto FOREIGN KEY ( kontoid ) REFERENCES tblskjemakonto ( kontoid ); ALTER TABLE tblforetak ADD CONSTRAINT regionforetak FOREIGN KEY ( regionid ) REFERENCES tblregion ( regionid ); ALTER TABLE tblavdelingkontolinje ADD CONSTRAINT avdelingkonto FOREIGN KEY ( institusjonid ) REFERENCES tblinstitusjon ( institusjonid ); ALTER TABLE tblavdelingkontolinje ADD CONSTRAINT kontoavdeling FOREIGN KEY ( kontoid ) REFERENCES tblskjemakonto ( kontoid ); ALTER TABLE tblkontobrukerlinje ADD CONSTRAINT brukerkonto FOREIGN KEY ( brukerid ) REFERENCES tblbruker ( brukerid ); ALTER TABLE tblkontobrukerlinje ADD CONSTRAINT knotobruker FOREIGN KEY ( kontoid ) REFERENCES tblskjemakonto ( kontoid );
CREATE Procedure sp_ser_checkjobestimation(@EstimationID as int) as Select "Status" = isNull(Status,0) from EstimationAbstract where (isNull(Status,0) & 192 = 192 or isNull(Status,0) & 128 = 128) and EstimationID = @EstimationID
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 21, 2020 at 06:09 AM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `hotelbooking` -- -- -------------------------------------------------------- -- -- Table structure for table `bookingdetails` -- CREATE TABLE `bookingdetails` ( `id` bigint(20) UNSIGNED NOT NULL, `room_id` bigint(20) UNSIGNED NOT NULL, `booking_id` bigint(20) UNSIGNED NOT NULL, `qty` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `bookingdetails` -- INSERT INTO `bookingdetails` (`id`, `room_id`, `booking_id`, `qty`, `created_at`, `updated_at`) VALUES (1, 23, 1, 1, '2020-09-17 04:07:11', '2020-09-17 04:07:11'), (2, 24, 2, 1, '2020-09-17 07:20:45', '2020-09-17 07:20:45'), (3, 39, 3, 1, '2020-09-17 07:37:12', '2020-09-17 07:37:12'), (4, 18, 4, 1, '2020-09-18 04:22:44', '2020-09-18 04:22:44'), (5, 23, 5, 1, '2020-09-19 10:58:52', '2020-09-19 10:58:52'), (6, 29, 6, 1, '2020-09-19 11:10:40', '2020-09-19 11:10:40'); -- -------------------------------------------------------- -- -- Table structure for table `bookings` -- CREATE TABLE `bookings` ( `id` bigint(20) UNSIGNED NOT NULL, `checkin` date NOT NULL, `checkout` date NOT NULL, `adult` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `children` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `total` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(4) NOT NULL DEFAULT 0, `note` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `bookings` -- INSERT INTO `bookings` (`id`, `checkin`, `checkout`, `adult`, `children`, `total`, `status`, `note`, `user_id`, `created_at`, `updated_at`) VALUES (1, '2020-09-18', '2020-09-18', '2', '1', '65000', 1, 'kjhdryuiokpl', 7, '2020-09-17 04:07:11', '2020-09-20 21:02:32'), (2, '2020-09-19', '2020-09-25', '2', '0', '70000', 1, 'asdf', 7, '2020-09-17 07:20:44', '2020-09-20 09:07:14'), (3, '2020-09-25', '2020-09-29', '2', '1', '80000', 0, 'nice', 7, '2020-09-17 07:37:12', '2020-09-17 07:37:12'), (4, '2020-09-17', '2020-09-19', '3', '1', '65000', 0, 'nice', 7, '2020-09-18 04:22:44', '2020-09-18 04:22:44'), (5, '2020-09-12', '2020-09-13', '2', '2', '65000', 0, 'ewrdt', 7, '2020-09-19 10:58:52', '2020-09-19 10:58:52'), (6, '2020-09-26', '2020-09-25', '2', '1', '75000', 0, 'rtyui', 8, '2020-09-19 11:10:40', '2020-09-19 11:10:40'), (7, '2020-09-18', '2020-09-19', '1', '1', '130000', 0, 'asdfgnm', 8, '2020-09-19 20:47:10', '2020-09-19 20:47:10'), (8, '2020-09-25', '2020-09-29', '2', '1', '260000', 0, 'vbnmzxc', 8, '2020-09-19 20:49:37', '2020-09-19 20:49:37'), (9, '2020-09-24', '2020-09-27', '2', '1', '210000', 0, 'nice to meet you', 8, '2020-09-19 20:54:10', '2020-09-19 20:54:10'), (10, '2020-09-25', '2020-09-27', '2', '1', '130000', 1, 'beautiful', 6, '2020-09-19 21:28:40', '2020-09-20 09:03:38'), (11, '2020-09-08', '2020-09-13', '2', '1', '375000', 1, 'bny', 6, '2020-09-19 21:40:16', '2020-09-20 09:04:15'), (12, '2020-09-18', '2020-09-22', '2', '1', '260000', 1, 'dfhgjhkjk', 6, '2020-09-20 09:32:22', '2020-09-20 21:18:42'), (13, '2020-09-17', '2020-09-19', '2', '1', '130000', 0, 'beautiful room', 6, '2020-09-20 21:30:33', '2020-09-20 21:30:33'); -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_08_19_000000_create_failed_jobs_table', 1), (4, '2020_09_13_030917_create_roomtypes_table', 1), (6, '2020_09_13_031106_create_services_table', 1), (9, '2020_09_14_050636_create_room_service_table', 3), (10, '2020_09_14_054416_create_rooms_table', 4), (11, '2020_09_13_031130_create_bookings_table', 5), (12, '2020_09_13_031157_create_bookingdetails_table', 5), (13, '2020_09_14_054418_create_permission_tables', 6); -- -------------------------------------------------------- -- -- Table structure for table `model_has_permissions` -- CREATE TABLE `model_has_permissions` ( `permission_id` bigint(20) UNSIGNED NOT NULL, `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `model_has_roles` -- CREATE TABLE `model_has_roles` ( `role_id` bigint(20) UNSIGNED NOT NULL, `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `model_has_roles` -- INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES (1, 'App\\User', 6), (1, 'App\\User', 7), (1, 'App\\User', 8), (2, 'App\\User', 5); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES (1, 'Customer', 'web', '2020-09-16 21:42:04', '2020-09-16 21:42:04'), (2, 'Admin', 'web', '2020-09-16 21:42:04', '2020-09-16 21:42:04'); -- -------------------------------------------------------- -- -- Table structure for table `role_has_permissions` -- CREATE TABLE `role_has_permissions` ( `permission_id` bigint(20) UNSIGNED NOT NULL, `role_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `rooms` -- CREATE TABLE `rooms` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `price` int(11) NOT NULL, `photo` text COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `roomtype_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `rooms` -- INSERT INTO `rooms` (`id`, `name`, `price`, `photo`, `description`, `roomtype_id`, `created_at`, `updated_at`) VALUES (17, 'DELUXE ROOM', 60000, 'backend/roomimg/1600151376.jpeg', 'From 30m² in size, the Deluxe Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 1, '2020-09-14 23:59:36', '2020-09-17 00:31:28'), (18, 'DELUXE SUITE ROOM', 65000, 'backend/roomimg/1600151420.jpeg', 'The Deluxe Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 1, '2020-09-15 00:00:20', '2020-09-17 00:31:50'), (19, 'EXECUTIVE SUITE ROOM', 70000, 'backend/roomimg/1600151477.jpeg', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 1, '2020-09-15 00:01:17', '2020-09-17 00:32:19'), (20, 'PREMIER SUITE ROOM', 75000, 'backend/roomimg/1600259215.jpeg', 'At an expansive 95m², the well-appointed Adjacent room sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 1, '2020-09-15 00:01:51', '2020-09-17 00:32:45'), (21, 'PRESIDENTIAL SUITE', 80000, 'backend/roomimg/1600221256.jpeg', 'An impressive 317m² in size, our sumptuous Adjoining room offers ample room and everything you could possibly wish for in a perfect home away from home.', 1, '2020-09-15 00:02:27', '2020-09-17 00:33:02'), (22, 'DELUXE ROOM', 60000, 'backend/roomimg/1600153231.jpeg', 'From 30m² in size, the Master Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 2, '2020-09-15 00:30:31', '2020-09-17 00:33:24'), (23, 'DELUXE SUITE ROOM', 65000, 'backend/roomimg/1600153299.webp', 'The Deluxe Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 2, '2020-09-15 00:31:39', '2020-09-17 00:33:43'), (24, 'EXECUTIVE SUITE ROOM', 70000, 'backend/roomimg/1600153353.webp', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 2, '2020-09-15 00:32:33', '2020-09-17 00:34:08'), (25, 'PRESIDENTIAL SUITE', 75000, 'backend/roomimg/1600259145.jpeg', 'An impressive 317m² in size, our sumptuous PRESIDENTIAL SUITE ROOM offers ample room and everything you could possibly wish for in a perfect home away from home.', 2, '2020-09-15 00:33:20', '2020-09-17 00:34:29'), (26, 'PREMIER SUITE ROOM', 65000, 'backend/roomimg/1600153435.jpeg', 'At an expansive 95m², the well-appointed PREMIER SUITE ROOM sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 2, '2020-09-15 00:33:55', '2020-09-17 00:35:09'), (27, 'DELUXE ROOM', 60000, 'backend/roomimg/1600153505.jpeg', 'From 30m² in size, the Deluxe Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 6, '2020-09-15 00:35:05', '2020-09-15 04:28:56'), (28, 'DELUXE SUITE ROOM', 70000, 'backend/roomimg/1600175703.jpeg', 'The Deluxe Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 6, '2020-09-15 00:35:45', '2020-09-17 00:38:29'), (29, 'EXECUTIVE SUITE ROOM', 75000, 'backend/roomimg/1600153584.jpeg', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 6, '2020-09-15 00:36:24', '2020-09-17 00:39:13'), (30, 'PREMIER SUITE ROOM', 80000, 'backend/roomimg/1600175537.jpeg', 'At an expansive 95m², the well-appointed PREMIER SUITE ROOM sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 6, '2020-09-15 00:36:59', '2020-09-17 00:39:45'), (31, 'PRESIDENTIAL SUITE', 85000, 'backend/roomimg/1600153670.jpeg', 'An impressive 317m² in size, our sumptuous PRESIDENTIAL SUITE ROOM offers ample room and everything you could possibly wish for in a perfect home away from home.', 6, '2020-09-15 00:37:50', '2020-09-17 00:40:10'), (32, 'DELUXE ROOM', 55000, 'backend/roomimg/1600153721.jpeg', 'From 30m² in size, the Deluxe Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 11, '2020-09-15 00:38:41', '2020-09-17 00:40:34'), (33, 'DELUXE SUITE ROOM', 60000, 'backend/roomimg/1600175756.jpeg', 'The Deluxe Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 11, '2020-09-15 00:39:33', '2020-09-17 00:40:50'), (34, 'EXECUTIVE SUITE ROOM', 65000, 'backend/roomimg/1600153818.jpeg', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 11, '2020-09-15 00:40:18', '2020-09-17 00:41:18'), (35, 'PREMIER SUITE ROOM', 70000, 'backend/roomimg/1600153853.jpeg', 'At an expansive 95m², the well-appointed PREMIER SUITE ROOM sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 11, '2020-09-15 00:40:53', '2020-09-17 00:41:41'), (36, 'PRESIDENTIAL SUITE', 80000, 'backend/roomimg/1600153886.jpeg', 'An impressive 317m² in size, our sumptuous PRESIDENTIAL SUITE ROOM offers ample room and everything you could possibly wish for in a perfect home away from home.', 11, '2020-09-15 00:41:26', '2020-09-17 00:42:00'), (37, 'DELUXE ROOM', 60000, 'backend/roomimg/1600153935.jpeg', 'From 30m² in size, the Deluxe Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 12, '2020-09-15 00:42:15', '2020-09-15 04:31:18'), (38, 'DELUXE SUITE ROOM', 70000, 'backend/roomimg/1600153988.jpeg', 'The Deluxe\r\n Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 12, '2020-09-15 00:43:08', '2020-09-17 00:42:40'), (39, 'EXECUTIVE SUITE ROOM', 80000, 'backend/roomimg/1600221472.jpeg', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 12, '2020-09-15 00:44:13', '2020-09-17 00:43:13'), (40, 'PREMIER SUITE ROOM', 85000, 'backend/roomimg/1600154107.webp', 'At an expansive 95m², the well-appointed PREMIER SUITE ROOM sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 12, '2020-09-15 00:45:07', '2020-09-17 00:43:36'), (41, 'PRESIDENTIAL SUITE', 90000, 'backend/roomimg/1600154147.jpeg', 'An impressive 317m² in size, our sumptuous PRESIDENTIAL SUITE ROOM offers ample room and everything you could possibly wish for in a perfect home away from home.', 12, '2020-09-15 00:45:47', '2020-09-17 00:44:01'), (42, 'DELUXE ROOM', 55000, 'backend/roomimg/1600154184.png', 'From 30m² in size, the Deluxe Room comes in king-size or twin bed configurations and is equipped with a large ergonomic working area for attending to all your business matters', 13, '2020-09-15 00:46:24', '2020-09-17 00:44:28'), (43, 'DELUXE SUITE ROOM', 65000, 'backend/roomimg/1600154226.jpeg', 'The Deluxe Suite Room, with its separate living area, comfortable sofa, bathtub and rainfall shower experience will meet all your business and leisure requirements.From 70m² in size.', 13, '2020-09-15 00:47:06', '2020-09-17 00:44:47'), (44, 'PREMIER SUITE ROOM', 75000, 'backend/roomimg/1600154270.jpeg', 'At an expansive 95m², the well-appointed PREMIER SUITE ROOM sleeps six and is an ideal option for a family break, offering plenty of space in which to chill out together and enjoy the ‘suite life\'.', 13, '2020-09-15 00:47:50', '2020-09-17 00:45:30'), (45, 'PRESIDENTIAL SUITE', 90000, 'backend/roomimg/1600154296.jpeg', 'An impressive 317m² in size, our sumptuous PRESIDENTIAL SUITE ROOM offers ample room and everything you could possibly wish for in a perfect home away from home.', 13, '2020-09-15 00:48:16', '2020-09-17 00:46:14'), (46, 'EXECUTIVE SUITE ROOM', 70000, 'backend/roomimg/1600154412.png', 'Inclusive of breakfast and with access to our fitness center, swimming pool and tennis court on the terrace.From 70m² in size.', 13, '2020-09-15 00:50:12', '2020-09-17 00:46:49'), (47, 'EXECUTIVE ROOM', 60000, 'backend/roomimg/1600167093.jpeg', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 1, '2020-09-15 04:21:33', '2020-09-17 00:37:06'), (48, 'SUPERIOR ROOM', 50000, 'backend/roomimg/1600259360.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly and comfort during your stay in Yangon.', 1, '2020-09-15 04:24:13', '2020-09-17 00:30:16'), (49, 'EXECUTIVE ROOM', 60000, 'backend/roomimg/1600221360.jpeg', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 2, '2020-09-15 04:49:14', '2020-09-15 19:26:00'), (50, 'EXECUTIVE ROOM', 60000, 'backend/roomimg/1600168807.jpeg', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 6, '2020-09-15 04:50:07', '2020-09-15 04:50:07'), (51, 'SUPERIOR ROOM', 55000, 'backend/roomimg/1600169132.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly need for convenience', 2, '2020-09-15 04:55:32', '2020-09-17 00:30:58'), (52, 'SUPERIOR ROOM', 60000, 'backend/roomimg/1600175573.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly need for convenience', 6, '2020-09-15 04:56:18', '2020-09-15 06:42:53'), (53, 'SUPERIOR ROOM', 60000, 'backend/roomimg/1600169222.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly need for convenience', 11, '2020-09-15 04:57:02', '2020-09-17 00:36:08'), (54, 'SUPERIOR ROOM', 55000, 'backend/roomimg/1600175921.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly need for convenience', 12, '2020-09-15 04:57:53', '2020-09-17 00:36:27'), (55, 'SUPERIOR ROOM', 55000, 'backend/roomimg/1600169310.jpeg', 'With facilities including free high speed WiFi, satellite/cable TV, a working area, safety deposit box, Multimedia hub and blackout curtain, our stylish Superior room offers everything you could possibly need for convenience', 13, '2020-09-15 04:58:30', '2020-09-15 04:58:30'), (56, 'EXECUTIVE ROOM', 60000, 'backend/roomimg/1600259319.jpeg', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 12, '2020-09-15 05:00:25', '2020-09-17 00:37:29'), (57, 'EXECUTIVE ROOM', 55000, 'backend/roomimg/1600175811.jpeg', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 11, '2020-09-15 05:01:52', '2020-09-17 00:37:46'), (58, 'EXECUTIVE ROOM', 55000, 'backend/roomimg/1600169562.webp', 'Located on the higher floors, the 30m² Luxury Executive rooms offer a choice of either one king-size or two twin bed configurations, and in addition to all standard benefits provide superior amenities, an espresso machine and complimentary laundry service', 13, '2020-09-15 05:02:42', '2020-09-15 05:02:42'); -- -------------------------------------------------------- -- -- Table structure for table `roomtypes` -- CREATE TABLE `roomtypes` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `roomtypes` -- INSERT INTO `roomtypes` (`id`, `name`, `photo`, `created_at`, `updated_at`) VALUES (1, 'Single Room', 'backend/roomtypeimg/1600148337.jpeg', '2020-09-12 22:24:30', '2020-09-14 23:08:57'), (2, 'Double Room', 'backend/roomtypeimg/1600148381.jpeg', '2020-09-12 22:24:31', '2020-09-14 23:09:41'), (6, 'Triple Room', 'backend/roomtypeimg/1600148689.jpeg', '2020-09-13 01:36:00', '2020-09-14 23:14:49'), (11, 'Double Double Room', 'backend/roomtypeimg/1600148041.jpeg', '2020-09-14 23:04:01', '2020-09-14 23:04:01'), (12, 'Studio Room', 'backend/roomtypeimg/1600148077.jpeg', '2020-09-14 23:04:37', '2020-09-14 23:04:37'), (13, 'Quad Room', 'backend/roomtypeimg/1600148781.jpeg', '2020-09-14 23:12:54', '2020-09-14 23:16:21'); -- -------------------------------------------------------- -- -- Table structure for table `room_service` -- CREATE TABLE `room_service` ( `id` bigint(20) UNSIGNED NOT NULL, `room_id` bigint(20) UNSIGNED NOT NULL, `service_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `room_service` -- INSERT INTO `room_service` (`id`, `room_id`, `service_id`, `created_at`, `updated_at`) VALUES (54, 17, 1, NULL, NULL), (55, 17, 2, NULL, NULL), (57, 17, 4, NULL, NULL), (60, 18, 1, NULL, NULL), (61, 18, 2, NULL, NULL), (63, 18, 4, NULL, NULL), (64, 18, 6, NULL, NULL), (66, 19, 1, NULL, NULL), (67, 19, 2, NULL, NULL), (69, 19, 4, NULL, NULL), (70, 19, 6, NULL, NULL), (71, 20, 1, NULL, NULL), (72, 20, 2, NULL, NULL), (74, 20, 4, NULL, NULL), (75, 20, 6, NULL, NULL), (76, 21, 1, NULL, NULL), (77, 21, 2, NULL, NULL), (79, 21, 4, NULL, NULL), (80, 21, 6, NULL, NULL), (81, 22, 2, NULL, NULL), (83, 22, 4, NULL, NULL), (84, 22, 6, NULL, NULL), (86, 23, 4, NULL, NULL), (87, 23, 6, NULL, NULL), (88, 23, 7, NULL, NULL), (89, 24, 2, NULL, NULL), (91, 24, 6, NULL, NULL), (92, 24, 7, NULL, NULL), (93, 25, 1, NULL, NULL), (94, 25, 2, NULL, NULL), (96, 25, 4, NULL, NULL), (97, 25, 6, NULL, NULL), (99, 26, 4, NULL, NULL), (100, 26, 6, NULL, NULL), (101, 26, 7, NULL, NULL), (102, 27, 2, NULL, NULL), (104, 27, 4, NULL, NULL), (105, 27, 6, NULL, NULL), (106, 28, 2, NULL, NULL), (107, 28, 4, NULL, NULL), (108, 28, 6, NULL, NULL), (109, 28, 7, NULL, NULL), (111, 29, 6, NULL, NULL), (112, 29, 7, NULL, NULL), (113, 30, 1, NULL, NULL), (114, 30, 2, NULL, NULL), (116, 30, 6, NULL, NULL), (117, 31, 1, NULL, NULL), (118, 31, 2, NULL, NULL), (120, 31, 6, NULL, NULL), (121, 32, 1, NULL, NULL), (123, 32, 4, NULL, NULL), (124, 32, 6, NULL, NULL), (126, 33, 4, NULL, NULL), (127, 33, 6, NULL, NULL), (128, 33, 7, NULL, NULL), (129, 34, 1, NULL, NULL), (130, 34, 2, NULL, NULL), (132, 34, 6, NULL, NULL), (134, 35, 4, NULL, NULL), (135, 35, 6, NULL, NULL), (136, 35, 7, NULL, NULL), (137, 36, 2, NULL, NULL), (139, 36, 6, NULL, NULL), (140, 36, 7, NULL, NULL), (141, 37, 1, NULL, NULL), (142, 37, 2, NULL, NULL), (144, 37, 4, NULL, NULL), (145, 38, 1, NULL, NULL), (146, 38, 2, NULL, NULL), (147, 38, 4, NULL, NULL), (148, 38, 7, NULL, NULL), (149, 39, 1, NULL, NULL), (151, 39, 4, NULL, NULL), (152, 39, 6, NULL, NULL), (153, 39, 7, NULL, NULL), (154, 40, 4, NULL, NULL), (155, 40, 6, NULL, NULL), (156, 40, 7, NULL, NULL), (157, 41, 1, NULL, NULL), (158, 41, 2, NULL, NULL), (160, 41, 4, NULL, NULL), (161, 42, 2, NULL, NULL), (162, 42, 4, NULL, NULL), (163, 42, 7, NULL, NULL), (164, 43, 1, NULL, NULL), (165, 43, 2, NULL, NULL), (167, 43, 4, NULL, NULL), (168, 44, 1, NULL, NULL), (169, 44, 2, NULL, NULL), (171, 44, 4, NULL, NULL), (173, 45, 4, NULL, NULL), (174, 45, 6, NULL, NULL), (175, 46, 1, NULL, NULL), (176, 46, 2, NULL, NULL), (178, 46, 4, NULL, NULL), (179, 47, 1, NULL, NULL), (180, 47, 2, NULL, NULL), (182, 47, 4, NULL, NULL), (183, 47, 6, NULL, NULL), (184, 48, 2, NULL, NULL), (186, 48, 4, NULL, NULL), (188, 49, 4, NULL, NULL), (189, 49, 6, NULL, NULL), (191, 50, 4, NULL, NULL), (192, 50, 6, NULL, NULL), (193, 51, 2, NULL, NULL), (194, 51, 4, NULL, NULL), (195, 51, 6, NULL, NULL), (197, 52, 4, NULL, NULL), (198, 52, 6, NULL, NULL), (199, 53, 2, NULL, NULL), (200, 53, 4, NULL, NULL), (201, 53, 7, NULL, NULL), (202, 54, 2, NULL, NULL), (204, 54, 6, NULL, NULL), (205, 55, 1, NULL, NULL), (206, 55, 2, NULL, NULL), (208, 55, 4, NULL, NULL), (209, 56, 2, NULL, NULL), (211, 56, 4, NULL, NULL), (212, 57, 2, NULL, NULL), (214, 57, 4, NULL, NULL), (215, 58, 2, NULL, NULL), (217, 58, 6, NULL, NULL), (218, 19, 7, NULL, NULL), (219, 20, 8, NULL, NULL), (220, 21, 7, NULL, NULL), (221, 21, 8, NULL, NULL), (222, 23, 2, NULL, NULL), (223, 24, 1, NULL, NULL), (224, 24, 4, NULL, NULL), (225, 25, 7, NULL, NULL), (226, 25, 8, NULL, NULL), (227, 26, 2, NULL, NULL), (228, 52, 7, NULL, NULL), (229, 54, 4, NULL, NULL), (230, 56, 6, NULL, NULL), (231, 29, 2, NULL, NULL), (232, 29, 4, NULL, NULL), (233, 29, 8, NULL, NULL), (234, 30, 4, NULL, NULL), (235, 30, 7, NULL, NULL), (236, 31, 4, NULL, NULL), (237, 31, 7, NULL, NULL), (238, 31, 8, NULL, NULL), (239, 33, 2, NULL, NULL), (240, 34, 7, NULL, NULL), (241, 35, 2, NULL, NULL), (242, 35, 8, NULL, NULL), (243, 36, 1, NULL, NULL), (244, 36, 4, NULL, NULL), (245, 36, 8, NULL, NULL), (246, 39, 2, NULL, NULL), (247, 40, 1, NULL, NULL), (248, 40, 2, NULL, NULL), (249, 40, 8, NULL, NULL), (250, 41, 6, NULL, NULL), (251, 41, 7, NULL, NULL), (252, 41, 8, NULL, NULL), (253, 43, 6, NULL, NULL), (254, 44, 6, NULL, NULL), (255, 44, 7, NULL, NULL), (256, 45, 1, NULL, NULL), (257, 45, 2, NULL, NULL), (258, 45, 7, NULL, NULL), (259, 45, 8, NULL, NULL), (260, 46, 6, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `services` -- CREATE TABLE `services` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `services` -- INSERT INTO `services` (`id`, `name`, `photo`, `created_at`, `updated_at`) VALUES (1, 'Car rental service', 'backend/serviceimg/1600257137.jpeg', '2020-09-12 22:27:07', '2020-09-16 05:23:33'), (2, 'Catering service', 'backend/serviceimg/1600256967.jpeg', '2020-09-12 22:27:07', '2020-09-16 05:23:41'), (4, 'Courier service', 'backend/serviceimg/1600255750.jpeg', '2020-09-12 22:27:07', '2020-09-16 05:23:47'), (6, 'Doctor on call service', 'backend/serviceimg/1600255643.jpeg', '2020-09-13 02:07:36', '2020-09-16 05:23:09'), (7, 'Dry cleaning service', 'backend/serviceimg/1600255544.jpeg', '2020-09-13 04:19:53', '2020-09-16 05:24:00'), (8, 'Gift shop service', 'backend/serviceimg/1600256831.jpeg', '2020-09-16 05:17:11', '2020-09-16 05:24:14'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Minnie Lind', 'vjohnson@example.org', '2020-09-12 22:23:59', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'PktUEzwSjs', '2020-09-12 22:23:59', '2020-09-12 22:23:59'), (2, 'Addison Haag', 'kelvin00@example.com', '2020-09-12 22:23:59', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'cSktHkK9jn', '2020-09-12 22:23:59', '2020-09-12 22:23:59'), (3, 'Scotty Ondricka', 'greenholt.marcia@example.com', '2020-09-12 22:24:30', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'aBuhD0aJsH', '2020-09-12 22:24:30', '2020-09-12 22:24:30'), (4, 'Delbert Bogisich', 'jermain58@example.org', '2020-09-12 22:24:30', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'MxhmpNeK48', '2020-09-12 22:24:30', '2020-09-12 22:24:30'), (5, 'myint thein', 'myintkothein007@gmail.com', NULL, '$2y$10$dWN6H8rIjHlhMCa1X3qDceraPQ8m.jEKLshEhKDKoocIwR5f3jvF.', '6wAyAYZPWXrbUed2qkmvbAVeYpEvcxuNmsrXBPq1WkWZsVxNr0ySRFBycp13', '2020-09-14 09:31:35', '2020-09-14 09:31:35'), (6, 'mgmg', 'mgmg@gmail.com', NULL, '$2y$10$2pQs8k8/4LT2F3.G5PBrPOc7qgxVievnCQ8Rm9X45ZKBfkEJQjd4y', NULL, '2020-09-16 21:50:47', '2020-09-16 21:50:47'), (7, 'su', 'susu@gmail.com', NULL, '$2y$10$hfTqMMODF2T8eLZe3HrGRupSAPkBmscM6FaGSwQd19ecQV.M8/J7y', NULL, '2020-09-17 00:50:15', '2020-09-17 00:50:15'), (8, 'mmu', 'mamaa@gmail.com', NULL, '$2y$10$ci7vGsZqTS17hGPuzC3cB.OOTfC.GPu1iZ6NFqU8Sgv.xjE3MTReq', NULL, '2020-09-19 10:10:55', '2020-09-19 10:10:55'); -- -- Indexes for dumped tables -- -- -- Indexes for table `bookingdetails` -- ALTER TABLE `bookingdetails` ADD PRIMARY KEY (`id`), ADD KEY `bookingdetails_room_id_foreign` (`room_id`), ADD KEY `bookingdetails_booking_id_foreign` (`booking_id`); -- -- Indexes for table `bookings` -- ALTER TABLE `bookings` ADD PRIMARY KEY (`id`), ADD KEY `bookings_user_id_foreign` (`user_id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `model_has_permissions` -- ALTER TABLE `model_has_permissions` ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`), ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`); -- -- Indexes for table `model_has_roles` -- ALTER TABLE `model_has_roles` ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`), ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `role_has_permissions` -- ALTER TABLE `role_has_permissions` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `role_has_permissions_role_id_foreign` (`role_id`); -- -- Indexes for table `rooms` -- ALTER TABLE `rooms` ADD PRIMARY KEY (`id`), ADD KEY `rooms_roomtype_id_foreign` (`roomtype_id`); -- -- Indexes for table `roomtypes` -- ALTER TABLE `roomtypes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `room_service` -- ALTER TABLE `room_service` ADD PRIMARY KEY (`id`), ADD KEY `room_service_room_id_foreign` (`room_id`), ADD KEY `room_service_service_id_foreign` (`service_id`); -- -- Indexes for table `services` -- ALTER TABLE `services` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `bookingdetails` -- ALTER TABLE `bookingdetails` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `bookings` -- ALTER TABLE `bookings` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `rooms` -- ALTER TABLE `rooms` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59; -- -- AUTO_INCREMENT for table `roomtypes` -- ALTER TABLE `roomtypes` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `room_service` -- ALTER TABLE `room_service` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=261; -- -- AUTO_INCREMENT for table `services` -- ALTER TABLE `services` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- Constraints for dumped tables -- -- -- Constraints for table `bookingdetails` -- ALTER TABLE `bookingdetails` ADD CONSTRAINT `bookingdetails_booking_id_foreign` FOREIGN KEY (`booking_id`) REFERENCES `bookings` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `bookingdetails_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON DELETE CASCADE; -- -- Constraints for table `bookings` -- ALTER TABLE `bookings` ADD CONSTRAINT `bookings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `model_has_permissions` -- ALTER TABLE `model_has_permissions` ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE; -- -- Constraints for table `model_has_roles` -- ALTER TABLE `model_has_roles` ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; -- -- Constraints for table `role_has_permissions` -- ALTER TABLE `role_has_permissions` ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; -- -- Constraints for table `rooms` -- ALTER TABLE `rooms` ADD CONSTRAINT `rooms_roomtype_id_foreign` FOREIGN KEY (`roomtype_id`) REFERENCES `roomtypes` (`id`) ON DELETE CASCADE; -- -- Constraints for table `room_service` -- ALTER TABLE `room_service` ADD CONSTRAINT `room_service_room_id_foreign` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `room_service_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE; 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 */;
--1.插入新记录 CREATE PROC cust_InsertCustomer @CustomerID nvarchar(6), @CustomerName nvarchar(80), @SpellingCode nvarchar(20), @Address nvarchar(80), @ZipCode char(6), @Tel nvarchar(20), @Fax nvarchar(20), @BankName nvarchar(40), @BankAccount nvarchar(50), @Contacter nvarchar(20), @Email nvarchar(30) AS INSERT TBL_Customer VALUES(@CustomerID,@CustomerName,@SpellingCode,@Address,@ZipCode,@Tel,@Fax,@BankName,@BankAccount,@Contacter,@Email) RETURN EXEC cust_InsertCustomer '12','莫','666666','啊啊啊啊啊啊','222222','3333333331','发','工商银行','5456465441234564123','人','1123132@qq.com' --2.删除记录 create proc cust_DeleteCustomerByCustomerID @CustomerID nvarchar(6) as delete TBL_Customer where CustomerID=@CustomerID return exec prod_DeleteCustomerByCustomerID '123' --3.更新记录 create proc cust_UpdateCustomerByCustomerID @CustomerID nvarchar(6), @CustomerName nvarchar(80), @SpellingCode nvarchar(20), @Address nvarchar(80), @ZipCode char(6), @Tel nvarchar(20), @Fax nvarchar(20), @BankName nvarchar(40), @BankAccount nvarchar(50), @Contacter nvarchar(20), @Email nvarchar(30) AS update TBL_Customer set CustomerName=@CustomerName,SpellingCode=@SpellingCode,Address=@Address,ZipCode=@ZipCode,Tel=@Tel,Fax=@Fax,BankName=@BankName,BankAccount=@BankAccount,Contacter=@Contacter,Email=@Email where CustomerID=@CustomerID return exec cust_UpdateCustomerByCustomerID '1','莫1','6666661','啊啊1','2222221','33333333311','发1','工商银行1','54564654412345641231','人1','11123132@qq.com' --4.查询所有记录 create proc cust_GetAllCustomer as select * from TBL_Customer return exec cust_GetAllCustomer --5.根据CustomerID查询记录 create proc cust_GetAllCustomerByCustomerID @CustomerID nvarchar(6) as select * from TBL_Customer where CustomerID=@CustomerID return exec cust_GetAllCustomerByCustomerID '12'
create table students ( student_id serial primary key, first_name varchar(50) not null, last_name varchar(50), homeroom_number integer, phone varchar(20) unique not null, email varchar(50) unique not null, graduation_year integer) create table teachers ( teacher_id serial primary key, first_name varchar(50) not null, last_name varchar(50), homeroom_number integer, department varchar(30), phone varchar(25) unique, email varchar(50) unique) insert into students (student_id,first_name,last_name,homeroom_number,phone,email,graduation_year ) values (1,'Mark','Watney',5,'777-555-1234','n/a',2035); select * from students; insert into teachers (teacher_id, first_name, last_name, homeroom_number, department, phone, email) values (1, 'Jonas', 'Salk', 5 , 'Biology', '777-555-4321', 'jsalk@school.org'); select * from teachers;
INSERT INTO core_crm_where_find_us (id, myid, mykatastima, title) VALUES (0,0,(SELECT mykatastimadefault FROM aab2badmin_basesettings), 'Χωρίς Επιλογή');
-- MySQL dump 10.13 Distrib 5.5.41, for debian-linux-gnu (x86_64) -- -- Host: 127.0.0.1 Database: bmf-db -- ------------------------------------------------------ -- Server version 5.5.41-0ubuntu0.14.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `categoria_producto` -- DROP TABLE IF EXISTS `categoria_producto`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `categoria_producto` ( `categoriaId` int(11) NOT NULL AUTO_INCREMENT, `categoriaNombre` varchar(45) NOT NULL DEFAULT '', PRIMARY KEY (`categoriaId`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `categoria_producto` -- LOCK TABLES `categoria_producto` WRITE; /*!40000 ALTER TABLE `categoria_producto` DISABLE KEYS */; INSERT INTO `categoria_producto` VALUES (1,'BEBIDAS CON ALCOHOL'),(2,'BEBIDAS SIN ALCOHOL'),(3,'SNACKS'),(4,'VARIOS'); /*!40000 ALTER TABLE `categoria_producto` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `lista_producto` -- DROP TABLE IF EXISTS `lista_producto`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `lista_producto` ( `productoId` int(10) unsigned NOT NULL AUTO_INCREMENT, `productoCategoria` int(10) unsigned NOT NULL DEFAULT '0', `productoTipo` int(10) unsigned NOT NULL DEFAULT '0', `productoDescripcion` varchar(255) NOT NULL DEFAULT '', `productoPrecio` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`productoId`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `lista_producto` -- LOCK TABLES `lista_producto` WRITE; /*!40000 ALTER TABLE `lista_producto` DISABLE KEYS */; /*!40000 ALTER TABLE `lista_producto` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `promociones` -- DROP TABLE IF EXISTS `promociones`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `promociones` ( `id` int(11) NOT NULL AUTO_INCREMENT, `img` longblob, `precio` varchar(45) NOT NULL DEFAULT '', `descripcion` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `promociones` -- LOCK TABLES `promociones` WRITE; /*!40000 ALTER TABLE `promociones` DISABLE KEYS */; /*!40000 ALTER TABLE `promociones` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `tipo_producto` -- DROP TABLE IF EXISTS `tipo_producto`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tipo_producto` ( `tipoId` int(10) unsigned NOT NULL AUTO_INCREMENT, `tipoNombre` varchar(45) NOT NULL DEFAULT '', `imagen` longblob, `categoriaProducto` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`tipoId`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `tipo_producto` -- LOCK TABLES `tipo_producto` WRITE; /*!40000 ALTER TABLE `tipo_producto` DISABLE KEYS */; /*!40000 ALTER TABLE `tipo_producto` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( `iduser` int(11) NOT NULL, `username` varchar(10) DEFAULT NULL, `password` varchar(10) DEFAULT NULL, PRIMARY KEY (`iduser`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `users` -- LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES (1,'admin','admin'); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2015-04-27 16:23:05
--修改日期:20121210 --修改人:吴生火 --修改内容:诚通CFCA3.0证书需求,增加CFCA版本参数字段 --参数设置: DECLARE VN_COUNT NUMBER; BEGIN SELECT COUNT(*) INTO VN_COUNT FROM FC_PARAM WHERE PARAM_CODE='cfca_version'; IF VN_COUNT < 1 THEN insert into fc_param (PARAM_CODE, PARAM_NAME, PARAM_VALUE, RMK, COL_ADD1, COL_ADD2, WINDOW_NAME) values ( 'cfca_version', 'CFCA版本号', '0', '1为CFCA3.0版本,0为老版本', '', '', ''); COMMIT; END IF; END; /
INSERT INTO department (dep_code, dep_job) VALUES ('2', 'dev'), ('1', 'dev'), ('3', 'mark');
update timelines set datestop='2008:353:05:00:00.000' where id=345905553; update timelines set fixed_by_hand=1 where id=345905553; update load_segments set fixed_by_hand=1 where id=345905551; update load_segments set datestop='2008:353:05:00:00.000' where id=345905551; update timelines set datestop='2003:001:00:00:00.000' where id=183963768; update timelines set fixed_by_hand=1 where id=183963768; update load_segments set fixed_by_hand=1 where id=183963766; update load_segments set datestop='2003:001:00:00:00.000' where id=183963766;
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 28, 2015 at 01:22 -- Server version: 5.6.20 -- PHP Version: 5.5.15 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: `crmapp` -- -- -------------------------------------------------------- -- -- Table structure for table `address` -- CREATE TABLE IF NOT EXISTS `address` ( `address_id` int(11) NOT NULL, `purpose` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `country` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `city` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `street` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `building` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `apartment` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `reciever_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `postal_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `customer_id` int(11) NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `auth_assignment` -- CREATE TABLE IF NOT EXISTS `auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_assignment` -- INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES ('admin', '2', 1445416713), ('manager', '3', 1445416713), ('user', '1', 1445416713); -- -------------------------------------------------------- -- -- Table structure for table `auth_item` -- CREATE TABLE IF NOT EXISTS `auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` int(11) NOT NULL, `description` text COLLATE utf8_unicode_ci, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_item` -- INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES ('admin', 1, 'untuk admin yang login', NULL, NULL, 1445416713, 1445416713), ('guest', 1, 'Nobody', NULL, NULL, 1445416713, 1445416713), ('manager', 1, 'untuk manager yang login', NULL, NULL, 1445416713, 1445416713), ('user', 1, 'untuk user yang login', NULL, NULL, 1445416713, 1445416713); -- -------------------------------------------------------- -- -- Table structure for table `auth_item_child` -- CREATE TABLE IF NOT EXISTS `auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_item_child` -- INSERT INTO `auth_item_child` (`parent`, `child`) VALUES ('user', 'guest'), ('admin', 'manager'), ('manager', 'user'); -- -------------------------------------------------------- -- -- Table structure for table `auth_rule` -- CREATE TABLE IF NOT EXISTS `auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE IF NOT EXISTS `customer` ( `customer_id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `birth_date` date DEFAULT NULL, `notes` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`customer_id`, `name`, `birth_date`, `notes`, `created_at`, `updated_at`) VALUES (1, 'John Doe', '1985-10-22', '', 2147483647, 1445485485), (2, 'Spongebob', '1987-10-12', '', 1445487398, 1445487572), (3, 'Bima X', '2010-02-12', '', 1445493121, 1445493121), (4, 'Jones', '1990-07-03', '', 1445493689, 1445493689); -- -------------------------------------------------------- -- -- Table structure for table `email` -- CREATE TABLE IF NOT EXISTS `email` ( `email_id` int(11) NOT NULL, `purpose` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `customer_id` int(11) NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `migration` -- CREATE TABLE IF NOT EXISTS `migration` ( `version` varchar(180) COLLATE utf8_unicode_ci NOT NULL, `apply_time` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `migration` -- INSERT INTO `migration` (`version`, `apply_time`) VALUES ('m000000_000000_base', 1445333028), ('m140506_102106_rbac_init', 1445408154), ('m151020_084218_init_customer_table', 1445333029), ('m151020_085031_init_customer_phone', 1445333030), ('m151020_101538_init_service_table', 1445336427), ('m151020_103929_init_user_table', 1445337670), ('m151021_012658_tambah_kolom_auth', 1445390922), ('m151022_021043_init_address_table', 1445480295), ('m151022_022328_init_email_table', 1445480792); -- -------------------------------------------------------- -- -- Table structure for table `phone` -- CREATE TABLE IF NOT EXISTS `phone` ( `phone_id` int(11) NOT NULL, `customer_id` int(11) NOT NULL, `number` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `phone` -- INSERT INTO `phone` (`phone_id`, `customer_id`, `number`, `created_at`, `updated_at`) VALUES (1, 1, '085123456789', 1445492510, 1445493435), (2, 3, '085789456123', 1445493147, 1445493147), (3, 4, '085753159486', 1445493706, 1445493706); -- -------------------------------------------------------- -- -- Table structure for table `service` -- CREATE TABLE IF NOT EXISTS `service` ( `service_id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `hourly_rate` int(11) NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ; -- -- Dumping data for table `service` -- INSERT INTO `service` (`service_id`, `name`, `hourly_rate`, `created_at`, `updated_at`) VALUES (5, 'jarjit', 8, 2147483647, 2147483647), (6, 'Upin', 7, 2147483647, 2147483647), (7, 'Ipin', 9, 2147483647, 2147483647), (8, 'Mail', 8, 2147483647, 2147483647); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `user_id` int(11) NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `auth_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`user_id`, `username`, `password`, `created_at`, `updated_at`, `auth_key`) VALUES (1, 'andhika', '$2y$13$UDTqlBOREhpvapyOUDY4MuErnGnZdiledu/nQN6fm5QCFtbHsrmF.', 0, 1445666313, 'W85QdzTPZfqf4IgmRhrfvLu7xj2KE3jh75_TrGAv5rLcQcJIJ0qF415dOEfoG7MsDNZ0NQHhuT2crTJsyJorb4-QqhGAhkfReaXfYxzU9JL3VkgnOf7uO5zdQHMqrH6GJ7ATZOtP5YglXBUWUjugtPlWPxH_v8kvXueOF1JJ_Vhemp9F3jBjvdb18FJ4pJmWRoodM8U3DlULMbp4N0glPADjjOyfAN-53GiMLVo-hF5HXtcuGi7sYBC5K0R7Dcp'), (2, 'admin', '$2y$13$pSZoUQd/Q8yz9/AyssvS6u4no7ucVM9sKh7nN8HQDtFu5yJGkEhLm', 0, 1445486443, 'HFGawhqBjuDi50q7LCPRb7XCEvdvjq1WOKsUnr73xnLH1ofD4qYlbNAPa_XuNxdxEtmOuU2yOJ6ken4dCXZDk_V9B-YZBNexz4ypdt9S6qz75IPxxowWfpO-WEezNkXdpdAXpWJNR71G3MqyGU5IgoXsxuMCTVxR9HN19J4EjbGsJIp7Qc4kXqnSeVpmwrLkLiEQNs0nIU-U1NsuqiVHSZQW10sjewlL7vUVypk1i5myaoj12rtLEbYWeG0GP1c'), (3, 'manager', '$2y$13$8j83KEdREgRg2c/V627tyuPQT4NUjvKLYkzBKFVUGqwOY/gfO0.2u', 0, 1445486451, '4qLB-SeZwrx93JgnnIKodd9Fx9UNOUgoef9dz58WCHVRmz99jayB-fZDxB8NA23HKisDgGvE1SAAD8y2PgUaSsFpwf3I5JKnuXzXkoxIs1ugg56tGSFH0R5vaQLz46iKMdyamkvA_IJMPR4ZiGgQAynKOo3W7qYdROWPfoy3X6MqvsGOaIrX__uuyXOysEeF7Z26rRtAA7XgvMSL2nArQ13Ki3NebS0JYuhEaEqgzIwJuMw3uXMJTeEDRL9znBi'); -- -- Indexes for dumped tables -- -- -- Indexes for table `address` -- ALTER TABLE `address` ADD PRIMARY KEY (`address_id`), ADD KEY `customer_address` (`customer_id`); -- -- Indexes for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD PRIMARY KEY (`item_name`,`user_id`); -- -- Indexes for table `auth_item` -- ALTER TABLE `auth_item` ADD PRIMARY KEY (`name`), ADD KEY `rule_name` (`rule_name`), ADD KEY `idx-auth_item-type` (`type`); -- -- Indexes for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD PRIMARY KEY (`parent`,`child`), ADD KEY `child` (`child`); -- -- Indexes for table `auth_rule` -- ALTER TABLE `auth_rule` ADD PRIMARY KEY (`name`); -- -- Indexes for table `customer` -- ALTER TABLE `customer` ADD PRIMARY KEY (`customer_id`); -- -- Indexes for table `email` -- ALTER TABLE `email` ADD PRIMARY KEY (`email_id`), ADD KEY `customer_email` (`customer_id`); -- -- Indexes for table `migration` -- ALTER TABLE `migration` ADD PRIMARY KEY (`version`); -- -- Indexes for table `phone` -- ALTER TABLE `phone` ADD PRIMARY KEY (`phone_id`), ADD UNIQUE KEY `customer_id` (`customer_id`); -- -- Indexes for table `service` -- ALTER TABLE `service` ADD PRIMARY KEY (`service_id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`user_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `address` -- ALTER TABLE `address` MODIFY `address_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `customer` -- ALTER TABLE `customer` MODIFY `customer_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `email` -- ALTER TABLE `email` MODIFY `email_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `phone` -- ALTER TABLE `phone` MODIFY `phone_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `service` -- ALTER TABLE `service` MODIFY `service_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `address` -- ALTER TABLE `address` ADD CONSTRAINT `customer_address` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`); -- -- Constraints for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `auth_item` -- ALTER TABLE `auth_item` ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Constraints for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `email` -- ALTER TABLE `email` ADD CONSTRAINT `customer_email` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`); -- -- Constraints for table `phone` -- ALTER TABLE `phone` ADD CONSTRAINT `customer_phone_number` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`); /*!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 */;
CREATE TABLE IF NOT EXISTS `news` ( `id` INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, `news_id` varchar(50) NOT NULL UNIQUE, `title` varchar(100) NOT NULL, `share_url` varchar(100) NOT NULL, `date` varchar(50) NOT NULL, `body` text NOT NULL, `image` varchar(100) NOT NULL, `image_source` varchar(100) NOT NULL, `image_public_url` varchar(100) NOT NULL ) DEFAULT CHARSET=utf8;
/* Создание таблицы отчетов */ CREATE TABLE /*PREFIX*/REPORTS ( REPORT_ID VARCHAR(32) NOT NULL, ENGINE VARCHAR(100) NOT NULL, REPORT LONGBLOB NOT NULL, PLACE INTEGER NOT NULL, PRIMARY KEY (REPORT_ID), FOREIGN KEY (REPORT_ID) REFERENCES /*PREFIX*/INTERFACES (INTERFACE_ID) ) -- /* Создание просмотра таблицы заданий */ CREATE VIEW /*PREFIX*/S_REPORTS AS SELECT R.*, I.NAME AS INTERFACE_NAME FROM /*PREFIX*/REPORTS R JOIN /*PREFIX*/INTERFACES I ON I.INTERFACE_ID=R.REPORT_ID -- /* Создание процедуры добавления задания */ CREATE PROCEDURE /*PREFIX*/I_REPORT ( IN REPORT_ID VARCHAR(32), IN NAME VARCHAR(100), IN DESCRIPTION VARCHAR(250), IN INTERFACE_TYPE INTEGER, IN ENGINE VARCHAR(100), IN REPORT BLOB, IN PLACE INTEGER ) BEGIN INSERT INTO /*PREFIX*/INTERFACES (INTERFACE_ID,NAME,DESCRIPTION,INTERFACE_TYPE,MODULE_NAME,MODULE_INTERFACE) VALUES (REPORT_ID,NAME,DESCRIPTION,INTERFACE_TYPE,NULL,NULL); INSERT INTO /*PREFIX*/REPORTS (REPORT_ID,ENGINE,REPORT,PLACE) VALUES (REPORT_ID,ENGINE,REPORT,PLACE); END; -- /* Создание процедуры изменения задания */ CREATE PROCEDURE /*PREFIX*/U_REPORT ( IN REPORT_ID VARCHAR(32), IN NAME VARCHAR(100), IN DESCRIPTION VARCHAR(250), IN INTERFACE_TYPE INTEGER, IN ENGINE VARCHAR(100), IN REPORT BLOB, IN PLACE INTEGER, IN OLD_REPORT_ID VARCHAR(32) ) BEGIN UPDATE /*PREFIX*/INTERFACES I SET I.INTERFACE_ID=REPORT_ID, I.NAME=NAME, I.DESCRIPTION=DESCRIPTION WHERE I.INTERFACE_ID=OLD_REPORT_ID; UPDATE /*PREFIX*/REPORTS R SET R.REPORT_ID=REPORT_ID, R.ENGINE=ENGINE, R.REPORT=REPORT, R.PLACE=PLACE WHERE R.REPORT_ID=OLD_REPORT_ID; END; -- /* Создание процедуры удаления задания */ CREATE PROCEDURE /*PREFIX*/D_REPORT ( IN OLD_REPORT_ID VARCHAR(32) ) BEGIN DELETE FROM /*PREFIX*/REPORTS WHERE REPORT_ID=OLD_REPORT_ID; DELETE FROM /*PREFIX*/INTERFACES WHERE INTERFACE_ID=OLD_REPORT_ID; END; --
CREATE TABLE TBL_STOCK( PRODUCT_ID VARCHAR2(6) CONSTRAINT TBL_STOCK_PK PRIMARY KEY, PRODUCT_NAME VARCHAR2(20) UNIQUE, QUANTITY_ON_HAND NUMBER CONSTRAINT TEST_CHECK_QTY CHECK( QUANTITY_ON_HAND >=0 ), PRODUCT_UNIT_PRICE NUMBER CONSTRAINT TEST_CHECK_PRICE CHECK ( PRODUCT_UNIT_PRICE >= 0 ), REORDER_LEVEL NUMBER CONSTRAINT TEST_CHECK_REORDER CHECK ( REORDER_LEVEL >= 0 ) ) CREATE TABLE TBL_SALES( SALES_ID VARCHAR2(6) CONSTRAINT TBL_SALES_PK PRIMARY KEY, SALES_DATE DATE, PRODUCT_ID VARCHAR(6) CONSTRAINT TBL_SALES_FK REFERENCES TBL_STOCK(PRODUCT_ID) ON DELETE CASCADE, QUANTITY_SOLD NUMBER CONSTRAINT TEST_CHECK_SALES_QTY CHECK( QUANTITY_SOLD >=0 ), SALES_PRICE_PER_UNIT NUMBER CONSTRAINT TEST_CHECK_SALES_PRICE CHECK( SALES_PRICE_PER_UNIT >=0 ) ) INSERT INTO TBL_STOCK VALUES ('RE1001','REDMI NOTE 3',20,12000,5); INSERT INTO TBL_STOCK VALUES ('IP1002','IPHONE 5S',10,21000,2); INSERT INTO TBL_STOCK VALUES ('PA1003','PANASONIC P55',50,5500,5); CREATE SEQUENCE SEQ_SALES_ID START WITH 1000 INCREMENT BY 1 NOCACHE NOCYCLE; CREATE SEQUENCE SEQ_PRODUCT_ID START WITH 1004 INCREMENT BY 1 NOCACHE NOCYCLE; CREATE VIEW V_SALES_REPORT AS SELECT SALES_ID , SALES_DATE , TBL_STOCK.PRODUCT_ID ,PRODUCT_NAME ,QUANTITY_SOLD ,PRODUCT_UNIT_PRICE ,SALES_PRICE_PER_UNIT, SALES_PRICE_PER_UNIT - PRODUCT_UNIT_PRICE AS "PROFIT_AMOUNT" FROM TBL_STOCK INNER JOIN TBL_SALES ON TBL_STOCK.PRODUCT_ID=TBL_SALES.PRODUCT_ID;
/* Changing Database Collation/Ctype to UTF-8 breaks pretty links Purpose: after fixing collation on PostgreSQL breaks links Confluence database collation/ctype should be set to UTF-8. If Confluence resides on a database with an ASCII (C) collation/ctype we advise that this is changed to UTF-8, as described in: How to fix the collation of a Postgres Confluence database There is however a potential problem for instances using a non-Latin characters that have capitalisations, such as Cyrillic or Greek, that may manifest in ways such as pretty links being broken. The cause is that an ASCII (C) ctype, will ignore non-Latin characters, as it won't know how to treat them. That means that character manipulation functions, such as those used to change capitalisation, won't be applied to them. Confluence relies on those functions to populate the lower* columns in its database. Such lowertitle in CONTENT, or lowerspacekey in SPACES. As a result of the failure to apply those functions, when using non-ASCII characters, the columns will be populated by the values as provided, including capitalisations. link: https://confluence.atlassian.com/confkb/changing-database-collation-ctype-to-utf-8-breaks-pretty-links-1086419517.html */ update content set lowertitle=lower(lowertitle);
SELECT TOP 5 Name, COUNT(*) AS ReportsNumber FROM Reports r JOIN Categories ca ON ca.Id = r.CategoryId GROUP BY ca.[Name] ORDER BY COUNT(ca.Name) DESC, ca.Name
CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `first_name` varchar(100) NOT NULL, `last_name` varchar(100) NOT NULL, `email` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `account` ( `id` int NOT NULL AUTO_INCREMENT, `user_id` int(11) unsigned NOT NULL, `is_active` int(2) unsigned NOT NULL DEFAULT 1, `account_balance` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), CONSTRAINT `fk_account_user` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `operation` ( `id` int NOT NULL AUTO_INCREMENT, `from_user` int(11) unsigned NOT NULL, `to_user` int(11) unsigned NULL DEFAULT NULL, `type` smallint(5) unsigned NOT NULL DEFAULT 0, `amount` INT(11) NOT NULL DEFAULT 0, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), CONSTRAINT `fk_transaction_from_user` FOREIGN KEY (`from_user`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_transaction_to_user` FOREIGN KEY (`to_user`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `user` (`first_name`, `last_name`, `email`) VALUES ('John', 'Doe', 'john@example.com'); INSERT INTO `user` (`first_name`, `last_name`, `email`) VALUES ('Jane', 'Doe', 'jane@example.com'); INSERT INTO `user` (`first_name`, `last_name`, `email`) VALUES ('Bobby', 'Doe', 'bobby@example.com'); INSERT INTO `account` (`user_id`, `is_active`, `account_balance`) VALUES ('1', '1', '80000'); INSERT INTO `account` (`user_id`, `is_active`, `account_balance`) VALUES ('2', '1', '80000'); INSERT INTO `account` (`user_id`, `is_active`, `account_balance`) VALUES ('3', '0', '0'); INSERT INTO `operation` (`from_user`, `to_user`, `type`, `amount`, `created_at`) VALUES ('1', '2', '1', '1000', '2020-05-23 16:19:44');
DO $$ BEGIN BEGIN ALTER TABLE cd_profiles ADD COLUMN user_type character varying; EXCEPTION WHEN duplicate_column THEN RAISE NOTICE 'column user_type already exists in cd_profiles.'; END; END; $$
# --- !Ups alter table person add column gender varchar(10) not null default 'Unknown' check(gender = 'Unknown' or gender='Male' or gender='Female'); # --- !Downs alter table person drop column gender;
-- Server Fees $Date: 04/01/23 16:13:40-06:00 $ SELECT customer_number as "Account Number", computer_number as "Server Number", sum( CASE WHEN datacenter_number = 2 THEN null_to_float8(final_monthly) * 1.46 ELSE null_to_float8(final_monthly) END ) as "Monthy Fee", sum( CASE WHEN datacenter_number = 2 THEN null_to_float8(final_setup) * 1.46 ELSE null_to_float8(final_setup) END ) as "Setup Fee" FROM queue_cancel_server join server using (computer_number) WHERE --date_where GROUP BY customer_number, computer_number ORDER BY customer_number, computer_number ;
drop table products; drop sequence pid_seq restrict; create table products ( id INT PRIMARY KEY, name VARCHAR (40) NOT NULL, price NUMERIC (6,2) NOT NULL, best_before DATE, version INT DEFAULT 1); create sequence pid_seq as int start with 1 increment by 1 no cycle; insert into products values (next value for pid_seq, 'Cookie', 2.99, cast({ fn timestampadd(SQL_TSI_DAY,5,current_date) } as DATE), 1); insert into products values (next value for pid_seq, 'Cake', 3.99, cast({ fn timestampadd(SQL_TSI_DAY,5,current_date) } as DATE), 1); insert into products values (next value for pid_seq, 'Tea', 1.99, null, 1); insert into products values (next value for pid_seq, 'Coffee', 1.99, null, 1);
INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (11, 'ID', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (12, 'FOR_NAME', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (13, 'REF_NAME', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (14, 'ID', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (14, 'POS', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (15, 'SPACE', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (16, 'SPACE', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (17, 'TABLE_ID', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (17, 'POS', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (17, 'BASE_POS', 2); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (18, 'database_name', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (18, 'table_name', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (19, 'database_name', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (19, 'table_name', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (19, 'index_name', 2); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (19, 'stat_name', 3); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (20, 'transaction_id', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (21, 'commit_id', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (22, 'begin_timestamp', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (23, 'commit_timestamp', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (23, 'transaction_id', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (24, 'domain_id', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (24, 'sub_id', 1); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (25, 'id', 0); INSERT INTO information_schema.INNODB_SYS_FIELDS (INDEX_ID, NAME, POS) VALUES (26, 'id', 0);
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Anamakine: 127.0.0.1 -- Üretim Zamanı: 16 Şub 2021, 21:07:34 -- Sunucu sürümü: 10.4.17-MariaDB -- PHP Sürümü: 7.3.26 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 */; -- -- Veritabanı: `action` -- -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `kisiler` -- CREATE TABLE `kisiler` ( `id` int(11) NOT NULL, `kullaniciadi` varchar(55) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL, `sifre` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `salt` binary(20) NOT NULL, `mail` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `adsoyad` varchar(50) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL, `avatar` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `emailonay` int(11) NOT NULL DEFAULT 1, `date` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Tablo döküm verisi `kisiler` -- INSERT INTO `kisiler` (`id`, `kullaniciadi`, `sifre`, `salt`, `mail`, `adsoyad`, `avatar`, `emailonay`, `date`) VALUES (32, 'admin', 'admin', 0xe13c3dd05417929ec89d38e29c3f4241d391200d, 'admin@', 'admin', '', 1, '2021-02-16 19:56:14'); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `tweetler` -- CREATE TABLE `tweetler` ( `id` int(11) NOT NULL, `uuid` varchar(100) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL, `text` varchar(500) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL, `path` varchar(500) CHARACTER SET utf8 COLLATE utf8_turkish_ci NOT NULL, `date` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dökümü yapılmış tablolar için indeksler -- -- -- Tablo için indeksler `kisiler` -- ALTER TABLE `kisiler` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`), ADD UNIQUE KEY `kullaniciadi` (`kullaniciadi`), ADD UNIQUE KEY `mail` (`mail`); -- -- Tablo için indeksler `tweetler` -- ALTER TABLE `tweetler` ADD UNIQUE KEY `uuid` (`uuid`); -- -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri -- -- -- Tablo için AUTO_INCREMENT değeri `kisiler` -- ALTER TABLE `kisiler` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; 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 */;
drop table `dmn_quizzes` CREATE TABLE `dmn_quizzes` ( `id` int(11) NOT NULL, `quiz_name` varchar(100) NOT NULL, `course_name` varchar(100) NOT NULL, `quiz_level` varchar(25) NOT NULL, `topic` varchar(50) NOT NULL, `topic_id` int(11) NOT NULL, `question_text` text NOT NULL, `question_has_image` varchar(1) DEFAULT NULL, `question_image_path` varchar(100) DEFAULT NULL, `option_a_text` text NOT NULL, `option_a_has_image` varchar(1) DEFAULT NULL, `option_a_image_path` varchar(100) DEFAULT NULL, `option_b_text` text NOT NULL, `option_b_has_image` varchar(1) DEFAULT NULL, `option_b_image_path` text, `option_c_text` text NOT NULL, `option_c_has_image` varchar(1) DEFAULT NULL, `option_c_image_path` varchar(100) DEFAULT NULL, `option_d_text` text NOT NULL, `option_d_has_image` varchar(1) DEFAULT NULL, `option_d_image_path` varchar(100) DEFAULT NULL, `option_e_text` text NOT NULL, `option_e_has_image` varchar(1) DEFAULT NULL, `option_e_image_path` varchar(100) DEFAULT NULL, `option_f_text` text NOT NULL, `option_f_has_image` varchar(1) DEFAULT NULL, `option_f_image_path` varchar(100) DEFAULT NULL, `correct_option` varchar(20) NOT NULL, `last_insrt_upd_usr_id` int(11) NOT NULL, `last_insrt_upd_ts` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `dmn_quizzes` -- ALTER TABLE `dmn_quizzes` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `dmn_quizzes` -- ALTER TABLE `dmn_quizzes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!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 */; CREATE TABLE `app_polyglot_quiz` ( `id` INT NOT NULL AUTO_INCREMENT , `partner_id` INT NOT NULL , `quiz_id` INT NOT NULL , `last_insrt_upd_ts` DATETIME NOT NULL , `last_insrt_upd_usr_id` INT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB; ALTER TABLE `app_polyglot_quiz` ADD CONSTRAINT `fk_partner_id_quiz` FOREIGN KEY (`partner_id`) REFERENCES `app_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `app_polyglot_quiz` ADD CONSTRAINT `fk_quiz_id_quiz` FOREIGN KEY (`quiz_id`) REFERENCES `dmn_quizzes`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE `app_polyglot_quiz` ADD `is_active` VARCHAR(1) NOT NULL AFTER `quiz_id`; ALTER TABLE `app_polyglot_quiz` ADD `duration` INT NOT NULL AFTER `is_active`; ALTER TABLE `app_polyglot_quiz` ADD `number_of_questions` INT NOT NULL AFTER `duration`; ALTER TABLE `app_polyglot_quiz` ADD `quiz_name` VARCHAR(100) NOT NULL AFTER `quiz_id`; ALTER TABLE `app_polyglot_quiz` ADD `description` VARCHAR(250) NULL AFTER `number_of_questions`; ALTER TABLE `dmn_quizzes` DROP `quiz_name`;
#After installtion: # this user has access to sockets in /var/run/postgresql sudo su - postgres # include path to postgres binaries export PATH=$PATH:/usr/lib/postgresql/12/bin cd ~ #create directory mkdir -p citus/master citus/slave1 citus/slave2 # create three normal postgres instances initdb -D citus/master initdb -D citus/slave1 initdb -D citus/slave2 #change the config file echo "shared_preload_libraries = 'citus'" >> citus/master/postgresql.conf echo "shared_preload_libraries = 'citus'" >> citus/slave1/postgresql.conf echo "shared_preload_libraries = 'citus'" >> citus/slave2/postgresql.conf #Let’s start the server: /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/citus/master start /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/citus/sslave1 start /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/citus/slave2 start #create Extensions psql -p 4444 -c "CREATE EXTENSION citus;" psql -p 5555-c "CREATE EXTENSION citus;" psql -p 6666 -c "CREATE EXTENSION citus;" #adding node to master SELECT * from master_add_node('localhost', 5555); SELECT * from master_add_node('localhost', 6666); #check whether its added select * from master_get_active_worker_nodes(); #master port is running on :4444 CREATE TABLE companies ( id bigint NOT NULL, name text NOT NULL, image_url text, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); CREATE TABLE campaigns ( id bigint NOT NULL, company_id bigint NOT NULL, name text NOT NULL, cost_model text NOT NULL, state text NOT NULL, monthly_budget bigint, blacklisted_site_urls text[], created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); # To distribute the tables in the worker nodes SELECT create_distributed_table('companies', 'id'); SELECT create_distributed_table('campaigns', 'company_id'); #load the data into the tables using \copy command \copy companies from '/home/keerthana/Downloads/companies.csv' with csv \copy campaigns from '/home/keerthana/Downloads/campaigns.csv' with csv #sample queries 1.INSERT INTO companies VALUES (5000, 'New Company', 'https://randomurl/image.png', now(), now()); 2.DELETE FROM campaigns WHERE id = 23 AND company_id = 3;
create table comics_date ( comic varchar(20) not null, date date not null, gfx tinytext null, comment text null, timestamp datetime not null, primary key (comic,date) );
CREATE TABLE `Customer` ( `CustomerID` INT NOT NULL, `FirstName` VARCHAR(100) NOT NULL, `LastName` VARCHAR(100) NOT NULL, `TransactionTotal` FLOAT NULL DEFAULT 0, PRIMARY KEY (`CustomerID`)); CREATE TABLE `Transaction` ( `ID` INT NOT NULL AUTO_INCREMENT, `CustomerID` INT NOT NULL, `Amount` INT NULL, PRIMARY KEY (`ID`)); TRUNCATE TABLE Customer; TRUNCATE TABLE Transaction; CREATE TABLE `CustomerUpperCase` ( `CustomerID` INT NOT NULL, `FirstName` VARCHAR(100) NOT NULL, `LastName` VARCHAR(100) NOT NULL, `TransactionTotal` FLOAT NULL DEFAULT 0, PRIMARY KEY (`CustomerID`)); CREATE TABLE `CustomerLowerCase` ( `CustomerID` INT NOT NULL, `FirstName` VARCHAR(100) NOT NULL, `LastName` VARCHAR(100) NOT NULL, `TransactionTOtal` FLOAT NULL DEFAULT 0, PRIMARY KEY (`CustomerID`));
USE sakila SELECT COUNT(*) FROM customer; SELECT COUNT(email) FROM customer;
#创建流程任务变量池表 DROP TABLE IF EXISTS act_task_var_pool; CREATE TABLE act_task_var_pool( id INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键', process_key VARCHAR(64) NOT NULL COMMENT '流程key', process_def_id VARCHAR(64) COMMENT '流程定义id 未发布之前没有流程定义id', user_task_var_info TEXT COMMENT '流程任务节点变量池', type_ TINYINT COMMENT '1.节点相关变量 2.表单绑定的变量', PRIMARY KEY (id), INDEX (process_key,type_) )engine=innodb CHARSET ="utf8" AUTO_INCREMENT=1 COMMENT '流程任务变量池'; DROP TABLE IF EXISTS act_inform_process; CREATE TABLE `act_inform_process` ( `id_` int(11) NOT NULL AUTO_INCREMENT, `process_instance_id` varchar(64) NOT NULL COMMENT '流程实例id', `task_id` varchar(64) NOT NULL COMMENT '任务id', `state_` tinyint(4) NOT NULL DEFAULT '0' COMMENT '知会状态', `type_` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1代表自动完成 2代表知会不自动完成,任务知会', `inform_person_id` int(11) NOT NULL COMMENT '知会人id', `operate_person_id` int(11) DEFAULT NULL COMMENT '操作人id', `create_time` datetime NOT NULL COMMENT '知会时间', PRIMARY KEY (`id_`), INDEX(process_instance_Id,task_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='知会流程'; /* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50536 Source Host : localhost:3306 Source Database : activiti Target Server Type : MYSQL Target Server Version : 50536 File Encoding : 65001 Date: 2017-03-01 15:39:32 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for act_state -- ---------------------------- DROP TABLE IF EXISTS `act_state`; CREATE TABLE `act_state` ( `processId` VARCHAR(64) NOT NULL, `state` TINYINT(4) DEFAULT '0' COMMENT '状态 0普通 1催办', PRIMARY KEY (`processId`) ) ENGINE=INNODB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for hm_act_creation -- ---------------------------- DROP TABLE IF EXISTS `hm_act_creation`; DROP TABLE IF EXISTS `hm_act_creation`; CREATE TABLE `hm_act_creation` ( ID INT(11) NOT NULL AUTO_INCREMENT, FACTORY_NAME VARCHAR(255) DEFAULT NULL COMMENT '保存工厂名称', PROCESS_DEFINITION_ID VARCHAR(255) NOT NULL COMMENT '流程定义id', DOUSERID VARCHAR(20) DEFAULT NULL COMMENT '操作人id', ACT_ID VARCHAR(64) DEFAULT NULL, PROCESS_INSTANCE_ID VARCHAR(255) NOT NULL COMMENT '流程实例id', PROPERTIES_TEXT VARCHAR(2000) DEFAULT NULL COMMENT '参数', STATE_ TINYINT(4) DEFAULT 0 COMMENT '0为有效,1为无效', PRIMARY KEY (ID), INDEX (PROCESS_INSTANCE_ID) ) ENGINE=INNODB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COMMENT='临时创建活动节点'; -- ---------------------------- -- Table structure for hm_act_replace -- ---------------------------- DROP TABLE IF EXISTS `hm_act_replace`; CREATE TABLE `hm_act_replace` ( `id` int(11) NOT NULL AUTO_INCREMENT, `processKey` varchar(64) DEFAULT NULL COMMENT '流程key', `checkPerson` varchar(20) DEFAULT NULL COMMENT '审批人', `changePerson` varchar(20) DEFAULT NULL COMMENT '代签人', `startTime` datetime DEFAULT NULL COMMENT '代理开始时间', `endTime` datetime DEFAULT NULL COMMENT '代理结束时间', `agree` tinyint(4) DEFAULT '0' COMMENT '是否同意 默认是0 等待同意 1 代表 同意 2不同意', `state` tinyint(4) DEFAULT '1' COMMENT '代签状态 1 代表使用 2 代表不使用', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程审批代理人'; -- ---------------------------- -- Table structure for hm_act_skipactiviti -- ---------------------------- DROP TABLE IF EXISTS `hm_act_skipactiviti`; CREATE TABLE `hm_act_skipactiviti` ( `id` int(11) NOT NULL AUTO_INCREMENT, `processId` varchar(64) NOT NULL COMMENT '流程实例id', `processDef` varchar(64) DEFAULT NULL COMMENT '流程定义id', `activityKey` varchar(64) NOT NULL COMMENT '活动key', `userId` int(11) DEFAULT NULL COMMENT '操作人id', `activityType` tinyint(4) DEFAULT NULL, `state` tinyint(4) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for hm_flow_diagram_form_model -- ---------------------------- DROP TABLE IF EXISTS `hm_flow_diagram_form_model`; CREATE TABLE `hm_flow_diagram_form_model` ( `formid` int(11) NOT NULL AUTO_INCREMENT, `type` varchar(255) DEFAULT NULL, `parseform` text, `formtype` varchar(255) DEFAULT NULL, `state` int(255) DEFAULT '0', `createtime` datetime DEFAULT NULL, PRIMARY KEY (`formid`) ) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for inform_act -- ---------------------------- DROP TABLE IF EXISTS `inform_act`; CREATE TABLE `inform_act` ( `id` int(11) NOT NULL AUTO_INCREMENT, `processId` varchar(64) NOT NULL COMMENT '流程实例id', `state` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 为不需要知会的 1需要知会的流程', `informPersonId` int(11) NOT NULL COMMENT '知会人id', `opertPersonName` varchar(20) NOT NULL COMMENT '操作人名称', `opertPersonId` int(11) NOT NULL COMMENT '操作人id', `createTime` datetime NOT NULL COMMENT '通知时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='知会流程'; -- ---------------------------- -- Table structure for process_role -- ---------------------------- DROP TABLE IF EXISTS `process_role`; CREATE TABLE `process_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `adminid` int(11) DEFAULT NULL COMMENT '员工id', `departmentid` int(11) DEFAULT NULL COMMENT '部门id', `roleid` int(11) DEFAULT NULL COMMENT '岗位id', `branchid` int(11) DEFAULT NULL COMMENT '分公司id', `createtime` datetime NOT NULL, `updatetime` datetime DEFAULT NULL, `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0:无效,1有效', `creatorid` int(11) NOT NULL COMMENT '创建者', `processId` varchar(64) DEFAULT NULL COMMENT '流程实例id', `taskId` varchar(64) DEFAULT NULL COMMENT '任务id', `processDefKey` varchar(64) DEFAULT NULL COMMENT '流程key', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程_岗位表'; DROP TABLE IF EXISTS act_process_type; CREATE TABLE `act_process_type` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `code_id` varchar(10) NOT NULL COMMENT '类别id', `name_` varchar(20) NOT NULL COMMENT '类型名称', `pid` int(11) NOT NULL DEFAULT '0' COMMENT '分类的上级id', `state_` bigint(4) NOT NULL DEFAULT '0' COMMENT '有效性', PRIMARY KEY (`id`), UNIQUE KEY `name_` (`name_`), KEY `code_id` (`code_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='流程分类'; DROP TABLE IF EXISTS hm_process_priority; CREATE TABLE `hm_process_priority` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `proc_inst_id` varchar(255) NOT NULL COMMENT '流程实例的id', `priority` int(11) NOT NULL DEFAULT '0' COMMENT '任务优先级', `create_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `hand_time` tinyint(4) DEFAULT NULL COMMENT '流程整个处理时间(单位为小时)', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='催办的流程实例';
-- phpMyAdmin SQL Dump -- version 3.1.3.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Erstellungszeit: 27. Januar 2011 um 17:07 -- Server Version: 5.1.33 -- PHP-Version: 5.2.9 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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 */; -- -- Datenbank: `buecher` -- -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `buch` -- CREATE TABLE IF NOT EXISTS `buch` ( `buch_id` int(3) unsigned NOT NULL AUTO_INCREMENT, `buch_name` varchar(255) DEFAULT NULL, `buch_isbn` varchar(14) DEFAULT NULL, `buch_preis` double DEFAULT NULL, PRIMARY KEY (`buch_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12; -- -- Daten für Tabelle `buch` -- INSERT INTO `buch` (`buch_id`, `buch_name`, `buch_isbn`, `buch_preis`) VALUES (1, 'Einstieg in PHP 5 und MySQL 5', '3898428540', 42.9), (2, 'PHP 5 & MySQL 5 Kochbuch', '3826616804', 63), (3, 'PHP 5, Grundlagen und Profiwissen', '3446403345', 86), (4, 'Datenbankprogrammierung mit MySQL 5 und PHP 5', '3826681479', 41.9), (5, 'Dynamische Webseiten mit PHP 5.1 / MySQL 5', '377236330X', 18.9), (6, 'C als erste Programmiersprache', '3835102222', 45.9), (7, 'Moderne C-Programmierung', '3540237852', 63), (8, 'C in a Nutshell (Deutsche Ausgabe)', '3897213443', 75), (9, 'C Kompaktreferenz', '3827322863', 36.9), (10, 'C-Programmierung unter Linux / Unix / Windows', '3899901231', 91), (11, 'C für Dummies', '352770647X', 38.9);
CREATE OR REPLACE PROCEDURE print_any(i_any IN ANYDATA) IS tn VARCHAR2(61); str VARCHAR2(4000); chr VARCHAR2(1000); num NUMBER; dat DATE; rw RAW(4000); res NUMBER; BEGIN IF i_any IS NULL THEN DBMS_OUTPUT.PUT_LINE('NULL value'); RETURN; END IF; tn := i_any.GETTYPENAME(); IF tn = 'SYS.VARCHAR2' THEN res := i_any.GETVARCHAR2(str); DBMS_OUTPUT.PUT_LINE(SUBSTR(str,0,253)); ELSIF tn = 'SYS.CHAR' then res := i_any.GETCHAR(chr); DBMS_OUTPUT.PUT_LINE(SUBSTR(chr,0,253)); ELSIF tn = 'SYS.VARCHAR' THEN res := i_any.GETVARCHAR(chr); DBMS_OUTPUT.PUT_LINE(chr); ELSIF tn = 'SYS.NUMBER' THEN res := i_any.GETNUMBER(num); DBMS_OUTPUT.PUT_LINE(num); ELSIF tn = 'SYS.DATE' THEN res := i_any.GETDATE(dat); DBMS_OUTPUT.PUT_LINE(dat); ELSIF tn= 'SYS.TIMESTAMP' THEN res := i_any.GETTIMESTAMP(dat); DBMS_OUTPUT.PUT_LINE(TO_CHAR(dat,'YYYY-MM-DD HH24:MI:SS')); --RAO DBMS_OUTPUT.PUT_LINE(TO_CHAR(dat,'DD-MON-RR HH.MI.SSXFF AM')); ELSIF tn= 'SYS.TIMESTAMPTZ' THEN res := i_any.GETTIMESTAMPTZ(dat); DBMS_OUTPUT.PUT_LINE(TO_CHAR(dat,'DD-MON-RR HH.MI.SSXFF AM')); ELSIF tn= 'SYS.TIMESTAMPLTZ' THEN res := i_any.GETTIMESTAMPLTZ(dat); DBMS_OUTPUT.PUT_LINE(TO_CHAR(dat,'DD-MON-RR HH.MI.SSXFF AM')); ELSIF tn = 'SYS.RAW' THEN -- res := i_any.GETRAW(rw); -- DBMS_OUTPUT.PUT_LINE(SUBSTR(DBMS_LOB.SUBSTR(rw),0,253)); DBMS_OUTPUT.PUT_LINE('BLOB Value'); ELSIF tn = 'SYS.BLOB' THEN DBMS_OUTPUT.PUT_LINE('BLOB Found'); ELSE DBMS_OUTPUT.PUT_LINE('typename is ' || tn); END IF; END print_any; /
-- 统计玩家游戏的次数 select player_id,event_date, (select sum(games_played) from activity b where player_id = a.player_id and event_date <= a.event_date) as 'ames_played_so_far' from activity a
-- find org records associated with a group of pubs defined in pub_tree select org.id, min(pub.title), pub_tree.parent, min(parent_pub.title) from org join pub_org on org.id = pub_org.org_id join pub on pub_org.pub_id = pub.id join pub_tree on pub.id = pub_tree.pub join pub_tree as parent on pub_tree.parent = parent.id and parent.depth = 1 join pub as parent_pub on parent.pub = parent_pub.id where pub_tree.depth = 1 group by org.id, pub_tree.parent;
SELECT DISTINCT (cp.bank_code) FROM cp_cust_bank_acct_info cp WHERE EXISTS ( SELECT 1 FROM ac_dis_bank_card ad WHERE ad.cust_bank_id = cp.cust_bank_id AND ad.is_valid = '1' AND ad.pay_sign = '2' AND ad.cust_no = '1000000821' AND ad.dis_code = 'null')
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 01-Set-2018 às 00:45 -- Versão do servidor: 5.7.17 -- PHP Version: 5.6.30 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: `java` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `metodologia` -- CREATE TABLE `metodologia` ( `id` int(5) NOT NULL, `titulo` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `pessoa` -- CREATE TABLE `pessoa` ( `id` int(5) NOT NULL, `nome` varchar(100) NOT NULL, `email` varchar(150) NOT NULL, `sexo` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `rel_tarefa_pessoa` -- CREATE TABLE `rel_tarefa_pessoa` ( `id` int(5) NOT NULL, `id_tarefa` int(11) NOT NULL, `id_pessoa` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `tarefa` -- CREATE TABLE `tarefa` ( `id` int(5) NOT NULL, `titulo` varchar(100) NOT NULL, `prazo_estimado` date DEFAULT NULL, `descricao` varchar(400) DEFAULT NULL, `data_inicio` date NOT NULL, `data_termino` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `metodologia` -- ALTER TABLE `metodologia` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pessoa` -- ALTER TABLE `pessoa` ADD PRIMARY KEY (`id`); -- -- Indexes for table `rel_tarefa_pessoa` -- ALTER TABLE `rel_tarefa_pessoa` ADD PRIMARY KEY (`id`), ADD KEY `FK_Tarefa` (`id_tarefa`), ADD KEY `FK_Pessoa` (`id_pessoa`); -- -- Indexes for table `tarefa` -- ALTER TABLE `tarefa` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `metodologia` -- ALTER TABLE `metodologia` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `pessoa` -- ALTER TABLE `pessoa` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `rel_tarefa_pessoa` -- ALTER TABLE `rel_tarefa_pessoa` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tarefa` -- ALTER TABLE `tarefa` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Limitadores para a tabela `metodologia` -- ALTER TABLE `metodologia` ADD CONSTRAINT `FK_idTarefa` FOREIGN KEY (`id`) REFERENCES `tarefa` (`id`); -- -- Limitadores para a tabela `rel_tarefa_pessoa` -- ALTER TABLE `rel_tarefa_pessoa` ADD CONSTRAINT `FK_Pessoa` FOREIGN KEY (`id_pessoa`) REFERENCES `pessoa` (`id`), ADD CONSTRAINT `FK_Tarefa` FOREIGN KEY (`id_tarefa`) REFERENCES `tarefa` (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
SELECT nfc_type_id,count(id) FROM emergency_server.tbl_emergency_call group by nfc_type_id; select * from tbl_emergency_call Select count(id) from tbl_emergency_call GROUP BY YEAR(report_datetime), MONTH(report_datetime) Select nfc_type_id,MONTH(report_datetime),count(id) from tbl_emergency_call where YEAR(report_datetime)=2016 GROUP BY nfc_type_id,MONTH(report_datetime) SELECT COUNT(id), DATE_FORMAT(report_datetime, '%Y-%m-%d') AS DAY, DATE_FORMAT(report_datetime, '%Y-%m') AS MONTH, DATE_FORMAT(report_datetime, '%Y') AS YEAR, FROM tbl_emergency_call GROUP BY DATE_FORMAT(report_datetime, '%Y-%m-%d ');
#База данных “страны и города мира”: use geodata; # 1) сделать запрос в котором мы выберем все данные о городе - регион, страна. select _cities.title as city, _regions.title as region, _countries.title as country from _cities left join _regions on region_id = _regions.id left join _countries on _cities.country_id = _countries.id; # 2) Выбрать все города из Московской области. select _cities.title as city from _cities where region_id = (select id from _regions where title='Московская область'); # База данных «Сотрудники». use employees; #1. Выбрать среднюю зарплату по отделам. select avg(salaries.salary) as salary, departments.dept_name as department from departments left join dept_emp on departments.dept_no = dept_emp.dept_no left join salaries on dept_emp.emp_no = salaries.emp_no group by department; # 2. Выбрать максимальную зарплату у сотрудника. select max(salary) as max_salary, concat(first_name, ' ', last_name) as employee from salaries left join employees on salaries.emp_no = employees.emp_no group by employees.emp_no order by max_salary desc; #3. Удалить одного сотрудника, у которого максимальная зарплата. delete from employees where emp_no = (select emp_no from salaries having max(salary)); #4. Посчитать количество сотрудников во всех отделах. select count(employees.emp_no) as emp_count, departments.dept_name as department from employees right join dept_emp on employees.emp_no = dept_emp.emp_no right join departments on dept_emp.dept_no = departments.dept_no group by department order by emp_count desc; #5. Найти количество сотрудников в отделах и посмотреть сколько всего денег получает отдел. select count(employees.emp_no) as emp_count, departments.dept_name as department, sum(salaries.salary) as money from employees right join dept_emp on employees.emp_no = dept_emp.emp_no right join departments on dept_emp.dept_no = departments.dept_no left join salaries on employees.emp_no = salaries.emp_no group by department order by money desc;
CREATE TABLE `rfid_data_day_1` ( `resortID` int(11) NOT NULL, `dayNum` int(11) NOT NULL, `skierID` int(11) NOT NULL, `liftID` int(11) NOT NULL, `time` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
delimiter $$ CREATE DATABASE `evaluacion` /*!40100 DEFAULT CHARACTER SET utf8 */$$ delimiter $$ CREATE TABLE `usuarios` ( `id_usuario` int(11) NOT NULL AUTO_INCREMENT, `nombre` varchar(50) NOT NULL, `apellido` varchar(50) NOT NULL, `documento` varchar(11) NOT NULL, `sexo` varchar(1) NOT NULL, `puesto` enum('SUPERVISOR','SEMI-JUNIOR','JUNIOR') NOT NULL, `user` varchar(255) NOT NULL, `pass` varchar(255) NOT NULL, `imagen` varchar(255) NOT NULL, PRIMARY KEY (`id_usuario`), UNIQUE KEY `id_2` (`id_usuario`), UNIQUE KEY `user` (`user`), KEY `id` (`id_usuario`) ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1$$ delimiter $$ CREATE TABLE `ventas` ( `venta_id` int(11) NOT NULL AUTO_INCREMENT, `venta_monto` double(19,4) NOT NULL, `venta_fecha` datetime NOT NULL, `id_usuario` int(11) NOT NULL, PRIMARY KEY (`venta_id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1$$
CREATE TABLE climateChange ( country_code varchar(255), country_name varchar(255), co2_emissions varchar(255), Y1990 real, Y1991 real, Y1992 real, Y1993 real, Y1994 real, Y1995 real, Y1996 real, Y1997 real, Y1998 real, Y1999 real, Y2000 real, Y2001 real, Y2002 real, Y2003 real, Y2004 real, Y2005 real, Y2006 real, Y2007 real, Y2008 real );
-------------------------------------------------------------- drop table if exists ads_order_daycount; create external table ads_order_daycount( dt string comment '统计日期', order_count bigint comment '每日下单笔数', order_amount bigint comment '每日下单金额', order_users bigint comment '每日下单用户数' ) comment '每日订单总计表' row format delimited fields terminated by '\t' location '/warehouse/gmall/ads/ads_order_daycount'; -------------------------------------------------------------- -------------------------------------------------------------- insert into table ads_order_daycount select '2020-03-10', sum(order_count), sum(order_amount), sum(if(order_count>0,1,0)) from dws_user_action_daycount where dt='2020-03-10'; -------------------------------------------------------------- -------------------------------------------------------------- drop table if exists ads_payment_daycount; create external table ads_payment_daycount( dt string comment '统计日期', payment_count bigint comment '单日支付笔数', payment_amount bigint comment '单日支付金额', payment_user_count bigint comment '单日支付人数', payment_sku_count bigint comment '单日支付商品数', payment_avg_time double comment '下单到支付的平均时长,取分钟数' ) comment '每日支付总计表' row format delimited fields terminated by '\t' location '/warehouse/gmall/ads/ads_payment_daycount'; -------------------------------------------------------------- -------------------------------------------------------------- insert into table ads_payment_daycount select tmp_payment.dt, tmp_payment.payment_count, tmp_payment.payment_amount, tmp_payment.payment_user_count, tmp_skucount.payment_sku_count, tmp_time.payment_avg_time from ( select '2020-03-10' dt, sum(payment_count) payment_count, sum(payment_amount) payment_amount, sum(if(payment_count>0,1,0)) payment_user_count from dws_user_action_daycount where dt='2020-03-10' )tmp_payment join ( select '2020-03-10' dt, sum(if(payment_count>0,1,0)) payment_sku_count from dws_sku_action_daycount where dt='2020-03-10' )tmp_skucount on tmp_payment.dt=tmp_skucount.dt join ( select '2020-03-10' dt, sum(unix_timestamp(payment_time)-unix_timestamp(create_time))/count(*)/60 payment_avg_time from dwd_fact_order_info where dt='2020-03-10' and payment_time is not null )tmp_time on tmp_payment.dt=tmp_time.dt; -------------------------------------------------------------- -------------------------------------------------------------- drop table ads_sale_tm_category1_stat_mn; create external table ads_sale_tm_category1_stat_mn ( tm_id string comment '品牌id', category1_id string comment '一级品类id ', category1_name string comment '一级品类名称 ', buycount bigint comment '购买人数', buy_twice_last bigint comment '两次以上购买人数', buy_twice_last_ratio decimal(10,2) comment '单次复购率', buy_3times_last bigint comment '三次以上购买人数', buy_3times_last_ratio decimal(10,2) comment '多次复购率', stat_mn string comment '统计月份', stat_date string comment '统计日期' ) COMMENT '复购率统计表' row format delimited fields terminated by '\t' location '/warehouse/gmall/ads/ads_sale_tm_category1_stat_mn/'; -------------------------------------------------------------- -------------------------------------------------------------- with tmp_order as ( select user_id, order_stats_struct.sku_id sku_id, order_stats_struct.order_count order_count from dws_user_action_daycount lateral view explode(order_stats) tmp as order_stats_struct where date_format(dt,'yyyy-MM')=date_format('2020-03-10','yyyy-MM') ), tmp_sku as ( select id, tm_id, category1_id, category1_name from dwd_dim_sku_info where dt='2020-03-10' ) insert into table ads_sale_tm_category1_stat_mn select tm_id, category1_id, category1_name, sum(if(order_count>=1,1,0)) buycount, sum(if(order_count>=2,1,0)) buyTwiceLast, sum(if(order_count>=2,1,0))/sum( if(order_count>=1,1,0)) buyTwiceLastRatio, sum(if(order_count>=3,1,0)) buy3timeLast , sum(if(order_count>=3,1,0))/sum( if(order_count>=1,1,0)) buy3timeLastRatio , date_format('2020-03-10' ,'yyyy-MM') stat_mn, '2020-03-10' stat_date from ( select tmp_order.user_id, tmp_sku.category1_id, tmp_sku.category1_name, tmp_sku.tm_id, sum(order_count) order_count from tmp_order join tmp_sku on tmp_order.sku_id=tmp_sku.id group by tmp_order.user_id,tmp_sku.category1_id,tmp_sku.category1_name,tmp_ sku.tm_id )tmp group by tm_id, category1_id, category1_name; --------------------------------------------------------------
drop table if exists categories; create table `categories` ( id int auto_increment, pid int NULL, name varchar(100), description varchar(255), created_at datetime not null, updated_at datetime not null, constraint categories_pk primary key (id), constraint categories_categories_id_fk foreign key (pid) references categories (id) on update cascade on delete cascade ); create unique index categories_id_uindex on categories (id); create unique index categories_name_uindex on categories (name); INSERT INTO `categories` (`id`, `pid`,`name`, `description`,`created_at`,`updated_at`) VALUES (1, NULL, 'Auto', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (2, 1, 'Moto', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (3, 1, 'Mazda', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (4, 1, 'Honda', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (5, 2, 'Kawasaki', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (6, 2, 'Harley', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (7, 3, 'Mazda 3', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (8, 3, 'Mazda 6', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (9, 7, 'Sedan', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (10, 7, 'Hatchback', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (11, NULL, 'Boats', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (12, 8, 'Liftback', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (13, 8, 'Crossover', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (14, 13, 'White', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (15, 13, 'Red', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (16, 13, 'Black', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (17, 13, 'Green', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (18, 3, 'Mazda SX', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (19, 3, 'LRed', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (20, 15, 'NormalR', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (21, 15, 'DRed', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (22, 20, 'Percent10Red', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (23, 20, 'Percent15Red', 'Lorem ipsum dolor sit amet','2020-12-15 18:56:46', '2020-12-15 18:56:46'), (24,11,'Abta','kadabra','2020-12-15 18:56:46','2020-12-16 16:34:17');
--Insecao de dados na Tabela Permissao INSERT INTO public.permissao (nome) VALUES ('Permissao1'), ('Permissao2'), ('Permissao3'), ('Permissao4'), ('Permissao5');
update alm_defeitos set alm_defeitos.Fabrica_Teste = a3.testManuf from ( select a2.subproject, a2.delivery, a2.defeito ,case when a2.testManuf not like '%LINK%' then case when a2.testManuf not like '%SONDA%' then case when a2.testManuf not like '%TRIAD%' then case when a2.testManuf not like '%ACC%' then a2.testManuf else 'ACCENTURE' end else 'TRIAD' end else 'SONDA' end else 'LINK' end as testManuf from ( select a1.subproject, a1.delivery, a1.defeito ,(case when IsNull(a1.testManuf,'') not in ('', 'OI') then a1.testManuf else 'N/A' end) as testManuf from ( select df.subprojeto as subproject ,df.entrega as delivery ,df.defeito ,case when isNull(detectado_por,'') <> '' then case when (select isNull(us.fornecedor,'') from ALM_Usuarios us where us.login = df.detectado_por) not in ('', 'OI', '.') then replace(replace((select us.fornecedor from ALM_Usuarios us where us.login = df.detectado_por),char(10),''),char(13),'') else df.fabrica_teste end else df.fabrica_teste end as testManuf from alm_defeitos df ) a1 ) a2 ) a3 where alm_defeitos.subprojeto = a3.subproject and alm_defeitos.entrega = a3.delivery and alm_defeitos.defeito = a3.defeito and ( alm_defeitos.fabrica_teste is null or alm_defeitos.fabrica_teste <> a3.testManuf )
-- phpMyAdmin SQL Dump -- version 3.2.0.1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 09-11-2011 a las 18:00:22 -- Versión del servidor: 5.1.37 -- Versión de PHP: 5.3.0 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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: `chompasdb` -- CREATE DATABASE `chompasdb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `chompasdb`; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `chompas` -- CREATE TABLE IF NOT EXISTS `chompas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_insumo` int(11) NOT NULL, `nombre` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `precio` decimal(10,0) NOT NULL, `stock_min` int(10) NOT NULL, `stock_actual` int(11) NOT NULL, `unidades_pedido` int(3) NOT NULL, PRIMARY KEY (`id`), KEY `id_insumo` (`id_insumo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=7 ; -- -- Volcar la base de datos para la tabla `chompas` -- INSERT INTO `chompas` (`id`, `id_insumo`, `nombre`, `precio`, `stock_min`, `stock_actual`, `unidades_pedido`) VALUES (1, 1, 'office', '100', 100, 200, 200), (2, 2, 'mid season', '120', 80, 160, 100), (3, 1, 'holmes', '120', 80, 160, 100), (4, 3, 'gigardo', '100', 120, 240, 180), (5, 1, 'anton', '110', 100, 200, 150), (6, 3, 'l-blanc', '100', 150, 300, 200); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `insumos` -- CREATE TABLE IF NOT EXISTS `insumos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nombre` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=4 ; -- -- Volcar la base de datos para la tabla `insumos` -- INSERT INTO `insumos` (`id`, `nombre`) VALUES (1, 'classic'), (2, 'modern'), (3, 'elegant'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pedidos` -- CREATE TABLE IF NOT EXISTS `pedidos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_insumo` int(11) NOT NULL, `id_admin` int(11) NOT NULL, `fecha` datetime NOT NULL, `detalle` varchar(300) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`), KEY `id_insumo` (`id_insumo`), KEY `id_admin` (`id_admin`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE IF NOT EXISTS `usuarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `password` varchar(32) COLLATE utf8_spanish_ci NOT NULL, `nombre` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `apellido` varchar(20) COLLATE utf8_spanish_ci NOT NULL, `rol` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`id`, `username`, `password`, `nombre`, `apellido`, `rol`) VALUES (1, 'admin01', '18c6d818ae35a3e8279b5330eda01498', 'Gabriel', 'Pinedo', 'administrador'), (2, 'system', '54b53072540eeeb8f8e9343e71f28176', 'Jeffrey', 'Arenas', 'administrador'); -- -- Filtros para las tablas descargadas (dump) -- -- -- Filtros para la tabla `chompas` -- ALTER TABLE `chompas` ADD CONSTRAINT `chompas_ibfk_1` FOREIGN KEY (`id_insumo`) REFERENCES `insumos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Filtros para la tabla `pedidos` -- ALTER TABLE `pedidos` ADD CONSTRAINT `pedidos_ibfk_1` FOREIGN KEY (`id_insumo`) REFERENCES `insumos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `pedidos_ibfk_2` FOREIGN KEY (`id_admin`) REFERENCES `usuarios` (`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 */;
/* Navicat MySQL Data Transfer Source Server : Mysql-Server Source Server Version : 50505 Source Host : craniusprojects.no-ip.org Source Database : test Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2016-06-09 14:06:59 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `glyphs_info` -- ---------------------------- DROP TABLE IF EXISTS `glyphs_info`; CREATE TABLE `glyphs_info` ( `glyphID` int(4) NOT NULL DEFAULT '0', `itemID` int(6) DEFAULT NULL, `GlyphName` varchar(255) DEFAULT NULL, PRIMARY KEY (`glyphID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of glyphs_info -- ---------------------------- INSERT INTO `glyphs_info` VALUES ('2', '0', null); INSERT INTO `glyphs_info` VALUES ('21', '0', null); INSERT INTO `glyphs_info` VALUES ('22', '0', null); INSERT INTO `glyphs_info` VALUES ('61', '0', null); INSERT INTO `glyphs_info` VALUES ('81', '0', null); INSERT INTO `glyphs_info` VALUES ('82', '0', null); INSERT INTO `glyphs_info` VALUES ('101', '0', null); INSERT INTO `glyphs_info` VALUES ('121', '0', null); INSERT INTO `glyphs_info` VALUES ('141', '0', null); INSERT INTO `glyphs_info` VALUES ('161', '40896', 'Glyphe \'Rasende Regeneration\''); INSERT INTO `glyphs_info` VALUES ('162', '40897', 'Glyphe \'Zermalmen\''); INSERT INTO `glyphs_info` VALUES ('163', '40899', 'Glyphe \'Knurren\''); INSERT INTO `glyphs_info` VALUES ('164', '40900', 'Glyphe \'Zerfleischen\''); INSERT INTO `glyphs_info` VALUES ('165', '40901', 'Glyphe \'Schreddern\''); INSERT INTO `glyphs_info` VALUES ('166', '40902', 'Glyphe \'Zerfetzen\''); INSERT INTO `glyphs_info` VALUES ('167', '40903', 'Glyphe \'Krallenhieb\''); INSERT INTO `glyphs_info` VALUES ('168', '40906', 'Glyphe \'Rasche Heilung\''); INSERT INTO `glyphs_info` VALUES ('169', '40908', 'Glyphe \'Anregen\''); INSERT INTO `glyphs_info` VALUES ('170', '40909', 'Glyphe \'Wiedergeburt\''); INSERT INTO `glyphs_info` VALUES ('171', '40912', 'Glyphe \'Nachwachsen\''); INSERT INTO `glyphs_info` VALUES ('172', '40913', 'Glyphe \'Verjüngung\''); INSERT INTO `glyphs_info` VALUES ('173', '40914', 'Glyphe \'Heilende Berührung\''); INSERT INTO `glyphs_info` VALUES ('174', '40915', 'Glyphe \'Blühendes Leben\''); INSERT INTO `glyphs_info` VALUES ('175', '40916', 'Glyphe \'Sternenfeuer\''); INSERT INTO `glyphs_info` VALUES ('176', '40919', 'Glyphe \'Insektenschwarm\''); INSERT INTO `glyphs_info` VALUES ('177', '40920', 'Glyphe \'Hurrikan\''); INSERT INTO `glyphs_info` VALUES ('178', '40921', 'Glyphe \'Sternenregen\''); INSERT INTO `glyphs_info` VALUES ('179', '40922', 'Glyphe \'Zorn\''); INSERT INTO `glyphs_info` VALUES ('180', '40923', 'Glyphe \'Mondfeuer\''); INSERT INTO `glyphs_info` VALUES ('181', '40924', 'Glyphe \'Wucherwurzeln\''); INSERT INTO `glyphs_info` VALUES ('182', '0', null); INSERT INTO `glyphs_info` VALUES ('183', '41092', 'Glyphe \'Richturteil\''); INSERT INTO `glyphs_info` VALUES ('184', '41094', 'Glyphe \'Siegel des Befehls\''); INSERT INTO `glyphs_info` VALUES ('185', '41095', 'Glyphe \'Hammer der Gerechtigkeit\''); INSERT INTO `glyphs_info` VALUES ('186', '41096', 'Glyphe \'Einklang des Geistes\''); INSERT INTO `glyphs_info` VALUES ('187', '41097', 'Glyphe \'Hammer des Zorns\''); INSERT INTO `glyphs_info` VALUES ('188', '41098', 'Glyphe \'Kreuzfahrerstoß\''); INSERT INTO `glyphs_info` VALUES ('189', '41099', 'Glyphe \'Weihe\''); INSERT INTO `glyphs_info` VALUES ('190', '41100', 'Glyphe \'Rechtschaffene Verteidigung\''); INSERT INTO `glyphs_info` VALUES ('191', '41101', 'Glyphe \'Schild des Rächers\''); INSERT INTO `glyphs_info` VALUES ('192', '41102', 'Glyphe \'Böses vertreiben\''); INSERT INTO `glyphs_info` VALUES ('193', '41103', 'Glyphe \'Exorzismus\''); INSERT INTO `glyphs_info` VALUES ('194', '41104', 'Glyphe \'Läuterung\''); INSERT INTO `glyphs_info` VALUES ('195', '41105', 'Glyphe \'Lichtblitz\''); INSERT INTO `glyphs_info` VALUES ('196', '41106', 'Glyphe \'Heiliges Licht\''); INSERT INTO `glyphs_info` VALUES ('197', '41107', 'Glyphe \'Zornige Vergeltung\''); INSERT INTO `glyphs_info` VALUES ('198', '41108', 'Glyphe \'Göttlichkeit\''); INSERT INTO `glyphs_info` VALUES ('199', '41109', 'Glyphe \'Siegel der Weisheit\''); INSERT INTO `glyphs_info` VALUES ('200', '41110', 'Glyphe \'Siegel des Lichts\''); INSERT INTO `glyphs_info` VALUES ('211', '41541', 'Glyphe \'Wasserbeherrschung\''); INSERT INTO `glyphs_info` VALUES ('212', '41517', 'Glyphe \'Kettenheilung\''); INSERT INTO `glyphs_info` VALUES ('213', '41518', 'Glyphe \'Kettenblitzschlag\''); INSERT INTO `glyphs_info` VALUES ('214', '41524', 'Glyphe \'Lava\''); INSERT INTO `glyphs_info` VALUES ('215', '41526', 'Glyphe \'Schock\''); INSERT INTO `glyphs_info` VALUES ('216', '41527', 'Glyphe \'Waffe der Lebensgeister\''); INSERT INTO `glyphs_info` VALUES ('217', '41529', 'Glyphe \'Totem des Feuerelementars\''); INSERT INTO `glyphs_info` VALUES ('218', '41530', 'Glyphe \'Feuernova\''); INSERT INTO `glyphs_info` VALUES ('219', '41531', 'Glyphe \'Flammenschock\''); INSERT INTO `glyphs_info` VALUES ('220', '41532', 'Glyphe \'Waffe der Flammenzunge\''); INSERT INTO `glyphs_info` VALUES ('221', '41547', 'Glyphe \'Frostschock\''); INSERT INTO `glyphs_info` VALUES ('222', '41533', 'Glyphe \'Totem des heilenden Flusses\''); INSERT INTO `glyphs_info` VALUES ('223', '41534', 'Glyphe \'Welle der Heilung\''); INSERT INTO `glyphs_info` VALUES ('224', '41535', 'Glyphe \'Geringe Welle der Heilung\''); INSERT INTO `glyphs_info` VALUES ('225', '41537', 'Glyphe \'Blitzschlagschild\''); INSERT INTO `glyphs_info` VALUES ('226', '41536', 'Glyphe \'Blitzschlag\''); INSERT INTO `glyphs_info` VALUES ('227', '41538', 'Glyphe \'Totem der Manaflut\''); INSERT INTO `glyphs_info` VALUES ('228', '41539', 'Glyphe \'Sturmschlag\''); INSERT INTO `glyphs_info` VALUES ('229', '41540', 'Glyphe \'Lavapeitsche\''); INSERT INTO `glyphs_info` VALUES ('230', '41552', 'Glyphe \'Elementarbeherrschung\''); INSERT INTO `glyphs_info` VALUES ('231', '41542', 'Glyphe \'Waffe des Windzorns\''); INSERT INTO `glyphs_info` VALUES ('251', '42396', 'Glyphe \'Kreis der Heilung\''); INSERT INTO `glyphs_info` VALUES ('252', '42397', 'Glyphe \'Magie bannen\''); INSERT INTO `glyphs_info` VALUES ('253', '42398', 'Glyphe \'Schleier\''); INSERT INTO `glyphs_info` VALUES ('254', '42399', 'Glyphe \'Furchtzauberschutz\''); INSERT INTO `glyphs_info` VALUES ('255', '42400', 'Glyphe \'Blitzheilung\''); INSERT INTO `glyphs_info` VALUES ('256', '42401', 'Glyphe \'Heilige Nova\''); INSERT INTO `glyphs_info` VALUES ('257', '42402', 'Glyphe \'Inneres Feuer\''); INSERT INTO `glyphs_info` VALUES ('258', '42403', 'Glyphe \'Brunnen des Lichts\''); INSERT INTO `glyphs_info` VALUES ('259', '42404', 'Glyphe \'Massenbannung\''); INSERT INTO `glyphs_info` VALUES ('260', '42405', 'Glyphe \'Gedankenkontrolle\''); INSERT INTO `glyphs_info` VALUES ('261', '42406', 'Glyphe \'Schattenwort: Schmerz\''); INSERT INTO `glyphs_info` VALUES ('262', '42407', 'Glyphe \'Schatten\''); INSERT INTO `glyphs_info` VALUES ('263', '42408', 'Glyphe \'Machtwort: Schild\''); INSERT INTO `glyphs_info` VALUES ('264', '42409', 'Glyphe \'Gebet der Heilung\''); INSERT INTO `glyphs_info` VALUES ('265', '42410', 'Glyphe \'Psychischer Schrei\''); INSERT INTO `glyphs_info` VALUES ('266', '42411', 'Glyphe \'Erneuerung\''); INSERT INTO `glyphs_info` VALUES ('267', '42412', 'Glyphe \'Geißelgefangennahme\''); INSERT INTO `glyphs_info` VALUES ('268', '42414', 'Glyphe \'Schattenwort: Tod\''); INSERT INTO `glyphs_info` VALUES ('269', '42415', 'Glyphe \'Gedankenschinden\''); INSERT INTO `glyphs_info` VALUES ('270', '42416', 'Glyphe \'Göttliche Pein\''); INSERT INTO `glyphs_info` VALUES ('271', '42417', 'Glyphe \'Geist der Erlösung\''); INSERT INTO `glyphs_info` VALUES ('272', '42453', 'Glyphe \'Verbrennen\''); INSERT INTO `glyphs_info` VALUES ('273', '42454', 'Glyphe \'Feuersbrunst\''); INSERT INTO `glyphs_info` VALUES ('274', '42455', 'Glyphe \'Verderbnis\''); INSERT INTO `glyphs_info` VALUES ('275', '42456', 'Glyphe \'Fluch der Pein\''); INSERT INTO `glyphs_info` VALUES ('276', '42457', 'Glyphe \'Todesmantel\''); INSERT INTO `glyphs_info` VALUES ('277', '42458', 'Glyphe \'Furcht\''); INSERT INTO `glyphs_info` VALUES ('278', '42459', 'Glyphe \'Teufelswache\''); INSERT INTO `glyphs_info` VALUES ('279', '42460', 'Glyphe \'Teufelsjäger\''); INSERT INTO `glyphs_info` VALUES ('280', '42461', 'Glyphe \'Lebenslinie\''); INSERT INTO `glyphs_info` VALUES ('281', '42462', 'Glyphe \'Gesundheitsstein\''); INSERT INTO `glyphs_info` VALUES ('282', '42463', 'Glyphe \'Schreckensgeheul\''); INSERT INTO `glyphs_info` VALUES ('283', '42464', 'Glyphe \'Feuerbrand\''); INSERT INTO `glyphs_info` VALUES ('284', '42465', 'Glyphe \'Wichtel\''); INSERT INTO `glyphs_info` VALUES ('285', '42466', 'Glyphe \'Sengender Schmerz\''); INSERT INTO `glyphs_info` VALUES ('286', '42467', 'Glyphe \'Schattenblitz\''); INSERT INTO `glyphs_info` VALUES ('287', '42468', 'Glyphe \'Schattenbrand\''); INSERT INTO `glyphs_info` VALUES ('288', '42469', 'Glyphe \'Lebensentzug\''); INSERT INTO `glyphs_info` VALUES ('289', '42470', 'Glyphe \'Seelenstein\''); INSERT INTO `glyphs_info` VALUES ('290', '42471', 'Glyphe \'Sukkubus\''); INSERT INTO `glyphs_info` VALUES ('291', '42472', 'Glyphe \'Instabiles Gebrechen\''); INSERT INTO `glyphs_info` VALUES ('292', '42473', 'Glyphe \'Leerwandler\''); INSERT INTO `glyphs_info` VALUES ('311', '42734', 'Glyphe \'Arkane Explosion\''); INSERT INTO `glyphs_info` VALUES ('312', '42735', 'Glyphe \'Arkane Geschosse\''); INSERT INTO `glyphs_info` VALUES ('313', '42736', 'Glyphe \'Arkane Macht\''); INSERT INTO `glyphs_info` VALUES ('314', '42737', 'Glyphe \'Blinzeln\''); INSERT INTO `glyphs_info` VALUES ('315', '42738', 'Glyphe \'Hervorrufung\''); INSERT INTO `glyphs_info` VALUES ('316', '42739', 'Glyphe \'Feuerball\''); INSERT INTO `glyphs_info` VALUES ('317', '42740', 'Glyphe \'Feuerschlag\''); INSERT INTO `glyphs_info` VALUES ('318', '42741', 'Glyphe \'Frostnova\''); INSERT INTO `glyphs_info` VALUES ('319', '42742', 'Glyphe \'Frostblitz\''); INSERT INTO `glyphs_info` VALUES ('320', '42743', 'Glyphe \'Eisrüstung\''); INSERT INTO `glyphs_info` VALUES ('321', '42744', 'Glyphe \'Eisblock\''); INSERT INTO `glyphs_info` VALUES ('322', '42745', 'Glyphe \'Eislanze\''); INSERT INTO `glyphs_info` VALUES ('323', '42746', 'Glyphe \'Eisige Adern\''); INSERT INTO `glyphs_info` VALUES ('324', '42747', 'Glyphe \'Versengen\''); INSERT INTO `glyphs_info` VALUES ('325', '42748', 'Glyphe \'Unsichtbarkeit\''); INSERT INTO `glyphs_info` VALUES ('326', '42749', 'Glyphe \'Magische Rüstung\''); INSERT INTO `glyphs_info` VALUES ('327', '42750', 'Glyphe \'Manaedelstein\''); INSERT INTO `glyphs_info` VALUES ('328', '42751', 'Glyphe \'Glühende Rüstung\''); INSERT INTO `glyphs_info` VALUES ('329', '42752', 'Glyphe \'Verwandlung\''); INSERT INTO `glyphs_info` VALUES ('330', '42753', 'Glyphe \'Fluch aufheben\''); INSERT INTO `glyphs_info` VALUES ('331', '42754', 'Glyphe \'Wasserelementar\''); INSERT INTO `glyphs_info` VALUES ('351', '42897', 'Glyphe \'Gezielter Schuss\''); INSERT INTO `glyphs_info` VALUES ('352', '42898', 'Glyphe \'Arkaner Schuss\''); INSERT INTO `glyphs_info` VALUES ('353', '42899', 'Glyphe \'Wildtier\''); INSERT INTO `glyphs_info` VALUES ('354', '42900', 'Glyphe \'Besserung\''); INSERT INTO `glyphs_info` VALUES ('355', '42901', 'Glyphe \'Aspekt der Viper\''); INSERT INTO `glyphs_info` VALUES ('356', '42902', 'Glyphe \'Zorn des Wildtiers\''); INSERT INTO `glyphs_info` VALUES ('357', '42903', 'Glyphe \'Abschreckung\''); INSERT INTO `glyphs_info` VALUES ('358', '42904', 'Glyphe \'Rückzug\''); INSERT INTO `glyphs_info` VALUES ('359', '42905', 'Glyphe \'Eiskältefalle\''); INSERT INTO `glyphs_info` VALUES ('360', '42906', 'Glyphe \'Frostfalle\''); INSERT INTO `glyphs_info` VALUES ('361', '42907', 'Glyphe \'Mal des Jägers\''); INSERT INTO `glyphs_info` VALUES ('362', '42908', 'Glyphe \'Feuerbrandfalle\''); INSERT INTO `glyphs_info` VALUES ('363', '42909', 'Glyphe \'Falke\''); INSERT INTO `glyphs_info` VALUES ('364', '42910', 'Glyphe \'Mehrfachschuss\''); INSERT INTO `glyphs_info` VALUES ('365', '42911', 'Glyphe \'Schnellfeuer\''); INSERT INTO `glyphs_info` VALUES ('366', '42912', 'Glyphe \'Schlangenbiss\''); INSERT INTO `glyphs_info` VALUES ('367', '42913', 'Glyphe \'Schlangenfalle\''); INSERT INTO `glyphs_info` VALUES ('368', '42914', 'Glyphe \'Zuverlässiger Schuss\''); INSERT INTO `glyphs_info` VALUES ('369', '42915', 'Glyphe \'Aura des Volltreffers\''); INSERT INTO `glyphs_info` VALUES ('370', '42916', 'Glyphe \'Salve\''); INSERT INTO `glyphs_info` VALUES ('371', '42917', 'Glyphe \'Stich des Flügeldrachen\''); INSERT INTO `glyphs_info` VALUES ('391', '42954', 'Glyphe \'Adrenalinrausch\''); INSERT INTO `glyphs_info` VALUES ('392', '42955', 'Glyphe \'Hinterhalt\''); INSERT INTO `glyphs_info` VALUES ('393', '42956', 'Glyphe \'Meucheln\''); INSERT INTO `glyphs_info` VALUES ('394', '42957', 'Glyphe \'Klingenwirbel\''); INSERT INTO `glyphs_info` VALUES ('395', '42958', 'Glyphe \'Verkrüppelndes Gift\''); INSERT INTO `glyphs_info` VALUES ('396', '42959', 'Glyphe \'Tödlicher Wurf\''); INSERT INTO `glyphs_info` VALUES ('397', '42960', 'Glyphe \'Entrinnen\''); INSERT INTO `glyphs_info` VALUES ('398', '42961', 'Glyphe \'Ausweiden\''); INSERT INTO `glyphs_info` VALUES ('399', '42962', 'Glyphe \'Rüstung schwächen\''); INSERT INTO `glyphs_info` VALUES ('400', '42963', 'Glyphe \'Finte\''); INSERT INTO `glyphs_info` VALUES ('401', '42964', 'Glyphe \'Erdrosseln\''); INSERT INTO `glyphs_info` VALUES ('402', '42965', 'Glyphe \'Geisterhafter Stoß\''); INSERT INTO `glyphs_info` VALUES ('403', '42966', 'Glyphe \'Solarplexus\''); INSERT INTO `glyphs_info` VALUES ('404', '42967', 'Glyphe \'Blutsturz\''); INSERT INTO `glyphs_info` VALUES ('405', '42968', 'Glyphe \'Vorbereitung\''); INSERT INTO `glyphs_info` VALUES ('406', '42969', 'Glyphe \'Blutung\''); INSERT INTO `glyphs_info` VALUES ('407', '42970', 'Glyphe \'Kopfnuss\''); INSERT INTO `glyphs_info` VALUES ('408', '42971', 'Glyphe \'Lebenskraft\''); INSERT INTO `glyphs_info` VALUES ('409', '42972', 'Glyphe \'Finsterer Stoß\''); INSERT INTO `glyphs_info` VALUES ('410', '42973', 'Glyphe \'Zerhäckseln\''); INSERT INTO `glyphs_info` VALUES ('411', '42974', 'Glyphe \'Sprinten\''); INSERT INTO `glyphs_info` VALUES ('431', '43316', 'Glyphe \'Wassergestalt\''); INSERT INTO `glyphs_info` VALUES ('432', '43334', 'Glyphe \'Herausforderndes Gebrüll\''); INSERT INTO `glyphs_info` VALUES ('433', '43335', 'Glyphe \'Gabe der Wildnis\''); INSERT INTO `glyphs_info` VALUES ('434', '43331', 'Glyphe \'Sorglose Wiedergeburt\''); INSERT INTO `glyphs_info` VALUES ('435', '43332', 'Glyphe \'Dornen\''); INSERT INTO `glyphs_info` VALUES ('436', '0', null); INSERT INTO `glyphs_info` VALUES ('438', '0', null); INSERT INTO `glyphs_info` VALUES ('439', '43338', 'Glyphe \'Tier wiederbeleben\''); INSERT INTO `glyphs_info` VALUES ('440', '43350', 'Glyphe \'Tier heilen\''); INSERT INTO `glyphs_info` VALUES ('441', '43351', 'Glyphe \'Totstellen\''); INSERT INTO `glyphs_info` VALUES ('442', '43356', 'Glyphe \'Wildtier Ängstigen\''); INSERT INTO `glyphs_info` VALUES ('443', '43355', 'Glyphe \'Aspekt des Rudels\''); INSERT INTO `glyphs_info` VALUES ('444', '43354', 'Glyphe \'Besessene Stärke\''); INSERT INTO `glyphs_info` VALUES ('445', '43339', 'Glyphe \'Arkane Intelligenz\''); INSERT INTO `glyphs_info` VALUES ('446', '43357', 'Glyphe \'Feuerzauberschutz\''); INSERT INTO `glyphs_info` VALUES ('447', '43360', 'Glyphe \'Frostzauberschutz\''); INSERT INTO `glyphs_info` VALUES ('448', '43359', 'Glyphe \'Frostrüstung\''); INSERT INTO `glyphs_info` VALUES ('449', '0', null); INSERT INTO `glyphs_info` VALUES ('450', '43361', 'Glyphe \'Pinguin\''); INSERT INTO `glyphs_info` VALUES ('451', '43364', 'Glyphe \'Langsamer Fall\''); INSERT INTO `glyphs_info` VALUES ('452', '43365', 'Glyphe \'Segen der Könige\''); INSERT INTO `glyphs_info` VALUES ('453', '43340', 'Glyphe \'Segen der Macht\''); INSERT INTO `glyphs_info` VALUES ('454', '43366', 'Glyphe \'Segen der Weisheit\''); INSERT INTO `glyphs_info` VALUES ('455', '43367', 'Glyphe \'Handauflegung\''); INSERT INTO `glyphs_info` VALUES ('456', '43368', 'Glyphe \'Untote spüren\''); INSERT INTO `glyphs_info` VALUES ('457', '43369', 'Glyphe \'Der Weise\''); INSERT INTO `glyphs_info` VALUES ('458', '43342', 'Glyphe \'Verblassen\''); INSERT INTO `glyphs_info` VALUES ('459', '43370', 'Glyphe \'Levitieren\''); INSERT INTO `glyphs_info` VALUES ('460', '43371', 'Glyphe \'Seelenstärke\''); INSERT INTO `glyphs_info` VALUES ('461', '43373', 'Glyphe \'Untote fesseln\''); INSERT INTO `glyphs_info` VALUES ('462', '43372', 'Glyphe \'Schattenschutz\''); INSERT INTO `glyphs_info` VALUES ('463', '43374', 'Glyphe \'Schattengeist\''); INSERT INTO `glyphs_info` VALUES ('464', '43376', 'Glyphe \'Ablenken\''); INSERT INTO `glyphs_info` VALUES ('465', '43377', 'Glyphe \'Schloss knacken\''); INSERT INTO `glyphs_info` VALUES ('466', '43343', 'Glyphe \'Taschendiebstahl\''); INSERT INTO `glyphs_info` VALUES ('467', '43378', 'Glyphe \'Sicheres Fallen\''); INSERT INTO `glyphs_info` VALUES ('468', '43379', 'Glyphe \'Verschwimmen\''); INSERT INTO `glyphs_info` VALUES ('469', '43380', 'Glyphe \'Verschwinden\''); INSERT INTO `glyphs_info` VALUES ('470', '43381', 'Glyphe \'Astraler Rückruf\''); INSERT INTO `glyphs_info` VALUES ('471', '0', null); INSERT INTO `glyphs_info` VALUES ('472', '0', null); INSERT INTO `glyphs_info` VALUES ('473', '43385', 'Glyphe \'Erneuertes Leben\''); INSERT INTO `glyphs_info` VALUES ('474', '43344', 'Glyphe \'Wasseratmung\''); INSERT INTO `glyphs_info` VALUES ('475', '43386', 'Glyphe \'Wasserschild\''); INSERT INTO `glyphs_info` VALUES ('476', '43388', 'Glyphe \'Wasserwandeln\''); INSERT INTO `glyphs_info` VALUES ('477', '43389', 'Glyphe \'Unendlicher Atem\''); INSERT INTO `glyphs_info` VALUES ('478', '43390', 'Glyphe \'Seelendieb\''); INSERT INTO `glyphs_info` VALUES ('479', '43391', 'Glyphe \'Auge von Kilrogg\''); INSERT INTO `glyphs_info` VALUES ('480', '43392', 'Glyphe \'Fluch der Erschöpfung\''); INSERT INTO `glyphs_info` VALUES ('481', '43393', 'Glyphe \'Dämonensklave\''); INSERT INTO `glyphs_info` VALUES ('482', '43394', 'Glyphe \'Ritual der Seelen\''); INSERT INTO `glyphs_info` VALUES ('483', '43395', 'Glyphe \'Schlachtruf\''); INSERT INTO `glyphs_info` VALUES ('484', '43396', 'Glyphe \'Blutrausch\''); INSERT INTO `glyphs_info` VALUES ('485', '43397', 'Glyphe \'Sturmangriff\''); INSERT INTO `glyphs_info` VALUES ('486', '43398', 'Glyphe \'Spöttischer Schlag\''); INSERT INTO `glyphs_info` VALUES ('487', '43399', 'Glyphe \'Donnerknall\''); INSERT INTO `glyphs_info` VALUES ('488', '43400', 'Glyphe \'Beständiger Sieg\''); INSERT INTO `glyphs_info` VALUES ('489', '43421', 'Glyphe \'Tödlicher Stoß\''); INSERT INTO `glyphs_info` VALUES ('490', '43412', 'Glyphe \'Blutdurst\''); INSERT INTO `glyphs_info` VALUES ('491', '43413', 'Glyphe \'Schneller Sturmangriff\''); INSERT INTO `glyphs_info` VALUES ('492', '43414', 'Glyphe \'Spalten\''); INSERT INTO `glyphs_info` VALUES ('493', '43415', 'Glyphe \'Verwüsten\''); INSERT INTO `glyphs_info` VALUES ('494', '43416', 'Glyphe \'Hinrichten\''); INSERT INTO `glyphs_info` VALUES ('495', '43417', 'Glyphe \'Kniesehne\''); INSERT INTO `glyphs_info` VALUES ('496', '43418', 'Glyphe \'Heldenhafter Stoß\''); INSERT INTO `glyphs_info` VALUES ('497', '43419', 'Glyphe \'Einschreiten\''); INSERT INTO `glyphs_info` VALUES ('498', '43420', 'Glyphe \'Barbarische Beleidigungen\''); INSERT INTO `glyphs_info` VALUES ('499', '43422', 'Glyphe \'Überwältigen\''); INSERT INTO `glyphs_info` VALUES ('500', '43423', 'Glyphe \'Verwunden\''); INSERT INTO `glyphs_info` VALUES ('501', '43424', 'Glyphe \'Rache\''); INSERT INTO `glyphs_info` VALUES ('502', '43425', 'Glyphe \'Blocken\''); INSERT INTO `glyphs_info` VALUES ('503', '43426', 'Glyphe \'Letztes Gefecht\''); INSERT INTO `glyphs_info` VALUES ('504', '43427', 'Glyphe \'Rüstung zerreißen\''); INSERT INTO `glyphs_info` VALUES ('505', '43428', 'Glyphe \'Weitreichende Stöße\''); INSERT INTO `glyphs_info` VALUES ('506', '43429', 'Glyphe \'Spott\''); INSERT INTO `glyphs_info` VALUES ('507', '43430', 'Glyphe \'Nachhallende Kraft\''); INSERT INTO `glyphs_info` VALUES ('508', '43431', 'Glyphe \'Siegesrausch\''); INSERT INTO `glyphs_info` VALUES ('509', '43432', 'Glyphe \'Wirbelwind\''); INSERT INTO `glyphs_info` VALUES ('511', '43538', 'Glyphe \'Dunkler Befehl\''); INSERT INTO `glyphs_info` VALUES ('512', '43533', 'Glyphe \'Antimagische Hülle\''); INSERT INTO `glyphs_info` VALUES ('513', '43534', 'Glyphe \'Herzstoß\''); INSERT INTO `glyphs_info` VALUES ('514', '43535', 'Glyphe \'Blutwandlung\''); INSERT INTO `glyphs_info` VALUES ('515', '43536', 'Glyphe \'Knochenschild\''); INSERT INTO `glyphs_info` VALUES ('516', '43537', 'Glyphe \'Eisketten\''); INSERT INTO `glyphs_info` VALUES ('518', '43539', 'Glyphe \'Umarmung des Todes\''); INSERT INTO `glyphs_info` VALUES ('519', '43541', 'Glyphe \'Todesgriff\''); INSERT INTO `glyphs_info` VALUES ('520', '43542', 'Glyphe \'Tod und Verfall\''); INSERT INTO `glyphs_info` VALUES ('521', '43543', 'Glyphe \'Froststoß\''); INSERT INTO `glyphs_info` VALUES ('522', '43544', 'Glyphe \'Horn des Winters\''); INSERT INTO `glyphs_info` VALUES ('523', '43545', 'Glyphe \'Eisige Gegenwehr\''); INSERT INTO `glyphs_info` VALUES ('524', '43546', 'Glyphe \'Eisige Berührung\''); INSERT INTO `glyphs_info` VALUES ('525', '43547', 'Glyphe \'Auslöschen\''); INSERT INTO `glyphs_info` VALUES ('526', '43548', 'Glyphe \'Seuchenstoß\''); INSERT INTO `glyphs_info` VALUES ('527', '43549', 'Glyphe \'Ghul\''); INSERT INTO `glyphs_info` VALUES ('528', '43550', 'Glyphe \'Runenstoß\''); INSERT INTO `glyphs_info` VALUES ('529', '43551', 'Glyphe \'Geißelstoß\''); INSERT INTO `glyphs_info` VALUES ('530', '43552', 'Glyphe \'Strangulieren\''); INSERT INTO `glyphs_info` VALUES ('531', '43553', 'Glyphe \'Undurchdringliche Rüstung\''); INSERT INTO `glyphs_info` VALUES ('532', '43554', 'Glyphe \'Vampirblut\''); INSERT INTO `glyphs_info` VALUES ('551', '43674', 'Glyphe \'Spurt\''); INSERT INTO `glyphs_info` VALUES ('552', '43725', 'Glyphe \'Geisterwolf\''); INSERT INTO `glyphs_info` VALUES ('553', '43672', 'Glyphe \'Pestilenz\''); INSERT INTO `glyphs_info` VALUES ('554', '43671', 'Glyphe \'Leichenexplosion\''); INSERT INTO `glyphs_info` VALUES ('555', '43673', 'Glyphe \'Totenerweckung\''); INSERT INTO `glyphs_info` VALUES ('556', '43825', 'Glyphe \'Runenheilung\''); INSERT INTO `glyphs_info` VALUES ('557', '43826', 'Glyphe \'Blutstoß\''); INSERT INTO `glyphs_info` VALUES ('558', '43827', 'Glyphe \'Todesstoß\''); INSERT INTO `glyphs_info` VALUES ('559', '43867', 'Glyphe \'Heiliger Zorn\''); INSERT INTO `glyphs_info` VALUES ('560', '43868', 'Glyphe \'Siegel der Rechtschaffenheit\''); INSERT INTO `glyphs_info` VALUES ('561', '43869', 'Glyphe \'Siegel der Vergeltung\''); INSERT INTO `glyphs_info` VALUES ('571', '0', null); INSERT INTO `glyphs_info` VALUES ('591', '44684', 'Glyphe \'Frostfeuer\''); INSERT INTO `glyphs_info` VALUES ('611', '44920', 'Glyphe \'Druckwelle\''); INSERT INTO `glyphs_info` VALUES ('612', '44923', 'Glyphe \'Gewitter\''); INSERT INTO `glyphs_info` VALUES ('613', '44922', 'Glyphe \'Taifun\''); INSERT INTO `glyphs_info` VALUES ('631', '44928', 'Glyphe \'Fokus\''); INSERT INTO `glyphs_info` VALUES ('651', '44955', 'Glyphe \'Arkanschlag\''); INSERT INTO `glyphs_info` VALUES ('671', '45601', 'Glyphe \'Berserker\''); INSERT INTO `glyphs_info` VALUES ('672', '45602', 'Glyphe \'Wildwuchs\''); INSERT INTO `glyphs_info` VALUES ('673', '45603', 'Glyphe \'Pflege\''); INSERT INTO `glyphs_info` VALUES ('674', '45604', 'Glyphe \'Wildes Brüllen\''); INSERT INTO `glyphs_info` VALUES ('675', '45622', 'Glyphe \'Monsun\''); INSERT INTO `glyphs_info` VALUES ('676', '45623', 'Glyphe \'Baumrinde\''); INSERT INTO `glyphs_info` VALUES ('677', '45625', 'Glyphe \'Schimärenschuss\''); INSERT INTO `glyphs_info` VALUES ('691', '45731', 'Glyphe \'Explosivschuss\''); INSERT INTO `glyphs_info` VALUES ('692', '45732', 'Glyphe \'Tödlicher Schuss\''); INSERT INTO `glyphs_info` VALUES ('693', '45733', 'Glyphe \'Sprengfalle\''); INSERT INTO `glyphs_info` VALUES ('694', '45734', 'Glyphe \'Streuschuss\''); INSERT INTO `glyphs_info` VALUES ('695', '45735', 'Glyphe \'Raptorstoß\''); INSERT INTO `glyphs_info` VALUES ('696', '45736', 'Glyphe \'Tieffrieren\''); INSERT INTO `glyphs_info` VALUES ('697', '45737', 'Glyphe \'Lebende Bombe\''); INSERT INTO `glyphs_info` VALUES ('698', '45738', 'Glyphe \'Arkanbeschuss\''); INSERT INTO `glyphs_info` VALUES ('699', '45739', 'Glyphe \'Spiegelbild\''); INSERT INTO `glyphs_info` VALUES ('700', '45740', 'Glyphe \'Eisbarriere\''); INSERT INTO `glyphs_info` VALUES ('701', '45741', 'Glyphe \'Flamme des Glaubens\''); INSERT INTO `glyphs_info` VALUES ('702', '45742', 'Glyphe \'Hammer der Rechtschaffenen\''); INSERT INTO `glyphs_info` VALUES ('703', '45743', 'Glyphe \'Göttlicher Sturm\''); INSERT INTO `glyphs_info` VALUES ('704', '45744', 'Glyphe \'Schild der Rechtschaffenheit\''); INSERT INTO `glyphs_info` VALUES ('705', '45745', 'Glyphe \'Göttliche Bitte\''); INSERT INTO `glyphs_info` VALUES ('706', '45746', 'Glyphe \'Heiliger Schock\''); INSERT INTO `glyphs_info` VALUES ('707', '45747', 'Glyphe \'Erlösung\''); INSERT INTO `glyphs_info` VALUES ('708', '45753', 'Glyphe \'Dispersion\''); INSERT INTO `glyphs_info` VALUES ('709', '45755', 'Glyphe \'Schutzgeist\''); INSERT INTO `glyphs_info` VALUES ('710', '45756', 'Glyphe \'Sühne\''); INSERT INTO `glyphs_info` VALUES ('711', '45757', 'Glyphe \'Gedankenexplosion\''); INSERT INTO `glyphs_info` VALUES ('712', '45758', 'Glyphe \'Hymne der Hoffnung\''); INSERT INTO `glyphs_info` VALUES ('713', '45760', 'Glyphe \'Schmerzunterdrückung\''); INSERT INTO `glyphs_info` VALUES ('714', '45761', 'Glyphe \'Blutgier\''); INSERT INTO `glyphs_info` VALUES ('715', '45762', 'Glyphe \'Mordlust\''); INSERT INTO `glyphs_info` VALUES ('716', '45764', 'Glyphe \'Schattentanz\''); INSERT INTO `glyphs_info` VALUES ('731', '45766', 'Glyphe \'Dolchfächer\''); INSERT INTO `glyphs_info` VALUES ('732', '45767', 'Glyphe \'Schurkenhandel\''); INSERT INTO `glyphs_info` VALUES ('733', '45768', 'Glyphe \'Verstümmeln\''); INSERT INTO `glyphs_info` VALUES ('734', '45769', 'Glyphe \'Mantel der Schatten\''); INSERT INTO `glyphs_info` VALUES ('735', '45770', 'Glyphe \'Donner\''); INSERT INTO `glyphs_info` VALUES ('736', '45771', 'Glyphe \'Wildgeist\''); INSERT INTO `glyphs_info` VALUES ('737', '45772', 'Glyphe \'Springflut\''); INSERT INTO `glyphs_info` VALUES ('751', '45775', 'Glyphe \'Erdschild\''); INSERT INTO `glyphs_info` VALUES ('752', '45776', 'Glyphe \'Totem des Ingrimms\''); INSERT INTO `glyphs_info` VALUES ('753', '45777', 'Glyphe \'Verhexen\''); INSERT INTO `glyphs_info` VALUES ('754', '45778', 'Glyphe \'Totem der Steinklaue\''); INSERT INTO `glyphs_info` VALUES ('755', '45779', 'Glyphe \'Heimsuchung\''); INSERT INTO `glyphs_info` VALUES ('756', '45780', 'Glyphe \'Metamorphose\''); INSERT INTO `glyphs_info` VALUES ('757', '45781', 'Glyphe \'Chaosblitz\''); INSERT INTO `glyphs_info` VALUES ('758', '45782', 'Glyphe \'Dämonischer Zirkel\''); INSERT INTO `glyphs_info` VALUES ('759', '45783', 'Glyphe \'Schattenflamme\''); INSERT INTO `glyphs_info` VALUES ('760', '45785', 'Glyphe \'Aderlass\''); INSERT INTO `glyphs_info` VALUES ('761', '45789', 'Glyphe \'Seelenverbindung\''); INSERT INTO `glyphs_info` VALUES ('762', '45790', 'Glyphe \'Klingensturm\''); INSERT INTO `glyphs_info` VALUES ('763', '45792', 'Glyphe \'Schockwelle\''); INSERT INTO `glyphs_info` VALUES ('764', '45793', 'Glyphe \'Wachsamkeit\''); INSERT INTO `glyphs_info` VALUES ('765', '45794', 'Glyphe \'Wütende Regeneration\''); INSERT INTO `glyphs_info` VALUES ('766', '45795', 'Glyphe \'Zauberreflexion\''); INSERT INTO `glyphs_info` VALUES ('767', '45797', 'Glyphe \'Schildwall\''); INSERT INTO `glyphs_info` VALUES ('768', '45799', 'Glyphe \'Tanzende Runenwaffe\''); INSERT INTO `glyphs_info` VALUES ('769', '45800', 'Glyphe \'Zehrende Kälte\''); INSERT INTO `glyphs_info` VALUES ('770', '45803', 'Glyphe \'Unheilige Verseuchung\''); INSERT INTO `glyphs_info` VALUES ('771', '45804', 'Glyphe \'Dunkler Tod\''); INSERT INTO `glyphs_info` VALUES ('772', '45805', 'Glyphe \'Krankheit\''); INSERT INTO `glyphs_info` VALUES ('773', '45806', 'Glyphe \'Heulende Böe\''); INSERT INTO `glyphs_info` VALUES ('791', '0', null); INSERT INTO `glyphs_info` VALUES ('811', '46372', 'Glyphe \'Überlebensinstinkt\''); INSERT INTO `glyphs_info` VALUES ('831', '48720', 'Glyphe \'Klaue\''); INSERT INTO `glyphs_info` VALUES ('851', '49084', 'Glyphe \'Befehl\''); INSERT INTO `glyphs_info` VALUES ('871', '50045', 'Glyphe \'Ewiges Wasser\''); INSERT INTO `glyphs_info` VALUES ('891', '50125', 'Glyphe \'Hastige Verjüngung\''); INSERT INTO `glyphs_info` VALUES ('911', '50077', 'Glyphe \'Schneller Verfall\'');
WITH SubTotalTable AS ( SELECT c.[ClientName] ,YEAR(c.[Date]) as [Year] ,MONTH(c.[Date]) as [Month] ,SUM(c.[Amount]) as [SubTotal] FROM Clients c WHERE YEAR(c.[Date]) = '2017' GROUP BY c.[ClientName] ,YEAR(c.[Date]) ,MONTH(c.[Date]) ) SELECT [ClientName] ,[Month] ,SUM([SubTotal]) OVER ( PARTITION BY [ClientName] ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) as [Cumulative Sum] FROM SubTotalTable ORDER BY [ClientName] DESC, [Month]
SELECT Customer.CustomerID, Customer.FirstName, Purchases.PurchaseID FROM Purchases INNER JOIN Customer ON Purchases.CustomerID=Customer.CustomerID;
Create Procedure Sp_InsertInvoiceReasons (@Type Nvarchar(255),@Reason Nvarchar(255),@Active Int) As Begin If Not Exists(Select 'x' From InvoiceReasons Where [Type] = @Type And Reason = @Reason) Begin Insert Into InvoiceReasons ([Type],Reason,Active,CreationDate,ModifiedDate) Select @Type,@Reason,@Active,Getdate(),Null End Else Begin Update InvoiceReasons Set Active = @Active,ModifiedDate = Getdate() Where [Type] = @Type And Reason = @Reason End End
use ccgitranscripts; CREATE OR REPLACE VIEW term_type_counts AS WITH recent_files as ( select substr(t1.filename, 1, 9), t1.filename, t1.inserted_at, ROW_NUMBER() OVER ( PARTITION BY substr(t1.filename, 1, 9) ORDER BY inserted_at DESC ) row_num from ( SELECT distinct filename, inserted_at FROM ccgitranscripts.archive_course_grades ) t1 ORDER BY filename, inserted_at ASC ) , course_grade_files as ( SELECT # substr(CDS_CODE, 1, 7) as district_cds_code, # CDS_CODE, filename, inserted_at, school_year, term FROM ccgitranscripts.archive_course_grades WHERE filename IN (select filename from recent_files WHERE row_num = 1 ) ### UPDATE ACADEMIC YEAR BELOW #### AND ( (MONTH(curdate()) IN (8,9,10,11,12) AND substr(school_year,1,4) = (YEAR(CURDATE()))) OR (MONTH(curdate()) IN (1,2,3,4,5,6,7) AND substr(school_year,1,4) = (YEAR(CURDATE())-1)) ) ) select case when substr(filename, 1, 9) = 'PUHSD_CCG' then 'Perris Union High ' when substr(filename, 1, 9) = 'applevall' then 'Apple Valley Unified' when substr(filename, 1, 9) = 'brawleyad' then 'Brawley Union High' when substr(filename, 1, 9) = 'centinela' then 'Centinela Valley Union High' when substr(filename, 1, 9) = 'centralad' then 'Central Unified' when substr(filename, 1, 9) = 'ceresadmi' then 'Ceres Unified' when substr(filename, 1, 9) = 'chaffeyad' then 'Chaffey Joint Union High' when substr(filename, 1, 9) = 'chinoadmi' then 'Chino Valley Unified' when substr(filename, 1, 9) = 'coachella' then 'Coachella Valley Unified' when substr(filename, 1, 9) = 'comptonad' then 'Compton Unified' when substr(filename, 1, 9) = 'coronaadm' then 'Corona-Norco Unified' when substr(filename, 1, 9) = 'cutleroro' then 'Cutler-Orosi Joint Unified' when substr(filename, 1, 9) = 'delhiadmi' then 'Delhi Unified' when substr(filename, 1, 9) = 'denairadm' then 'Denair Unified' when substr(filename, 1, 9) = 'desertadm' then 'Desert Sands Unified' when substr(filename, 1, 9) = 'dinubaadm' then 'Dinuba Unified' when substr(filename, 1, 9) = 'elranchoa' then 'El Rancho Unified' when substr(filename, 1, 9) = 'elkgrovea' then 'Elk Grove Unified' when substr(filename, 1, 9) = 'escalonad' then 'Escalon Unified' when substr(filename, 1, 9) = 'exeteradm' then 'Exeter Unified' when substr(filename, 1, 9) = 'farmersvi' then 'Farmersville Unified' when substr(filename, 1, 9) = 'firebaugh' then 'Firebaugh-Las Deltas Unified' when substr(filename, 1, 9) = 'FresnoUni' then 'Fresno Unified' when substr(filename, 1, 9) = 'gardenadm' then 'Garden Grove Unified' when substr(filename, 1, 9) = 'gilroyadm' then 'Gilroy Unified' when substr(filename, 1, 9) = 'goldenpla' then 'Golden Plains Unified' when substr(filename, 1, 9) = 'hanfordad' then 'Hanford Joint Union High' when substr(filename, 1, 9) = 'haywardad' then 'Hayward Unified' when substr(filename, 1, 9) = 'hemetadmi' then 'Hemet Unified' when substr(filename, 1, 9) = 'hesperiaa' then 'Hesperia Unified' when substr(filename, 1, 9) = 'hughsonad' then 'Hughson Unified' when substr(filename, 1, 9) = 'jefferson' then 'Jefferson Union High' when substr(filename, 1, 9) = 'jurupaadm' then 'Jurupa Unified' when substr(filename, 1, 9) = 'kermanadm' then 'Kerman Unified' when substr(filename, 1, 9) = 'kingscany' then 'Kings Canyon Joint Unified' when substr(filename, 1, 9) = 'lakeelsin' then 'Lake Elsinore Unified' when substr(filename, 1, 9) = 'legrandad' then 'Le Grand Union High' when substr(filename, 1, 9) = 'lemooread' then 'Lemoore Union High' when substr(filename, 1, 9) = 'lindsayad' then 'Lindsay Unified' when substr(filename, 1, 9) = 'greendota' then 'Los Angeles Unified' when substr(filename, 1, 9) = 'losbanosa' then 'Los Banos Unified' when substr(filename, 1, 9) = 'maderaadm' then 'Madera Unified' when substr(filename, 1, 9) = 'maricopaa' then 'Maricopa Unified' when substr(filename, 1, 9) = 'mcfarland' then 'McFarland Unified' when substr(filename, 1, 9) = 'mendotaad' then 'Mendota Unified' when substr(filename, 1, 9) = 'morenoadm' then 'Moreno Valley Unified' when substr(filename, 1, 9) = 'MVUSD_CCG' then 'Murrieta Valley Unified' when substr(filename, 1, 9) = 'newmancro' then 'Newman-Crows Landing Unified' when substr(filename, 1, 9) = 'norwalkla' then 'Norwalk-La Mirada Unified' when substr(filename, 1, 9) = 'oceanside' then 'Oceanside Unified' when substr(filename, 1, 9) = 'palmsprin' then 'Palm Springs Unified' when substr(filename, 1, 9) = 'pasadenaa' then 'Pasadena Unified' when substr(filename, 1, 9) = 'placeradm' then 'Placer Union High' when substr(filename, 1, 9) = 'Pomona_CC' then 'Pomona Unified' when substr(filename, 1, 9) = 'portervil' then 'Porterville Unified' when substr(filename, 1, 9) = 'redlandsa' then 'Redlands Unified' when substr(filename, 1, 9) = 'riverdale' then 'Riverdale Joint Unified' when substr(filename, 1, 9) = 'riverside' then 'Riverside County Office of Education' when substr(filename, 1, 9) = 'sacrament' then 'Sacramento City Unified' when substr(filename, 1, 9) = 'sanluisco' then 'San Luis Coastal Unified' when substr(filename, 1, 9) = 'SMUSD_CCG' then 'San Marcos Unified' when substr(filename, 1, 9) = 'sangeradm' then 'Sanger Unified' when substr(filename, 1, 9) = 'SAUSD_CCG' then 'Santa Ana Unified' when substr(filename, 1, 9) = 'selmaadmi' then 'Selma Unified' when substr(filename, 1, 9) = 'shandonad' then 'Shandon Joint Unified' when substr(filename, 1, 9) = 'sierrasan' then 'Sierra Sands Unified' when substr(filename, 1, 9) = 'snowlinej' then 'Snowline Joint Unified' when substr(filename, 1, 9) = 'taftunion' then 'Taft Union High' when substr(filename, 1, 9) = 'TVUSD_CCG' then 'Temecula Valley Unified' when substr(filename, 1, 9) = 'tracyjoin' then 'Tracy Joint Unified' when substr(filename, 1, 9) = 'tularejoi' then 'Tulare Joint Union High' when substr(filename, 1, 9) = 'valverdea' then 'Val Verde Unified' when substr(filename, 1, 9) = 'visaliaad' then 'Visalia Unified' when substr(filename, 1, 9) = 'VUSD_CCGI' then 'Vista Unified' when substr(filename, 1, 9) = 'wascoadmi' then 'Wasco Union High' when substr(filename, 1, 9) = 'washingto' then 'Washington Unified' when substr(filename, 1, 9) = 'waterford' then 'Waterford Unified' when substr(filename, 1, 9) = 'woodlakea' then 'Woodlake Unified' when substr(filename, 1, 9) = 'woodlanda' then 'Woodland Joint Unified' else 'DISTRICT NAME NOT IDENTIFIED' end as district, filename, inserted_at, school_year, term, count(*) as record_count from course_grade_files GROUP BY 1,2,3,4,5
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 22, 2018 at 09:33 PM -- Server version: 10.1.30-MariaDB -- PHP Version: 7.2.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `test_amay` -- -- -------------------------------------------------------- -- -- Table structure for table `atm_details` -- CREATE TABLE `atm_details` ( `id` int(11) NOT NULL, `atm_id` varchar(20) NOT NULL, `currency_denomination` int(11) NOT NULL, `count` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `atm_details` -- INSERT INTO `atm_details` (`id`, `atm_id`, `currency_denomination`, `count`) VALUES (1, 'SBIN0012346', 2000, 15), (2, 'SBIN0012346', 500, 43), (3, 'SBIN0012346', 100, 93); -- -------------------------------------------------------- -- -- Table structure for table `card_details` -- CREATE TABLE `card_details` ( `card_id` int(11) NOT NULL, `card_number` varchar(16) NOT NULL, `pin` int(11) NOT NULL, `balance` float(16,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `card_details` -- INSERT INTO `card_details` (`card_id`, `card_number`, `pin`, `balance`) VALUES (1, '1234567891011123', 1234, 12100.00), (2, '3121110987654321', 1234, 150000.00); -- -------------------------------------------------------- -- -- Table structure for table `transaction_deails` -- CREATE TABLE `transaction_deails` ( `transaction_id` int(11) NOT NULL, `card_id` int(11) DEFAULT NULL, `atm_id` varchar(20) NOT NULL, `denomination_details` text NOT NULL, `transaction_date` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaction_deails` -- INSERT INTO `transaction_deails` (`transaction_id`, `card_id`, `atm_id`, `denomination_details`, `transaction_date`) VALUES (3, 1, '\'SBIN0012346\'', '\'[{\"currency\":2000,\"count\":2},{\"currency\":500,\"count\":2},{\"currency\":100,\"count\":3}]\'', 0), (4, 1, '\'SBIN0012346\'', '\'[{\"currency\":2000,\"count\":1}]\'', 0), (5, 1, '\'SBIN0012346\'', '\'[{\"currency\":2000,\"count\":0},{\"currency\":500,\"count\":0},{\"currency\":100,\"count\":1}]\'', 0), (6, 1, 'SBIN0012346', '[{\"currency\":2000,\"count\":0},{\"currency\":500,\"count\":3}]', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `atm_details` -- ALTER TABLE `atm_details` ADD PRIMARY KEY (`id`); -- -- Indexes for table `card_details` -- ALTER TABLE `card_details` ADD PRIMARY KEY (`card_id`); -- -- Indexes for table `transaction_deails` -- ALTER TABLE `transaction_deails` ADD PRIMARY KEY (`transaction_id`), ADD KEY `card_id` (`card_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `atm_details` -- ALTER TABLE `atm_details` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `card_details` -- ALTER TABLE `card_details` MODIFY `card_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `transaction_deails` -- ALTER TABLE `transaction_deails` MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- Constraints for dumped tables -- -- -- Constraints for table `transaction_deails` -- ALTER TABLE `transaction_deails` ADD CONSTRAINT `card_id` FOREIGN KEY (`card_id`) REFERENCES `card_details` (`card_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Dec 21, 2019 at 07:21 AM -- Server version: 5.6.21 -- PHP Version: 5.6.3 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: `hospital` -- -- -------------------------------------------------------- -- -- Table structure for table `daftar_dokter` -- CREATE TABLE IF NOT EXISTS `daftar_dokter` ( `id` int(11) NOT NULL, `nama` varchar(50) DEFAULT NULL, `nip` varchar(20) DEFAULT NULL, `spesialis` varchar(50) DEFAULT NULL, `foto` varchar(250) DEFAULT NULL, `telp` varchar(50) DEFAULT NULL, `jenis_kelamin` varchar(50) DEFAULT NULL, `reg` varchar(50) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_dokter` -- INSERT INTO `daftar_dokter` (`id`, `nama`, `nip`, `spesialis`, `foto`, `telp`, `jenis_kelamin`, `reg`) VALUES (3, 'Gendut', 'A11.2017.10499', 'Dokter Anak', '19062019033924A11.2017.10494.jpg', '0811117777777', 'Perempuan', '2019-06-19 01:59:50'); -- -------------------------------------------------------- -- -- Table structure for table `daftar_pasien` -- CREATE TABLE IF NOT EXISTS `daftar_pasien` ( `id` int(11) NOT NULL, `nama` varchar(40) DEFAULT NULL, `alamat` text, `telp` varchar(15) DEFAULT NULL, `jenis_kelamin` varchar(15) DEFAULT NULL, `gejala` text, `foto` varchar(250) DEFAULT NULL, `kota` varchar(50) DEFAULT NULL, `tlahir` varchar(50) DEFAULT NULL, `reg` varchar(50) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_pasien` -- INSERT INTO `daftar_pasien` (`id`, `nama`, `alamat`, `telp`, `jenis_kelamin`, `gejala`, `foto`, `kota`, `tlahir`, `reg`) VALUES (5, 'Muhamad Rizky Fajar', 'Semarang Barat', '081228479747', 'Laki-Laki', 'Pilek', '19062019033658A11.2017.10494.jpg', 'Salatiga', '22/02/1999', '2019-06-19 03:36:58'), (6, 'Gendut', 'Ketileng', '082123123', 'Laki-Laki', 'Sehat, Lapar', '03072019175830A11.2017.10492.jpg', 'Salatiga', '19/02/1999', '2019-07-03 17:58:30'), (7, 'Dinda', 'Pleburan V', '088888', 'Perempuan', 'Ngantuk', '03072019175949A11.2017.10494.jpg', 'Tarakan', '10/06/1999', '2019-07-03 17:59:49'); -- -------------------------------------------------------- -- -- Table structure for table `daftar_rawatinap` -- CREATE TABLE IF NOT EXISTS `daftar_rawatinap` ( `id` int(11) NOT NULL, `id_pasien` int(11) DEFAULT NULL, `nama_pasien` varchar(50) DEFAULT NULL, `alamat` text, `telp` varchar(14) DEFAULT NULL, `jenis_kelamin_pasien` varchar(14) DEFAULT NULL, `gejala` text, `foto_pasien` varchar(250) DEFAULT NULL, `kota` varchar(50) DEFAULT NULL, `tlahir` varchar(20) DEFAULT NULL, `reg_pasien` varchar(50) DEFAULT NULL, `id_dokter` int(11) DEFAULT NULL, `nama_dokter` varchar(50) DEFAULT NULL, `nip` varchar(50) DEFAULT NULL, `spesialis` varchar(50) DEFAULT NULL, `foto_dokter` varchar(250) DEFAULT NULL, `telp_dokter` varchar(50) DEFAULT NULL, `jenis_kelamin_dokter` varchar(50) DEFAULT NULL, `reg_dokter` varchar(50) DEFAULT NULL, `id_ruangan` int(11) DEFAULT NULL, `nama-ruangan` varchar(50) DEFAULT NULL, `kelas` varchar(10) DEFAULT NULL, `no_ruangan` int(11) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_rawatinap` -- INSERT INTO `daftar_rawatinap` (`id`, `id_pasien`, `nama_pasien`, `alamat`, `telp`, `jenis_kelamin_pasien`, `gejala`, `foto_pasien`, `kota`, `tlahir`, `reg_pasien`, `id_dokter`, `nama_dokter`, `nip`, `spesialis`, `foto_dokter`, `telp_dokter`, `jenis_kelamin_dokter`, `reg_dokter`, `id_ruangan`, `nama-ruangan`, `kelas`, `no_ruangan`) VALUES (2, 5, 'Muhamad Rizky Fajar', 'Semarang Barat', '081228479747', 'Laki-Laki', 'Pilek', '19062019033658A11.2017.10494.jpg', 'Salatiga', '22/02/1999', '2019-06-19 03:36:58', 3, 'Gendut', 'A11.2017.10499', 'Dokter Anak', '19062019033924A11.2017.10494.jpg', '0811117777777', 'Perempuan', '2019-06-19 01:59:50', 2, 'Bougenvile', 'Pilih..', 101), (3, 7, 'Dinda', 'Pleburan V', '088888', 'Perempuan', 'Ngantuk', '03072019175949A11.2017.10494.jpg', 'Tarakan', '10/06/1999', '2019-07-03 17:59:49', 3, 'Gendut', 'A11.2017.10499', 'Dokter Anak', '19062019033924A11.2017.10494.jpg', '0811117777777', 'Perempuan', '2019-06-19 01:59:50', 4, 'Mawar', 'VIP', 101), (4, 6, 'Gendut', 'Ketileng', '082123123', 'Laki-Laki', 'Sehat, Lapar', '03072019175830A11.2017.10492.jpg', 'Salatiga', '19/02/1999', '2019-07-03 17:58:30', 3, 'Gendut', 'A11.2017.10499', 'Dokter Anak', '19062019033924A11.2017.10494.jpg', '0811117777777', 'Perempuan', '2019-06-19 01:59:50', 4, 'Mawar', 'VIP', 101), (5, 6, 'Gendut', 'Ketileng', '082123123', 'Laki-Laki', 'Sehat, Lapar', '03072019175830A11.2017.10492.jpg', 'Salatiga', '19/02/1999', '2019-07-03 17:58:30', 3, 'Gendut', 'A11.2017.10499', 'Dokter Anak', '19062019033924A11.2017.10494.jpg', '0811117777777', 'Perempuan', '2019-06-19 01:59:50', 4, 'Mawar', 'VIP', 101); -- -------------------------------------------------------- -- -- Table structure for table `daftar_ruangan` -- CREATE TABLE IF NOT EXISTS `daftar_ruangan` ( `id` int(11) NOT NULL, `kelas` varchar(50) DEFAULT NULL, `nama_ruangan` varchar(50) DEFAULT NULL, `no_ruangan` varchar(50) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_ruangan` -- INSERT INTO `daftar_ruangan` (`id`, `kelas`, `nama_ruangan`, `no_ruangan`) VALUES (2, 'Pilih..', 'Bougenvile', '101'), (3, 'VIP', 'Mawar', '101'), (4, 'VIP', 'Mawar', '101'); -- -------------------------------------------------------- -- -- Table structure for table `pegawai` -- CREATE TABLE IF NOT EXISTS `pegawai` ( `id` int(11) NOT NULL, `username` varchar(40) DEFAULT NULL, `password` varchar(250) DEFAULT NULL, `foto` varchar(250) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; -- -- Dumping data for table `pegawai` -- INSERT INTO `pegawai` (`id`, `username`, `password`, `foto`) VALUES (2, 'admin', 'admin', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `daftar_dokter` -- ALTER TABLE `daftar_dokter` ADD PRIMARY KEY (`id`); -- -- Indexes for table `daftar_pasien` -- ALTER TABLE `daftar_pasien` ADD PRIMARY KEY (`id`); -- -- Indexes for table `daftar_rawatinap` -- ALTER TABLE `daftar_rawatinap` ADD PRIMARY KEY (`id`); -- -- Indexes for table `daftar_ruangan` -- ALTER TABLE `daftar_ruangan` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pegawai` -- ALTER TABLE `pegawai` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `daftar_dokter` -- ALTER TABLE `daftar_dokter` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `daftar_pasien` -- ALTER TABLE `daftar_pasien` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `daftar_rawatinap` -- ALTER TABLE `daftar_rawatinap` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `daftar_ruangan` -- ALTER TABLE `daftar_ruangan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `pegawai` -- ALTER TABLE `pegawai` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; /*!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 */;
-- Motor: PostgreSQL 9.5.2 ---------------------------------------------------------------------------------------- -- Constraints del trabajo práctico N°2 -- Constraints tabla cliente ALTER table cliente ALTER COLUMN Nrocliente SET NOT NULL; ALTER table cliente ADD PRIMARY KEY ( Nrocliente ); ALTER table cliente ALTER COLUMN Apellido SET NOT NULL; ALTER table cliente ALTER COLUMN Nombre SET NOT NULL; -- Constraints tabla tarjeta ALTER table tarjeta ALTER COLUMN Nrotarjeta SET NOT NULL; ALTER table tarjeta ADD PRIMARY KEY ( Nrotarjeta ); ALTER TABLE tarjeta ADD FOREIGN KEY (Nrocliente) REFERENCES cliente(Nrocliente); -- Constraints tabla comercio ALTER table comercio ALTER COLUMN Nrocomercio SET NOT NULL; ALTER table comercio ADD PRIMARY KEY ( Nrocomercio ); -- Constraints tabla consumos ALTER table consumos ALTER COLUMN NroOperacion SET NOT NULL; ALTER table consumos ADD PRIMARY KEY ( NroOperacion ); ALTER TABLE consumos ADD FOREIGN KEY (Nrotarjeta) REFERENCES tarjeta(Nrotarjeta); ALTER TABLE consumos ADD FOREIGN KEY (NroComercio) REFERENCES comercio(Nrocomercio); ALTER TABLE consumos ADD CONSTRAINT check_Monto CHECK (Monto > 0); -- Constraints tabla rechazos ALTER table rechazos ALTER COLUMN NroRechazo SET NOT NULL; ALTER table rechazos ADD PRIMARY KEY ( NroRechazo ); -- Esta FK esta demás si tenemos en cuenta que en la --tabla rechazos pueden ir números de tarjeta inválidos --ALTER TABLE rechazos ADD FOREIGN KEY --(NroTarjeta) REFERENCES tarjeta(Nrotarjeta); ALTER TABLE rechazos ADD FOREIGN KEY (NroComercio) REFERENCES comercio(Nrocomercio); ALTER TABLE rechazos ADD CONSTRAINT check_Monto CHECK (Monto > 0); -- Constraints tabla cierres ALTER table cierres ALTER COLUMN Mes SET NOT NULL; ALTER table cierres ALTER COLUMN Año SET NOT NULL; ALTER table cierres ALTER COLUMN Terminacion SET NOT NULL; ALTER table cierres ADD PRIMARY KEY ( Año,Mes,Terminacion ); -- Constraints tabla compras ALTER table compras ALTER COLUMN Nrotarjeta SET NOT NULL; ALTER table compras ADD PRIMARY KEY ( Nrotarjeta ); ALTER TABLE compras ADD CONSTRAINT check_Monto CHECK (Monto > 0); -- Constraints tabla test ALTER TABLE test ADD CONSTRAINT check_Monto CHECK (Monto > 0); -- Constraints tabla alertas ALTER TABLE alertas ADD CONSTRAINT NroOperacion_esRechazo UNIQUE (NroOperacion, esRechazo); -- Verificar unique key ---------------------------------------------------------------------------------------- -- Constraints tabla factura ALTER TABLE factura ADD FOREIGN KEY (Nrocliente) REFERENCES cliente(Nrocliente); ---------------------------------------------------------------------------------------- -- Constraints tabla compras_periodo_usuario ALTER TABLE compras_periodo_usuario ADD FOREIGN KEY (idFactura) REFERENCES factura(idFactura); ALTER TABLE compras_periodo_usuario ADD FOREIGN KEY (Nrotarjeta) REFERENCES tarjeta(Nrotarjeta); ----------------------------------------------------------------------------------------
/* Populate tabla partidos */ INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Colombia', 'Brasil', '2-1', '2021-01-01'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Argentina', 'Paraguay', '3-1', '2021-01-02'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Uruguay', 'Bolivia', '1-0', '2021-01-03'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Venezuela', 'Peru', '0-1', '2021-01-04'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Ecuador', 'Chile', '1-1', '2021-02-01'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Colombia', 'Argentina', '0-0', '2021-02-10'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Paraguay', 'Uruguay', '1-2', '2021-02-18'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Bolivia', 'Peru', '1-3', '2021-02-28'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Ecuador', 'Brasil', '0-2', '2021-03-03'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Colombia', 'Paraguay', '2-1', '2021-03-04'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Chile', 'Venezuela', '3-1', '2021-03-05'); INSERT INTO partidos (local, visitante, resultado, create_at) VALUES('Argentina', 'Brasil', '2-1', '2021-03-06'); /* Populate tabla equipos */ INSERT INTO equipos (nombre) VALUES('Colombia'); INSERT INTO equipos (nombre) VALUES('Brasil'); INSERT INTO equipos (nombre) VALUES('Argentina'); INSERT INTO equipos (nombre) VALUES('Uruguay'); /* Populate tabla usuarios INSERT INTO usuarios (nombre, correo, username, pasword) VALUES('Carlos', 'molinacarlosj@hotmail.com', 'molinacarlosj', 'pass123'); INSERT INTO usuarios (nombre, correo, username, pasword) VALUES('admin', 'administrator@hotmail.com', 'admin', 'admin123'); INSERT INTO usuarios (nombre, correo, username, pasword) VALUES('Invitado', 'invitado@hotmail.com', 'invitado', 'invitado123'); */
-- phpMyAdmin SQL Dump -- version 4.8.0.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 22-04-2019 a las 22:25:39 -- Versión del servidor: 10.1.32-MariaDB -- Versión de PHP: 7.2.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `hvtbd` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `alumno` -- CREATE DATABASE hvtbd; USE hvtbd; CREATE TABLE `alumno` ( `id_alumno` int(11) NOT NULL, `nombre` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `apellidos` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `direccion` varchar(120) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `estado_civil` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `sexo` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `dui` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `nit` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `carnet_minoridad` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `discapacidad` varchar(120) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `telefono` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `correo` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `fecha_nac` date NOT NULL, `id_cohorte` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `alumno` -- INSERT INTO `alumno` (`id_alumno`, `nombre`, `apellidos`, `direccion`, `estado_civil`, `sexo`, `dui`, `nit`, `carnet_minoridad`, `discapacidad`, `telefono`, `correo`, `fecha_nac`, `id_cohorte`) VALUES (5, 'Gabriela Nathalie', 'Menendez Menendez', 'Urb. Las Colinas', 'Soltera/o', 'Femenino', '02564987-8', '1561-805181-848-4', NULL, '', '8676-4378', 'gabriela.menendez@proyectosfgk.org', '1993-06-16', 1), (6, 'Stephannie', 'Escobar', 'calle iaofaew', 'Soltera/o', 'Femenino', '02564987-8', '1561-805181-848-4', NULL, '', '4367-3475', 'stephannie.escobar@proyectosfgk.org', '2019-04-10', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cohorte` -- CREATE TABLE `cohorte` ( `id_cohorte` int(11) NOT NULL, `nombre` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `fecha_inicio` date NOT NULL, `fecha_fin` date NOT NULL, `id_sede` int(11) NOT NULL, `id_curso` int(11) NOT NULL, `estado` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `cohorte` -- INSERT INTO `cohorte` (`id_cohorte`, `nombre`, `fecha_inicio`, `fecha_fin`, `id_sede`, `id_curso`, `estado`) VALUES (1, 'COHORTE-1', '2019-03-25', '2019-10-28', 1, 1, 1), (16, 'COHORTE-2', '2019-04-23', '2019-04-26', 1, 2, 1), (24, 'COHORTE-4', '2019-04-11', '2019-04-19', 1, 1, 1), (25, 'COHORTE-6', '2019-04-12', '2019-04-13', 1, 4, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `criterio` -- CREATE TABLE `criterio` ( `id_criterio` int(11) NOT NULL, `id_tipo_criterio` int(11) NOT NULL, `nombre` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `criterio` -- INSERT INTO `criterio` (`id_criterio`, `id_tipo_criterio`, `nombre`) VALUES (1, 1, 'Identifica sus fortalezas y aspectos a mejorar'), (2, 1, 'Identifica y relaciona sus intereses con las posibilidades de desarrollo personal, profesional y laboral'), (3, 1, 'Asume y responde oportuna y eficientemente a los compromisos adquiridos'), (4, 2, 'Utiliza el lenguaje escrito con claridad, fluidez y adecuadamente, para interactuar en distintos contextos sociales y con otras personas'), (5, 2, 'Utiliza el lenguaje oral con claridad, fluidez y adecuadamente, para interactuar en distintos contextos sociales y con otras personas'), (6, 3, 'Analiza el entorno y las diferentes situaciones de la vida, desde diversos puntos de vista'), (7, 3, 'Transforma necesidades u obstáculos en oportunidades'), (8, 4, 'Identifica los aspectos del entorno visualizando necesidades, obstáculos y oportunidades para posible solución'), (9, 5, 'Considera importante pensar el futuro y trazarse un objetivo'), (10, 5, 'Especifica tiempos y recursos necesarios para cada acción propuesta'), (11, 5, 'Considera cuidadosamente ventajas y desventajas para valorar alternativas'), (12, 6, 'Participa y aporta conocimientos y capacidades para el desarrollo de una tarea u objetivo común'), (13, 6, 'Diferencia roles y funciones en el desarrollo de una tarea u objetivo común'), (14, 6, 'Interactúa con las y los demás y promueve el trabajo en equipo'), (15, 6, 'Se responsabiliza de cumplir con su parte para el logro común de los objetivos'), (16, 7, 'Analiza de manera anticipada problemas, dificultades y riesgos; propone soluciones'), (17, 7, 'Moviliza continuamente proactivamente sus recursos para lograr resultados'), (18, 7, 'Hace lo que se necesita hacer antes que otras personas tengan que pedirle que lo haga'), (19, 8, 'Asimila con rapidez los nuevos conocimientos y los pone en practica cotidianamente'), (20, 8, 'Evalúa y revisa sus acciones, adecuándose a nuevas condiciones, entornos y personas'), (21, 8, 'Percibe los cambios o los desaciertos, como una posibilidad de nuevos aprendizajes'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `curso` -- CREATE TABLE `curso` ( `id_curso` int(11) NOT NULL, `nombre` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `curso` -- INSERT INTO `curso` (`id_curso`, `nombre`) VALUES (1, 'PHP'), (2, 'C# XAMARIN'), (3, 'HTML MVC'), (4, 'JAVA'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `nota` -- CREATE TABLE `nota` ( `id_nota` int(11) NOT NULL, `nombre_materia` enum('Habilidades para la vida y el trabajo') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `id_criterio` int(11) NOT NULL, `nota_inicio` int(11) DEFAULT NULL, `nota_fin` int(11) DEFAULT NULL, `fecha_llenado_inicio` date DEFAULT NULL, `fecha_llenado_fin` date DEFAULT NULL, `id_alumno` int(11) NOT NULL, `id_usuario` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `nota` -- INSERT INTO `nota` (`id_nota`, `nombre_materia`, `id_criterio`, `nota_inicio`, `nota_fin`, `fecha_llenado_inicio`, `fecha_llenado_fin`, `id_alumno`, `id_usuario`) VALUES (2, 'Habilidades para la vida y el trabajo', 1, 1, 2, '2019-04-23', '2019-04-24', 5, 4), (3, 'Habilidades para la vida y el trabajo', 2, 1, 2, '2019-04-23', '2019-04-24', 5, 4), (4, 'Habilidades para la vida y el trabajo', 3, 2, 2, '2019-04-23', '2019-04-24', 5, 4), (5, 'Habilidades para la vida y el trabajo', 4, 1, 2, '2019-04-23', '2019-04-24', 5, 4), (6, 'Habilidades para la vida y el trabajo', 5, 2, 3, '2019-04-23', '2019-04-24', 5, 4), (7, 'Habilidades para la vida y el trabajo', 6, 1, 3, '2019-04-23', '2019-04-24', 5, 4), (8, 'Habilidades para la vida y el trabajo', 7, 2, 3, '2019-04-23', '2019-04-24', 5, 4), (9, 'Habilidades para la vida y el trabajo', 8, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (10, 'Habilidades para la vida y el trabajo', 9, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (11, 'Habilidades para la vida y el trabajo', 10, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (12, 'Habilidades para la vida y el trabajo', 11, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (13, 'Habilidades para la vida y el trabajo', 12, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (14, 'Habilidades para la vida y el trabajo', 13, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (15, 'Habilidades para la vida y el trabajo', 14, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (16, 'Habilidades para la vida y el trabajo', 15, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (17, 'Habilidades para la vida y el trabajo', 16, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (18, 'Habilidades para la vida y el trabajo', 17, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (19, 'Habilidades para la vida y el trabajo', 18, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (20, 'Habilidades para la vida y el trabajo', 19, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (21, 'Habilidades para la vida y el trabajo', 20, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (22, 'Habilidades para la vida y el trabajo', 21, 0, 0, '2019-04-23', '2019-04-24', 5, 4), (23, 'Habilidades para la vida y el trabajo', 1, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (24, 'Habilidades para la vida y el trabajo', 2, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (25, 'Habilidades para la vida y el trabajo', 3, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (26, 'Habilidades para la vida y el trabajo', 4, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (27, 'Habilidades para la vida y el trabajo', 5, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (28, 'Habilidades para la vida y el trabajo', 6, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (29, 'Habilidades para la vida y el trabajo', 7, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (30, 'Habilidades para la vida y el trabajo', 8, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (31, 'Habilidades para la vida y el trabajo', 9, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (32, 'Habilidades para la vida y el trabajo', 10, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (33, 'Habilidades para la vida y el trabajo', 11, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (34, 'Habilidades para la vida y el trabajo', 12, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (35, 'Habilidades para la vida y el trabajo', 13, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (36, 'Habilidades para la vida y el trabajo', 14, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (37, 'Habilidades para la vida y el trabajo', 15, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (38, 'Habilidades para la vida y el trabajo', 16, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (39, 'Habilidades para la vida y el trabajo', 17, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (40, 'Habilidades para la vida y el trabajo', 18, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (41, 'Habilidades para la vida y el trabajo', 19, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (42, 'Habilidades para la vida y el trabajo', 20, 0, 0, '2019-04-24', '2019-04-24', 6, 4), (43, 'Habilidades para la vida y el trabajo', 21, 0, 0, '2019-04-24', '2019-04-24', 6, 4); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rol` -- CREATE TABLE `rol` ( `id_rol` int(11) NOT NULL, `nombre` varchar(64) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `rol` -- INSERT INTO `rol` (`id_rol`, `nombre`) VALUES (1, 'ADMINISTRADOR'), (2, 'DOCENTE'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sede` -- CREATE TABLE `sede` ( `id_sede` int(11) NOT NULL, `nombre` varchar(120) NOT NULL, `telefono` varchar(32) NOT NULL, `correo` varchar(120) DEFAULT NULL, `direccion` varchar(120) NOT NULL, `departamento` varchar(64) NOT NULL, `municipio` varchar(64) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `sede` -- INSERT INTO `sede` (`id_sede`, `nombre`, `telefono`, `correo`, `direccion`, `departamento`, `municipio`) VALUES (1, 'FGK-SANTA ANA', '4367-3475', 'vnsihrs@jsgergvsdgsrjgdkfhbdsjklrghdjkrhgkdjrgd.com', '9° Calle ', 'SANTA ANA', 'Santa Ana'), (3, 'FGK AHUACHAPAN', '8676-4378', 'adagae@gmail.com', 'calle faew', 'AHUACHAPAN', 'AHUACHAPAN'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipo_criterio` -- CREATE TABLE `tipo_criterio` ( `id_tipo_criterio` int(11) NOT NULL, `nombre` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `tipo_criterio` -- INSERT INTO `tipo_criterio` (`id_tipo_criterio`, `nombre`) VALUES (1, 'Gestionar el desarrollo personal '), (2, 'Comunicar con efectividad'), (3, 'Identificar oportunidades'), (4, 'Pensar y actuar de manera creativa'), (5, 'Traducir ideas en un plan de acción'), (6, 'Trabajar de manera colaborativa'), (7, 'Actuar con iniciativa'), (8, 'Adaptacion al cambio'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario` -- CREATE TABLE `usuario` ( `id_usuario` int(11) NOT NULL, `nombre` varchar(64) NOT NULL, `apellidos` varchar(64) NOT NULL, `id_rol` int(11) NOT NULL, `correo` varchar(120) NOT NULL, `contrasenia` varchar(120) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `usuario` -- INSERT INTO `usuario` (`id_usuario`, `nombre`, `apellidos`, `id_rol`, `correo`, `contrasenia`) VALUES (1, 'Ulises', 'Samayoa', 1, 'ulises.samayoa@proyectosfgk.org', '202cb962ac59075b964b07152d234b70'), (4, 'Rogelio', 'Gonzalez', 2, 'rogelio.gonzalez@proyectosfgk.org', '827ccb0eea8a706c4c34a16891f84e7b'), (5, 'Mauricio', 'Gudiel', 1, 'mauricio.gudiel@proyectosfgk.org', '827ccb0eea8a706c4c34a16891f84e7b'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `alumno` -- ALTER TABLE `alumno` ADD PRIMARY KEY (`id_alumno`), ADD KEY `id_cohorte` (`id_cohorte`); -- -- Indices de la tabla `cohorte` -- ALTER TABLE `cohorte` ADD PRIMARY KEY (`id_cohorte`), ADD KEY `id_sede` (`id_sede`), ADD KEY `id_curso` (`id_curso`); -- -- Indices de la tabla `criterio` -- ALTER TABLE `criterio` ADD PRIMARY KEY (`id_criterio`), ADD KEY `id_tipo_criterio` (`id_tipo_criterio`); -- -- Indices de la tabla `curso` -- ALTER TABLE `curso` ADD PRIMARY KEY (`id_curso`); -- -- Indices de la tabla `nota` -- ALTER TABLE `nota` ADD PRIMARY KEY (`id_nota`), ADD KEY `id_alumno` (`id_alumno`), ADD KEY `id_usuario` (`id_usuario`), ADD KEY `id_criterio` (`id_criterio`); -- -- Indices de la tabla `rol` -- ALTER TABLE `rol` ADD PRIMARY KEY (`id_rol`); -- -- Indices de la tabla `sede` -- ALTER TABLE `sede` ADD PRIMARY KEY (`id_sede`); -- -- Indices de la tabla `tipo_criterio` -- ALTER TABLE `tipo_criterio` ADD PRIMARY KEY (`id_tipo_criterio`); -- -- Indices de la tabla `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`id_usuario`), ADD KEY `id_rol` (`id_rol`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `alumno` -- ALTER TABLE `alumno` MODIFY `id_alumno` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT de la tabla `cohorte` -- ALTER TABLE `cohorte` MODIFY `id_cohorte` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT de la tabla `criterio` -- ALTER TABLE `criterio` MODIFY `id_criterio` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT de la tabla `curso` -- ALTER TABLE `curso` MODIFY `id_curso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT de la tabla `nota` -- ALTER TABLE `nota` MODIFY `id_nota` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65; -- -- AUTO_INCREMENT de la tabla `rol` -- ALTER TABLE `rol` MODIFY `id_rol` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `sede` -- ALTER TABLE `sede` MODIFY `id_sede` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `tipo_criterio` -- ALTER TABLE `tipo_criterio` MODIFY `id_tipo_criterio` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT de la tabla `usuario` -- ALTER TABLE `usuario` MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `alumno` -- ALTER TABLE `alumno` ADD CONSTRAINT `alumno_ibfk_1` FOREIGN KEY (`id_cohorte`) REFERENCES `cohorte` (`id_cohorte`); -- -- Filtros para la tabla `cohorte` -- ALTER TABLE `cohorte` ADD CONSTRAINT `cohorte_ibfk_1` FOREIGN KEY (`id_sede`) REFERENCES `sede` (`id_sede`), ADD CONSTRAINT `cohorte_ibfk_2` FOREIGN KEY (`id_curso`) REFERENCES `curso` (`id_curso`); -- -- Filtros para la tabla `criterio` -- ALTER TABLE `criterio` ADD CONSTRAINT `criterio_ibfk_1` FOREIGN KEY (`id_tipo_criterio`) REFERENCES `tipo_criterio` (`id_tipo_criterio`); -- -- Filtros para la tabla `nota` -- ALTER TABLE `nota` ADD CONSTRAINT `nota_ibfk_1` FOREIGN KEY (`id_alumno`) REFERENCES `alumno` (`id_alumno`), ADD CONSTRAINT `nota_ibfk_2` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`), ADD CONSTRAINT `nota_ibfk_3` FOREIGN KEY (`id_criterio`) REFERENCES `criterio` (`id_criterio`); -- -- Filtros para la tabla `usuario` -- ALTER TABLE `usuario` ADD CONSTRAINT `usuario_ibfk_1` FOREIGN KEY (`id_rol`) REFERENCES `rol` (`id_rol`); 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 */;
CREATE TABLE `bottega-university`.`students` ( `id` INT NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(30) NOT NULL, `last_name` VARCHAR(30) NOT NULL, `email` VARCHAR(50) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE, UNIQUE INDEX `email_UNIQUE` (`email` ASC) VISIBLE);
drop table theatre; drop table outdat; drop trigger trii; create table theatre(mov_id number(10),mov_name varchar(20),lang varchar(20),revw number(10)); insert into theatre values(101,'Junglebook','English',6); insert into theatre values(501,'Parava','Malayalam',8); insert into theatre values(601,'OSO','Hindi',9); insert into theatre values(701,'Avengers','English',9); insert into theatre values(801,'Hobbit','English',7); insert into theatre values(901,'Don','Hindi',6); select * from theatre; create table outdat(mov_id number(10),mov_name varchar(20)); create trigger trii after delete on theatre for each row begin insert into outdat values(:old.mov_id,:old.mov_name); end; set server output on declare a1 number:=&a1; a2 number:=&a2; begin if(a2<5) then delete from theatre where mov_id=a1; end if; end; select * from theatre; select * from outdat;
--Script to change into SQL database \c mrcoffee_app
--Write a query that displays only the state and total fruit for the state with the largest amount of fruit supply select state, sum(supply) from fruit_imports group by state order by 2 desc limit 1; --Write a query that displays only the state with the largest amount of fruit supply. select state from fruit_imports group by state order by sum(supply) desc limit 1; -- Write a query that returns the most expensive cost_per_unit of every season -- The query should display 2 columns, the season and the cost_per_unit select season, max(cost_per_unit) from fruit_imports group by season; -- Write a query that returns the state that has more than 1 import of the same fruit. select state from fruit_imports group by state order by count(name) desc limit 1; -- Write a query that returns the seasons that produce either 3 fruits or 4 fruits. select season from fruit_imports group by season having count(name) = 3 or count(name) = 4; --Write a query that takes into consideration the supply and cost_per_unit columns for determining the --total cost and returns the most expensive state with the total cost. select state, (sum(supply) * sum(cost_per_unit)) total_cost from fruit_imports group by state order by 2 desc limit 1; /* CREATE table fruits (fruit_name varchar(10)); INSERT INTO fruits VALUES ('Orange'); INSERT INTO fruits VALUES ('Apple'); INSERT INTO fruits VALUES (NULL); INSERT INTO fruits VALUES (NULL); Write a query that returns the count of 4. You'll need to count on the column fruit_name and not use COUNT(*) */ select count(fruit_name is not null or fruit_name is null) from fruits;
SELECT MAX(e1.Salary) AS SecondHighestSalary FROM Employee e1 WHERE 1<=(SELECT COUNT(DISTINCT e2.Salary) FROM Employee e2 WHERE e1.Salary<e2.Salary);
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1 -- Время создания: Дек 24 2020 г., 14:10 -- Версия сервера: 10.4.11-MariaDB -- Версия PHP: 7.2.26 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 */; -- -- База данных: `clockware` -- -- -------------------------------------------------------- -- -- Структура таблицы `cities` -- CREATE TABLE `cities` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `cities` -- INSERT INTO `cities` (`id`, `name`) VALUES (1, 'Днепр'), (11, 'Харьков'), (12, 'Одесса'); -- -------------------------------------------------------- -- -- Структура таблицы `clients` -- CREATE TABLE `clients` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `clients` -- INSERT INTO `clients` (`id`, `name`, `email`) VALUES (1, 'Vasia Client', 'vasia@muemail.ioo'), (2, 'Petia Client', 'petia@muemail.io'), (4, 'Константин Николаевич', 'kohan.dev@gmail.com'), (6, 'Константин', 'kohan.kot@gmail.com'), (10, 'sfdfsf88', 'admin@example.com'), (18, 'aaa', 'ss_ss@ua.fm'), (24, 'Vasia', 'vasia@example.com'); -- -------------------------------------------------------- -- -- Структура таблицы `masters` -- CREATE TABLE `masters` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `cityId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `masters` -- INSERT INTO `masters` (`id`, `name`, `cityId`) VALUES (1, 'Артур Риверский', 1), (2, 'Владимир Пасечкин', 11), (26, 'Василий Пупкин', 11), (28, 'Петров Вася', 12), (31, 'Семен Семенович', 11), (53, 'Леша Свистунов', 12), (54, 'Вася Васечкин', 1); -- -------------------------------------------------------- -- -- Структура таблицы `orders` -- CREATE TABLE `orders` ( `id` int(11) NOT NULL, `date` datetime NOT NULL, `time` varchar(255) NOT NULL, `hours` int(11) NOT NULL, `cityId` int(11) DEFAULT NULL, `masterId` int(11) DEFAULT NULL, `photoURL` varchar(255) NOT NULL, `userId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `orders` -- INSERT INTO `orders` (`id`, `date`, `time`, `hours`, `cityId`, `masterId`, `photoURL`, `userId`) VALUES (89, '2020-10-02 00:00:00', '10:00', 1, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843070/clockware/x0s5cp5bpsbfjni5a1av.jpg', NULL), (91, '2020-10-05 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843346/clockware/odijalax0g7crwdgw791.jpg', NULL), (94, '2020-10-09 00:00:00', '14:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843410/clockware/cbzp8udakyz28y5b2iic.jpg', NULL), (95, '2020-09-23 00:00:00', '10:00', 1, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843428/clockware/airoxrllolxlnmktbtiy.jpg', NULL), (96, '2020-09-24 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843443/clockware/j9d0jophucmyn0qhrt2g.jpg', NULL), (98, '2020-09-26 00:00:00', '10:00', 2, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843513/clockware/bcrljkqekiqmzbfcgwsk.jpg', NULL), (99, '2020-10-01 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843536/clockware/ayouu5crhmex6xkq6in2.jpg', NULL), (100, '2020-09-24 00:00:00', '10:00', 2, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1599843553/clockware/nsyscblcwdl8vas4jejz.jpg', NULL), (108, '2020-10-29 00:00:00', '10:00', 2, 11, 26, '', NULL), (109, '2020-10-23 00:00:00', '10:00', 1, 11, 31, '', NULL), (110, '2020-10-05 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1601930569/clockware/qzduklmvs9zdzgf8402m.jpg', NULL), (111, '2020-10-18 00:00:00', '15:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601931199/clockware/tnx302rh1jpw6hxy5icw.jpg', NULL), (112, '2020-10-10 00:00:00', '10:00', 2, 11, 26, '', NULL), (113, '2020-10-08 00:00:00', '10:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1601931636/clockware/oiurkvqhfctgztpodpzo.jpg', NULL), (114, '2020-10-09 00:00:00', '10:00', 1, 11, 31, '', NULL), (115, '2020-10-11 00:00:00', '10:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601932062/clockware/jtf1erteafyn9s6qt010.jpg', NULL), (116, '2020-10-21 00:00:00', '10:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601932393/clockware/vcwyzbzvodd2rcmtyh4n.jpg', NULL), (117, '2020-10-15 00:00:00', '10:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601932973/clockware/fzyx7n9dxxutbsjfa1ir.jpg', NULL), (118, '2020-11-01 00:00:00', '10:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1601933973/clockware/akxqxyxsigghlffsd7wr.jpg', NULL), (119, '2020-10-23 00:00:00', '10:00', 1, 12, 28, '', NULL), (120, '2020-10-17 00:00:00', '10:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1601934375/clockware/kdohlwk2ltuvkxjcejsb.jpg', NULL), (121, '2020-10-21 00:00:00', '15:00', 1, 1, 1, '', NULL), (122, '2020-10-20 00:00:00', '10:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601934676/clockware/lnnw2c4gt4i4wvdk6cl9.jpg', NULL), (124, '2020-11-03 00:00:00', '10:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1601934875/clockware/pn4gnc97qwy8q3ifdc0x.jpg', NULL), (126, '2020-10-27 00:00:00', '16:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1602102354/clockware/wkcxlwjtbctztxpoaa1v.jpg', NULL), (127, '2020-10-29 00:00:00', '15:00', 1, 1, 1, '', NULL), (128, '2020-10-24 00:00:00', '10:00', 1, 12, 28, '', NULL), (129, '2020-10-19 00:00:00', '16:00', 2, 11, 26, '', NULL), (130, '2020-11-03 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1602103537/clockware/jlcwh95un4af8mo6uhrh.jpg', NULL), (131, '2020-10-25 00:00:00', '10:00', 2, 12, 28, 'https://res.cloudinary.com/kodevtm/image/upload/v1602104237/clockware/xvtpiaduhwqs9cgssypy.jpg', NULL), (132, '2020-10-12 00:00:00', '14:00', 2, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1602104606/clockware/nffnja3surlabt7dvf4c.jpg', NULL), (134, '2020-10-16 00:00:00', '13:00', 2, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1602105377/clockware/zzbfqfkmpbvzqyeh4mlh.jpg', NULL), (135, '2020-10-31 00:00:00', '10:00', 2, 12, 28, 'https://res.cloudinary.com/kodevtm/image/upload/v1602105543/clockware/h6zrmijnbchju7zypfgi.jpg', NULL), (136, '2020-10-18 00:00:00', '10:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1602105669/clockware/kaqkof6dnkydwn0ncr6y.jpg', NULL), (137, '2020-10-23 00:00:00', '16:00', 2, 1, 1, '', NULL), (138, '2020-10-29 00:00:00', '13:00', 2, 11, 26, '', NULL), (139, '2020-11-02 00:00:00', '15:00', 1, 12, 28, '', NULL), (140, '2020-10-27 00:00:00', '10:00', 1, 12, 28, '', NULL), (142, '2020-10-22 00:00:00', '12:00', 1, 11, 31, '', NULL), (143, '2020-10-23 00:00:00', '10:00', 1, 11, 2, '', NULL), (146, '2020-10-24 00:00:00', '15:00', 1, 11, 2, '', NULL), (147, '2020-11-05 00:00:00', '16:00', 2, 1, 1, '', NULL), (148, '2020-11-07 00:00:00', '14:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1602543097/clockware/ctdo7gkokxk5tryqanip.jpg', NULL), (149, '2020-10-24 00:00:00', '15:00', 2, 11, 26, '', NULL), (150, '2020-10-14 00:00:00', '10:00', 1, 12, 53, '', NULL), (151, '2020-11-06 00:00:00', '15:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1603489176/clockware/ijtmrp4nmlshrcmbjnq1.jpg', NULL), (152, '2020-11-05 00:00:00', '10:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1603531049/clockware/i90wf2rqwrg7eutcgiaw.jpg', NULL), (153, '2020-11-04 00:00:00', '16:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1603641044/clockware/as5d2zrjwe4k2saiadvc.jpg', NULL), (154, '2020-11-07 00:00:00', '16:00', 1, 11, 31, '', NULL), (155, '2020-11-07 00:00:00', '16:00', 2, 11, 26, '', NULL), (156, '2020-11-06 00:00:00', '14:00', 1, 12, 53, '', NULL), (157, '2020-11-02 00:00:00', '10:00', 1, 11, 31, '', NULL), (158, '2020-11-07 00:00:00', '12:00', 1, 11, 2, '', NULL), (159, '2020-11-07 00:00:00', '16:00', 1, 11, 2, '', NULL), (161, '2020-10-24 00:00:00', '10:00', 1, 12, 53, '', NULL), (162, '2020-11-08 00:00:00', '10:00', 1, 11, 26, '', NULL), (163, '2020-11-08 00:00:00', '12:00', 1, 11, 2, '', NULL), (164, '2020-11-01 00:00:00', '13:00', 1, 11, 31, '', NULL), (165, '2020-11-08 00:00:00', '14:00', 1, 11, 2, '', NULL), (166, '2020-11-01 00:00:00', '14:00', 1, 11, 2, '', NULL), (167, '2020-11-16 00:00:00', '10:00', 1, 1, 1, '', NULL), (168, '2020-11-16 00:00:00', '10:00', 1, 11, 26, '', NULL), (169, '2020-11-16 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1605536538/clockware/srke8ydfa1iw0pv2blot.jpg', NULL), (170, '2020-11-17 00:00:00', '10:00', 1, 11, 31, '', NULL), (171, '2020-11-27 00:00:00', '15:00', 1, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1605624479/clockware/zswfngjkuw0deaskbhj4.jpg', NULL), (172, '2020-11-21 00:00:00', '16:00', 2, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1605626257/clockware/m7jlwzypazeqctyulxkk.jpg', NULL), (173, '2020-11-20 00:00:00', '10:00', 2, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1605627795/clockware/d5gstocvjdrulxma1xhu.jpg', NULL), (174, '2020-11-20 00:00:00', '10:00', 1, 1, 1, 'https://res.cloudinary.com/kodevtm/image/upload/v1605872168/clockware/ing2udiusianrnmyjx8d.jpg', NULL), (175, '2020-11-24 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1606143343/clockware/plawtfkqisuwrn0ncogr.jpg', NULL), (176, '2020-11-25 00:00:00', '10:00', 2, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1606300631/clockware/usbmphe4ecazbyet21fn.jpg', NULL), (177, '2020-11-25 00:00:00', '10:00', 1, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1606300661/clockware/okesdhowfzlfrupfrqks.jpg', NULL), (178, '2020-11-25 00:00:00', '10:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1606300687/clockware/rhbd8eqhokntieviuyae.jpg', NULL), (179, '2020-11-25 00:00:00', '10:00', 1, 1, 54, '', NULL), (180, '2020-12-04 00:00:00', '10:00', 1, 11, 26, '', NULL), (181, '2020-12-04 00:00:00', '10:00', 1, 11, 31, '', NULL), (182, '2020-12-09 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1607514926/clockware/wjmfb0bgozlqzot7x8jo.jpg', NULL), (183, '2020-12-17 00:00:00', '10:00', 1, 1, 54, 'https://res.cloudinary.com/kodevtm/image/upload/v1608219265/clockware/zqmzuze07n1uu7fbz5od.jpg', NULL), (184, '2020-12-18 00:00:00', '10:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1608284474/clockware/soy9zmqbwkt5pfwa4t9b.jpg', NULL), (185, '2020-12-18 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1608289632/clockware/gr4gmft5vix51l4q1ud7.jpg', NULL), (186, '2020-12-18 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1608289632/clockware/gr4gmft5vix51l4q1ud7.jpg', NULL), (187, '2020-12-22 00:00:00', '10:00', 2, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1608626200/clockware/cd6i9p3ctsu0lhm8vz5i.jpg', NULL), (188, '2020-12-22 00:00:00', '10:00', 2, 11, 31, 'https://res.cloudinary.com/kodevtm/image/upload/v1608626468/clockware/xr4or5dzoprm1noujf0y.jpg', NULL), (189, '2020-12-22 00:00:00', '10:00', 1, 11, 2, 'https://res.cloudinary.com/kodevtm/image/upload/v1608626539/clockware/jefuluzjwqkvpu9bdr9c.jpg', 3), (190, '2020-12-22 00:00:00', '15:00', 1, 11, 26, 'https://res.cloudinary.com/kodevtm/image/upload/v1608626691/clockware/zk6r08xcqu2ol5zhf7lp.jpg', 3); -- -------------------------------------------------------- -- -- Структура таблицы `reviews` -- CREATE TABLE `reviews` ( `id` int(11) NOT NULL, `review` text NOT NULL, `rating` int(11) NOT NULL, `masterId` int(11) DEFAULT NULL, `orderId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `reviews` -- INSERT INTO `reviews` (`id`, `review`, `rating`, `masterId`, `orderId`) VALUES (3, 'паппаапап', 5, 1, 148), (4, 'рпарпарпар', 1, 26, 120), (5, 'парароопраопрао парап ра\n апрпара\n парпара\n апрапр', 4, 1, 122), (6, 'рпраапр \nапрапрлдлрп\nарпарарап', 1, 26, 129), (7, 'апвапвапва\nвпвапыпфрор', 4, 1, 136), (9, 'ропо опроаллро\nпопопрао', 5, 31, 142), (10, 'пвапыв м\n\nравразапрар\n\nрдпр', 2, 28, 140), (11, 'првпарварвар\nапрпарпар\nпарапрпар\n', 5, 28, 131), (12, '', 4, 2, 132), (13, 'кке\nкекеке\nкекеке', 3, 2, 134), (14, 'еукгщешег\n кгушщгщешу\nгушкеещшкуе', 4, 28, 135), (15, 'варара\nпрпарпар\nпарпарапр\nпарпрпар', 4, 1, 137), (16, 'fsdfsdfsdf', 4, 28, 131), (17, 'adasdasd', 3, 1, NULL), (18, 'dede', 4, 31, 89), (19, 'dsdds', 2, 2, 91), (22, 'ewewe', 4, 31, 94), (23, 'weddwd', 4, 31, 95), (24, 'wewe', 5, 31, 96), (25, 'ававав', 2, 26, 98), (26, 'цуцуцуцу', 2, 2, 99), (27, 'ццкцук', 3, 2, 100), (28, 'ввцвуцв', 5, 26, 108), (29, '', 4, 31, 109), (30, 'куеуеук', 4, 31, 110), (31, 'неннглгшллбпро', 4, 1, 111), (32, '6кеннкирвр', 3, 26, 112), (33, 'вуцувсывсвы', 4, 26, 113), (34, 'парапрар', 4, 53, 150), (36, 'dsdsdsd', 5, 28, 128), (37, 'sasasas', 3, 1, 124), (38, 'Хороший отзыв о выполнении', 5, 26, 189), (39, 'Хороший отзыв', 5, 2, 166), (40, 'все отлично, спасибо', 5, 1, 174), (41, 'оценка отличная\nвсе просто супер!!!', 5, 31, 181), (42, '', 5, 31, 182); -- -------------------------------------------------------- -- -- Структура таблицы `tokens` -- CREATE TABLE `tokens` ( `id` int(11) NOT NULL, `token` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Структура таблицы `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `login` varchar(255) NOT NULL, `password` varchar(255) DEFAULT NULL, `salt` varchar(255) DEFAULT NULL, `status` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `clientId` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Дамп данных таблицы `users` -- INSERT INTO `users` (`id`, `login`, `password`, `salt`, `status`, `name`, `clientId`) VALUES (1, 'admin@example.com', '$2b$10$4vK4k0DxDJDr9A57AS.JleD0P9KUKTYA/t1lL3cBJVa5J0pET6KlC', '$2b$10$4vK4k0DxDJDr9A57AS.Jle', 'admin', 'ADMIN', NULL), (3, 'vasia@example.com', '$2b$10$89z8WxcjKZbUx6P2VZQVd.lhD5QLNe/dQAznC7FvZypvegyxAs8SK', '$2b$10$89z8WxcjKZbUx6P2VZQVd.', 'client', 'Vasia', NULL), (4, 'p.petia@example.com', '$2b$10$SPJJBpOAdLyT.AuPclhLkuZKAJZJwN4aDqzu3kTZUY6JrG0dXIEqe', '$2b$10$SPJJBpOAdLyT.AuPclhLku', 'client', 'Petia Petrov', NULL), (5, 'alex@example.com', '$2b$10$mee4JXJ60d0pZOACJ705C.hzJqwG60FBn0nmyI8QO1ih7Bp00/Esm', '$2b$10$mee4JXJ60d0pZOACJ705C.', 'client', 'Aleksey Ivanov', NULL), (6, 'roma@example.com', '$2b$10$KD26wZG3Pq2uKyYZ1LSUIuyu3ExAZ.SibA18gO8d0ZTQ1nXLhpIi6', '$2b$10$KD26wZG3Pq2uKyYZ1LSUIu', 'client', 'Roma', NULL); -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `cities` -- ALTER TABLE `cities` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `clients` -- ALTER TABLE `clients` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `masters` -- ALTER TABLE `masters` ADD PRIMARY KEY (`id`), ADD KEY `cityId` (`cityId`); -- -- Индексы таблицы `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`), ADD KEY `cityId` (`cityId`), ADD KEY `masterId` (`masterId`), ADD KEY `userId` (`userId`); -- -- Индексы таблицы `reviews` -- ALTER TABLE `reviews` ADD PRIMARY KEY (`id`), ADD KEY `masterId` (`masterId`), ADD KEY `orderId` (`orderId`); -- -- Индексы таблицы `tokens` -- ALTER TABLE `tokens` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD KEY `clientId` (`clientId`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `cities` -- ALTER TABLE `cities` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT для таблицы `clients` -- ALTER TABLE `clients` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT для таблицы `masters` -- ALTER TABLE `masters` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55; -- -- AUTO_INCREMENT для таблицы `orders` -- ALTER TABLE `orders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=191; -- -- AUTO_INCREMENT для таблицы `reviews` -- ALTER TABLE `reviews` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43; -- -- AUTO_INCREMENT для таблицы `tokens` -- ALTER TABLE `tokens` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT для таблицы `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- Ограничения внешнего ключа сохраненных таблиц -- -- -- Ограничения внешнего ключа таблицы `masters` -- ALTER TABLE `masters` ADD CONSTRAINT `masters_ibfk_1` FOREIGN KEY (`cityId`) REFERENCES `cities` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Ограничения внешнего ключа таблицы `orders` -- ALTER TABLE `orders` ADD CONSTRAINT `orders_ibfk_6422` FOREIGN KEY (`cityId`) REFERENCES `cities` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `orders_ibfk_6423` FOREIGN KEY (`masterId`) REFERENCES `masters` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `orders_ibfk_6424` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Ограничения внешнего ключа таблицы `reviews` -- ALTER TABLE `reviews` ADD CONSTRAINT `reviews_ibfk_309` FOREIGN KEY (`masterId`) REFERENCES `masters` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `reviews_ibfk_310` FOREIGN KEY (`orderId`) REFERENCES `orders` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Ограничения внешнего ключа таблицы `users` -- ALTER TABLE `users` ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`clientId`) REFERENCES `clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; 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 */;