sql
stringlengths
6
1.05M
select count(*) from nulls2 where string_7 glob '*123' 0
<filename>scholarship.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 12, 2019 at 08:36 AM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.11 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: `scholarship` -- DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `getscholarships` () select * from adminupload$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `userid` int(11) NOT NULL, `emailid` varchar(20) NOT NULL, `password` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`userid`, `emailid`, `password`) VALUES (1, '<PASSWORD>', 'ss'), (2, '<PASSWORD>', 'dk'); -- -------------------------------------------------------- -- -- Table structure for table `adminupload` -- CREATE TABLE `adminupload` ( `donid` int(11) NOT NULL, `title` varchar(50) NOT NULL, `eligibility` varchar(20) NOT NULL, `category` varchar(10) NOT NULL, `phone` int(20) NOT NULL, `emailid` varchar(30) NOT NULL, `link` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `adminupload` -- INSERT INTO `adminupload` (`donid`, `title`, `eligibility`, `category`, `phone`, `emailid`, `link`) VALUES (4, 'Monash University Alfred Research Alliance Honours', ' Bachelor of Science', 'Merit', 46565232, ' <EMAIL>', 'https://applicant.connect.mona'), (5, 'prerana', '10th', 'talent', 984532, '<EMAIL>', 'http://prerana.com'), (6, 'karepass', '10th or puc passed', 'mean based', 46565232, 'asdas@asdasd', 'asfafaf'), (7, 'epaas', '1oth', 'mean based', 987, 'la@g', 'asfafaf'), (8, 'vidhyadhan', 'puc', 'talent', 98745, 'vidya@g', 'sdfsf'), (9, 'colgate scholarship', 'engineering students', 'mean/ meri', 4587123, '<EMAIL>', 'http://colgate.in'), (10, 'prerana', '10th', 'mean based', 1122, 'gani@g', 'sdgsfdf'), (11, 'prerana', '10th', 'mean based', 1122, 'gani@g', 'sdgsfdf'), (12, 'prerana', '10th', 'mean based', 1122, 'gani@g', 'sdgsfdf'); -- -------------------------------------------------------- -- -- Table structure for table `application` -- CREATE TABLE `application` ( `appid` int(20) NOT NULL, `name` varchar(20) NOT NULL, `date` varchar(10) NOT NULL, `emailid` varchar(20) NOT NULL, `phone` int(20) NOT NULL, `gender` char(1) NOT NULL, `address` varchar(100) NOT NULL, `class10_max` int(5) NOT NULL, `class10_marks` int(5) NOT NULL, `class10_percent` float NOT NULL, `class12_max` int(5) NOT NULL, `class12_marks` int(5) NOT NULL, `class12_percent` float NOT NULL, `adhaar` int(20) NOT NULL, `income` varchar(20) NOT NULL, `caste` varchar(20) NOT NULL, `college` varchar(50) NOT NULL, `year` int(4) NOT NULL, `stream` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `application` -- INSERT INTO `application` (`appid`, `name`, `date`, `emailid`, `phone`, `gender`, `address`, `class10_max`, `class10_marks`, `class10_percent`, `class12_max`, `class12_marks`, `class12_percent`, `adhaar`, `income`, `caste`, `college`, `year`, `stream`) VALUES (5, '', '0000-00-00', '', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (7, 'dkkkkk', '2019-11-05', 'asdas@asdasde', 13, 'm', 'asdq', 12, 3, 4, 5, 6, 57, 1234, 'kj', 'ljhf', 'jhgt', 2006, 'cse'), (8, 'kd', '0000-00-00', 'asdas@asdasd', 12, '', 'asd', 1, 6, 7, 2, 3, 5, 123, 'gfh', 'fgh', 'ags', 2005, 'ise'), (9, 'deepak', '0000-00-00', 'asdas@asdasd', 455, '', 'fhd', 12, 15, 64, 45, 45, 4, 5, 'fdh', 'ghc', 'df', 2005, 'ggg'), (10, 'kdwww', '0000-00-00', 'asdas@asdasd', 12245, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (11, 'kdwww', '0000-00-00', 'asdas@asdasd', 12245, '', 'cvsds', 22, 55, 99, 55, 88, 77, 0, '98', '77', 'sss', 1999, 'unknown'), (12, 'kdwww', '0000-00-00', 'asdas@asdasd', 12245, '', 'efwe', 54, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (13, 'kdwww', '0000-00-00', 'asdas<EMAIL>', 12245, '', 'efwe', 54, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (14, 'de', '0000-00-00', 'asdas@asdasd', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (15, 'de', '0000-00-00', 'asdas@asdasd', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (16, 'de', '0000-00-00', 'asdas@asdasd', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (17, 'dkkkkk', '0000-00-00', 'asdas@asdasde', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (18, 'dkkkkk', '0000-00-00', 'asdas@asdasde', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (19, '', '0000-00-00', '', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (20, '', '0000-00-00', '', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (21, '', '0000-00-00', '', 0, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (22, 'dkkapse', '0000-00-00', 'dk@g', 12245, '', '', 444, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (23, 'sonu', '0000-00-00', 's@g', 987, '', 'asdwqe', 12, 10, 22, 14, 15, 66, 456, 'yui', 'jkl', 'bnm', 2006, 'ise'), (24, 'sonu', '0000-00-00', 's@g', 987, '', 'asdwqe', 12, 10, 22, 14, 15, 66, 456, 'yui', 'jkl', 'bnm', 2006, 'ise'), (41, 'sonudeepu', '', '<EMAIL>', 154, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (42, 'sonudeepu', '', '<EMAIL>', 154, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (43, 'sonudeepu', '', '<EMAIL>', 154, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (48, 'swati', '13/07/1999', '<EMAIL>', 2147483647, 'F', 'udgir', 77, 77, 76, 88, 84, 85, 125, 'rd', 'rd', 'sce', 2018, 'ise'), (49, 'swati', '13/07/1999', '<EMAIL>', 2147483647, 'F', 'udgir', 77, 77, 76, 88, 84, 85, 125, 'rd', 'rd', 'sce', 2018, 'ise'), (50, 'swati', '13/07/1999', '<EMAIL>', 2147483647, 'F', 'asdfadf', 77, 88, 99, 88, 77, 88, 456, 'rt', 'rt', 'ww', 2014, 'ise'), (51, '<NAME>', '', '<EMAIL>', 2147483647, 'M', 'adssf', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (52, 'ganesh', '21/09/2011', 'gani@g', 1122, 'M', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''), (53, 'sonudeepu', '', 'son<EMAIL>', 154, '', '', 0, 0, 0, 0, 0, 0, 0, '', '', '', 0, ''); -- -------------------------------------------------------- -- -- Table structure for table `applied` -- CREATE TABLE `applied` ( `appliedid` int(50) NOT NULL, `name` varchar(50) NOT NULL, `emailid` varchar(50) NOT NULL, `title` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `applied` -- INSERT INTO `applied` (`appliedid`, `name`, `emailid`, `title`) VALUES (1, 'sonu', 's@g', ''), (3, 'sonu', 's@g', ''), (4, 'sonu', 's@g', ''), (5, 'sonu', 's@g', ''), (6, 'laxmi', 'la@g', ''), (7, 'laxmi', 'la@g', ''), (8, 'laxmi', 'la@g', ''), (9, 'jjjjhhhh', 'ddkk@gg', ''), (10, 'jjjjhhhh', 'ddkk@gg', ''), (11, 'abcde', 'sa@gg', ''), (12, 'abcde', 'sa@gg', ''), (13, 'abcde', 'sa@gg', ''), (14, 'kapse', 'kapse@g', ''), (15, 'kapse', 'kapse@g', ''), (16, 'kapse', 'kapse@g', ''), (17, '', '', ''), (18, 'kapsek', '<EMAIL>', ''), (19, '', '', ''), (20, 'manasa', '<EMAIL>', 'epaas'), (21, 'manasa', '<EMAIL>', 'epaas'), (22, 'manasa', '<EMAIL>', 'epaas'), (23, 'manasa', '<EMAIL>', 'epaas'), (24, 'manasa', '<EMAIL>', 'epaas'), (25, 'krishna', 'k@g', 'epaas'), (26, 'kapse', 'kapse@g', ''), (27, 'kd', 'kd@g', 'prerana'), (28, 'kd', 'kd@g', 'prerana'), (30, 'kdd', 'kdd@g', 'loreal scholarship'), (31, '', '', ''), (32, 'manasa', 'm@g', 'sch'), (33, 'swati', '<EMAIL>', 'karepass'), (34, 'swati', '<EMAIL>', 'karepass'), (35, 'swati', '<EMAIL>', 'karepass'), (36, '<NAME>', '<EMAIL>', ''), (37, 'ganesh', 'gani@g', 'loreal schp'), (38, 'sonu', '<EMAIL>', 'epaas'), (39, 'sonu', '<EMAIL>', 'epaas'), (40, 'sonu', '<EMAIL>', 'epaas'), (41, 'sonu', '<EMAIL>', 'epaas'); -- -------------------------------------------------------- -- -- Table structure for table `register` -- CREATE TABLE `register` ( `userid` int(11) NOT NULL, `username` varchar(20) NOT NULL, `phoneno` int(10) NOT NULL, `emailid` varchar(20) NOT NULL, `password` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `register` -- INSERT INTO `register` (`userid`, `username`, `phoneno`, `emailid`, `password`) VALUES (1, 'brew', 251, 'wn@g', 'we'), (2, 'brew', 251, 'wn@g', 'we'), (3, '', 0, '', ''), (4, 'deepak', 2147483647, 'kd@g', 'kd'), (5, 'deepak', 2147483647, 'kd@g', 'kd'), (6, 'wq', 9845, 'asd@g', 'asd'), (7, 'sonu', 777, 'sonu@g', '777'), (8, 'ww', 47, 'as@g', '13'), (9, 'as', 48, 'aw@g', '22'), (10, 'student', 121, 'asd@g', 'asd'), (11, 'deepak', 1212, '<EMAIL>', 'deepak'), (55, 'sd', 44, '<EMAIL>', 'sd'), (56, 'amar', 123, 'amar@g', 'amar'), (57, 'amar', 123, 'amar@g', 'amar'), (58, 'sonu', 111, 'sonu@g', 'sonu'); -- -- Triggers `register` -- DELIMITER $$ CREATE TRIGGER `backup` AFTER INSERT ON `register` FOR EACH ROW INSERT INTO register_backup VALUES (null,NEW.username,NEW.phoneno,NEW.emailid,NEW.password) $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `register_backup` -- CREATE TABLE `register_backup` ( `userid` int(10) NOT NULL, `username` varchar(255) NOT NULL, `phoneno` int(255) NOT NULL, `emailid` varchar(255) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `register_backup` -- INSERT INTO `register_backup` (`userid`, `username`, `phoneno`, `emailid`, `password`) VALUES (1, 'sd', 44, '<EMAIL>', 'sd'), (2, 'amar', 123, 'amar@g', 'amar'), (3, 'amar', 123, '<EMAIL>', '<PASSWORD>'), (4, 'sonu', 111, 'sonu@g', '<PASSWORD>'); -- -------------------------------------------------------- -- -- Table structure for table `studenttest` -- CREATE TABLE `studenttest` ( `stdid` int(50) NOT NULL, `name` varchar(30) NOT NULL, `title` varchar(100) NOT NULL, `college` varchar(100) NOT NULL, `year` int(5) NOT NULL, `amount` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `studenttest` -- INSERT INTO `studenttest` (`stdid`, `name`, `title`, `college`, `year`, `amount`) VALUES (2, 'sonu', 'epaas', 'bms', 2019, 0), (3, 'dkapse', 'asvf', 'bnm', 5000, 0), (5, 'abcd', 'asd', 'ise', 2001, 5000); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`userid`); -- -- Indexes for table `adminupload` -- ALTER TABLE `adminupload` ADD PRIMARY KEY (`donid`); -- -- Indexes for table `application` -- ALTER TABLE `application` ADD PRIMARY KEY (`appid`); -- -- Indexes for table `applied` -- ALTER TABLE `applied` ADD PRIMARY KEY (`appliedid`); -- -- Indexes for table `register` -- ALTER TABLE `register` ADD PRIMARY KEY (`userid`); -- -- Indexes for table `register_backup` -- ALTER TABLE `register_backup` ADD PRIMARY KEY (`userid`); -- -- Indexes for table `studenttest` -- ALTER TABLE `studenttest` ADD PRIMARY KEY (`stdid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `adminupload` -- ALTER TABLE `adminupload` MODIFY `donid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `application` -- ALTER TABLE `application` MODIFY `appid` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54; -- -- AUTO_INCREMENT for table `applied` -- ALTER TABLE `applied` MODIFY `appliedid` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42; -- -- AUTO_INCREMENT for table `register` -- ALTER TABLE `register` MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59; -- -- AUTO_INCREMENT for table `register_backup` -- ALTER TABLE `register_backup` MODIFY `userid` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>delucca-workspaces/data<filename>warehouse/models/data_marts/okr/staging/stg_analytics__key_result_progress_record.sql with src_analytics__key_result_progress_record as ( select * from {{ source('conformed', 'analytics__key_result_progress_record') }} ), final as ( select id::uuid, key_result_id::uuid, key_result_check_in_id::uuid, date::timestamp, progress::float, created_at::timestamp, updated_at::timestamp from src_analytics__key_result_progress_record ) select * from final
CREATE TABLE nifipeople ( loginuuid STRING , gender STRING ,nametitle STRING ,namefirst STRING ,namelast STRING ,locationstreetnumber INT ,locationstreetname STRING ,locationcity STRING ,locationstate STRING ,locationcountry STRING ,locationpostcode INT ,locationcoordinateslatitude DOUBLE ,locationcoordinateslongitude DOUBLE ,locationtimezoneoffset STRING ,locationtimezonedescription STRING ,email STRING ,loginusername STRING ,loginpassword STRING ,loginsalt STRING ,loginmd5 STRING ,loginsha1 STRING ,loginsha256 STRING ,dobdate STRING ,dobage INT ,registereddate STRING ,registeredage INT ,phone STRING ,cell STRING ,idname STRING ,idvalue STRING ,picturelarge STRING ,picturemedium STRING ,picturethumbnail STRING ,nat STRING ,PRIMARY KEY (loginuuid) ) PARTITION BY HASH PARTITIONS 4 STORED AS KUDU TBLPROPERTIES ('kudu.num_tablet_replicas' = '1');
select name, type from gcp.gcp_dns_record_set where name = 'dummy-{{ resourceName }}'
<reponame>nenadnoveljic/tpt-oracle<gh_stars>100-1000 -- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com -- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions. alter session set events '&1 trace name context off'; alter session set tracefile_identifier=CLEANUP; host ssh2 oracle@solaris01 "rm &trc" --host ssh2 oracle@solaris01 "rm `echo &trc | sed 's/_CLEANUP//'`"
<gh_stars>1-10 update user_account set user_type = 'ldap'; update user_account set user_type = 'system' where eppn = 'creator'; update user_account set user_type = 'system' where eppn = 'system';
<gh_stars>0 select distinct TAXON_I D from NCBI_SEQS_TAXONS order by taxon_id select count(*) from TAXONS select * from taxons order by id select name from prok_groups where GROUP_CRITER_ID = 0 order by name
/* A wrapper around pg_stat_activity to enable session, blocking lock, etc monitoring by the non-superuser pgwatch2 role. Assumes a role has been created named pgwatch2 */ CREATE OR REPLACE FUNCTION public.get_stat_activity() RETURNS SETOF pg_stat_activity AS $$ select * from pg_stat_activity where datname = current_database() $$ LANGUAGE sql VOLATILE SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION public.get_stat_activity() FROM PUBLIC; GRANT EXECUTE ON FUNCTION public.get_stat_activity() TO pgwatch2; COMMENT ON FUNCTION public.get_stat_activity() IS 'created for pgwatch2';
<gh_stars>0 /* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 100314 Source Host : localhost:3306 Source Schema : travel_db Target Server Type : MySQL Target Server Version : 100314 File Encoding : 65001 Date: 13/08/2019 18:53:09 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for booking -- ---------------------------- DROP TABLE IF EXISTS `booking`; CREATE TABLE `booking` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(10) UNSIGNED NOT NULL, `holiday_id` int(10) UNSIGNED NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, INDEX `booking_holiday_id_foreign`(`holiday_id`) USING BTREE, INDEX `booking_user_id_foreign`(`user_id`) USING BTREE, CONSTRAINT `booking_holiday_id_foreign` FOREIGN KEY (`holiday_id`) REFERENCES `holidays` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `booking_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of booking -- ---------------------------- INSERT INTO `booking` VALUES (7, 1, 7, '2019-07-29', '2019-09-27', '2019-08-12 10:21:52', '2019-08-13 10:43:59'); INSERT INTO `booking` VALUES (8, 1, 8, '2019-09-03', '2019-09-19', '2019-08-12 10:25:34', '2019-08-12 15:18:01'); INSERT INTO `booking` VALUES (10, 1, 10, '2019-05-06', '2019-09-20', '2019-08-12 15:19:23', '2019-08-12 18:25:46'); INSERT INTO `booking` VALUES (13, 1, 13, '2019-08-26', '2019-09-26', '2019-08-12 18:34:09', '2019-08-13 03:53:12'); INSERT INTO `booking` VALUES (14, 1, 14, '2019-09-02', '2019-09-24', '2019-08-12 18:41:55', '2019-08-13 03:53:03'); INSERT INTO `booking` VALUES (15, 5, 6, '2019-08-06', '2019-08-13', '2019-08-13 02:57:53', '2019-08-13 02:57:53'); INSERT INTO `booking` VALUES (17, 1, 17, '2019-08-02', '2019-09-20', '2019-08-13 03:54:14', '2019-08-13 03:57:31'); INSERT INTO `booking` VALUES (18, 7, 6, '2019-08-10', '2019-09-27', '2019-08-13 10:40:43', '2019-08-13 10:40:43'); INSERT INTO `booking` VALUES (19, 1, 55, '2019-08-22', '2019-09-27', '2019-08-13 10:43:16', '2019-08-13 10:43:16'); -- ---------------------------- -- Table structure for holidays -- ---------------------------- DROP TABLE IF EXISTS `holidays`; CREATE TABLE `holidays` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `location_id` int(10) UNSIGNED NOT NULL, `wifi` tinyint(1) NOT NULL, `hotel` tinyint(1) NOT NULL, `car_rental` tinyint(1) NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, INDEX `holidays_location_id_foreign`(`location_id`) USING BTREE, CONSTRAINT `holidays_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB AUTO_INCREMENT = 206 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of holidays -- ---------------------------- INSERT INTO `holidays` VALUES (1, 'China Holiday', '<NAME>', 1, 0, 0, 0, '2019-08-11 18:25:25', '2019-08-11 18:25:25'); INSERT INTO `holidays` VALUES (3, 'Javan holiday', 'japan ciy', 7, 1, 0, 0, '2019-08-11 18:26:34', '2019-08-12 08:43:04'); INSERT INTO `holidays` VALUES (5, 'Emlynne', 'Jiapeng', 41, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (6, 'Derby', 'Haapsalu', 87, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (7, 'Donaugh', 'Mir', 158, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (8, 'Thia', 'Cumaná', 27, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (9, 'Cleveland', 'Tianjiazhuang', 16, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (10, 'Rube', 'São Caetano do Sul', 33, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (11, 'Gennifer', 'Maracaju', 27, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (12, 'Conn', 'Mondokan', 160, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (13, 'Joseito', 'Beringovskiy', 33, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (14, 'Clemmy', 'Piedra Blanca', 131, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (15, 'Park', 'Nam Đàn', 136, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (16, 'Kingston', 'Conel', 80, 1, 1, 1, NULL, '2019-08-13 04:33:42'); INSERT INTO `holidays` VALUES (17, 'Shandy', 'Tielu', 139, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (18, 'Lilli', 'Valuyki', 170, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (19, 'Sibyl', 'Jingpeng', 62, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (20, 'Davie', 'Lima', 167, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (21, 'Jamil', 'Chornukhyne', 170, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (22, 'Fair', 'Šumperk', 27, 0, 0, 1, NULL, '2019-08-13 04:33:52'); INSERT INTO `holidays` VALUES (23, 'Boycey', 'Mubende', 106, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (24, 'Rea', '<NAME>', 27, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (25, 'Bel', 'Photharam', 136, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (26, 'Abbie', 'Fernandópolis', 111, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (27, 'Clare', 'Capitán Bado', 69, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (28, 'Jsandye', 'Poputnaya', 187, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (29, 'Almeda', 'Zbraslavice', 43, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (30, 'Rasia', 'Sidomulyo', 52, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (31, 'Fletch', 'Lantang', 177, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (32, 'Reid', 'Wenci', 134, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (33, 'Edsel', 'Jiangkou', 137, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (34, 'Kendricks', 'Limoeiro do Norte', 27, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (35, 'Augustine', 'Sunan', 28, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (36, 'Nat', 'Wates', 194, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (37, 'Rosalie', '<NAME>', 81, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (38, 'Luigi', 'Babakanjaya', 52, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (39, 'Daffie', 'Marne-la-Vallée', 148, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (40, 'Elonore', 'Sumbergebang', 200, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (41, 'Alon', 'Wailebe', 180, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (42, 'Arther', '<NAME>', 30, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (43, 'Avril', 'Ledeunu', 60, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (44, 'Travis', 'Nihommatsu', 192, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (45, 'Berty', 'Guimarães', 195, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (46, 'Napoleon', 'Yangping', 125, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (47, 'Natalina', 'Dīvāndarreh', 178, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (48, 'Ann', 'Wan’an', 87, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (49, 'Klaus', 'Shuanglong', 98, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (50, 'Lennard', 'Orléans', 131, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (51, 'Alejoa', 'Macau', 139, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (52, 'Jessy', 'Juliaca', 88, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (53, 'Kayla', 'Ciasna', 183, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (54, 'Silvia', 'Nong Khai', 106, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (55, 'Leonard', 'Wahawaha', 29, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (56, 'Lorine', 'Taman', 57, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (57, 'Corina', 'Mekarsari', 179, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (58, 'Aili', 'Oebaki', 149, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (59, 'Gerri', 'Opatów', 48, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (60, 'Mag', 'Daba', 17, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (61, 'Jemmie', 'Runan', 44, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (62, 'Vidovik', 'Slobodnica', 149, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (63, 'Aubrey', 'Ban Lam Luk Ka', 149, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (64, 'Yelena', 'Skhodnya', 188, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (65, 'Arden', 'Hongde', 18, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (66, 'Valentia', 'Sabadell', 123, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (67, 'Debbi', 'Örebro', 47, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (68, 'Nomi', 'Kuanghe', 33, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (69, 'Susanna', 'Arjona', 116, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (70, 'Anthony', 'Pensacola', 60, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (71, 'Yevette', 'Lancai', 105, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (72, 'Desmund', '<NAME>', 73, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (73, 'Clemmie', 'Sacramento', 163, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (74, 'Mirilla', 'Ciduren', 16, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (75, 'Alyda', 'Pita', 128, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (76, 'Benedikt', 'Sinegor\'ye', 77, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (77, 'Elka', 'Nogoonnuur', 93, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (78, 'Alethea', 'Uchkulan', 154, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (79, 'Rossie', 'Zaplavnoye', 193, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (80, 'Sarah11', 'Log', 68, 1, 1, 0, NULL, '2019-08-13 10:39:00'); INSERT INTO `holidays` VALUES (81, 'Lynnea', 'Pérama', 36, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (82, 'Daveen', '<NAME>', 72, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (83, 'Bernetta', 'Diavatós', 164, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (84, 'Stacy', 'Neochóri', 61, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (85, 'Dita', 'Borås', 87, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (86, 'Isidoro', 'Al Ḩajar al Aswad', 19, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (87, 'Oralie', 'Jinsheng', 41, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (88, 'Carce', 'Taramana', 146, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (89, 'Meg', '<NAME>', 99, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (90, 'Barbey', 'Niort', 136, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (91, 'Maison', 'Alegre', 102, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (92, 'Ody', 'Kalinkavichy', 54, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (93, 'Calvin', '<NAME>', 138, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (94, 'Heather', 'Ḩajjah', 71, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (95, 'Johannes', 'Lucheng', 189, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (96, 'Anett', 'Dijon', 116, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (97, 'Livy', 'Yuanqiao', 69, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (98, 'Rriocard', 'Torkanivka', 118, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (99, 'Elspeth', 'Tyresö', 84, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (100, 'Riannon', 'Hrvatini', 17, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (101, 'Trina', 'Gorzkowice', 29, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (102, 'Carmita', 'Yurla', 130, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (103, 'Nada', 'Brumadinho', 184, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (104, 'Paige', 'Viçosa', 106, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (105, 'Gerrilee', 'Shuiting', 149, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (106, 'Maggy', 'Sindanghayu', 53, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (107, 'Dietrich', 'Cimişlia', 165, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (108, 'Shell', 'Zvenyhorodka', 90, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (109, 'Cleavland', 'Shuanglu', 64, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (110, 'Persis', 'Caringin', 114, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (111, 'Valerye', 'Maevatanana', 96, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (112, 'Carey', 'Bertoua', 160, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (113, 'Sue', 'Gadzhiyevo', 21, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (114, 'Morton', 'Skrzyszów', 19, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (115, 'Shandeigh', 'La Laja', 190, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (116, 'Bradly', 'Uzda', 18, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (117, 'Roland', 'Rancabungur', 108, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (118, 'Judye', 'Aranos', 156, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (119, 'Robin', 'Gadang', 148, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (120, 'Laurence', 'Chashnikovo', 26, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (121, 'Jody', 'Bromma', 80, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (122, 'Hazel', 'Bualu', 89, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (123, 'Hakim', 'Battle Creek', 27, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (124, 'Cristionna', 'Meiyao', 137, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (125, 'Jessey', 'Nema', 13, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (126, 'Marne', 'Heping', 168, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (127, 'Virgie', 'Vyborg', 190, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (128, 'Verla', 'Cravinhos', 146, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (129, 'Andi', '<NAME>ia', 51, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (130, 'Foster', 'Pirajuí', 146, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (131, 'Olva', 'Krzemieniewo', 189, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (132, 'Gerri', 'Pingshui', 200, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (133, 'Jerrylee', 'Clearwater', 44, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (134, 'Angelo', 'Suizhou', 85, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (135, 'Marie', 'Ladhewāla Warāich', 122, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (136, 'Alisun', 'Vilque', 132, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (137, 'Urbain', 'Gaohu', 155, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (138, 'Edmon', 'Calimita', 129, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (139, 'Cynthia', 'Smålandsstenar', 93, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (140, 'Lancelot', 'Penghu', 170, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (141, 'Riva', 'Marne-la-Vallée', 192, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (142, 'Axe', 'Amiens', 193, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (143, 'Carmella', 'Sechenovo', 134, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (144, 'Bond', 'Mełgiew', 49, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (145, 'Babs', 'Baro', 141, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (146, 'Darcy', 'Shumyachi', 57, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (147, 'Trueman', 'Hongqi', 190, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (148, 'Marcel', 'Mława', 65, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (149, 'Lizbeth', 'Pines', 124, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (150, 'Alberta', 'Uijeongbu-si', 52, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (151, 'Alysia', '<NAME>', 144, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (152, 'Hedy', 'Koktokay', 79, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (153, 'Kilian', 'Krajan Atas Suger Lor', 191, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (154, 'Der', '<NAME>', 169, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (155, 'Gerhard', 'Topchikha', 52, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (156, 'Nolana', 'Ilhabela', 75, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (157, 'Leroi', 'Depok', 74, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (158, 'Billie', 'At-Bashi', 69, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (159, 'Bette-ann', 'Lianyi', 178, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (160, 'Brunhilde', 'Jiaoshanhe', 82, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (161, 'Gasper', 'Hengduo', 166, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (162, 'Jelene', 'Saskylakh', 196, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (163, 'Hunt', 'Sukatani', 129, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (164, 'Isiahi', 'Sipirok', 163, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (165, 'Jeramie', 'Doropeti', 163, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (166, 'Shurlocke', 'Cuevas', 54, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (167, 'Rudie', 'Sutton', 184, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (168, 'Roby', 'Datian', 120, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (169, 'Cati', 'Manacsac', 200, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (170, 'Donal', 'Podujeva', 187, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (171, 'Franky', 'Dalkey', 51, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (172, 'Rennie', 'Granja', 193, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (173, 'Emlynne', '<NAME>', 77, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (174, 'Emelina', 'Ouyang', 13, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (175, 'Gracie', 'Torino', 157, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (176, 'Vinita', 'Brasília', 137, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (177, 'Sharlene', 'Presidente Bernardes', 140, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (178, 'Kelcie', 'Bunog', 172, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (179, 'Darnell', '<NAME>', 186, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (180, 'Mata', 'Croix', 180, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (181, 'Tomasine', 'Non Narai', 125, 1, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (182, 'Rikki', 'Curitiba', 146, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (183, 'Trenton', 'Pasirgaru', 24, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (184, 'Rochell', 'Mauloo', 39, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (185, 'Lucienne', 'Longhe', 39, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (186, 'Simeon', 'Salt Lake City', 176, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (187, 'Thayne', '<NAME>', 130, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (188, 'Trish', 'Asen', 10, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (189, 'Iolande', 'Huya', 185, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (190, 'Collie', 'Sainyabuli', 107, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (191, 'Simon', 'Makbon', 74, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (192, 'Annalise', 'Al Fayyūm', 167, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (193, 'Patricia', 'Isdalstø', 14, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (194, 'Mae', 'Budy', 186, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (195, 'Barbara-anne', 'Novopavlovsk', 149, 0, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (196, 'Kippar', 'Nglego', 192, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (197, 'Waylin', 'Kawengan', 6, 0, 1, 1, NULL, NULL); INSERT INTO `holidays` VALUES (198, 'Johna', 'Ḩabīl ar Raydah', 132, 0, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (199, 'Juli', 'Daqin Tal', 55, 0, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (200, 'Nikki', 'Datarkadu', 125, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (201, 'Diana', 'Muktāgācha', 23, 1, 0, 1, NULL, NULL); INSERT INTO `holidays` VALUES (202, 'Moira', 'Saint Louis', 88, 1, 1, 0, NULL, NULL); INSERT INTO `holidays` VALUES (203, 'Arron', 'Volta Redonda', 165, 1, 0, 0, NULL, NULL); INSERT INTO `holidays` VALUES (204, 'Tasha', 'Oyonnax', 100, 1, 0, 1, NULL, NULL); -- ---------------------------- -- Table structure for locations -- ---------------------------- DROP TABLE IF EXISTS `locations`; CREATE TABLE `locations` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 261 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of locations -- ---------------------------- INSERT INTO `locations` VALUES (1, 'China', '2019-08-11 18:14:13', '2019-08-11 18:14:13'); INSERT INTO `locations` VALUES (2, 'Japan', '2019-08-11 18:14:25', '2019-08-11 18:14:25'); INSERT INTO `locations` VALUES (6, 'Afghanistan', NULL, NULL); INSERT INTO `locations` VALUES (7, 'Africa', NULL, NULL); INSERT INTO `locations` VALUES (8, 'Albania', NULL, NULL); INSERT INTO `locations` VALUES (9, 'Algeria', NULL, NULL); INSERT INTO `locations` VALUES (10, 'American Samoa', NULL, NULL); INSERT INTO `locations` VALUES (11, 'Andorra', NULL, NULL); INSERT INTO `locations` VALUES (12, 'Angola', NULL, NULL); INSERT INTO `locations` VALUES (13, 'Antigua and Barbuda', NULL, NULL); INSERT INTO `locations` VALUES (14, 'Arab World', NULL, NULL); INSERT INTO `locations` VALUES (15, 'Argentina', NULL, NULL); INSERT INTO `locations` VALUES (16, 'Armenia', NULL, NULL); INSERT INTO `locations` VALUES (17, 'Aruba', NULL, NULL); INSERT INTO `locations` VALUES (18, 'Australia', NULL, NULL); INSERT INTO `locations` VALUES (19, 'Austria', NULL, NULL); INSERT INTO `locations` VALUES (20, 'Azerbaijan', NULL, NULL); INSERT INTO `locations` VALUES (21, 'Bahamas, The', NULL, NULL); INSERT INTO `locations` VALUES (22, 'Bahrain', NULL, NULL); INSERT INTO `locations` VALUES (23, 'Bangladesh', NULL, NULL); INSERT INTO `locations` VALUES (24, 'Barbados', NULL, NULL); INSERT INTO `locations` VALUES (25, 'Belarus', NULL, NULL); INSERT INTO `locations` VALUES (26, 'Belgium', NULL, NULL); INSERT INTO `locations` VALUES (27, 'Belize', NULL, NULL); INSERT INTO `locations` VALUES (28, 'Benin', NULL, NULL); INSERT INTO `locations` VALUES (29, 'Bermuda', NULL, NULL); INSERT INTO `locations` VALUES (30, 'Bhutan', NULL, NULL); INSERT INTO `locations` VALUES (31, 'Bolivia', NULL, NULL); INSERT INTO `locations` VALUES (32, 'Bosnia and Herzegovina', NULL, NULL); INSERT INTO `locations` VALUES (33, 'Botswana', NULL, NULL); INSERT INTO `locations` VALUES (34, 'Brazil', NULL, NULL); INSERT INTO `locations` VALUES (35, 'Brunei Darussalam', NULL, NULL); INSERT INTO `locations` VALUES (36, 'Bulgaria', NULL, NULL); INSERT INTO `locations` VALUES (37, 'Burkina Faso', NULL, NULL); INSERT INTO `locations` VALUES (38, 'Burundi', NULL, NULL); INSERT INTO `locations` VALUES (39, 'Cabo Verde', NULL, NULL); INSERT INTO `locations` VALUES (40, 'Cambodia', NULL, NULL); INSERT INTO `locations` VALUES (41, 'Cameroon', NULL, NULL); INSERT INTO `locations` VALUES (42, 'Canada', NULL, NULL); INSERT INTO `locations` VALUES (43, 'Caribbean small states', NULL, NULL); INSERT INTO `locations` VALUES (44, 'Cayman Islands', NULL, NULL); INSERT INTO `locations` VALUES (45, 'Central African Republic', NULL, NULL); INSERT INTO `locations` VALUES (46, 'Chad', NULL, NULL); INSERT INTO `locations` VALUES (47, 'Channel Islands', NULL, NULL); INSERT INTO `locations` VALUES (48, 'Chile', NULL, NULL); INSERT INTO `locations` VALUES (49, 'China', NULL, NULL); INSERT INTO `locations` VALUES (50, 'Colombia', NULL, NULL); INSERT INTO `locations` VALUES (51, 'Comoros', NULL, NULL); INSERT INTO `locations` VALUES (52, 'Congo, Dem. Rep.', NULL, NULL); INSERT INTO `locations` VALUES (53, 'Congo, Rep.', NULL, NULL); INSERT INTO `locations` VALUES (54, 'Costa Rica', NULL, NULL); INSERT INTO `locations` VALUES (55, 'Cote d\'Ivoire', NULL, NULL); INSERT INTO `locations` VALUES (56, 'Croatia', NULL, NULL); INSERT INTO `locations` VALUES (57, 'Cuba', NULL, NULL); INSERT INTO `locations` VALUES (58, 'Curacao', NULL, NULL); INSERT INTO `locations` VALUES (59, 'Cyprus', NULL, NULL); INSERT INTO `locations` VALUES (60, 'Czech Republic', NULL, NULL); INSERT INTO `locations` VALUES (61, 'Denmark', NULL, NULL); INSERT INTO `locations` VALUES (62, 'Djibouti', NULL, NULL); INSERT INTO `locations` VALUES (63, 'Dominican Republic', NULL, NULL); INSERT INTO `locations` VALUES (64, 'Dominica', NULL, NULL); INSERT INTO `locations` VALUES (65, 'East Asia & Pacific (all income levels)', NULL, NULL); INSERT INTO `locations` VALUES (66, 'East Asia & Pacific (developing only)', NULL, NULL); INSERT INTO `locations` VALUES (67, 'East Asia and the Pacific (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (68, 'Ecuador', NULL, NULL); INSERT INTO `locations` VALUES (69, 'Egypt, Arab Rep.', NULL, NULL); INSERT INTO `locations` VALUES (70, 'El Salvador', NULL, NULL); INSERT INTO `locations` VALUES (71, 'Equatorial Guinea', NULL, NULL); INSERT INTO `locations` VALUES (72, 'Eritrea', NULL, NULL); INSERT INTO `locations` VALUES (73, 'Estonia', NULL, NULL); INSERT INTO `locations` VALUES (74, 'Ethiopia', NULL, NULL); INSERT INTO `locations` VALUES (75, 'Euro area', NULL, NULL); INSERT INTO `locations` VALUES (76, 'Europe & Central Asia (all income levels)', NULL, NULL); INSERT INTO `locations` VALUES (77, 'Europe & Central Asia (developing only)', NULL, NULL); INSERT INTO `locations` VALUES (78, 'Europe and Central Asia (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (79, 'European Union', NULL, NULL); INSERT INTO `locations` VALUES (80, 'Faeroe Islands', NULL, NULL); INSERT INTO `locations` VALUES (81, 'Fiji', NULL, NULL); INSERT INTO `locations` VALUES (82, 'Finland', NULL, NULL); INSERT INTO `locations` VALUES (83, 'France', NULL, NULL); INSERT INTO `locations` VALUES (84, 'French Polynesia', NULL, NULL); INSERT INTO `locations` VALUES (85, 'Gabon', NULL, NULL); INSERT INTO `locations` VALUES (86, 'Gambia, The', NULL, NULL); INSERT INTO `locations` VALUES (87, 'Georgia', NULL, NULL); INSERT INTO `locations` VALUES (88, 'Germany', NULL, NULL); INSERT INTO `locations` VALUES (89, 'Ghana', NULL, NULL); INSERT INTO `locations` VALUES (90, 'Greece', NULL, NULL); INSERT INTO `locations` VALUES (91, 'Greenland', NULL, NULL); INSERT INTO `locations` VALUES (92, 'Grenada', NULL, NULL); INSERT INTO `locations` VALUES (93, 'Guam', NULL, NULL); INSERT INTO `locations` VALUES (94, 'Guatemala', NULL, NULL); INSERT INTO `locations` VALUES (95, 'Guinea-Bissau', NULL, NULL); INSERT INTO `locations` VALUES (96, 'Guinea', NULL, NULL); INSERT INTO `locations` VALUES (97, 'Guyana', NULL, NULL); INSERT INTO `locations` VALUES (98, 'Haiti', NULL, NULL); INSERT INTO `locations` VALUES (99, 'Heavily indebted poor countries (HIPC)', NULL, NULL); INSERT INTO `locations` VALUES (100, 'High income: nonOECD', NULL, NULL); INSERT INTO `locations` VALUES (101, 'High income: OECD', NULL, NULL); INSERT INTO `locations` VALUES (102, 'High income', NULL, NULL); INSERT INTO `locations` VALUES (103, 'Honduras', NULL, NULL); INSERT INTO `locations` VALUES (104, 'Hong Kong SAR, China', NULL, NULL); INSERT INTO `locations` VALUES (105, 'Hungary', NULL, NULL); INSERT INTO `locations` VALUES (106, 'Iceland', NULL, NULL); INSERT INTO `locations` VALUES (107, 'India', NULL, NULL); INSERT INTO `locations` VALUES (108, 'Indonesia', NULL, NULL); INSERT INTO `locations` VALUES (109, 'Iran, Islamic Rep.', NULL, NULL); INSERT INTO `locations` VALUES (110, 'Iraq', NULL, NULL); INSERT INTO `locations` VALUES (111, 'Ireland', NULL, NULL); INSERT INTO `locations` VALUES (112, 'Isle of Man', NULL, NULL); INSERT INTO `locations` VALUES (113, 'Israel', NULL, NULL); INSERT INTO `locations` VALUES (114, 'Italy', NULL, NULL); INSERT INTO `locations` VALUES (115, 'Jamaica', NULL, NULL); INSERT INTO `locations` VALUES (116, 'Japan', NULL, NULL); INSERT INTO `locations` VALUES (117, 'Jordan', NULL, NULL); INSERT INTO `locations` VALUES (118, 'Kazakhstan', NULL, NULL); INSERT INTO `locations` VALUES (119, 'Kenya', NULL, NULL); INSERT INTO `locations` VALUES (120, 'Kiribati', NULL, NULL); INSERT INTO `locations` VALUES (121, 'Korea, Dem. Rep.', NULL, NULL); INSERT INTO `locations` VALUES (122, 'Korea, Rep.', NULL, NULL); INSERT INTO `locations` VALUES (123, 'Kosovo', NULL, NULL); INSERT INTO `locations` VALUES (124, 'Kuwait', NULL, NULL); INSERT INTO `locations` VALUES (125, 'Kyrgyz Republic', NULL, NULL); INSERT INTO `locations` VALUES (126, 'Lao PDR', NULL, NULL); INSERT INTO `locations` VALUES (127, 'Latin America & Caribbean (all income levels)', NULL, NULL); INSERT INTO `locations` VALUES (128, 'Latin America & Caribbean (developing only)', NULL, NULL); INSERT INTO `locations` VALUES (129, 'Latin America and the Caribbean (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (130, 'Latvia', NULL, NULL); INSERT INTO `locations` VALUES (131, 'Least developed countries: UN classification', NULL, NULL); INSERT INTO `locations` VALUES (132, 'Lebanon', NULL, NULL); INSERT INTO `locations` VALUES (133, 'Lesotho', NULL, NULL); INSERT INTO `locations` VALUES (134, 'Liberia', NULL, NULL); INSERT INTO `locations` VALUES (135, 'Libya', NULL, NULL); INSERT INTO `locations` VALUES (136, 'Liechtenstein', NULL, NULL); INSERT INTO `locations` VALUES (137, 'Lithuania', NULL, NULL); INSERT INTO `locations` VALUES (138, 'Low & middle income', NULL, NULL); INSERT INTO `locations` VALUES (139, 'Low income', NULL, NULL); INSERT INTO `locations` VALUES (140, 'Lower middle income', NULL, NULL); INSERT INTO `locations` VALUES (141, 'Luxembourg', NULL, NULL); INSERT INTO `locations` VALUES (142, 'Macao SAR, China', NULL, NULL); INSERT INTO `locations` VALUES (143, 'Macedonia, FYR', NULL, NULL); INSERT INTO `locations` VALUES (144, 'Madagascar', NULL, NULL); INSERT INTO `locations` VALUES (145, 'Malawi', NULL, NULL); INSERT INTO `locations` VALUES (146, 'Malaysia', NULL, NULL); INSERT INTO `locations` VALUES (147, 'Maldives', NULL, NULL); INSERT INTO `locations` VALUES (148, 'Mali', NULL, NULL); INSERT INTO `locations` VALUES (149, 'Malta', NULL, NULL); INSERT INTO `locations` VALUES (150, 'Marshall Islands', NULL, NULL); INSERT INTO `locations` VALUES (151, 'Mauritania', NULL, NULL); INSERT INTO `locations` VALUES (152, 'Mauritius', NULL, NULL); INSERT INTO `locations` VALUES (153, 'Mexico', NULL, NULL); INSERT INTO `locations` VALUES (154, 'Micronesia, Fed. Sts.', NULL, NULL); INSERT INTO `locations` VALUES (155, 'Middle East & North Africa (all income levels)', NULL, NULL); INSERT INTO `locations` VALUES (156, 'Middle East & North Africa (developing only)', NULL, NULL); INSERT INTO `locations` VALUES (157, 'Middle East and North Africa (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (158, 'Middle income', NULL, NULL); INSERT INTO `locations` VALUES (159, 'Moldova', NULL, NULL); INSERT INTO `locations` VALUES (160, 'Monaco', NULL, NULL); INSERT INTO `locations` VALUES (161, 'Mongolia', NULL, NULL); INSERT INTO `locations` VALUES (162, 'Montenegro', NULL, NULL); INSERT INTO `locations` VALUES (163, 'Morocco', NULL, NULL); INSERT INTO `locations` VALUES (164, 'Mozambique', NULL, NULL); INSERT INTO `locations` VALUES (165, 'Myanmar', NULL, NULL); INSERT INTO `locations` VALUES (166, 'Namibia', NULL, NULL); INSERT INTO `locations` VALUES (167, 'Nepal', NULL, NULL); INSERT INTO `locations` VALUES (168, 'Netherlands', NULL, NULL); INSERT INTO `locations` VALUES (169, 'New Caledonia', NULL, NULL); INSERT INTO `locations` VALUES (170, 'New Zealand', NULL, NULL); INSERT INTO `locations` VALUES (171, 'Nicaragua', NULL, NULL); INSERT INTO `locations` VALUES (172, 'Nigeria', NULL, NULL); INSERT INTO `locations` VALUES (173, 'Niger', NULL, NULL); INSERT INTO `locations` VALUES (174, 'North Africa', NULL, NULL); INSERT INTO `locations` VALUES (175, 'North America', NULL, NULL); INSERT INTO `locations` VALUES (176, 'Northern Mariana Islands', NULL, NULL); INSERT INTO `locations` VALUES (177, 'Norway', NULL, NULL); INSERT INTO `locations` VALUES (178, 'OECD members', NULL, NULL); INSERT INTO `locations` VALUES (179, 'Oman', NULL, NULL); INSERT INTO `locations` VALUES (180, 'Other small states', NULL, NULL); INSERT INTO `locations` VALUES (181, 'Pacific island small states', NULL, NULL); INSERT INTO `locations` VALUES (182, 'Pakistan', NULL, NULL); INSERT INTO `locations` VALUES (183, 'Palau', NULL, NULL); INSERT INTO `locations` VALUES (184, 'Panama', NULL, NULL); INSERT INTO `locations` VALUES (185, 'Papua New Guinea', NULL, NULL); INSERT INTO `locations` VALUES (186, 'Paraguay', NULL, NULL); INSERT INTO `locations` VALUES (187, 'Peru', NULL, NULL); INSERT INTO `locations` VALUES (188, 'Philippines', NULL, NULL); INSERT INTO `locations` VALUES (189, 'Poland', NULL, NULL); INSERT INTO `locations` VALUES (190, 'Portugal', NULL, NULL); INSERT INTO `locations` VALUES (191, 'Puerto Rico', NULL, NULL); INSERT INTO `locations` VALUES (192, 'Qatar', NULL, NULL); INSERT INTO `locations` VALUES (193, 'Romania', NULL, NULL); INSERT INTO `locations` VALUES (194, 'Russian Federation', NULL, NULL); INSERT INTO `locations` VALUES (195, 'Rwanda', NULL, NULL); INSERT INTO `locations` VALUES (196, 'Samoa', NULL, NULL); INSERT INTO `locations` VALUES (197, 'San Marino', NULL, NULL); INSERT INTO `locations` VALUES (198, 'Sao Tome and Principe', NULL, NULL); INSERT INTO `locations` VALUES (199, 'Saudi Arabia', NULL, NULL); INSERT INTO `locations` VALUES (200, 'Senegal', NULL, NULL); INSERT INTO `locations` VALUES (201, 'Serbia', NULL, NULL); INSERT INTO `locations` VALUES (202, 'Seychelles', NULL, NULL); INSERT INTO `locations` VALUES (203, 'Sierra Leone', NULL, NULL); INSERT INTO `locations` VALUES (204, 'Singapore', NULL, NULL); INSERT INTO `locations` VALUES (205, 'Sint Maarten (Dutch part)', NULL, NULL); INSERT INTO `locations` VALUES (206, 'Slovak Republic', NULL, NULL); INSERT INTO `locations` VALUES (207, 'Slovenia', NULL, NULL); INSERT INTO `locations` VALUES (208, 'Small states', NULL, NULL); INSERT INTO `locations` VALUES (209, 'Solomon Islands', NULL, NULL); INSERT INTO `locations` VALUES (210, 'Somalia', NULL, NULL); INSERT INTO `locations` VALUES (211, 'South Africa', NULL, NULL); INSERT INTO `locations` VALUES (212, 'South Asia (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (213, 'South Asia', NULL, NULL); INSERT INTO `locations` VALUES (214, 'South Sudan', NULL, NULL); INSERT INTO `locations` VALUES (215, 'Spain', NULL, NULL); INSERT INTO `locations` VALUES (216, 'Sri Lanka', NULL, NULL); INSERT INTO `locations` VALUES (217, 'St. Kitts and Nevis', NULL, NULL); INSERT INTO `locations` VALUES (218, 'St. Lucia', NULL, NULL); INSERT INTO `locations` VALUES (219, 'St. Martin (French part)', NULL, NULL); INSERT INTO `locations` VALUES (220, 'St. Vincent and the Grenadines', NULL, NULL); INSERT INTO `locations` VALUES (221, 'Sub-Saharan Africa (all income levels)', NULL, NULL); INSERT INTO `locations` VALUES (222, 'Sub-Saharan Africa (developing only)', NULL, NULL); INSERT INTO `locations` VALUES (223, 'Sub-Saharan Africa (IFC classification)', NULL, NULL); INSERT INTO `locations` VALUES (224, 'Sub-Saharan Africa excluding South Africa and Nigeria', NULL, NULL); INSERT INTO `locations` VALUES (225, 'Sub-Saharan Africa excluding South Africa', NULL, NULL); INSERT INTO `locations` VALUES (226, 'Sudan', NULL, NULL); INSERT INTO `locations` VALUES (227, 'Suriname', NULL, NULL); INSERT INTO `locations` VALUES (228, 'Swaziland', NULL, NULL); INSERT INTO `locations` VALUES (229, 'Sweden', NULL, NULL); INSERT INTO `locations` VALUES (230, 'Switzerland', NULL, NULL); INSERT INTO `locations` VALUES (231, 'Syrian Arab Republic', NULL, NULL); INSERT INTO `locations` VALUES (232, 'Tajikistan', NULL, NULL); INSERT INTO `locations` VALUES (233, 'Tanzania', NULL, NULL); INSERT INTO `locations` VALUES (234, 'Thailand', NULL, NULL); INSERT INTO `locations` VALUES (235, 'Timor-Leste', NULL, NULL); INSERT INTO `locations` VALUES (236, 'Togo', NULL, NULL); INSERT INTO `locations` VALUES (237, 'Tonga', NULL, NULL); INSERT INTO `locations` VALUES (238, 'Trinidad and Tobago', NULL, NULL); INSERT INTO `locations` VALUES (239, 'Tunisia', NULL, NULL); INSERT INTO `locations` VALUES (240, 'Turkey', NULL, NULL); INSERT INTO `locations` VALUES (241, 'Turkmenistan', NULL, NULL); INSERT INTO `locations` VALUES (242, 'Turks and Caicos Islands', NULL, NULL); INSERT INTO `locations` VALUES (243, 'Tuvalu', NULL, NULL); INSERT INTO `locations` VALUES (244, 'Uganda', NULL, NULL); INSERT INTO `locations` VALUES (245, 'Ukraine', NULL, NULL); INSERT INTO `locations` VALUES (246, 'United Arab Emirates', NULL, NULL); INSERT INTO `locations` VALUES (247, 'United Kingdom', NULL, NULL); INSERT INTO `locations` VALUES (248, 'United States', NULL, NULL); INSERT INTO `locations` VALUES (249, 'Upper middle income', NULL, NULL); INSERT INTO `locations` VALUES (250, 'Uruguay', NULL, NULL); INSERT INTO `locations` VALUES (251, 'Uzbekistan', NULL, NULL); INSERT INTO `locations` VALUES (252, 'Vanuatu', NULL, NULL); INSERT INTO `locations` VALUES (253, 'Venezuela, RB', NULL, NULL); INSERT INTO `locations` VALUES (254, 'Vietnam', NULL, NULL); INSERT INTO `locations` VALUES (255, 'Virgin Islands (U.S.)', NULL, NULL); INSERT INTO `locations` VALUES (256, 'West Bank and Gaza', NULL, NULL); INSERT INTO `locations` VALUES (257, 'World', NULL, NULL); INSERT INTO `locations` VALUES (258, 'Yemen, Rep.', NULL, NULL); INSERT INTO `locations` VALUES (259, 'Zambia', NULL, NULL); INSERT INTO `locations` VALUES (260, 'Zimbabwe', NULL, '2019-08-13 10:40:15'); -- ---------------------------- -- Table structure for migrations -- ---------------------------- DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of migrations -- ---------------------------- INSERT INTO `migrations` VALUES (1, '2014_10_12_000000_create_users_table', 1); INSERT INTO `migrations` VALUES (2, '2014_10_12_100000_create_password_resets_table', 1); INSERT INTO `migrations` VALUES (4, '2019_08_11_133940_create_permission_tables', 3); INSERT INTO `migrations` VALUES (5, '2019_08_11_180629_location_table', 4); INSERT INTO `migrations` VALUES (6, '2019_08_11_113758_holiday_table', 5); INSERT INTO `migrations` VALUES (12, '2019_08_11_192904_booking_table', 6); -- ---------------------------- -- Table structure for model_has_permissions -- ---------------------------- DROP TABLE IF EXISTS `model_has_permissions`; CREATE TABLE `model_has_permissions` ( `permission_id` int(10) UNSIGNED NOT NULL, `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL, PRIMARY KEY (`permission_id`, `model_id`, `model_type`) USING BTREE, INDEX `model_has_permissions_model_id_model_type_index`(`model_id`, `model_type`) USING BTREE, CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for model_has_roles -- ---------------------------- DROP TABLE IF EXISTS `model_has_roles`; CREATE TABLE `model_has_roles` ( `role_id` int(10) UNSIGNED NOT NULL, `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `model_id` bigint(20) UNSIGNED NOT NULL, PRIMARY KEY (`role_id`, `model_id`, `model_type`) USING BTREE, INDEX `model_has_roles_model_id_model_type_index`(`model_id`, `model_type`) USING BTREE, CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of model_has_roles -- ---------------------------- INSERT INTO `model_has_roles` VALUES (1, 'App\\Models\\BackpackUser', 1); INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\BackpackUser', 1); INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\BackpackUser', 2); INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\BackpackUser', 5); INSERT INTO `model_has_roles` VALUES (2, 'App\\Models\\BackpackUser', 7); -- ---------------------------- -- Table structure for password_resets -- ---------------------------- DROP TABLE IF EXISTS `password_resets`; CREATE TABLE `password_resets` ( `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, INDEX `password_resets_email_index`(`email`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for permissions -- ---------------------------- DROP TABLE IF EXISTS `permissions`; CREATE TABLE `permissions` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of permissions -- ---------------------------- INSERT INTO `permissions` VALUES (1, 'manage_holiday', 'web', '2019-08-11 13:47:35', '2019-08-11 13:47:35'); INSERT INTO `permissions` VALUES (2, 'manage_user', 'web', '2019-08-11 13:48:05', '2019-08-11 13:48:05'); INSERT INTO `permissions` VALUES (3, 'booking', 'web', '2019-08-11 13:58:03', '2019-08-11 13:58:03'); INSERT INTO `permissions` VALUES (4, 'manage_location', 'backpack', '2019-08-13 03:59:11', '2019-08-13 03:59:11'); -- ---------------------------- -- Table structure for role_has_permissions -- ---------------------------- DROP TABLE IF EXISTS `role_has_permissions`; CREATE TABLE `role_has_permissions` ( `permission_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL, PRIMARY KEY (`permission_id`, `role_id`) USING BTREE, INDEX `role_has_permissions_role_id_foreign`(`role_id`) USING BTREE, CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of role_has_permissions -- ---------------------------- INSERT INTO `role_has_permissions` VALUES (1, 1); INSERT INTO `role_has_permissions` VALUES (2, 1); INSERT INTO `role_has_permissions` VALUES (3, 2); INSERT INTO `role_has_permissions` VALUES (4, 1); -- ---------------------------- -- Table structure for roles -- ---------------------------- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `guard_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of roles -- ---------------------------- INSERT INTO `roles` VALUES (1, 'admin', 'web', '2019-08-11 13:43:22', '2019-08-11 13:43:22'); INSERT INTO `roles` VALUES (2, 'user', 'web', '2019-08-11 13:43:30', '2019-08-11 13:43:30'); -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp(0) NULL DEFAULT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, `created_at` timestamp(0) NULL DEFAULT NULL, `updated_at` timestamp(0) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `users_email_unique`(`email`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of users -- ---------------------------- INSERT INTO `users` VALUES (1, 'Admin', '<EMAIL>', NULL, '$2y$10$WfqFuDnXc4RO30MwfyFEXebMTNxU8enckVGI4DNk883.0giLTHVG.', 'HVMBpXdtGe9bohV1R8Sq2d92l1jLc7VIMAhLbwdAZ1RrOcbcpZRCRnikBLwv', '2019-08-11 10:02:58', '2019-08-11 13:52:23'); INSERT INTO `users` VALUES (2, 'testUser', '<EMAIL>', NULL, '$2y$10$nLvV7DHdbkZ4BXpNWjDC3OfLVkORJLXQA.85gzJWHdb5SmFBcwtVq', NULL, '2019-08-11 13:49:14', '2019-08-11 17:50:30'); INSERT INTO `users` VALUES (5, 'SuperDev', '<EMAIL>', NULL, '$2y$10$tHtPABwrAnZrB4l/AyPDGu2eFsFbkkZVNZ.5kQwyk/sjtxZZgw18S', '1fHcBvLPasWHnJ4D22aZp5qnziJ3xQqbsepNFEIXDSrEnXtubxxdclRRh1Pn', '2019-08-12 12:23:05', '2019-08-13 03:58:06'); INSERT INTO `users` VALUES (7, 'anywhere111', '<EMAIL>', NULL, '$2y$10$XOJv5yDn4OQEECy6eAwaOOkgL78EU0T1ZTEJHxQDY04LvSB96eWQm', NULL, '2019-08-13 10:38:19', '2019-08-13 10:38:28'); SET FOREIGN_KEY_CHECKS = 1;
<reponame>Scout2012/Hospital-Patient-System DROP SCHEMA IF EXISTS DocOffice; CREATE SCHEMA IF NOT EXISTS DocOffice; SET FOREIGN_KEY_CHECKS=0; -- Definition of table 'DEPARTMENT' CREATE TABLE IF NOT EXISTS DocOffice.DEPARTMENT ( departmentId INT NOT NULL, name VARCHAR(50), PRIMARY KEY (departmentId) ); -- Definition of table 'SPECIALTY' CREATE TABLE IF NOT EXISTS DocOffice.SPECIALTY ( specialtyId INT NOT NULL AUTO_INCREMENT, specialtyName VARCHAR(50) NULL, PRIMARY KEY (specialtyID) ); -- Definition of table 'DOCTOR' CREATE TABLE IF NOT EXISTS DocOffice.DOCTOR ( doctorId VARCHAR(08) NOT NULL, lastName VARCHAR(50) NULL, firstName VARCHAR(50) NULL, gender VARCHAR(10) NULL, specialtyId INT NULL, departmentId INT NOT NULL, phoneNumber VARCHAR(10) NULL, email VARCHAR(50) NULL, streetAddress VARCHAR(100) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip INT NULL, PRIMARY KEY (doctorId), CONSTRAINT FK_Doctor_Specialty FOREIGN KEY (specialtyId) REFERENCES DocOffice.SPECIALTY (specialtyId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_Doctor_Department FOREIGN KEY (departmentId) REFERENCES DocOffice.DEPARTMENT (departmentId) ON DELETE NO ACTION ON UPDATE NO ACTION ); -- Definition of table 'PATIENT' CREATE TABLE IF NOT EXISTS DocOffice.PATIENT( patientID INT NOT NULL AUTO_INCREMENT, careProvider VARCHAR(20) NULL, ssn VARCHAR(09) NULL, lastName VARCHAR(50) NULL, firstName VARCHAR(50) NULL, gender VARCHAR(10) NULL, dateOfBirth DATE NULL, phoneNumber VARCHAR(10) NULL, email VARCHAR(50) NULL, streetAddress VARCHAR(100) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip INT NULL, PRIMARY KEY (patientId) ); -- Definition of table 'TREATMENT' or PATIENT HAS TEST/PRESCRIPTION AKA PatientVisits -- Primary Key has multiple because in one day: -- Patient can see multiple doctors -- Doctors can see multiple patients -- Patients can recieve more than one test (Tests/Prescriptions) CREATE TABLE IF NOT EXISTS DocOffice.TREATMENT ( patientID INT NOT NULL, doctorID VARCHAR(08) NOT NULL, test_ID INT NOT NULL, medicine_ID INT NOT NULL, appointmentDate DATE NOT NULL, PRIMARY KEY (patientID, doctorID, test_ID, appointmentDate), CONSTRAINT FK_TREATMENT_HAS_PATIENT FOREIGN KEY (patientID) REFERENCES DocOffice.PATIENT (patientId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_TREATMENT_HAS_DOCTOR FOREIGN KEY (doctorID) REFERENCES DocOffice.DOCTOR (doctorID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_PATIENT_HAS_TEST FOREIGN KEY (test_ID) REFERENCES DocOffice.TEST (test_ID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_PATIENT_HAS_MEDICINE FOREIGN KEY (medicine_ID) REFERENCES DocOffice.PRESCRIPTION (medicine_ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); -- Definition of table 'PRESCRIPTION' CREATE TABLE IF NOT EXISTS DocOffice.PRESCRIPTION ( medicine_ID INT NOT NULL, dosage INT NULL, medName VARCHAR(50) NULL, medPrice FLOAT NULL, PRIMARY KEY (medicine_ID) ); -- Definition of table 'TEST' CREATE TABLE IF NOT EXISTS DocOffice.TEST ( test_ID INT NOT NULL, testName VARCHAR(50) NULL, testPrice FLOAT NULL, PRIMARY KEY (test_ID) ); -- Definition of table 'APPOINTMENT' -- UNUSED, but may be implemented in the future CREATE TABLE IF NOT EXISTS DocOffice.APPOINTMENT ( appointmentTime datetime NOT NULL, medical_reason VARCHAR(50) NULL, startTime DATETIME NULL, endTime DATETIME NULL, location VARCHAR(50) NULL ); -- Definition of table 'AUDIT_TABLE' CREATE TABLE IF NOT EXISTS DocOffice.AUDIT_TABLE ( doctorFirstName VARCHAR(50) NULL, actionType VARCHAR(10) NULL, specialtyName VARCHAR(50) NULL, dateOfModification DATE NULL ); SET FOREIGN_KEY_CHECKS=1; -- Question 6 -- Create trigger on the DoctorSpeciality so that every time a doctor specialty is -- updated or added, a new entry is made in the audit table. The audit table will -- have the following (Hint-The trigger will be on DoctorSpecialty table). DELIMITER $$ CREATE TRIGGER DocOffice.Doctor_Specialty_Insert AFTER INSERT ON DocOffice.DOCTOR FOR EACH ROW BEGIN SET @date := CURDATE(); SET @specialtyName := (SELECT specialtyName FROM DocOffice.SPECIALTY WHERE specialtyId = new.specialtyId); INSERT INTO DocOffice.AUDIT_TABLE (doctorFirstName, actionType, specialtyName, dateOfModification) VALUES(new.firstName, "Added", @specialtyName, @date); END$$ CREATE TRIGGER DocOffice.Doctor_Specialty_Update AFTER UPDATE ON DocOffice.DOCTOR FOR EACH ROW BEGIN SET @date := CURDATE(); SET @specialtyName := (SELECT specialtyName FROM DocOffice.SPECIALTY WHERE specialtyId = new.specialtyId); INSERT INTO DocOffice.AUDIT_TABLE (doctorFirstName, actionType, specialtyName, dateOfModification) VALUES(new.firstName, "Update", @specialtyName, @date); END$$ DELIMITER ; -- Insert Specalities INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(100, 'Pediatrics'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(101, 'Surgery'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(102, 'Dermatology'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(103, 'Gynaecology'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(104, 'Neurology'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(105, 'Cardiology'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(106, 'Radiology'); INSERT INTO DocOffice.SPECIALTY (specialtyId, specialtyName) VALUES(107, 'Endocrinology'); -- Insert Departments INSERT INTO DocOffice.DEPARTMENT (departmentId, name) VALUES(1234, 'Fullerton'); INSERT INTO DocOffice.DEPARTMENT (departmentId, name) VALUES(2468, 'Huntington Beach'); INSERT INTO DocOffice.DEPARTMENT (departmentId, name) VALUES(1357, 'New York'); INSERT INTO DocOffice.DEPARTMENT (departmentId, name) VALUES(0987, 'San Antonio'); INSERT INTO DocOffice.DEPARTMENT (departmentId, name) VALUES(5678, 'San Francisco'); -- Insert Doctors INSERT INTO DocOffice.DOCTOR (doctorId, lastName, firstName, gender, specialtyId, departmentId, phoneNumber, email, streetAddress, city, state, zip) VALUES('LO0001','Bishop','Louise','Female',100,1234,7141231234,'<EMAIL>','123 Taco Ave.', 'Fullerton', 'CA', 92831); INSERT INTO DocOffice.DOCTOR (doctorId, lastName, firstName, gender, specialtyId, departmentId, phoneNumber, email, streetAddress, city, state, zip) VALUES('GE0002','Graham','Gene','Male',103,1357,2121231234,'<EMAIL>','123 West St.', 'New York', 'NY', 10036); INSERT INTO DocOffice.DOCTOR (doctorId, lastName, firstName, gender, specialtyId, departmentId, phoneNumber, email, streetAddress, city, state, zip) VALUES('RO0003','Belkin','Rob','Male',107,5678,4081231234,'Rob.Belkin2<EMAIL>','123 Great Ave.', 'San Francisco', 'CA', 94016); INSERT INTO DocOffice.DOCTOR (doctorId, lastName, firstName, gender, departmentId, phoneNumber, email, streetAddress, city, state, zip) VALUES('TO0004','Clark','Tom','Male',5678,4081234567,'<EMAIL>','534 Fish Ct.', 'San Francisco', 'CA', 94016); INSERT INTO DocOffice.DOCTOR (doctorId, lastName, firstName, gender, departmentId, phoneNumber, email, streetAddress, city, state, zip) VALUES('JA0005','Thompson','Janet','Female',1234,6571231234,'<EMAIL>','242 Salad Ave.', 'Fullerton', 'CA', 92830); -- Insert Patients INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000001,'All Care',123111234,'Cruise','Tom','Male','1962-07-03',2136481934,'<EMAIL>','123 W St.', 'Beverly Hills', 'CA', 90035); INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000002,'Sunrise Care',123765234,'Demuro','Doug','Male','1988-05-22',2128478234,'<EMAIL>','5412 E Way', 'Beverly Hills', 'CA', 90035); INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000003,'GCare',176511234,'Spears','Britmey','Female','1981-12-02',2132939134,'<EMAIL>','1234 Diamond Ave.', 'Austin', 'TX', 73301); INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000004,'Health R Us',123123234,'Williams','Serena','Female','1981-09-26',2343131234,'<EMAIL>','123 Kool Ave.', 'Fullerton','CA', 92831); INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000005,'<NAME>',123386924,'Colbert','Stephen','Male','1964-05-13',2132383134,'<EMAIL>','753 Limbo Ave.', 'Queens', 'NY', 11365); INSERT INTO DocOffice.PATIENT (patientID, careProvider, ssn, lastName, firstName, gender, dateOfBirth, phoneNumber, email, streetAddress, city, state, zip) VALUES(100000006,'Hit Health',123386953,'Goytiaa','Clarissa','Female','1998-04-13',2343132234,'<EMAIL>','123 Kool Ave.', 'Fullerton', 'CA', 92831); -- Insert Prescription INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10001, 200, 'Acetaminophen', 149.99); INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10002, 500, 'Adderall', 649.99); INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10003, 40, 'Clindamycin', 130.99); INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10004, 450, 'Amoxicillin', 599.99); INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10005, 20, 'Ibuprofen', 1.99); INSERT INTO DocOffice.PRESCRIPTION (medicine_ID, dosage, medName, medPrice) VALUES(10006, 600, 'Panadol', 132.99); -- Insert Tests INSERT INTO DocOffice.TEST (test_ID, testName, testPrice) VALUES(20001, 'Blood Test', 500.00); INSERT INTO DocOffice.TEST (test_ID, testName, testPrice) VALUES(20002, 'X-ray', 2200.00); INSERT INTO DocOffice.TEST (test_ID, testName, testPrice) VALUES(20003, 'Biospy', 2540.00); INSERT INTO DocOffice.TEST (test_ID, testName, testPrice) VALUES(20004, 'Liver Functions Test', 1231.00); INSERT INTO DocOffice.TEST (test_ID, testName, testPrice) VALUES(20005, 'Gyn-Routine Check Up', 350.00); -- Insert Treatments INSERT INTO DocOffice.TREATMENT (patientID, doctorID, test_ID, medicine_ID, appointmentDate) VALUES(100000001,'RO0003',20003,10001,'2019-09-05'); INSERT INTO DocOffice.TREATMENT (patientID, doctorID, test_ID, medicine_ID, appointmentDate) VALUES(100000005,'RO0003',20001,10002,'2019-11-23'); INSERT INTO DocOffice.TREATMENT (patientID, doctorID, test_ID, medicine_ID, appointmentDate) VALUES(100000004,'GE0002',20005,10004,'2019-01-13'); INSERT INTO DocOffice.TREATMENT (patientID, doctorID, test_ID, medicine_ID, appointmentDate) VALUES(100000002,'LO0001',20002,10003,'2019-05-07'); INSERT INTO DocOffice.TREATMENT (patientID, doctorID, test_ID, medicine_ID, appointmentDate) VALUES(100000003,'TO0004',20004,10006,'2019-09-12'); -- Update Doctor Specialty UPDATE DocOffice.DOCTOR SET specialtyId = 104 WHERE doctorId = 'LO0001'; -- Question 2 -- Doctor <NAME> is retiring. We need to inform all his patients, and ask them to -- select a new doctor. For this purpose, Create a VIEW that finds the names and -- phone numbers of all of Rob's patients. DROP VIEW IF EXISTS DocOffice.ROB_PATIENTS; CREATE VIEW DocOffice.ROB_PATIENTS AS SELECT firstName, lastName, phoneNumber FROM DocOffice.PATIENT WHERE patientID IN ( SELECT patientID FROM DocOffice.TREATMENT WHERE doctorID IN ( SELECT doctorID FROM DocOffice.DOCTOR WHERE firstName = "Rob" AND lastName = "Belkin" ) ); SELECT * FROM DocOffice.ROB_PATIENTS; -- Question 3 -- Create a view which has First Names, Last Names of all doctors who gave out -- prescription for Panadol. DROP VIEW IF EXISTS DocOffice.PANADOL_PRESCRIPTION; CREATE VIEW DocOffice.PANADOL_PRESCRIPTION AS SELECT firstName, lastName FROM DocOffice.DOCTOR WHERE doctorID IN ( SELECT doctorID FROM DocOffice.TREATMENT WHERE medicine_ID IN ( SELECT medicine_ID FROM DocOffice.PRESCRIPTION WHERE medName = 'Panadol' ) ); SELECT * FROM DocOffice.PANADOL_PRESCRIPTION; -- Question 4 -- Create a view which shows the First Name and Last name of all doctors and their -- specialty’s. DROP VIEW IF EXISTS DocOffice.DOCTORS_AND_SPECIALTIES; CREATE VIEW DocOffice.DOCTORS_AND_SPECIALTIES AS SELECT firstName, lastName, specialtyName FROM DocOffice.DOCTOR, DocOffice.SPECIALTY WHERE DocOffice.DOCTOR.specialtyID = DocOffice.SPECIALTY.specialtyID; SELECT * FROM DocOffice.DOCTORS_AND_SPECIALTIES; -- Question 5 -- Modify the view created in Q4 to show the First Name and Last name of all -- doctors and their specialties ALSO include doctors who DO NOT have any -- specialty. ALTER VIEW DocOffice.DOCTORS_AND_SPECIALTIES AS SELECT firstName, lastName, specialtyName FROM DocOffice.DOCTOR LEFT JOIN DocOffice.SPECIALTY ON DOCTOR.specialtyID = DocOffice.SPECIALTY.specialtyID; SELECT * FROM DocOffice.DOCTORS_AND_SPECIALTIES; -- 7. Create a script to do the following (Write the script for this) -- a. If first time backup take backup of all the tables -- b. If not the first time remove the previous backup tables and take new -- backups. DROP SCHEMA IF EXISTS DocTableBackUp; CREATE SCHEMA IF NOT EXISTS DocTableBackUp; -- INSERT INTO DocTableBackUp SELECT * from DocTableBackUp; -- ^ Wish this would work, only works on tables not database and without mysqldumps: DROP SCHEMA IF EXISTS DocTableBackUp; CREATE SCHEMA IF NOT EXISTS DocTableBackUp; SET FOREIGN_KEY_CHECKS=0; -- Definition of table 'DEPARTMENT' CREATE TABLE IF NOT EXISTS DocTableBackUp.DEPARTMENT ( departmentId INT NOT NULL, name VARCHAR(50), PRIMARY KEY (departmentId) ); -- Definition of table 'SPECIALTY' CREATE TABLE IF NOT EXISTS DocTableBackUp.SPECIALTY ( specialtyId INT NOT NULL AUTO_INCREMENT, specialtyName VARCHAR(50) NULL, PRIMARY KEY (specialtyID) ); -- Definition of table 'DOCTOR' CREATE TABLE IF NOT EXISTS DocTableBackUp.DOCTOR ( doctorId VARCHAR(08) NOT NULL, lastName VARCHAR(50) NULL, firstName VARCHAR(50) NULL, gender VARCHAR(10) NULL, specialtyId INT NULL, departmentId INT NOT NULL, phoneNumber VARCHAR(10) NULL, email VARCHAR(50) NULL, streetAddress VARCHAR(100) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip INT NULL, PRIMARY KEY (doctorId), CONSTRAINT FK_Doctor_Specialty FOREIGN KEY (specialtyId) REFERENCES DocTableBackUp.SPECIALTY (specialtyId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_Doctor_Department FOREIGN KEY (departmentId) REFERENCES DocTableBackUp.DEPARTMENT (departmentId) ON DELETE NO ACTION ON UPDATE NO ACTION ); -- Definition of table 'PATIENT' CREATE TABLE IF NOT EXISTS DocTableBackUp.PATIENT( patientID INT NOT NULL AUTO_INCREMENT, careProvider VARCHAR(20) NULL, ssn VARCHAR(09) NULL, lastName VARCHAR(50) NULL, firstName VARCHAR(50) NULL, gender VARCHAR(10) NULL, dateOfBirth DATE NULL, phoneNumber VARCHAR(10) NULL, email VARCHAR(50) NULL, streetAddress VARCHAR(100) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip INT NULL, PRIMARY KEY (patientId) ); -- Definition of table 'TREATMENT' or PATIENT HAS TEST/PRESCRIPTION AKA PatientVisits -- Primary Key has multiple because in one day: -- Patient can see multiple doctors -- Doctors can see multiple patients -- Patients can recieve more than one test (Tests/Prescriptions) CREATE TABLE IF NOT EXISTS DocTableBackUp.TREATMENT ( patientID INT NOT NULL, doctorID VARCHAR(08) NOT NULL, test_ID INT NOT NULL, medicine_ID INT NOT NULL, appointmentDate DATE NOT NULL, PRIMARY KEY (patientID, doctorID, test_ID, appointmentDate), CONSTRAINT FK_TREATMENT_HAS_PATIENT FOREIGN KEY (patientID) REFERENCES DocTableBackUp.PATIENT (patientId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_TREATMENT_HAS_DOCTOR FOREIGN KEY (doctorID) REFERENCES DocTableBackUp.DOCTOR (doctorID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_PATIENT_HAS_TEST FOREIGN KEY (test_ID) REFERENCES DocTableBackUp.TEST (test_ID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_PATIENT_HAS_MEDICINE FOREIGN KEY (medicine_ID) REFERENCES DocTableBackUp.PRESCRIPTION (medicine_ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); -- Definition of table 'PRESCRIPTION' CREATE TABLE IF NOT EXISTS DocTableBackUp.PRESCRIPTION ( medicine_ID INT NOT NULL, dosage INT NULL, medName VARCHAR(50) NULL, medPrice FLOAT NULL, PRIMARY KEY (medicine_ID) ); -- Definition of table 'TEST' CREATE TABLE IF NOT EXISTS DocTableBackUp.TEST ( test_ID INT NOT NULL, testName VARCHAR(50) NULL, testPrice FLOAT NULL, PRIMARY KEY (test_ID) ); -- Definition of table 'APPOINTMENT' -- UNUSED, but may be implemented in the future CREATE TABLE IF NOT EXISTS DocTableBackUp.APPOINTMENT ( appointmentTime datetime NOT NULL, medical_reason VARCHAR(50) NULL, startTime DATETIME NULL, endTime DATETIME NULL, location VARCHAR(50) NULL ); -- Definition of table 'AUDIT_TABLE' CREATE TABLE IF NOT EXISTS DocTableBackUp.AUDIT_TABLE ( doctorFirstName VARCHAR(50) NULL, actionType VARCHAR(10) NULL, specialtyName VARCHAR(50) NULL, dateOfModification DATE NULL ); SET FOREIGN_KEY_CHECKS=1; -- Copy data from DocOffice Schema to DocTableBackup INSERT INTO DocTableBackUp.DEPARTMENT SELECT * FROM DocOffice.DEPARTMENT; INSERT INTO DocTableBackUp.SPECIALTY SELECT * FROM DocOffice.SPECIALTY; INSERT INTO DocTableBackUp.DOCTOR SELECT * FROM DocOffice.DOCTOR; INSERT INTO DocTableBackUp.PATIENT SELECT * FROM DocOffice.PATIENT; INSERT INTO DocTableBackUp.PRESCRIPTION SELECT * FROM DocOffice.PRESCRIPTION; INSERT INTO DocTableBackUp.TEST SELECT * FROM DocOffice.TEST; INSERT INTO DocTableBackUp.TREATMENT SELECT * FROM DocOffice.TREATMENT; INSERT INTO DocTableBackUp.AUDIT_TABLE SELECT * FROM DocOffice.AUDIT_TABLE; DELIMITER $$ CREATE PROCEDURE DocOffice.FullertonPersc() BEGIN SELECT COUNT(*), medName FROM DocOffice.TREATMENT tr JOIN DocOffice.PRESCRIPTION pr ON tr.medicine_ID = pr.medicine_ID JOIN DocOffice.PATIENT pa ON pa.patientID = tr.patientID GROUP BY medName HAVING sum(pa.city = 'Fullerton') > 0; END$$ DELIMITER ; CALL DocOffice.FullertonPersc;
<reponame>Naimcse56/ecommerce -- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Aug 07, 2018 at 11:11 PM -- Server version: 10.1.16-MariaDB -- PHP Version: 7.0.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ecom` -- -- -------------------------------------------------------- -- -- 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, '2018_08_07_113516_create_tbl_admin_table', 1), (2, '2018_08_07_191150_create_tbl_category_table', 2); -- -------------------------------------------------------- -- -- Table structure for table `tbl_admin` -- CREATE TABLE `tbl_admin` ( `admin_id` int(10) UNSIGNED NOT NULL, `admin_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `admin_password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `admin_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `admin_phonr` 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 `tbl_admin` -- INSERT INTO `tbl_admin` (`admin_id`, `admin_email`, `admin_password`, `admin_name`, `admin_phonr`, `created_at`, `updated_at`) VALUES (1, '<EMAIL>', '<PASSWORD>', '<NAME>', '01773379864', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `tbl_category` -- CREATE TABLE `tbl_category` ( `category_id` int(10) UNSIGNED NOT NULL, `category_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `category_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `publication_status` int(11) 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 `tbl_category` -- INSERT INTO `tbl_category` (`category_id`, `category_name`, `category_description`, `publication_status`, `created_at`, `updated_at`) VALUES (1, 'The Men', 'This is men category.', 1, NULL, NULL), (2, 'The Women', 'This is women category', 1, NULL, NULL), (3, 'Child', 'Child category.', 0, NULL, NULL), (4, 'Furniture', 'This is Furniture category.', 1, NULL, NULL), (5, 'Others', 'Others', 1, NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_admin` -- ALTER TABLE `tbl_admin` ADD PRIMARY KEY (`admin_id`); -- -- Indexes for table `tbl_category` -- ALTER TABLE `tbl_category` ADD PRIMARY KEY (`category_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_admin` -- ALTER TABLE `tbl_admin` MODIFY `admin_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_category` -- ALTER TABLE `tbl_category` MODIFY `category_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; /*!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 */;
-- Albums CREATE TABLE Albums ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(70) NOT NULL, artist VARCHAR(70) NOT NULL, year_published INTEGER NOT NULL ); -- Songs CREATE TABLE Songs ( id INTEGER, album_id INTEGER NOT NULL, name VARCHAR(100) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (album_id) REFERENCES Albums(id) ); -- Dataset Insertion INSERT INTO Albums (name, artist, year_published) VALUES ('The Dark Side of the Moon', 'Pink Floyd', 1973), ('Abbey Road', 'The Beatles', 1969), ('Hotel California', 'Eagles', 1976), ('Born in the U.S.A.', '<NAME>', 1984), ('California', 'Blink-182', 2016) ; INSERT INTO Songs (name, album_id) VALUES ('Hello from the other side', 1), ('On the run', 1), ('Time', 1), ('Come Together', 2), ('Something', 3), ('Oh, Darling!', 4) ; /* Required to get result in column format */ .headers on .mode column /* Queries */ SELECT * FROM Albums; SELECT * FROM Songs; SELECT Songs.name as song, Albums.name as album FROM Songs JOIN Albums ON Songs.album_id = Albums.id; SELECT * From Albums WHERE 1970 <= year_published AND year_published <= 1980; SELECT Songs.name as song, Albums.name as album, Albums.year_published FROM Songs JOIN Albums ON Songs.album_id = Albums.id WHERE 1970 <= year_published AND year_published <= 1980; SELECT Songs.name as song, Albums.name as album FROM Songs JOIN Albums ON Songs.album_id = Albums.id WHERE album LIKE "%California%";
SELECT t_id, t_ili_tid, gemeindename, bfs_gemeindenummer, bezirksname, kantonsname, geometrie FROM agi_hoheitsgrenzen_pub.hoheitsgrenzen_gemeindegrenze;
-- `IS NULL` is to used to look up records that miss an attribute. USE sql_store; SELECT * FROM customers -- Customers who do not have a phone number WHERE phone IS NULL; -- Customers who have a phone number WHERE phone IS NOT NULL; -- Exercise -- -- Get the orders that are not shipped yet. SELECT * FROM orders WHERE shipped_date IS NULL; -- or shipper_id IS NULL;
<filename>server/sql/users/find_by_email.sql SELECT * FROM tbl_user WHERE email = $1
-- MySQL dump 10.13 Distrib 8.0.15, for macos10.14 (x86_64) -- -- Host: localhost Database: kate_skorija -- ------------------------------------------------------ -- Server version 8.0.15 /*!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 `clients` -- DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `clients` ( `Name` varchar(255) NOT NULL, `Phone` varchar(14) NOT NULL, `ClientId` int(11) NOT NULL AUTO_INCREMENT, `StylistId` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`ClientId`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `clients` -- LOCK TABLES `clients` WRITE; /*!40000 ALTER TABLE `clients` DISABLE KEYS */; INSERT INTO `clients` VALUES ('<NAME>','666-666-6666',11,1),('<NAME>','444-444-4444',13,1),('<NAME>','333-333-3333',14,3); /*!40000 ALTER TABLE `clients` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `stylists` -- DROP TABLE IF EXISTS `stylists`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `stylists` ( `Name` varchar(255) NOT NULL, `Phone` varchar(14) NOT NULL, `WorkStation` varchar(2) NOT NULL, `StylistId` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`StylistId`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `stylists` -- LOCK TABLES `stylists` WRITE; /*!40000 ALTER TABLE `stylists` DISABLE KEYS */; INSERT INTO `stylists` VALUES ('April Ludgate','123-456-7890','1A',1),('<NAME>','987-654-3210','1C',3); /*!40000 ALTER TABLE `stylists` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-07-31 16:52:35
<reponame>tjadezweni/SQL-Query-Exercise<filename>Solutions/Q10.sql SELECT EmployeeID, OrderID, CustomerID, RequiredDate, ShippedDate FROM Orders WHERE ShippedDate > RequiredDate;
<gh_stars>100-1000 Rem Rem $Header: sh_hiera.sql 02-feb-2007.11:50:58 gssmith Exp $ Rem Rem sh_hiera.sql Rem Rem Copyright (c) 2001, 2015, Oracle. All rights reserved. Rem Rem Permission is hereby granted, free of charge, to any person obtaining Rem a copy of this software and associated documentation files (the Rem "Software"), to deal in the Software without restriction, including Rem without limitation the rights to use, copy, modify, merge, publish, Rem distribute, sublicense, and/or sell copies of the Software, and to Rem permit persons to whom the Software is furnished to do so, subject to Rem the following conditions: Rem Rem The above copyright notice and this permission notice shall be Rem included in all copies or substantial portions of the Software. Rem Rem THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Rem EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Rem MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Rem NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE Rem LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION Rem OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Rem WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Rem Rem NAME Rem sh_hiera.sql - Create dimensions and hierarchies Rem Rem DESCRIPTION Rem SH is the Sales History schema of the Oracle 9i Sample Rem Schemas Rem Rem NOTES Rem Rem Rem MODIFIED (MM/DD/YY) Rem gssmith 02/02/07 - Change references to mview$ items Rem hyeh 08/29/02 - hyeh_mv_comschema_to_rdbms Rem hbaer 01/29/01 - Created Rem CREATE DIMENSION times_dim LEVEL day IS TIMES.TIME_ID LEVEL month IS TIMES.CALENDAR_MONTH_DESC LEVEL quarter IS TIMES.CALENDAR_QUARTER_DESC LEVEL year IS TIMES.CALENDAR_YEAR LEVEL fis_week IS TIMES.WEEK_ENDING_DAY LEVEL fis_month IS TIMES.FISCAL_MONTH_DESC LEVEL fis_quarter IS TIMES.FISCAL_QUARTER_DESC LEVEL fis_year IS TIMES.FISCAL_YEAR HIERARCHY cal_rollup ( day CHILD OF month CHILD OF quarter CHILD OF year ) HIERARCHY fis_rollup ( day CHILD OF fis_week CHILD OF fis_month CHILD OF fis_quarter CHILD OF fis_year ) ATTRIBUTE day DETERMINES (day_number_in_week, day_name, day_number_in_month, calendar_week_number) ATTRIBUTE month DETERMINES (calendar_month_desc, calendar_month_number, calendar_month_name, days_in_cal_month, end_of_cal_month) ATTRIBUTE quarter DETERMINES (calendar_quarter_desc, calendar_quarter_number,days_in_cal_quarter, end_of_cal_quarter) ATTRIBUTE year DETERMINES (calendar_year, days_in_cal_year, end_of_cal_year) ATTRIBUTE fis_week DETERMINES (week_ending_day, fiscal_week_number) ATTRIBUTE fis_month DETERMINES (fiscal_month_desc, fiscal_month_number, fiscal_month_name, days_in_fis_month, end_of_fis_month) ATTRIBUTE fis_quarter DETERMINES (fiscal_quarter_desc, fiscal_quarter_number, days_in_fis_quarter, end_of_fis_quarter) ATTRIBUTE fis_year DETERMINES (fiscal_year, days_in_fis_year, end_of_fis_year) ; CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit, cust_street_address, cust_postal_code, cust_main_phone_number, cust_email) ATTRIBUTE city DETERMINES (cust_city) ATTRIBUTE state DETERMINES (cust_state_province) ATTRIBUTE country DETERMINES (countries.country_name) ATTRIBUTE subregion DETERMINES (countries.country_subregion) ATTRIBUTE region DETERMINES (countries.country_region) ; CREATE DIMENSION products_dim LEVEL product IS (products.prod_id) LEVEL subcategory IS (products.prod_subcategory) LEVEL category IS (products.prod_category) HIERARCHY prod_rollup ( product CHILD OF subcategory CHILD OF category ) ATTRIBUTE product DETERMINES (products.prod_name, products.prod_desc, prod_weight_class, prod_unit_of_measure, prod_pack_size,prod_status, prod_list_price, prod_min_price) ATTRIBUTE subcategory DETERMINES (prod_subcategory, prod_subcat_desc) ATTRIBUTE category DETERMINES (prod_category, prod_cat_desc) ; CREATE DIMENSION promotions_dim LEVEL promo IS (promotions.promo_id) LEVEL subcategory IS (promotions.promo_subcategory) LEVEL category IS (promotions.promo_category) HIERARCHY promo_rollup ( promo CHILD OF subcategory CHILD OF category ) ATTRIBUTE promo DETERMINES (promo_name, promo_cost, promo_begin_date, promo_end_date) ATTRIBUTE subcategory DETERMINES (promo_subcategory) ATTRIBUTE category DETERMINES (promo_category) ; CREATE DIMENSION channels_dim LEVEL channel IS (channels.channel_id) LEVEL channel_class IS (channels.channel_class) HIERARCHY channel_rollup ( channel CHILD OF channel_class ) ATTRIBUTE channel DETERMINES (channel_desc) ATTRIBUTE channel_class DETERMINES (channel_class) ; COMMIT;
SELECT ns.nspname AS "tableSchema", t.relname AS "tableName", a.attname AS "columnName", i.relname AS "indexName", ix.indisunique AS "isUnique", ix.indisprimary AS "isPrimaryKey", (SELECT MIN(CASE WHEN ix.indkey[i] = a.attnum THEN i ELSE NULL END)::int FROM generate_series(ARRAY_LOWER(ix.indkey, 1), ARRAY_UPPER(ix.indkey, 1)) i) AS "position" FROM pg_index ix INNER JOIN pg_class t ON (t.oid = ix.indrelid AND t.relkind = 'r') -- Tables only from pg_class, r: ordinary table INNER JOIN pg_class i ON (i.oid = ix.indexrelid AND i.relkind = 'i') -- Indexes only from pg_class, i: indexes INNER JOIN pg_attribute a ON (a.attrelid = t.oid AND a.attnum = ANY(ix.indkey)) INNER JOIN pg_namespace ns ON (ns.oid = t.relnamespace) WHERE ns.nspname = ANY ($1) ORDER BY t.relname, lower(i.relname), -- Order for i.relname is case-sensitive. (SELECT MIN(CASE WHEN ix.indkey[i] = a.attnum THEN i ELSE NULL END)::int FROM generate_series(ARRAY_LOWER(ix.indkey, 1), ARRAY_UPPER(ix.indkey, 1)) i);
create database ACCELERATE; use ACCELERATE; create table USERS( USERNAME VARCHAR(25) NOT NULL UNIQUE, PASSWD VARCHAR(150) NOT NULL, PUBLICKEY VARCHAR(150) NOT NULL, PRIMARY KEY (USERNAME) );
ALTER TABLE users ADD COLUMN evol_self pickle; CREATE TABLE evol_unnamed_children ( -- entry ID, autoincrement to avoid reusing deleted row IDs entry_id integer PRIMARY KEY AUTOINCREMENT, -- child child pickle );
-- file:numeric_big.sql ln:119 expect:true INSERT INTO num_exp_div VALUES (2,0,'NaN')
<filename>demo/shop/shop-translated/query-26.sql WITH RECURSIVE c0(src, trg) AS ((SELECT s0.src, s2.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 56 AND s1.label = 54 AND s2.label = 61 UNION SELECT s0.src, s2.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, edge s1, edge s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 56 AND s1.label = 72 AND s2.label = 61 UNION SELECT s0.src, s2.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 56 AND s1.label = 54 AND s2.label = 66 )) , c1(src, trg) AS ((SELECT s0.src, s1.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, edge s1 WHERE s0.trg = s1.src AND s0.label = 66 AND s1.label = 6 UNION SELECT s0.src, s3.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, edge s1, (SELECT trg as src, src as trg, label FROM edge) as s2, edge s3 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s2.trg = s3.src AND s0.label = 61 AND s1.label = 49 AND s2.label = 2 AND s3.label = 6 UNION SELECT s0.src, s1.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, edge s1 WHERE s0.trg = s1.src AND s0.label = 61 AND s1.label = 48 )) , c2(src, trg) AS ((SELECT s0.src, s3.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, edge s1, (SELECT trg as src, src as trg, label FROM edge) as s2, edge s3 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s2.trg = s3.src AND s0.label = 56 AND s1.label = 0 AND s2.label = 46 AND s3.label = 63 UNION SELECT s0.src, s2.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 56 AND s1.label = 54 AND s2.label = 63 )) , c3(src, trg) AS ((SELECT s0.src, s3.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, (SELECT trg as src, src as trg, label FROM edge) as s2, edge s3 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s2.trg = s3.src AND s0.label = 56 AND s1.label = 57 AND s2.label = 60 AND s3.label = 63 UNION SELECT s0.src, s2.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 56 AND s1.label = 58 AND s2.label = 63 )) SELECT DISTINCT c0.src, c3.src FROM c0, c1, c2, c3 WHERE c0.src = c2.src AND c1.src = c0.trg AND c3.src = c1.trg;
Create or replace function random_string(length integer) returns text as $$ declare chars text[] := '{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}'; result text := ''; i integer := 0; begin if length < 0 then raise exception 'Given length cannot be less than 0'; end if; for i in 1..length loop result := result || chars[1+random()*(array_length(chars, 1)-1)]; end loop; return result; end; $$ language plpgsql; -- Test functions -- For temporary tests CREATE OR REPLACE FUNCTION get_session_hash( BYTEA -- Data ) RETURNS text AS $$ SELECT encode( hmac( $1, decode( current_setting('mozumder.secret_key'), 'hex'), 'sha1'), 'hex') $$ LANGUAGE SQL STRICT IMMUTABLE; CREATE OR REPLACE FUNCTION new_session(TEXT) RETURNS text AS $$ SELECT '{"session_start_time":"' || $1 || '"}"' $$ LANGUAGE SQL STRICT IMMUTABLE; prepare get_session(TEXT) as select session_data_json->>'session_start_time' session_start_time, session_data_json->>'_auth_user_id' _auth_user_id, session_data_json->>'_auth_user_hash' _auth_user_hash, session_hash from ( select substring(session_data_field,42)::jsonb as session_data_json, substring(session_data_field,1,40) as session_hash from ( select encode(decode(session_data, 'base64'), 'escape') as session_data_field from django_session where session_key = $1 ) as u ) as t ; -- no session data: create fresh new session -- existing session: check date -- expired: create fresh new session, logout -- near expired: create fresh new session, login -- valid: login DROP FUNCTION IF EXISTS check_ip_address(inet); CREATE OR REPLACE FUNCTION check_ip_address(ip inet) RETURNS TABLE (banned bool) STABLE AS $BODY$ SELECT coalesce(bot,FALSE) FROM mozumder_ip WHERE mozumder_ip.address = ip $BODY$ LANGUAGE sql; DROP FUNCTION IF EXISTS check_user_agent(text); CREATE OR REPLACE FUNCTION check_user_agent(user_agent text) RETURNS TABLE (bot bool) STABLE AS $BODY$ SELECT coalesce(bot,FALSE) FROM mozumder_useragent WHERE mozumder_useragent.user_agent_string = user_agent $BODY$ LANGUAGE sql; DROP FUNCTION IF EXISTS start_view(TEXT, TEXT, TEXT, INET, TEXT); CREATE OR REPLACE FUNCTION start_view( session_secret text, request_timestamp text, request_session_key text, ip inet, user_agent text ) RETURNS TABLE (status_code integer, session_key varchar, session_expire_date timestamptz, session_data_field json, user_id integer, new_session bool ) AS $BODY$ DECLARE bot BOOL; banned BOOL; session RECORD; json TEXT; data TEXT; expire timestamptz; BEGIN SELECT t.banned FROM check_ip_address(ip) as t INTO banned ; IF banned = TRUE THEN RETURN QUERY SELECT 403, null::varchar, null::timestamptz, '{}'::json, null::integer, FALSE; RETURN; END IF; SELECT t.bot FROM check_user_agent(user_agent) as t INTO bot ; IF bot = TRUE THEN RETURN QUERY SELECT 200, null::varchar, null::timestamptz, '{}'::json, null::integer, FALSE; RETURN; END IF; -- Get session data WITH t AS ( SELECT "django_session"."expire_date" as session_expire_date, substr( encode( decode( "django_session"."session_data", 'base64'), 'escape'), 42)::json as session_data FROM "django_session" WHERE "django_session"."session_key" = request_session_key AND "django_session"."expire_date" > request_timestamp::timestamptz ) SELECT request_session_key::varchar as session_key, t.session_expire_date as session_expire_date, t.session_data as session_data_field, (t.session_data->>'_auth_user_id')::integer as user_id, FALSE as new_session FROM t INTO session ; IF NOT FOUND THEN json := '{"session_start_time":"'|| request_timestamp || '"}' ; expire := request_timestamp::timestamptz + interval '14 days' ; data := encode( decode( encode( hmac( json, session_secret, 'sha1'::text ), 'hex'::text) || ':' || json, 'escape'::text), 'base64') ; LOOP WITH t AS ( INSERT INTO "django_session" ( session_key, expire_date, session_data ) VALUES ( random_string(32)::varchar, expire, data ) ON CONFLICT DO NOTHING RETURNING "django_session"."session_key"::varchar(40) as session_key, expire_date as session_expire_date, substr(encode(decode(session_data, 'base64'), 'escape'), 42)::json as session_data_field ) SELECT t.session_key as session_key, t.session_expire_date as session_expire_date, t.session_data_field as session_data_field, (t.session_data_field->>'_auth_user_id')::integer as user_id, TRUE as new_session FROM t INTO session; EXIT WHEN FOUND; END LOOP; END IF; -- Return Session and Page data RETURN QUERY SELECT 200, session.session_key, session.session_expire_date, session.session_data_field, session.user_id, session.new_session; RETURN ; END $BODY$ LANGUAGE plpgsql; PREPARE start_view(TEXT, TEXT, TEXT, INET, TEXT) AS SELECT * from start_view($1, $2, $3, $4, $5) ; -- Check for banned IP -- Send 403 Forbidden -- Check for crawler -- Don't send new session -- Check for prefetch (?) HTTP_X_PURPOSE HTTP_X_MOZ "X-Purpose: prefetch" or "Purpose: prefetch -- Don't send new session -- Check for Cache Hit -- Use Cache data instead of database --DEALLOCATE get_session; PREPARE get_error_session(TEXT) AS WITH t AS ( SELECT "django_session"."expire_date" as session_expire_date, substr( encode( decode( "django_session"."session_data", 'base64'), 'escape'), 42)::json as session_data FROM "django_session" WHERE "django_session"."session_key" = $1 AND "django_session"."expire_date" > current_timestamp ) SELECT $1::varchar as session_key, t.session_expire_date as session_expire_date, t.session_data as session_data_field, (t.session_data->>'_auth_user_id')::integer as user_id, FALSE as new_session FROM t ;
-- commit: <PASSWORD>
<reponame>TritonSE/WA-Family-Literacy-Application -- +goose Up ALTER TABLE books RENAME TO book_info; CREATE VIEW books AS ( SELECT book_info.*, array_remove(array_agg(book_contents.lang), NULL) AS languages FROM book_info LEFT JOIN book_contents ON book_info.id = book_contents.id GROUP BY book_info.id ); -- +goose Down DROP VIEW IF EXISTS books; ALTER TABLE book_info RENAME TO books;
<reponame>cityofaustin/transportation-vz-data<gh_stars>1-10 -- -- Creates indexes for death count and suspected serious injuries -- create index atd_txdot_crashes_death_cnt_index on atd_txdot_crashes (death_cnt); create index atd_txdot_crashes_sus_serious_injry_cnt_index on atd_txdot_crashes (sus_serious_injry_cnt);
<gh_stars>0 -- DROP TABLE DROP TABLE IF EXISTS sims.student_notes;
-- phpMyAdmin SQL Dump -- version 4.4.12 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jan 27, 2016 at 03:36 AM -- Server version: 5.6.25 -- PHP Version: 5.5.27 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `filemanager` -- -- -------------------------------------------------------- -- -- Table structure for table `accounts` -- CREATE TABLE IF NOT EXISTS `accounts` ( `id` int(11) NOT NULL, `username` varchar(32) NOT NULL, `password` varchar(129) NOT NULL, `email` varchar(256) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `files` -- CREATE TABLE IF NOT EXISTS `files` ( `id` int(11) NOT NULL, `user` int(11) NOT NULL, `path` varchar(256) NOT NULL, `name` varchar(128) NOT NULL, `fileid` varchar(16) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `accounts` -- ALTER TABLE `accounts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `files` -- ALTER TABLE `files` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `accounts` -- ALTER TABLE `accounts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `files` -- ALTER TABLE `files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10; /*!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.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: May 13, 2016 at 07:31 PM -- Server version: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `tourist` -- -- -------------------------------------------------------- -- -- Table structure for table `akcija` -- CREATE TABLE IF NOT EXISTS `akcija` ( `idAkcija` int(11) NOT NULL AUTO_INCREMENT, `popust` decimal(10,2) NOT NULL, PRIMARY KEY (`idAkcija`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=2 ; -- -- Dumping data for table `akcija` -- INSERT INTO `akcija` (`idAkcija`, `popust`) VALUES (1, '0.90'); -- -------------------------------------------------------- -- -- Table structure for table `apartman` -- CREATE TABLE IF NOT EXISTS `apartman` ( `idSmjestaj` int(11) NOT NULL AUTO_INCREMENT, `brojOsoba` int(11) NOT NULL, `brojSoba` int(11) NOT NULL, `cijenaPoDanu` decimal(10,0) NOT NULL, `naziv` varchar(100) COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`idSmjestaj`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=5 ; -- -- Dumping data for table `apartman` -- INSERT INTO `apartman` (`idSmjestaj`, `brojOsoba`, `brojSoba`, `cijenaPoDanu`, `naziv`) VALUES (3, 4, 2, '50', 'Placa Espanya Apt'), (4, 4, 2, '55', 'Diagonal Apartment'); -- -------------------------------------------------------- -- -- Table structure for table `drzava` -- CREATE TABLE IF NOT EXISTS `drzava` ( `idDrzava` int(11) NOT NULL AUTO_INCREMENT, `naziv` varchar(50) COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`idDrzava`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=5 ; -- -- Dumping data for table `drzava` -- INSERT INTO `drzava` (`idDrzava`, `naziv`) VALUES (1, 'Spain'), (2, 'Switzerland'), (3, 'USA'), (4, 'Italy'); -- -------------------------------------------------------- -- -- Table structure for table `hotel` -- CREATE TABLE IF NOT EXISTS `hotel` ( `idSmjestaj` int(11) NOT NULL AUTO_INCREMENT, `naziv` varchar(50) COLLATE utf8mb4_bin NOT NULL, `kapacitetHotela` int(11) NOT NULL, `brojObroka` int(11) NOT NULL, PRIMARY KEY (`idSmjestaj`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=3 ; -- -- Dumping data for table `hotel` -- INSERT INTO `hotel` (`idSmjestaj`, `naziv`, `kapacitetHotela`, `brojObroka`) VALUES (1, 'Mercer Hotel Barcelona', 500, 3), (2, 'Alma Hotel Barcelona', 600, 3); -- -------------------------------------------------------- -- -- Table structure for table `hotel_nudi` -- CREATE TABLE IF NOT EXISTS `hotel_nudi` ( `idSmjestaj` int(11) NOT NULL, `idSadrzaj` int(11) NOT NULL, PRIMARY KEY (`idSmjestaj`,`idSadrzaj`), KEY `idSadrzaj` (`idSadrzaj`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `hotel_nudi` -- INSERT INTO `hotel_nudi` (`idSmjestaj`, `idSadrzaj`) VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6); -- -------------------------------------------------------- -- -- Table structure for table `izlet` -- CREATE TABLE IF NOT EXISTS `izlet` ( `idIzlet` int(11) NOT NULL AUTO_INCREMENT, `naziv` varchar(100) COLLATE utf8mb4_bin NOT NULL, `opis` varchar(1000) COLLATE utf8mb4_bin NOT NULL, `trajanje` int(11) NOT NULL, `cijenaPoOsobi` decimal(10,0) NOT NULL, `ukljucenVodic` tinyint(1) NOT NULL, `ukljucenObrok` tinyint(1) NOT NULL, `ukljuceneUlaznice` tinyint(1) NOT NULL, `nazivKompanije` varchar(100) COLLATE utf8mb4_bin NOT NULL, `idLokacija` int(11) NOT NULL, `idAkcija` int(11) DEFAULT NULL, PRIMARY KEY (`idIzlet`), KEY `idLokacija` (`idLokacija`,`idAkcija`), KEY `idLokacija_2` (`idLokacija`), KEY `idAkcija` (`idAkcija`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=4 ; -- -- Dumping data for table `izlet` -- INSERT INTO `izlet` (`idIzlet`, `naziv`, `opis`, `trajanje`, `cijenaPoOsobi`, `ukljucenVodic`, `ukljucenObrok`, `ukljuceneUlaznice`, `nazivKompanije`, `idLokacija`, `idAkcija`) VALUES (1, 'Disney California Story Tour', 'Explore the Golden State’s vibrant history and see how its turn-of-the-century spirit influenced daring dreamers like <NAME>. ', 8, '2000', 1, 1, 1, 'AmericaTours', 6, NULL), (3, 'Cinque Terre Day Trip', 'Explore the Italian Riviera on this day trip to the beautiful Cinque Terre from Florence, with transport between each small town provided. Led by a local guide, discover each fishing village by coach, train and boat, from the beaches of Monterosso to the charming streets of Riomaggiore. Stop for a swim in the turquoise waters and upgrade to include a traditional Italian lunch. Soak up all the character of this UNESCO-listed region before heading back to Florence.', 13, '100', 1, 1, 2, 'Viator', 8, 1); -- -------------------------------------------------------- -- -- Table structure for table `izlet_polazak` -- CREATE TABLE IF NOT EXISTS `izlet_polazak` ( `idIzletPolazak` int(11) NOT NULL AUTO_INCREMENT, `idIzlet` int(11) NOT NULL, `vrijemePolazak` datetime NOT NULL, `slobodnoMjesta` int(11) NOT NULL DEFAULT '30', PRIMARY KEY (`idIzletPolazak`), KEY `idIzlet` (`idIzlet`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=5 ; -- -- Dumping data for table `izlet_polazak` -- INSERT INTO `izlet_polazak` (`idIzletPolazak`, `idIzlet`, `vrijemePolazak`, `slobodnoMjesta`) VALUES (1, 3, '2016-07-07 07:00:00', 28), (2, 3, '2016-07-08 07:00:00', 21), (3, 3, '2016-07-09 07:00:00', 30), (4, 3, '2016-07-10 07:00:00', 30); -- -------------------------------------------------------- -- -- Table structure for table `izlet_rezervacija` -- CREATE TABLE IF NOT EXISTS `izlet_rezervacija` ( `idIzletRezervacija` int(11) NOT NULL AUTO_INCREMENT, `brojOsoba` int(11) NOT NULL, `ukupnaCijena` decimal(10,2) NOT NULL, `idIzlet` int(11) NOT NULL, `idIzletPolazak` int(11) NOT NULL, `idKupac` int(11) NOT NULL, PRIMARY KEY (`idIzletRezervacija`), KEY `idIzlet` (`idIzlet`), KEY `idKupac` (`idKupac`), KEY `idIzletPolazak` (`idIzletPolazak`), KEY `idIzletPolazak_2` (`idIzletPolazak`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=5 ; -- -- Dumping data for table `izlet_rezervacija` -- INSERT INTO `izlet_rezervacija` (`idIzletRezervacija`, `brojOsoba`, `ukupnaCijena`, `idIzlet`, `idIzletPolazak`, `idKupac`) VALUES (1, 2, '200.00', 3, 1, 1), (2, 4, '400.00', 3, 2, 4), (3, 3, '300.00', 3, 2, 6), (4, 2, '180.00', 3, 2, 1); -- -------------------------------------------------------- -- -- Table structure for table `kupac` -- CREATE TABLE IF NOT EXISTS `kupac` ( `idKupac` int(11) NOT NULL AUTO_INCREMENT, `ime` varchar(50) COLLATE utf8mb4_bin NOT NULL, `prezime` varchar(50) COLLATE utf8mb4_bin NOT NULL, `e_mail` varchar(50) COLLATE utf8mb4_bin NOT NULL, `godinaRodjenja` int(11) NOT NULL, `kontakt` int(11) NOT NULL, PRIMARY KEY (`idKupac`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=7 ; -- -- Dumping data for table `kupac` -- INSERT INTO `kupac` (`idKupac`, `ime`, `prezime`, `e_mail`, `godinaRodjenja`, `kontakt`) VALUES (1, 'Goran', 'Brlas', '<EMAIL>', 1995, 996777919), (4, 'Antonija', 'Vrdoljak', '<EMAIL>', 1994, 998166372), (5, 'Ivana', 'Vrdoljak', '<EMAIL>', 1994, 996706433), (6, 'Antonija', 'Vrdoljak', '<EMAIL>', 1994, 996706433); -- -------------------------------------------------------- -- -- Table structure for table `lokacija` -- CREATE TABLE IF NOT EXISTS `lokacija` ( `idLokacija` int(11) NOT NULL AUTO_INCREMENT, `ime` varchar(50) COLLATE utf8mb4_bin NOT NULL, `opis` varchar(1000) COLLATE utf8mb4_bin NOT NULL, `dugiOpis` varchar(10000) COLLATE utf8mb4_bin NOT NULL, `tip` int(11) NOT NULL, `idDrzava` int(11) NOT NULL, `pregledi` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`idLokacija`), KEY `idDrzava` (`idDrzava`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=9 ; -- -- Dumping data for table `lokacija` -- INSERT INTO `lokacija` (`idLokacija`, `ime`, `opis`, `dugiOpis`, `tip`, `idDrzava`, `pregledi`) VALUES (2, 'Barcelona, Spain', 'Founded as a Roman city, in the Middle Ages Barcelona became the capital of the County of Barcelona. After merging with the Kingdom of Aragon, Barcelona continued to be an important city in the Crown of Aragon as an economical and administrative center of this Crown and the capital of the Principality of Catalonia. Besieged several times during its history, Barcelona has a rich cultural heritage and is today an important cultural center and a major tourist destination. Particularly renowned are the architectural works of <NAME> and <NAME>, which have been designated UNESCO World Heritage Sites. The headquarters of the Union for the Mediterranean is located in Barcelona. The city is known for hosting the 1992 Summer Olympics as well as world-class conferences and expositions and also many international sport tournaments.', '', 3, 1, 18), (3, 'Madrid, Spain', 'The city is located on the Manzanares River in the centre of both the country and the Community of Madrid (which comprises the city of Madrid, its conurbation and extended suburbs and villages); this community is bordered by the autonomous communities of Castile and León and Castile-La Mancha. As the capital city of Spain, seat of government, and residence of the Spanish monarch, Madrid is also the political, economic and cultural centre of Spain. The current mayor is Manuela Carmena from Ahora Madrid.', '', 3, 1, 4), (4, 'Murren, Switzerland', 'Mürren is a traditional Walser mountain village in Bernese Oberland, Switzerland, at an elevation of 1,650 m (5,413 ft.) above sea level and unreachable by public road. Tourism is popular through the summer and winter; the village features a view of the three towering mountains: Eiger, Mönch, and Jungfrau. Mürren has a population of just 450, but has 2,000 hotel beds.\r\n\r\nMürren has its own school and two churches, one Reformed and one Roman Catholic.', '', 2, 2, 1), (5, 'Santa Catalina Island, California', 'Santa Catalina Island, often called Catalina Island, or just Catalina, is a rocky island off the coast of the U.S. state of California in the Gulf of Santa Catalina. The island is 22 miles (35 km) long and 8 miles (13 km) across at its greatest width. The island is located about 22 miles (35 km) south-southwest of Los Angeles, California. The highest point on the island is 2,097 feet (639 m) Mt. Orizaba. Santa Catalina is part of the Channel Islands of California archipelago and lies within Los Angeles County.', '', 1, 3, 1), (6, 'Disneyland Resort', 'Disneyland resort.', '', 5, 3, 0), (7, 'New York City, USA', 'The City of New York, often called New York City or simply New York, is the most populous city in the United States. Located at the southern tip of the State of New York, the city is the center of the New York metropolitan area, one of the most populous urban agglomerations in the world. A global power city, New York City exerts a significant impact upon commerce, finance, media, art, fashion, research, technology, education, and entertainment, its fast pace defining the term New York minute. Home to the headquarters of the United Nations, New York is an important center for international diplomacy and has been described as the cultural and financial capital of the world.', '', 3, 3, 0), (8, 'Italian Riviera', 'Italian Riviera', '', 5, 4, 0); -- -------------------------------------------------------- -- -- Table structure for table `sadrzaj` -- CREATE TABLE IF NOT EXISTS `sadrzaj` ( `idSadrzaj` int(11) NOT NULL AUTO_INCREMENT, `naziv` varchar(50) COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`idSadrzaj`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=7 ; -- -- Dumping data for table `sadrzaj` -- INSERT INTO `sadrzaj` (`idSadrzaj`, `naziv`) VALUES (1, 'Chic restaurant'), (2, 'Cafe/bar'), (3, 'Garden terace'), (4, 'Spa'), (5, 'Pool'), (6, 'Gym'); -- -------------------------------------------------------- -- -- Table structure for table `slika` -- CREATE TABLE IF NOT EXISTS `slika` ( `idSlika` int(11) NOT NULL AUTO_INCREMENT, `url` varchar(1000) COLLATE utf8mb4_bin NOT NULL, PRIMARY KEY (`idSlika`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=25 ; -- -- Dumping data for table `slika` -- INSERT INTO `slika` (`idSlika`, `url`) VALUES (1, 'barcelona1.jpg'), (7, 'madrid1.jpg'), (8, 'murren1.jpg'), (9, 'santacatalina1.jpg'), (10, 'disneyland1.jpg'), (11, 'ny1.jpg'), (12, 'hotel1.jpg'), (13, 'hotel2.jpg'), (14, 'apartman1.jpg'), (15, 'apartman2.jpg'), (16, 'italiariviera1.jpg'), (17, 'barcelona2.jpg'), (18, 'barcelona3.jpg'), (19, 'barcelona4.jpg'), (20, 'hotel3.jpg'), (21, 'italia2.jpg'), (22, 'madrid2.jpg'), (23, 'madrid3.jpg'), (24, 'madrid4.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `slike_izlet` -- CREATE TABLE IF NOT EXISTS `slike_izlet` ( `idIzlet` int(11) NOT NULL, `idSlika` int(11) NOT NULL, PRIMARY KEY (`idIzlet`,`idSlika`), KEY `idSlika` (`idSlika`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `slike_izlet` -- INSERT INTO `slike_izlet` (`idIzlet`, `idSlika`) VALUES (1, 10), (3, 16), (3, 21); -- -------------------------------------------------------- -- -- Table structure for table `slike_lokacija` -- CREATE TABLE IF NOT EXISTS `slike_lokacija` ( `idLokacija` int(11) NOT NULL, `idSlika` int(11) NOT NULL, PRIMARY KEY (`idLokacija`,`idSlika`), KEY `idSlika` (`idSlika`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `slike_lokacija` -- INSERT INTO `slike_lokacija` (`idLokacija`, `idSlika`) VALUES (2, 1), (3, 7), (4, 8), (5, 9), (7, 11), (2, 17), (2, 18), (2, 19), (3, 22), (3, 23), (3, 24); -- -------------------------------------------------------- -- -- Table structure for table `slike_smjestaj` -- CREATE TABLE IF NOT EXISTS `slike_smjestaj` ( `idSmjestaj` int(11) NOT NULL, `idSlika` int(11) NOT NULL, PRIMARY KEY (`idSmjestaj`,`idSlika`), KEY `idSlika` (`idSlika`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Dumping data for table `slike_smjestaj` -- INSERT INTO `slike_smjestaj` (`idSmjestaj`, `idSlika`) VALUES (1, 12), (2, 13), (3, 14), (4, 15), (1, 20); -- -------------------------------------------------------- -- -- Table structure for table `smjestaj` -- CREATE TABLE IF NOT EXISTS `smjestaj` ( `idSmjestaj` int(11) NOT NULL AUTO_INCREMENT, `tip` int(11) NOT NULL, `opis` varchar(1000) COLLATE utf8mb4_bin NOT NULL, `adresa` varchar(100) COLLATE utf8mb4_bin NOT NULL, `klasifikacija` int(11) NOT NULL, `idLokacija` int(11) NOT NULL, `idAkcija` int(11) DEFAULT NULL, PRIMARY KEY (`idSmjestaj`), KEY `idLokacija` (`idLokacija`), KEY `idAkcija` (`idAkcija`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=5 ; -- -- Dumping data for table `smjestaj` -- INSERT INTO `smjestaj` (`idSmjestaj`, `tip`, `opis`, `adresa`, `klasifikacija`, `idLokacija`, `idAkcija`) VALUES (1, 1, 'In a historic building in Barcelona''s historic Gothic quarter, this upscale hotel is a 3-minute walk from the Jaume I metro station and 500 m from the Museu Picasso (art museum). \n\nOffering free Wi-Fi and minibars, the refined rooms also come with flat-screen TVs, designer toiletries and rainfall showerheads. Some have balconies and/or original wood beams or stone walls, while suites add amenities such as separate living rooms, bath tubs and desks. Room service is available.', '<NAME>', 5, 2, 1), (2, 1, 'A 5-minute walk from Passeig de Gràcia metro station, this sophisticated hotel is a 3-minute walk from Gaudi''s Casa Milà and 1.5 km from Sagrada Família church. \n\nThe contemporary rooms come with free Wi-Fi, flat-screen TVs and minibars. Upgraded rooms with city views are individually decorated. Suites add separate living areas, and there''s 1 with a balcony. Room service is available.', '<NAME>', 5, 2, NULL), (3, 2, 'This apartment "Placa Espanya Romantic apartment" offers Terrace y HVAC. \nThe accommodation is just 1.4 km to the center away from Barcelona.\n', 'Sants-Montjuïc, Barcelona', 3, 2, NULL), (4, 2, 'This apartment "SAGRADA FAMILIA WIFI" offers HVAC y Lift. \nThe accommodation is just 1.3 km to the center away from Barcelona.', 'Sant Marti, Barcelona', 4, 2, 1); -- -------------------------------------------------------- -- -- Table structure for table `smjestaj_rezervacija` -- CREATE TABLE IF NOT EXISTS `smjestaj_rezervacija` ( `idSmjestajRezervacija` int(11) NOT NULL AUTO_INCREMENT, `tipRezervacije` int(11) NOT NULL, `idRezervirano` int(11) DEFAULT NULL, `datumOd` date NOT NULL, `brojDana` int(11) NOT NULL, `ukupnaCijena` decimal(10,2) NOT NULL, `idSmjestaj` int(11) NOT NULL, `idKupac` int(11) NOT NULL, PRIMARY KEY (`idSmjestajRezervacija`), KEY `idSmjestaj` (`idSmjestaj`), KEY `idKupac` (`idKupac`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=19 ; -- -- Dumping data for table `smjestaj_rezervacija` -- INSERT INTO `smjestaj_rezervacija` (`idSmjestajRezervacija`, `tipRezervacije`, `idRezervirano`, `datumOd`, `brojDana`, `ukupnaCijena`, `idSmjestaj`, `idKupac`) VALUES (6, 1, 1, '2016-07-12', 2, '200.00', 1, 1), (7, 1, 4, '2016-05-15', 4, '520.00', 1, 1), (8, 2, 6, '2016-07-12', 5, '275.00', 4, 1), (9, 1, 1, '2016-05-15', 8, '800.00', 1, 5), (10, 2, 6, '2016-06-09', 4, '220.00', 4, 1), (13, 2, 6, '2016-05-15', 5, '247.50', 4, 1), (17, 2, 6, '2016-05-15', 5, '247.50', 4, 1), (18, 1, 2, '2016-05-15', 2, '162.00', 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `soba` -- CREATE TABLE IF NOT EXISTS `soba` ( `idSoba` int(11) NOT NULL AUTO_INCREMENT, `velicina` float NOT NULL, `tip` varchar(100) COLLATE utf8mb4_bin NOT NULL, `cijenaPoDanu` float NOT NULL, `brojSlobodnih` tinyint(1) NOT NULL, `brojOsoba` int(11) NOT NULL, `idSmjestaj` int(11) NOT NULL, PRIMARY KEY (`idSoba`), KEY `idSmjestaj` (`idSmjestaj`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=7 ; -- -- Dumping data for table `soba` -- INSERT INTO `soba` (`idSoba`, `velicina`, `tip`, `cijenaPoDanu`, `brojSlobodnih`, `brojOsoba`, `idSmjestaj`) VALUES (1, 30, 'Superior', 100, 40, 2, 1), (2, 36, 'Deluxe', 90, 50, 3, 1), (3, 43, 'Junior Suite', 120, 20, 3, 1), (4, 95, 'Suite', 130, 10, 4, 1), (5, 30, 'Apartment room', 50, 2, 2, 3), (6, 35, 'Apartment room', 55, 2, 2, 4); -- -------------------------------------------------------- -- -- Table structure for table `soba_rezervacija` -- CREATE TABLE IF NOT EXISTS `soba_rezervacija` ( `idSobaRezervacija` int(11) NOT NULL AUTO_INCREMENT, `idSoba` int(11) NOT NULL, `datum` date NOT NULL, `slobodno` int(11) NOT NULL, PRIMARY KEY (`idSobaRezervacija`), KEY `idSoba` (`idSoba`), KEY `idSoba_2` (`idSoba`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=38 ; -- -- Dumping data for table `soba_rezervacija` -- INSERT INTO `soba_rezervacija` (`idSobaRezervacija`, `idSoba`, `datum`, `slobodno`) VALUES (5, 1, '2016-07-12', 39), (6, 1, '2016-07-13', 39), (7, 4, '2016-05-15', 9), (8, 4, '2016-05-16', 9), (9, 4, '2016-05-17', 9), (10, 4, '2016-05-18', 9), (11, 6, '2016-07-12', 1), (12, 6, '2016-07-13', 1), (13, 6, '2016-07-14', 1), (14, 6, '2016-07-15', 1), (15, 6, '2016-07-16', 1), (16, 1, '2016-05-15', 39), (17, 1, '2016-05-16', 39), (18, 1, '2016-05-17', 39), (19, 1, '2016-05-18', 39), (20, 1, '2016-05-19', 39), (21, 1, '2016-05-20', 39), (22, 1, '2016-05-21', 39), (23, 1, '2016-05-22', 39), (24, 6, '2016-06-09', 1), (25, 6, '2016-06-10', 1), (26, 6, '2016-06-11', 1), (27, 6, '2016-06-12', 1), (33, 6, '2016-05-15', 0), (34, 6, '2016-05-16', 0), (35, 6, '2016-05-18', 1), (36, 2, '2016-05-15', 49), (37, 2, '2016-05-16', 49); -- -- Constraints for dumped tables -- -- -- Constraints for table `apartman` -- ALTER TABLE `apartman` ADD CONSTRAINT `APARTMAN_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`); -- -- Constraints for table `hotel` -- ALTER TABLE `hotel` ADD CONSTRAINT `HOTEL_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`); -- -- Constraints for table `hotel_nudi` -- ALTER TABLE `hotel_nudi` ADD CONSTRAINT `HOTEL_NUDI_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`), ADD CONSTRAINT `HOTEL_NUDI_ibfk_2` FOREIGN KEY (`idSadrzaj`) REFERENCES `sadrzaj` (`idSadrzaj`); -- -- Constraints for table `izlet` -- ALTER TABLE `izlet` ADD CONSTRAINT `IZLET_ibfk_1` FOREIGN KEY (`idLokacija`) REFERENCES `lokacija` (`idLokacija`) ON UPDATE CASCADE, ADD CONSTRAINT `IZLET_ibfk_2` FOREIGN KEY (`idAkcija`) REFERENCES `akcija` (`idAkcija`) ON UPDATE CASCADE; -- -- Constraints for table `izlet_polazak` -- ALTER TABLE `izlet_polazak` ADD CONSTRAINT `IZLET_POLAZAK_ibfk_1` FOREIGN KEY (`idIzlet`) REFERENCES `izlet` (`idIzlet`); -- -- Constraints for table `izlet_rezervacija` -- ALTER TABLE `izlet_rezervacija` ADD CONSTRAINT `IZLET_REZERVACIJA_ibfk_1` FOREIGN KEY (`idIzlet`) REFERENCES `izlet` (`idIzlet`), ADD CONSTRAINT `IZLET_REZERVACIJA_ibfk_2` FOREIGN KEY (`idKupac`) REFERENCES `kupac` (`idKupac`), ADD CONSTRAINT `IZLET_REZERVACIJA_ibfk_3` FOREIGN KEY (`idIzletPolazak`) REFERENCES `izlet_polazak` (`idIzletPolazak`); -- -- Constraints for table `lokacija` -- ALTER TABLE `lokacija` ADD CONSTRAINT `LOKACIJA_ibfk_1` FOREIGN KEY (`idDrzava`) REFERENCES `drzava` (`idDrzava`); -- -- Constraints for table `slike_izlet` -- ALTER TABLE `slike_izlet` ADD CONSTRAINT `SLIKE_IZLET_ibfk_1` FOREIGN KEY (`idIzlet`) REFERENCES `izlet` (`idIzlet`), ADD CONSTRAINT `SLIKE_IZLET_ibfk_2` FOREIGN KEY (`idSlika`) REFERENCES `slika` (`idSlika`); -- -- Constraints for table `slike_lokacija` -- ALTER TABLE `slike_lokacija` ADD CONSTRAINT `SLIKE_LOKACIJA_ibfk_1` FOREIGN KEY (`idLokacija`) REFERENCES `lokacija` (`idLokacija`), ADD CONSTRAINT `SLIKE_LOKACIJA_ibfk_2` FOREIGN KEY (`idSlika`) REFERENCES `slika` (`idSlika`); -- -- Constraints for table `slike_smjestaj` -- ALTER TABLE `slike_smjestaj` ADD CONSTRAINT `SLIKE_SMJESTAJ_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`), ADD CONSTRAINT `SLIKE_SMJESTAJ_ibfk_2` FOREIGN KEY (`idSlika`) REFERENCES `slika` (`idSlika`); -- -- Constraints for table `smjestaj` -- ALTER TABLE `smjestaj` ADD CONSTRAINT `SMJESTAJ_ibfk_1` FOREIGN KEY (`idLokacija`) REFERENCES `lokacija` (`idLokacija`), ADD CONSTRAINT `SMJESTAJ_ibfk_2` FOREIGN KEY (`idAkcija`) REFERENCES `akcija` (`idAkcija`); -- -- Constraints for table `smjestaj_rezervacija` -- ALTER TABLE `smjestaj_rezervacija` ADD CONSTRAINT `SMJESTAJ_REZERVACIJA_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`), ADD CONSTRAINT `SMJESTAJ_REZERVACIJA_ibfk_2` FOREIGN KEY (`idKupac`) REFERENCES `kupac` (`idKupac`); -- -- Constraints for table `soba` -- ALTER TABLE `soba` ADD CONSTRAINT `SOBA_ibfk_1` FOREIGN KEY (`idSmjestaj`) REFERENCES `smjestaj` (`idSmjestaj`); -- -- Constraints for table `soba_rezervacija` -- ALTER TABLE `soba_rezervacija` ADD CONSTRAINT `SOBA_REZERVACIJA_ibfk_1` FOREIGN KEY (`idSoba`) REFERENCES `soba` (`idSoba`); /*!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 */;
//// CHANGE name=change0 CREATE MEMORY TABLE TABLE36(ID INTEGER NOT NULL PRIMARY KEY,FIELD1 VARCHAR(30),USERTYPE4FIELD USERTYPE4,USERTYPE1FIELD USERTYPE1,USERTYPE5FIELD USERTYPE5) GO
ALTER TABLE fledge.streams DROP CONSTRAINT streams_fk1; DROP TABLE IF EXISTS fledge.destinations; DROP INDEX IF EXISTS fledge.fki_streams_fk1; -- Drops destination_id field from the table DROP TABLE IF EXISTS fledge.streams_old; ALTER TABLE fledge.streams RENAME TO streams_old; ALTER TABLE fledge.streams_old RENAME CONSTRAINT strerams_pkey TO strerams_pkey_old; CREATE TABLE fledge.streams ( id integer NOT NULL DEFAULT nextval('fledge.streams_id_seq'::regclass), -- Sequence ID description character varying(255) NOT NULL DEFAULT ''::character varying COLLATE pg_catalog."default", -- A brief description of the stream entry properties jsonb NOT NULL DEFAULT '{}'::jsonb, -- A generic set of properties object_stream jsonb NOT NULL DEFAULT '{}'::jsonb, -- Definition of what must be streamed object_block jsonb NOT NULL DEFAULT '{}'::jsonb, -- Definition of how the stream must be organised object_filter jsonb NOT NULL DEFAULT '{}'::jsonb, -- Any filter involved in selecting the data to stream active_window jsonb NOT NULL DEFAULT '{}'::jsonb, -- The window of operations active boolean NOT NULL DEFAULT true, -- When false, all data to this stream stop and are inactive last_object bigint NOT NULL DEFAULT 0, -- The ID of the last object streamed (asset or reading, depending on the object_stream) ts timestamp(6) with time zone NOT NULL DEFAULT now(), -- Creation or last update CONSTRAINT strerams_pkey PRIMARY KEY (id)); INSERT INTO fledge.streams SELECT id, description, properties, object_stream, object_block, object_filter, active_window, active, last_object, ts FROM fledge.streams_old; DROP TABLE fledge.streams_old;
#standardSQL # CSS in JS. Show number of sites that using each framework or not using any. CREATE TEMPORARY FUNCTION getCssInJS(payload STRING) RETURNS ARRAY<STRING> LANGUAGE js AS ''' try { var $ = JSON.parse(payload); var css = JSON.parse($._css); return css && Array.isArray(css.css_in_js) && css.css_in_js.length > 0 ? css.css_in_js : ['NONE']; } catch (e) { return ['Error:' + e.message]; } '''; SELECT cssInJs, COUNT(0) AS freq, SUM(COUNT(0)) OVER () AS total, COUNT(0) / SUM(COUNT(0)) OVER () AS pct FROM ( SELECT url, cssInJs FROM `httparchive.sample_data.pages_mobile_10k` CROSS JOIN UNNEST(getCssInJS(payload)) AS cssInJs ) WHERE cssInJs != 'NONE' GROUP BY cssInJs ORDER BY freq
<reponame>SKalt/pg_sql_parser_tests<filename>fixtures/doctests/rowtypes/014/input.sql UPDATE mytab SET complex_col.r = (complex_col).r + 1 WHERE ...;
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50519 Source Host : localhost:3306 Source Database : exam Target Server Type : MYSQL Target Server Version : 50519 File Encoding : 65001 Date: 2019-02-28 17:06:00 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for sys_answer -- ---------------------------- DROP TABLE IF EXISTS `sys_answer`; CREATE TABLE `sys_answer` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` tinyint(1) DEFAULT NULL COMMENT '1图文,2语音', `cid` char(40) DEFAULT NULL, `subjectid` int(11) DEFAULT NULL, `content` varchar(255) DEFAULT NULL, `userid` int(11) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, `teachid` int(11) DEFAULT NULL, `teachname` varchar(255) DEFAULT NULL, `status` tinyint(1) DEFAULT '1' COMMENT '1未回答,2已回答,3老师待回答', `intime` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `id` (`id`,`cid`,`subjectid`) ) ENGINE=MyISAM AUTO_INCREMENT=125 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_answer -- ---------------------------- INSERT INTO `sys_answer` VALUES ('81', '2', '9A68ADF0-C893-2403-B9D9-0B9C91AEE5FE', '9', '', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-22 08:37:19'); INSERT INTO `sys_answer` VALUES ('82', '1', 'F64BA974-22C6-62C8-AECC-08CE1F7C1DC3', '9', 'asd', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 08:37:49'); INSERT INTO `sys_answer` VALUES ('83', '2', 'E6956F26-220F-6ADD-E2B7-288245B501D3', '11', '', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 08:38:03'); INSERT INTO `sys_answer` VALUES ('84', '1', '336BA2B2-010A-8440-680A-4C6EA858A7A5', '10', '高等数学怎么复习呀?', '84', 'zhangwenfeng', '55', '陈见柯', '2', '2019-02-22 09:49:45'); INSERT INTO `sys_answer` VALUES ('85', '1', 'BE6FD11C-C29D-1A7B-C4F8-6986B2F32202', '11', '英语单词记忆的常用方法有哪些?', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-22 09:54:25'); INSERT INTO `sys_answer` VALUES ('86', '2', 'DFC54DBF-9A15-617D-A48A-71D18E62FE32', '9', '', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-22 11:05:47'); INSERT INTO `sys_answer` VALUES ('87', '1', '5571EBAE-3B77-C685-44E6-B530F370FD2B', '13', '明年的专升本考试在什么时间?', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 11:06:51'); INSERT INTO `sys_answer` VALUES ('88', '1', 'E543721C-4B9D-78D3-AB72-8713CC87F9F8', '12', '计算机课程难吗', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-22 11:08:18'); INSERT INTO `sys_answer` VALUES ('89', '2', '8E841529-80CA-4190-E1A3-CBDFFBD4D086', '9', '', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 11:17:02'); INSERT INTO `sys_answer` VALUES ('90', '1', '1FDAC2A5-60A5-20F7-A68F-3CA768978420', '12', '域名服务器的作用是什么?', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 16:20:54'); INSERT INTO `sys_answer` VALUES ('91', '1', '0A8E5E68-7EE3-9308-EF73-3E35EF741575', '11', '英语语法是考试重点吗?', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 16:22:02'); INSERT INTO `sys_answer` VALUES ('92', '1', 'C8BC7E63-21FC-4E19-E6E9-54093AC83401', '9', '英语写作题材给一些吧', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-22 16:35:18'); INSERT INTO `sys_answer` VALUES ('93', '1', '52C463B0-1677-260B-541F-A6A681F3B80C', '9', '2019-2-23-test1', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-23 09:35:39'); INSERT INTO `sys_answer` VALUES ('94', '1', '24533F54-4E9E-111E-4FDC-8615D78276AE', '9', 'test2', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-23 09:36:45'); INSERT INTO `sys_answer` VALUES ('95', '2', '809E6F0A-5AB7-F107-BBB3-FA5A9F497027', '10', 'test3', '84', 'zhangwenfeng', '55', '陈见柯', '2', '2019-02-23 09:41:36'); INSERT INTO `sys_answer` VALUES ('96', '2', '5AA599D1-3095-6E3D-9056-697BB80D8921', '9', '能直接拍照上传吗', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-23 09:43:17'); INSERT INTO `sys_answer` VALUES ('97', '1', '9B31A3A3-E926-6CC1-92E8-8A2A937D7446', '9', 'test6', '84', 'zhangwenfeng', '59', '丁兴建', '2', '2019-02-23 09:49:45'); INSERT INTO `sys_answer` VALUES ('98', '2', '11C5385C-A58C-870F-AE71-4404C54FB342', '9', '', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-23 09:50:44'); INSERT INTO `sys_answer` VALUES ('99', '1', 'EB48E431-8A31-90E4-E84D-9893131DA77D', '9', '拉', '84', 'zhangwenfeng', '54', '刘玥', '3', '2019-02-25 17:13:56'); INSERT INTO `sys_answer` VALUES ('100', '1', '15027156-26C5-EA41-1A23-9ADF652988CC', '9', '测试\n', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-25 17:23:49'); INSERT INTO `sys_answer` VALUES ('101', '1', '5ADCDA24-EEB3-8FCA-0C6F-AB0F18D6B5B2', '9', '123123', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-26 12:00:06'); INSERT INTO `sys_answer` VALUES ('102', '1', '9EEEF797-2170-8005-954D-5B227561CEA5', '9', '测试测试', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-26 13:49:21'); INSERT INTO `sys_answer` VALUES ('103', '1', '6A9FA93F-FA22-A3C7-4877-68F8C9CFB238', '9', '阿萨德', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-26 13:58:10'); INSERT INTO `sys_answer` VALUES ('104', '1', '4539AFC5-B3F9-6079-1A55-F518E959DD3F', '9', '111', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-26 13:59:06'); INSERT INTO `sys_answer` VALUES ('105', '1', 'A3DEDAC4-A68D-D2E4-DB2C-2B8735C996EA', '9', '阿萨德', '84', 'zhangwenfeng', '57', 'test', '2', '2019-02-26 14:06:51'); INSERT INTO `sys_answer` VALUES ('106', '1', '78CFAECE-FD3F-F26C-AA32-D19590DB57AF', '9', '语文考试大纲', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-27 09:54:39'); INSERT INTO `sys_answer` VALUES ('107', '2', '9F60C876-3386-512A-4C71-D373BB419768', '10', '', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-27 09:56:10'); INSERT INTO `sys_answer` VALUES ('108', '2', 'DC863248-48CA-1C70-8293-6B437E17BE9B', '9', '', '84', 'zhangwenfeng', '58', '孟祥光', '3', '2019-02-27 10:24:25'); INSERT INTO `sys_answer` VALUES ('109', '1', '03D0A29E-C4BF-8EA4-426F-8C8BDB924ABC', '9', '春天要来了么', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-27 10:46:28'); INSERT INTO `sys_answer` VALUES ('110', '2', '8663B668-308C-9DAA-EE43-112D995D32D6', '12', '', '84', 'zhangwenfeng', '59', '丁兴建', '2', '2019-02-27 10:47:46'); INSERT INTO `sys_answer` VALUES ('111', '2', '871969CF-077A-D57D-D34A-CC2B13D1E391', '9', '', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-27 16:14:13'); INSERT INTO `sys_answer` VALUES ('112', '2', '18C7F084-696D-2B30-2F1E-375CBF21BD2A', '9', '', '84', 'zhangwenfeng', '58', '孟祥光', '3', '2019-02-27 16:15:11'); INSERT INTO `sys_answer` VALUES ('113', '2', '3A2C7AE3-29DF-E65A-5725-09B88FCF9391', '9', '', '84', 'zhangwenfeng', '58', '孟祥光', '3', '2019-02-27 16:16:11'); INSERT INTO `sys_answer` VALUES ('114', '2', 'A713FF32-FA0E-EC14-0807-B797A2580289', '9', '', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-27 16:17:44'); INSERT INTO `sys_answer` VALUES ('115', '2', '11AD4CC9-4235-0F2C-1FAB-0FB6564A913D', '9', '', '84', 'zhangwenfeng', '57', 'test', '3', '2019-02-27 16:21:43'); INSERT INTO `sys_answer` VALUES ('116', '1', '0E8B8EB5-C1C8-C8F9-43C9-318C9C780D6E', '9', '2019年2月28日第一个问题', '84', 'zhangwenfeng', '58', '孟祥光', '2', '2019-02-28 11:12:34'); INSERT INTO `sys_answer` VALUES ('117', '2', 'F2202E89-5375-A7BB-3AB8-D6ACC9ACF50B', '9', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 11:12:53'); INSERT INTO `sys_answer` VALUES ('118', '2', '83CE32C1-300A-54FC-A77A-B645E6C0776E', '9', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 11:14:19'); INSERT INTO `sys_answer` VALUES ('119', '1', '27E3871A-50D9-CA4F-2F9F-5C95C1D3EA53', '13', '今天天气不错', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 13:08:41'); INSERT INTO `sys_answer` VALUES ('120', '2', '08B47D1B-9B15-7D61-A2D3-248E6DF22E6D', '10', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 13:12:52'); INSERT INTO `sys_answer` VALUES ('121', '2', '9FB7B9C7-48B7-477C-68F6-A6BE7DA69B4C', '9', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 13:24:40'); INSERT INTO `sys_answer` VALUES ('122', '2', '0A122216-40CC-14C0-E6FD-709953240642', '9', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 13:55:39'); INSERT INTO `sys_answer` VALUES ('123', '2', 'DA472E42-3710-6640-C768-B6BB26608A81', '9', '', '84', 'zhangwenfeng', null, '', '1', '2019-02-28 13:57:05'); INSERT INTO `sys_answer` VALUES ('124', '2', '09F638ED-C132-59FF-9D6E-4F6016495B64', '11', '', '84', 'zhangwenfeng', null, null, '1', '2019-02-28 14:52:23'); -- ---------------------------- -- Table structure for sys_exam -- ---------------------------- DROP TABLE IF EXISTS `sys_exam`; CREATE TABLE `sys_exam` ( `examid` int(11) NOT NULL AUTO_INCREMENT, `examsubid` int(11) DEFAULT NULL, `examsubname` varchar(255) DEFAULT NULL, `examcourseid` int(11) DEFAULT NULL, `examcoursename` varchar(255) DEFAULT NULL, `examcoursesectionid` int(11) DEFAULT NULL, `examcoursesectionname` varchar(255) DEFAULT NULL, `examname` varchar(255) DEFAULT NULL, `examscore` varchar(255) DEFAULT NULL, `examquestions` text, `examstatus` int(11) DEFAULT '1', `examtime` char(255) DEFAULT NULL, `examinuser` varchar(255) DEFAULT NULL, `examintime` datetime DEFAULT NULL, PRIMARY KEY (`examid`), KEY `examid` (`examid`,`examsubid`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_exam -- ---------------------------- INSERT INTO `sys_exam` VALUES ('2', '23', '高等数学', '99', '课程2020年山东专升本考试辅导高等数学II基础班', '8', '第一单元', '测试试卷', '100', null, '1', '60', 'admin', '2019-02-25 13:57:25'); -- ---------------------------- -- Table structure for sys_examhistory -- ---------------------------- DROP TABLE IF EXISTS `sys_examhistory`; CREATE TABLE `sys_examhistory` ( `ehid` int(11) NOT NULL AUTO_INCREMENT, `ehexamid` int(11) DEFAULT NULL, `ehscorelist` text, `errorlist` text, `ehanswer` text, `ehtime` int(11) DEFAULT NULL, `ehscore` varchar(255) DEFAULT '0', `ehstarttime` varchar(50) DEFAULT NULL, `ehendtime` varchar(50) DEFAULT NULL, `ehgrade` int(11) DEFAULT '1' COMMENT '1自评分,2教师评分', `ehstatus` int(11) DEFAULT '0' COMMENT '1,已完成答题,2可以继续答题', `userid` varchar(255) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, `ehgardestatus` int(11) DEFAULT '1' COMMENT '1,未阅卷2,已阅卷,3临时保存', `ehcheckuser` int(11) DEFAULT NULL, `chcheckusername` varchar(255) DEFAULT NULL, `ehcomment` text, `ehgardetime` char(40) DEFAULT NULL, `ehgardeendtime` char(40) DEFAULT NULL, PRIMARY KEY (`ehid`), KEY `ehid` (`ehid`,`ehexamid`,`userid`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_examhistory -- ---------------------------- INSERT INTO `sys_examhistory` VALUES ('2', '2', 'a:1:{i:1;s:1:\"2\";}', 'a:1:{i:2;s:1:\"A\";}', 'a:2:{i:1;s:1:\"B\";i:2;a:1:{i:1;s:1:\"A\";}}', '19', '2', '1551330925', '1551330944', '1', '1', '84', 'zhangwenfeng', '2', '84', 'zhangwenfeng', 's:0:\"\";', null, null); -- ---------------------------- -- Table structure for sys_file -- ---------------------------- DROP TABLE IF EXISTS `sys_file`; CREATE TABLE `sys_file` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `type` int(1) DEFAULT '1', `FileId` varchar(50) NOT NULL, `FilePath` varchar(255) NOT NULL, `FileExtension` varchar(50) NOT NULL, `FileSize` int(20) NOT NULL, `InUser` varchar(20) NOT NULL, `InTime` datetime NOT NULL, `key` varchar(255) DEFAULT NULL, PRIMARY KEY (`Id`), KEY `FileId` (`FileId`) USING BTREE ) ENGINE=MyISAM AUTO_INCREMENT=191 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_file -- ---------------------------- INSERT INTO `sys_file` VALUES ('144', '1', '24533F54-4E9E-111E-4FDC-8615D78276AE', 'pm4gmozbu.bkt.clouddn.com/1550885804', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550885804'); INSERT INTO `sys_file` VALUES ('143', '1', '52C463B0-1677-260B-541F-A6A681F3B80C', 'pm4gmozbu.bkt.clouddn.com/1550885738', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550885738'); INSERT INTO `sys_file` VALUES ('139', '1', '0A8E5E68-7EE3-9308-EF73-3E35EF741575', 'pm4gmozbu.bkt.clouddn.com/1550823721', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550823721'); INSERT INTO `sys_file` VALUES ('140', '1', '2F50A68B-0E3C-F5F6-94D2-ACCB69808BAA', 'pm4gmozbu.bkt.clouddn.com/1550823805', '', '0', '孟祥光', '2019-02-22 00:00:00', '1550823805'); INSERT INTO `sys_file` VALUES ('141', '1', '7625ABB0-C380-1E06-BDD2-D7B66AD55646', 'pm4gmozbu.bkt.clouddn.com/1550823842', '', '0', '孟祥光', '2019-02-22 00:00:00', '1550823842'); INSERT INTO `sys_file` VALUES ('142', '1', 'C8BC7E63-21FC-4E19-E6E9-54093AC83401', 'pm4gmozbu.bkt.clouddn.com/1550824518', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550824518'); INSERT INTO `sys_file` VALUES ('82', '1', '4C3ADCA9-17DD-2794-9186-78358207D858', 'Data/201902/18/095729fpsppvj7e7u7gmpv.png', 'png', '226', 'admin', '2019-02-18 00:00:00', null); INSERT INTO `sys_file` VALUES ('83', '1', 'FF144E6A-2694-F72D-70E4-54630F86DC69', 'Data/201902/18/095754jan3awl7nlmkom3c.png', 'png', '270', 'admin', '2019-02-18 00:00:00', null); INSERT INTO `sys_file` VALUES ('85', '1', 'B1733FA1-DCC6-812B-A02D-E872EE2661A8', 'Data/201902/18/100248gv74sypxswwzszws.jpg', 'jpg', '36', 'admin', '2019-02-18 00:00:00', null); INSERT INTO `sys_file` VALUES ('132', '1', 'EDA3C34B-06AF-79C0-E4B2-CFAD107BC3C2', 'pm4gmozbu.bkt.clouddn.com/1550806395', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550806395'); INSERT INTO `sys_file` VALUES ('137', '1', 'AC954546-9E02-49EA-6DF8-4DB68BAF8AA7', 'pm4gmozbu.bkt.clouddn.com/1550807510', '', '0', '孟祥光', '2019-02-22 00:00:00', '1550807510'); INSERT INTO `sys_file` VALUES ('138', '1', '1FDAC2A5-60A5-20F7-A68F-3CA768978420', 'pm4gmozbu.bkt.clouddn.com/1550823653', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550823653'); INSERT INTO `sys_file` VALUES ('84', '1', '22ED302E-89B8-1E3E-A44E-E288D2275A07', 'Data/201902/18/095925alrxf2x1ddeaisxe.jpg', 'jpg', '78', 'admin', '2019-02-18 00:00:00', null); INSERT INTO `sys_file` VALUES ('43', '1', '67B540DB-0087-1F04-4839-54B503931A8F', 'Data/201902/15/153039tyip2btzp9tp24y3.png', 'png', '1', 'admin', '2019-02-15 00:00:00', null); INSERT INTO `sys_file` VALUES ('44', '1', '61C14409-90F9-218F-33A1-F79419F2090B', 'Data/201902/15/153600nplpppmfppmbfpee.png', 'png', '1', 'admin', '2019-02-15 00:00:00', null); INSERT INTO `sys_file` VALUES ('119', '1', 'BE6FD11C-C29D-1A7B-C4F8-6986B2F32202', 'pm4gmozbu.bkt.clouddn.com/1550800464', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550800464'); INSERT INTO `sys_file` VALUES ('120', '2', 'DFC54DBF-9A15-617D-A48A-71D18E62FE32', 'pm4gmozbu.bkt.clouddn.com/1550804746', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550804746'); INSERT INTO `sys_file` VALUES ('121', '1', '5571EBAE-3B77-C685-44E6-B530F370FD2B', 'pm4gmozbu.bkt.clouddn.com/1550804811', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550804811'); INSERT INTO `sys_file` VALUES ('124', '2', 'DF5C3BAB-B6E6-AD4B-0D9D-AED095C06965', 'pm4gmozbu.bkt.clouddn.com/1550804895', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550804895'); INSERT INTO `sys_file` VALUES ('125', '1', 'E543721C-4B9D-78D3-AB72-8713CC87F9F8', 'pm4gmozbu.bkt.clouddn.com/1550804897', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550804897'); INSERT INTO `sys_file` VALUES ('118', '1', '336BA2B2-010A-8440-680A-4C6EA858A7A5', 'pm4gmozbu.bkt.clouddn.com/1550800184', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550800184'); INSERT INTO `sys_file` VALUES ('128', '1', 'D285FB32-0B34-49B4-2E34-F79AC747B916', 'pm4gmozbu.bkt.clouddn.com/1550805057', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550805057'); INSERT INTO `sys_file` VALUES ('129', '2', 'D285FB32-0B34-49B4-2E34-F79AC747B916', 'pm4gmozbu.bkt.clouddn.com/1550805063', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550805063'); INSERT INTO `sys_file` VALUES ('130', '2', '8E841529-80CA-4190-E1A3-CBDFFBD4D086', 'pm4gmozbu.bkt.clouddn.com/1550805420', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550805420'); INSERT INTO `sys_file` VALUES ('131', '1', '71A7C956-9F4F-9A78-2EF4-919D02412473', 'Data/201902/22/112347jrucoyo0hcylhojn.png', 'png', '270', 'admin', '2019-02-22 00:00:00', null); INSERT INTO `sys_file` VALUES ('98', '1', '40EA43A2-5B0A-392E-3E28-068F4FE1932A', 'Data/201902/19/142154alv93b29d99zv9bl.png', 'png', '32', 'admin', '2019-02-19 00:00:00', null); INSERT INTO `sys_file` VALUES ('110', '2', 'B06D2394-EF9E-6BCF-D819-43A0B7F9F666', 'pm4gmozbu.bkt.clouddn.com/1550760285', '', '0', 'zhangwenfeng', '2019-02-21 00:00:00', '1550760285'); INSERT INTO `sys_file` VALUES ('111', '2', '9A68ADF0-C893-2403-B9D9-0B9C91AEE5FE', 'pm4gmozbu.bkt.clouddn.com/1550795633', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550795633'); INSERT INTO `sys_file` VALUES ('112', '2', '9A68ADF0-C893-2403-B9D9-0B9C91AEE5FE', 'pm4gmozbu.bkt.clouddn.com/1550795839', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550795839'); INSERT INTO `sys_file` VALUES ('113', '1', 'F64BA974-22C6-62C8-AECC-08CE1F7C1DC3', 'pm4gmozbu.bkt.clouddn.com/1550795869', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550795869'); INSERT INTO `sys_file` VALUES ('114', '2', 'E6956F26-220F-6ADD-E2B7-288245B501D3', 'pm4gmozbu.bkt.clouddn.com/1550795882', '', '0', 'zhangwenfeng', '2019-02-22 00:00:00', '1550795882'); INSERT INTO `sys_file` VALUES ('115', '1', '7801F3C0-F0D9-1E1F-6EC2-88EAFFD6CD86', 'Data/201902/22/094715o0r8g1pv421gk2c0.jpg', 'jpg', '1', 'admin', '2019-02-22 00:00:00', null); INSERT INTO `sys_file` VALUES ('116', '1', '74579318-81A0-BBB9-669C-D605E4ECE0FA', 'Data/201902/22/094728q8a43mt514zte2m1.png', 'png', '2', 'admin', '2019-02-22 00:00:00', null); INSERT INTO `sys_file` VALUES ('117', '1', '6AD50832-1FF0-8D2C-7C06-E08F65914E2A', 'Data/201902/22/094739h2kabw6ccocc6kcj.png', 'png', '1', 'admin', '2019-02-22 00:00:00', null); INSERT INTO `sys_file` VALUES ('145', '2', '809E6F0A-5AB7-F107-BBB3-FA5A9F497027', 'pm4gmozbu.bkt.clouddn.com/1550886095', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550886095'); INSERT INTO `sys_file` VALUES ('146', '1', '809E6F0A-5AB7-F107-BBB3-FA5A9F497027', 'pm4gmozbu.bkt.clouddn.com/1550886096', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550886096'); INSERT INTO `sys_file` VALUES ('147', '2', '5AA599D1-3095-6E3D-9056-697BB80D8921', 'pm4gmozbu.bkt.clouddn.com/1550886196', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550886196'); INSERT INTO `sys_file` VALUES ('148', '1', '5AA599D1-3095-6E3D-9056-697BB80D8921', 'pm4gmozbu.bkt.clouddn.com/1550886197', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550886197'); INSERT INTO `sys_file` VALUES ('149', '2', '11C5385C-A58C-870F-AE71-4404C54FB342', 'pm4gmozbu.bkt.clouddn.com/1550886644', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550886644'); INSERT INTO `sys_file` VALUES ('151', '1', '846470E9-9F96-BC5F-5101-9FC8DC5A63BB', 'pm4gmozbu.bkt.clouddn.com/1550888253', '', '0', '陈见柯', '2019-02-23 00:00:00', '1550888253'); INSERT INTO `sys_file` VALUES ('152', '2', '846470E9-9F96-BC5F-5101-9FC8DC5A63BB', 'pm4gmozbu.bkt.clouddn.com/1550888302', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550888302'); INSERT INTO `sys_file` VALUES ('153', '1', '1CEDDADF-98BE-68F3-B375-38A7D32C40C2', 'pm4gmozbu.bkt.clouddn.com/1550888848', '', '0', '孟祥光', '2019-02-23 00:00:00', '1550888848'); INSERT INTO `sys_file` VALUES ('155', '1', 'CCB01580-BC52-92ED-D028-98EFCDD1A4B3', 'pm4gmozbu.bkt.clouddn.com/1550888883', '', '0', '丁兴建', '2019-02-23 00:00:00', '1550888883'); INSERT INTO `sys_file` VALUES ('156', '2', '68967B1F-DEDE-5A6C-0CA3-C60A61E781A6', 'pm4gmozbu.bkt.clouddn.com/1550888885', '', '0', 'zhangwenfeng', '2019-02-23 00:00:00', '1550888885'); INSERT INTO `sys_file` VALUES ('157', '1', 'EB48E431-8A31-90E4-E84D-9893131DA77D', 'pm4gmozbu.bkt.clouddn.com/1551086035', '', '0', 'zhangwenfeng', '2019-02-25 00:00:00', '1551086035'); INSERT INTO `sys_file` VALUES ('158', '1', '15027156-26C5-EA41-1A23-9ADF652988CC', 'pm4gmozbu.bkt.clouddn.com/1551086629', '', '0', 'zhangwenfeng', '2019-02-25 00:00:00', '1551086629'); INSERT INTO `sys_file` VALUES ('159', '1', '5ADCDA24-EEB3-8FCA-0C6F-AB0F18D6B5B2', 'pm4gmozbu.bkt.clouddn.com/1551153605', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551153605'); INSERT INTO `sys_file` VALUES ('160', '1', '9EEEF797-2170-8005-954D-5B227561CEA5', 'pm4gmozbu.bkt.clouddn.com/1551160161', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551160161'); INSERT INTO `sys_file` VALUES ('161', '1', '6A9FA93F-FA22-A3C7-4877-68F8C9CFB238', 'pm4gmozbu.bkt.clouddn.com/1551160690', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551160690'); INSERT INTO `sys_file` VALUES ('162', '1', '4539AFC5-B3F9-6079-1A55-F518E959DD3F', 'pm4gmozbu.bkt.clouddn.com/1551160745', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551160745'); INSERT INTO `sys_file` VALUES ('163', '1', 'A3DEDAC4-A68D-D2E4-DB2C-2B8735C996EA', 'pm4gmozbu.bkt.clouddn.com/1551161211', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551161211'); INSERT INTO `sys_file` VALUES ('164', '2', 'CFC85719-1641-EE7E-8A09-529ED90C42B2', 'pm4gmozbu.bkt.clouddn.com/1551163165', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551163165'); INSERT INTO `sys_file` VALUES ('165', '2', 'CFC9DDA4-C566-4710-0474-B01CE5146DC3', 'pm4gmozbu.bkt.clouddn.com/1551163208', '', '0', 'zhangwenfeng', '2019-02-26 00:00:00', '1551163208'); INSERT INTO `sys_file` VALUES ('166', '1', '78CFAECE-FD3F-F26C-AA32-D19590DB57AF', 'pm4gmozbu.bkt.clouddn.com/1551232478', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551232478'); INSERT INTO `sys_file` VALUES ('167', '2', '9F60C876-3386-512A-4C71-D373BB419768', 'pm4gmozbu.bkt.clouddn.com/1551232569', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551232569'); INSERT INTO `sys_file` VALUES ('168', '2', 'DC863248-48CA-1C70-8293-6B437E17BE9B', 'pm4gmozbu.bkt.clouddn.com/1551234264', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551234264'); INSERT INTO `sys_file` VALUES ('169', '1', 'C16DDD59-AD39-3B22-B6A2-BA5E9ED29AA9', 'pm4gmozbu.bkt.clouddn.com/1551235558', '', '0', '孟祥光', '2019-02-27 00:00:00', '1551235558'); INSERT INTO `sys_file` VALUES ('170', '1', '03D0A29E-C4BF-8EA4-426F-8C8BDB924ABC', 'pm4gmozbu.bkt.clouddn.com/1551235588', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551235588'); INSERT INTO `sys_file` VALUES ('171', '2', '8663B668-308C-9DAA-EE43-112D995D32D6', 'pm4gmozbu.bkt.clouddn.com/1551235665', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551235665'); INSERT INTO `sys_file` VALUES ('172', '1', '7D318D3E-27DA-7C41-668D-769641D732A1', 'pm4gmozbu.bkt.clouddn.com/1551245964', '', '0', '丁兴建', '2019-02-27 00:00:00', '1551245964'); INSERT INTO `sys_file` VALUES ('173', '1', '6315794B-4847-24FD-17F4-E7652621C204', 'pm4gmozbu.bkt.clouddn.com/1551250164', '', '0', '孟祥光', '2019-02-27 00:00:00', '1551250164'); INSERT INTO `sys_file` VALUES ('174', '1', '551C6671-850A-E897-F5C8-02692D9E6A23', 'pm4gmozbu.bkt.clouddn.com/1551255356', '', '0', '孟祥光', '2019-02-27 00:00:00', '1551255356'); INSERT INTO `sys_file` VALUES ('175', '2', '11AD4CC9-4235-0F2C-1FAB-0FB6564A913D', 'pm4gmozbu.bkt.clouddn.com/LeBgjRO1QctOEgfOADIy-7B38CE=/FhBAfAoNJyAmPJC4wFVRdZi9mKDM', '', '0', '', '2019-02-27 00:00:00', 'LeBgjRO1QctOEgfOADIy-7B38CE=/FhBAfAoNJyAmPJC4wFVRdZi9mKDM'); INSERT INTO `sys_file` VALUES ('176', '1', '438810D1-8416-1410-F4B8-9CC650954757', 'pm4gmozbu.bkt.clouddn.com/1551260936', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551260936'); INSERT INTO `sys_file` VALUES ('177', '1', '438810D1-8416-1410-F4B8-9CC650954757', 'pm4gmozbu.bkt.clouddn.com/1551260938', '', '0', 'zhangwenfeng', '2019-02-27 00:00:00', '1551260938'); INSERT INTO `sys_file` VALUES ('178', '1', '773EC624-554A-8356-E6FC-1D4DA1394C33', 'pm4gmozbu.bkt.clouddn.com/1551261332', '', '0', 'test', '2019-02-27 00:00:00', '1551261332'); INSERT INTO `sys_file` VALUES ('179', '1', '773EC624-554A-8356-E6FC-1D4DA1394C33', 'pm4gmozbu.bkt.clouddn.com/1551261333', '', '0', 'test', '2019-02-27 00:00:00', '1551261333'); INSERT INTO `sys_file` VALUES ('180', '1', '59040A00-7071-2A03-C6FC-6C6FFBC5ED1B', 'pm4gmozbu.bkt.clouddn.com/1551322894', '', '0', 'test', '2019-02-28 00:00:00', '1551322894'); INSERT INTO `sys_file` VALUES ('181', '1', 'B981659E-00F4-DA5E-953A-114E615294A3', 'pm4gmozbu.bkt.clouddn.com/1551323097', '', '0', 'test', '2019-02-28 00:00:00', '1551323097'); INSERT INTO `sys_file` VALUES ('182', '2', 'B981659E-00F4-DA5E-953A-114E615294A3', 'pm4gmozbu.bkt.clouddn.com/1551323098', '', '0', 'zhangwenfeng', '2019-02-28 00:00:00', '1551323098'); INSERT INTO `sys_file` VALUES ('183', '1', '0E8B8EB5-C1C8-C8F9-43C9-318C9C780D6E', 'pm4gmozbu.bkt.clouddn.com/1551323554', '', '0', 'zhangwenfeng', '2019-02-28 00:00:00', '1551323554'); INSERT INTO `sys_file` VALUES ('184', '2', 'F2202E89-5375-A7BB-3AB8-D6ACC9ACF50B', 'pm4gmozbu.bkt.clouddn.com/1551323572', '', '0', 'zhangwenfeng', '2019-02-28 00:00:00', '1551323572'); INSERT INTO `sys_file` VALUES ('185', '2', '83CE32C1-300A-54FC-A77A-B645E6C0776E', 'pm4gmozbu.bkt.clouddn.com/1551323658', '', '0', 'zhangwenfeng', '2019-02-28 00:00:00', '1551323658'); INSERT INTO `sys_file` VALUES ('186', '1', '87DB1CA9-199E-098C-5893-F2E5C740E42E', 'pm4gmozbu.bkt.clouddn.com/1551323751', '', '0', '孟祥光', '2019-02-28 00:00:00', '1551323751'); INSERT INTO `sys_file` VALUES ('187', '1', '27E3871A-50D9-CA4F-2F9F-5C95C1D3EA53', 'pm4gmozbu.bkt.clouddn.com/1551330518', '', '0', 'zhangwenfeng', '2019-02-28 00:00:00', '1551330518'); INSERT INTO `sys_file` VALUES ('188', '2', '0A122216-40CC-14C0-E6FD-709953240642', 'pm4gmozbu.bkt.clouddn.com/LeBgjRO1QctOEgfOADIy-7B38CE=/FnBzW9Wc-KTi4XIOcegVVZeuYpd9', '', '0', '', '2019-02-28 00:00:00', 'LeBgjRO1QctOEgfOADIy-7B38CE=/FnBzW9Wc-KTi4XIOcegVVZeuYpd9'); INSERT INTO `sys_file` VALUES ('189', '2', 'DA472E42-3710-6640-C768-B6BB26608A81', 'pm4gmozbu.bkt.clouddn.com/LeBgjRO1QctOEgfOADIy-7B38CE=/FtIx6bCEJ0AzjjSSYWwa0dy98XOs', '', '0', '', '2019-02-28 00:00:00', 'LeBgjRO1QctOEgfOADIy-7B38CE=/FtIx6bCEJ0AzjjSSYWwa0dy98XOs'); INSERT INTO `sys_file` VALUES ('190', '2', '09F638ED-C132-59FF-9D6E-4F6016495B64', 'pm4gmozbu.bkt.clouddn.com/LeBgjRO1QctOEgfOADIy-7B38CE=/FoyOqy-Fyd7H1LPYeo6V2eaNfG4X', '', '0', '', '2019-02-28 00:00:00', 'LeBgjRO1QctOEgfOADIy-7B38CE=/FoyOqy-Fyd7H1LPYeo6V2eaNfG4X'); -- ---------------------------- -- Table structure for sys_question -- ---------------------------- DROP TABLE IF EXISTS `sys_question`; CREATE TABLE `sys_question` ( `questionid` int(11) NOT NULL AUTO_INCREMENT, `examid` int(11) DEFAULT NULL, `questiontype` int(11) DEFAULT NULL, `question` text COMMENT '题干', `questionselect` text COMMENT '选项', `questionselectnumber` int(11) DEFAULT NULL COMMENT '选选项数量', `questionanswer` text COMMENT '答案', `questiondescribe` text COMMENT '解析', `questionscore` text COMMENT '分值', `questionvideo` text, `questionstatus` int(11) DEFAULT '1', `questionparent` int(11) DEFAULT '0', `questioncreatetime` datetime DEFAULT NULL, `questionuser` varchar(255) DEFAULT NULL, `questioncap` int(11) DEFAULT '0', PRIMARY KEY (`questionid`), KEY `questionid` (`questionid`,`questiontype`,`questionstatus`,`examid`) USING BTREE ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_question -- ---------------------------- INSERT INTO `sys_question` VALUES ('1', '2', '3', '<p>测试题干()</p>', '<p>A、选这个<br/>B、选这个<br/>C、选这个<br/>D、选中<br/></p>', '4', 'B', '<p>暂无解析</p>', '2', '', '1', '0', '2019-02-25 14:09:09', 'admin', '0'); INSERT INTO `sys_question` VALUES ('2', '2', '4', '<p>测试测试测试</p>', '<p>A 阿萨德<br/>B 洒水大所大<br/>C 萨达所大速度<br/>D 嗷嗷待食大所<br/></p>', '4', 'ABC', '<p>111</p>', '2', '', '1', '0', '2019-02-25 14:31:59', 'student', '0'); -- ---------------------------- -- Table structure for sys_subject -- ---------------------------- DROP TABLE IF EXISTS `sys_subject`; CREATE TABLE `sys_subject` ( `id` int(11) NOT NULL AUTO_INCREMENT, `CID` varchar(255) DEFAULT NULL, `subject` varchar(255) DEFAULT NULL, `voice` varchar(255) DEFAULT NULL, `image` varchar(255) DEFAULT NULL, `voicecoin` decimal(10,0) DEFAULT NULL, `imagecoin` decimal(10,0) DEFAULT NULL, `addtime` datetime DEFAULT NULL, `inuser` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_subject -- ---------------------------- INSERT INTO `sys_subject` VALUES ('9', '67B540DB-0087-1F04-4839-54B503931A8F', '语文', '1', '1', '10', '10', '2019-02-15 15:35:38', 'admin'); INSERT INTO `sys_subject` VALUES ('10', '61C14409-90F9-218F-33A1-F79419F2090B', '高等数学', '1', '1', '10', '10', '2019-02-15 15:36:02', 'admin'); INSERT INTO `sys_subject` VALUES ('11', '6AD50832-1FF0-8D2C-7C06-E08F65914E2A', '英语', '1', '1', '20', '10', '2019-02-22 09:47:40', 'admin'); INSERT INTO `sys_subject` VALUES ('12', '74579318-81A0-BBB9-669C-D605E4ECE0FA', '计算机', '1', '1', '20', '10', '2019-02-22 09:47:30', 'admin'); INSERT INTO `sys_subject` VALUES ('13', '7801F3C0-F0D9-1E1F-6EC2-88EAFFD6CD86', '政策咨询', '1', '1', '10', '10', '2019-02-22 09:47:17', 'admin'); -- ---------------------------- -- Table structure for sys_teachanswerd -- ---------------------------- DROP TABLE IF EXISTS `sys_teachanswerd`; CREATE TABLE `sys_teachanswerd` ( `id` int(11) NOT NULL AUTO_INCREMENT, `answerid` int(11) DEFAULT NULL, `teachid` int(11) DEFAULT NULL, `cid` varchar(255) DEFAULT NULL, `teachcontent` varchar(255) DEFAULT NULL, `teachname` varchar(255) DEFAULT NULL, `rank` varchar(255) DEFAULT NULL, `coin` decimal(10,0) DEFAULT NULL, `addtime` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `id` (`id`,`answerid`,`teachid`) ) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_teachanswerd -- ---------------------------- INSERT INTO `sys_teachanswerd` VALUES ('19', '84', '55', 'EB87A9C9-E2C0-0AF3-EC39-DEF1FB7AA8CD', '提前准备,多做练习', '陈见柯', '5', '10', '2019-02-22 10:24:46'); INSERT INTO `sys_teachanswerd` VALUES ('20', '85', '57', 'DF5C3BAB-B6E6-AD4B-0D9D-AED095C06965', '1', 'test', '5', '10', '2019-02-22 11:08:14'); INSERT INTO `sys_teachanswerd` VALUES ('21', '88', '57', 'D285FB32-0B34-49B4-2E34-F79AC747B916', '阿打算', 'test', '5', '10', '2019-02-22 11:11:02'); INSERT INTO `sys_teachanswerd` VALUES ('22', '86', '57', 'CAB695F1-55C5-63B5-C5C6-3259289628E0', 'asdas', 'test', null, '10', '2019-02-22 11:14:45'); INSERT INTO `sys_teachanswerd` VALUES ('23', '87', '58', 'CE705CB7-D8D8-9E46-2C86-505D5E78CE7B', '一般在每年3月份下旬考试', '孟祥光', null, '10', '2019-02-22 11:29:05'); INSERT INTO `sys_teachanswerd` VALUES ('24', '83', '58', '07E2E786-CAA2-4E51-55E8-C7A60DBE5C71', '此问题无解', '孟祥光', null, '20', '2019-02-22 11:32:05'); INSERT INTO `sys_teachanswerd` VALUES ('25', '82', '58', 'FB615721-E6ED-7DCF-5AF7-C03B27BF0A15', '不好回答呀', '孟祥光', null, '10', '2019-02-22 11:33:02'); INSERT INTO `sys_teachanswerd` VALUES ('26', '89', '58', 'AC954546-9E02-49EA-6DF8-4DB68BAF8AA7', '这个问题好回答呀', '孟祥光', '5', '10', '2019-02-22 11:51:57'); INSERT INTO `sys_teachanswerd` VALUES ('27', '91', '58', '2F50A68B-0E3C-F5F6-94D2-ACCB69808BAA', '专升本考试重点在于词汇和阅读', '孟祥光', null, '10', '2019-02-22 16:23:31'); INSERT INTO `sys_teachanswerd` VALUES ('28', '90', '58', '7625ABB0-C380-1E06-BDD2-D7B66AD55646', '域名服务器的作用就是域名解析', '孟祥光', null, '10', '2019-02-22 16:24:12'); INSERT INTO `sys_teachanswerd` VALUES ('29', '95', '55', '846470E9-9F96-BC5F-5101-9FC8DC5A63BB', '回答见录音', '陈见柯', '3', '10', '2019-02-23 10:18:22'); INSERT INTO `sys_teachanswerd` VALUES ('30', '92', '58', '1CEDDADF-98BE-68F3-B375-38A7D32C40C2', '沙发沙发防辐射', '孟祥光', null, '10', '2019-02-23 10:27:47'); INSERT INTO `sys_teachanswerd` VALUES ('31', '92', '54', '68967B1F-DEDE-5A6C-0CA3-C60A61E781A6', '回答1', '刘玥', null, '10', '2019-02-23 10:28:05'); INSERT INTO `sys_teachanswerd` VALUES ('32', '92', '59', 'CCB01580-BC52-92ED-D028-98EFCDD1A4B3', '丁兴建的回答', '丁兴建', null, '10', '2019-02-23 10:28:15'); INSERT INTO `sys_teachanswerd` VALUES ('33', '97', '59', '16CC7426-2470-D7A0-8358-B165D577AEAE', '丁兴建的回答', '丁兴建', '3', '10', '2019-02-23 10:33:13'); INSERT INTO `sys_teachanswerd` VALUES ('34', '97', '54', 'E0D7399F-E666-2F68-BE8D-6090D2D038DF', '刘玥回答2', '刘玥', null, '10', '2019-02-23 10:34:00'); INSERT INTO `sys_teachanswerd` VALUES ('35', '110', '59', '7D318D3E-27DA-7C41-668D-769641D732A1', '丁兴建回答', '丁兴建', '5', '20', '2019-02-27 13:39:30'); INSERT INTO `sys_teachanswerd` VALUES ('36', '109', '58', '6315794B-4847-24FD-17F4-E7652621C204', ' meng xiang guang 回答', '孟祥光', '3', '10', '2019-02-27 14:49:30'); INSERT INTO `sys_teachanswerd` VALUES ('37', '105', '57', 'CA574E0B-889B-8657-52E3-1B85AFE43F7B', '111', 'test', null, '10', '2019-02-27 17:43:28'); INSERT INTO `sys_teachanswerd` VALUES ('38', '104', '57', '438810D1-8416-1410-F4B8-9CC650954757', '文本', 'test', null, '10', '2019-02-27 17:48:58'); INSERT INTO `sys_teachanswerd` VALUES ('39', '103', '57', '773EC624-554A-8356-E6FC-1D4DA1394C33', '回答啊', 'test', null, '10', '2019-02-27 17:55:34'); INSERT INTO `sys_teachanswerd` VALUES ('40', '81', '57', 'B981659E-00F4-DA5E-953A-114E615294A3', 'xjj', 'test', null, '10', '2019-02-28 11:04:57'); INSERT INTO `sys_teachanswerd` VALUES ('41', '116', '58', '87DB1CA9-199E-098C-5893-F2E5C740E42E', '孟祥光回答', '孟祥光', '4', '10', '2019-02-28 11:15:52'); -- ---------------------------- -- Table structure for sys_teachpay -- ---------------------------- DROP TABLE IF EXISTS `sys_teachpay`; CREATE TABLE `sys_teachpay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `coin` int(11) DEFAULT NULL, `teachid` int(11) DEFAULT NULL, `teachname` varchar(255) DEFAULT NULL, `date` varchar(255) DEFAULT NULL, `indate` datetime DEFAULT NULL, `status` varchar(255) DEFAULT '1' COMMENT '1,未兑现,2银行卡转账', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_teachpay -- ---------------------------- INSERT INTO `sys_teachpay` VALUES ('4', '20', '55', '陈见柯', '2019-02', '2019-02-22 10:24:46', '2'); INSERT INTO `sys_teachpay` VALUES ('5', '30', '57', 'test', '2019-02', '2019-02-22 11:08:14', '2'); INSERT INTO `sys_teachpay` VALUES ('6', '80', '58', '孟祥光', '2019-02', '2019-02-22 11:29:05', '2'); INSERT INTO `sys_teachpay` VALUES ('7', '20', '54', '刘玥', '2019-02', '2019-02-23 10:28:05', '2'); INSERT INTO `sys_teachpay` VALUES ('8', '20', '59', '丁兴建', '2019-02', '2019-02-23 10:28:15', '2'); INSERT INTO `sys_teachpay` VALUES ('9', '20', '59', '丁兴建', '2019-02', '2019-02-27 13:39:30', '1'); INSERT INTO `sys_teachpay` VALUES ('10', '20', '58', '孟祥光', '2019-02', '2019-02-27 14:49:30', '1'); INSERT INTO `sys_teachpay` VALUES ('11', '40', '57', 'test', '2019-02', '2019-02-27 17:43:28', '1'); -- ---------------------------- -- Table structure for sys_teachrole -- ---------------------------- DROP TABLE IF EXISTS `sys_teachrole`; CREATE TABLE `sys_teachrole` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) DEFAULT NULL, `sectionid` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_teachrole -- ---------------------------- INSERT INTO `sys_teachrole` VALUES ('1', '60', '8'); INSERT INTO `sys_teachrole` VALUES ('2', '60', '9'); INSERT INTO `sys_teachrole` VALUES ('3', '60', '10'); -- ---------------------------- -- Table structure for sys_type -- ---------------------------- DROP TABLE IF EXISTS `sys_type`; CREATE TABLE `sys_type` ( `typeid` int(11) NOT NULL AUTO_INCREMENT, `examid` int(11) DEFAULT NULL, `typenum` varchar(255) DEFAULT NULL, `typename` varchar(255) DEFAULT NULL, `typeinfo` varchar(255) DEFAULT NULL, `type` int(11) DEFAULT NULL COMMENT '1,单选,2多选,3填空,4文字', `inuser` varchar(255) DEFAULT NULL, `intime` datetime DEFAULT NULL, PRIMARY KEY (`typeid`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_type -- ---------------------------- INSERT INTO `sys_type` VALUES ('1', null, null, null, null, null, null, null); INSERT INTO `sys_type` VALUES ('2', '1', '1', '1', '1', '1', 'admin', '2019-01-15 17:24:55'); INSERT INTO `sys_type` VALUES ('3', '2', '一', '单选题', '每题两分', '1', 'admin', '2019-02-25 13:57:56'); INSERT INTO `sys_type` VALUES ('4', '2', '二', '多选题', '每题两分', '2', 'admin', '2019-02-25 13:58:14'); -- ---------------------------- -- Table structure for sys_user -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` int(10) NOT NULL AUTO_INCREMENT, `UserName` varchar(20) NOT NULL DEFAULT '', `UserFull` varchar(50) DEFAULT NULL, `UserPwd` varchar(100) DEFAULT NULL, `UserType` int(10) DEFAULT '3' COMMENT '1是学生,2教师,3其他', `RoleID` varchar(5) DEFAULT NULL, `UserEmail` varchar(50) DEFAULT NULL COMMENT '公司邮箱', `UserStatus` int(10) DEFAULT NULL, `LoginIp` varchar(200) DEFAULT NULL, `InTime` varchar(30) DEFAULT NULL COMMENT '新增時間', `InUserName` varchar(50) DEFAULT NULL, `Contact` varchar(30) DEFAULT '' COMMENT '管理教师工号或者学生工号', `AuthKey` varchar(255) DEFAULT NULL, `AccessToken` varchar(255) DEFAULT NULL, `Phone` char(20) DEFAULT NULL, `UserInfo` text, `CID` char(40) DEFAULT NULL, `AnswerSubject` varchar(255) DEFAULT NULL, `Bank` varchar(255) DEFAULT NULL, `BankNum` int(20) DEFAULT NULL, `Aliname` varchar(255) DEFAULT NULL, `Alinum` varchar(255) DEFAULT NULL, `SubId` varchar(255) DEFAULT NULL, `SubName` varchar(255) DEFAULT NULL, `CourseId` varchar(255) DEFAULT NULL, `CourseName` varchar(255) DEFAULT NULL, `SectionId` varchar(255) DEFAULT NULL, `SectionName` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`,`UserName`) ) ENGINE=MyISAM AUTO_INCREMENT=61 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_user -- ---------------------------- INSERT INTO `sys_user` VALUES ('1', 'admin', '管理员', '21232f297a57a5a743894a0e4a801fc3', '3', '1', '', '1', null, '2015-12-03', 'admin', '', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('2', 'student', '学生', '21232f297a57a5a743894a0e4a801fc3', '3', '3', null, '1', null, '2015-12-03', 'admin', '', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('53', '郑柳依', '郑柳依', '81dc9bdb52d04dc20036dbd8313ed055', '2', '4', null, '1', null, '2019-02-22 02:04:03', 'admin', '', null, null, '13108450233', ' 郑柳依,女,1986年出生,博士,国内知名大学外国语学院教师;\n教育经历:\n2008年,天津外国语大学本科毕业获文学学士学位;\n2010年,西班牙庞培发布拉大学毕业获翻译学硕士学位;\n2016年,西班牙康普顿斯大学毕业获文学博士学位;\n科研项目\n世界文化多样性与海外民族志,参与课题,2012年国家社科基金重点项目\n西译汉中的词汇归化异化”及其文化流失研究,主持人,2017年校级科研培育项目\n20世纪中叶侦探小说文学现象研究,主持人, 2018校级科研项目\n擅长:阅读、写作;\n山东省专升本入学考试大学英语命题研究组成员\n ', '22ED302E-89B8-1E3E-A44E-E288D2275A07', '12,11,10', '123', '123', 'test1', '123', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('54', '刘玥', '刘玥', 'e10adc3949ba59abbe56e057f20f883e', '2', '4', null, '1', null, '2019-02-18 10:08:29', 'admin', '', null, null, '13126815518', '刘玥老师介绍\n刘玥,1985年生,山东济南人,\n2014年在中国人民大学获博士文学学位;\n现为知名高校人文学院古代汉语教研室教师;\n主讲课程有《古代汉语》《汉语史》《中国语言学史》《汉语文字学》《汉语词汇学》等。\n参与多项国家社科重大项目课题研究,并发表论文若干。\n山东省专升本入学考试大学语文命题研究组成员', 'FF144E6A-2694-F72D-70E4-54630F86DC69', '13,9', '中国银行', '0', 'test2', '1231222222222', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('55', '陈见柯', '陈见柯', 'e10adc3949ba59abbe56e057f20f883e', '2', '4', null, '1', null, '2019-02-18 10:06:59', 'admin', '', null, null, '131268888888', '陈见柯,男,国内知名大学理工学院教师,博士后 ', '4C3ADCA9-17DD-2794-9186-78358207D858', '10', '北京银行', '333333333', 'test3', '444444444444', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('58', '孟祥光', '孟祥光', 'e10adc3949ba59abbe56e057f20f883e', '2', '4', null, '1', null, '2019-02-22 03:50:49', 'admin', '', null, null, '13120319662', ' 中国大学教师 ', '71A7C956-9F4F-9A78-2EF4-919D02412473', '12,11,10,9', '北京银行', '2147483647', '田萱', '88888888888', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('57', 'test', 'test', '81dc9bdb52d04dc20036dbd8313ed055', '2', '4', null, '1', null, '2019-02-25 09:24:37', 'admin', '', null, null, '13108450233', ' ', '40EA43A2-5B0A-392E-3E28-068F4FE1932A', '13,12,11,10,9', 'test', '123123', 'test', 'test', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('56', '孙玲钰', '孙玲钰', 'e10adc3949ba59abbe56e057f20f883e', '2', '4', null, '1', null, '2019-02-18 10:07:48', 'admin', '', null, null, '13126815518', '孙凌钰老师,女,2014.06获得北京大学文学博士学位;\n主攻专业比较文学与世界文学;\n现任职于职某知名大学人文学院,任外国文学教研室讲师;\n主讲课程为本科生必修课“外国文学史”“西方文论概论”,选修课“西方文论经典导读”等;\n山东省专升本入学考试大学语文命题研究组组长', 'B1733FA1-DCC6-812B-A02D-E872EE2661A8', '12,9', '山东银行', '8888888', 'test4', '888888888888', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('59', '丁兴建', '丁兴建', 'e10adc3949ba59abbe56e057f20f883e', '2', '4', null, '1', null, '2019-02-23 10:25:01', 'admin', '', null, null, '11111111111111', ' ', 'ACA0AADD-129F-4813-F3CC-327BFE583264', '13,12,11,10,9', '北京银行', '888888888', '丁', '666666666666', null, null, null, null, null, null); INSERT INTO `sys_user` VALUES ('60', '测试老师', '测试老师', '81dc9bdb52d04dc20036dbd8313ed055', '2', '2', null, '1', null, '2019-02-25 01:59:16', 'admin', '', null, null, '13188888888', ' ', '1DE2B181-894A-6CBE-F90D-003AD83E5A40', null, null, null, null, null, 'f23', '高等数学', 's99', '课程2020年山东专升本考试辅导高等数学II基础班', 't8,t9,t10', '第一单元,第二单元,第三单元');
<reponame>shahriltech/e-pm<filename>db/e-pm.sql -- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: May 20, 2016 at 03:03 PM -- Server version: 5.5.43-0ubuntu0.14.04.1 -- PHP Version: 5.5.9-1ubuntu4.14 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: `e-pm` -- -- -------------------------------------------------------- -- -- Table structure for table `lookup_position` -- CREATE TABLE IF NOT EXISTS `lookup_position` ( `position_id` int(11) NOT NULL AUTO_INCREMENT, `position` varchar(100) DEFAULT NULL, `role` int(11) DEFAULT NULL, PRIMARY KEY (`position_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ; -- -- Dumping data for table `lookup_position` -- INSERT INTO `lookup_position` (`position_id`, `position`, `role`) VALUES (13, 'Pendidikan', 2), (14, 'Dakwah', 2), (15, 'Keselamatan', 2), (16, '<NAME>', 2), (17, 'Kebajikan', 2), (18, 'Ict', 2), (19, 'Ekonomi', 2), (20, '<NAME>', 2), (21, '<NAME>', 2), (22, 'Pembangunan', 2), (23, '<NAME>', 2), (24, 'Penerbitan', 2), (25, 'Nazir', 1), (26, '<NAME>', 1), (27, 'Bendahari', 1), (28, 'Setiausaha', 1), (29, 'Sistem Admin', 3); -- -------------------------------------------------------- -- -- Table structure for table `lookup_role` -- CREATE TABLE IF NOT EXISTS `lookup_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `role` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `lookup_role` -- INSERT INTO `lookup_role` (`id`, `role`) VALUES (1, 'Pengurusan'), (2, 'AJK/Sokongan'), (3, 'Admin'); -- -------------------------------------------------------- -- -- Table structure for table `paperwork` -- CREATE TABLE IF NOT EXISTS `paperwork` ( `id` int(5) NOT NULL AUTO_INCREMENT, `nama_program` varchar(200) DEFAULT NULL, `pw_obj` varchar(1000) DEFAULT NULL, `pw_background` varchar(1000) DEFAULT NULL, `pw_justifikasi` varchar(1000) DEFAULT NULL, `pw_advantage` varchar(1000) DEFAULT NULL, `pw_startdate` varchar(20) DEFAULT NULL, `pw_endDate` varchar(50) DEFAULT NULL, `jangka_masa` varchar(100) DEFAULT NULL, `pw_budget` decimal(10,2) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `status_by_su` int(11) DEFAULT '0', `status_by_bendahari` int(11) NOT NULL DEFAULT '0', `status_by_timbalan` int(11) NOT NULL DEFAULT '0', `status_by_nazir` int(11) NOT NULL DEFAULT '0', `pw_submit_status` varchar(200) DEFAULT NULL, `pw_norujukan` varchar(50) DEFAULT NULL, `pw_dateUpdated` varchar(50) DEFAULT NULL, `pw_yearApprove` varchar(20) DEFAULT NULL, `pw_monthlyApprove` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=55 ; -- -- Dumping data for table `paperwork` -- INSERT INTO `paperwork` (`id`, `nama_program`, `pw_obj`, `pw_background`, `pw_justifikasi`, `pw_advantage`, `pw_startdate`, `pw_endDate`, `jangka_masa`, `pw_budget`, `user_id`, `status_by_su`, `status_by_bendahari`, `status_by_timbalan`, `status_by_nazir`, `pw_submit_status`, `pw_norujukan`, `pw_dateUpdated`, `pw_yearApprove`, `pw_monthlyApprove`) VALUES (38, 'Program Kesedaran Ibu Bapa dan Pengenalan Job Coach Untuk Orang Kurang Upaya (OKU).', 'Pengisian program Job Coach ini adalah bagi memberi pendedahan dan penekanan kepada ibu bapa supaya mereka dapat membantu dan melatih perkembangan diri anak OKU bukan sahaja dari segi pendidikan malah dari segi pendekatan dan membuka peluang kepada anak-anak OKU itu sendiri.', 'Program ini akan berkunjung ke Perak buat pertama kalinya pada 29 Mei 2016 bersamaan hari Jumaat bertempat di Dewan Masjid Jamek, Bota. Program yang bakal dijalankan ini turut mendapat kerjasama dan sokongan daripada Jabatan Kebajikan Masyarakat.', 'Dengan berlangsungnya program ini, ianya dapat memberi kesedaran kepada ibu bapa mengenai kepentingan dalam meningkatkan motivasi diri Anak Kurang Upaya (OKU) serta melatih perkembangan diri anak-anak ini supaya mereka dapat berdikari apabila mereka besar kelak. Pengenalan Job Coach ini juga dapat membantu ibu bapa untuk melatih anak mereka serta membantu dari segi mencari pekerjaan untuk anak-anak mereka.', 'Kelebihan program ini dapat memberi kesedaran kepada ibu bapa malah dapat membantu <NAME> dalam beberapa program yang akan di jalankan di bawah Job Coach For Malaysia (JCFM).', '29/05/2016', '29/05/2016', '9.00 pagi - 1.00 petang', 5500.00, 37, 1, 1, 2, 2, 'Telah Di Hantar', 'e-kk72086', '2016-05-18', '2016', 'Mei, 2016'), (39, 'KERTAS CADANGAN PROGRAM TAZKIRAH ', 'Melahirkan warga SMKA yang memiliki sahsiah diri yang mulia, berbudi pekerti, berhemah dan cintakan ajaran Islam. Mewujudkan suasana keakraban, kemesraan dan seronok beramal ibadah demi menyemarakkan amalan secara jamaie serta seimbang dalam mengendalikan urusan duniawi dan ukhrawi. Melahirkan rasa bersyukur dengan nikmat keselesaan hidup dan kesihatan di kalangan warga SMKA. Memantap dan menyemarakkan lagi ukhuwah Islamiah antara warga SMK Agama Slim River. Melatih pelajar mempunyai keyakinan diri apabila berhadapan dengan orang ramai.', 'Semua murid SMK Agama Slim River, Perak Darul Ridzuan. Program yang dirancang adalah untuk kecemerlangan sahsiah pelajarSMK Agama Slim River sesuai dengan Falsafah Pendidikan Kebangsaan yangingin melahirkan insan yang seimbang dari segi jasmani, emosi, rohani danintelek. Program yang dirancang, perlu dilaksanakan secara berterusan agarmembuahkan hasil yang membanggakan. ', 'Program yang dirancang adalah untuk kecemerlangan sahsiah pelajarSMK Agama Slim River sesuai dengan Falsafah Pendidikan Kebangsaan yangingin melahirkan insan yang seimbang dari segi jasmani, emosi, rohani danintelek. Program yang dirancang, perlu dilaksanakan secara berterusan agarmembuahkan hasil yang membanggakan. ', 'Program Tazkirah adalah salah satu aktiviti yang dilaksanakan olehpara pelajar SMK Agama Slim River di bawah bimbingan AJK BADANI.Program ini dapat mehidupkan sunnah Rasulullah di samping melatih pelajarmempunyai keyakinan diri apabila berhadapan dengan para jamaahseterusnya dapat merapatkan hubungan antara warga SMK Agama SlimRiver serta menambah pahala. ', '19/05/2016', '21/05/2016', '9.00 pagi - 3.00 petang', 4500.00, 37, 0, 0, 0, 0, 'Belum Di hantar', 'e-kk06952', '2016-05-19', '2016', 'Mei, 2016'); -- -------------------------------------------------------- -- -- Table structure for table `reason_paperworkNotapproved` -- CREATE TABLE IF NOT EXISTS `reason_paperworkNotapproved` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sebab` varchar(1000) DEFAULT NULL, `paperwork_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Dumping data for table `reason_paperworkNotapproved` -- INSERT INTO `reason_paperworkNotapproved` (`id`, `sebab`, `paperwork_id`) VALUES (3, 'Peruntukan tidak mencukupi untuk program ini.', 38); -- -------------------------------------------------------- -- -- Table structure for table `status_paperwork` -- CREATE TABLE IF NOT EXISTS `status_paperwork` ( `id` int(11) NOT NULL AUTO_INCREMENT, `status` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Dumping data for table `status_paperwork` -- INSERT INTO `status_paperwork` (`id`, `status`) VALUES (0, 'Belum Diluluskan'), (1, 'Diluluskan'), (2, 'Tidak Diluluskan'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ic_no` varchar(14) DEFAULT NULL, `fullname` varchar(250) DEFAULT NULL, `username` varchar(100) DEFAULT NULL, `role` int(11) DEFAULT NULL, `password_hash` varchar(255) CHARACTER SET latin2 DEFAULT NULL, `position_id` int(100) DEFAULT NULL, `auth_key` varchar(50) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '10', `email` varchar(250) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `ic_no`, `fullname`, `username`, `role`, `password_hash`, `position_id`, `auth_key`, `status`, `email`) VALUES (26, '123456-78-9102', 'admin', 'admin', 3, '$2y$13$YuAjeB6XKLq5UUhgWAPS4.qlq6b1/CW4rit4lr7.fNtsWCfRl1aEK', 29, 'YRZOmY34aJv_V1F0Uzw2wECFi1cHkNdP', 10, '<EMAIL>'), (30, '910420-08-4563', 'shahril anuar bin md din ', 'shahril9', 2, '$2y$13$dXJbvFf0KKNZzXXltFmVmuyx5tAMYsbedCDUyKW6LVlOfd9HT13RO', 18, 'Rxhn8pI09-6qC9_UhBwXX3WMHPxPy8lx', 10, '<EMAIL>'), (34, '111135-55-1568', '<NAME>', 'zaid', 1, '$2y$13$ncHd715ZH54jZVfbnfHUReEaezYy.S./vSB2af7qRfQyInjsM2MHW', 28, '7Avgr48udem4D9syuUMZP02fJ7JI0xhg', 10, '<EMAIL>'), (35, '901211-12-4569', 'muhammad sazali bin ramli', 'sazali', 1, '$2y$13$NZ4uK.QBcH1LaoKjq5KTyepCJlnpwAd8N8QJ6i9u1PX6SzwYG5XRG', 27, '0NtQ7hV3BHb9w-qTW7YKN-ZU1t0SRwKp', 10, '<EMAIL>'), (36, '900401-03-1234', '<NAME>', 'zulmadi', 1, '$2y$13$2zEbRAIa6dyH9j8thkgsJ.IlZl3Fv1u54QdhaAFBaGqYIrYssPUPu', 26, '5wTzyLsh1z-amXdZvk-hlFZFUu0LC-so', 10, '<EMAIL>'), (37, '900808-14-6543', '<NAME>', 'fuad', 2, '$2y$13$Y8EmGIclJUj2kLzlMc/S..r9Hkd9vIJi8cmRU9vT9mOrGqzuRHhK.', 13, 'LA2ijPFPOiagiQLao9ImnjhnGXM9FEvP', 10, '<EMAIL>'), (38, '870505-06-9874', '<NAME>', 'nikpadel', 1, '$2y$13$YRRJRVwS1M3pKjjKXYsnEePdJHrhL2JvVxdK2zelSJD/WiNFloVla', 25, 'n7JDhC3zcPqjh_IDBwIExoNk1ygqnhQR', 10, '<EMAIL>'); -- -------------------------------------------------------- -- -- Table structure for table `userpass` -- CREATE TABLE IF NOT EXISTS `userpass` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pass` varchar(20) NOT NULL, `user_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ; -- -- Dumping data for table `userpass` -- INSERT INTO `userpass` (`id`, `pass`, `user_id`) VALUES (9, 'admin', 26), (13, 'shahril9', 30), (15, 'zaidgomez', 34), (16, 'sazali', 35), (17, 'zulmadi', 36), (18, 'fuad', 37), (19, 'nikpadel', 38); /*!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 */;
<filename>AprendiendoSQL/Ejercicios/ejercicio2.sql /* Modificar la comision de los vendedores y ponerla al 2% cuando ganan mas de 50000 */ UPDATE vendedores SET comision=0.5 WHERE sueldo >=50000;
<reponame>mikerodionov/ps_scripts DECLARE @YEAR AS INT SET @YEAR=2012 DECLARE @DBNAME VARCHAR(255) WHILE(@YEAR<=2017) BEGIN SET @DBNAME = 'K2Archive' + CAST(@YEAR AS VARCHAR(4)) PRINT @DBNAME SET @YEAR = @YEAR+1; END
CREATE TABLE `test.vacinations_per_country` ( `index` BIGINT, country TEXT, iso_code TEXT, date TEXT, total_vaccinations BIGINT, people_vaccinated BIGINT, people_fully_vaccinated BIGINT, daily_vaccinations_raw FLOAT(53), daily_vaccinations BIGINT, total_vaccinations_per_hundred FLOAT(53), people_vaccinated_per_hundred FLOAT(53), people_fully_vaccinated_per_hundred FLOAT(53), daily_vaccinations_per_million BIGINT, vaccines TEXT, source_name TEXT, source_website TEXT )
<reponame>dmitriso/Good-Burger -- THIS DROPS THE DATABASE IF IT ALREADY EXISTS DROP DATABASE burgers_db; -- THIS CREATES THE burgers_db CREATE DATABASE burgers_db; -- THIS DEISGNATES THE burgers_db TO BE AFFECTED USE burgers_db; -- THIS CREATES A NEW TABLE NAMED burgers CREATE TABLE burgers ( id INT NOT NULL AUTO_INCREMENT, burger_name VARCHAR(30) NOT NULL, devoured BOOLEAN DEFAULT false, PRIMARY KEY (id) ) -- THIS DIPLAYS THE burgers TABLE SELECT * FROM burgers;
USE [BuenDoctorData] GO INSERT INTO [USER_TYPE] VALUES (1,'Administrador',1); INSERT INTO [USER_TYPE] VALUES (2,'médicos',1); INSERT INTO [USER_TYPE] VALUES (3,'enfermeros',1); INSERT INTO [USER_TYPE] VALUES (4,'fisioterapeutas',1); GO INSERT INTO [APPOINTMENT_STATUS] VALUES (1,'Atendido',1); INSERT INTO [APPOINTMENT_STATUS] VALUES (2,'En servicio',1); INSERT INTO [APPOINTMENT_STATUS] VALUES (3,'No atendido',1); INSERT INTO [APPOINTMENT_STATUS] VALUES (4,'Asignado',1); INSERT INTO [APPOINTMENT_STATUS] VALUES (5,'Anulada',1); GO
<filename>Databases Basics - MS SQL Server/Basic CRUD/Basic CRUD/9.Find Names of All Employees by Salary in Range.sql SELECT FirstName,LastName,JobTitle FROM Employees WHERE Salary>=20000 AND Salary<=30000
CREATE TABLE if not exists users ( id INTEGER PRIMARY KEY AUTOINCREMENT, userid TEXT NOT NULL, password TEXT NOT NULL );
------------------------------------------------------- -- -- Title : [dbo].[AllCommunitiesView] -- Description : View for retrieving details about all the Communities, including the deleted ones. -- Input : N/A. -- Output : N/A. -- Author : v-sagna -- Date : 02 Jan 2012 -- ------------------------------------------------------- CREATE VIEW [dbo].[AllCommunitiesView] AS SELECT [dbo].[Community].[CommunityID] As [CommunityID] , [dbo].[Community].[Name] As [CommunityName] , [dbo].[Community].[Description] , [dbo].[Category].[CategoryID] AS [CategoryID] , [dbo].[Category].[Name] AS [CategoryName] , [dbo].[Community].[DistributedBy] , [dbo].[Community].[ThumbnailID] , [dbo].[Community].[CreatedByID] , [dbo].[Community].[CommunityTypeID] , [dbo].[Community].[ViewCount] , [dbo].[User].[FirstName] + ' ' + [dbo].[User].[LastName] AS [ProducedBy] , [dbo].[Community].[CreatedDatetime] , [dbo].[Community].[ModifiedDatetime] AS [LastUpdatedDatetime] , [Parent].[CommunityID] AS [ParentID] , [Parent].[Name] AS [ParentName] , [dbo].GetCommunityAccessType([dbo].[Community].[CommunityID]) AS [AccessType] , [dbo].GetAverageCommunityRating([dbo].[Community].[CommunityID]) AS [AverageRating] , [dbo].GetCommunityRatedPeopleCount([dbo].[Community].[CommunityID]) AS [RatedPeople] , [dbo].GetCommunityTags([dbo].[Community].[CommunityID]) AS [Tags] , [dbo].[Community].[IsDeleted] , [dbo].[Community].[IsOffensive] FROM [dbo].[Community] INNER JOIN [dbo].[Category] ON [dbo].[Community].[CategoryID] = [dbo].[Category].[CategoryID] INNER JOIN [dbo].[User] ON [dbo].[User].[UserID] = [dbo].[Community].[CreatedByID] LEFT OUTER JOIN [dbo].[CommunityRelation] ON [dbo].[Community].[CommunityID] = [dbo].[CommunityRelation].[ChildCommunityID] LEFT OUTER JOIN [dbo].[Community] AS [Parent] ON [dbo].[CommunityRelation].[ParentCommunityID] = [Parent].[CommunityID]
<gh_stars>1-10 DEFINE RECORD CDD$TOP.AD.AD_CEILINGONE DESCRIPTION IS /*One Dimensional Optional Ceiling Table*/. AD_CEILINGONE_CDD STRUCTURE. /* Element = OPTTABLE Description = Depreciation optional table code */ OPTTABLE DATATYPE IS TEXT SIZE IS 6. /* Element = DATE Description = Effective Date (YYYYMMDD) */ EFFDATE DATATYPE IS TEXT SIZE IS 8. /* Element = Description = Deprecition year */ DEP_YEAR DATATYPE IS TEXT SIZE IS 2. /* Element = Description = Ceiling amount */ CEILING DATATYPE IS G_FLOATING. END AD_CEILINGONE_CDD STRUCTURE. END AD_CEILINGONE.
vacuum; vacuum sales; vacuum sales to 100 percent; vacuum recluster sales; vacuum sort only sales to 75 percent; vacuum delete only sales to 75 percent; vacuum reindex listing; vacuum reindex listing to 75 percent; vacuum listing to 75 percent BOOST;
<reponame>johannesgerer/peekattack<gh_stars>1-10 DELIMITER $$ DROP PROCEDURE IF EXISTS `FindPartner` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `FindPartner` ( myFilterID BIGINT unsigned, myClientID BIGINT unsigned, OUT myPropertyID BIGINT unsigned, OUT Red5ClientID BIGINT unsigned, OUT ServerURL varchar(255), fGender tinyint(4), fSexual tinyint(3), fFacebook tinyint(1), fCountry char(2), fLanguage char(2), fCamera tinyint(1) unsigned, fUDP tinyint(1) unsigned, fLastParnterClientID BIGINT unsigned, ) BEGIN DECLARE PartnerClientID BIGINT unsigned; #################################################### ######## FIND myPropertyID ########### #################################################### SELECT fID INTO myPropertyID from tPropertySets WHERE #myP.fID=1; #myP.fGender = -1 AND #myP.fSexual = -1 AND #myP.fFacebook = 0 AND #myP.fCountry = 'AD' AND #myP.fLanguage = 'af' AND #myP.fCamera = 0 AND #myP.fUDP = 0 tPropertySets.fGender = fGender AND tPropertySets.fSexual = fSexual AND tPropertySets.fFacebook = fFacebook AND tPropertySets.fCountry = fCountry AND tPropertySets.fLanguage = fLanguage AND tPropertySets.fCamera = fCamera AND tPropertySets.fUDP = fUDP; #################################################### ######## FIND Partner ClientID ########## #################################################### SELECT #This tells me so far unkown myPropertyID, #which is found using WHERE with my properties c.fID,c.fRed5ClientID,c.ServerURL INTO PartnerClientID,Red5ClientID,ServerURL FROM tClients c JOIN vMatches ClientPropertyMatch JOIN vMatches ClientFilterMatch WHERE ClientPropertyMatch.propertyID = c.fPropertyID AND ClientPropertyMatch.filterID = myFilterID AND ClientFilterMatch.filterID = c.fFilterID AND ClientFilterMatch.propertyID = myPropertyID #Only show available AND c.fAvailable #Dont call myself AND c.fID <> fLastParnterClientID AND c.fID <> myClientID LIMIT 1; #################################################### ######## FIND Partner ClientID ########## #################################################### IF ClientID IS NOT NULL THEN UPDATE tClients c SET c.fAvailable = 0 WHERE c.fID=ClientID OR c.fID=PartnerClientID ELSE SELECT ClientID; END IF; END $$ DELIMITER ; ################################################# USE: #CALL FindPartner(240,4,-1,-1,0,'De','de',0,0,4,@a,@b,@c,@d);
<reponame>EcZachly/robinhood-nlp CREATE TABLE robinhood.news_content( url TEXT, title TEXT, source TEXT, content TEXT, tickers TEXT[], published_at TIMESTAMP, updated_at TIMESTAMP, num_clicks INTEGER, cleaned_content TEXT, content_positive_sentiment DECIMAL, content_negative_sentiment DECIMAL, content_neutral_sentiment DECIMAL, title_positive_sentiment DECIMAL, title_negative_sentiment DECIMAL, title_neutral_sentiment DECIMAL PRIMARY KEY(url) )
BEGIN TRANSACTION; CREATE TABLE "orders" ( `index` INTEGER PRIMARY KEY AUTOINCREMENT, `address` TEXT, `wif` TEXT, `private_key` TEXT, `paid` INTEGER, `address_salt` INTEGER, `item_index` INTEGER, `item_amount` INTEGER, `btc_address` TEXT, `order_price` REAL, `date` INTEGER, `note` TEXT ); CREATE TABLE "items" ( `name` TEXT NOT NULL, `ind` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, `price` REAL NOT NULL, `visible` INTEGER, `description` TEXT, `pcs` TEXT ); INSERT INTO `items` VALUES ('Project hat',1,1.0,-1,'-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Donations are pretty much welcome. 1KsxhDfYbF7Lg47wqeTgcZQgTVS18mzZrd Laffka -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAltvCL0ACgkQ2+cre6vr1tXROgD8DA+koJytuInHBb7EQVmOj37v V5Y83aQrTm7F+UaLqrkBAJt5A48GnAWDYRfPm8dTIZpgEnPN0cOCf/mPRjQusqBe =7yQ9 -----END PGP SIGNATURE-----','1,5,10,50,100'); CREATE TABLE `btc` ( `rate` REAL ); INSERT INTO `btc` VALUES (5358.13); COMMIT;
-- CreateTable CREATE TABLE "lobby" ( "lobby_id" SERIAL NOT NULL, "lobby_name" TEXT NOT NULL, "owner_id" INTEGER NOT NULL, "joined_users" INTEGER[], PRIMARY KEY ("lobby_id") ); -- AddForeignKey ALTER TABLE "lobby" ADD FOREIGN KEY ("owner_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
<reponame>rebremer/azure-synapseserverless-python-rest-api /****** Object: StoredProcedure [dbo].[get_taxidata] Script Date: 8/27/2021 9:28:46 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[get_taxidata] AS SET NOCOUNT ON; -- Cast is needed to corretly inform pyodbc of output type is NVARCHAR(MAX) -- Needed if generated json is bigger then 4000 bytes and thus pyodbc trucates it -- https://stackoverflow.com/questions/49469301/pyodbc-truncates-the-response-of-a-sql-server-for-json-query SELECT top 1000 * FROM [dbo].[taxidemo] FOR JSON PATH GO /****** Object: StoredProcedure [dbo].[get_taxidataAmount] Script Date: 8/27/2021 9:29:04 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[get_taxidataAmount] @Json NVARCHAR(MAX) AS SET NOCOUNT ON; DECLARE @total_amount FLOAT = JSON_VALUE(@Json, '$.total_amount'); SET NOCOUNT ON; -- Cast is needed to corretly inform pyodbc of output type is NVARCHAR(MAX) -- Needed if generated json is bigger then 4000 bytes and thus pyodbc trucates it -- https://stackoverflow.com/questions/49469301/pyodbc-truncates-the-response-of-a-sql-server-for-json-query SELECT top 1000 * FROM [dbo].[taxidemo] WHERE [total_amount] = @total_amount FOR JSON PATH GO
<filename>resources/customconfigs/de-sl/data/mapbender/cronjobs/update_loadstats.sql INSERT INTO mapbender.loadstat(load_count, title, abstract, type, date, fkey_id) SELECT load_count, wmc_title, abstract ,'wmc', current_date, fkey_wmc_serial_id FROM mapbender.wmc_load_count, mapbender.mb_user_wmc WHERE wmc_load_count.fkey_wmc_serial_id = mb_user_wmc.wmc_serial_id; DELETE FROM wmc_load_count; INSERT INTO mapbender.loadstat(load_count, title, abstract, type, date, fkey_id) SELECT load_count, layer_title, layer_abstract, 'layer', current_date, fkey_layer_id FROM mapbender.layer_load_count, mapbender.layer WHERE layer_load_count.fkey_layer_id = layer.layer_id; DELETE FROM layer_load_count;
<filename>core/src/test/resources/sql/create.sql CREATE TABLE test_null ( col_boolean boolean, col_date date, col_decimal decimal(8, 2), col_double double, col_float float, col_int int, col_varchar varchar(255), col_time time, col_timestamp timestamp ) ;; CREATE TABLE test_notnull ( col_boolean boolean NOT NULL, col_date date NOT NULL, col_decimal decimal(8, 2) NOT NULL, col_double double NOT NULL, col_float float NOT NULL, col_int int NOT NULL, col_varchar varchar(255) NOT NULL, col_time time NOT NULL, col_timestamp timestamp NOT NULL )
UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0, `groupid`=1 WHERE `entry` IN (39625, 48337, 40177, 48702, 40319, 48784, 40484); DELETE FROM `creature_onkill_reward` WHERE `creature_id` IN (39625, 48337, 40177, 48702, 40319, 48784, 40484, 48822); INSERT INTO `creature_onkill_reward` (`creature_id`, `RewOnKillRepFaction1`, `RewOnKillRepFaction2`, `MaxStanding1`, `IsTeamAward1`, `RewOnKillRepValue1`, `MaxStanding2`, `IsTeamAward2`, `RewOnKillRepValue2`, `TeamDependent`, `CurrencyId1`, `CurrencyId2`, `CurrencyId3`, `CurrencyCount1`, `CurrencyCount2`, `CurrencyCount3`) VALUES (48337, 1177, 1178, 7, 0, 300, 7, 0, 300, 1, 395, 0, 0, 7000, 0, 0), (39625, 1177, 1178, 7, 0, 270, 7, 0, 270, 1, 395, 0, 0, 3000, 0, 0), (40177, 1177, 1178, 7, 0, 270, 7, 0, 270, 1, 395, 0, 0, 3000, 0, 0), (48702, 1177, 1178, 7, 0, 300, 7, 0, 300, 1, 395, 0, 0, 7000, 0, 0), (40319, 1177, 1178, 7, 0, 270, 7, 0, 270, 1, 395, 0, 0, 3000, 0, 0), (48784, 1177, 1178, 7, 0, 300, 7, 0, 300, 1, 395, 0, 0, 7000, 0, 0), (40484, 1177, 1178, 7, 0, 270, 7, 0, 270, 1, 395, 0, 0, 3000, 0, 0), (48822, 1177, 1178, 7, 0, 300, 7, 0, 300, 1, 395, 0, 0, 7000, 0, 0); DELETE FROM `creature_loot_template` WHERE `entry` = 48822; INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 52078, 0, 1, 2, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56455, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56456, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56457, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56458, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56459, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56460, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56461, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56462, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56463, 0, 1, 1, 1, 1); INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (48822, 56464, 0, 1, 1, 1, 1);
<filename>Cancer Modifier/manual_work/concept_manual_dimension.sql --The file emulates stage tables creation only and used to populate the Manual tables --Table Preparation --cm_concept_dimension the manual File https://docs.google.com/spreadsheets/d/10INTlC8XeoAFRzkSbOc3rS37ilJn979qlvpkEHOaOYU/edit#gid=0 DROP TABLE IF EXISTS cm_concept_dimension; CREATE TABLE cm_concept_dimension ( old_concept_code varchar(50), old_concept_name varchar(255), new_concept_name varchar(255), status varchar(50), remap_to varchar(50), changed_class varchar(20) ) ; --Table Preparation --source_mapping_dimension the manual File https://docs.google.com/spreadsheets/d/1vUD_vgTCVtCFkE_IM9hIBAOaOsf9AyBQN0HMoobfjcQ/edit#gid=0 DROP TABLE IF EXISTS source_mapping_dimension; CREATE TABLE source_mapping_dimension ( source_vocabulary_id varchar(20), source_code varchar(50), source_name varchar(255), target_concept_name varchar(255), target_concept_code varchar(50), target_vocabulary_id varchar(20) ) ; --Concept_attributes the manual File https://docs.google.com/spreadsheets/d/1K7jeNwAy8b-L6RGFq_mte94jp3R8yza8G2LZZgicszg/edit#gid=0 DROP TABLE IF EXISTS Concept_attributes; CREATE TABLE Concept_attributes ( concept_name varchar(255), site varchar(255), meas varchar(255) ) ; --FROM source_mapping_dimension smd the manual File https://docs.google.com/spreadsheets/d/1K7jeNwAy8b-L6RGFq_mte94jp3R8yza8G2LZZgicszg/edit DROP TABLE IF EXISTS Attributes_hierarchy ; CREATE TABLE Attributes_hierarchy ( anc_atr varchar(255), desc_Atr varchar(255) ) ; TRUNCATE concept_manual; TRUNCATE concept_relationship_manual; --Codes to be Renamed Insert INSERT INTO concept_manual ( concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT new_concept_name, 'Measurement', 'Cancer Modifier', 'Dimension', 'S', old_concept_code, c.valid_start_date, c.valid_end_date, NULL FROM cm_concept_dimension a JOIN devv5.concept c ON c.concept_code = a.old_concept_code AND c.vocabulary_id = 'Cancer Modifier' WHERE status = 'Rename' ; --Concept Class Switch INSERT INTO concept_manual ( concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT old_concept_name, 'Measurement', 'Cancer Modifier', changed_class, 'S', old_concept_code, c.valid_start_date, c.valid_end_date, NULL FROM cm_concept_dimension a JOIN devv5.concept c ON c.concept_code = a.old_concept_code AND c.vocabulary_id = 'Cancer Modifier' WHERE status = 'Change_class' ; -- Concepts to be Deprecated INSERT INTO concept_manual (concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT old_concept_name, 'Measurement', 'Cancer Modifier', 'Dimension', NULL, old_concept_code, c.valid_start_date, CURRENT_DATE, 'D' FROM cm_concept_dimension a JOIN devv5.concept c ON c.concept_code = a.old_concept_code AND c.vocabulary_id = 'Cancer Modifier' WHERE status = 'Deprecate' ; -- Concepts to be Updatated Remapped INSERT INTO concept_manual (concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT old_concept_name, 'Measurement', 'Cancer Modifier', 'Dimension', NULL, old_concept_code, c.valid_start_date, CURRENT_DATE, 'U' FROM cm_concept_dimension a JOIN devv5.concept c ON c.concept_code = a.old_concept_code AND c.vocabulary_id = 'Cancer Modifier' WHERE status = 'Remap' ; --New concepts from Dimension Class to be added INSERT INTO concept_manual (concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT new_concept_name, 'Measurement', 'Cancer Modifier', 'Dimension', 'S', 'OMOP' || NEXTVAL('omop_seq') AS concept_code, CURRENT_DATE, TO_DATE('20991231', 'yyyyMMdd'), NULL FROM cm_concept_dimension WHERE status = 'Add_new' ; --New concepts with Attributive Chars to be added -- Morph Abnormality that was exactly measured INSERT INTO concept_manual ( concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT DISTINCT site, 'Observation', 'Cancer Modifier', 'Morph Abnormality', NULL, 'OMOP' || NEXTVAL('omop_seq') AS concept_code, CURRENT_DATE, TO_DATE('20991231', 'yyyyMMdd'), NULL FROM (SELECT DISTINCT site FROM Concept_attributes) a ; --New concepts with Attributive Chars to be added -- Type of Measurement performed INSERT INTO concept_manual ( concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason ) SELECT DISTINCT meas, 'Measurement', 'Cancer Modifier', 'Qualifier Value', NULL, 'OMOP' || NEXTVAL('omop_seq') AS concept_code, CURRENT_DATE, TO_DATE('20991231', 'yyyyMMdd'), NULL FROM (SELECT DISTINCT meas FROM Concept_attributes) a ; -- To make NAACCR concepts Non-Standard INSERT INTO concept_manual (concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason) SELECT DISTINCT c.concept_name, c.domain_id, c.vocabulary_id, c.concept_class_id, null as standard_concept, c.concept_code, c.valid_start_date, c.valid_end_date, c.invalid_reason FROM source_mapping_dimension m JOIN concept c ON m.source_code = c.concept_code WHERE m.source_vocabulary_id = c.vocabulary_id and c.vocabulary_id = 'NAACCR'; --CRM Population INSERT INTO concept_relationship_manual (concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason) SELECT c.concept_code AS cocnept_code_1, c1.concept_code AS cocnept_code_2, 'Cancer Modifier' AS vocabulary_id_1, 'Cancer Modifier' AS vocabulary_id_2, 'Inheres in' AS relationship_id, c1.valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, c1.invalid_reason FROM Concept_attributes cm JOIN concept_manual c ON cm.concept_name = c.concept_name JOIN concept_manual c1 ON cm.site = c1.concept_name AND c.concept_name != c1.concept_name UNION SELECT c.concept_code AS cocnept_code_1, c1.concept_code AS cocnept_code_2, 'Cancer Modifier' AS vocabulary_id_1, 'Cancer Modifier' AS vocabulary_id_2, 'Has property' AS relationship_id, c1.valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, c1.invalid_reason FROM Concept_attributes cm JOIN concept_manual c ON cm.concept_name = c.concept_name JOIN concept_manual c1 ON cm.meas = c1.concept_name AND c.concept_name != c1.concept_name UNION SELECT source_code AS cocnept_code_1, c.concept_code AS cocnept_code_2, source_vocabulary_id AS vocabulary_id_1, target_vocabulary_id AS vocabulary_id_2, 'Maps to' AS relationship_id, c.valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, c.invalid_reason FROM source_mapping_dimension smd JOIN concept_manual c ON smd.target_concept_name = c.concept_name and CASE WHEN target_concept_name='Thickness of Tumor' then c.concept_code else smd.target_concept_code end = c.concept_code UNION SELECT old_concept_code AS cocnept_code_1, remap_to AS cocnept_code_2, 'Cancer Modifier' AS vocabulary_id_1, 'Cancer Modifier' AS vocabulary_id_2, 'Maps to' AS relationship_id, CURRENT_DATE AS valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, NULL AS invalid_reason FROM cm_concept_dimension WHERE status = 'Remap' UNION SELECT old_concept_code AS cocnept_code_1, remap_to AS cocnept_code_2, 'Cancer Modifier' AS vocabulary_id_1, 'Cancer Modifier' AS vocabulary_id_2, 'Concept replaced by' AS relationship_id, CURRENT_DATE AS valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, NULL AS invalid_reason FROM cm_concept_dimension WHERE status = 'Remap' ; --Hierarchy of Attributes construction WITH a AS ( SELECT a.concept_name AS parent_name, d.concept_name AS child_name FROM Concept_attributes a JOIN Attributes_hierarchy b ON a.site = b.anc_atr --join Attributes_hierarchy c on a.meas = c.anc_atr JOIN Concept_attributes d ON d.site = b.desc_atr AND d.meas = a.meas AND a.concept_name != d.concept_name UNION SELECT a.concept_name AS parent_name, d.concept_name AS child_name FROM Concept_attributes a --join Attributes_hierarchy b on a.site = b.anc_atr JOIN Attributes_hierarchy c ON a.meas = c.anc_atr JOIN Concept_attributes d ON d.site = a.site AND d.meas = c.desc_atr AND a.concept_name != d.concept_name ) INSERT INTO concept_relationship_manual (concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason) SELECT cm2.concept_code AS cocnept_code_1, cm1.concept_code AS cocnept_code_2, /* cm2.concept_name AS cocnept_name_1, cm1.concept_name AS cocnept_name_2,*/ cm2.vocabulary_id AS vocabulary_id_1, cm1.vocabulary_id AS vocabulary_id_2, 'Is a' AS relationship_id, CURRENT_DATE AS valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, NULL AS invalid_reason FROM a JOIN concept_manual cm1 ON cm1.concept_name = a.parent_name JOIN concept_manual cm2 ON cm2.concept_name = a.child_name; ; --attributes inserting insert INTO concept_relationship_manual (concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason) SELECT --b.concept_name AS name_1, b.concept_code AS cocnept_code_1, --a.concept_name AS name_2, a.concept_code AS cocnept_code_2, b.vocabulary_id AS vocabulary_id_1, a.vocabulary_id AS vocabulary_id_2, 'Is a' AS relationship_id, CURRENT_DATE AS valid_start_date, TO_DATE('20991231', 'yyyyMMdd') AS valid_end_date, NULL AS invalid_reason FROM Attributes_hierarchy atr JOIN concept_manual a ON a.concept_name = atr.anc_atr JOIN concept_manual b ON b.concept_name = atr.desc_atr where a.concept_code != b.concept_code ; --CONCEPT MANUAL backup DROP TABLE concept_manual_dimension; CREATE TABLE concept_manual_dimension as SELECT distinct concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason FROM concept_manual ; --CONCEPT RELATIONSHIP MANUAL backup DROP TABLE concept_relationship_manual_dimension; CREATE TABLE concept_relationship_manual_dimension as SELECT distinct concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason FROM concept_relationship_manual ; --Manual Table Preparation TRUNCATE TABLE concept_relationship_manual; INSERT INTO concept_relationship_manual (concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason) SELECT concept_code_1, concept_code_2, vocabulary_id_1, vocabulary_id_2, relationship_id, valid_start_date, valid_end_date, invalid_reason FROM concept_relationship_manual_dimension ;
SELECT FirstName, LastName, EmailAddress /* get vendor agent of company*/ FROM Purchasing.VendorContact AS VendorContact /* get name of agent */ JOIN Person.Contact AS Contact ON VendorContact.ContactID = Contact.ContactID /* get name of company */ JOIN Purchasing.Vendor AS Vendor ON VendorContact.VendorID = Vendor.VendorID /* order by company name*/ ORDER BY Name
<gh_stars>100-1000 /************************************************************************** * Copyright 2016 Observational Health Data Sciences and Informatics (OHDSI) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Authors: <NAME>, <NAME> * Date: 2017 **************************************************************************/ DROP TABLE IF EXISTS SOURCES.RFMLDRH0_DXID_HIST; CREATE TABLE SOURCES.RFMLDRH0_DXID_HIST ( FMLPRVDXID VARCHAR (8) NOT NULL, FMLREPDXID VARCHAR (8) NOT NULL, FMLDXREPDT DATE ); DROP TABLE IF EXISTS SOURCES.RFMLDX0_DXID; CREATE TABLE SOURCES.RFMLDX0_DXID ( DXID VARCHAR (8) NOT NULL, DXID_DESC56 VARCHAR (56), DXID_DESC100 VARCHAR (100), DXID_STATUS VARCHAR (1) NOT NULL, FDBDX VARCHAR (9) NOT NULL, DXID_DISEASE_DURATION_CD VARCHAR (1) NOT NULL ); DROP TABLE IF EXISTS SOURCES.RFMLSYN0_DXID_SYN; CREATE TABLE SOURCES.RFMLSYN0_DXID_SYN ( DXID_SYNID VARCHAR (8) NOT NULL, DXID VARCHAR (8) NOT NULL, DXID_SYN_NMTYP VARCHAR (2) NOT NULL, DXID_SYN_DESC56 VARCHAR (56), DXID_SYN_DESC100 VARCHAR (100), DXID_SYN_STATUS VARCHAR (1) NOT NULL ); DROP TABLE IF EXISTS SOURCES.RINDMGC0_INDCTS_GCNSEQNO_LINK; CREATE TABLE SOURCES.RINDMGC0_INDCTS_GCNSEQNO_LINK ( GCN_SEQNO VARCHAR (6) NOT NULL, INDCTS VARCHAR (5) NOT NULL ); DROP TABLE IF EXISTS SOURCES.RINDMMA2_INDCTS_MSTR; CREATE TABLE SOURCES.RINDMMA2_INDCTS_MSTR ( INDCTS VARCHAR (5) NOT NULL, INDCTS_SN VARCHAR (2) NOT NULL, INDCTS_LBL VARCHAR (1) NOT NULL, FDBDX VARCHAR (9) NOT NULL, DXID VARCHAR (8), PROXY_IND VARCHAR (1), PRED_CODE VARCHAR (1) NOT NULL ); DROP TABLE IF EXISTS SOURCES.RDDCMGC0_CONTRA_GCNSEQNO_LINK; CREATE TABLE SOURCES.RDDCMGC0_CONTRA_GCNSEQNO_LINK ( GCN_SEQNO VARCHAR (6) NOT NULL, DDXCN VARCHAR (5) NOT NULL ); DROP TABLE IF EXISTS SOURCES.RDDCMMA1_CONTRA_MSTR; CREATE TABLE SOURCES.RDDCMMA1_CONTRA_MSTR ( DDXCN VARCHAR (5) NOT NULL, DDXCN_SN VARCHAR (2) NOT NULL, FDBDX VARCHAR (9), DDXCN_SL VARCHAR (1), DDXCN_REF VARCHAR (26), DXID VARCHAR (8) ); DROP TABLE IF EXISTS SOURCES.RFMLISR1_ICD_SEARCH; CREATE TABLE SOURCES.RFMLISR1_ICD_SEARCH ( SEARCH_ICD_CD VARCHAR (10) NOT NULL, ICD_CD_TYPE VARCHAR (2) NOT NULL, RELATED_DXID VARCHAR (8) NOT NULL, FML_CLIN_CODE VARCHAR (2) NOT NULL, FML_NAV_CODE VARCHAR (2) NOT NULL );
<reponame>KamLar/datly DROP TABLE IF EXISTS events; CREATE TABLE events ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, timestamp DATETIME, event_type_id INTEGER, quantity DECIMAL(7, 2) DEFAULT NULL, user_id INTEGER ); DROP TABLE IF EXISTS event_types; CREATE TABLE event_types ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(255), account_id INTEGER ); DROP TABLE IF EXISTS accounts; CREATE TABLE accounts ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(255), user_id INTEGER NOT NULL ); DROP TABLE IF EXISTS users; CREATE TABLE users ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(255), role VARCHAR(255) ); DROP TABLE IF EXISTS foos; CREATE TABLE foos ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(255), price DECIMAL(7, 2) ); DROP TABLE IF EXISTS dual; CREATE TABLE dual ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ); DROP TABLE IF EXISTS articles; CREATE TABLE articles ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, content VARCHAR(255), lang_id INTEGER ); DROP TABLE IF EXISTS datly_acl; CREATE TABLE datly_acl ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, subject VARCHAR(255), criteria VARCHAR(255), data_view varchar(255) );
<filename>src/main/resources/db.sql use trash; CREATE TABLE trash.trash_item ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(255) DEFAULT '' NOT NULL, alias varchar(512) DEFAULT '' NOT NULL, description varchar(512) DEFAULT '' NOT NULL, type_id int NOT NULL, score decimal(6, 2) DEFAULT 0 NOT NULL, create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci; CREATE TABLE trash.trash_type ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(255) DEFAULT '' NOT NULL, parent_id int DEFAULT 0 NULL, create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
create or alter proc dbo.uspCreateEvent @StartsAt datetimeoffset, @HomeId int, @AwayId int , @LeagueId int as begin set nocount on declare @EventId int select @EventId = EventId from dbo.Event where StartsAt = @StartsAt and HomeId = @HomeId and AwayId = @AwayId and LeagueId = @LeagueId if @@rowcount = 0 insert into Event (StartsAt, HomeId, AwayId, LeagueId) output inserted.EventId values (@StartsAt, @HomeId, @AwayId, @LeagueId) else select @EventId end
drop database if exists spring_cloud_zuul; create database spring_cloud_zuul; use spring_cloud_zuul; create table zuul_routes( id int(12) auto_increment, /* 编号 */ path varchar(60) not null, /* 请求路径 */ service_id varchar(60) null, /* 服务编号 */ url varchar(200) null, /* 映射路径 */ `enable` bit not null default 1, /* 是否启用*/ retryable bit not null default 1, /* 使用支持重试*/ primary key(id) ); insert into zuul_routes(path, service_id, url) values('/user-api/**', 'user', null); insert into zuul_routes(path, service_id, url) values('/fund-api/**', null, 'http://localhost:7001');
{{ config( sort='inferred_user_id', dist='inferred_user_id', unique_key='inferred_user_id' ) }} {% set timezone = var('snowplow:timezone', 'UTC') %} with add_to_cart as ( select * from {{ var('snowplow:add_to_cart') }} ), event_to_user_map as ( select * from {{ ref('snowplow_event_to_user_map') }} ), web_page_context as ( select event_id, page_view_id from {{ ref('snowplow_web_page_context') }} ), web_events_time as ( select * from {{ ref('snowplow_web_events_time') }} ), web_events_scroll_depth as ( select * from {{ ref('snowplow_web_events_scroll_depth') }} ), add_to_cart_with_user_id as ( select m.inferred_user_id, count(e.*) as add_to_cart_count, SUM(t.pv_count) AS add_to_cart_pv_count, SUM(t.pp_count) AS add_to_cart_pp_count, SUM(t.time_engaged_in_s) AS add_to_cart_time_engaged_in_s, {{convert_timezone("'UTC'", "'" ~ timezone ~ "'", 'MIN(t.min_tstamp)')}} as add_to_cart_first_time, MAX(d.vmax) AS add_to_cart_vertical_pixels_scrolled, MAX(d.br_viewheight) AS add_to_cart_viewport_length, round(add_to_cart_vertical_pixels_scrolled / NULLIF(add_to_cart_viewport_length, 0), 2) + 1 AS add_to_cart_viewports_consumed, MAX(d.doc_height) AS add_to_cart_page_height from event_to_user_map as m inner join add_to_cart as e on m.event_id = e.event_id left join web_page_context as c on e.event_id = c.event_id left join web_events_time as t on c.page_view_id = t.page_view_id left join web_events_scroll_depth as d on c.page_view_id = d.page_view_id group by m.inferred_user_id ) select * from add_to_cart_with_user_id
<filename>initdb.sql create table comments ( id varchar(64) not null, video_id varchar(64), author_id int(10), content text, time datetime default current_timestamp, primary key (id) ); create table sessions ( session_id tinytext not null, TTL tinytext, login_name text ); alter table sessions add primary key (session_id(64)); create table users ( id int unsigned not null auto_increment, login_name varchar(64), pwd text not null, unique key (login_name), primary key (id) ); create table video_del_rec ( video_id varchar(64) not null, primary key (video_id) ); create table video_info ( id varchar(64) not null, author_id int(10), name text, display_ctime text, create_time datetime default current_timestamp, primary key (id) );
--문제3 - EMP테이블에서 관리자가 없는 직원 정보 조회 SELECT * FROM EMP WHERE MGR IS NULL;
<filename>src/oc_erchef/schema/verify/org_user_associations.sql -- Verify org_user_associations BEGIN; SELECT org_id, user_id, last_updated_by, created_at, updated_at FROM org_user_associations WHERE FALSE; ROLLBACK;
<reponame>amit-git/titus-executor START TRANSACTION ; create unique index branch_eni_actions_associate_branch_eni_trunk_eni_idx_uindex on branch_eni_actions_associate (branch_eni, trunk_eni, idx) where state = 'pending'; COMMIT;
-- Test: Subqueries 2 SELECT '' AS two, f1 AS "Constant Select" FROM SUBSELECT_TBL1 WHERE f1 IN (SELECT 1) ORDER BY 2;
<reponame>wanyos2005/smartLearn -- phpMyAdmin SQL Dump -- version 4.4.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Nov 02, 2015 at 05:41 AM -- Server version: 5.6.26 -- PHP Version: 5.5.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `we@ss` -- -- -------------------------------------------------------- -- -- Table structure for table `migration` -- CREATE TABLE IF NOT EXISTS `migration` ( `version` varchar(180) NOT NULL, `apply_time` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `migration` -- INSERT INTO `migration` (`version`, `apply_time`) VALUES ('m000000_000000_base', 1445841009), ('m130524_201442_init', 1445841015); -- -------------------------------------------------------- -- -- Table structure for table `tbl_campuses` -- CREATE TABLE IF NOT EXISTS `tbl_campuses` ( `id` int(11) NOT NULL COMMENT 'ID', `inst_id` int(11) NOT NULL COMMENT 'Mother Institution', `name` varchar(128) NOT NULL COMMENT 'Campus Name', `phone1` varchar(20) DEFAULT NULL COMMENT 'Phone 1', `phone2` varchar(20) DEFAULT NULL COMMENT 'Phone 2', `phone3` varchar(20) DEFAULT NULL COMMENT 'Phone 3', `email1` varchar(128) DEFAULT NULL COMMENT 'Email 1', `email2` varchar(128) DEFAULT NULL COMMENT 'Email 2', `postal_address` varchar(128) DEFAULT NULL COMMENT 'Postal Address', `county` int(11) NOT NULL COMMENT 'County', `constituency` int(11) NOT NULL COMMENT 'Constituency', `town` varchar(30) NOT NULL COMMENT 'Nearest Town/Urban', `physical_address` varchar(128) NOT NULL COMMENT 'Physical Address', `main` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'Main Campus' ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_campuses` -- INSERT INTO `tbl_campuses` (`id`, `inst_id`, `name`, `phone1`, `phone2`, `phone3`, `email1`, `email2`, `postal_address`, `county`, `constituency`, `town`, `physical_address`, `main`) VALUES (1, 7, 'Nakuru Town Campus', '', '', '', '', '', '', 1, 1, 'Nairobi', 'Nairobi Town', 'no'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_centers` -- CREATE TABLE IF NOT EXISTS `tbl_centers` ( `id` int(11) NOT NULL COMMENT 'ID', `trainer_id` int(11) NOT NULL COMMENT 'Mother Institution', `name` varchar(128) NOT NULL COMMENT 'Center Name', `phone1` varchar(20) DEFAULT NULL COMMENT 'Phone 1', `phone2` varchar(20) DEFAULT NULL COMMENT 'Phone 2', `phone3` varchar(20) DEFAULT NULL COMMENT 'Phone 3', `email1` varchar(128) DEFAULT NULL COMMENT 'Email 1', `email2` varchar(128) DEFAULT NULL COMMENT 'Email 2', `postal_address` varchar(128) DEFAULT NULL COMMENT 'Postal Address', `county` int(11) NOT NULL COMMENT 'County', `constituency` int(11) NOT NULL COMMENT 'Constituency', `town` varchar(30) NOT NULL COMMENT 'Nearest Town/Urban', `physical_address` varchar(128) NOT NULL COMMENT 'Physical Address', `main` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'Head Office' ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_centers` -- INSERT INTO `tbl_centers` (`id`, `trainer_id`, `name`, `phone1`, `phone2`, `phone3`, `email1`, `email2`, `postal_address`, `county`, `constituency`, `town`, `physical_address`, `main`) VALUES (1, 6, 'Nairobi Center', '', '', '', '', '', '', 1, 1, 'Nairobi', 'Nairobi Town', 'yes'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_comment` -- CREATE TABLE IF NOT EXISTS `tbl_comment` ( `id` int(11) NOT NULL, `content` text COLLATE utf8_unicode_ci NOT NULL, `status` int(11) NOT NULL, `create_time` int(11) DEFAULT NULL, `author` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `post_id` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `tbl_comment` -- INSERT INTO `tbl_comment` (`id`, `content`, `status`, `create_time`, `author`, `email`, `url`, `post_id`) VALUES (1, 'This is a test comment.', 2, 1230952187, 'Tester', '<EMAIL>', NULL, 2); -- -------------------------------------------------------- -- -- Table structure for table `tbl_constituencies` -- CREATE TABLE IF NOT EXISTS `tbl_constituencies` ( `id` int(11) NOT NULL COMMENT 'ID', `county_id` int(11) NOT NULL COMMENT 'County', `name` varchar(50) NOT NULL COMMENT 'Constituency' ) ENGINE=InnoDB AUTO_INCREMENT=291 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_constituencies` -- INSERT INTO `tbl_constituencies` (`id`, `county_id`, `name`) VALUES (1, 1, 'CHANGAMWE'), (2, 1, 'JOMVU'), (3, 1, 'KISAUNI'), (4, 1, 'LIKONI'), (5, 1, 'MVITA'), (6, 1, 'NYALI'), (7, 2, 'KINANGO'), (8, 2, 'LUNGALUNGA'), (9, 2, 'MATUGA'), (10, 2, 'MSAMBWENI'), (11, 3, 'GANZE'), (12, 3, 'KALOLENI'), (13, 3, 'KILIFI NORTH'), (14, 3, '<NAME>OUTH'), (15, 3, 'MAGARINI'), (16, 3, 'MALINDI'), (17, 3, 'RABAI'), (18, 4, 'BURA'), (19, 4, 'GALOLE'), (20, 4, 'GARSEN'), (21, 5, 'LAMU EAST'), (22, 5, 'LAMU WEST'), (23, 6, 'MWATATE'), (24, 6, 'TAVETA'), (25, 6, 'VOI'), (26, 6, 'WUNDANYI'), (27, 7, 'BALAMBALA'), (28, 7, 'DADAAB'), (29, 7, 'FAFI'), (30, 7, 'GARISSA TOWNSHIP'), (31, 7, 'IJARA'), (32, 7, 'LAGDERA'), (33, 8, 'ELDAS'), (34, 8, 'TARBAJ'), (35, 8, 'WAJIR EAST'), (36, 8, 'WAJIR NORTH'), (37, 8, 'WAJIR SOUTH'), (38, 8, 'WAJIR WEST'), (39, 9, 'BANISSA'), (40, 9, 'LAFEY'), (41, 9, 'MANDERA EAST'), (42, 9, 'MANDERA NORTH'), (43, 9, 'MANDERA SOUTH'), (44, 9, 'MANDERA WEST'), (45, 10, 'LAISAMIS'), (46, 10, 'MOYALE'), (47, 10, 'NORTH HORR'), (48, 10, 'SAKU'), (49, 11, 'ISIOLO NORTH'), (50, 11, '<NAME>'), (51, 12, 'BUURI'), (52, 12, 'CENTRAL IMENTI'), (53, 12, 'IGEMBE CENTRAL'), (54, 12, 'IGEMBE NORTH'), (55, 12, 'IGEMBE SOUTH'), (56, 12, 'NORTH IMENTI'), (57, 12, 'SOUTH IMENTI'), (58, 12, 'TIGANIA EAST'), (59, 12, 'TIGANIA WEST'), (60, 13, 'CHUKA/IGAMBANG''OMBE'), (61, 13, 'MAARA'), (62, 13, 'THARAKA'), (63, 14, 'MANYATTA'), (64, 14, 'MBEERE NORTH'), (65, 14, 'MBEERE SOUTH'), (66, 14, 'RUNYENJES'), (67, 15, 'KITUI CENTRAL'), (68, 15, 'KITUI EAST'), (69, 15, 'KITUI RURAL'), (70, 15, 'KITUI SOUTH'), (71, 15, 'KITUI WEST'), (72, 15, 'MWINGI CENTRAL'), (73, 15, 'MWINGI NORTH'), (74, 15, 'MWINGI WEST'), (75, 16, 'KANGUNDO'), (76, 16, 'KATHIANI'), (77, 16, '<NAME>'), (78, 16, 'MASINGA'), (79, 16, 'MATUNGULU'), (80, 16, 'MAVOKO'), (81, 16, 'MWALA'), (82, 16, 'YATTA'), (83, 17, 'KAITI'), (84, 17, 'KIBWEZI EAST'), (85, 17, 'KIBWEZI WEST'), (86, 17, 'KILOME'), (87, 17, 'MAKUENI'), (88, 17, 'MBOONI'), (89, 18, 'KINANGOP'), (90, 18, 'KIPIPIRI'), (91, 18, 'NDARAGWA'), (92, 18, '<NAME>'), (93, 18, '<NAME>'), (94, 19, 'KIENI'), (95, 19, 'MATHIRA'), (96, 19, 'MUKURWEINI'), (97, 19, '<NAME>'), (98, 19, 'OTHAYA'), (99, 19, 'TETU'), (100, 20, 'GICHUGU'), (101, 20, 'KIRINYAGA CENTRAL'), (102, 20, 'MWEA'), (103, 20, 'NDIA'), (104, 21, 'GATANGA'), (105, 21, 'KANDARA'), (106, 21, 'KANGEMA'), (107, 21, 'KIGUMO'), (108, 21, 'KIHARU'), (109, 21, 'MARAGWA'), (110, 21, 'MATHIOYA'), (111, 22, '<NAME>'), (112, 22, '<NAME>'), (113, 22, 'GITHUNGURI'), (114, 22, 'JUJA'), (115, 22, 'KABETE'), (116, 22, 'KIAMBAA'), (117, 22, 'KIAMBU'), (118, 22, 'KIKUYU'), (119, 22, 'LARI'), (120, 22, 'LIMURU'), (121, 22, 'RUIRU'), (122, 22, '<NAME>'), (123, 23, 'LOIMA'), (124, 23, 'TURKANA CENTRAL'), (125, 23, 'TURKANA EAST'), (126, 23, 'TURKANA NORTH'), (127, 23, 'TURKANA SOUTH'), (128, 23, 'TURKANA WEST'), (129, 24, 'KACHELIBA'), (130, 24, 'KAPENGURIA'), (131, 24, '<NAME>'), (132, 24, 'SIGOR'), (133, 25, 'SAMBURU EAST'), (134, 25, 'SAMBURU NORTH'), (135, 25, 'SAMBURU WEST'), (136, 26, 'CHERANGANY'), (137, 26, 'ENDEBESS'), (138, 26, 'KIMININI'), (139, 26, 'KWANZA'), (140, 26, 'SABOTI'), (141, 27, 'AINABKOI'), (142, 27, 'KAPSERET'), (143, 27, 'KESSES'), (144, 27, 'MOIBEN'), (145, 27, 'SOY'), (146, 27, 'TURBO'), (147, 28, 'KEIYO NORTH'), (148, 28, '<NAME>'), (149, 28, 'MARAKWET EAST'), (150, 28, '<NAME>EST'), (151, 29, 'ALDAI'), (152, 29, 'CHESUMEI'), (153, 29, 'EMGWEN'), (154, 29, 'MOSOP'), (155, 29, '<NAME>'), (156, 29, 'TINDERET'), (157, 30, 'BARINGO NORTH'), (158, 30, 'BARINGO CENTRAL'), (159, 30, '<NAME>'), (160, 30, 'ELDAMA RAVINE'), (161, 30, 'MOGOTIO'), (162, 30, 'TIATY'), (163, 31, 'LAIKIPIA EAST'), (164, 31, 'LAIKIPIA NORTH'), (165, 31, 'LAIKIPIA WEST'), (166, 32, 'BAHATI'), (167, 32, 'GILGIL'), (168, 32, 'KURESOI NORTH'), (169, 32, 'KURESOI SOUTH'), (170, 32, 'MOLO'), (171, 32, 'NAIVASHA'), (172, 32, 'NAKURU TOWN EAST'), (173, 32, 'NAKURU TOWN WEST'), (174, 32, 'NJORO'), (175, 32, 'RONGAI'), (176, 32, 'SUBUKIA'), (177, 33, '<NAME>'), (178, 33, 'KILGORIS'), (179, 33, 'NAROK EAST'), (180, 33, 'NAROK NORTH'), (181, 33, 'NAROK SOUTH'), (182, 33, 'NAROK WEST'), (183, 34, 'KAJIADO CENTRAL'), (184, 34, 'KAJIADO EAST'), (185, 34, 'KAJIADO NORTH'), (186, 34, 'KAJIADO SOUTH'), (187, 34, 'KAJIADO WEST'), (188, 35, 'AINAMOI'), (189, 35, 'BELGUT'), (190, 35, 'BURETI'), (191, 35, 'KIPKELION EAST'), (192, 35, 'KIPKELION WEST'), (193, 35, 'SIGOWET/SOIN'), (194, 36, '<NAME>'), (195, 36, '<NAME>'), (196, 36, 'CHEPALUNGU'), (197, 36, 'KONOIN'), (198, 36, 'SOTIK'), (199, 37, 'BUTERE'), (200, 37, 'IKOLOMANI'), (201, 37, 'KHWISERO'), (202, 37, 'LIKUYANI'), (203, 37, 'LUGARI'), (204, 37, 'LURAMBI'), (205, 37, 'MALAVA'), (206, 37, 'MATUNGU'), (207, 37, 'MUMIAS EAST'), (208, 37, 'MUMIAS WEST'), (209, 37, 'NAVAKHOLO'), (210, 37, 'SHINYALU'), (211, 38, 'EMUHAYA'), (212, 38, 'HAMISI'), (213, 38, 'LUANDA'), (214, 38, 'SABATIA'), (215, 38, 'VIHIGA'), (216, 39, 'BUMULA'), (217, 39, 'KABUCHAI'), (218, 39, 'KANDUYI'), (219, 39, 'KIMILILI'), (220, 39, '<NAME>'), (221, 39, 'SIRISIA'), (222, 39, 'TONGAREN'), (223, 39, 'WEBUYE EAST'), (224, 39, 'WEBUYE WEST'), (225, 40, 'BUDALANGI'), (226, 40, 'BUTULA'), (227, 40, 'FUNYULA'), (228, 40, 'MATAYOS'), (229, 40, 'NAMBALE'), (230, 40, 'TESO NORTH'), (231, 40, '<NAME>'), (232, 41, '<NAME>'), (233, 41, 'BONDO'), (234, 41, 'GEM'), (235, 41, 'RARIEDA'), (236, 41, 'UGENYA'), (237, 41, 'UGUNJA'), (238, 42, 'KISUMU CENTRAL'), (239, 42, 'KISUMU EAST'), (240, 42, 'KISUMU WEST'), (241, 42, 'MUHORONI'), (242, 42, 'NYAKACH'), (243, 42, 'NYANDO'), (244, 42, 'SEME'), (245, 43, '<NAME>'), (246, 43, '<NAME>'), (247, 43, 'KARACHUONYO'), (248, 43, 'KASIPUL'), (249, 43, 'MBITA'), (250, 43, 'NDHIWA'), (251, 43, 'RANGWE'), (252, 43, 'SUBA'), (253, 44, 'AWENDO'), (254, 44, 'KURIA EAST'), (255, 44, 'KURIA WEST'), (256, 44, 'NYATIKE'), (257, 44, 'RONGO'), (258, 44, 'SUNA EAST'), (259, 44, 'SUNA WEST'), (260, 44, 'URIRI'), (261, 45, 'BOBASI'), (262, 45, '<NAME>'), (263, 45, '<NAME>'), (264, 45, 'BONCHARI'), (265, 45, 'KITUTU CHACHE NORTH'), (266, 45, 'KITUTU CHACHE SOUTH'), (267, 45, '<NAME>'), (268, 45, '<NAME>'), (269, 45, 'SOUTH MUGIRANGO'), (270, 46, 'BORABU'), (271, 46, '<NAME>'), (272, 46, 'NORTH MUGIRANGO'), (273, 46, 'WEST MUGIRANGO'), (274, 47, 'DAGORETTI NORTH'), (275, 47, 'DAGORETTI SOUTH'), (276, 47, 'EMBAKASI CENTRAL'), (277, 47, 'EMBAKASI EAST'), (278, 47, 'EMBAKASI NORTH'), (279, 47, 'EMBAKASI SOUTH'), (280, 47, 'EMBAKASI WEST'), (281, 47, 'KAMUKUNJI'), (282, 47, 'KASARANI'), (283, 47, 'KIBRA'), (284, 47, 'LANGATA'), (285, 47, 'MAKADARA'), (286, 47, 'MATHARE'), (287, 47, 'ROYSAMBU'), (288, 47, 'RUARAKA'), (289, 47, 'STAREHE'), (290, 47, 'WESTLANDS'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_counties` -- CREATE TABLE IF NOT EXISTS `tbl_counties` ( `id` int(11) NOT NULL COMMENT 'ID', `name` varchar(50) NOT NULL COMMENT 'County' ) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_counties` -- INSERT INTO `tbl_counties` (`id`, `name`) VALUES (1, 'MOMBASA'), (2, 'KWALE'), (3, 'KILIFI'), (4, '<NAME>'), (5, 'LAMU'), (6, '<NAME>'), (7, 'GARISSA'), (8, 'WAJIR'), (9, 'MANDERA'), (10, 'MARSABIT'), (11, 'ISIOLO'), (12, 'MERU'), (13, '<NAME>'), (14, 'EMBU'), (15, 'KITUI'), (16, 'MACHAKOS'), (17, 'MAKUENI'), (18, 'NYANDARUA'), (19, 'NYERI'), (20, 'KIRINYAGA'), (21, 'MURANG''A'), (22, 'KIAMBU'), (23, 'TURKANA'), (24, '<NAME>OT'), (25, 'SAMBURU'), (26, 'TRANS NZOIA'), (27, '<NAME>'), (28, 'ELGEYO/MARAKWET'), (29, 'NANDI'), (30, 'BARINGO'), (31, 'LAIKIPIA'), (32, 'NAKURU'), (33, 'NAROK'), (34, 'KAJIADO'), (35, 'KERICHO'), (36, 'BOMET'), (37, 'KAKAMEGA'), (38, 'VIHIGA'), (39, 'BUNGOMA'), (40, 'BUSIA'), (41, 'SIAYA'), (42, 'KISUMU'), (43, '<NAME>'), (44, 'MIGORI'), (45, 'KISII'), (46, 'NYAMIRA'), (47, 'NAIROBI'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_courses` -- CREATE TABLE IF NOT EXISTS `tbl_courses` ( `id` int(11) NOT NULL COMMENT 'ID', `inst_id` int(11) NOT NULL COMMENT 'Institution', `course_type` varchar(25) NOT NULL COMMENT 'Nature Of Course', `course_name` text NOT NULL COMMENT 'Course Name', `mean_grade` varchar(2) NOT NULL COMMENT 'Mean Grade', `annual_fees` int(11) NOT NULL COMMENT 'Annual Fees', `course_duration` int(1) NOT NULL COMMENT 'Course Duration', `sessions_per_year` int(1) NOT NULL COMMENT 'Sessions Per Year', `active` enum('yes','no') NOT NULL DEFAULT 'yes' COMMENT 'Active' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_course_campuses` -- CREATE TABLE IF NOT EXISTS `tbl_course_campuses` ( `id` int(11) NOT NULL COMMENT 'ID', `campus_id` int(11) NOT NULL COMMENT 'Campus', `course_id` int(11) NOT NULL COMMENT 'Course', `active` enum('yes','no') NOT NULL DEFAULT 'yes' COMMENT 'Active' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_course_levels` -- CREATE TABLE IF NOT EXISTS `tbl_course_levels` ( `id` int(11) NOT NULL COMMENT 'ID', `course_id` int(11) NOT NULL COMMENT 'Course', `level` varchar(15) NOT NULL COMMENT 'Graduation', `active` enum('yes','no') NOT NULL DEFAULT 'yes' COMMENT 'Active' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_course_subject_cat_grades` -- CREATE TABLE IF NOT EXISTS `tbl_course_subject_cat_grades` ( `id` int(11) NOT NULL COMMENT 'ID', `course_id` int(11) NOT NULL COMMENT 'Course', `category` varchar(25) NOT NULL COMMENT 'Category', `no_of_subjects` int(1) DEFAULT NULL COMMENT 'No Of Subjects', `min_grade` varchar(2) DEFAULT NULL COMMENT 'Minimum Grade' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_course_subject_grades` -- CREATE TABLE IF NOT EXISTS `tbl_course_subject_grades` ( `id` int(11) NOT NULL COMMENT 'ID', `course_id` int(11) NOT NULL COMMENT 'Course', `subject` varchar(5) NOT NULL COMMENT 'Subject', `min_grade` varchar(2) DEFAULT NULL COMMENT 'Minimum Grade' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tbl_institutions` -- CREATE TABLE IF NOT EXISTS `tbl_institutions` ( `id` int(11) NOT NULL COMMENT 'ID', `inst_name` varchar(128) NOT NULL COMMENT 'Name of Institution', `inst_type` varchar(25) NOT NULL COMMENT 'Institution Type', `website` varchar(128) DEFAULT NULL COMMENT 'Website', `logo` varchar(128) DEFAULT NULL COMMENT 'Logo', `motto` text COMMENT 'Motto', `mission` text COMMENT 'Mission Statement', `vision` text COMMENT 'Vision Statement', `active` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'Active' ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_institutions` -- INSERT INTO `tbl_institutions` (`id`, `inst_name`, `inst_type`, `website`, `logo`, `motto`, `mission`, `vision`, `active`) VALUES (7, 'University of Nairobi', 'univ', '', '', '', '', '', 'no'), (8, 'Strathmore', 'univ', '', '', '', '', '', 'no'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_inst_types` -- CREATE TABLE IF NOT EXISTS `tbl_inst_types` ( `id` int(11) NOT NULL COMMENT 'id', `symbol` varchar(25) NOT NULL COMMENT 'symbol', `name` varchar(25) NOT NULL COMMENT 'name' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='the institution types e.g. university'; -- -------------------------------------------------------- -- -- Table structure for table `tbl_lookup` -- CREATE TABLE IF NOT EXISTS `tbl_lookup` ( `id` int(11) NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `code` int(11) NOT NULL, `type` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `position` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `tbl_lookup` -- INSERT INTO `tbl_lookup` (`id`, `name`, `code`, `type`, `position`) VALUES (1, 'Draft', 1, 'PostStatus', 1), (2, 'Published', 2, 'PostStatus', 2), (3, 'Archived', 3, 'PostStatus', 3), (4, 'Pending Approval', 1, 'CommentStatus', 1), (5, 'Approved', 2, 'CommentStatus', 2); -- -------------------------------------------------------- -- -- Table structure for table `tbl_person` -- CREATE TABLE IF NOT EXISTS `tbl_person` ( `id` int(11) NOT NULL COMMENT 'ID', `fname` varchar(25) NOT NULL COMMENT 'First/English Name', `mname` varchar(25) DEFAULT NULL COMMENT 'Middle/Given Name', `lname` varchar(25) NOT NULL COMMENT 'Family/Last/Surname', `gender` enum('Male','Female') NOT NULL COMMENT 'Gender', `dob` date DEFAULT NULL COMMENT 'Date of Birth', `id_no` varchar(8) DEFAULT NULL COMMENT 'Nat. ID. No.', `phone` varchar(13) DEFAULT NULL COMMENT 'Cell Phone No.', `cse_yr` int(4) NOT NULL COMMENT 'KCSE Year', `cse_index` varchar(13) NOT NULL COMMENT 'Index No.', `grade` varchar(2) NOT NULL COMMENT 'Mean Grade' ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_person` -- INSERT INTO `tbl_person` (`id`, `fname`, `mname`, `lname`, `gender`, `dob`, `id_no`, `phone`, `cse_yr`, `cse_index`, `grade`) VALUES (4, 'Sarah', 'Khatete', 'Nendela', 'Female', '1985-08-05', '25265712', '0727171565', 2004, '602710010', 'B-'), (5, 'Shadrack', 'Wabomba', 'Wanyonyi', 'Male', '1985-08-24', '24544153', '0725171265', 2003, '602101001', 'B+'), (6, 'Siati', 'Siati', 'Siati', 'Male', '1985-08-05', '12345678', '0789129098', 2012, '602101001', 'A-'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_post` -- CREATE TABLE IF NOT EXISTS `tbl_post` ( `id` int(11) NOT NULL, `title` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `content` text COLLATE utf8_unicode_ci NOT NULL, `tags` text COLLATE utf8_unicode_ci, `status` int(11) NOT NULL, `create_time` int(11) DEFAULT NULL, `update_time` int(11) DEFAULT NULL, `author_id` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `tbl_post` -- INSERT INTO `tbl_post` (`id`, `title`, `content`, `tags`, `status`, `create_time`, `update_time`, `author_id`) VALUES (1, 'Welcome!', 'This blog system is developed using Yii. It is meant to demonstrate how to use Yii to build a complete real-world application. Complete source code may be found in the Yii releases.\r\n\r\nFeel free to try this system by writing new posts and posting comments.', 'yii, blog', 2, 1230952187, 1230952187, 1), (2, 'A Test Post', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'test', 2, 1230952187, 1230952187, 1); -- -------------------------------------------------------- -- -- Table structure for table `tbl_student_subject_scores` -- CREATE TABLE IF NOT EXISTS `tbl_student_subject_scores` ( `id` int(11) NOT NULL COMMENT 'id', `stud_id` int(11) NOT NULL COMMENT 'Student ID', `subject` varchar(5) NOT NULL COMMENT 'Subject', `grade` varchar(2) DEFAULT NULL COMMENT 'Grade' ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_student_subject_scores` -- INSERT INTO `tbl_student_subject_scores` (`id`, `stud_id`, `subject`, `grade`) VALUES (1, 4, 'phy', 'A'), (2, 5, 'phy', 'A'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_tag` -- CREATE TABLE IF NOT EXISTS `tbl_tag` ( `id` int(11) NOT NULL, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `frequency` int(11) DEFAULT '1' ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `tbl_tag` -- INSERT INTO `tbl_tag` (`id`, `name`, `frequency`) VALUES (1, 'yii', 1), (2, 'blog', 1), (3, 'test', 1); -- -------------------------------------------------------- -- -- Table structure for table `tbl_trainers` -- CREATE TABLE IF NOT EXISTS `tbl_trainers` ( `id` int(11) NOT NULL COMMENT 'ID', `name` varchar(128) NOT NULL COMMENT 'Name of Institution', `website` varchar(128) DEFAULT NULL COMMENT 'Website', `logo` varchar(128) DEFAULT NULL COMMENT 'Logo', `motto` text COMMENT 'Motto', `mission` text COMMENT 'Mission Statement', `vision` text COMMENT 'Vision Statement', `brief` text COMMENT 'Brief Description', `active` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'Active' ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_trainers` -- INSERT INTO `tbl_trainers` (`id`, `name`, `website`, `logo`, `motto`, `mission`, `vision`, `brief`, `active`) VALUES (6, 'Inspiration For Greatness', '', '', '', '', '', '', 'no'), (9, 'ifg', '', '', '', '', '', '', 'no'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_user` -- CREATE TABLE IF NOT EXISTS `tbl_user` ( `id` int(11) NOT NULL, `username` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Email', `password` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `salt` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `profile` text COLLATE utf8_unicode_ci, `date_created` datetime NOT NULL, `last_login` datetime DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `tbl_user` -- INSERT INTO `tbl_user` (`id`, `username`, `email`, `password`, `salt`, `profile`, `date_created`, `last_login`) VALUES (1, 'demo', '<EMAIL>', '<PASSWORD>', '<PASSWORD>', NULL, '0000-00-00 00:00:00', NULL), (2, 'siati', '<EMAIL>', '<PASSWORD>', '<PASSWORD>2182048fd9cf91760', NULL, '0000-00-00 00:00:00', '2015-10-22 23:08:49'), (3, 'wsiati', '<EMAIL>', 'ee3fcba726ac85f22c6f9866a3d405c3', '562b7c03511b03.75414100', 'student', '2015-10-24 14:39:31', '2015-10-28 09:01:57'), (4, 'khate', '<EMAIL>', '31de835049c7e8444e906615626582c1', '562ba1f3c84f87.36439614', 'student', '2015-10-24 17:21:23', '2015-10-28 04:39:57'), (5, 'uoni', '<EMAIL>', 'uoni', '562bf55d0d18e4.40922889', 'institution', '2015-10-24 23:17:17', '2015-10-28 04:32:12'), (6, 'i4g', '<EMAIL>', '<PASSWORD>', '562cd5f4ee6f01.11632770', 'trainer', '2015-10-25 14:15:32', '2015-10-28 04:17:02'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `profile` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `last_logged_in` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `profile`, `status`, `created_at`, `updated_at`, `last_logged_in`) VALUES (1, 'me', 'RQ62yf25UfPQEaeEMHc5mLjnxWU-_Vd5', '$2y$13$78HZNJXh5WCyKFe4Gsz/De3AzmpHl3obEW7nbQsk.qO.sfCCw55M.', NULL, '<EMAIL>', 'we@ss', 10, 1446051872, 1446051872, 0), (2, 'wewe', 'wPZHKpQVu5CwRjs8vNsxniB5-4vRMUwq', '$2y$13$tFo8lbTe.xHazEjH4ZZ96u1Dvze3tgQxdaTc1JLrK0NAcIYTTb.wu', NULL, '<EMAIL>', '', 10, 1446051872, 1446051872, 0), (3, 'tu', '0EaT5-ihrxovm-D3VOXIEA0yaYgxiuZJ', '$2y$13$tKI6zMmEpD4TriOE3AttSeUi73GBzBRxGso5eMoPslDcwFhf3eCT2', NULL, '<EMAIL>', '', 10, 1446051872, 1446051872, 0), (4, 'rop', 'pLxqiFYGe7DWFyJAHngRO8YyZTz57_CN', '$2y$13$yHXmT4UNGcc2s0hTowsj1edJ4WQlmc333Y26Rz./l.gkxJmW9XX7K', NULL, '<EMAIL>', '', 10, 1446118445, 1446119537, 1446119537), (5, 'siati', '1UI3ncV9VwBhp6pVqncZ21VoO5onah4u', '$2y$13$qDuVwE2rtIkDd65rt83qFeh02II3If6E8/cdu0odxuBp0aayF5xqa', NULL, '<EMAIL>', 'student', 10, 1446197418, 1446437639, 1446437639), (6, 'sop', 'NFmnjPszPDsr_t4roQIPdm-hmPeBr8zz', '$2y$13$cddtHWiXq63cWiVyUJwIOOsejdQl/nSGWY17jPp4k7cQyxKJLbWoe', NULL, '<EMAIL>', 'student', 10, 1446216473, 1446216473, 0), (7, 'uoni', 'NCJzXKQW_tZxFheTfz35CxMh6n0t-gGG', '$2y$13$Aqm5cJzaoDSgrUqak/RPLO2vImkOjAl2dXOxxza9n1foB4Z9TVKZq', NULL, '<EMAIL>', 'institution', 10, 1446216721, 1446389697, 1446389697), (8, 'strh', 'B1KP9bTMUWJPjX4-jtZvUCJpFhbJYe_d', '$2y$13$gW1gLyJS6aGAFJXpnxNyJ.vJV7XFoVd9FUbCISc3./E2NsCxxiOZm', NULL, '<EMAIL>', 'institution', 10, 1446217077, 1446217077, 0), (9, 'ifg', 's3H1rhIzLk-Ixv9Z5W9Y6jYMxubVlthI', '$2y$13$1Z8Koy893ue.KT98JJ//a.nAsI365nUGbn03k3t1Rz.qBCMx3ftuG', NULL, '<EMAIL>', 'trainer', 10, 1446217427, 1446217451, 1446217451); -- -- Indexes for dumped tables -- -- -- Indexes for table `migration` -- ALTER TABLE `migration` ADD PRIMARY KEY (`version`); -- -- Indexes for table `tbl_campuses` -- ALTER TABLE `tbl_campuses` ADD PRIMARY KEY (`id`), ADD KEY `inst_id` (`inst_id`); -- -- Indexes for table `tbl_centers` -- ALTER TABLE `tbl_centers` ADD PRIMARY KEY (`id`), ADD KEY `inst_id` (`trainer_id`); -- -- Indexes for table `tbl_comment` -- ALTER TABLE `tbl_comment` ADD PRIMARY KEY (`id`), ADD KEY `FK_comment_post` (`post_id`); -- -- Indexes for table `tbl_constituencies` -- ALTER TABLE `tbl_constituencies` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`); -- -- Indexes for table `tbl_counties` -- ALTER TABLE `tbl_counties` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_courses` -- ALTER TABLE `tbl_courses` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_course_campuses` -- ALTER TABLE `tbl_course_campuses` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_course_levels` -- ALTER TABLE `tbl_course_levels` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_course_subject_cat_grades` -- ALTER TABLE `tbl_course_subject_cat_grades` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_course_subject_grades` -- ALTER TABLE `tbl_course_subject_grades` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_institutions` -- ALTER TABLE `tbl_institutions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_inst_types` -- ALTER TABLE `tbl_inst_types` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `symbol` (`symbol`), ADD UNIQUE KEY `name` (`name`); -- -- Indexes for table `tbl_lookup` -- ALTER TABLE `tbl_lookup` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_person` -- ALTER TABLE `tbl_person` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_post` -- ALTER TABLE `tbl_post` ADD PRIMARY KEY (`id`), ADD KEY `FK_post_author` (`author_id`); -- -- Indexes for table `tbl_student_subject_scores` -- ALTER TABLE `tbl_student_subject_scores` ADD PRIMARY KEY (`id`), ADD KEY `unique_user_subject` (`stud_id`,`subject`); -- -- Indexes for table `tbl_tag` -- ALTER TABLE `tbl_tag` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_trainers` -- ALTER TABLE `tbl_trainers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_user` -- ALTER TABLE `tbl_user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `password_reset_token` (`password_<PASSWORD>_<PASSWORD>`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_campuses` -- ALTER TABLE `tbl_campuses` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_centers` -- ALTER TABLE `tbl_centers` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_comment` -- ALTER TABLE `tbl_comment` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_constituencies` -- ALTER TABLE `tbl_constituencies` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=291; -- -- AUTO_INCREMENT for table `tbl_counties` -- ALTER TABLE `tbl_counties` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=48; -- -- AUTO_INCREMENT for table `tbl_courses` -- ALTER TABLE `tbl_courses` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID'; -- -- AUTO_INCREMENT for table `tbl_course_campuses` -- ALTER TABLE `tbl_course_campuses` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID'; -- -- AUTO_INCREMENT for table `tbl_course_levels` -- ALTER TABLE `tbl_course_levels` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID'; -- -- AUTO_INCREMENT for table `tbl_course_subject_cat_grades` -- ALTER TABLE `tbl_course_subject_cat_grades` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID'; -- -- AUTO_INCREMENT for table `tbl_course_subject_grades` -- ALTER TABLE `tbl_course_subject_grades` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID'; -- -- AUTO_INCREMENT for table `tbl_institutions` -- ALTER TABLE `tbl_institutions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `tbl_inst_types` -- ALTER TABLE `tbl_inst_types` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id'; -- -- AUTO_INCREMENT for table `tbl_lookup` -- ALTER TABLE `tbl_lookup` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `tbl_person` -- ALTER TABLE `tbl_person` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tbl_post` -- ALTER TABLE `tbl_post` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_student_subject_scores` -- ALTER TABLE `tbl_student_subject_scores` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tbl_tag` -- ALTER TABLE `tbl_tag` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tbl_trainers` -- ALTER TABLE `tbl_trainers` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `tbl_user` -- ALTER TABLE `tbl_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `tbl_comment` -- ALTER TABLE `tbl_comment` ADD CONSTRAINT `FK_comment_post` FOREIGN KEY (`post_id`) REFERENCES `tbl_post` (`id`) ON DELETE CASCADE; -- -- Constraints for table `tbl_post` -- ALTER TABLE `tbl_post` ADD CONSTRAINT `FK_post_author` FOREIGN KEY (`author_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
drop if exists test_class; create class test_class ( col1 integer, col2 date default '2001-05-05', col3 timestamp default '2001-05-05 08:00:00' on update current_timestamp ); insert into test_class(col1) values(999); insert into test_class(col1) values(888); select * from test_class order by 1,2; select attr_name, class_name, default_value from db_attribute where class_name = 'test_class' order by 1,2; alter class test_class modify column col2 date default '2001-05-05' on update current_timestamp; select attr_name, class_name, default_value from db_attribute where class_name = 'test_class' order by 1,2; drop class test_class;
<filename>openGaussBase/testcase/SQL/INNERFUNC/ASCII/Opengauss_Function_Innerfunc_Ascii_Case0023.sql -- @testpoint: 与distinct联用 drop table if exists test; create table test(name text); insert into test values('a'),('j'),('Hi'),('Hello'),('Hello'),('#'); select distinct chr(ascii(name)) from test order by chr(ascii(name)); drop table if exists test;
-- @testpoint: rpad函数入参为算术表达式 select rpad(32142-3423,10,33) from sys_dummy;
<gh_stars>0 create schema wsdb default character set utf8; use wsdb create table tb_produto ( id int primary key auto_increment, nm_produto varchar(150) not null, qnt_produto int, preco_produto double not null, img_produto varchar(255) not null ) default character set utf8;
-- Updates the applicationn status upon approval or rejection by an authority CREATE OR REPLACE FUNCTION updateApplicationStatus( IN application_id INTEGER, IN position_of_updater VARCHAR, IN type_of_update VARCHAR ) RETURNS VOID AS $$ #variable_conflict use_column DECLARE new_status VARCHAR; retrosp INTEGER; BEGIN SELECT isretrospective INTO retrosp FROM applications WHERE appid=application_id; if type_of_update='approve' then if position_of_updater='Faculty' then new_status='HOD'; elsif position_of_updater='HOD' then new_status='Dean FA'; elsif position_of_updater='Dean FA' then if retrosp=1 then new_status='Director'; else new_status='Approved'; end if; elsif position_of_updater='Director' then new_status:='Approved'; end if; elsif type_of_update='reject' then new_status:='Rejected'; elseif type_of_update='return' then new_status:=CONCAT('Returned by ',position_of_updater); end if; UPDATE applications SET status=new_status WHERE appid=application_id; END; $$ LANGUAGE plpgsql;
<filename>benchmark/Bimbo/tables-vectorwise/Bimbo_1.table-renamed.sql CREATE TABLE "Bimbo_1"( "col_00" smallint NOT NULL, "col_01" smallint NOT NULL, "col_02" integer NOT NULL, "col_03" smallint NOT NULL, "col_04" float8 NOT NULL, "col_05" integer NOT NULL, "col_06" smallint NOT NULL, "col_07" integer NOT NULL, "col_08" smallint NOT NULL, "col_09" smallint NOT NULL, "col_10" float8 NOT NULL, "col_11" smallint NOT NULL );
<reponame>1005200/toko-online1 -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 26 Apr 2021 pada 18.39 -- Versi server: 10.4.18-MariaDB -- Versi PHP: 8.0.3 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: `db_toko` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `tb_produk` -- CREATE TABLE `tb_produk` ( `id_produk` int(11) NOT NULL, `nama` varchar(225) NOT NULL, `harga` int(20) NOT NULL, `deskripsi` varchar(225) NOT NULL, `gambar` varchar(225) NOT NULL, `stok` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `tb_produk` -- INSERT INTO `tb_produk` (`id_produk`, `nama`, `harga`, `deskripsi`, `gambar`, `stok`) VALUES (19, 'kampang', 123, 'bakso enak dan gurih', 'Screenshot_(31).png', 120), (20, 'es buah', 5000, 'asd', 'Screenshot_(31)1.png', 119), (21, 'asdf', 1000, 'asdasdasas', 'Screenshot_(34).png', 123), (37, 'sss', 12414113, 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur placeat at expedita asperiores, beatae repellat fugiat, deleniti earum voluptas deserunt quasi harum accusamus culpa sit exercitationem sunt temporibus, il', 'Screenshot_(26).png', 24112), (39, 'adf', 32, '<PASSWORD>', 'naruto1.jpg', 23); -- -------------------------------------------------------- -- -- Struktur dari tabel `tb_users` -- CREATE TABLE `tb_users` ( `id_users` int(11) NOT NULL, `nama` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `tb_produk` -- ALTER TABLE `tb_produk` ADD PRIMARY KEY (`id_produk`); -- -- Indeks untuk tabel `tb_users` -- ALTER TABLE `tb_users` ADD PRIMARY KEY (`id_users`); -- -- AUTO_INCREMENT untuk tabel yang dibuang -- -- -- AUTO_INCREMENT untuk tabel `tb_produk` -- ALTER TABLE `tb_produk` MODIFY `id_produk` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40; -- -- AUTO_INCREMENT untuk tabel `tb_users` -- ALTER TABLE `tb_users` MODIFY `id_users` int(11) NOT NULL AUTO_INCREMENT; 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 */;
ALTER TABLE `userGroup` ADD FOREIGN KEY (`user`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `userGroup` ADD FOREIGN KEY (`group`) REFERENCES `group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `profile` ADD FOREIGN KEY (`gender`) REFERENCES `gender` (`code`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `profile` ADD FOREIGN KEY (`owner`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
-- a comment -- first step: make sure the dropdown is set to the right DB, not "master" -- ("USE adventureworks;" is usually how you switch Dbs, but Azure SQL DB doesn't support it) -- basic SELECT query - all columns and all rows from a given table. -- SalesLT is the schema name, Customer is the table name. SELECT * FROM SalesLT.Customer; -- highlight a command and press F5 (execute / play button) to run that command. -- SELECT query/statement/command - read some info from the DB. -- or, do "anything" that should return/print a value. -- don't even need to access the DB. SELECT 1; SELECT 1 + 1; -- two clauses in the SELECT statement so far - SELECT clause and FROM clause. -- FROM clause specifies what table or tables we are looking inside. -- and SELECT clause specifies the columns of our "result set" SELECT CustomerID, Title, FirstName, MiddleName, LastName, Suffix FROM SalesLT.Customer; -- only get the columns you ask for. -- we can do calculations from the table's columns. -- we can name/alias our result columns with AS and [column name here] SELECT CustomerID, Title, FirstName + ' ' + MiddleName + ' ' + LastName AS [Full Name], Suffix FROM SalesLT.Customer; SELECT * FROM SalesLT.Product; SELECT ProductID, Name, StandardCost, ListPrice, ListPrice * 1.08 AS [Price After Tax], ListPrice - StandardCost AS [Profit Margin] FROM SalesLT.Product; SELECT Color, Size FROM SalesLT.Product; -- returns 295 rows -- filter duplicate rows out with DISTINCT in SELECT clause SELECT DISTINCT Color, Size FROM SalesLT.Product; -- returns 68 rows SELECT DISTINCT ProductID, Color, Size FROM SalesLT.Product; -- returns 295 rows -- table aliases -- important when we start selecting from multiple tables -- would rather do so with a short name. SELECT p.Color, p.Size FROM SalesLT.Product AS p; -- WHERE clause -- allows filtering of rows based on a condition (before any calculated columns in the SELECT clause) -- in SQL, string literals must be with single quote. double quote is for names of things with spaces in them SELECT * FROM SalesLT.Customer WHERE FirstName = 'Brian'; -- we have boolean operators AND, OR -- we can group them with parentheses -- we have comparisons like = for equals SELECT * FROM SalesLT.Customer WHERE FirstName = 'Brian' AND LastName = 'Goldstein'; -- not-equals is <> or != SELECT * FROM SalesLT.Customer WHERE FirstName = 'Brian' AND LastName != 'Goldstein'; -- we have ordered comparison with < <= > >= -- of numbers, dates, and also strings ("dictionary"/lexicographic ordering) -- all customers with first names that start with B SELECT * From SalesLT.Customer WHERE FirstName >= 'B' AND FirstName < 'C'; -- SQL supports, not regex, but some amount of its own pattern matching with LIKE operator -- % any number of characters -- [abc] either a, b, or c -- there's others SELECT * FROM SalesLT.Customer WHERE FirstName LIKE 'B[ar]%'; -- some string functions SELECT LEFT('123456789', 4); -- return 1234 SELECT RIGHT('123456789', 4); -- return 6789 SELECT LEN('123456789'); -- returns 9, the length SELECT SUBSTRING('123456789', 3, 5); -- start index and length of substring, returns 34567 -- string indexes are 1-based in SQL unfortunately SELECT REPLACE('Hello World', 'World', 'Justin'); -- return Hello Justin SELECT CHARINDEX(' ','Hello world'); -- returns 6 (first index of that character in the string) -- data types -- numeric -- tinyint, smallint, int, bigint -- (1) (2) (4) (8) byte(s) -- float, real, decimal -- use decimal for basically all floating-point stuff -- decimal as a type accepts parameters -- decimal(10,3) means 10 digits, with 3 of them after the decimal place. -- i.e. 0000000.000 -- for currency values, we have money type -- string -- char(10) (fixed length character array) -- varchar(10) (variable length up to 10 character array) -- nchar(10) ("national" aka Unicode char array) -- nvarchar(10) (Unicode variable length) -- for the varchars we can also pass "MAX" as parameter e.g. NVARCHAR(MAX). -- no reason to not use NVARCHAR all the time. -- string literals are technically VARCHAR: 'Hello' -- we can make Unicode string literals (NVARCHAR) like: N'Hello' -- we also have BINARY type and VARBINARY for storing binary data directly in the DB -- e.g. ThumbNailPhoto column in Product table. SELECT * FROM SalesLT.Product; --date and time data types -- date, time, datetime -- don't use datetime, use datetime2 because it has more range -- datetimeoffset (for intervals of time like "5 minutes") -- we've seen SELECT, FROM, and WHERE -- the other clauses are GROUP BY, HAVING, and ORDER BY. -- group all rows by first name, and count the number of duplicates per name. SELECT FirstName, COUNT(FirstName) AS Count FROM SalesLT.Customer GROUP BY FirstName; -- WHERE clause runs "before" the GROUP BY clause. -- so we can't filter on any conditions that depend on the grouping. -- e.g. if i want only the FirstNames that "have" duplicates, i can't use WHERE, -- because the grouping hasn't happened yet. there's nothing to compare SELECT FirstName, COUNT(FirstName) AS Count FROM SalesLT.Customer WHERE COUNT(Firstname) > 1 GROUP BY FirstName; -- COUNT is an aggregate function, this means it operates on many values and returns just one value. -- (unlike LEN for example, takes one string and returns a number) -- you use COUNT with GROUP BY. -- HAVING is for conditions that run AFTER the GROUP BY. -- (aggregate functions must be in HAVING, not WHERE.) -- all first names besides Andrew that have any duplicates, and how many there are. SELECT FirstName, COUNT(FirstName) AS Count FROM SalesLT.Customer WHERE FirstName != 'Andrew' GROUP BY FirstName HAVING COUNT(FirstName) > 1; -- ORDER BY sorts the result set and it's the last thing that runs. -- all products sorted by cost, cheapest first. SELECT * FROM SalesLT.Product ORDER BY StandardCost ASC; -- ascending order (ASC) is the default so you can skip it -- descending order is DESC -- all products sorted by color alphabetically, and by most expensive cost. SELECT * FROM SalesLT.Product ORDER BY Color, StandardCost DESC; -- execution order of a select statement: -- FROM -- WHERE -- GROUP BY -- HAVING -- ORDER BY -- SELECT -- (in order of writing it, except for SELECT.)
<reponame>taapp/tsoha-keskustelusovellus<filename>schema.sql CREATE TABLE users ( id SERIAL PRIMARY KEY, name TEXT UNIQUE, password TEXT, created_at TIMESTAMP, is_admin BOOLEAN, is_visible BOOLEAN ); CREATE TABLE areas ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users, name TEXT, created_at TIMESTAMP, is_secret BOOLEAN, is_visible BOOLEAN ); CREATE TABLE threads ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users, area_id INTEGER REFERENCES areas, title TEXT, created_at TIMESTAMP, is_visible BOOLEAN ); CREATE TABLE messages ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users, thread_id INTEGER REFERENCES threads, content TEXT, created_at TIMESTAMP, is_visible BOOLEAN ); CREATE TABLE users_areas ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users, area_id INTEGER REFERENCES areas );
DROP DATABASE IF EXISTS city_explorer; CREATE DATABASE city_explorer; \c city_explorer; DROP TABLE IF EXISTS locations; CREATE TABLE locations ( id SERIAL PRIMARY KEY, searchQuery VARCHAR(255), latitude FLOAT, longitude FLOAT );
<gh_stars>0 -- Structured Query Language (SQL) -- Preparation -- Start phpMyAdmin and create new database "Academy", using the provided script -- Connect to the database "Academy". Examine the major tables in the "Academy" database. -- ### Tasks -- 1. Write a SQL query to find all information about all departments (use "Academy" database). SELECT * FROM `departments` -- 2. Write a SQL query to find all department names. SELECT Name FROM `departments` -- 3. Write a SQL query to find the salary of each employee. SELECT Salary FROM `employees` -- or SELECT * FROM `employees` -- 4. Write a SQL to find the full name of each employee. SELECT CONCAT(FirstName, ' ', IFNULL(CONCAT(MiddleName, ' '), ''), LastName) as FullName FROM `employees` -- 5. Write a SQL query to find the email addresses of each employee (by his first and last name). Consider that the mail domain is telerik.com. Emails should look like “<EMAIL>.Doe<EMAIL>". The produced column should be named "Full Email Addresses". SELECT CONCAT(FirstName, '.', LastName, '@vsc.com') as `Full Email Addresses` FROM `employees` 6. Write a SQL query to find all different employee salaries. SELECT DISTINCT Salary FROM `employees` 7. Write a SQL query to find all information about the employees whose job title is “Sales Representative“. SELECT * FROM `employees` WHERE JobTitle = 'Sales Representative' 8. Write a SQL query to find the names of all employees whose first name starts with "SA". SELECT FirstName, MiddleName, LastName FROM `employees` WHERE LastName like 'SA%' 9. Write a SQL query to find the names of all employees whose last name contains "ei". SELECT FirstName, MiddleName, LastName FROM `employees` WHERE LastName like '%ei%' 10. Write a SQL query to find the salary of all employees whose salary is in the range [20000…30000]. SELECT Salary FROM `employees` WHERE Salary BETWEEN 20000 and 30000 11. Write a SQL query to find the names of all employees whose salary is 25000, 14000, 12500 or 23600. SELECT FirstName, MiddleName, LastName FROM `employees` WHERE Salary in (25000, 14000, 12500, 23600) 12. Write a SQL query to find all employees that do not have manager. SELECT * FROM `employees` WHERE ManagerID is null 13. Write a SQL query to find all employees that have salary more than 50000. Order them in decreasing order by salary. SELECT * FROM `employees` WHERE Salary > 50000 ORDER BY Salary DESC 14. Write a SQL query to find the top 5 best paid employees. SELECT * FROM `employees` ORDER BY Salary DESC LIMIT 5 15. Write a SQL query to find all employees and their address. SELECT * FROM `employees` as e JOIN addresses as a on a.AddressID = e.AddressID 16. Write a SQL query to find all employees that have manager, along with their manager. SELECT * FROM employees as e JOIN employees as m on e.ManagerID = m.EmployeeID 17. Write a SQL query to find all employees that have manager, along with their manager and their address. SELECT * FROM employees as e JOIN employees as m on e.ManagerID = m.EmployeeID JOIN addresses as a on a.AddressID = e.AddressID 18. Write a SQL query to find all departments and all town names as a single list. SELECT Name as DepartmentsAndTownsNames FROM towns UNION SELECT Name FROM departments 19. Write a SQL query to find all the employees and the manager for each of them along with the employees that do not have manager. SELECT * FROM employees as e LEFT JOIN employees as m on e.ManagerID = m.EmployeeID 20. Write a SQL query to find the names of all employees from the departments "Sales" and "Finance" whose hire year is between 1995 and 2005. SELECT CONCAT(e.FirstName, ' ', IFNULL(CONCAT(e.MiddleName, ' '), ''), e.LastName) as FullName, e.EmployeeID, e.DepartmentID, e.HireDate, d.Name FROM employees e join departments d on e.DepartmentID = d.DepartmentID WHERE (d.Name in ('Sales', 'Finance')) and (year(e.HireDate) BETWEEN 1995 and 2005)
<reponame>Lotes/mysql-meta-modeling #import "table" CREATE FUNCTION is_class ( given_id INT ) RETURNS BOOL COMMENT 'checks if id is a valid class' LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA SQL SECURITY DEFINER BEGIN DECLARE class_id INT DEFAULT -1; SELECT id FROM named_elements ne WHERE ne.id=given_id AND ne.type='CLASS' INTO class_id; RETURN class_id <> -1; END;
insert into municipality(id, name) values(UUID_TO_BIN('691bce27-f890-4f42-ac19-85f68429ab25'), 'Calakmul'); insert into municipality(id, name) values(UUID_TO_BIN('1cdd0ae3-35fa-4b45-98d7-d689caf4f718'), 'Calkiní'); insert into municipality(id, name) values(UUID_TO_BIN('76b0721b-b6b5-4569-91a0-c884ba63b49f'), 'Campeche'); insert into municipality(id, name) values(UUID_TO_BIN('b0defb5b-589f-44f7-8e5c-e75a4cfcc4d3'), 'Candelaria'); insert into municipality(id, name) values(UUID_TO_BIN('72623812-4f84-43a8-97d4-d3204298da36'), 'Carmen'); insert into municipality(id, name) values(UUID_TO_BIN('5925099f-b608-48e2-9fa8-01d2dab7dff3'), 'Champotón'); insert into municipality(id, name) values(UUID_TO_BIN('d79d222f-e007-413b-a687-ca401d18c225'), 'Escárcega'); insert into municipality(id, name) values(UUID_TO_BIN('b9c96e91-c514-490c-9a26-03efc4b252a7'), 'Hecelchakán'); insert into municipality(id, name) values(UUID_TO_BIN('beddb5ad-8585-46ba-99d4-5809a7b3e54c'), 'Hopelchén'); insert into municipality(id, name) values(UUID_TO_BIN('caf0ba0e-36f9-40a0-9f09-431f06f1fcf2'), 'Palizada'); insert into municipality(id, name) values(UUID_TO_BIN('c1c05143-23ad-49d8-a4ca-c70863dc2dd7'), 'Tenabo');
--------------------------------- <<label>> LOOP statements; END LOOP loop_label; --A LOOPdeclaração pode ter um rótulo opcional que aparece no início e no final da declaração. --É uma boa prática usar a LOOPinstrução quando: --Você deseja executar o corpo do loop pelo menos uma vez. --Você não tem certeza de quantas vezes deseja que o loop seja executado. LOOP EXIT; END LOOP; LOOP IF condition THEN EXIT; END IF; END LOOP; DECLARE l_counter NUMBER := 0; BEGIN LOOP l_counter := l_counter + 1; IF l_counter > 3 THEN EXIT; END IF; dbms_output.put_line( 'Inside loop: ' || l_counter ) ; END LOOP; -- control resumes here after EXIT dbms_output.put_line( 'After loop: ' || l_counter ); END; DECLARE l_contador NUMBER := 0; BEGIN LOOP l_contador := l_contador + 1; EXIT WHEN l_contador > 5; dbms_output.put_line( 'Laco interno: ' || l_contador) ; END LOOP; -- Pula para essa linha quando a condi��o do WHEN � satisfeito dbms_output.put_line( 'Apos o la�o terminar: ' || l_contador ); END; -------------------------------------------------------- DECLARE l_i NUMBER := 0; l_j NUMBER := 0; BEGIN <<outer_loop>> LOOP l_i := l_i + 1; EXIT outer_loop WHEN l_i > 2; dbms_output.put_line('Outer counter ' || l_i); -- reset inner counter l_j := 0; <<inner_loop>> LOOP l_j := l_j + 1; EXIT inner_loop WHEN l_j > 3; dbms_output.put_line(' Inner counter ' || l_j); END LOOP inner_loop; END LOOP outer_loop; END; --------------------------------------------------------------------------------- BEGIN FOR n_contador IN 1..5 LOOP dbms_output.put_line(n_contador); END LOOP; END; DECLARE n_contador number; BEGIN FOR n_contador IN 1..5 LOOP dbms_output.put_line(n_contador); END LOOP; END; -- Trabalhando com escopo - Ciclo de vida �til de uma vari�vel BEGIN FOR l_counter IN REVERSE 1..5 LOOP DBMS_OUTPUT.PUT_LINE( l_counter ); END LOOP; END;
<reponame>pradeepkumarcm-egov/DIGIT-Dev Insert into egw_status (ID,MODULETYPE,DESCRIPTION,LASTMODIFIEDDATE,CODE,ORDER_ID) values (nextval('seq_egw_status'),'DISHONORCHEQUE','Created',current_date,'Created',null); Insert into egw_status (ID,MODULETYPE,DESCRIPTION,LASTMODIFIEDDATE,CODE,ORDER_ID) values (nextval('seq_egw_status'),'DISHONORCHEQUE','Approved',current_date,'Approved',null); Insert into egw_status (ID,MODULETYPE,DESCRIPTION,LASTMODIFIEDDATE,CODE,ORDER_ID) values (nextval('seq_egw_status'),'DISHONORCHEQUE','Cancelled',current_date,'Cancelled',null); Insert into egw_status (ID,MODULETYPE,DESCRIPTION,LASTMODIFIEDDATE,CODE,ORDER_ID) values (nextval('seq_egw_status'),'DISHONORCHEQUE','Rejected',current_date,'Rejected',null);
<reponame>NaturalSolutions/ecoReleve-Data<filename>Back/database/View/V_RFIDasFile.sql /****** Object: View [dbo].[VArgosData_With_EquipIndiv] Script Date: 12/10/2015 17:53:50 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER view [dbo].[V_dataRFID_as_file] as SELECT e.ID as equipID,S.UnicIdentifier,rfid.FK_Sensor as FK_Sensor,m.Name as site_name,M.Category as site_type,e.StartDate as StartDate,e3.StartDate EndDate,count (distinct chip_code) as nb_chip_code, count (chip_code) as total_scan,Max(rfid.date_) as last_scan ,Min(rfid.date_) as first_scan from [ecoReleve_sensor].[dbo].[T_rfid] rfid LEFT JOIN Equipment E on e.FK_Sensor = rfid.FK_Sensor and e.Deploy =1 and e.StartDate < rfid.date_ and not exists (select * from [Equipment] e2 where e2.FK_Sensor = e.FK_Sensor AND e2.StartDate > e.StartDate AND e2.StartDate < rfid.date_) LEFT JOIN MonitoredSite M on e.FK_MonitoredSite = M.id LEFT JOIN Sensor S on rfid.FK_Sensor = S.ID LEFT JOIN Equipment E3 on e3.FK_Sensor = rfid.FK_Sensor and e3.Deploy =0 and e3.StartDate > e.StartDate and not exists (select * from [Equipment] e4 where e4.FK_Sensor = e.FK_Sensor AND e4.StartDate < e3.StartDate and e4.StartDate > e.StartDate) where rfid.checked = 0 GROUP BY S.UnicIdentifier,m.Name,m.Category,e.StartDate,e3.StartDate,e.ID,rfid.FK_Sensor GO
<gh_stars>10-100 CREATE INDEX rooms_import_index ON rooms USING btree (import);
CREATE TABLE [dbo].[Publisher] ( [Id] INT IDENTITY(1,1) NOT NULL, [Name] NVARCHAR(100) NOT NULL, [DateCreated] DATETIME NOT NULL, [UserCreated] NVARCHAR(50) NOT NULL, [DateModified] DATETIME NULL, [UserModified] NVARCHAR(50) NULL, [IsDeleted] BIT NOT NULL ) GO ALTER TABLE [dbo].[Publisher] ADD CONSTRAINT [PK_Publisher] PRIMARY KEY ([Id] DESC) GO
-- file:json.sql ln:391 expect:true CREATE TYPE jsrec AS ( i int, ia _int4, ia1 int[], ia2 int[][], ia3 int[][][], ia1d js_int_array_1d, ia2d js_int_array_2d, t text, ta text[], c char(10), ca char(10)[], ts timestamp, js json, jsb jsonb, jsa json[], rec jpop, reca jpop[] )
<reponame>ytechie/azure-saas CREATE TABLE [dbo].[Tenant] ( [Id] UNIQUEIDENTIFIER NOT NULL DEFAULT NewId(), [Name] NVARCHAR(200) NOT NULL, [IsActive] BIT NOT NULL DEFAULT 1, [IsCancelled] BIT NOT NULL DEFAULT 0, [IsProvisioned] BIT NOT NULL DEFAULT 0, [ApiKey] UNIQUEIDENTIFIER NOT NULL, [CategoryId] INT NOT NULL, [ProductId] INT NOT NULL, [UserId] NVARCHAR(37) NOT NULL, [Created] DATETIME NOT NULL DEFAULT GetDate(), CONSTRAINT [PK_Tenant] PRIMARY KEY ([Id]) )
<filename>res/sql/formats/Complementos.sql CREATE TABLE IF NOT EXISTS `Carreras` ( `Carrera_Id` INT(15) NOT NULL AUTO_INCREMENT, `Carrera_Name` VARCHAR(350) NOT NULL, `Create_by` INT NOT NULL DEFAULT '1', `Create_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`Carrera_Id`), UNIQUE KEY(`Carrera_Name`), FOREIGN KEY(`Create_by`) REFERENCES `User_Data`(`User_Id`) ON UPDATE CASCADE ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS `Peds` ( `Ped_Id` INT(15) NOT NULL AUTO_INCREMENT, `Ped_Name` VARCHAR(350) NOT NULL, `Create_by` INT NOT NULL DEFAULT '1', `Create_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`Ped_Id`), UNIQUE KEY(`Ped_Name`), FOREIGN KEY(`Create_by`) REFERENCES `User_Data`(`User_Id`) ON UPDATE CASCADE ON DELETE CASCADE ); CREATE TABLE IF NOT EXISTS `Turnos` ( `Turno_Id` INT(15) NOT NULL AUTO_INCREMENT, `Turno_Name` VARCHAR(350) NOT NULL, `Create_by` INT NOT NULL DEFAULT '1', `Create_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`Turno_Id`), UNIQUE KEY(`Turno_Name`), FOREIGN KEY(`Create_by`) REFERENCES `User_Data`(`User_Id`) ON UPDATE CASCADE ON DELETE CASCADE );
<reponame>kevin-at-datical/liquibase-test-harness INVALID TEST enableCheckConstraint is not supported for EDB --https://docs.liquibase.com/change-types/enable-check-constraint.html
<gh_stars>1-10 /*==============================================================*/ /* Table: demo_DEMO */ /*==============================================================*/ create sequence demo_DEMO_SEQ minvalue 1 increment by 1 nocache; / create table demo_DEMO ( ID int not null, NAME nvarchar2(100), USER_ID int, DEMO_TYPE nvarchar2(10), DEMO_TIME datetime, ISDEL char(1), CREATE_TIME datetime ); comment on table demo_DEMO is 'demo开发演示表' / comment on column demo_DEMO.ID is 'ID'; comment on column demo_DEMO.NAME is '名称'; comment on column demo_DEMO.USER_ID is '关联用户'; comment on column demo_DEMO.DEMO_TYPE is '演示类型'; comment on column demo_DEMO.DEMO_TIME is '演示时间'; comment on column demo_DEMO.ISDEL is '是否删除'; comment on column demo_DEMO.CREATE_TIME is '创建时间'; alter table demo_DEMO add constraint PK_demo_DEMO primary key (ID); CREATE OR REPLACE TRIGGER demo_DEMO_TRG BEFORE INSERT ON demo_DEMO FOR EACH ROW DECLARE -- LOCAL VARIABLES HERE BEGIN SELECT demo_DEMO_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; END demo_DEMO_TRG; /
<gh_stars>1-10 CREATE TABLE IF NOT EXISTS to_do_item ( id IDENTITY PRIMARY KEY, ts BIGINT, title VARCHAR(255), priority VARCHAR(7), status VARCHAR(5) );
<gh_stars>1-10 CREATE TYPE sims.offering_types AS ENUM ('Public', 'Application Specific');
<filename>packages/amplication-server/prisma/migrations/20210630105716_block_version_commit/migration.sql /* Warnings: - You are about to drop the column `label` on the `BlockVersion` table. All the data in the column will be lost. */ -- AlterTable ALTER TABLE "Block" ADD COLUMN "lockedByUserId" TEXT, ADD COLUMN "lockedAt" TIMESTAMP(3), ADD COLUMN "deletedAt" TIMESTAMP(3); -- AlterTable ALTER TABLE "BlockVersion" DROP COLUMN "label", ADD COLUMN "displayName" TEXT NOT NULL DEFAULT E'', ADD COLUMN "description" TEXT, ADD COLUMN "commitId" TEXT, ADD COLUMN "deleted" BOOLEAN; -- AddForeignKey ALTER TABLE "Block" ADD FOREIGN KEY ("lockedByUserId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- AddForeignKey ALTER TABLE "BlockVersion" ADD FOREIGN KEY ("commitId") REFERENCES "Commit"("id") ON DELETE SET NULL ON UPDATE CASCADE;
/*L Copyright SAIC-F Inc. Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/cadsr-password-change/LICENSE.txt for details. L*/ --run as sbrext update sbr.user_accounts_view set enabled_ind = 'No' where ua_name like 'DEVELOPER%' /
CREATE TRIGGER maintain_project_fact_types BEFORE DELETE ON project_types FOR EACH ROW EXECUTE PROCEDURE v1.remove_project_type_from_project_fact_types();
<reponame>domdomegg/tabula<gh_stars>1-10 alter table feedback add column finalstage varchar(255); -- Marker chooses - populate final stage update feedback f set finalstage = 'moderation-marker' where id in ( select f.id from feedback f join assignment a on a.id = f.assignment_id join markingworkflow m on a.cm2_workflow_id = m.id join auditevent ae on ae.eventtype = 'FinishMarking' and ae.eventstage = 'before' and ae.data::jsonb -> 'assignment' ? a.id and ae.data::jsonb -> 'students' ? f.userid where m.settings::jsonb -> 'moderationSampler' ? 'marker' ); update feedback f set finalstage = 'moderation-moderator' where id in ( select f.id from feedback f -- there wouldn't be any MarkingCompleted events if this hadn't gone via the moderator join assignment a on a.id = f.assignment_id join markingworkflow m on a.cm2_workflow_id = m.id join auditevent ae on ae.eventtype = 'MarkingCompleted' and ae.eventstage = 'before' and ae.data::jsonb -> 'assignment' ? a.id and ae.data::jsonb -> 'students' ? f.userid where m.settings::jsonb -> 'moderationSampler' ? 'marker' ); -- Admin chooses - populate final stage update feedback f set finalstage = 'moderation-marker' where id in ( select f.id from feedback f join assignment a on a.id = f.assignment_id join markingworkflow m on a.cm2_workflow_id = m.id join auditevent ae on ae.eventtype = 'AdminFinalise' and ae.eventstage = 'before' and ae.data::jsonb -> 'assignment' ? a.id and ae.data::jsonb -> 'studentUsercodes' ? f.userid where m.settings::jsonb -> 'moderationSampler' ? 'admin' ); update feedback f set finalstage = 'moderation-moderator' where id in ( select f.id from feedback f join assignment a on a.id = f.assignment_id join markingworkflow m on a.cm2_workflow_id = m.id join auditevent ae on ae.eventtype = 'AllocateModerators' and ae.eventstage = 'before' and ae.data::jsonb -> 'assignment' ? a.id and ae.data::jsonb -> 'studentUsercodes' ? f.userid where m.settings::jsonb -> 'moderationSampler' ? 'admin' ); -- Moderator chooses - populate all final stages - we have to assume that every submission was moderated as pre TAB-7031 no separate skip moderation action existed update feedback f set finalstage = 'moderation-moderator' where id in ( select f.id from feedback f join assignment a on a.id = f.assignment_id join markingworkflow m on a.cm2_workflow_id = m.id where m.settings::jsonb -> 'moderationSampler' ? 'moderator' );
<gh_stars>0 CREATE TABLE [Verification].[Earnings] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, LearnerUln bigint NOT NULL, LearnerReferenceNumber NVARCHAR(50) NOT NULL, Ukprn bigint NOT NULL, PriceEpisodeIdentifier NVARCHAR(50) NULL, EpisodeStartDate DATETIME2 NOT NULL, EpisodeEffectiveTnpStartDate DATETIME2 NOT NULL, DeliveryPeriod int NOT NULL, LearningAimProgrammeType int, LearningAimFrameworkCode int, LearningAimPathwayCode int, LearningAimStandardCode int, [SfaContributionPercentage] DECIMAL(18, 5) NOT NULL, [LearningAimFundingLineType] NVARCHAR(150) NOT NULL, [LearningAimReference] NVARCHAR(50) NOT NULL, [LearningStartDate] DATETIME2 NOT NULL, [TransactionType01] MONEY NOT NULL, [TransactionType02] MONEY NOT NULL, [TransactionType03] MONEY NOT NULL, [TransactionType04] MONEY NOT NULL, [TransactionType05] MONEY NOT NULL, [TransactionType06] MONEY NOT NULL, [TransactionType07] MONEY NOT NULL, [TransactionType08] MONEY NOT NULL, [TransactionType09] MONEY NOT NULL, [TransactionType10] MONEY NOT NULL, [TransactionType11] MONEY NOT NULL, [TransactionType12] MONEY NOT NULL, [TransactionType13] MONEY NOT NULL, [TransactionType14] MONEY NOT NULL, [TransactionType15] MONEY NOT NULL, [TransactionType16] MONEY NOT NULL, [ContractType] INT NOT NULL, [FirstIncentiveCensusDate] DATETIME NULL, [SecondIncentiveCensusDate] DATETIME NULL, [LearnerAdditionalPaymentsDate] DATETIME NULL, [AgreedPrice] DECIMAL(18, 5) NOT NULL, [EndDate] DATETIME NULL, [CumulativePmrs] INT NOT NULL, [ExemptionCodeForCompletionHoldback] INT NOT NULL, [VerificationResult] INT NOT NULL, [JobId] INT NOT NULL DEFAULT 0 )