sql stringlengths 6 1.05M |
|---|
DROP table if EXISTS member;
CREATE TABLE `member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL DEFAULT '',
`group` int(3) NOT NULL DEFAULT 1,
`status` tinyint(2) NOT NULL DEFAULT 0,
`file_name` varchar(128) DEFAULT NULL,
`filesize_total` int(11) NOT NULL DEFAULT 0 COMMENT 'Total file size',
`register_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0: normal, 1:facebook, 2:twitter, 3:google',
`sex` varchar(16) DEFAULT NULL,
`sex_public_flag` tinyint(2) NOT NULL DEFAULT 0,
`birthyear` int(4) DEFAULT NULL,
`birthyear_public_flag` tinyint(2) NOT NULL DEFAULT 0,
`birthdate` varchar(5) DEFAULT NULL,
`birthdate_public_flag` tinyint(2) NOT NULL DEFAULT 0,
`country` varchar(2) DEFAULT NULL COMMENT 'Save format by ISO 3166-1 alpha-2',
`country_public_flag` tinyint(2) NOT NULL DEFAULT 0,
`login_hash` varchar(255) DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
`previous_login` datetime DEFAULT NULL,
`invite_member_id` int(11) NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `birthdate_id` (`birthdate`,`id`),
UNIQUE KEY `name_UNIQUE_idx` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
<filename>e3mlbeznistask.sql
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Oct 20, 2021 at 06:45 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.4.19
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: `e3mlbeznistask`
--
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
CREATE TABLE `admins` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
`image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted_at` timestamp NULL 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 `admins`
--
INSERT INTO `admins` (`id`, `name`, `email`, `phone`, `active`, `image`, `password`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'admin@admin.<EMAIL>', '123456', 1, NULL, '$2y$10$WzA1B9pKmdZ4pbr5EC4QJeKdkQNTabl9sccJwiN6KIGSr4knD/LFm', NULL, '2020-05-09 17:59:50', '2019-11-11 22:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`active` tinyint(4) DEFAULT 1,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted_at` timestamp NULL 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 `categories`
--
INSERT INTO `categories` (`id`, `active`, `name`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 'القسم الاول', NULL, '2021-10-19 22:00:45', '2021-10-19 22:13:22'),
(2, 1, 'القسم التاني2', NULL, '2021-10-19 22:21:19', '2021-10-19 22:22:22');
-- --------------------------------------------------------
--
-- Table structure for table `courses`
--
CREATE TABLE `courses` (
`id` bigint(20) UNSIGNED NOT NULL,
`category_id` bigint(20) UNSIGNED DEFAULT NULL,
`active` tinyint(4) DEFAULT 1,
`name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rate` int(11) NOT NULL DEFAULT 0,
`views` int(11) NOT NULL DEFAULT 0,
`hours` int(11) NOT NULL DEFAULT 0,
`levels` enum('beginner','immediat','high') COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted_at` timestamp NULL 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 `courses`
--
INSERT INTO `courses` (`id`, `category_id`, `active`, `name`, `description`, `rate`, `views`, `hours`, `levels`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'الكورس الاول1 القسم الاول', 'الكورس الاول القسم الاول', 3, 0, 2, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(2, 2, 1, 'الكورس2 التاني القسم التاني', 'الكورس التاني القسم التاني', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(3, 1, 1, ' 22الكورس3 الاول القسم الاول', ' 22الكورس الاول القسم الاول', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(4, 2, 1, 'الكورس التاني4 القسم التاني22', 'الكورس التاني القسم التاني22', 3, 0, 10, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(5, 1, 1, 'الكورس5 الاول القسم الاول', 'الكورس الاول القسم الاول', 3, 0, 2, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(6, 2, 1, 'الكورس التاني6 القسم التاني', 'الكورس التاني القسم التاني', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(7, 1, 1, ' 22الكورس الاول القسم الاول7', ' 22الكورس الاول القسم الاول', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(8, 2, 1, 'الكورس التاني القسم8 التاني22', 'الكورس التاني القسم التاني22', 3, 0, 10, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(9, 1, 1, 'الكورس الاول القسم الاول9', 'الكورس الاول القسم الاول', 3, 0, 2, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(10, 2, 1, 'الكورس10 التاني القسم التاني', 'الكورس التاني القسم التاني', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(11, 1, 1, ' 22الكورس11 الاول القسم الاول', ' 22الكورس الاول القسم الاول', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(12, 2, 1, 'الكورس12 التاني القسم التاني22', 'الكورس التاني القسم التاني22', 3, 0, 10, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(13, 1, 1, 'الكورس13 الاول القسم الاول', 'الكورس الاول القسم الاول', 3, 0, 2, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(14, 2, 1, 'الكورس التاني القسم التاني14', 'الكورس التاني القسم التاني', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(15, 1, 1, ' 22الكورس الاول15 القسم الاول', ' 22الكورس الاول القسم الاول', 3, 0, 5, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34'),
(16, 2, 1, 'الكورس التاني16 القسم التاني22', 'الكورس التاني القسم التاني22', 3, 0, 10, 'beginner', NULL, '2021-10-19 23:12:13', '2021-10-19 23:16:34');
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) 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, '2012_07_27_103408_create_admins_table', 1),
(2, '2013_10_12_000000_create_categories_table', 1),
(3, '2014_10_12_000000_create_courses_table', 1),
(4, '2014_10_12_000000_create_users_table', 1),
(5, '2014_10_12_100000_create_password_resets_table', 1),
(6, '2016_06_01_000001_create_oauth_auth_codes_table', 1),
(7, '2016_06_01_000002_create_oauth_access_tokens_table', 1),
(8, '2016_06_01_000003_create_oauth_refresh_tokens_table', 1),
(9, '2016_06_01_000004_create_oauth_clients_table', 1),
(10, '2016_06_01_000005_create_oauth_personal_access_clients_table', 1),
(11, '2019_08_19_000000_create_failed_jobs_table', 1),
(12, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(13, '2020_02_25_143036_create_verifications_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `oauth_access_tokens`
--
CREATE TABLE `oauth_access_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`client_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`revoked` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `oauth_access_tokens`
--
INSERT INTO `oauth_access_tokens` (`id`, `user_id`, `client_id`, `name`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) VALUES
('2c45a1844a18c5e9436202d532ed7a4333608d32736155b98156ff94ff8da1265ec44dabf1375470', 1, 1, 'Laravel Personal Access Client', '[]', 0, '2021-10-20 00:24:14', '2021-10-20 00:24:14', '2022-10-20 02:24:14'),
('b4e472916ab482f7673c778d248c00b5617a3c166096147b3d2cd0954b18602ccfdcb445137dd7c0', 1, 1, 'Laravel Personal Access Client', '[]', 0, '2021-10-20 00:30:43', '2021-10-20 00:30:43', '2022-10-20 02:30:43'),
('bf8981a2a6632fa270657d7032bc9542864accddb0ab296bb2f4937d2c1ff4a21d936d5fdcfad72f', 1, 1, 'Laravel Personal Access Client', '[]', 0, '2021-10-20 00:28:10', '2021-10-20 00:28:10', '2022-10-20 02:28:10');
-- --------------------------------------------------------
--
-- Table structure for table `oauth_auth_codes`
--
CREATE TABLE `oauth_auth_codes` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`client_id` bigint(20) UNSIGNED NOT NULL,
`scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `oauth_clients`
--
CREATE TABLE `oauth_clients` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`provider` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
`personal_access_client` tinyint(1) NOT NULL,
`password_client` tinyint(1) NOT NULL,
`revoked` tinyint(1) 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 `oauth_clients`
--
INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES
(1, NULL, 'Laravel Personal Access Client', 'k03JKZRykWfyUU3fB9E2luuiWm6700719xTq2W6x', NULL, 'http://localhost', 1, 0, 0, '2021-10-20 00:18:13', '2021-10-20 00:18:13');
-- --------------------------------------------------------
--
-- Table structure for table `oauth_personal_access_clients`
--
CREATE TABLE `oauth_personal_access_clients` (
`id` bigint(20) UNSIGNED NOT NULL,
`client_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `oauth_personal_access_clients`
--
INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES
(1, 1, '2021-10-20 00:18:14', '2021-10-20 00:18:14');
-- --------------------------------------------------------
--
-- Table structure for table `oauth_refresh_tokens`
--
CREATE TABLE `oauth_refresh_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT 0,
`suspend` tinyint(4) NOT NULL DEFAULT 0,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `active`, `suspend`, `name`, `email`, `email_verified_at`, `password`, `token`, `image`, `remember_token`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 0, 'test', '<EMAIL>', NULL, '$2y$10$jwHgwUkB2u4DZ9ANLIa2BewJfJ9nBLOaHzypP3O6kUAi16JiLi1mW', 'asd', NULL, NULL, NULL, '2021-10-20 00:30:43', '2021-10-20 00:30:43');
-- --------------------------------------------------------
--
-- Table structure for table `verifications`
--
CREATE TABLE `verifications` (
`id` bigint(20) UNSIGNED NOT NULL,
`role` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '1=>user ,2=>teacher',
`type` enum('activate','reset') COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`expire_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `verifications`
--
INSERT INTO `verifications` (`id`, `role`, `type`, `phone`, `code`, `expire_at`) VALUES
(1, NULL, 'activate', '<EMAIL>', '6187', '2021-10-20 01:30:43');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `admins_email_unique` (`email`),
ADD UNIQUE KEY `admins_phone_unique` (`phone`);
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
ADD PRIMARY KEY (`id`),
ADD KEY `courses_category_id_foreign` (`category_id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `oauth_access_tokens`
--
ALTER TABLE `oauth_access_tokens`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_access_tokens_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_auth_codes`
--
ALTER TABLE `oauth_auth_codes`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_auth_codes_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_clients_user_id_index` (`user_id`);
--
-- Indexes for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `oauth_refresh_tokens`
--
ALTER TABLE `oauth_refresh_tokens`
ADD PRIMARY KEY (`id`),
ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- Indexes for table `verifications`
--
ALTER TABLE `verifications`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `courses`
--
ALTER TABLE `courses`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `verifications`
--
ALTER TABLE `verifications`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `courses`
--
ALTER TABLE `courses`
ADD CONSTRAINT `courses_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 15, 2020 at 01:24 PM
-- Server version: 5.6.49-cll-lve
-- PHP Version: 7.3.6
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: `Animaldatabase`
--
-- --------------------------------------------------------
--
-- Table structure for table `track_users`
--
CREATE TABLE `track_users` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`username` varchar(64) NOT NULL,
`email` varchar(128) NOT NULL,
`password` varchar(32) NOT NULL,
`img` varchar(256) NOT NULL,
`date_create` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `track_users`
--
INSERT INTO `track_users` (`id`, `name`, `username`, `email`, `password`, `img`, `date_create`) VALUES
(10, '<NAME>', 'user10', '<EMAIL>', '<PASSWORD>', 'https://via.placeholder.com/400/859/fff/?text=user10', '2020-07-15 03:50:11'),
(9, '<NAME>', 'user9', '<EMAIL>', '1a1dc91c907325c69271ddf0c944bc72', 'https://via.placeholder.com/400/988/fff/?text=user9', '2020-01-26 11:17:08'),
(8, '<NAME>', 'user8', '<EMAIL>', '1a1dc91c907325c69271ddf0c944bc72', 'https://via.placeholder.com/400/724/fff/?text=user8', '2020-08-20 01:57:01'),
(7, '<NAME>', 'user7', '<EMAIL>', '1a1dc91c907325c69271ddf<PASSWORD>bc72', 'https://via.placeholder.com/400/817/fff/?text=user7', '2020-07-28 08:31:22'),
(6, '<NAME>', 'user6', '<EMAIL>', '1a1dc91c907325c69271ddf0c944bc72', 'https://via.placeholder.com/400/759/fff/?text=user6', '2020-04-16 01:39:51'),
(5, '<NAME>', 'user5', '<EMAIL>', '<PASSWORD>', 'https://via.placeholder.com/400/992/fff/?text=user5', '2020-08-21 07:35:11'),
(4, '<NAME>', 'user4', '<EMAIL>', '<PASSWORD>907325c69271ddf0c944bc72', 'https://via.placeholder.com/400/748/fff/?text=user4', '2020-09-09 08:50:17'),
(3, '<NAME>', 'user3', '<EMAIL>', '<PASSWORD>', 'https://via.placeholder.com/400/821/fff/?text=user3', '2020-08-23 11:23:23'),
(2, '<NAME>', 'user2', '<EMAIL>', '<PASSWORD>', 'https://via.placeholder.com/400/914/fff/?text=user2', '2020-02-04 11:33:50'),
(1, '<NAME>', 'user1', '<EMAIL>', '<PASSWORD>', 'https://via.placeholder.com/400/791/fff/?text=user1', '2020-08-13 09:35:58'),
(11, '<NAME>', 'user0', '<EMAIL>', '<PASSWORD>', 'uploads/1608063542.0614_user0.jpg', '2020-12-15 10:34:11');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `track_users`
--
ALTER TABLE `track_users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `track_users`
--
ALTER TABLE `track_users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
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>denistanjingyu/Instacart-Market-Basket-Analysis
CREATE database project1;
SELECT *
FROM project1.resultba2;
SELECT itemA,
itemB,
supportAB,
confidenceAtoB
FROM project1.resultba2
WHERE supportAB > 0.02
AND confidenceAtoB > 0.2
ORDER BY confidenceAtoB DESC;
SELECT itemA,
itemB,
supportAB,
confidenceAtoB
FROM project1.resultba2
WHERE supportAB > 0
AND confidenceAtoB > 0
AND itemA = "Coconut Chia Bar"
ORDER BY confidenceAtoB DESC;
CREATE VIEW CartItems1(itemA,
itemB,
supportAB,
confidenceAtoB) AS
SELECT itemA,
itemB,
supportAB,
confidenceAtoB
FROM project1.resultba2
WHERE supportAB > 0
AND confidenceAtoB > 0
AND itemA = "Coconut Chia Bar"
OR itemA = "Chocolate Sea Salt"
OR itemA = "Peanut Butter Bar"
ORDER BY confidenceAtoB DESC;
SELECT *
FROM CartItems1
WHERE itemB != "Coconut Chia Bar"
AND itemB != "Chocolate Sea Salt"
AND itemB != "Chocolate Peanut Butter"
ORDER BY confidenceAtoB DESC
LIMIT 3;
|
<gh_stars>0
CREATE OR REPLACE FUNCTION descendant_forums(
root_id INTEGER
) RETURNS TABLE (
id INTEGER
) AS $descendant_forums$
WITH RECURSIVE descendants AS (
SELECT
forum.id,
forum.parent_forum_id
FROM forum
WHERE forum.id = root_id
UNION ALL
SELECT
subforum.id,
subforum.parent_forum_id
FROM forum AS subforum
INNER JOIN descendants
ON subforum.parent_forum_id = descendants.id
)
SELECT
descendants.id
FROM descendants;
$descendant_forums$
STABLE
LANGUAGE sql;
|
-- These must be loaded into your Oracle instance if you are going
-- to use locking.
-- They were taken from https://jeffkemponoracle.com/2005/10/user-named-locks-with-dbms_lock/
-- internal function to get a lock handle
-- (private for use by request_lock and release_lock)
CREATE OR REPLACE FUNCTION get_handle (lock_name IN VARCHAR2) RETURN VARCHAR2 IS
PRAGMA AUTONOMOUS_TRANSACTION;
lock_handle VARCHAR2(128);
BEGIN
DBMS_LOCK.ALLOCATE_UNIQUE (
lockname => lock_name,
lockhandle => lock_handle,
expiration_secs => 864000); -- 10 days
RETURN lock_handle;
END get_handle;
CREATE OR REPLACE PROCEDURE request_lock (lock_name IN VARCHAR2) IS
lock_status NUMBER;
BEGIN
lock_status := DBMS_LOCK.REQUEST(
lockhandle => get_handle(lock_name),
lockmode => DBMS_LOCK.X_MODE, -- eXclusive
timeout => DBMS_LOCK.MAXWAIT, -- wait forever
release_on_commit => FALSE);
CASE lock_status
WHEN 0 THEN NULL;
WHEN 2 THEN RAISE_APPLICATION_ERROR(-20000,'deadlock detected');
WHEN 4 THEN RAISE_APPLICATION_ERROR(-20000,'lock already obtained');
ELSE RAISE_APPLICATION_ERROR(-20000,'request lock failed: ' || lock_status);
END CASE;
END request_lock;
-- wrapper to release a lock
CREATE OR REPLACE PROCEDURE release_lock (lock_name IN VARCHAR2) IS
lock_status NUMBER;
BEGIN
lock_status := DBMS_LOCK.RELEASE(
lockhandle => get_handle(lock_name));
IF lock_status > 0 THEN
RAISE_APPLICATION_ERROR(-20000,'release lock failed: ' || lock_status);
END IF;
END release_lock;
|
-- phpMyAdmin SQL Dump
-- version 4.9.5deb2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 27, 2022 at 12:29 PM
-- Server version: 8.0.28-0ubuntu0.20.04.3
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `parkir`
--
-- --------------------------------------------------------
--
-- Table structure for table `akun`
--
CREATE TABLE `akun` (
`id` int NOT NULL,
`nama` varchar(200) NOT NULL,
`username` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`password` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`id_role` int NOT NULL,
`id_mall` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `akun`
--
INSERT INTO `akun` (`id`, `nama`, `username`, `password`, `id_role`, `id_mall`) VALUES
(1, '<NAME>', '<PASSWORD>', '<PASSWORD>', 1, 1),
(2, 'Afifz Over Powahhh', 'apip', '<PASSWORD>', 1, 1),
(4, 'Fiken Aja', 'fikena', 'fikena', 2, 1),
(5, 'fiken biasa aja', 'fikenb', 'fikenbaja', 3, 1),
(6, 'fiken cukp sih', 'fikenc', 'fikencsih', 4, 1),
(7, 'admin', 'admin', 'admin', 5, 1);
-- --------------------------------------------------------
--
-- Table structure for table `detail_parkir`
--
CREATE TABLE `detail_parkir` (
`id` int NOT NULL,
`plat` varchar(25) NOT NULL,
`tempat_parkir` int DEFAULT NULL,
`masuk` datetime NOT NULL DEFAULT (now()),
`keluar` datetime DEFAULT (now()),
`harga` int DEFAULT (0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `detail_parkir`
--
INSERT INTO `detail_parkir` (`id`, `plat`, `tempat_parkir`, `masuk`, `keluar`, `harga`) VALUES
(20, 'q123q', 1, '2022-04-27 04:39:56', '2022-04-27 04:56:43', 10000),
(21, 'a123a', NULL, '2022-04-27 05:04:41', '2022-04-27 05:24:49', 10000),
(22, 'q123q', 1, '2022-04-27 05:27:41', '2022-04-27 05:28:11', 10000);
-- --------------------------------------------------------
--
-- Table structure for table `kendaraan`
--
CREATE TABLE `kendaraan` (
`plat` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `kendaraan`
--
INSERT INTO `kendaraan` (`plat`) VALUES
('a123a'),
('a123fif'),
('A123fifz'),
('b321b'),
('K470K'),
('q123q'),
('q123q1'),
('t132t'),
('U928A'),
('Z123z'),
('zzzz');
-- --------------------------------------------------------
--
-- Table structure for table `mall`
--
CREATE TABLE `mall` (
`id` int NOT NULL,
`nama` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `mall`
--
INSERT INTO `mall` (`id`, `nama`) VALUES
(1, 'Mall assin');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `parkiran`
--
CREATE TABLE `parkiran` (
`id` int NOT NULL,
`nama` varchar(100) NOT NULL,
`id_mall` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `parkiran`
--
INSERT INTO `parkiran` (`id`, `nama`, `id_mall`) VALUES
(1, 'Parkiran Reguler', 1);
-- --------------------------------------------------------
--
-- Table structure for table `role`
--
CREATE TABLE `role` (
`id` int NOT NULL,
`tipe` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `role`
--
INSERT INTO `role` (`id`, `tipe`) VALUES
(1, 'Administrator'),
(2, 'masuk'),
(3, 'lapangan'),
(4, 'keluar'),
(5, 'admin');
-- --------------------------------------------------------
--
-- Table structure for table `tempat_parkir`
--
CREATE TABLE `tempat_parkir` (
`id` int NOT NULL,
`nama` int NOT NULL,
`id_parkiran` int NOT NULL,
`kondisi` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `tempat_parkir`
--
INSERT INTO `tempat_parkir` (`id`, `nama`, `id_parkiran`, `kondisi`) VALUES
(1, 1, 1, 0),
(2, 2, 1, 0),
(3, 3, 1, 0),
(4, 4, 1, 0),
(5, 5, 1, 0),
(6, 6, 1, 0),
(7, 7, 1, 0),
(8, 8, 1, 0),
(9, 9, 1, 0),
(10, 10, 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int UNSIGNED NOT NULL,
`username` varchar(40) DEFAULT NULL,
`nama` varchar(50) DEFAULT NULL,
`nohp` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `nama`, `nohp`) VALUES
(1, 'rendiwithi', '<NAME>', '08456654'),
(3, 'admin', '<NAME>', '098767877');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `akun`
--
ALTER TABLE `akun`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_akun_role` (`id_role`),
ADD KEY `fk_akun_mall` (`id_mall`);
--
-- Indexes for table `detail_parkir`
--
ALTER TABLE `detail_parkir`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_detail parkir_kendaraan` (`plat`),
ADD KEY `fk_detail parkir_tempat_parkir` (`tempat_parkir`);
--
-- Indexes for table `kendaraan`
--
ALTER TABLE `kendaraan`
ADD PRIMARY KEY (`plat`);
--
-- Indexes for table `mall`
--
ALTER TABLE `mall`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `parkiran`
--
ALTER TABLE `parkiran`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unq_parkiran_id_mall` (`id_mall`);
--
-- Indexes for table `role`
--
ALTER TABLE `role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tempat_parkir`
--
ALTER TABLE `tempat_parkir`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_tempat_parkir_parkiran` (`id_parkiran`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `akun`
--
ALTER TABLE `akun`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `detail_parkir`
--
ALTER TABLE `detail_parkir`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `mall`
--
ALTER TABLE `mall`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `parkiran`
--
ALTER TABLE `parkiran`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `tempat_parkir`
--
ALTER TABLE `tempat_parkir`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `akun`
--
ALTER TABLE `akun`
ADD CONSTRAINT `fk_akun_mall` FOREIGN KEY (`id_mall`) REFERENCES `mall` (`id`),
ADD CONSTRAINT `fk_akun_role` FOREIGN KEY (`id_role`) REFERENCES `role` (`id`);
--
-- Constraints for table `detail_parkir`
--
ALTER TABLE `detail_parkir`
ADD CONSTRAINT `fk_detail parkir_kendaraan` FOREIGN KEY (`plat`) REFERENCES `kendaraan` (`plat`),
ADD CONSTRAINT `fk_detail parkir_tempat_parkir` FOREIGN KEY (`tempat_parkir`) REFERENCES `tempat_parkir` (`id`);
--
-- Constraints for table `parkiran`
--
ALTER TABLE `parkiran`
ADD CONSTRAINT `fk_parkiran_mall` FOREIGN KEY (`id_mall`) REFERENCES `mall` (`id`);
--
-- Constraints for table `tempat_parkir`
--
ALTER TABLE `tempat_parkir`
ADD CONSTRAINT `fk_tempat_parkir_parkiran` FOREIGN KEY (`id_parkiran`) REFERENCES `parkiran` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
select
s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment
from
tpch0_001_part,
tpch0_001_supplier,
tpch0_001_partsupp,
tpch0_001_nation,
tpch0_001_region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
and p_size = 15
and p_type LIKE '%TIN'
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
and r_name = 'EUROPE'
and ps_supplycost = (
select
min(ps_supplycost)
from
tpch0_001_partsupp,
tpch0_001_supplier,
tpch0_001_nation,
tpch0_001_region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
and r_name = 'EUROPE'
)
order by
s_acctbal DESC,
n_name,
s_name,
p_partkey
limit 100
;
|
CREATE TABLE IF NOT EXISTS parcel_status (
id SERIAL PRIMARY KEY,
status_value TEXT NOT NULL
);
BEGIN;
CREATE OR REPLACE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = now();
RETURN NEW;
END;
$$ language 'plpgsql';
COMMIT;
BEGIN;
CREATE TABLE IF NOT EXISTS parcel (
id SERIAL PRIMARY KEY,
user_id INT NOT NULL CHECK(user_id > 0),
carrier_id INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status INT NOT NULL DEFAULT 1,
source_address TEXT NOT NULL CHECK(source_address != ''),
destination_address TEXT NOT NULL CHECK(destination_address != ''),
source_time TIMESTAMP,
type TEXT NOT NULL CHECK(type != ''),
price FLOAT,
carrier_fee FLOAT,
company_fee FLOAT,
CONSTRAINT status
FOREIGN KEY(status)
REFERENCES parcel_status(id)
);
CREATE TRIGGER user_timestamp BEFORE INSERT OR UPDATE ON parcel
FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
COMMIT;
CREATE TABLE IF NOT EXISTS carrier_request_status (
id SERIAL PRIMARY KEY,
status_value TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS carrier_request (
PRIMARY KEY(parcel_id, carrier_id),
parcel_id INT NOT NULL,
carrier_id INT NOT NULL,
status INT NOT NULL DEFAULT 1,
CONSTRAINT parcel_id
FOREIGN KEY(parcel_id)
REFERENCES parcel(id)
ON DELETE CASCADE,
CONSTRAINT status
FOREIGN KEY(status)
REFERENCES carrier_request_status(id)
); |
-- savepoint.test
--
-- execsql {
-- SAVEPOINT sp1;
-- SAVEPOINT sp2;
-- RELEASE sp1;
-- }
SAVEPOINT sp1;
SAVEPOINT sp2;
RELEASE sp1; |
-- analyze.test
--
-- execsql {
-- DROP INDEX t2i3;
-- ANALYZE t1;
-- SELECT idx, stat FROM sqlite_stat1 ORDER BY idx;
-- }
DROP INDEX t2i3;
ANALYZE t1;
SELECT idx, stat FROM sqlite_stat1 ORDER BY idx; |
-- original: shared2.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
BEGIN;
CREATE TABLE numbers(a PRIMARY KEY, b);
INSERT INTO numbers(oid) VALUES(NULL);
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
INSERT INTO numbers(oid) SELECT NULL FROM numbers;
UPDATE numbers set a = oid, b = 'abcdefghijklmnopqrstuvwxyz0123456789';
COMMIT
;pragma read_uncommitted = 1
;SELECT count(*) FROM numbers
;SELECT a FROM numbers ORDER BY oid
;BEGIN;
DELETE FROM numbers
;ROLLBACK
;SELECT count(*) FROM numbers
;SELECT a, b FROM numbers ORDER BY a
;DELETE FROM numbers
;CREATE TABLE t0(a, b);
CREATE TABLE t1(a, b DEFAULT 'hello world')
;SELECT a, b FROM t0
;INSERT INTO t1(a) VALUES(1)
;CREATE TABLE t2(a, b, c)
;CREATE INDEX i1 ON t2(a)
;CREATE TABLE t1(a, b)
;CREATE TABLE t2(a, b)
;SELECT * FROM t2
;SELECT * FROM t1; |
<reponame>thanhnam2811/FashionWeb<gh_stars>1-10
use QuanLiShop
go
---------- SanPham ----------
-- load SanPham by maLoaiSP --
drop procedure if exists load_SanPham_by_maLoaiSP
go
create procedure load_SanPham_by_maLoaiSP
@maLoaiSP int
as
select *
from SanPham
where maLoaiSP = @maLoaiSP
go
-- load SanPham by maSP --
drop procedure if exists load_SanPham_by_maSP
go
create procedure load_SanPham_by_maSP
@maSP int
as
select *
from SanPham
where maSP = @maSP
go
---Load DonHang theo maKH----------
drop procedure if exists load_DonHangbyMaKH
go
create procedure load_DonHangbyMaKH
@maKH int null
AS
BEGIN
if(@maKH is null)
select * from DonHang
else
select * from DonHang where maKH = @maKH
END;
GO
-- Load list Sản phẩm theo mã loại sản phẩm
drop procedure if exists load_ListSanPhambymaLoaiSP
go
create procedure load_ListSanPhambymaLoaiSP
@maLoaiSP int null
AS
BEGIN
if(@maLoaiSP is null)
select * from SanPham
else
select * from SanPham where maLoaiSP = @maLoaiSP
END;
GO
-- Load loại Sản phẩm theo mã sản phẩm ---
drop procedure if exists load_LoaiSanPhambymaSP
go
create procedure load_LoaiSanPhambymaSP
@maSP int null
AS
BEGIN
select SanPham.maLoaiSP,tenLoaiSP
from SanPham join LoaiSP on SanPham.maLoaiSP=LoaiSP.maLoaiSP
where SanPham.maSP=@maSP
END;
GO
-- Load list Bình Luận theo mã sản phẩm --
drop procedure if exists load_ListBinhLuanPhambymaSP
go
create procedure load_ListBinhLuanPhambymaSP
@maSP int null
AS
BEGIN
select maCMT,users.hoTen,maSP,noiDung,ngayDang
from users,binhluan
where users.maKH = binhluan.maKH and binhluan.maSP=@maSP
END;
GO
-- Load thương hiệu theo mã sản phẩm--
drop procedure if exists load_ThuongHieuPhambymaSP
go
create procedure load_ThuongHieuPhambymaSP
@maSP int null
AS
BEGIN
select ThuongHieu.maTH,tenTH,emailTH,hinhTH
from ThuongHieu inner join SanPham on ThuongHieu.maTH=SanPham.maTH
where SanPham.maSP=@maSP
END;
GO
-- update Num Product In GioHang --
drop procedure if exists update_NumProductInGioHang
go
create procedure update_NumProductInGioHang
@id int,
@soLuongSP int
as
update ChiTietGioHang
set soLuongSP = @soLuongSP
where ID = @id
go
-- find user --
drop procedure if exists find_User
go
create procedure find_User
@username varchar(20),
@password varchar(max)
as
select *
from Users
where
Users.userName = @username and
Users.[password] = <PASSWORD>;
go
-- Load info user theo maKH--
drop procedure if exists load_UserInfo_bymaKH
go
create procedure load_UserInfo_bymaKH
@maKH int
as
select * from Users
where Users.maKH=@maKH
go
--load list Đơn hàng theo maKH--
drop procedure if exists load_listDonHang_bymaKH
go
create procedure load_listDonHang_bymaKH
@maKH int
as
select DonHang.maDH,DonHang.maKH,DonHang.tenNguoiNhan,DonHang.diaChi,DonHang.sdt ,DonHang.ngayMua,DonHang.tongTien,DonHang.maDV
from DonHang join Users on DonHang.maKH=Users.maKH
where DonHang.maKH=@maKH
go
-- Load list Chi tiết đơn hàng theo maKH--
drop procedure if exists load_listChiTietDonHang_bymaKH
go
create procedure load_listChiTietDonHang_bymaKH
@maKH int
as
select ChiTietDonHang.ID,ChiTietDonHang.maDH,ChiTietDonHang.maSP,ChiTietDonHang.soLuongSP,ChiTietDonHang.thanhTien
from ChiTietDonHang join DonHang on ChiTietDonHang.maDH=DonHang.maDH
where DonHang.maKH=@maKH
go
-- Edit thông tin User (Không thay đổi pass) theo maKH --
drop procedure if exists update_UserInfo_bymaKH
go
create procedure update_UserInfo_bymaKH
@maKH int,
@hoTen nvarchar(50),
@sdt varchar(10),
@ngaySinh date,
@diaChi nvarchar(50)
as
update Users
set
Users.hoTen = @hoTen,
Users.sdt = @sdt,
Users.ngaySinh = @ngaySinh,
Users.diaChi = @diaChi
where Users.maKH = @maKH
go
------------------------------------------
drop procedure if exists searchSP
go
create procedure searchSP
@search nvarchar(50)
AS
Begin
select *
from SanPham
where SanPham.tenSP like @search
End
Go
--------------------------------------------------------
drop procedure if exists count_listSP
go
create procedure count_listSP
@search nvarchar(50)
AS
Begin
select COUNT(*) as sl from SanPham where SanPham.tenSP like @search
End
Go
----------------------------------------------------------
drop procedure if exists sortSP_bygiaSP
go
create procedure sortSP_bygiaSP
@sortType nvarchar(10),
@min nvarchar(20),
@max nvarchar(20)
AS
BEGIN
IF(@sortType = 'DESC')
select * from SanPham where giaSP >= @min and giaSP <= @max order by giaSP DESC
ELSE
select * from SanPham where giaSP >= @min and giaSP <= @max order by giaSP
END
go
---------------------------------------------------
drop procedure if exists sortSP_byngayDangBan
go
CREATE PROCEDURE sortSP_byngayDangBan
@min nvarchar(20),
@max nvarchar(20)
AS
BEGIN
SELECT *
FROM SanPham
WHERE giaSP >= @min and giaSP <= @max
ORDER BY ngayDangBan DESC
END
Go
-----------------------------------------------
drop procedure if exists getMaxPrice
go
create procedure getMaxPrice
AS
Begin
select max(giaSP) from SanPham
END
Go
----------------------------------------------------
drop procedure if exists load_SPBanNhieu
go
create procedure load_SPBanNhieu
AS
Begin
select top(10) maSP,tenSP, maTH, maLoaiSP, hinhSP, giaSP, soLuongSP, ngayDangBan
from SanPham as b, (select maSP as sp, count(soLuongSP) as SL
from ChiTietDonHang
group by maSP) as A
where b.maSP = A.sp and soLuongSP > 0
order by SL desc
end
go
-----------------------------------------------------
drop procedure if exists load_ThuongHieu_byMaTH
go
create procedure load_ThuongHieu_byMaTH
@maTH nvarchar(10)
AS
BEGIN
select * from ThuongHieu where maTH = @maTH
END
go
-----------------
drop procedure if exists getChiTietGioHangByMaKH
go
create procedure getChiTietGioHangByMaKH
@maKH int
as
BEGIN
Select ChiTietGioHang.ID, ChiTietGioHang.maSP,ChiTietGioHang.soLuongSP, tenSP,giaSP,hinhSP,ChiTietGioHang.thanhTien
From ChiTietGioHang, SanPham, Users
Where ChiTietGioHang.maKH = Users.maKH and ChiTietGioHang.maSP = SanPham.maSP
and Users.maKH =@maKH;
END;
go
--
drop procedure if exists deleteGioHangBymaKH
go
create procedure deleteGioHangBymaKH
@maKH int
as
BEGIN
delete ChiTietGioHang
where maKH = @maKH;
END;
go
--
drop procedure if exists insertUserAdmin
go
create procedure insertUserAdmin
@hoTen nvarchar(50),
@sdt varchar(10),
@ngaySinh date,
@diaChi nvarchar(50),
@username varchar(20),
@password varchar(MAX),
@roleID int
as
BEGIN
insert into Users(hoTen, sdt, ngaySinh, diaChi, username, password,roleID)
values(@hoTen,@sdt,@ngaySinh,@diaChi,@username,@password,@roleID)
END;
go
drop procedure if exists Admin_editUser
go
create procedure Admin_editUser
@hoTen nvarchar(50),
@sdt varchar(10),
@ngaySinh date,
@diaChi nvarchar(50),
@username varchar(20),
@roleID int,
@maKH int
as
BEGIN
update Users
set
hoTen = @hoTen,
sdt = @sdt,
ngaySinh = @ngaySinh,
diaChi = @diaChi,
userName = @userName,
roleID = @roleID
where maKh = @maKH
END;
go
--
drop procedure if exists getDoanhThuTheoNgay
go
create procedure getDoanhThuTheoNgay
as
BEGIN
Select ngayMua, Sum(tongTien)as tongTien
From DonHang
Group by ngayMua
END;
go
--
drop procedure if exists EditUserInfo_password
go
create procedure EditUserInfo_password
@username varchar(20),
@new_password varchar(MAX),
@old_password varchar(MAX)
as
begin
declare @sql varchar(max),@oldpass varchar(MAX)
select @oldpass = password
from Users
where userName = @username;
--Check password cũ
if @oldpass = @old_password
begin
set @sql = 'alter login ' + @username + ' with password = ''' + @new_password + ''' OLD_PASSWORD = ''' + @old_password + ''''
exec (@sql)
Update Users
set password = <PASSWORD>
where username= @username
and password = <PASSWORD>
end
end
go
-- find user --
drop procedure if exists findUserByUserName
go
create procedure findUserByUserName
@username varchar(20)
as
select *
from Users
where
Users.userName = @username
go
|
--Shared blocks contain data from regular tables and indexes; local blocks contain data from temporary tables and indexes; while temp blocks contain short-term working data used in sorts, hashes, Materialize plan nodes, and similar cases. The number of blocks dirtied indicates the number of previously unmodified blocks that were changed by this query; while the number of blocks written indicates the number of previously-dirtied blocks evicted from cache by this backend during query processing.
\prompt 'Enter queryid (shown in Top x queries reports): ' query_id
select distinct query from pg_stat_statements_history
where snap_id between :begin_snap_id and :end_snap_id
and queryid = :query_id;
with get_sql_id as (
select sample_start_time,a.snap_id,dbid,userid,queryid,round(avg(calls)) AS calls,round(avg(total_time)) AS total_time,round(avg(rows)) AS rows,
round(avg(shared_blks_hit)) AS shared_blks_hit,round(avg(shared_blks_read)) AS shared_blks_read, round(avg(shared_blks_dirtied)) AS shared_blks_dirtied,
round(avg(shared_blks_written)) AS shared_blks_written, round(avg(local_blks_hit)) AS local_blks_hit, round(avg(local_blks_read)) AS local_blks_read,
round(avg(local_blks_dirtied)) As local_blks_dirtied, round(avg(local_blks_written)) AS local_blks_written, round(avg(temp_blks_read)) AS temp_blks_read,
round(avg(temp_blks_written)) AS temp_blks_written, round(avg(blk_read_time)) AS blk_read_time, round(avg(blk_write_time)) AS blk_write_time
from pg_stat_statements_history a, pg_awr_snapshots_cust b where a.snap_id = b.snap_id
and a.snap_id between :begin_snap_id and :end_snap_id
and queryid = :query_id
group by sample_start_time, a.snap_id, dbid, userid, queryid
order by dbid,userid,queryid,a.snap_id
),
get_lag_data as (
select sample_start_time,dbid,userid,queryid,snap_id,calls,
case WHEN (calls-lag(calls::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = calls then null
else (calls-lag(calls::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS delta_calls,
case WHEN (total_time-lag(total_time::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = total_time then null
else (total_time-lag(total_time::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END as Delta_total_time,
case WHEN (rows-lag(rows::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = rows then null
else (rows-lag(rows::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END as Delta_rows,
case WHEN (shared_blks_hit-lag(shared_blks_hit::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = shared_blks_hit then null
else (shared_blks_hit-lag(shared_blks_hit::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS Delta_shared_blks_hit,
case WHEN (shared_blks_read-lag(shared_blks_read::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = shared_blks_read then null
else (shared_blks_read-lag(shared_blks_read::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS DELTA_shared_blks_read,
case WHEN (shared_blks_dirtied-lag(shared_blks_dirtied::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = shared_blks_dirtied then null
else (shared_blks_dirtied-lag(shared_blks_dirtied::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS DELTA_shared_blks_dirtied,
case WHEN (shared_blks_written-lag(shared_blks_written::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = shared_blks_written then null
else (shared_blks_written-lag(shared_blks_written::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS DELTA_shared_blks_written,
case WHEN (temp_blks_written-lag(temp_blks_written::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = temp_blks_written then null
else (temp_blks_written-lag(temp_blks_written::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS DELTA_temp_blks_written,
case WHEN (blk_read_time-lag(blk_read_time::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) = blk_read_time then null
else (blk_read_time-lag(blk_read_time::numeric,1,0::numeric) OVER (partition by dbid, userid, queryid ORDER BY snap_id) ) END AS DELTA_blk_read_time
from get_sql_id
where snap_id between :begin_snap_id-1 and :end_snap_id
)
select sample_start_time,dbid,userid,queryid,snap_id,calls as calls,delta_calls as delta_calls,
round((Delta_rows/(case when delta_calls <=0 then 1 else delta_calls end))::numeric) as "rows/exec",
round((delta_total_time/(case when delta_calls <=0 then 1 else delta_calls end))::numeric,2) as "elapsed_time_msec/exec",
round((Delta_shared_blks_hit/(case when delta_calls <=0 then 1 else delta_calls end))::numeric) as "shared_blk_hit/exec",
round((DELTA_shared_blks_read/(case when delta_calls <=0 then 1 else delta_calls end))::numeric) as "shared_blks_read/exec",
round((DELTA_shared_blks_written/(case when delta_calls <=0 then 1 else delta_calls end))::numeric) as "shared_blks_written/exec",
round((DELTA_temp_blks_written/(case when delta_calls <=0 then 1 else delta_calls end))::numeric) as "temp_blks_written/exec",
round((DELTA_blk_read_time/(case when delta_calls <=0 then 1 else delta_calls end))::numeric,2) as "blk_read_time/exec"
from get_lag_data
order by dbid,userid,queryid,snap_id;
|
update SPONSOR_TERM
set DESCRIPTION ='ONR, "Grant General Terms and Conditions for Educational Institutions, Nonprofit Organizations, and State and Local Government"'
where SPONSOR_TERM_ID = 157;
commit; |
<reponame>Arveto/N2I-2K17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE `arvauto_events` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'event''s id',
`type_id` bigint(20) NOT NULL COMMENT 'type''s id',
`description` text NOT NULL COMMENT 'event''s descriptin',
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'event''s publish date',
`latitude` float(5,3) NOT NULL COMMENT 'event''s latitude',
`longitude` float(5,3) NOT NULL COMMENT 'event''s longitude',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arvauto_events_types` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'type''s id',
`name` varchar(255) NOT NULL COMMENT 'type''s name',
`description` text NOT NULL COMMENT 'type''s description',
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arvauto_messages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'message''s id',
`event_id` bigint(20) NOT NULL COMMENT 'event''s id',
`user_id` bigint(20) NOT NULL COMMENT 'user''s id',
`content` text NOT NULL COMMENT 'message''s content',
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'message''s delevery date',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arvauto_skills` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'skill''s id',
`name` varchar(255) NOT NULL COMMENT 'skill name',
`description` text NOT NULL COMMENT 'skill''s description',
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arvauto_users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'user''s id',
`email` varchar(255) NOT NULL COMMENT 'users''s email',
`pass` varchar(255) NOT NULL COMMENT '<PASSWORD>''s <PASSWORD>',
`familyname` varchar(255) DEFAULT NULL COMMENT 'user''s familyname',
`firstname` varchar(255) DEFAULT NULL COMMENT 'user''s firstname',
`last_log` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'user''s last connection',
`chat_event` bigint(20) NOT NULL DEFAULT '0' COMMENT 'user''s curent chat room',
`connected` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'is the user online',
PRIMARY KEY (`id`),
UNIQUE (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `arvauto_users_skills` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` bigint(20) NOT NULL COMMENT 'user''s id',
`skill_id` bigint(20) NOT NULL COMMENT 'skill''s id',
`level` tinyint(4) NOT NULL COMMENT 'skill level (percents)',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
<reponame>OpertusMundi/api-gateway-interim
--
-- Drop existing objects
--
DROP SEQUENCE IF EXISTS "order".order_id_seq CASCADE;
DROP TABLE IF EXISTS "order".order CASCADE;
DROP SEQUENCE IF EXISTS "order".order_status_hist_id_seq CASCADE;
DROP TABLE IF EXISTS "order".order_status_hist CASCADE;
DROP SEQUENCE IF EXISTS "order".order_item_id_seq CASCADE;
DROP TABLE IF EXISTS "order".order_item CASCADE;
--
-- Order
--
CREATE SEQUENCE "order".order_id_seq INCREMENT 1 MINVALUE 1 START 1 CACHE 1;
CREATE TABLE "order".order
(
"id" integer NOT NULL DEFAULT nextval('order.order_id_seq'::regclass),
-- Unique key used as a business key for the purchase workflow
"key" uuid NOT NULL,
"account" integer NOT NULL,
-- Reference to the cart instance used during the checkout operation
"cart" integer NOT NULL,
"total_price" numeric(20,6) NOT NULL,
"total_price_excluding_tax" numeric(20,6) NOT NULL,
"total_tax" numeric(20,6) NOT NULL,
"currency" text NOT NULL,
"created_on" timestamp NOT NULL,
"status" character varying(64) NOT NULL,
"status_updated_on" timestamp NOT NULL,
"delivery_method" character varying(64) NOT NULL,
"payment_method" character varying(64) NOT NULL,
-- User friendly reference code for support (unique per user account)
"reference_number" character varying,
CONSTRAINT pk_order PRIMARY KEY (id),
CONSTRAINT uq_order_key UNIQUE ("key"),
CONSTRAINT fk_order_account FOREIGN KEY ("account")
REFERENCES web.account (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL,
CONSTRAINT fk_order_cart FOREIGN KEY ("cart")
REFERENCES "order".cart (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE SET NULL
);
--
-- Order status history
--
CREATE SEQUENCE "order".order_status_hist_id_seq INCREMENT 1 MINVALUE 1 START 1 CACHE 1;
CREATE TABLE "order".order_status_hist
(
"id" integer NOT NULL DEFAULT nextval('order.order_status_hist_id_seq'::regclass),
"order" integer NOT NULL,
"status" character varying(64) NOT NULL,
"status_updated_on" timestamp NOT NULL,
-- Optional user key. If the property is updated by the system without user interaction,
-- the value is set to null
"status_updated_by" integer,
CONSTRAINT pk_order_status_hist PRIMARY KEY (id),
CONSTRAINT fk_order_status_hist_order FOREIGN KEY ("order")
REFERENCES "order".order (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE
);
--
-- Order item
--
CREATE SEQUENCE "order".order_item_id_seq INCREMENT 1 MINVALUE 1 START 1 CACHE 1;
CREATE TABLE "order".order_item
(
"id" integer NOT NULL DEFAULT nextval('order.order_item_id_seq'::regclass),
"order" integer NOT NULL,
-- Invoice line number
"index" integer NOT NULL,
-- Item type: Bundle, Value-Added-Service (VAS), API, Catalogue Asset
"type" character varying(64) NOT NULL,
"product" uuid NOT NULL,
"pricing_model" uuid NOT NULL,
"discount_code" character varying(64) NULL,
CONSTRAINT pk_order_item PRIMARY KEY (id),
CONSTRAINT fk_order_item_order FOREIGN KEY ("order")
REFERENCES "order".order (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE
);
|
<filename>testredirect.sql<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50711
Source Host : localhost:3306
Source Database : testredirect
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2019-10-28 15:27:37
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for domain
-- ----------------------------
DROP TABLE IF EXISTS `domain`;
CREATE TABLE `domain` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`extension` varchar(255) NOT NULL,
`orders` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ex` (`extension`),
UNIQUE KEY `or` (`orders`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of domain
-- ----------------------------
INSERT INTO `domain` VALUES ('1', 'creationsbycameca.com', 'http://popsneaker.org');
INSERT INTO `domain` VALUES ('2', '15minnews.com', 'https://www.snkes.co');
INSERT INTO `domain` VALUES ('3', 'testredirect.com', 'http://www.baidu.com');
-- ----------------------------
-- Table structure for sku_redirect
-- ----------------------------
DROP TABLE IF EXISTS `sku_redirect`;
CREATE TABLE `sku_redirect` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`domain_id` int(11) NOT NULL,
`sku` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `did` (`domain_id`),
KEY `sku` (`sku`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sku_redirect
-- ----------------------------
INSERT INTO `sku_redirect` VALUES ('1', '2', 'FU9006', '/yeezy-boost-350-v2-black-non-reflective.html');
INSERT INTO `sku_redirect` VALUES ('2', '1', 'EG7737', '/which-sneaker-is-that-young-must-buy/');
INSERT INTO `sku_redirect` VALUES ('3', '2', 'EG7737', 'cream-white-human-race-now-is-her-time.html');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`uname` varchar(255) NOT NULL,
`upass` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uname` (`uname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', '123456');
-- ----------------------------
-- Table structure for visitor_info
-- ----------------------------
DROP TABLE IF EXISTS `visitor_info`;
CREATE TABLE `visitor_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(255) NOT NULL,
`request_uri` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
`redirect_status` varchar(255) DEFAULT NULL,
`http_referer` varchar(255) DEFAULT NULL,
`http_user_agent` varchar(255) DEFAULT NULL,
`http_x_forwarder_for` varchar(255) DEFAULT NULL,
`os_lang` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=146 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of visitor_info
-- ----------------------------
INSERT INTO `visitor_info` VALUES ('1', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:42');
INSERT INTO `visitor_info` VALUES ('2', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:47');
INSERT INTO `visitor_info` VALUES ('3', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:48');
INSERT INTO `visitor_info` VALUES ('4', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:48');
INSERT INTO `visitor_info` VALUES ('5', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:48');
INSERT INTO `visitor_info` VALUES ('6', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:48');
INSERT INTO `visitor_info` VALUES ('7', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:49');
INSERT INTO `visitor_info` VALUES ('8', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:49');
INSERT INTO `visitor_info` VALUES ('9', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:49');
INSERT INTO `visitor_info` VALUES ('10', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:49');
INSERT INTO `visitor_info` VALUES ('11', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:50');
INSERT INTO `visitor_info` VALUES ('12', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:50');
INSERT INTO `visitor_info` VALUES ('13', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:50');
INSERT INTO `visitor_info` VALUES ('14', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:50');
INSERT INTO `visitor_info` VALUES ('15', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:51');
INSERT INTO `visitor_info` VALUES ('16', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:51');
INSERT INTO `visitor_info` VALUES ('17', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:51');
INSERT INTO `visitor_info` VALUES ('18', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:51');
INSERT INTO `visitor_info` VALUES ('19', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:52');
INSERT INTO `visitor_info` VALUES ('20', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:52');
INSERT INTO `visitor_info` VALUES ('21', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:52');
INSERT INTO `visitor_info` VALUES ('22', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:56');
INSERT INTO `visitor_info` VALUES ('23', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:56');
INSERT INTO `visitor_info` VALUES ('24', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:57');
INSERT INTO `visitor_info` VALUES ('25', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:57');
INSERT INTO `visitor_info` VALUES ('26', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:57');
INSERT INTO `visitor_info` VALUES ('27', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:57');
INSERT INTO `visitor_info` VALUES ('28', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:58');
INSERT INTO `visitor_info` VALUES ('29', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:58');
INSERT INTO `visitor_info` VALUES ('30', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:54:58');
INSERT INTO `visitor_info` VALUES ('31', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:03');
INSERT INTO `visitor_info` VALUES ('32', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:03');
INSERT INTO `visitor_info` VALUES ('33', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:03');
INSERT INTO `visitor_info` VALUES ('34', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:03');
INSERT INTO `visitor_info` VALUES ('35', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:04');
INSERT INTO `visitor_info` VALUES ('36', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:04');
INSERT INTO `visitor_info` VALUES ('37', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:04');
INSERT INTO `visitor_info` VALUES ('38', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:04');
INSERT INTO `visitor_info` VALUES ('39', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:05');
INSERT INTO `visitor_info` VALUES ('40', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:09');
INSERT INTO `visitor_info` VALUES ('41', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:09');
INSERT INTO `visitor_info` VALUES ('42', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:10');
INSERT INTO `visitor_info` VALUES ('43', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:10');
INSERT INTO `visitor_info` VALUES ('44', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:10');
INSERT INTO `visitor_info` VALUES ('45', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:11');
INSERT INTO `visitor_info` VALUES ('46', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:11');
INSERT INTO `visitor_info` VALUES ('47', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:11');
INSERT INTO `visitor_info` VALUES ('48', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:12');
INSERT INTO `visitor_info` VALUES ('49', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:12');
INSERT INTO `visitor_info` VALUES ('50', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:12');
INSERT INTO `visitor_info` VALUES ('51', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:12');
INSERT INTO `visitor_info` VALUES ('52', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:13');
INSERT INTO `visitor_info` VALUES ('53', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:14');
INSERT INTO `visitor_info` VALUES ('54', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:14');
INSERT INTO `visitor_info` VALUES ('55', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:15');
INSERT INTO `visitor_info` VALUES ('56', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:15');
INSERT INTO `visitor_info` VALUES ('57', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:16');
INSERT INTO `visitor_info` VALUES ('58', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:17');
INSERT INTO `visitor_info` VALUES ('59', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:17');
INSERT INTO `visitor_info` VALUES ('60', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:17');
INSERT INTO `visitor_info` VALUES ('61', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:22');
INSERT INTO `visitor_info` VALUES ('62', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:22');
INSERT INTO `visitor_info` VALUES ('63', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:23');
INSERT INTO `visitor_info` VALUES ('64', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:23');
INSERT INTO `visitor_info` VALUES ('65', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:23');
INSERT INTO `visitor_info` VALUES ('66', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:23');
INSERT INTO `visitor_info` VALUES ('67', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:24');
INSERT INTO `visitor_info` VALUES ('68', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:24');
INSERT INTO `visitor_info` VALUES ('69', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:24');
INSERT INTO `visitor_info` VALUES ('70', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:30');
INSERT INTO `visitor_info` VALUES ('71', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:30');
INSERT INTO `visitor_info` VALUES ('72', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:30');
INSERT INTO `visitor_info` VALUES ('73', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:30');
INSERT INTO `visitor_info` VALUES ('74', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:31');
INSERT INTO `visitor_info` VALUES ('75', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:31');
INSERT INTO `visitor_info` VALUES ('76', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:31');
INSERT INTO `visitor_info` VALUES ('77', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:31');
INSERT INTO `visitor_info` VALUES ('78', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:39');
INSERT INTO `visitor_info` VALUES ('79', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:39');
INSERT INTO `visitor_info` VALUES ('80', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:39');
INSERT INTO `visitor_info` VALUES ('81', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:39');
INSERT INTO `visitor_info` VALUES ('82', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:39');
INSERT INTO `visitor_info` VALUES ('83', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:40');
INSERT INTO `visitor_info` VALUES ('84', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:40');
INSERT INTO `visitor_info` VALUES ('85', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:40');
INSERT INTO `visitor_info` VALUES ('86', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:40');
INSERT INTO `visitor_info` VALUES ('87', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:48');
INSERT INTO `visitor_info` VALUES ('88', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:48');
INSERT INTO `visitor_info` VALUES ('89', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:48');
INSERT INTO `visitor_info` VALUES ('90', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:48');
INSERT INTO `visitor_info` VALUES ('91', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:49');
INSERT INTO `visitor_info` VALUES ('92', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:49');
INSERT INTO `visitor_info` VALUES ('93', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:49');
INSERT INTO `visitor_info` VALUES ('94', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:49');
INSERT INTO `visitor_info` VALUES ('95', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:50');
INSERT INTO `visitor_info` VALUES ('96', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:50');
INSERT INTO `visitor_info` VALUES ('97', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:50');
INSERT INTO `visitor_info` VALUES ('98', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:51');
INSERT INTO `visitor_info` VALUES ('99', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:51');
INSERT INTO `visitor_info` VALUES ('100', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:51');
INSERT INTO `visitor_info` VALUES ('101', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:51');
INSERT INTO `visitor_info` VALUES ('102', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:52');
INSERT INTO `visitor_info` VALUES ('103', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:52');
INSERT INTO `visitor_info` VALUES ('104', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:52');
INSERT INTO `visitor_info` VALUES ('105', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:59');
INSERT INTO `visitor_info` VALUES ('106', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:59');
INSERT INTO `visitor_info` VALUES ('107', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:59');
INSERT INTO `visitor_info` VALUES ('108', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:59');
INSERT INTO `visitor_info` VALUES ('109', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:55:59');
INSERT INTO `visitor_info` VALUES ('110', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:04');
INSERT INTO `visitor_info` VALUES ('111', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:04');
INSERT INTO `visitor_info` VALUES ('112', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:05');
INSERT INTO `visitor_info` VALUES ('113', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:05');
INSERT INTO `visitor_info` VALUES ('114', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:05');
INSERT INTO `visitor_info` VALUES ('115', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:12');
INSERT INTO `visitor_info` VALUES ('116', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:12');
INSERT INTO `visitor_info` VALUES ('117', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:13');
INSERT INTO `visitor_info` VALUES ('118', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:13');
INSERT INTO `visitor_info` VALUES ('119', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:13');
INSERT INTO `visitor_info` VALUES ('120', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:13');
INSERT INTO `visitor_info` VALUES ('121', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:14');
INSERT INTO `visitor_info` VALUES ('122', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:14');
INSERT INTO `visitor_info` VALUES ('123', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:15');
INSERT INTO `visitor_info` VALUES ('124', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:56:15');
INSERT INTO `visitor_info` VALUES ('125', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:13');
INSERT INTO `visitor_info` VALUES ('126', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:13');
INSERT INTO `visitor_info` VALUES ('127', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:13');
INSERT INTO `visitor_info` VALUES ('128', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:13');
INSERT INTO `visitor_info` VALUES ('129', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:14');
INSERT INTO `visitor_info` VALUES ('130', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:14');
INSERT INTO `visitor_info` VALUES ('131', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:14');
INSERT INTO `visitor_info` VALUES ('132', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:14');
INSERT INTO `visitor_info` VALUES ('133', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:15');
INSERT INTO `visitor_info` VALUES ('134', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:15');
INSERT INTO `visitor_info` VALUES ('135', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:15');
INSERT INTO `visitor_info` VALUES ('136', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:15');
INSERT INTO `visitor_info` VALUES ('137', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:15');
INSERT INTO `visitor_info` VALUES ('138', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:16');
INSERT INTO `visitor_info` VALUES ('139', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:16');
INSERT INTO `visitor_info` VALUES ('140', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:16');
INSERT INTO `visitor_info` VALUES ('141', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:16');
INSERT INTO `visitor_info` VALUES ('142', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:16');
INSERT INTO `visitor_info` VALUES ('143', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:17');
INSERT INTO `visitor_info` VALUES ('144', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:17');
INSERT INTO `visitor_info` VALUES ('145', '127.0.0.1', '/visitor/visitor_info.php', 'testredirect.com/visitor/visitor_info.php', '', 'http://testredirect.com/visitor/', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36', '', '0', '2019-10-28 14:57:17');
|
<reponame>Kuntal572/FoodOrder
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 23, 2020 at 07:28 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.0.25
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: `online_food`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `name`, `username`, `password`, `email`) VALUES
(1, 'Admin', 'admin', 'admin', '<EMAIL>');
-- --------------------------------------------------------
--
-- Table structure for table `banner`
--
CREATE TABLE `banner` (
`id` int(11) NOT NULL,
`image` varchar(100) NOT NULL,
`heading` varchar(500) NOT NULL,
`sub_heading` varchar(500) NOT NULL,
`link` varchar(100) NOT NULL,
`link_txt` varchar(100) NOT NULL,
`order_number` int(11) NOT NULL,
`added_on` datetime NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `banner`
--
INSERT INTO `banner` (`id`, `image`, `heading`, `sub_heading`, `link`, `link_txt`, `order_number`, `added_on`, `status`) VALUES
(1, '533799913_banner-4.jpg', 'Drink & Heathy Food', 'Fresh Heathy and Organic', 'shop', 'Order Now', 1, '2020-06-23 03:00:05', 1),
(2, '546847873_banner-4.jpg', 'Drink & Heathy Food', 'Fresh Heathy and Organic', 'shop', 'Order Now', 1, '2020-06-23 03:06:53', 1);
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE `category` (
`id` int(11) NOT NULL,
`category` varchar(50) NOT NULL,
`order_number` int(11) NOT NULL,
`status` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `category`, `order_number`, `status`, `added_on`) VALUES
(1, 'Chaat & Snacks', 1, 1, '2020-06-16 12:06:33'),
(2, 'Chinese', 2, 1, '2020-06-16 12:06:41'),
(3, 'South Indian', 3, 1, '2020-06-16 12:06:59'),
(4, 'Desserts', 4, 1, '2020-06-16 12:07:18'),
(5, 'Murg', 0, 1, '2020-06-27 12:49:37');
-- --------------------------------------------------------
--
-- Table structure for table `contact_us`
--
CREATE TABLE `contact_us` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`mobile` varchar(15) NOT NULL,
`subject` varchar(200) NOT NULL,
`message` text NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contact_us`
--
INSERT INTO `contact_us` (`id`, `name`, `email`, `mobile`, `subject`, `message`, `added_on`) VALUES
(1, 'Vishal', '<EMAIL>', '9999999999', 'Test Subject', 'test message', '2020-06-23 03:21:43');
-- --------------------------------------------------------
--
-- Table structure for table `coupon_code`
--
CREATE TABLE `coupon_code` (
`id` int(11) NOT NULL,
`coupon_code` varchar(20) NOT NULL,
`coupon_type` enum('P','F') NOT NULL,
`coupon_value` int(11) NOT NULL,
`cart_min_value` int(11) NOT NULL,
`expired_on` date NOT NULL,
`status` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `coupon_code`
--
INSERT INTO `coupon_code` (`id`, `coupon_code`, `coupon_type`, `coupon_value`, `cart_min_value`, `expired_on`, `status`, `added_on`) VALUES
(1, 'FIRST50', 'P', 10, 50, '2020-08-20', 1, '2020-06-20 05:31:03'),
(2, 'FRIDAY', 'F', 200, 200, '2020-07-15', 1, '2020-07-10 10:38:43');
-- --------------------------------------------------------
--
-- Table structure for table `delivery_boy`
--
CREATE TABLE `delivery_boy` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`mobile` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`status` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `delivery_boy`
--
INSERT INTO `delivery_boy` (`id`, `name`, `mobile`, `password`, `status`, `added_on`) VALUES
(1, 'Vishal', '1234567890', 'vishal', 1, '2020-07-08 08:06:06'),
(2, 'Amit', '1234567891', 'amit', 1, '2020-07-08 08:06:21');
-- --------------------------------------------------------
--
-- Table structure for table `dish`
--
CREATE TABLE `dish` (
`id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`dish` varchar(100) NOT NULL,
`dish_detail` text NOT NULL,
`image` varchar(100) NOT NULL,
`type` enum('veg','non-veg') NOT NULL,
`status` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `dish`
--
INSERT INTO `dish` (`id`, `category_id`, `dish`, `dish_detail`, `image`, `type`, `status`, `added_on`) VALUES
(1, 4, '<NAME>', '<NAME>', '977945963_862169053_gulab-jamun.jpg', 'veg', 1, '2020-06-17 10:43:59'),
(3, 2, 'Chow mein', 'Chow mein', '836724175_Chowmein.jpg', 'non-veg', 1, '2020-06-17 10:47:26'),
(4, 5, 'Butter Chicken', 'Butter chicken or murg makhani is a dish, originating in the Indian subcontinent, of chicken in a mildly spiced tomato sauce.', '348714192_30-Minute-Instant-Pot-Butter-Chicken-7.jpg', 'non-veg', 1, '2020-06-27 12:50:50'),
(5, 2, 'Testing', 'testing', '140977647_404.jpg', 'veg', 0, '2020-07-06 12:00:24');
-- --------------------------------------------------------
--
-- Table structure for table `dish_cart`
--
CREATE TABLE `dish_cart` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`dish_detail_id` int(11) NOT NULL,
`qty` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `dish_cart`
--
INSERT INTO `dish_cart` (`id`, `user_id`, `dish_detail_id`, `qty`, `added_on`) VALUES
(3, 2, 6, 2, '2020-07-21 09:18:31');
-- --------------------------------------------------------
--
-- Table structure for table `dish_details`
--
CREATE TABLE `dish_details` (
`id` int(11) NOT NULL,
`dish_id` int(11) NOT NULL,
`attribute` varchar(100) NOT NULL,
`price` int(11) NOT NULL,
`status` int(11) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `dish_details`
--
INSERT INTO `dish_details` (`id`, `dish_id`, `attribute`, `price`, `status`, `added_on`) VALUES
(1, 3, 'Full', 300, 1, '2020-06-19 10:25:47'),
(2, 3, 'Half', 170, 1, '2020-06-19 10:49:45'),
(6, 1, 'Per Piece', 40, 1, '2020-06-20 00:00:00'),
(8, 4, 'Half', 250, 0, '2020-06-27 12:50:50'),
(9, 4, 'Full', 410, 1, '2020-06-27 12:50:50'),
(11, 5, 'Test1', 100, 1, '2020-07-06 12:00:24'),
(12, 5, 'Test2', 200, 0, '2020-07-06 12:00:24');
-- --------------------------------------------------------
--
-- Table structure for table `order_detail`
--
CREATE TABLE `order_detail` (
`id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`dish_details_id` int(11) NOT NULL,
`price` float NOT NULL,
`qty` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `order_detail`
--
INSERT INTO `order_detail` (`id`, `order_id`, `dish_details_id`, `price`, `qty`) VALUES
(1, 1, 6, 40, 6),
(2, 2, 6, 40, 4),
(3, 3, 6, 40, 3);
-- --------------------------------------------------------
--
-- Table structure for table `order_master`
--
CREATE TABLE `order_master` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`mobile` varchar(50) NOT NULL,
`address` text NOT NULL,
`total_price` float NOT NULL,
`coupon_code` varchar(20) NOT NULL,
`final_price` float NOT NULL,
`zipcode` varchar(10) NOT NULL,
`delivery_boy_id` int(11) NOT NULL,
`payment_status` varchar(20) NOT NULL,
`payment_type` varchar(10) NOT NULL,
`payment_id` varchar(100) NOT NULL,
`order_status` int(11) NOT NULL,
`cancel_by` enum('user','admin') NOT NULL,
`cancel_at` datetime NOT NULL,
`added_on` datetime NOT NULL,
`delivered_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `order_master`
--
INSERT INTO `order_master` (`id`, `user_id`, `name`, `email`, `mobile`, `address`, `total_price`, `coupon_code`, `final_price`, `zipcode`, `delivery_boy_id`, `payment_status`, `payment_type`, `payment_id`, `order_status`, `cancel_by`, `cancel_at`, `added_on`, `delivered_on`) VALUES
(1, 2, 'Vishal', '<EMAIL>', '9999999999', 'Test', 240, '', 240, '110076', 0, 'pending', 'wallet', '', 5, 'admin', '2020-07-21 08:13:01', '2020-07-18 06:08:19', '0000-00-00 00:00:00'),
(2, 2, 'Vishal', '<EMAIL>', '9999999999', 'test', 160, '', 160, '110076', 0, 'pending', 'wallet', '', 4, 'user', '0000-00-00 00:00:00', '2020-07-20 06:09:59', '0000-00-00 00:00:00'),
(3, 5, 'Vishal', '<EMAIL>', '9999999999', 'Test', 120, '', 120, '110076', 0, 'pending', 'cod', '', 4, 'user', '0000-00-00 00:00:00', '2020-07-23 09:09:41', '0000-00-00 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `order_status`
--
CREATE TABLE `order_status` (
`id` int(11) NOT NULL,
`order_status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `order_status`
--
INSERT INTO `order_status` (`id`, `order_status`) VALUES
(1, 'Pending'),
(2, 'Cooking '),
(3, 'On the Way'),
(4, 'Delivered'),
(5, 'Cancel');
-- --------------------------------------------------------
--
-- Table structure for table `rating`
--
CREATE TABLE `rating` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`dish_detail_id` int(11) NOT NULL,
`rating` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `rating`
--
INSERT INTO `rating` (`id`, `user_id`, `order_id`, `dish_detail_id`, `rating`) VALUES
(1, 1, 6, 1, 5);
-- --------------------------------------------------------
--
-- Table structure for table `setting`
--
CREATE TABLE `setting` (
`id` int(11) NOT NULL,
`cart_min_price` int(11) NOT NULL,
`cart_min_price_msg` varchar(250) NOT NULL,
`website_close` int(11) NOT NULL,
`wallet_amt` int(11) NOT NULL,
`website_close_msg` varchar(250) NOT NULL,
`referral_amt` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `setting`
--
INSERT INTO `setting` (`id`, `cart_min_price`, `cart_min_price_msg`, `website_close`, `wallet_amt`, `website_close_msg`, `referral_amt`) VALUES
(1, 40, 'Cart min price will be 50 rs', 0, 0, 'Website Closed for today', 50);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`mobile` varchar(15) NOT NULL,
`password` varchar(100) NOT NULL,
`status` int(11) NOT NULL,
`email_verify` int(11) NOT NULL,
`rand_str` varchar(20) NOT NULL,
`referral_code` varchar(20) NOT NULL,
`from_referral_code` varchar(20) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `email`, `mobile`, `password`, `status`, `email_verify`, `rand_str`, `referral_code`, `from_referral_code`, `added_on`) VALUES
(2, 'Vishal', '<EMAIL>', '<PASSWORD>', '$2y$10$cZ6sSDVYUINCnynmB3Tbuend7e7bRqgCPeD.RPmxdRucxKhbSo/52', 1, 1, '<PASSWORD>', '<PASSWORD>', '', '2020-07-18 05:11:37'),
(5, 'Vishal', '<EMAIL>', '9999999999', '$2y$10$wWBWMJTK37jkyLujN8YQoOVfQQt/3.B9ruoaNkjruQEwz4ZVfvNJa', 1, 1, 'zdoxxhajyeqtgpp', 'lhqtkjofzevfdai', 'lmkaetixyrzqoqds', '2020-07-23 08:48:08');
-- --------------------------------------------------------
--
-- Table structure for table `wallet`
--
CREATE TABLE `wallet` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`amt` int(11) NOT NULL,
`msg` varchar(500) NOT NULL,
`type` enum('in','out') NOT NULL,
`payment_id` varchar(50) NOT NULL,
`added_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `wallet`
--
INSERT INTO `wallet` (`id`, `user_id`, `amt`, `msg`, `type`, `payment_id`, `added_on`) VALUES
(2, 2, 50, 'Registration', 'in', '', '2020-07-18 05:11:38'),
(4, 2, 50, 'Shoping', 'out', '', '0000-00-00 00:00:00'),
(5, 2, 100, 'Added', 'in', '', '0000-00-00 00:00:00'),
(7, 2, 100, 'Added', 'in', '', '2020-07-18 05:58:29'),
(8, 2, 20, 'Added', 'in', '', '2020-07-18 05:59:02'),
(9, 2, 15, 'Added', 'in', '', '2020-07-18 06:00:35'),
(10, 2, 30, 'Added', 'in', '', '2020-07-18 06:01:17'),
(11, 2, 10, 'Added', 'in', '20200718111212800110168602301710786', '2020-07-18 06:04:04'),
(13, 2, 160, 'Order Id-2', 'out', '', '2020-07-18 06:09:59'),
(14, 2, 800, 'Added', 'in', '20200718111212800110168644701732407', '2020-07-18 06:17:19'),
(15, 3, 0, 'Register', 'in', '', '2020-07-18 08:00:53'),
(16, 2, 200, 'Order Id-3', 'out', '', '2020-07-19 04:29:04'),
(17, 2, 200, 'Order Id-4', 'out', '', '2020-07-19 04:30:51'),
(18, 3, 100, 'Test msg', 'in', '', '2020-07-21 08:22:33'),
(19, 2, 200, 'Test Msg', 'in', '', '2020-07-21 08:22:46'),
(22, 2, 50, 'Referral Amt from <EMAIL>', 'in', '', '2020-07-23 09:12:28');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `banner`
--
ALTER TABLE `banner`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_us`
--
ALTER TABLE `contact_us`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `coupon_code`
--
ALTER TABLE `coupon_code`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `delivery_boy`
--
ALTER TABLE `delivery_boy`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dish`
--
ALTER TABLE `dish`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dish_cart`
--
ALTER TABLE `dish_cart`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dish_details`
--
ALTER TABLE `dish_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `order_detail`
--
ALTER TABLE `order_detail`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `order_master`
--
ALTER TABLE `order_master`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `order_status`
--
ALTER TABLE `order_status`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rating`
--
ALTER TABLE `rating`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `setting`
--
ALTER TABLE `setting`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `wallet`
--
ALTER TABLE `wallet`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `banner`
--
ALTER TABLE `banner`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `contact_us`
--
ALTER TABLE `contact_us`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `coupon_code`
--
ALTER TABLE `coupon_code`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `delivery_boy`
--
ALTER TABLE `delivery_boy`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `dish`
--
ALTER TABLE `dish`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `dish_cart`
--
ALTER TABLE `dish_cart`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `dish_details`
--
ALTER TABLE `dish_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `order_detail`
--
ALTER TABLE `order_detail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `order_master`
--
ALTER TABLE `order_master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `order_status`
--
ALTER TABLE `order_status`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `rating`
--
ALTER TABLE `rating`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `setting`
--
ALTER TABLE `setting`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `wallet`
--
ALTER TABLE `wallet`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
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 */;
|
-- Rename foreign keys from release_atlasitem table and cascade remove operation.
ALTER TABLE `atlas`.`release_atlasitem`
DROP FOREIGN KEY `fk_release_atlasobject_atlasobject1`;
ALTER TABLE `atlas`.`release_atlasitem`
DROP FOREIGN KEY `fk_release_atlasobject_release1`;
ALTER TABLE `atlas`.`release_atlasitem`
ADD CONSTRAINT `FK_RELEASE_ATLASITEM_RELEASE_ID`
FOREIGN KEY (`release_id`)
REFERENCES `atlas`.`release` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION;
ALTER TABLE `atlas`.`release_atlasitem`
ADD CONSTRAINT `FK_RELEASE_ATLASITEM_OBJECTS_ID`
FOREIGN KEY (`objects_id`)
REFERENCES `atlas`.`atlasobject` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION;
|
/*********此SQL针对之前下载过FastOS部署过的用户,核心数据库fastdb 只需执行此SQL就可以了*************/
/**flowable 工作流数据库 为分库管理所以单独开辟数据库**/
/*建库*/
CREATE USER 'fast_flowable'@'localhost' IDENTIFIED BY 'fast_flowable@123$';
CREATE USER 'fast_flowable'@'%' IDENTIFIED BY 'fast_flowable@123$';
CREATE DATABASE fast_flowabledb DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_bin;
GRANT ALL PRIVILEGES ON `fast_flowabledb`.* TO 'fast_flowable'@'%' IDENTIFIED BY 'fast_flowable@123$';
GRANT ALL PRIVILEGES ON `fast_flowabledb`.* TO 'fast_flowable'@'localhost' IDENTIFIED BY 'fast_flowable@123$'; |
{#- 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.
-#}
{%- macro sat_template(src_pk, src_hashdiff, src_payload,
src_eff, src_ldts, src_source,
tgt_pk, tgt_hashdiff, tgt_payload,
tgt_eff, tgt_ldts, tgt_source,
source) -%}
{%- set tgt_cols = dbtvault.create_tgt_cols(src_pk=src_pk,
src_hashdiff=src_hashdiff, src_payload=src_payload, src_eff=src_eff,
src_ldts=src_ldts, src_source=src_source,
tgt_pk=tgt_pk,
tgt_hashdiff=tgt_hashdiff, tgt_payload=tgt_payload, tgt_eff=tgt_eff,
tgt_ldts=tgt_ldts, tgt_source=tgt_source,
source=source) -%}
{%- set tgt_pk = tgt_cols['tgt_pk'] -%}
{%- set tgt_hashdiff = tgt_cols['tgt_hashdiff'] -%}
{%- set tgt_payload = tgt_cols['tgt_payload'] -%}
{%- set tgt_eff = tgt_cols['tgt_eff'] -%}
{%- set tgt_ldts = tgt_cols['tgt_ldts'] -%}
{%- set tgt_source = tgt_cols['tgt_source'] -%}
{%- set tgt_cols_list = dbtvault.get_col_list([tgt_pk, tgt_hashdiff, tgt_payload, tgt_eff, tgt_ldts, tgt_source]) -%}
-- Generated by dbtvault.
SELECT DISTINCT {{ dbtvault.cast([tgt_pk, tgt_hashdiff, tgt_payload, tgt_ldts, tgt_eff, tgt_source], 'e') }}
FROM {{ source[0] }} AS e
{% if is_incremental() -%}
LEFT JOIN (
SELECT {{ dbtvault.prefix(tgt_cols_list, 'd') }}
FROM (
SELECT {{ dbtvault.prefix(tgt_cols_list, 'c') }},
CASE WHEN RANK()
OVER (PARTITION BY {{ dbtvault.prefix([tgt_pk|last], 'c') }}
ORDER BY {{ dbtvault.prefix([tgt_ldts|last], 'c') }} DESC) = 1
THEN 'Y' ELSE 'N' END CURR_FLG
FROM (
SELECT {{ dbtvault.prefix(tgt_cols_list, 'a') }}
FROM {{ this }} as a
JOIN {{ source[0] }} as b
ON {{ dbtvault.prefix([tgt_pk|last], 'a') }} = {{ dbtvault.prefix([src_pk], 'b') }}
) as c
) AS d
WHERE d.CURR_FLG = 'Y') AS src
ON {{ dbtvault.prefix([tgt_hashdiff|last], 'src') }} = {{ dbtvault.prefix([src_hashdiff], 'e') }}
WHERE {{ dbtvault.prefix([tgt_hashdiff|last], 'src') }} IS NULL
{%- endif -%}
{% endmacro %}
|
INSERT INTO olisuite.s_patch_history(component, release_number, service_pack_number, component_typ)
VALUES('MARCCAT DB', 1, 5, 12);
|
create table customers (
ID integer primary key asc,
name text not null,
surname text not null,
address text not null,
country text not null,
phone text not null
);
create table products (
ID integer primary key asc,
name text not null,
description text not null,
price number(6, 2) not null
);
create table orders (
ID integer primary key asc,
customer_id integer not null,
sold datetime not null,
total number(6, 2) not null,
foreign key(customer_id) references customers(ID)
);
create table order_item (
ID integer primary key asc,
order_id integer not null,
product_id integer not null,
quantity integer not null,
price number(6,2) not null,
foreign key(order_id) references orders(ID),
foreign key(product_id) references products(ID)
);
|
<reponame>stroonsN/livehelperchat
ALTER TABLE `lh_webhook` ADD `bot_id_alt` int(11) NOT NULL DEFAULT '0', COMMENT='';
ALTER TABLE `lh_webhook` ADD `trigger_id_alt` int(11) NOT NULL DEFAULT '0', COMMENT=''; |
-- MySQL dump 10.13 Distrib 5.5.38, for osx10.6 (i386)
--
-- Host: localhost Database: snapshot
-- ------------------------------------------------------
-- Server version 5.5.38
SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE IF NOT EXISTS `snapshot` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`modified` datetime NOT NULL,
`description` longtext,
`end_date` datetime DEFAULT NULL,
`name` longtext NOT NULL,
`snapshot_date` datetime NOT NULL,
`host` varchar(255) NOT NULL,
`port` int(11) NOT NULL,
`space_id` varchar(255) NOT NULL,
`store_id` varchar(255) NOT NULL,
`start_date` datetime DEFAULT NULL,
`status` varchar(255) NOT NULL,
`status_text` longtext,
`user_email` varchar(255) NOT NULL,
`member_id` varchar(128) DEFAULT NULL,
`total_size_in_bytes` bigint(20) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Table structure for table `restoration`
--
CREATE TABLE IF NOT EXISTS `restoration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`modified` datetime NOT NULL,
`host` varchar(255) NOT NULL,
`port` int(11) NOT NULL,
`space_id` varchar(255) NOT NULL,
`store_id` varchar(255) NOT NULL,
`end_date` datetime DEFAULT NULL,
`start_date` datetime DEFAULT NULL,
`expiration_date` datetime DEFAULT NULL,
`status` varchar(255) NOT NULL,
`status_text` longtext,
`user_email` varchar(255) NOT NULL,
`snapshot_id` bigint(20) NOT NULL,
`restoration_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_RESTORATION_ID` (`restoration_id`),
KEY `FK_ejb7a5btov5hyhb0pyvo3yeb7` (`snapshot_id`),
CONSTRAINT `FK_ejb7a5btov5hyhb0pyvo3yeb7` FOREIGN KEY (`snapshot_id`) REFERENCES `snapshot` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET FOREIGN_KEY_CHECKS=1;
|
<filename>openGaussBase/testcase/SQL/DDL/analyze_table/Opengauss_Function_DDL_Analyze_Case0017.sql
-- @testpoint: 每组多列统计信息最多支持32列
drop table if exists t1;
create table t1(id1 int,id2 int,id3 int,id4 int,id5 int,id6 int,id7 int,id8 int,id9 int,id10 int,id11 int,id12 int,id13 int,id14 int,id15 int,id16 int,id17 int,id18 int,id19 int,id20 int,id21 int,id22 int,id23 int,id24 int,id25 int,id26 int,id27 int,id28 int,id29 int,id30 int,id31 int,id32 int);
insert into t1 values(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32);
analyze t1((id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,id12,id13,id14,id15,id16,id17,id18,id19,id20,id21,id22,id23,id24,id25,id26,id27,id28,id29,id30,id31,id32));
analyze t1;
drop table if exists t1; |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 28, 2017 at 06:06 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
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: `darji_samaj`
--
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
CREATE TABLE `admins` (
`id_admin` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password_text` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `car_models`
--
CREATE TABLE `car_models` (
`id_car_model` int(10) UNSIGNED NOT NULL,
`fk_id_manufacturer` int(11) NOT NULL,
`model_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `car_models`
--
INSERT INTO `car_models` (`id_car_model`, `fk_id_manufacturer`, `model_name`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(3, 5, 'i-10', 'i-10', 'ACTIVE', '2017-09-22 02:16:05', '2017-09-22 02:16:05'),
(4, 5, 'Honda City', 'Honda-City', 'ACTIVE', '2017-09-22 02:16:14', '2017-09-22 02:16:14'),
(5, 3, 'i-20', 'i-20', 'ACTIVE', '2017-09-22 02:16:27', '2017-09-22 02:16:27');
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`id_customer` int(10) UNSIGNED NOT NULL,
`customer_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`customer_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone_no` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mobile_no` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`area` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`p_code` 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 `customers`
--
INSERT INTO `customers` (`id_customer`, `customer_name`, `customer_email`, `phone_no`, `mobile_no`, `city`, `area`, `p_code`, `created_at`, `updated_at`) VALUES
(2, '<NAME>', '<EMAIL>', '1231231233', '9966332255', 'Vadodara', 'Tarsali', 390009, '2017-09-28 01:18:08', '2017-09-28 01:34:36');
-- --------------------------------------------------------
--
-- Table structure for table `job_cards`
--
CREATE TABLE `job_cards` (
`id_job_card` int(10) UNSIGNED NOT NULL,
`fk_id_customer` int(11) NOT NULL,
`fk_id_car` int(11) NOT NULL,
`total_services_price` int(11) NOT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'New',
`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 `job_cards`
--
INSERT INTO `job_cards` (`id_job_card`, `fk_id_customer`, `fk_id_car`, `total_services_price`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 4, 0, 'New', '2017-09-28 00:15:07', '2017-09-28 00:15:07'),
(2, 2, 5, 0, 'New', '2017-09-28 00:17:48', '2017-09-28 00:19:04'),
(3, 1, 3, 150, 'New', '2017-09-28 03:06:02', '2017-09-28 03:06:02'),
(4, 2, 5, 150, 'New', '2017-09-28 10:23:52', '2017-09-28 10:23:52');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`login_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`user_type` enum('admin','team_member') NOT NULL DEFAULT 'admin'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`login_id`, `name`, `email`, `password`, `user_type`) VALUES
(1, 'Sales India', '<EMAIL>', '<PASSWORD>', '<PASSWORD>'),
(3, 'BlueStar', '<EMAIL>', 'admin', 'admin');
-- --------------------------------------------------------
--
-- Table structure for table `manufacturers`
--
CREATE TABLE `manufacturers` (
`id_manufacturer` int(10) UNSIGNED NOT NULL,
`manufacturer_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `manufacturers`
--
INSERT INTO `manufacturers` (`id_manufacturer`, `manufacturer_by`, `img`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(3, 'OD', 'yBleOslX_1506002865.jpg', 'OD', 'ACTIVE', '2017-09-21 08:37:21', '2017-09-21 08:42:21'),
(4, 'BMW', 'KldWdube_1506006413.jpg', 'BMW', 'ACTIVE', '2017-09-21 09:36:53', '2017-09-21 09:37:12'),
(5, 'Honda', 'DyAcN8oY_1506066338.JPG', 'Honda', 'ACTIVE', '2017-09-22 02:15:38', '2017-09-22 02:15:38');
-- --------------------------------------------------------
--
-- Table structure for table `master_cities`
--
CREATE TABLE `master_cities` (
`id_master_city` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` text COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `master_cities`
--
INSERT INTO `master_cities` (`id_master_city`, `name`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(3, 'Rajpipla', 'Rajpipla', 'INACTIVE', '2017-03-22 21:43:39', '2017-09-19 11:19:25'),
(4, 'Bharuch', 'Bharuch', 'ACTIVE', '2017-03-22 21:43:54', '2017-03-22 21:43:54'),
(5, 'aa', 'aa', 'ACTIVE', '2017-09-19 20:49:46', '2017-09-19 20:49:46');
-- --------------------------------------------------------
--
-- Table structure for table `member_roles`
--
CREATE TABLE `member_roles` (
`id_member_roles` int(10) UNSIGNED NOT NULL,
`member_role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` text COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `member_roles`
--
INSERT INTO `member_roles` (`id_member_roles`, `member_role`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(1, 'aa qqa aa', 'aa-qqa-aa', 'ACTIVE', '2017-03-22 12:04:07', '2017-03-22 21:28:45');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 2),
(3, '2017_03_21_151114_create_master_cities_table', 2),
(4, '2017_03_22_032054_create_member_roles_table', 2),
(5, '2017_09_20_014804_create_product_categories_table', 2),
(6, '2017_09_20_073301_create_products_table', 3),
(7, '2017_09_20_180104_create_services_categories_table', 4),
(8, '2017_09_20_184557_create_services_table', 5),
(9, '2017_09_21_110734_create_manufacturers_table', 6),
(10, '2017_09_21_151610_create_car_models_table', 7),
(11, '2017_09_23_064217_create_job_cards_table', 8),
(12, '2017_09_24_130710_create_admins_table', 9),
(13, '2017_09_26_041954_create_selected_job_card_services_lists_table', 10),
(14, '2017_09_28_063120_create_customers_table', 11);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id_product` int(10) UNSIGNED NOT NULL,
`fk_id_product_category` int(11) NOT NULL,
`pro_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_cat_desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pro_price` int(11) DEFAULT NULL,
`pro_qty` int(11) DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `products`
--
INSERT INTO `products` (`id_product`, `fk_id_product_category`, `pro_title`, `pro_cat_desc`, `pro_price`, `pro_qty`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(1, 2, 'New Product Update', 'Desciption About Update', 20, 10, 'New-Product-Update', 'ACTIVE', '2017-09-20 02:13:10', '2017-09-28 02:05:07'),
(2, 3, 'Product', 'Description about Cate', 20, 50, 'Product', 'ACTIVE', '2017-09-20 09:45:35', '2017-09-20 09:45:35');
-- --------------------------------------------------------
--
-- Table structure for table `product_categories`
--
CREATE TABLE `product_categories` (
`id_product_category` int(10) UNSIGNED NOT NULL,
`pro_cat_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pro_cat_desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`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 `product_categories`
--
INSERT INTO `product_categories` (`id_product_category`, `pro_cat_title`, `pro_cat_desc`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(2, 'ProNew Cate', 'DescPro Desc', 'ProNew-Cate', 'ACTIVE', '2017-09-19 20:58:50', '2017-09-24 09:26:51'),
(3, 'Car i20', 'This car is var nice', 'Car-i20', 'ACTIVE', '2017-09-19 21:33:04', '2017-09-19 21:33:04');
-- --------------------------------------------------------
--
-- Table structure for table `selected_job_card_services_lists`
--
CREATE TABLE `selected_job_card_services_lists` (
`id_selected_job_card` int(10) UNSIGNED NOT NULL,
`fk_id_job_card` int(11) NOT NULL,
`fk_id_job_card_services` int(11) NOT NULL,
`services_price` int(11) DEFAULT NULL,
`services_name` text COLLATE utf8mb4_unicode_ci,
`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 `selected_job_card_services_lists`
--
INSERT INTO `selected_job_card_services_lists` (`id_selected_job_card`, `fk_id_job_card`, `fk_id_job_card_services`, `services_price`, `services_name`, `created_at`, `updated_at`) VALUES
(9, 1, 6, NULL, NULL, '2017-09-28 00:15:46', '2017-09-28 00:15:46'),
(10, 1, 7, NULL, NULL, '2017-09-28 00:15:46', '2017-09-28 00:15:46'),
(15, 2, 6, NULL, NULL, '2017-09-28 00:19:04', '2017-09-28 00:19:04'),
(16, 2, 7, NULL, NULL, '2017-09-28 00:19:04', '2017-09-28 00:19:04'),
(17, 2, 8, NULL, NULL, '2017-09-28 00:19:04', '2017-09-28 00:19:04'),
(18, 2, 9, NULL, NULL, '2017-09-28 00:19:04', '2017-09-28 00:19:04'),
(19, 3, 1, NULL, NULL, '2017-09-28 03:06:02', '2017-09-28 03:06:02'),
(20, 3, 4, NULL, NULL, '2017-09-28 03:06:02', '2017-09-28 03:06:02'),
(21, 4, 1, NULL, NULL, '2017-09-28 10:23:52', '2017-09-28 10:23:52'),
(22, 4, 4, NULL, NULL, '2017-09-28 10:23:52', '2017-09-28 10:23:52');
-- --------------------------------------------------------
--
-- Table structure for table `seo_admin_login`
--
CREATE TABLE `seo_admin_login` (
`id` int(11) NOT NULL,
`u_name` varchar(50) NOT NULL,
`pass` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `seo_admin_login`
--
INSERT INTO `seo_admin_login` (`id`, `u_name`, `pass`) VALUES
(1, 'admin', '<PASSWORD>');
-- --------------------------------------------------------
--
-- Table structure for table `seo_table`
--
CREATE TABLE `seo_table` (
`id` int(10) NOT NULL,
`p_name` varchar(255) NOT NULL,
`p_title` varchar(255) NOT NULL,
`keyword` varchar(255) NOT NULL,
`seo_desc` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `services`
--
CREATE TABLE `services` (
`id_services` int(10) UNSIGNED NOT NULL,
`fk_id_services_category` int(11) NOT NULL,
`ser_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`ser_cat_desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ser_price` int(11) DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `services`
--
INSERT INTO `services` (`id_services`, `fk_id_services_category`, `ser_title`, `ser_cat_desc`, `ser_price`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'FUEL CAPS', 'Description', 100, 'FUEL-CAPS', 'ACTIVE', '2017-09-27 13:47:29', '2017-09-27 13:47:59'),
(2, 1, 'CHECK CRACK LIGHTS', 'Description', 100, 'CHECK-CRACK-LIGHTS', 'ACTIVE', '2017-09-27 13:49:08', '2017-09-27 13:49:08'),
(3, 1, 'SPARE WHEELS', 'Decription', 120, 'SPARE-WHEELS', 'ACTIVE', '2017-09-27 13:49:46', '2017-09-27 13:49:46'),
(4, 1, '<NAME>', 'Description', 50, 'WHEELS-NUTS', 'ACTIVE', '2017-09-27 13:50:27', '2017-09-27 13:50:27'),
(5, 1, 'TYRE CONDITION', 'Decrip', 50, 'TYRE-CONDITION', 'ACTIVE', '2017-09-27 13:51:07', '2017-09-27 13:51:07'),
(6, 2, 'SEAT BELTS', 'Desciption', 100, 'SEAT-BELTS', 'ACTIVE', '2017-09-27 13:51:44', '2017-09-27 13:51:44'),
(7, 2, 'BUCKLES', 'Description', 80, 'BUCKLES', 'ACTIVE', '2017-09-27 13:52:31', '2017-09-27 13:52:31'),
(8, 2, 'ENGINE MOUNTS', 'Description', 150, 'ENGINE-MOUNTS', 'ACTIVE', '2017-09-27 13:53:04', '2017-09-27 13:53:04'),
(9, 2, 'HORN', 'Description', 50, 'HORN', 'ACTIVE', '2017-09-27 13:53:42', '2017-09-27 13:53:42'),
(10, 3, 'BREAK FUEL', NULL, 450, 'BREAK-FUEL', 'ACTIVE', '2017-09-27 14:09:28', '2017-09-27 14:09:28'),
(11, 3, 'DRIVE BELTS', NULL, 150, 'DRIVE-BELTS', 'ACTIVE', '2017-09-27 14:09:54', '2017-09-27 14:09:54'),
(12, 1, 'ENGINE FLUID', NULL, 250, 'ENGINE-FLUID', 'ACTIVE', '2017-09-27 14:10:31', '2017-09-28 02:07:44');
-- --------------------------------------------------------
--
-- Table structure for table `services_categories`
--
CREATE TABLE `services_categories` (
`id_services_category` int(10) UNSIGNED NOT NULL,
`ser_cat_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ser_cat_desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` text COLLATE utf8mb4_unicode_ci,
`status` enum('ACTIVE','INACTIVE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `services_categories`
--
INSERT INTO `services_categories` (`id_services_category`, `ser_cat_title`, `ser_cat_desc`, `slug`, `status`, `created_at`, `updated_at`) VALUES
(1, 'OUTSIDE CHECK', 'Any Desc', 'OUTSIDE-CHECK', 'ACTIVE', '2017-09-27 13:43:13', '2017-09-27 13:43:13'),
(2, 'FROM INSIDE CHECK', 'Description', 'FROM-INSIDE-CHECK', 'ACTIVE', '2017-09-27 13:43:52', '2017-09-27 13:43:52'),
(3, 'UNDER BONNET CHECK', 'description', 'UNDER-BONNET-CHECK', 'ACTIVE', '2017-09-27 13:44:23', '2017-09-27 13:44:23'),
(4, 'UNDER BODY CHECK', 'description', 'UNDER-BODY-CHECK', 'ACTIVE', '2017-09-27 13:44:52', '2017-09-27 13:44:52'),
(5, 'ROAD TEST', 'Description', 'ROAD-TEST', 'ACTIVE', '2017-09-27 13:45:24', '2017-09-27 13:45:24');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mobile_no` int(11) DEFAULT NULL,
`user_type` enum('ADMIN','INPECTER') 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 `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `mobile_no`, `user_type`, `created_at`, `updated_at`) VALUES
(3, 'Nirav', '<EMAIL>', <PASSWORD>$ir<PASSWORD>', NULL, 1234567891, 'ADMIN', '2017-09-28 01:49:58', '2017-09-28 01:52:41');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id_admin`);
--
-- Indexes for table `car_models`
--
ALTER TABLE `car_models`
ADD PRIMARY KEY (`id_car_model`);
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`id_customer`);
--
-- Indexes for table `job_cards`
--
ALTER TABLE `job_cards`
ADD PRIMARY KEY (`id_job_card`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`login_id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `email_2` (`email`);
--
-- Indexes for table `manufacturers`
--
ALTER TABLE `manufacturers`
ADD PRIMARY KEY (`id_manufacturer`);
--
-- Indexes for table `master_cities`
--
ALTER TABLE `master_cities`
ADD PRIMARY KEY (`id_master_city`);
--
-- Indexes for table `member_roles`
--
ALTER TABLE `member_roles`
ADD PRIMARY KEY (`id_member_roles`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id_product`);
--
-- Indexes for table `product_categories`
--
ALTER TABLE `product_categories`
ADD PRIMARY KEY (`id_product_category`);
--
-- Indexes for table `selected_job_card_services_lists`
--
ALTER TABLE `selected_job_card_services_lists`
ADD PRIMARY KEY (`id_selected_job_card`);
--
-- Indexes for table `seo_admin_login`
--
ALTER TABLE `seo_admin_login`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `seo_table`
--
ALTER TABLE `seo_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `services`
--
ALTER TABLE `services`
ADD PRIMARY KEY (`id_services`);
--
-- Indexes for table `services_categories`
--
ALTER TABLE `services_categories`
ADD PRIMARY KEY (`id_services_category`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
MODIFY `id_admin` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `car_models`
--
ALTER TABLE `car_models`
MODIFY `id_car_model` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
MODIFY `id_customer` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `job_cards`
--
ALTER TABLE `job_cards`
MODIFY `id_job_card` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `login`
--
ALTER TABLE `login`
MODIFY `login_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `manufacturers`
--
ALTER TABLE `manufacturers`
MODIFY `id_manufacturer` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `master_cities`
--
ALTER TABLE `master_cities`
MODIFY `id_master_city` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `member_roles`
--
ALTER TABLE `member_roles`
MODIFY `id_member_roles` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id_product` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `product_categories`
--
ALTER TABLE `product_categories`
MODIFY `id_product_category` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `selected_job_card_services_lists`
--
ALTER TABLE `selected_job_card_services_lists`
MODIFY `id_selected_job_card` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `seo_admin_login`
--
ALTER TABLE `seo_admin_login`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `seo_table`
--
ALTER TABLE `seo_table`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
MODIFY `id_services` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `services_categories`
--
ALTER TABLE `services_categories`
MODIFY `id_services_category` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
/*!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>desinole/UpdateConf2020
Update Customer
Set HomePhone = c.Phone, CellPhone = C.Phone
from Customer C
where Id = C.Id |
<gh_stars>0
SELECT name
FROM employee
WHERE months < 10
AND salary > 2000 |
<gh_stars>0
# Dump of table settings
# ------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `?` (
`key` varchar(50) NOT NULL DEFAULT '',
`value` varchar(200) DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
CREATE PROCEDURE procfwk.GetPipelinesInStage
(
@StageId INT
)
AS
BEGIN
SET NOCOUNT ON;
SELECT
[PipelineId],
[PipelineName],
[DataFactoryName],
[ResourceGroupName]
FROM
[procfwk].[CurrentExecution]
WHERE
[StageId] = @StageId
AND ISNULL([PipelineStatus],'') <> 'Success'
AND [IsBlocked] <> 1
ORDER BY
[PipelineId] ASC;
END; |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 04, 2017 at 02:13
-- Server version: 10.1.19-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: `db_rental_mobil`
--
DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `inBooking` (IN `x` VARCHAR(5), IN `y` CHAR(20), IN `z` CHAR(20), IN `i` DATE, IN `a` DATE, IN `b` DATE, IN `c` TIME, IN `d` CHAR(20), IN `e` VARCHAR(5)) BEGIN
INSERT INTO transaksisewa(notransaksi,nik,noktp,tglpesan,TglPinjamRencana,tglkembalirencana,JamKembaliRencana,NoPlat,IDSopir) VALUES(x,y,z,i,a,b,c,d,e);
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertPlgn` (IN `NoKTP` VARCHAR(20), IN `NamaPel` VARCHAR(50), IN `AlamatPel` VARCHAR(50), IN `TelpPel` VARCHAR(20)) BEGIN
INSERT INTO pelanggan VALUES(NoKTP,NamaPel,AlamatPel,TelpPel);
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertSop` (`x` VARCHAR(5), `y` VARCHAR(20), `z` VARCHAR(50), `a` VARCHAR(20), `b` VARCHAR(30), `c` INT) BEGIN
INSERT INTO sopir VALUES(x,y,z,a,b,c);
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `tranServices` (IN `x` VARCHAR(5), IN `y` DATE, IN `z` DOUBLE, IN `a` CHAR(20), IN `b` VARCHAR(5)) BEGIN
INSERT INTO service VALUES(x,y,z,a,b);
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `uTranSewa` (IN `c` DATE, IN `d` TIME, IN `f` INT, IN `g` INT, IN `h` VARCHAR(50), IN `k` VARCHAR(5)) BEGIN
UPDATE transaksisewa SET tglpinjam = c ,jampinjam = d ,
kilometerpinjam = f ,bbmpinjam = g ,kondisimobilpinjam = h WHERE notransaksi = k;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Stand-in structure for view `booData`
--
CREATE TABLE `booData` (
`NoTransaksi` varchar(5)
,`NIK` char(20)
,`NoKTP` varchar(20)
,`TglPesan` date
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `bookingData`
--
CREATE TABLE `bookingData` (
`NoTransaksi` varchar(5)
,`TglPesan` date
,`TglPinjam` date
,`JamPinjam` time
,`tglkembalirencana` date
,`TglPinjamRencana` date
,`JamKembaliRencana` time
,`TglKembaliRealisasi` date
,`JamKembaliReal` time
,`Denda` double
,`KiloMeterPinjam` int(11)
,`KiloMeterKembali` int(11)
,`BBMPinjam` int(11)
,`BBMKembali` int(11)
,`KondisiMobilPinjam` varchar(50)
,`KondisiMobilKembali` varchar(50)
,`Kerusakan` varchar(255)
,`BiayaKerusakan` double
,`BiayaBBM` double
,`NIK` char(20)
,`NoPlat` char(20)
,`IDSopir` varchar(5)
,`NoKTP` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `daKendaraan`
--
CREATE TABLE `daKendaraan` (
`NoPlat` char(20)
,`IDType` varchar(5)
,`Tahun` varchar(4)
,`TarifPerJam` int(11)
,`StatusRental` char(1)
,`KodeMerk` varchar(5)
,`NmMerk` varchar(20)
,`NmType` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `datKendaraan`
--
CREATE TABLE `datKendaraan` (
`NoPlat` char(20)
,`IDType` varchar(5)
,`Tahun` varchar(4)
,`TarifPerJam` int(11)
,`StatusRental` char(1)
,`KodeMerk` varchar(5)
,`NmMerk` varchar(20)
,`NmType` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dk`
--
CREATE TABLE `dk` (
`NIK` char(20)
,`NmKaryawan` varchar(50)
,`AlmtKaryawan` varchar(50)
,`TelpKaryawan` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dkarJoin`
--
CREATE TABLE `dkarJoin` (
`nik` char(20)
,`NmKaryawan` varchar(50)
,`AlmtKaryawan` varchar(50)
,`TelpKaryawan` varchar(20)
,`username` char(10)
,`typeuser` varchar(10)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dkc`
--
CREATE TABLE `dkc` (
`COUNT(*)` bigint(21)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dKembali`
--
CREATE TABLE `dKembali` (
`NoTransaksi` varchar(5)
,`NIK` char(20)
,`NoPlat` char(20)
,`IDSopir` varchar(5)
,`NoKTP` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dKendaraan`
--
CREATE TABLE `dKendaraan` (
`NoPlat` char(20)
,`IDType` varchar(5)
,`Tahun` varchar(4)
,`TarifPerJam` int(11)
,`StatusRental` char(1)
,`KodeMerk` varchar(5)
,`NmMerk` varchar(20)
,`NmType` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dKJoin`
--
CREATE TABLE `dKJoin` (
`NIK` char(20)
,`NmKaryawan` varchar(50)
,`AlmtKaryawan` varchar(50)
,`TelpKaryawan` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dmbl`
--
CREATE TABLE `dmbl` (
`NoPlat` char(20)
,`IDType` varchar(5)
,`Tahun` varchar(4)
,`TarifPerJam` int(11)
,`StatusRental` char(1)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dplgn`
--
CREATE TABLE `dplgn` (
`NoKTP` varchar(20)
,`NamaPel` varchar(50)
,`AlamatPel` varchar(50)
,`TelpPel` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `ds`
--
CREATE TABLE `ds` (
`IDSopir` varchar(5)
,`NmSopir` varchar(20)
,`AlmSopir` varchar(50)
,`TelpSopir` varchar(20)
,`NoSIM` varchar(30)
,`TarifPerJam` int(11)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dServices`
--
CREATE TABLE `dServices` (
`KodeService` varchar(5)
,`TglService` date
,`BiayaService` double
,`NoPlat` char(20)
,`IDJenisService` varchar(5)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `dSop`
--
CREATE TABLE `dSop` (
`IDSopir` varchar(5)
,`NmSopir` varchar(20)
,`AlmSopir` varchar(50)
,`TelpSopir` varchar(20)
,`NoSIM` varchar(30)
,`TarifPerJam` int(11)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `getIdSop`
--
CREATE TABLE `getIdSop` (
`IDSopir` varchar(5)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `getNKTP`
--
CREATE TABLE `getNKTP` (
`noktp` varchar(20)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `getPlMob`
--
CREATE TABLE `getPlMob` (
`NoPlat` char(20)
);
-- --------------------------------------------------------
--
-- Table structure for table `jenisservice`
--
CREATE TABLE `jenisservice` (
`IDJenisService` varchar(5) NOT NULL,
`NmJenisService` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `jenisservice`
--
INSERT INTO `jenisservice` (`IDJenisService`, `NmJenisService`) VALUES
('123', '<NAME>'),
('55555', 'Karbulator');
-- --------------------------------------------------------
--
-- Stand-in structure for view `jServices`
--
CREATE TABLE `jServices` (
`IDJenisService` varchar(5)
,`NmJenisService` varchar(50)
);
-- --------------------------------------------------------
--
-- Table structure for table `karyawan`
--
CREATE TABLE `karyawan` (
`NIK` char(20) NOT NULL,
`NmKaryawan` varchar(50) NOT NULL,
`AlmtKaryawan` varchar(50) NOT NULL,
`TelpKaryawan` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `karyawan`
--
INSERT INTO `karyawan` (`NIK`, `NmKaryawan`, `AlmtKaryawan`, `TelpKaryawan`) VALUES
('1234', 'idneh', 'maleber', '089182918'),
('13131311311', '<NAME>', 'Jl.Kh Saleh Kp.Pandan Jaya RT 01/RW 06', '081563283453');
-- --------------------------------------------------------
--
-- Table structure for table `kendaraan`
--
CREATE TABLE `kendaraan` (
`NoPlat` char(20) NOT NULL,
`IDType` varchar(5) NOT NULL,
`Tahun` varchar(4) NOT NULL,
`TarifPerJam` int(11) NOT NULL,
`StatusRental` char(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kendaraan`
--
INSERT INTO `kendaraan` (`NoPlat`, `IDType`, `Tahun`, `TarifPerJam`, `StatusRental`) VALUES
('F1010ZQ', '12345', '2009', 10000, '1'),
('FA182D', '1234', '2009', 1000, '0');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`NIK` char(20) NOT NULL,
`UserName` char(10) NOT NULL,
`password` varchar(10) NOT NULL,
`TypeUser` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`NIK`, `UserName`, `password`, `TypeUser`) VALUES
('1234', '<PASSWORD>', '<PASSWORD>', 'admin'),
('13131311311', '<PASSWORD>', 'gagay12345', 'User');
-- --------------------------------------------------------
--
-- Table structure for table `merk`
--
CREATE TABLE `merk` (
`KodeMerk` varchar(5) NOT NULL,
`NmMerk` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `merk`
--
INSERT INTO `merk` (`KodeMerk`, `NmMerk`) VALUES
('1', 'TOYOTA');
-- --------------------------------------------------------
--
-- Table structure for table `pelanggan`
--
CREATE TABLE `pelanggan` (
`NoKTP` varchar(20) NOT NULL,
`NamaPel` varchar(50) NOT NULL,
`AlamatPel` varchar(50) NOT NULL,
`TelpPel` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pelanggan`
--
INSERT INTO `pelanggan` (`NoKTP`, `NamaPel`, `AlamatPel`, `TelpPel`) VALUES
('1234', 'Garsa', 'x', '23532'),
('1234242', '<NAME>', 'JL.<NAME>', '081563283453'),
('1235', 'Garsa', 'x', '23533'),
('12353225325', '<NAME>', 'JL.<NAME>ani No.56', '085616189212'),
('1236', 'Garsa', 'x', '23534'),
('1237', 'Garsa', 'x', '23535'),
('1238', 'Garsa', 'x', '23536'),
('1239', 'Garsa', 'x', '23537'),
('1240', 'Garsa', 'x', '23538'),
('1241', 'Garsa', 'x', '23539'),
('1242', 'Garsa', 'x', '23540'),
('1243', 'Garsa', 'x', '23541'),
('15315', '152235', '2352', '532532525223'),
('2232352', '5325323', '532532532', '523253253'),
('235232', '523', '523532', '22353253253');
-- --------------------------------------------------------
--
-- Table structure for table `pemilik`
--
CREATE TABLE `pemilik` (
`KodePemilik` varchar(5) NOT NULL,
`NoPlat` char(20) NOT NULL,
`NmPemilik` varchar(20) NOT NULL,
`AlmPemilik` varchar(50) NOT NULL,
`TelpPemilik` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Stand-in structure for view `pinjamData`
--
CREATE TABLE `pinjamData` (
`NoTransaksi` varchar(5)
,`TglPesan` date
,`TglPinjam` date
,`JamPinjam` time
,`tglkembalirencana` date
,`TglPinjamRencana` date
,`JamKembaliRencana` time
,`TglKembaliRealisasi` date
,`JamKembaliReal` time
,`Denda` double
,`KiloMeterPinjam` int(11)
,`KiloMeterKembali` int(11)
,`BBMPinjam` int(11)
,`BBMKembali` int(11)
,`KondisiMobilPinjam` varchar(50)
,`KondisiMobilKembali` varchar(50)
,`Kerusakan` varchar(255)
,`BiayaKerusakan` double
,`BiayaBBM` double
,`NIK` char(20)
,`NoPlat` char(20)
,`IDSopir` varchar(5)
,`NoKTP` varchar(20)
);
-- --------------------------------------------------------
--
-- Table structure for table `service`
--
CREATE TABLE `service` (
`KodeService` varchar(5) NOT NULL,
`TglService` date DEFAULT NULL,
`BiayaService` double DEFAULT NULL,
`NoPlat` char(20) NOT NULL,
`IDJenisService` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `service`
--
INSERT INTO `service` (`KodeService`, `TglService`, `BiayaService`, `NoPlat`, `IDJenisService`) VALUES
('12345', '2017-02-03', 100000, 'F1010ZQ', '123'),
('2727', '2017-02-04', 1000000, 'F1010ZQ', '55555');
-- --------------------------------------------------------
--
-- Table structure for table `setoran`
--
CREATE TABLE `setoran` (
`NoSetoran` varchar(5) NOT NULL,
`TglSetoran` date NOT NULL,
`Jumlah` double NOT NULL,
`KodePemilik` varchar(5) NOT NULL,
`NIK` char(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sopir`
--
CREATE TABLE `sopir` (
`IDSopir` varchar(5) NOT NULL,
`NmSopir` varchar(20) NOT NULL,
`AlmSopir` varchar(50) NOT NULL,
`TelpSopir` varchar(20) NOT NULL,
`NoSIM` varchar(30) NOT NULL,
`TarifPerJam` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `sopir`
--
INSERT INTO `sopir` (`IDSopir`, `NmSopir`, `AlmSopir`, `TelpSopir`, `NoSIM`, `TarifPerJam`) VALUES
('1', 'Ujang', 'JL.Ahmad Yani', '0823521234', '1748374857', 100000);
-- --------------------------------------------------------
--
-- Table structure for table `transaksisewa`
--
CREATE TABLE `transaksisewa` (
`NoTransaksi` varchar(5) NOT NULL,
`TglPesan` date NOT NULL,
`TglPinjam` date NOT NULL,
`JamPinjam` time NOT NULL,
`tglkembalirencana` date NOT NULL,
`TglPinjamRencana` date NOT NULL,
`JamKembaliRencana` time NOT NULL,
`TglKembaliRealisasi` date NOT NULL,
`JamKembaliReal` time NOT NULL,
`Denda` double NOT NULL,
`KiloMeterPinjam` int(11) NOT NULL,
`KiloMeterKembali` int(11) NOT NULL,
`BBMPinjam` int(11) NOT NULL,
`BBMKembali` int(11) NOT NULL,
`KondisiMobilPinjam` varchar(50) NOT NULL,
`KondisiMobilKembali` varchar(50) NOT NULL,
`Kerusakan` varchar(255) NOT NULL,
`BiayaKerusakan` double NOT NULL,
`BiayaBBM` double NOT NULL,
`NIK` char(20) NOT NULL,
`NoPlat` char(20) NOT NULL,
`IDSopir` varchar(5) NOT NULL,
`NoKTP` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `transaksisewa`
--
INSERT INTO `transaksisewa` (`NoTransaksi`, `TglPesan`, `TglPinjam`, `JamPinjam`, `tglkembalirencana`, `TglPinjamRencana`, `JamKembaliRencana`, `TglKembaliRealisasi`, `JamKembaliReal`, `Denda`, `KiloMeterPinjam`, `KiloMeterKembali`, `BBMPinjam`, `BBMKembali`, `KondisiMobilPinjam`, `KondisiMobilKembali`, `Kerusakan`, `BiayaKerusakan`, `BiayaBBM`, `NIK`, `NoPlat`, `IDSopir`, `NoKTP`) VALUES
('12345', '2017-02-03', '2017-02-03', '10:54:28', '2017-02-03', '2017-02-03', '00:47:00', '0000-00-00', '00:00:00', 0, 1600, 0, 100, 0, 'Baik - Baik Saja', '', '', 0, 0, '13131311311', 'F1010ZQ', '1', '1234'),
('67878', '2017-02-03', '0000-00-00', '00:00:00', '2017-02-04', '2017-02-04', '11:00:00', '0000-00-00', '00:00:00', 0, 0, 0, 0, 0, '', '', '', 0, 0, '13131311311', 'F1010ZQ', '1', '12353225325');
-- --------------------------------------------------------
--
-- Table structure for table `type`
--
CREATE TABLE `type` (
`IDType` varchar(5) NOT NULL,
`KodeMerk` varchar(5) NOT NULL,
`NmType` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `type`
--
INSERT INTO `type` (`IDType`, `KodeMerk`, `NmType`) VALUES
('12345', '1', 'AVANZA');
-- --------------------------------------------------------
--
-- Structure for view `booData`
--
DROP TABLE IF EXISTS `booData`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `booData` AS select `transaksisewa`.`NoTransaksi` AS `NoTransaksi`,`transaksisewa`.`NIK` AS `NIK`,`transaksisewa`.`NoKTP` AS `NoKTP`,`transaksisewa`.`TglPesan` AS `TglPesan` from `transaksisewa` ;
-- --------------------------------------------------------
--
-- Structure for view `bookingData`
--
DROP TABLE IF EXISTS `bookingData`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `bookingData` AS select `transaksisewa`.`NoTransaksi` AS `NoTransaksi`,`transaksisewa`.`TglPesan` AS `TglPesan`,`transaksisewa`.`TglPinjam` AS `TglPinjam`,`transaksisewa`.`JamPinjam` AS `JamPinjam`,`transaksisewa`.`tglkembalirencana` AS `tglkembalirencana`,`transaksisewa`.`TglPinjamRencana` AS `TglPinjamRencana`,`transaksisewa`.`JamKembaliRencana` AS `JamKembaliRencana`,`transaksisewa`.`TglKembaliRealisasi` AS `TglKembaliRealisasi`,`transaksisewa`.`JamKembaliReal` AS `JamKembaliReal`,`transaksisewa`.`Denda` AS `Denda`,`transaksisewa`.`KiloMeterPinjam` AS `KiloMeterPinjam`,`transaksisewa`.`KiloMeterKembali` AS `KiloMeterKembali`,`transaksisewa`.`BBMPinjam` AS `BBMPinjam`,`transaksisewa`.`BBMKembali` AS `BBMKembali`,`transaksisewa`.`KondisiMobilPinjam` AS `KondisiMobilPinjam`,`transaksisewa`.`KondisiMobilKembali` AS `KondisiMobilKembali`,`transaksisewa`.`Kerusakan` AS `Kerusakan`,`transaksisewa`.`BiayaKerusakan` AS `BiayaKerusakan`,`transaksisewa`.`BiayaBBM` AS `BiayaBBM`,`transaksisewa`.`NIK` AS `NIK`,`transaksisewa`.`NoPlat` AS `NoPlat`,`transaksisewa`.`IDSopir` AS `IDSopir`,`transaksisewa`.`NoKTP` AS `NoKTP` from `transaksisewa` where ((`transaksisewa`.`TglPinjam` = ((0 - 0) - 0)) and (`transaksisewa`.`JamPinjam` = ((0 - 0) - 0))) ;
-- --------------------------------------------------------
--
-- Structure for view `daKendaraan`
--
DROP TABLE IF EXISTS `daKendaraan`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `daKendaraan` AS select `k`.`NoPlat` AS `NoPlat`,`k`.`IDType` AS `IDType`,`k`.`Tahun` AS `Tahun`,`k`.`TarifPerJam` AS `TarifPerJam`,`k`.`StatusRental` AS `StatusRental`,`m`.`KodeMerk` AS `KodeMerk`,`m`.`NmMerk` AS `NmMerk`,`t`.`NmType` AS `NmType` from ((`kendaraan` `k` join `type` `t`) join `merk` `m`) where ((`k`.`IDType` = `t`.`IDType`) and (`t`.`KodeMerk` = `m`.`KodeMerk`) and (`k`.`StatusRental` = 0)) ;
-- --------------------------------------------------------
--
-- Structure for view `datKendaraan`
--
DROP TABLE IF EXISTS `datKendaraan`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `datKendaraan` AS select `k`.`NoPlat` AS `NoPlat`,`k`.`IDType` AS `IDType`,`k`.`Tahun` AS `Tahun`,`k`.`TarifPerJam` AS `TarifPerJam`,`k`.`StatusRental` AS `StatusRental`,`m`.`KodeMerk` AS `KodeMerk`,`m`.`NmMerk` AS `NmMerk`,`t`.`NmType` AS `NmType` from ((`kendaraan` `k` join `type` `t`) join `merk` `m`) where ((`k`.`IDType` = `t`.`IDType`) and (`t`.`KodeMerk` = `m`.`KodeMerk`) and (`k`.`StatusRental` = 0)) ;
-- --------------------------------------------------------
--
-- Structure for view `dk`
--
DROP TABLE IF EXISTS `dk`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dk` AS select `karyawan`.`NIK` AS `NIK`,`karyawan`.`NmKaryawan` AS `NmKaryawan`,`karyawan`.`AlmtKaryawan` AS `AlmtKaryawan`,`karyawan`.`TelpKaryawan` AS `TelpKaryawan` from `karyawan` ;
-- --------------------------------------------------------
--
-- Structure for view `dkarJoin`
--
DROP TABLE IF EXISTS `dkarJoin`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dkarJoin` AS select `k`.`NIK` AS `nik`,`k`.`NmKaryawan` AS `NmKaryawan`,`k`.`AlmtKaryawan` AS `AlmtKaryawan`,`k`.`TelpKaryawan` AS `TelpKaryawan`,`l`.`UserName` AS `username`,`l`.`TypeUser` AS `typeuser` from (`karyawan` `k` join `login` `l` on((`k`.`NIK` = `l`.`NIK`))) ;
-- --------------------------------------------------------
--
-- Structure for view `dkc`
--
DROP TABLE IF EXISTS `dkc`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dkc` AS select count(0) AS `COUNT(*)` from `karyawan` ;
-- --------------------------------------------------------
--
-- Structure for view `dKembali`
--
DROP TABLE IF EXISTS `dKembali`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dKembali` AS select `transaksisewa`.`NoTransaksi` AS `NoTransaksi`,`transaksisewa`.`NIK` AS `NIK`,`transaksisewa`.`NoPlat` AS `NoPlat`,`transaksisewa`.`IDSopir` AS `IDSopir`,`transaksisewa`.`NoKTP` AS `NoKTP` from `transaksisewa` ;
-- --------------------------------------------------------
--
-- Structure for view `dKendaraan`
--
DROP TABLE IF EXISTS `dKendaraan`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dKendaraan` AS select `k`.`NoPlat` AS `NoPlat`,`k`.`IDType` AS `IDType`,`k`.`Tahun` AS `Tahun`,`k`.`TarifPerJam` AS `TarifPerJam`,`k`.`StatusRental` AS `StatusRental`,`m`.`KodeMerk` AS `KodeMerk`,`m`.`NmMerk` AS `NmMerk`,`t`.`NmType` AS `NmType` from ((`kendaraan` `k` join `type` `t`) join `merk` `m`) where ((`k`.`IDType` = `t`.`IDType`) and (`t`.`KodeMerk` = `m`.`KodeMerk`)) ;
-- --------------------------------------------------------
--
-- Structure for view `dKJoin`
--
DROP TABLE IF EXISTS `dKJoin`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dKJoin` AS select `karyawan`.`NIK` AS `NIK`,`karyawan`.`NmKaryawan` AS `NmKaryawan`,`karyawan`.`AlmtKaryawan` AS `AlmtKaryawan`,`karyawan`.`TelpKaryawan` AS `TelpKaryawan` from `karyawan` ;
-- --------------------------------------------------------
--
-- Structure for view `dmbl`
--
DROP TABLE IF EXISTS `dmbl`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dmbl` AS select `kendaraan`.`NoPlat` AS `NoPlat`,`kendaraan`.`IDType` AS `IDType`,`kendaraan`.`Tahun` AS `Tahun`,`kendaraan`.`TarifPerJam` AS `TarifPerJam`,`kendaraan`.`StatusRental` AS `StatusRental` from `kendaraan` ;
-- --------------------------------------------------------
--
-- Structure for view `dplgn`
--
DROP TABLE IF EXISTS `dplgn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dplgn` AS select `pelanggan`.`NoKTP` AS `NoKTP`,`pelanggan`.`NamaPel` AS `NamaPel`,`pelanggan`.`AlamatPel` AS `AlamatPel`,`pelanggan`.`TelpPel` AS `TelpPel` from `pelanggan` ;
-- --------------------------------------------------------
--
-- Structure for view `ds`
--
DROP TABLE IF EXISTS `ds`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ds` AS select `sopir`.`IDSopir` AS `IDSopir`,`sopir`.`NmSopir` AS `NmSopir`,`sopir`.`AlmSopir` AS `AlmSopir`,`sopir`.`TelpSopir` AS `TelpSopir`,`sopir`.`NoSIM` AS `NoSIM`,`sopir`.`TarifPerJam` AS `TarifPerJam` from `sopir` ;
-- --------------------------------------------------------
--
-- Structure for view `dServices`
--
DROP TABLE IF EXISTS `dServices`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dServices` AS select `service`.`KodeService` AS `KodeService`,`service`.`TglService` AS `TglService`,`service`.`BiayaService` AS `BiayaService`,`service`.`NoPlat` AS `NoPlat`,`service`.`IDJenisService` AS `IDJenisService` from `service` ;
-- --------------------------------------------------------
--
-- Structure for view `dSop`
--
DROP TABLE IF EXISTS `dSop`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `dSop` AS select `sopir`.`IDSopir` AS `IDSopir`,`sopir`.`NmSopir` AS `NmSopir`,`sopir`.`AlmSopir` AS `AlmSopir`,`sopir`.`TelpSopir` AS `TelpSopir`,`sopir`.`NoSIM` AS `NoSIM`,`sopir`.`TarifPerJam` AS `TarifPerJam` from `sopir` ;
-- --------------------------------------------------------
--
-- Structure for view `getIdSop`
--
DROP TABLE IF EXISTS `getIdSop`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `getIdSop` AS select `sopir`.`IDSopir` AS `IDSopir` from `sopir` ;
-- --------------------------------------------------------
--
-- Structure for view `getNKTP`
--
DROP TABLE IF EXISTS `getNKTP`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `getNKTP` AS select `pelanggan`.`NoKTP` AS `noktp` from `pelanggan` ;
-- --------------------------------------------------------
--
-- Structure for view `getPlMob`
--
DROP TABLE IF EXISTS `getPlMob`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `getPlMob` AS select `kendaraan`.`NoPlat` AS `NoPlat` from `kendaraan` ;
-- --------------------------------------------------------
--
-- Structure for view `jServices`
--
DROP TABLE IF EXISTS `jServices`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `jServices` AS select `jenisservice`.`IDJenisService` AS `IDJenisService`,`jenisservice`.`NmJenisService` AS `NmJenisService` from `jenisservice` ;
-- --------------------------------------------------------
--
-- Structure for view `pinjamData`
--
DROP TABLE IF EXISTS `pinjamData`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `pinjamData` AS select `transaksisewa`.`NoTransaksi` AS `NoTransaksi`,`transaksisewa`.`TglPesan` AS `TglPesan`,`transaksisewa`.`TglPinjam` AS `TglPinjam`,`transaksisewa`.`JamPinjam` AS `JamPinjam`,`transaksisewa`.`tglkembalirencana` AS `tglkembalirencana`,`transaksisewa`.`TglPinjamRencana` AS `TglPinjamRencana`,`transaksisewa`.`JamKembaliRencana` AS `JamKembaliRencana`,`transaksisewa`.`TglKembaliRealisasi` AS `TglKembaliRealisasi`,`transaksisewa`.`JamKembaliReal` AS `JamKembaliReal`,`transaksisewa`.`Denda` AS `Denda`,`transaksisewa`.`KiloMeterPinjam` AS `KiloMeterPinjam`,`transaksisewa`.`KiloMeterKembali` AS `KiloMeterKembali`,`transaksisewa`.`BBMPinjam` AS `BBMPinjam`,`transaksisewa`.`BBMKembali` AS `BBMKembali`,`transaksisewa`.`KondisiMobilPinjam` AS `KondisiMobilPinjam`,`transaksisewa`.`KondisiMobilKembali` AS `KondisiMobilKembali`,`transaksisewa`.`Kerusakan` AS `Kerusakan`,`transaksisewa`.`BiayaKerusakan` AS `BiayaKerusakan`,`transaksisewa`.`BiayaBBM` AS `BiayaBBM`,`transaksisewa`.`NIK` AS `NIK`,`transaksisewa`.`NoPlat` AS `NoPlat`,`transaksisewa`.`IDSopir` AS `IDSopir`,`transaksisewa`.`NoKTP` AS `NoKTP` from `transaksisewa` where ((`transaksisewa`.`TglKembaliRealisasi` = '0000-00-00') and (`transaksisewa`.`JamKembaliReal` = '00:00:00')) ;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `jenisservice`
--
ALTER TABLE `jenisservice`
ADD PRIMARY KEY (`IDJenisService`);
--
-- Indexes for table `karyawan`
--
ALTER TABLE `karyawan`
ADD PRIMARY KEY (`NIK`);
--
-- Indexes for table `kendaraan`
--
ALTER TABLE `kendaraan`
ADD PRIMARY KEY (`NoPlat`,`IDType`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`NIK`);
--
-- Indexes for table `merk`
--
ALTER TABLE `merk`
ADD PRIMARY KEY (`KodeMerk`);
--
-- Indexes for table `pelanggan`
--
ALTER TABLE `pelanggan`
ADD PRIMARY KEY (`NoKTP`);
--
-- Indexes for table `pemilik`
--
ALTER TABLE `pemilik`
ADD PRIMARY KEY (`KodePemilik`,`NoPlat`);
--
-- Indexes for table `service`
--
ALTER TABLE `service`
ADD PRIMARY KEY (`KodeService`,`NoPlat`,`IDJenisService`);
--
-- Indexes for table `setoran`
--
ALTER TABLE `setoran`
ADD PRIMARY KEY (`NoSetoran`,`KodePemilik`,`NIK`);
--
-- Indexes for table `sopir`
--
ALTER TABLE `sopir`
ADD PRIMARY KEY (`IDSopir`);
--
-- Indexes for table `transaksisewa`
--
ALTER TABLE `transaksisewa`
ADD PRIMARY KEY (`NoTransaksi`,`NIK`,`NoPlat`,`NoKTP`,`IDSopir`);
--
-- Indexes for table `type`
--
ALTER TABLE `type`
ADD PRIMARY KEY (`IDType`,`KodeMerk`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT array_to_json(array_agg(row_to_json(t)))
FROM(
SELECT sum("Men") as men, sum("Women") as women, count("Id") as movies, "Year" as year
FROM movie_gender
WHERE "Fetched" = True and "Valid" = True and "Unset" = 0 and "Year" >= 1930
GROUP BY "Year"
ORDER BY "Year"
) t;
|
<filename>Scripts/ASAQC - NGRMDF/Troubleshooting/ShotinfoPreplotCounts.sql
/*
* base counts
*/
declare
@ShotInfo int,
@PreplotShotpoint int,
@ShotInfoDeviation int
select @ShotInfo = count(*) from [acquisition].[ShotInfo]
select @PreplotShotpoint = count(*) from [survey].[PreplotShotpoint]
select @ShotInfoDeviation = count(*) from [acquisition].[ShotInfoDeviation]
select @ShotInfo [ShotInfo]
select @PreplotShotpoint [PreplotShotpoint]
select @ShotInfoDeviation [ShotInfoDeviation]
/*
* shotInfo with corresponding shotpoint
*/
declare @ShotInfoWithPreplotShotpoint int
select @ShotInfoWithPreplotShotpoint = count(*)
from
[acquisition].[ShotInfo] si
join [survey].[PreplotShotpoint] pp
on pp.sailline_num = si.sailline_num
and pp.shotpoint_num = si.shotpoint_num
select @ShotInfoWithPreplotShotpoint [ShotInfoWithPreplotShotpoint]
/*
* shotinfo without corresponding shotpoint
*/
declare @ShotInfoWithoutPreplotShotpoint int
select @ShotInfoWithoutPreplotShotpoint = count(*)
from
[acquisition].[ShotInfo] si
left join [survey].[PreplotShotpoint] pp
on pp.sailline_num = si.sailline_num
and pp.shotpoint_num = si.shotpoint_num
where
pp.SurveyID is null
select @ShotInfoWithoutPreplotShotpoint [ShotInfoWithoutPreplotShotpoint]
/*
* Check
*/
select @ShotInfo Total, @ShotInfoWithPreplotShotpoint + @ShotInfoWithoutPreplotShotpoint WithAndWithout
select
@ShotInfoDeviation Calulated,
@ShotInfoWithPreplotShotpoint Expected,
@ShotInfoWithPreplotShotpoint - @ShotInfoDeviation NotCalculated,
(100.0 * @ShotInfoDeviation) / nullif(@ShotInfoWithPreplotShotpoint, 0) [PercentCalculated] |
<filename>server/db.sql
-- create user
CREATE USER IF NOT EXISTS `[USERNAME` IDENTIFIED BY `[PASSWORD]`;
-- grant db access
GRANT ALL PRIVILEGES ON `project`.* TO `[USERNAME]` @`%`;
-- create db
CREATE DATABASE `project`;
-- create table
CREATE TABLE IF NOT EXISTS `student` (
`srn` varchar(255),
`name` varchar(255) NOT NULL,
\ `course` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`srn`)
);
-- show records
SELECT *
FROM `student`;
-- insert records
INSERT INTO `student` (`srn`, `name`, `course`, `password`)
VALUES ('[SRN]', '[NAME]', '[COURSE]', '[PASSWORD]');
-- delete records
DELETE FROM `student`
WHERE `srn` = '[SRN]';
-- delete all records
DELETE FROM `student`;
-- create stats table with srn FOREIGN KEY
CREATE TABLE IF NOT EXISTS `stats` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`srn` varchar(255) NOT NULL,
`ref_string` varchar(255) NOT NULL,
`proc_count` int(11) NOT NULL,
`ram_size` int(11) NOT NULL,
`page_size` int(11) NOT NULL,
`frame_count` int(11) NOT NULL,
`page_count` int(11) NOT NULL,
`fifo_hits` int(11) NOT NULL,
`fifo_misses` int(11) NOT NULL,
`lru_hits` int(11) NOT NULL,
`lru_misses` int(11) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`srn`) REFERENCES `student`(`srn`)
);
-- show stats
SELECT *
FROM `stats`;
-- insert stats
INSERT INTO `stats` (
`srn`,
`ref_string`,
`proc_count`,
`ram_size`,
`page_size`,
`frame_count`,
`page_count`,
`fifo_hits`,
`fifo_misses`,
`lru_hits`,
`lru_misses`
) VALUES (
'[SRN]',
'[REF_STRING]',
'[PROC_COUNT]',
'[RAM_SIZE]',
'[PAGE_SIZE]',
'[FRAME_COUNT]',
'[PAGE_COUNT]',
'[FIFO_HITS]',
'[FIFO_MISSES]',
'[LRU_HITS]',
'[LRU_MISSES]'
);
-- delete stats
DELETE FROM `stats`
WHERE `srn` = '[SRN]';
-- delete all stats
DELETE FROM `stats`;
-- drop db
DROP DATABASE `project`; |
<reponame>EuFreela/bdr<filename>DER/bdr.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 05-Dez-2018 às 03:37
-- Versão do servidor: 5.7.24-0ubuntu0.18.04.1
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
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: `bdr`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `priority`
--
CREATE TABLE `priority` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`code` int(11) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estrutura da tabela `system_message`
--
CREATE TABLE `system_message` (
`id` int(11) NOT NULL,
`code` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estrutura da tabela `task`
--
CREATE TABLE `task` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`description` longtext,
`created_at` datetime DEFAULT NULL,
`updated_at` varchar(45) DEFAULT NULL,
`priority_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tabela de realização de tarefas';
--
-- Indexes for dumped tables
--
--
-- Indexes for table `priority`
--
ALTER TABLE `priority`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `system_message`
--
ALTER TABLE `system_message`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `task`
--
ALTER TABLE `task`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_task_priority_idx` (`priority_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `priority`
--
ALTER TABLE `priority`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `system_message`
--
ALTER TABLE `system_message`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `task`
--
ALTER TABLE `task`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Limitadores para a tabela `task`
--
ALTER TABLE `task`
ADD CONSTRAINT `fk_task_priority` FOREIGN KEY (`priority_id`) REFERENCES `priority` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT * FROM bt_fluxo_eventos bfe
DROP TABLE IF EXISTS agg_fluxo_eventos
CREATE TABLE agg_fluxo_eventos AS
SELECT
bfe.cod_concorrente AS cod_concorrente
, bfe.num_dia_semana_evento AS num_dia_semana_evento
, bfe.nome_dia_semana_evento AS nome_dia_semana_evento
, bfe.periodo_evento AS periodo_evento
, count(bfe.cod_concorrente) AS fluxo_medio
FROM
bt_fluxo_eventos bfe
GROUP BY
bfe.cod_concorrente
, bfe.num_dia_semana_evento
, bfe.nome_dia_semana_evento
, bfe.periodo_evento
ORDER BY 1, 2, 3
SELECT * FROM agg_fluxo_eventos afe |
<filename>application/models/separate_reports/report5_data.sql<gh_stars>0
SELECT umpire_type,
age_group,
short_league_name,
match_no_ump,
total_match_count,
match_pct
FROM dw_mv_report_05
WHERE short_league_name IN (:pLeague)
AND region_name IN (:pRegion)
AND season_year = :pSeasonYear
ORDER BY umpire_type, age_sort_order, league_sort_order; |
/*****************************************************************************
This is snapshot of the db schema that shipped with v0.1.
It's only purpose is to test db migrations.
*****************************************************************************/
-------------------------------------------------------------------------------
-- Migrations
-------------------------------------------------------------------------------
create schema ew;
create table ew.revision (
singleton int primary key default 1,
version integer not null,
check(singleton = 1)
);
insert into ew.revision (version) values (1);
create table ew.constraints (
singleton int primary key default 1,
tier_1 boolean not null default false,
tier_2 boolean not null default false,
check(singleton = 1)
);
insert into ew.constraints (singleton) values (1);
-------------------------------------------------------------------------------
-- Core
-------------------------------------------------------------------------------
create schema core;
create table core.headers (
height int,
id text,
parent_id text,
timestamp bigint
);
create table core.transactions (
id text,
header_id text,
height integer,
index integer
);
create table core.outputs (
box_id text,
tx_id text,
header_id text,
creation_height int,
address text,
-- settlement_height int,
index int,
value bigint
-- additional_registers json
);
create table core.inputs (
box_id text,
tx_id text,
header_id text,
index int
);
create table core.data_inputs (
box_id text,
tx_id text,
header_id text,
index int
);
create table core.box_registers (
id smallint, -- [4,9]
box_id text,
value_type text,
serialized_value text,
rendered_value text
);
create table core.tokens (
id text,
box_id text,
emission_amount bigint,
name text,
description text,
decimals integer,
standard text
);
create table core.box_assets (
box_id text,
token_id text,
amount bigint
);
-------------------------------------------------------------------------------
-- Unpent boxes
-------------------------------------------------------------------------------
create schema usp;
create table usp.boxes (
box_id text
);
-------------------------------------------------------------------------------
-- Balances
-------------------------------------------------------------------------------
create schema bal;
-- Running ERG balances
create table bal.erg (
address text,
value bigint
);
-- Changes in ERG balances
create table bal.erg_diffs (
address text,
height int,
tx_id text,
value bigint
);
-- Running token balances
create table bal.tokens (
address text,
token_id text,
value bigint
);
-- Changes in token balances
create table bal.tokens_diffs (
address text,
token_id text,
height int,
tx_id text,
value bigint
);
|
<reponame>vikdork/Certsys
USE [Certificate]
GO
/****** Object: Table [dbo].[Contact] Script Date: 2016-09-09 09:43:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Contact](
[ContactId] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](max) NULL,
[Mail] [nvarchar](max) NULL,
[SamAccountName] [nvarchar](50) NULL,
PRIMARY KEY CLUSTERED
(
[ContactId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
|
<gh_stars>1-10
USE [msdb]
GO
if serverproperty('EngineEdition')=4
print 'This is an Express edition. Nothign should be done.'
else
begin
declare
@OperatorName nvarchar(255) = N'$(MaintDBName)-DBA',
@OperatorMail nvarchar(255) = N'$(DBAOperatorMail)'
if exists (select * from msdb.dbo.sysoperators where name=@OperatorName)
begin
print 'Operator "' + @OperatorName + '" already exists. Updating...'
execute msdb.dbo.sp_update_operator
@name=@OperatorName,
@email_address=@OperatorMail
end
else
begin
print 'Creating operator "' + @OperatorName + '"...'
execute msdb.dbo.sp_add_operator
@name=@OperatorName,
@enabled=1,
@weekday_pager_start_time=90000,
@weekday_pager_end_time=180000,
@saturday_pager_start_time=90000,
@saturday_pager_end_time=180000,
@sunday_pager_start_time=90000,
@sunday_pager_end_time=180000,
@pager_days=0,
@email_address=@OperatorMail,
@category_name=N'[Uncategorized]'
end
end
GO
|
DELETE FROM model_version WHERE model = 'unknown';
DELETE FROM model WHERE id = 'unknown';
ALTER TABLE modelling_group
RENAME COLUMN current to replaced_by;
ALTER TABLE model
DROP COLUMN current,
ADD COLUMN is_current boolean NOT NULL DEFAULT FALSE,
ADD COLUMN current_version INTEGER NULL,
ADD COLUMN disease text;
-- Add disease information to models
UPDATE model SET disease = 'HepB' WHERE id in
('HepBGoldstein', 'HepBIC', 'HepBSTATIC', 'PRoGReSs ');
UPDATE model SET disease = 'Hib' WHERE id in
('LiST-Hib', 'TRIVAC-Hib');
UPDATE model SET disease = 'HPV' WHERE id in
('PRIME', 'HPVGoldie', 'HPVGoldie-flat', 'HPVGoldie-linear');
UPDATE model SET disease = 'JE' WHERE id in
('JE-Clapham', 'PATH-JE');
UPDATE model SET disease = 'Measles' WHERE id in
('DynaMICE', 'MeaslesPSU');
UPDATE model SET disease = 'MenA' WHERE id in
('MenA-Cambridge', 'MenAJackson', 'PATH-MenA');
UPDATE model SET disease = 'PCV' WHERE id in
('LiST-PCV', 'TRIVAC-PCV');
UPDATE model SET disease = 'Rota' WHERE id in
('LiST-Rota', 'TRIVAC-Rota');
UPDATE model SET disease = 'Rubella' WHERE id in
('RubellaPHE');
UPDATE model SET disease = 'YF' WHERE id in
('UnknownYF', 'YFIC');
-- Add is_current information to models
UPDATE model SET is_current = TRUE;
UPDATE model SET is_current = FALSE WHERE modelling_group IN
('unknown', 'Harvard-Sweet', 'LSHTM-Edmunds');
UPDATE model SET is_current = FALSE WHERE id IN
('PATH-MenA');
-- This is the only modelling group that has more than one model for the same
-- disease. I've just picked one of three models at random - we need Tini on
-- this one.
UPDATE model SET is_current = TRUE
WHERE modelling_group = 'Harvard-Sweet'
and id = 'HPVGoldie';
-- Create a new version for every model
WITH inserted_versions AS (
INSERT INTO model_version (model, version, note)
SELECT model.id, '201708test',
'Generated automatically - we have not gathered any information about '
'what versions the groups used in this touchstone'
FROM model
WHERE model.is_current
RETURNING model_version.id, model_version.model
)
UPDATE model
SET current_version = inserted_versions.id
FROM inserted_versions
WHERE model.id = inserted_versions.model;
-- Add constraints to model
ALTER TABLE model
ADD FOREIGN KEY (disease) REFERENCES disease(id),
ADD FOREIGN KEY (current_version) REFERENCES model_version(id);
-- Add conditional unique constraint to model
CREATE UNIQUE INDEX modelling_group_disease_unique_when_current ON
model (modelling_group, disease) WHERE (is_current); |
-- DROP TABLE IF EXISTS `im_messagestatus`;
CREATE TABLE `im_messagestatus` (
`user` mediumint(8) NOT NULL DEFAULT 0,
`gid` char(40) NOT NULL DEFAULT '',
`status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting',
UNIQUE KEY `user` (`user`,`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `im_message` CHANGE `type` `type` ENUM('normal','broadcast','notify') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'normal';
ALTER TABLE `im_message` CHANGE `contentType` `contentType` ENUM('text','emotion','image','file','object') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'text';
|
<reponame>devansh-pratap-singh/hackerrank-solutions<gh_stars>1-10
SELECT H.HACKER_ID, H.NAME FROM SUBMISSIONS AS S
JOIN HACKERS AS H ON S.HACKER_ID = H.HACKER_ID
JOIN CHALLENGES AS C ON S.CHALLENGE_ID = C.CHALLENGE_ID
JOIN DIFFICULTY AS D ON C.DIFFICULTY_LEVEL = D.DIFFICULTY_LEVEL
WHERE S.SCORE = D.SCORE
GROUP BY H.HACKER_ID, H.NAME
HAVING COUNT(*)>1
ORDER BY COUNT(*) DESC, H.HACKER_ID; |
<filename>Database/Programmability/Stored Procedures/VMBackup.InsertVirtualMachineRecord.sql
CREATE PROCEDURE [VMBackup].[InsertVirtualMachineRecord]
@subscriptionId uniqueidentifier
,@vmmId uniqueidentifier
,@hyperVId uniqueidentifier
,@vmName nvarchar(128)
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @protectionGroupId int,
@protectionGroupName nvarchar(128),
@backupServerName nvarchar(128),
@userName nvarchar(128),
@password nvarchar(128),
@protectingCount int;
BEGIN TRANSACTION
SELECT @protectionGroupId = [pg].Id
,@protectionGroupName = [pg].ProtectionGroupName
,@backupServerName = [backupServers].ServerName
,@userName = [backupservers].UserName
,@password = CAST([backupservers].[Password] as nvarchar(128))
FROM VMBackup.Subscriptions sub
INNER JOIN VMBackup.ProtectionGroups pg on pg.SubscriptionId = sub.Id
INNER JOIN VMBackup.BackupServers backupServers on pg.BackupServerId = backupServers.Id
WHERE sub.SubscriptionId = @subscriptionId
IF @protectionGroupId IS NULL
BEGIN
ROLLBACK TRANSACTION
RAISERROR (N'56001', 16, 1); -- (msg_str, severity, state)
RETURN;
END
SELECT @protectingCount = Count(*)
FROM VMBackup.VirtualMachines vm WITH (ROWLOCK, UPDLOCK, HOLDLOCK)
INNER JOIN ProtectionGroups pg ON vm.ProtectionGroupId = pg.Id
INNER JOIN VMBackup.Subscriptions sub ON pg.SubscriptionId = sub.Id
WHERE sub.SubscriptionId = @subscriptionId AND vm.ActionStateId = 1;
IF @protectingCount > 0
BEGIN
ROLLBACK TRANSACTION
RAISERROR (N'56002', 16, 1); -- (msg_str, severity, state)
RETURN;
END
IF EXISTS (SELECT [HyperVId] FROM [VMBackup].[VirtualMachines] WHERE [HyperVId] = @hyperVId)
BEGIN
IF EXISTS (SELECT [HyperVId] FROM [VMBackup].[VirtualMachines] WHERE [HyperVId] = @hyperVId AND [VirtualMachineStateId] = 2)
BEGIN
UPDATE [VMBackup].[VirtualMachines]
SET [ProtectionGroupId] = @protectionGroupId
,[ActionStateId] = 1
,[ActionStateDate] = GETDATE()
WHERE [HyperVId] = @hyperVId
END
ELSE
BEGIN
ROLLBACK TRANSACTION
RAISERROR (N'56003', 16, 1); -- (msg_str, severity, state)
RETURN;
END
END
ELSE
BEGIN
INSERT INTO [VMBackup].[VirtualMachines]
([VmmId]
,[HyperVId]
,[VmName]
,[VirtualMachineStateId]
,[RecoveryPointCount]
,[LastRecoveryPoint]
,[ProtectionGroupId]
,[ActionStateId]
,[ActionStateDate])
VALUES
(@vmmId
,@hyperVId
,@vmName
,2
,0
,null
,@protectionGroupId
,1 --Protecting
,GETDATE())
END
SELECT ProtectionGroupName = @protectionGroupName
,BackupServerName = @backupServerName
,BackupServerUserName = @userName
,BackupServerPassword = <PASSWORD>
COMMIT TRANSACTION
END |
<reponame>rafelafrance/sightings-database<gh_stars>1-10
SELECT *
FROM places
JOIN events USING (place_id)
JOIN counts USING (event_id)
JOIN taxa USING (taxon_id)
WHERE year = 2014
AND day BETWEEN 100 AND 110
AND lng BETWEEN -73 AND -72
AND lat BETWEEN 40 AND 41
AND target = 't';
SELECT *
FROM places
JOIN events USING (place_id)
JOIN counts USING (event_id)
JOIN taxa USING (taxon_id)
WHERE year = 2014
AND day BETWEEN 100 AND 110
AND lng BETWEEN -73 AND -72
AND lat BETWEEN 40 AND 41
AND class = 'lepidoptera'
AND target = 't';
SELECT lng, lat, year, day, count, sci_name,
event_json ->> 'GROUP_IDENTIFIER' AS group_identifier
FROM places
JOIN events USING (place_id)
JOIN counts USING (event_id)
JOIN taxa USING (taxon_id)
WHERE dataset_id = 'ebird'
AND year = 2014
AND day BETWEEN 100 AND 110
AND lng BETWEEN -73 AND -72
AND lat BETWEEN 40 AND 41
AND target = 't'
AND event_json -> 'GROUP_IDENTIFIER' IS NOT NULL;
WITH checklists AS (
SELECT event_json ->> 'SAMPLING_EVENT_IDENTIFIER' AS sample_id
FROM places
JOIN events USING (place_id)
WHERE places.dataset_id = 'ebird'
AND year >= 2010
AND day BETWEEN 30 AND 150
AND lng BETWEEN -80.430375 AND -80.124475
AND lat BETWEEN 25.956546 AND 25.974140
AND event_json -> 'SAMPLING_EVENT_IDENTIFIER' IS NOT NULL)
SELECT COUNT(*) AS n
FROM checklists;
|
<reponame>Shuttl-Tech/antlr_psql
-- file:oid.sql ln:15 expect:true
INSERT INTO OID_TBL(f1) VALUES (' 15 ')
|
<gh_stars>10-100
-- file:identity.sql ln:183 expect:true
INSERT INTO itest6 DEFAULT VALUES
|
<reponame>d-ylee/dbs2go
{{if .Main}}
SELECT R.RELEASE_VERSION, P.PSET_HASH, P.PSET_NAME, A.APP_NAME, O.OUTPUT_MODULE_LABEL, O.GLOBAL_TAG, O.CREATION_DATE, O.CREATE_BY
FROM {{.Owner}}.OUTPUT_MODULE_CONFIGS O
JOIN {{.Owner}}.RELEASE_VERSIONS R ON O.RELEASE_VERSION_ID=R.RELEASE_VERSION_ID
JOIN {{.Owner}}.APPLICATION_EXECUTABLES A ON O.APP_EXEC_ID=A.APP_EXEC_ID
JOIN {{.Owner}}.PARAMETER_SET_HASHES P ON O.PARAMETER_SET_HASH_ID=P.PARAMETER_SET_HASH_ID
{{if .Dataset}}
JOIN {{.Owner}}.DATASET_OUTPUT_MOD_CONFIGS DC ON DC.OUTPUT_MOD_CONFIG_ID=O.OUTPUT_MOD_CONFIG_ID
JOIN {{.Owner}}.DATASETS DS ON DS.DATASET_ID=DC.DATASET_ID
{{end}}
{{if .Lfn}}
JOIN {{.Owner}}.FILE_OUTPUT_MOD_CONFIGS FC ON FC.OUTPUT_MOD_CONFIG_ID=O.OUTPUT_MOD_CONFIG_ID
JOIN {{.Owner}}.FILES FS ON FS.FILE_ID=FC.FILE_ID
{{end}}
{{else}}
SELECT R.RELEASE_VERSION, P.PSET_HASH, P.PSET_NAME, A.APP_NAME, O.OUTPUT_MODULE_LABEL, O.GLOBAL_TAG, O.CREATION_DATE, O.CREATE_BY, FS.LOGICAL_FILE_NAME LFN
FROM {{.Owner}}.OUTPUT_MODULE_CONFIGS O
JOIN {{.Owner}}.RELEASE_VERSIONS R ON O.RELEASE_VERSION_ID=R.RELEASE_VERSION_ID
JOIN {{.Owner}}.APPLICATION_EXECUTABLES A ON O.APP_EXEC_ID=A.APP_EXEC_ID
JOIN {{.Owner}}.PARAMETER_SET_HASHES P ON O.PARAMETER_SET_HASH_ID=P.PARAMETER_SET_HASH_ID
JOIN {{.Owner}}.FILE_OUTPUT_MOD_CONFIGS FC ON FC.OUTPUT_MOD_CONFIG_ID=O.OUTPUT_MOD_CONFIG_ID
JOIN {{.Owner}}.FILES FS ON FS.FILE_ID=FC.FILE_ID
{{end}}
|
<reponame>sitakantapanda/nber<gh_stars>1-10
CREATE TABLE paper (
id INTEGER PRIMARY KEY,
citation_title VARCHAR,
citation_author VARCHAR[],
citation_date DATE,
citation_publication_date DATE,
citation_technical_report_institution VARCHAR,
citation_technical_report_number VARCHAR UNIQUE,
citation_journal_title VARCHAR,
citation_journal_issn VARCHAR,
citation_pdf_url VARCHAR,
topics VARCHAR[],
abstract VARCHAR,
also_downloaded VARCHAR[]
); |
<reponame>ShayHa/CodingInterviewSolution<filename>sql/1179_Reformat_Department_Table.sql
SELECT id,
SUM(CASE WHEN Department.month = 'Jan' THEN Department.revenue END) AS "Jan Rev",
SUM(CASE WHEN Department.month = 'Feb' THEN Department.revenue END) AS "Feb Rev",
SUM(CASE WHEN Department.month = 'Mar' THEN Department.revenue END) AS "Mar Rev"
FROM Department
GROUP BY id
|
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table buy_option (
id integer auto_increment not null,
title varchar(255),
normal_price double not null,
sale_price double not null,
percentage_discount double not null,
quantity_cupom bigint,
start_date datetime(6),
end_date datetime(6),
deal_id integer,
constraint pk_buy_option primary key (id)
);
create table deal (
id integer auto_increment not null,
title varchar(255),
text varchar(255),
create_date datetime(6),
publish_date datetime(6),
end_date datetime(6),
url varchar(255),
total_sold integer,
type_deal integer,
constraint pk_deal primary key (id)
);
alter table buy_option add constraint fk_buy_option_deal_id foreign key (deal_id) references deal (id) on delete restrict on update restrict;
create index ix_buy_option_deal_id on buy_option (deal_id);
# --- !Downs
alter table buy_option drop foreign key fk_buy_option_deal_id;
drop index ix_buy_option_deal_id on buy_option;
drop table if exists buy_option;
drop table if exists deal;
|
DROP SCHEMA IF EXISTS MAIN;
CREATE SCHEMA MAIN AUTHORIZATION SA;
DROP TABLE IF EXISTS MAIN.PROFILE;
CREATE TABLE MAIN.PROFILE (
id UUID PRIMARY KEY,
update_date TIMESTAMP,
first_name VARCHAR(250) NOT NULL,
last_name VARCHAR(250) NOT NULL,
email VARCHAR(250) DEFAULT NULL,
membership_date DATE,
membership_statu VARCHAR(250),
premium_membership_expiry_date DATE
);
DROP TABLE IF EXISTS MAIN.SUPPORT_REQUEST;
CREATE TABLE MAIN.SUPPORT_REQUEST (
id UUID PRIMARY KEY,
update_date TIMESTAMP,
profile_id UUID,
subject VARCHAR(250),
message VARCHAR(500)
);
DROP TABLE IF EXISTS MAIN.DEBIT_CARD;
CREATE TABLE MAIN.DEBIT_CARD (
id UUID PRIMARY KEY,
update_date TIMESTAMP,
profile_id UUID,
name VARCHAR(20),
no VARCHAR(30),
expiry_date VARCHAR(5),
cvc VARCHAR(3)
);
|
SELECT FirstName, LastName FROM Clients
WHERE YEAR(BirthDate) BETWEEN 1977 AND 1994
ORDER BY FirstName, LastName, Id |
<filename>apps/endpoint-registry/sql/create_endpoints.sql
CREATE TABLE public.endpoints
(
"endpointId" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
"URL" character varying(1024) COLLATE pg_catalog."default" NOT NULL,
protocol_name character varying(1024) COLLATE pg_catalog."default" NOT NULL,
protocol_version character varying(1024) COLLATE pg_catalog."default",
"aasId" character varying(1024) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT endpoints_pkey PRIMARY KEY ("endpointId"),
CONSTRAINT "aasId" FOREIGN KEY ("aasId")
REFERENCES public.asset_administration_shells ("aasId") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT "endpointId" FOREIGN KEY ("endpointId")
REFERENCES public.endpoints ("endpointId") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.endpoints
OWNER to postgres; |
TRUNCATE TABLE @source_schema.drug_claims;
TRUNCATE TABLE @source_schema.enrollment_detail;
TRUNCATE TABLE @source_schema.enrollment_summary;
TRUNCATE TABLE @source_schema.facility_header;
TRUNCATE TABLE @source_schema.icd9;
TRUNCATE TABLE @source_schema.inpatient_admissions;
TRUNCATE TABLE @source_schema.inpatient_services;
TRUNCATE TABLE @source_schema.long_term_care;
TRUNCATE TABLE @source_schema.outpatient_services;
-- 1. Condition Occurrence
--
-- 1.0 Patient has two different primary diagnoses between inpatient_services and inpatient_admissions, the inpatient_admissions PDX is used [Test ID: 1]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '1', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '2', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '9', '1', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', '2500', '2', '1', '2', '21', '1', '1', '50', '2012-08-09', '20226', '2012-08-12', '01', '2012');
INSERT INTO @source_schema.inpatient_admissions (admdate, admtyp, boe, cap, caseid, days, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx2, dxver, enrolid, hospnet, hosppay, mas, mdc, medicare, mhsacovg, pddate, pdx, physnet, physpay, plantyp, sex, stdrace, totcob, totcoins, totcopay, totded, totnet, totpay, version, year) VALUES ('2012-01-01', '3', '2', '0', '2', '2', '2012-12-31', '2014', '795', '1', '01', 'V3000 ', '25000 ', '9', '1', '0.0', '0.0', '9', '14', '0', '1', '2008-05-12', '0092', '0.0', '0.0', '2', '2', '1', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '01', '2012');
--
-- 1.1 Patient has the same diagnosis code in outpatient_services and facility_header but in different positions, outpatient_services dx is prioritized [Test ID: 2]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '3', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '1024', '9', '3', '4', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-10-16', '12220', '2012-10-16', '01', '2015');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, dx9, dxver, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '1024', '9', '3', '4', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '2', '22', '1', '1', '2012-10-16', '2012-10-16', '01', '2015');
--
-- 1.2 Patient has diagnosis in dx4 field in inpatient_services, condition_type_concept_id = 38000187 [Test ID: 3]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '5', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx4, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '57411', '9', '5', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-07-23', '20226', '2012-07-23', '01', '2014');
--
-- 1.3 Patient has diagnosis in dx9 field in facility_header, condition_type_concept_id = 38000208 [Test ID: 4]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '7', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '7', '8', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-07-23', '20226', '2012-07-23', '01', '2014');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, dx9, dxver, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '4760', '9', '7', '8', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '2', '22', '1', '1', '2012-07-23', '2012-07-23', '01', '2015');
--
-- 1.4 Patient has revcode 0450 and diagnosis codes in the pdx and dx1 fields, ER record created and conditions have condition_type_concept_id = 38000215 [Test ID: 5]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '9', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, revcode, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', '57411', '9', '9', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', '4760', '2', '1', '0450', '2', '21', '1', '1', '50', '2012-04-14', '20226', '2012-04-14', '01', '2014');
--
-- 1.5 Patient has diagnosis in a dx field that has domain=procedure, condition record moved to procedure_occurrence [Test ID: 6]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '11', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '9', '11', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V755', '2', '1', '2', '21', '1', '1', '50', '2012-10-15', '20226', '2012-10-17', '01', '2014');
--
-- 1.6 Patient has diagnosis in a dx field that has domain=observation, condition record moved to observation [Test ID: 7]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '13', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '9', '13', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'E0152', '2', '1', '2', '21', '1', '1', '50', '2012-02-04', '20226', '2012-02-08', '01', '2014');
--
-- 1.7 Patient has diagnosis in a dx field that has domain=measurement, condition record moved to measurement [Test ID: 8]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '15', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '9', '15', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V726', '2', '1', '2', '21', '1', '1', '50', '2012-08-21', '20226', '2012-08-25', '01', '2014');
--
-- 1.8 Patient has icd10 diagnosis in a dx field with dxver=0, condition record created with icd10 mapped to snomed [Test ID: 9]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '17', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'S42241S', '0', '17', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-08-09', '20226', '2012-08-12', '01', '2014');
--
-- 1.9 patient has icd10cm diagnosis in a dx field that overlaps with an icd10 diagnosis, condition record created with icd10cm mapped to snomed [Test ID: 10]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '19', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V9001', '0', '19', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-08-09', '20226', '2012-08-12', '01', '2014');
--
-- 1.10 Patient has icd10 diagnosis after 10/1/2015 in a dx field with dxver=null, condition record created with icd10 mapped to snomed [Test ID: 11]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-12-31', '2015-01-01', '21', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-11-09', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'S42241S', '', '21', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2015-11-09', '20226', '2015-11-12', '01', '2014');
--
-- 1.11 Patient has icd10 diagnosis before 10/1/2015 in a dx field with dxver=null, used ICD9 [Test ID: 12]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '23', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V9001', '', '23', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-08-09', '20226', '2012-08-12', '01', '2014');
--
-- 1.12 Patient has diagnosis in dx1 in ltc, condition_type_concept_id = 38000215 [Test ID: 13]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '25', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', 'v9001', '9', '25', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '1', '0190', '2', '31', '1', '11-05-2012', '10210', '11-10-2012', '01', '2014');
-- 2. Condition Era
--
-- 2.0 Patient condition_concept_id of 0, no condition_era record created [Test ID: 14]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '27', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', '71978', '9', '27', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', '71978', '2', '1', '2', '21', '1', '1', '50', '2012-04-21', '20226', '2012-04-22', '01', '2014');
--
-- 2.1 Two records with same condition_concept_id are less than 30 days apart, one condition_era record created [Test ID: 15]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '29', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '37613', '9', '29', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-07-01', '12220', '2015-04-30', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '37613', '9', '29', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-07-12', '12220', '2015-04-30', '01', '2015');
--
-- 2.2 Two records with same condition_concept_id are more than 30 days apart, two condition_era records created [Test ID: 16]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2013-12-31', '2012-01-01', '31', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '37613', '9', '31', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-07-01', '12220', '2015-04-30', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '37613', '9', '31', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-08-12', '12220', '2015-04-30', '01', '2015');
-- 3. Cost
--
-- 3.0 Patient has values in ingcost and and dispfee [Test ID: 17]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '33', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '20', '01', '30', '6', '0.0', '25', '1957', '1', '33', '111273', '4', '50', '2', '9', '0', '0', '1', '00378510501', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '2012-02-09', '69', '08', '01', '2015');
--
-- 3.1 Patient has cost values, cost is correctly associated with cost_domain_id = 10 [Test ID: 18]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '35', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, proc1, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '36', '0.0', '0.0', '40', '120', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '35', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '65779', '1', '2', '21', '1', '1', '50', '2012-06-11', '20226', '2012-06-30', '01', '2012');
INSERT INTO @source_schema.inpatient_admissions (admdate, admtyp, boe, cap, caseid, days, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx2, enrolid, hospnet, hosppay, mas, mdc, medicare, mhsacovg, pddate, pdx, physnet, physpay, plantyp, sex, stdrace, totcob, totcoins, totcopay, totded, totnet, totpay, version, year) VALUES ('2012-01-01', '3', '2', '0', '36', '2', '2012-12-31', '2014', '795', '1', '01', 'V3000 ', '25000 ', '35', '0.0', '0.0', '9', '14', '0', '1', '2008-05-12', 'V3000 ', '0.0', '0.0', '2', '2', '1', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '01', '2012');
--
-- 3.2 Patient has procedure with domain = measurement, measurement record created [Test ID: 19]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '37', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '37', '0.0', '0', '2006', '1', '37', 'P', '9', '23', '0', '1', '120', '0.0', '2014-05-28', '2', '82985', '104', '1', '1', '2', '11', '1', '1', '2012-05-07', '12220', '2012-05-07', '01', '2015');
--
-- 3.3 Patient has procedure with domain = observation, observation record created [Test ID: 20]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '39', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '52', '100', '0.0', '0.0', '0', '2006', '1', '39', 'P', '9', '23', '0', '1', '75', '0.0', '2014-05-28', '2', 'S9368', '104', '1', '1', '2', '11', '1', '1', '2012-10-03', '12220', '2012-10-03', '01', '2015');
--
-- 3.4 Patient has cost values and revenue code, cost is correctly associated with cost_domain_id = 10 [Test ID: 21]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '41', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, revcode, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '42', '0.0', '0.0', '80', '20', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '41', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '0420', '2', '21', '1', '1', '50', '2012-06-05', '20226', '2012-06-05', '01', '2012');
INSERT INTO @source_schema.inpatient_admissions (admdate, admtyp, boe, cap, caseid, days, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx2, enrolid, hospnet, hosppay, mas, mdc, medicare, mhsacovg, pddate, pdx, physnet, physpay, plantyp, sex, stdrace, totcob, totcoins, totcopay, totded, totnet, totpay, version, year) VALUES ('2012-01-01', '3', '2', '0', '42', '2', '2012-12-31', '2014', '795', '1', '01', 'V3000 ', '25000 ', '41', '0.0', '0.0', '9', '14', '0', '1', '2008-05-12', 'V3000 ', '0.0', '0.0', '2', '2', '1', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '01', '2012');
--
-- 3.5 Patient has record with costs in ltc, cost record created [Test ID: 22]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '43', '9', '0', '31', '1', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '20', '88', '62', '0.0', '1925', '0', 'v9001', '9', '43', 'F', '9', '01', '1', '1', '90', '0.0', '2010-08-30', '2', '65779', '1', '0190', '2', '31', '1', '11-12-2012', '10210', '11-22-2012', '01', '2014');
-- 4. Death
--
-- 4.0 Date of death visit end date [Test ID: 23]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-12-31', '2012-01-01', '45', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '45', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2013-01-06', '20226', '2013-01-09', '01', '2013');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, dx1, dxver, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '7981', '9', '45', '46', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2013-01-07', '12220', '2013-01-07', '01', '2013');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, dx9, dxver, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '7981', '9', '45', '46', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '2', '22', '1', '1', '2013-01-07', '2013-01-07', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2016-12-31', '2012-01-01', '47', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 4.1 ICD10 Death and Death Type Correct [Test ID: 24]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'I461', '0', '47', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2016-01-06', '20226', '2016-01-09', '01', '2016');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-12-31', '2012-01-01', '49', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 4.2 ICD9 Death and Death Type Correct [Test ID: 25]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', '798', '9', '49', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2013-01-06', '20226', '2013-01-09', '01', '2013');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2013-02-01', '2012-01-01', '51', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 4.3 Discharge Status and Death Type Correct [Test ID: 26]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '20', 'V3000 ', '51', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2013-01-06', '20226', '2013-01-09', '01', '2013');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-12-31', '2012-01-01', '53', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 4.4 Death by ICD9 and Death by Discharge, Keep the Discharge [Test ID: 27]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '20', '798', '9', '53', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2013-01-06', '20226', '2013-01-09', '01', '2013');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-12-31', '2012-01-01', '55', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 4.5 Death and then contined Activity Cancels Death [Test ID: 28]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '20', 'V3000 ', '55', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2013-01-06', '20226', '2013-01-09', '01', '2013');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '55', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2013-03-12', '12220', '2015-04-30', '01', '2013');
--
-- 4.6 Patient has icd9 death cord in ltc, death record created [Test ID: 29]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '57', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '798', '9', '57', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '1', '0190', '2', '31', '1', '11-02-2012', '10210', '11-22-2012', '01', '2014');
-- 5. Device Exposure
-- 6. Drug Exposure
--
-- 6.0 Duplicate drug records become one record in the CDM [Test ID: 30]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '59', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '59', '111273', '4', '0.0', '2', '9', '0', '0', '1', '36987257801', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '02-01-2012', '69', '08', '01', '2012');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '59', '111273', '4', '0.0', '2', '9', '0', '0', '1', '36987257801', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '02-01-2012', '69', '08', '01', '2012');
--
-- 6.1 Negative daysupp should be 0 in cdm [Test ID: 31]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '61', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '-30', '6', '0.0', '0.0', '1957', '1', '61', '111273', '4', '0.0', '2', '9', '0', '0', '1', '58864060830', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '06-12-2012', '69', '08', '01', '2012');
--
-- 6.2 Daysupp >365 should be 365 in cdm [Test ID: 32]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '63', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '432', '6', '0.0', '0.0', '1957', '1', '63', '111273', '4', '0.0', '2', '9', '0', '0', '1', '58864060830', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '08-07-2012', '69', '08', '01', '2012');
--
-- 6.3 CPT4 drug code in inpatient record moves to drug_exposure [Test ID: 33]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '65', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, proc1, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '66', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '65', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '90376', '1', '2', '21', '1', '1', '50', '2012-08-09', '20226', '2012-08-12', '01', '2012');
--
-- 6.4 Patient has 11 digit NDC that doesn''t map, should use first 9 digits instead [Test ID: 34]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '67', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '67', '111273', '4', '0.0', '2', '9', '0', '0', '1', '13533063670', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '01-17-2012', '69', '08', '01', '2012');
--
-- 6.5 Patient has 9 digit NDC that doesn''t map, should use first 9 digits instead, should map to DRUG_CONCEPT_ID=0 because of the date filter [Test ID: 35]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2006-12-31', '2006-01-01', '69', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '69', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00006000543', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '07-08-2006', '69', '08', '01', '2006');
--
-- 6.6 Patient has 9 digit NDC that doesn''t map, should use first 9 digits instead, should map to correct DRUG_CONCEPT_ID because of the date filter [Test ID: 36]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2014-12-31', '2014-01-01', '71', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '71', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00006032582', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '09-18-2014', '69', '08', '01', '2014');
-- 7. Drug Era
--
-- 7.0 Two drugs with same ingredient within 30 days, should be one drug era [Test ID: 37]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '73', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '73', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00463303410', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '02-04-2012', '69', '08', '01', '2012');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '73', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00463303410', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '02-22-2012', '69', '08', '01', '2012');
--
-- 7.1 Two drugs with same ingredient > 30 days apart, should be two drug eras [Test ID: 38]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '75', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '75', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00463303410', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '09-21-2012', '69', '08', '01', '2012');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '75', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00463303410', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '12-08-2012', '69', '08', '01', '2012');
--
-- 7.2 Drug_era_end_date should be drug start date + days supply [Test ID: 39]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2010-01-01', '77', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '14', '6', '0.0', '0.0', '1957', '1', '77', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00349835305', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '12-08-2010', '69', '08', '01', '2012');
--
-- 7.3 No drug era created from procedure drugs since they are not related to ingredients [Test ID: 40]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '79', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, proc1, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '80', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '79', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '90376', '1', '2', '21', '1', '1', '50', '2012-03-26', '20226', '2012-03-30', '01', '2012');
--
-- 7.4 Drug with two ingredients should have two drug eras [Test ID: 41]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2010-01-01', '81', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.drug_claims (awp, boe, cap, cob, coins, copay, dawind, daysupp, deaclas, deduct, dispfee, dobyr, drugcovg, enrolid, generid, genind, ingcost, maintin, mas, medicare, metqty, mhsacovg, ndcnum, netpay, pay, pddate, plantyp, qty, refill, sex, stdrace, svcdate, thercls, thergrp, version, year) VALUES ('0.0', '2', '0', '0.0', '0.0', '0.0', '01', '30', '6', '0.0', '0.0', '1957', '1', '81', '111273', '4', '0.0', '2', '9', '0', '0', '1', '00008419001', '0.0', '0.0', '2014-05-14', '2', '1', '0', '2', '1', '05-01-2010', '69', '08', '01', '2012');
-- 8. Location
-- 9. Measurement
-- 10. Observation Period
--
-- 10.0 Subsumed enrollment test where two enrollment durations with the second subsumed by the first results in a single observation [Test ID: 42]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '83', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-07-31', '2012-06-01', '83', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 10.1 Combine enrollment test where two enrollment durations with the second within 30 days of the first results in a single observation [Test ID: 43]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-05-31', '2012-05-01', '84', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-06-15', '84', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 10.2 Gap enrollment test where two enrollment durations are 33 days apart results in two observations [Test ID: 44]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-06-01', '2012-01-01', '85', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-08-02', '85', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
-- 11. Observation
--
-- 11.0 Store Discharge Status [Test ID: 45]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2013-12-31', '2012-01-01', '86', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, dxver, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '51', '57411', '9', '86', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-07-23', '20226', '2012-07-23', '01', '2014');
-- 12. Payer Plan Period
--
-- 12.0 Person has a gap of >32 days between enrollment periods with the same payer_source_value; person has two records [Test ID: 46]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2013-01-31', '2013-01-01', '88', '9', '1', '31', '0', '6', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2013-05-31', '2013-05-01', '88', '9', '1', '31', '0', '6', '2', '1', '01', '2015');
--
-- 12.1 Person does not have prescription benefits and is excluded [Test ID: 47]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '0', '2013-01-31', '2013-01-01', '89', '9', '0', '31', '0', '6', '2', '1', '01', '2015');
--
-- 12.2 Person switches plans in the middle of an enrollment period; person has two records with the first truncated [Test ID: 48]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-04-30', '2012-04-01', '90', '9', '1', '31', '0', '6', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-04-30', '2012-04-07', '90', '9', '1', '31', '0', '5', '2', '1', '01', '2015');
--
-- 12.3 Person has duplicate records, only one is brought into the cdm [Test ID: 49]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-04-30', '2012-04-01', '91', '9', '1', '31', '0', '6', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-04-30', '2012-04-01', '91', '9', '1', '31', '0', '6', '2', '1', '01', '2015');
-- 13. Person
--
-- 13.0 Person with two genders is excluded [Test ID: 50]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '92', '9', '0', '31', '0', '4', '1', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '92', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.1 Person with two birth years >2 yrs apart is excluded [Test ID: 51]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1970', '1', '2015-08-31', '2015-08-01', '93', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1980', '1', '2015-08-31', '2015-08-01', '93', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.2 Person with two birth years <2 yrs apart is kept with last birth year selected [Test ID: 52]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1970', '1', '2012-01-31', '2012-01-01', '94', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1971', '1', '2012-02-28', '2012-02-01', '94', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.3 Person born before 1900 is excluded [Test ID: 53]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1899', '1', '2015-08-31', '2015-08-01', '95', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.4 Person born in 2099 is excluded [Test ID: 54]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2099', '1', '2015-08-31', '2015-08-01', '96', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.5 Person born in 2014 but enrolled in 2012 is excluded [Test ID: 55]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2014', '1', '2012-01-31', '2012-01-01', '97', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.6 Person born in 2013 but enrolled in 2012 is kept, latest birth year taken [Test ID: 56]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2013', '1', '2012-01-31', '2012-01-01', '98', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.7 Person with two enrollment_detail records has one person record [Test ID: 57]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1980', '1', '2012-01-31', '2012-01-01', '99', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '1980', '1', '2012-02-28', '2012-02-01', '99', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.8 Person with sex=3 is excluded [Test ID: 58]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '100', '9', '0', '31', '0', '4', '3', '1', '01', '2015');
--
-- 13.9 Person has record with sex=3 but last record has sex=1, person is kept [Test ID: 59]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-01-31', '2012-01-01', '101', '9', '0', '31', '0', '4', '3', '1', '01', '2015');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-02-28', '2012-02-01', '101', '9', '0', '31', '0', '4', '1', '1', '01', '2015');
--
-- 13.10 Person born the same year as enrolled, use first enrollment month to impute month of birth and day of birth [Test ID: 60]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2012', '1', '2012-04-30', '2012-04-01', '102', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.11 Person with DRUGCOVG=0 and MEDICARE=0, person is excluded [Test ID: 61]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '0', '2015-08-31', '2015-08-01', '103', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.12 Person with DRUGCOVG=1 and MEDICARE=0, person is kept [Test ID: 62]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '104', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.13 Person with DRUGCOVG=0 and MEDICARE=1, person is kept [Test ID: 63]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '0', '2015-08-31', '2015-08-01', '105', '9', '1', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.14 Person with stdrace=1 [Test ID: 64]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '106', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 13.15 Person with stdrace=4 [Test ID: 65]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2015-08-31', '2015-08-01', '107', '9', '0', '31', '0', '4', '2', '4', '01', '2015');
-- 14. Procedure Occurrence
--
-- 14.0 Patient has two PPROC values, PPROC from inpatient_admissions is used [Test ID: 66]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '108', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, pproc, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '109', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '108', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '65779', '1', '2', '21', '1', '1', '50', '2012-06-11', '20226', '2012-06-12', '01', '2012');
INSERT INTO @source_schema.inpatient_admissions (admdate, admtyp, boe, cap, caseid, days, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx2, enrolid, hospnet, hosppay, mas, mdc, medicare, mhsacovg, pddate, pdx, physnet, physpay, plantyp, pproc, sex, stdrace, totcob, totcoins, totcopay, totded, totnet, totpay, version, year) VALUES ('2012-01-01', '3', '2', '0', '109', '2', '2012-12-31', '2014', '795', '1', '01', 'V3000 ', '25000 ', '108', '0.0', '0.0', '9', '14', '0', '1', '2008-05-12', 'V3000 ', '0.0', '0.0', '2', '29914', '2', '1', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '01', '2012');
--
-- 14.1 Patient has two different providers for the same procedure, the provider on the first line (ascending) is chosen [Test ID: 67]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '110', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_admissions (admdate, admtyp, boe, cap, caseid, days, disdate, dobyr, drg, drugcovg, dstatus, dx1, dx2, enrolid, hospnet, hosppay, mas, mdc, medicare, mhsacovg, pddate, pdx, physnet, physpay, plantyp, sex, stdrace, totcob, totcoins, totcopay, totded, totnet, totpay, version, year) VALUES ('2012-01-01', '3', '2', '0', '111', '2', '2012-12-31', '2014', '795', '1', '01', 'V3000 ', '25000 ', '110', '0.0', '0.0', '9', '14', '0', '1', '2008-05-12', 'V3000 ', '0.0', '0.0', '2', '2', '1', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '01', '2012');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, proc1, prov_id, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '111', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '110', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '50760', '3456789', '1', '2', '21', '220', '1', '50', '2012-10-20', '20226', '2012-10-22', '01', '2012');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, proc1, prov_id, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '111', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '110', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '50760', '1234567', '1', '2', '21', '540', '1', '50', '2012-10-20', '20226', '2012-10-22', '01', '2012');
--
-- 14.2 Patient has procedure in proc1 field in long_term_care table [Test ID: 68]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '112', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '112', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '92568', '1', '0190', '2', '31', '1', '2012-09-15', '10210', '2012-10-30', '01', '2014');
--
-- 14.3 Patient has two records for the same procedure, procedure in outpatient_services prioritized [Test ID: 69]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '114', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '114', '115', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '54861', '104', '1', '1', '2', '11', '1', '1', '2012-02-15', '12220', '2012-02-15', '01', '2012');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, proc1, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '114', '115', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '54861', '2', '22', '1', '1', '2012-02-15', '2012-02-15', '01', '2012');
--
-- 14.4 Patient has procedure in proc5 position in facility header, procedure_type_concept_id = 38000273 [Test ID: 70]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '116', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '116', '117', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-03-03', '12220', '2012-03-03', '01', '2012');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, proc5, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '116', '117', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '93042', '2', '22', '1', '1', '2012-03-03', '2012-03-03', '01', '2012');
--
-- 14.5 Patient has procedure with domain = device, device record created [Test ID: 71]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '118', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '118', '119', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', 'E0304', '104', '1', '1', '2', '11', '1', '1', '2012-04-03', '12220', '2012-04-03', '01', '2012');
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, enrolid, fachdid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '118', '119', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '2', '22', '1', '1', '2012-04-03', '2012-04-03', '01', '2012');
--
-- 14.6 Patient has procedure with domain = drug, drug record created [Test ID: 72]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '120', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '120', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '90686', '104', '1', '1', '2', '11', '1', '1', '2012-05-03', '12220', '2012-05-03', '01', '2015');
--
-- 14.7 Patient has procedure with domain = measurement, measurement record created [Test ID: 73]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '122', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '122', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '82985', '104', '1', '1', '2', '11', '1', '1', '2012-05-03', '12220', '2012-05-03', '01', '2015');
--
-- 14.8 Patient has procedure with domain = observation, observation record created [Test ID: 74]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '124', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, proc1, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '124', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', 'S9368', '104', '1', '1', '2', '11', '1', '1', '2012-05-03', '12220', '2012-05-03', '01', '2015');
-- 15. Provider
--
-- 15.0 Provider in facility header table with stdprov=220, specialty = emergency medicine [Test ID: 75]
--
INSERT INTO @source_schema.facility_header (billtyp, boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, dstatus, dx1, enrolid, mas, mdc, medicare, mhsacovg, netpay, pddate, plantyp, sex, stdplac, stdprov, stdrace, svcdate, tsvcdat, version, year) VALUES ('131', '2', '0', '0.0', '0.0', '0.0', '0.0', '2007', '1', '01', 'V221 ', '127', '9', '23', '0', '1', '0.0', '2013-07-12', '2', '2', '22', '220', '1', '2014-08-01', '2014-01-31', '01', '2015');
--
-- 15.1 Provider in outpatient_services table with stdprov=285, specialty = infectious disease [Test ID: 76]
--
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, prov_id, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '129', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '128', '1', '2', '11', '285', '1', '2015-07-01', '12220', '2015-04-30', '01', '2015');
--
-- 15.2 provider in inpatient_services table with stdprov=540, specialty = cardiac surgery [Test ID: 77]
--
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, prov_id, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '131', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '130', '1', '2', '21', '540', '1', '50', '2015-02-24', '20226', '2015-02-19', '01', '2014');
--
-- 15.3 provider in long_term_care table with stdprov=22, specialty = addiction medicine [Test ID: 78]
--
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, prov_id, qty, revcode, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '133', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '132', '1', '0190', '2', '31', '22', '1', '2015-05-01', '10210', '2014-06-30', '01', '2014');
-- 16. Visit Occurrence
--
-- 16.0 Patient with visit that starts before the observation period, start date trimmed to beginning of observation period [Test ID: 79]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '134', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '135', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '134', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2011-12-05', '20226', '2012-01-06', '01', '2014');
--
-- 16.1 svcdate>tsvcdate, visit_end_date is svcdate [Test ID: 80]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '136', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '136', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-03-21', '20226', '2012-03-19', '01', '2014');
--
-- 16.2 Service falls during observation period but ends after the period ends, visit_end_date is the observation_period_end_date [Test ID: 81]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '138', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '138', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-12-30', '20226', '2013-01-08', '01', '2014');
--
-- 16.3 service in inpatient_services with revcode of 0450, visit classified as ER [Test ID: 82]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '140', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, revcode, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '140', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '0450', '2', '21', '1', '1', '50', '2012-04-12', '20226', '2012-04-12', '01', '2014');
--
-- 16.4 service in outpatient_services with revcode of 0450, visit classified as ER [Test ID: 83]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '142', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, revcode, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '142', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '0450', '2', '11', '1', '1', '2012-05-01', '12220', '2012-05-01', '01', '2015');
--
-- 16.5 service in outpatient_services with revcode of 0100, visit classified as IP [Test ID: 84]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '144', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, revcode, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '144', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '0100', '2', '11', '1', '1', '2012-10-17', '12220', '2012-10-20', '01', '2015');
--
-- 16.6 patient has two lines in the inpatient_services table where the end_date of one line and the start_date of the next >1, two visits created [Test ID: 85]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '146', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '146', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-08-08', '20226', '2012-08-12', '01', '2014');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '146', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-10-01', '20226', '2012-10-05', '01', '2014');
--
-- 16.7 Patient has an ER record that starts and ends on the first day of the IP visit, separate ER visit created [Test ID: 86]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '148', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, revcode, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '148', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '0450', '2', '21', '1', '1', '50', '2012-09-03', '20226', '2012-09-03', '01', '2014');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, revcode, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '148', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '0100', '2', '21', '1', '1', '50', '2012-09-03', '20226', '2012-09-10', '01', '2014');
--
-- 16.8 Patient has two lines in the inpatient_services table where the difference between the end_date of one line and the start_date of the next is <= 1, one visit created [Test ID: 87]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '150', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '150', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-05-15', '20226', '2012-05-16', '01', '2014');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '150', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '1', '2', '21', '1', '1', '50', '2012-05-16', '20226', '2012-05-17', '01', '2014');
--
-- 16.9 Patient has record in outpatient_services table but no rx benefits, visit dropped [Test ID: 88]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '0', '2012-12-31', '2012-01-01', '152', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.outpatient_services (boe, cap, cob, coins, copay, deduct, dental, dobyr, drugcovg, enrolid, fachdid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, procgrp, proctyp, qty, sex, stdplac, stdprov, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('2', '0', '0.0', '0.0', '0.0', '0.0', '0', '2006', '1', '152', '153', 'P', '9', '23', '0', '1', '0.0', '0.0', '2014-05-28', '2', '104', '1', '1', '2', '11', '1', '1', '2012-01-06', '12220', '2012-01-06', '01', '2015');
--
-- 16.10 Patient has two records in the same visit with different prov_id and provstd [Test ID: 89]
--
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '154', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, prov_id, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '154', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '156', '1', '2', '21', '220', '1', '50', '2012-08-08', '20226', '2012-08-12', '01', '2014');
INSERT INTO @source_schema.inpatient_services (admdate, admtyp, boe, cap, caseid, cob, coins, copay, deduct, disdate, dobyr, drg, drugcovg, dstatus, dx1, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, pdx, plantyp, prov_id, qty, sex, stdplac, stdprov, stdrace, stdsvc, svcdate, svcscat, tsvcdat, version, year) VALUES ('2015-04-08', '2', '2', '0', '532786', '0.0', '0.0', '0.0', '0.0', '2015-02-27', '2014', '775', '1', '01', 'V3000 ', '154', 'F', '9', '14', '0', '1', '0.0', '0.0', '2015-03-31', 'V3000 ', '2', '157', '1', '2', '21', '540', '1', '50', '2012-08-08', '20226', '2012-08-12', '01', '2014');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '158', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 16.11 Patient has two LTC claims where the end_date of the first is within one day of the start_date of the second, one visit created [Test ID: 90]
--
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '158', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '1', '0190', '2', '31', '1', '2012-06-18', '10210', '2012-06-30', '01', '2012');
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '158', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '1', '0190', '2', '31', '1', '2012-07-01', '10210', '2012-07-31', '01', '2012');
INSERT INTO @source_schema.enrollment_detail (boe, cap, dobyr, drugcovg, dtend, dtstart, enrolid, mas, medicare, memdays, mhsacovg, plantyp, sex, stdrace, version, year) VALUES ('4', '1', '2006', '1', '2012-12-31', '2012-01-01', '160', '9', '0', '31', '0', '4', '2', '1', '01', '2015');
--
-- 16.12 Patient has LTC claim where the end_date = the start_date [Test ID: 91]
--
INSERT INTO @source_schema.long_term_care (boe, cap, cob, coins, copay, deduct, dobyr, drugcovg, enrolid, facprof, mas, mdc, medicare, mhsacovg, netpay, pay, pddate, plantyp, qty, revcode, sex, stdplac, stdrace, svcdate, svcscat, tsvcdat, version, year) VALUES ('1', '0', '0.0', '0.0', '0.0', '0.0', '1925', '0', '160', 'F', '9', '01', '1', '1', '0.0', '0.0', '2010-08-30', '2', '1', '0190', '2', '31', '1', '2012-08-03', '10210', '2012-08-03', '01', '2012'); |
-- Revert nz-buildings:buildings_bulk_load/functions/load_to_production from pg
BEGIN;
DROP FUNCTION buildings_bulk_load.load_building_outlines(integer);
COMMIT;
|
-- @author prabhd
-- @created 2012-12-05 12:00:00
-- @modified 2012-12-05 12:00:00
-- @tags dml
-- @db_name dmldb
-- @description update_test20: Negative test - Update WHERE join returns more than one tuple with different values.
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
SELECT SUM(a) FROM dml_heap_pt_v;
UPDATE dml_heap_pt_v SET a = dml_heap_pt_u.a FROM dml_heap_pt_u WHERE dml_heap_pt_u.b = dml_heap_pt_v.b;
SELECT SUM(a) FROM dml_heap_pt_v;
|
-- phpMyAdmin SQL Dump
-- version 4.0.10.12
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2017-10-18 17:06:24
-- 服务器版本: 5.1.73
-- PHP 版本: 5.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: `person`
--
-- --------------------------------------------------------
--
-- 表的结构 `tp_admin`
--
CREATE TABLE IF NOT EXISTS `tp_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL COMMENT '用户名',
`password` varchar(32) NOT NULL COMMENT '<PASSWORD>',
`creattime` text NOT NULL COMMENT '创建时间',
`lasttime` text NOT NULL COMMENT '登陆时间',
`img` text NOT NULL COMMENT '头像',
`phone` text NOT NULL COMMENT '手机号码',
`token` text COMMENT '令牌',
`tokentime` int(11) DEFAULT NULL COMMENT '令牌时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理者表' AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tp_admin`
--
INSERT INTO `tp_admin` (`id`, `name`, `password`, `creattime`, `lasttime`, `img`, `phone`, `token`, `tokentime`) VALUES
(1, 'dzx', '<PASSWORD>', '1496465483', '1506675734', '1496979855.png', '15812671184', 'f5d59185f76952a8763565a87339ba39', 1506762134),
(2, 'hzx', 'a6c80bf3483f98956b93e0be73b12170', '1496465601', '1508293233', '1504853734.jpg', '13609615061', 'fa693392e3b5e4ece17a07a7222ad716', 1508379633);
-- --------------------------------------------------------
--
-- 表的结构 `tp_admingj`
--
CREATE TABLE IF NOT EXISTS `tp_admingj` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '管理员ID',
`creattime` text NOT NULL COMMENT '创建时间',
`imgtime` text NOT NULL COMMENT '发表照片时间',
`filetime` text NOT NULL COMMENT '发表文章时间',
`logintime` text NOT NULL COMMENT '最近登陆时间',
`remesstime` text NOT NULL COMMENT '回复留言时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员轨迹' AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tp_admingj`
--
INSERT INTO `tp_admingj` (`id`, `uid`, `creattime`, `imgtime`, `filetime`, `logintime`, `remesstime`) VALUES
(1, 1, '1496465483', '1506675827', '1503555856', '1506675734', '1503467993'),
(2, 2, '1496465601', '1507619618', '1504144007', '1508293233', '1504143383');
-- --------------------------------------------------------
--
-- 表的结构 `tp_adminlogin`
--
CREATE TABLE IF NOT EXISTS `tp_adminlogin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '管理员ID',
`jan` int(11) NOT NULL DEFAULT '0' COMMENT '一月总数',
`feb` int(11) NOT NULL DEFAULT '0' COMMENT '二月总数',
`mar` int(11) NOT NULL DEFAULT '0' COMMENT '三月总数',
`apr` int(11) NOT NULL DEFAULT '0' COMMENT '四月总数',
`may` int(11) NOT NULL DEFAULT '0' COMMENT '五月总数',
`jun` int(11) NOT NULL DEFAULT '0' COMMENT '六月总数',
`jul` int(11) NOT NULL DEFAULT '0' COMMENT '七月总数',
`aug` int(11) NOT NULL DEFAULT '0' COMMENT '八月总数',
`sep` int(11) NOT NULL DEFAULT '0' COMMENT '九月总数',
`oct` int(11) NOT NULL DEFAULT '0' COMMENT '十月总数',
`nov` int(11) NOT NULL DEFAULT '0' COMMENT '十一月总数',
`dec` int(11) NOT NULL DEFAULT '0' COMMENT '十二月总数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员个人登录' AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tp_adminlogin`
--
INSERT INTO `tp_adminlogin` (`id`, `uid`, `jan`, `feb`, `mar`, `apr`, `may`, `jun`, `jul`, `aug`, `sep`, `oct`, `nov`, `dec`) VALUES
(1, 1, 1, 0, 0, 1, 1, 22, 0, 34, 3, 0, 0, 0),
(2, 2, 0, 1, 0, 0, 0, 1, 1, 9, 21, 19, 0, 0);
-- --------------------------------------------------------
--
-- 表的结构 `tp_album`
--
CREATE TABLE IF NOT EXISTS `tp_album` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL COMMENT '相册名',
`tid` int(11) NOT NULL COMMENT '分类ID',
`img` text NOT NULL COMMENT '图片路径',
`imgwidth` int(11) NOT NULL DEFAULT '1' COMMENT '照片形式 1:竖屏,2:横屏,3正方 ',
`status` int(11) NOT NULL DEFAULT '1' COMMENT '相册状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='相册表' AUTO_INCREMENT=20 ;
--
-- 转存表中的数据 `tp_album`
--
INSERT INTO `tp_album` (`id`, `name`, `tid`, `img`, `imgwidth`, `status`) VALUES
(10, 'LOVE', 3, '045613.jpg', 1, 1),
(11, '节日', 5, '030403.jpg', 2, 1),
(14, '欢乐谷', 7, '1506757222.jpg', 1, 1),
(15, 'Sweet Lovers', 6, '030532.jpg', 2, 1),
(16, '文谷', 7, '103342.JPG', 1, 1),
(17, '荷兰花卉小镇', 7, '104037.JPG', 1, 1),
(18, 'Eternal love', 6, '113757.jpg', 1, 1),
(19, 'Miss', 6, '031208.jpg', 3, 1);
-- --------------------------------------------------------
--
-- 表的结构 `tp_articleimg`
--
CREATE TABLE IF NOT EXISTS `tp_articleimg` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`imgurl` text NOT NULL COMMENT '图片地址',
`type` text NOT NULL COMMENT '类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='暂时存放' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `tp_articleimg`
--
INSERT INTO `tp_articleimg` (`id`, `imgurl`, `type`) VALUES
(1, 'noimg.jpg', 'article');
-- --------------------------------------------------------
--
-- 表的结构 `tp_articlemon`
--
CREATE TABLE IF NOT EXISTS `tp_articlemon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`month` text NOT NULL COMMENT '月份',
`count` int(255) NOT NULL COMMENT '数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
--
-- 转存表中的数据 `tp_articlemon`
--
INSERT INTO `tp_articlemon` (`id`, `month`, `count`) VALUES
(1, 'jan', 0),
(2, 'feb', 0),
(3, 'mar', 0),
(4, 'apr', 0),
(5, 'may', 0),
(6, 'jun', 10),
(7, 'jul', 0),
(8, 'aug', 39),
(9, 'sep', 9),
(10, 'otc', 0),
(11, 'nov', 0),
(12, 'dec', 0);
-- --------------------------------------------------------
--
-- 表的结构 `tp_file`
--
CREATE TABLE IF NOT EXISTS `tp_file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`filename` text NOT NULL COMMENT '文章名称',
`content` text NOT NULL COMMENT '内容',
`img` text NOT NULL COMMENT '封面',
`describe` text NOT NULL COMMENT '描述',
`author` int(11) NOT NULL COMMENT '作者',
`publishtime` text NOT NULL COMMENT '发表时间',
`creattime` text NOT NULL COMMENT '修改时间',
`status` int(11) NOT NULL COMMENT '状态',
`fid` int(11) NOT NULL COMMENT '文章类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章表' AUTO_INCREMENT=11 ;
--
-- 转存表中的数据 `tp_file`
--
INSERT INTO `tp_file` (`id`, `filename`, `content`, `img`, `describe`, `author`, `publishtime`, `creattime`, `status`, `fid`) VALUES
(3, 'Aenean feugiat in ante et blandit', 'Aenean feugiat in ante et blandit. Vestibulum posuere molestie risus, ac interdum magna porta non. Pellentesque rutrum fringilla elementum. Curabitur tincidunt porta lorem vitae accumsan.Aenean feugiat in ante et blandit. Vestibulum posuere molestie risus, ac interdum magna porta non.ac interdum magna porta non. Pellentesque rutrum fringilla elementum. Curabitur tincidunt porta lorem vitae accumsan ', '1496910912.jpg', 'Aenean feugiat in ante et blandit. Vestibulum posuere molestie risus, ac interdum magna porta non', 1, '1496819317', '1496910915', 1, 1),
(4, 'Lorem ipsum dolor sit amet', '<p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Consetetur sadipscing elitr, sed diam nonumy eirmod tempor inviduntut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.justo duo dolores et ea rebum. Consetetur sadipscing elitr, consetetur sadipscing elitr elitr. </p>', '1496830056.jpg', 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', 1, '1496819365', '1502848899', 1, 2),
(7, '上线一周', '<p>上线一周</p>', '1503469663.jpg', '上线一周', 1, '1503469669', ' ', 0, 1),
(9, '七夕情人节', '<p> 今天是中国传统的情人节,属于我们的第一个七夕节,也是我们结束异地后的第一个情人节,I LOVE YOU,香香,爱你的小汤圆。感谢你一路以来的支持与包容,我很幸运,因为你带给我的总是快乐与幸福,谢谢你的这一切付出,我也不会让你的付出白白浪费,我会努力创造属于我们彼此的幸福,让你做一个幸福的姑娘,带给你欢乐与幸福,香香,我爱你,七夕节快乐,属于我们的节日!<br/></p><p><br/></p>', '1503885621.jpg', '好想朝朝暮暮,更想天长地久', 1, '1503885821', '1504172068', 1, 1),
(10, '我与香香的日常', '<p> 每天醒来第一件事就是互道早安,一起收能量。吃过早饭之后,我便来到你住的公寓,看你吃早餐,帮忙看看哪些没有带上的(你就是这么一个不让人省心的孩子,但我喜欢替你安排妥当)。吃过早餐之后,我们便开始上班的开始,我们总是习惯坐到总站,然后再坐去公司,你每天在地铁上基本就是睡觉,你习惯性的靠着我的肩膀睡,我也喜欢你靠着我的肩膀睡。我总是故意坐过几个站,然后再坐回去,只为多陪伴你一会。</p><p> 每天下班,我总会提前在大运地铁站等你的到来,然后一起下班回家吃饭,吃过晚饭之后,我们也会出去逛逛街,享受晚上两人的独处时间,回到你住的地方,我总会等你洗完澡,给你洗衣服,这种状况,已经持续了几个月的时间,我也能为你洗衣服感到很幸福,因为可以为自己喜欢的姑娘的洗衣服,也是一种幸福。</p><p> 我们也会在晚上睡觉前通通视频,谈谈心,有时候你也会被我的逗逼所逗笑,每当看到你的笑容,我都会很开心,因为你开心,我便感到莫名的欢喜。这样使我们彼此的感情更加的稳定与牢固,这便是我们每天的基本日常,即是那么的简单,又是那么的开心。</p>', '1504143483.jpg', '两个人在一起是最甜蜜的时光,两个人在一起总会产生矛盾,关键在于我们两个人怎么去解决,怎么去面对', 1, '1504144007', '1504172093', 1, 1);
-- --------------------------------------------------------
--
-- 表的结构 `tp_filetype`
--
CREATE TABLE IF NOT EXISTS `tp_filetype` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` text NOT NULL COMMENT '文章分类名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章分类表' AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tp_filetype`
--
INSERT INTO `tp_filetype` (`id`, `type`) VALUES
(1, '心情'),
(2, '游玩');
-- --------------------------------------------------------
--
-- 表的结构 `tp_footervideo`
--
CREATE TABLE IF NOT EXISTS `tp_footervideo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`video` text NOT NULL COMMENT '视频地址',
`type` text NOT NULL COMMENT '类型',
`creattime` int(11) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='视频展示表' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `tp_footervideo`
--
INSERT INTO `tp_footervideo` (`id`, `video`, `type`, `creattime`) VALUES
(1, '025449.mp4', 'video', 0);
-- --------------------------------------------------------
--
-- 表的结构 `tp_img`
--
CREATE TABLE IF NOT EXISTS `tp_img` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`img` text NOT NULL COMMENT '图片地址',
`describe` text NOT NULL COMMENT '描述',
`tid` int(11) NOT NULL COMMENT '分类ID',
`aid` int(11) NOT NULL COMMENT '相册ID',
`imgwidth` int(11) NOT NULL DEFAULT '1' COMMENT '照片形式 1:竖屏,2:横屏 ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='图片表' AUTO_INCREMENT=117 ;
--
-- 转存表中的数据 `tp_img`
--
INSERT INTO `tp_img` (`id`, `img`, `describe`, `tid`, `aid`, `imgwidth`) VALUES
(15, '045638.jpg', 'LOVE', 3, 10, 1),
(16, '045649.jpg', 'LOVE', 3, 10, 1),
(17, '045702.jpg', 'LOVE', 3, 10, 1),
(18, '045715.jpg', 'LOVE', 3, 10, 1),
(19, '092048.jpg', '七夕情人节', 5, 11, 2),
(49, '050232.jpg', '', 7, 14, 1),
(50, '050347.jpg', '', 7, 14, 1),
(56, '053410.jpg', 'LOVE', 6, 15, 1),
(59, '053444.jpg', 'LOVE', 6, 15, 1),
(60, '045405.jpeg', 'LOVE', 6, 15, 2),
(61, '053458.jpg', 'LOVE', 6, 15, 1),
(62, '053506.jpg', 'LOVE', 6, 15, 1),
(63, '045318.jpg', 'LOVE', 6, 15, 2),
(64, '045300.jpg', 'LOVE', 6, 15, 2),
(65, '045236.jpg', 'LOVE', 6, 15, 2),
(66, '045215.jpg', 'LOVE', 6, 15, 2),
(67, '045154.jpg', 'LOVE', 6, 15, 2),
(68, '045132.jpg', 'LOVE', 6, 15, 2),
(69, '045107.jpg', 'LOVE', 6, 15, 2),
(70, '045030.jpg', 'LOVE', 6, 15, 2),
(71, '044935.jpg', 'LOVE', 6, 15, 2),
(72, '043240.jpg', '国庆节快乐', 5, 11, 1),
(74, '103609.JPG', '文谷', 7, 16, 1),
(75, '103624.JPG', '文谷', 7, 16, 1),
(76, '044216.JPG', '文谷', 7, 16, 2),
(78, '044151.JPG', '文谷', 7, 16, 2),
(79, '103738.JPG', '文谷', 7, 16, 1),
(80, '103751.JPG', '文谷', 7, 16, 1),
(81, '103804.JPG', '文谷', 7, 16, 1),
(83, '103916.JPG', '文谷', 7, 16, 1),
(84, '044513.JPG', '荷兰花卉小镇', 7, 17, 2),
(85, '104108.JPG', '荷兰花卉小镇', 7, 17, 1),
(86, '104124.JPG', '荷兰花卉小镇', 7, 17, 1),
(87, '104140.JPG', '荷兰花卉小镇', 7, 17, 1),
(88, '104152.JPG', '荷兰花卉小镇', 7, 17, 1),
(89, '104203.JPG', '荷兰花卉小镇', 7, 17, 1),
(90, '104214.JPG', '荷兰花卉小镇', 7, 17, 1),
(91, '044449.JPG', '荷兰花卉小镇', 7, 17, 2),
(93, '044326.JPG', '文谷', 7, 16, 2),
(94, '044344.JPG', '文谷', 7, 16, 1),
(95, '044400.JPG', '文谷', 7, 16, 1),
(96, '044418.JPG', '文谷', 7, 16, 2),
(97, '092024.jpg', '中秋', 5, 11, 2),
(98, '113816.jpg', 'LOVE', 6, 18, 3),
(99, '113849.jpg', 'LOVE', 6, 18, 3),
(100, '113904.jpg', 'LOVE', 6, 18, 3),
(101, '113922.jpg', 'LOVE', 6, 18, 2),
(102, '113936.jpg', 'LOVE', 6, 18, 2),
(103, '113947.jpg', 'LOVE', 6, 18, 3),
(104, '113957.jpg', 'LOVE', 6, 18, 2),
(105, '114007.jpg', 'LOVE', 6, 18, 3),
(106, '114017.jpg', 'LOVE', 6, 18, 3),
(107, '031220.jpg', 'Miss', 6, 19, 3),
(108, '031228.jpg', 'Miss', 6, 19, 3),
(109, '031237.jpg', 'Miss', 6, 19, 3),
(110, '031247.jpg', 'Miss', 6, 19, 3),
(112, '031308.jpg', 'Miss', 6, 19, 3),
(113, '031316.jpg', 'Miss', 6, 19, 3),
(114, '031323.jpg', 'Miss', 6, 19, 3),
(115, '031331.jpg', 'Miss', 6, 19, 3),
(116, '031338.jpg', 'Miss', 6, 19, 3);
-- --------------------------------------------------------
--
-- 表的结构 `tp_imgtype`
--
CREATE TABLE IF NOT EXISTS `tp_imgtype` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` text NOT NULL COMMENT '分类',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='图片分类表' AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tp_imgtype`
--
INSERT INTO `tp_imgtype` (`id`, `type`) VALUES
(3, '花'),
(5, '节日'),
(6, 'LOVE'),
(7, '旅行记');
-- --------------------------------------------------------
--
-- 表的结构 `tp_kprecord`
--
CREATE TABLE IF NOT EXISTS `tp_kprecord` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`titlefrist` text NOT NULL COMMENT '第一段',
`titletwo` text NOT NULL COMMENT '第二段',
`type` varchar(126) NOT NULL COMMENT '类型',
`creattime` int(11) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='网站底部备案字段' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `tp_kprecord`
--
INSERT INTO `tp_kprecord` (`id`, `titlefrist`, `titletwo`, `type`, `creattime`) VALUES
(1, '© DZX', '粤ICP备17107450号', 'footer', 1503554659);
-- --------------------------------------------------------
--
-- 表的结构 `tp_loginip`
--
CREATE TABLE IF NOT EXISTS `tp_loginip` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`login_ip` varchar(256) DEFAULT NULL COMMENT '访问IP地址',
`login_city` varchar(256) DEFAULT NULL COMMENT '访问城市',
`login_user` varchar(256) DEFAULT NULL COMMENT '访问者姓名',
`operation_url` varchar(256) DEFAULT NULL COMMENT '访问操作',
`create_at` int(11) DEFAULT '0' COMMENT '访问时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='访问统计记录表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `tp_lognum`
--
CREATE TABLE IF NOT EXISTS `tp_lognum` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mon` text NOT NULL COMMENT '月份',
`count` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户访问数' AUTO_INCREMENT=13 ;
--
-- 转存表中的数据 `tp_lognum`
--
INSERT INTO `tp_lognum` (`id`, `mon`, `count`) VALUES
(1, '01', 0),
(2, '02', 0),
(3, '03', 0),
(4, '04', 0),
(5, '05', 1),
(6, '06', 6),
(7, '07', 0),
(8, '08', 20),
(9, '09', 4),
(10, '10', 0),
(11, '11', 0),
(12, '12', 0);
-- --------------------------------------------------------
--
-- 表的结构 `tp_lunbo`
--
CREATE TABLE IF NOT EXISTS `tp_lunbo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`img` text NOT NULL COMMENT '图片地址',
`content` text NOT NULL COMMENT '图片描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='轮播表' AUTO_INCREMENT=10 ;
--
-- 转存表中的数据 `tp_lunbo`
--
INSERT INTO `tp_lunbo` (`id`, `img`, `content`) VALUES
(2, '122148.jpg', 'I LOVE YOU'),
(3, '122155.jpg', 'This is My Love'),
(4, '122202.jpg', 'Hold your hand and grow old together with you'),
(5, '122209.jpg', 'I LOVE YOU'),
(6, '122216.jpg', 'Eternal love'),
(7, '122225.jpg', 'Love you with my whole life'),
(8, '122247.jpg', 'Sweetheart'),
(9, '122319.jpg', 'Is My LOVE');
-- --------------------------------------------------------
--
-- 表的结构 `tp_message`
--
CREATE TABLE IF NOT EXISTS `tp_message` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '留着者ID',
`content` text NOT NULL COMMENT '留言内容',
`creattime` text NOT NULL COMMENT '留言时间',
`status` int(11) NOT NULL DEFAULT '2' COMMENT '1:已回复 2:未回复',
`biaozhi` int(11) NOT NULL DEFAULT '1' COMMENT '标志(1:正常;2:垃圾箱;)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='留言表' AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tp_message`
--
INSERT INTO `tp_message` (`id`, `uid`, `content`, `creattime`, `status`, `biaozhi`) VALUES
(1, 2, '测速!', '1496990738', 1, 1),
(2, 3, '测试', '1496990738', 1, 1),
(3, 3, '<p>我来了</p>', '1497315571', 1, 1),
(4, 5, '你好!', '1497583133', 1, 1),
(5, 5, '你好!', '1503300494', 1, 1),
(6, 5, '嘿嘿!', '1503300586', 1, 1),
(7, 5, '假期前期,怀揣着归家的心与不舍', '1506671832', 2, 1);
-- --------------------------------------------------------
--
-- 表的结构 `tp_pinglun`
--
CREATE TABLE IF NOT EXISTS `tp_pinglun` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fid` int(11) NOT NULL COMMENT '文章ID',
`uid` int(11) NOT NULL COMMENT '用户ID',
`content` text NOT NULL COMMENT '评论内容',
`time` text NOT NULL COMMENT '评论时间',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '评论浏览状态',
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评论表' AUTO_INCREMENT=4 ;
--
-- 转存表中的数据 `tp_pinglun`
--
INSERT INTO `tp_pinglun` (`id`, `fid`, `uid`, `content`, `time`, `status`) VALUES
(1, 4, 5, '<p>英文好难看懂</p>', '1497580972', 1),
(2, 4, 5, '<p>英文好高大上</p>', '1497597748', 1),
(3, 3, 5, '<p>哇,占个楼先</p>', '1497598211', 1);
-- --------------------------------------------------------
--
-- 表的结构 `tp_readartcle`
--
CREATE TABLE IF NOT EXISTS `tp_readartcle` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rjid` int(11) NOT NULL COMMENT '日记ID',
`reader` int(255) NOT NULL DEFAULT '0' COMMENT '浏览总数',
`thumbs` int(255) NOT NULL DEFAULT '0' COMMENT '点赞数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日记附属表' AUTO_INCREMENT=9 ;
--
-- 转存表中的数据 `tp_readartcle`
--
INSERT INTO `tp_readartcle` (`id`, `rjid`, `reader`, `thumbs`) VALUES
(1, 3, 25, 1),
(2, 4, 92, 0),
(5, 7, 0, 0),
(7, 9, 6, 0),
(8, 10, 7, 2);
-- --------------------------------------------------------
--
-- 表的结构 `tp_remessage`
--
CREATE TABLE IF NOT EXISTS `tp_remessage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mid` int(11) NOT NULL COMMENT '留言ID',
`uid` int(11) NOT NULL COMMENT '留言者ID',
`aid` int(11) NOT NULL COMMENT '管理员ID',
`content` text NOT NULL COMMENT '回复内容',
`creattime` text NOT NULL COMMENT '回复时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='回复留言表' AUTO_INCREMENT=18 ;
--
-- 转存表中的数据 `tp_remessage`
--
INSERT INTO `tp_remessage` (`id`, `mid`, `uid`, `aid`, `content`, `creattime`) VALUES
(1, 1, 0, 1, '你好,感谢你的留言', '1497250437'),
(2, 1, 2, 0, '没想到你会回复我!', '1497253501'),
(3, 1, 0, 1, '是啊,惊不惊喜,意不意外', '1497254253'),
(4, 1, 0, 1, '<p><img src="http://img.baidu.com/hi/jx2/j_0057.gif"/></p>', '1497254334'),
(5, 1, 0, 1, '<p>嘿嘿!<br/></p>', '1497314848'),
(6, 2, 0, 1, '<p>嘿嘿!</p>', '1497314870'),
(7, 1, 0, 1, '<p><img src="http://img.baidu.com/hi/jx2/j_0068.gif"/></p>', '1497315204'),
(9, 2, 3, 0, '<p>哈喽</p>', '1497323062'),
(10, 2, 0, 1, '<p>你好呀</p>', '1497323073'),
(11, 2, 3, 0, '<p><img src="http://img.baidu.com/hi/jx2/j_0067.gif"/></p>', '1497323178'),
(12, 2, 3, 0, '<p>哈哈</p>', '1497324114'),
(13, 1, 0, 1, '<p>嘿嘿</p>', '1502849438'),
(14, 3, 0, 1, '<p>好哒</p>', '1502849463'),
(15, 4, 0, 1, '<p>嘿嘿</p>', '1503467993'),
(16, 5, 0, 2, '<p>欢迎欢迎</p>', '1504143376'),
(17, 6, 0, 2, '<p>哈喽!!!</p>', '1504143383');
-- --------------------------------------------------------
--
-- 表的结构 `tp_sms`
--
CREATE TABLE IF NOT EXISTS `tp_sms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` text NOT NULL COMMENT 'token',
`account` text NOT NULL COMMENT 'access',
`content` text NOT NULL COMMENT '模版内容',
`type` text NOT NULL COMMENT '类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信验证码表' AUTO_INCREMENT=2 ;
--
-- 转存表中的数据 `tp_sms`
--
INSERT INTO `tp_sms` (`id`, `token`, `account`, `content`, `type`) VALUES
(1, '2c757955d66b47d0839bdae46cc8b1a8', 'aa93642712c54c25950cb12f858873ff', '【我的空间】打死都不要告诉别人你的验证码是:', 'sms');
-- --------------------------------------------------------
--
-- 表的结构 `tp_theme`
--
CREATE TABLE IF NOT EXISTS `tp_theme` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`vid` int(11) NOT NULL COMMENT '分类ID',
`name` text NOT NULL COMMENT '主题名称',
`img` text NOT NULL COMMENT '照片封面',
`status` int(11) NOT NULL COMMENT '状态(1:公开,0:保密)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='视频主题表' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `tp_title`
--
CREATE TABLE IF NOT EXISTS `tp_title` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text NOT NULL COMMENT '标题名称',
`type` text NOT NULL COMMENT '类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网站标题' AUTO_INCREMENT=3 ;
--
-- 转存表中的数据 `tp_title`
--
INSERT INTO `tp_title` (`id`, `title`, `type`) VALUES
(1, '小汤圆快到碗里来', 'top'),
(2, 'My love is you,!', 'footer');
-- --------------------------------------------------------
--
-- 表的结构 `tp_user`
--
CREATE TABLE IF NOT EXISTS `tp_user` (
`id` int(120) NOT NULL AUTO_INCREMENT,
`password` text NOT NULL COMMENT '密码',
`creattime` text NOT NULL COMMENT '创建时间',
`img` text NOT NULL COMMENT '头像',
`phone` text NOT NULL COMMENT '手机号',
`status` int(11) NOT NULL DEFAULT '1' COMMENT '状态',
`lasttime` text NOT NULL COMMENT '最近登陆时间',
`groupid` int(120) NOT NULL COMMENT '用户分组',
`username` varchar(32) NOT NULL COMMENT '用户名',
`token` text COMMENT '令牌',
`tokentime` int(11) DEFAULT '0' COMMENT '令牌时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tp_user`
--
INSERT INTO `tp_user` (`id`, `password`, `creattime`, `img`, `phone`, `status`, `lasttime`, `groupid`, `username`, `token`, `tokentime`) VALUES
(2, '<PASSWORD>', '<PASSWORD>', '2.jpg', '13609615063', 1, ' 1496710136', 2, 'user03', NULL, 0),
(3, '<PASSWORD>', '1496655008', 'user.png', ' 15223365478', 0, ' 1494645071', 1, 'user01', '68f8d3378e1b0a1ed456c1992556b445', 1503741715),
(4, '11f5926e6608cdc<PASSWORD>bb0859', '1496882028', 'user.png', ' ', 1, ' ', 1, 'user02', NULL, 0),
(5, 'df29c6a28ab2cb0e393c1705eb4850a5', '1496892895', '5.jpg', ' ', 1, ' ', 1, 'dzx', 'a05365389928bfe1d2e15c3c75d03c76', 1506759251),
(6, 'ea083fa621ecbe224dc2707bf35c2655', '1497926000', 'user.png', '13609615061', 1, '', 1, 'user', NULL, 0),
(7, 'c114023bc43214a287c7e7c1a3d9403d', '1503652918', 'user.png', '15992259745', 1, '', 1, '慢慢没发现', NULL, 0);
-- --------------------------------------------------------
--
-- 表的结构 `tp_usergroup`
--
CREATE TABLE IF NOT EXISTS `tp_usergroup` (
`id` int(120) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL COMMENT '名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户组表' AUTO_INCREMENT=4 ;
--
-- 转存表中的数据 `tp_usergroup`
--
INSERT INTO `tp_usergroup` (`id`, `name`) VALUES
(1, '普通用户'),
(2, '亲密用户'),
(3, '其他用户');
-- --------------------------------------------------------
--
-- 表的结构 `tp_variable`
--
CREATE TABLE IF NOT EXISTS `tp_variable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text NOT NULL COMMENT '标题',
`caption` varchar(128) NOT NULL COMMENT '描述',
`type` text NOT NULL COMMENT '类型',
`creattime` int(11) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='变量表' AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `tp_variable`
--
INSERT INTO `tp_variable` (`id`, `title`, `caption`, `type`, `creattime`) VALUES
(1, '相册', '甜蜜的日常', 'image', 1503383511),
(2, '日记', '关于我们的点点滴滴', 'filetype', 1503383511),
(3, '美好的时光', '小汤圆快到碗里来', 'videotype', 1503383511),
(4, '我的留言', '时间轴', 'messagetype', 1503383511),
(5, 'Belong to our love', 'Record our sweet and mundane bits and pieces, and gather these bits and pieces into love forever.', 'indextop', 1503383511),
(6, '甜蜜的记忆', '岁月是那么的短暂 & 但有你却是那么的漫长.', 'indexbanner', 1503383511),
(7, '美好 时光', '有你在的每一分每一秒都是那么的甜蜜. <br> 遇上你是我的荣幸 LOVE ', 'indexfooter', 1503383511);
-- --------------------------------------------------------
--
-- 表的结构 `tp_video`
--
CREATE TABLE IF NOT EXISTS `tp_video` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL COMMENT '名称',
`describe` text NOT NULL COMMENT '描述',
`tid` int(11) NOT NULL COMMENT '分类ID',
`vid` int(11) NOT NULL COMMENT '主题ID',
`video` text NOT NULL COMMENT '视频',
`time` text NOT NULL COMMENT '发表时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='视频表' AUTO_INCREMENT=5 ;
--
-- 转存表中的数据 `tp_video`
--
INSERT INTO `tp_video` (`id`, `name`, `describe`, `tid`, `vid`, `video`, `time`) VALUES
(3, '狗狗', '狗狗', 4, 7, '051050.mp4', '1497601396'),
(4, '狗狗', '狗狗', 4, 7, '051114.mp4', '1497601416');
-- --------------------------------------------------------
--
-- 表的结构 `tp_videtype`
--
CREATE TABLE IF NOT EXISTS `tp_videtype` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL COMMENT '分类名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='视频分类表' AUTO_INCREMENT=7 ;
--
-- 转存表中的数据 `tp_videtype`
--
INSERT INTO `tp_videtype` (`id`, `name`) VALUES
(5, '游玩'),
(6, 'LOVE');
/*!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 DATETIMETZ from without DEFAULT/constraints to with DEFAULT/constraints, strict no
set system parameters 'alter_table_change_type_strict=no';
drop table if exists tz;
create table tz(
id int,
c_dttz1 datetime with time zone,
c_dttz2 datetime with time zone,
c_dttz3 datetime with time zone,
c_dttz4 datetime with time zone,
c_dttz5 datetime with time zone,
c_dttz6 datetime with time zone
);
insert into tz values(1, '2014-07-01 18:00:00.789 -6:00', '2014-07-01 18:00:00.789 -6:00', '2014-07-01 18:00:00.789 -6:00','2014-07-01 18:00:00.789 -6:00', null, null);
insert into tz values(2, null, '2014-07-01 18:00:00.789 -6:00', '2014-07-01 18:00:00.789 -5:00','2014-07-01 18:00:00.789 -5:00', '2014-07-01 18:00:00.789 -6:00', null);
insert into tz values(3, '2014-07-01 18:00:00.789 -6:00', null, '2014-07-01 18:00:00.789 -4:00','2014-07-01 19:00:00.789 -4:00', '2014-07-01 18:00:00.789 -6:00', null);
insert into tz values(4, '2014-07-01 18:00:00.789 -6:00', '2014-07-01 18:00:00.789 -6:00', '2014-07-01 18:00:00.789 -3:00', null, '2014-07-01 18:00:00.789 -6:00', null);
--test: not null
alter table tz change c_dttz1 c_dttz11 datetime with time zone not null;
desc tz;
select * from tz order by 1, 2, 3, 4, 5;
--test: default
alter table tz change c_dttz2 c_dttz22 datetime with time zone default now();
desc tz;
select * from tz order by 1, 2, 3, 4, 5;
--test: unique
alter table tz change c_dttz3 c_dttz33 datetime with time zone unique;
show columns in tz;
select * from tz order by 1, 2, 3, 4, 5;
--test: pk
alter table tz change c_dttz4 c_dttz44 datetime with time zone primary key;
show columns in tz;
select * from tz order by 1, 2, 3, 4, 5;
--test: not null + defualt
alter table tz change c_dttz5 c_dttz55 datetime with time zone not null default '2000-10-10 10:10:10 +00:00';
show full columns in tz;
select * from tz order by 1, 2, 3, 4, 5;
--test: [er] unique + not null + default
alter table tz change c_dttz6 c_dttz66 datetime with time zone default '2000-10-10 10:10:10 +00:00' unique not null;
--test: not null + defualt
alter table tz change c_dttz6 c_dttz66 datetime with time zone default '2000-10-10 10:10:10 +00:00' not null;
show full columns in tz;
select * from tz order by 1, 2, 3, 4, 5;
drop table tz;
|
<filename>Test & DB/group11.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 27, 2017 at 07:58 PM
-- Server version: 5.7.17-log
-- PHP Version: 7.0.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `group11`
--
-- --------------------------------------------------------
--
-- Table structure for table `donate`
--
CREATE TABLE `donate` (
`donate_id` int(11) NOT NULL,
`donate_name` varchar(45) NOT NULL,
`donate_description` varchar(200) DEFAULT NULL,
`donate_detail` varchar(100) DEFAULT NULL,
`donate_date` datetime DEFAULT NULL,
`donate_height` varchar(45) DEFAULT NULL,
`donate_length` varchar(45) DEFAULT NULL,
`donate_width` varchar(45) DEFAULT NULL,
`donate_weight` varchar(45) DEFAULT NULL,
`donate_amount` varchar(45) DEFAULT NULL,
`donate_image` varchar(45) DEFAULT NULL,
`donatetype_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `donate`
--
INSERT INTO `donate` (`donate_id`, `donate_name`, `donate_description`, `donate_detail`, `donate_date`, `donate_height`, `donate_length`, `donate_width`, `donate_weight`, `donate_amount`, `donate_image`, `donatetype_id`, `user_id`) VALUES
(1, 'name', 'description', 'detail', '2017-03-24 14:14:38', NULL, NULL, NULL, 'weight', 'amount', 'WS201490361278', 5, 20),
(2, 'name', 'description', 'detail', '2017-03-24 14:20:32', NULL, NULL, NULL, 'weight', 'amount', 'WS201490361632.gif', 6, 20),
(3, 'น่ารัก', 'descriptionมาก', 'detail', '2017-03-24 14:28:18', NULL, NULL, NULL, 'weight', 'amount', 'WS201490362098.jpg', 6, 20),
(4, 'เย้ๆ', 'รายละเอียด', 'รักเลย', '2017-03-24 15:17:03', NULL, NULL, NULL, 'บวก', 'ง่อว', 'WS201490365023.jpg', 6, 20),
(5, 'name', 'description', 'detail', '2017-03-24 15:21:24', NULL, NULL, NULL, 'weight', 'amount', 'WS201490365284.gif', 6, 20),
(6, 'name', 'description', 'detail', '2017-03-24 15:24:26', NULL, NULL, NULL, 'weight', 'amount', 'WS201490365466.png', 8, 20),
(7, 'name', 'description', 'detail', '2017-03-25 14:07:05', NULL, NULL, NULL, 'weight', 'amount', 'WS201490447225.png', 6, 20),
(8, 'this', 'is', 'small', '2017-03-26 15:15:13', NULL, NULL, NULL, '1', '2', 'WS201490534113.png', 6, 20),
(9, 'zzzz', 'cccc', 'xxxx', '2017-03-27 18:46:16', '21', '4444', '333', '13', '2', 'WS201490633176.png', 5, 20),
(10, 'zzzz', 'cccc', 'xxxx', '2017-03-27 18:46:37', '21', '4444', '333', '13', '2', 'WS201490633197.png', 5, 20),
(11, 'zzzz', 'cccc', 'xxxx', '2017-03-27 18:48:55', '21', '4444', '333', '13', '2', 'WS201490633335.png', 5, 20),
(12, 'ของสิ่งนี้', 'นะจ่ะ', 'คือของเล่น', '2017-03-27 19:05:11', '18', '13', '13', '40', '4', 'WS201490634311.png', 6, 20);
-- --------------------------------------------------------
--
-- Table structure for table `donatetype`
--
CREATE TABLE `donatetype` (
`type_id` int(11) NOT NULL,
`type_name_en` varchar(45) NOT NULL,
`type_name_th` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `donatetype`
--
INSERT INTO `donatetype` (`type_id`, `type_name_en`, `type_name_th`) VALUES
(5, 'บริจาค1', 'Donate1'),
(6, 'บริจาค2', 'Donate2'),
(7, 'บริจาค3', 'Donate3'),
(8, 'บริจาค4', 'Donate4');
-- --------------------------------------------------------
--
-- Table structure for table `picture`
--
CREATE TABLE `picture` (
`pic_id` int(11) NOT NULL,
`pic_name` varchar(45) COLLATE armscii8_bin NOT NULL,
`pic_created` datetime NOT NULL,
`donate_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=armscii8 COLLATE=armscii8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `prefix`
--
CREATE TABLE `prefix` (
`prefix_id` int(11) NOT NULL,
`prefix_name` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `prefix`
--
INSERT INTO `prefix` (`prefix_id`, `prefix_name`) VALUES
(4, 'นาย'),
(5, 'นาง'),
(6, 'นางสาว'),
(7, 'เด็กชาย'),
(8, 'เด็กหญิง');
-- --------------------------------------------------------
--
-- Table structure for table `question`
--
CREATE TABLE `question` (
`question_id` int(11) NOT NULL,
`question_name` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `question`
--
INSERT INTO `question` (`question_id`, `question_name`) VALUES
(3, 'โดยส่วนตัวแล้วคุณคิดว่าตัวเองน่ารักมากแค่ไหน'),
(4, 'ถ้าคุณถูกลอตเตอรี่สามล้าน คุณจะบอกบอกคนอื่นหรือไม่'),
(5, 'คุณเกิดวันที่เท่าไหร่'),
(6, 'ถนนบ้านเกิดของคุณชื่อว่าอะไร'),
(7, 'สัตว์เลี้ยงตัวแรกของคุณชื่อว่าอะไร'),
(8, 'คุณเป็นคนใช่หรือไม่'),
(9, 'ถ้าวันนี้คุณเจอคนที่คุณชอบ คุณจะบอกเขาว่าอะไร');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`user_email` varchar(45) NOT NULL,
`prefix_id` int(11) NOT NULL,
`user_password` varchar(150) NOT NULL,
`user_fname` varchar(45) NOT NULL,
`user_lname` varchar(45) NOT NULL,
`user_idno` char(13) NOT NULL,
`user_address` varchar(150) NOT NULL,
`user_tel` char(10) NOT NULL,
`question_id` int(11) NOT NULL,
`user_answer` varchar(45) NOT NULL,
`user_type` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `user_email`, `prefix_id`, `user_password`, `user_fname`, `user_lname`, `user_idno`, `user_address`, `user_tel`, `question_id`, `user_answer`, `user_type`) VALUES
(20, '<EMAIL>', 4, '2af8172b0add87a349bbbf7549568a8d824754109db65ef299d05b818f818024', 'อำนาจ', 'มะธิปิไข', '1231231234567', 'kku123', '0001112223', 3, 'มาก', 1),
(21, '<EMAIL>', 4, '158dc26dd297817226245c3461786ad7611a2e7962296624d7f28ef45ee6a866', 'คมเคียว', 'ตั้งประเสริฐ', '1111113332225', 'kku123', '1112221123', 6, 'kku', 1),
(22, '<EMAIL>', 4, 'dc350bfa798cda14ca549b2b6444e8624ef4d5a0b0ac75740f8b40b460e3d8a4', 'รัฐพงศ์', 'ทองรักษ์', '1231456745321', 'kku123', '4444444444', 5, 'หนุ่ม', 1),
(23, '<EMAIL>', 4, '66f87a41556619392b81934af58135b8d63863d947c9f2856fa9c772685c67fd', 'ชนาธิป', 'ดวงชาทม', '1212123452225', 'kku123', '4445553345', 5, 'สตางค์', 1),
(24, '<EMAIL>', 6, 'c649c87122ea31557fc1afa045dfb0b821ece56073631283647adf6270275da1', 'กิตติวดี', 'ยุระยาตร์', '1231456745321', 'kku123', '4444444444', 5, 'capper', 1),
(25, '<EMAIL>', 6, '66bd16054474920be76d3ce910601ff1a2ac89047e8f45773606cfec5a2a3eb1', 'อภิญญา', 'ไชยสัจ', '1212123452225', 'kku123', '4445553345', 5, 'moccy', 1),
(26, 'admin', 4, '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', 'แอดมิน', 'คนหล่อ', '1231231234567', 'kku123', '0001112223', 3, 'มาก', 9);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `donate`
--
ALTER TABLE `donate`
ADD PRIMARY KEY (`donate_id`,`donatetype_id`,`user_id`),
ADD KEY `fk_donate_donateType_idx` (`donatetype_id`),
ADD KEY `fk_donate_user1_idx` (`user_id`);
--
-- Indexes for table `donatetype`
--
ALTER TABLE `donatetype`
ADD PRIMARY KEY (`type_id`);
--
-- Indexes for table `picture`
--
ALTER TABLE `picture`
ADD PRIMARY KEY (`pic_id`,`donate_id`),
ADD KEY `fk_picture_donate1_idx` (`donate_id`);
--
-- Indexes for table `prefix`
--
ALTER TABLE `prefix`
ADD PRIMARY KEY (`prefix_id`);
--
-- Indexes for table `question`
--
ALTER TABLE `question`
ADD PRIMARY KEY (`question_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`,`prefix_id`,`question_id`),
ADD KEY `fk_user_question1_idx` (`question_id`),
ADD KEY `fk_user_prefix1_idx` (`prefix_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `donate`
--
ALTER TABLE `donate`
MODIFY `donate_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `donatetype`
--
ALTER TABLE `donatetype`
MODIFY `type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `picture`
--
ALTER TABLE `picture`
MODIFY `pic_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `prefix`
--
ALTER TABLE `prefix`
MODIFY `prefix_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `question`
--
ALTER TABLE `question`
MODIFY `question_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `donate`
--
ALTER TABLE `donate`
ADD CONSTRAINT `fk_donate_donateType` FOREIGN KEY (`donatetype_id`) REFERENCES `donatetype` (`type_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_donate_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `picture`
--
ALTER TABLE `picture`
ADD CONSTRAINT `fk_picture_donate1` FOREIGN KEY (`donate_id`) REFERENCES `donate` (`donate_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `fk_user_prefix1` FOREIGN KEY (`prefix_id`) REFERENCES `prefix` (`prefix_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_user_question1` FOREIGN KEY (`question_id`) REFERENCES `question` (`question_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!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>jixu-invn/veterinary_clinic_database
DROP VIEW IF EXISTS STATISTIQUES_ANIMAUX;
DROP VIEW IF EXISTS STATISTIQUES_GLOBALES_MEDICAMENTS;
DROP VIEW IF EXISTS vPersonnel;
DROP VIEW IF EXISTS vIndividu;
DROP TABLE IF EXISTS Medicament_autorise;
DROP TABLE IF EXISTS Traitement_contient;
DROP TABLE IF EXISTS Medicaments;
DROP TABLE IF EXISTS Traitements;
DROP TABLE IF EXISTS Animaux;
DROP TABLE IF EXISTS Especes;
DROP TABLE IF EXISTS Clients;
DROP TABLE IF EXISTS Veterinaires;
DROP TABLE IF EXISTS Assistants;
DROP TABLE IF EXISTS Classes_especes_animales; |
<reponame>Ahmedshakil01/student-poc<filename>SQL/test.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 19, 2022 at 06:48 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.23
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: `test`
--
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`rating` decimal(8,2) DEFAULT NULL,
`comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 = positive, 0 = negative',
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_by` int(11) DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `comments`
--
INSERT INTO `comments` (`id`, `name`, `email`, `age`, `rating`, `comment`, `status`, `created_by`, `updated_by`, `deleted_by`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Shakil', '<EMAIL>', 25, '4.50', 'This is a testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(2, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(3, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(4, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(5, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(6, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(7, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(8, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10'),
(9, '<NAME>', '<EMAIL>', 26, '4.00', 'This is another testing comment', 1, 4, NULL, NULL, NULL, '2022-01-19 11:44:10', '2022-01-19 11:44:10');
-- --------------------------------------------------------
--
-- Table structure for table `contents`
--
CREATE TABLE `contents` (
`id` bigint(20) UNSIGNED NOT NULL,
`video` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 = active, 0 = inactive',
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`deleted_by` int(11) DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `contents`
--
INSERT INTO `contents` (`id`, `video`, `description`, `status`, `created_by`, `updated_by`, `deleted_by`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, '/upload/files/video/file_name__2022_01_19_05_24_09_1642613049.mp4', 'This is a testing video upload.', 1, 1, NULL, NULL, NULL, '2022-01-19 11:24:09', '2022-01-19 11:24:09'),
(2, '/upload/files/video/file_name__2022_01_19_05_29_39_1642613379.mp4', 'Testing content', 1, 1, NULL, NULL, NULL, '2022-01-19 11:29:39', '2022-01-19 11:29:39');
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(7, '2014_10_12_000000_create_users_table', 1),
(8, '2014_10_12_100000_create_password_resets_table', 1),
(9, '2019_08_19_000000_create_failed_jobs_table', 1),
(10, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(11, '2022_01_19_151442_create_contents_table', 1),
(12, '2022_01_19_151622_create_comments_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `user_type`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Teacher', '<EMAIL>', '2022-01-19 11:10:55', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'teacher', 'RVbsk234rxzrS3moNCcTcZtskD8OiaMGD7qveFGikZNpAvRKPCPArVpPH6Rb', '2022-01-19 11:10:55', '2022-01-19 11:10:55'),
(4, 'Student', '<EMAIL>', '2022-01-19 11:10:55', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'student', 'c7ivAnigUOx6V1KpNkn9YQ8IMZJwtpWvio5Rqf71xvjIwZ30MeXwWkF9V821', '2022-01-19 15:10:55', '2022-01-19 15:10:55');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contents`
--
ALTER TABLE `contents`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `contents`
--
ALTER TABLE `contents`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED 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 */;
|
SELECT Username, IpAddress
FROM Users
WHERE IpAddress LIKE '___.1_%._%.___'
ORDER BY Username |
<filename>v2_USER_CODE_Synapse/MS_test_3/microsoft_sql/query54.sql
-- query54
WITH my_customers
AS (SELECT DISTINCT c_customer_sk,
c_current_addr_sk
FROM (SELECT cs_sold_date_sk sold_date_sk,
cs_bill_customer_sk customer_sk,
cs_item_sk item_sk
FROM catalog_sales
UNION ALL
SELECT ws_sold_date_sk sold_date_sk,
ws_bill_customer_sk customer_sk,
ws_item_sk item_sk
FROM web_sales) cs_or_ws_sales,
item,
date_dim,
customer
WHERE sold_date_sk = d_date_sk
AND item_sk = i_item_sk
AND i_category = 'Sports'
AND i_class = 'fitness'
AND c_customer_sk = cs_or_ws_sales.customer_sk
AND d_moy = 5
AND d_year = 2000),
my_revenue
AS (SELECT c_customer_sk,
Sum(ss_ext_sales_price) AS revenue
FROM my_customers,
store_sales,
customer_address,
store,
date_dim
WHERE c_current_addr_sk = ca_address_sk
AND ca_county = s_county
AND ca_state = s_state
AND ss_sold_date_sk = d_date_sk
AND c_customer_sk = ss_customer_sk
AND d_month_seq BETWEEN (SELECT DISTINCT d_month_seq + 1
FROM date_dim
WHERE d_year = 2000
AND d_moy = 5) AND
(SELECT DISTINCT
d_month_seq + 3
FROM date_dim
WHERE d_year = 2000
AND d_moy = 5)
GROUP BY c_customer_sk),
segments
AS (SELECT Floor(revenue / 50) AS segment
FROM my_revenue)
SELECT TOP 100 segment,
Count(*) AS num_customers,
segment * 50 AS segment_base
FROM segments
GROUP BY segment
ORDER BY segment,
num_customers
|
<reponame>asnoazzawagama/creativeitem<filename>install.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2019 at 02:29 AM
-- 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: `install`
--
-- --------------------------------------------------------
--
-- Table structure for table `actor`
--
CREATE TABLE `actor` (
`actor_id` int(11) NOT NULL,
`name` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `actor`
--
INSERT INTO `actor` (`actor_id`, `name`) VALUES
(1, 'Infina');
-- --------------------------------------------------------
--
-- Table structure for table `ci_sessions`
--
CREATE TABLE `ci_sessions` (
`id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`ip_address` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`timestamp` int(10) UNSIGNED NOT NULL DEFAULT '0',
`data` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `ci_sessions`
--
INSERT INTO `ci_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('0gfu173gtff4es87jo0gj5p76kgpk61p', '::1', 1564808332, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343830383333323b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('39fd1v9evhiejskhpluhctcpf11opujl', '::1', 1564747856, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734373835363b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('6280pu3n6j5r406lrfillfnf7ertg03a', '::1', 1564804728, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343830343732383b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('79sc2foaep3mki6otmg1sbmkf57pj0cc', '::1', 1564662294, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343636323239343b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('akcvi8ohqlsa8vh29f3ch0eegdtqb90n', '::1', 1564928215, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343932383231353b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2232223b6c6f67696e5f747970657c733a313a2230223b6163746976655f757365727c733a353a227573657231223b757365725f656e746572696e675f74696d657374616d707c693a313536343932363033333b),
('ap0nkranopn59dt1oqm56updecqpto88', '::1', 1564805039, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343830353033393b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('b7b5s11admjli9lbei1h5tnbg2q7nres', '::1', 1564750518, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343735303531363b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('c05dc9rgk7eo48rro03dbjgl2mee5r28', '::1', 1564744353, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734343335333b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('cvqn7l5skgtlnd1b7fc14ro8ggqu3qn7', '::1', 1564749945, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734393934353b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('dpvondo47nrrqeke385uk77b776mui06', '::1', 1564750516, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343735303531363b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('f9t53og9l068bha44k50g3an4ugmv80j', '::1', 1564745198, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734353139383b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('imj4icooit2tdv5bfd7vndbs6h71mdhm', '::1', 1564663868, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343636333636303b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('jmeub1sasqrr2pvnivbe0jjuevnar9ge', '::1', 1564804267, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343830343236373b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2232223b6c6f67696e5f747970657c733a313a2230223b6163746976655f757365727c733a353a227573657232223b757365725f656e746572696e675f74696d657374616d707c693a313536343830343132303b),
('ks6al4muq0blk0lbirglu91cur84rb6l', '::1', 1564808514, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343830383333323b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('l8d5tgj1r01qggce569fs8c9cnl9pthj', '::1', 1564749258, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734393235383b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('mjl3ep1am20qvu0ftaeb67jidi294732', '::1', 1564663660, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343636333636303b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('mqepde17tm11t0uehp6ksbn7d1cjjns2', '::1', 1564663260, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343636333236303b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('nc9tfhivkddqe72mvi3mdg1a5b9jv65i', '::1', 1564748938, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734383933383b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('pqf7p78n2ndbio00p272q0uuop2i9ghh', '::1', 1564928215, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343932383231353b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2232223b6c6f67696e5f747970657c733a313a2230223b6163746976655f757365727c733a353a227573657231223b757365725f656e746572696e675f74696d657374616d707c693a313536343932363033333b),
('tsjatpvp6616qt1mpeupmcrhanu9fv71', '::1', 1564662883, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343636323838333b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b),
('tu9frmdtvf2q2d4sjgifmngse4c2n363', '::1', 1564749568, 0x5f5f63695f6c6173745f726567656e65726174657c693a313536343734393536383b757365725f6c6f67696e5f7374617475737c733a313a2231223b757365725f69647c733a313a2231223b6c6f67696e5f747970657c733a313a2231223b);
-- --------------------------------------------------------
--
-- Table structure for table `episode`
--
CREATE TABLE `episode` (
`episode_id` int(11) NOT NULL,
`season_id` int(11) NOT NULL,
`title` longtext COLLATE utf8_unicode_ci NOT NULL,
`url` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `faq`
--
CREATE TABLE `faq` (
`faq_id` int(11) NOT NULL,
`question` longtext COLLATE utf8_unicode_ci NOT NULL,
`answer` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `faq`
--
INSERT INTO `faq` (`faq_id`, `question`, `answer`) VALUES
(1, 'Apa itu Neonton?', 'Neonton adalah sebuah platform yang bergerak di bidang industri kreatif. Pada Neonton ini akan ditampilkan blablabalbala blablabalbala blablabalbala blablabalbala'),
(2, 'What are the packages?', 'There are 4 package \r\n<ol>\r\n<li>Basic : 1 user screen for $4.99 per month</li>\r\n<li>Standard : 2 user screen for $7.99 per month</li>\r\n<li>Premium: 4 user screen for $11.99 per month</li>\r\n</ol>'),
(3, 'How many devices can i use?', 'According to your purchased package, you can access upto 1,2 or 4 devices at once from same account.');
-- --------------------------------------------------------
--
-- Table structure for table `genre`
--
CREATE TABLE `genre` (
`genre_id` int(11) NOT NULL,
`name` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `genre`
--
INSERT INTO `genre` (`genre_id`, `name`) VALUES
(1, 'Action'),
(2, 'ENTERTAINMENT');
-- --------------------------------------------------------
--
-- Table structure for table `language`
--
CREATE TABLE `language` (
`phrase_id` int(11) NOT NULL,
`phrase` longtext COLLATE utf8_unicode_ci NOT NULL,
`english` longtext COLLATE utf8_unicode_ci NOT NULL,
`Indonesia` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
--
-- Dumping data for table `language`
--
INSERT INTO `language` (`phrase_id`, `phrase`, `english`, `Indonesia`) VALUES
(1, 'date', '', ''),
(2, 'package', '', ''),
(3, 'service_period', '', ''),
(4, 'payment_method', '', ''),
(5, 'total', '', ''),
(6, 'cancel_your_membership', '', ''),
(7, 'Click_Finish_Cancellation_below_to_cancel_your_membership', '', ''),
(8, 'Cancellation_will_be_effective_immedietly_after_your_confirmation', '', ''),
(9, 'Restart_your_membership_anytime. Your_viewing_preferences_will_be_saved_always', '', ''),
(10, 'cancel_plan', '', ''),
(11, 'Finish_Cancellation', '', ''),
(12, 'Edit_Profile', '', ''),
(13, 'Change_Email', '', ''),
(14, 'Current_Email', '', ''),
(15, 'New_Email', '', ''),
(16, 'Current_Password', '', ''),
(17, 'Frequently_asked_question', '', ''),
(18, 'Faq', '', ''),
(19, 'Refund_Policy', '', ''),
(20, 'Forgot_Email/_Password', '', ''),
(21, 'Enter_your_email_address. We_will_send_you_a_temporary_password.', '', ''),
(22, 'Email', '', ''),
(23, 'Email_me', '', ''),
(24, 'Movie', '', ''),
(25, 'Tv_Serial', '', ''),
(26, 'Admin', '', ''),
(27, 'Account', '', ''),
(28, 'Sign_out', '', ''),
(29, 'PLAY', '', ''),
(30, 'See_what_is_next.', '', ''),
(31, 'WATCH_ANYWHERE.', '', ''),
(32, 'CANCEL_ANYTIME.', '', ''),
(33, 'JOIN_TODAY', '', ''),
(34, 'Cancel_subscription_anytime', '', ''),
(35, 'Watch_from_anywhere', '', ''),
(36, 'Pricing_packages', '', ''),
(37, 'If_you_decide_Videoflix_is_not_for_you, no_problem.', '', ''),
(38, 'No_commitment. Cancel_online_anytime.', '', ''),
(39, 'Watch_TV_shows_and_movies_anytime, anywhere. From_any_device.', '', ''),
(40, 'Watch_on_your_tv', '', ''),
(41, 'Watch_on_your_phone, tablet', '', ''),
(42, 'Watch_on_your_pc', '', ''),
(43, 'Choose_one_plan_and_watch_everything.', '', ''),
(44, 'Monthly_price', '', ''),
(45, 'Screens_you_can_watch_on_at_the_same_time', '', ''),
(46, 'Watch_on_your_laptop, TV, phone_and_tablet', '', ''),
(47, 'HD_available', '', ''),
(48, 'Unlimited_movies_and_TV_shows', '', ''),
(49, 'Cancel_anytime', '', ''),
(50, 'DONE', '', ''),
(51, 'movies', '', ''),
(52, 'Change_Password', '', ''),
(53, 'New_Password', '', ''),
(54, 'Save', '', ''),
(55, 'Add_to_My_list', '', ''),
(56, 'Added_to_My_list', '', ''),
(57, 'Genre', '', ''),
(58, 'Year', '', ''),
(59, 'About', '', ''),
(60, 'Cast', '', ''),
(61, 'More', '', ''),
(62, 'Episode', '', ''),
(63, 'Search_result_for', '', ''),
(64, 'Tv_series', '', ''),
(65, 'Password', '', ''),
(66, 'Forget_password', '', ''),
(67, 'Sign_up', '', ''),
(68, 'Sign_up_to_start_your_membership', '', ''),
(69, 'Create_your_account', '', ''),
(70, 'Email_Address', '', ''),
(71, 'Register', '', ''),
(72, 'Who_is_watching', '', ''),
(73, 'MEMBERSHIP_AND_BILLING', '', ''),
(74, 'Cancel_Membership', '', ''),
(75, 'PLAN_DETAILS', '', ''),
(76, 'Effective_upto', '', ''),
(77, 'Go_Back', '', ''),
(78, 'Cancel', '', ''),
(79, 'Billing_history', '', ''),
(80, 'MY_PROFILE', '', ''),
(81, 'Manage_profiles', '', ''),
(82, 'language_list', '', ''),
(83, 'add_phrase', '', ''),
(84, 'add_language', '', ''),
(85, 'language', '', ''),
(86, 'option', '', ''),
(87, 'edit_phrase', '', ''),
(88, 'delete_language', '', ''),
(89, 'phrase', '', ''),
(90, 'value_required', '', ''),
(91, 'MY_LIST', '', ''),
(92, 'update_phrase', '', ''),
(93, 'settings_updated', '', ''),
(94, 'video_playlist', '', ''),
(95, 'sign_in', '', ''),
(96, 'Privacy_Policy', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `movie`
--
CREATE TABLE `movie` (
`movie_id` int(11) NOT NULL,
`title` longtext COLLATE utf8_unicode_ci NOT NULL,
`description_short` longtext COLLATE utf8_unicode_ci NOT NULL,
`description_long` longtext COLLATE utf8_unicode_ci NOT NULL,
`year` int(11) NOT NULL,
`rating` int(11) NOT NULL,
`genre_id` int(11) NOT NULL,
`actors` longtext COLLATE utf8_unicode_ci NOT NULL,
`featured` int(11) NOT NULL,
`kids_restriction` int(11) NOT NULL DEFAULT '0',
`url` longtext COLLATE utf8_unicode_ci NOT NULL,
`trailer_url` longtext COLLATE utf8_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `movie`
--
INSERT INTO `movie` (`movie_id`, `title`, `description_short`, `description_long`, `year`, `rating`, `genre_id`, `actors`, `featured`, `kids_restriction`, `url`, `trailer_url`) VALUES
(1, 'Coba', 'blablablablalabala blablablablalabala blablablablalabala blablablablalabalablablablablalabala blablablablalabala ', 'blablablablalabala blablablablalabala blablablablalabala blablablablalabalablablablablalabala blablablablalabala blablablablalabala blablablablalabalablablablablalabala ', 2019, 2, 1, '["1"]', 1, 0, 'https://www.youtube.com/watch?v=1G4isv_Fylg&list=RD1G4isv_Fylg&start_radio=1', 'https://www.youtube.com/watch?v=1G4isv_Fylg&list=RD1G4isv_Fylg&start_radio=1'),
(2, 'Actionnnnnn', 'https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3', 'https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3', 2019, 5, 1, '[]', 1, 0, 'https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3', 'https://www.youtube.com/watch?v=BPNTC7uZYrI&list=RD1G4isv_Fylg&index=3');
-- --------------------------------------------------------
--
-- Table structure for table `plan`
--
CREATE TABLE `plan` (
`plan_id` int(11) NOT NULL,
`name` longtext COLLATE utf8_unicode_ci NOT NULL,
`screens` longtext COLLATE utf8_unicode_ci NOT NULL,
`price` longtext COLLATE utf8_unicode_ci NOT NULL,
`status` int(11) NOT NULL COMMENT '1 active, 0 inactive'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `plan`
--
INSERT INTO `plan` (`plan_id`, `name`, `screens`, `price`, `status`) VALUES
(1, 'basic', '1', '7.99', 1),
(2, 'standard', '2', '9.99', 1),
(3, 'premium', '4', '11.99', 1);
-- --------------------------------------------------------
--
-- Table structure for table `season`
--
CREATE TABLE `season` (
`season_id` int(11) NOT NULL,
`series_id` int(11) NOT NULL,
`name` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `series`
--
CREATE TABLE `series` (
`series_id` int(11) NOT NULL,
`title` longtext COLLATE utf8_unicode_ci NOT NULL,
`trailer_url` longtext COLLATE utf8_unicode_ci,
`description_short` longtext COLLATE utf8_unicode_ci NOT NULL,
`description_long` longtext COLLATE utf8_unicode_ci NOT NULL,
`genre_id` int(11) NOT NULL,
`actors` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT 'comma separated actor_id',
`year` int(11) NOT NULL,
`rating` int(11) NOT NULL,
`featured` int(11) NOT NULL,
`kids_restriction` int(11) NOT NULL,
`episodes` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `series`
--
INSERT INTO `series` (`series_id`, `title`, `trailer_url`, `description_short`, `description_long`, `genre_id`, `actors`, `year`, `rating`, `featured`, `kids_restriction`, `episodes`) VALUES
(1, 'RCTI', 'https://www.youtube.com/watch?v=oxj9bBoGy7A', 'bksbdajkjbjasbdkjas', 'jhdajhsjahdjsahdkjsahdaj', 1, '["1"]', 2019, 3, 0, 0, '');
-- --------------------------------------------------------
--
-- Table structure for table `settings`
--
CREATE TABLE `settings` (
`settings_id` int(11) NOT NULL,
`type` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`description` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `settings`
--
INSERT INTO `settings` (`settings_id`, `type`, `description`) VALUES
(1, 'site_name', 'Movie subscription portal'),
(2, 'site_email', '<EMAIL>'),
(3, 'paypal_merchant_email', ''),
(4, 'invoice_address', '24/e North Huston, NY, Australia'),
(5, 'language', 'Indonesia'),
(6, 'purchase_code', 'your-product-purchase-code-goes-here'),
(7, 'privacy_policy', '<p>Effective date: November 02, 2018</p>\r\n\r\n\r\n<p>Netflex ("us", "we", or "our") operates the http://netflex.com website (the "Service").</p>\r\n\r\n<p>This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. Our Privacy Policy for Netflex is managed through <a href="https://www.freeprivacypolicy.com/free-privacy-policy-generator.php">Free Privacy Policy</a>.</p>\r\n\r\n<p>We use your data to provide and improve the Service. By using the Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, accessible from http://netflex.com</p>\r\n\r\n\r\n<h2 class="black_text">Information Collection And Use</h2>\r\n\r\n<p>We collect several different types of information for various purposes to provide and improve our Service to you.</p>\r\n\r\n<h3 class="black_text">Types of Data Collected</h3>\r\n\r\n<h4 class="black_text">Personal Data</h4>\r\n\r\n<p>While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you ("Personal Data"). Personally identifiable information may include, but is not limited to:</p>\r\n\r\n<ul>\r\n<li>Email address</li><li>First name and last name</li><li>Cookies and Usage Data</li>\r\n</ul>\r\n\r\n<h4 class="black_text">Usage Data</h4>\r\n\r\n<p>We may also collect information how the Service is accessed and used ("Usage Data"). This Usage Data may include information such as your computer''s Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data.</p>\r\n\r\n<h4 class="black_text">Tracking & Cookies Data</h4>\r\n<p>We use cookies and similar tracking technologies to track the activity on our Service and hold certain information.</p>\r\n<p>Cookies are files with small amount of data which may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Tracking technologies also used are beacons, tags, and scripts to collect and track information and to improve and analyze our Service.</p>\r\n<p>You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service.</p>\r\n<p>Examples of Cookies we use:</p>\r\n<ul>\r\n <li><strong>Session Cookies.</strong> We use Session Cookies to operate our Service.</li>\r\n <li><strong>Preference Cookies.</strong> We use Preference Cookies to remember your preferences and various settings.</li>\r\n <li><strong>Security Cookies.</strong> We use Security Cookies for security purposes.</li>\r\n</ul>\r\n\r\n<h2 class="black_text">Use of Data</h2>\r\n \r\n<p>Netflex uses the collected data for various purposes:</p> \r\n<ul>\r\n <li>To provide and maintain the Service</li>\r\n <li>To notify you about changes to our Service</li>\r\n <li>To allow you to participate in interactive features of our Service when you choose to do so</li>\r\n <li>To provide customer care and support</li>\r\n <li>To provide analysis or valuable information so that we can improve the Service</li>\r\n <li>To monitor the usage of the Service</li>\r\n <li>To detect, prevent and address technical issues</li>\r\n</ul>\r\n\r\n<h2 class="black_text">Transfer Of Data</h2>\r\n<p>Your information, including Personal Data, may be transferred to — and maintained on — computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from your jurisdiction.</p>\r\n<p>If you are located outside Australia and choose to provide information to us, please note that we transfer the data, including Personal Data, to Australia and process it there.</p>\r\n<p>Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer.</p>\r\n<p>Netflex will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information.</p>\r\n\r\n<h2 class="black_text">Disclosure Of Data</h2>\r\n\r\n<h3 class="black_text">Legal Requirements</h3>\r\n<p>Netflex may disclose your Personal Data in the good faith belief that such action is necessary to:</p>\r\n<ul>\r\n <li>To comply with a legal obligation</li>\r\n <li>To protect and defend the rights or property of Netflex</li>\r\n <li>To prevent or investigate possible wrongdoing in connection with the Service</li>\r\n <li>To protect the personal safety of users of the Service or the public</li>\r\n <li>To protect against legal liability</li>\r\n</ul>\r\n\r\n<h2 class="black_text">Security Of Data</h2>\r\n<p>The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security.</p>\r\n\r\n<h2 class="black_text">Service Providers</h2>\r\n<p>We may employ third party companies and individuals to facilitate our Service ("Service Providers"), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Service is used.</p>\r\n<p>These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose.</p>\r\n\r\n\r\n\r\n<h2 class="black_text">Links To Other Sites</h2>\r\n<p>Our Service may contain links to other sites that are not operated by us. If you click on a third party link, you will be directed to that third party''s site. We strongly advise you to review the Privacy Policy of every site you visit.</p>\r\n<p>We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.</p>\r\n\r\n\r\n<h2 class="black_text">Children''s Privacy</h2>\r\n<p>Our Service does not address anyone under the age of 18 ("Children").</p>\r\n<p>We do not knowingly collect personally identifiable information from anyone under the age of 18. If you are a parent or guardian and you are aware that your Children has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from children without verification of parental consent, we take steps to remove that information from our servers.</p>\r\n\r\n\r\n<h2 class="black_text">Changes To This Privacy Policy</h2>\r\n<p>We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.</p>\r\n<p>We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update the "effective date" at the top of this Privacy Policy.</p>\r\n<p>You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.</p>\r\n\r\n\r\n<h2 class="black_text">Contact Us</h2>\r\n<p>If you have any questions about this Privacy Policy, please contact us:</p>\r\n<ul>\r\n <li>By email: <EMAIL></li>\r\n \r\n </ul>'),
(8, 'refund_policy', '<h1 class="black_text">Returns and Refunds Policy</h1>\r\n\r\n\r\n<p>Thank you for shopping at Netflex.</p>\r\n\r\n<p>Please read this policy carefully. This is the Return and Refund Policy of Netflex. This Return and Refund Policy for Netflex is managed by <a href="https://termsfeed.com/return-refund-policy/generator/">the Return Refund Policy Generator</a>.</p>\r\n\r\n\r\n\r\n\r\n<h2 class="black_text">Digital products</h2>\r\n\r\n<p>We do not issue refunds for digital products once the order is confirmed and the product is sent.</p>\r\n\r\n<p>We recommend contacting us for assistance if you experience any issues receiving or downloading our products.</p>\r\n\r\n\r\n\r\n<h2 class="black_text">Contact us</h2>\r\n\r\n<p>If you have any questions about our Returns and Refunds Policy, please contact us:</p>\r\n\r\n<ul>\r\n<li>\r\n <p>By email: <EMAIL></p>\r\n</li>\r\n</ul>\r\n\r\n'),
(9, 'stripe_publishable_key', ''),
(10, 'stripe_secret_key', ''),
(11, 'trial_period', 'off'),
(12, 'trial_period_days', '30'),
(13, 'theme', 'flixer');
-- --------------------------------------------------------
--
-- Table structure for table `subscription`
--
CREATE TABLE `subscription` (
`subscription_id` int(11) NOT NULL,
`plan_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`price_amount` int(11) NOT NULL,
`paid_amount` float NOT NULL,
`timestamp_from` int(11) NOT NULL,
`timestamp_to` int(11) NOT NULL,
`payment_method` longtext COLLATE utf8_unicode_ci NOT NULL,
`payment_details` longtext COLLATE utf8_unicode_ci NOT NULL,
`payment_timestamp` int(11) NOT NULL,
`status` int(11) NOT NULL DEFAULT '1' COMMENT '1 active, 0 cancelled'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `subscription`
--
INSERT INTO `subscription` (`subscription_id`, `plan_id`, `user_id`, `price_amount`, `paid_amount`, `timestamp_from`, `timestamp_to`, `payment_method`, `payment_details`, `payment_timestamp`, `status`) VALUES
(1, 2, 2, 0, 9.99, 1564804088, 1567396088, 'stripe', '', 1564804088, 1);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`type` int(11) NOT NULL COMMENT '1 admin, 0 customer',
`name` longtext COLLATE utf8_unicode_ci NOT NULL,
`email` longtext COLLATE utf8_unicode_ci NOT NULL,
`password` longtext COLLATE utf8_unicode_ci NOT NULL,
`user1` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user 1',
`user2` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user 2',
`user3` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user 3',
`user4` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user 4',
`user1_session` longtext COLLATE utf8_unicode_ci NOT NULL,
`user2_session` longtext COLLATE utf8_unicode_ci NOT NULL,
`user3_session` longtext COLLATE utf8_unicode_ci NOT NULL,
`user4_session` longtext COLLATE utf8_unicode_ci NOT NULL,
`user1_movielist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user2_movielist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user3_movielist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user4_movielist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user1_serieslist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user2_serieslist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user3_serieslist` longtext COLLATE utf8_unicode_ci NOT NULL,
`user4_serieslist` longtext COLLATE utf8_unicode_ci NOT NULL,
`plan_id` int(11) NOT NULL,
`status` int(11) NOT NULL DEFAULT '1' COMMENT '0 banned'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `type`, `name`, `email`, `password`, `user1`, `user2`, `user3`, `user4`, `user1_session`, `user2_session`, `user3_session`, `user4_session`, `user1_movielist`, `user2_movielist`, `user3_movielist`, `user4_movielist`, `user1_serieslist`, `user2_serieslist`, `user3_serieslist`, `user4_serieslist`, `plan_id`, `status`) VALUES
(1, 1, '<NAME>', '<EMAIL>', 'd6112c2263<PASSWORD>2', 'user 1', 'user 2', 'user 3', 'user 4', '', '', '', '', '', '', '', '', '', '', '', '', 0, 1),
(2, 0, 'Asno AF', '<EMAIL>', 'd6112c226324538e0d65f02e124f66dad77fe7d2', 'user 1', 'Asno AF', 'user 3', 'user 4', '1564926033', '1564804297', '', '', '', '', '', '', '', '', '', '', 0, 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `actor`
--
ALTER TABLE `actor`
ADD PRIMARY KEY (`actor_id`);
--
-- Indexes for table `ci_sessions`
--
ALTER TABLE `ci_sessions`
ADD PRIMARY KEY (`id`),
ADD KEY `ci_sessions_timestamp` (`timestamp`);
--
-- Indexes for table `episode`
--
ALTER TABLE `episode`
ADD PRIMARY KEY (`episode_id`);
--
-- Indexes for table `faq`
--
ALTER TABLE `faq`
ADD PRIMARY KEY (`faq_id`);
--
-- Indexes for table `genre`
--
ALTER TABLE `genre`
ADD PRIMARY KEY (`genre_id`);
--
-- Indexes for table `language`
--
ALTER TABLE `language`
ADD PRIMARY KEY (`phrase_id`);
--
-- Indexes for table `movie`
--
ALTER TABLE `movie`
ADD PRIMARY KEY (`movie_id`);
--
-- Indexes for table `plan`
--
ALTER TABLE `plan`
ADD PRIMARY KEY (`plan_id`);
--
-- Indexes for table `season`
--
ALTER TABLE `season`
ADD PRIMARY KEY (`season_id`);
--
-- Indexes for table `series`
--
ALTER TABLE `series`
ADD PRIMARY KEY (`series_id`);
--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
ADD PRIMARY KEY (`settings_id`);
--
-- Indexes for table `subscription`
--
ALTER TABLE `subscription`
ADD PRIMARY KEY (`subscription_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `actor`
--
ALTER TABLE `actor`
MODIFY `actor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `episode`
--
ALTER TABLE `episode`
MODIFY `episode_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `faq`
--
ALTER TABLE `faq`
MODIFY `faq_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `genre`
--
ALTER TABLE `genre`
MODIFY `genre_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `language`
--
ALTER TABLE `language`
MODIFY `phrase_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=97;
--
-- AUTO_INCREMENT for table `movie`
--
ALTER TABLE `movie`
MODIFY `movie_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `plan`
--
ALTER TABLE `plan`
MODIFY `plan_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `season`
--
ALTER TABLE `season`
MODIFY `season_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `series`
--
ALTER TABLE `series`
MODIFY `series_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
MODIFY `settings_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `subscription`
--
ALTER TABLE `subscription`
MODIFY `subscription_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
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 */;
--
-- Datenbank: `veva`
--
--
-- Daten für Tabelle `vorlesung`
--
INSERT INTO vorlesung (VoID, VoBezeichnung) VALUES (1, 'Logik und Algebra');
--
-- Daten für Tabelle `kapitel`
--
INSERT INTO kapitel (KaID, KaBezeichnung, VoID) VALUES
(1, 'Mengenlehre', 1),
(2, 'Relationen', 1),
(3, 'Relationenalgebra', 1),
(4, 'Abbildungen', 1),
(5, 'Boolesche Algebra', 1),
(6, 'Aussagenlogik', 1);
--
-- Daten für Tabelle `fragepool`
--
INSERT INTO fragepool (FpID, KaID) VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 4),
(5, 5),
(6, 6);
--
-- Daten für Tabelle `frage`
--
-- Mengenlehre
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(1, 'Mengenlehre - Vereinigung 1', 'Sei X={a,b} und Y={b,a}. Was ergibt die Vereinigung von X und Y (X ∪ Y)?', 1, 'mchoic'),
(2, 'Mengenlehre - Differenz 1', 'Sei X={a,b,c} und Y={b,a}. Was ergibt die Differenz von X und Y (X - Y)?', 1, 'mchoic'),
(3, 'Mengenlehre - Durchschnitt 1', 'Sei X={a,b,c,d} und Y={c,d,e,f}. Was ergibt der Durschschnitt von X und Y(X ∩ Y)?', 1, 'mchoic'),
(4, 'Mengenlehre - Durchschnitt 2', 'Sei X={a,b,c} und Y={d,e,f}. Was ergibt der Durschschnitt von X und Y(X ∩ Y)?', 1, 'mchoic'),
(5, 'Mengenlehre - Differenz 2', 'Sei X={a,b,c,d} und Y={c,d,e,f}. Was ergibt die symmetrische Differenz von X und Y (X ∆ Y)?', 1, 'mchoic'),
(6, 'Mengenlehre - Potenzmenge 1', 'Sei X={a,b}. Was ist die Potenzmenge von X?', 1, 'mchoic'),
(7, 'Mächtigkeit', 'Sei R={{1,2,{}},{3,4}}. Wie groß ist die Mächtigkeit von R (|R|)?', 1, 'text'),
(8, 'Mengenlehre - Definition', 'Was ist eine Menge?', 1, 'mchoic');
-- Relationen
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(9, 'Eigenschaften von Relationen 1', 'Sei M = {1, 2} und R = {(1, 2),(2, 1)}. Welche Eigenschaften erfüllt R?', 2, 'mchoic'),
(10, 'Eigenschaften von Relationen 2', 'Sei M = {1, 2, 3} und R = {(1, 2),(1, 3),(2, 3)}. Welche Eigenschaften erfüllt R?', 2, 'mchoic'),
(11, 'Eigenschaften von Relationen 3', 'Sei M = {1, 2, 3} und R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3),(1, 3)}. Welche Eigenschaften erfüllt R?', 2, 'mchoic'),
(12, 'Reflexivität 1', 'Sei M = {1, 2, 3} und R = {(1, 1),(1, 2),(2, 3),(3,3)}. Was ist die reflexive Hülle der Relation R auf der Menge M?', 2, 'text'),
(13, 'Symmetrie 1', 'Sei M = {1, 2, 3} und R = {(1, 1),(1, 2),(2, 3),(3,3)}. Was ist die symmetrische Hülle der Relation R auf der Menge M?', 2, 'text'),
(14, 'Transitivität 1', 'Sei M = {1, 2, 3} und R = {(1, 1),(1, 2),(2, 3),(3,3)}. Was ist die transitive Hülle der Relation R auf der Menge M?', 2, 'text'),
(15, 'Eigenschaften von Relationen 4', 'Finden Sie eine Relation R auf der Menge M = {1,2,3}, die reflexiv und transitiv ist aber nicht symmetrisch', 2, 'mchoic'),
(16, 'Eigenschaften von Relationen 5', 'Finden Sie eine Relation R auf der Menge M = {1,2,3}, die reflexiv ist aber nicht symmetrisch und transitiv', 2, 'mchoic'),
(17, 'Totale Ordnungen 1', 'Welche der folgenden Relationen sind totale Ordnungen?', 2, 'mchoic'),
(18, 'Totale Ordnungen 2', 'Welche der folgenden Relationen ist eine totale Ordnung auf die Menge M = {1, 2, 3}', 2, 'mchoic'),
(19, 'Zerlegungen 1', 'Sei R = {a, b, c, d, e, f}. Welches der folgenden Relationen Z ist eine Zerlegung von R?', 2, 'mchoic');
-- Relationenalgebra
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(20, 'Relationenalgebra 1', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. Welche Vereine befinden sich in Kiel?<br/>', 3, 'text'),
(21, 'Relationenalgebra 2', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. Welche Spiele am 11. Spieltag hatten weniger als 50000 Zuschauer?', 3, 'text'),
(22, 'Relationenalgebra 3', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. Welche Spiele sind mit dem Resultat 2:1 ausgegangen?', 3, 'text'),
(23, 'Relationenalgebra 4', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. In welchen Vereinen spielen Spieler, deren Geburtsort gleich dem Vereinsort ist?', 3, 'text'),
(24, 'Relationenalgebra 5', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. Welche Spieler (Name, Vorname) haben noch nie gespielt?', 3, 'text'),
(25, 'Relationenalgebra 6', 'Gegeben sei das folgende Schema zur Verwaltung von Fußballvereinen: (PK_... := Primärschlüssel; FK_... := Fremdschlüssel)<br/>\r\n<br/>\r\nVerein (PK_Vname, Ort, Präsident)<br/>\r\nSpiel (PK_FK_Heim, PK_FK_Gast, Resultat, Zuschauer, Termin, Spieltag, FK_Heim-TrNr, FK_Gast-TrNr)<br/>\r\nSpieler (PK_SpNr, Name, Vorname, FK_Verein, Alter, Gehalt, Geburtsort)<br/>\r\nTrainer (PK_TrNr, Name, Vorname, FK_Verein, Gehalt)<br/>\r\nEinsatz ( PK_FK_Heim, PK_FK_Gast, PK_FK_SpNr, von, bis, Tore, Karte)<br/>\r\n<br/>\r\nFormulieren Sie folgende Anfrage mithilfe der Relationenalgebra. Welche Spieler (Name, Vorname) haben schon mindestenz eine Karte bekommen?', 3, 'text');
-- Abbildungen
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(26, 'Linksvollständigkeit 1', 'Sei R ⊆ N X M. Wann ist R linksvollständig?', 4, 'mchoic'),
(27, 'Rechtseindeutigkeit 1', 'Sei R ⊆ N X M. Wann ist R rechtseindeutig?', 4, 'mchoic'),
(28, 'Injektivität 1', 'Gegeben ist die Funktion f definiert durch f: ℤ -> ℤ mit f(x) = 1 + x. Ist die Funktion injektiv?', 4, 'mchoic'),
(29, 'Surjektivität 1', 'Gegeben ist die Funktion f definiert durch f: ℤ -> ℤ mit f(x) = 1 + x. Ist die Funktion surjektiv?', 4, 'mchoic'),
(30, 'Surjektivität 2', 'Gegeben ist die Funktion f definiert durch f: ℕ -> ℤ mit f(x) = 1 + x. Ist die Funktion surjektiv?', 4, 'mchoic'),
(31, 'Surjektivität 3', 'Gegeben ist die Funktion f definiert durch f: R -> R mit f(x) = 1 + x*x. Ist die Funktion surjektiv?', 4, 'mchoic'),
(32, 'Injektivität 2', 'Gegeben ist die Funktion f definiert durch f: R -> R mit f(x) = 1 + x*x. Ist die Funktion injektiv?', 4, 'mchoic'),
(33, 'Injektivität 3', 'Sei f eine Abbildung von Matrikelnummer auf Schuhgröße. Ist f injektiv?', 4, 'mchoic'),
(34, 'Surjektivität 4', 'Sei f eine Abbildung von Matrikelnummer auf Schuhgröße. Ist f surjektiv?', 4, 'mchoic');
-- Boolesche Algebra
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(35, 'Disjunktive Normalform 1', 'Nennen Sie die disjunktive Normalform von (a + b)*(c + d).', 5, 'text'),
(36, 'Konjunktive Normalform 1', 'Nennen Sie die konjunktive Normalform von a + b*c.', 5, 'text'),
(37, 'Implikation 1', 'Lösen Sie in dem Booleschen Ausdruck (a + b) -> ¬(a + b) die Implikation auf.', 5, 'text'),
(38, 'Äquivalenz 1', 'Welcher Ausdruck ist äquivalent zu a*(¬(a*b))', 5, 'mchoic');
-- Aussagenlogik
INSERT INTO frage (FrID, FrBezeichnung, FrText, FpID, FrTyp) VALUES
(39, 'Aussagenlogik 1', 'Welche Aussagen sind wahr?', 6, 'mchoic');
--
-- Daten für Tabelle `antwort`
--
-- Mengenlehre
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(1, '{a,b}', 1, 0),
(1, '{}', 0, 1),
(1, '{a,b,b,a}', 0, 2),
(1, '{{a,b},{b,a}}', 0, 3),
(2, '{a,b}', 0, 0),
(2, '{c}', 1, 1),
(2, '{a,b,c}', 0, 2),
(2, '{}', 0, 3),
(3, '{a,b,e,f}', 0, 0),
(3, '{c,d}', 1, 1),
(3, '{e,f}', 0, 2),
(3, '{}', 0, 3),
(4, '{a,b,c,d,e,f}', 0, 0),
(4, '{c,d}', 0, 1),
(4, '{a,b,c}', 0, 2),
(4, '{}', 1, 3),
(5, '{a,b,e,f}', 1, 0),
(5, '{c,d}', 0, 1),
(5, '{e,f}', 0, 2),
(5, '{}', 0, 3),
(6, '{{a}, {b}, {a,b}}', 0, 0),
(6, '{{a}, {b}, {a,b}, {}}', 1, 1),
(6, '{a,b,{a,b},{}}', 0, 2),
(6, '2', 0, 3),
(7, '2', 0, 0),
(8, 'Menge an Studenten in der Vorlesung Logik und Algebra vom Jahrgang 2014', 1, 0),
(8, 'Menge der Torschützen bei einem Fußballspiel', 0, 1),
(8, 'Menge aller Natürlichen Zahlen', 1, 2),
(8, 'Menge der getrunkenen Maßkrüge beim Rutenfest', 0, 3);
-- Relationen
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(9, 'reflexiv', 0, 0),
(9, 'symmetrisch', 1, 1),
(9, 'antisymmetrisch', 0, 2),
(9, 'asymetrisch', 0, 3),
(9, 'transitiv', 0, 4),
(10, 'reflexiv', 0, 0),
(10, 'symmetrisch', 0, 1),
(10, 'antisymmetrisch', 0, 2),
(10, 'asymetrisch', 0, 3),
(10, 'transitiv', 1, 4),
(11, 'reflexiv', 1, 0),
(11, 'symmetrisch', 0, 1),
(11, 'antisymmetrisch', 0, 2),
(11, 'asymetrisch', 0, 3),
(11, 'transitiv', 1, 4),
(12, '{(1, 1),(2, 2),(3, 3),(1, 2),(2, 3)}', 0, 0),
(13, '{(1, 1),(1, 2),(2, 1),(2, 3),(3, 2),(3, 3)}', 0, 0),
(14, '{(1, 1),(1, 2),(2, 3),(1, 3),(3, 3)}', 0, 0),
(15, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3),(1, 3)}', 1, 0),
(15, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3)}', 0, 1),
(15, 'R = {(1, 1),(2, 2),(3, 3)}', 0, 2),
(15, 'R = {(1, 2),(2, 3),(1, 3)}', 0, 3),
(16, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3),(1, 3)}', 0, 0),
(16, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3)}', 0, 1),
(16, 'R = {(1, 1),(2, 2),(3, 3)}', 0, 2),
(16, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(2, 3)}', 1, 3),
(17, '≤N auf N', 1, 0),
(17, '<N auf N', 0, 1),
(17, '≥Z auf Z', 1, 2),
(17, 'σ auf N', 0, 3),
(17, 'N × N auf N', 0, 4),
(18, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(3, 1),(3, 2),(1, 3)}', 0, 0),
(18, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(3, 1),(3, 2)}', 1, 1),
(18, 'R = {(1, 1),(2, 2),(3, 3),(1, 2),(3, 1)}', 0, 2),
(18, 'R = {(1, 1),(2, 2),(3, 3),(1, 2)}', 0, 3),
(18, 'R = {(1, 1),(2, 2),(3, 3)}', 0, 4),
(19, 'Z = {{a, c}, {e}, {f, d, b}}', 1, 0),
(19, 'Z = {{a, b, c}, {e}, {f, d, b}}', 0, 1),
(19, 'Z = {{a, c, e}, {f}, {d}}', 0, 2);
-- Relationenalgebra
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(20, 'π PK_Vname(ϭ Ort= ''Kiel'' (Verein))', 0, 0),
(21, 'π PK_FK_Heim, PK_FK_Gast( ϭ Spieltag = 11 ∧ Zuschauer < 50000 (Spiel))', 0, 0),
(22, 'π PK_FK_Heim, PK_FK_Gast( ϭ Resultat = 2:1 (Spiel))', 0, 0),
(23, 'π PK_Vname(ϭ V.Ort= S.Geb-Ort (ρV(Verein) ⋈ ρS(Spieler) ))', 0, 0),
(24, 'π PK_SpNr(π PK_SpNr(Spieler) - π PK_SpNr((Einsatz) ⋈ (Spieler)))', 0, 0),
(25, 'π Name, Vorname (ϭ E.Karte > 0 (ρE(Einsatz) ⋈ ρS(Spieler)))', 0, 0);
-- Abbildungen
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(26, 'Wenn jedes Element von M in mindestens einem Paar in R vorkommt', 0, 0),
(26, 'Wenn jedes Element von N in mindestens einem Paar in R vorkommt', 1, 1),
(26, 'Kein Paar ein gleiches Element von N enthält', 0, 2),
(26, 'Kein Paar ein gleiches Element von M enthält', 0, 3),
(27, 'Wenn jedes Element von M in mindestens einem Paar in R vorkommt', 0, 0),
(27, 'Wenn jedes Element von N in mindestens einem Paar in R vorkommt', 0, 1),
(27, 'Kein Paar ein gleiches Element von N enthält', 1, 2),
(27, 'Kein Paar ein gleiches Element von M enthält', 0, 3),
(28, 'Ja', 1, 0),
(28, 'Nein', 0, 1),
(29, 'Ja', 1, 0),
(29, 'Nein', 0, 1),
(30, 'Ja', 0, 0),
(30, 'Nein', 1, 1),
(31, 'Ja', 1, 0),
(31, 'Nein', 0, 1),
(32, 'Ja', 0, 0),
(32, 'Nein', 1, 1),
(33, 'Ja', 0, 0),
(33, 'Nein', 1, 1),
(34, 'Ja', 0, 0),
(35, 'Nein', 1, 1);
-- Boolesche Algebra
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(35, 'a*c + a *d + b*c + b*d', 0, 0),
(36, '(¬a + b)*(¬a + ¬ c)', 0, 0),
(37, '¬(a + b) + ¬(a*b)', 0, 0),
(38, 'b', 0, 0),
(38, '¬b', 0, 1),
(38, 'a*b', 0, 2),
(38, '¬a*b', 0, 3),
(38, 'a*¬b', 1, 4);
-- Aussagenlogik
INSERT INTO antwort (FrID, AwText, AwWahrheit, AwID) VALUES
(39, 'Alle Primzahlen sind gerade', 0, 0),
(39, 'Die Wurzel aus 2 ist eine rationale Zahl', 0, 1),
(39, '1>1', 0, 2),
(39, 'Friedrichshafen liegt am Bodensee ', 1, 3);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2018 at 06:53 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.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: `emps`
--
-- --------------------------------------------------------
--
-- Table structure for table `emps`
--
CREATE TABLE `emps` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`surname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`age` int(11) NOT NULL,
`salary` int(11) NOT NULL,
`position` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`Address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`Hired_date` date NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `emps`
--
INSERT INTO `emps` (`id`, `name`, `surname`, `age`, `salary`, `position`, `Address`, `Hired_date`, `user_id`, `created_at`, `updated_at`) VALUES
(1, '<NAME>', 'Prof. <NAME> PhD', 29590, 640, 'Prof. <NAME>', '66079 Myra Court Apt. 227\nMalikaborough, MI 09659', '1981-04-09', 41, '2018-06-05 22:52:47', '2018-06-05 22:52:47'),
(2, '<NAME>', '<NAME> DDS', 3599955, 9876, '<NAME>', '868 Dillan Highway\nTurnerbury, SD 51184-3470', '2001-01-29', 31, '2018-06-05 22:52:47', '2018-06-05 22:52:47'),
(3, 'Prof. <NAME> Sr.', 'Dr. <NAME> III', 373, 670307031, '<NAME>', '709 Romaine Coves Apt. 658\nSouth Euniceville, GA 41796', '2013-02-22', 14, '2018-06-05 22:52:47', '2018-06-05 22:52:47'),
(4, 'Dr. <NAME> IV', '<NAME>', 475, 344474380, '<NAME>', '896 Ewald Summit\nWatsicaside, NE 11327', '2008-11-30', 35, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(5, 'Dr. <NAME> DDS', '<NAME>', 656, 971, 'Prof. <NAME>', '22045 Bosco Heights\nEast Andy, MT 94582-0449', '1981-11-14', 70, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(6, '<NAME>', '<NAME>', 77147, 25, '<NAME>', '6853 Ari Turnpike Suite 794\nNew Bryana, FL 10778', '1980-01-15', 82, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(7, 'Prof. <NAME> IV', '<NAME>', 8876109, 49150, '<NAME>', '68394 Ryan Keys\nNorth Isabellabury, IA 15461-5822', '1973-10-01', 10, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(8, 'Dr. <NAME> I', 'Miss <NAME> IV', 422594836, 58, 'Dr. <NAME> I', '8212 Otto Well Apt. 351\nLeoneland, AK 04296-2281', '1977-08-28', 37, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(9, '<NAME> IV', 'Rahsaan Koelpin IV', 997238, 300212828, 'Dr. <NAME>', '368 Alia Light Suite 702\nCarmellaberg, VA 98905-6939', '1972-06-09', 33, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(10, 'Dr. <NAME> DVM', '<NAME> V', 7, 75, 'Dr. <NAME>', '8591 Patricia Lock Suite 061\nBillton, TX 25092-5259', '2008-08-21', 51, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(11, '<NAME>', '<NAME> Sr.', 6, 5, 'Mr. <NAME> PhD', '5054 Myrtis Gateway\nSouth Chasityborough, AZ 48494', '2012-02-24', 35, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(12, 'Dr. <NAME>', '<NAME>', 706, 45431, '<NAME>', '9554 Fern Street Apt. 893\nJeffreyside, PA 56464-4100', '2004-08-15', 77, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(13, '<NAME> PhD', 'Dr. <NAME> Jr.', 20325, 61686, '<NAME>', '1887 Nienow Junctions Apt. 276\nWest Nikolasburgh, IL 36581', '2003-11-25', 98, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(14, '<NAME>', 'Prof. <NAME> PhD', 5, 44, '<NAME> Sr.', '19660 Christiansen Road\nPort Joany, NH 03632-8113', '1991-12-30', 42, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(15, '<NAME>', '<NAME>', 5, 5, '<NAME> III', '864 Hettinger Common\nNew Jadynstad, MA 19480-7909', '2002-06-09', 38, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(16, 'Dr. <NAME>', 'Ms. <NAME> II', 62, 7165775, 'Stone McDermott', '686 Pacocha Fall Apt. 861\nNorth Tomasaland, NJ 25799', '2014-06-27', 24, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(17, '<NAME>', '<NAME>', 46389965, 9178, 'Prof. <NAME>', '6657 Terrance Creek Apt. 115\nMurphyport, NM 98571', '1971-02-14', 95, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(18, '<NAME>', '<NAME>', 100194, 55, '<NAME>', '8530 Earline Groves Apt. 893\nLake Keven, WI 90090-9499', '1997-01-30', 87, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(19, 'Miss <NAME> Jr.', '<NAME>', 6, 9, '<NAME>', '64880 Bins Loop Suite 659\nGeovanymouth, MA 18989', '1988-02-14', 27, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(20, '<NAME>', '<NAME>', 68032870, 1647, 'Dr. <NAME>', '7358 Schimmel Grove Suite 891\nEast Rebeccamouth, PA 93838', '2015-02-26', 46, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(21, 'Dr. <NAME> MD', '<NAME> IV', 40, 690463097, '<NAME>', '5075 Derek Forges\nPort Kayaburgh, VA 11692', '1975-09-23', 31, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(22, '<NAME>', 'Prof. <NAME>', 362250, 8401793, '<NAME>', '39504 Wisoky Mill Apt. 726\nLake Stanford, NJ 89457', '1993-05-31', 69, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(23, 'Dr. <NAME>', '<NAME>', 388, 4, 'Ms. Zetta Boehm Jr.', '3807 Karina Trail Suite 944\nBotsfordview, OR 91686-6293', '2017-05-13', 48, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(24, 'Cierra Bartoletti', '<NAME>', 5, 486, '<NAME> PhD', '3588 Kattie Park Apt. 503\nLake Christopherport, ID 91044-3215', '2001-07-18', 76, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(25, '<NAME>', '<NAME>', 8247518, 57613701, '<NAME>', '3543 Gislason Creek Suite 555\nSouth Meaghanport, MT 77807', '1988-11-18', 53, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(26, '<NAME>', 'Mr. <NAME> MD', 47338, 33904933, '<NAME>', '6219 Shanel Falls Apt. 358\nKundeton, AL 61784', '1972-02-15', 75, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(27, '<NAME>', '<NAME>', 4219, 6, 'Mr. <NAME> I', '7956 Fredy Mission\nFritschside, CA 24185-4632', '2001-04-06', 12, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(28, 'Prof. <NAME> DDS', 'Prof. <NAME>', 436325, 360236, 'Mr. <NAME> MD', '480 Conn Stravenue\nNorth Kaia, DC 81922-2289', '2010-10-09', 22, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(29, '<NAME>', '<NAME> PhD', 6, 735229879, 'Prof. <NAME>', '53880 Michelle Row\nWest Demariofort, AZ 37094', '1988-08-23', 17, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(30, 'Dr. <NAME>', 'Prof. <NAME> DDS', 2748, 418, 'Bria Kautzer IV', '1249 Westley Mall\nNew Katharina, IL 20351', '2008-12-30', 58, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(31, '<NAME>', 'Dr. <NAME> DVM', 14, 5, 'Ms. <NAME> V', '95479 Trent Curve Apt. 729\nSimside, OR 87789', '1992-02-01', 7, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(32, '<NAME>', '<NAME>', 287, 2010786, '<NAME>', '117 Kenton Avenue\nSouth Erlingmouth, NM 27313-2055', '1986-03-09', 48, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(33, 'Prof. <NAME>', '<NAME>', 5528243, 3, 'Mrs. <NAME>', '2709 Mariam Junction\nLindgrenmouth, IL 44598-6318', '2013-05-04', 94, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(34, '<NAME>', '<NAME>', 8951799, 85, '<NAME>', '605 Jonatan View\nBruenbury, NJ 22138', '2003-05-17', 16, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(35, 'Dr. <NAME>', '<NAME>', 9, 27040, 'Amiya Kuvalis Sr.', '96208 Keebler Harbors\nSchroederport, WI 20910', '1983-09-04', 63, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(36, '<NAME> MD', '<NAME>', 94, 49967649, '<NAME>', '238 Myrl Corner\nGeorgianamouth, NH 63161', '1977-06-20', 7, '2018-06-05 22:52:48', '2018-06-05 22:52:48'),
(37, '<NAME>', '<NAME> DVM', 450143990, 85582757, '<NAME>', '4962 Armstrong Causeway Apt. 807\nHeathcotefort, ID 93401', '1993-05-23', 46, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(38, '<NAME>', '<NAME> V', 225, 9247463, '<NAME>', '6264 Nicolas Alley\nJuniorberg, NY 17467-3667', '1991-02-27', 23, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(39, 'Dr. <NAME>', '<NAME>', 6, 7675, 'Mr. <NAME> Sr.', '320 Ledner Circle\nLemkefurt, CO 30018', '2010-04-09', 69, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(40, '<NAME>', 'Dr. <NAME>', 1412167, 4, 'Dr. <NAME> PhD', '5260 Dylan Valley Suite 226\nShanahanbury, AZ 96283', '2000-03-14', 50, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(41, '<NAME>', '<NAME>', 29061, 4794, '<NAME>', '6235 Crona Landing Suite 732\nEast Danemouth, OH 47526-0509', '1991-11-25', 24, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(42, 'Prof. <NAME>', 'Dr. <NAME> DDS', 62768335, 452, '<NAME>', '424 Flatley Groves\nCliftontown, NJ 19047', '1996-11-15', 38, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(43, '<NAME>', 'Prof. <NAME>', 7, 472880, '<NAME>', '5766 Lisa Bypass\nZackerytown, AZ 76280-4225', '1978-01-13', 62, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(44, '<NAME>', 'Miss <NAME>', 260497, 930526117, 'Mrs. <NAME>', '36506 Casper Ridge Suite 050\nLake Rubye, ME 51297', '1989-01-23', 76, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(45, '<NAME>', '<NAME>', 46956, 5716282, '<NAME> DDS', '62073 Wehner Trafficway Apt. 377\nWeberbury, MT 79832-6278', '2002-05-14', 63, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(46, 'Ms. <NAME>', '<NAME>', 86253295, 88, '<NAME>', '808 Glenna Neck Suite 188\nDonnellyville, MD 09974', '1970-05-06', 13, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(47, '<NAME>', 'Dr. <NAME>', 845444889, 6, '<NAME>', '197 Schuppe Parks\nNew Ephraimmouth, OK 50376', '1989-08-05', 63, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(48, '<NAME>', '<NAME>', 86, 512, '<NAME>', '4778 Alia Lights Suite 825\nCristalton, WA 97407-6138', '1977-02-10', 0, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(49, '<NAME>', '<NAME>', 4, 307, 'Dr. <NAME>', '5712 Myron Mountain\nHermanchester, DE 20057', '2008-02-12', 92, '2018-06-05 22:52:49', '2018-06-05 22:52:49'),
(50, '<NAME>', '<NAME>', 21678, 7, 'Mr. <NAME>', '9630 Ora Meadow Suite 220\nNew Vedaland, AR 04165', '1983-05-29', 94, '2018-06-05 22:52:49', '2018-06-05 22:52:49');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) 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
(20, '2014_10_12_000000_create_users_table', 1),
(21, '2014_10_12_100000_create_password_resets_table', 1),
(22, '2018_06_01_072229_create_emps_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default.jpg',
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `emps`
--
ALTER TABLE `emps`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `emps`
--
ALTER TABLE `emps`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED 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 `prefix`
ADD COLUMN IF NOT EXISTS `id` CHAR(12) NOT NULL,
ADD COLUMN IF NOT EXISTS `guild_id` VARCHAR(21) NOT NULL,
ADD COLUMN IF NOT EXISTS `value` VARCHAR(25) NOT NULL,
ADD COLUMN IF NOT EXISTS `space` TINYINT(1) NOT NULL DEFAULT 0,
-- Indexes
ADD UNIQUE INDEX IF NOT EXISTS `id` (`id`),
ADD UNIQUE INDEX IF NOT EXISTS `value_guild` (`value`, `guild_id`),
ADD INDEX IF NOT EXISTS `guild_id` (`guild_id`),
-- Foreign Keys
ADD CONSTRAINT `fk_prefix_guildid` FOREIGN KEY IF NOT EXISTS (`guild_id`) REFERENCES `guilds` (`id`);
|
<filename>ontask/tests/fixtures/all_key_columns.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.2
-- Dumped by pg_dump version 11.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: __ONTASK_WORKFLOW_TABLE_1; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."__ONTASK_WORKFLOW_TABLE_1" (
"Name" text,
"Column 1" bigint,
"Column 2" bigint,
"Column 3" bigint
);
--
-- Data for Name: __ONTASK_WORKFLOW_TABLE_1; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public."__ONTASK_WORKFLOW_TABLE_1" ("Name", "Column 1", "Column 2", "Column 3") FROM stdin;
Firas Moosvi 50 60 100
\.
--
-- PostgreSQL database dump complete
--
|
<reponame>edenia/proton-affiliate
DROP TABLE "public"."referral";
|
-- where2.test
--
-- execsql {
-- CREATE INDEX i11cccccccc ON t11(c,c,c,c,c,c,c,c); -- repeated column
-- SELECT d FROM t11 WHERE c=9;
-- }
CREATE INDEX i11cccccccc ON t11(c,c,c,c,c,c,c,c); -- repeated column
SELECT d FROM t11 WHERE c=9; |
-- file:create_table_like.sql ln:54 expect:true
CREATE TABLE inhg (x text, LIKE inhx INCLUDING INDEXES, y text)
|
-- file:inherit.sql ln:308 expect:true
drop table p2 cascade
|
<reponame>Danial41/-
--
-- Make #__user_keys.user_id fit to #__users.username
--
ALTER TABLE `#__user_keys` MODIFY `user_id` varchar(150) NOT NULL;
|
<gh_stars>1-10
UPDATE `gameobject_template` SET `ScriptName`='go_main_chambers_access_panel' WHERE `entry` IN (184125,184126);
|
<filename>PDBX.sql
--
-- basic db schema for RCSB ligand expo
--
drop schema if exists ligand_expo cascade;
create schema ligand_expo;
-- chem_comp
create table ligand_expo.chem_comp (
formula text,
formula_weight text,
id text primary key,
model_details text,
model_erf text,
model_source text,
mon_nstd_class text,
mon_nstd_details text,
mon_nstd_flag text,
mon_nstd_parent text,
mon_nstd_parent_comp_id text,
name text,
number_atoms_all integer,
number_atoms_nh integer,
one_letter_code text,
pdbx_ambiguous_flag text,
pdbx_component_no text,
pdbx_formal_charge text,
pdbx_ideal_coordinates_details text,
pdbx_ideal_coordinates_missing_flag text,
pdbx_initial_date date,
pdbx_model_coordinates_db_code text,
pdbx_model_coordinates_details text,
pdbx_model_coordinates_missing_flag text,
pdbx_modification_details text,
pdbx_modified_date date,
pdbx_processing_site text,
pdbx_release_status text,
pdbx_replaced_by text,
pdbx_replaces text,
pdbx_subcomponent_list text,
pdbx_synonyms text,
pdbx_type text,
three_letter_code text,
type text );
-- chem_comp_atom
create table ligand_expo.chem_comp_atom (
alt_atom_id text,
atom_id text,
charge text,
comp_id text,
model_Cartn_x text,
model_Cartn_x_esd text,
model_Cartn_y text,
model_Cartn_y_esd text,
model_Cartn_z text,
model_Cartn_z_esd text,
partial_charge text,
pdbx_align text,
pdbx_alt_atom_id text,
pdbx_stnd_atom_id text,
pdbx_alt_comp_id text,
pdbx_aromatic_flag text,
pdbx_component_atom_id text,
pdbx_component_comp_id text,
pdbx_leaving_atom_flag text,
pdbx_model_Cartn_x_ideal text,
pdbx_model_Cartn_y_ideal text,
pdbx_model_Cartn_z_ideal text,
pdbx_ordinal integer,
pdbx_stereo_config text,
substruct_code text,
type_symbol text,
unique( comp_id, atom_id ),
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- chem_comp_angle
create table ligand_expo.chem_comp_angle (
atom_id_1 text,
atom_id_2 text,
atom_id_3 text,
comp_id text,
value_angle text,
value_angle_esd text,
value_dist text,
value_dist_esd text,
foreign key( comp_id, atom_id_1 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_2 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_3 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- chem_comp_bond
create table ligand_expo.chem_comp_bond (
atom_id_1 text,
atom_id_2 text,
comp_id text,
pdbx_aromatic_flag text,
pdbx_ordinal integer,
pdbx_stereo_config text,
value_dist text,
value_dist_esd text,
value_order text,
foreign key( comp_id, atom_id_1 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_2 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- chem_comp_chir
create table ligand_expo.chem_comp_chir (
atom_config text,
atom_id text,
comp_id text,
id text,
number_atoms_all integer,
number_atoms_nh integer,
volume_flag text,
volume_three text,
volume_three_esd text,
unique (comp_id, atom_id, id ),
foreign key( comp_id, atom_id ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- chem_comp_chir_atom
create table ligand_expo.chem_comp_chir_atom (
atom_id text,
chir_id text,
comp_id text,
dev text,
foreign key( chir_id, comp_id, atom_id ) references ligand_expo.chem_comp_chir( id, comp_id, atom_id ) on delete cascade
);
-- chem_comp_plane
create table ligand_expo.chem_comp_plane (
comp_id text,
id text,
number_atoms_all integer,
number_atoms_nh integer,
unique( comp_id, id ),
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- chem_comp_plane_atom
create table ligand_expo.chem_comp_plane_atom (
atom_id text,
comp_id text,
dist_esd text,
plane_id text,
foreign key( comp_id, atom_id ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( plane_id, comp_id ) references ligand_expo.chem_comp_plane( id, comp_id ) on delete cascade
);
-- chem_comp_tor
create table ligand_expo.chem_comp_tor (
atom_id_1 text,
atom_id_2 text,
atom_id_3 text,
atom_id_4 text,
comp_id text,
id text,
unique( comp_id, id ),
foreign key( comp_id, atom_id_1 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_2 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_3 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_4 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- chem_comp_tor_value
create table ligand_expo.chem_comp_tor_value (
angle text,
angle_esd text,
comp_id text,
dist text,
dist_esd text,
tor_id text,
foreign key( tor_id, comp_id ) references ligand_expo.chem_comp_tor( id, comp_id ) on delete cascade
);
-- pdbx_chem_comp_atom_edit
create table ligand_expo.pdbx_chem_comp_atom_edit (
atom_id text,
comp_id text,
edit_atom_id text,
edit_atom_value text,
edit_op text,
ordinal integer,
foreign key( comp_id, atom_id ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- pdbx_chem_comp_atom_feature
create table ligand_expo.pdbx_chem_comp_atom_feature (
atom_id text,
comp_id text,
feature_type text,
foreign key( comp_id, atom_id ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- pdbx_chem_comp_audit
create table ligand_expo.pdbx_chem_comp_audit (
action_type text,
annotator text,
comp_id text,
date date,
details text,
processing_site text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- pdbx_chem_comp_bond_edit
create table ligand_expo.pdbx_chem_comp_bond_edit (
atom_id_1 text,
atom_id_2 text,
comp_id text,
edit_bond_value text,
edit_op text,
ordinal integer,
foreign key( comp_id, atom_id_1 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade,
foreign key( comp_id, atom_id_2 ) references ligand_expo.chem_comp_atom( comp_id, atom_id ) on delete cascade
);
-- pdbx_chem_comp_descriptor
create table ligand_expo.pdbx_chem_comp_descriptor (
comp_id text,
descriptor text,
ordinal integer,
program text,
program_version text,
type text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- pdbx_chem_comp_feature
create table ligand_expo.pdbx_chem_comp_feature (
comp_id text,
source text,
support text,
type text,
value text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- pdbx_chem_comp_identifier
create table ligand_expo.pdbx_chem_comp_identifier (
comp_id text,
identifier text,
ordinal integer,
program text,
program_version text,
type text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- pdbx_chem_comp_import
create table ligand_expo.pdbx_chem_comp_import (
comp_id text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
-- pdbx_chem_comp_synonyms
create table ligand_expo.pdbx_chem_comp_synonyms (
ordinal integer,
comp_id text,
name text,
provenance text,
"type" text,
foreign key( comp_id ) references ligand_expo.chem_comp( id ) on delete cascade
);
|
<gh_stars>0
/* C2 Compute-optimized */
/* https://cloud.google.com/compute/docs/machine-types#machine_type_comparison */
/* https://cloud.google.com/compute/docs/compute-optimized-machines#c2_machine_types */
UPDATE instances SET
series = 'c2',
family = 'Compute-optimized',
cpuPlatform = 'Cascade Lake',
localSsd = '1',
sud = '1',
spot = '1'
WHERE name LIKE 'c2-%';
UPDATE instances SET bandwidth = '10' WHERE name LIKE 'c2-%-4';
UPDATE instances SET bandwidth = '16' WHERE name LIKE 'c2-%-8';
UPDATE instances SET bandwidth = '32' WHERE name LIKE 'c2-%-16';
UPDATE instances SET bandwidth = '32', tier1 = '50' WHERE name LIKE 'c2-%-30';
UPDATE instances SET bandwidth = '32', tier1 = '100' WHERE name LIKE 'c2-%-60'; |
<reponame>carsonhynes/ThoughtHub
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 21, 2015 at 08:51 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `thoughthub`
--
CREATE DATABASE IF NOT EXISTS `thoughthub` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `thoughthub`;
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE IF NOT EXISTS `comments` (
`sID` smallint(6) NOT NULL,
`cID` smallint(6) NOT NULL,
`uID` smallint(6) NOT NULL,
`comment` mediumtext NOT NULL,
`udate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `saved`
--
CREATE TABLE IF NOT EXISTS `saved` (
`uID` int(11) NOT NULL,
`list` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `submissions`
--
CREATE TABLE IF NOT EXISTS `submissions` (
`sID` smallint(6) NOT NULL,
`title` text NOT NULL,
`description` mediumtext NOT NULL,
`udate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`uID` smallint(6) NOT NULL,
`rating` smallint(6) NOT NULL,
`contributors` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`uID` smallint(6) NOT NULL,
`name` tinytext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`sID`);
--
-- Indexes for table `submissions`
--
ALTER TABLE `submissions`
ADD PRIMARY KEY (`sID`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`uID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `sID` smallint(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `submissions`
--
ALTER TABLE `submissions`
MODIFY `sID` smallint(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `uID` smallint(6) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
ALTER TABLE T_CM_USER2INSTS ADD CONSTRAINT FK_CM_USER2INSTS_UID FOREIGN KEY (USER_ID) REFERENCES T_CM_USER (ID) ON DELETE CASCADE;
ALTER TABLE T_CM_USER2INSTS ADD CONSTRAINT FK_CM_USER2INSTS_IID FOREIGN KEY (INST_ID) REFERENCES T_CM_INST (ID) ON DELETE CASCADE; |
--
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You 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.
--
-- tests for check constraints
autocommit off;
-- negative
-- The following are not allowed in check constraints:
-- ?, subquery, datetime functions
create table neg1(c1 int check(?));
create table neg1(c1 int check(c1 in (select c1 from neg1)));
create table neg1(c1 int check(CURRENT_DATE = CURRENT_DATE));
create table neg1(c1 int check(CURRENT_TIME = CURRENT_TIME));
create table neg1(c1 int check(CURRENT_TIMESTAMP = CURRENT_TIMESTAMP));
-- The check constraint definition must evaluate to a boolean
create table neg1(c1 int check(c1));
create table neg1(c1 int check(1));
create table neg1(c1 int check(c1+c1));
-- All column references are to target table
create table neg1(c1 int check((c2 = 1)));
-- verify that a check constraint can't be used as an optimizer override
create table t1(c1 int constraint asdf check(c1 = 1));
select * from t1 --gemfirexd-properties constraint = asdf
;
-- alter table t1 drop constraint asdf;
rollback;
-- alter table t1 drop constraint asdf;
-- forward references should fail
create table neg1(c1 int check(c2 = 1), c2 int);
create table neg2(c1 int constraint asdf check(c2 = 1), c2 int);
rollback;
-- positive
-- multiple check constraints on same table
create table pos1(c1 int check(c1 > 0), constraint asdf check(c1 < 10));
-- verify both constraints are enforced
insert into pos1 values 0;
insert into pos1 values 1;
insert into pos1 values 9;
insert into pos1 values 10;
select * from pos1;
-- verify constraint violation rolls back entire statement
update pos1 set c1 = c1 + 1;
select * from pos1;
update pos1 set c1 = c1 - 1;
select * from pos1;
rollback;
-- conflicting constraints, should fail
create table negcks(c1 int constraint ck1st check(c1 > 4), c2 int constraint ck2nd check(c2 > 2), c3 int, constraint ckLast check(c2 > c1));
-- constraint ck1st fails
insert into negcks values (1, 3, 3);
-- constraint ckLast fails (ck2nd fails too)
insert into negcks values (5, 1, 3);
-- constraint ck1st fails (ckLast fails too)
insert into negcks values (2, 3, 3);
rollback;
-- same source and target tables
create table pos1(c1 int, c2 int, constraint ck1 check (c1 < c2));
insert into pos1 values (1, 2), (2, 3), (3, 4);
commit;
-- these should work
insert into pos1 select * from pos1;
select count(*) from pos1;
update pos1 set c2 = (select max(c1) from pos1),
c1 = (select min(c2) from pos1);
select * from pos1;
rollback;
-- these should fail
insert into pos1 select c2, c1 from pos1;
select count(*) from pos1;
update pos1 set c2 = (select min(c1) from pos1),
c1 = (select max(c2) from pos1);
select * from pos1;
drop table pos1;
commit;
-- union under insert
create table t1(c1 int, c2 int, constraint ck1 check(c1 = c2));
insert into t1 values (1, 1), (2, 1);
select * from t1;
-- normalize result set under insert/update
insert into t1 values (1.0, 1);
insert into t1 values (2.0, 1);
select * from t1;
update t1 set c2 = 1.0;
update t1 set c2 = 2.0;
select * from t1;
update t1 set c1 = 3.0, c2 = 3.0;
select * from t1;
rollback;
-- positioned update
create table t1(c1 int, c2 int, constraint ck1 check(c1 = c2), constraint ck2 check(c2=c1));
insert into t1 values (1, 1), (2, 2), (3, 3), (4, 4);
create index i1 on t1(c1);
get cursor c1 as 'select * from t1 where c2 = 2 for update of c1';
next c1;
-- this update should succeed
update t1 set c1 = c1 where current of c1;
-- this update should fail
update t1 set c1 = c1 + 1 where current of c1;
close c1;
get cursor c2 as 'select * from t1 where c1 = 2 for update of c2';
next c2;
-- this update should succeed
update t1 set c2 = c2 where current of c2;
-- this update should fail
update t1 set c2 = c2 + 1 where current of c2;
close c2;
get cursor c3 as 'select * from t1 where c1 = 2 for update of c1, c2';
next c3;
-- this update should succeed
update t1 set c2 = c1, c1 = c2 where current of c3;
-- this update should fail
update t1 set c2 = c2 + 1, c1 = c1 + 3 where current of c3;
-- this update should succeed
update t1 set c2 = c1 + 3, c1 = c2 + 3 where current of c3;
select * from t1;
close c3;
rollback;
-- complex expressions
create table t1(c1 int check((c1 + c1) = (c1 * c1) or
(c1 + c1)/2 = (c1 * c1)), c2 int);
-- this insert should succeed
insert into t1 values (1, 9), (2, 10);
-- these updates should succeed
update t1 set c2 = c2 * c2;
update t1 set c1 = 2 where c1 = 1;
update t1 set c1 = 1 where c1 = 2;
-- this update should fail
update t1 set c1 = c2;
select * from t1;
rollback;
-- built-in functions in a check constraint
create table charTab (c1 char(4) check(CHAR(c1) = c1));
insert into charTab values 'asdf';
insert into charTab values 'fdsa';
-- beetle 5805 - support built-in function INT
-- should fail until beetle 5805 is implemented
create table intTab (c1 int check(INT(1) = c1));
insert into intTab values 1;
-- this insert should fail, does not satisfy check constraint
insert into intTab values 2;
create table maxIntTab (c1 int check(INT(2147483647) > c1));
insert into maxIntTab values 1;
-- this insert should fail, does not satisfy check constraint
insert into maxIntTab values 2147483647;
rollback;
-- verify that inserts, updates and statements with forced constraints are
-- indeed dependent on the constraints
create table t1(c1 int not null constraint asdf primary key);
insert into t1 values 1, 2, 3, 4, 5;
commit;
prepare p1 as 'insert into t1 values 1';
prepare p2 as 'update t1 set c1 = 3 where c1 = 4';
prepare p3 as 'select * from t1';
-- the insert and update should fail, select should succeed
execute p1;
execute p2;
execute p3;
alter table t1 drop constraint asdf;
-- rollback and verify that constraints are enforced and select succeeds
rollback;
execute p1;
execute p2;
execute p3;
remove p1;
remove p2;
remove p3;
drop table t1;
-- check constraints with parameters
create table t1(c1 int constraint asdf check(c1 = 1));
prepare p1 as 'insert into t1 values (?)';
execute p1 using 'values (1)';
-- clean up
drop table t1;
create table t1(active_flag char(2) check(active_flag IN ('Y', 'N')), araccount_active_flag char(2) check(araccount_active_flag IN ('Y', 'N')), automatic_refill_flag char(2) check(automatic_refill_flag IN ('Y', 'N')), call_when_ready_flag char(2) check(call_when_ready_flag IN ('Y', 'N')), compliance_flag char(2) check(compliance_flag IN ('Y', 'N')), delivery_flag char(2) check(delivery_flag IN ('Y', 'N')), double_count_flag char(2) check(double_count_flag IN ('Y', 'N')), gender_ind char(2) check(gender_ind IN ('M', 'F', 'U')), geriatric_flag char(2) check(geriatric_flag IN ('Y', 'N')), refuse_inquiry_flag char(2) check(refuse_inquiry_flag IN ('Y', 'N')), animal_flag char(2) check(animal_flag IN ('Y', 'N')), terminal_flag char(2) check(terminal_flag IN ('Y', 'N')), unit_flag char(2) check(unit_flag IN ('Y', 'N')), VIP_flag char(2) check(VIP_flag IN ('Y', 'N')), snap_cap_flag char(2) check(snap_cap_flag IN ('Y', 'N')), consent_on_file_flag char(2) check(consent_on_file_flag IN ('Y', 'N')), enlarged_SIG_flag char(2) check(enlarged_SIG_flag IN ('Y', 'N')),aquired_patient_flag char(2) check(aquired_patient_flag IN ('Y', 'N')));
-- bug 5622 - internal generated constraint names are re-worked to match db2's naming convention.
drop table t1;
create table t1 (c1 int not null primary key, c2 int not null unique, c3 int check (c3>=0));
alter table t1 add column c4 int not null default 1;
alter table t1 add constraint c4_unique UNIQUE(c4);
alter table t1 add column c5 int check(c5 >= 0);
select c.constraintname, c.type from sys.sysconstraints c, sys.systables t where c.tableid = t.tableid and tablename='T1';
drop table t2;
create table t2 (c21 int references t1);
select c.constraintname, c.type from sys.sysconstraints c, sys.systables t where c.tableid = t.tableid and tablename='T2';
drop table t3;
create table t3 (c1 int check (c1 >= 0), c2 int check (c2 >= 0), c3 int check (c3 >= 0), c4 int check (c4 >= 0), c5 int check (c5 >= 0),
c6 int check (c6 >= 0), c7 int check (c7 >= 0), c8 int check (c8 >= 0), c9 int check (c9 >= 0), c10 int check (c10 >= 0),
c11 int check (c11 >= 0), c12 int check (c12 >= 0), c13 int check (c13 >= 0));
select c.constraintname, c.type from sys.sysconstraints c, sys.systables t where c.tableid = t.tableid and tablename='T3';
drop table t4;
create table t4(c11 int not null, c12 int not null, primary key (c11, c12));
select c.constraintname, c.type from sys.sysconstraints c, sys.systables t where c.tableid = t.tableid and tablename='T4';
-- DERBY-2989
CREATE TABLE "indicator" (c CHAR(1) DEFAULT 'N');
ALTER TABLE "indicator" ADD CONSTRAINT my_constraint CHECK ((c IN ('Y','N')));
INSERT INTO "indicator" VALUES ('N');
ALTER TABLE "indicator" DROP CONSTRAINT my_constraint;
DROP TABLE "indicator";
|
<gh_stars>1-10
/*
* Copyright (c) 2010-2015 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*
* This query presents each animal's birth date, combining values from the Birth dataset
* and information from the demographics record. If an animal's birth date appears here
* as null, we don't know when the animal was born.
*/
SELECT demographics.Id, births.date, births.description,
CASE
WHEN (demographics.origin = 'cen') THEN TRUE
ELSE FALSE
END as bornAtCenter
FROM study.demographics as demographics
FULL JOIN (
SELECT
events.Id,
cast(events.date as DATE) as date, -- Ensure it's a date, not a timestamp
events.date as dateWithTime,
GROUP_CONCAT(DISTINCT events.remark, ';') as description
FROM (
SELECT Id,date,remark FROM study.birth
WHERE qcstate.publicdata = TRUE
UNION
SELECT
Id,
birth as date,
'[calculated from demographics dataset]' as remark
FROM study.demographics AS demographics
WHERE demographics.birth IS NOT NULL
) as events
GROUP BY events.date, events.Id
) as births
ON (births.Id = demographics.Id) |
<filename>Source/tSQLt.(at)tSQLt_MaxSqlMajorVersion.sfn.sql
IF OBJECT_ID('tSQLt.[@tSQLt:MaxSqlMajorVersion]') IS NOT NULL DROP FUNCTION tSQLt.[@tSQLt:MaxSqlMajorVersion];
GO
---Build+
GO
CREATE FUNCTION tSQLt.[@tSQLt:MaxSqlMajorVersion](@MaxVersion INT)
RETURNS TABLE
AS
RETURN
SELECT AF.*
FROM (SELECT PSSV.Major FROM tSQLt.Private_SqlVersion() AS PSV CROSS APPLY tSQLt.Private_SplitSqlVersion(PSV.ProductVersion) AS PSSV) AV
CROSS APPLY tSQLt.[@tSQLt:SkipTest]('Maximum allowed version is '+
CAST(@MaxVersion AS NVARCHAR(MAX))+
', but current version is '+
CAST(AV.Major AS NVARCHAR(MAX))+'.'
) AS AF
WHERE @MaxVersion < AV.Major
GO
---Build-
GO
|
<filename>src/github.com/stellar/gateway/db/drivers/mysql/migrations_compliance/02_auth_data.sql<gh_stars>1-10
-- +migrate Up
CREATE TABLE `AuthData` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`request_id` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
`auth_data` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `request_id` (`request_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- +migrate Down
DROP TABLE `AuthData`;
|
REM
REM Standard disclaimer - anything in here can be used at your own risk.
REM
REM It is possible you'll need to edit the script for correct usernames/passwords, missing information etc.
REM
REM No warranty or liability etc etc etc. See the license file in the git repo root
REM
REM *** USE AT YOUR OWN RISK ***
REM
set echo on
drop table basketball purge;
create table basketball
( player varchar2(10) collate using_nls_comp,
game date,
tstamp date,
quarter number(*,0),
points number(*,0)
) ;
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Matt',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Rory',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Will',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Max',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Rory',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Max',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Matt',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Rory',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Max',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Will',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Matt',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Max',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,3);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Campbell',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),1,2);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Zack',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,1);
Insert into BASKETBALL (PLAYER,GAME,TSTAMP,QUARTER,POINTS) values ('Robbie',to_date('07/MAY/21','DD/MON/RR'),to_date('07/MAY/21','DD/MON/RR'),2,2);
select quarter,
nvl2(rownum,max(player),null) player,
nvl2(rownum,max(tstamp),null) tstamp,
sum(points)
from basketball
group by rollup(quarter,rownum)
order by quarter,tstamp;
select quarter,player,sum(points) from basketball
group by cube(quarter,player);
select quarter,player,sum(points)
from basketball
group by grouping sets (
(player),(quarter), () );
select qtr, player, pts
from
( select quarter, player, sum(points) pts
from basketball
group by quarter, player ) b
right outer join
( select rownum qtr from dual connect by level <= 4 ) q
on ( q.qtr = b.quarter )
order by 2,1;
select qtr, player, nvl(pts,0)
from
( select quarter, player, sum(points) pts
from basketball
group by quarter, player ) b
partition by (b.player)
right outer join
( select rownum qtr from dual connect by level <= 4 ) q
on ( q.qtr = b.quarter )
order by 2,1;
select rank(13) within group ( order by pts ) ranking
from
( select player, sum(points) pts
from basketball
group by player
);
select
quarter,
rank(4) within group ( order by pts ) ranking
from
( select player, quarter, sum(points) pts
from basketball
group by player, quarter
)
group by quarter
order by 1;
drop table aust_rules purge;
create table aust_rules
( player# number(*,0),
quarter number(*,0),
position varchar2(20) collate using_nls_comp,
stops number(*,0),
goals number(*,0)
) ;
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (2,2,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (3,3,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (4,4,'Defense',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (5,1,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (6,2,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (7,3,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (8,4,'Centre',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (9,1,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (10,2,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (11,3,'Forward',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (12,4,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (13,1,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (14,2,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (15,3,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (16,4,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (17,1,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (18,2,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (19,3,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (20,4,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (21,1,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (22,2,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (23,3,'Centre',2,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (24,4,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (25,1,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (1,2,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (2,3,'Forward',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (3,4,'Centre',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (4,1,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (5,2,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (6,3,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (7,4,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (8,1,'Centre',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (9,2,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (10,3,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (11,4,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (12,1,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (13,2,'Centre',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (14,3,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (15,4,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (16,1,'Forward',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (17,2,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (18,3,'Centre',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (19,4,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (20,1,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (21,2,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (22,3,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (23,4,'Centre',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (24,1,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (25,2,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (1,3,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (2,4,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (3,1,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (4,2,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (5,3,'Defense',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (6,4,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (7,1,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (8,2,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (9,3,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (10,4,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (11,1,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (12,2,'Forward',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (13,3,'Centre',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (14,4,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (15,1,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (16,2,'Forward',2,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (17,3,'Forward',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (18,4,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (19,1,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (20,2,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (21,3,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (22,4,'Forward',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (23,1,'Centre',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (24,2,'Defense',2,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (25,3,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (1,4,'Forward',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (2,1,'Forward',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (3,2,'Centre',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (4,3,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (5,4,'Defense',1,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (6,1,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (7,2,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (8,3,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (9,4,'Defense',2,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (10,1,'Defense',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (11,2,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (12,3,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (13,4,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (14,1,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (15,2,'Defense',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (16,3,'Forward',0,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (17,4,'Forward',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (18,1,'Centre',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (19,2,'Defense',2,1);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (20,3,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (21,4,'Forward',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (22,1,'Forward',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (23,2,'Centre',0,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (24,3,'Defense',1,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (25,4,'Defense',2,0);
Insert into AUST_RULES (PLAYER#,QUARTER,POSITION,STOPS,GOALS) values (1,1,'Forward',0,0);
with
player_total as
( select player#, sum(goals) goals_per_player
from aust_rules
group by player#
),
avg_goals as
( select avg(goals_per_player) avg_goals
from player_total
)
select *
from player_total,
avg_goals
where goals_per_player > avg_goals
order by 1;
with raw_data as (
select qtr, player, pts
from
( select quarter, player, sum(points) pts
from basketball
group by quarter, player ) b
partition by (b.player)
right outer join
( select rownum qtr from dual connect by level <= 4 ) q
on ( q.qtr = b.quarter )
)
select
json_arrayagg(
json_object(key player value pts )
order by qtr ) as results
from raw_data;
drop table shopping purge;
drop table hardware purge;
create table shopping
( item varchar2(20) collate using_nls_comp,
weight number(*,0)
) ;
create table hardware
( item varchar2(20) collate using_nls_comp,
weight number(*,0)
) ;
Insert into SHOPPING (ITEM,WEIGHT) values ('milk',1000);
Insert into SHOPPING (ITEM,WEIGHT) values ('bread',650);
Insert into SHOPPING (ITEM,WEIGHT) values ('dogfood',490);
Insert into SHOPPING (ITEM,WEIGHT) values ('biscuits',250);
Insert into SHOPPING (ITEM,WEIGHT) values ('soda',1500);
Insert into SHOPPING (ITEM,WEIGHT) values ('gin',2100);
Insert into SHOPPING (ITEM,WEIGHT) values ('apples',900);
Insert into SHOPPING (ITEM,WEIGHT) values ('bananas',1200);
Insert into SHOPPING (ITEM,WEIGHT) values ('carrots',650);
Insert into SHOPPING (ITEM,WEIGHT) values ('steak',550);
Insert into SHOPPING (ITEM,WEIGHT) values ('icecream',1240);
Insert into SHOPPING (ITEM,WEIGHT) values ('butter',450);
Insert into SHOPPING (ITEM,WEIGHT) values ('honey',370);
Insert into SHOPPING (ITEM,WEIGHT) values ('vegemite',540);
Insert into SHOPPING (ITEM,WEIGHT) values ('ketchup',290);
Insert into SHOPPING (ITEM,WEIGHT) values ('eggs',800);
Insert into SHOPPING (ITEM,WEIGHT) values ('detergent',950);
Insert into SHOPPING (ITEM,WEIGHT) values ('deodrant',220);
Insert into HARDWARE (ITEM,WEIGHT) values ('chisel',400);
Insert into HARDWARE (ITEM,WEIGHT) values ('hammer',1200);
Insert into HARDWARE (ITEM,WEIGHT) values ('chainsaw',12000);
Insert into HARDWARE (ITEM,WEIGHT) values ('screwdriver',800);
Insert into HARDWARE (ITEM,WEIGHT) values ('paint',2000);
Insert into HARDWARE (ITEM,WEIGHT) values ('rake',1500);
Insert into HARDWARE (ITEM,WEIGHT) values ('shovel',3000);
Insert into HARDWARE (ITEM,WEIGHT) values ('drill',2500);
Insert into HARDWARE (ITEM,WEIGHT) values ('padlock',800);
Insert into HARDWARE (ITEM,WEIGHT) values ('tap',750);
Insert into HARDWARE (ITEM,WEIGHT) values ('sink',2100);
Insert into HARDWARE (ITEM,WEIGHT) values ('powerwasher',9000);
Insert into HARDWARE (ITEM,WEIGHT) values ('wood',2000);
Insert into HARDWARE (ITEM,WEIGHT) values ('broom',1200);
Insert into HARDWARE (ITEM,WEIGHT) values ('vice',5000);
Insert into HARDWARE (ITEM,WEIGHT) values ('hacksaw',1200);
Insert into HARDWARE (ITEM,WEIGHT) values ('bucket',500);
Insert into HARDWARE (ITEM,WEIGHT) values ('transformer',2000);
select *
from shopping
match_recognize (
order by weight desc
measures
classifier() bag#,
sum(bag1.weight) bag1,
sum(bag2.weight) bag2,
sum(bag3.weight) bag3,
sum(bag4.weight) bag4
all rows per match
pattern ( (bag1|bag2|bag3|bag4)* )
define
bag1 as count(bag1.*) = 1 or
sum(bag1.weight)-bag1.weight <=
least(sum(bag2.weight),sum(bag3.weight),sum(bag4.weight))
, bag2 as count(bag2.*) = 1 or
sum(bag2.weight)-bag2.weight <=
least(sum(bag3.weight),sum(bag4.weight))
, bag3 as count(bag3.*) = 1 or
sum(bag3.weight)-bag3.weight <= sum(bag4.weight)
);
with portions as
(
select *
from shopping
match_recognize (
order by weight desc
measures
classifier() bag#,
sum(bag1.weight) bag1,
sum(bag2.weight) bag2,
sum(bag3.weight) bag3,
sum(bag4.weight) bag4
all rows per match
pattern ( (bag1|bag2|bag3|bag4)* )
define
bag1 as count(bag1.*) = 1 or
sum(bag1.weight)-bag1.weight <=
least(sum(bag2.weight),sum(bag3.weight),sum(bag4.weight))
, bag2 as count(bag2.*) = 1 or
sum(bag2.weight)-bag2.weight <=
least(sum(bag3.weight),sum(bag4.weight))
, bag3 as count(bag3.*) = 1 or
sum(bag3.weight)-bag3.weight <= sum(bag4.weight)
)
)
select
bag#,
listagg(item,',') within group ( order by item ) as items,
sum(weight)/1000 kg
from portions
group by bag#;
create or replace
function pack_and_carry(p_tab dbms_tf.table_t,
p_bags dbms_tf.columns_t) return clob sql_macro is
l_sql clob;
l_bag varchar2(1000);
l_sum varchar2(4000);
l_pattern varchar2(4000);
l_cnt int := to_number(trim('"' from p_bags(1)));
begin
for i in 1 .. l_cnt loop
l_bag := l_bag || 'bag'||i||'|';
l_sum := l_sum || replace('sum(bag@.weight) bag@,','@',i)||chr(10);
if i < l_cnt then
if i < l_cnt-1 then
l_pattern := l_pattern || replace(',bag@ as count(bag@.*) = 1
or sum(bag@.weight)-bag@.weight <= least(','@',i);
else
l_pattern := l_pattern || replace(',bag@ as count(bag@.*) = 1
or sum(bag@.weight)-bag@.weight <= ','@',i);
end if;
for j in i+1 .. l_cnt loop
l_pattern := l_pattern ||replace('sum(bag@.weight),','@',j);
end loop;
l_pattern := rtrim(l_pattern,',')||')'||chr(10);
end if;
end loop;
l_sql := q'{
select *
from p_tab
match_recognize (
order by weight desc
measures
classifier() bag#,
~~~
all rows per match
pattern ( (###)* )
define
$$$
}';
l_sql := replace(l_sql,'###',rtrim(l_bag,'|'));
l_sql := replace(l_sql,'~~~',rtrim(l_sum,','||chr(10)));
l_sql := replace(l_sql,'$$$',ltrim(l_pattern,','));
return l_sql;
end;
/
select
bag#,
listagg(item,',') within group ( order by item ) as items,
sum(weight)/1000 kg
from pack_and_carry(shopping,columns("4"))
group by bag#;
select
bag#,
listagg(item,',') within group ( order by item ) as items,
sum(weight)/1000 kg
from pack_and_carry(shopping,columns("3"))
group by bag#;
select
bag#,
listagg(item,',') within group ( order by item ) as items,
sum(weight)/1000 kg
from pack_and_carry(hardware,columns("5"))
group by bag#;
drop table swimming purge;
create table swimming
( sess date,
lap number(*,0),
ela number(6,1),
delta number(6,1) invisible generated always as (ela-60) virtual
) ;
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),1,58.7);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),2,59.7);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),3,60.3);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),4,61.3);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),5,60.7);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),6,59.7);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),7,60.2);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),8,58.6);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),9,59.6);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),10,59.9);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),11,60.4);
Insert into SWIMMING (SESS,LAP,ELA) values (to_date('10/SEP/21','DD/MON/RR'),12,60.1);
select * from swimming
match_recognize (
partition by sess order by lap
measures classifier() pattern, sum(delta) as run_tot
all rows per match
after match skip to next row
pattern (off_tgt* zero)
define zero as sum(delta) = 0
);
drop table car_fuel purge;
create table car_fuel
( dte date,
pctfull number(*,0),
litres number(*,0)
) ;
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('01/AUG/21','DD/MON/RR'),0,45);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('09/AUG/21','DD/MON/RR'),20,37);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('13/AUG/21','DD/MON/RR'),60,22);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('21/AUG/21','DD/MON/RR'),20,20);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('26/AUG/21','DD/MON/RR'),5,60);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('03/SEP/21','DD/MON/RR'),15,32);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('11/SEP/21','DD/MON/RR'),80,15);
Insert into CAR_FUEL (DTE,PCTFULL,LITRES) values (to_date('15/SEP/21','DD/MON/RR'),60,20);
with t as
( select
car_fuel.*,
row_number() over (order by dte ) as seq
from car_fuel
),
results(dte, pctfull, litres, dirt ,seq) as
(
select dte, pctfull, litres, litres*0.05 dirt, seq
from t
where seq = 1
union all
select t.dte, t.pctfull, t.litres,
results.dirt * t.pctfull/60 + t.litres*0.05 , t.seq
from t, results
where t.seq - 1 = results.seq
)
select * from results
order by seq;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Дек 07 2020 г., 16:32
-- Версия сервера: 10.3.22-MariaDB
-- Версия PHP: 7.4.5
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 */;
--
-- База данных: `testredpromo`
--
-- --------------------------------------------------------
--
-- Структура таблицы `cities`
--
CREATE TABLE `cities` (
`id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `cities`
--
INSERT INTO `cities` (`id`, `name`) VALUES
(1, 'Уфа'),
(2, 'Москва'),
(3, 'Краснодар');
-- --------------------------------------------------------
--
-- Структура таблицы `city_news`
--
CREATE TABLE `city_news` (
`id_city` int(11) NOT NULL,
`id_news` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `city_news`
--
INSERT INTO `city_news` (`id_city`, `id_news`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(2, 1),
(2, 3),
(3, 1),
(3, 4);
-- --------------------------------------------------------
--
-- Структура таблицы `news`
--
CREATE TABLE `news` (
`id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL,
`date` datetime NOT NULL DEFAULT current_timestamp(),
`text` varchar(9999) COLLATE utf8mb4_unicode_ci NOT NULL,
`img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`public` tinyint(1) NOT NULL DEFAULT 1,
`favorites` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `news`
--
INSERT INTO `news` (`id`, `title`, `description`, `date`, `text`, `img`, `public`, `favorites`) VALUES
(1, 'Google закроет сервис публикаций 3D-моделей Poly', 'Google объявила о закрытии библиотеки 3D-объектов Poly для разработчиков в сфере AR и VR. Загрузить новый контент в Poly будет будет невозможно после 30 апреля 2021 года. Сервис прекратит работу 30 июня.', '2020-12-05 17:15:46', 'Google объявила о закрытии библиотеки 3D-объектов Poly для разработчиков в сфере AR и VR. Загрузить новый контент в Poly будет будет невозможно после 30 апреля 2021 года. Сервис прекратит работу 30 июня.\r\n\r\nПользователям Poly нужно скачать загруженные в библиотеку 3D-объекты, чтобы их не потерять. В качестве альтернативы разработчики в сфере виртуальной реальности смогут воспользоваться сервисом Sketchfab. Туда можно перенести свои работы, либо воспользоваться аналогами в виде TurboSquid или CGTrader.\r\n\r\nPoly запустили в 2017 году. Сервис предназначался для помощи разработчикам в создании низкополигональных VR-объектов.\r\n\r\nСервис также играл роль библиотеки ресурсов, которой могли пользоваться разработчиками игр и приложений на основе технологий виртуальной реальности. Poly предлагал более простой способ создания 3D-объектов в отличие от Tilt Brush или приложений Autodesk и Blender.\r\n\r\nРанее Google прекратила продажи своих VR-гарнитур Daydream и отказалась от развития платформы, а также закрыла студию Spotlight Stories VR вместе с приложением Daydream Play Movies and TV. Работа платформы Jump VR была прекращена в 2019 году.', 'https://habrastorage.org/webt/ct/l8/v2/ctl8v29or8lpenw99omzh98eg6w.png', 1, 1),
(2, 'Spotify научила модель на основе ИИ искать плагиат в песнях', 'Spotify подала патентную заявку на модель ИИ, которая может искать плагиат в песнях. Согласно патентной документации, инструмент способен находить заимствования на уровне нот, мелодии, аккордов и текстов.', '2020-12-06 19:21:12', 'Spotify подала патентную заявку на модель ИИ, которая может искать плагиат в песнях. Согласно патентной документации, инструмент способен находить заимствования на уровне нот, мелодии, аккордов и текстов.\r\n\r\nДанная модель позволит сразу проверять контент на «детекторе плагиата». Ее обучили на песнях, хранящихся на сервере Spotify.\r\n\r\nМодель ищет заимствования на основе мелодического сходства, сэмплирования или схожести ритмов. Графический пользовательский интерфейс (GUI) способен выделить конкретные куски произведения и подобрать список соответствующих им треков, которые могли быть первоисточником. Потенциально такое программное обеспечение может даже вычислить «значение сходства».\r\n\r\nimage\r\n\r\nКомпания утверждает, что новый инструмент будет полезен самим сочинителям, так как позволит им проверить композицию на оригинальность практически в режиме реального времени.\r\n\r\nЧтобы песню или мелодию не отсеяли как плагиат, музыканты смогут сразу давать отсылки к определенным композициям.\r\n\r\nПо словам представителей Spotify, такая система будет работать гораздо эффективнее, чем ручной отбор. Сейчас модераторам приходится прослушивать несколько тысяч песен, а во многих заимствования невозможно определить с первого раза. При внедрении модели им нужно будет лишь принять финальное решение по композиции. Однако в Spotify пока не говорят, будут ли внедрять изобретение в работу собственной платформы.\r\n\r\nОдним из разработчиков технологии стал эксперт в области искусственного интеллекта Франсуа Паше, которого Spotify нанял в качестве директора своей исследовательской лаборатории технологий для авторов в 2017 году. До этого он был директором лаборатории компьютерных наук Sony в Париже.\r\n\r\nПеред тем, как присоединиться к Spotify, композитор, ученый и музыкальный эксперт курировал исследовательский проект Sony Flow Machines, в результате которого были созданы одни из первых известных современных поп-песен, написанных с помощью искусственного интеллекта, в том числе Daddy\'s Car в стиле Beatles. К 2018 году работа Паше завершилась выпуском Hello World, который был описан как «первый коммерческий альбом с несколькими артистами, созданный с использованием искусственного интеллекта». Сам эксперт тогда заявил, что музыкальный бизнес должен работать с искусственным интеллектом, а не бояться его.\r\n\r\nНовая система может накалить ситуацию в музыкальной индустрии. Поскольку сочетания нот ограничены, они довольно часто повторяются в разных композициях, и это может спровоцировать судебные тяжбы между лейблами и артистами.\r\n\r\nРанее Amazon получила патент на разработку, целью которой является защита стримингового контента от пиратства. Компания разработала методику, при которой личная информация может быть динамически добавлена к потоковому контенту, видимым или скрытым способом. Это позволит обнаружить источник пиратских фильмов, телешоу и даже прямых трансляций.', 'https://habrastorage.org/webt/5f/cc/2d/5fcc2dilhoor8fc-xbjbzrnxhea.jpeg', 1, 1),
(3, 'Постаматы PickPoint стали автоматически открывать дверцы в результате взлома', 'В работе сервиса PickPoint произошел сбой из-за взлома — постаматы начали открывать двери․ Запись об этом появилась в официальном сообществе «VK» (на данный момент удалена). В компании подтвердили факт сбоев.\r\n\r\nСбой зафиксировали 4 декабря в 15:06 мск, добавили в компании.\r\n\r\nPickPoint проведёт восстановление системы в ближайшее время. «Дистанционно провести эту работу невозможно, необходим физический выезд на каждую точку, поэтому работы будут вестись всю ночь. Точки, которые не доступны в ночное время, будут восстановлены завтра с утра», — сообщили в компании.', '2020-12-06 19:25:11', 'В работе сервиса PickPoint произошел сбой из-за взлома — постаматы начали открывать двери․ Запись об этом появилась в официальном сообществе «VK» (на данный момент удалена). В компании подтвердили факт сбоев.\r\n\r\nСбой зафиксировали 4 декабря в 15:06 мск, добавили в компании.\r\n\r\nPickPoint проведёт восстановление системы в ближайшее время. «Дистанционно провести эту работу невозможно, необходим физический выезд на каждую точку, поэтому работы будут вестись всю ночь. Точки, которые не доступны в ночное время, будут восстановлены завтра с утра», — сообщили в компании.\r\n\r\nКомпании просят закрывать двери свидетелей происшествия.', 'https://leonardo.osnova.io/2e66e855-8399-5e0c-999e-3baccc7d794a/-/preview/600/-/format/webp/', 1, 0),
(4, 'Сбербанк открыл облако ML Space для сторонних разработчиков', 'Сбербанк и SberCloud сделали облачную платформу ML Space доступной для всех разработчиков приложений и сервисов на базе технологий ИИ. На ML Space можно запускать процессы распределенного машинного обучения более чем на тысяче GPU.\r\n\r\nПлатформа станет доступна с 12 декабря. Разработчики смогут выполнять различные операции — от ввода данных до автоматического развертывания обученных моделей в облаке SberCloud.', '2020-12-06 19:25:11', 'Сбербанк и SberCloud сделали облачную платформу ML Space доступной для всех разработчиков приложений и сервисов на базе технологий ИИ. На ML Space можно запускать процессы распределенного машинного обучения более чем на тысяче GPU.\r\n\r\nПлатформа станет доступна с 12 декабря. Разработчики смогут выполнять различные операции — от ввода данных до автоматического развертывания обученных моделей в облаке SberCloud.\r\n\r\nПараллельно Сбербанк запускает программу грантов «ML Space для бизнеса». Она предусматривает грант в размере до 1 млн рублей для российских предпринимателей и компаний на создание ML-технологий и внедрение их в свои ИИ-продукты.\r\n\r\nML Space позволяет проводить полный цикл разработки прикладных решений на базе машинного обучения и ориентирована на совместную работу команд специалистов по данным над созданием и развертыванием моделей.\r\n\r\nАрхитектура ML Space сформирована на базе суперкомпьютера «Кристофари», который выполнен на базе вычислительных узлов Nvidia DGX-2. Каждый из узлов включает два процессора Intel Xeon Platinum 8168 24C 2,7 ГГц и поддерживает до 16 графических ускорителей Nvidia Tesla V100 с 32 ГБ памяти HBM2. Суммарная производительность суперкомпьютера составляет 6,7 петафлопс. Он находится на 36 месте в топ-500 самых высокопроизводительных систем мира.\r\n\r\nТехнология LAMA со специальным модулем AutoML позволяет создавать модели машинного обучения в автоматическом режиме. Модуль Environments предназначен для запуска процесса обучения нейросетей и доступа к утилитам для мониторинга потребления ресурсов, моделей и эксперимент-менеджмента, с отслеживанием загрузки ресурсов по разрезам CPU, GPU, RAM в любой момент времени. Модуль Data Catalog отвечает за сбор и управление данными и моделями машинного обучения в многопользовательском режиме для распределенных команд. С помощью модуля AutoDeploy готовые модели можно автоматически в несколько кликов развернуть на мощностях облака SberCloud. Также пользователям доступен сервис TagMe для разметки данных.\r\n\r\nНа платформе настроены популярные фреймворки и библиотеки для ML-разработки, а в качестве среды обучения можно использовать любой Docker-образ.\r\n\r\nПлатформа поддерживает препроцессинг данных GPU с применением Spark, Pandas, NumPy, Scikit-Learn, Matplotlib. Пользователи могут переносить большие данные из файловых систем AmazonS3, Google Cloud Storage и баз данных PostgreSQL, MS-SQL, My SQL, Oracle.\r\n\r\nОплата использования модулей ML Space и потребление вычислительных ресурсов платформы будут тарифицироваться по принципу Pay-As-You-Go («Оплата по мере потребления»). Цена за обучение и препроцессинг будет начинаться от 3 рублей за одну GPU-минуту и от 0,12 рубля за одну CPU-минуту. Инференс будет стоить 0,054 копейки, деплой — от 0,05 рублей за GPU-секунду и от 0,12 рублей за СPU-минуту. Хранение данных будет стоить от 1,2 рубля.', 'https://habrastorage.org/webt/nb/5a/gb/nb5agbbrkczqe3wsx_r8wf5jfi8.png', 1, 0),
(5, 'Исследователи из Бразилии представили модели анализа нравственности на основе языка', 'Исследователи из Бразилии разработали три модели, которые могут описать моральные принципы людей на основе языка, который они используют. Модели оценивают выбор слов человека, чтобы определить его позицию по пяти ключевым нравственным принципам.', '2020-12-07 17:19:40', 'Исследователи из Бразилии разработали три модели, которые могут описать моральные принципы людей на основе языка, который они используют. Модели оценивают выбор слов человека, чтобы определить его позицию по пяти ключевым нравственным принципам.\r\n\r\nИвандре Парабони, адъюнкт-профессор Школы искусств, естественных и гуманитарных наук Университета Сан-Паулу, руководил исследованием. Его команда решила сосредоточиться на теории моральных основ, обычно используемой социологами. Она постулирует несколько ключевых категорий морали, включая заботу, справедливость, верность, авторитет и чистоту.\r\n\r\nПо словам Парабони, цель новых моделей состоит в том, чтобы сделать вывод о ценностях человека, просто взглянув на его тексты, независимо от того, чему они посвящены.\r\n\r\nДля разработки и проверки моделей команда Парабони раздала анкеты более чем 500 добровольцам. Участников попросили оценить восемь тем (например, однополые браки, владение оружием, наркополитику) с помощью баллов (от 0 = «полностью против» до 5 = «полностью за»). Их также попросили написать пояснения к этим оценкам.\r\n\r\nЗатем люди-судьи дали свою собственную оценку подмножеству объяснений участников. Это определило, насколько хорошо другие люди могут делать выводы из чужого текста. «Понимание сложности задачи с человеческой точки зрения дало нам более реалистичное представление о том, что вычислительные модели могут или не могут делать с этим конкретным набором данных», — говорит Парабони.\r\n\r\nИспользуя мнения участников исследования, исследовательская группа создала три алгоритма машинного обучения, которые могут оценить язык, используемый в утверждении каждого участника. В моделях анализировалась психолингвистика (эмоциональный контекст слов), слова и словосочетания.\r\n\r\nПервые две модели, которые фокусируются на отдельных словах, используемых автором, были более точными, чем подход глубокого обучения, который анализирует последовательности слов.\r\nПарабони добавляет: «Подсчет слов, например, того, как часто человек использует такие слова, как «грех» или «долг», в высшей степени раскрывает их моральные принципы, то есть с большей точностью предсказывает степень их заботы, справедливости, лояльности, авторитет и чистоту».\r\n\r\nКоманда планирует включать в свои модели другие формы лингвистического анализа. Теперь она изучает модели, которые больше фокусируются на тексте независимо от его автора, чтобы представить способ анализа данных из Twitter.\r\n\r\nВ ноябре прошлого года стало известно, что Росмолодежь предложила использовать Институт развития интернета как оператора субсидий для производства социально значимого контента в интернете для пользователей до 35 лет. Предполагалось, что видеоролики, мультфильмы, аудиотрансляции, веб-сериалы, подкасты, проекты в соцсетях, а также игровые приложения, образовательные программы, информационные ленты будут размещать в соцсетях «ВКонтакте», «Одноклассники», Instagram, Facebook, TikTok, на YouTube и других молодежных интернет-площадках. На эту работу в ближайшие три года российские власти планировали выделить 2,4 млрд рублей.', 'https://habrastorage.org/webt/jt/ry/hq/jtryhqb1c6nc41dvl5jxwkwbeqc.jpeg', 1, 0),
(6, 'Samsung начала выпускать Android 11 для своих устройств через три месяца после выхода ОС', 'Владельцы Samsung Galaxy S20, S20 + и S20 Ultra из Южной Кореи, США и Европы начали получать Android 11 и пользовательский интерфейс One UI 3.0 на свои смартфоны, сообщается на сайте компании. Они смогут обновить ОС в течение декабря. ', '2020-12-07 17:21:44', 'Владельцы Samsung Galaxy S20, S20 + и S20 Ultra из Южной Кореи, США и Европы начали получать Android 11 и пользовательский интерфейс One UI 3.0 на свои смартфоны, сообщается на сайте компании. Они смогут обновить ОС в течение декабря. \r\n\r\nAndroid 11 вышла три месяца назад. Как отмечает Ars Technica, трёхмесячная задержка соответствует таковой же в прошлом году для Android 10 — устройства Samsung начали получать обновления спустя такой же срок после выхода ОС.\r\n\r\nSamsung обещает, что флагманские смартфоны компании получат новую ОС и пользовательский интерфейс в течение декабря. На январь запланированы обновления гаджетов семейства Galaxy Note (10, 10+, 20 и 20 Ultra), смартфонов Galaxy S10, Galaxy S10+, Galaxy S10 Lite, Galaxy Z Fold 2 и Galaxy Z Flip. При этом самые продаваемые устройства Samsung — смартфоны серии Galaxy A — будут получать обновления значительно позже, в период с марта по июнь 2021 года. Список моделей с датами выхода Android 11 опубликован на сайте компании. \r\n\r\nSamsung продолжает стратегию неспешного обновления своих устройств — компания по-прежнему начинает выпускать новую ОС для них спустя несколько недель, как это было и с предыдущими версиями Android, напоминает The Verge. При этом другие производители, например, OnePlus, Xiaomi и Oppo смогли добавить поддержку Android 11 в день её выхода. Вероятно, обновления Samsung занимают столько времени отчасти потому, что компания работает со своим пользовательским интерфейсом. \r\n\r\nИзменения в оболочке в основном визуальные. В One UI 3.0 изменились рабочий стол, экран блокировки, вид уведомлений, панель быстрого доступа и другие элементы. Кроме того, компания переработала виджеты, в которых теперь можно менять прозрачность, добавила новую анимацию, визуальные эффекты. Для видеозвонков в оболочке появился полноэкранный режим. Также изменения затронули камеру — зум в камере улучшили с помощью ИИ, также улучшили автофокус и автоэкспозицию. \r\n\r\nФинальная сборка открытой ОС Android 11 вышла в начале сентября. В ней появились встроенная функция записи экрана, единый раздел для управления чатами и новые настройки приватности.', 'https://habrastorage.org/getpro/habr/upload_files/532/29e/17a/53229e17a44014968593141bea62ecf8.jpg', 1, 0);
-- --------------------------------------------------------
--
-- Структура таблицы `related_news`
--
CREATE TABLE `related_news` (
`id_news` int(11) NOT NULL,
`id_related_news` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `related_news`
--
INSERT INTO `related_news` (`id_news`, `id_related_news`) VALUES
(1, 2),
(1, 3),
(1, 4);
--
-- Индексы сохранённых таблиц
--
--
-- Индексы таблицы `cities`
--
ALTER TABLE `cities`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `city_news`
--
ALTER TABLE `city_news`
ADD PRIMARY KEY (`id_city`,`id_news`);
--
-- Индексы таблицы `news`
--
ALTER TABLE `news`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `related_news`
--
ALTER TABLE `related_news`
ADD PRIMARY KEY (`id_related_news`,`id_news`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `cities`
--
ALTER TABLE `cities`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT для таблицы `news`
--
ALTER TABLE `news`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE fieldkit.recovery_token (
token bytea PRIMARY KEY,
user_id integer REFERENCES fieldkit.user (id) ON DELETE CASCADE NOT NULL,
expires timestamp NOT NULL
);
CREATE UNIQUE INDEX ON fieldkit.recovery_token (user_id);
|
ALTER TABLE `{prefix}users` DROP COLUMN `old_encryption`; |
<reponame>kuky1993/ADOP-CAN
CREATE DATABASE Adop_can default character set utf8 collate utf8_unicode_ci;
use Adop_can;
CREATE TABLE Animal (
id int not null auto_increment,
id_animal int null,
nombre varchar(50) null,
peso double(4,2) null,
edad int null,
descripcion varchar(255) null,
imagen longblob,
PRIMARY KEY (id));
CREATE TABLE Usuario (
id_usuario int not null auto_increment,
cedula varchar(10) null,
nombres varchar(60) null,
apellidos varchar(60) null,
direccion varchar(100) null,
correo varchar(100) null,
telefono varchar(10) null,
PRIMARY KEY (id_usuario));
CREATE TABLE Salud1 (
id_salud int not null auto_increment,
estado_salud varchar(100) null,
primary key (id_salud));
CREATE TABLE Tamaño1 (
id_tamaño int not null auto_increment,
tamaño varchar(20) null,
primary key (id_tamaño));
Create table Tipo_raza1(
id_raza int not null auto_increment,
nombre_raza varchar(50) null,
primary key(id_raza));
Create table Solicitud_Adopcion1(
id_solicitud int not null auto_increment,
primary key (id_solicitud));
create table Tipo_mascota1(
id_tipo_mascota int not null auto_increment,
mascota varchar(100) null,
primary key(id_tipo_mascota));
alter table salud1 add constraint R_1 foreign key (id_salud) references animal(id);
alter table tamaño1 add constraint R_2 foreign key (id_tamaño) references animal(id);
alter table tipo_raza1 add constraint R_3 foreign key (id_raza) references animal(id);
alter table animal add constraint R_4 foreign key (id_animal) references solicitud_adopcion1(id_solicitud);
alter table usuario add constraint R_5 foreign key (id_usuario) references solicitud_adopcion1(id_solicitud);
alter table tipo_mascota1 add constraint R_6 foreign key (id_tipo_mascota) references tipo_raza1(id_raza);
|
#
# Data for table "edu_teacher"
#
INSERT INTO `edu_teacher` VALUES ('1','张三','近年主持国家自然科学基金(6项)、江苏省重大科技成果转化项目(5项)、江苏省产学研前瞻性联合研究项目(3项)、省工业科技支撑、省高技术、省自然科学基金等省部级及其企业的主要科研项目40多个,多个项目在企业成功转化,产生了较好的经济、社会和环境效益。积极开展产学研科技合作,并与省内16家企业建立了江苏省研究生工作站,其中6家为江苏省优秀研究生工作站','高级',1,'https://guli-file-190513.oss-cn-beijing.aliyuncs.com/avatar/default.jpg',0,0,'2019-10-30 14:18:46','2019-11-12 13:36:36'),('1189389726308478977','晴天','高级讲师简介','高级讲师资历',2,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/10/30/de47ee9b-7fec-43c5-8173-13c5f7f689b2.png',1,0,'2019-10-30 11:53:03','2019-10-30 11:53:03'),('1189390295668469762','李刚','高级讲师简介','高级讲师',2,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/10/30/b8aa36a2-db50-4eca-a6e3-cc6e608355e0.png',2,0,'2019-10-30 11:55:19','2019-11-12 13:37:52'),('1189426437876985857','王二','高级讲师简介','高级讲师',1,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/11/08/e44a2e92-2421-4ea3-bb49-46f2ec96ef88.png',0,0,'2019-10-30 14:18:56','2019-11-12 13:37:35'),('1189426464967995393','王五','高级讲师简介','高级讲师',1,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/10/30/65423f14-49a9-4092-baf5-6d0ef9686a85.png',0,0,'2019-10-30 14:19:02','2019-11-12 13:37:18'),('1192249914833055746','李四','高级讲师简介','高级讲师',1,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/11/07/91871e25-fd83-4af6-845f-ea8d471d825d.png',0,0,'2019-11-07 09:18:25','2019-11-12 13:37:01'),('1192327476087115778','1222-12-12','1111','11',1,'https://online-teach-file.oss-cn-beijing.aliyuncs.com/teacher/2019/11/08/5805c6cd-c8ad-4a77-aafd-d2e083bfd8a4.png',0,1,'2019-11-07 14:26:37','2019-11-11 16:26:26'),('1195337453429129218','test','sdfsdf','sdfdf',1,'https://guli-file-190513.oss-cn-beijing.aliyuncs.com/avatar/default.jpg',0,1,'2019-11-15 21:47:12','2019-11-15 21:47:27');
|
<reponame>anbya/contohUploadKeGit<filename>closedaydata/OLD/IAT1602201002.sql
INSERT INTO pos_itemtemp VALUES("IATT200005382","193027","191001","192003","43000","1","43000","0","43000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193027"),
("IATT200005382","193027","191001","192003","43000","1","43000","0","43000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193027"),
("IATT200005382","193047","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193047"),
("IATT200005382","193052","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193052"),
("IATT200005383","193255","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193255"),
("IATT200005383","193242","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193242"),
("IATT200005383","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005384","193252","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193252"),
("IATT200005384","193242","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193242"),
("IATT200005384","193028","191001","192003","43000","1","43000","0","43000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193028"),
("IATT200005384","193048","191002","192010","8000","1","8000","0","8000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193048"),
("IATT200005385","193255","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193255"),
("IATT200005385","193244","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193244"),
("IATT200005385","193056","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193056"),
("IATT200005383","193055","191002","192010","17000","1","17000","0","17000","2","1","2","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005386","193246","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193246"),
("IATT200005386","193244","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193244"),
("IATT200005386","193118","191001","192012","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193118"),
("IATT200005386","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005386","193050","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193050"),
("IATT200005387","193048","191002","192010","8000","1","8000","0","8000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193048"),
("IATT200005388","193009","191001","192001","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193009"),
("IATT200005388","193096","191001","192008","50000","1","50000","0","50000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193096"),
("IATT200005388","193052","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193052"),
("IATT200005388","193046","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193046"),
("IATT200005389","193005","191001","192001","37000","1","37000","0","37000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193005"),
("IATT200005389","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005390","193246","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193246"),
("IATT200005390","193244","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193244"),
("IATT200005390","193034","191001","192005","37000","1","37000","0","37000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193034"),
("IATT200005390","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005390","193047","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193047"),
("IATT200005391","193246","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193246"),
("IATT200005391","193241","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193241"),
("IATT200005391","193047","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193047"),
("IATT200005391","193008","191001","192001","37000","1","37000","0","37000","1","1","2","IAT1602201002","NHO2018000007","PAID","","193008"),
("IATT200005392","193011","191001","192001","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005392","193082","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193082"),
("IATT200005392","193056","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193056"),
("IATT200005392","193051","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193051"),
("IATT200005392","193048","191002","192010","8000","1","8000","0","8000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193048"),
("IATT200005393","193019","191001","192002","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005393","193049","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193049"),
("IATT200005394","193084","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005394","193033","191001","192005","42000","1","42000","0","42000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193033"),
("IATT200005394","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005394","193055","191002","192010","17000","1","17000","0","17000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005395","193055","191002","192010","17000","1","17000","0","17000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005395","193055","191002","192010","17000","1","17000","0","17000","3","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005395","193049","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193049"),
("IATT200005395","193011","191001","192001","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005395","193021","191001","192002","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","","ORIGINAL"),
("IATT200005395","193036","191001","192006","36000","1","36000","0","36000","1","1","1","IAT1602201002","NHO2018000007","PAID","JANGAN PEDAS","ORIGINAL"),
("IATT200005396","193253","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193253"),
("IATT200005396","193242","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193242"),
("IATT200005396","193111","191001","192008","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193111"),
("IATT200005396","193113","191001","192003","55000","1","55000","0","55000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193113"),
("IATT200005396","193054","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193054"),
("IATT200005396","193054","191002","192010","20000","1","20000","0","20000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193054"),
("IATT200005396","193056","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193056"),
("IATT200005395","193069","191001","192012","13000","1","13000","0","13000","1","1","2","IAT1602201002","NHO2018000007","PAID","TAKE AWAY","193069"),
("IATT200005395","193071","191001","192012","18000","1","18000","0","18000","1","1","2","IAT1602201002","NHO2018000007","PAID","TAKE AWAY","193071"),
("IATT200005397","193082","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193082"),
("IATT200005397","193015","191001","192002","33000","1","33000","0","33000","1","1","1","IAT1602201002","NHO2018000007","PAID","","ORIGINAL"),
("IATT200005397","193086","191001","192002","33000","1","33000","0","33000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005397","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005397","193055","191002","192010","17000","1","17000","0","17000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005397","193051","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193051"),
("IATT200005398","193249","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193249"),
("IATT200005398","193243","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193243"),
("IATT200005398","193056","191002","192010","17000","1","17000","0","17000","1","1","2","IAT1602201002","NHO2018000007","PAID","","193056"),
("IATT200005398","193048","191002","192010","8000","1","8000","0","8000","1","1","2","IAT1602201002","NHO2018000007","PAID","","193048"),
("IATT200005399","193071","191001","192012","18000","1","18000","0","18000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193071"),
("IATT200005399","193033","191001","192005","42000","1","42000","0","42000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193033"),
("IATT200005399","193052","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193052"),
("IATT200005399","193048","191002","192010","8000","1","8000","0","8000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193048"),
("IATT200005400","193022","191001","192003","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193022"),
("IATT200005400","193024","191001","192003","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193024"),
("IATT200005400","193082","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193082"),
("IATT200005400","193047","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193047"),
("IATT200005400","193047","191002","192010","10000","1","10000","0","10000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193047"),
("IATT200005401","193255","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","SEDANG","193255"),
("IATT200005401","193239","191001","192013","25000","1","25000","0","25000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193239"),
("IATT200005402","193083","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193083"),
("IATT200005402","193078","191001","192001","30000","1","30000","0","30000","1","1","1","IAT1602201002","NHO2018000007","PAID","","PEDAS"),
("IATT200005402","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005402","193056","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193056"),
("IATT200005403","193011","191001","192001","40000","1","40000","0","40000","1","1","1","IAT1602201002","NHO2018000007","PAID","SEDANG","PEDAS"),
("IATT200005403","193113","191001","192003","55000","1","55000","0","55000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193113"),
("IATT200005403","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IAT1602201002","NHO2018000007","PAID","","193055"),
("IATT200005403","193055","191002","192010","17000","1","17000","0","17000","2","1","1","IAT1602201002","NHO2018000007","PAID","","193055");
INSERT INTO pos_salestemp VALUES("IATT200005382","","2","116000","0","11600","0","127600","150000","16/02/2020","11:12","2020-02-16","11:49:36","ISU000004","tbl0010","CLOSED","1","","IATR200005236","","","","","IAT1602201002","NHO2018000007"),
("IATT200005383","","2","84000","0","8400","0","92400","100000","16/02/2020","12:12","2020-02-16","13:02:05","ISU000004","tbl0010","CLOSED","1","","IATR200005239","","","","","IAT1602201002","NHO2018000007"),
("IATT200005384","","2","101000","0","10100","0","111100","150000","16/02/2020","12:12","2020-02-16","12:58:41","ISU000004","tbl0012","CLOSED","1","","IATR200005238","","","","","IAT1602201002","NHO2018000007"),
("IATT200005385","","2","67000","0","6700","0","73700","73700","16/02/2020","12:27","2020-02-16","13:09:26","ISU000004","tbl0011","CLOSED","1","","IATR200005240","","","","","IAT1602201002","NHO2018000007"),
("IATT200005386","","2","107000","0","10700","0","117700","200000","16/02/2020","12:29","2020-02-16","13:26:46","ISU000004","tbl0004","CLOSED","1","","IATR200005241","","","","","IAT1602201002","NHO2018000007"),
("IATT200005387","","1","8000","0","800","0","8800","20000","16/02/2020","12:41","2020-02-16","12:41:28","ISU000004","takeaway","CLOSED","1","","IATR200005237","","","","","IAT1602201002","NHO2018000007"),
("IATT200005388","","2","120000","0","12000","0","132000","132000","16/02/2020","13:13","2020-02-16","13:57:36","ISU000004","tbl0010","CLOSED","1","","IATR200005242","","","","","IAT1602201002","NHO2018000007"),
("IATT200005389","","1","54000","0","5400","0","59400","100000","16/02/2020","13:20","2020-02-16","14:02:40","ISU000004","tbl0012","CLOSED","1","","IATR200005244","","","","","IAT1602201002","NHO2018000007"),
("IATT200005390","","2","114000","0","11400","0","125400","125400","16/02/2020","13:31","2020-02-16","14:02:00","ISU000004","tbl0011","CLOSED","1","","IATR200005243","","","","","IAT1602201002","NHO2018000007"),
("IATT200005391","","2","97000","0","9700","0","106700","106700","16/02/2020","14:25","2020-02-16","14:59:30","ISU000006","tbl0012","CLOSED","1","","IATR200005245","","","","","IAT1602201002","NHO2018000007"),
("IATT200005392","","2","115000","0","11500","0","126500","150000","16/02/2020","15:42","2020-02-16","16:18:44","ISU000006","tbl0011","CLOSED","1","","IATR200005246","","","","","IAT1602201002","NHO2018000007"),
("IATT200005393","","1","50000","0","5000","0","55000","60000","16/02/2020","16:04","2020-02-16","16:32:55","ISU000006","tbl0012","CLOSED","1","","IATR200005247","","","","","IAT1602201002","NHO2018000007"),
("IATT200005394","","2","106000","0","10600","0","116600","150000","16/02/2020","16:07","2020-02-16","17:21:26","ISU000004","tbl0010","CLOSED","1","","IATR200005248","","","","","IAT1602201002","NHO2018000007"),
("IATT200005395","","3","191000","0","19100","0","210100","210100","16/02/2020","16:53","2020-02-16","17:39:38","ISU000004","tbl0012","CLOSED","1","","IATR200005249","","","","","IAT1602201002","NHO2018000007"),
("IATT200005396","","4","187000","0","18700","0","205700","205700","16/02/2020","17:04","2020-02-16","17:40:38","ISU000004","tbl0011","CLOSED","1","","IATR200005250","","","","","IAT1602201002","NHO2018000007"),
("IATT200005397","","2","150000","0","15000","0","165000","165000","16/02/2020","17:33","2020-02-16","18:12:15","ISU000006","tbl0010","CLOSED","1","","IATR200005252","","","","","IAT1602201002","NHO2018000007"),
("IATT200005398","","2","75000","0","7500","0","82500","82500","16/02/2020","17:40","2020-02-16","18:05:50","ISU000006","tbl0014","CLOSED","1","","IATR200005251","","","","","IAT1602201002","NHO2018000007"),
("IATT200005399","","1","88000","0","8800","0","96800","96800","16/02/2020","17:42","2020-02-16","18:13:27","ISU000006","tbl0004","CLOSED","1","","IATR200005253","","","","","IAT1602201002","NHO2018000007"),
("IATT200005400","","3","110000","0","11000","0","121000","121000","16/02/2020","18:15","2020-02-16","18:52:17","ISU000006","tbl0012","CLOSED","1","","IATR200005254","","","","","IAT1602201002","NHO2018000007"),
("IATT200005401","","2","50000","0","5000","0","55000","55000","16/02/2020","19:00","2020-02-16","19:08:14","ISU000006","tbl0011","CLOSED","1","","IATR200005255","","","","","IAT1602201002","NHO2018000007"),
("IATT200005402","","1","94000","0","9400","0","103400","103400","16/02/2020","19:20","2020-02-16","20:08:40","ISU000006","tbl0014","CLOSED","1","","IATR200005256","","","","","IAT1602201002","NHO2018000007"),
("IATT200005403","","2","129000","0","12900","0","141900","150000","16/02/2020","19:42","2020-02-16","20:26:28","ISU000006","tbl0012","CLOSED","1","","IATR200005257","","","","","IAT1602201002","NHO2018000007");
INSERT INTO item_void VALUES("IATT200005396","IAT1602201002","NHO2018000007","193056","193056","1","17000","Before Send","Salah Order");
INSERT INTO pos_paymenttemp VALUES("IATT200005382","CASH","CASH","127600","150000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005387","CASH","CASH","8800","20000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005384","CASH","CASH","111100","150000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005383","CASH","CASH","92400","100000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005385","CARD","DEBIT BCA","73700","73700","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005386","CASH","CASH","117700","200000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005388","CASH","OVO","132000","132000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005390","CARD","DEBIT BCA","125400","125400","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005389","CASH","CASH","59400","100000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005391","CARD","VISA","106700","106700","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005392","CASH","CASH","126500","150000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005393","CASH","CASH","55000","60000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005394","CASH","CASH","116600","150000","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005395","CARD","VISA","210100","210100","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005396","CARD","DEBIT BCA","205700","205700","ISU000004","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005398","CARD","DEBIT BCA","82500","82500","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005397","CARD","DEBIT BCA","165000","165000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005399","CARD","DEBIT BCA","96800","96800","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005400","CASH","OVO","121000","121000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005401","CARD","MASTER","55000","55000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005402","CASH","OVO","103400","103400","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007"),
("IATT200005403","CASH","CASH","141900","150000","ISU000006","2020-02-16","","1","","CLOSED","IAT1602201002","NHO2018000007");
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 22-11-2019 a las 18:38:41
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `cartera`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `administrador`
--
CREATE TABLE `administrador` (
`id` int(11) NOT NULL,
`usuario` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`identif` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`nombres` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`clave` varchar(200) COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `administrador`
--
INSERT INTO `administrador` (`id`, `usuario`, `identif`, `nombres`, `clave`) VALUES
(1, 'admin', '123456', 'admin', '<PASSWORD>');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cliente`
--
CREATE TABLE `cliente` (
`id` int(11) NOT NULL,
`codcliente` varchar(30) COLLATE utf8_spanish_ci NOT NULL,
`apellidos` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`nombres` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`usuario` varchar(15) COLLATE utf8_spanish_ci NOT NULL,
`saldo` float NOT NULL,
`clave` varchar(200) COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `cliente`
--
INSERT INTO `cliente` (`id`, `codcliente`, `apellidos`, `nombres`, `usuario`, `saldo`, `clave`) VALUES
(1, '123', 'florez', 'pepito', 'pflorez', 200000, '123456');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `factura`
--
CREATE TABLE `factura` (
`nrofactura` int(50) NOT NULL,
`codcliente` varchar(30) COLLATE utf8_spanish_ci NOT NULL,
`fecha` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`vlrfactura` float NOT NULL,
`saldo` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pago`
--
CREATE TABLE `pago` (
`nropago` int(100) NOT NULL,
`nrofactura` varchar(50) COLLATE utf8_spanish_ci NOT NULL,
`fecha` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`valor` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `recarga`
--
CREATE TABLE `recarga` (
`nrorecarga` int(100) NOT NULL,
`codcliente` varchar(30) COLLATE utf8_spanish_ci NOT NULL,
`fecha` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`hora` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`valor` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `administrador`
--
ALTER TABLE `administrador`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `cliente`
--
ALTER TABLE `cliente`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `factura`
--
ALTER TABLE `factura`
ADD PRIMARY KEY (`nrofactura`);
--
-- Indices de la tabla `pago`
--
ALTER TABLE `pago`
ADD PRIMARY KEY (`nropago`);
--
-- Indices de la tabla `recarga`
--
ALTER TABLE `recarga`
ADD PRIMARY KEY (`nrorecarga`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `administrador`
--
ALTER TABLE `administrador`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `cliente`
--
ALTER TABLE `cliente`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `factura`
--
ALTER TABLE `factura`
MODIFY `nrofactura` int(50) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `pago`
--
ALTER TABLE `pago`
MODIFY `nropago` int(100) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `recarga`
--
ALTER TABLE `recarga`
MODIFY `nrorecarga` int(100) 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 */;
|
<gh_stars>0
DROP TABLE IF EXISTS item_id
CREATE TABLE item_id
(
id serial NOT NULL,
item_name character varying(50),
PRIMARY KEY (id)
);
-- COPY persons(first_name,last_name) FROM '/demo/persons.csv' DELIMITER ',' CSV HEADER; |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 8.0.25 - MySQL Community Server - GPL
-- SO del servidor: Linux
-- HeidiSQL Versión: 11.3.0.6295
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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 */;
-- Volcando estructura de base de datos para hoursTracking
CREATE DATABASE IF NOT EXISTS `hoursTracking` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `hoursTracking`;
-- Volcando estructura para tabla hoursTracking.clients
CREATE TABLE IF NOT EXISTS `clients` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.hours
CREATE TABLE IF NOT EXISTS `hours` (
`id` int NOT NULL AUTO_INCREMENT,
`startDate` datetime DEFAULT NULL,
`endDate` datetime DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
`userId` int DEFAULT NULL,
`projectId` int DEFAULT NULL,
`taskId` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userId` (`userId`),
KEY `projectId` (`projectId`),
KEY `taskId` (`taskId`),
CONSTRAINT `hours_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `hours_ibfk_2` FOREIGN KEY (`projectId`) REFERENCES `projects` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `hours_ibfk_3` FOREIGN KEY (`taskId`) REFERENCES `tasks` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.positions
CREATE TABLE IF NOT EXISTS `positions` (
`id` int NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`eurosPerHour` int DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.projects
CREATE TABLE IF NOT EXISTS `projects` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`budget` int DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
`clientId` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `clientId` (`clientId`),
CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`clientId`) REFERENCES `clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.tasks
CREATE TABLE IF NOT EXISTS `tasks` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`status` int DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
`projectId` int DEFAULT NULL,
`userId` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `projectId` (`projectId`),
KEY `userId` (`userId`),
CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`projectId`) REFERENCES `projects` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `tasks_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.users
CREATE TABLE IF NOT EXISTS `users` (
`id` int NOT NULL AUTO_INCREMENT,
`email` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deletedAT` datetime DEFAULT NULL,
`positionId` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `positionId` (`positionId`),
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`positionId`) REFERENCES `positions` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.UsersOnProject
CREATE TABLE IF NOT EXISTS `UsersOnProject` (
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
`projectId` int NOT NULL,
`userId` int NOT NULL,
PRIMARY KEY (`projectId`,`userId`),
KEY `userId` (`userId`),
CONSTRAINT `UsersOnProject_ibfk_1` FOREIGN KEY (`projectId`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `UsersOnProject_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
-- Volcando estructura para tabla hoursTracking.UsersOnTask
CREATE TABLE IF NOT EXISTS `UsersOnTask` (
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
`taskId` int NOT NULL,
`userId` int NOT NULL,
PRIMARY KEY (`taskId`,`userId`),
KEY `userId` (`userId`),
CONSTRAINT `UsersOnTask_ibfk_1` FOREIGN KEY (`taskId`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `UsersOnTask_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- La exportación de datos fue deseleccionada.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
|
<filename>praktekgci.sql
/*
SQLyog Community v13.1.7 (64 bit)
MySQL - 8.0.21-0ubuntu0.20.04.4 : Database - praktekgci
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`praktekgci` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `praktekgci`;
/*Table structure for table `jurusan` */
DROP TABLE IF EXISTS `jurusan`;
CREATE TABLE `jurusan` (
`id_jurusan` int NOT NULL AUTO_INCREMENT,
`jurusan` varchar(255) DEFAULT NULL,
`id_fakultas` int DEFAULT NULL,
PRIMARY KEY (`id_jurusan`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `jurusan` */
insert into `jurusan`(`id_jurusan`,`jurusan`,`id_fakultas`) values
(1,'Teknik Informatika',NULL),
(2,'Teknik Sipil',NULL),
(3,'Sistem Informasi',NULL);
/*Table structure for table `level_user` */
DROP TABLE IF EXISTS `level_user`;
CREATE TABLE `level_user` (
`id_level` int NOT NULL AUTO_INCREMENT,
`level` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id_level`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `level_user` */
insert into `level_user`(`id_level`,`level`) values
(1,'pimpinan'),
(2,'bendahara'),
(3,'mahasiswa');
/*Table structure for table `semester` */
DROP TABLE IF EXISTS `semester`;
CREATE TABLE `semester` (
`id_semester` int NOT NULL AUTO_INCREMENT,
`semester` varchar(5) DEFAULT NULL,
`genap` enum('yes','no') DEFAULT NULL,
PRIMARY KEY (`id_semester`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `semester` */
insert into `semester`(`id_semester`,`semester`,`genap`) values
(1,'I','no'),
(2,'II','yes'),
(3,'III','no'),
(4,'IV','yes');
/*Table structure for table `tagihan` */
DROP TABLE IF EXISTS `tagihan`;
CREATE TABLE `tagihan` (
`id_tagihan` int NOT NULL AUTO_INCREMENT,
`nama_tagihan` varchar(255) DEFAULT NULL,
`angkatan` year DEFAULT NULL,
`jumlah` double DEFAULT NULL,
PRIMARY KEY (`id_tagihan`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `tagihan` */
insert into `tagihan`(`id_tagihan`,`nama_tagihan`,`angkatan`,`jumlah`) values
(14,'SPP',2018,3200000),
(15,'SPP',2019,3000000),
(29,'SPP',2018,3200000);
/*Table structure for table `tagihan_mhs` */
DROP TABLE IF EXISTS `tagihan_mhs`;
CREATE TABLE `tagihan_mhs` (
`id_tagihan_mhs` int NOT NULL AUTO_INCREMENT,
`id_user` int DEFAULT NULL,
`id_tagihan` int DEFAULT NULL,
`status` enum('lunas','tunda') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'tunda',
PRIMARY KEY (`id_tagihan_mhs`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `tagihan_mhs` */
insert into `tagihan_mhs`(`id_tagihan_mhs`,`id_user`,`id_tagihan`,`status`) values
(1,3,14,'lunas'),
(2,4,15,'tunda'),
(4,3,29,'tunda');
/*Table structure for table `users` */
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id_user` int NOT NULL AUTO_INCREMENT,
`nik` varchar(255) DEFAULT NULL,
`nama` varchar(255) DEFAULT NULL,
`username` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`tahun_masuk` year DEFAULT NULL,
`id_jurusan` int DEFAULT NULL,
`id_level` int DEFAULT NULL,
PRIMARY KEY (`id_user`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*Data for the table `users` */
insert into `users`(`id_user`,`nik`,`nama`,`username`,`password`,`tahun_masuk`,`id_jurusan`,`id_level`) values
(1,'132001','Zainal Ali','zainal','<PASSWORD>396344b004e2fb6eabda',2010,NULL,1),
(2,'212001','Anita','anita','83349cbdac695f3943635a4fd1aaa7d0',2010,NULL,2),
(3,'223000','<NAME>','lukman','b5bbc8cf472072baffe920e4e28ee29c',2018,1,3),
(4,'223001','<NAME>','asri','371e3678e35662cc9862fdb96fece88b',2019,2,3);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 25, 2020 at 02:21 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_knockdok`
--
-- --------------------------------------------------------
--
-- Table structure for table `tb_dokter`
--
CREATE TABLE `tb_dokter` (
`id_dokter` int(11) NOT NULL,
`nama_dokter` varchar(45) NOT NULL,
`spesialis` varchar(40) NOT NULL,
`nomor_telepon` varchar(12) NOT NULL,
`alamat_dokter` varchar(150) NOT NULL,
`email` varchar(45) NOT NULL,
`foto_dokter` varchar(40) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_jadwal`
--
CREATE TABLE `tb_jadwal` (
`id_jadwal` int(11) NOT NULL,
`waktu_mulai` datetime NOT NULL,
`estimasi_durasi` time NOT NULL,
`tersedia` tinyint(1) NOT NULL DEFAULT 1,
`id_dokter` int(11) NOT NULL,
`id_rs` int(11) NOT NULL,
`biaya` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_pesanan`
--
CREATE TABLE `tb_pesanan` (
`id_pesanan` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`id_jadwal` int(11) NOT NULL,
`keluhan` varchar(200) DEFAULT NULL,
`tanggal_pemesanan` date NOT NULL,
`id_transaksi` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_pivot_dokter_rs`
--
CREATE TABLE `tb_pivot_dokter_rs` (
`id_dokter` int(11) NOT NULL,
`id_rs` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_rs`
--
CREATE TABLE `tb_rs` (
`id_rs` int(11) NOT NULL,
`nama_rs` varchar(30) NOT NULL,
`nomor_telepon_rs` varchar(12) NOT NULL,
`alamat_rs` varchar(100) NOT NULL,
`foto_rs` varchar(30) NOT NULL,
`delete_status` enum('true','false') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_transaksi`
--
CREATE TABLE `tb_transaksi` (
`id_transaksi` int(11) NOT NULL,
`waktu_transaksi` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`status_bayar` enum('pending','gagal','berhasil') DEFAULT 'pending',
`bukti_pembayaran` varchar(40) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tb_user`
--
CREATE TABLE `tb_user` (
`username` varchar(20) NOT NULL,
`nama_depan` varchar(15) NOT NULL,
`nama_belakang` varchar(15) NOT NULL,
`password` varchar(30) NOT NULL,
`alamat` varchar(100) NOT NULL,
`email` varchar(35) NOT NULL,
`nomor_telepon` varchar(12) NOT NULL,
`foto_profil` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tb_dokter`
--
ALTER TABLE `tb_dokter`
ADD PRIMARY KEY (`id_dokter`);
--
-- Indexes for table `tb_jadwal`
--
ALTER TABLE `tb_jadwal`
ADD PRIMARY KEY (`id_jadwal`),
ADD KEY `id_dokter` (`id_dokter`),
ADD KEY `id_RS` (`id_rs`);
--
-- Indexes for table `tb_pesanan`
--
ALTER TABLE `tb_pesanan`
ADD PRIMARY KEY (`id_pesanan`),
ADD KEY `fk_username` (`username`),
ADD KEY `fk_id_jadwal` (`id_jadwal`),
ADD KEY `fk_id_transaksi` (`id_transaksi`);
--
-- Indexes for table `tb_pivot_dokter_rs`
--
ALTER TABLE `tb_pivot_dokter_rs`
ADD KEY `id_dokter` (`id_dokter`),
ADD KEY `id_RS` (`id_rs`);
--
-- Indexes for table `tb_rs`
--
ALTER TABLE `tb_rs`
ADD PRIMARY KEY (`id_rs`);
--
-- Indexes for table `tb_transaksi`
--
ALTER TABLE `tb_transaksi`
ADD PRIMARY KEY (`id_transaksi`);
--
-- Indexes for table `tb_user`
--
ALTER TABLE `tb_user`
ADD PRIMARY KEY (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tb_dokter`
--
ALTER TABLE `tb_dokter`
MODIFY `id_dokter` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tb_jadwal`
--
ALTER TABLE `tb_jadwal`
MODIFY `id_jadwal` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tb_pesanan`
--
ALTER TABLE `tb_pesanan`
MODIFY `id_pesanan` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tb_rs`
--
ALTER TABLE `tb_rs`
MODIFY `id_rs` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tb_transaksi`
--
ALTER TABLE `tb_transaksi`
MODIFY `id_transaksi` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `tb_jadwal`
--
ALTER TABLE `tb_jadwal`
ADD CONSTRAINT `tb_jadwal_ibfk_1` FOREIGN KEY (`id_rs`) REFERENCES `tb_rs` (`id_rs`) ON DELETE CASCADE,
ADD CONSTRAINT `tb_jadwal_ibfk_3` FOREIGN KEY (`id_rs`) REFERENCES `tb_rs` (`id_rs`) ON DELETE NO ACTION,
ADD CONSTRAINT `tb_jadwal_ibfk_4` FOREIGN KEY (`id_dokter`) REFERENCES `tb_dokter` (`id_dokter`) ON DELETE CASCADE;
--
-- Constraints for table `tb_pesanan`
--
ALTER TABLE `tb_pesanan`
ADD CONSTRAINT `fk_id_jadwal` FOREIGN KEY (`id_jadwal`) REFERENCES `tb_jadwal` (`id_jadwal`),
ADD CONSTRAINT `fk_id_transaksi` FOREIGN KEY (`id_transaksi`) REFERENCES `tb_transaksi` (`id_transaksi`),
ADD CONSTRAINT `fk_username` FOREIGN KEY (`username`) REFERENCES `tb_user` (`username`);
--
-- Constraints for table `tb_pivot_dokter_rs`
--
ALTER TABLE `tb_pivot_dokter_rs`
ADD CONSTRAINT `tb_pivot_dokter_rs_ibfk_1` FOREIGN KEY (`id_dokter`) REFERENCES `tb_dokter` (`id_dokter`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `tb_pivot_dokter_rs_ibfk_2` FOREIGN KEY (`id_rs`) REFERENCES `tb_rs` (`id_rs`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Ноя 19 2017 г., 12:44
-- Версия сервера: 5.7.20-0ubuntu0.16.04.1
-- Версия PHP: 7.0.22-0ubuntu0.16.04.1
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 */;
--
-- База данных: `tapmedia`
--
-- --------------------------------------------------------
--
-- Структура таблицы `bad_domains`
--
CREATE TABLE `bad_domains` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `bad_domains`
--
INSERT INTO `bad_domains` (`id`, `name`) VALUES
(65, 'http://tapmedia.dev/'),
(75, 'http://gmail.com'),
(76, 'https://google.com'),
(77, 'http://www.facebook.com');
-- --------------------------------------------------------
--
-- Структура таблицы `clicks`
--
CREATE TABLE `clicks` (
`id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`ua` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`ref` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`param1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`param2` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`error` int(10) UNSIGNED NOT NULL DEFAULT '0',
`bad_domain` int(10) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `clicks`
--
INSERT INTO `clicks` (`id`, `ua`, `ip`, `ref`, `param1`, `param2`, `error`, `bad_domain`) VALUES
('46617f285d89c5208f4c9c39670e7b7d', 'Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0', '127.0.0.1', 'http://tapmedia.dev/', 'param1', 'param2', 1, 1),
('ba033ced4c6e2a7be9dea46861e48a05', 'Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0', '127.0.0.1', 'http://tapmedia.dev/', 'another param', 'another_param', 2, 2),
('c14e7134a42f8222df166c89a2360ae8', 'Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0', '127.0.0.1', 'http://tapmedia.dev/', 'param1_new', 'param2_new', 1, 1);
-- --------------------------------------------------------
--
-- Структура таблицы `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;
--
-- Дамп данных таблицы `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(5, '2014_10_12_000000_create_users_table', 1),
(6, '2014_10_12_100000_create_password_resets_table', 1),
(7, '2017_11_17_203027_create_bad_domains_table', 1),
(8, '2017_11_17_205702_create_clicks_table', 1);
-- --------------------------------------------------------
--
-- Структура таблицы `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Структура таблицы `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Индексы сохранённых таблиц
--
--
-- Индексы таблицы `bad_domains`
--
ALTER TABLE `bad_domains`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `clicks`
--
ALTER TABLE `clicks`
ADD PRIMARY KEY (`id`),
ADD KEY `clicks_ua_ip_ref_param1_index` (`ua`,`ip`,`ref`,`param1`);
--
-- Индексы таблицы `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Индексы таблицы `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `bad_domains`
--
ALTER TABLE `bad_domains`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78;
--
-- AUTO_INCREMENT для таблицы `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT для таблицы `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
insert into users(id, name) values('user', 'User U.');
insert into users(id, name) values('admin', 'Admin A.');
insert into users(id, name) values('daggerok', '<NAME>');
insert into messages(user_id, body) values('daggerok', 'Hello, World!');
|
<reponame>taufikariefwidodo/haci
-- phpMyAdmin SQL Dump
-- version 4.4.15.10
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 07, 2018 at 09:14 AM
-- Server version: 5.5.60-MariaDB
-- PHP Version: 5.6.38
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: `haci`
--
-- --------------------------------------------------------
--
-- Table structure for table `app_nav_menu`
--
CREATE TABLE IF NOT EXISTS `app_nav_menu` (
`nav_menu_id` int(11) NOT NULL,
`nav_menu_name` varchar(128) NOT NULL,
`nav_menu_location` varchar(128) NOT NULL,
`nav_menu_sort` int(11) NOT NULL,
`nav_menu_icon` varchar(128) NOT NULL,
`nav_menu_module` varchar(64) NOT NULL,
`nav_menu_link` varchar(128) NOT NULL,
`nav_menu_parent_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `app_nav_menu`
--
INSERT INTO `app_nav_menu` (`nav_menu_id`, `nav_menu_name`, `nav_menu_location`, `nav_menu_sort`, `nav_menu_icon`, `nav_menu_module`, `nav_menu_link`, `nav_menu_parent_id`, `created_at`, `updated_at`) VALUES
(1, 'Dashboard', 'sidebar_admin_menu', 0, 'fa fa-dashboard', 'dashboard', '#', 0, '2018-10-02 20:36:32', '2018-10-02 20:36:32'),
(2, 'Dashboard v1', 'sidebar_admin_menu', 1, 'fa fa-dashboard', 'dashboard', 'dashboard', 1, '2018-10-02 20:42:12', '2018-10-02 20:42:12'),
(3, 'Dashboard v2', 'sidebar_admin_menu', 2, 'fa fa-circle-o', 'dashboard', '#', 1, '2018-10-03 10:25:17', '2018-10-03 10:25:17'),
(4, 'Users', 'sidebar_admin_menu', 3, 'fa fa-users', 'users', '#', 0, '2018-10-03 10:29:50', '2018-10-03 10:29:50'),
(5, 'Multilevel', 'sidebar_admin_menu', 1, 'fa fa-share', '', '#', 0, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(6, 'Level One', 'sidebar_admin_menu', 2, 'fa fa-circle-o', '', '#', 5, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(7, 'Level One ', 'sidebar_admin_menu', 3, 'fa fa-circle-o', '', '#', 5, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(8, 'Level Two', 'sidebar_admin_menu', 4, 'fa fa-circle-o', '', '#', 7, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(9, 'Level Two', 'sidebar_admin_menu', 5, 'fa fa-circle-o', '', '#', 7, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(10, 'Level Three', 'sidebar_admin_menu', 6, 'fa fa-circle-o', '', '#', 9, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(11, 'Level Three', 'sidebar_admin_menu', 7, 'fa fa-circle-o', '', '#', 9, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(12, 'Level One', 'sidebar_admin_menu', 8, 'fa fa-circle-o', '', '#', 5, '2018-10-03 14:03:00', '2018-10-03 14:03:00'),
(13, 'Users', 'sidebar_admin_menu', 0, 'fa fa-circle-o', 'users', 'users', 4, '2018-10-03 10:29:50', '2018-10-03 10:29:50'),
(14, 'Add User', 'sidebar_admin_menu', 1, 'fa fa-circle-o', 'users', 'users/add', 4, '2018-10-03 10:29:50', '2018-10-03 10:29:50'),
(15, 'Groups', 'sidebar_admin_menu', 0, 'fa fa-circle-o', 'users', 'users/groups', 4, '2018-10-03 10:29:50', '2018-10-03 10:29:50'),
(16, 'Add Group', 'sidebar_admin_menu', 1, 'fa fa-circle-o', 'users', 'users/groups/add', 4, '2018-10-03 10:29:50', '2018-10-03 10:29:50');
-- --------------------------------------------------------
--
-- Table structure for table `app_setting`
--
CREATE TABLE IF NOT EXISTS `app_setting` (
`setting_id` int(11) NOT NULL,
`setting_name` varchar(128) NOT NULL,
`setting_value` longtext NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `app_setting`
--
INSERT INTO `app_setting` (`setting_id`, `setting_name`, `setting_value`, `created_at`, `updated_at`) VALUES
(1, 'title_admin_name', 'Haci App', '2018-09-17 10:00:05', '2018-09-17 10:00:05'),
(2, 'title_public_name', 'Homepage Haci', '2018-09-17 10:11:07', '2018-09-17 10:11:07'),
(3, 'admin_theme', 'adminlte', '2018-09-19 13:53:52', '2018-09-19 13:53:52'),
(4, 'public_theme', 'madedesign', '2018-09-19 13:54:19', '2018-09-19 13:54:19');
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE IF NOT EXISTS `groups` (
`id` mediumint(8) unsigned NOT NULL,
`name` varchar(20) NOT NULL,
`description` varchar(100) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `groups`
--
INSERT INTO `groups` (`id`, `name`, `description`) VALUES
(1, 'admin', 'Administrator'),
(2, 'members', 'General User');
-- --------------------------------------------------------
--
-- Table structure for table `login_attempts`
--
CREATE TABLE IF NOT EXISTS `login_attempts` (
`id` int(11) unsigned NOT NULL,
`ip_address` varchar(45) NOT NULL,
`login` varchar(100) NOT NULL,
`time` int(11) unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) unsigned NOT NULL,
`ip_address` varchar(45) NOT NULL,
`username` varchar(100) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`salt` varchar(255) DEFAULT NULL,
`email` varchar(254) NOT NULL,
`activation_code` varchar(40) DEFAULT NULL,
`forgotten_password_code` varchar(40) DEFAULT NULL,
`forgotten_password_time` int(11) unsigned DEFAULT NULL,
`remember_code` varchar(40) DEFAULT NULL,
`created_on` int(11) unsigned NOT NULL,
`last_login` int(11) unsigned DEFAULT NULL,
`active` tinyint(1) unsigned DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`company` varchar(100) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES
(1, '127.0.0.1', 'administrator', <PASSWORD>', '', '<EMAIL>', '', 'D-j0b-uyPpBQeKbK.m1V5ua6275b1686e272741b', 1538277911, '0y7Qy6s0HP5C3nMziMMTx.', 1268889823, 1541331596, 1, 'Administrator', 'Haci', 'ADMIN', '0'),
(2, '192.168.188.1', '<EMAIL>', <PASSWORD>', NULL, '<EMAIL>', NULL, NULL, NULL, NULL, 1539920091, 1540636229, 1, 'Cak', 'Topik', 'caktopik.id', '0');
-- --------------------------------------------------------
--
-- Table structure for table `users_groups`
--
CREATE TABLE IF NOT EXISTS `users_groups` (
`id` int(11) unsigned NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`group_id` mediumint(8) unsigned NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users_groups`
--
INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES
(1, 1, 1),
(2, 1, 2),
(26, 2, 1),
(27, 2, 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `app_nav_menu`
--
ALTER TABLE `app_nav_menu`
ADD PRIMARY KEY (`nav_menu_id`);
--
-- Indexes for table `app_setting`
--
ALTER TABLE `app_setting`
ADD PRIMARY KEY (`setting_id`);
--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `login_attempts`
--
ALTER TABLE `login_attempts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users_groups`
--
ALTER TABLE `users_groups`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
ADD KEY `fk_users_groups_users1_idx` (`user_id`),
ADD KEY `fk_users_groups_groups1_idx` (`group_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `app_nav_menu`
--
ALTER TABLE `app_nav_menu`
MODIFY `nav_menu_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `app_setting`
--
ALTER TABLE `app_setting`
MODIFY `setting_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `groups`
--
ALTER TABLE `groups`
MODIFY `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `login_attempts`
--
ALTER TABLE `login_attempts`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users_groups`
--
ALTER TABLE `users_groups`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=28;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `users_groups`
--
ALTER TABLE `users_groups`
ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
/*!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 */;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.