text
stringlengths 1
1.05M
|
|---|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 04, 2022 at 02:43 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `praktikum_ukp`
--
-- --------------------------------------------------------
--
-- Table structure for table `ambil_praktikum`
--
CREATE TABLE `ambil_praktikum` (
`id` int(11) NOT NULL,
`id_pendaftaran_praktikum` int(11) NOT NULL,
`id_mahasiswa_matakuliah` int(11) NOT NULL,
`NRP` varchar(11) NOT NULL,
`id_subject` int(11) NOT NULL,
`pil1` int(11) NOT NULL,
`pil2` int(11) DEFAULT NULL COMMENT 'id_kelas_praktikum',
`pil3` int(11) DEFAULT NULL,
`pil4` int(11) DEFAULT NULL,
`PP` tinyint(1) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0= nonactive; 1=active;',
`terpilih` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `asisten_dosen`
--
CREATE TABLE `asisten_dosen` (
`id` int(11) NOT NULL,
`id_pendaftaran_asisten_dosen` int(11) NOT NULL,
`NRP` varchar(11) NOT NULL,
`NIP` varchar(11) NOT NULL,
`password` varchar(255) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0= nonactive; 1=active',
`keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `backup_log`
--
CREATE TABLE `backup_log` (
`id` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`is_success` tinyint(1) NOT NULL COMMENT '0=gagal; 1=berhasil',
`keterangan` text NOT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `calon_asisten_dosen`
--
CREATE TABLE `calon_asisten_dosen` (
`id` int(11) NOT NULL,
`NRP` varchar(11) NOT NULL,
`id_pendaftaran_praktikum` int(11) NOT NULL,
`upload_transkrip` varchar(100) NOT NULL,
`upload_foto` varchar(100) NOT NULL,
`gender` varchar(10) NOT NULL,
`alamat` text NOT NULL,
`no_hp` varchar(20) NOT NULL,
`line_id` varchar(50) NOT NULL,
`ipk` float(3,2) NOT NULL,
`motivasi` text NOT NULL,
`komitmen` text NOT NULL,
`kelebihan` text NOT NULL,
`kekurangan` text NOT NULL,
`pengalaman` text NOT NULL,
`keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `dosen`
--
CREATE TABLE `dosen` (
`NIP` int(11) NOT NULL,
`nama` int(11) NOT NULL,
`password` varchar(255) NOT NULL,
`last_login` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `jadwal_berhalangan`
--
CREATE TABLE `jadwal_berhalangan` (
`id` int(11) NOT NULL,
`NIP` varchar(11) NOT NULL,
`hari` varchar(12) NOT NULL,
`jam` varchar(12) NOT NULL,
`durasi` int(11) NOT NULL,
`keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `jadwal_wawancara`
--
CREATE TABLE `jadwal_wawancara` (
`id` int(11) NOT NULL,
`NIP` varchar(11) NOT NULL,
`id_calon_asisten_dosen` int(11) NOT NULL,
`tanggal` timestamp NOT NULL DEFAULT current_timestamp(),
`keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `kelas_praktikum`
--
CREATE TABLE `kelas_praktikum` (
`id` int(11) NOT NULL,
`kode_kelas_praktikum` varchar(7) NOT NULL,
`id_subject` int(11) NOT NULL,
`id_laboratorium` int(11) NOT NULL,
`hari` varchar(12) NOT NULL,
`jam` varchar(12) NOT NULL,
`durasi` int(11) NOT NULL,
`terisi` int(11) NOT NULL,
`NIP1` varchar(11) NOT NULL,
`NIP2` varchar(11) DEFAULT NULL,
`NIP3` varchar(11) DEFAULT NULL,
`status` tinyint(1) NOT NULL COMMENT '0= nonactive; 1=active;'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `laboratorium`
--
CREATE TABLE `laboratorium` (
`kode_lab` varchar(2) NOT NULL,
`nama` varchar(50) NOT NULL,
`quota_max` tinyint(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa`
--
CREATE TABLE `mahasiswa` (
`NRP` varchar(11) NOT NULL,
`nama` varchar(100) NOT NULL,
`angkatan` varchar(4) NOT NULL,
`ips` float(3,2) NOT NULL,
`ipk` float(3,2) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`last_login` timestamp NOT NULL DEFAULT current_timestamp(),
`status` tinyint(1) NOT NULL COMMENT '0=nonactive; 1=active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `mahasiswa`
--
INSERT INTO `mahasiswa` (`NRP`, `nama`, `angkatan`, `ips`, `ipk`, `password`, `email`, `last_login`, `status`) VALUES
('m26415008', 'TANU WIJAYA SARIDIN', '2015', 0.00, 2.79, '41500', 'm26415008@john.petra.ac.id', '2022-03-01 11:16:29', 1);
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa_matakuliah`
--
CREATE TABLE `mahasiswa_matakuliah` (
`id` int(11) NOT NULL,
`NRP` int(11) NOT NULL,
`id_subject` int(11) NOT NULL,
`kelas_paralel` char(1) NOT NULL,
`semester` tinyint(1) NOT NULL,
`tahun_ajaran` varchar(9) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa_nilai`
--
CREATE TABLE `mahasiswa_nilai` (
`id` int(11) NOT NULL,
`id_kelas_praktikum` int(11) NOT NULL,
`pertemuan` tinyint(2) NOT NULL,
`NRP` varchar(11) NOT NULL,
`nilai_awal` int(11) NOT NULL,
`nilai_materi` int(11) NOT NULL,
`nilai_tugas` int(11) NOT NULL,
`status_absensi` char(1) NOT NULL COMMENT 'm = masuk; a=apla; i=ijin',
`keterangan` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `pendaftaran_asisten_dosen`
--
CREATE TABLE `pendaftaran_asisten_dosen` (
`id` int(11) NOT NULL,
`waktu_start` timestamp NOT NULL DEFAULT current_timestamp(),
`waktu_end` timestamp NOT NULL DEFAULT current_timestamp(),
`semester` tinyint(1) NOT NULL,
`tahun_ajaran` varchar(9) NOT NULL,
`status` tinyint(1) NOT NULL,
`keterangan` text NOT NULL,
`created` timestamp NOT NULL DEFAULT current_timestamp(),
`updated` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `pendaftaran_praktikum`
--
CREATE TABLE `pendaftaran_praktikum` (
`id` int(11) NOT NULL,
`waktu_start` timestamp NOT NULL DEFAULT current_timestamp(),
`waktu_end` timestamp NOT NULL DEFAULT current_timestamp(),
`PP` tinyint(1) NOT NULL,
`semester` tinyint(1) NOT NULL,
`tahun_ajaran` varchar(9) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0= nonactive; 1=active',
`keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `subject`
--
CREATE TABLE `subject` (
`id` int(11) NOT NULL,
`kode_mk` varchar(6) NOT NULL,
`id_dosen` int(11) NOT NULL,
`nama` varchar(30) NOT NULL,
`kelas_paralel` char(1) NOT NULL,
`status_praktikum` tinyint(1) NOT NULL COMMENT '0=tidak ada; 1=ada',
`status_transfer_nilai` tinyint(1) NOT NULL COMMENT '0=tidak boleh; 1=boleh',
`status` tinyint(1) NOT NULL COMMENT '0=nonactive; 1=active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`level` tinyint(2) DEFAULT NULL COMMENT '1=admin; 2=kepala lab; 3=astap',
`id_lab` int(11) DEFAULT NULL,
`last_login` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ambil_praktikum`
--
ALTER TABLE `ambil_praktikum`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `asisten_dosen`
--
ALTER TABLE `asisten_dosen`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `backup_log`
--
ALTER TABLE `backup_log`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `calon_asisten_dosen`
--
ALTER TABLE `calon_asisten_dosen`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dosen`
--
ALTER TABLE `dosen`
ADD PRIMARY KEY (`NIP`);
--
-- Indexes for table `jadwal_berhalangan`
--
ALTER TABLE `jadwal_berhalangan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `jadwal_wawancara`
--
ALTER TABLE `jadwal_wawancara`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `kelas_praktikum`
--
ALTER TABLE `kelas_praktikum`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `laboratorium`
--
ALTER TABLE `laboratorium`
ADD PRIMARY KEY (`kode_lab`);
--
-- Indexes for table `mahasiswa`
--
ALTER TABLE `mahasiswa`
ADD PRIMARY KEY (`NRP`);
--
-- Indexes for table `mahasiswa_matakuliah`
--
ALTER TABLE `mahasiswa_matakuliah`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pendaftaran_asisten_dosen`
--
ALTER TABLE `pendaftaran_asisten_dosen`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pendaftaran_praktikum`
--
ALTER TABLE `pendaftaran_praktikum`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `subject`
--
ALTER TABLE `subject`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ambil_praktikum`
--
ALTER TABLE `ambil_praktikum`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `asisten_dosen`
--
ALTER TABLE `asisten_dosen`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `backup_log`
--
ALTER TABLE `backup_log`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `calon_asisten_dosen`
--
ALTER TABLE `calon_asisten_dosen`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `jadwal_berhalangan`
--
ALTER TABLE `jadwal_berhalangan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `jadwal_wawancara`
--
ALTER TABLE `jadwal_wawancara`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kelas_praktikum`
--
ALTER TABLE `kelas_praktikum`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `mahasiswa_matakuliah`
--
ALTER TABLE `mahasiswa_matakuliah`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pendaftaran_asisten_dosen`
--
ALTER TABLE `pendaftaran_asisten_dosen`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pendaftaran_praktikum`
--
ALTER TABLE `pendaftaran_praktikum`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `subject`
--
ALTER TABLE `subject`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE EXTENSION test_wal_pipeline;
SELECT test_wal_pipeline();
|
SET NOCOUNT ON
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Documents' AND COLUMN_NAME = 'CategoryId')
BEGIN
PRINT 'Adding Documents.CategoryId'
ALTER TABLE Documents ADD CategoryId BIGINT NULL
END
GO
IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Documents' AND COLUMN_NAME = 'CategoryId') AND COLUMNPROPERTY(OBJECT_ID('Documents', 'U'), 'CategoryId', 'AllowsNull')=1
BEGIN
PRINT 'Making Documents.CategoryId not nullable'
UPDATE Documents SET CategoryId = (SELECT MIN(Id) from DocumentCategories)
ALTER TABLE Documents ADD Constraint FK_Documents_CategoryId FOREIGN KEY(CategoryId) REFERENCES DocumentCategories(Id)
ALTER TABLE Documents ALTER COLUMN CategoryId BIGINT NOT NULL
END
GO
SET NOCOUNT OFF
|
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: 192.168.0.110
-- Generation Time: Nov 30, 2021 at 02:02 PM
-- Server version: 8.0.27-0ubuntu0.20.04.1
-- PHP Version: 7.4.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: `url_rewrites`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`parent_id` int 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 `categories`
--
INSERT INTO `categories` (`id`, `name`, `parent_id`, `created_at`, `updated_at`) VALUES
(1, 'Apple', 0, '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(2, 'Philips', 0, '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(3, 'Sonos', 0, '2021-11-30 00:27:14', '2021-11-30 00:27:14');
-- --------------------------------------------------------
--
-- Table structure for table `category_products`
--
CREATE TABLE `category_products` (
`id` bigint UNSIGNED NOT NULL,
`category_id` int NOT NULL,
`product_id` int 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 `category_products`
--
INSERT INTO `category_products` (`id`, `category_id`, `product_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL),
(2, 1, 2, NULL, NULL),
(3, 1, 3, NULL, NULL),
(4, 1, 4, NULL, NULL),
(5, 2, 5, NULL, NULL),
(6, 2, 6, NULL, NULL),
(7, 3, 7, NULL, NULL),
(8, 3, 8, NULL, NULL),
(9, 3, 9, NULL, NULL);
-- --------------------------------------------------------
--
-- 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;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_03_08_092546_create_url_rewrites_table', 1),
(4, '2019_03_08_092838_create_products_table', 1),
(5, '2019_03_08_094009_create_categories_table', 1),
(6, '2019_03_08_094035_create_category_products_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 `products`
--
CREATE TABLE `products` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` decimal(8,2) 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 `products`
--
INSERT INTO `products` (`id`, `name`, `description`, `image`, `price`, `created_at`, `updated_at`) VALUES
(1, 'Apple iPad 128GB WiFi Space Gray', 'Apple iPad 128GB WiFi Space Gray is actually just like a computer, but it only weighs 469 grams.', '/img/ipad.jpeg', '429.95', NULL, NULL),
(2, 'Apple AirPods', 'Apple AirPods allow you to listen to the music of your iPhone, iPad, Mac, or Apple Watch wirelessly. The earbuds work via Bluetooth and have a 5-hour battery life.', '/img/airpods.jpeg', '178.95', NULL, NULL),
(3, 'Apple MacBook Air 13.3 inches', 'This Macbook allows you to surf the web for up to 12 hours without having to recharge.', '/img/macbook-air.jpeg', '999.99', NULL, NULL),
(4, 'Apple iPhone 7 32GB Black', 'Do you like taking pictures with your smartphone? Then the iPhone 7 comes highly recommended.', '/img/iphone.jpeg', '999.99', NULL, NULL),
(5, 'Philips HUE Starter Pack White with Dimmer switch', 'Discover the possibilities of smart lighting with the Philips Hue White Starter Pack with Dimmer.', '/img/philips-hue-starter-pack-white-with-dimmer-switch.jpg', '89.95', NULL, NULL),
(6, 'Philips 65OLED803 - Ambilight', 'With the Philips 65OLED803 you can view sharp images with a lifelike contrast.', '/img/philips-tv.jpeg', '89.95', NULL, NULL),
(7, 'SONOS One Black', 'Listen to your favorite music wirelessly with the SONOS One.', '/img/sonos.jpeg', '229.95', NULL, NULL),
(8, 'SONOS Sub Black', 'With the Sonos Sub, the bass of your Sonos system sounds extra deep.', '/img/sonos-sub.jpeg', '691.95', NULL, NULL),
(9, 'Sonos Play:5 Wit', 'Are you looking for a powerful wireless speaker? Then the Sonos Play: 5 is the speaker for you.', '/img/sonos-play5.jpeg', '691.95', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `url_rewrites`
--
CREATE TABLE `url_rewrites` (
`id` int UNSIGNED NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type_attributes` json DEFAULT NULL,
`request_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`target_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`redirect_type` smallint NOT NULL DEFAULT '0',
`description` 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 `url_rewrites`
--
INSERT INTO `url_rewrites` (`id`, `type`, `type_attributes`, `request_path`, `target_path`, `redirect_type`, `description`, `created_at`, `updated_at`) VALUES
(1, 'category', '{\"id\": 1}', 'apple', '/category/1', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(2, 'category', '{\"id\": 2}', 'philips', '/category/2', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(3, 'category', '{\"id\": 3}', 'sonos', '/category/3', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(4, 'product', '{\"id\": 1}', 'ipad', '/product/1', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(5, 'product', '{\"id\": 2}', 'airpod', '/product/2', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(6, 'product', '{\"id\": 3}', 'macbook', '/product/3', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(7, 'product', '{\"id\": 4}', 'iphone', '/product/4', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(8, 'product', '{\"id\": 5}', 'dimmer', '/product/5', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(9, 'product', '{\"id\": 6}', 'ambilight', '/product/6', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(10, 'product', '{\"id\": 7}', 'oneblack', '/product/7', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(11, 'product', '{\"id\": 8}', 'subblack', '/product/8', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14'),
(12, 'product', '{\"id\": 9}', 'playwit', '/product/9', 0, '1', '2021-11-30 00:27:14', '2021-11-30 00:27:14');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `category_products`
--
ALTER TABLE `category_products`
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 `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `url_rewrites`
--
ALTER TABLE `url_rewrites`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `category_products`
--
ALTER TABLE `category_products`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `url_rewrites`
--
ALTER TABLE `url_rewrites`
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint 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 */;
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2020-05-25 09:13:51
-- 服务器版本: 5.7.14
-- PHP Version: 7.0.10
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: `soe`
--
-- --------------------------------------------------------
--
-- 表的结构 `soe_comment`
--
CREATE TABLE `soe_comment` (
`comment_Id` int(11) NOT NULL,
`movie_Id` int(11) NOT NULL,
`user_Id` int(11) NOT NULL,
`comment_Content` varchar(2000) NOT NULL,
`comment_Date` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `soe_movie`
--
CREATE TABLE `soe_movie` (
`movie_Id` int(11) NOT NULL,
`movie_Name` varchar(100) NOT NULL,
`movie_Type` varchar(10) NOT NULL,
`movie_Brief` varchar(500) NOT NULL,
`movie_Start` date NOT NULL,
`movie_End` date NOT NULL,
`movie_Time` time NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `soe_order`
--
CREATE TABLE `soe_order` (
`order_Id` int(11) NOT NULL,
`user_Id` int(11) NOT NULL,
`performance_Id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `soe_performance`
--
CREATE TABLE `soe_performance` (
`performance_Id` int(11) NOT NULL,
`movie_Id` int(11) NOT NULL,
`theater_Id` int(11) NOT NULL,
`performance_Start` datetime NOT NULL,
`performance_End` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `soe_performance`
--
INSERT INTO `soe_performance` (`performance_Id`, `movie_Id`, `theater_Id`, `performance_Start`, `performance_End`) VALUES
(1, 1, 0, '2020-01-12 23:23:12', '2020-01-12 23:23:50');
-- --------------------------------------------------------
--
-- 表的结构 `soe_seat`
--
CREATE TABLE `soe_seat` (
`seat_Id` int(11) NOT NULL,
`theater_Id` int(11) NOT NULL,
`seat_Col` int(11) NOT NULL,
`seat_Row` int(11) NOT NULL,
`seat_status` int(11) NOT NULL,
`performance_Id` int(11) NOT NULL,
`performance_End` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `soe_theater`
--
CREATE TABLE `soe_theater` (
`theater_Id` int(11) NOT NULL,
`theater_colnum` int(11) NOT NULL,
`theater_rownum` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `soe_user`
--
CREATE TABLE `soe_user` (
`user_Id` int(11) NOT NULL,
`user_Name` varchar(20) NOT NULL,
`user_Password` varchar(100) NOT NULL,
`user_Status` int(11) NOT NULL COMMENT '1为正常,2为冻结,3为注销,4为管理员',
`user_Email` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `soe_user`
--
INSERT INTO `soe_user` (`user_Id`, `user_Name`, `user_Password`, `user_Status`, `user_Email`) VALUES
(1, 'xuesihao', 'e10adc3949ba59abbe56e057f20f883e', 1, '754769243@qq.com');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `soe_comment`
--
ALTER TABLE `soe_comment`
ADD PRIMARY KEY (`comment_Id`);
--
-- Indexes for table `soe_movie`
--
ALTER TABLE `soe_movie`
ADD PRIMARY KEY (`movie_Id`);
--
-- Indexes for table `soe_order`
--
ALTER TABLE `soe_order`
ADD PRIMARY KEY (`order_Id`);
--
-- Indexes for table `soe_performance`
--
ALTER TABLE `soe_performance`
ADD PRIMARY KEY (`performance_Id`);
--
-- Indexes for table `soe_theater`
--
ALTER TABLE `soe_theater`
ADD PRIMARY KEY (`theater_Id`);
--
-- Indexes for table `soe_user`
--
ALTER TABLE `soe_user`
ADD PRIMARY KEY (`user_Id`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `soe_comment`
--
ALTER TABLE `soe_comment`
MODIFY `comment_Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `soe_movie`
--
ALTER TABLE `soe_movie`
MODIFY `movie_Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `soe_order`
--
ALTER TABLE `soe_order`
MODIFY `order_Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `soe_performance`
--
ALTER TABLE `soe_performance`
MODIFY `performance_Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- 使用表AUTO_INCREMENT `soe_theater`
--
ALTER TABLE `soe_theater`
MODIFY `theater_Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `soe_user`
--
ALTER TABLE `soe_user`
MODIFY `user_Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
DELIMITER $$
--
-- 事件
--
CREATE DEFINER=`root`@`localhost` EVENT `删除过期的演出计划的座位` ON SCHEDULE EVERY 1 DAY STARTS '2020-05-24 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO DELETE FROM soe_seat WHERE now()>performance_End$$
DELIMITER ;
/*!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 DATABASE IF NOT EXISTS QUERY_SIMPLE_PARAMS_DB;
USE QUERY_SIMPLE_PARAMS_DB;
DROP TABLE IF EXISTS DataTable;
CREATE TABLE IF NOT EXISTS DataTable(
row_id INTEGER,
int_type INTEGER,
long_type BIGINT,
float_type FLOAT,
double_type DOUBLE,
boolean_type BOOLEAN,
string_type VARCHAR(50),
decimal_type DECIMAL(20, 2),
PRIMARY KEY (row_id)
);
INSERT INTO DataTable (row_id, int_type, long_type, float_type, double_type, boolean_type, string_type, decimal_type)
VALUES(1, 1, 9223372036854774807, 123.34, 2139095039, TRUE, 'Hello', 23.45);
INSERT INTO DataTable (row_id) VALUES (2);
INSERT INTO DataTable (row_id, int_type, long_type, float_type, double_type, boolean_type, string_type, decimal_type)
VALUES(3, 1, 9372036854774807, 124.34, 29095039, false, '1', 25.45);
DROP TABLE IF EXISTS ComplexTypes;
CREATE TABLE IF NOT EXISTS ComplexTypes(
row_id INTEGER NOT NULL,
tinyblob_type TINYBLOB,
blob_type BLOB,
mediumblob_type MEDIUMBLOB,
longblob_type LONGBLOB,
tinytext_type TINYTEXT,
text_type TEXT,
mediumtext_type MEDIUMTEXT,
longtext_type LONGTEXT,
binary_type BINARY(27),
var_binary_type VARBINARY(27),
PRIMARY KEY (row_id)
);
INSERT INTO ComplexTypes (row_id, tinyblob_type, blob_type, mediumblob_type, longblob_type, tinytext_type, text_type,
mediumtext_type, longtext_type, binary_type, var_binary_type) VALUES
(1, X'77736F322062616C6C6572696E6120626C6F6220746573742E', X'77736F322062616C6C6572696E6120626C6F6220746573742E',
X'77736F322062616C6C6572696E6120626C6F6220746573742E', X'77736F322062616C6C6572696E6120626C6F6220746573742E',
'very long text', 'very long text','very long text','very long text',
X'77736F322062616C6C6572696E612062696E61727920746573742E', X'77736F322062616C6C6572696E612062696E61727920746573742E');
INSERT INTO ComplexTypes (row_id, tinyblob_type, blob_type, mediumblob_type, longblob_type, tinytext_type, text_type,
mediumtext_type, longtext_type, binary_type, var_binary_type) VALUES
(2, null, null, null, null, null, null, null, null, null, null);
DROP TABLE IF EXISTS NumericTypes;
CREATE TABLE NumericTypes (
id INT AUTO_INCREMENT,
int_type INT NOT NULL,
bigint_type BIGINT NOT NULL,
smallint_type SMALLINT NOT NULL ,
mediumint_type MEDIUMINT NOT NULL ,
tinyint_type TINYINT NOT NULL ,
bit_type BIT NOT NULL ,
decimal_type DECIMAL(10,3) NOT NULL ,
numeric_type NUMERIC(10,3) NOT NULL ,
float_type FLOAT NOT NULL ,
real_type REAL NOT NULL ,
PRIMARY KEY (id)
);
INSERT INTO NumericTypes (id, int_type, bigint_type, smallint_type, mediumint_type, tinyint_type, bit_type, decimal_type, numeric_type,
float_type, real_type) VALUES (1, 2147483647, 9223372036854774807, 32767, 8388607, 127, 1, 1234.567, 1234.567, 1234.567,
1234.567);
INSERT INTO NumericTypes (id, int_type, bigint_type, smallint_type, mediumint_type, tinyint_type, bit_type, decimal_type, numeric_type,
float_type, real_type) VALUES (2, 2147483647, 9223372036854774807, 32767, 8388607, 127, 1, 1234, 1234, 1234,
1234);
DROP TABLE IF EXISTS DateTimeTypes;
CREATE TABLE IF NOT EXISTS DateTimeTypes(
row_id INTEGER NOT NULL,
date_type DATE,
time_type TIME,
timestamp_type TIMESTAMP,
datetime_type DATETIME,
PRIMARY KEY (row_id)
);
INSERT INTO DateTimeTypes (row_id, date_type, time_type, datetime_type, timestamp_type) VALUES
(1,'2017-02-03', '11:35:45', '2017-02-03 11:53:00', '2017-02-03 11:53:00');
DROP TABLE IF EXISTS ENUMTable;
CREATE TABLE ENUMTable (
id integer NOT NULL,
enum_type ENUM('admin','doctor','housekeeper') DEFAULT NULL,
PRIMARY KEY (id)
);
INSERT INTO ENUMTable(id, enum_type) VALUES (1, 'doctor');
DROP TABLE IF EXISTS SetTable;
CREATE TABLE SetTable (
row_id INTEGER NOT NULL,
set_type SET('a', 'b', 'c', 'd')
);
INSERT INTO SetTable (row_id, set_type) VALUES (1, 'a,d'), (2, 'd,a'), (3, 'a,d,a');
DROP TABLE IF EXISTS GEOTable;
CREATE TABLE GEOTable(
id INTEGER NOT NULL ,
geom GEOMETRY
);
INSERT INTO GEOTable (id, geom) values (1, ST_GeomFromText('POINT(7 52)'));
DROP TABLE IF EXISTS JsonTable;
CREATE TABLE JsonTable(
id INTEGER NOT NULL ,
json_type JSON
);
INSERT INTO JsonTable (id, json_type) values (1, JSON_OBJECT('id', 100, 'name', 'Joe', 'groups', '[2,5]'));
|
-- List the name of the head of modules with the list of his phone number.
SELECT
instructor.person_id,
person.first_name || ' ' || person.last_name "Name",
person.m_phone_no "Permanent Phone Number",
address.phone_no "Temporary Phone Number"
FROM
instructor
JOIN
person
ON
(instructor.person_id = person.person_id)
LEFT JOIN
person_address
ON
(instructor.person_id = person_address.person_id)
LEFT JOIN
address
ON
(person_address.address_id = address.address_id)
WHERE
instructor.role = 'mod ldr'
;
-- OK
|
--+ holdcas on;
select json_set('"x"', '/0', '"a"');
select json_set('"x"', '$', '"a"');
select json_set('"x"', '$', 'a');
select json_keys('{"a": 1, "b": {"c": 30}}');
select json_type(json_keys('{"a": 1, "b": {"c": 30}}'));
select json_keys('{"a": 1, "b": {"c": 30}}', '$.b.c'),json_keys('{"a": 1, "b": {"c": 30}}', '$.b');
select json_keys('null');
select json_get_all_paths('{"a": 1, "b": {"c": 30}}');
select json_get_all_paths('["a", "b", {"a": 1, "b": 2, "c": {"d": 4}}]');
select json_get_all_paths(json_extract('{"a": 1, "b": {"c": 30}}','$.b'));
select json_object('a','b','c',1,'d',json_array('1','a')) as "json_object",
json_get_all_paths(json_object('a','b','c',1,'d',json_array('1','a'))) all_paths,
json_type(json_get_all_paths(json_object('a','b','c',1,'d',json_array('1','a')))) type,
json_length(json_get_all_paths(json_object('a','b','c',1,'d',json_array('1','a')))) length,
json_depth(json_get_all_paths(json_object('a','b','c',1,'d',json_array('1','a')))) as "depth";
select json_extract(json_get_all_paths(json_object('a','b','c',1,'d',json_array('1','a'))),'$[0]');
set @j = '["a", ["b", "c"], "d"]';
select json_keys(json_array_append(@j, '/1', '1','/0', '2', '/2', '4','/2/0', '5'));
select json_array_append(@j, '/1', '1','/0', '2', '/2', '3','/', '4');
select json_array_append(@j, '/1', '1','/0', '2', '/2', '3','', '4');
select json_array_append(@j, '/1', '1','/0', '2', '/2', '3','$', '4');
select json_array_append(@j, '/1', '1');
select json_array_append(@j, '/0', '2');
select json_array_append(@j, '/1/0', '3');
select json_array_append(@j, '/1', '1','/0', '2', '/1/0', '3');
select json_array_append(@j, '/1', '1','/0', '2', '/1/0', '3', '/1/0', '4');
--error
select json_array_append(@j, '/1', '1','/0', '2', '/3', '3', '/3/','"x"');
select json_array_append(@j, '/1', '1','$[0]', '2', '/2', '3');
select json_array_append(@j, '/1', '1','/0', '2', '/2', '{"aaa":"12344"}');
select json_array_append(@j, '/1', '1','/0', '2', '/2', '3','/', '4');
select json_array_append(@j, '/1', null);
select json_array_append(@j, '/0', '{"key":[9,8,"a"]}', '/0/1/key', '"x"');
select json_array_append(@j, '/0', cast('{"key":[9,8,"a"]}' as json), '/0/1/key', 'x');
set @j = null;
select json_array_append(@j, '/1', '1');
select json_array_append(@j, '/', null);
SET @j = '{"a": 1, "b": [2, 3], "c": 4}';
select json_array_append(@j, '/', '"z"');
select json_array_append(@j, '', '"z"');
select json_array_append(@j, '$', '"z"');
select json_array_append(@j, '/b', '"x"');
select json_array_append(@j, '/c', '"y"');
select json_array_append(@j, '/b', '"x"','/b', '"x"');
select json_array_append(@j, '/b', '"x"','/b/2','"y"');
SET @j = '["a", {"b": [true, false]}, [10, 20]]';
select json_set(@j, '/1/b/0', '1', '/2/2', '2');
select json_insert(@j, '/1/b/0-', '1', '/2/2-', '2');
select json_insert(@j, '/1/b/-0', '1', '/2/2/-', '2');
select json_insert(@j, '/1/b/-', '1', '/2/-', '2');
select json_insert(@j, '/1/b/-', '1', '/2-', '2');
select json_replace(@j, '/1/b/0', '1', '/2/1', '2');
select json_replace(@j, '/1/b/0', '1', '/2', '2');
select json_replace(@j, '/1/b', '[1,2,3]', '/2', '2');
select json_replace(@j, '/1/b', '[1,2,3]', '/1/b/1', '"a"');
select json_replace(@j, '/1/b', cast('[1,2,3]' as json), '/1/b/1', 'a');
set @j = '{ "a": 1, "b": [2, 3]}';
--error
select json_replace(@j, '/a', '10', '/c', '[true, false]');
--error
SELECT json_replace(@j, '$.a', '10', '$.c', '[true, false]');
--error
select json_remove(@j, '/2', '/1/b/1', '/1/b/1');
drop table if exists json_test;
create table json_test(id int, emp json);
insert into json_test values (1,'{
"programmers": [
{"fName": "aa","lName": "ccc","email": "aaaa@aaa.aa"},
{"fName": "bb","lName": "ccc","email": "bbbb@aaa.aa"},
{"fName": "ee","lName": "eee","email": "cccc@aaa.aa"}],
"authors": [
{"fName": "ff","lName": "fff","works": "sss@aaa.aa"},
{"fName": "gg","lName": "ggg","works": "fff@aaa.aa"},
{"fName": "ss","lName": "sss","works": "ccc@aaa.aa"}],
"musicians": [
{"fName": "rr","lName": "rrr","songs": "gg@aaa.aa"},
{"fName": "yy","lName": "yyy","songs": "pp@aaa.aa"}]}
');
select json_keys(emp) from json_test;
select json_keys(emp,'/authors') from json_test;
select json_keys(emp,'$.authors[1]') from json_test;
select json_get_all_paths(emp) from json_test;
select json_extract(authors,'/lName') name, authors,json_get_all_paths(authors) from (
select id,json_extract(emp,'/authors/0') authors from json_test
union all
select id,json_extract(emp,'/authors/1') authors from json_test
union all
select id,json_extract(emp,'/authors/2') authors from json_test
) as t1 order by name desc;
select json_extract(authors,'/lName') name, authors,json_keys(authors) from (
select id,json_extract(emp,'/authors/0') authors from json_test
union all
select id,json_extract(emp,'/authors/1') authors from json_test
union all
select id,json_extract(emp,'/authors/2') authors from json_test
) as t1 order by name desc;
select
json_extract(authors,'/fName') fName,
json_extract(authors,'/lName') lName,
json_extract(authors,'/works') works
from (
select id,json_extract(emp,'/authors/0') authors from json_test
) as t;
update json_test set emp = json_remove(emp,'/authors');
select * from json_test;
drop table if exists json_test;
drop VARIABLE @j;
--+ holdcas off;
|
/*
-- sys.fn_stmt_sql_handle_from_sql_stmt からの取得
EXEC Q2
SELECT * FROM sys.fn_stmt_sql_handle_from_sql_stmt('EXEC Q2', NULL);
*/
-- ハッシュからの取得
DECLARE @query_hash binary(8) = 0xB4A24E1213D92EE3
SELECT
i.start_time,
i.end_time,
q.query_id ,
q.query_text_id,
q.initial_compile_start_time,
q.last_compile_start_time,
q.last_execution_time,
p.compatibility_level,
t.query_sql_text,
CAST(p.query_plan AS xml) AS query_plan,
r.*
FROM
sys.query_store_query q
INNER JOIN sys.query_store_plan p
ON q.query_id = p.query_id
INNER JOIN sys.query_store_query_text t
ON t.query_text_id = q.query_text_id
INNER JOIN sys.query_store_runtime_stats r
ON r.plan_id =p.plan_id
INNER JOIN sys.query_store_runtime_stats_interval i
ON i.runtime_stats_interval_id = r.runtime_stats_interval_id
WHERE
q.query_hash = @query_hash
ORDER BY
i.start_time,q.query_id
|
select quote(binary_9) from nulls2 where rowid = 1 and binary_9 is not X'00'
|
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
----------------
--- ENUM support
----------------
--- ENUM basic operations
create table card (rank int, suit enum('hearts', 'clubs', 'spades'));
> ok
insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (4, NULL);
> update count: 3
alter table card alter column suit enum('hearts', 'clubs', 'spades', 'diamonds');
> ok
select * from card;
> RANK SUIT
> ---- ------
> 0 clubs
> 3 hearts
> 4 null
> rows: 3
@reconnect
select suit from card where rank = 0;
>> clubs
alter table card alter column suit enum('a', 'b', 'c', 'd');
> exception ENUM_VALUE_NOT_PERMITTED
alter table card alter column suit enum('''none''', 'hearts', 'clubs', 'spades', 'diamonds');
> ok
select * from card order by suit;
> RANK SUIT
> ---- ------
> 4 null
> 3 hearts
> 0 clubs
> rows (ordered): 3
insert into card (rank, suit) values (8, 'diamonds'), (10, 'clubs'), (7, 'hearts');
> update count: 3
select suit, count(rank) from card group by suit order by suit, count(rank);
> SUIT COUNT(RANK)
> -------- -----------
> null 1
> hearts 2
> clubs 2
> diamonds 1
> rows (ordered): 4
select rank from card where suit = 'diamonds';
>> 8
select column_type from information_schema.columns where COLUMN_NAME = 'SUIT';
>> ENUM('''none''', 'hearts', 'clubs', 'spades', 'diamonds')
alter table card alter column suit enum('hearts', 'clubs', 'spades', 'diamonds');
> ok
alter table card alter column suit enum('hearts', 'clubs', 'spades', 'diamonds', 'long_enum_value_of_128_chars_00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
> ok
insert into card (rank, suit) values (11, 'long_enum_value_of_128_chars_00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
> update count: 1
--- ENUM integer-based operations
select rank from card where suit = 1;
> RANK
> ----
> 0
> 10
> rows: 2
insert into card (rank, suit) values(5, 2);
> update count: 1
select * from card where rank = 5;
> RANK SUIT
> ---- ------
> 5 spades
> rows: 1
--- ENUM edge cases
insert into card (rank, suit) values(6, ' ');
> exception ENUM_VALUE_NOT_PERMITTED
alter table card alter column suit enum('hearts', 'clubs', 'spades', 'diamonds', 'clubs');
> exception ENUM_DUPLICATE
alter table card alter column suit enum('hearts', 'clubs', 'spades', 'diamonds', '');
> exception ENUM_EMPTY
drop table card;
> ok
--- ENUM as custom user data type
create type CARD_SUIT as enum('hearts', 'clubs', 'spades', 'diamonds');
> ok
create table card (rank int, suit CARD_SUIT);
> ok
insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts');
> update count: 2
select * from card;
> RANK SUIT
> ---- ------
> 0 clubs
> 3 hearts
> rows: 2
drop table card;
> ok
drop type CARD_SUIT;
> ok
--- ENUM in primary key with another column
create type CARD_SUIT as enum('hearts', 'clubs', 'spades', 'diamonds');
> ok
create table card (rank int, suit CARD_SUIT, primary key(rank, suit));
> ok
insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (1, 'clubs');
> update count: 3
insert into card (rank, suit) values (0, 'clubs');
> exception DUPLICATE_KEY_1
select rank from card where suit = 'clubs';
> RANK
> ----
> 0
> 1
> rows: 2
drop table card;
> ok
drop type CARD_SUIT;
> ok
--- ENUM with index
create type CARD_SUIT as enum('hearts', 'clubs', 'spades', 'diamonds');
> ok
create table card (rank int, suit CARD_SUIT, primary key(rank, suit));
> ok
insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (1, 'clubs');
> update count: 3
create index idx_card_suite on card(`suit`);
> ok
select rank from card where suit = 'clubs';
> RANK
> ----
> 0
> 1
> rows: 2
select rank from card where suit in ('clubs');
> RANK
> ----
> 0
> 1
> rows: 2
insert into card values (2, 'diamonds');
> update count: 1
select rank from card where suit in ('clubs', 'hearts');
> RANK
> ----
> 0
> 1
> 3
> rows: 3
select rank from card where suit in ('clubs', 'hearts') or suit = 'diamonds';
> RANK
> ----
> 0
> 1
> 2
> 3
> rows: 4
drop table card;
> ok
drop type CARD_SUIT;
> ok
CREATE TABLE TEST(ID INT, E1 ENUM('A', 'B') DEFAULT 'A', E2 ENUM('C', 'D') DEFAULT 'C' ON UPDATE 'D');
> ok
INSERT INTO TEST(ID) VALUES (1);
> update count: 1
SELECT * FROM TEST;
> ID E1 E2
> -- -- --
> 1 A C
> rows: 1
UPDATE TEST SET E1 = 'B';
> update count: 1
SELECT * FROM TEST;
> ID E1 E2
> -- -- --
> 1 B D
> rows: 1
DROP TABLE TEST;
> ok
CREATE TABLE TEST(E ENUM('A', 'B'));
> ok
INSERT INTO TEST VALUES ('B');
> update count: 1
CREATE VIEW V AS SELECT * FROM TEST;
> ok
SELECT * FROM V;
>> B
CREATE VIEW V1 AS SELECT E + 2 AS E FROM TEST;
> ok
SELECT * FROM V1;
>> 3
CREATE VIEW V2 AS SELECT E + E AS E FROM TEST;
> ok
SELECT * FROM V2;
>> 2
CREATE VIEW V3 AS SELECT -E AS E FROM TEST;
> ok
SELECT * FROM V3;
>> -1
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'E' ORDER BY TABLE_NAME;
> TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION DOMAIN_CATALOG DOMAIN_SCHEMA DOMAIN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE IS_VISIBLE
> ------------- ------------ ---------- ----------- ---------------- -------------- ------------- ----------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- -------------- ---------------- ----------
> SCRIPT PUBLIC TEST E 1 null null null null YES 1111 1 1 1 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A', 'B') null TRUE
> SCRIPT PUBLIC V E 1 null null null null YES 1111 1 1 1 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A', 'B') null TRUE
> SCRIPT PUBLIC V1 E 1 null null null null YES 4 10 10 10 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> SCRIPT PUBLIC V2 E 1 null null null null YES 4 10 10 10 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> SCRIPT PUBLIC V3 E 1 null null null null YES 4 10 10 10 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> rows (ordered): 5
DROP VIEW V;
> ok
DROP VIEW V1;
> ok
DROP VIEW V2;
> ok
DROP VIEW V3;
> ok
DROP TABLE TEST;
> ok
SELECT CAST (2 AS ENUM('a', 'b', 'c', 'd'));
>> c
CREATE TABLE TEST(E ENUM('a', 'b'));
> ok
EXPLAIN SELECT * FROM TEST WHERE E = 'a';
>> SELECT "TEST"."E" FROM "PUBLIC"."TEST" /* PUBLIC.TEST.tableScan */ WHERE "E" = 'a'
INSERT INTO TEST VALUES ('a');
> update count: 1
(SELECT * FROM TEST A) UNION ALL (SELECT * FROM TEST A);
> E
> -
> a
> a
> rows: 2
(SELECT * FROM TEST A) MINUS (SELECT * FROM TEST A);
> E
> -
> rows: 0
DROP TABLE TEST;
> ok
|
CREATE DATABASE wisher;
USE wisher;
CREATE TABLE IF NOT EXISTS ci_sessions (
id VARCHAR(128) NOT NULL,
ip_address VARCHAR(45) NOT NULL,
timestamp INT UNSIGNED DEFAULT 0 NOT NULL,
data BLOB NOT NULL,
KEY ci_sessions_timestamp(timestamp)
);
CREATE TABLE IF NOT EXISTS Users(
UserId INT AUTO_INCREMENT NOT NULL,
Username VARCHAR(40) NOT NULL,
Email VARCHAR(50) NOT NULL,
Password VARCHAR(255) NOT NULL,
CreatedAt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(UserId),
INDEX (Email)
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS WishList(
ListId INT AUTO_INCREMENT NOT NULL,
Title VARCHAR(100) NOT NULL,
Description VARCHAR(255) NOT NULL,
UserId INT NOT NULL,
CreatedAt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
UpdatedAt DATETIME NULL,
PRIMARY KEY(ListId),
FOREIGN KEY (UserId) REFERENCES Users(UserId)
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS Priority(
PriorityId INT AUTO_INCREMENT NOT NULL,
PriorityTitle VARCHAR(100) NOT NULL,
PRIMARY KEY(PriorityId)
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS WishListItems(
ItemId INT AUTO_INCREMENT NOT NULL,
Title VARCHAR(100) NOT NULL,
URL VARCHAR(255) NOT NULL,
Price DECIMAL(6,2) NOT NULL,
Quantity INT NOT NULL,
PriorityId INT NOT NULL,
ListId INT NOT NULL,
CreatedAt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
UpdatedAt DATETIME NULL,
PRIMARY KEY(ItemId),
FOREIGN KEY (ListId) REFERENCES WishList(ListId),
FOREIGN KEY (PriorityId) REFERENCES Priority(PriorityId)
)ENGINE = InnoDB;
|
INSERT INTO `country` VALUES ('40', '阿联酋', 'ae');
INSERT INTO `country` VALUES ('41', '南非', 'za');
INSERT INTO `country` VALUES ('42', '缅甸', 'mm');
INSERT INTO `country` VALUES ('43', '冰岛', 'is');
INSERT INTO `country` VALUES ('44', '芬兰', 'fi');
INSERT INTO `country` VALUES ('45', '卢森堡', 'lu');
INSERT INTO `country` VALUES ('46', '比利时', 'be');
-- 用户余额字段由decimal改为int,数值变大一百倍
ALTER TABLE `user` MODIFY `balance` int(11) NOT NULL DEFAULT '0' COMMENT '余额,单位分';
UPDATE `user` SET balance = balance * 100;
-- 用于余额日志表 balance 字段改 amount字段
ALTER TABLE `user_balance_log` CHANGE `balance` `amount` int(11) NOT NULL DEFAULT '0' COMMENT '发生金额,单位分';
|
-- MySQL dump 10.18 Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: wikidbschema
-- ------------------------------------------------------
-- Server version 10.3.27-MariaDB-0+deb10u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `actor`
--
DROP TABLE IF EXISTS `actor`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `actor` (
`actor_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`actor_user` int(10) unsigned DEFAULT NULL,
`actor_name` varbinary(255) NOT NULL,
PRIMARY KEY (`actor_id`),
UNIQUE KEY `actor_name` (`actor_name`),
UNIQUE KEY `actor_user` (`actor_user`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `actor`
--
LOCK TABLES `actor` WRITE;
/*!40000 ALTER TABLE `actor` DISABLE KEYS */;
INSERT INTO `actor` VALUES (1,1,'Demo'),(2,2,'MediaWiki default');
/*!40000 ALTER TABLE `actor` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `archive`
--
DROP TABLE IF EXISTS `archive`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `archive` (
`ar_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ar_namespace` int(11) NOT NULL DEFAULT 0,
`ar_title` varbinary(255) NOT NULL DEFAULT '',
`ar_comment_id` bigint(20) unsigned NOT NULL,
`ar_actor` bigint(20) unsigned NOT NULL,
`ar_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`ar_minor_edit` tinyint(4) NOT NULL DEFAULT 0,
`ar_rev_id` int(10) unsigned NOT NULL,
`ar_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
`ar_len` int(10) unsigned DEFAULT NULL,
`ar_page_id` int(10) unsigned DEFAULT NULL,
`ar_parent_id` int(10) unsigned DEFAULT NULL,
`ar_sha1` varbinary(32) NOT NULL DEFAULT '',
PRIMARY KEY (`ar_id`),
UNIQUE KEY `ar_revid_uniq` (`ar_rev_id`),
KEY `name_title_timestamp` (`ar_namespace`,`ar_title`,`ar_timestamp`),
KEY `ar_actor_timestamp` (`ar_actor`,`ar_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `archive`
--
LOCK TABLES `archive` WRITE;
/*!40000 ALTER TABLE `archive` DISABLE KEYS */;
/*!40000 ALTER TABLE `archive` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `bot_passwords`
--
DROP TABLE IF EXISTS `bot_passwords`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bot_passwords` (
`bp_user` int(10) unsigned NOT NULL,
`bp_app_id` varbinary(32) NOT NULL,
`bp_password` tinyblob NOT NULL,
`bp_token` binary(32) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`bp_restrictions` blob NOT NULL,
`bp_grants` blob NOT NULL,
PRIMARY KEY (`bp_user`,`bp_app_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `bot_passwords`
--
LOCK TABLES `bot_passwords` WRITE;
/*!40000 ALTER TABLE `bot_passwords` DISABLE KEYS */;
/*!40000 ALTER TABLE `bot_passwords` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `category` (
`cat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`cat_title` varbinary(255) NOT NULL,
`cat_pages` int(11) NOT NULL DEFAULT 0,
`cat_subcats` int(11) NOT NULL DEFAULT 0,
`cat_files` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`cat_id`),
UNIQUE KEY `cat_title` (`cat_title`),
KEY `cat_pages` (`cat_pages`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `category`
--
LOCK TABLES `category` WRITE;
/*!40000 ALTER TABLE `category` DISABLE KEYS */;
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `categorylinks`
--
DROP TABLE IF EXISTS `categorylinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categorylinks` (
`cl_from` int(10) unsigned NOT NULL DEFAULT 0,
`cl_to` varbinary(255) NOT NULL DEFAULT '',
`cl_sortkey` varbinary(230) NOT NULL DEFAULT '',
`cl_sortkey_prefix` varbinary(255) NOT NULL DEFAULT '',
`cl_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`cl_collation` varbinary(32) NOT NULL DEFAULT '',
`cl_type` enum('page','subcat','file') NOT NULL DEFAULT 'page',
PRIMARY KEY (`cl_from`,`cl_to`),
KEY `cl_sortkey` (`cl_to`,`cl_type`,`cl_sortkey`,`cl_from`),
KEY `cl_timestamp` (`cl_to`,`cl_timestamp`),
KEY `cl_collation_ext` (`cl_collation`,`cl_to`,`cl_type`,`cl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `categorylinks`
--
LOCK TABLES `categorylinks` WRITE;
/*!40000 ALTER TABLE `categorylinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `categorylinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `change_tag`
--
DROP TABLE IF EXISTS `change_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `change_tag` (
`ct_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ct_rc_id` int(11) DEFAULT NULL,
`ct_log_id` int(10) unsigned DEFAULT NULL,
`ct_rev_id` int(10) unsigned DEFAULT NULL,
`ct_params` blob DEFAULT NULL,
`ct_tag_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`ct_id`),
UNIQUE KEY `change_tag_rc_tag_id` (`ct_rc_id`,`ct_tag_id`),
UNIQUE KEY `change_tag_log_tag_id` (`ct_log_id`,`ct_tag_id`),
UNIQUE KEY `change_tag_rev_tag_id` (`ct_rev_id`,`ct_tag_id`),
KEY `change_tag_tag_id_id` (`ct_tag_id`,`ct_rc_id`,`ct_rev_id`,`ct_log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `change_tag`
--
LOCK TABLES `change_tag` WRITE;
/*!40000 ALTER TABLE `change_tag` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_tag` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `change_tag_def`
--
DROP TABLE IF EXISTS `change_tag_def`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `change_tag_def` (
`ctd_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ctd_name` varbinary(255) NOT NULL,
`ctd_user_defined` tinyint(1) NOT NULL,
`ctd_count` bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`ctd_id`),
UNIQUE KEY `ctd_name` (`ctd_name`),
KEY `ctd_count` (`ctd_count`),
KEY `ctd_user_defined` (`ctd_user_defined`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `change_tag_def`
--
LOCK TABLES `change_tag_def` WRITE;
/*!40000 ALTER TABLE `change_tag_def` DISABLE KEYS */;
/*!40000 ALTER TABLE `change_tag_def` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment` (
`comment_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`comment_hash` int(11) NOT NULL,
`comment_text` blob NOT NULL,
`comment_data` blob DEFAULT NULL,
PRIMARY KEY (`comment_id`),
KEY `comment_hash` (`comment_hash`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `comment`
--
LOCK TABLES `comment` WRITE;
/*!40000 ALTER TABLE `comment` DISABLE KEYS */;
INSERT INTO `comment` VALUES (1,0,'',NULL);
/*!40000 ALTER TABLE `comment` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `content`
--
DROP TABLE IF EXISTS `content`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `content` (
`content_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`content_size` int(10) unsigned NOT NULL,
`content_sha1` varbinary(32) NOT NULL,
`content_model` smallint(5) unsigned NOT NULL,
`content_address` varbinary(255) NOT NULL,
PRIMARY KEY (`content_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `content`
--
LOCK TABLES `content` WRITE;
/*!40000 ALTER TABLE `content` DISABLE KEYS */;
INSERT INTO `content` VALUES (1,784,'ezw1y7tpy380c53gmx6sikr7wj415iu',1,'tt:1');
/*!40000 ALTER TABLE `content` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `content_models`
--
DROP TABLE IF EXISTS `content_models`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `content_models` (
`model_id` smallint(6) NOT NULL AUTO_INCREMENT,
`model_name` varbinary(64) NOT NULL,
PRIMARY KEY (`model_id`),
UNIQUE KEY `model_name` (`model_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `content_models`
--
LOCK TABLES `content_models` WRITE;
/*!40000 ALTER TABLE `content_models` DISABLE KEYS */;
INSERT INTO `content_models` VALUES (1,'wikitext');
/*!40000 ALTER TABLE `content_models` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `externallinks`
--
DROP TABLE IF EXISTS `externallinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `externallinks` (
`el_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`el_from` int(10) unsigned NOT NULL DEFAULT 0,
`el_to` blob NOT NULL,
`el_index` blob NOT NULL,
`el_index_60` varbinary(60) NOT NULL,
PRIMARY KEY (`el_id`),
KEY `el_from` (`el_from`,`el_to`(40)),
KEY `el_to` (`el_to`(60),`el_from`),
KEY `el_index` (`el_index`(60)),
KEY `el_index_60` (`el_index_60`,`el_id`),
KEY `el_from_index_60` (`el_from`,`el_index_60`,`el_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `externallinks`
--
LOCK TABLES `externallinks` WRITE;
/*!40000 ALTER TABLE `externallinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `externallinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `filearchive`
--
DROP TABLE IF EXISTS `filearchive`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `filearchive` (
`fa_id` int(11) NOT NULL AUTO_INCREMENT,
`fa_name` varbinary(255) NOT NULL DEFAULT '',
`fa_archive_name` varbinary(255) DEFAULT '',
`fa_storage_group` varbinary(16) DEFAULT NULL,
`fa_storage_key` varbinary(64) DEFAULT '',
`fa_deleted_user` int(11) DEFAULT NULL,
`fa_deleted_timestamp` binary(14) DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`fa_deleted_reason_id` bigint(20) unsigned NOT NULL,
`fa_size` int(10) unsigned DEFAULT 0,
`fa_width` int(11) DEFAULT 0,
`fa_height` int(11) DEFAULT 0,
`fa_metadata` mediumblob DEFAULT NULL,
`fa_bits` int(11) DEFAULT 0,
`fa_media_type` enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') DEFAULT NULL,
`fa_major_mime` enum('unknown','application','audio','image','text','video','message','model','multipart','chemical') DEFAULT 'unknown',
`fa_minor_mime` varbinary(100) DEFAULT 'unknown',
`fa_description_id` bigint(20) unsigned NOT NULL,
`fa_actor` bigint(20) unsigned NOT NULL,
`fa_timestamp` binary(14) DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`fa_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
`fa_sha1` varbinary(32) NOT NULL DEFAULT '',
PRIMARY KEY (`fa_id`),
KEY `fa_name` (`fa_name`,`fa_timestamp`),
KEY `fa_storage_group` (`fa_storage_group`,`fa_storage_key`),
KEY `fa_deleted_timestamp` (`fa_deleted_timestamp`),
KEY `fa_actor_timestamp` (`fa_actor`,`fa_timestamp`),
KEY `fa_sha1` (`fa_sha1`(10))
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `filearchive`
--
LOCK TABLES `filearchive` WRITE;
/*!40000 ALTER TABLE `filearchive` DISABLE KEYS */;
/*!40000 ALTER TABLE `filearchive` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `image`
--
DROP TABLE IF EXISTS `image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `image` (
`img_name` varbinary(255) NOT NULL DEFAULT '',
`img_size` int(10) unsigned NOT NULL DEFAULT 0,
`img_width` int(11) NOT NULL DEFAULT 0,
`img_height` int(11) NOT NULL DEFAULT 0,
`img_metadata` mediumblob NOT NULL,
`img_bits` int(11) NOT NULL DEFAULT 0,
`img_media_type` enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') DEFAULT NULL,
`img_major_mime` enum('unknown','application','audio','image','text','video','message','model','multipart','chemical') NOT NULL DEFAULT 'unknown',
`img_minor_mime` varbinary(100) NOT NULL DEFAULT 'unknown',
`img_description_id` bigint(20) unsigned NOT NULL,
`img_actor` bigint(20) unsigned NOT NULL,
`img_timestamp` varbinary(14) NOT NULL DEFAULT '',
`img_sha1` varbinary(32) NOT NULL DEFAULT '',
PRIMARY KEY (`img_name`),
KEY `img_actor_timestamp` (`img_actor`,`img_timestamp`),
KEY `img_size` (`img_size`),
KEY `img_timestamp` (`img_timestamp`),
KEY `img_sha1` (`img_sha1`(10)),
KEY `img_media_mime` (`img_media_type`,`img_major_mime`,`img_minor_mime`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `image`
--
LOCK TABLES `image` WRITE;
/*!40000 ALTER TABLE `image` DISABLE KEYS */;
/*!40000 ALTER TABLE `image` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `imagelinks`
--
DROP TABLE IF EXISTS `imagelinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `imagelinks` (
`il_from` int(10) unsigned NOT NULL DEFAULT 0,
`il_from_namespace` int(11) NOT NULL DEFAULT 0,
`il_to` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`il_from`,`il_to`),
KEY `il_to` (`il_to`,`il_from`),
KEY `il_backlinks_namespace` (`il_from_namespace`,`il_to`,`il_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `imagelinks`
--
LOCK TABLES `imagelinks` WRITE;
/*!40000 ALTER TABLE `imagelinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `imagelinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `interwiki`
--
DROP TABLE IF EXISTS `interwiki`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `interwiki` (
`iw_prefix` varbinary(32) NOT NULL,
`iw_url` blob NOT NULL,
`iw_api` blob NOT NULL,
`iw_wikiid` varbinary(64) NOT NULL,
`iw_local` tinyint(1) NOT NULL,
`iw_trans` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`iw_prefix`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `interwiki`
--
LOCK TABLES `interwiki` WRITE;
/*!40000 ALTER TABLE `interwiki` DISABLE KEYS */;
INSERT INTO `interwiki` VALUES ('acronym','https://www.acronymfinder.com/~/search/af.aspx?string=exact&Acronym=$1','','',0,0),('advogato','http://www.advogato.org/$1','','',0,0),('arxiv','https://www.arxiv.org/abs/$1','','',0,0),('c2find','http://c2.com/cgi/wiki?FindPage&value=$1','','',0,0),('cache','https://www.google.com/search?q=cache:$1','','',0,0),('commons','https://commons.wikimedia.org/wiki/$1','https://commons.wikimedia.org/w/api.php','',0,0),('dictionary','http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1','','',0,0),('doi','https://dx.doi.org/$1','','',0,0),('drumcorpswiki','http://www.drumcorpswiki.com/$1','http://drumcorpswiki.com/api.php','',0,0),('dwjwiki','http://www.suberic.net/cgi-bin/dwj/wiki.cgi?$1','','',0,0),('elibre','http://enciclopedia.us.es/index.php/$1','http://enciclopedia.us.es/api.php','',0,0),('emacswiki','https://www.emacswiki.org/emacs/$1','','',0,0),('foldoc','https://foldoc.org/?$1','','',0,0),('foxwiki','https://fox.wikis.com/wc.dll?Wiki~$1','','',0,0),('freebsdman','https://www.FreeBSD.org/cgi/man.cgi?apropos=1&query=$1','','',0,0),('gentoo-wiki','http://gentoo-wiki.com/$1','','',0,0),('google','https://www.google.com/search?q=$1','','',0,0),('googlegroups','https://groups.google.com/groups?q=$1','','',0,0),('hammondwiki','http://www.dairiki.org/HammondWiki/$1','','',0,0),('hrwiki','http://www.hrwiki.org/wiki/$1','http://www.hrwiki.org/w/api.php','',0,0),('imdb','http://www.imdb.com/find?q=$1&tt=on','','',0,0),('kmwiki','https://kmwiki.wikispaces.com/$1','','',0,0),('linuxwiki','http://linuxwiki.de/$1','','',0,0),('lojban','https://mw.lojban.org/papri/$1','','',0,0),('lqwiki','http://wiki.linuxquestions.org/wiki/$1','','',0,0),('meatball','http://www.usemod.com/cgi-bin/mb.pl?$1','','',0,0),('mediawikiwiki','https://www.mediawiki.org/wiki/$1','https://www.mediawiki.org/w/api.php','',0,0),('memoryalpha','http://en.memory-alpha.org/wiki/$1','http://en.memory-alpha.org/api.php','',0,0),('metawiki','http://sunir.org/apps/meta.pl?$1','','',0,0),('metawikimedia','https://meta.wikimedia.org/wiki/$1','https://meta.wikimedia.org/w/api.php','',0,0),('mozillawiki','https://wiki.mozilla.org/$1','https://wiki.mozilla.org/api.php','',0,0),('mw','https://www.mediawiki.org/wiki/$1','https://www.mediawiki.org/w/api.php','',0,0),('oeis','https://oeis.org/$1','','',0,0),('openwiki','http://openwiki.com/ow.asp?$1','','',0,0),('pmid','https://www.ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract','','',0,0),('pythoninfo','https://wiki.python.org/moin/$1','','',0,0),('rfc','https://tools.ietf.org/html/rfc$1','','',0,0),('s23wiki','http://s23.org/wiki/$1','http://s23.org/w/api.php','',0,0),('seattlewireless','http://seattlewireless.net/$1','','',0,0),('senseislibrary','https://senseis.xmp.net/?$1','','',0,0),('shoutwiki','http://www.shoutwiki.com/wiki/$1','http://www.shoutwiki.com/w/api.php','',0,0),('squeak','http://wiki.squeak.org/squeak/$1','','',0,0),('theopedia','https://www.theopedia.com/$1','','',0,0),('tmbw','http://www.tmbw.net/wiki/$1','http://tmbw.net/wiki/api.php','',0,0),('tmnet','http://www.technomanifestos.net/?$1','','',0,0),('twiki','http://twiki.org/cgi-bin/view/$1','','',0,0),('uncyclopedia','https://en.uncyclopedia.co/wiki/$1','https://en.uncyclopedia.co/w/api.php','',0,0),('unreal','https://wiki.beyondunreal.com/$1','https://wiki.beyondunreal.com/w/api.php','',0,0),('usemod','http://www.usemod.com/cgi-bin/wiki.pl?$1','','',0,0),('wiki','http://c2.com/cgi/wiki?$1','','',0,0),('wikia','http://www.wikia.com/wiki/$1','','',0,0),('wikibooks','https://en.wikibooks.org/wiki/$1','https://en.wikibooks.org/w/api.php','',0,0),('wikidata','https://www.wikidata.org/wiki/$1','https://www.wikidata.org/w/api.php','',0,0),('wikif1','http://www.wikif1.org/$1','','',0,0),('wikihow','https://www.wikihow.com/$1','https://www.wikihow.com/api.php','',0,0),('wikimedia','https://foundation.wikimedia.org/wiki/$1','https://foundation.wikimedia.org/w/api.php','',0,0),('wikinews','https://en.wikinews.org/wiki/$1','https://en.wikinews.org/w/api.php','',0,0),('wikinfo','http://wikinfo.co/English/index.php/$1','','',0,0),('wikipedia','https://en.wikipedia.org/wiki/$1','https://en.wikipedia.org/w/api.php','',0,0),('wikiquote','https://en.wikiquote.org/wiki/$1','https://en.wikiquote.org/w/api.php','',0,0),('wikisource','https://wikisource.org/wiki/$1','https://wikisource.org/w/api.php','',0,0),('wikispecies','https://species.wikimedia.org/wiki/$1','https://species.wikimedia.org/w/api.php','',0,0),('wikiversity','https://en.wikiversity.org/wiki/$1','https://en.wikiversity.org/w/api.php','',0,0),('wikivoyage','https://en.wikivoyage.org/wiki/$1','https://en.wikivoyage.org/w/api.php','',0,0),('wikt','https://en.wiktionary.org/wiki/$1','https://en.wiktionary.org/w/api.php','',0,0),('wiktionary','https://en.wiktionary.org/wiki/$1','https://en.wiktionary.org/w/api.php','',0,0);
/*!40000 ALTER TABLE `interwiki` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ip_changes`
--
DROP TABLE IF EXISTS `ip_changes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ip_changes` (
`ipc_rev_id` int(10) unsigned NOT NULL DEFAULT 0,
`ipc_rev_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`ipc_hex` varbinary(35) NOT NULL DEFAULT '',
PRIMARY KEY (`ipc_rev_id`),
KEY `ipc_rev_timestamp` (`ipc_rev_timestamp`),
KEY `ipc_hex_time` (`ipc_hex`,`ipc_rev_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ip_changes`
--
LOCK TABLES `ip_changes` WRITE;
/*!40000 ALTER TABLE `ip_changes` DISABLE KEYS */;
/*!40000 ALTER TABLE `ip_changes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ipblocks`
--
DROP TABLE IF EXISTS `ipblocks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipblocks` (
`ipb_id` int(11) NOT NULL AUTO_INCREMENT,
`ipb_address` tinyblob NOT NULL,
`ipb_user` int(10) unsigned NOT NULL DEFAULT 0,
`ipb_by_actor` bigint(20) unsigned NOT NULL,
`ipb_reason_id` bigint(20) unsigned NOT NULL,
`ipb_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`ipb_auto` tinyint(1) NOT NULL DEFAULT 0,
`ipb_anon_only` tinyint(1) NOT NULL DEFAULT 0,
`ipb_create_account` tinyint(1) NOT NULL DEFAULT 1,
`ipb_enable_autoblock` tinyint(1) NOT NULL DEFAULT 1,
`ipb_expiry` varbinary(14) NOT NULL DEFAULT '',
`ipb_range_start` tinyblob NOT NULL,
`ipb_range_end` tinyblob NOT NULL,
`ipb_deleted` tinyint(1) NOT NULL DEFAULT 0,
`ipb_block_email` tinyint(1) NOT NULL DEFAULT 0,
`ipb_allow_usertalk` tinyint(1) NOT NULL DEFAULT 0,
`ipb_parent_block_id` int(11) DEFAULT NULL,
`ipb_sitewide` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`ipb_id`),
UNIQUE KEY `ipb_address_unique` (`ipb_address`(255),`ipb_user`,`ipb_auto`),
KEY `ipb_user` (`ipb_user`),
KEY `ipb_range` (`ipb_range_start`(8),`ipb_range_end`(8)),
KEY `ipb_timestamp` (`ipb_timestamp`),
KEY `ipb_expiry` (`ipb_expiry`),
KEY `ipb_parent_block_id` (`ipb_parent_block_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ipblocks`
--
LOCK TABLES `ipblocks` WRITE;
/*!40000 ALTER TABLE `ipblocks` DISABLE KEYS */;
/*!40000 ALTER TABLE `ipblocks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ipblocks_restrictions`
--
DROP TABLE IF EXISTS `ipblocks_restrictions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipblocks_restrictions` (
`ir_ipb_id` int(11) NOT NULL,
`ir_type` tinyint(1) NOT NULL,
`ir_value` int(11) NOT NULL,
PRIMARY KEY (`ir_ipb_id`,`ir_type`,`ir_value`),
KEY `ir_type_value` (`ir_type`,`ir_value`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ipblocks_restrictions`
--
LOCK TABLES `ipblocks_restrictions` WRITE;
/*!40000 ALTER TABLE `ipblocks_restrictions` DISABLE KEYS */;
/*!40000 ALTER TABLE `ipblocks_restrictions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `iwlinks`
--
DROP TABLE IF EXISTS `iwlinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `iwlinks` (
`iwl_from` int(10) unsigned NOT NULL DEFAULT 0,
`iwl_prefix` varbinary(20) NOT NULL DEFAULT '',
`iwl_title` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`iwl_from`,`iwl_prefix`,`iwl_title`),
KEY `iwl_prefix_title_from` (`iwl_prefix`,`iwl_title`,`iwl_from`),
KEY `iwl_prefix_from_title` (`iwl_prefix`,`iwl_from`,`iwl_title`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `iwlinks`
--
LOCK TABLES `iwlinks` WRITE;
/*!40000 ALTER TABLE `iwlinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `iwlinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `job`
--
DROP TABLE IF EXISTS `job`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job` (
`job_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`job_cmd` varbinary(60) NOT NULL DEFAULT '',
`job_namespace` int(11) NOT NULL,
`job_title` varbinary(255) NOT NULL,
`job_timestamp` varbinary(14) DEFAULT NULL,
`job_params` mediumblob NOT NULL,
`job_random` int(10) unsigned NOT NULL DEFAULT 0,
`job_attempts` int(10) unsigned NOT NULL DEFAULT 0,
`job_token` varbinary(32) NOT NULL DEFAULT '',
`job_token_timestamp` varbinary(14) DEFAULT NULL,
`job_sha1` varbinary(32) NOT NULL DEFAULT '',
PRIMARY KEY (`job_id`),
KEY `job_sha1` (`job_sha1`),
KEY `job_cmd_token` (`job_cmd`,`job_token`,`job_random`),
KEY `job_cmd_token_id` (`job_cmd`,`job_token`,`job_id`),
KEY `job_cmd` (`job_cmd`,`job_namespace`,`job_title`,`job_params`(128)),
KEY `job_timestamp` (`job_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `job`
--
LOCK TABLES `job` WRITE;
/*!40000 ALTER TABLE `job` DISABLE KEYS */;
/*!40000 ALTER TABLE `job` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `l10n_cache`
--
DROP TABLE IF EXISTS `l10n_cache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `l10n_cache` (
`lc_lang` varbinary(35) NOT NULL,
`lc_key` varbinary(255) NOT NULL,
`lc_value` mediumblob NOT NULL,
PRIMARY KEY (`lc_lang`,`lc_key`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `l10n_cache`
--
LOCK TABLES `l10n_cache` WRITE;
/*!40000 ALTER TABLE `l10n_cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `l10n_cache` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `langlinks`
--
DROP TABLE IF EXISTS `langlinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `langlinks` (
`ll_from` int(10) unsigned NOT NULL DEFAULT 0,
`ll_lang` varbinary(35) NOT NULL DEFAULT '',
`ll_title` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ll_from`,`ll_lang`),
KEY `ll_lang` (`ll_lang`,`ll_title`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `langlinks`
--
LOCK TABLES `langlinks` WRITE;
/*!40000 ALTER TABLE `langlinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `langlinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `log_search`
--
DROP TABLE IF EXISTS `log_search`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_search` (
`ls_field` varbinary(32) NOT NULL,
`ls_value` varbinary(255) NOT NULL,
`ls_log_id` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`ls_field`,`ls_value`,`ls_log_id`),
KEY `ls_log_id` (`ls_log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `log_search`
--
LOCK TABLES `log_search` WRITE;
/*!40000 ALTER TABLE `log_search` DISABLE KEYS */;
INSERT INTO `log_search` VALUES ('associated_rev_id','1',1);
/*!40000 ALTER TABLE `log_search` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `logging`
--
DROP TABLE IF EXISTS `logging`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `logging` (
`log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`log_type` varbinary(32) NOT NULL DEFAULT '',
`log_action` varbinary(32) NOT NULL DEFAULT '',
`log_timestamp` binary(14) NOT NULL DEFAULT '19700101000000',
`log_actor` bigint(20) unsigned NOT NULL,
`log_namespace` int(11) NOT NULL DEFAULT 0,
`log_title` varbinary(255) NOT NULL DEFAULT '',
`log_page` int(10) unsigned DEFAULT NULL,
`log_comment_id` bigint(20) unsigned NOT NULL,
`log_params` blob NOT NULL,
`log_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`log_id`),
KEY `type_time` (`log_type`,`log_timestamp`),
KEY `actor_time` (`log_actor`,`log_timestamp`),
KEY `page_time` (`log_namespace`,`log_title`,`log_timestamp`),
KEY `times` (`log_timestamp`),
KEY `log_actor_type_time` (`log_actor`,`log_type`,`log_timestamp`),
KEY `log_page_id_time` (`log_page`,`log_timestamp`),
KEY `log_type_action` (`log_type`,`log_action`,`log_timestamp`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `logging`
--
LOCK TABLES `logging` WRITE;
/*!40000 ALTER TABLE `logging` DISABLE KEYS */;
INSERT INTO `logging` VALUES (1,'create','create','20210116000759',2,0,'Hauptseite',1,1,'a:1:{s:17:\"associated_rev_id\";i:1;}',0);
/*!40000 ALTER TABLE `logging` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `module_deps`
--
DROP TABLE IF EXISTS `module_deps`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `module_deps` (
`md_module` varbinary(255) NOT NULL,
`md_skin` varbinary(32) NOT NULL,
`md_deps` mediumblob NOT NULL,
PRIMARY KEY (`md_module`,`md_skin`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `module_deps`
--
LOCK TABLES `module_deps` WRITE;
/*!40000 ALTER TABLE `module_deps` DISABLE KEYS */;
/*!40000 ALTER TABLE `module_deps` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `objectcache`
--
DROP TABLE IF EXISTS `objectcache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `objectcache` (
`keyname` varbinary(255) NOT NULL DEFAULT '',
`value` mediumblob DEFAULT NULL,
`exptime` datetime DEFAULT NULL,
PRIMARY KEY (`keyname`),
KEY `exptime` (`exptime`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `objectcache`
--
LOCK TABLES `objectcache` WRITE;
/*!40000 ALTER TABLE `objectcache` DISABLE KEYS */;
/*!40000 ALTER TABLE `objectcache` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oldimage`
--
DROP TABLE IF EXISTS `oldimage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oldimage` (
`oi_name` varbinary(255) NOT NULL DEFAULT '',
`oi_archive_name` varbinary(255) NOT NULL DEFAULT '',
`oi_size` int(10) unsigned NOT NULL DEFAULT 0,
`oi_width` int(11) NOT NULL DEFAULT 0,
`oi_height` int(11) NOT NULL DEFAULT 0,
`oi_bits` int(11) NOT NULL DEFAULT 0,
`oi_description_id` bigint(20) unsigned NOT NULL,
`oi_actor` bigint(20) unsigned NOT NULL,
`oi_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`oi_metadata` mediumblob NOT NULL,
`oi_media_type` enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') DEFAULT NULL,
`oi_major_mime` enum('unknown','application','audio','image','text','video','message','model','multipart','chemical') NOT NULL DEFAULT 'unknown',
`oi_minor_mime` varbinary(100) NOT NULL DEFAULT 'unknown',
`oi_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
`oi_sha1` varbinary(32) NOT NULL DEFAULT '',
KEY `oi_actor_timestamp` (`oi_actor`,`oi_timestamp`),
KEY `oi_name_timestamp` (`oi_name`,`oi_timestamp`),
KEY `oi_name_archive_name` (`oi_name`,`oi_archive_name`(14)),
KEY `oi_sha1` (`oi_sha1`(10))
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oldimage`
--
LOCK TABLES `oldimage` WRITE;
/*!40000 ALTER TABLE `oldimage` DISABLE KEYS */;
/*!40000 ALTER TABLE `oldimage` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `page`
--
DROP TABLE IF EXISTS `page`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `page` (
`page_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`page_namespace` int(11) NOT NULL,
`page_title` varbinary(255) NOT NULL,
`page_restrictions` tinyblob DEFAULT NULL,
`page_is_redirect` tinyint(3) unsigned NOT NULL DEFAULT 0,
`page_is_new` tinyint(3) unsigned NOT NULL DEFAULT 0,
`page_random` double unsigned NOT NULL,
`page_touched` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`page_links_updated` varbinary(14) DEFAULT NULL,
`page_latest` int(10) unsigned NOT NULL,
`page_len` int(10) unsigned NOT NULL,
`page_content_model` varbinary(32) DEFAULT NULL,
`page_lang` varbinary(35) DEFAULT NULL,
PRIMARY KEY (`page_id`),
UNIQUE KEY `name_title` (`page_namespace`,`page_title`),
KEY `page_random` (`page_random`),
KEY `page_len` (`page_len`),
KEY `page_redirect_namespace_len` (`page_is_redirect`,`page_namespace`,`page_len`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `page`
--
LOCK TABLES `page` WRITE;
/*!40000 ALTER TABLE `page` DISABLE KEYS */;
INSERT INTO `page` VALUES (1,0,'Hauptseite','',0,1,0.947713248395,'20210116000759',NULL,1,784,'wikitext',NULL);
/*!40000 ALTER TABLE `page` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `page_props`
--
DROP TABLE IF EXISTS `page_props`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `page_props` (
`pp_page` int(11) NOT NULL,
`pp_propname` varbinary(60) NOT NULL,
`pp_value` blob NOT NULL,
`pp_sortkey` float DEFAULT NULL,
PRIMARY KEY (`pp_page`,`pp_propname`),
UNIQUE KEY `pp_propname_page` (`pp_propname`,`pp_page`),
UNIQUE KEY `pp_propname_sortkey_page` (`pp_propname`,`pp_sortkey`,`pp_page`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `page_props`
--
LOCK TABLES `page_props` WRITE;
/*!40000 ALTER TABLE `page_props` DISABLE KEYS */;
/*!40000 ALTER TABLE `page_props` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `page_restrictions`
--
DROP TABLE IF EXISTS `page_restrictions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `page_restrictions` (
`pr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pr_page` int(11) NOT NULL,
`pr_type` varbinary(60) NOT NULL,
`pr_level` varbinary(60) NOT NULL,
`pr_cascade` tinyint(4) NOT NULL,
`pr_user` int(10) unsigned DEFAULT NULL,
`pr_expiry` varbinary(14) DEFAULT NULL,
PRIMARY KEY (`pr_id`),
UNIQUE KEY `pr_pagetype` (`pr_page`,`pr_type`),
KEY `pr_typelevel` (`pr_type`,`pr_level`),
KEY `pr_level` (`pr_level`),
KEY `pr_cascade` (`pr_cascade`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `page_restrictions`
--
LOCK TABLES `page_restrictions` WRITE;
/*!40000 ALTER TABLE `page_restrictions` DISABLE KEYS */;
/*!40000 ALTER TABLE `page_restrictions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pagelinks`
--
DROP TABLE IF EXISTS `pagelinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pagelinks` (
`pl_from` int(10) unsigned NOT NULL DEFAULT 0,
`pl_from_namespace` int(11) NOT NULL DEFAULT 0,
`pl_namespace` int(11) NOT NULL DEFAULT 0,
`pl_title` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`pl_from`,`pl_namespace`,`pl_title`),
KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`),
KEY `pl_backlinks_namespace` (`pl_from_namespace`,`pl_namespace`,`pl_title`,`pl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pagelinks`
--
LOCK TABLES `pagelinks` WRITE;
/*!40000 ALTER TABLE `pagelinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `pagelinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `protected_titles`
--
DROP TABLE IF EXISTS `protected_titles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `protected_titles` (
`pt_namespace` int(11) NOT NULL,
`pt_title` varbinary(255) NOT NULL,
`pt_user` int(10) unsigned NOT NULL,
`pt_reason_id` bigint(20) unsigned NOT NULL,
`pt_timestamp` binary(14) NOT NULL,
`pt_expiry` varbinary(14) NOT NULL DEFAULT '',
`pt_create_perm` varbinary(60) NOT NULL,
PRIMARY KEY (`pt_namespace`,`pt_title`),
KEY `pt_timestamp` (`pt_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `protected_titles`
--
LOCK TABLES `protected_titles` WRITE;
/*!40000 ALTER TABLE `protected_titles` DISABLE KEYS */;
/*!40000 ALTER TABLE `protected_titles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `querycache`
--
DROP TABLE IF EXISTS `querycache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `querycache` (
`qc_type` varbinary(32) NOT NULL,
`qc_value` int(10) unsigned NOT NULL DEFAULT 0,
`qc_namespace` int(11) NOT NULL DEFAULT 0,
`qc_title` varbinary(255) NOT NULL DEFAULT '',
KEY `qc_type` (`qc_type`,`qc_value`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `querycache`
--
LOCK TABLES `querycache` WRITE;
/*!40000 ALTER TABLE `querycache` DISABLE KEYS */;
/*!40000 ALTER TABLE `querycache` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `querycache_info`
--
DROP TABLE IF EXISTS `querycache_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `querycache_info` (
`qci_type` varbinary(32) NOT NULL DEFAULT '',
`qci_timestamp` binary(14) NOT NULL DEFAULT '19700101000000',
PRIMARY KEY (`qci_type`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `querycache_info`
--
LOCK TABLES `querycache_info` WRITE;
/*!40000 ALTER TABLE `querycache_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `querycache_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `querycachetwo`
--
DROP TABLE IF EXISTS `querycachetwo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `querycachetwo` (
`qcc_type` varbinary(32) NOT NULL,
`qcc_value` int(10) unsigned NOT NULL DEFAULT 0,
`qcc_namespace` int(11) NOT NULL DEFAULT 0,
`qcc_title` varbinary(255) NOT NULL DEFAULT '',
`qcc_namespacetwo` int(11) NOT NULL DEFAULT 0,
`qcc_titletwo` varbinary(255) NOT NULL DEFAULT '',
KEY `qcc_type` (`qcc_type`,`qcc_value`),
KEY `qcc_title` (`qcc_type`,`qcc_namespace`,`qcc_title`),
KEY `qcc_titletwo` (`qcc_type`,`qcc_namespacetwo`,`qcc_titletwo`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `querycachetwo`
--
LOCK TABLES `querycachetwo` WRITE;
/*!40000 ALTER TABLE `querycachetwo` DISABLE KEYS */;
/*!40000 ALTER TABLE `querycachetwo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `recentchanges`
--
DROP TABLE IF EXISTS `recentchanges`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recentchanges` (
`rc_id` int(11) NOT NULL AUTO_INCREMENT,
`rc_timestamp` varbinary(14) NOT NULL DEFAULT '',
`rc_actor` bigint(20) unsigned NOT NULL,
`rc_namespace` int(11) NOT NULL DEFAULT 0,
`rc_title` varbinary(255) NOT NULL DEFAULT '',
`rc_comment_id` bigint(20) unsigned NOT NULL,
`rc_minor` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_bot` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_new` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_cur_id` int(10) unsigned NOT NULL DEFAULT 0,
`rc_this_oldid` int(10) unsigned NOT NULL DEFAULT 0,
`rc_last_oldid` int(10) unsigned NOT NULL DEFAULT 0,
`rc_type` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_source` varbinary(16) NOT NULL DEFAULT '',
`rc_patrolled` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_ip` varbinary(40) NOT NULL DEFAULT '',
`rc_old_len` int(11) DEFAULT NULL,
`rc_new_len` int(11) DEFAULT NULL,
`rc_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rc_logid` int(10) unsigned NOT NULL DEFAULT 0,
`rc_log_type` varbinary(255) DEFAULT NULL,
`rc_log_action` varbinary(255) DEFAULT NULL,
`rc_params` blob DEFAULT NULL,
PRIMARY KEY (`rc_id`),
KEY `rc_timestamp` (`rc_timestamp`),
KEY `rc_namespace_title_timestamp` (`rc_namespace`,`rc_title`,`rc_timestamp`),
KEY `rc_cur_id` (`rc_cur_id`),
KEY `new_name_timestamp` (`rc_new`,`rc_namespace`,`rc_timestamp`),
KEY `rc_ip` (`rc_ip`),
KEY `rc_ns_actor` (`rc_namespace`,`rc_actor`),
KEY `rc_actor` (`rc_actor`,`rc_timestamp`),
KEY `rc_name_type_patrolled_timestamp` (`rc_namespace`,`rc_type`,`rc_patrolled`,`rc_timestamp`),
KEY `rc_this_oldid` (`rc_this_oldid`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `recentchanges`
--
LOCK TABLES `recentchanges` WRITE;
/*!40000 ALTER TABLE `recentchanges` DISABLE KEYS */;
/*!40000 ALTER TABLE `recentchanges` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `redirect`
--
DROP TABLE IF EXISTS `redirect`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `redirect` (
`rd_from` int(10) unsigned NOT NULL DEFAULT 0,
`rd_namespace` int(11) NOT NULL DEFAULT 0,
`rd_title` varbinary(255) NOT NULL DEFAULT '',
`rd_interwiki` varbinary(32) DEFAULT NULL,
`rd_fragment` varbinary(255) DEFAULT NULL,
PRIMARY KEY (`rd_from`),
KEY `rd_ns_title` (`rd_namespace`,`rd_title`,`rd_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `redirect`
--
LOCK TABLES `redirect` WRITE;
/*!40000 ALTER TABLE `redirect` DISABLE KEYS */;
/*!40000 ALTER TABLE `redirect` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `revision`
--
DROP TABLE IF EXISTS `revision`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `revision` (
`rev_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rev_page` int(10) unsigned NOT NULL,
`rev_comment_id` bigint(20) unsigned NOT NULL DEFAULT 0,
`rev_actor` bigint(20) unsigned NOT NULL DEFAULT 0,
`rev_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`rev_minor_edit` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rev_deleted` tinyint(3) unsigned NOT NULL DEFAULT 0,
`rev_len` int(10) unsigned DEFAULT NULL,
`rev_parent_id` int(10) unsigned DEFAULT NULL,
`rev_sha1` varbinary(32) NOT NULL DEFAULT '',
PRIMARY KEY (`rev_id`),
KEY `rev_page_id` (`rev_page`,`rev_id`),
KEY `rev_timestamp` (`rev_timestamp`),
KEY `page_timestamp` (`rev_page`,`rev_timestamp`),
KEY `rev_actor_timestamp` (`rev_actor`,`rev_timestamp`,`rev_id`),
KEY `rev_page_actor_timestamp` (`rev_page`,`rev_actor`,`rev_timestamp`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `revision`
--
LOCK TABLES `revision` WRITE;
/*!40000 ALTER TABLE `revision` DISABLE KEYS */;
INSERT INTO `revision` VALUES (1,1,0,0,'20210116000759',0,0,784,0,'ezw1y7tpy380c53gmx6sikr7wj415iu');
/*!40000 ALTER TABLE `revision` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `revision_actor_temp`
--
DROP TABLE IF EXISTS `revision_actor_temp`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `revision_actor_temp` (
`revactor_rev` int(10) unsigned NOT NULL,
`revactor_actor` bigint(20) unsigned NOT NULL,
`revactor_timestamp` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`revactor_page` int(10) unsigned NOT NULL,
PRIMARY KEY (`revactor_rev`,`revactor_actor`),
UNIQUE KEY `revactor_rev` (`revactor_rev`),
KEY `actor_timestamp` (`revactor_actor`,`revactor_timestamp`),
KEY `page_actor_timestamp` (`revactor_page`,`revactor_actor`,`revactor_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `revision_actor_temp`
--
LOCK TABLES `revision_actor_temp` WRITE;
/*!40000 ALTER TABLE `revision_actor_temp` DISABLE KEYS */;
INSERT INTO `revision_actor_temp` VALUES (1,2,'20210116000759',1);
/*!40000 ALTER TABLE `revision_actor_temp` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `revision_comment_temp`
--
DROP TABLE IF EXISTS `revision_comment_temp`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `revision_comment_temp` (
`revcomment_rev` int(10) unsigned NOT NULL,
`revcomment_comment_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`revcomment_rev`,`revcomment_comment_id`),
UNIQUE KEY `revcomment_rev` (`revcomment_rev`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `revision_comment_temp`
--
LOCK TABLES `revision_comment_temp` WRITE;
/*!40000 ALTER TABLE `revision_comment_temp` DISABLE KEYS */;
INSERT INTO `revision_comment_temp` VALUES (1,1);
/*!40000 ALTER TABLE `revision_comment_temp` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `searchindex`
--
DROP TABLE IF EXISTS `searchindex`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `searchindex` (
`si_page` int(10) unsigned NOT NULL,
`si_title` varchar(255) NOT NULL DEFAULT '',
`si_text` mediumtext NOT NULL,
UNIQUE KEY `si_page` (`si_page`),
FULLTEXT KEY `si_title` (`si_title`),
FULLTEXT KEY `si_text` (`si_text`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `searchindex`
--
LOCK TABLES `searchindex` WRITE;
/*!40000 ALTER TABLE `searchindex` DISABLE KEYS */;
/*!40000 ALTER TABLE `searchindex` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_identifiers`
--
DROP TABLE IF EXISTS `site_identifiers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_identifiers` (
`si_type` varbinary(32) NOT NULL,
`si_key` varbinary(32) NOT NULL,
`si_site` int(10) unsigned NOT NULL,
PRIMARY KEY (`si_type`,`si_key`),
KEY `site_ids_site` (`si_site`),
KEY `site_ids_key` (`si_key`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_identifiers`
--
LOCK TABLES `site_identifiers` WRITE;
/*!40000 ALTER TABLE `site_identifiers` DISABLE KEYS */;
/*!40000 ALTER TABLE `site_identifiers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `site_stats`
--
DROP TABLE IF EXISTS `site_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `site_stats` (
`ss_row_id` int(10) unsigned NOT NULL,
`ss_total_edits` bigint(20) unsigned DEFAULT NULL,
`ss_good_articles` bigint(20) unsigned DEFAULT NULL,
`ss_total_pages` bigint(20) unsigned DEFAULT NULL,
`ss_users` bigint(20) unsigned DEFAULT NULL,
`ss_active_users` bigint(20) unsigned DEFAULT NULL,
`ss_images` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`ss_row_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `site_stats`
--
LOCK TABLES `site_stats` WRITE;
/*!40000 ALTER TABLE `site_stats` DISABLE KEYS */;
INSERT INTO `site_stats` VALUES (1,0,0,0,1,0,0);
/*!40000 ALTER TABLE `site_stats` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sites`
--
DROP TABLE IF EXISTS `sites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sites` (
`site_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`site_global_key` varbinary(64) NOT NULL,
`site_type` varbinary(32) NOT NULL,
`site_group` varbinary(32) NOT NULL,
`site_source` varbinary(32) NOT NULL,
`site_language` varbinary(35) NOT NULL,
`site_protocol` varbinary(32) NOT NULL,
`site_domain` varbinary(255) NOT NULL,
`site_data` blob NOT NULL,
`site_forward` tinyint(1) NOT NULL,
`site_config` blob NOT NULL,
PRIMARY KEY (`site_id`),
UNIQUE KEY `sites_global_key` (`site_global_key`),
KEY `sites_type` (`site_type`),
KEY `sites_group` (`site_group`),
KEY `sites_source` (`site_source`),
KEY `sites_language` (`site_language`),
KEY `sites_protocol` (`site_protocol`),
KEY `sites_domain` (`site_domain`),
KEY `sites_forward` (`site_forward`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sites`
--
LOCK TABLES `sites` WRITE;
/*!40000 ALTER TABLE `sites` DISABLE KEYS */;
/*!40000 ALTER TABLE `sites` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `slot_roles`
--
DROP TABLE IF EXISTS `slot_roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `slot_roles` (
`role_id` smallint(6) NOT NULL AUTO_INCREMENT,
`role_name` varbinary(64) NOT NULL,
PRIMARY KEY (`role_id`),
UNIQUE KEY `role_name` (`role_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `slot_roles`
--
LOCK TABLES `slot_roles` WRITE;
/*!40000 ALTER TABLE `slot_roles` DISABLE KEYS */;
INSERT INTO `slot_roles` VALUES (1,'main');
/*!40000 ALTER TABLE `slot_roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `slots`
--
DROP TABLE IF EXISTS `slots`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `slots` (
`slot_revision_id` bigint(20) unsigned NOT NULL,
`slot_role_id` smallint(5) unsigned NOT NULL,
`slot_content_id` bigint(20) unsigned NOT NULL,
`slot_origin` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`slot_revision_id`,`slot_role_id`),
KEY `slot_revision_origin_role` (`slot_revision_id`,`slot_origin`,`slot_role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `slots`
--
LOCK TABLES `slots` WRITE;
/*!40000 ALTER TABLE `slots` DISABLE KEYS */;
INSERT INTO `slots` VALUES (1,1,1,1);
/*!40000 ALTER TABLE `slots` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `templatelinks`
--
DROP TABLE IF EXISTS `templatelinks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `templatelinks` (
`tl_from` int(10) unsigned NOT NULL DEFAULT 0,
`tl_from_namespace` int(11) NOT NULL DEFAULT 0,
`tl_namespace` int(11) NOT NULL DEFAULT 0,
`tl_title` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`tl_from`,`tl_namespace`,`tl_title`),
KEY `tl_namespace` (`tl_namespace`,`tl_title`,`tl_from`),
KEY `tl_backlinks_namespace` (`tl_from_namespace`,`tl_namespace`,`tl_title`,`tl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `templatelinks`
--
LOCK TABLES `templatelinks` WRITE;
/*!40000 ALTER TABLE `templatelinks` DISABLE KEYS */;
/*!40000 ALTER TABLE `templatelinks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `text`
--
DROP TABLE IF EXISTS `text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `text` (
`old_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`old_text` mediumblob NOT NULL,
`old_flags` tinyblob NOT NULL,
PRIMARY KEY (`old_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=binary MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `text`
--
LOCK TABLES `text` WRITE;
/*!40000 ALTER TABLE `text` DISABLE KEYS */;
INSERT INTO `text` VALUES (1,'<strong>MediaWiki wurde installiert.</strong>\n\nHilfe zur Benutzung und Konfiguration der Wiki-Software findest du im [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Benutzerhandbuch].\n\n== Starthilfen ==\n\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Liste der Konfigurationsvariablen]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki-FAQ]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce Mailingliste neuer MediaWiki-Versionen]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Übersetze MediaWiki für deine Sprache]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Erfahre, wie du Spam auf deinem Wiki bekämpfen kannst]','utf-8');
/*!40000 ALTER TABLE `text` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `updatelog`
--
DROP TABLE IF EXISTS `updatelog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `updatelog` (
`ul_key` varbinary(255) NOT NULL,
`ul_value` blob DEFAULT NULL,
PRIMARY KEY (`ul_key`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `updatelog`
--
LOCK TABLES `updatelog` WRITE;
/*!40000 ALTER TABLE `updatelog` DISABLE KEYS */;
INSERT INTO `updatelog` VALUES ('filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql',NULL),('image-img_major_mime-patch-img_major_mime-chemical.sql',NULL),('oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql',NULL),('user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql',NULL),('user_groups-ug_group-patch-ug_group-length-increase-255.sql',NULL),('user_properties-up_property-patch-up_property.sql',NULL);
/*!40000 ALTER TABLE `updatelog` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `uploadstash`
--
DROP TABLE IF EXISTS `uploadstash`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `uploadstash` (
`us_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`us_user` int(10) unsigned NOT NULL,
`us_key` varbinary(255) NOT NULL,
`us_orig_path` varbinary(255) NOT NULL,
`us_path` varbinary(255) NOT NULL,
`us_source_type` varbinary(50) DEFAULT NULL,
`us_timestamp` varbinary(14) NOT NULL,
`us_status` varbinary(50) NOT NULL,
`us_chunk_inx` int(10) unsigned DEFAULT NULL,
`us_props` blob DEFAULT NULL,
`us_size` int(10) unsigned NOT NULL,
`us_sha1` varbinary(31) NOT NULL,
`us_mime` varbinary(255) DEFAULT NULL,
`us_media_type` enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') DEFAULT NULL,
`us_image_width` int(10) unsigned DEFAULT NULL,
`us_image_height` int(10) unsigned DEFAULT NULL,
`us_image_bits` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`us_id`),
UNIQUE KEY `us_key` (`us_key`),
KEY `us_user` (`us_user`),
KEY `us_timestamp` (`us_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `uploadstash`
--
LOCK TABLES `uploadstash` WRITE;
/*!40000 ALTER TABLE `uploadstash` DISABLE KEYS */;
/*!40000 ALTER TABLE `uploadstash` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varbinary(255) NOT NULL DEFAULT '',
`user_real_name` varbinary(255) NOT NULL DEFAULT '',
`user_password` tinyblob NOT NULL,
`user_newpassword` tinyblob NOT NULL,
`user_newpass_time` binary(14) DEFAULT NULL,
`user_email` tinyblob NOT NULL,
`user_touched` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`user_token` binary(32) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`user_email_authenticated` binary(14) DEFAULT NULL,
`user_email_token` binary(32) DEFAULT NULL,
`user_email_token_expires` binary(14) DEFAULT NULL,
`user_registration` binary(14) DEFAULT NULL,
`user_editcount` int(11) DEFAULT NULL,
`user_password_expires` varbinary(14) DEFAULT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `user_name` (`user_name`),
KEY `user_email_token` (`user_email_token`),
KEY `user_email` (`user_email`(50))
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'Demo','',':pbkdf2:sha512:30000:64:qxHIABTEAsLMVujHqbqE1w==:bntV+/naHe2z6DFWpNspS+FZlJjf3JQNAhA/DKbaNXy9BohiiJkVlFL+9mSCvxiEaFWNCVLt0AInZSjxulrgcQ==','',NULL,'demo@my.domain','20210116000759','51e4cc76bc9f7a202de96259df6614b2',NULL,NULL,NULL,'20210116000758',0,NULL),(2,'MediaWiki default','','','',NULL,'','20210116000759','*** INVALID ***\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',NULL,NULL,NULL,'20210116000759',0,NULL);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_former_groups`
--
DROP TABLE IF EXISTS `user_former_groups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_former_groups` (
`ufg_user` int(10) unsigned NOT NULL DEFAULT 0,
`ufg_group` varbinary(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ufg_user`,`ufg_group`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_former_groups`
--
LOCK TABLES `user_former_groups` WRITE;
/*!40000 ALTER TABLE `user_former_groups` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_former_groups` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_groups`
--
DROP TABLE IF EXISTS `user_groups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_groups` (
`ug_user` int(10) unsigned NOT NULL DEFAULT 0,
`ug_group` varbinary(255) NOT NULL DEFAULT '',
`ug_expiry` varbinary(14) DEFAULT NULL,
PRIMARY KEY (`ug_user`,`ug_group`),
KEY `ug_group` (`ug_group`),
KEY `ug_expiry` (`ug_expiry`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_groups`
--
LOCK TABLES `user_groups` WRITE;
/*!40000 ALTER TABLE `user_groups` DISABLE KEYS */;
INSERT INTO `user_groups` VALUES (1,'bureaucrat',NULL),(1,'interface-admin',NULL),(1,'sysop',NULL);
/*!40000 ALTER TABLE `user_groups` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_newtalk`
--
DROP TABLE IF EXISTS `user_newtalk`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_newtalk` (
`user_id` int(10) unsigned NOT NULL DEFAULT 0,
`user_ip` varbinary(40) NOT NULL DEFAULT '',
`user_last_timestamp` varbinary(14) DEFAULT NULL,
KEY `un_user_id` (`user_id`),
KEY `un_user_ip` (`user_ip`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_newtalk`
--
LOCK TABLES `user_newtalk` WRITE;
/*!40000 ALTER TABLE `user_newtalk` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_newtalk` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_properties`
--
DROP TABLE IF EXISTS `user_properties`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_properties` (
`up_user` int(10) unsigned NOT NULL,
`up_property` varbinary(255) NOT NULL,
`up_value` blob DEFAULT NULL,
PRIMARY KEY (`up_user`,`up_property`),
KEY `user_properties_property` (`up_property`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_properties`
--
LOCK TABLES `user_properties` WRITE;
/*!40000 ALTER TABLE `user_properties` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_properties` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `watchlist`
--
DROP TABLE IF EXISTS `watchlist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `watchlist` (
`wl_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`wl_user` int(10) unsigned NOT NULL,
`wl_namespace` int(11) NOT NULL DEFAULT 0,
`wl_title` varbinary(255) NOT NULL DEFAULT '',
`wl_notificationtimestamp` varbinary(14) DEFAULT NULL,
PRIMARY KEY (`wl_id`),
UNIQUE KEY `wl_user` (`wl_user`,`wl_namespace`,`wl_title`),
KEY `namespace_title` (`wl_namespace`,`wl_title`),
KEY `wl_user_notificationtimestamp` (`wl_user`,`wl_notificationtimestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `watchlist`
--
LOCK TABLES `watchlist` WRITE;
/*!40000 ALTER TABLE `watchlist` DISABLE KEYS */;
/*!40000 ALTER TABLE `watchlist` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `watchlist_expiry`
--
DROP TABLE IF EXISTS `watchlist_expiry`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `watchlist_expiry` (
`we_item` int(10) unsigned NOT NULL,
`we_expiry` binary(14) NOT NULL,
PRIMARY KEY (`we_item`),
KEY `we_expiry` (`we_expiry`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `watchlist_expiry`
--
LOCK TABLES `watchlist_expiry` WRITE;
/*!40000 ALTER TABLE `watchlist_expiry` DISABLE KEYS */;
/*!40000 ALTER TABLE `watchlist_expiry` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-01-16 1:09:02
|
DROP TABLE IF EXISTS users;
CREATE TABLE users
(
userId VARCHAR(64) PRIMARY KEY,
email VARCHAR(64) NOT NULL,
firstName VARCHAR(64) NOT NULL,
lastName VARCHAR(64) NOT NULL,
studentId INTEGER,
isEmailVerified BOOL NOT NULL
);
|
CREATE TABLE [Source].[ApplePodcastHistory] (
[Feed URL] VARCHAR(MAX) NULL,
[Episode ID] VARCHAR(MAX) NULL,
[Visible?] VARCHAR(25) NULL,
[Marked as played on] VARCHAR(30) NULL,
[Manually set] VARCHAR(8) NULL,
[Is New?] VARCHAR(8) NULL,
[Last played on] VARCHAR(30) NULL,
[Playback position] VARCHAR(50) NULL,
[Play count] VARCHAR(50) NULL,
[Has been played?] VARCHAR(8) NULL
)
|
--liquibase formatted sql
--changeset artemov_i:MTGetLocalNameSpace dbms:postgresql runOnChange:true splitStatements:false stripComments:false
INSERT INTO s_mt.t_query (ck_id, cc_query, ck_provider, ck_user, ct_change, cr_type, cr_access, cn_action, cv_description) VALUES ('MTGetLocalNameSpace', '--MTGetLocalNameSpace
select ''meta'' as ck_id
union all
select ''message'' as ck_id
union all
select ''static'' as ck_id
', 'meta', '4fd05ca9-3a9e-4d66-82df-886dfa082113', '2019-11-05 12:56:04.052926+03', 'select', 'po_session', NULL, 'Список языков')
on conflict (ck_id) do update set cc_query = excluded.cc_query, ck_provider = excluded.ck_provider, ck_user = excluded.ck_user, ct_change = excluded.ct_change, cr_type = excluded.cr_type, cr_access = excluded.cr_access, cn_action = excluded.cn_action, cv_description = excluded.cv_description;
|
DELETE FROM northwind.order_details;
|
CREATE OR REPLACE FUNCTION "PERMISOS".F_DEVOLVER_ESPECIF_PERMISO(IN P_ID_PERMISO INTEGER, OUT P_NOMBRE_COMPLETO TEXT,
OUT P_TIPO_AUSENCIA CHARACTER VARYING(70), OUT P_FECHA_SOLICITUD TIMESTAMP WITHOUT TIME ZONE,
OUT P_FECHA_INICIO TIMESTAMP WITHOUT TIME ZONE, OUT P_FECHA_FIN TIMESTAMP WITHOUT TIME ZONE,
OUT DESCRIPCION CHARACTER VARYING(60))
RETURNS SETOF record AS
$BODY$
BEGIN
RETURN query SELECT B."PRIMER_SEGUNDO_NOMBRE" || ' ' || B."PRIMER_SEGUNDO_APELLIDO" AS NOMBRE_COMPLETO,
C."TIPO_AUSENCIA", A."FECHA_SOLICITUD", A."FECHA_INICIO", A."FECHA_FIN", A."DESCRIPCION_PERMISO"
FROM "PERMISOS"."TBL_PERMISOS" A
INNER JOIN "PERMISOS"."TBL_EMPLEADOS" B
ON (A."ID_EMPLEADO" = B."ID_EMPLEADO")
INNER JOIN "PERMISOS"."TBL_TIPOS_AUSENCIAS" C
ON(A."ID_TIPO_AUSENCIA" = C."ID_TIPO_AUSENCIA")
WHERE A."ID_PERMISO" = P_ID_PERMISO;
END;
$BODY$
LANGUAGE 'plpgsql';
--Ejecutar la función
SELECT *
FROM "PERMISOS".F_DEVOLVER_ESPECIF_PERMISO(1);
|
select substr(col, 2, 3)
from (select split(n_comment, ' ') [3] col
from cp.`tpch/nation.parquet`
where n_nationkey = -1
group by n_comment
order by n_comment
limit 5);
|
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: faithwraps
-- ------------------------------------------------------
-- Server version 5.6.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `billing_addresses`
--
DROP TABLE IF EXISTS `billing_addresses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `billing_addresses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`address` varchar(50) DEFAULT NULL,
`address_2` varchar(50) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`state` varchar(15) DEFAULT NULL,
`zip_code` varchar(10) DEFAULT NULL,
`country` varchar(45) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `billing_addresses`
--
LOCK TABLES `billing_addresses` WRITE;
/*!40000 ALTER TABLE `billing_addresses` DISABLE KEYS */;
INSERT INTO `billing_addresses` VALUES (1,73,'Deborah','Peterson','5561 Western Avenue','','San Bernardino','CA','92407','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(2,1,'Nate','Brady','17 chino','132','Chino','CA','91710','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(3,69,'Denise','Benoit','29 Sacramento Street','','Cambridge','MA','02138','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(4,70,'Rene ','Benoit','18 Lynn Ellen','','Acushnet','MA','02743','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(5,65,'Faith','Benoit','11475 Central Ave','41','Chino','CA','91710','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(6,67,'','','','','','','','','2015-09-01 02:24:43','2015-09-01 02:24:43'),(7,84,'Rebecca','Greene','34 Oaklawn Street','','New Bedford ','MA','02744','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(8,83,'','','','','','','','','2015-09-01 02:24:43','2015-09-01 02:24:43'),(9,74,'Tara','Girouard','32 orchard hill lane','','Greenwich','CT','06831','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(10,75,'Pamela','Hutchinson','10 Beechwood Drive','NA','Acushnet','MA','02743','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(11,76,'Maggie','Laing','503 Green Street','','Dowagiac','MI','49047','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(12,77,'Erin','DeSousa','5061 Collins st','A','Fort Campbell','KY','42223','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(13,79,'Gail','Borges','29 Castle Ave','','Fairhaven','MA','02719','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(14,80,'Brent','Kopenhaver Jr','452 w 57th St','5E','New York','NY','10019','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(15,81,'test','test','11475 Central Ave APT 41','','Chino','KY','91710','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(16,82,'Leah','Isabelle','70 Jouvette street','Floor 2','New Bedford','MA','02744','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(17,85,'Miguel','De Jesus','67 Wall St','9i','New York','NY','10032','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(18,86,'','','','','','','','','2015-09-01 02:24:43','2015-09-01 02:24:43'),(19,87,'Lynne ','Freitas','559 Ashley Blvd','','New Bedford','MA','02745','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(20,88,'Caitlyn ','Freitas','816 E Street NE','Apt 107','Washington ','DC','20002','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(21,89,'Tracy','Grant','110 Merrill Lane','6','Dracut','MA','01826','US','2015-09-01 02:24:43','2015-09-01 02:24:43'),(22,90,'','','','','','','','','2015-09-01 02:24:43','2015-09-01 02:24:43'),(23,91,'luciana','martinez','5050 Rhine Wine Dr.','','sparks','NV','89436','US','2015-09-01 02:24:43','2015-09-01 02:24:43');
/*!40000 ALTER TABLE `billing_addresses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `galleries`
--
DROP TABLE IF EXISTS `galleries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `galleries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(300) NOT NULL,
`desc` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `galleries`
--
LOCK TABLES `galleries` WRITE;
/*!40000 ALTER TABLE `galleries` DISABLE KEYS */;
INSERT INTO `galleries` VALUES (1,'Traditional FaithWraps','The traditional FaithWrap is the original concept design by Faith Benoit. These wraps cover a wide variety of styles. If you\'re new to the site, start here and browse the different attributes of each gem. Pair them with your favorite ribbon to create the perfect FaithWrap combination for you.'),(2,'Limited Edition FaithWraps','The limited edition FaithWrap is a special collection designed from gems that are hard to find. Each new gem has a unique quality; whether it\'s for style or a new energy, there\'s one perfect for you. Check back often for new editions because once they\'re sold out, they\'re unlikely to return.'),(4,'Affirmations in a Bottle','Affirmations in a Bottle is the newest design to come to FaithWraps. It\'s not just a fashion statement - These bottles combine gems and powerful mantras to affirm the qualities within that we sometimes need to be reminded of. '),(3,'Leather & Feather','The Leather & Feather collection combine our favorite gems with rare feathers to create unique headbands, cuffs and earrings.');
/*!40000 ALTER TABLE `galleries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gems`
--
DROP TABLE IF EXISTS `gems`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`desc` text NOT NULL,
`colors` text NOT NULL,
`energies` text NOT NULL,
`chakras` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gems`
--
LOCK TABLES `gems` WRITE;
/*!40000 ALTER TABLE `gems` DISABLE KEYS */;
INSERT INTO `gems` VALUES (1,'Malachite','This ancient gem was used by Egyptians, Greeks, and Romans for jewelry and grounded to use as eye shadow. Malachite is the stone of transformation, assisting it\\\'s wearer with changing situations. During these transformations, it helps to clarify ones emotions and release negative experiences. It can serve as a mirror, allowing the self to understand the process and our greater good more clearly. Having malachite in a period of change can be extremely insightful and comforting, reminding us that we are never alone, and change is always for our greatest good and highest intention. The rich green color is also great for the healing process. ','Emerald Green','Change, Clarity','Heart'),(2,'Lapis Lazuli','Lapis lazuli is an ancient gem that was valued more highly than gold in early cultures. The Egyptians thought the stone was a symbol of truth. It was also buried with their dead as it was said to offer protection. Lapis lazuli is a deep blue stone with beautiful pieces of golden pyrite. The stone is a powerful meditation tool which can bring great insight and clarity, helping the wearer to see things more clearly. Lapis lazuli helps one to expand awareness and intellectual capacity. It assists in attuning to the divine self and increases one\\\'s consciousness and intuition. The stone can help one to become a channel and turn deep within. The stone serves as a great asset for clarity, inner communication, as well as harmonious relationships ','Royal Blue with gold specks of pyrite','Clarity, Inner Communication, Harmony, Intuition','Third Eye and Throat'),(3,'Rhodonite','Rhodonite is referred to as the \\"Stone of Love.\\" It activates and energizes the heart chakra and helps to resonate unconditional love. Rhodonite clears anxiety from the heart and increases self worth. It opens the heart to opportunities and receiving love. The stone has been known to help its wearer achieve his or her greatest potential. We all could use a little more love in our lives and whether it is romantic love or self love, rhodonite can serve as a great companion¸','Pink with black streaks','Unconditional Love, Self Worth, and Emotional Healing ','Heart'),(4,'Tiger\'s Eye','Tiger\\\'s Eye is a great tool to assist in determination and abundance. It serves individuals seeking mental clarity. It contains sharpness and grounding energy and helps bring light in situations where one must be practical. Tiger\'s Eye generates calmness and helps one enhance their optimism. The stone aids in stimulating wealth and enhances the stability to maintain it.','Gold and Brown','Determination, Grounding, Focus, Mental Clarity, Optimism, Abundance ','Solar Plexus'),(5,'Onyx','Onyx is a powerful stone for anyone who feels overwhelmed or stressed. The stone is a valuable tool when dealing with difficult times, detachment, or letting go. Onyx is a protective stone and also repels negative energy directed towards you. It centers and grounds the self. The stone enhances self control and wise decision making ','Black','Grounding, Protection, Healing','Root'),(6,'Carnelian','Carnelian has a long storied past, and was once considered strictly the property of the noble class. People holding a high social status were often buried with this gem stone. It was a stone of honor comparable to the diamond and emerald. Carnelian increases physical energy and personal power. The stone helps the self to be proactive and find what gives the self a sense of meaning. It reminds of us of our passions and helps to embrace our creative self. Carnelian also protects against anger, fear, envy, rage, and sorrow. ','Red','Creativity, Energy, Passion','Sacral'),(7,'Blue Lace Agate','Blue lace agate is a calming uplifting stone. It stimulates the throat chakra and encourages communication, peace, and serenity. Blue lace agate is considered a stone of communication. It can ease the harsh edge off communication in difficult times, enhance public speaking, and smooth discussions. It\\\'s a great stone for anyone dealing with harsh anxiety or stress. It serves as a reminder to relax and let go of the stressors of the day.','Bands of blue and white','Serenity, Healing, Communication, Peace ','Throat'),(8,'Rose Quartz','Rose Quartz is the stone of self love. It emits a cool calming energy. The stone gently removes negativity and replaces it with self worth. It helps to open the heart center and heal emotional wounds and stress. Rose Quartz serves as a reminder to love ourselves and appreciate all of our beautiful qualities. \r\n','Soft Pink','Self love and Emotional Healing ','Heart'),(9,'Aventurine','The name aventurine is said to have derived its name from the Italian word ‘a ventura’ which means by chance. Aventurine is thought to be a talisman of luck and abundance. It\\\'s a great stone for someone who is looking to find prosperity, wealth, and courage. It reinforces decisiveness and amplifies one\\\'s leadership qualities. Aventurine activates and clears the heart chakra. ','Pastel Green','Luck, Wealth, Abundance, Leadership','Heart'),(10,'Goldstone','Goldstone is said to be a Master Healer, assisting in staying calm and stabilizing emotions. It\\\'s a great mood lifter for anyone who needs some positive energy. Goldstone is also used for protection as it reflects negative energy. This is technically a man-made stone but has healing properties, as it is created from copper. Copper is also thought to be extremely helpful in increasing blood flow and reducing inflammation.','Copper','Positive Energy, Healing, Protection','Root and Sacral'),(11,'Labradorite','Labradorite is a stunning gem, with it\\\'s flash of colors, depending on the angle viewed. It\\\'s known to be a powerful tool for receiving prophetic dreams and guidance. This gorgeous stone can increase intuition and help to understand present situations more clearly. Labradorite can help it\\\'s wearer relax and easily achieve a deep state of meditation. ','Green with shimmering flashes of purple, blue and yellow ','Prophetic Dreaming, Meditation, Intuition, Healing ','Third Eye'),(12,'Flower Sugilite','Flower sugilite, a variety of lepidolite, is said to assist in the forgiveness process. The stone promotes openness and honesty. The stone rids the self of headaches, negativity, and jealousy. Flower sugilite is a natural relaxer and promotes a restful sleep. It\\\'s a great stone for insomniacs or those who have frequent nightmares.','Lilac','Peace, Relaxation, Forgiveness','Crown and Heart'),(13,'African Turquoise','African Turquoise, a type of spotted Jasper found in Africa, is said to be one of the best protection stones. The stone is especially great for traveler\\\'s or those who could use a boost of courage. It\\\'s a peaceful stone with a calm and relaxing energy. It helps the wearer to achieve a state of wholeness. African Turquoise is also said to attract prosperity and success.','Blue with black spots','Protection, Prosperity, Relaxation, Courage ','Throat'),(14,'Snow Quartz','Bring out your inner child with Snow Quartz! Snow Quartz is said to increase positivity and help us relearn the word \\"wonderful.\\" Quartz is a power stone and known to be the master healer. Snow quartz is also great for mental clarity. It\\\'s a calming stone that\\\'s the perfect tool for meditation and insight.','White ','Healing, Positivity, Innocence, Mental Clarity, Calming, Meditation','Crown'),(15,'Paua Shell','Although not a gemstone, the paua shell is said to have healing properties. The paua shell stimulates imagination and intuition. It\\\'s used as a calming tool and is great to have during emotional situations. It\\\'s worn to balance one\\\'s mood throughout the day. The paua shell is also used for harmonizing relationships and connecting family.','Ocean Blue','Intuition, Imagination, Calming, Emotional Stability','Solar Plexus, Heart, Third Eye'),(16,'Poppy Jasper','Poppy Jasper is a feel good stone, known to bring relaxation and joy to its wearer. The stone helps to achieve a state of tranquility and wholeness. It\\\'s said to bring happiness and positivity. Poppy Jasper is great for enhancing organization abilities. It\\\'s a protection stone that also has a beautiful soft grounding energy. ','Red','Relaxation, Protection, Prosperity','Root'),(17,'Sodalite','Sodalite is the stone of self expression and perfect for writers. The stone helps to calm the mind, clear fears, and instill confidence. It eases communication and causes artistic expression to flow. Sodalite is a great tool for meditation and accessing deep thought.','Purple-blue with white','Clarity, Inner Communication, Harmony, Intuition','Throat'),(18,'Blue Laguna Agate','Laguna agate is said create stability, balance, and strength. The stone increases consciousness and spiritual growth. Laguna agate eases depression and helps the wearer find inner happiness. The stone is thought to stimulate brain activity and improve memory and concentration. Laguna agate is also used for protection. The color of this stone may have been enhanced.','Blue, grey, and black','Inner Happiness, Stability, Strength, Memory','Root'),(19,'Rhodocrosite','Rhodochrosite \\"the stone of love and balance\\" is said to attract love and deepend already existing love. It\\\'s an uplifting stone and a mood booster. Rhodochrosite has a strong loving energy, which makes it difficult to feel negativity. It calms the emotions and rids anxiety and loneliness. The stone enhances self worth, lifts depression, and soothes emotional stress and fear. Rhodocrosite is also though to stimulate creativity, innovation, and dream states.','Pink with white streaks','Love, Balance, Mood Booster, Self Worth, Soothing, Creativity','Heart'),(20,'Copper Turquoise','Turquoise is considered one of the oldest stones used for protection by the ancients. It was also thought to be a symbol of wealth and courage. The copper infused with the turquoise is said to increase and amplify the properties of the turquoise. The stone carries great wisdom and truth for it\\\'s wearer. Turquoise stabilizes one\\\'s mood and is also great for preventing depression and panic attacks. The stone protects the wearer from negativity and promotes self-realization and communication.','Turquoise, Green, and Copper','Protection, Love, Healing, Wisdom, Communication','Throat and Heart'),(21,'Abalone Shell','Although not a gemstone, the abalone shell is said to have healing properties. The abalone shell stimulates imagination and intuition. It\\\'s used as a calming tool and is great to have during emotional situations. It\\\'s worn to balance one\\\'s mood throughout the day. The abalone shell is also used for harmonizing relationships and connecting family.','Iridescent silver, blue, and green','Intuition, Imagination, Calming, Emotional Stability','Solar Plexus, Heart, Third Eye'),(22,'Turquoise','Bring some noble wisdom into your life with The Ancients\\\' Wrap. Whether you seek courage, communication, or self-realization, the stone serves as a beautiful companion. Turquoise grows closer to it\\\'s wearer with age. This timeless turquoise gem is sure to enrich your wardrobe and sense of style. Wear it with our hand-dyed Rainforest ribbon to bring out its stunning color.','Turquoise and Green','Protection, Love, Healing, Wisdom, Communication','Throat and Heart'),(23,'Drusy Quartz','Druzy Quartz is a beautiful and powerful piece. It softly amplifies energy and encourages growth, positive patterns, and spiritual protection. The stone increases positivity and eliminates stress, as it clears negative thoughts and emotions. Drusy Quartz is perfect for meditation and spiritual healing. The gem is also used in Feng Shui to bring life in lifeless corners. ','Crystal','Positivity, Meditation, Balance, Eliminates stress and negativity','Crown'),(24,'Rainbow Moonstone','Moonstone is the stone of motherhood and goddess energy. It is said to heal feminine health issues and protect the health of pregnant women. This beautiful gem reduces stress and treats female hormone imbalance and headaches. Rainbow Moonstone is also said to increase intuition, wisdom, and harmony.\r\n','White with a flash of the rainbow','Uplifting, Stress relief, Intuition, Wisdom, Peace','Crown'),(25,'Amethyst','Amethyst is a beautiful spiritual stone, perfect for meditation and its calming affects. It works to provide the wearer with intuition, balance, peace, patience, and serenity. The stone brings inner strength and emotional stability. Amethyst is a great tool for anyone dealing with grief or loss. The stone is also used for bringing pleasant dreams and understanding them.','Purple','Intuition, Balance, Serenity, Inner Strength, Emotional Stability, Lucid Dreaming','Crown and Third Eye'),(26,'Black Tourmaline','Black tourmaline is a very powerful stone. It is said to protect the wearer from all negativity. Black tourmaline is excellent for grounding the self and dispelling fear. It goes one step further to also balance the body and support the nervous system. Black tourmaline is a great companion which helps it\\\'s wearer get to the place they need to be. The stone is also said to bring good luck and happiness.','Black','Protection, Strength, Grounding, Positivity ','Root'),(27,'Kyanite','Kyanite is the stone of all forms of communication. It is said to serve as powerful tool for the manifestation of hopes and dreams. The gem calms the mind, and helps the wear to let go of anxiety and confusion. Kyanite is one of the best stones to use in your daily practice.','Blue','Communication, Intuition, Manifestation, Medication, Stress Relief ','Throat'),(28,'Peridot','The joyful energy of peridot is said to be great for making friends and strengthening bonds. It increases patience and confidence. The stone releases stress, anger, and guilt from the heart. The gem is said to be a visionary stone and good for helping the wearer understand her purpose. Peridot is also a stone of prosperity.','Green, Yellow','Protection, Balance, Traumatic Healing, Recovery, Romance','Heart, Solar Plexus'),(29,'Aventurine','The name aventurine is said to have derived its name from the Italian word ‘a ventura’ which means by chance. Aventurine is thought to be a talisman of luck and abundance. It\'s a great stone for someone who is looking to find prosperity, wealth, and courage. It reinforces decisiveness and amplifies one\'s leadership qualities. Aventurine activates and clears the heart chakra.','Green','Luck, Wealth, Abundance, Leadership','Heart'),(30,'Peridot','The joyful energy of peridot is said to be great for making friends and strengthening bonds. It increases patience and confidence. The stone releases stress, anger, and guilt from the heart. The gem is said to be a visionary stone and good for helping the wearer understand her purpose. Peridot is also a stone of prosperity.','Green, Yellow','Protection, Balance, Traumatic Healing, Recovery, Romance','Heart, Solar Plexus'),(31,'Tiger\'s Eye','Tiger\'s Eye is a great tool to assist in determination and abundance. It serves individuals seeking mental clarity. It contains sharpness and grounding energy and helps bring light in situations where one must be practical. Tiger\'s Eye generates calmness and helps one enhance their optimism. The stone aids in stimulating wealth and enhances the stability to maintain it.','Gold and Brown','Determination, Grounding, Focus, Mental Clarity, Optimism, Abundance','Solar Plexus'),(32,'Aventurine','The name aventurine is said to have derived its name from the Italian word ‘a ventura’ which means by chance. Aventurine is thought to be a talisman of luck and abundance. It\'s a great stone for someone who is looking to find prosperity, wealth, and courage. It reinforces decisiveness and amplifies one\'s leadership qualities. Aventurine activates and clears the heart chakra.','Green','Luck, Wealth, Abundance, Leadership','Heart'),(33,'Peridot','The joyful energy of peridot is said to be great for making friends and strengthening bonds. It increases patience and confidence. The stone releases stress, anger, and guilt from the heart. The gem is said to be a visionary stone and good for helping the wearer understand her purpose. Peridot is also a stone of prosperity.','Green, Yellow','Protection, Balance, Traumatic Healing, Recovery, Romance','Heart, Solar Plexus'),(34,'Tiger\'s Eye','Tiger\'s Eye is a great tool to assist in determination and abundance. It serves individuals seeking mental clarity. It contains sharpness and grounding energy and helps bring light in situations where one must be practical. Tiger\'s Eye generates calmness and helps one enhance their optimism. The stone aids in stimulating wealth and enhances the stability to maintain it.','Gold and Brown','Determination, Grounding, Focus, Mental Clarity, Optimism, Abundance','Solar Plexus');
/*!40000 ALTER TABLE `gems` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `mailing_addresses`
--
DROP TABLE IF EXISTS `mailing_addresses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mailing_addresses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`address` varchar(50) DEFAULT NULL,
`address_2` varchar(50) DEFAULT NULL,
`city` varchar(45) DEFAULT NULL,
`state` varchar(15) DEFAULT NULL,
`zip_code` varchar(10) DEFAULT NULL,
`country` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `mailing_addresses`
--
LOCK TABLES `mailing_addresses` WRITE;
/*!40000 ALTER TABLE `mailing_addresses` DISABLE KEYS */;
INSERT INTO `mailing_addresses` VALUES (1,73,NULL,NULL,'5561 Western Avenue','','San Bernardino','CA','92407','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(2,1,NULL,NULL,'17 chino','132','Chino','CA','91710','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(3,69,NULL,NULL,'29 Sacramento Street','','Cambridge','MA','02138','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(4,70,NULL,NULL,'18 Lynn Ellen','','Acushnet','MA','02743','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(5,65,NULL,NULL,'11475 Central Ave','41','Chino','CA','91710','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(6,67,NULL,NULL,'915 Crab Orchard Drive','','Roswell','GA','30076','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(7,84,NULL,NULL,'34 Oaklawn Street','','New Bedford ','MA','02744','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(8,83,NULL,NULL,'','','','','','','2015-09-01 02:18:22','2015-09-01 02:18:22'),(9,74,NULL,NULL,'32 orchard hill lane','','Greenwich','CT','06831','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(10,75,NULL,NULL,'10 Beechwood Drive','NA','Acushnet','MA','02743','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(11,76,NULL,NULL,'503 Green Street','','Dowagiac','MI','49047','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(12,77,NULL,NULL,'5061 Collins st','A','Fort Campbell','KY','42223','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(13,79,NULL,NULL,'29 Castle Ave','','Fairhaven','MA','02719','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(14,80,NULL,NULL,'448 Pine Run Rd','','Doylestown','PA','18901','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(15,81,NULL,NULL,'11475 Central Ave APT 41','','Chino','KY','91710','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(16,82,NULL,NULL,'19 Shawmut Avenue','floor 1','New Bedford','MA','02740','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(17,85,NULL,NULL,'67 Wall St','9i','New York','NY','10032','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(18,86,NULL,NULL,'','','','','','','2015-09-01 02:18:22','2015-09-01 02:18:22'),(19,87,NULL,NULL,'559 Ashley Blvd','','New Bedford','MA','02745','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(20,88,NULL,NULL,'816 E Street NE','Apt 107','Washington ','DC','20002','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(21,89,NULL,NULL,'110 Merrill Lane','6','Dracut','MA','01826','US','2015-09-01 02:18:22','2015-09-01 02:18:22'),(22,90,NULL,NULL,'','','','','','','2015-09-01 02:18:22','2015-09-01 02:18:22'),(23,91,NULL,NULL,'5050 Rhine Wine Dr.','','sparks','NV','89436','US','2015-09-01 02:18:22','2015-09-01 02:18:22');
/*!40000 ALTER TABLE `mailing_addresses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_types`
--
DROP TABLE IF EXISTS `oauth_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_types`
--
LOCK TABLES `oauth_types` WRITE;
/*!40000 ALTER TABLE `oauth_types` DISABLE KEYS */;
INSERT INTO `oauth_types` VALUES (1,'google'),(2,'facebook');
/*!40000 ALTER TABLE `oauth_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `oauth_users`
--
DROP TABLE IF EXISTS `oauth_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`verified_email` enum('0','1') DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`picture` varchar(255) DEFAULT NULL,
`oauth_id` varchar(45) DEFAULT NULL,
`oauth_type_id` int(2) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `oauth_users`
--
LOCK TABLES `oauth_users` WRITE;
/*!40000 ALTER TABLE `oauth_users` DISABLE KEYS */;
INSERT INTO `oauth_users` VALUES (3,NULL,'andrew.a.lee@gmail.com','1','Andrew','Lee','https://lh6.googleusercontent.com/-ibj8fdGK97I/AAAAAAAAAAI/AAAAAAAABUs/uHXyfRZyjfw/photo.jpg','100456593567481012590',1,'2015-09-01 11:19:05',NULL);
/*!40000 ALTER TABLE `oauth_users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order_parts`
--
DROP TABLE IF EXISTS `order_parts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_parts` (
`id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_style_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order_parts`
--
LOCK TABLES `order_parts` WRITE;
/*!40000 ALTER TABLE `order_parts` DISABLE KEYS */;
INSERT INTO `order_parts` VALUES (1,1,1,1),(2,1,1,2);
/*!40000 ALTER TABLE `order_parts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date_created` int(11) NOT NULL,
`total_price` decimal(10,2) NOT NULL,
`shipping` decimal(10,2) NOT NULL,
`tax` decimal(10,2) NOT NULL,
`filled` int(11) NOT NULL DEFAULT '0',
`shipped` int(11) NOT NULL DEFAULT '0',
`tracking` varchar(50) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orders`
--
LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
INSERT INTO `orders` VALUES (15,65,1322083334,37.71,0.00,2.71,0,1,'01293420934234'),(16,69,1322324386,35.00,0.00,0.00,0,1,'0'),(17,70,1322503722,40.00,0.00,0.00,0,1,'0'),(18,72,1322507060,35.00,0.00,0.00,0,1,'0'),(19,73,1322617675,40.95,0.00,2.95,0,1,'0'),(24,74,1322970071,88.00,0.00,0.00,0,1,'03103200000027000710'),(25,75,1323094192,70.00,0.00,0.00,0,1,'03103200000027000734'),(26,76,1323583049,76.00,0.00,0.00,0,1,'03103200000027005128'),(27,76,1323909704,40.00,0.00,0.00,0,1,'03103200000027005630'),(28,79,1324049480,105.00,0.00,0.00,0,1,'03103200000027005937'),(29,80,1324065531,108.00,0.00,0.00,0,1,'03103200000027005944'),(30,77,1324086812,76.00,0.00,0.00,0,1,'95055000031181353001000'),(31,77,1324434207,70.00,0.00,0.00,0,1,'03103200000027007894'),(32,82,1327028717,38.99,3.99,0.00,0,1,'03111660000211704793'),(33,84,1327252072,38.99,3.99,0.00,0,1,'03103200000027011631'),(34,85,1327725947,58.99,3.99,0.00,0,1,'03103200000027014526'),(35,87,1330354480,45.99,3.99,0.00,0,1,'03110820000184958240'),(36,88,1331487857,38.99,3.99,0.00,0,1,'03112550000117776048'),(37,89,1332173432,43.99,3.99,0.00,0,1,'03112550000117778097'),(38,1,1411588821,44.94,3.99,2.95,0,1,'3252525444');
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`expiry` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
INSERT INTO `password_resets` VALUES (1,105,'586499f6f5e70fdf5ab7f85b0561c2b2','2015-09-01 18:48:16');
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_styles`
--
DROP TABLE IF EXISTS `product_styles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_styles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`image` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=167 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_styles`
--
LOCK TABLES `product_styles` WRITE;
/*!40000 ALTER TABLE `product_styles` DISABLE KEYS */;
INSERT INTO `product_styles` VALUES (1,1,'Mistletoe','transformation_mistletoe.jpg'),(2,1,'Royal Lush','transformation_royallush.jpg'),(3,1,'Rainforest','transformation_rainforest.jpg'),(4,1,'River Stone','transformation_riverstone.jpg'),(5,1,'Raven','transformation_raven.jpg'),(6,1,'Cabernet','transformation_cabernet.jpg'),(7,1,'Electric Guitar','transformation_electricguitar.jpg'),(8,2,'Rustic Gold','meditation_rusticgold.jpg'),(9,2,'Raven','meditation_raven.jpg'),(10,2,'Sunshine','meditation_sunshine.jpg'),(11,2,'Venus','meditation_venus.jpg'),(12,2,'Electric Guitar','meditation_electricguitar.jpg'),(13,3,'Riverstone','love_riverstone.jpg'),(14,3,'Raven','love_raven.jpg'),(15,3,'Wonderland','love_wonderland.jpg'),(16,3,'Ballet Slipper','love_balletslipper.jpg'),(17,3,'Royal Lush','love_royallush.jpg'),(18,3,'Blushing Bride','love_blushingbride.jpg'),(19,3,'Sunshine','love_sunshine.jpg'),(20,4,'Rustic Gold','tigress_rusticgold.jpg'),(21,4,'Royal Lush','tigress_royallush.jpg'),(22,4,'Rain Forest','tigress_rainforest.jpg'),(23,4,'River Stone','tigress_riverstone.jpg'),(24,4,'Raven','tigress_raven.jpg'),(25,4,'Cabernet','tigress_cabernet.jpg'),(26,4,'Sunshine','tigress_sunshine.jpg'),(27,5,'Royal Lush','grounding_royallush.jpg'),(28,5,'Electric Guitar','grounding_electricguitar.jpg'),(29,5,'River Stone','grounding_riverstone.jpg'),(30,5,'Mistletoe','grounding_mistletoe.jpg'),(31,5,'Raven','grounding_raven.jpg'),(32,5,'Rainforest','grounding_rainforest.jpg'),(33,5,'Wonderland','grounding_wonderland.jpg'),(34,5,'Cabernet','grounding_cabernet.jpg'),(35,6,'Venus','creativity_venus.jpg'),(36,6,'Ballet Slipper','creativity_balletslipper.jpg'),(37,6,'River Stone','creativity_riverstone.jpg'),(38,6,'Wonderland','creativity_wonderland.jpg'),(39,6,'Raven','creativity_raven.jpg'),(40,6,'Sunshine','creativity_sunshine.jpg'),(41,7,'Orchid Ivory','serenity_orchidivory.jpg'),(42,7,'Ballet Slipper','serenity_balletslipper.jpg'),(43,7,'Blushing Bride','serenity_blushingbride.jpg'),(44,7,'River Stone','serenity_riverstone.jpg'),(45,7,'Wonderland','serenity_wonderland.jpg'),(46,7,'Raven','serenity_raven.jpg'),(47,8,'Blushing Bride','selflove_blushingbride.jpg'),(48,8,'Ballet Slipper','selflove_balletslipper.jpg'),(49,8,'Tulip','selflove_tulip.jpg'),(50,8,'River Stone','selflove_riverstone.jpg'),(51,8,'Royal Lush','selflove_royallush.jpg'),(52,8,'Rustic Gold','selflove_rusticgold.jpg'),(53,8,'Raven','selflove_raven.jpg'),(54,8,'Wonderland','selflove_wonderland.jpg'),(55,8,'Cabernet','selflove_cabernet.jpg'),(56,9,'Tulip','lucky_tulip.jpg'),(57,9,'Raven','lucky_raven.jpg'),(58,9,'Ballet Slipper','lucky_balletslipper.jpg'),(59,9,'Wonderland','lucky_wonderland.jpg'),(60,9,'River Stone','lucky_riverstone.jpg'),(61,10,'Raven','healing_raven.jpg'),(62,10,'Rustic Gold','healing_rusticgold.jpg'),(63,10,'Venus','healing_venus.jpg'),(64,11,'Raven','dream_raven.jpg'),(65,11,'Rain Forest','dream_rainforest.jpg'),(66,11,'Royal Lush','dream_royallush.jpg'),(67,11,'Venus','dream_venus.jpg'),(68,12,'Orchid Ivory','peace_orchidivory.jpg'),(69,12,'Venus','peace_venus.jpg'),(70,12,'Raven','peace_raven.jpg'),(71,13,'Rain Forest','protection_rainforest.jpg'),(72,13,'Raven','protection_raven.jpg'),(73,14,'Ballet Slipper','snow_balletslipper.jpg'),(74,14,'Rainforest','snow_rainforest.jpg'),(75,14,'Mistletoe','snow_mistletoe.jpg'),(76,14,'Royal Lush','snow_royallush.jpg'),(77,14,'Cabernet','snow_cabernet.jpg'),(78,15,'Royal Lush','ocean_royallush.jpg'),(79,15,'Raven','ocean_raven.jpg'),(80,16,'River Stone','relaxation_riverstone.jpg'),(81,16,'Cabernet','relaxation_cabernet.jpg'),(82,16,'Raven','relaxation_raven.jpg'),(83,16,'Rainforest','relaxation_rainforest.jpg'),(84,16,'Venus','relaxation_venus.jpg'),(85,17,'Orchid Ivory','expression_orchidivory.jpg'),(86,17,'Rain Forest','expression_rainforest.jpg'),(87,17,'Ballet Slipper','expression_balletslipper.jpg'),(88,17,'Raven','expression_raven.jpg'),(89,17,'Blushing Bride','expression_blushingbride.jpg'),(90,17,'Venus','expression_venus.jpg'),(91,18,'River Stone','balance_riverstone.jpg'),(92,18,'Rainforest','balance_rainforest.jpg'),(93,18,'Raven','balance_raven.jpg'),(94,18,'Royal Lush','balance_royallush.jpg'),(95,19,'Wonderland','attraction_wonderland.jpg'),(96,19,'Ballet Slipper','attraction_balletslipper.jpg'),(97,19,'River Stone','attraction_riverstone.jpg'),(98,19,'Blushing Bride','attraction_blushingbride.jpg'),(99,19,'Royal Lush','attraction_royallush.jpg'),(100,19,'Electric Guitar','attraction_electricguitar.jpg'),(101,19,'Orchid Ivory','attraction_orchidivory.jpg'),(102,20,'Rustic Gold','sacred_rusticgold.jpg'),(103,20,'Rainforest','sacred_rainforest.jpg'),(104,20,'Raven','sacred_raven.jpg'),(105,21,'Ballet Slipper','lucky_balletslipper.jpg'),(106,22,'Electric Guitar','meditation_electricguitar.jpg'),(107,23,'Ballet Slipper','serenity_balletslipper.jpg'),(108,23,'Blushing Bride','serenity_blushingbride.jpg'),(109,24,'Cabernet','grounding_cabernet.jpg'),(110,24,'Electric Guitar','grounding_electricguitar.jpg'),(111,25,'Rustic Gold','ocean_rusticgold.jpg'),(112,25,'Rainforest','ocean_rainforest.jpg'),(113,25,'Raven','ocean_raven.jpg'),(114,25,'Venus','ocean_venus.jpg'),(115,26,'Rainforest','ancients_rainforest.jpg'),(116,26,'Raven','ancients_raven.jpg'),(117,26,'Rustic Gold','ancients_rusticgold.jpg'),(118,27,'Wonderland','spirit_wonderland.jpg'),(119,27,'Cabernet','spirit_cabernet.jpg'),(120,27,'Orchid Ivory','spirit_orchidivory.jpg'),(121,27,'Raven','spirit_raven.jpg'),(122,27,'Venus','spirit_venus.jpg'),(123,28,'Wonderland','mother_wonderland.jpg'),(124,28,'Raven','mother_raven.jpg'),(125,28,'Royal Lush','mother_royallush.jpg'),(126,28,'Orchid Ivory','mother_orchidivory.jpg'),(127,29,'Trust In A Bottle Necklace','bottlenecklace_trust.jpg'),(128,29,'Inside the scroll','bottlescroll_trust.jpg'),(129,30,'Strength In A Bottle Necklace','bottlenecklace_strength.jpg'),(130,30,'Inside the scroll','bottlescroll_strength.jpg'),(131,31,'Confidence In A Bottle Necklace','bottlenecklace_confidence.jpg'),(132,31,'Inside the scroll','bottlescroll_confidence.jpg'),(133,32,'Trust In A Bottle Ring','bottlering_trust.jpg'),(134,32,'Inside the scroll','bottlescroll_trust.jpg'),(135,33,'Strength In A Bottle Ring','bottlering_strength.jpg'),(136,33,'Inside the scroll','bottlescroll_strength.jpg'),(137,34,'Confidence In A Bottle Ring','bottlering_confidence.jpg'),(138,34,'Inside the scroll','bottlescroll_confidence.jpg'),(139,35,'Trust In A Bottle Set','bottleset_trust.jpg'),(140,35,'Trust In A Bottle Necklace','bottlenecklace_trust.jpg'),(141,35,'Inside the scroll','bottlescroll_trust.jpg'),(142,35,'Trust In A Bottle Ring','bottlering_trust.jpg'),(143,36,'Strength In A Bottle Set','bottleset_strength.jpg'),(144,36,'Strength In A Bottle Necklace','bottlenecklace_strength.jpg'),(145,36,'Inside the scroll','bottlescroll_strength.jpg'),(146,36,'Strength In A Bottle Ring','bottlering_strength.jpg'),(147,37,'Confidence In A Bottle Set','bottleset_confidence.jpg'),(148,37,'Confidence In A Bottle Necklace','bottlenecklace_confidence.jpg'),(149,37,'Inside the scroll','bottlescroll_confidence.jpg'),(150,37,'Confidence In A Bottle Ring','bottlering_confidence.jpg'),(151,38,'Tigress Cuff','tigresscuff.jpg'),(152,39,'The Leather Wrap','leatherwrap.jpg'),(153,40,'The Grounding Cuff','groundingcuff.jpg'),(154,41,'Men\'s Arrowhead Wrap','arrowheadwrap.jpg'),(155,42,'Men\'s Grounding Cuff','mensgroundingcuff.jpg'),(156,43,'Brown Pheasant Headband','brownheadband.jpg'),(157,44,'Green Pheasant Headband','greenheadband.jpg'),(158,45,'Green Pheasant Earrings','greenpheasant.jpg'),(159,46,'Brown Pheasant Earrings','brownpheasant.jpg'),(160,47,'Black Feather Earrings','blackearrings.jpg'),(161,48,'Layered Green Pheasant Earrings','layeredgreenpheasant.jpg'),(162,49,'Layered Black & White Earrings','layeredblackandwhite.jpg'),(163,50,'Layered Black Earrings','layeredblackearrings.jpg'),(164,51,'Black & White Earrings','blackandwhite.jpg'),(165,52,'Orange Pheasant Earrings','orangepheasant.jpg'),(166,53,'Gold Pheasant Earrings','goldpheasant.jpg');
/*!40000 ALTER TABLE `product_styles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gem_id` int(11) NOT NULL,
`gallery_id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`desc` text NOT NULL,
`price` decimal(10,2) NOT NULL,
`shipping` decimal(10,2) NOT NULL,
`combined_shipping` decimal(10,2) NOT NULL,
`qty` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,1,1,'The Transformation Wrap','Whether you\\\'re seeking transformation, wanting clarity for the changes around you, or simply need to surround yourself with a healing color, Malachite is the perfect gem. There\\\'s no wonder why the ancients used this stone for their prized jewelry. Its brilliant green color is the perfect accessory for this holiday season. Pair it with our mistletoe hand-dyed ribbon and have that perfect discussion piece at your annual office party. Or give it as a gift to your best friend who deserves a meaningful holiday present this year. ',38.00,3.99,1.00,3),(2,2,1,'The Meditation Wrap','The fierce royal blue and golden specked lapis lazuli will be sure to catch anyone\\\'s eye. This beautiful rich stone will make any outfit pop. Wear it with a sleek black dress and a pair of blue pumps or dress it down and bring out your inner diva. The Meditation Wrap is sure to enrich your daily practice and outer goddess.',38.00,3.99,1.00,1),(3,3,1,'The Love Wrap','Welcome unconditional love into your life with this passionate piece. Every woman could use a little more love in her life and what better way than with The Love Wrap. Wear this rich pink stone with your favorite black or pink top. Rhodonite and its feminine charm are bound to dazzle any wardrobe with a boost of goddess energy. Pair it with our Raven hand-dyed ribbon for a sophisticated look or Blushing Bride for the special day.',38.00,3.99,1.00,4),(4,4,1,'The Tigress Wrap','The Tigress Wrap is a powerful combination of determination and beauty. With its satin gold brown colors, this gem is bound to enrich your sense of style. Combine it with our Rustic Gold hand-dyed ribbon and embrace your inner tigress. The Tigress Wrap enhances our fierce feminine energy with mental clarity, determination, confidence, and a touch of abundance. Everything a goddess forgets to embrace from time to time.',35.00,3.99,1.00,7),(5,5,1,'The Grounding Wrap','Add an instant touch of elegance to any outfit with The Grounding Wrap. Black is a classic color that never goes out of style. This rich black color will now serve as your favorite basic yet give you powerful grounding energy in your fast-paced daily routine. Pair it with a hand-dyed Mistletoe silk ribbon for that perfect holiday accessory! ',35.00,3.99,1.00,1),(6,6,1,'The Creativity Wrap','Embrace this stone of honor and give your creative side a surge of energy! With our crazy schedules these days, we all could use a little boost. Energize your sacral chakra and find some time in your day to do something you love. The Creativity Wrap is the perfect way to add a dash of color to your wardrobe and lifestyle.',35.00,3.99,1.00,5),(7,7,1,'The Serenity Wrap','Throughout a busy day, a hardworking woman could use a piece of serenity. Whether you find yourself stressed in rush hour traffic, at work, or at home, blue lace agate can help with your anxieties. Its soothing blue color will complement any pastel palette or vintage dress you\\\'ve been dying to wear. Wear it with our Wonderland hand-dyed ribbon and highlight your winter wonderland wardrobe this holiday season.',38.00,3.99,1.00,1),(8,8,1,'The Self Love Wrap','The Self Love Wrap is the perfect way to add a touch of Victorian elegance and self love. Its soft pink color will compliment all of our fun feminine pieces while surrounding ourselves with soothing love. Rose Quartz is a timeless stone that is bound to make any outfit chic. Indulge in your inner and outer beauty with this exquisite gem. Wear it with our hand-dyed Blushing Bride ribbon for that special day.',38.00,3.99,1.00,10),(9,9,1,'The Lucky Wrap','Take home a little bit of luck with Aventurine! We all need some good fortune in our lives now and then and this gem is the perfect tool to realize those affirmations. Welcome opportunity and wealth at your door with The Lucky Wrap. Pair this beautiful pastel green stone with a ballet slipper hand-dyed ribbon for a vintage look. ',35.00,3.99,1.00,1),(10,10,2,'The Healing Wrap','Take home a piece of glitz and glamor with Goldstone. This beautiful stone will be sure to add some shimmer to any holiday outfit. Wear it with our hand-dyed Raven ribbon and awe at it\\\'s sparkle!',35.00,0.00,0.00,4),(11,11,2,'The Dream Wrap','Get lost in this exquisite one-of-a-kind gem. Labradorite is definitely a piece you\\\'ll want to show off time and time again. Pair it with a hand-dyed Raven ribbon and let it\\\'s flashes of color shine. ',50.00,0.00,0.00,0),(12,12,2,'The Peace Wrap','Flower Sugilite is perfect for that flower child! This lovely purple stone will make a great addition to any sundress or flowy blouse. Pair it with our Orchid Ivory hand-dyed ribbon for a beautiful soft look.',38.00,0.00,0.00,1),(13,13,1,'The Protection Wrap','For us weary travelers, The Protection Wrap will give it\\\'s wearer a boost of courage in style. This beautiful serene looking stone is the perfect addition to your favorite pair of jeans. Wear it with our hand-dyed Rainforest ribbon and make any basic outfit pop.',40.00,0.00,0.00,4),(14,14,1,'The Snow Wrap','Let it snow! Let it snow! Let is snow with The Snow Wrap! The beautiful snow quartz is true to its name and resembles a fresh sheet of pure snow. Pair it with our hand-dyed Mistletoe ribbon for that perfect holiday accessory! It\\\'s fluffy white charm will sure to be the talk of your holiday studded evening. ',35.00,3.99,1.00,4),(15,15,2,'The Paua Shell Wrap','Bring the serenity of the ocean to your hands with the paua shell. This stunning shell, only found on the shores of New Zealand, will capture your gaze the entire day. It\\\'s brilliant shimmering colors will make any ordinary outfit come to life. Wear it with our Purple Lush or Raven hand-dyed ribbon to really bring out the paua shell\\\'s majestic beauty.',35.00,3.00,1.00,0),(16,16,1,'The Relaxation Wrap','Keep a small piece of R&R at your wrist with The Relaxation Wrap. Poppy Jasper reminds us to put some time aside for ourselves and find our inner peace. The stone\\\'s rich red tones make a beautiful addition to your neutral wardrobe.',35.00,0.00,0.00,5),(17,17,2,'The Expression Wrap','Whether you need to clear your mind, instill a boost of confidence, or say the words you\\\'ve been meaning to say, The Expression Wrap is the perfect piece. Sodalite and it\\\'s purple-blue color will brighten any outfit. Make a statement with our hand-dyed Rainforest ribbon.',35.00,3.99,1.00,4),(18,18,2,'The Balance Wrap','Bring some stability to your life with The Balance Wrap. We all need to find our center from time to time and what better way than with laguna agate. This mesmerizing gem will splash color to any outfit. Wear it with our hand-dyed river stone ribbon for your daily practice.',35.00,3.99,1.00,3),(19,19,2,'The Attraction Wrap','Feel pretty in pink with The Attraction Wrap. For those who have lost contact with your inner diva, the powerful Rhodochrosite will add some definite goddess energy to your life. This exquisite pink gem will make the perfect accessory for all your feminine outfits. Pair it with our hand-dyed electric guitar ribbon and rock out.',40.00,3.99,1.00,5),(20,20,2,'The Sacred Wrap','Bring some noble wisdom into your life with The Sacred Wrap. Whether you seek courage, communication, or self-realization, the stone serves as a beautiful companion. Turquoise grows closer to it\\\'s wearer with age. This timeless designer gem is sure to enrich your wardrobe and sense of style. Wear it with our hand-dyed Rainforest ribbon to bring out its stunning color.',42.00,0.00,0.00,0),(21,9,1,'The Lucky Valentine\'s Wrap','Take home a little bit of luck with Aventurine! We all need some good fortune in our lives now and then and this gem is the perfect tool to realize those affirmations. Welcome opportunity and wealth at your door with The Lucky Wrap. Pair this beautiful pastel green stone with a ballet slipper hand-dyed ribbon for a vintage look. ',35.00,0.00,0.00,3),(22,2,1,'The Meditation Valentine\'s Wrap','The fierce royal blue and golden specked lapis lazuli will be sure to catch anyone\\\'s eye. This beautiful rich stone will make any outfit pop. Wear it with a sleek black dress and a pair of blue pumps or dress it down and bring out your inner diva. The Meditation Wrap is sure to enrich your daily practice and outer goddess.',38.00,0.00,0.00,2),(23,7,1,'The Serenity Valentine\'s Wrap','Throughout a busy day, a hardworking woman could use a piece of serenity. Whether you find yourself stressed in rush hour traffic, at work, or at home, blue lace agate can help with your anxieties. Its soothing blue color will complement any pastel palette or vintage dress you\\\'ve been dying to wear. Wear it with our Wonderland hand-dyed ribbon and highlight your winter wonderland wardrobe this holiday season.',38.00,0.00,0.00,2),(24,5,1,'The Grounding Valentine\'s Wrap','Add an instant touch of elegance to any outfit with The Grounding Wrap. Black is a classic color that never goes out of style. This rich black color will now serve as your favorite basic yet give you powerful grounding energy in your fast-paced daily routine. Pair it with a hand-dyed Mistletoe silk ribbon for that perfect holiday accessory! ',35.00,0.00,0.00,1),(25,21,2,'The Ocean Wrap','Bring the serenity of the ocean to your hands with the abalone shell. This stunning natural shell will capture your gaze the entire day. It\\\'s brilliant shimmering colors will make any ordinary outfit come to life. Wear it with our Rustic Gold hand-dyed ribbon to really bring out the abalone shell\\\'s majestic beauty.',35.00,0.00,0.00,1),(26,22,2,'The Ancients\' Wrap','Turquoise is considered one of the oldest stones used for protection by the ancients. It was also thought to be a symbol of wealth and courage. The stone carries great wisdom and truth for it\\\'s wearer. Turquoise stabilizes one\\\'s mood and is also great for preventing depression and panic attacks. The stone protects the wearer from negativity and promotes self-realization and communication.',38.00,0.00,0.00,1),(27,23,2,'The Spirit Wrap','Get a surge of positivity with The Spirit Wrap. This drusy quartz brilliantly catches light with all of its crystals. There\\\'s not a more stunning way to dissolve your worry and stress and amplify positivity. Druzy Quartz is sure to dazzle your wardrobe with some glitz and glamour! Pair it with our hand-dyed River Stone ribbon for an exquisite accessory.',55.00,0.00,0.00,0),(28,24,2,'The Mother\'s Wrap','The Mother Wrap is the perfect gift for that amazing mom in your life. With it\\\'s stunning iridescent flashes of light, it serves as a reminder of the powerful goddess energy they possess. The rare rainbow moonstone will make any outfit come to life. Pair it with our Wonderland hand-dyed ribbon to bring out its blue flashes.',42.00,0.00,0.00,1),(29,25,4,'Trust In A Bottle Necklace','Bring peace and intuition to your heart center with the Trust In A Bottle necklace. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I trust my dreams and intuitions. I am destined for great things.\\" The bottle also includes amethyst gems and an antique key on a 27\\" antique chain. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Strength In A Bottle ring for a cute key and lock affirmation set.',19.00,0.00,0.00,1),(30,26,4,'Strength In A Bottle Necklace','Bring some inner strength to your heart center with the Strength In A Bottle necklace. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I\\\'m strong, confident, fearless, and powerful. I\\\'m in control.\\" The bottle also includes black tourmaline gems and an antique key on a 27\\" antique chain. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Strength In A Bottle ring for a cute key and lock affirmation set.',19.00,0.00,0.00,1),(31,8,4,'Confidence In A Bottle Necklace','Bring your inner diva to your heart center with the Confidence In A Bottle necklace. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I\\\'m beautiful, confident, appreciated, and admired. I\\\'m loved. I\\\'m perfection.\\" The bottle also includes rose quartz gems and an antique key on a 27\\" antique chain. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Confidence In A Bottle ring for a cute key and lock affirmation set.',19.00,0.00,0.00,1),(32,25,4,'Trust In A Bottle Ring','Bring peace and intuition to your finger tips with the Trust In A Bottle ring. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I trust my dreams and intuitions. I am destined for great things.\\" The bottle also includes amethyst gems and an antique heart lock on an antique adjustable ring. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Strength In A Bottle necklace for a cute key and lock affirmation set.',14.00,0.00,0.00,2),(33,26,4,'Strength In A Bottle Ring','Bring some inner strength to your finger tips with the Strength In A Bottle ring. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I\\\'m strong, confident, fearless, and powerful. I\\\'m in control.\\" The bottle also includes black tourmaline gems and an antique heart lock on an antique adjustable ring. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Strength In A Bottle necklace for a cute key and lock affirmation set.',14.00,0.00,0.00,2),(34,8,4,'Confidence In A Bottle Ring','Bring your inner diva to your finger tips with the Confidence In A Bottle ring. This adorable tiny bottle contains an affirmation on a hand-distressed scroll, which reads \\"I\\\'m beautiful, confident, appreciated, and admired. I\\\'m loved. I\\\'m perfection.\\" The bottle also includes rose quartz gems and an antique heart lock on an antique adjustable ring. This little bottle is the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. Pair it with the Confidence In A Bottle necklace for a cute key and lock affirmation set.',14.00,0.00,0.00,2),(35,25,4,'Trust In A Bottle Set','Bring peace and intuition to your heart center and finger tips with the Trust In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read \\"I trust my dreams and intuitions. I am destined for great things.\\" The bottles also include amethyst gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27\\" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. ',30.00,0.00,0.00,2),(36,26,4,'Strength In A Bottle Set','Bring some inner strength to your heart center and finger tips with the Strength In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read \\"I\\\'m strong, confident, fearless, and powerful. I\\\'m in control.\\" The bottles also include black tourmaline gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27\\" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. ',30.00,0.00,0.00,2),(37,8,4,'Confidence In A Bottle Set','Bring your inner diva to your heart center and finger tips with the Confidence In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read \\"I\\\'m beautiful, confident, appreciated, and admired. I\\\'m loved. I\\\'m perfection.\\" The bottles also include rose quartz gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27\\" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. ',30.00,0.00,0.00,2),(38,4,3,'Tigress Leather Cuff','Wrap yourself in feathers with this stylish leather cuff. It features brown pheasant feathers and a tiger\\\'s eye at it\\\'s core. The cuff is 1.5\\" wide and adjusts from 6.5\\" to 7.5\\". Wear it with any basic outfit with this rich handmade piece.',32.00,0.00,0.00,1),(39,27,1,'The Leather Wrap','Elegance meets rocker chic with this exquisite piece. This handmade leather wrap features rich black feathers and a kyanite at it\\\'s core. Dress it up or wear it with your favorite vintage tee.',36.00,0.00,0.00,1),(40,5,3,'The Grounding Cuff','Wrap yourself in feathers with this stylish leather cuff. It features green pheasant feathers and an onyx at it\\\'s core. The cuff is 1.5\\" wide and adjusts from 6.5\\" to 7.5\\". Wear any basic outfit with this rich handmade piece.',32.00,0.00,0.00,1),(41,5,3,'Men\'s Arrowhead Wrap','Get in touch with your inner rocker with The Arrowhead Wrap. It\\\'s the perfect accessory for the stylish man in your life. It features a unique onyx arrowhead and red suede. It\\\'s sure to fit any man with an adjustable closure.',36.00,0.00,0.00,1),(42,5,3,'Men\'s Grounding Cuff','This handsome leather cuff is sleek with a slight edge. It features a large onyx wrapped in red suede. It\\\'s sure to fit that special man in your life with an adjustable buckle closure. The grounding cuff is the perfect accessory for your favorite vintage tee and jeans.',30.00,0.00,0.00,1),(43,5,3,'Brown Pheasant Headband','No matter what hair color you\\\'re rocking this season, embellish it with the brown pheasant headband. These beautiful natural brown feathers are sure to enhance any hair style. This elegant headband features an onyx gem and a 1.5\\" wide headband lined with suede for maximum comfort.',0.00,0.00,0.00,1),(44,5,3,'Green Pheasant Headband','Add some textured color to your locks. These beautiful green pheasant and guinea feathers are sure to enhance any hair style. This elegant headband features an onyx gem and a 1.5\\" wide headband lined with suede for maximum comfort.',0.00,0.00,0.00,1),(45,5,3,'Green Pheasant Earrings','These elegant earrings feature a rich emerald pheasant feather topped with an onyx gem. Measuring at approximately 4.25" long, these earrings are sure to bring the solid tops and dresses in your wardrobe to the next level.',18.00,0.00,0.00,1),(46,5,3,'Brown Pheasant Earrings','Add some warmth to your profile with this rich pair. These earrings feature feathers topped with an onyx gem. Measuring at approximately 4.5\\" long, these earrings are sure to compliment all the neutrals in your wardrobe.',18.00,0.00,0.00,1),(47,11,3,'Black Feather Earrings','These sleek black earrings make the perfect evening accessory. Handmade with black labradorite gems, they are sure to add some sparkle to your night. Measuring at approximately 4.5\\" long, these feathers easily create a stunning dramatic look.',17.00,0.00,0.00,1),(48,5,3,'Layered Green Pheasant Earrings','These elegant earrings feature rich emerald pheasant feathers topped with an onyx gem. Measuring at approximately 5\\" long, these earrings are sure to help create that dramatic evening look.',19.00,0.00,0.00,1),(49,5,3,'Layered Black & White Earrings','Take elegance to the next level with stunning layered black and white feathers. Measuring at 4.75\\", these rare pheasant feathers will enrich any outfit. Pair them with a bold solid top or dress for that desired dramatic look.',19.00,0.00,0.00,1),(50,11,3,'Layered Black Earrings','These sleek black earrings make the perfect evening accessory. Handmade with black labradorite gems, they are sure to add some sparkle to your night. Measuring at approximately 5\\" long, the layered black feathers easily create a stunning dramatic look.',19.00,0.00,0.00,1),(51,5,3,'Black & White Earrings','Take elegance to the next level with stunning black and white feathers. Measuring at 5", these rare pheasant feathers will enrich any outfit. Pair them with a bold solid top or dress for that desired dramatic look.',19.00,0.00,0.00,1),(52,5,3,'Orange Pheasant Earrings','Add a pop color to your wardrobe with this fun pair. This elegant set of earrings features an orange pheasant feather and an onyx gem. Measuring at 4.25", these feathers are sure to spice up your neutrals.',18.00,0.00,0.00,1),(53,5,3,'Gold Pheasant Earrings','Add a pop color to your wardrobe with this fun pair. This elegant set of earrings features a gold pheasant feather and an onyx gem. Measuring at 4.5", these feathers are sure to spice up your neutrals.',18.00,0.00,0.00,1),(54,9,4,'Luck in a Bottle Set','Bring opportunity and abundance to your heart center and finger tips with the Luck In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read "Doors are opening for me. Wealth is pouring into my life. I\'m lucky in every aspect." The bottles also include aventurine gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day',30.00,0.00,0.00,2),(55,28,4,'Comfort in a Bottle Set','Bring some joy to your heart center and finger tips with the Comfort In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read \"I\'m grateful for the people and things which bring joy to my life. My life is rich. I love being me.\" The bottles also include peridot gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27\" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. ',30.00,0.00,0.00,2),(56,4,4,'Clarity in a Bottle Set','Bring some focus and determination to your heart center and finger tips with the Clarity In A Bottle necklace and ring set. These adorable tiny bottles contain affirmations on hand-distressed scrolls, which read \"My inner vision is clear and focused. I\'m grounded, sharp, and determined. I\'m a pure force.\" The bottles also include tigers eye gems. The ring is finished with an antique heart lock and an adjustable ring. The necklace comes with an antique key and matching 27\" chain. These exquisite bottles are the perfect touch of vintage to any outfit, while reminding us to keep positive throughout the day. ',30.00,0.00,0.00,2);
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tweets`
--
DROP TABLE IF EXISTS `tweets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tweets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tweet_id` varchar(45) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`time_tweeted` timestamp NULL DEFAULT NULL,
`time_checked` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tweets`
--
LOCK TABLES `tweets` WRITE;
/*!40000 ALTER TABLE `tweets` DISABLE KEYS */;
INSERT INTO `tweets` VALUES (1,'598351425085673472','@jolieodell @macdonald_ted @TWiT I thought it was a fun change of pace. Need to take a break from the apple watch and Google teacking us.','2015-05-13 04:57:51','2015-09-03 04:12:36'),(2,'572868615210336256','Collect, Share Your Digital Life With the New Hive - Hello everyone, We are getting closer to the official... http://t.co/BTFinbSENq','2015-03-03 21:18:15','2015-09-03 04:12:36'),(3,'517712882176634880','Enhance your #Creativity #Energy & #Passion. Carnelian gem the heart of our Creativity Wrap on http://t.co/ojawE5hKZK http://t.co/enCzlSJiLH','2014-10-02 16:29:04','2015-09-03 04:12:36'),(4,'517710991300517888','My inner vision is clear and focused. I\'m grounded, sharp, and determined. I\'m a pure force. #Clarity @... http://t.co/E6XgwdRmhJ','2014-10-02 16:21:33','2015-09-03 04:12:36'),(5,'517430879921401856','The Comfort in a Bottle Set on http://t.co/ojawE5hKZK #Affirmations #Comfort http://t.co/YXmqv9rVm6','2014-10-01 21:48:29','2015-09-03 04:12:36');
/*!40000 ALTER TABLE `tweets` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-09-02 21:20:48
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 03, 2022 at 06:02 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
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: `mypsg`
--
-- --------------------------------------------------------
--
-- Table structure for table `komik`
--
CREATE TABLE `komik` (
`id` int(11) NOT NULL,
`Judul` varchar(255) NOT NULL,
`Slug` varchar(255) NOT NULL,
`Penulis` varchar(255) NOT NULL,
`Penerbit` varchar(255) NOT NULL,
`Sampul` varchar(255) NOT NULL,
`Created_at` datetime DEFAULT NULL,
`Update_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `komik`
--
INSERT INTO `komik` (`id`, `Judul`, `Slug`, `Penulis`, `Penerbit`, `Sampul`, `Created_at`, `Update_at`) VALUES
(1, 'Naruto', 'naruto', 'asdasdasdasd', 'asdfasd', 'Naruto.jpg', NULL, NULL),
(2, 'One Piece', 'one piece', 'qwdsadas', 'rdqaweq', 'one piece.jpg', NULL, NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `komik`
--
ALTER TABLE `komik`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `komik`
--
ALTER TABLE `komik`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE e2e_users (
id UUID NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
username VARCHAR(255) NULL,
CONSTRAINT "primary" PRIMARY KEY (id ASC),
FAMILY "primary" (id, created_at, updated_at, username)
);
CREATE TABLE e2e_user_notes (
id UUID NOT NULL,
user_id UUID NOT NULL,
notes VARCHAR(255) NULL,
CONSTRAINT "primary" PRIMARY KEY (id ASC),
INDEX e2e_user_notes_user_id_idx (user_id ASC),
FAMILY "primary" (id, user_id, notes)
);
CREATE TABLE schema_migration (
version VARCHAR(14) NOT NULL,
UNIQUE INDEX schema_migration_version_idx (version ASC),
FAMILY "primary" (version, rowid)
);
ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE;
-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump.
ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk;
|
with u_rnd as (
select cast(idx as bigint) userid, pu, bu, rand(31) as rnd
from mf_model m
where m.idx in (select userid from ratings_mf)
),
i as (
select cast(idx as bigint) itemid, qi, bi
from mf_model m
where m.idx in (select itemid from ratings_mf)
),
t1 as (
select
each_top_k(${k}, u.userid, mf_predict(u.pu, i.qi, u.bu, i.bi, ${td.last_results.mu}),
u.userid, itemid) as (rank, score, userid, itemid)
from (select userid, pu, bu from u_rnd where rnd < 0.2) u
left outer join i
where not exists (
select userid from training_mf train
where train.userid = u.userid and train.itemid = i.itemid
)
),
t2 as (
select
each_top_k(${k}, u.userid, mf_predict(u.pu, i.qi, u.bu, i.bi, ${td.last_results.mu}),
u.userid, itemid) as (rank, score, userid, itemid)
from (select userid, pu, bu from u_rnd where rnd >= 0.2 and rnd < 0.4) u
left outer join i
where not exists (
select userid from training_mf train
where train.userid = u.userid and train.itemid = i.itemid
)
),
t3 as (
select
each_top_k(${k}, u.userid, mf_predict(u.pu, i.qi, u.bu, i.bi, ${td.last_results.mu}),
u.userid, itemid) as (rank, score, userid, itemid)
from (select userid, pu, bu from u_rnd where rnd >= 0.4 and rnd < 0.6) u
left outer join i
where not exists (
select userid from training_mf train
where train.userid = u.userid and train.itemid = i.itemid
)
),
t4 as (
select
each_top_k(${k}, u.userid, mf_predict(u.pu, i.qi, u.bu, i.bi, ${td.last_results.mu}),
u.userid, itemid) as (rank, score, userid, itemid)
from (select userid, pu, bu from u_rnd where rnd >= 0.6 and rnd < 0.8) u
left outer join i
where not exists (
select userid from training_mf train
where train.userid = u.userid and train.itemid = i.itemid
)
),
t5 as (
select
each_top_k(${k}, u.userid, mf_predict(u.pu, i.qi, u.bu, i.bi, ${td.last_results.mu}),
u.userid, itemid) as (rank, score, userid, itemid)
from (select userid, pu, bu from u_rnd where rnd >= 0.8) u
left outer join i
where not exists (
select userid from training_mf train
where train.userid = u.userid and train.itemid = i.itemid
)
)
-- DIGDAG_INSERT_LINE
select * from t1
union all
select * from t2
union all
select * from t3
union all
select * from t4
union all
select * from t5
;
|
USE `pm`;
DROP TABLE IF EXISTS `tasks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasks` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`description` TEXT NOT NULL,
`type` VARCHAR(10) NOT NULL,
`closed` TINYINT NOT NULL,
`projectId` INT(11) NOT NULL,
`parentId` INT(11),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
|
----
-- Copyright (c) 2012-2015 Apple Inc. All rights reserved.
--
-- 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.
----
---------------------------------------------------
-- Upgrade database schema from VERSION 38 to 39 --
---------------------------------------------------
alter table GROUP_MEMBERSHIP add foreign key ("GROUP_ID") references GROUPS on delete cascade;
alter table GROUP_ATTENDEE add foreign key ("GROUP_ID") references GROUPS on delete cascade;
alter table GROUP_ATTENDEE add foreign key ("RESOURCE_ID") references CALENDAR_OBJECT on delete cascade;
alter table DELEGATE_GROUPS add foreign key ("GROUP_ID") references GROUPS on delete cascade;
-- update the version
update CALENDARSERVER set VALUE = '39' where NAME = 'VERSION';
|
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
*/
/*
Find top 100 customers with the most number of orders
*/
{{ config(materialized='table') }}
select c_custkey, c_nationkey, count(*) total_order
from customer c left join orders o on c.c_custkey = o.o_custkey
group by c_custkey, c_nationkey
order by total_order desc
limit 100
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Set 27, 2020 alle 14:09
-- Versione del server: 10.4.14-MariaDB
-- Versione PHP: 7.2.33
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: `invoices`
--
-- --------------------------------------------------------
--
-- Struttura della tabella `invoice`
--
CREATE TABLE `invoice` (
`id` int(11) NOT NULL,
`invoiceDate` date NOT NULL,
`invoiceNumber` int(11) NOT NULL,
`clientId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dump dei dati per la tabella `invoice`
--
INSERT INTO `invoice` (`id`, `invoiceDate`, `invoiceNumber`, `clientId`) VALUES
(94, '2020-09-27', 1, 44),
(96, '2020-09-27', 3, 55);
-- --------------------------------------------------------
--
-- Struttura della tabella `invoice_rows`
--
CREATE TABLE `invoice_rows` (
`id` int(11) NOT NULL,
`InvoiceId` int(11) NOT NULL,
`Description` longtext COLLATE utf8_unicode_ci NOT NULL,
`Quantity` int(11) NOT NULL,
`Amount` decimal(10,2) NOT NULL,
`VAT` decimal(4,2) NOT NULL,
`TotalWithVAT` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dump dei dati per la tabella `invoice_rows`
--
INSERT INTO `invoice_rows` (`id`, `InvoiceId`, `Description`, `Quantity`, `Amount`, `VAT`, `TotalWithVAT`) VALUES
(21, 94, 'Try', 4, '30.99', '8.00', '38.99'),
(22, 96, 'New try', 5, '36.99', '9.00', '46.99');
--
-- Indici per le tabelle scaricate
--
--
-- Indici per le tabelle `invoice`
--
ALTER TABLE `invoice`
ADD PRIMARY KEY (`id`);
--
-- Indici per le tabelle `invoice_rows`
--
ALTER TABLE `invoice_rows`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQ_84E96C4BF8A5EF2` (`InvoiceId`);
--
-- AUTO_INCREMENT per le tabelle scaricate
--
--
-- AUTO_INCREMENT per la tabella `invoice`
--
ALTER TABLE `invoice`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=97;
--
-- AUTO_INCREMENT per la tabella `invoice_rows`
--
ALTER TABLE `invoice_rows`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- Limiti per le tabelle scaricate
--
--
-- Limiti per la tabella `invoice_rows`
--
ALTER TABLE `invoice_rows`
ADD CONSTRAINT `invoice_rows_ibfk_1` FOREIGN KEY (`InvoiceId`) REFERENCES `invoice` (`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
"broker_subaward"."unique_award_key" AS "prime_award_unique_key",
"broker_subaward"."award_id" AS "prime_award_piid",
"broker_subaward"."parent_award_id" AS "prime_award_parent_piid",
"broker_subaward"."award_amount" AS "prime_award_amount",
DEFC."disaster_emergency_funds" AS "prime_award_disaster_emergency_fund_codes",
DEFC."gross_outlay_amount_by_award_cpe" AS "prime_award_outlayed_amount_funded_by_COVID-19_supplementals",
DEFC."transaction_obligated_amount" AS "prime_award_obligated_amount_funded_by_COVID-19_supplementals",
"broker_subaward"."action_date" AS "prime_award_base_action_date",
EXTRACT (YEAR FROM ("awards"."date_signed") + INTERVAL '3 months') AS "prime_award_base_action_date_fiscal_year",
"awards"."certified_date" AS "prime_award_latest_action_date",
EXTRACT (YEAR FROM ("awards"."certified_date"::DATE) + INTERVAL '3 months') AS "prime_award_latest_action_date_fiscal_year",
"awards"."period_of_performance_start_date" AS "prime_award_period_of_performance_start_date",
"awards"."period_of_performance_current_end_date" AS "prime_award_period_of_performance_current_end_date",
("transaction_fpds"."period_of_perf_potential_e") ::date AS "prime_award_period_of_performance_potential_end_date",
"broker_subaward"."awarding_agency_code" AS "prime_award_awarding_agency_code",
"broker_subaward"."awarding_agency_name" AS "prime_award_awarding_agency_name",
"broker_subaward"."awarding_sub_tier_agency_c" AS "prime_award_awarding_sub_agency_code",
"broker_subaward"."awarding_sub_tier_agency_n" AS "prime_award_awarding_sub_agency_name",
"broker_subaward"."awarding_office_code" AS "prime_award_awarding_office_code",
"broker_subaward"."awarding_office_name" AS "prime_award_awarding_office_name",
"broker_subaward"."funding_agency_code" AS "prime_award_funding_agency_code",
"broker_subaward"."funding_agency_name" AS "prime_award_funding_agency_name",
"broker_subaward"."funding_sub_tier_agency_co" AS "prime_award_funding_sub_agency_code",
"broker_subaward"."funding_sub_tier_agency_na" AS "prime_award_funding_sub_agency_name",
"broker_subaward"."funding_office_code" AS "prime_award_funding_office_code",
"broker_subaward"."funding_office_name" AS "prime_award_funding_office_name",
(SELECT STRING_AGG (DISTINCT U2."tas_rendering_label", ';') AS "value" FROM "awards" U0 LEFT OUTER JOIN "financial_accounts_by_awards" U1 ON (U0."id" = U1."award_id") LEFT OUTER JOIN "treasury_appropriation_account" U2 ON (U1."treasury_account_id" = U2."treasury_account_identifier") WHERE U0."id" = ("subaward"."award_id") GROUP BY U0."id") AS "prime_award_treasury_accounts_funding_this_award",
(SELECT STRING_AGG (DISTINCT U3."federal_account_code", ';') AS "value" FROM "awards" U0 LEFT OUTER JOIN "financial_accounts_by_awards" U1 ON (U0."id" = U1."award_id") LEFT OUTER JOIN "treasury_appropriation_account" U2 ON (U1."treasury_account_id" = U2."treasury_account_identifier") LEFT OUTER JOIN "federal_account" U3 ON (U2."federal_account_id" = U3."id") WHERE U0."id" = ("subaward"."award_id") GROUP BY U0."id") AS "prime_award_federal_accounts_funding_this_award",
(SELECT STRING_AGG(DISTINCT CONCAT(U2."object_class", ':', U2.object_class_name), ';') FROM "awards" U0 LEFT OUTER JOIN "financial_accounts_by_awards" U1 ON (U0. "id" = U1. "award_id") INNER JOIN "object_class" U2 ON (U1. "object_class_id" = U2. "id") WHERE U0. "id" = ("subaward"."award_id") and U1.object_class_id is not null GROUP BY U0. "id") AS "prime_award_object_classes_funding_this_award",
(SELECT STRING_AGG(DISTINCT CONCAT(U2."program_activity_code", ':', U2.program_activity_name), ';') FROM "awards" U0 LEFT OUTER JOIN "financial_accounts_by_awards" U1 ON (U0. "id" = U1. "award_id") INNER JOIN "ref_program_activity" U2 ON (U1. "program_activity_id" = U2. "id") WHERE U0. "id" = ("subaward"."award_id") and U1.program_activity_id is not null GROUP BY U0. "id") AS "prime_award_program_activities_funding_this_award",
"broker_subaward"."awardee_or_recipient_uniqu" AS "prime_awardee_duns",
"broker_subaward"."awardee_or_recipient_legal" AS "prime_awardee_name",
"broker_subaward"."dba_name" AS "prime_awardee_dba_name",
"broker_subaward"."ultimate_parent_unique_ide" AS "prime_awardee_parent_duns",
"broker_subaward"."ultimate_parent_legal_enti" AS "prime_awardee_parent_name",
"broker_subaward"."legal_entity_country_code" AS "prime_awardee_country_code",
"broker_subaward"."legal_entity_country_name" AS "prime_awardee_country_name",
"broker_subaward"."legal_entity_address_line1" AS "prime_awardee_address_line_1",
"broker_subaward"."legal_entity_city_name" AS "prime_awardee_city_name",
"transaction_fpds"."legal_entity_county_name" AS "prime_awardee_county_name",
"broker_subaward"."legal_entity_state_code" AS "prime_awardee_state_code",
"broker_subaward"."legal_entity_state_name" AS "prime_awardee_state_name",
"broker_subaward"."legal_entity_zip" AS "prime_awardee_zip_code",
"broker_subaward"."legal_entity_congressional" AS "prime_awardee_congressional_district",
"broker_subaward"."legal_entity_foreign_posta" AS "prime_awardee_foreign_postal_code",
"broker_subaward"."business_types" AS "prime_awardee_business_types",
"broker_subaward"."place_of_perform_city_name" AS "prime_award_primary_place_of_performance_city_name",
"broker_subaward"."place_of_perform_state_code" AS "prime_award_primary_place_of_performance_state_code",
"broker_subaward"."place_of_perform_state_name" AS "prime_award_primary_place_of_performance_state_name",
"broker_subaward"."place_of_performance_zip" AS "prime_award_primary_place_of_performance_address_zip_code",
"broker_subaward"."place_of_perform_congressio" AS "prime_award_primary_place_of_performance_congressional_district",
"broker_subaward"."place_of_perform_country_co" AS "prime_award_primary_place_of_performance_country_code",
"broker_subaward"."place_of_perform_country_na" AS "prime_award_primary_place_of_performance_country_name",
"broker_subaward"."award_description" AS "prime_award_description",
"broker_subaward"."program_title" AS "prime_award_project_title",
"broker_subaward"."naics" AS "prime_award_naics_code",
"broker_subaward"."naics_description" AS "prime_award_naics_description",
"transaction_fpds"."national_interest_action" AS "prime_award_national_interest_action_code",
"transaction_fpds"."national_interest_desc" AS "prime_award_national_interest_action",
"broker_subaward"."subaward_type" AS "subaward_type",
"broker_subaward"."internal_id" AS "subaward_fsrs_report_id",
"broker_subaward"."subaward_report_year" AS "subaward_fsrs_report_year",
"broker_subaward"."subaward_report_month" AS "subaward_fsrs_report_month",
"broker_subaward"."subaward_number" AS "subaward_number",
"broker_subaward"."subaward_amount" AS "subaward_amount",
"broker_subaward"."sub_action_date" AS "subaward_action_date",
EXTRACT (YEAR FROM ("subaward"."action_date") + INTERVAL '3 months') AS "subaward_action_date_fiscal_year",
"broker_subaward"."sub_awardee_or_recipient_uniqu" AS "subawardee_duns",
"broker_subaward"."sub_awardee_or_recipient_legal" AS "subawardee_name",
"broker_subaward"."sub_dba_name" AS "subawardee_dba_name",
"broker_subaward"."sub_ultimate_parent_unique_ide" AS "subawardee_parent_duns",
"broker_subaward"."sub_ultimate_parent_legal_enti" AS "subawardee_parent_name",
"broker_subaward"."sub_legal_entity_country_code" AS "subawardee_country_code",
"broker_subaward"."sub_legal_entity_country_name" AS "subawardee_country_name",
"broker_subaward"."sub_legal_entity_address_line1" AS "subawardee_address_line_1",
"broker_subaward"."sub_legal_entity_city_name" AS "subawardee_city_name",
"broker_subaward"."sub_legal_entity_state_code" AS "subawardee_state_code",
"broker_subaward"."sub_legal_entity_state_name" AS "subawardee_state_name",
"broker_subaward"."sub_legal_entity_zip" AS "subawardee_zip_code",
"broker_subaward"."sub_legal_entity_congressional" AS "subawardee_congressional_district",
"broker_subaward"."sub_legal_entity_foreign_posta" AS "subawardee_foreign_postal_code",
"broker_subaward"."sub_business_types" AS "subawardee_business_types",
"broker_subaward"."place_of_perform_street" AS "subaward_primary_place_of_performance_address_line_1",
"broker_subaward"."sub_place_of_perform_city_name" AS "subaward_primary_place_of_performance_city_name",
"broker_subaward"."sub_place_of_perform_state_code" AS "subaward_primary_place_of_performance_state_code",
"broker_subaward"."sub_place_of_perform_state_name" AS "subaward_primary_place_of_performance_state_name",
"broker_subaward"."sub_place_of_performance_zip" AS "subaward_primary_place_of_performance_address_zip_code",
"broker_subaward"."sub_place_of_perform_congressio" AS "subaward_primary_place_of_performance_congressional_district",
"broker_subaward"."sub_place_of_perform_country_co" AS "subaward_primary_place_of_performance_country_code",
"broker_subaward"."sub_place_of_perform_country_na" AS "subaward_primary_place_of_performance_country_name",
"broker_subaward"."subaward_description" AS "subaward_description",
"broker_subaward"."sub_high_comp_officer1_full_na" AS "subawardee_highly_compensated_officer_1_name",
"broker_subaward"."sub_high_comp_officer1_amount" AS "subawardee_highly_compensated_officer_1_amount",
"broker_subaward"."sub_high_comp_officer2_full_na" AS "subawardee_highly_compensated_officer_2_name",
"broker_subaward"."sub_high_comp_officer2_amount" AS "subawardee_highly_compensated_officer_2_amount",
"broker_subaward"."sub_high_comp_officer3_full_na" AS "subawardee_highly_compensated_officer_3_name",
"broker_subaward"."sub_high_comp_officer3_amount" AS "subawardee_highly_compensated_officer_3_amount",
"broker_subaward"."sub_high_comp_officer4_full_na" AS "subawardee_highly_compensated_officer_4_name",
"broker_subaward"."sub_high_comp_officer4_amount" AS "subawardee_highly_compensated_officer_4_amount",
"broker_subaward"."sub_high_comp_officer5_full_na" AS "subawardee_highly_compensated_officer_5_name",
"broker_subaward"."sub_high_comp_officer5_amount" AS "subawardee_highly_compensated_officer_5_amount",
CONCAT ('https://www.usaspending.gov/award/' , urlencode("awards"."generated_unique_award_id"), '/') AS "usaspending_permalink",
"broker_subaward"."date_submitted" AS "subaward_fsrs_report_last_modified_date"
FROM "subaward"
INNER JOIN "awards" ON ("subaward"."award_id" = "awards"."id")
INNER JOIN "transaction_fpds" ON ("awards"."latest_transaction_id" = "transaction_fpds"."transaction_id")
INNER JOIN "broker_subaward" ON ("subaward"."id" = "broker_subaward"."id")
INNER JOIN (
SELECT
faba.award_id,
STRING_AGG(DISTINCT CONCAT(disaster_emergency_fund_code, ': ', public_law), '; ' ORDER BY CONCAT(disaster_emergency_fund_code, ': ', public_law)) AS disaster_emergency_funds,
COALESCE(SUM(CASE WHEN sa.is_final_balances_for_fy = TRUE THEN faba.gross_outlay_amount_by_award_cpe END), 0) AS gross_outlay_amount_by_award_cpe,
COALESCE(SUM(faba.transaction_obligated_amount), 0) AS transaction_obligated_amount
FROM
financial_accounts_by_awards faba
INNER JOIN disaster_emergency_fund_code defc
ON defc.code = faba.disaster_emergency_fund_code
AND defc.group_name = 'covid_19'
INNER JOIN submission_attributes sa
ON faba.submission_id = sa.submission_id
AND sa.reporting_period_start >= '2020-04-01'
INNER JOIN dabs_submission_window_schedule ON (
sa."submission_window_id" = dabs_submission_window_schedule."id"
AND dabs_submission_window_schedule."submission_reveal_date" <= now()
)
WHERE faba.award_id IS NOT NULL
GROUP BY
faba.award_id
HAVING
COALESCE(SUM(CASE WHEN sa.is_final_balances_for_fy = TRUE THEN faba.gross_outlay_amount_by_award_cpe END), 0) != 0
OR COALESCE(SUM(faba.transaction_obligated_amount), 0) != 0
) DEFC ON (DEFC.award_id = awards.id)
WHERE (
"subaward"."award_type" IN ('procurement')
AND "subaward"."action_date" >= '2020-04-01'
)
|
UPDATE oskari_maplayer
SET minscale=-1, maxscale=-1
where
internal = true
and name in ('oskari:my_places', 'oskari:vuser_layer_data', 'oskari:analysis_data');
|
-- Deploy ggircs-portal:computed_columns/ciip_user_organisation_last_name to pg
-- requires: tables/ciip_user_organisation
begin;
create or replace function ggircs_portal.ciip_user_organisation_last_name(cuo ggircs_portal.ciip_user_organisation)
returns varchar
as $$
select last_name from ggircs_portal.ciip_user cu where cu.id = cuo.user_id;
$$ language sql stable;
comment on function ggircs_portal.ciip_user_organisation_last_name(ggircs_portal.ciip_user_organisation) is E'@sortable\nThis function is a wrapper to return last_name from the ciip_user object as a scalar';
commit;
|
create database test;
use database test;
create table T (
m_int int not null,
m_long long,
m_float float,
m_double double,
m_string string(5) not null
);
insert into T values (1, 1, 1.0, 1.0, "1");
insert into T values (2, 2, 2.0, 2.0, "2");
insert into T values (3, 3, 3.0, 3.0, "3");
insert into T values (4, 4, 4.0, 4.0, "4");
insert into T values (5, 5, 5.0, 5.0, "5");
insert into T values (6, 6, 6.0, 6.0, "6");
insert into T values (7, 7, 7.0, 7.0, "7");
insert into T values (8, 8, 8.0, 8.0, "8");
insert into T values (9, 9, 9.0, 9.0, "9");
insert into T values (10, 10, 10.0, 10.0, "10");
insert into T values (11, 11, 11.0, 11.0, "11");
insert into T values (12, 12, 12.0, 12.0, "12");
insert into T values (13, 13, 13.0, 13.0, "13");
insert into T values (14, 14, 14.0, 14.0, "14");
insert into T values (15, 15, 15.0, 15.0, "15");
insert into T values (16, 16, 16.0, 16.0, "16");
insert into T values (17, 17, 17.0, 17.0, "17");
insert into T values (18, 18, 18.0, 18.0, "18");
insert into T values (19, 19, 19.0, 19.0, "19");
insert into T values (20, 20, 20.0, 20.0, "20");
show databases;
select * from T;
-- a database exist --
-- or, and, long, int, string --
-- 6 --
select * from T where m_long = 8 and m_int = 7 or m_string = "6";
-- all --
select * from T where m_long != 8 and m_int != 7 or m_string != "6";
-- except 6 --
select * from T where m_long != 8 and m_int = 7 or m_string != "6";
-- [1,7], [9, 20] --
select * from T where m_long != 8 and m_int = 7 or m_string != "8";
-- all --
select * from T where m_long > 8 and m_int <= 16 or m_string != "10";
select * from T where m_long <= 18 and m_int > 1 or m_string != "8";
-- only 9 --
select * from T where m_long < 8 and m_int >= 8 or m_string = "9";
select * from T where m_long < 10 and m_int >= 9 or m_string = "9";
-- all --
select * from T where m_long < 10 and m_int >= 9 or m_string != "9";
-- {8, 9} --
select * from T where m_long = 8 and m_int >= 5 or m_string = "9";
-- drop database --
drop database test;
show databases;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : mb
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-01-12 15:35:16
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `py_admin`
-- ----------------------------
DROP TABLE IF EXISTS `py_admin`;
CREATE TABLE `py_admin` (
`user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '管理员ID',
`user_name` varchar(50) NOT NULL COMMENT '登录名',
`real_name` varchar(200) NOT NULL COMMENT '管理员真实名称',
`password` char(32) NOT NULL COMMENT '登录密码',
`sex` tinyint(1) NOT NULL DEFAULT '1' COMMENT '性别',
`session_key` char(32) NOT NULL COMMENT '登录密码串',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`group_id` int(11) NOT NULL COMMENT '组织架构',
`role_id` int(11) NOT NULL COMMENT '角色',
`menu_id` text NOT NULL COMMENT '功能ID集合,逗号隔开',
`is_open` tinyint(1) DEFAULT '0' COMMENT '开放权限',
`create_time` int(11) DEFAULT NULL COMMENT '插入时间',
`update_time` int(11) DEFAULT NULL COMMENT '最后更新时间',
`last_login_time` int(11) DEFAULT NULL COMMENT '上次登录时间',
`now_login_time` int(11) DEFAULT NULL COMMENT '本次登录时间',
`last_login_ip` varchar(50) DEFAULT NULL COMMENT '上次登录密码',
`now_login_ip` varchar(50) DEFAULT NULL COMMENT '本次登录IP',
PRIMARY KEY (`user_id`),
KEY `index_user_name` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='管理员表';
-- ----------------------------
-- Records of py_admin
-- ----------------------------
INSERT INTO `py_admin` VALUES ('1', '800001', '超级管理员', '758894b3e908de2074e26216e973e677', '1', '1mr2rerrinve3pcbk59funhji5', '0', '1', '1', '', '0', '1435324617', '1515724530', '1512378183', '1512378224', '127.0.0.1', '127.0.0.1');
-- ----------------------------
-- Table structure for `py_admin_log`
-- ----------------------------
DROP TABLE IF EXISTS `py_admin_log`;
CREATE TABLE `py_admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`module_name` varchar(255) NOT NULL,
`controller_name` varchar(255) NOT NULL,
`action_name` varchar(255) NOT NULL,
`note` varchar(255) NOT NULL,
`params` text COMMENT '参数',
`create_time` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_note` (`note`)
) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8 COMMENT='登录日志表';
-- ----------------------------
-- Records of py_admin_log
-- ----------------------------
-- ----------------------------
-- Table structure for `py_config`
-- ----------------------------
DROP TABLE IF EXISTS `py_config`;
CREATE TABLE `py_config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '配置ID',
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '配置名称',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '配置类型',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '配置说明',
`group` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '配置分组',
`extra` varchar(255) NOT NULL DEFAULT '' COMMENT '配置项',
`remark` varchar(100) NOT NULL COMMENT '配置说明',
`create_time` int(11) DEFAULT NULL COMMENT '创建时间',
`update_time` int(11) DEFAULT NULL COMMENT '更新时间',
`value` text NOT NULL COMMENT '配置值',
`orderby` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_name` (`name`),
KEY `type` (`type`),
KEY `group` (`group`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='系统配置表';
-- ----------------------------
-- Records of py_config
-- ----------------------------
INSERT INTO `py_config` VALUES ('1', 'SITE_TITLE', '1', '网站标题', '1', '', '网站标题前台显示标题', '1435324617', '1490864693', '凤鸣集团网站后台管理平台', '50');
INSERT INTO `py_config` VALUES ('2', 'SITE_DESCRIPTION', '1', '网站描述', '1', '', '网站搜索引擎描述', '1435324617', '1490601795', '凤鸣集团网站后台管理平台', '50');
INSERT INTO `py_config` VALUES ('3', 'SITE_KEYWORD', '1', '网站关键字', '1', '', '网站搜索引擎关键字', '1435324617', '1438265293', '凤鸣集团网站后台管理平台', '50');
INSERT INTO `py_config` VALUES ('4', 'SITE_CLOSE', '5', '开启站点', '1', '0:关闭,1:开启', '站点关闭后其他用户不能访问,管理员可以正常访问', '1435324617', '1439647872', '0', '50');
INSERT INTO `py_config` VALUES ('5', 'OPEN_REGISTER', '5', '会员注册', '3', '0:关闭,1:开启', '关闭后所有访客都不可进行注册', '1435324617', '1493790596', '1', '50');
INSERT INTO `py_config` VALUES ('11', 'CONFIG_GROUP_LIST', '4', '配置分组', '0', '', '', '1435324617', '1490781408', '1:基本,2:内容,3:用户,4:系统', '50');
INSERT INTO `py_config` VALUES ('12', 'CONFIG_TYPE_LIST', '4', '配置类型', '0', '', '', '1435324617', null, '1:数字,2:字符,3:文本,4:数组,5:枚举', '50');
INSERT INTO `py_config` VALUES ('13', 'VERIFY_CLOSE', '5', '开启验证码', '1', '0:关闭,1:开启', '验证码关闭后无需使用验证码', '1461200474', '1515666899', '0', '50');
-- ----------------------------
-- Table structure for `py_group`
-- ----------------------------
DROP TABLE IF EXISTS `py_group`;
CREATE TABLE `py_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`text` varchar(255) NOT NULL COMMENT '组别名称',
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '上级组别',
`remark` varchar(255) NOT NULL COMMENT '描述',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '禁用',
`orderby` smallint(5) NOT NULL DEFAULT '0' COMMENT '排序',
`create_time` int(11) DEFAULT NULL COMMENT '创建时间',
`update_time` int(11) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_locked` (`locked`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='角色表';
-- ----------------------------
-- Records of py_group
-- ----------------------------
INSERT INTO `py_group` VALUES ('1', '超级管理员', '0', '', '0', '50', '1435324617', '1435324617');
INSERT INTO `py_group` VALUES ('3', '管理员', '0', '', '0', '50', '1503539517', '1515659477');
-- ----------------------------
-- Table structure for `py_menu`
-- ----------------------------
DROP TABLE IF EXISTS `py_menu`;
CREATE TABLE `py_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(255) DEFAULT NULL COMMENT '菜单名',
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '父级ID',
`module` varchar(50) DEFAULT NULL COMMENT '模块名',
`controller` varchar(50) DEFAULT NULL COMMENT '控制器名称',
`method` varchar(50) DEFAULT NULL COMMENT '方法名称',
`other_method` varchar(255) DEFAULT NULL COMMENT '关联权限方法',
`display` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示到菜单',
`icon` varchar(50) DEFAULT NULL COMMENT '图标',
`orderby` smallint(5) NOT NULL DEFAULT '0' COMMENT '排序',
`create_time` int(10) unsigned NOT NULL DEFAULT '0',
`update_time` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='模块表';
-- ----------------------------
-- Records of py_menu
-- ----------------------------
INSERT INTO `py_menu` VALUES ('1', '权限', '0', 'admin', 'master', '*', '', '1', 'fa-power-off', '60', '1435324617', '1487318419');
INSERT INTO `py_menu` VALUES ('2', '系统', '0', 'admin', 'setting', '*', '', '1', 'fa-dashboard', '100', '1435324617', '1479806145');
INSERT INTO `py_menu` VALUES ('3', '系统设置', '2', 'admin', 'config', 'setting', '', '1', 'fa-plane', '7', '1435324617', '1448952211');
INSERT INTO `py_menu` VALUES ('5', '管理人员', '1', 'admin', 'admin', '*', '', '1', 'fa-user-md', '50', '1435324617', '1448677843');
INSERT INTO `py_menu` VALUES ('6', '角色管理', '1', 'admin', 'role', '*', '', '1', 'fa-user-secret', '50', '1435324617', '1447831484');
INSERT INTO `py_menu` VALUES ('7', '组织架构', '1', 'admin', 'group', '*', 'save', '1', 'fa-sitemap', '50', '1435324617', '1448589479');
INSERT INTO `py_menu` VALUES ('8', '功能管理', '1', 'admin', 'menu', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
-- ----------------------------
-- Table structure for `py_role`
-- ----------------------------
DROP TABLE IF EXISTS `py_role`;
CREATE TABLE `py_role` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色ID',
`text` varchar(255) DEFAULT NULL COMMENT '角色名称',
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '父级ID',
`remark` varchar(255) DEFAULT NULL COMMENT '描述',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '禁用',
`orderby` smallint(5) NOT NULL DEFAULT '0' COMMENT '排序',
`menu_id` text COMMENT '功能ID集合,逗号隔开',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_locked` (`locked`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='角色表';
-- ----------------------------
-- Records of py_role
-- ----------------------------
INSERT INTO `py_role` VALUES ('1', '超级管理员', '0', '', '0', '50', '1', '1435324617', '1490600242');
INSERT INTO `py_role` VALUES ('2', '管理员', '0', '', '0', '50', '84,86,92,87,88,93,94,89,95,96', '1503539475', '1515655050');
CREATE TABLE `py_company` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '公司ID',
`text` varchar(255) DEFAULT NULL COMMENT '公司名称',
`address` varchar(255) DEFAULT NULL COMMENT '公司地址',
`scale` varchar(255) DEFAULT NULL COMMENT '公司规模',
`welfare` varchar(255) DEFAULT NULL COMMENT '公司福利',
`industry` varchar(255) DEFAULT NULL COMMENT '所属行业',
`logo` varchar(255) DEFAULT NULL COMMENT 'logo',
`thumb` varchar(255) DEFAULT NULL COMMENT 'thumb',
`tel` varchar(255) DEFAULT NULL COMMENT '电话',
`qq` varchar(255) DEFAULT NULL COMMENT 'QQ',
`license` varchar(255) DEFAULT NULL COMMENT '营业执照照片',
`remark` text COMMENT '描述',
`audit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '审核',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '禁用',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_locked` (`locked`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='公司表';
INSERT INTO `py_menu` VALUES ('11', '公司管理', '0', 'admin', 'company', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
INSERT INTO `py_menu` VALUES ('12', '用户管理', '0', 'admin', 'user', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
INSERT INTO `py_menu` VALUES ('13', '内容管理', '0', 'admin', 'content', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
INSERT INTO `py_menu` VALUES ('', '公司审核', '11', 'admin', 'company', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_social_r` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '话题id',
`user_id` varchar(255) DEFAULT NULL COMMENT 'userid',
`title` varchar(255) DEFAULT NULL COMMENT '标题描述',
`content` text COMMENT '内容描述',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='话题表';
CREATE TABLE `py_social_a` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '答案id',
`user_id` varchar(255) DEFAULT NULL COMMENT 'userid',
`r_id` int(11) DEFAULT NULL COMMENT '话题id',
`content` text COMMENT '内容描述',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='答复表';
CREATE TABLE `py_social_approval` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '答案id',
`user_id` varchar(255) DEFAULT NULL COMMENT 'userid',
`r_id` int(11) DEFAULT NULL COMMENT '话题id',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='赞赏表';
CREATE TABLE `py_tag` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签id',
`type_id` int(11) DEFAULT NULL COMMENT '标签类型',
`text` varchar(255) DEFAULT NULL COMMENT '标签名称',
`order` smallint(5) DEFAULT '0' COMMENT '推荐顺序',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='标签表';
INSERT INTO `py_menu` VALUES ('', '标签', '13', 'admin', 'tag', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_tag_type` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签类型id',
`text` varchar(255) NOT NULL COMMENT '标签类型',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='标签类型表';
CREATE TABLE `py_report` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`tag_id` int(11) DEFAULT NULL COMMENT '标签id',
`tag_text` varchar(255) DEFAULT NULL COMMENT '标签名称',
`type_id` int(11) DEFAULT NULL COMMENT '类型id 公司举报|用户举报',
`c_id` int(11) DEFAULT NULL COMMENT '简历id|职位id',
`c_name` int(11) DEFAULT NULL COMMENT '用户真实姓名|公司名称',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='举报表';
INSERT INTO `py_menu` VALUES ('', '举报', '13', 'admin', 'report', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_msg_sys` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'd',
`title` varchar(255) DEFAULT NULL COMMENT '标题描述',
`thumb` varchar(255) DEFAULT NULL COMMENT '标题图片 ',
`content` text COMMENT '内容描述',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='系统消息表表';
INSERT INTO `py_menu` VALUES ('', '系统消息', '13', 'admin', 'msgSys', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_msg_user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`title` varchar(255) DEFAULT NULL COMMENT '标题',
`thumb` varchar(255) DEFAULT NULL COMMENT '头像',
`content` text COMMENT '内容',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户消息表';
CREATE TABLE `py_msg_feedback` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`title` varchar(255) DEFAULT NULL COMMENT '标题',
`content` text COMMENT '内容',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='意见反馈表';
INSERT INTO `py_menu` VALUES ('', '意见反馈', '13', 'admin', 'feedback', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_user_collection` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`position_id` int(11) DEFAULT 0 COMMENT '职位id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户收藏表';
CREATE TABLE `py_user_position` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`position_id` int(11) DEFAULT 0 COMMENT '职位id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='我看过的职位表';
CREATE TABLE `py_user_company` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`company_id` int(11) DEFAULT 0 COMMENT '公司id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='看过我的企业表';
CREATE TABLE `py_company_collection` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`resume_id` int(11) DEFAULT 0 COMMENT '简历id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='公司收藏表';
CREATE TABLE `py_company_position` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`company_id` int(11) DEFAULT 0 COMMENT '公司id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`latitude` decimal(12,8) DEFAULT NULL COMMENT '纬度',
`longitude` decimal(12,8) DEFAULT NULL COMMENT '经度',
`position_name` varchar(255) DEFAULT NULL COMMENT '职位名称',
`position_tag` varchar(255) DEFAULT NULL COMMENT '职位名称tag',
`place` varchar(255) DEFAULT NULL COMMENT '工作地点',
`duty` text COMMENT '岗位职责',
`salary` int(11) DEFAULT NULL COMMENT '招聘薪资tag_id',
`experience` int(11) DEFAULT NULL COMMENT '工作经验tag_id',
`education` int(11) DEFAULT NULL COMMENT '学历tag_id',
`order` smallint(5) DEFAULT '0' COMMENT '推荐顺序',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_name` (`position_tag`,`position_name`,`place`),
KEY `index_company` (`company_id`),
KEY `index_user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='公司职位表';
CREATE TABLE `py_user_resume` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`position_name` varchar(255) DEFAULT NULL COMMENT '职位名称',
`position_tag` varchar(255) DEFAULT NULL COMMENT '职位名称tag',
`status` varchar(255) DEFAULT NULL COMMENT '在职状态',
`tel` varchar(255) DEFAULT NULL COMMENT '联系方式',
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
`qq` varchar(255) DEFAULT NULL COMMENT 'QQ',
`thumb` varchar(255) DEFAULT NULL COMMENT '头像',
`realname` varchar(255) DEFAULT NULL COMMENT '真实姓名',
`sex` tinyint(3) NOT NULL DEFAULT '0' COMMENT '性别1,男,2女',
`birthday` varchar(255) DEFAULT NULL COMMENT '生日',
`work` text COMMENT '工作经验',
`schoole` text COMMENT '教育经历',
`appraisal` text COMMENT '自我评价',
`place` varchar(255) DEFAULT NULL COMMENT '工作地点',
`salary` int(11) DEFAULT NULL COMMENT '招聘薪资tag_id',
`experience` int(11) DEFAULT NULL COMMENT '工作经验tag_id',
`education` int(11) DEFAULT NULL COMMENT '学历tag_id',
`latitude` decimal(12,8) DEFAULT NULL COMMENT '纬度',
`longitude` decimal(12,8) DEFAULT NULL COMMENT '经度',
`order` smallint(5) DEFAULT '0' COMMENT '推荐顺序',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `index_name` (`position_tag`,`position_name`,`place`),
KEY `index_user` (`user_id`,`realname`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户简历表';
INSERT INTO `py_menu` VALUES ('', '职位管理', '11', 'admin', 'companyPosition', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
INSERT INTO `py_menu` VALUES ('', '简历管理', '12', 'admin', 'userResume', '*', '', '1', 'fa-cogs', '50', '1435324617', '1447831850');
CREATE TABLE `py_user_work` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`start_time` int(11) DEFAULT NULL,
`end_time` int(11) DEFAULT NULL,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) DEFAULT NULL,
`locked` tinyint(1) DEFAULT NULL,
`resume_id` int(11) unsigned DEFAULT NULL COMMENT '简历id',
`text` varchar(250) DEFAULT NULL COMMENT '职位名称',
`company` varchar(250) DEFAULT NULL COMMENT '公司名称',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `py_user_school` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`start_time` int(11) DEFAULT NULL,
`end_time` int(11) DEFAULT NULL,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) DEFAULT NULL,
`locked` tinyint(1) DEFAULT NULL,
`resume_id` int(11) unsigned DEFAULT NULL COMMENT '简历id',
`text` varchar(250) DEFAULT NULL COMMENT '专业名称',
`school` varchar(250) DEFAULT NULL COMMENT '学校名称',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `py_warrant` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`company_id` int(11) DEFAULT NULL COMMENT '公司idid',
`level_surplus` int(11) DEFAULT '0' COMMENT '剩余',
`level_text` varchar(255) DEFAULT NULL COMMENT '等级名称',
`level_id` int(11) DEFAULT NULL COMMENT '等级id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '公司用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司授权表';
CREATE TABLE `py_warrant_linked` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`company_id` int(11) DEFAULT NULL COMMENT '公司id',
`resume_id` int(11) DEFAULT NULL COMMENT '简历id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '公司用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司授权查看数据关联表';
CREATE TABLE `py_level` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`text` varchar(255) NOT NULL COMMENT '文本',
`num` int(11) DEFAULT '0' COMMENT '数量',
`price` int(11) DEFAULT NULL COMMENT '价格',
`remark` text COMMENT '描述',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='等级(商品)表';
CREATE TABLE `py_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`text` varchar(255) NOT NULL COMMENT '文本(名称)',
`product_id` int(11) NOT NULL COMMENT '关联商品id',
`num` int(11) DEFAULT '0' COMMENT '数量',
`price` int(11) DEFAULT NULL COMMENT '价格',
`pay_type` varchar(255) NOT NULL COMMENT '支付方式',
`pay_status` tinyint(3) DEFAULT '0' COMMENT '支付状态0.未付款|.已付款',
`remark` text COMMENT '描述',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '公司用户id',
`locked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否锁定',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单表';
|
-- MySQL dump 10.14 Distrib 5.5.65-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: corporate
-- ------------------------------------------------------
-- Server version 5.7.31-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `cor_delivery`
--
DROP TABLE IF EXISTS `cor_delivery`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_delivery` (
`id` bigint(30) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`order_no` varchar(32) DEFAULT NULL COMMENT '订单号',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`deliverer_id` bigint(11) DEFAULT NULL COMMENT '交付人,即司机账号的USER_ID字段的值',
`scooter_id` bigint(11) DEFAULT NULL COMMENT 'scooterId',
`recipient` varchar(32) DEFAULT NULL COMMENT '收件人',
`recipient_email` varchar(64) DEFAULT NULL COMMENT '收件人邮箱',
`country_code` varchar(64) DEFAULT NULL COMMENT '手机国家区号',
`recipient_tel` varchar(32) DEFAULT NULL COMMENT '收件人电话',
`recipient_address` varchar(256) DEFAULT NULL COMMENT '收件人地址',
`longitude` decimal(32,10) DEFAULT NULL COMMENT '经度',
`latitude` decimal(32,10) DEFAULT NULL COMMENT '纬度',
`geohash` varchar(32) DEFAULT NULL COMMENT 'GeoHash',
`house_info` varchar(32) DEFAULT NULL COMMENT '门牌信息',
`parcel_quantity` int(11) DEFAULT NULL COMMENT '包裹数量',
`goods_inventory` varchar(128) DEFAULT NULL COMMENT '商品清单',
`result` varchar(32) DEFAULT NULL COMMENT '订单服务结果 按时、延迟、取消 ONTIME、DELAY、CANCEl',
`status` varchar(32) DEFAULT NULL COMMENT '订单状态:PENDING待配送, DELIVERING正在配送,REJECTED拒绝,TIMEOUT配送超时,COMPLETE已送达,CANCEL取消失败;PC订单状态显示:待配送Pending,配送中In progress,拒单Declined,配送超时Overdue,超时完成Delayed,已送达Delivered,取消订单Cancelled',
`planned_time` varchar(24) DEFAULT NULL COMMENT '安排配送时间',
`timeout_expectde` varchar(24) DEFAULT NULL COMMENT '超时预警值,单位分钟',
`time_out` datetime DEFAULT NULL COMMENT '超时预警时间',
`etd` datetime DEFAULT NULL COMMENT '预计开始时间',
`atd` datetime DEFAULT NULL COMMENT '实际开始时间',
`eta` datetime DEFAULT NULL COMMENT '预计送达时间',
`ata` datetime DEFAULT NULL COMMENT '实际送达时间',
`driven_mileage` decimal(32,10) DEFAULT NULL COMMENT '骑行里程',
`driven_duration` int(11) DEFAULT NULL COMMENT '骑行时长',
`co2` decimal(32,10) DEFAULT NULL COMMENT '二氧化碳排放量',
`savings` decimal(32,10) DEFAULT NULL COMMENT '节省金额',
`statistics` varchar(32) DEFAULT '0' COMMENT '0 标识未统计,1 标识 已统计',
`label` varchar(32) DEFAULT NULL COMMENT '标签',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='递送单';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_delivery_trace`
--
DROP TABLE IF EXISTS `cor_delivery_trace`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_delivery_trace` (
`id` bigint(25) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`delivery_id` bigint(20) DEFAULT NULL COMMENT 'deliveryId',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`user_id` bigint(11) DEFAULT NULL COMMENT 'userId,即delivery表中的交付人id同时是司机的user_id',
`status` varchar(64) DEFAULT NULL COMMENT '订单状态',
`event` varchar(32) DEFAULT NULL COMMENT '事件',
`reason` varchar(128) DEFAULT NULL COMMENT '订单取消时,存储取消原因;订单拒绝时,存储拒绝原因;',
`event_time` datetime DEFAULT NULL COMMENT '事件时间',
`longitude` decimal(32,10) DEFAULT NULL COMMENT '经度',
`latitude` decimal(32,10) DEFAULT NULL COMMENT '维度',
`geohash` varchar(32) DEFAULT NULL COMMENT 'GEOHASH',
`scooter_id` bigint(32) DEFAULT NULL COMMENT 'scooterId',
`scooter_longitude` decimal(32,10) DEFAULT NULL COMMENT 'scooter经度',
`scooter_latitude` decimal(32,10) DEFAULT NULL COMMENT 'scooter维度',
`scooter_location_geohash` varchar(32) DEFAULT NULL COMMENT 'scooterGEOHASH',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Delivery操作跟踪表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_driver`
--
DROP TABLE IF EXISTS `cor_driver`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_driver` (
`id` bigint(11) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`user_id` bigint(20) NOT NULL COMMENT 'USER_ID',
`driving_license` varchar(256) DEFAULT NULL COMMENT '驾照',
`driver_license_level` varchar(64) DEFAULT NULL COMMENT '驾照等级',
`score` int(11) DEFAULT '3' COMMENT '评分',
`status` varchar(32) DEFAULT NULL COMMENT '状态 VACATION 休假,WORKING 上班中OFFWORK 下班中',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='司机';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_driver_ride_stat`
--
DROP TABLE IF EXISTS `cor_driver_ride_stat`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_driver_ride_stat` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
`driver_id` bigint(20) NOT NULL COMMENT '司机主键',
`total_duration` bigint(20) DEFAULT NULL COMMENT '总时长',
`co2_total` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳总量',
`co2_increment` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳增量值',
`saved_money` decimal(32,4) DEFAULT NULL COMMENT '节省金额',
`svg_speed` decimal(32,2) DEFAULT NULL COMMENT '平均时速',
`read_time` datetime DEFAULT NULL COMMENT '读取时间',
`total_mileage` decimal(32,2) DEFAULT NULL COMMENT '总公里数',
`first_ride_time` datetime DEFAULT NULL COMMENT '首次骑行时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`update_by` bigint(20) DEFAULT NULL COMMENT '更新人',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='司机骑行统计数据';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_driver_ride_stat_detail`
--
DROP TABLE IF EXISTS `cor_driver_ride_stat_detail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_driver_ride_stat_detail` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
`biz_type` varchar(16) DEFAULT NULL COMMENT '业务类型',
`biz_id` bigint(20) DEFAULT NULL COMMENT '业务id',
`driver_id` bigint(20) NOT NULL COMMENT '司机主键',
`duration` bigint(20) DEFAULT NULL COMMENT '本次时长',
`co2_history_total` decimal(32,4) DEFAULT NULL COMMENT 'co2 历史总量',
`co2_increment` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳增量',
`svg_speed` decimal(32,4) DEFAULT NULL COMMENT '本次平均时速',
`mileage` decimal(32,4) DEFAULT NULL COMMENT '本次总公里数',
`saved_money` decimal(32,4) DEFAULT NULL COMMENT '本次节省金额',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`update_by` bigint(20) DEFAULT NULL COMMENT '更新人',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='司机骑行统计数据明细';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_driver_scooter`
--
DROP TABLE IF EXISTS `cor_driver_scooter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_driver_scooter` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`driver_id` bigint(11) DEFAULT NULL COMMENT '司机ID',
`scooter_id` bigint(11) DEFAULT NULL COMMENT '车辆ID',
`begin_time` datetime DEFAULT NULL COMMENT '车辆分配开始时间',
`end_time` datetime DEFAULT NULL COMMENT '车辆归还时间',
`status` varchar(32) DEFAULT NULL COMMENT '状态 1 使用中,2 已还车',
`mileage` varchar(255) DEFAULT NULL COMMENT '行驶里程',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='司机分配车辆表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_driver_scooter_history`
--
DROP TABLE IF EXISTS `cor_driver_scooter_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_driver_scooter_history` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`driver_id` bigint(11) DEFAULT NULL COMMENT '司机ID',
`scooter_id` bigint(11) DEFAULT NULL COMMENT '车辆ID',
`begin_time` datetime DEFAULT NULL COMMENT '车辆分配开始时间',
`end_time` datetime DEFAULT NULL COMMENT '车辆归还时间',
`status` varchar(32) DEFAULT NULL COMMENT '状态 1 使用中,2 已还车',
`mileage` varchar(255) DEFAULT NULL COMMENT '行驶里程',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='司机分配车辆表历史记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_express_delivery`
--
DROP TABLE IF EXISTS `cor_express_delivery`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_express_delivery` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户表',
`scooter_Id` bigint(20) DEFAULT NULL,
`status` varchar(32) NOT NULL COMMENT '状态,WAITING 待配送 SHIPPING 正在配送 COMPLETED 已配送 REFUSED 失败',
`result` varchar(32) DEFAULT NULL COMMENT '订单服务结果',
`driver_id` bigint(20) DEFAULT NULL COMMENT '司机ID',
`order_sum` int(11) NOT NULL DEFAULT '0' COMMENT '订单总数',
`order_complete_num` int(11) NOT NULL DEFAULT '0' COMMENT '订单完成数',
`delivery_date` date DEFAULT NULL COMMENT '排单日期',
`delivery_start_time` datetime DEFAULT NULL COMMENT '开始配送时间',
`delivery_end_time` datetime DEFAULT NULL COMMENT '结束配送时间',
`driven_mileage` decimal(32,10) NOT NULL DEFAULT '0.0000000000' COMMENT '行驶里程数',
`driven_duration` int(11) DEFAULT '0' COMMENT '行驶时长',
`co2` decimal(32,10) DEFAULT '0.0000000000' COMMENT '二氧化碳排放量',
`savings` decimal(32,10) DEFAULT '0.0000000000' COMMENT '节省金额',
`create_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_by` bigint(20) DEFAULT '0' COMMENT '更新人',
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递递送单';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_express_delivery_detail`
--
DROP TABLE IF EXISTS `cor_express_delivery_detail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_express_delivery_detail` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) NOT NULL COMMENT '租户id',
`express_delivery_id` bigint(20) NOT NULL COMMENT '递送单主键',
`express_order_id` bigint(20) NOT NULL COMMENT '订单主键',
`status` varchar(64) NOT NULL COMMENT 'delivery子订单状态',
`parcel_quantity` int(11) NOT NULL DEFAULT '1' COMMENT '包裹数',
`etd` datetime DEFAULT NULL COMMENT '预计开始时间 快递业务没有 暂时做冗余字段',
`ata` datetime DEFAULT NULL COMMENT '实际到达时间',
`atd` datetime DEFAULT NULL COMMENT '实际开始时间',
`eta` datetime DEFAULT NULL COMMENT '预计送达时间',
`priority_sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序优先级,多个订单分配同一个配送单,所需先后顺序',
`created_by` bigint(20) NOT NULL COMMENT '创建人',
`created_time` datetime NOT NULL COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL COMMENT '更新人',
`updated_time` datetime NOT NULL COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递订单子表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_express_order`
--
DROP TABLE IF EXISTS `cor_express_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_express_order` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) NOT NULL COMMENT '租户id',
`batch_no` varchar(32) NOT NULL COMMENT '批次号',
`order_no` varchar(32) NOT NULL COMMENT '订单号',
`status` varchar(32) NOT NULL COMMENT '状态,待分配UNASGN,已分配ASGN,已完成COMPLETE',
`recipient_country` varchar(64) DEFAULT NULL COMMENT '收货方国家',
`recipient_province` varchar(64) DEFAULT NULL COMMENT '收件方省份',
`recipient_city` varchar(64) DEFAULT NULL COMMENT '收件方城市',
`recipient_postcode` varchar(32) NOT NULL COMMENT '收件方邮编',
`recipient_address` varchar(255) DEFAULT NULL COMMENT '收件方详细地址',
`recipient_latitude` decimal(32,10) DEFAULT '0.0000000000' COMMENT '收件方纬度',
`recipient_longitude` decimal(32,10) DEFAULT '0.0000000000' COMMENT '收货方经度',
`recipient_geohash` varchar(32) DEFAULT NULL COMMENT 'GeoHash',
`customer_reference` varchar(64) DEFAULT NULL COMMENT '客户id,等价于收件人名称',
`recipient_name` varchar(64) DEFAULT NULL COMMENT '收件人',
`recipient_company` varchar(128) DEFAULT NULL COMMENT '收件方公司,个人时为空',
`recipient_phone` varchar(16) DEFAULT NULL COMMENT '收件人电话',
`recipient_mail` varchar(64) DEFAULT NULL COMMENT '收件方邮箱',
`recipient_notes` varchar(255) DEFAULT NULL COMMENT '收件方备注',
`sender_country` varchar(64) DEFAULT NULL COMMENT '发货方国家',
`sender_city` varchar(64) DEFAULT NULL COMMENT '发货方城市',
`sender_province` varchar(64) DEFAULT NULL COMMENT '发货方省份',
`sender_postcode` varchar(32) DEFAULT NULL COMMENT '发货方邮编',
`sender_address` varchar(255) DEFAULT NULL COMMENT '发货方详细地址',
`sender_latitude` decimal(32,10) DEFAULT '0.0000000000' COMMENT '发货方纬度',
`sender_longitude` decimal(32,10) DEFAULT '0.0000000000' COMMENT '发货方经度',
`sender_geohash` varchar(32) DEFAULT NULL COMMENT 'Geohash',
`sender_company` varchar(64) DEFAULT NULL COMMENT '发货方公司,个人时为空',
`sender_name` varchar(64) DEFAULT NULL COMMENT '发货人',
`sender_phone` varchar(16) DEFAULT NULL COMMENT '发货人手机',
`sender_mail` varchar(64) DEFAULT NULL COMMENT '发货人邮箱',
`sender_notes` varchar(255) DEFAULT NULL COMMENT '发货方备注',
`parcel_quantity` int(11) DEFAULT '1' COMMENT '包裹数',
`assign_flag` tinyint(1) DEFAULT '0' COMMENT '是否已分配',
`assign_time` datetime DEFAULT NULL COMMENT '分配递送时间',
`vehicle_type` varchar(32) DEFAULT NULL COMMENT '车辆类型',
`expect_time_begin` datetime DEFAULT NULL COMMENT '期望送达时间,注意这是时间段',
`expect_time_end` datetime DEFAULT NULL COMMENT '期望送达时间,注意这是时间段',
`general_notes` varchar(255) DEFAULT NULL COMMENT '其他备注',
`denial_reason` varchar(255) DEFAULT NULL COMMENT '拒绝原因',
`delivered_time` datetime DEFAULT NULL COMMENT '订单完成时间',
`created_by` bigint(20) NOT NULL COMMENT '创建人',
`created_time` datetime NOT NULL COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL COMMENT '更新人',
`updated_time` datetime NOT NULL COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递订单表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_express_order_trace`
--
DROP TABLE IF EXISTS `cor_express_order_trace`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_express_order_trace` (
`id` bigint(25) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`express_delivery_id` bigint(20) DEFAULT NULL COMMENT 'deliveryId',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`express_order_id` bigint(11) DEFAULT NULL COMMENT '完成时订单id',
`driver_id` bigint(11) DEFAULT NULL COMMENT '交付人id',
`status` varchar(64) DEFAULT NULL COMMENT '订单状态',
`event` varchar(32) DEFAULT NULL COMMENT '事件',
`reason` varchar(128) DEFAULT NULL COMMENT '订单取消时,存储取消原因;订单拒绝时,存储拒绝原因;',
`event_time` datetime DEFAULT NULL COMMENT '事件时间',
`longitude` decimal(32,10) DEFAULT NULL COMMENT '经度',
`latitude` decimal(32,10) DEFAULT NULL COMMENT '维度',
`geohash` varchar(32) DEFAULT NULL COMMENT 'GEOHASH',
`scooter_id` bigint(32) DEFAULT NULL COMMENT 'scooterId',
`scooter_longitude` decimal(32,10) DEFAULT NULL COMMENT 'scooter经度',
`scooter_latitude` decimal(32,10) DEFAULT NULL COMMENT 'scooter维度',
`scooter_geohash` varchar(32) DEFAULT NULL COMMENT 'scooterGEOHASH',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递订单操作跟踪表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_rfid`
--
DROP TABLE IF EXISTS `cor_rfid`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_rfid` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`sn` varchar(32) DEFAULT NULL COMMENT '序列号',
`secret_key` varchar(32) DEFAULT NULL COMMENT '秘钥',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '门店Id',
`scooter_id` bigint(20) DEFAULT NULL COMMENT '已分配:allocation已写卡:available已失效:unavailable(暂时不要)空闲:FREE',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`status` varchar(32) DEFAULT NULL COMMENT '已分配:allocation已写卡:available已失效:unavailable(暂时不要)空闲:FREE',
`created_by` bigint(11) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(11) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='RFID表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_scooter_ride_stat`
--
DROP TABLE IF EXISTS `cor_scooter_ride_stat`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_scooter_ride_stat` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
`scooter_id` bigint(20) NOT NULL COMMENT '车辆主键',
`total_duration` bigint(20) DEFAULT NULL COMMENT '总时长',
`co2_total` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳总量',
`co2_increment` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳增量值',
`saved_money` decimal(32,4) DEFAULT NULL COMMENT '节省金额',
`svg_speed` decimal(32,4) DEFAULT NULL COMMENT '平均时速',
`read_time` datetime DEFAULT NULL COMMENT '读取时间',
`total_mileage` decimal(32,4) DEFAULT NULL COMMENT '总公里数',
`first_ride_time` datetime DEFAULT NULL COMMENT '首次骑行时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`update_by` bigint(20) DEFAULT NULL COMMENT '更新人',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='车辆骑行统计数据';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_scooter_ride_stat_detail`
--
DROP TABLE IF EXISTS `cor_scooter_ride_stat_detail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_scooter_ride_stat_detail` (
`id` bigint(20) NOT NULL COMMENT '主键',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
`biz_type` varchar(16) DEFAULT NULL COMMENT '业务类型',
`biz_id` bigint(20) DEFAULT NULL COMMENT '业务id',
`scooter_id` bigint(20) NOT NULL COMMENT '车辆主键',
`duration` bigint(20) DEFAULT NULL COMMENT '本次时长',
`co2_history_total` decimal(32,4) DEFAULT NULL COMMENT 'co2 历史总量',
`co2_increment` decimal(32,4) DEFAULT NULL COMMENT '二氧化碳增量',
`svg_speed` decimal(32,4) DEFAULT NULL COMMENT '本次平均时速',
`mileage` decimal(32,4) DEFAULT NULL COMMENT '本次总公里数',
`saved_money` decimal(32,4) DEFAULT NULL COMMENT '本次节省金额',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`update_by` bigint(20) DEFAULT NULL COMMENT '更新人',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='车辆骑行统计数据明细';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_tenant_scooter`
--
DROP TABLE IF EXISTS `cor_tenant_scooter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_tenant_scooter` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(20) DEFAULT NULL COMMENT 'tenantId',
`model` varchar(255) DEFAULT NULL COMMENT '车辆型号',
`scooter_id` bigint(32) DEFAULT NULL COMMENT '车辆ID',
`longitule` decimal(32,10) DEFAULT NULL COMMENT '车辆经度',
`latitude` decimal(32,10) DEFAULT NULL COMMENT '车辆纬度',
`license_plate` varchar(16) DEFAULT NULL COMMENT '车牌号',
`license_plate_picture` varchar(128) DEFAULT NULL COMMENT '车牌号图片',
`status` varchar(32) NOT NULL DEFAULT 'AVAILABLE' COMMENT '车辆状态 AVAILABLE;CHARGING;REPAIR;FAULT;USEING',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='租户车辆表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cor_user_profile`
--
DROP TABLE IF EXISTS `cor_user_profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cor_user_profile` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`dr` int(20) DEFAULT '0' COMMENT '逻辑删除标识 0正常 1删除',
`tenant_id` bigint(11) DEFAULT NULL COMMENT '租户ID',
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`is_master` int(11) DEFAULT '0' COMMENT '是否主账号:1-主账号,0-子账号',
`picture` varchar(2048) DEFAULT NULL COMMENT '照片',
`first_name` varchar(32) DEFAULT NULL COMMENT '名',
`last_name` varchar(32) DEFAULT NULL COMMENT '姓',
`full_name` varchar(32) DEFAULT NULL COMMENT '全名',
`nickname` varchar(255) DEFAULT NULL COMMENT '昵称',
`email_1` varchar(64) DEFAULT NULL COMMENT '邮箱',
`email_2` varchar(64) DEFAULT NULL COMMENT '邮箱',
`email_3` varchar(64) DEFAULT NULL COMMENT '邮箱',
`tel_number_1` varchar(32) DEFAULT NULL COMMENT '电话号',
`country_code_1` varchar(64) DEFAULT NULL COMMENT '国家编码如+86',
`tel_number_2` varchar(32) DEFAULT NULL COMMENT '电话号',
`country_code_2` varchar(64) DEFAULT NULL COMMENT '国家编码如+86',
`tel_number_3` varchar(32) DEFAULT NULL COMMENT '电话号',
`country_code_3` varchar(64) DEFAULT NULL COMMENT '国家编码如+86',
`gender` varchar(32) DEFAULT NULL COMMENT '性别',
`birthday` date DEFAULT NULL COMMENT '生日',
`CERTIFICATE_TYPE` varchar(32) DEFAULT NULL COMMENT '证件类型1身份证,2驾驶证,3护照',
`CERTIFICATE_NEGATIVE_ANNEX` varchar(128) DEFAULT NULL COMMENT '证件反面图片',
`CERTIFICATE_POSITIVE_ANNEX` varchar(128) DEFAULT NULL COMMENT '证件正面图片',
`role` varchar(32) DEFAULT NULL COMMENT '角色 DRIVER-司机;MANAGE-管理者',
`page_boot_tips` tinyint(1) DEFAULT '1' COMMENT '页面引导提示开关,默认true 打开 0关闭 1开启',
`place_birth` varchar(255) DEFAULT NULL COMMENT '出生地',
`join_date` date DEFAULT NULL COMMENT '加入日期',
`time_zone` varchar(16) DEFAULT NULL COMMENT '时区',
`created_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建人',
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新人',
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`def1` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def2` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def3` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def5` varchar(64) DEFAULT NULL COMMENT '冗余字段',
`def6` double(20,0) DEFAULT '0' COMMENT '冗余字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-10-20 7:36:25
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50527
Source Host : localhost:3306
Source Database : spcms
Target Server Type : MYSQL
Target Server Version : 50527
File Encoding : 65001
Date: 2014-05-21 22:27:26
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `sp_access`
-- ----------------------------
DROP TABLE IF EXISTS `sp_access`;
CREATE TABLE `sp_access` (
`role_id` smallint(6) unsigned NOT NULL,
`g` varchar(20) NOT NULL COMMENT '项目',
`m` varchar(20) NOT NULL COMMENT '模块',
`a` varchar(20) NOT NULL COMMENT '方法',
KEY `groupId` (`role_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_ad`
-- ----------------------------
DROP TABLE IF EXISTS `sp_ad`;
CREATE TABLE `sp_ad` (
`ad_id` bigint(20) NOT NULL AUTO_INCREMENT,
`ad_name` varchar(255) NOT NULL,
`ad_content` text,
`status` int(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`ad_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_ad
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_admin_panel`
-- ----------------------------
DROP TABLE IF EXISTS `sp_admin_panel`;
CREATE TABLE `sp_admin_panel` (
`menuid` mediumint(8) unsigned NOT NULL,
`userid` mediumint(8) unsigned NOT NULL DEFAULT '0',
`name` char(32) DEFAULT NULL,
`url` char(255) DEFAULT NULL,
`datetime` int(10) unsigned DEFAULT '0',
UNIQUE KEY `userid` (`menuid`,`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_admin_panel
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_asset`
-- ----------------------------
DROP TABLE IF EXISTS `sp_asset`;
CREATE TABLE `sp_asset` (
`aid` bigint(20) NOT NULL AUTO_INCREMENT,
`_unique` varchar(14) NOT NULL,
`filename` varchar(50) DEFAULT NULL,
`filesize` int(11) DEFAULT NULL,
`filepath` varchar(200) NOT NULL,
`uploadtime` int(11) NOT NULL,
`status` int(2) NOT NULL DEFAULT '1',
`meta` text,
`suffix` varchar(50) DEFAULT NULL,
`download_times` int(6) NOT NULL,
PRIMARY KEY (`aid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_asset
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_comments`
-- ----------------------------
DROP TABLE IF EXISTS `sp_comments`;
CREATE TABLE `sp_comments` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_table` varchar(100) NOT NULL,
`post_id` int(11) unsigned NOT NULL DEFAULT '0',
`uid` int(11) NOT NULL DEFAULT '0',
`to_uid` int(11) NOT NULL DEFAULT '0',
`full_name` varchar(50) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`createtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`content` text NOT NULL,
`type` smallint(1) NOT NULL DEFAULT '1',
`parentid` bigint(20) unsigned NOT NULL DEFAULT '0',
`status` smallint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `comment_post_ID` (`post_id`),
KEY `comment_approved_date_gmt` (`status`),
KEY `comment_parent` (`parentid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_guestbook`
-- ----------------------------
DROP TABLE IF EXISTS `sp_guestbook`;
CREATE TABLE `sp_guestbook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`full_name` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`msg` text NOT NULL,
`createtime` datetime NOT NULL,
`status` smallint(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_guestbook
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_links`
-- ----------------------------
DROP TABLE IF EXISTS `sp_links`;
CREATE TABLE `sp_links` (
`link_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`link_url` varchar(255) NOT NULL DEFAULT '',
`link_name` varchar(255) NOT NULL DEFAULT '',
`link_image` varchar(255) DEFAULT '',
`link_target` varchar(25) NOT NULL DEFAULT '_blank',
`link_description` text NOT NULL,
`link_status` int(2) NOT NULL DEFAULT '1',
`link_rating` int(11) NOT NULL DEFAULT '0',
`link_rel` varchar(255) DEFAULT '',
`listorder` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`link_id`),
KEY `link_visible` (`link_status`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_links
-- ----------------------------
INSERT INTO `sp_links` VALUES ('1', 'http://www.thinkcmf.com', 'ThinkCMF', '', '_blank', '', '1', '0', '', '0');
-- ----------------------------
-- Table structure for `sp_members`
-- ----------------------------
DROP TABLE IF EXISTS `sp_members`;
CREATE TABLE `sp_members` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_login_name` varchar(25) NOT NULL,
`user_pass` varchar(64) NOT NULL DEFAULT '',
`user_nickname` varchar(50) NOT NULL,
`user_pic_url` varchar(300) NOT NULL,
`user_pic_assetid` int(8) NOT NULL,
`sign_words` varchar(200) NOT NULL,
`user_email` varchar(100) NOT NULL DEFAULT '',
`last_login_ip` varchar(16) NOT NULL,
`last_login_time` int(12) NOT NULL,
`create_time` int(12) NOT NULL,
`user_activation_key` varchar(60) NOT NULL DEFAULT '',
`user_status` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
KEY `user_nicename` (`user_nickname`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_members
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sp_menu`;
CREATE TABLE `sp_menu` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`parentid` smallint(6) unsigned NOT NULL DEFAULT '0',
`app` char(20) NOT NULL COMMENT '应用名称app',
`model` char(20) NOT NULL DEFAULT '',
`action` char(20) NOT NULL DEFAULT '',
`data` char(50) NOT NULL DEFAULT '',
`type` tinyint(1) NOT NULL DEFAULT '0',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0',
`name` varchar(50) NOT NULL DEFAULT '',
`icon` varchar(50) DEFAULT NULL,
`remark` varchar(255) NOT NULL DEFAULT '',
`listorder` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '排序ID',
PRIMARY KEY (`id`),
KEY `status` (`status`),
KEY `parentid` (`parentid`),
KEY `model` (`model`)
) ENGINE=MyISAM AUTO_INCREMENT=567 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_menu
-- ----------------------------
INSERT INTO `sp_menu` VALUES ('239', '0', 'Admin', 'Setting', 'default', '', '0', '1', '设置', 'cogs', '', '0');
INSERT INTO `sp_menu` VALUES ('308', '307', 'Wx', 'Answeradmin', 'index', '', '1', '1', '默认回复', '', '', '0');
INSERT INTO `sp_menu` VALUES ('309', '307', 'Wx', 'Answeradmin', 'fixed', '', '1', '1', '固定回复', '', '', '0');
INSERT INTO `sp_menu` VALUES ('310', '307', 'Wx', 'Answeradmin', 'robot', '', '1', '1', '智能回复', '', '', '0');
INSERT INTO `sp_menu` VALUES ('51', '0', 'Admin', 'Content', 'default', '', '0', '1', '内容管理', 'th', '', '10');
INSERT INTO `sp_menu` VALUES ('307', '305', 'Wx', 'Answeradmin', 'index', '', '1', '1', '回复设置', '', '', '20');
INSERT INTO `sp_menu` VALUES ('245', '51', 'Admin', 'Term', 'index', '', '0', '1', '分类管理', '', '', '2');
INSERT INTO `sp_menu` VALUES ('314', '312', 'Wx', 'Collectadmin', 'answer', '', '1', '1', '回复数量', '', '', '0');
INSERT INTO `sp_menu` VALUES ('299', '260', 'Api', 'Oauthadmin', 'setting', '', '1', '1', '第三方登陆', 'leaf', '', '4');
INSERT INTO `sp_menu` VALUES ('252', '239', 'Admin', 'Setting', 'userdefault', '', '0', '1', '个人信息', '', '', '0');
INSERT INTO `sp_menu` VALUES ('253', '252', 'Admin', 'User', 'userinfo', '', '1', '1', '修改信息', '', '', '0');
INSERT INTO `sp_menu` VALUES ('254', '252', 'Admin', 'Setting', 'password', '', '1', '1', '修改密码', '', '', '0');
INSERT INTO `sp_menu` VALUES ('313', '312', 'Wx', 'Collectadmin', 'location', '', '1', '1', '地理位置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('260', '0', 'Admin', 'Extension', 'default', '', '0', '1', '扩展工具', 'cloud', '', '30');
INSERT INTO `sp_menu` VALUES ('262', '260', 'Admin', 'Slide', 'default', '', '1', '1', '幻灯片', '', '', '1');
INSERT INTO `sp_menu` VALUES ('264', '262', 'Admin', 'Slide', 'index', '', '1', '1', '幻灯片管理', '', '', '0');
INSERT INTO `sp_menu` VALUES ('265', '260', 'Admin', 'Ad', 'index', '', '1', '1', '网站广告', '', '', '2');
INSERT INTO `sp_menu` VALUES ('317', '312', 'Wx', 'Collectadmin', 'users', '', '1', '1', '关注趋势', '', '', '0');
INSERT INTO `sp_menu` VALUES ('316', '312', 'Wx', 'Collectadmin', 'userlist', '', '1', '1', '粉丝列表', '', '', '0');
INSERT INTO `sp_menu` VALUES ('268', '262', 'Admin', 'Slidecat', 'index', '', '1', '1', '幻灯片分类', '', '', '0');
INSERT INTO `sp_menu` VALUES ('270', '260', 'Admin', 'Link', 'index', '', '0', '1', '友情链接', '', '', '3');
INSERT INTO `sp_menu` VALUES ('312', '305', 'Wx', 'Collectadmin', 'location', '', '1', '1', '数据分析', '', '', '30');
INSERT INTO `sp_menu` VALUES ('277', '51', 'Admin', 'Page', 'index', '', '1', '1', '页面管理', '', '', '3');
INSERT INTO `sp_menu` VALUES ('301', '300', 'Admin', 'Page', 'recyclebin', '', '1', '1', '页面回收', '', '', '1');
INSERT INTO `sp_menu` VALUES ('302', '300', 'Admin', 'Post', 'recyclebin', '', '1', '1', '文章回收', '', '', '0');
INSERT INTO `sp_menu` VALUES ('305', '0', 'Wx', 'Indexadmin', 'default', '', '1', '1', '微信管理', 'tags', '', '20');
INSERT INTO `sp_menu` VALUES ('300', '51', 'Admin', 'Recycle', 'default', '', '1', '1', '回收站', '', '', '4');
INSERT INTO `sp_menu` VALUES ('284', '239', 'Admin', 'Setting', 'site', '', '1', '1', '网站信息', '', '', '0');
INSERT INTO `sp_menu` VALUES ('285', '51', 'Admin', 'Post', 'index', '', '1', '1', '文章管理', '', '', '1');
INSERT INTO `sp_menu` VALUES ('286', '0', 'Member', 'Indexadmin', 'default', '', '1', '1', '用户管理', 'group', '', '0');
INSERT INTO `sp_menu` VALUES ('287', '289', 'Member', 'Indexadmin', 'index', '', '1', '1', '本站用户', 'leaf', '', '0');
INSERT INTO `sp_menu` VALUES ('288', '289', 'Api', 'Oauthadmin', 'index', '', '1', '1', '第三方用户', 'leaf', '', '0');
INSERT INTO `sp_menu` VALUES ('289', '286', 'Member', 'Indexadmin', 'default1', '', '1', '1', '用户组', '', '', '0');
INSERT INTO `sp_menu` VALUES ('290', '286', 'Member', 'Indexadmin', 'default3', '', '1', '1', '管理组', '', '', '0');
INSERT INTO `sp_menu` VALUES ('291', '290', 'Admin', 'Rbac', 'index', '', '1', '1', '角色管理', '', '', '0');
INSERT INTO `sp_menu` VALUES ('292', '290', 'Admin', 'User', 'index', '', '1', '1', '管理员', '', '', '0');
INSERT INTO `sp_menu` VALUES ('293', '0', 'Admin', 'Menu', 'default', '', '1', '1', '菜单管理', 'list', '', '0');
INSERT INTO `sp_menu` VALUES ('294', '293', 'Admin', 'Navcat', 'default1', '', '1', '1', '前台菜单', '', '', '0');
INSERT INTO `sp_menu` VALUES ('295', '294', 'Admin', 'Nav', 'index', '', '1', '1', '菜单管理', '', '', '0');
INSERT INTO `sp_menu` VALUES ('296', '294', 'Admin', 'Navcat', 'index', '', '1', '1', '菜单分类', '', '', '0');
INSERT INTO `sp_menu` VALUES ('297', '293', 'Admin', 'Menu', 'index', '', '1', '1', '后台菜单', '', '', '0');
INSERT INTO `sp_menu` VALUES ('298', '239', 'Admin', 'Setting', 'clearcache', '', '1', '1', '清除缓存', '', '', '1');
INSERT INTO `sp_menu` VALUES ('318', '305', 'Wx', 'Menuadmin', 'index', '', '1', '1', '菜单管理', '', '', '30');
INSERT INTO `sp_menu` VALUES ('319', '260', 'Admin', 'Backup', 'default', '', '1', '1', '备份管理', '', '', '0');
INSERT INTO `sp_menu` VALUES ('480', '292', 'Admin', 'User', 'delete', '', '1', '0', '删除管理员', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('479', '292', 'Admin', 'User', 'edit', '', '1', '0', '编辑管理员', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('478', '292', 'Admin', 'User', 'add', '', '1', '0', '添加管理员', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('477', '245', 'Admin', 'Term', 'delete', '', '1', '0', '删除分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('476', '245', 'Admin', 'Term', 'edit', '', '1', '0', '编辑分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('475', '245', 'Admin', 'Term', 'add', '', '1', '0', '添加分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('474', '268', 'Admin', 'Slidecat', 'delete', '', '1', '0', '删除分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('473', '268', 'Admin', 'Slidecat', 'edit', '', '1', '0', '编辑分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('472', '268', 'Admin', 'Slidecat', 'add', '', '1', '0', '添加分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('471', '264', 'Admin', 'Slide', 'delete', '', '1', '0', '删除幻灯片', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('470', '264', 'Admin', 'Slide', 'edit', '', '1', '0', '编辑幻灯片', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('469', '264', 'Admin', 'Slide', 'add', '', '1', '0', '添加幻灯片', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('467', '291', 'Admin', 'Rbac', 'member', '', '1', '0', '成员管理', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('465', '291', 'Admin', 'Rbac', 'authorize', '', '1', '0', '权限设置', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('464', '291', 'Admin', 'Rbac', 'roleedit', '', '1', '0', '编辑角色', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('463', '291', 'Admin', 'Rbac', 'roledelete', '', '1', '1', '删除角色', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('462', '291', 'Admin', 'Rbac', 'roleadd', '', '1', '1', '添加角色', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('458', '302', 'Admin', 'Post', 'restore', '', '1', '0', '文章还原', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('457', '302', 'Admin', 'Post', 'clean', '', '1', '0', '彻底删除', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('456', '285', 'Admin', 'Post', 'move', '', '1', '0', '批量移动', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('455', '285', 'Admin', 'Post', 'check', '', '1', '0', '文章审核', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('454', '285', 'Admin', 'Post', 'delete', '', '1', '0', '删除文章', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('452', '285', 'Admin', 'Post', 'edit', '', '1', '0', '编辑文章', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('451', '285', 'Admin', 'Post', 'add', '', '1', '0', '添加文章', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('450', '301', 'Admin', 'Page', 'clean', '', '1', '0', '彻底删除', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('449', '301', 'Admin', 'Page', 'restore', '', '1', '0', '页面还原', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('448', '277', 'Admin', 'Page', 'delete', '', '1', '0', '删除页面', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('446', '277', 'Admin', 'Page', 'edit', '', '1', '0', '编辑页面', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('445', '277', 'Admin', 'Page', 'add', '', '1', '0', '添加页面', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('444', '296', 'Admin', 'Navcat', 'delete', '', '1', '0', '删除分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('443', '296', 'Admin', 'Navcat', 'edit', '', '1', '0', '编辑分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('442', '296', 'Admin', 'Navcat', 'add', '', '1', '0', '添加分类', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('441', '295', 'Admin', 'Nav', 'delete', '', '1', '0', '删除菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('440', '295', 'Admin', 'Nav', 'edit', '', '1', '0', '编辑菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('439', '295', 'Admin', 'Nav', 'add', '', '1', '0', '添加菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('436', '297', 'Admin', 'Menu', 'export_menu', '', '1', '0', '菜单备份', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('434', '297', 'Admin', 'Menu', 'edit', '', '1', '0', '编辑菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('433', '297', 'Admin', 'Menu', 'delete', '', '1', '0', '删除菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('432', '297', 'Admin', 'Menu', 'lists', '', '1', '0', '所有菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('430', '270', 'Admin', 'Link', 'delete', '', '1', '0', '删除友情链接', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('429', '270', 'Admin', 'Link', 'edit', '', '1', '0', '编辑友情链接', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('428', '270', 'Admin', 'Link', 'add', '', '1', '0', '添加友情链接', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('424', '319', 'Admin', 'Backup', 'download', '', '1', '0', '下载备份', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('423', '319', 'Admin', 'Backup', 'del_backup', '', '1', '0', '删除备份', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('422', '319', 'Admin', 'Backup', 'import', '', '1', '0', '数据备份导入', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('421', '319', 'Admin', 'Backup', 'restore', '', '1', '1', '数据还原', '', '', '0');
INSERT INTO `sp_menu` VALUES ('420', '265', 'Admin', 'Ad', 'delete', '', '1', '0', '删除广告', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('419', '265', 'Admin', 'Ad', 'edit', '', '1', '0', '编辑广告', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('418', '265', 'Admin', 'Ad', 'add', '', '1', '0', '添加广告', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('482', '288', 'Api', 'Oauthadmin', 'delete', '', '1', '0', '删除第三方用户', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('483', '287', 'Member', 'Indexadmin', 'delete', '', '1', '0', '删除用户', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('488', '310', 'Wx', 'Answeradmin', 'split', '', '1', '0', '分词', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('490', '318', 'Wx', 'Menuadmin', 'createmenu', '', '1', '0', '生成微信菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('492', '318', 'Wx', 'Menuadmin', 'add', '', '1', '0', '添加微信菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('493', '318', 'Wx', 'Menuadmin', 'delete', '', '1', '0', '删除微信菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('494', '318', 'Wx', 'Menuadmin', 'edit', '', '1', '0', '编辑微信菜单', '', '', '1000');
INSERT INTO `sp_menu` VALUES ('495', '305', 'Wx', 'Indexadmin', 'index', '', '1', '1', '账号信息', '', '', '0');
INSERT INTO `sp_menu` VALUES ('496', '319', 'Admin', 'Backup', 'index', '', '1', '1', '数据备份', '', '', '0');
INSERT INTO `sp_menu` VALUES ('497', '418', 'Admin', 'Ad', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('498', '419', 'Admin', 'Ad', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('499', '428', 'Admin', 'Link', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('500', '429', 'Admin', 'Link', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('501', '536', 'Admin', 'Menu', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('502', '434', 'Admin', 'Menu', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('503', '439', 'Admin', 'Nav', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('504', '440', 'Admin', 'Nav', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('505', '442', 'Admin', 'Navcat', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('506', '443', 'Admin', 'Navcat', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('507', '445', 'Admin', 'Page', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('508', '446', 'Admin', 'Page', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('509', '451', 'Admin', 'Post', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('510', '452', 'Admin', 'Post', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('511', '462', 'Admin', 'Rbac', 'roleadd_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('512', '464', 'Admin', 'Rbac', 'roleedit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('513', '465', 'Admin', 'Rbac', 'authorize_post', '', '1', '0', '提交设置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('514', '284', 'Admin', 'Setting', 'site_post', '', '1', '0', '提交修改', '', '', '0');
INSERT INTO `sp_menu` VALUES ('515', '254', 'Admin', 'Setting', 'password_post', '', '1', '0', '提交修改', '', '', '0');
INSERT INTO `sp_menu` VALUES ('516', '469', 'Admin', 'Slide', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('517', '470', 'Admin', 'Slide', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('518', '472', 'Admin', 'Slidecat', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('519', '473', 'Admin', 'Slidecat', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('520', '475', 'Admin', 'Term', 'add_post', '', '1', '0', '提交添加', '', '', '0');
INSERT INTO `sp_menu` VALUES ('521', '476', 'Admin', 'Term', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('522', '478', 'Admin', 'User', 'add_post', '', '1', '0', '提交保存', '', '', '0');
INSERT INTO `sp_menu` VALUES ('523', '479', 'Admin', 'User', 'edit_post', '', '1', '0', '提交编辑', '', '', '0');
INSERT INTO `sp_menu` VALUES ('524', '253', 'Admin', 'User', 'userinfo_post', '', '1', '0', '提交修改', '', '', '0');
INSERT INTO `sp_menu` VALUES ('525', '299', 'Api', 'Oauthadmin', 'setting_post', '', '1', '0', '提交设置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('526', '533', 'Admin', 'Mailer', 'index', '', '1', '1', 'SMTP配置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('527', '526', 'Admin', 'Mailer', 'index_post', '', '1', '0', '提交配置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('528', '533', 'Admin', 'Mailer', 'active', '', '1', '1', '邮件模板', '', '', '0');
INSERT INTO `sp_menu` VALUES ('529', '528', 'Admin', 'Mailer', 'active_post', '', '1', '0', '提交模板', '', '', '0');
INSERT INTO `sp_menu` VALUES ('533', '239', 'Admin', 'Mailer', 'default', '', '1', '1', '邮箱配置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('538', '308', 'Wx', 'Answeradmin', 'index_post', '', '1', '0', '默认回复和欢迎辞设置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('536', '297', 'Admin', 'Menu', 'add', '', '1', '0', '添加菜单', '', '', '0');
INSERT INTO `sp_menu` VALUES ('539', '309', 'Wx', 'Answeradmin', 'fixed_post', '', '1', '0', '固定回答设置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('541', '310', 'Wx', 'Answeradmin', 'robot_post', '', '1', '0', '机器人问题集设置', '', '', '0');
INSERT INTO `sp_menu` VALUES ('542', '495', 'Wx', 'Indexadmin', 'index_post', '', '1', '0', '账号信息修改提交', '', '', '0');
INSERT INTO `sp_menu` VALUES ('543', '492', 'Wx', 'Menuadmin', 'add_post', '', '1', '0', ' 添加微信菜单提交', '', '', '0');
INSERT INTO `sp_menu` VALUES ('544', '494', 'Wx', 'Menuadmin', 'edit_post', '', '1', '0', '提交编辑微信菜单', '', '', '0');
INSERT INTO `sp_menu` VALUES ('546', '496', 'Admin', 'Backup', 'index_post', '', '1', '0', '提交数据备份', '', '', '0');
INSERT INTO `sp_menu` VALUES ('547', '270', 'Admin', 'Link', 'listorders', '', '1', '0', '友情链接排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('548', '297', 'Admin', 'Menu', 'listorders', '', '1', '0', '后台菜单排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('549', '295', 'Admin', 'Nav', 'listorders', '', '1', '0', '前台导航排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('550', '277', 'Admin', 'Page', 'listorders', '', '1', '0', '页面排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('551', '285', 'Admin', 'Post', 'listorders', '', '1', '0', '文章排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('552', '264', 'Admin', 'Slide', 'listorders', '', '1', '0', '幻灯片排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('553', '245', 'Admin', 'Term', 'listorders', '', '1', '0', '文章分类排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('554', '51', 'Api', 'Guestbookadmin', 'index', '', '1', '1', '所有留言', '', '', '0');
INSERT INTO `sp_menu` VALUES ('555', '554', 'Api', 'Guestbookadmin', 'delete', '', '1', '0', '删除网站留言', '', '', '0');
INSERT INTO `sp_menu` VALUES ('556', '318', 'Wx', 'Menuadmin', 'listorders', '', '1', '0', '微信菜单排序', '', '', '0');
INSERT INTO `sp_menu` VALUES ('557', '51', 'Comment', 'Commentadmin', 'index', '', '1', '1', '评论管理', '', '', '0');
INSERT INTO `sp_menu` VALUES ('559', '557', 'Comment', 'Commentadmin', 'delete', '', '1', '0', '删除评论', '', '', '0');
INSERT INTO `sp_menu` VALUES ('560', '557', 'Comment', 'Commentadmin', 'check', '', '1', '0', '评论审核', '', '', '0');
-- ----------------------------
-- Table structure for `sp_nav`
-- ----------------------------
DROP TABLE IF EXISTS `sp_nav`;
CREATE TABLE `sp_nav` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) NOT NULL,
`parentid` int(11) NOT NULL,
`label` varchar(255) NOT NULL,
`target` varchar(50) DEFAULT NULL,
`href` varchar(255) NOT NULL,
`icon` varchar(255) NOT NULL,
`status` int(2) NOT NULL DEFAULT '1',
`listorder` int(6) DEFAULT '0',
`path` varchar(255) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_nav
-- ----------------------------
INSERT INTO `sp_nav` VALUES ('1', '1', '0', '首页', '', 'home', '', '1', '0', '0-1');
-- ----------------------------
-- Table structure for `sp_nav_cat`
-- ----------------------------
DROP TABLE IF EXISTS `sp_nav_cat`;
CREATE TABLE `sp_nav_cat` (
`navcid` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`active` int(1) NOT NULL DEFAULT '1',
`remark` text,
PRIMARY KEY (`navcid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_nav_cat
-- ----------------------------
INSERT INTO `sp_nav_cat` VALUES ('1', '主导航', '1', '主导航');
-- ----------------------------
-- Table structure for `sp_oauth_member`
-- ----------------------------
DROP TABLE IF EXISTS `sp_oauth_member`;
CREATE TABLE `sp_oauth_member` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`_from` varchar(20) NOT NULL,
`_name` varchar(30) NOT NULL,
`head_img` varchar(200) NOT NULL,
`lock_to_id` int(20) NOT NULL,
`create_time` int(12) NOT NULL,
`last_login_time` int(12) NOT NULL,
`last_login_ip` varchar(16) NOT NULL,
`login_times` int(6) NOT NULL,
`status` tinyint(2) NOT NULL,
`access_token` varchar(60) NOT NULL,
`expires_date` int(12) NOT NULL,
`openid` varchar(40) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=163 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_options`
-- ----------------------------
DROP TABLE IF EXISTS `sp_options`;
CREATE TABLE `sp_options` (
`option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`option_name` varchar(64) NOT NULL DEFAULT '',
`option_value` longtext NOT NULL,
`autoload` int(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`option_id`),
UNIQUE KEY `option_name` (`option_name`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_options
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_postmeta`
-- ----------------------------
DROP TABLE IF EXISTS `sp_postmeta`;
CREATE TABLE `sp_postmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) DEFAULT NULL,
`meta_value` longtext,
PRIMARY KEY (`meta_id`),
KEY `post_id` (`post_id`),
KEY `meta_key` (`meta_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_postmeta
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_posts`
-- ----------------------------
DROP TABLE IF EXISTS `sp_posts`;
CREATE TABLE `sp_posts` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_author` bigint(20) unsigned DEFAULT '0',
`post_keywords` varchar(150) NOT NULL,
`post_date` datetime DEFAULT '0000-00-00 00:00:00',
`post_content` longtext,
`post_title` text,
`post_excerpt` text,
`post_status` int(2) DEFAULT '1',
`comment_status` int(2) DEFAULT '1',
`post_modified` datetime DEFAULT '0000-00-00 00:00:00',
`post_content_filtered` longtext,
`post_parent` bigint(20) unsigned DEFAULT '0',
`post_type` int(2) DEFAULT NULL,
`post_mime_type` varchar(100) DEFAULT '',
`comment_count` bigint(20) DEFAULT '0',
`smeta` text,
PRIMARY KEY (`ID`),
KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`),
KEY `post_parent` (`post_parent`),
KEY `post_author` (`post_author`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_role`
-- ----------------------------
DROP TABLE IF EXISTS `sp_role`;
CREATE TABLE `sp_role` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL DEFAULT '角色名称',
`pid` smallint(6) DEFAULT NULL COMMENT '父角色ID',
`status` tinyint(1) unsigned DEFAULT NULL COMMENT '状态',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_time` int(11) unsigned NOT NULL COMMENT '创建时间',
`update_time` int(11) unsigned NOT NULL COMMENT '更新时间',
`listorder` int(3) NOT NULL DEFAULT '0' COMMENT '排序字段',
PRIMARY KEY (`id`),
KEY `parentId` (`pid`),
KEY `status` (`status`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_role
-- ----------------------------
INSERT INTO `sp_role` VALUES ('1', '超级管理员', '0', '1', '拥有网站最高管理员权限!', '1329633709', '1329633709', '0');
-- ----------------------------
-- Table structure for `sp_role_user`
-- ----------------------------
DROP TABLE IF EXISTS `sp_role_user`;
CREATE TABLE `sp_role_user` (
`role_id` mediumint(9) unsigned DEFAULT NULL,
`user_id` char(32) DEFAULT NULL,
KEY `group_id` (`role_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_role_user
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_slide`
-- ----------------------------
DROP TABLE IF EXISTS `sp_slide`;
CREATE TABLE `sp_slide` (
`slide_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`slide_cid` bigint(20) NOT NULL,
`slide_name` varchar(255) NOT NULL,
`slide_pic` varchar(255) DEFAULT NULL,
`slide_url` varchar(255) DEFAULT NULL,
`slide_des` varchar(255) DEFAULT NULL,
`slide_content` text,
`slide_status` int(2) NOT NULL DEFAULT '1',
`listorder` int(10) DEFAULT '0',
PRIMARY KEY (`slide_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_slide
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_slide_cat`
-- ----------------------------
DROP TABLE IF EXISTS `sp_slide_cat`;
CREATE TABLE `sp_slide_cat` (
`cid` bigint(20) NOT NULL AUTO_INCREMENT,
`cat_name` varchar(255) NOT NULL,
`cat_idname` varchar(255) NOT NULL,
`cat_remark` text,
`cat_status` int(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_slide_cat
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_terms`
-- ----------------------------
DROP TABLE IF EXISTS `sp_terms`;
CREATE TABLE `sp_terms` (
`term_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(200) DEFAULT '',
`slug` varchar(200) DEFAULT '',
`taxonomy` varchar(32) DEFAULT '',
`description` longtext,
`parent` bigint(20) unsigned DEFAULT '0',
`count` bigint(20) DEFAULT '0',
`path` varchar(500) DEFAULT NULL,
`seo_title` varchar(500) DEFAULT NULL,
`seo_keywords` varchar(500) DEFAULT NULL,
`seo_description` varchar(500) DEFAULT NULL,
`list_tpl` varchar(50) DEFAULT NULL,
`one_tpl` varchar(50) DEFAULT NULL,
`listorder` int(5) NOT NULL DEFAULT '0',
`status` int(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`term_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
INSERT INTO `sp_terms` VALUES ('1', '未分类', '', 'article', '', '0', '0', '0-1', '', '', '', 'list', 'article', '0', '1');
-- ----------------------------
-- Table structure for `sp_term_relationships`
-- ----------------------------
DROP TABLE IF EXISTS `sp_term_relationships`;
CREATE TABLE `sp_term_relationships` (
`tid` bigint(20) NOT NULL AUTO_INCREMENT,
`object_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`term_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`listorder` int(10) NOT NULL DEFAULT '0',
`status` int(2) NOT NULL DEFAULT '1',
PRIMARY KEY (`tid`),
KEY `term_taxonomy_id` (`term_id`)
) ENGINE=MyISAM AUTO_INCREMENT=90 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_usermeta`
-- ----------------------------
DROP TABLE IF EXISTS `sp_usermeta`;
CREATE TABLE `sp_usermeta` (
`umeta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) DEFAULT NULL,
`meta_value` longtext,
PRIMARY KEY (`umeta_id`),
KEY `user_id` (`user_id`),
KEY `meta_key` (`meta_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_usermeta
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_users`
-- ----------------------------
DROP TABLE IF EXISTS `sp_users`;
CREATE TABLE `sp_users` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_login` varchar(60) NOT NULL DEFAULT '',
`user_pass` varchar(64) NOT NULL DEFAULT '',
`user_nicename` varchar(50) NOT NULL DEFAULT '',
`user_email` varchar(100) NOT NULL DEFAULT '',
`user_url` varchar(100) NOT NULL DEFAULT '',
`last_login_ip` varchar(16) NOT NULL,
`last_login_time` datetime NOT NULL,
`create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`user_activation_key` varchar(60) NOT NULL DEFAULT '',
`user_status` int(11) NOT NULL DEFAULT '1',
`display_name` varchar(250) NOT NULL DEFAULT '',
`role_id` smallint(6) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `user_login_key` (`user_login`),
KEY `user_nicename` (`user_nicename`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_wx_answer`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_answer`;
CREATE TABLE `sp_wx_answer` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`_key` varchar(30) NOT NULL,
`_value` text NOT NULL,
`belong` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_wx_answer
-- ----------------------------
INSERT INTO `sp_wx_answer` VALUES ('5', '1', '回复天气+城市名称查询当地近三天天气情况,如“天气上海”,支持语音查询', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_answer` VALUES ('9', '2', '回复快递+快递名称+快递单号查询快递详情,如“快递申通768277296108”,支持语音查询', '');
INSERT INTO `sp_wx_answer` VALUES ('10', '3', '直接提交查询内容即可,支持语音哦。.', '');
-- ----------------------------
-- Table structure for `sp_wx_answer_robot`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_answer_robot`;
CREATE TABLE `sp_wx_answer_robot` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`question` varchar(50) NOT NULL,
`answer` text NOT NULL,
`key1` varchar(20) NOT NULL,
`key2` varchar(20) NOT NULL,
`key3` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_wx_answer_robot
-- ----------------------------
INSERT INTO `sp_wx_answer_robot` VALUES ('2', '你真可爱', '谢谢夸奖', '可爱', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('3', '你真聪明', '谢谢夸奖', '聪明', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('4', '你叫什么名字', '我叫小T,是个智能机器人,我可是很聪明的哦~', '你', '什么', '名字');
INSERT INTO `sp_wx_answer_robot` VALUES ('5', '你几岁了', '我才1岁,是个小萝莉', '你', '几', '岁');
INSERT INTO `sp_wx_answer_robot` VALUES ('6', '你好', '你好啊', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('7', '你好啊', '你好', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('8', '你吃饭了吗', '亲,您搞错了吧?我是不需要吃饭的', '你', '吃饭', '吗');
INSERT INTO `sp_wx_answer_robot` VALUES ('9', '你吃过了吗', '亲,您搞错了吧?俺是不需要吃饭滴', '你', '吃', '吗');
INSERT INTO `sp_wx_answer_robot` VALUES ('10', '你的爸爸妈妈呢', '我没有', '你', '爸爸', '妈妈');
INSERT INTO `sp_wx_answer_robot` VALUES ('11', '我喜欢你', '谢谢,我也喜欢你', '我喜欢', '你', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('12', '我爱你', '我也爱你', '我爱你', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('13', '你家在哪', '嘻嘻,我才不要告诉你呢', '你家', '在', '哪');
INSERT INTO `sp_wx_answer_robot` VALUES ('14', '你在干嘛', '我在认真工作', '你', '在', '嘛');
INSERT INTO `sp_wx_answer_robot` VALUES ('15', '你在做什么', '这都看不出来?我在认真工作', '你', '做', '什么');
INSERT INTO `sp_wx_answer_robot` VALUES ('16', '现在几点了', '你看看手机就知道了', '现在', '几', '点');
INSERT INTO `sp_wx_answer_robot` VALUES ('17', '王八蛋', '请不要说脏话', '王八', '蛋', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('18', '我感冒了', '呜呜~那我劝你多喝水,多运动。祝你早日康复!', '我', '感冒', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('19', '我生病了', '那你八成缺乏锻炼,记得多出去走走哦', '我', '生病', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('20', '呵呵', '你是在嘲笑我吗', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('21', '嘿嘿', '笑的让我很费解', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('22', '哈哈', '你在笑什么?没有什么好笑的吧', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('23', 'hello', 'hello !', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('24', 'hi', 'hi', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('25', '嗨', '嗨,您好啊!', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('26', '在吗?', '您好,在的', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('27', '在吗', '您好,在的', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('28', '有人在吗', '您好,在的', '', '', '');
INSERT INTO `sp_wx_answer_robot` VALUES ('29', '最近忙吗', '恩,老加班', '最近', '忙', '吗');
-- ----------------------------
-- Table structure for `sp_wx_answer_third`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_answer_third`;
CREATE TABLE `sp_wx_answer_third` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`question` varchar(50) NOT NULL,
`answer` text NOT NULL,
`key1` varchar(20) NOT NULL,
`key2` varchar(20) NOT NULL,
`key3` varchar(20) NOT NULL,
`belong` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_wx_answer_third
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_wx_config`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_config`;
CREATE TABLE `sp_wx_config` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`_key` varchar(30) NOT NULL,
`_value` text NOT NULL,
`belong` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_wx_config
-- ----------------------------
INSERT INTO `sp_wx_config` VALUES ('1', 'ANSWER_DEFAULT_1', '回复数字编号查询以下内容:\n1.天气查询\n2.快递查询\n3.智能客服', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_config` VALUES ('2', 'ANSWER_WELCOME', '走过路过,幸好您没错过。精彩从此刻开始,谢谢您的关注!', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_config` VALUES ('3', 'ANSWER_DEFAULT_2', '回复数字编号查询以下内容:\n1.天气查询\n2.快递查询\n3.智能客服', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_config` VALUES ('4', 'ANSWER_DEFAULT_3', '呸呸呸,你说的我完全没听懂', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_config` VALUES ('5', 'ANSWER_DEFAULT_4', '装作没听懂......', 'gh_ef34a6c9f774');
INSERT INTO `sp_wx_config` VALUES ('11', 'WX_NUM', 'thinkcmf', '');
INSERT INTO `sp_wx_config` VALUES ('12', 'WX_INI_NUM', ' ', '');
INSERT INTO `sp_wx_config` VALUES ('13', 'WX_TOKEN', ' ', '');
INSERT INTO `sp_wx_config` VALUES ('14', 'WX_APPID', ' ', '');
INSERT INTO `sp_wx_config` VALUES ('15', 'WX_APPSECRET', ' ', '');
INSERT INTO `sp_wx_config` VALUES ('16', 'WX_ACCESS_TOKEN', '', '');
-- ----------------------------
-- Table structure for `sp_wx_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_menu`;
CREATE TABLE `sp_wx_menu` (
`menu_id` int(5) NOT NULL AUTO_INCREMENT,
`menu_type` varchar(10) DEFAULT NULL,
`menu_name` varchar(10) NOT NULL,
`event_key` varchar(200) NOT NULL,
`view_url` varchar(300) NOT NULL,
`parentid` int(5) NOT NULL DEFAULT '0',
`listorder` varchar(5) NOT NULL,
`status` tinyint(1) NOT NULL,
PRIMARY KEY (`menu_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_wx_message_image`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_message_image`;
CREATE TABLE `sp_wx_message_image` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`message_id` varchar(20) NOT NULL,
`from` varchar(30) NOT NULL,
`to` varchar(30) NOT NULL,
`url` text NOT NULL,
`time` int(12) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sp_wx_message_image
-- ----------------------------
-- ----------------------------
-- Table structure for `sp_wx_message_location`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_message_location`;
CREATE TABLE `sp_wx_message_location` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`message_id` varchar(20) NOT NULL,
`from` varchar(30) NOT NULL,
`to` varchar(30) NOT NULL,
`location_x` double NOT NULL,
`location_y` double NOT NULL,
`province` varchar(7) NOT NULL,
`scale` int(3) NOT NULL,
`label` varchar(200) NOT NULL,
`time` int(12) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_wx_message_text`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_message_text`;
CREATE TABLE `sp_wx_message_text` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`message_id` varchar(20) NOT NULL,
`from` varchar(30) NOT NULL,
`to` varchar(30) NOT NULL,
`content` varchar(150) NOT NULL,
`time` int(12) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_wx_message_voice`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_message_voice`;
CREATE TABLE `sp_wx_message_voice` (
`voice_id` int(10) NOT NULL AUTO_INCREMENT,
`message_id` int(64) NOT NULL,
`media_id` varchar(20) NOT NULL,
`from` varchar(30) NOT NULL,
`to` varchar(30) NOT NULL,
`text` varchar(100) NOT NULL,
`format` varchar(10) NOT NULL,
`time` int(12) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`voice_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `sp_wx_user`
-- ----------------------------
DROP TABLE IF EXISTS `sp_wx_user`;
CREATE TABLE `sp_wx_user` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`openid` varchar(30) NOT NULL,
`subscribe_time` int(12) NOT NULL,
`nickname` varchar(80) NOT NULL,
`sex` tinyint(1) NOT NULL,
`language` varchar(30) NOT NULL,
`city` varchar(10) NOT NULL,
`province` varchar(30) NOT NULL,
`country` varchar(15) NOT NULL,
`headimgurl` varchar(200) NOT NULL,
`unsubscribe_time` int(12) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '1',
`belong` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
#
# YCSB-WEB v1.0.0
# Copyright (c) 2021-present, leo_jie.
CREATE database if NOT EXISTS `ycsb_web` default character set utf8mb4 collate utf8mb4_unicode_ci;
use `ycsb_web`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for xxl_job_group
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_group`;
CREATE TABLE `xxl_job_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
`title` varchar(12) NOT NULL COMMENT '执行器名称',
`address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
`address_list` text COMMENT '执行器地址列表,多地址逗号分隔',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_group
-- ----------------------------
BEGIN;
INSERT INTO `xxl_job_group` (`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (1, 'ycsb-local-executor', 'YCSB本地执行器', 1, 'http://127.0.0.1:9999', '2022-01-09 12:26:22');
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_info
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_info`;
CREATE TABLE `xxl_job_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_desc` varchar(255) NOT NULL,
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`author` varchar(64) DEFAULT NULL COMMENT '作者',
`alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
`schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型',
`schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型',
`misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '调度过期策略',
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
`glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
`child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
`trigger_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '调度状态:0-停止,1-运行',
`trigger_last_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '上次调度时间',
`trigger_next_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '下次调度时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_info
-- ----------------------------
BEGIN;
INSERT INTO `xxl_job_info` (`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`, `trigger_status`, `trigger_last_time`, `trigger_next_time`) VALUES (1, 1, 'YCSB压测HBase集群', '2018-11-03 22:21:31', '2022-01-09 12:26:44', 'leo_jie', '2326130720@qq.com', 'CRON', '0 0 0 * * ? *', 'DO_NOTHING', 'FIRST', 'HBaseJobHandler', '-db com.leo.ycsb.job.executor.db.HBaseClient -P /Users/leojie/other_project/ycsb-web/conf/workloads/workloada -p threads=10 -p hbase.config.file.path=/Users/leojie/other_project/ycsb-web/conf/hbase-site.xml -p table=usertable -p columnfamily=info -p recordcount=1000 -p operationcount=1000 -s -t', 'DISCARD_LATER', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '', 0, 0, 0);
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_lock
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_lock`;
CREATE TABLE `xxl_job_lock` (
`lock_name` varchar(50) NOT NULL COMMENT '锁名称',
PRIMARY KEY (`lock_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_lock
-- ----------------------------
BEGIN;
INSERT INTO `xxl_job_lock` (`lock_name`) VALUES ('schedule_lock');
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_log
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_log`;
CREATE TABLE `xxl_job_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
`trigger_code` int(11) NOT NULL COMMENT '调度-结果',
`trigger_msg` text COMMENT '调度-日志',
`handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
`handle_code` int(11) NOT NULL COMMENT '执行-状态',
`handle_msg` text COMMENT '执行-日志',
`alarm_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
PRIMARY KEY (`id`),
KEY `I_trigger_time` (`trigger_time`),
KEY `I_handle_code` (`handle_code`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_log_report
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_log_report`;
CREATE TABLE `xxl_job_log_report` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trigger_day` datetime DEFAULT NULL COMMENT '调度-时间',
`running_count` int(11) NOT NULL DEFAULT '0' COMMENT '运行中-日志数量',
`suc_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
`fail_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_log_report
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_logglue
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_logglue`;
CREATE TABLE `xxl_job_logglue` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_logglue
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_registry
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_registry`;
CREATE TABLE `xxl_job_registry` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`registry_group` varchar(50) NOT NULL,
`registry_key` varchar(255) NOT NULL,
`registry_value` varchar(255) NOT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_registry
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for xxl_job_user
-- ----------------------------
DROP TABLE IF EXISTS `xxl_job_user`;
CREATE TABLE `xxl_job_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '账号',
`password` varchar(50) NOT NULL COMMENT '密码',
`role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
`permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
PRIMARY KEY (`id`),
UNIQUE KEY `i_username` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of xxl_job_user
-- ----------------------------
BEGIN;
INSERT INTO `xxl_job_user` (`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
|
declare
x number(32);
y number(32);
z number;
begin
x :=
to_number(
extract(day from(systimestamp - to_timestamp('1970-01-01', 'YYYY-MM-DD'))) * 86400000
+ to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3'))
);
dbms_lock.sleep(1);
y :=
to_number(
extract(day from(systimestamp - to_timestamp('1970-01-01', 'YYYY-MM-DD'))) * 86400000
+ to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3'))
);
dbms_output.put_line('x: ' || x );
dbms_output.put_line('y: ' || y );
dbms_output.put_line('diff: ' || to_char(y-x) );
end;
/
|
-- https://www.codewars.com/kata/594633020a561e329a0000a2
-- Given a demographics table you need to return a table that shows a count of each race represented, ordered by the count in descending order.
SELECT race, COUNT(*) AS count
FROM demographics
GROUP BY race
ORDER BY COUNT(*) DESC;
|
-- lists all shows, and all genres linked to that show
SELECT tv_shows.title, tv_genres.name
FROM tv_shows
LEFT JOIN tv_show_genres
ON tv_shows.id = tv_show_genres.show_id
LEFT JOIN tv_genres
ON tv_genres.id = tv_show_genres.genre_id
ORDER BY tv_shows.title, tv_genres.name ASC;
|
SELECT * FROM `vlogs` WHERE Comment='Generated via Timestamp';
|
-- SETTINGS
SET @iCategId = (SELECT `id` FROM `sys_options_categories` WHERE `name`='bx_posts' LIMIT 1);
DELETE FROM `sys_options` WHERE `name` IN ('bx_posts_per_page_profile');
INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
('bx_posts_per_page_profile', '3', @iCategId, '_bx_posts_option_per_page_profile', 'digit', '', '', '', 12);
-- PAGES
DELETE FROM `sys_pages_blocks` WHERE `object`='bx_posts_home' AND `title` IN ('_bx_posts_page_block_title_featured_entries_view_extended');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
('bx_posts_home', 1, 'bx_posts', '', '_bx_posts_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0);
UPDATE `sys_pages_blocks` SET `order`='1' WHERE `object`='bx_posts_home' AND `title`='_bx_posts_page_block_title_recent_entries_view_extended';
UPDATE `sys_pages_blocks` SET `content`='a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:1:{s:8:"per_page";s:25:"bx_posts_per_page_profile";}}}' WHERE `title`='_bx_posts_page_block_title_my_entries' AND `content`='a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_author";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}';
|
//e1
-- Hapus data yang ber-id 7 di tabel student
DELETE FROM students WHERE id=7;
-- Jangan hapus kueri dibawah
SELECT * FROM students;
|
INSERT INTO PUBLISHER (ID, NAME) VALUES (1001, 'APress');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1002, 'Manning');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1003, 'O Reilly');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1004, 'Addison-Wesley');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1005, 'John Wiley');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1006, 'MIT Press');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1007, 'Packt');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1008, 'The Pragmatic Programmer');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1009, 'Prentice Hall');
INSERT INTO PUBLISHER (ID, NAME) VALUES (1010, 'Wrox Press');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2001, 'Antonio', 'Goncalves', 1, '1971-05-29', 'Antonio is a senior developer specialized in Java/Java EE. As a consultant he advises customers and helps them in defining and developing their software architecture. This Java Champion is also the founder of the very successful Paris JUG, Devoxx Franc...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2002, 'Nigel', 'Deakin', 0, '1972-04-19', 'Nigel Deakin is specification lead for JMS 2.0 (JSR 343) and a principal member of technical staff at Oracle.');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2003, 'Kinman', 'Chung', 5, '1973-03-09', 'Spec lead for JSR 341, EL 3.0. Formerly a Tomcat committer. Currently a developer in Glassfish, working on web container, JSP and EL.');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH) VALUES (2004, 'Linda', 'Demichiel', 0, '1969-10-23');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2005, 'Arun', 'Gupta', 6, '1969-10-23', 'Arun Gupta is a Java evangelist working at Oracle. He works to create and foster the community around Java EE, GlassFish, and WebLogic. He has been with the Java EE team since its inception and contributed to all releases. Arun has extensive world wide...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, BIO) VALUES (2006, 'Lincoln', 'Baxter III', 0, 'Lincoln Baxter, III is a Research Engineer at Red Hat, working on JBoss open-source projects; most notably as project lead for JBoss Forge.');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2007, 'Ed', 'Burns', 0, '1971-10-14', 'Ed Burns is a Senior Staff Engineer for Oracle Corporation where he chairs the JSR 344 (JSF 2.2) Expert Group and contributes to the open source Mojarra project. He is the author of two books published by McGraw-Hill: Secrets of the Rock Star Programme...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2008, 'Roger', 'Kitain', 0, '1974-08-08', 'Roger Kitain is an Engineer at Oracle Corporation where he spent the last 15 years working with web technologies. He started working on JavaServer Faces in 2001 as a member of the implementation team and has co-led the specification for JSF since 1.1, ...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2009, 'Adam', 'Bien', 7, '1971-07-07', 'Consultant and author Adam Bien is an Expert Group member for the Java EE 6 / 7, EJB 3.X, JAX-RS and JPA 2.X JSRs. He has worked with Java technology since JDK 1.0 and with Servlets/EJB 1.0 and is now an architect and developer for Java SE and Java EE ...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2010, 'Emmanuel', 'Bernard', 1, '1973-03-03', 'Emmanuel Bernard is data platform architect at JBoss by Red Hat where he oversees data projects of the Red Hat''s middleware and is member of the Hibernate team. Emmanuel has spent a few years in the retail industry as developer and architect where he ...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2011, 'Jitendra', 'Kotamraju', 8, '1974-04-04', 'Jitendra Kotamraju is a software engineer at Oracle. He has been contributing to the many Java EE technologies and GlassFish projects for the last 8 years. He was the specification and implementation lead of JAX-WS 2.2. At present, he is the specificat...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2012, 'Mike', 'Keith', 0, '1968-01-14', 'Mike Keith has been an enterprise, distributed systems and persistence expert for over 20 years. He is a Java and Enterprise Architect at Oracle and contributes to Java EE and many of the subspecifications that make up the enterprise Java portfolio. He...');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2013, 'Anthony', 'Lai', 0, '1969-06-24', 'Anthony Lai is a principal member of technical staff at Oracle. He is the specification lead for JSR 236 - Concurrency Utilities for Java EE 1.0, and was previously a member of the J2EE Connector Architecture 1.5 specification (JSR 112) expert group.');
INSERT INTO AUTHOR (ID, FIRST_NAME, LAST_NAME, PREFERRED_LANGUAGE, DATE_OF_BIRTH, BIO) VALUES (2014, 'Fred', 'Rowe', 0, '1969-06-24', 'Fred is the WebSphere Architect for a number of Application Server components including those responsible for JEE managed concurrency, JCA (Java Connector Architecture), and database connectivity and connection management. Fred has worked at IBM for 10...');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3001, 'John', 'Lennon', '1940-10-09', 'Guitar', 'John Winston Ono Lennon, (born John Winston Lennon; 9 October 1940 – 8 December 1980) was an English musician, singer and songwriter who rose to worldwide fame as a founder member of the Beatles, the most commercially successful band in the history of popular music. With Paul McCartney, he formed a songwriting partnership that is one of the most celebrated of the 20th century');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3002, 'Paul', 'McCartney', '1942-06-10', 'Bass', 'Sir James Paul McCartney, (born 18 June 1942) is an English musician, singer, songwriter, multi-instrumentalist, and composer. With John Lennon, George Harrison and Ringo Starr, he gained worldwide fame as a member of the Beatles, widely regarded as one of the most popular and influential acts in the history of rock music; his songwriting partnership with Lennon is one of the most celebrated of the 20th century. After the band''s break-up, he pursued a solo career and later formed Wings with his first wife, Linda, and Denny Laine.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3003, 'Ringo', 'Starr', '1940-07-07', 'Drums', 'Ringo Starr (born Richard Starkey; 7 July 1940) is an English musician, singer, songwriter and actor who gained worldwide fame as the drummer for the Beatles. On most of the band''s albums, he sang lead vocals for one song, including "With a Little Help from My Friends", "Yellow Submarine" and their cover of "Act Naturally". He also wrote the Beatles'' songs "Don''t Pass Me By" and "Octopus''s Garden", and is credited as a co-writer of others, such as "What Goes On" and "Flying"');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3004, 'George', 'Harrison', '1943-02-25', 'Guitar', 'George Harrison, (25 February 1943 – 29 November 2001) was an English musician, singer and songwriter who achieved international fame as the lead guitarist of the Beatles. Although John Lennon and Paul McCartney were the band''s primary songwriters, most of their albums included at least one Harrison composition, including "While My Guitar Gently Weeps", "Here Comes the Sun" and "Something", which became the Beatles'' second most-covered song.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3005, 'Ronnie', 'Wood', '1947-07-01', 'Guitar', 'Ronald David "Ronnie" Wood (born 1 June 1947) is an English rock musician best known as a member of the Rolling Stones since 1975, as well as a former member of the Faces and the Jeff Beck Group.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3006, 'Mick', 'Jagger', '1943-07-26', 'Voice', 'Sir Michael Philip "Mick" Jagger (born 26 July 1943) is an English musician, singer, songwriter and actor, best known as the lead vocalist and a founder member of the Rolling Stones.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3007, 'Keith', 'Richards', '1943-12-18', 'Guitar', 'Keith Richards (born 18 December 1943) is an English musician, singer, songwriter and founding member of the English rock band the Rolling Stones. Rolling Stone magazine credited Richards for "rock''s greatest single body of riffs" on guitar and ranked him 4th on its list of 100 best guitarists.[1] Fourteen songs Richards wrote with the Rolling Stones'' lead vocalist Mick Jagger are listed among Rolling Stone magazine''s "500 Greatest Songs of All Time".');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3008, 'Charlie', 'Watts', '1941-06-02', 'Drums', 'Charles Robert "Charlie" Watts (born 2 June 1941) is an English drummer, best known as a member of the Rolling Stones. He is also the leader of a jazz band,[1] a record producer, commercial artist, and horse breeder.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3009, 'Nick', 'Mason', '1944-01-27', 'Drums', 'Nicholas Berkeley "Nick" Mason (born 27 January 1944) is an English drummer and composer, best known for his work with Pink Floyd. He is the only constant member of the band since its formation in 1965. Despite solely writing only a few Pink Floyd songs, Mason has co-written some of Pink Floyd''s most popular compositions such as "Echoes" and "Time"');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3010, 'Roger', 'Waters', '1943-09-06', 'Bass', 'George Roger Waters (born 6 September 1943) is an English musician, singer, songwriter and composer. In 1965, he co-founded the progressive rock band Pink Floyd with drummer Nick Mason, keyboardist Richard Wright and guitarist, singer and songwriter Syd Barrett. Waters initially served as the group''s bassist and co-lead vocalist, but following the departure of Barrett in 1968, he also became their lyricist and conceptual leader.');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3011, 'Richard', 'Wright', '1943-07-28', 'Keyboard', 'Richard William "Rick" Wright (28 July 1943 – 15 September 2008) was an English musician, singer and songwriter, best known for his career with Pink Floyd.[1] Wright''s richly textured keyboard layers were a vital ingredient and a distinctive characteristic of Pink Floyd''s sound. Wright frequently sang harmony and occasionally lead vocals on stage and in the studio with Pink Floyd (most notably on the songs "Time", "Echoes", "Wearing the Inside Out", "Astronomy Domine" and "Matilda Mother").');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3012, 'Syd', 'Barrett', '1946-01-06', 'Guitar', 'Roger Keith "Syd" Barrett (6 January 1946 – 7 July 2006) was an English musician, singer, songwriter, guitarist, and painter, best remembered as a founding member of the band Pink Floyd. He was the lead vocalist, guitarist, and principal songwriter during the band''s psychedelic years, providing major musical and stylistic direction in their early work. In addition, he is credited with naming the band. Barrett left the group in April 1968 and was briefly hospitalized amid speculation of mental illness exacerbated by drug use');
INSERT INTO MUSICIAN (ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, PREFERRED_INSTRUMENT, BIO) VALUES (3013, 'David', 'Gilmour', '1946-03-06', 'Guitar', 'David Jon Gilmour, CBE (born 6 March 1946), is an English musician, singer, songwriter and multi-instrumentalist. He is best-known for his work as the guitarist and co-lead vocalist of the progressive rock band Pink Floyd. It is estimated that as of 2012, the group have sold over 250 million records worldwide, including 74.5 million units sold in the United States');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, ISBN, LANGUAGE, NB_OF_PAGES, PUBLICATION_DATE, PUBLISHER_PK, DESCRIPTION) VALUES (1000, 'Book', 'Beginning Java EE 7', 49.99, '143024626X', 'ENGLISH', 608, '2014-02-05', 1001, 'Java Enterprise Edition (Java EE) continues to be one of the leading Java technologies and platforms. Beginning Java EE 7 is the first tutorial book on Java EE 7. Step by step and easy to follow, this book describes many of the Java EE 7 specifications...');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, ISBN, LANGUAGE, NB_OF_PAGES, PUBLICATION_DATE, PUBLISHER_PK, DESCRIPTION) VALUES (2000, 'Book', 'Java EE 7 Essentials', 39.99, '1449370179', 'ENGLISH', 362, '2014-02-05', 1002, 'Get up to speed on the principal technologies in the Java Platform, Enterprise Edition 7, and learn how the latest version embraces HTML5, focuses on higher productivity, and provides functionality to meet enterprise demands. Written by Arun Gupta, a k...');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, ISBN, LANGUAGE, NB_OF_PAGES, PUBLICATION_DATE, PUBLISHER_PK, DESCRIPTION) VALUES (3000, 'Book', 'Java EE 7 Recipes: A Problem-Solution Approach', 49.99, '1430244259', 'ENGLISH', 748, '2014-02-05', 1003, 'Java EE 7 Recipes takes an example-based approach in showing how to program Enterprise Java applications in many different scenarios. Be it a small-business web application, or an enterprise database application, Java EE 7 Recipes provides effective an...');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, ISBN, LANGUAGE, NB_OF_PAGES, PUBLICATION_DATE, PUBLISHER_PK, DESCRIPTION) VALUES (4000, 'Book', 'Introducing Java EE 7: A Look at What''s New', 29.99, '1430258489', 'ENGLISH', 240, '2014-02-05', 1004, 'Introducing Java EE 7: A Look at What’s New</em> guides you through the new features and enhancements in each of the technologies comprising the Java EE platform. Readers of this book will not have to wade through introductory material or infor...');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, ISBN, LANGUAGE, NB_OF_PAGES, PUBLICATION_DATE, PUBLISHER_PK, DESCRIPTION) VALUES (5000, 'Book', 'Oracle Certified Master Java Enterprise Architect Java EE 7: Certification Guide', 49.99, '1430250011', 'FRENCH', 700, '2014-02-05', 1005, 'Oracle Certified Master, Java Enterprise Architect Java EE 7 Certification Guide is a practical hands on guide for those looking to achieve the Master certification. It deals with the different technological aspects necessary to prop up the understandi...');
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (1000, 2001);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (2000, 2002);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (2000, 2003);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (2000, 2004);
-- TODO INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (3000, 2004);
-- TODO INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (3000, 2005);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (4000, 2005);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (4000, 2006);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (4000, 2007);
INSERT INTO BOOK_AUTHOR (BOOK_FK, AUTHOR_FK) VALUES (5000, 2008);
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, GENRE, MUSIC_COMPANY, TOTAL_DURATION, DESCRIPTION) VALUES (100, 'CD', 'Let It Be', 12.99, 'Jazz', 'EMI', 123, 'Let It Be is the 12th and final studio album released by the English rock band the Beatles. It was released on 8 May 1970 by the band''s Apple Records label shortly after the group announced their break-up.');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, GENRE, MUSIC_COMPANY, TOTAL_DURATION, DESCRIPTION) VALUES (101, 'CD', 'Abbey Road', 15.99, 'Pop', 'Apple', 76, 'Abbey Road is the 11th studio album released by the English rock band the Beatles. It is their last recorded album, although Let It Be was the last album released before the band''s dissolution in 1970. Work on Abbey Road began in April 1969, and the album was released on 26 September 1969 in the United Kingdom, and 1 October 1969 in the United States.');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, GENRE, MUSIC_COMPANY, TOTAL_DURATION, DESCRIPTION) VALUES (102, 'CD', 'Yellow Submarine', 15.99, 'Pop Rock', 'EMI', 64, 'Yellow Submarine is the tenth studio album by the Beatles in the United Kingdom, released on Apple Records. It was issued as the soundtrack to the film of the same name, which premiered in the United Kingdom seven months prior to the album''s release.');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, GENRE, MUSIC_COMPANY, TOTAL_DURATION, DESCRIPTION) VALUES (103, 'CD', 'Magical Mystery Tour', 14.99, 'Pop Rock', 'Parlophone', 78, 'Magical Mystery Tour is a double EP and LP by the English rock group the Beatles, produced by George Martin, both including the six-song soundtrack to the 1967 film of the same name. The material was released in the United Kingdom on 8 December 1967 as a six-track double EP on the Parlophone label; in the United States the record, released on 27 November 1967, was an eleven-track LP compiled by Capitol Records, adding the band''s 1967 single releases. The EP was also released in Germany, France, Spain, Yugoslavia, Australia and Japan. [1] The first official release of the recordings in the UK as an eleven-track LP did not occur until 1976');
INSERT INTO ITEM (ID, DTYPE, TITLE, UNIT_COST, GENRE, MUSIC_COMPANY, TOTAL_DURATION, DESCRIPTION) VALUES (104, 'CD', 'Sgt. Pepper''s Lonely Hearts Club Band', 24.99, 'Pop Rock', 'Parlophone', 48, 'Sgt. Pepper''s Lonely Hearts Club Band (often shortened to Sgt. Pepper) is the eighth studio album by English rock band the Beatles. Released in June 1967, the album, which included songs such as "With a Little Help from My Friends", "Lucy in the Sky with Diamonds", and "A Day in the Life", now has over 30 million albums sold. Continuing the artistic maturation seen on the band''s album Revolver (1966), Sgt. Pepper further departed from the conventional pop rock idiom of the time and incorporated balladry, psychedelic, music hall, and symphonic influences');
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (100, 3001);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (100, 3002);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (100, 3003);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (100, 3004);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (101, 3001);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (101, 3002);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (101, 3003);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (101, 3004);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (102, 3001);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (102, 3002);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (102, 3003);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (102, 3004);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (103, 3001);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (103, 3002);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (103, 3003);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (103, 3004);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3001);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3002);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3003);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3004);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3005);
INSERT INTO CD_MUSICIAN (CD_FK, MUSICIAN_FK) VALUES (104, 3006);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3001, 100);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3002, 100);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3001, 101);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3002, 101);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3001, 102);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3002, 102);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3001, 103);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3002, 103);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3001, 104);
INSERT INTO MUSICIAN_CD (MUSICIAN_FK, CD_FK) VALUES (3002, 104);
|
/****** Object: Table [T_EUS_Proposal_Users_State_Name] ******/
/****** RowCount: 5 ******/
/****** Columns: ID, Name ******/
INSERT INTO [T_EUS_Proposal_Users_State_Name] VALUES (1,'Associated with active proposal')
INSERT INTO [T_EUS_Proposal_Users_State_Name] VALUES (2,'Associated with inactive proposal')
INSERT INTO [T_EUS_Proposal_Users_State_Name] VALUES (3,'Unknown association; may need to delete')
INSERT INTO [T_EUS_Proposal_Users_State_Name] VALUES (4,'Permanently associated with proposal')
INSERT INTO [T_EUS_Proposal_Users_State_Name] VALUES (5,'No longer associated with proposal')
|
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'Queensland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Queensland')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Maryland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Maryland')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Ohio' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Ohio')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Queensland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Queensland')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Queensland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Queensland')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Alberta' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Alberta')
INSERT INTO Providence (ProvidenceName) SELECT 'Queensland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Queensland')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'Queensland' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Queensland')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Victoria' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Victoria')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Victoria' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Victoria')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'England' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='England')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Washington' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Washington')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
INSERT INTO Providence (ProvidenceName) SELECT 'California' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='California')
INSERT INTO Providence (ProvidenceName) SELECT 'Oregon' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='Oregon')
INSERT INTO Providence (ProvidenceName) SELECT 'New South Wales' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='New South Wales')
INSERT INTO Providence (ProvidenceName) SELECT 'British Columbia' WHERE NOT EXISTS (SELECT ProvidenceName FROM Providence WHERE ProvidenceName='British Columbia')
|
-- MySQL dump 10.13 Distrib 5.6.23, for Win32 (x86)
--
-- Host: localhost Database: marks_attend
-- ------------------------------------------------------
-- Server version 5.6.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `schemas_status`
--
DROP TABLE IF EXISTS `schemas_status`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schemas_status` (
`acad_year` varchar(45) NOT NULL,
`program` varchar(45) DEFAULT NULL,
`branch` varchar(45) DEFAULT NULL,
`semester` varchar(45) DEFAULT NULL,
`sub_code` varchar(45) DEFAULT NULL,
`section` varchar(45) DEFAULT NULL,
`assesment_type` varchar(45) DEFAULT NULL,
`assesment_method` varchar(45) DEFAULT NULL,
`assesment_number` varchar(45) DEFAULT NULL,
`fac_id` varchar(45) DEFAULT NULL,
`schema_used` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `schemas_status`
--
LOCK TABLES `schemas_status` WRITE;
/*!40000 ALTER TABLE `schemas_status` DISABLE KEYS */;
INSERT INTO `schemas_status` VALUES ('2016-17','1A','5','6','13CS1102','1','test','','1','vasishta','schemaId20170421142803'),('2016-17','1A','5','6','13CS1102','1','test','','2','vasishta','schemaId20170421143057'),('2016-17','1A','5','6','13CS1102','1','assesment','Assignment','1','vasishta','schemaId20170421171521'),('2016-17','1A','5','4','15CT1109','2','test','','1','sanoop','schemaId20170424113302'),('2016-17','1A','5','4','15CT1109','2','test','','1','sanoop','schemaId20170424113433'),('2016-17','1A','5','6','13CT1124','1','test','','2','cshanti','schemaId20170607093410'),('2016-17','1A','5','6','13CT1124','1','assesment','Quiz','1','cshanti','schemaId20170607133743'),('2016-17','1A','5','6','13CT1124','1','assesment','Quiz','2','cshanti','schemaId20170607135042'),('2016-17','1A','5','6','13CT1124','1','assesment','Assignment','1','cshanti','schemaId20170607141832'),('2016-17','1A','5','6','1','1','assesment','Quiz','4','cshanti','schemaId20170608100041'),('2016-17','1A','5','6','13CT1124','1','assesment','Quiz','3','cshanti','schemaId20170608100147'),('2016-17','1A','5','6','1','1','assesment','Assignment','4','cshanti','schemaId20170608101053'),('2016-17','1A','5','6','13CT1124','1','assesment','Assignment','4','cshanti','schemaId20170608101155'),('2016-17','1A','5','6','13CT1124','1','test','','1','cshanti','schemaId20170608111731');
/*!40000 ALTER TABLE `schemas_status` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-07-18 15:07:36
|
## 3. Your First Query ##
SELECT *
FROM recent_grads;
## 4. Understanding Your First Query ##
SELECT *
FROM recent_grads;
select * from recent_grads;
## 6. The LIMIT Clause ##
SELECT *
FROM recent_grads
LIMIT 5;
## 7. Selecting Specific Columns ##
SELECT Major, ShareWomen
FROM recent_grads;
## 8. Filtering Rows Using WHERE ##
SELECT Major, ShareWomen
FROM recent_grads
WHERE ShareWomen < 0.5;
## 9. Expressing Multiple Filter Criteria Using 'AND' ##
SELECT Major, Major_category, Median, ShareWomen
FROM recent_grads
WHERE ShareWomen > 0.5
AND Median > 50000;
## 10. Returning One of Several Conditions With OR ##
SELECT Major, Median, Unemployed
FROM recent_grads
WHERE Median >= 10000
OR Men > Women
LIMIT 20;
## 11. Grouping Operators with Parentheses ##
SELECT Major, Major_category, ShareWomen, Unemployment_rate
FROM recent_grads
WHERE (Major_category = 'Engineering')
AND (ShareWomen > 0.5 OR Unemployment_rate < 0.051);
## 12. Ordering Results Using ORDER BY ##
SELECT Major, ShareWomen, Unemployment_rate
FROM recent_grads
WHERE ShareWomen > 0.3
AND Unemployment_rate < .1
ORDER BY ShareWomen DESC;
## 13. Practice Writing a Query ##
SELECT Major_category, Major, Unemployment_rate
FROM recent_grads
WHERE Major_category='Engineering'
OR Major_category='Physical Sciences'
ORDER BY Unemployment_rate;
|
INSERT INTO Terminal(Label) VALUES ('Terminal 1');
INSERT INTO Terminal(Label) VALUES ('Terminal 2');
INSERT INTO Terminal(Label) VALUES ('Terminal 3');
|
/*
SQLyog Community v13.1.6 (64 bit)
MySQL - 10.4.10-MariaDB
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
create table `tbl_events` (
`fld_events_id` int (11),
`fld_events_title` varchar (300),
`fld_start_date` date ,
`fld_end_date` date ,
`fld_recurrence` tinyint (1),
`fld_recurrence_type_name` varchar (300),
`created_datetime` varchar (90),
`updated_datetime` varchar (90)
);
|
CREATE TEMPORARY TABLE dfs.tmp.temp_tbl10d PARTITION BY ( col_vrchr2 )
AS
SELECT col_int, col_chr, col_vrchr1, col_vrchr2, col_dt, col_tim, col_tmstmp , col_flt, col_intrvl_yr, col_intrvl_day, col_bln
FROM typeall_l;
SELECT
DISTINCT col_vrchr2,
MIN(col_vrchr2) min_vrchr2,
MAX(col_vrchr2) mx_vrchr2,
COUNT(*) cow_nt
FROM dfs.tmp.temp_tbl10d
GROUP BY col_vrchr2;
DROP TABLE dfs.tmp.temp_tbl10d;
|
/*
Enter your query here.
*/
select
w.id, p.age, w.coins_needed, w.power
from
wands as w
join
wands_property as p
on w.code = p.code
where
p.is_evil != '1' and
w.coins_needed =
(
select
min(coins_needed)
from
wands as w1
join
wands_property as p1
on
w1.code = p1.code
where
w1.power = w.power and
p1.age = p.age
)
order by
w.power desc,
p.age desc;
|
create index if not exists idx1 on table1(p.a, p.b, z_order_lat_lon(c.c1, c.c2), c.d, c.e) using left join
|
CREATE TABLE [dbo].[AlertConfiguration]
(
[Id] INT NOT NULL PRIMARY KEY,
[Key] VARCHAR(50) NOT NULL,
[Value] VARCHAR(100) NULL,
[MinValue] INT NULL,
[MaxValue] INT NULL
)
|
-- create-db.sql
-- temperature
drop table temperature_measurements;
create table temperature_measurements (id int, date timestamp with time zone, device_id varchar(30), temperature_millic int);
drop sequence temperature_measurements_seq;
create sequence temperature_measurements_seq;
alter table temperature_measurements alter column id set default nextval('temperature_measurements_seq');
-- pressure
drop table pressure_measurements;
create table pressure_measurements (id int, date timestamp with time zone, device_id varchar(30), pressure_pa int);
drop sequence pressure_measurements_seq;
create sequence pressure_measurements_seq;
alter table pressure_measurements alter column id set default nextval('pressure_measurements_seq');
|
INSERT INTO Towns(Id,Name)
VALUES (1,'Sofia'), (2, 'Plovdiv'), (3,'Varna')
INSERT INTO Minions(Id,Name,Age,TownId)
VALUES (1,'Kevin', 22, 1), (2, 'Bob', 15, 3), (3,'Steward', NULL, 2)
|
-- BCrypt
-- admin -> $2a$10$DJr9REpKHS5SknDJxUwVPOXQ6SCI72qt5ki5vvYOa4ln3Hfrh67.u
-- 1234 -> $2a$10$Ui91L7As0DQzgHiYwTsmv.BrnF9iBY2N3qPpbf/vR6cDAXUPAlqOK
INSERT INTO USUARIO(nome, email, senha) VALUES('admin', 'admin', '$2a$10$DJr9REpKHS5SknDJxUwVPOXQ6SCI72qt5ki5vvYOa4ln3Hfrh67.u');
INSERT INTO USUARIO(nome, email, senha) VALUES('mu', 'mu@gmail.com', '$2a$10$Ui91L7As0DQzgHiYwTsmv.BrnF9iBY2N3qPpbf/vR6cDAXUPAlqOK');
INSERT INTO USUARIO(nome, email, senha) VALUES('aluno', 'aluno@email.com', '$2a$10$Ui91L7As0DQzgHiYwTsmv.BrnF9iBY2N3qPpbf/vR6cDAXUPAlqOK');
INSERT INTO CURSO(nome, categoria) VALUES('Spring Boot', 'Programação');
INSERT INTO CURSO(nome, categoria) VALUES('HTML 5', 'Front-end');
INSERT INTO CURSO(nome, categoria) VALUES('Java 8', 'Back-end');
INSERT INTO TOPICO(titulo, mensagem, data_criacao, status, autor_id, curso_id) VALUES('Dúvida', 'Erro ao criar projeto', '2019-05-05 18:00:00', 'NAO_RESPONDIDO', 1, 1);
INSERT INTO TOPICO(titulo, mensagem, data_criacao, status, autor_id, curso_id) VALUES('Dúvida 2', 'Projeto não compila', '2019-05-05 19:00:00', 'NAO_RESPONDIDO', 2, 1);
INSERT INTO TOPICO(titulo, mensagem, data_criacao, status, autor_id, curso_id) VALUES('Dúvida 3', 'Tag HTML', '2019-05-05 20:00:00', 'NAO_RESPONDIDO', 1, 2);
INSERT INTO TOPICO(titulo, mensagem, data_criacao, status, autor_id, curso_id) VALUES('Dúvida 4', 'Java 8 - Lambda', '2019-05-05 20:00:00', 'NAO_RESPONDIDO', 3, 3);
|
-- This file should undo anything in `up.sql`
drop table employees_skills
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 16 Sty 2018, 11:40
-- Wersja serwera: 10.1.28-MariaDB
-- Wersja PHP: 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 */;
--
-- Baza danych: `1404_jitw`
--
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `courses`
--
CREATE TABLE `courses` (
`course_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`descr` text NOT NULL,
`password` varchar(100) NOT NULL,
`owner` int(11) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `coursetask`
--
CREATE TABLE `coursetask` (
`task_id` int(11) NOT NULL,
`course_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL,
`maxNote` tinyint(3) NOT NULL,
`acceptedFile` tinyint(1) NOT NULL,
`deadline` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`timeAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `shoutbox`
--
CREATE TABLE `shoutbox` (
`id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`text` varchar(255) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `usercourses`
--
CREATE TABLE `usercourses` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`course_id` varchar(255) NOT NULL,
`dateJoined` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `users`
--
CREATE TABLE `users` (
`user_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`password` varchar(100) NOT NULL,
`email` varchar(255) NOT NULL,
`access` smallint(1) NOT NULL DEFAULT '0',
`profilepic` varchar(255) NOT NULL DEFAULT 'default-profile.png',
`lastLogin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `usertasks`
--
CREATE TABLE `usertasks` (
`id` int(8) NOT NULL,
`task_id` int(8) NOT NULL,
`course_id` int(8) NOT NULL,
`user_id` int(8) NOT NULL,
`note` int(3) NOT NULL DEFAULT '-1',
`filename` varchar(300) NOT NULL,
`timeAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`timeChecked` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indeksy dla zrzutów tabel
--
--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
ADD PRIMARY KEY (`course_id`);
--
-- Indexes for table `coursetask`
--
ALTER TABLE `coursetask`
ADD PRIMARY KEY (`task_id`);
--
-- Indexes for table `shoutbox`
--
ALTER TABLE `shoutbox`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `usercourses`
--
ALTER TABLE `usercourses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `usertasks`
--
ALTER TABLE `usertasks`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT dla tabeli `courses`
--
ALTER TABLE `courses`
MODIFY `course_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
--
-- AUTO_INCREMENT dla tabeli `coursetask`
--
ALTER TABLE `coursetask`
MODIFY `task_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
--
-- AUTO_INCREMENT dla tabeli `shoutbox`
--
ALTER TABLE `shoutbox`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
--
-- AUTO_INCREMENT dla tabeli `usercourses`
--
ALTER TABLE `usercourses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
--
-- AUTO_INCREMENT dla tabeli `users`
--
ALTER TABLE `users`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
--
-- AUTO_INCREMENT dla tabeli `usertasks`
--
ALTER TABLE `usertasks`
MODIFY `id` int(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
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 */;
|
/*
This worksheet walks through the process of accessing the SafeGraph data hosted in the
Snowflake Data Marketplace (https://www.snowflake.com/datasets/safegraph-foot-traffic-patterns-starbucks/)
and joining it with some "internal" data using the Placekey External Function
*/
// setup
// note: you may have to change the name of the file to reflect the database name in your instance
use role accountadmin;
use demo_db;
// get SafeGraph patterns data for NY Starbucks locations
// note: you may have to change the name of the file to reflect the filename in your instance
select *
from safegraph_aws_us_east_2_starbucks_patterns_sample.public.patterns
where region = 'NY'
limit 10;
// pull "internal" data from an s3 bucket
CREATE OR REPLACE TABLE starbucks_origin (
brand VARCHAR(20),
store_number VARCHAR(20),
name VARCHAR(256),
ownership_type VARCHAR(256),
facility_id VARCHAR(128),
products VARCHAR(128),
service VARCHAR(128),
stations VARCHAR(128),
food_region VARCHAR(128),
venue_type VARCHAR(128),
phone_number VARCHAR(128),
location VARCHAR(512),
street_address VARCHAR(128),
street_line1 VARCHAR(128),
street_line2 VARCHAR(128),
city VARCHAR(128),
state VARCHAR(2),
zip VARCHAR(20),
country VARCHAR(2),
coordinates VARCHAR(40),
latitude VARCHAR(20),
longitude VARCHAR(20),
insert_date VARCHAR(30)
);
// copy the data from s3 into Snowflake
copy into starbucks_origin
from @aws_s3_starbucks_origin_stage
pattern = '.*.csv'
on_error = continue
;
// inspect the "internal" data
select *
from starbucks_origin
where state = 'NY';
delete from starbucks_origin
where state != 'NY';
// set up the Placekey External Function
// api integration object to communicate with lambda function
create or replace api integration placekey_api_integration
api_provider = aws_api_gateway
api_aws_role_arn = 'arn:aws:iam::886725170148:role/placekey-lambda-production'
enabled = true
api_allowed_prefixes = ('https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/')
;
// create the external function
create or replace external function get_placekeys_variant(
input variant
)
returns variant
api_integration = placekey_api_integration
headers = ('api-key' = 'lxsFTUkHSyT8mcQ4g4hn2UuoJqqSQJrH')
max_batch_rows = 1000
as 'https://lbdl9njufi.execute-api.us-east-1.amazonaws.com/api/placekeys'
;
// query the Placekey API to get Placekeys to conduct the join
create or replace temporary table placekeyed_data as (
select
cast(api_result[0] as integer) as id,
cast(api_result[1] as varchar) as placekey,
cast(api_result[2] as varchar) as error
from (
select get_placekeys_variant(object_construct(joined.*)) as api_result
from (
select
facility_id as primary_key,
brand as location_name,
street_address as street_address,
city as city,
state as region,
zip as postal_code,
latitude as latitude,
longitude as longitude
from starbucks_origin
) as joined
) as result
);
// visualize the merged datasets
select *
from placekeyed_data d
join starbucks_origin s on d.id = s.facility_id
join safegraph_aws_us_east_2_starbucks_patterns_sample.public.patterns p on p.placekey = d.placekey
limit 10;
// select certain columns for inspection
select d.placekey, s.service, p.visits_by_day
from placekeyed_data d
join starbucks_origin s on d.id = s.facility_id
join safegraph_aws_us_east_2_starbucks_patterns_sample.public.patterns p on p.placekey = d.placekey;
|
/*
Warnings:
- You are about to drop the column `clientFamilyMemberId` on the `Visitation` table. All the data in the column will be lost.
- You are about to drop the `ClientFamilyMember` table. If the table is not empty, all the data it contains will be lost.
- Added the required column `dateTime` to the `Visitation` table without a default value. This is not possible if the table is not empty.
- Added the required column `note` to the `Visitation` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "ClientFamilyMember" DROP CONSTRAINT "ClientFamilyMember_clientId_fkey";
-- DropForeignKey
ALTER TABLE "Visitation" DROP CONSTRAINT "Visitation_clientFamilyMemberId_fkey";
-- AlterTable
ALTER TABLE "Visitation" DROP COLUMN "clientFamilyMemberId",
ADD COLUMN "dateTime" TIMESTAMP(3) NOT NULL,
ADD COLUMN "note" TEXT NOT NULL;
-- DropTable
DROP TABLE "ClientFamilyMember";
|
DROP TABLE IF EXISTS Channels;
|
CREATE TABLE [dbo].[Quote]
(
[QuoteId] [int] NOT NULL IDENTITY(1, 1),
[AuthorId] [int] NOT NULL,
[QuoteText] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Quote] ADD CONSTRAINT [PK_Quote] PRIMARY KEY CLUSTERED ([QuoteId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Quote] ADD CONSTRAINT [FK_Quote_Author] FOREIGN KEY ([AuthorId]) REFERENCES [dbo].[Author] ([AuthorId])
GO
|
-- Your SQL goes here
CREATE TABLE birthdays (
id TEXT PRIMARY KEY NOT NULL,
userid TEXT NOT NULL,
channelid TEXT NOT NULL,
guildid TEXT NOT NULL,
date DATE NOT NULL,
lastdate DATE NOT NULL,
allexceptdate BOOLEAN NOT NULL,
notifyrole TEXT
);
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 23 Mei 2021 pada 15.44
-- Versi Server: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `gis_projek`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_jagung`
--
CREATE TABLE `t_jagung` (
`Id_Wilayah` varchar(5) CHARACTER SET latin1 DEFAULT NULL,
`ID` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
`Id_Jenis` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
`Tahun` int(4) DEFAULT NULL,
`Luas_Lahan_Tanam` varchar(7) DEFAULT NULL,
`Luas_Aktivitas_Tanam` int(6) DEFAULT NULL,
`Jumlah_Produktivitas` varchar(11) DEFAULT NULL,
`Rata_Rata_Produktivitas_Produk` varchar(8) DEFAULT NULL,
`Rata_Rata_Produktivitas_Lahan` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `t_jagung`
--
INSERT INTO `t_jagung` (`Id_Wilayah`, `ID`, `Id_Jenis`, `Tahun`, `Luas_Lahan_Tanam`, `Luas_Aktivitas_Tanam`, `Jumlah_Produktivitas`, `Rata_Rata_Produktivitas_Produk`, `Rata_Rata_Produktivitas_Lahan`) VALUES
('JT001', 'MG01', 'JN02', 2019, '91', 109, '0', '0', '1.1978'),
('JT001', 'MG02', 'JN02', 2019, '308', 209, '0', '0', '0.6786'),
('JT001', 'MG03', 'JN02', 2019, '181', 181, '0', '0', '1.0000'),
('JT001', 'MG04', 'JN02', 2019, '88', 93, '0', '0', '1.0568'),
('JT001', 'MG05', 'JN02', 2019, '250', 250, '0', '0', '1.0000'),
('JT001', 'MG06', 'JN02', 2019, '106', 39, '0', '0', '0.3679'),
('JT001', 'MG07', 'JN02', 2019, '31', 31, '0', '0', '1.0000'),
('JT001', 'MG08', 'JN02', 2019, '22', 27, '0', '0', '1.2273'),
('JT001', 'MG09', 'JN02', 2019, '48', 134, '0', '0', '2.7917'),
('JT001', 'MG10', 'JN02', 2019, '223', 375, '0', '0', '1.6816'),
('JT001', 'MG11', 'JN02', 2019, '92', 68, '0', '0', '0.7391'),
('JT001', 'MG12', 'JN02', 2019, '73', 85, '0', '0', '1.1644'),
('JT001', 'MG13', 'JN02', 2019, '186', 138, '0', '0', '0.7419'),
('JT001', 'MG14', 'JN02', 2019, '741', 1161, '0', '0', '1.5668'),
('JT001', 'MG15', 'JN02', 2019, '546', 556, '0', '0', '1.0183'),
('JT001', 'MG16', 'JN02', 2019, '2383', 2179, '0', '0', '0.9144'),
('JT001', 'MG17', 'JN02', 2019, '389', 408, '0', '0', '1.0488'),
('JT001', 'MG18', 'JN02', 2019, '1055', 1120, '0', '0', '1.0616'),
('JT001', 'MG19', 'JN02', 2019, '579', 691, '0', '0', '1.1934'),
('JT001', 'MG20', 'JN02', 2019, '70', 79, '0', '0', '1.1286'),
('JT001', 'MG21', 'JN02', 2019, '40', 167, '0', '0', '4.1750'),
('JT001', 'MG01', 'JN02', 2020, ' 101 ', 96, '0', '0', '0.95'),
('JT001', 'MG02', 'JN02', 2020, ' 387 ', 280, '0', '0', '0.72'),
('JT001', 'MG03', 'JN02', 2020, ' 149 ', 117, '0', '0', '0.79'),
('JT001', 'MG04', 'JN02', 2020, ' 265 ', 135, '0', '0', '0.51'),
('JT001', 'MG05', 'JN02', 2020, ' 72 ', 75, '0', '0', '1.04'),
('JT001', 'MG06', 'JN02', 2020, ' 100 ', 36, '0', '0', '0.36'),
('JT001', 'MG07', 'JN02', 2020, ' 45 ', 38, '0', '0', '0.84'),
('JT001', 'MG08', 'JN02', 2020, ' 22 ', 8, '0', '0', '0.36'),
('JT001', 'MG09', 'JN02', 2020, ' 152 ', 88, '0', '0', '0.58'),
('JT001', 'MG10', 'JN02', 2020, ' 232 ', 156, '0', '0', '0.67'),
('JT001', 'MG11', 'JN02', 2020, ' 33 ', 54, '0', '0', '1.64'),
('JT001', 'MG12', 'JN02', 2020, ' 104 ', 56, '0', '0', '0.54'),
('JT001', 'MG13', 'JN02', 2020, ' 86 ', 186, '0', '0', '2.16'),
('JT001', 'MG14', 'JN02', 2020, ' 514 ', 790, '0', '0', '1.54'),
('JT001', 'MG15', 'JN02', 2020, ' 258 ', 230, '0', '0', '0.89'),
('JT001', 'MG16', 'JN02', 2020, ' 1,539 ', 2163, '0', '0', '1.41'),
('JT001', 'MG17', 'JN02', 2020, ' 456 ', 459, '0', '0', '1.01'),
('JT001', 'MG18', 'JN02', 2020, ' 606 ', 725, '0', '0', '1.20'),
('JT001', 'MG19', 'JN02', 2020, ' 719 ', 312, '0', '0', '0.43'),
('JT001', 'MG20', 'JN02', 2020, ' 429 ', 65, '0', '0', '0.15'),
('JT001', 'MG21', 'JN02', 2020, ' 77 ', 56, '0', '0', '0.73'),
('DIY02', 'SL01', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY02', 'SL02', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY02', 'SL03', 'JN02', 2019, '0', 174, ' 1,235.00 ', '0', '0'),
('DIY02', 'SL04', 'JN02', 2019, '0', 23, ' 165.10 ', '0', '0'),
('DIY02', 'SL05', 'JN02', 2019, '0', 23, ' 167.20 ', '0', '0'),
('DIY02', 'SL06', 'JN02', 2019, '0', 108, ' 776.62 ', '0', '0'),
('DIY02', 'SL07', 'JN02', 2019, '0', 19, ' 139.08 ', '0', '0'),
('DIY02', 'SL08', 'JN02', 2019, '0', 430, ' 3,144.00 ', '0', '0'),
('DIY02', 'SL09', 'JN02', 2019, '0', 752, ' 548.10 ', '0', '0'),
('DIY02', 'SL10', 'JN02', 2019, '266.97', 265, ' 1,919.01 ', ' 7.1881 ', '0.9918'),
('DIY02', 'SL11', 'JN02', 2019, '0', 646, ' 469.10 ', '0', '0.0000'),
('DIY02', 'SL12', 'JN02', 2019, '5119.9', 519, ' 376.38 ', ' 0.0735 ', '9.8668'),
('DIY02', 'SL13', 'JN02', 2019, '625', 623, ' 452.70 ', ' 0.7243 ', '1.0032'),
('DIY02', 'SL14', 'JN02', 2019, '0', 544, ' 3,955.79 ', '0', '0.0000'),
('DIY02', 'SL15', 'JN02', 2019, '0', 49, ' 344.27 ', '0', '0.0000'),
('DIY02', 'SL16', 'JN02', 2019, '137', 17, ' 972.70 ', ' 7.1000 ', '8.0588'),
('DIY02', 'SL17', 'JN02', 2019, '0', 40, ' 287.00 ', '0', '0.0000'),
('DIY02', 'SL01', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL02', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL03', 'JN02', 2020, '0', 242, ' 1,716.90 ', '0', '0'),
('DIY02', 'SL04', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL05', 'JN02', 2020, '0', 4, ' 28.00 ', '0', '0'),
('DIY02', 'SL06', 'JN02', 2020, '0', 206, ' 13,270.00 ', '0', '0'),
('DIY02', 'SL07', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL09', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL10', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL11', 'JN02', 2020, '0', 60, ' 485.20 ', '0', '0'),
('DIY02', 'SL12', 'JN02', 2020, '504.8', 493, ' 7.25 ', ' 0.01 ', ' 0.98 '),
('DIY02', 'SL13', 'JN02', 2020, '679', 679, ' 468.60 ', ' 0.69 ', ' 1.00 '),
('DIY02', 'SL14', 'JN02', 2020, '0', 466, ' 3,381.00 ', '0', '0'),
('DIY02', 'SL15', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL16', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY02', 'SL17', 'JN02', 2020, '0', 40, ' 287.00 ', '0', '0'),
('DIY04', 'KP01', 'JN02', 2019, '70', 413, '0', '0', ''),
('DIY04', 'KP02', 'JN02', 2019, '232.4', 1320, '0', '0', ''),
('DIY04', 'KP03', 'JN02', 2019, '493.4', 3005, '0', '0', ''),
('DIY04', 'KP04', 'JN02', 2019, '61.4', 382, '0', '0', ''),
('DIY04', 'KP05', 'JN02', 2019, '531.4', 3191, '0', '0', ''),
('DIY04', 'KP06', 'JN02', 2019, '1575.9', 9139, '0', '0', ''),
('DIY04', 'KP07', 'JN02', 2019, '1115.9', 6528, '0', '0', ''),
('DIY04', 'KP08', 'JN02', 2019, '110.4', 670, '0', '0', ''),
('DIY04', 'KP09', 'JN02', 2019, '189.3', 1173, '0', '0', ''),
('DIY04', 'KP10', 'JN02', 2019, '321.5', 1970, '0', '0', ''),
('DIY04', 'KP11', 'JN02', 2019, '304.2', 1864, '0', '0', ''),
('DIY04', 'KP12', 'JN02', 2019, '73.9', 459, '0', '0', ''),
('DIY04', 'KP01', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP02', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP03', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP04', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP05', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP06', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP07', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP09', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP10', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP11', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY04', 'KP12', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR01', 'JN02', 2019, '1857', 0, '0', '0', '0'),
('JT003', 'PR02', 'JN02', 2019, '406', 0, '0', '0', '0'),
('JT003', 'PR03', 'JN02', 2019, '358', 0, '0', '0', '0'),
('JT003', 'PR04', 'JN02', 2019, '343', 0, '0', '0', '0'),
('JT003', 'PR05', 'JN02', 2019, '7', 0, '0', '0', '0'),
('JT003', 'PR06', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT003', 'PR07', 'JN02', 2019, '152', 0, '0', '0', '0'),
('JT003', 'PR08', 'JN02', 2019, '386', 0, '0', '0', '0'),
('JT003', 'PR09', 'JN02', 2019, '109.5', 0, '0', '0', '0'),
('JT003', 'PR10', 'JN02', 2019, '75', 0, '0', '0', '0'),
('JT003', 'PR11', 'JN02', 2019, '58', 0, '0', '0', '0'),
('JT003', 'PR12', 'JN02', 2019, '159', 0, '0', '0', '0'),
('JT003', 'PR13', 'JN02', 2019, '209', 0, '0', '0', '0'),
('JT003', 'PR14', 'JN02', 2019, '196', 0, '0', '0', '0'),
('JT003', 'PR15', 'JN02', 2019, '237', 0, '0', '0', '0'),
('JT003', 'PR16', 'JN02', 2019, '31.5', 0, '0', '0', '0'),
('JT003', 'PR01', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR02', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR03', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR04', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR05', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR06', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR07', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR09', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR10', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR11', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR12', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR13', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR14', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR15', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT003', 'PR16', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL01', 'JN02', 2019, '0', 575, '0', '0', '0'),
('JT002', 'KL02', 'JN02', 2019, '0', 2981, '0', '0', '0'),
('JT002', 'KL03', 'JN02', 2019, '0', 0, '2773', '0', '0'),
('JT002', 'KL04', 'JN02', 2019, '0', 0, '7607', '0', '0'),
('JT002', 'KL05', 'JN02', 2019, '0', 34, '0', '0', '0'),
('JT002', 'KL06', 'JN02', 2019, '0', 1032, '0', '0', '0'),
('JT002', 'KL07', 'JN02', 2019, '0', 4308, '0', '0', '0'),
('JT002', 'KL08', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL09', 'JN02', 2019, '0', 340, '0', '0', '0'),
('JT002', 'KL10', 'JN02', 2019, '0', 364, '0', '0', '0'),
('JT002', 'KL11', 'JN02', 2019, '0', 339, '0', '0', '0'),
('JT002', 'KL12', 'JN02', 2019, '0', 0, '280.8', '0', '0'),
('JT002', 'KL13', 'JN02', 2019, '0', 509, '0', '0', '0'),
('JT002', 'KL14', 'JN02', 2019, '0', 417, '0', '0', '0'),
('JT002', 'KL15', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL16', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL17', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL18', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL19', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL20', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL21', 'JN02', 2019, '0', 2605, '0', '0', '0'),
('JT002', 'KL22', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL23', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL24', 'JN02', 2019, '0', 45, '0', '0', '0'),
('JT002', 'KL25', 'JN02', 2019, '0', 399, '0', '0', '0'),
('JT002', 'KL26', 'JN02', 2019, '0', 0, '0', '0', '0'),
('JT002', 'KL01', 'JN02', 2020, '3', 0, '0', '0', '0'),
('JT002', 'KL02', 'JN02', 2020, '173.63', 0, '0', '0', '0'),
('JT002', 'KL03', 'JN02', 2020, '55', 0, '0', '0', '0'),
('JT002', 'KL04', 'JN02', 2020, '18', 0, '0', '0', '0'),
('JT002', 'KL05', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL06', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL07', 'JN02', 2020, '28.6', 0, '0', '0', '0'),
('JT002', 'KL08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL09', 'JN02', 2020, '49.6', 0, '0', '0', '0'),
('JT002', 'KL10', 'JN02', 2020, '5', 0, '0', '0', '0'),
('JT002', 'KL11', 'JN02', 2020, '4', 0, '0', '0', '0'),
('JT002', 'KL12', 'JN02', 2020, '2', 0, '0', '0', '0'),
('JT002', 'KL13', 'JN02', 2020, '52.33', 0, '0', '0', '0'),
('JT002', 'KL14', 'JN02', 2020, '24.91', 0, '0', '0', '0'),
('JT002', 'KL15', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL16', 'JN02', 2020, '8.98', 0, '0', '0', '0'),
('JT002', 'KL17', 'JN02', 2020, '42', 0, '0', '0', '0'),
('JT002', 'KL18', 'JN02', 2020, '8.64', 0, '0', '0', '0'),
('JT002', 'KL19', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL20', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL21', 'JN02', 2020, '2', 0, '0', '0', '0'),
('JT002', 'KL22', 'JN02', 2020, '48.38', 0, '0', '0', '0'),
('JT002', 'KL23', 'JN02', 2020, '0', 0, '0', '0', '0'),
('JT002', 'KL24', 'JN02', 2020, '6.6', 0, '0', '0', '0'),
('JT002', 'KL25', 'JN02', 2020, '3.12', 0, '0', '0', '0'),
('JT002', 'KL26', 'JN02', 2020, '1.2', 0, '0', '0', '0'),
('DIY05', 'GK01', 'JN02', 2019, '0', 3112, '0', '0', '0'),
('DIY05', 'GK02', 'JN02', 2019, '0', 1200, '0', '0', '0'),
('DIY05', 'GK03', 'JN02', 2019, '0', 2748, '0', '0', '0'),
('DIY05', 'GK04', 'JN02', 2019, '0', 5136, '0', '0', '0'),
('DIY05', 'GK05', 'JN02', 2019, '0', 3162, '0', '0', '0'),
('DIY05', 'GK06', 'JN02', 2019, '0', 1965, '0', '0', '0'),
('DIY05', 'GK07', 'JN02', 2019, '0', 2660, '0', '0', '0'),
('DIY05', 'GK08', 'JN02', 2019, '0', 2642, '0', '0', '0'),
('DIY05', 'GK09', 'JN02', 2019, '0', 3095, '0', '0', '0'),
('DIY05', 'GK10', 'JN02', 2019, '0', 4789, '0', '0', '0'),
('DIY05', 'GK11', 'JN02', 2019, '0', 3090, '0', '0', '0'),
('DIY05', 'GK12', 'JN02', 2019, '0', 2903, '0', '0', '0'),
('DIY05', 'GK13', 'JN02', 2019, '0', 2977, '0', '0', '0'),
('DIY05', 'GK14', 'JN02', 2019, '0', 1675, '0', '0', '0'),
('DIY05', 'GK15', 'JN02', 2019, '0', 833, '0', '0', '0'),
('DIY05', 'GK16', 'JN02', 2019, '0', 4111, '0', '0', '0'),
('DIY05', 'GK17', 'JN02', 2019, '0', 1079, '0', '0', '0'),
('DIY05', 'GK18', 'JN02', 2019, '0', 3939, '0', '0', '0'),
('DIY05', 'GK01', 'JN02', 2020, '0', 3114, '0', '0', '0'),
('DIY05', 'GK02', 'JN02', 2020, '0', 1059, '0', '0', '0'),
('DIY05', 'GK03', 'JN02', 2020, '0', 3048, '0', '0', '0'),
('DIY05', 'GK04', 'JN02', 2020, '0', 5921, '0', '0', '0'),
('DIY05', 'GK05', 'JN02', 2020, '0', 3162, '0', '0', '0'),
('DIY05', 'GK06', 'JN02', 2020, '0', 1975, '0', '0', '0'),
('DIY05', 'GK07', 'JN02', 2020, '0', 2652, '0', '0', '0'),
('DIY05', 'GK08', 'JN02', 2020, '0', 2463, '0', '0', '0'),
('DIY05', 'GK09', 'JN02', 2020, '0', 3603, '0', '0', '0'),
('DIY05', 'GK10', 'JN02', 2020, '0', 5067, '0', '0', '0'),
('DIY05', 'GK11', 'JN02', 2020, '0', 3074, '0', '0', '0'),
('DIY05', 'GK12', 'JN02', 2020, '0', 3297, '0', '0', '0'),
('DIY05', 'GK13', 'JN02', 2020, '0', 2827, '0', '0', '0'),
('DIY05', 'GK14', 'JN02', 2020, '0', 1704, '0', '0', '0'),
('DIY05', 'GK15', 'JN02', 2020, '0', 532, '0', '0', '0'),
('DIY05', 'GK16', 'JN02', 2020, '0', 3964, '0', '0', '0'),
('DIY05', 'GK17', 'JN02', 2020, '0', 1327, '0', '0', '0'),
('DIY05', 'GK18', 'JN02', 2020, '0', 4158, '0', '0', '0'),
('DIY03', 'BL01', 'JN02', 2019, '0', 117, '0', '0', '0'),
('DIY03', 'BL02', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL03', 'JN02', 2019, '0', 283, '0', '0', '0'),
('DIY03', 'BL04', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL05', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL06', 'JN02', 2019, '0', 271, '0', '0', '0'),
('DIY03', 'BL07', 'JN02', 2019, '0', 170, '0', '0', '0'),
('DIY03', 'BL08', 'JN02', 2019, '0', 71, '0', '0', '0'),
('DIY03', 'BL09', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL10', 'JN02', 2019, '0', 782, '0', '0', '0'),
('DIY03', 'BL11', 'JN02', 2019, '0', 129, '0', '0', '0'),
('DIY03', 'BL12', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL13', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL14', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY03', 'BL15', 'JN02', 2019, '0', 101, '0', '0', '0'),
('DIY03', 'BL16', 'JN02', 2019, '0', 510, '0', '0', '0'),
('DIY03', 'BL17', 'JN02', 2019, '0', 110, '0', '0', '0'),
('DIY03', 'BL01', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL02', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL03', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL04', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL05', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL06', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL07', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL09', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL10', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL11', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL12', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL13', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL14', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL15', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL16', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY03', 'BL17', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK01', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK02', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK03', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK04', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK05', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK06', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK07', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK08', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK09', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK10', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK11', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK12', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK13', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK14', 'JN02', 2019, '0', 0, '0', '0', '0'),
('DIY01', 'YK01', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK02', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK03', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK04', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK05', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK06', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK07', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK08', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK09', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK10', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK11', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK12', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK13', 'JN02', 2020, '0', 0, '0', '0', '0'),
('DIY01', 'YK14', 'JN02', 2020, '0', 0, '0', '0', '0');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_jenis`
--
CREATE TABLE `t_jenis` (
`Id_Komuditas` varchar(5) CHARACTER SET latin1 DEFAULT NULL,
`Id_Jenis` varchar(4) CHARACTER SET latin1 NOT NULL,
`Jenis` varchar(27) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `t_jenis`
--
INSERT INTO `t_jenis` (`Id_Komuditas`, `Id_Jenis`, `Jenis`) VALUES
('KDM01', 'JN01', 'Padi / Beras'),
('KDM01', 'JN02', 'Jagung'),
('KDM01', 'JN03', 'Ubi Kayu'),
('KDM02', 'JN04', 'Bawang Merah'),
('KDM02', 'JN05', 'Cabai'),
('KDM02', 'JN06', 'Cabai Merah Besar'),
('KDM02', 'JN07', 'Cabai Rawit'),
('KDM02', 'JN08', 'Tebu'),
('KDM03', 'JN09', 'Daging Ayam (Ayam Pedaging)'),
('KDM03', 'JN10', 'Daging Sapi (Sapi Potong)'),
('KDM03', 'JN11', 'Telur Ayam (Banyak Telur)');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_kecamatan`
--
CREATE TABLE `t_kecamatan` (
`Id_Wilayah` varchar(5) CHARACTER SET latin1 DEFAULT NULL,
`ID` varchar(4) CHARACTER SET latin1 NOT NULL,
`Kecamatan` varchar(14) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `t_kecamatan`
--
INSERT INTO `t_kecamatan` (`Id_Wilayah`, `ID`, `Kecamatan`) VALUES
('DIY03', 'BL01', 'Srandakan'),
('DIY03', 'BL02', 'Sanden'),
('DIY03', 'BL03', 'Kretek'),
('DIY03', 'BL04', 'Pundong'),
('DIY03', 'BL05', 'Bambanglipuro'),
('DIY03', 'BL06', 'Pandak'),
('DIY03', 'BL07', 'Bantul'),
('DIY03', 'BL08', 'Jetis'),
('DIY03', 'BL09', 'Imogiri'),
('DIY03', 'BL10', 'Dlingo'),
('DIY03', 'BL11', 'Pleret'),
('DIY03', 'BL12', 'Piyungan'),
('DIY03', 'BL13', 'Banguntapan'),
('DIY03', 'BL14', 'Sewon'),
('DIY03', 'BL15', 'Kasihan'),
('DIY03', 'BL16', 'Pajangan'),
('DIY03', 'BL17', 'Sedayu'),
('DIY05', 'GK01', 'Panggang'),
('DIY06', 'GK02', 'Purwosari'),
('DIY07', 'GK03', 'Paliyan'),
('DIY08', 'GK04', 'Saptosari'),
('DIY09', 'GK05', 'Tepus'),
('DIY10', 'GK06', 'Tanjungsari'),
('DIY11', 'GK07', 'Rongkop'),
('DIY12', 'GK08', 'Girisubo'),
('DIY13', 'GK09', 'Semanu'),
('DIY14', 'GK10', 'Ponjong'),
('DIY15', 'GK11', 'Karangmojo'),
('DIY16', 'GK12', 'Wonosari'),
('DIY17', 'GK13', 'Playen'),
('DIY18', 'GK14', 'Patuk'),
('DIY19', 'GK15', 'Gedangsari'),
('DIY20', 'GK16', 'Nglipar'),
('DIY21', 'GK17', 'Ngawen'),
('DIY22', 'GK18', 'Semin'),
('JT002', 'KL01', 'Prambanan'),
('JT002', 'KL02', 'Gantiwarno'),
('JT002', 'KL03', 'Wedi'),
('JT002', 'KL04', 'Bayat'),
('JT002', 'KL05', 'Cawas'),
('JT002', 'KL06', 'Trucuk'),
('JT002', 'KL07', 'Kalikotes'),
('JT002', 'KL08', 'Kebonarum'),
('JT002', 'KL09', 'Jogonalan'),
('JT002', 'KL10', 'Manisrenggo'),
('JT002', 'KL11', 'Karangnongko'),
('JT002', 'KL12', 'Ngawen'),
('JT002', 'KL13', 'Ceper'),
('JT002', 'KL14', 'Pedan'),
('JT002', 'KL15', 'Karangdowo'),
('JT002', 'KL16', 'Juwiring'),
('JT002', 'KL17', 'Wonosari'),
('JT002', 'KL18', 'Delanggu'),
('JT002', 'KL19', 'Polanharjo'),
('JT002', 'KL20', 'Karanganom'),
('JT002', 'KL21', 'Tulung'),
('JT002', 'KL22', 'Jatinom'),
('JT002', 'KL23', 'Kemalang'),
('JT002', 'KL24', 'Klaten Selatan'),
('JT002', 'KL25', 'Klaten Tengah'),
('JT002', 'KL26', 'Klaten Utara'),
('DIY04', 'KP01', 'Temon'),
('DIY04', 'KP02', 'Wates'),
('DIY04', 'KP03', 'Panjatan'),
('DIY04', 'KP04', 'Galur '),
('DIY04', 'KP05', 'Lendah'),
('DIY04', 'KP06', 'Sentolo'),
('DIY04', 'KP07', 'Pengasih'),
('DIY04', 'KP08', 'Kokap'),
('DIY04', 'KP09', 'Girimulyo'),
('DIY04', 'KP10', 'Nnaggulan'),
('DIY04', 'KP11', 'Samigaluh'),
('DIY04', 'KP12', 'Kalibawang '),
('JT01', 'MG01', 'Salaman'),
('JT01', 'MG02', 'Borobudur'),
('JT01', 'MG03', 'Ngluwar'),
('JT01', 'MG04', 'Salam'),
('JT01', 'MG05', 'Srumbung'),
('JT01', 'MG06', 'Dukun'),
('JT01', 'MG07', 'Muntilan'),
('JT01', 'MG08', 'Mungkid'),
('JT01', 'MG09', 'Sawangan'),
('JT01', 'MG10', 'Candimulyo'),
('JT01', 'MG11', 'Mertoyudan'),
('JT01', 'MG12', 'Tempuran'),
('JT01', 'MG13', 'Kajoran'),
('JT01', 'MG14', 'Kaliangkrik'),
('JT01', 'MG15', 'Bandongan'),
('JT01', 'MG16', 'Windusari'),
('JT01', 'MG17', 'Secang'),
('JT01', 'MG18', 'Tegalrejo'),
('JT01', 'MG19', 'Pakis'),
('JT01', 'MG20', 'Grabag'),
('JT01', 'MG21', 'Ngablak'),
('JT003', 'PR01', 'Grabag'),
('JT003', 'PR02', 'Ngombol'),
('JT003', 'PR03', 'Purwodadi'),
('JT003', 'PR04', 'Bagelen'),
('JT003', 'PR05', 'Kaligesing'),
('JT003', 'PR06', 'Purworejo'),
('JT003', 'PR07', 'Banyuurip'),
('JT003', 'PR08', 'Bayan'),
('JT003', 'PR09', 'Kutoarjo'),
('JT003', 'PR10', 'Butuh'),
('JT003', 'PR11', 'Pituruh'),
('JT003', 'PR12', 'Kemiri'),
('JT003', 'PR13', 'Bruno'),
('JT003', 'PR14', 'Gebang'),
('JT003', 'PR15', 'Loano'),
('JT003', 'PR16', 'Bener'),
('DIY02', 'SL01', 'Moyudan'),
('DIY02', 'SL02', 'Minggir'),
('DIY02', 'SL03', 'Seyegan'),
('DIY02', 'SL04', 'Godean'),
('DIY02', 'SL05', 'Gamping'),
('DIY02', 'SL06', 'Mlati'),
('DIY02', 'SL07', 'Depok'),
('DIY02', 'SL08', 'Berbah'),
('DIY02', 'SL09', 'Prambanan'),
('DIY02', 'SL10', 'Kalasan'),
('DIY02', 'SL11', 'Ngemplak'),
('DIY02', 'SL12', 'Ngaglik'),
('DIY02', 'SL13', 'Sleman'),
('DIY02', 'SL14', 'Tempel'),
('DIY02', 'SL15', 'Turi'),
('DIY02', 'SL16', 'Pakem'),
('DIY02', 'SL17', 'Cangkringan'),
('DIY01', 'YK01', 'Mantijeron'),
('DIY01', 'YK02', 'Kraton'),
('DIY01', 'YK03', 'Margangsan'),
('DIY01', 'YK04', 'Umbulharjo'),
('DIY01', 'YK05', 'Kotagede'),
('DIY01', 'YK06', 'Gondokusuman'),
('DIY01', 'YK07', 'Danurejan'),
('DIY01', 'YK08', 'Pakualaman'),
('DIY01', 'YK09', 'Gondomanan'),
('DIY01', 'YK10', 'Ngampilan'),
('DIY01', 'YK11', 'Wirobrajan'),
('DIY01', 'YK12', 'Gedongtengen'),
('DIY01', 'YK13', 'Jetis'),
('DIY01', 'YK14', 'Tegalrejo');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_komoditas`
--
CREATE TABLE `t_komoditas` (
`Id_Komuditas` varchar(6) NOT NULL,
`Komuditas` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `t_komoditas`
--
INSERT INTO `t_komoditas` (`Id_Komuditas`, `Komuditas`) VALUES
('KMD01', 'Tanaman Pangan'),
('KMD02', 'Hultikultura'),
('KMD03', 'Peternakan');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_padi`
--
CREATE TABLE `t_padi` (
`Id_Wilayah` varchar(5) CHARACTER SET latin1 DEFAULT NULL,
`ID` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
`Id_Jenis` varchar(4) CHARACTER SET latin1 DEFAULT NULL,
`Tahun` int(4) DEFAULT NULL,
`Luas_Lahan_Tanam` varchar(10) DEFAULT NULL,
`Luas_Aktivitas_Tanam` varchar(10) DEFAULT NULL,
`Jumlah_Produktivitas` varchar(11) DEFAULT NULL,
`Rata_Rata_Produktivitas_Produk` decimal(10,4) DEFAULT NULL,
`Rata_Rata_Produktivitas_Lahan` decimal(10,4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `t_padi`
--
INSERT INTO `t_padi` (`Id_Wilayah`, `ID`, `Id_Jenis`, `Tahun`, `Luas_Lahan_Tanam`, `Luas_Aktivitas_Tanam`, `Jumlah_Produktivitas`, `Rata_Rata_Produktivitas_Produk`, `Rata_Rata_Produktivitas_Lahan`) VALUES
('JT001', 'MG01', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG02', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG03', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG04', 'JN01', 2019, '2542.80', '2598.60', '0', '0.0000', '1.0200'),
('JT001', 'MG05', 'JN01', 2019, '2894.30', '2686.40', '0', '0.0000', '0.9300'),
('JT001', 'MG06', 'JN01', 2019, '4761.00', '38811.27', '0', '0.0000', '8.1500'),
('JT001', 'MG07', 'JN01', 2019, '2875.10', '3433.80', '0', '0.0000', '1.1900'),
('JT001', 'MG08', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG09', 'JN01', 2019, '0', '122.00', '871.08', '0.0000', '0.0000'),
('JT001', 'MG10', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG11', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG12', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG13', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG14', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG15', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG16', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG17', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG18', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG19', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG20', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG21', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG01', 'JN01', 2020, '4481.7', '4182.3', '0', '0.0000', '0.9300'),
('JT001', 'MG02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT001', 'MG03', 'JN01', 2020, '1937.1', '2177', '0', '0.0000', '1.1200'),
('JT001', 'MG04', 'JN01', 2020, '2200.00', '2394.60', '0', '0.0000', '1.0900'),
('JT001', 'MG05', 'JN01', 2020, '2478.20', '2478.20', '0', '0.0000', '1.0000'),
('JT001', 'MG06', 'JN01', 2020, '3014.70', '3172.80', '0', '0.0000', '1.0500'),
('JT001', 'MG07', 'JN01', 2020, '45.20', '37.50', '0', '0.0000', '0.8300'),
('JT001', 'MG08', 'JN01', 2020, '4683.1', '4951', '0', '0.0000', '1.0600'),
('JT001', 'MG09', 'JN01', 2020, '3829.9', '3987.80', '0', '0.0000', '1.0400'),
('JT001', 'MG10', 'JN01', 2020, '2194.1', '2200.8', '0', '0.0000', '1.0000'),
('JT001', 'MG11', 'JN01', 2020, '3275.8', '3356.7', '0', '0.0000', '1.0200'),
('JT001', 'MG12', 'JN01', 2020, '3776.9', '4403.6', '0', '0.0000', '1.1700'),
('JT001', 'MG13', 'JN01', 2020, '5668.3', '5863.8', '0', '0.0000', '1.0300'),
('JT001', 'MG14', 'JN01', 2020, '2858.5', '3263.2', '0', '0.0000', '1.1400'),
('JT001', 'MG15', 'JN01', 2020, '196', '233.6', '0', '0.0000', '1.1900'),
('JT001', 'MG16', 'JN01', 2020, '4237.1', '4227.5', '0', '0.0000', '1.0000'),
('JT001', 'MG17', 'JN01', 2020, '5061.5', '5138.5', '0', '0.0000', '1.0200'),
('JT001', 'MG18', 'JN01', 2020, '1537.3', '2241.3', '0', '0.0000', '1.4600'),
('JT001', 'MG19', 'JN01', 2020, '119.4', '131.1', '0', '0.0000', '1.1000'),
('JT001', 'MG20', 'JN01', 2020, '57.58', '59.24', '0', '0.0000', '1.0300'),
('JT001', 'MG21', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL01', 'JN01', 2019, ' 1,268.00 ', ' 3,315.00 ', ' 1,670.50 ', '1.3174', '2.6144'),
('DIY02', 'SL02', 'JN01', 2019, ' 3,495.00 ', ' 3,515.00 ', ' 1,811.80 ', '0.5184', '1.0057'),
('DIY02', 'SL03', 'JN01', 2019, '0', ' 2,954.00 ', ' 16,020.00 ', '0.0000', '0.0000'),
('DIY02', 'SL04', 'JN01', 2019, ' 3,392.67 ', ' 3,355.00 ', ' 18,532.91 ', '5.4626', '0.9889'),
('DIY02', 'SL05', 'JN01', 2019, ' 2,627.70 ', ' 2,562.00 ', ' 14,098.38 ', '5.3653', '0.9750'),
('DIY02', 'SL06', 'JN01', 2019, ' 2,034.31 ', ' 2,138.00 ', ' 11,568.39 ', '5.6866', '1.0510'),
('DIY02', 'SL07', 'JN01', 2019, '0', ' 1,024.00 ', ' 561.70 ', '0.0000', '0.0000'),
('DIY02', 'SL08', 'JN01', 2019, '0', ' 2,568.00 ', ' 14,086.00 ', '0.0000', '0.0000'),
('DIY02', 'SL09', 'JN01', 2019, ' 2,776.00 ', ' 3,122.00 ', ' 1,656.70 ', '0.5968', '1.1246'),
('DIY02', 'SL10', 'JN01', 2019, ' 2,695.00 ', ' 3,135.00 ', ' 17.03 ', '0.0063', '1.1633'),
('DIY02', 'SL11', 'JN01', 2019, ' 3,816.00 ', ' 3,866.00 ', ' 21,082.00 ', '5.5246', '1.0131'),
('DIY02', 'SL12', 'JN01', 2019, ' 320.40 ', ' 3,128.60 ', ' 1,678.19 ', '5.2378', '9.7647'),
('DIY02', 'SL13', 'JN01', 2019, ' 2,890.00 ', ' 2,947.00 ', ' 1,574.30 ', '0.5447', '1.0197'),
('DIY02', 'SL14', 'JN01', 2019, '0', ' 2,095.00 ', ' 11,076.55 ', '0.0000', '0.0000'),
('DIY02', 'SL15', 'JN01', 2019, '0', ' 805.00 ', ' 4,231.15 ', '0.0000', '0.0000'),
('DIY02', 'SL16', 'JN01', 2019, ' 2,597.00 ', ' 2,597.00 ', ' 16,186.00 ', '6.2326', '1.0000'),
('DIY02', 'SL17', 'JN01', 2019, ' 2,725.00 ', ' 2,940.00 ', ' 15,084.00 ', '5.5354', '1.0789'),
('DIY02', 'SL01', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL03', 'JN01', 2020, '0', ' 2,745.00 ', ' 15,770.57 ', '0.0000', '0.0000'),
('DIY02', 'SL04', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL05', 'JN01', 2020, ' 2,474.00 ', ' 2,480.00 ', ' 16,084.00 ', '6.5012', '1.0024'),
('DIY02', 'SL06', 'JN01', 2020, ' 1,652.00 ', ' 1,845.00 ', ' 1,138.90 ', '0.6894', '1.1168'),
('DIY02', 'SL07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL09', 'JN01', 2020, ' 3,076.00 ', ' 3,027.00 ', ' 15,899.89 ', '5.1690', '0.9841'),
('DIY02', 'SL10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL11', 'JN01', 2020, ' 3,648.00 ', ' 3,537.00 ', ' 2,479.44 ', '0.6797', '0.9696'),
('DIY02', 'SL12', 'JN01', 2020, ' 1,957.10 ', ' 2,359.20 ', ' 1,452.10 ', '0.7420', '1.2055'),
('DIY02', 'SL13', 'JN01', 2020, ' 1,744.00 ', ' 266.00 ', ' 1,622.60 ', '0.9304', '0.1525'),
('DIY02', 'SL14', 'JN01', 2020, '0', ' 2,085.00 ', ' 12,805.00 ', '0.0000', '0.0000'),
('DIY02', 'SL15', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL16', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY02', 'SL17', 'JN01', 2020, ' 2,321.00 ', ' 2,395.00 ', ' 13,850.00 ', '5.9673', '1.0319'),
('DIY04', 'KP01', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP03', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP04', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP05', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP09', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP11', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY04', 'KP12', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR01', 'JN01', 2019, '49', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR02', 'JN01', 2019, '3', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR03', 'JN01', 2019, '68.5', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR04', 'JN01', 2019, '943', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR05', 'JN01', 2019, '10', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR06', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR07', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR08', 'JN01', 2019, '11', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR09', 'JN01', 2019, '4', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR10', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR11', 'JN01', 2019, '71', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR12', 'JN01', 2019, '844', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR13', 'JN01', 2019, '314', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR14', 'JN01', 2019, '67', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR15', 'JN01', 2019, '30', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR16', 'JN01', 2019, '173.75', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR01', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR03', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR04', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR05', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR09', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR11', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR12', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR13', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR14', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR15', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT003', 'PR16', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL01', 'JN01', 2019, '0', '2079', '6.99', '0.0000', '0.0000'),
('JT002', 'KL02', 'JN01', 2019, '0', '2613', '6.47', '0.0000', '0.0000'),
('JT002', 'KL03', 'JN01', 2019, '0', '2889', '6.56', '0.0000', '0.0000'),
('JT002', 'KL04', 'JN01', 2019, '0', '1099', '6.23', '0.0000', '0.0000'),
('JT002', 'KL05', 'JN01', 2019, '0', '4144', '7.19', '0.0000', '0.0000'),
('JT002', 'KL06', 'JN01', 2019, '0', '3742', '6.48', '0.0000', '0.0000'),
('JT002', 'KL07', 'JN01', 2019, '0', '1235', '6.66', '0.0000', '0.0000'),
('JT002', 'KL08', 'JN01', 2019, '0', '1752', '7.09', '0.0000', '0.0000'),
('JT002', 'KL09', 'JN01', 2019, '0', '3128', '6.53', '0.0000', '0.0000'),
('JT002', 'KL10', 'JN01', 2019, '0', '2581', '6.9', '0.0000', '0.0000'),
('JT002', 'KL11', 'JN01', 2019, '0', '2180', '6.73', '0.0000', '0.0000'),
('JT002', 'KL12', 'JN01', 2019, '0', '3085', '6.77', '0.0000', '0.0000'),
('JT002', 'KL13', 'JN01', 2019, '0', '2759', '6.71', '0.0000', '0.0000'),
('JT002', 'KL14', 'JN01', 2019, '0', '1621', '6.64', '0.0000', '0.0000'),
('JT002', 'KL15', 'JN01', 2019, '0', '4479', '7.39', '0.0000', '0.0000'),
('JT002', 'KL16', 'JN01', 2019, '0', '4824', '6.58', '0.0000', '0.0000'),
('JT002', 'KL17', 'JN01', 2019, '0', '5567', '6.59', '0.0000', '0.0000'),
('JT002', 'KL18', 'JN01', 2019, '0', '3915', '7.16', '0.0000', '0.0000'),
('JT002', 'KL19', 'JN01', 2019, '0', '5377', '6.88', '0.0000', '0.0000'),
('JT002', 'KL20', 'JN01', 2019, '0', '3376', '6.28', '0.0000', '0.0000'),
('JT002', 'KL21', 'JN01', 2019, '0', '2743', '6.44', '0.0000', '0.0000'),
('JT002', 'KL22', 'JN01', 2019, '0', '1141', '7.02', '0.0000', '0.0000'),
('JT002', 'KL23', 'JN01', 2019, '0', '100', '6.33', '0.0000', '0.0000'),
('JT002', 'KL24', 'JN01', 2019, '0', '1789', '6.65', '0.0000', '0.0000'),
('JT002', 'KL25', 'JN01', 2019, '0', '714', '6.56', '0.0000', '0.0000'),
('JT002', 'KL26', 'JN01', 2019, '0', '627', '6.78', '0.0000', '0.0000'),
('JT002', 'KL01', 'JN01', 2020, '3', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL02', 'JN01', 2020, '173.63', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL03', 'JN01', 2020, '55', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL04', 'JN01', 2020, '18', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL05', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL07', 'JN01', 2020, '28.6', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL09', 'JN01', 2020, '49.6', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL10', 'JN01', 2020, '5', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL11', 'JN01', 2020, '4', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL12', 'JN01', 2020, '2', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL13', 'JN01', 2020, '52.33', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL14', 'JN01', 2020, '24.91', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL15', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL16', 'JN01', 2020, '8.98', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL17', 'JN01', 2020, '42', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL18', 'JN01', 2020, '8.64', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL19', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL20', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL21', 'JN01', 2020, '2', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL22', 'JN01', 2020, '48.38', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL23', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL24', 'JN01', 2020, '6.6', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL25', 'JN01', 2020, '3.12', '0', '0', '0.0000', '0.0000'),
('JT002', 'KL26', 'JN01', 2020, '1.2', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK01', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK02', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK03', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK04', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK05', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK06', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK07', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK08', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK09', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK10', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK11', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK12', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK13', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK14', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK15', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK16', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK17', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK18', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK01', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK03', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK04', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK05', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK09', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK11', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK12', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK13', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK14', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK15', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK16', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK17', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY05', 'GK18', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL01', 'JN01', 2019, '0', '728.3', '0', '0.0000', '0.0000'),
('DIY03', 'BL02', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL03', 'JN01', 2019, '0', '1348', '0', '0.0000', '0.0000'),
('DIY03', 'BL04', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL05', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL06', 'JN01', 2019, '0', '1856', '0', '0.0000', '0.0000'),
('DIY03', 'BL07', 'JN01', 2019, '0', '1383', '0', '0.0000', '0.0000'),
('DIY03', 'BL08', 'JN01', 2019, '0', '2827.1', '0', '0.0000', '0.0000'),
('DIY03', 'BL09', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL10', 'JN01', 2019, '0', '1531', '0', '0.0000', '0.0000'),
('DIY03', 'BL11', 'JN01', 2019, '0', '1081', '0', '0.0000', '0.0000'),
('DIY03', 'BL12', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL13', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL14', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL15', 'JN01', 2019, '0', '948.8', '0', '0.0000', '0.0000'),
('DIY03', 'BL16', 'JN01', 2019, '0', '472', '0', '0.0000', '0.0000'),
('DIY03', 'BL17', 'JN01', 2019, '0', '1691.4', '0', '0.0000', '0.0000'),
('DIY03', 'BL01', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL03', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL04', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL05', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL09', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL11', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL12', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL13', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL14', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL15', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL16', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY03', 'BL17', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK01', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK02', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK03', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK04', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK05', 'JN01', 2019, '0', '15', '101.55', '0.0000', '0.0000'),
('DIY01', 'YK06', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK07', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK08', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK09', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK10', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK11', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK12', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK13', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK14', 'JN01', 2019, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK01', 'JN01', 2020, '0', '1', '0', '0.0000', '0.0000'),
('DIY01', 'YK02', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK03', 'JN01', 2020, '0', '4', '0', '0.0000', '0.0000'),
('DIY01', 'YK04', 'JN01', 2020, '0', '32', '0', '0.0000', '0.0000'),
('DIY01', 'YK05', 'JN01', 2020, '0', '5', '0', '0.0000', '0.0000'),
('DIY01', 'YK06', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK07', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK08', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK09', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK10', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK11', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK12', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK13', 'JN01', 2020, '0', '0', '0', '0.0000', '0.0000'),
('DIY01', 'YK14', 'JN01', 2020, '0', '10', '0', '0.0000', '0.0000');
-- --------------------------------------------------------
--
-- Struktur dari tabel `t_wilayah`
--
CREATE TABLE `t_wilayah` (
`Id_Wilayah` varchar(5) CHARACTER SET latin1 NOT NULL,
`Kab/Kota` varchar(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `t_wilayah`
--
INSERT INTO `t_wilayah` (`Id_Wilayah`, `Kab/Kota`) VALUES
('DIY01', 'Yogyakarta'),
('DIY02', 'Sleman'),
('DIY03', 'Bantul'),
('DIY04', 'Kulon Progo'),
('DIY05', 'Gunung Kidul'),
('JT001', 'Magelang'),
('JT002', 'Klaten'),
('JT003', 'Purworejo');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `t_jenis`
--
ALTER TABLE `t_jenis`
ADD PRIMARY KEY (`Id_Jenis`);
--
-- Indexes for table `t_kecamatan`
--
ALTER TABLE `t_kecamatan`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `t_komoditas`
--
ALTER TABLE `t_komoditas`
ADD PRIMARY KEY (`Id_Komuditas`);
--
-- Indexes for table `t_wilayah`
--
ALTER TABLE `t_wilayah`
ADD PRIMARY KEY (`Id_Wilayah`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
--
-- Table structure for table `package`
--
CREATE TABLE IF NOT EXISTS `package` (
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`code` varchar(100) NOT NULL,
`description` varchar(1000) NOT NULL,
`title` varchar(100) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
`price` varchar(100) NOT NULL,
`duration` varchar(100) DEFAULT NULL,
`image_path` varchar(100) DEFAULT NULL,
`relevant_for` varchar(1000) NOT NULL,
`advantage` varchar(1000) NOT NULL,
`ff_classroom` varchar(100) NOT NULL DEFAULT '0',
`whatuserget` varchar(2000) NOT NULL,
`created_at` int(10) NOT NULL,
`created_by` bigint(10) NOT NULL,
`updated_at` int(10) NOT NULL,
`updated_by` bigint(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
--
-- Dumping data for table `package`
--
INSERT INTO `package` (`id`, `code`, `description`, `title`, `status`, `price`, `duration`, `image_path`, `relevant_for`, `advantage`, `ff_classroom`, `whatuserget`, `created_at`, `created_by`, `updated_at`, `updated_by`) VALUES
(7, 'KGPKG-000-1', 'System Package', 'The long term planner', 1, '12.5k', '15 to 22 Months', NULL, 'You have more than a year to finish your graduation or like your job enough to stay there for another 12 months', 'Start early,Learn fundamentals, solve problems & revisit the concepts again.,Learn at a comfortable pace.', '1 per Month', '1. Access to detailed course contents,\r\n2. 1 Face-to-Face class per month with our expert faculty,\r\n3. Mock tests', 1457240573, 1, 1457240573, 1),
(8, 'KGPKG-000-8', 'System Package', 'The go-getter', 1, '10k', '8 to 10 Months', NULL, 'You are in your final year and cant wait to do MBA or you hate your work/boss and want to be in your dream B school at the earliest\r\n', 'Learn fundamentals, solve problems & revisit the concepts again., You need to move quickly though\r\n', '1 per Month', '1. Access to detailed course contents,\r\n2. 1 Face-to-Face class per month with our expert faculty,\r\n3. Mock tests', 1457240775, 1, 1457240775, 1),
(9, 'KGPKG-000-9', 'System Package', 'The go-getter (intensive)', 1, '12.5k', '8 to 10 Months', NULL, 'You are in your final year and REALLY cant wait to do MBA or you REALLY hate your work/boss and want to be in your dream B school at the earliest\r\n', 'Learn fundamentals, solve problems & revisit the concepts again., Get intensive coaching with 2 face-to-face classes month to put you on fast track\r\n', '2 Per month', '1. Access to detailed course contents,\r\n2. 2 Face-to-Face class per month with our expert faculty,\r\n3. Mock tests', 1457240939, 1, 1457240939, 1),
(10, 'KGPKG-000-10', 'System Package', 'Fine-tuning', 1, '5K', 'NA', NULL, 'Solve problems and get solutions., Know your strengths and weaknesses., Build up your confidence and fine tune your preparation\r\n', 'You know your stuff and need to test yourself and fine tune things a bit. \r\n', '3-5 Months', '1. Mock tests\r\n2. Preparation Material', 1457241045, 1, 1457241045, 1);
|
CREATE TABLE admins (
id serial PRIMARY KEY,
email varchar(255) NOT NULL UNIQUE
);
|
create database if not exists carpark;
use carpark;
create table customer(
id varchar(20)primary key,
name varchar(100)not null,
address varchar(100)not null,
contact varchar(20)not null,
nic varchar(20)not null,
carNumber varchar(100)not null,
carModel varchar(100)not null
);
create table carCells(
cellid varchar(10)primary key not null,
status varchar(20)not null
);
insert into carCells values('lblA1','not reserved');
insert into carCells values('lblA2','not reserved');
insert into carCells values('lblA3','not reserved');
insert into carCells values('lblA4','not reserved');
insert into carCells values('lblB1','not reserved');
insert into carCells values('lblB2','not reserved');
insert into carCells values('lblB3','not reserved');
insert into carCells values('lblB4','not reserved');
insert into carCells values('lblC1','not reserved');
insert into carCells values('lblC2','not reserved');
insert into carCells values('lblC3','not reserved');
insert into carCells values('lblC4','not reserved');
insert into carCells values('lblD1','not reserved');
insert into carCells values('lblD2','not reserved');
insert into carCells values('lblD3','not reserved');
insert into carCells values('lblD4','not reserved');
insert into carCells values('lblE1','not reserved');
insert into carCells values('lblE2','not reserved');
insert into carCells values('lblE3','not reserved');
insert into carCells values('lblE4','not reserved');
insert into carCells values('lblF1','not reserved');
insert into carCells values('lblF2','not reserved');
insert into carCells values('lblF3','not reserved');
insert into carCells values('lblF4','not reserved');
insert into carCells values('lblG1','not reserved');
insert into carCells values('lblG2','not reserved');
insert into carCells values('lblG3','not reserved');
insert into carCells values('lblG4','not reserved');
insert into carCells values('lblH1','not reserved');
insert into carCells values('lblH2','not reserved');
insert into carCells values('lblH3','not reserved');
insert into carCells values('lblH4','not reserved');
insert into carCells values('lblI1','not reserved');
insert into carCells values('lblI2','not reserved');
insert into carCells values('lblI3','not reserved');
insert into carCells values('lblI4','not reserved');
insert into carCells values('lblJ1','not reserved');
insert into carCells values('lblJ2','not reserved');
insert into carCells values('lblJ3','not reserved');
insert into carCells values('lblJ4','not reserved');
insert into carCells values('lblK1','not reserved');
insert into carCells values('lblK2','not reserved');
insert into carCells values('lblK3','not reserved');
insert into carCells values('lblK4','not reserved');
insert into carCells values('lblL1','not reserved');
insert into carCells values('lblL2','not reserved');
insert into carCells values('lblL3','not reserved');
insert into carCells values('lblL4','not reserved');
insert into carCells values('lblM1','not reserved');
insert into carCells values('lblM2','not reserved');
insert into carCells values('lblM3','not reserved');
insert into carCells values('lblM4','not reserved');
insert into carCells values('lblN1','not reserved');
insert into carCells values('lblN2','not reserved');
insert into carCells values('lblN3','not reserved');
insert into carCells values('lblN4','not reserved');
create table defaultPayment(
id int not null auto_increment,
cid varchar(20),
cellId varchar(20)not null,
inTime varchar(20)not null,
outTime varchar(20)not null,
constraint primary key(id),
constraint foreign key(cellId)references carCells(cellId)
);
alter table defaultPayment add invoiceNumber varchar(100);
create table payment(
invoice varchar(100)not null,
payment varchar(100)not null,
date varchar(20)not null
);
create table package(
id varchar(20)primary key,
type varchar(100)not null,
price varchar(100)not null
);
create table packageCells(
cellId varchar(20)primary key,
status varchar(20)not null
);
create table packagePayment(
id varchar(20),
price varchar(100)not null,
cellid varchar(10)not null,
inDate varchar(100)not null,
outDate varchar(100)not null,
invoice varchar(100)not null,
cid varchar(20)not null,
constraint foreign key(id)references package(id),
constraint foreign key(cellid)references packageCells(cellId),
constraint foreign key(cid) references customer(id)
);
insert into packageCells values ('lblA1P','not reserved');
insert into packageCells values ('lblA2P','not reserved');
insert into packageCells values ('lblB1P','not reserved');
insert into packageCells values ('lblB2P','not reserved');
insert into packageCells values ('lblC1P','not reserved');
insert into packageCells values ('lblC2P','not reserved');
insert into packageCells values ('lblD1P','not reserved');
insert into packageCells values ('lblD2P','not reserved');
insert into packageCells values ('lblE1P','not reserved');
insert into packageCells values ('lblE2P','not reserved');
insert into packageCells values ('lblF1P','not reserved');
insert into packageCells values ('lblF2P','not reserved');
create table users(
id varchar(20)primary key ,
name varchar(100)not null,
nic varchar(100)not null,
address varchar(100)not null,
contact varchar(100)not null,
email varchar(100)not null,
password varchar(100)not null,
userName varchar(100)not null,
userRole varchar(100)not null
);
|
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Creating primary key [Intervention_PK] on [edfi].[Intervention]'
GO
ALTER TABLE [edfi].[Intervention] ADD CONSTRAINT [Intervention_PK] PRIMARY KEY CLUSTERED ([InterventionIdentificationCode], [EducationOrganizationId])
GO
PRINT N'Creating index [UX_Intervention_Id] on [edfi].[Intervention]'
GO
CREATE UNIQUE NONCLUSTERED INDEX [UX_Intervention_Id] ON [edfi].[Intervention] ([Id]) WITH (FILLFACTOR=75, PAD_INDEX=ON)
GO
PRINT N'Creating index [FK_Intervention_DeliveryMethodType] on [edfi].[Intervention]'
GO
CREATE NONCLUSTERED INDEX [FK_Intervention_DeliveryMethodType] ON [edfi].[Intervention] ([DeliveryMethodTypeId])
GO
PRINT N'Creating index [FK_Intervention_EducationOrganization] on [edfi].[Intervention]'
GO
CREATE NONCLUSTERED INDEX [FK_Intervention_EducationOrganization] ON [edfi].[Intervention] ([EducationOrganizationId])
GO
PRINT N'Creating index [FK_Intervention_InterventionClassType] on [edfi].[Intervention]'
GO
CREATE NONCLUSTERED INDEX [FK_Intervention_InterventionClassType] ON [edfi].[Intervention] ([InterventionClassTypeId])
GO
PRINT N'Adding constraints to [edfi].[Intervention]'
GO
ALTER TABLE [edfi].[Intervention] ADD CONSTRAINT [Intervention_DF_CreateDate] DEFAULT (getdate()) FOR [CreateDate]
GO
ALTER TABLE [edfi].[Intervention] ADD CONSTRAINT [Intervention_DF_LastModifiedDate] DEFAULT (getdate()) FOR [LastModifiedDate]
GO
ALTER TABLE [edfi].[Intervention] ADD CONSTRAINT [Intervention_DF_Id] DEFAULT (newid()) FOR [Id]
GO
|
REM
REM Standard disclaimer - anything in here can be used at your own risk.
REM
REM It is very likely you'll need to edit the script for correct usernames/passwords 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
@clean
set termout off
@drop emp
@drop dept
create table dept as select * from scott.dept;
create table emp as select * from scott.emp;
drop function combine;
clear screen
set serverout on
set echo on
set termout on
select dname||'-'||loc concat_dept from dept;
pause
select dname||'~'||loc concat_dept from dept;
pause
clear screen
create or replace
function combine(p_separator varchar2 default '-')
return varchar2 SQL_MACRO is
l_sep_in_quotes varchar2(200) := chr(39)||p_separator||chr(39);
l_sql varchar2(200);
begin
l_sql :=
'select dname ||' ||
l_sep_in_quotes ||
'||loc concat_dept from dept';
dbms_output.put_line('RETURNED SQL='||l_sql);
return l_sql;
end;
/
pause
clear screen
select * from combine();
pause
set echo off
clear screen
pro
pro SQL> select * from combine(' from dept union all select username from all_users union all ... ');
pro
set echo on
pause
select * from combine();
pause
select * from combine('~');
pause
select * from combine('CONNOR');
pause
clear screen
create or replace
function combine(p_separator varchar2 default '-')
return varchar2 SQL_Macro is
l_sql varchar2(200);
begin
l_sql := 'select dname || p_separator || loc concat_dept from dept';
dbms_output.put_line('RETURNED SQL='||l_sql);
return l_sql;
end;
/
pause
clear screen
set serverout on
select * from combine();
pause
select * from combine('~');
pause
select * from combine('|');
pause
clear screen
create or replace
function no_change(p_table dbms_tf.table_t)
return varchar2 SQL_Macro is
begin
return 'select * from p_table';
end;
/
pause
select * from no_change(dept);
pause
select * from no_change(emp);
pause
clear screen
select * from combine('xxx');
pause
select * from combine('xxx');
|
--
-- Copyright 2009-2021 the original author or authors.
--
-- 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.
--
drop table users if exists;
create table Parent (
id int,
Name varchar(20),
SurName varchar(20)
);
create table Child (
id int,
Name varchar(20),
SurName varchar(20),
Age int,
ParentId varchar(20)
);
insert into Parent values (1, 'Jose', 'Garcia');
insert into Parent values (2, 'Juan', 'Perez');
insert into Child values (1, 'Ana', 'Garcia', 1, 1);
insert into Child values (2, 'Rosa', 'Garcia', 4, 1);
|
restore filelistonly from disk = 'c:\demos\sqlintersectionmarch2018\sql2017fastandfurious\demo1_sqlserverisfast\tpcc_workload.bak'
go
use master
go
drop database tpcc_workload
go
restore database tpcc_workload from disk = 'c:\demos\sqlintersectionmarch2018\sql2017fastandfurious\demo1_sqlserverisfast\tpcc_workload.bak'
go
|
INSERT INTO public."group" (id, name, title) VALUES (1, 'user', 'User');
INSERT INTO public."group" (id, name, title) VALUES (2, 'admin', 'Admin');
|
create table ACT_GE_PROPERTY (
NAME_ NVARCHAR2(64),
VALUE_ NVARCHAR2(300),
REV_ INTEGER,
primary key (NAME_)
);
insert into ACT_GE_PROPERTY
values ('schema.version', '5.11-SNAPSHOT', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(5.11-SNAPSHOT)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
create table ACT_GE_BYTEARRAY (
ID_ NVARCHAR2(64),
REV_ INTEGER,
NAME_ NVARCHAR2(255),
DEPLOYMENT_ID_ NVARCHAR2(64),
BYTES_ BLOB,
GENERATED_ NUMBER(1,0) CHECK (GENERATED_ IN (1,0)),
primary key (ID_)
);
create table ACT_RE_DEPLOYMENT (
ID_ NVARCHAR2(64),
NAME_ NVARCHAR2(255),
CATEGORY_ NVARCHAR2(255),
DEPLOY_TIME_ TIMESTAMP(6),
primary key (ID_)
);
create table ACT_RU_EXECUTION (
ID_ NVARCHAR2(64),
REV_ INTEGER,
PROC_INST_ID_ NVARCHAR2(64),
BUSINESS_KEY_ NVARCHAR2(255),
PARENT_ID_ NVARCHAR2(64),
PROC_DEF_ID_ NVARCHAR2(64),
SUPER_EXEC_ NVARCHAR2(64),
ACT_ID_ NVARCHAR2(255),
IS_ACTIVE_ NUMBER(1,0) CHECK (IS_ACTIVE_ IN (1,0)),
IS_CONCURRENT_ NUMBER(1,0) CHECK (IS_CONCURRENT_ IN (1,0)),
IS_SCOPE_ NUMBER(1,0) CHECK (IS_SCOPE_ IN (1,0)),
IS_EVENT_SCOPE_ NUMBER(1,0) CHECK (IS_EVENT_SCOPE_ IN (1,0)),
SUSPENSION_STATE_ INTEGER,
CACHED_ENT_STATE_ INTEGER,
primary key (ID_)
);
create table ACT_RU_JOB (
ID_ NVARCHAR2(64) NOT NULL,
REV_ INTEGER,
TYPE_ NVARCHAR2(255) NOT NULL,
LOCK_EXP_TIME_ TIMESTAMP(6),
LOCK_OWNER_ NVARCHAR2(255),
EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)),
EXECUTION_ID_ NVARCHAR2(64),
PROCESS_INSTANCE_ID_ NVARCHAR2(64),
RETRIES_ INTEGER,
EXCEPTION_STACK_ID_ NVARCHAR2(64),
EXCEPTION_MSG_ NVARCHAR2(2000),
DUEDATE_ TIMESTAMP(6),
REPEAT_ NVARCHAR2(255),
HANDLER_TYPE_ NVARCHAR2(255),
HANDLER_CFG_ NVARCHAR2(2000),
primary key (ID_)
);
create table ACT_RE_PROCDEF (
ID_ NVARCHAR2(64) NOT NULL,
REV_ INTEGER,
CATEGORY_ NVARCHAR2(255),
NAME_ NVARCHAR2(255),
KEY_ NVARCHAR2(255) NOT NULL,
VERSION_ INTEGER NOT NULL,
DEPLOYMENT_ID_ NVARCHAR2(64),
RESOURCE_NAME_ NVARCHAR2(2000),
DGRM_RESOURCE_NAME_ varchar(4000),
DESCRIPTION_ NVARCHAR2(2000),
HAS_START_FORM_KEY_ NUMBER(1,0) CHECK (HAS_START_FORM_KEY_ IN (1,0)),
SUSPENSION_STATE_ INTEGER,
primary key (ID_)
);
create table ACT_RU_TASK (
ID_ NVARCHAR2(64),
REV_ INTEGER,
EXECUTION_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
PROC_DEF_ID_ NVARCHAR2(64),
NAME_ NVARCHAR2(255),
PARENT_TASK_ID_ NVARCHAR2(64),
DESCRIPTION_ NVARCHAR2(2000),
TASK_DEF_KEY_ NVARCHAR2(255),
OWNER_ NVARCHAR2(255),
ASSIGNEE_ NVARCHAR2(255),
DELEGATION_ NVARCHAR2(64),
PRIORITY_ INTEGER,
CREATE_TIME_ TIMESTAMP(6),
DUE_DATE_ TIMESTAMP(6),
primary key (ID_)
);
create table ACT_RU_IDENTITYLINK (
ID_ NVARCHAR2(64),
REV_ INTEGER,
GROUP_ID_ NVARCHAR2(255),
TYPE_ NVARCHAR2(255),
USER_ID_ NVARCHAR2(255),
TASK_ID_ NVARCHAR2(64),
PROC_DEF_ID_ NVARCHAR2(64),
primary key (ID_)
);
create table ACT_RU_VARIABLE (
ID_ NVARCHAR2(64) not null,
REV_ INTEGER,
TYPE_ NVARCHAR2(255) not null,
NAME_ NVARCHAR2(255) not null,
EXECUTION_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
TASK_ID_ NVARCHAR2(64),
BYTEARRAY_ID_ NVARCHAR2(64),
DOUBLE_ NUMBER(*,10),
LONG_ NUMBER(19,0),
TEXT_ NVARCHAR2(2000),
TEXT2_ NVARCHAR2(2000),
primary key (ID_)
);
create table ACT_RU_EVENT_SUBSCR (
ID_ NVARCHAR2(64) not null,
REV_ integer,
EVENT_TYPE_ NVARCHAR2(255) not null,
EVENT_NAME_ NVARCHAR2(255),
EXECUTION_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
ACTIVITY_ID_ NVARCHAR2(64),
CONFIGURATION_ NVARCHAR2(255),
CREATED_ TIMESTAMP(6) not null,
primary key (ID_)
);
create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_BYTEAR_DEPL on ACT_GE_BYTEARRAY(DEPLOYMENT_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_);
create index ACT_IDX_EXE_PROCINST on ACT_RU_EXECUTION(PROC_INST_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_SUPER on ACT_RU_EXECUTION(SUPER_EXEC_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_EXE_PROCDEF on ACT_RU_EXECUTION(PROC_DEF_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TSKASS_TASK on ACT_RU_IDENTITYLINK(TASK_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_TASK_EXEC on ACT_RU_TASK(EXECUTION_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCINST on ACT_RU_TASK(PROC_INST_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_TASK_PROCDEF on ACT_RU_TASK(PROC_DEF_ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
create index ACT_IDX_VAR_PROCINST on ACT_RU_VARIABLE(PROC_INST_ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_JOB_EXCEPTION on ACT_RU_JOB(EXCEPTION_STACK_ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
-- see http://stackoverflow.com/questions/675398/how-can-i-constrain-multiple-columns-to-prevent-duplicates-but-ignore-null-value
create unique index ACT_UNIQ_RU_BUS_KEY on ACT_RU_EXECUTION
(case when BUSINESS_KEY_ is null then null else PROC_DEF_ID_ end,
case when BUSINESS_KEY_ is null then null else BUSINESS_KEY_ end);
|
logparser.exe "SELECT TO_STRING(TO_TIMESTAMP(date,time),'yyyy-MM-dd hh') AS Hour,
COUNT(*) FROM *.log WHERE sc-status=500 AND cs-uri-stem='/Start/default.aspx' AND date='2012-10-18' GROUP BY Hour ORDER BY Hour" -i:w3c
Hour COUNT(ALL *)
------------- ------------
2012-10-18 08 191
2012-10-18 09 163
2012-10-18 14 150
Statistics:
-----------
Elements processed: 4189228
Elements output: 3
Execution time: 6.36 seconds
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 26-02-2022 a las 00:29:24
-- Versión del servidor: 10.4.22-MariaDB
-- Versión de PHP: 7.4.27
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 */;
--
-- Base de datos: `extranet_db`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `subtareas`
--
CREATE TABLE `subtareas` (
`id_subtarea` int(100) NOT NULL,
`titulo_subtarea` varchar(100) NOT NULL,
`descp_tarea` varchar(100) NOT NULL,
`fecha_creacion` date NOT NULL,
`id_tarea` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `subtareas`
--
INSERT INTO `subtareas` (`id_subtarea`, `titulo_subtarea`, `descp_tarea`, `fecha_creacion`, `id_tarea`) VALUES
(1, 'definir', 'definir campos', '2022-02-25', 2),
(2, 'teclear ', 'teclear campos', '2022-02-23', 2),
(3, 'aprender', 'aprender sql', '2022-02-25', 3),
(4, 'explicar', 'explicar a sergi sql', '2022-02-25', 3),
(5, 'pedir mas press', 'pedir presupuestos industriales', '2022-02-25', 6),
(6, 'escoger ', 'escoger i entrar presupustos', '2022-02-25', 6);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tareas`
--
CREATE TABLE `tareas` (
`id_tarea` int(11) NOT NULL,
`titulo_tarea` varchar(100) NOT NULL,
`descp_tarea` varchar(100) NOT NULL,
`fecha_creacion` date NOT NULL,
`id_usuario` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `tareas`
--
INSERT INTO `tareas` (`id_tarea`, `titulo_tarea`, `descp_tarea`, `fecha_creacion`, `id_usuario`) VALUES
(1, 'Llevar pintor', 'Llevar pinto i repasos de obra tartera', '2022-02-25', 1),
(2, 'Tabla sql ', 'crear tabla sql', '0000-00-00', 1),
(3, 'Hacer sql', 'entrar i relacionar tablas ', '2022-02-25', 2),
(4, 'harware', 'arreglar ordenadores', '2022-02-25', 2),
(5, 'llamar cliente', 'llamar a isi costa por el asunto de una obra ', '2022-02-25', 3),
(6, 'presupuesto', 'acabar presupuesto obra barcelona', '2022-02-25', 3),
(7, 'Llevar pintor', 'Llevar pinto i repasos de obra tartera', '2022-02-25', 1),
(8, 'Tabla sql ', 'crear tabla sql', '0000-00-00', 1),
(9, 'Hacer sql', 'entrar i relacionar tablas ', '2022-02-25', 2),
(10, 'harware', 'arreglar ordenadores', '2022-02-25', 2),
(11, 'llamar cliente', 'llamar a isi costa por el asunto de una obra ', '2022-02-25', 3),
(12, 'presupuesto', 'acabar presupuesto obra barcelona', '2022-02-25', 3);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuarios`
--
CREATE TABLE `usuarios` (
`id_usuario` int(11) NOT NULL,
`nombre` varchar(100) NOT NULL,
`apellidos` varchar(100) NOT NULL,
`fecha_creacion` date NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`telf` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `usuarios`
--
INSERT INTO `usuarios` (`id_usuario`, `nombre`, `apellidos`, `fecha_creacion`, `username`, `password`, `telf`, `email`) VALUES
(1, 'Sergi', 'Reus', '2022-02-23', 'rdiaz', 'rdiaz', '676443322', 'sergi@reuscontrccions.com'),
(2, 'Rodrigo', 'Diaz', '2022-02-23', 'rdiaz', 'rdiaz', '698342312', 'rodridamigonza12@gmail.com'),
(3, 'Xavier', 'Reus', '2022-02-15', 'xreus', 'xreus', '656336716', 'xavier@reuscontruccions.com'),
(4, 'Sergi', 'Reus', '2022-02-23', 'rdiaz', 'rdiaz', '676443322', 'sergi@reuscontrccions.com'),
(5, 'Rodrigo', 'Diaz', '2022-02-23', 'rdiaz', 'rdiaz', '698342312', 'rodridamigonza12@gmail.com'),
(6, 'Xavier', 'Reus', '2022-02-15', 'xreus', 'xreus', '656336716', 'xavier@reuscontruccions.com');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `subtareas`
--
ALTER TABLE `subtareas`
ADD PRIMARY KEY (`id_subtarea`),
ADD KEY `id_tarea` (`id_tarea`);
--
-- Indices de la tabla `tareas`
--
ALTER TABLE `tareas`
ADD PRIMARY KEY (`id_tarea`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Indices de la tabla `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id_usuario`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `subtareas`
--
ALTER TABLE `subtareas`
MODIFY `id_subtarea` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT de la tabla `tareas`
--
ALTER TABLE `tareas`
MODIFY `id_tarea` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT de la tabla `usuarios`
--
ALTER TABLE `usuarios`
MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `subtareas`
--
ALTER TABLE `subtareas`
ADD CONSTRAINT `subtareas_ibfk_1` FOREIGN KEY (`id_tarea`) REFERENCES `tareas` (`id_tarea`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `tareas`
--
ALTER TABLE `tareas`
ADD CONSTRAINT `tareas_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`) 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 */;
|
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'AjaxFinMiscByService') ,(select id FROM eg_feature WHERE name = 'Create Challan'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceToBankMapping') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceTypeToBankAccountMappingList') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceTypeToBankAccountMappingCreate') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceTypeToBankAccountMappingSearch') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceTypeToBankAccountMappingEdit') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ServiceTypeToBankAccountMappingSave') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'serviceListNotMappedToAccount') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'bankBranchsByBankForReceiptPayments') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'bankAccountByBankBranch') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'AjaxServiceByCategory') ,(select id FROM eg_feature WHERE name = 'Modify Service To Bank Mapping'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'CollectionSummaryReport') ,(select id FROM eg_feature WHERE name = 'Collection Summary'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'CollectionSummaryReportResult') ,(select id FROM eg_feature WHERE name = 'Collection Summary'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'DishonoredChequeProcess') ,(select id FROM eg_feature WHERE name = 'Dishonored Cheque'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'ajax-process-function') ,(select id FROM eg_feature WHERE name = 'Miscelleneous Receipts'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'AjaxReceiptCreateDetailCode') ,(select id FROM eg_feature WHERE name = 'Miscelleneous Receipts'));
DELETE FROM eg_feature_action where feature in(select id from eg_feature where name ='Online Transaction Report');
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'OnlineTransactionReport') ,(select id FROM eg_feature WHERE name = 'Online Transaction Report'));
INSERT INTO eg_feature_action (ACTION, FEATURE) VALUES ((select id FROM eg_action WHERE name = 'OnlineTransactionReportResult') ,(select id FROM eg_feature WHERE name = 'Online Transaction Report'));
|
create or replace transient table "AIRBYTE_DATABASE".TEST_NORMALIZATION."EXCHANGE_RATE" as
(
with __dbt__CTE__EXCHANGE_RATE_AB1 as (
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
select
to_varchar(get_path(parse_json(_airbyte_data), '"id"')) as ID,
to_varchar(get_path(parse_json(_airbyte_data), '"currency"')) as CURRENCY,
to_varchar(get_path(parse_json(_airbyte_data), '"date"')) as DATE,
to_varchar(get_path(parse_json(_airbyte_data), '"timestamp_col"')) as TIMESTAMP_COL,
to_varchar(get_path(parse_json(_airbyte_data), '"HKD@spéçiäl & characters"')) as "HKD@spéçiäl & characters",
to_varchar(get_path(parse_json(_airbyte_data), '"HKD_special___characters"')) as HKD_SPECIAL___CHARACTERS,
to_varchar(get_path(parse_json(_airbyte_data), '"NZD"')) as NZD,
to_varchar(get_path(parse_json(_airbyte_data), '"USD"')) as USD,
_AIRBYTE_EMITTED_AT
from "AIRBYTE_DATABASE".TEST_NORMALIZATION._AIRBYTE_RAW_EXCHANGE_RATE as table_alias
-- EXCHANGE_RATE
), __dbt__CTE__EXCHANGE_RATE_AB2 as (
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
cast(ID as
bigint
) as ID,
cast(CURRENCY as
varchar
) as CURRENCY,
cast(DATE as
date
) as DATE,
cast(TIMESTAMP_COL as
timestamp with time zone
) as TIMESTAMP_COL,
cast("HKD@spéçiäl & characters" as
float
) as "HKD@spéçiäl & characters",
cast(HKD_SPECIAL___CHARACTERS as
varchar
) as HKD_SPECIAL___CHARACTERS,
cast(NZD as
float
) as NZD,
cast(USD as
float
) as USD,
_AIRBYTE_EMITTED_AT
from __dbt__CTE__EXCHANGE_RATE_AB1
-- EXCHANGE_RATE
), __dbt__CTE__EXCHANGE_RATE_AB3 as (
-- SQL model to build a hash column based on the values of this record
select
md5(cast(
coalesce(cast(ID as
varchar
), '') || '-' || coalesce(cast(CURRENCY as
varchar
), '') || '-' || coalesce(cast(DATE as
varchar
), '') || '-' || coalesce(cast(TIMESTAMP_COL as
varchar
), '') || '-' || coalesce(cast("HKD@spéçiäl & characters" as
varchar
), '') || '-' || coalesce(cast(HKD_SPECIAL___CHARACTERS as
varchar
), '') || '-' || coalesce(cast(NZD as
varchar
), '') || '-' || coalesce(cast(USD as
varchar
), '')
as
varchar
)) as _AIRBYTE_EXCHANGE_RATE_HASHID,
tmp.*
from __dbt__CTE__EXCHANGE_RATE_AB2 tmp
-- EXCHANGE_RATE
)-- Final base SQL model
select
ID,
CURRENCY,
DATE,
TIMESTAMP_COL,
"HKD@spéçiäl & characters",
HKD_SPECIAL___CHARACTERS,
NZD,
USD,
_AIRBYTE_EMITTED_AT,
_AIRBYTE_EXCHANGE_RATE_HASHID
from __dbt__CTE__EXCHANGE_RATE_AB3
-- EXCHANGE_RATE from "AIRBYTE_DATABASE".TEST_NORMALIZATION._AIRBYTE_RAW_EXCHANGE_RATE
);
|
CREATE TABLE city(
id int NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'Primary Key',
city_name VARCHAR(255) NOT NULL UNIQUE,
CONSTRAINT name_gt_2_char CHECK (CHAR_LENGTH(city_name) > 2)
) DEFAULT CHARSET UTF8 COMMENT '';
|
ALTER TABLE `lh_abstract_survey` ADD `configuration` longtext NOT NULL, COMMENT='';
|
-- original: ctime.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT sqlite_compileoption_used('THREADSAFE=')
;SELECT sqlite_compileoption_used('SQLITE_OMIT_COMPILEOPTION_DIAGS')
;SELECT sqlite_compileoption_used('OMIT_COMPILEOPTION_DIAGS');
|
/* 查询所有学生除了选修1号课程外的学号和平均成绩,其结果按平均成绩的降序排列 */
select student.no, avg(sc.grade) from student, class, sc
where class.no = sc.cno
and class.no <> '1'
and sc.grade >= 60
and student.no = sc.sno
group by(student.no)
order by avg(sc.grade) desc;
|
create materialized view current_state.issues as
with issue_latest as (
select issues.id,
issues.dup_repo_id as repo_id,
issues.dup_repo_name as repo_name,
issues.number,
issues.is_pull_request,
issues.milestone_id,
milestones.milestone,
issues.state,
issues.title,
issues.user_id as creator_id,
issues.assignee_id,
issues.created_at as created_at,
issues.updated_at,
issues.closed_at,
issues.body,
issues.comments,
row_number() over (partition by issues.id order by issues.updated_at desc, issues.event_id desc) as rank
from (gha_issues issues
left join current_state.milestones on issues.milestone_id = milestones.id)
)
select issue_latest.id,
issue_latest.repo_id,
issue_latest.repo_name,
issue_latest.number,
issue_latest.is_pull_request,
issue_latest.milestone_id,
issue_latest.milestone,
issue_latest.state,
issue_latest.title,
issue_latest.creator_id,
issue_latest.assignee_id,
issue_latest.created_at,
issue_latest.updated_at,
issue_latest.closed_at,
issue_latest.body,
issue_latest.comments
from issue_latest
where (issue_latest.rank = 1)
order by issue_latest.repo_name, issue_latest.number;
|
--[er]test cast function by casting string data type to multiset of string data type
create class func_03(
varchartest varchar(20),
sinttest smallint,
inttest int,
numerictest numeric(38,10),
floattest float,
realtest real,
doublepretest double precision,
moneytest monetary,
chartest char(8),
datetest date,
timetest datetimetz,
timestamptest timestamptz,
bittest bit(16),
nchartest nchar(20),
ncharvartest nchar varying(20),
bitvartest bit varying(20),
stringtest string);
create class dummy( a int );
insert into func_03 values ( '1234567890', 123, 12345, 9876543210987654321012345678.0123456789, 987654.321, 987654321.987654321,987654.321, 9876.1,'char1234', DATE '08/14/1977', datetimetz '2015-9-17 02:10:00', timestamptz '08/14/1977 5:35:00 pm',B'0', N'test111', N'test111', B'1','qa test');
insert into func_03 values ( '', 0, 0, 0, 0, 0,0, 0, '', null, null, null,B'', N'', N'', B'','');
insert into func_03(stringtest) values ( null);
insert into dummy values (1);
select cast(stringtest as multiset of string) from func_03 order by 1;
drop class func_03;
drop class dummy;
|
-- @author prabhd
-- @created 2012-12-05 12:00:00
-- @modified 2012-12-05 12:00:00
-- @tags dml
-- @db_name dmldb
-- @description test14: Delete on table with composite distcol
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
SELECT COUNT(*) FROM dml_heap_p;
DELETE FROM dml_heap_p USING dml_heap_r WHERE dml_heap_p.b::int = dml_heap_r.b::int and dml_heap_p.a = dml_heap_r.a;
SELECT COUNT(*) FROM dml_heap_p;
|
USE TableRelations
GO
DROP TABLE Models
GO
DROP TABLE Manufacturers
GO
CREATE TABLE Manufacturers (
ManufacturerID INT IDENTITY,
[Name] NVARCHAR(20) NOT NULL,
EstablishedOn DATE NOT NULL,
CONSTRAINT PK_Manufacturers PRIMARY KEY (ManufacturerID)
)
GO
CREATE TABLE Models (
ModelID INT IDENTITY(101, 1),
[Name] NVARCHAR(20) NOT NULL,
ManufacturerID INT NOT NULL,
CONSTRAINT PK_Models PRIMARY KEY (ModelID),
CONSTRAINT FK_Models_Manufacturers FOREIGN KEY (ManufacturerID) REFERENCES Manufacturers(ManufacturerID)
)
GO
INSERT INTO Manufacturers ([Name], EstablishedOn) VALUES
('BMW', '07/03/1916'),
('Tesla', '01/01/2003'),
('Lada', '01/05/1966')
GO
INSERT INTO Models ([Name], ManufacturerID) VALUES
('X1', 1),
('i6', 1),
('ModelS', 2),
('ModelX', 2),
('Model3', 2),
('Nova', 3)
|
/* Query 10 entries from multiple columns of the Order table ordered by OrderDate descending */
SELECT Id, ShipName, OrderDate FROM [Order] ORDER BY OrderDate DESC LIMIT 0,10
|
CREATE DATABASE `greenspacedb` /*!40100 DEFAULT CHARACTER SET utf8 */;
use greenspacedb;
create table Admin
(
userID int(8) not null auto_increment primary key,
username nvarchar(30) not null,
passwordHash nvarchar(50) not null,
createdAt date not null,
updatedAt date not null
);
create table Users
(
userID nvarchar(30) not null primary key,
name nvarchar(30) not null,
username nvarchar(30) not null unique,
passwordHash nvarchar(50) not null,
class nvarchar(20) not null,
specification nvarchar(20) not null,
createdAt date not null,
updatedAt date not null
);
select* from users;
select * from admin;
alter table admin
modify createdAt datetime DEFAULT CURRENT_TIMESTAMP;
alter table admin
modify updatedAt datetime DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP;
delete from admin;
ALTER TABLE admin MODIFY COLUMN userID INT(30) AUTO_INCREMENT;
ALTER TABLE admin AUTO_INCREMENT = 1001;
alter table users
modify createdAt datetime DEFAULT CURRENT_TIMESTAMP;
alter table users
modify updatedAt datetime DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP;
alter table users add column rollno varchar(30);
alter table users add column dateOfJoin varchar(30) after rollno;
delete from users where passwordHash='zdd';
|
DROP TABLE IF EXISTS `provinces`;
CREATE TABLE `provinces` (
`id` int(11) NOT NULL auto_increment,
`provinceid` varchar(20) NOT NULL,
`province` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='省份信息表' AUTO_INCREMENT=35 ;
insert into provinces(id,provinceid,province) values(1,'110000','北京市');
insert into provinces(id,provinceid,province) values(2,'120000','天津市');
insert into provinces(id,provinceid,province) values(3,'130000','河北省');
insert into provinces(id,provinceid,province) values(4,'140000','山西省');
insert into provinces(id,provinceid,province) values(5,'150000','内蒙古自治区');
insert into provinces(id,provinceid,province) values(6,'210000','辽宁省');
insert into provinces(id,provinceid,province) values(7,'220000','吉林省');
insert into provinces(id,provinceid,province) values(8,'230000','黑龙江省');
insert into provinces(id,provinceid,province) values(9,'310000','上海市');
insert into provinces(id,provinceid,province) values(10,'320000','江苏省');
insert into provinces(id,provinceid,province) values(11,'330000','浙江省');
insert into provinces(id,provinceid,province) values(12,'340000','安徽省');
insert into provinces(id,provinceid,province) values(13,'350000','福建省');
insert into provinces(id,provinceid,province) values(14,'360000','江西省');
insert into provinces(id,provinceid,province) values(15,'370000','山东省');
insert into provinces(id,provinceid,province) values(16,'410000','河南省');
insert into provinces(id,provinceid,province) values(17,'420000','湖北省');
insert into provinces(id,provinceid,province) values(18,'430000','湖南省');
insert into provinces(id,provinceid,province) values(19,'440000','广东省');
insert into provinces(id,provinceid,province) values(20,'450000','广西壮族自治区');
insert into provinces(id,provinceid,province) values(21,'460000','海南省');
insert into provinces(id,provinceid,province) values(22,'500000','重庆市');
insert into provinces(id,provinceid,province) values(23,'510000','四川省');
insert into provinces(id,provinceid,province) values(24,'520000','贵州省');
insert into provinces(id,provinceid,province) values(25,'530000','云南省');
insert into provinces(id,provinceid,province) values(26,'540000','西藏自治区');
insert into provinces(id,provinceid,province) values(27,'610000','陕西省');
insert into provinces(id,provinceid,province) values(28,'620000','甘肃省');
insert into provinces(id,provinceid,province) values(29,'630000','青海省');
insert into provinces(id,provinceid,province) values(30,'640000','宁夏回族自治区');
insert into provinces(id,provinceid,province) values(31,'650000','新疆维吾尔自治区');
insert into provinces(id,provinceid,province) values(32,'710000','台湾省');
insert into provinces(id,provinceid,province) values(33,'810000','香港特别行政区');
insert into provinces(id,provinceid,province) values(34,'820000','澳门特别行政区');
|
ALTER TABLE [dbo].[EmailQueueXAttachments]
ADD CONSTRAINT [FK_EmailQueueXAttachments_Attachments] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION;
|
insert into load (time, note) values
('2016-11-02 04:00:00', 'more_skip'),
('2016-11-02 04:00:05.333000', 'more_skip'),
('2016-11-02 04:00:05.333003', 'more_skip'),
('2016-11-02 04:00:05.333004', 'more_load'),
('2016-11-02 04:00:06', 'more_load'),
('2016-11-02 04:00:06', 'more_load');
|
-- --------------------------------------------------------------------------------
-- CREATE ROUTINES
-- --------------------------------------------------------------------------------
USE `sctau`;
DELIMITER //
DROP FUNCTION IF EXISTS get_FSN
//
CREATE FUNCTION get_FSN(candidate bigint(20)) RETURNS varchar(2048)
BEGIN
RETURN (select term from descriptions_snapshot
where active = 1
and typeId = 900000000000003001
and conceptId = candidate);
END
//
DROP FUNCTION IF EXISTS get_PT
//
CREATE FUNCTION get_PT(candidate bigint(20)) RETURNS varchar(2048)
BEGIN
RETURN (SELECT term
FROM descriptions_snapshot AS D
INNER JOIN language_refset_snapshot AS ADRS
ON D.id = ADRS.referencedcomponentid
WHERE D.conceptId = candidate
AND ADRS. acceptabilityid = 900000000000548007
AND ADRS.active = 1);
END
//
DELIMITER ;
|
CREATE PROCEDURE [dbo].[dnn_Messaging_GetNextMessageForDispatch]
@SchedulerInstance uniqueidentifier
AS
Declare @target_messageID int
SELECT @target_messageID = MessageID FROM dnn_Messaging_Messages WHERE EmailSent = 0 AND
(EmailSchedulerInstance is NULL or EmailSchedulerInstance= '00000000-0000-0000-0000-000000000000')
AND status not in (0,3) ORDER BY Date DESC
Update dnn_Messaging_Messages set EmailSchedulerInstance = @SchedulerInstance where MessageID = @target_messageID
select * from dnn_Messaging_Messages where MessageID = @target_messageID
|
CREATE DATABASE ecointracker_db;
GRANT ALL PRIVILEGES ON DATABASE ecointracker_db TO ecointracker;
CREATE DATABASE ecointracker_test_db;
GRANT ALL PRIVILEGES ON DATABASE ecointracker_test_db TO ecointracker;
|
CREATE TABLE `city` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`updated` datetime(6) DEFAULT NULL,
`country_fk` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK8mipuflnidcgu8cvvk595f9ot` (`country_fk`),
CONSTRAINT `FK8mipuflnidcgu8cvvk595f9ot` FOREIGN KEY (`country_fk`) REFERENCES `country` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
SET NAMES UTF8;
DROP DATABASE IF EXISTS xfn;
CREATE DATABASE xfn CHARSET=UTF8;
USE xfn;
-- 管理员信息表
CREATE TABLE xfn_admin(
aid INT PRIMARY KEY AUTO_INCREMENT,
aname VARCHAR(32) UNIQUE,
apwd VARCHAR(64)
);
-- 管理员
INSERT INTO xfn_admin VALUES
(Null,'admin',PASSWORD(123456)),
(Null,'boss',PASSWORD(9999));
-- 项目全局设置
CREATE TABLE xfn_settinngs(
sid INT PRIMARY KEY AUTO_INCREMENT,
appName VARCHAR(64),
apiUrl VARCHAR(64),
adminUrl VARCHAR(64),
appUrl VARCHAR(64),
icp VARCHAR(64),
copyright VARCHAR(64)
);
INSERT INTO xfn_settinngs VALUES
(NULL,'小肥牛','http://127.0.0.1:8090','http://127.0.0.1:8091','http://127.0.0.1:8092','京ICP备12003709号-3','Copyright © 2002-2019 北京达内金桥科技有限公司版权所有');
-- 桌面信息表
CREATE TABLE xfn_table(
tid INT PRIMARY KEY AUTO_INCREMENT,
tname VARCHAR(64),
type VARCHAR(16),
status INT
);
INSERT INTO xfn_table VALUES
(NULL,'福满堂','6-8人桌',1),
(NULL,'金镶玉','6-8人桌',1),
(NULL,'寿启天','6-8人桌',1),
(NULL,'小时代','6-8人桌',1),
(NULL,'全家福','6-8人桌',1);
-- 桌面预定信息表
-- 菜品分类表
CREATE TABLE xfn_reservation(
rid INT PRIMARY KEY AUTO_INCREMENT,
contactName VARCHAR(64),
phone VARCHAR(16),
contacTime BIGINT,
dinnerTime BIGINT
-- tableId INT
-- FOREIGN KEY(tableId) REFERENCES xfn_category(cid)
);
INSERT INTO xfn_reservation VALUES
(NULL,'丁丁','135012455678',1548404891997,1548404891997),
(NULL,'当当','135012455678',1548404891997,1548404891997),
(NULL,'丫丫','135012455678',1548404891997,1548404891997);
CREATE TABLE xfn_category(
cid INT PRIMARY KEY AUTO_INCREMENT,
cname VARCHAR(32)
);
INSERT INTO xfn_category VALUES
(NULL,'肉类'),
(NULL,'丸滑类'),
(NULL,'海鲜'),
(NULL,'菌菇类');
CREATE TABLE xfn_dish(
did INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(32),
imgUrl VARCHAR(128),
price DECIMAL(6,2),
detail VARCHAR(128),
categoryId INT,
FOREIGN KEY(categoryId) REFERENCES xfn_category(cid)
);
INSERT INTO xfn_dish VALUES
(100000,'草鱼片','sdfsd.png',35,'选鲜活草鱼',1),
(Null,'脆皮肠','sdfsd.png',25,'开锅即食',1);
CREATE TABLE xfn_order(
oid INT PRIMARY KEY AUTO_INCREMENT,
startTime BIGINT,
endTime BIGINT,
customerCount INT,
tableId INT,
FOREIGN KEY(tableId) REFERENCES xfn_table(tid)
);
INSERT INTO xfn_order VALUES
(1,1548404891997,1548404891997,3,1);
CREATE TABLE xfn_order_detail(
oid INT PRIMARY KEY AUTO_INCREMENT,
dishId INT,
dishCount INT,
CustomerName VARCHAR(64),
orderId INT,
FOREIGN KEY(dishId) REFERENCES xfn_dish(did),
FOREIGN KEY(orderId) REFERENCES xfn_order(oid)
);
INSERT INTO xfn_order_detail VALUES
(NULL,100000,1,'丁丁',1);
|
-- examples on insert
-- the current table status
select *
from service;
-- plain insert
insert into service (service_id, name, location_id) values
(20, 'Mirdor Shifty Solutions', 1100);
-- multiline insert
insert into service (service_id, name, location_id) values
(21, 'Old Gondor Messingup', 1200),
(22, 'Rohan Leather Finitures', 1300);
-- column with default value (nullable or other) could be skipped
insert into service (service_id, name) values
(12, 'Kerr & Reetch Associates');
-- auto-incremented value for pk
insert into service (name) values ('Multiple Oz');
-- using default values for each column
insert into service (name) values (DEFAULT);
-- insert relying on column definition on table
insert into service values
(13, 'Rainydays Carwash', null);
|
DELIMITER /
INSERT INTO KRIM_ROLE_ID_BS_S VALUES(NULL)
/
-- iacuc protocol creator
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR)
VALUES ('Y','IACUC Protocol Creator',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'UnitHierarchy'),NOW(),'KC-IACUC',UUID(),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),'IACUC Protocol Creator',1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KR-SYS' AND NM = 'Initiate Document'),'KC-IACUC','Create IACUC Protocol','Create IACUC Protocol','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KR-SYS' AND NM = 'Document Type (Permission)'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_ROLE_ID_BS_S VALUES(NULL)
/
-- iacuc protocol aggregator
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR)
VALUES ('Y','IACUC Protocol Aggregator',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'Unit'),NOW(),'KC-IACUC',UUID(),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),'IACUC Protocol Aggregator',1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Perform Document Action'),'KC-IACUC','Create IACUC Amendment','Create a new amendment for a IACUC protocol','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'documentAction'),'create_ammendment',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Perform Document Action'),'KC-IACUC','Create IACUC Renewal','Create a new renewal for a IACUC protocol','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'documentAction'),'create_renewal',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'Route Document'),'KC-IACUC','Submit IACUC protocol for Review','Submit a IACUC Protocol to IRB for review','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KR-SYS' AND NM = 'Document Type (Permission)'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Edit Document Section'),'KC-IACUC','Modify IACUC Protocol','Modify IACUC Protocol Document','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'sectionName'),'iacucProtocol',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Edit Document Section'),'KC-IACUC','Modify IACUC ProtocolPermissions','Assign Users to IACUC Protocol Roles','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'sectionName'),'protocol_permissions',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'View Document Section'),'KC-IACUC','View IACUC Protocol','View IACUC Protocol Document','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Section'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'sectionName'),'iacucProtocol',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Perform Document Action'),'KC-IACUC','Add IACUC Protocol Notes','Add IACUC Protocol Notes','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'documentAction'),'add_notes',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_T (PERM_ID,PERM_TMPL_ID,NMSPC_CD,NM,DESC_TXT,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT PERM_TMPL_ID FROM KRIM_PERM_TMPL_T WHERE NMSPC_CD = 'KC-IDM' AND NM = 'Modify All Documents'),'KC-IACUC','Modify Any IACUC Protocol','Modify Any IACUC Protocol Document','Y',UUID(),1)
/
INSERT INTO KRIM_ATTR_DATA_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_PERM_ATTR_DATA_T (ATTR_DATA_ID,PERM_ID,KIM_TYP_ID,KIM_ATTR_DEFN_ID,ATTR_VAL,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ATTR_DATA_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KC-SYS' AND NM = 'Document Action'),(SELECT KIM_ATTR_DEFN_ID FROM KRIM_ATTR_DEFN_T WHERE NMSPC_CD = 'KR-WKFLW' AND NM = 'documentTypeName'),'IacucProtocolDocument',UUID(),1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_PERM_ID_BS_S),'Y',UUID(),1)
/
INSERT INTO KRIM_ROLE_ID_BS_S VALUES(NULL)
/
-- modify iacuc protocol
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR)
VALUES ('Y','Modify IACUC Protocols',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'UnitHierarchy'),NOW(),'KC-IACUC',UUID(),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),'Modify IACUC Protocols',1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,VER_NBR,OBJ_ID)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT PERM_ID FROM KRIM_PERM_T WHERE NM = 'Modify Any IACUC Protocol' AND NMSPC_CD='KC-IACUC'),'Y',1,UUID())
/
INSERT INTO KRIM_ROLE_ID_BS_S VALUES(NULL)
/
-- iacuc protocol viewer
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR)
VALUES ('Y','IACUC Protocol Viewer',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM = 'Unit'),NOW(),'KC-IACUC',UUID(),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),'IACUC Protocol Viewer',1)
/
INSERT INTO KRIM_ROLE_PERM_ID_BS_S VALUES(NULL)
/
INSERT INTO KRIM_ROLE_PERM_T (ROLE_PERM_ID,ROLE_ID,PERM_ID,ACTV_IND,OBJ_ID,VER_NBR)
VALUES ((SELECT (MAX(ID)) FROM KRIM_ROLE_PERM_ID_BS_S),(SELECT (MAX(ID)) FROM KRIM_ROLE_ID_BS_S),(SELECT PERM_ID FROM KRIM_PERM_T WHERE NM = 'View IACUC Protocol' AND NMSPC_CD='KC-IACUC'),'Y',UUID(),1)
/
DELIMITER ;
|
/*
Start with batting tables
*/
/*
Query column that are not part of _additional_ table
*/
SELECT A.COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS A
WHERE A.TABLE_NAME = 'away_batting' AND
A.COLUMN_NAME NOT IN (SELECT A.COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS A
WHERE A.TABLE_NAME = 'away_additional_batting');
/*
Create temp table for batting
*/
SELECT aa.*, h.s_h, h.bo, h.slg, h.s_rbi, h.s_bb, h.obp, h.s_r, h.s_hr, h.s_so, h.avg, h.ops INTO TempAwayBatting
FROM away_additional_batting as aa
FULL JOIN away_batting as h ON (aa.name_display_first_last = h.name_display_first_last AND
h.game_id = aa.game_id);
SELECT aa.*, h.s_h, h.bo, h.slg, h.s_rbi, h.s_bb, h.obp, h.s_r, h.s_hr, h.s_so, h.avg, h.ops INTO TempHomeBatting
FROM home_additional_batting as aa
FULL JOIN home_batting as h ON (aa.name_display_first_last = h.name_display_first_last AND
h.game_id = aa.game_id);
/*
Find problematic columns
*/
SELECT column_name, data_type
FROM information_schema.columns
WHERE (information_schema.columns.table_name = 'tempawaybatting') OR
(information_schema.columns.table_name = 'temphomebatting');
/*
Change column type for batting tables
# TODO fix in the python extraction
*/
ALTER TABLE public.tempawaybatting ALTER COLUMN bam_s_d TYPE INTEGER USING bam_s_d::INTEGER;
ALTER TABLE public.tempawaybatting ALTER COLUMN bis_s_d TYPE INTEGER USING bis_s_d::INTEGER;
ALTER TABLE public.tempawaybatting ALTER COLUMN first_gidp TYPE INTEGER USING first_gidp::INTEGER;
ALTER TABLE public.tempawaybatting ALTER COLUMN gidp TYPE INTEGER USING gidp::INTEGER;
ALTER TABLE public.tempawaybatting ALTER COLUMN go TYPE INTEGER USING go::INTEGER;
ALTER TABLE public.tempawaybatting ALTER COLUMN cs TYPE INTEGER USING cs::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN bam_s_d TYPE INTEGER USING bam_s_d::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN bis_s_d TYPE INTEGER USING bis_s_d::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN first_gidp TYPE INTEGER USING first_gidp::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN gidp TYPE INTEGER USING gidp::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN go TYPE INTEGER USING go::INTEGER;
ALTER TABLE public.temphomebatting ALTER COLUMN cs TYPE INTEGER USING cs::INTEGER;
/*
Add side to a record, then union between away and home games
*/
ALTER TABLE public.tempawaybatting ADD side TEXT DEFAULT 'away' NULL;
ALTER TABLE public.temphomebatting ADD side TEXT DEFAULT 'home' NULL;
SELECT b.* INTO Batting
FROM (SELECT a.* FROM TempAwayBatting AS a
UNION
SELECT h.* FROM TempHomeBatting AS h) AS b;
DROP TABLE tempawaybatting;
DROP TABLE temphomebatting;
SELECT to_date(SUBSTR(game_id, 1, 10), 'YYYY_MM_DD') AS date
FROM batting;
ALTER TABLE public.batting ADD date DATE;
UPDATE public.batting SET date = to_date(SUBSTR(game_id, 1, 10), 'YYYY_MM_DD');
/*
Pitching
*/
/*
Query column that are not part of _additional_ table
*/
SELECT A.COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS A
WHERE A.TABLE_NAME = 'away_pitching' AND
A.COLUMN_NAME NOT IN (SELECT A.COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS A
WHERE A.TABLE_NAME = 'away_additional_pitching');
/*
Create temp table for batting
*/
SELECT aa.*, h.era, h.note, h.s_bb, h.w, h.l, h.s_r, h.s_er, h.sv, h.hld, h.s_so, bs, s_ip INTO TempAwayPitching
FROM away_additional_pitching as aa
FULL JOIN away_pitching as h ON (aa.name_display_first_last = h.name_display_first_last AND
h.game_id = aa.game_id);
SELECT aa.*, h.era, h.note, h.s_bb, h.w, h.l, h.s_r, h.s_er, h.sv, h.hld, h.s_so, bs, s_ip INTO TemphomePitching
FROM home_additional_pitching as aa
FULL JOIN home_pitching as h ON (aa.name_display_first_last = h.name_display_first_last AND
h.game_id = aa.game_id);
/*
Find problematic columns
*/
SELECT column_name, data_type
FROM information_schema.columns
WHERE (information_schema.columns.table_name = 'tempawaypitching') OR
(information_schema.columns.table_name = 'temphomepitching');
ALTER TABLE public.TempAwayPitching ADD side TEXT DEFAULT 'away' NULL;
ALTER TABLE public.TemphomePitching ADD side TEXT DEFAULT 'home' NULL;
SELECT b.* INTO Pitching
FROM (SELECT a.* FROM TempAwayPitching AS a
UNION
SELECT h.* FROM TemphomePitching AS h) AS b;
ALTER TABLE public.pitching ADD date DATE;
UPDATE public.pitching SET date = to_date(SUBSTR(game_id, 1, 10), 'YYYY_MM_DD');
DROP TABLE TempAwayPitching;
DROP TABLE TemphomePitching;
|
--cases from dev
SELECT QUARTER('2008-04-01 01:02:03 Asia/Seoul');
--SELECT QUARTER(current_time);
-- test for valid date-time-tz format
select quarter(datetimetz'2003-12-31 01:02:03.1234 Europe/Paris'), if (quarter(datetimetz'2003-12-31 01:02:03.1234 Europe/Paris') = 4, 'ok', 'nok');
select quarter(timestamptz'2003-12-31 01:02:03 Asia/Seoul'), if (quarter(timestamptz'2003-12-31 01:02:03 Asia/Seoul') = 4, 'ok', 'nok');
-- test for valid date-time-tz string format
select quarter('2003-12-31 01:02:03.1234'), if (quarter('2003-12-31 01:02:03.1234') = 4, 'ok', 'nok');
select quarter('2003-12-31 01:02:03'), if (quarter('2003-12-31 01:02:03') = 4, 'ok', 'nok');
-- test for special case
select quarter('1-1-1 10:10:10 AM'), if (quarter('1-1-1 10:10:10 AM') = 1, 'ok', 'nok');
select quarter('2000-12-31 10:10:10 AM'), if (quarter('2000-12-31 10:10:10') = 4, 'ok', 'nok');
-- check if ER_DATE_CONVERSION is occured.
select quarter('2000-01-00 01:02:03');
select quarter('2000-12-32 01:02:03');
select quarter('1999-2-29 01:02:03');
select quarter('01:02:03');
|
INSERT INTO `tb_empresa` (`cnpj`, `data_atualizacao`, `data_criacao`, `razao_social`)
VALUES ('75798614000160', CURRENT_DATE(), CURRENT_DATE(), 'FeeDev IT');
INSERT INTO `tb_funcionario` (`cpf`, `data_atualizacao`, `data_criacao`, `email`, `nome`,
`perfil`, `qtd_horas_almoco`, `qtd_horas_trabalho_dia`, `senha`, `valor_hora`, `empresa_id`)
VALUES ('16248890935', CURRENT_DATE(), CURRENT_DATE(), 'admin@feedev.com', 'ADMIN', 'ROLE_ADMIN', NULL, NULL,
'$2a$06$xIvBeNRfS65L1N17I7JzgefzxEuLAL0Xk0wFAgIkoNqu9WD6rmp4m', NULL,
(SELECT `id` FROM `tb_empresa` WHERE `cnpj` = '75798614000160'));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.