text
stringlengths
6
9.38M
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 22-07-2020 a las 19:57:27 -- Versión del servidor: 10.1.36-MariaDB -- Versión de PHP: 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `huellas` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `banner` -- CREATE TABLE `banner` ( `id` int(11) NOT NULL, `titulo` varchar(50) NOT NULL, `descripcion` varchar(255) NOT NULL, `url_image` varchar(255) NOT NULL, `estado` int(1) NOT NULL, `orden` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `banner` -- INSERT INTO `banner` (`id`, `titulo`, `descripcion`, `url_image`, `estado`, `orden`) VALUES (92, 'Teddy', 'Raza pequeña\r\n15 Centímetros\r\nVacunado contra la rabia', 'card1.png', 1, 1), (94, 'Frida', 'Pitbull \r\nRaza grande', '65585092_2644808335547928_5171459405446643712_n.jpg', 1, 2), (96, 'Horacio', 'Esterilizado', 'card2.png', 1, 3), (97, 'Paco', 'Raza pequeña, vacunado.', 'Seguimiento.jpg', 0, 4), (98, '', '', 'perro_china.jpg', 0, 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `form` -- CREATE TABLE `form` ( `id_form` int(5) NOT NULL, `id` int(5) NOT NULL, `id_usuario` int(5) NOT NULL, `titulo` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `nombre` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `ap` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `am` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `edad` int(3) NOT NULL, `tel` int(13) NOT NULL, `contacto_co` int(13) NOT NULL, `parent` varchar(15) COLLATE utf8_spanish_ci NOT NULL, `dir` varchar(80) COLLATE utf8_spanish_ci NOT NULL, `hijos` varchar(2) COLLATE utf8_spanish_ci NOT NULL, `hijos_cant` int(3) NOT NULL, `mascotas` varchar(2) COLLATE utf8_spanish_ci NOT NULL, `mascota_esp` varchar(30) COLLATE utf8_spanish_ci NOT NULL, `mascota_cant` int(3) NOT NULL, `url_ine` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `razon` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `term_cond` tinyint(1) NOT NULL, `estatus` varchar(15) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `form` -- INSERT INTO `form` (`id_form`, `id`, `id_usuario`, `titulo`, `nombre`, `ap`, `am`, `edad`, `tel`, `contacto_co`, `parent`, `dir`, `hijos`, `hijos_cant`, `mascotas`, `mascota_esp`, `mascota_cant`, `url_ine`, `razon`, `term_cond`, `estatus`) VALUES (1, 94, 2, '', 'Ulises', 'Vega', 'González', 21, 2147483647, 2147483647, 'Madre', 'Manuel Altamirano Lt 18', 'no', 0, 'no', '', 0, '', 'Porque quiero un nuevo compañero.', 1, 'Aceptado'), (2, 92, 2, '', 'Ulises', 'Vega', 'Gonzalez', 21, 2147483647, 2147483647, 'Tio', 'Manuel Altamirano ', 'no', 0, 'no', '', 0, '', '.', 1, 'Rechazado'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `seguimiento` -- CREATE TABLE `seguimiento` ( `id_seguimiento` int(11) NOT NULL, `id_usuario` int(5) NOT NULL, `foto_seg` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `observacion` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `estatus_seg` varchar(10) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Volcado de datos para la tabla `seguimiento` -- INSERT INTO `seguimiento` (`id_seguimiento`, `id_usuario`, `foto_seg`, `observacion`, `estatus_seg`) VALUES (1, 2, 'Seguimiento.jpg', '', 'Ok!'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipo_usuario` -- CREATE TABLE `tipo_usuario` ( `id` int(11) NOT NULL, `tipo` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `tipo_usuario` -- INSERT INTO `tipo_usuario` (`id`, `tipo`) VALUES (1, 'Administrador'), (2, 'Usuario'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE `usuarios` ( `id_usuario` int(11) NOT NULL, `usuario` varchar(30) NOT NULL, `password` varchar(130) NOT NULL, `nombre` varchar(100) NOT NULL, `correo` varchar(80) NOT NULL, `last_session` datetime DEFAULT NULL, `activacion` int(11) NOT NULL DEFAULT '0', `token` varchar(40) NOT NULL, `token_password` varchar(100) DEFAULT NULL, `password_request` int(11) DEFAULT '0', `id_tipo` int(11) NOT NULL, `tipo` varchar(15) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`id_usuario`, `usuario`, `password`, `nombre`, `correo`, `last_session`, `activacion`, `token`, `token_password`, `password_request`, `id_tipo`, `tipo`) VALUES (1, 'Juan ', '$2y$10$ihpc7pN/lISUNYkp1vUIrecOj.aAnihp6AQfPbHT3Ut04yeRsmtXK', 'Juan', 'juan@juan.juan', '2019-11-24 11:06:21', 1, '4e827208630dbd547df556c7cd098f6e', '', 1, 1, 'Administrador'), (2, 'Uez', '$2y$10$EppAVGO/WekSjtfc4Ex0ZupmZd9qpzHH42gO7w4yOn9QuJiIckfmC', 'Ulises', 'idknameuri@outlook.com', '2019-11-24 11:03:50', 1, 'cff170e3c0d208d460fe34ac389015ad', '', 1, 2, 'Usuario'), (3, 'cholo', '$2y$10$ihpc7pN/lISUNYkp1vUIrecOj.aAnihp6AQfPbHT3Ut04yeRsmtXK', 'choolo', 'cholo', NULL, 1, '1', '4e827208630dbd547df556c7cd098f6e', 0, 1, 'Administrador'), (4, 'choloez', '$2y$10$6K7DKn1ytiozid4QsRXdVOJCQ4dKwjsYzqUyPWGkAIDdVD0W78NKG', 'Cholo', 'cholo@cholo.com', '2019-10-20 22:30:01', 1, 'f2beb4a835cd90e55e104d4224049808', '', 1, 1, 'Administrador'), (5, 'idkuri', '$2y$10$gockecexFfCNEwBFqaGESu6DxpoEri7nnIfrFUJVhU24ZiTiZkDaS', 'Ulises', 'urisesug@gmail.com', NULL, 0, 'd778dc5764c59e6b62b77cd83eed1cc5', NULL, 0, 2, ''); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `banner` -- ALTER TABLE `banner` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `form` -- ALTER TABLE `form` ADD PRIMARY KEY (`id_form`,`id`,`id_usuario`); -- -- Indices de la tabla `seguimiento` -- ALTER TABLE `seguimiento` ADD PRIMARY KEY (`id_seguimiento`); -- -- Indices de la tabla `tipo_usuario` -- ALTER TABLE `tipo_usuario` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id_usuario`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `banner` -- ALTER TABLE `banner` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=99; -- -- AUTO_INCREMENT de la tabla `form` -- ALTER TABLE `form` MODIFY `id_form` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `seguimiento` -- ALTER TABLE `seguimiento` MODIFY `id_seguimiento` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `tipo_usuario` -- ALTER TABLE `tipo_usuario` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `usuarios` -- ALTER TABLE `usuarios` MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 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 IF NOT EXISTS user( user_name CHAR(255) NOT NULL, public_key TEXT NOT NULL, private_key TEXT NOT NULL, symmetric_key TEXT NOT NULL );
select "Posts".id as "post_id", * from "Posts" join "Users" on "Posts".author_id = "Users".id
-- phpMyAdmin SQL Dump -- version 4.4.11 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 13, 2015 at 05:39 AM -- Server version: 5.5.44 -- PHP Version: 5.6.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: `realtytrac` -- -- -------------------------------------------------------- -- -- Table structure for table `de_offenders` -- CREATE TABLE IF NOT EXISTS `de_offenders` ( `id` int(10) unsigned NOT NULL, `so_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_offenderid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_alias` text COLLATE utf8_unicode_ci, `so_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `zip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_statesource` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_addressdate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_ethnicity` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_race` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_sex` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL, `so_height` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_weight` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_eyes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_hair` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_dob` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_age` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_vehicles` text COLLATE utf8_unicode_ci, `so_targets` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_profilegenerated` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `so_duplicate` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `latitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `longitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `got_it_from` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `de_offenses` -- CREATE TABLE IF NOT EXISTS `de_offenses` ( `id` int(10) unsigned NOT NULL, `of_offendersid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Offense` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `of_ConvictedDate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Degree` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Counts` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `de_profiles` -- CREATE TABLE IF NOT EXISTS `de_profiles` ( `id` int(10) unsigned NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-Fresh, 1-Crawled, 2-Offender-not-Found', `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE IF NOT EXISTS `failed_jobs` ( `id` int(10) unsigned NOT NULL, `connection` text COLLATE utf8_unicode_ci NOT NULL, `queue` text COLLATE utf8_unicode_ci NOT NULL, `payload` longtext COLLATE utf8_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ga_counties` -- CREATE TABLE IF NOT EXISTS `ga_counties` ( `id` int(10) unsigned NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `pages` int(11) NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-fresh, 1-done' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ga_offenders` -- CREATE TABLE IF NOT EXISTS `ga_offenders` ( `id` int(10) unsigned NOT NULL, `so_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_offenderid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_alias` text COLLATE utf8_unicode_ci, `so_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `zip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_statesource` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_addressdate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_ethnicity` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_race` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_sex` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL, `so_height` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_weight` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_eyes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_hair` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_dob` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_age` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_vehicles` text COLLATE utf8_unicode_ci, `so_targets` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_profilegenerated` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `so_duplicate` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `latitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `longitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `got_it_from` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ga_offenses` -- CREATE TABLE IF NOT EXISTS `ga_offenses` ( `id` int(10) unsigned NOT NULL, `of_offendersid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Offense` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `of_ConvictedDate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Degree` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Counts` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `jobs` -- CREATE TABLE IF NOT EXISTS `jobs` ( `id` bigint(20) unsigned NOT NULL, `queue` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `payload` longtext COLLATE utf8_unicode_ci NOT NULL, `attempts` tinyint(3) unsigned NOT NULL, `reserved` tinyint(3) unsigned NOT NULL, `reserved_at` int(10) unsigned DEFAULT NULL, `available_at` int(10) unsigned NOT NULL, `created_at` int(10) unsigned NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ks_counties` -- CREATE TABLE IF NOT EXISTS `ks_counties` ( `id` int(10) unsigned NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1','2','3','4') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-fresh, 1-html-saved, 2-server-error, 3-links-extracted, 4-nolinks' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ks_offenders` -- CREATE TABLE IF NOT EXISTS `ks_offenders` ( `id` int(10) unsigned NOT NULL, `so_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_offenderid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_alias` text COLLATE utf8_unicode_ci, `so_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `zip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_statesource` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_addressdate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_ethnicity` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_race` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_sex` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL, `so_height` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_weight` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_eyes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_hair` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_dob` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_age` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_vehicles` text COLLATE utf8_unicode_ci, `so_targets` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_profilegenerated` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `so_duplicate` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `latitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `longitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `got_it_from` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ks_offenses` -- CREATE TABLE IF NOT EXISTS `ks_offenses` ( `id` int(10) unsigned NOT NULL, `of_offendersid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Offense` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `of_ConvictedDate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Degree` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Counts` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ks_profiles` -- CREATE TABLE IF NOT EXISTS `ks_profiles` ( `id` int(10) unsigned NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-Fresh, 1-Crawled, 2-Offender-not-Found', `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE IF NOT EXISTS `migrations` ( `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ms_counties` -- CREATE TABLE IF NOT EXISTS `ms_counties` ( `id` int(10) unsigned NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1','2','3','4') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-fresh, 1-html-saved, 2-server-error, 3-links-extracted, 4-nolinks' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ms_offenders` -- CREATE TABLE IF NOT EXISTS `ms_offenders` ( `id` int(10) unsigned NOT NULL, `so_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_offenderid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_alias` text COLLATE utf8_unicode_ci, `so_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `zip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_statesource` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_addressdate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_ethnicity` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `so_race` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_sex` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL, `so_height` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_weight` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_eyes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_hair` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_dob` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_age` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_vehicles` text COLLATE utf8_unicode_ci, `so_targets` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `so_profilegenerated` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `so_duplicate` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT NULL, `latitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `longitude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `got_it_from` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ms_offenses` -- CREATE TABLE IF NOT EXISTS `ms_offenses` ( `id` int(10) unsigned NOT NULL, `of_offendersid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Offense` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `of_ConvictedDate` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Degree` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_Counts` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `of_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ms_profiles` -- CREATE TABLE IF NOT EXISTS `ms_profiles` ( `id` int(10) unsigned NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `county_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `status` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL COMMENT '0-Fresh, 1-Crawled, 2-Offender-not-Found', `hash` varchar(32) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE IF NOT EXISTS `password_resets` ( `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `sexoffenders` -- CREATE TABLE IF NOT EXISTS `sexoffenders` ( `id` int(10) unsigned NOT NULL, `state_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `state_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `records_crawled` int(10) unsigned NOT NULL DEFAULT '0', `records_expected` int(10) unsigned NOT NULL DEFAULT '0', `crawl_state` enum('running','stopped','paused','completed','incomplete') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'incomplete', `paused` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT '0-normal, 1-paused', `expected_time` timestamp NULL DEFAULT NULL, `started_at` timestamp NULL DEFAULT NULL, `completed_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `sexoffenders_stats` -- CREATE TABLE IF NOT EXISTS `sexoffenders_stats` ( `id` int(10) unsigned NOT NULL, `sexoffender_id` int(10) unsigned NOT NULL, `records_crawled` int(10) unsigned NOT NULL DEFAULT '0', `crawl_time` time NOT NULL, `record_time` time NOT NULL, `started_at` timestamp NULL DEFAULT NULL, `completed_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `de_offenders` -- ALTER TABLE `de_offenders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `de_offenses` -- ALTER TABLE `de_offenses` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `de_offenses_hash_unique` (`hash`); -- -- Indexes for table `de_profiles` -- ALTER TABLE `de_profiles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `de_profiles_hash_unique` (`hash`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ga_counties` -- ALTER TABLE `ga_counties` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ga_offenders` -- ALTER TABLE `ga_offenders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ga_offenses` -- ALTER TABLE `ga_offenses` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `ga_offenses_hash_unique` (`hash`); -- -- Indexes for table `jobs` -- ALTER TABLE `jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ks_counties` -- ALTER TABLE `ks_counties` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ks_offenders` -- ALTER TABLE `ks_offenders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ks_offenses` -- ALTER TABLE `ks_offenses` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `ks_offenses_hash_unique` (`hash`); -- -- Indexes for table `ks_profiles` -- ALTER TABLE `ks_profiles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `ks_profiles_hash_unique` (`hash`); -- -- Indexes for table `ms_counties` -- ALTER TABLE `ms_counties` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ms_offenders` -- ALTER TABLE `ms_offenders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ms_offenses` -- ALTER TABLE `ms_offenses` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `ms_offenses_hash_unique` (`hash`); -- -- Indexes for table `ms_profiles` -- ALTER TABLE `ms_profiles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `ms_profiles_hash_unique` (`hash`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`), ADD KEY `password_resets_token_index` (`token`); -- -- Indexes for table `sexoffenders` -- ALTER TABLE `sexoffenders` ADD PRIMARY KEY (`id`), ADD KEY `sexoffenders_state_name_index` (`state_name`), ADD KEY `sexoffenders_state_code_index` (`state_code`), ADD KEY `sexoffenders_crawl_state_index` (`crawl_state`); -- -- Indexes for table `sexoffenders_stats` -- ALTER TABLE `sexoffenders_stats` ADD PRIMARY KEY (`id`), ADD KEY `sexoffenders_stats_sexoffender_id_foreign` (`sexoffender_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 `de_offenders` -- ALTER TABLE `de_offenders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `de_offenses` -- ALTER TABLE `de_offenses` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `de_profiles` -- ALTER TABLE `de_profiles` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ga_counties` -- ALTER TABLE `ga_counties` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ga_offenders` -- ALTER TABLE `ga_offenders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ga_offenses` -- ALTER TABLE `ga_offenses` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `jobs` -- ALTER TABLE `jobs` MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ks_counties` -- ALTER TABLE `ks_counties` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ks_offenders` -- ALTER TABLE `ks_offenders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ks_offenses` -- ALTER TABLE `ks_offenses` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ks_profiles` -- ALTER TABLE `ks_profiles` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ms_counties` -- ALTER TABLE `ms_counties` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ms_offenders` -- ALTER TABLE `ms_offenders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ms_offenses` -- ALTER TABLE `ms_offenses` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ms_profiles` -- ALTER TABLE `ms_profiles` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `sexoffenders` -- ALTER TABLE `sexoffenders` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `sexoffenders_stats` -- ALTER TABLE `sexoffenders_stats` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `sexoffenders_stats` -- ALTER TABLE `sexoffenders_stats` ADD CONSTRAINT `sexoffenders_stats_sexoffender_id_foreign` FOREIGN KEY (`sexoffender_id`) REFERENCES `sexoffenders` (`id`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jan 02, 2017 at 09:29 PM -- Server version: 5.6.33 -- PHP Version: 7.0.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `spotlight` -- -- -------------------------------------------------------- -- -- Table structure for table `atores` -- CREATE TABLE `atores` ( `_id_ator` bigint(20) UNSIGNED NOT NULL, `nome_ator` varchar(255) DEFAULT NULL, `nasc_ator` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `atores` -- INSERT INTO `atores` (`_id_ator`, `nome_ator`, `nasc_ator`) VALUES (1, 'Marlon Brando', '1924-04-03'), (2, 'Al Pacino', '1940-04-25'), (3, 'James Caan', '1940-03-26'), (4, 'Robert De Niro', '1943-07-17'), (5, 'Robert Duvall', '1931-01-05'), (6, 'Will Smith', '1968-09-25'), (7, 'Jared Leto', '1971-12-26'), (8, 'Margot Robbie', '1990-08-02'), (9, 'Jane Fonda', '1937-12-21'), (10, 'Jon Voight', '1938-12-29'), (11, 'Bruce Dern', '1936-06-04'), (12, 'Mike Myers', '1963-05-25'), (13, 'Dana Carvey', '1955-06-02'), (14, 'Rob Lowe', '1964-03-17'), (15, 'Tim Robbins', NULL), (16, 'Morgan Freeman', NULL), (17, 'Bob Gunton', NULL), (18, 'Christian Bale', NULL), (19, 'Heath Ledger', NULL), (20, 'Aaron Eckhart', NULL), (21, 'Henry Fonda', NULL), (22, 'Lee J. Cobb', NULL), (23, 'Martin Balsam ', NULL), (24, 'Tom Hanks', NULL), (25, 'Robin Wright', NULL), (26, 'Gary Sinise', NULL), (27, 'John Travolta', NULL), (28, 'Uma Thurman', NULL), (29, 'Samuel L. Jackson', NULL); -- -------------------------------------------------------- -- -- Table structure for table `filmes` -- CREATE TABLE `filmes` ( `_id_filmes` bigint(20) UNSIGNED NOT NULL, `filme` varchar(255) DEFAULT NULL, `image` varchar(500) DEFAULT NULL, `classif` decimal(19,0) DEFAULT NULL, `data_lanc` date DEFAULT NULL, `realizador` varchar(255) DEFAULT NULL, `imdb_rating` float DEFAULT NULL, `ost_rating` float DEFAULT NULL, `flag_filme_add` tinyint(1) DEFAULT '1', `flag_filme_estreia` tinyint(1) DEFAULT '1', `Utilizadoruser_name` varchar(255) NOT NULL DEFAULT 'gestor' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `filmes` -- INSERT INTO `filmes` (`_id_filmes`, `filme`, `image`, `classif`, `data_lanc`, `realizador`, `imdb_rating`, `ost_rating`, `flag_filme_add`, `flag_filme_estreia`, `Utilizadoruser_name`) VALUES (1, 'The Godfather', 'assets/images/the_godfather.jpg', '17', '1972-10-24', 'Francis Ford Coppola', 9.2, 89, 1, 1, 'gestor'), (2, 'The Godfather: Part II', 'assets/images/the_godfather_II.jpg', '16', '1977-10-14', 'Francis Ford Coppola', 9, 88.3, 1, 1, 'gestor'), (3, 'Suicide Squad', 'assets/images/suicide_squad.jpg', '14', '2016-08-04', 'David Ayer', 6.5, 91.3, 1, 1, 'gestor'), (4, 'Coming Home', 'assets/images/coming_home.jpg', NULL, '1978-02-15', 'Hal Ashby', 7.3, NULL, 1, 1, 'gestor'), (5, 'Wayne\'s World', 'assets/images/waynes_world.jpg', '12', '1992-02-22', 'Penelope Spheeris', 7, NULL, 1, 1, 'gestor'), (6, 'The Shawshank Redemption', 'assets/images/shawshank_redemption.jpg', '16', '1995-03-31', 'Frank Derabont', 9.3, NULL, 1, 1, 'gestor'), (7, 'The Dark Knight', 'assets/images/the_dark_knight.jpg', '12', '2008-07-24', 'Christopher Nolan', 9, 100, 1, 1, 'gestor'), (8, '12 Angry Men', 'assets/images/12_angry_men.jpg', '12', '1959-10-28', 'Sidney Lumet', 8.9, NULL, 1, 1, 'gestor'), (9, 'Forrest Gump', 'assets/images/forrest_gump.jpg', '12', '1994-10-24', 'Robert Zemeckis', 8.8, 99, 1, 1, 'gestor'), (10, 'Pulp Fiction', 'assets/images/pulp_fiction.jpg', '16', '1994-11-25', 'Quentin Tarantino', 8.9, NULL, 1, 1, 'gestor'); -- -------------------------------------------------------- -- -- Table structure for table `filmes_atores` -- CREATE TABLE `filmes_atores` ( `filmes_id_filmes` decimal(19,0) NOT NULL, `atores_id_ator` decimal(19,0) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `filmes_atores` -- INSERT INTO `filmes_atores` (`filmes_id_filmes`, `atores_id_ator`) VALUES ('1', '1'), ('1', '2'), ('2', '2'), ('1', '3'), ('2', '4'), ('2', '5'), ('3', '6'), ('3', '7'), ('3', '8'), ('4', '9'), ('4', '10'), ('4', '11'), ('5', '12'), ('5', '13'), ('5', '14'), ('6', '15'), ('6', '16'), ('6', '17'), ('7', '18'), ('7', '19'), ('7', '20'), ('8', '21'), ('8', '22'), ('8', '23'), ('9', '24'), ('9', '25'), ('9', '26'), ('10', '27'), ('10', '28'), ('10', '29'); -- -------------------------------------------------------- -- -- Table structure for table `filmes_generos` -- CREATE TABLE `filmes_generos` ( `filmes_id_filmes` decimal(19,0) NOT NULL, `generos_id_genero` int(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `filmes_generos` -- INSERT INTO `filmes_generos` (`filmes_id_filmes`, `generos_id_genero`) VALUES ('1', 1), ('2', 1), ('4', 1), ('1', 2), ('2', 2), ('3', 3), ('3', 4), ('3', 5), ('4', 6), ('4', 7), ('5', 8), ('5', 9), ('6', 1), ('6', 2), ('7', 1), ('7', 2), ('7', 3), ('8', 1), ('8', 2), ('9', 1), ('9', 8), ('10', 1), ('10', 2); -- -------------------------------------------------------- -- -- Table structure for table `filmes_musicas` -- CREATE TABLE `filmes_musicas` ( `filmes_id_filmes` decimal(19,0) NOT NULL, `musicas_id_musica` int(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `filmes_musicas` -- INSERT INTO `filmes_musicas` (`filmes_id_filmes`, `musicas_id_musica`) VALUES ('1', 1), ('1', 2), ('1', 3), ('1', 4), ('1', 5), ('1', 6), ('2', 7), ('2', 8), ('2', 9), ('2', 10), ('2', 11), ('2', 12), ('3', 13), ('4', 13), ('3', 14), ('5', 14), ('3', 15), ('3', 16), ('4', 17), ('4', 18), ('5', 19), ('6', 20), ('6', 21), ('6', 22), ('7', 23), ('7', 24), ('8', 25), ('9', 26), ('9', 27), ('9', 28), ('10', 29), ('10', 30), ('10', 31); -- -------------------------------------------------------- -- -- Table structure for table `generos` -- CREATE TABLE `generos` ( `_id_genero` bigint(20) UNSIGNED NOT NULL, `nome_genero` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `generos` -- INSERT INTO `generos` (`_id_genero`, `nome_genero`) VALUES (1, 'Drama'), (2, 'Crime'), (3, 'Action'), (4, 'Adventure'), (5, 'Fantasy'), (6, 'Romance'), (7, 'War'), (8, 'Comedy'); -- -------------------------------------------------------- -- -- Table structure for table `musicas` -- CREATE TABLE `musicas` ( `_id_musica` bigint(20) UNSIGNED NOT NULL, `nome_musica` varchar(255) NOT NULL, `m_generos` varchar(255) DEFAULT NULL, `m_ano` year(4) DEFAULT NULL, `cantor` varchar(255) DEFAULT NULL, `flag_musicas_novas` tinyint(1) DEFAULT '1', `Utilizadoruser_name` varchar(255) NOT NULL DEFAULT 'gestor' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `musicas` -- INSERT INTO `musicas` (`_id_musica`, `nome_musica`, `m_generos`, `m_ano`, `cantor`, `flag_musicas_novas`, `Utilizadoruser_name`) VALUES (1, 'Main Title (The Godfather Waltz)', NULL, NULL, NULL, 1, 'gestor'), (2, 'I Have But One Heart', NULL, NULL, 'Al Martino', 1, 'gestor'), (3, 'The Pickup', NULL, NULL, NULL, 1, 'gestor'), (4, 'Connie\'s Wedding', NULL, NULL, NULL, 1, 'gestor'), (5, 'The Halls of Fear', NULL, NULL, NULL, 1, 'gestor'), (6, 'Sicilian Pastorale', NULL, NULL, NULL, 1, 'gestor'), (7, 'Main Title/The Immigrant', NULL, NULL, NULL, 1, 'gestor'), (8, 'A New Carpet', NULL, NULL, NULL, 1, 'gestor'), (9, 'Kay', NULL, NULL, NULL, 1, 'gestor'), (10, 'Ev\'ry Time I Look In Your Eyes/After the Party', NULL, 1974, 'Nino Rota', 1, 'gestor'), (11, 'Vito and Abbandando', NULL, NULL, NULL, 1, 'gestor'), (12, 'Senza Mamma/Ciuri-Ciuri/Napule Ve Salute', NULL, NULL, NULL, 1, 'gestor'), (13, 'Sympathy for the Devil', NULL, 1968, 'The Rolling Stones', 1, 'gestor'), (14, 'Bohemian Rhapsody', 'Rock', 1975, 'Queen', 1, 'gestor'), (15, 'Without Me', 'Rap', 2002, 'Eminem', 1, 'gestor'), (16, 'Heathens', NULL, 2016, 'Twenty One Pilots', 1, 'gestor'), (17, 'Hey Jude', NULL, 1968, 'The Beatles', 1, 'gestor'), (18, 'My Girl', NULL, 1965, 'The Rolling Stones', 1, 'gestor'), (19, 'Everything About You', 'Hard rock', 1991, 'Ugly Kid Joe', 1, 'gestor'), (20, 'May', NULL, NULL, 'Thomas Newman', 1, 'gestor'), (21, 'If I Didn\'t Care', NULL, NULL, 'The Ink Spots', 1, 'gestor'), (22, 'Brooks Was Here', NULL, NULL, 'The Hollywood Studio Symphony', 1, 'gestor'), (23, 'Scatterin\' Monkey', NULL, 1998, 'Boom Boom Satellites', 1, 'gestor'), (24, '4 A Moment of Silence', NULL, 1998, 'Boom Boom Satellites', 1, 'gestor'), (25, 'Dance of the Cuckoos', NULL, 1998, NULL, 1, 'gestor'), (26, 'Lovesick Blues', NULL, 1922, 'Hank Williams', 1, 'gestor'), (27, 'Hound Dog', NULL, 1952, 'Elvis Presley', 1, 'gestor'), (28, 'Rebel-\'Rouser', NULL, 1958, 'Duane Eddy', 1, 'gestor'), (29, 'Misirlou', NULL, NULL, 'Dick Dale', 1, 'gestor'), (30, 'Jungle Boogie', NULL, NULL, 'Kool & The Gang', 1, 'gestor'), (31, 'Strawberry Letter 23', NULL, NULL, 'Brothers Johnson', 1, 'gestor'); -- -------------------------------------------------------- -- -- Table structure for table `utilizador` -- CREATE TABLE `utilizador` ( `username` varchar(255) NOT NULL, `passwd` varchar(255) NOT NULL, `tipo_user` varchar(11) NOT NULL DEFAULT 'user' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `utilizador` -- INSERT INTO `utilizador` (`username`, `passwd`, `tipo_user`) VALUES ('afvc', 'afvc', 'gestor'), ('1', '1', 'gestor'); -- -- Indexes for dumped tables -- -- -- Indexes for table `atores` -- ALTER TABLE `atores` ADD UNIQUE KEY `_id_ator` (`_id_ator`); -- -- Indexes for table `filmes` -- ALTER TABLE `filmes` ADD UNIQUE KEY `_id_filmes` (`_id_filmes`); -- -- Indexes for table `generos` -- ALTER TABLE `generos` ADD UNIQUE KEY `_id_genero` (`_id_genero`); -- -- Indexes for table `musicas` -- ALTER TABLE `musicas` ADD UNIQUE KEY `_id_musica` (`_id_musica`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `atores` -- ALTER TABLE `atores` MODIFY `_id_ator` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30; -- -- AUTO_INCREMENT for table `filmes` -- ALTER TABLE `filmes` MODIFY `_id_filmes` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `generos` -- ALTER TABLE `generos` MODIFY `_id_genero` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `musicas` -- ALTER TABLE `musicas` MODIFY `_id_musica` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
-- Listing all records of the second table of the data base SELECT score, name FROM second_table WHERE name is NOT NULL ORDER BY score DESC;
#mysql DROP TABLE IF EXISTS `fi_image_feature`; CREATE TABLE `fi_image_feature` ( `image_id` varchar(255) NOT NULL primary key, `feature` text default '', `charact` text default '', `pic_path` varchar(255) DEFAULT '', `lib_id` varchar(50) NOT NULL DEFAULT '0' , `top_left_x` int(11) DEFAULT 0, `top_left_y` int(11) DEFAULT 0, `bottom_right_x` int(11) DEFAULT 0, `bottom_right_y` int(11) DEFAULT 0, `creator` varchar(60) NOT NULL DEFAULT '创建者', `create_time` datetime NOT NULL default now(), `updator` varchar(50) NOT NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL default now() ) ENGINE=InnoDB DEFAULT CHARSET=utf8; #postgresql DROP table if exists fi_image_feature; CREATE TABLE fi_image_feature ( image_id varchar(255) NOT NULL primary key , feature text NOT NULL default '', charact text NOT NULL default '', pic_path varchar(255) NOT NULL DEFAULT '', lib_id varchar(50) NOT NULL DEFAULT '' , top_left_x int DEFAULT 0, top_left_y int DEFAULT 0, bottom_right_x int DEFAULT 0, bottom_right_y int DEFAULT 0, creator varchar(60) NOT NULL default 'user', create_time timestamp NOT NULL default now(), updator varchar(50) NOT NULL DEFAULT 'user' , update_time timestamp NOT NULL default now() ); comment on column fi_image_feature.image_id is '图片id,主键'; comment on column fi_image_feature.feature is '特征值'; comment on column fi_image_feature.charact is '保留字段'; comment on column fi_image_feature.lib_id is '专题库id'; comment on column fi_image_feature.top_left_x is '矩阵左下角X'; comment on column fi_image_feature.top_left_y is '矩阵左上角Y'; comment on column fi_image_feature.bottom_right_x is '矩阵右下角X'; comment on column fi_image_feature.bottom_right_y is '矩阵右下角Y'; comment on column fi_image_feature.creator is '更新者'; comment on column fi_image_feature.create_time is '创建时间'; comment on column fi_image_feature.updator is '更新者'; comment on column fi_image_feature.update_time is '更新时间';
DROP TABLE test.users; DROP SCHEMA test;
ALTER TABLE `XXX_plugin_hintergrundbild_lookup_bilder_menuepunkte` RENAME TO `XXX_plugin_background_lookup_bilder_menuepunkte`; ALTER TABLE `XXX_plugin_hintergrundbild_config` RENAME TO `XXX_plugin_background_configs`;
--4. Заказы поставщикам (Purchasing.Suppliers), которые были исполнены в январе 2014 года с доставкой Air Freight или Refrigerated Air Freight (DeliveryMethodName). --Вывести: --* способ доставки (DeliveryMethodName) --* дата доставки --* имя поставщика --* имя контактного лица принимавшего заказ (ContactPerson) --Таблицы: Purchasing.Suppliers, Purchasing.PurchaseOrders, Application.DeliveryMethods, Application.People. SELECT DeliveryMethodName,CONVERT(VarChar, OrderDate, 104), SupplierName, FullName FROM Purchasing.PurchaseOrders p JOIN Application.DeliveryMethods d ON p.DeliveryMethodID = d.DeliveryMethodID JOIN Purchasing.Suppliers s ON p.SupplierID = s.SupplierID JOIN Application.People pl ON p.ContactPersonID = pl.PersonID WHERE (OrderDate BETWEEN '01.01.2014' AND '31.01.2014') AND (DeliveryMethodName = 'Air Freight' OR DeliveryMethodName = 'Refrigerated Air Freight')
-- -- PostgreSQL database dump -- SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -- -- Name: plperl; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS plperl WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plperl; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION plperl IS 'PL/Perl procedural language'; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: pairs; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE pairs ( id integer NOT NULL, word1 text NOT NULL, word2 text NOT NULL ); -- -- Name: responses; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE responses ( id integer NOT NULL, uniqid character varying(13) NOT NULL, pair_id integer NOT NULL, score smallint NOT NULL, remote_addr inet, user_agent text ); -- -- Name: pair_scores; Type: VIEW; Schema: public; Owner: - -- CREATE VIEW pair_scores AS SELECT pairs.id AS pair_id, (1 / (count(responses.pair_id) + 1)) AS score FROM (pairs LEFT JOIN responses ON ((responses.pair_id = pairs.id))) GROUP BY pairs.id, responses.pair_id ORDER BY (1 / (count(responses.pair_id) + 1)) DESC, random(); -- -- Name: pairs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE pairs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: pairs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE pairs_id_seq OWNED BY pairs.id; -- -- Name: responses_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE responses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: responses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE responses_id_seq OWNED BY responses.id; -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY pairs ALTER COLUMN id SET DEFAULT nextval('pairs_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY responses ALTER COLUMN id SET DEFAULT nextval('responses_id_seq'::regclass); -- -- Name: pairs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY pairs ADD CONSTRAINT pairs_pkey PRIMARY KEY (id); -- -- Name: responses_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY responses ADD CONSTRAINT responses_pkey PRIMARY KEY (id); -- -- Name: responses_pair_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY responses ADD CONSTRAINT responses_pair_id_fk FOREIGN KEY (pair_id) REFERENCES pairs(id) ON DELETE CASCADE; -- -- Name: public; Type: ACL; Schema: -; Owner: - -- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete --
insert into langues values (1, 'français'); insert into langues values (2, 'anglais'); insert into langues values (3, 'espagnol'); insert into langues values (4, 'chinois'); insert into langues values (5, 'portugais'); insert into langues values (6, 'allemand'); insert into compte values ('admin', 'mdp', 'admin', -1); insert into compte values ('parent', 'mdp', 'parent', -2); insert into compte values ('nounou', 'mdp', 'nounou', -3); INSERT INTO revenu VALUES (24,58,128,1); INSERT INTO revenu VALUES (18,64,98,2);
CREATE TABLE `source_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `source_id` int(11) NOT NULL, `category` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `source_id` (`source_id`), KEY `category` (`category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Apr 01, 2018 at 06:14 AM -- Server version: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `the92shop` -- -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE IF NOT EXISTS `customer` ( `Cust_Id` int(30) NOT NULL AUTO_INCREMENT, `Name` varchar(50) NOT NULL, `Phone_number` varchar(10) NOT NULL, `Address` varchar(100) NOT NULL, `Postal_Code` varchar(30) NOT NULL, PRIMARY KEY (`Cust_Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=490 ; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`Cust_Id`, `Name`, `Phone_number`, `Address`, `Postal_Code`) VALUES (1, 'Racheal Loy', '96245546', '410 Canberra Road #13-55', '750410'), (2, 'Jean Wong', '98685252', '30 Jalan Bahagia #12-33', '320030'), (3, 'Jiao Jun', '85467999', '155 Mei Ling Street #23-44', '140155'), (4, 'Joanna Thew', '85879988', '15 Queen''s Close #17-66', '140015'), (5, 'Marge Fung', '95549989', '34 Eunos Crescent #15-90', '400034'), (6, 'Tang Ming Kit', '97552119', '17 Ghim Moh Road #02-45', '270017'), (7, 'Fan Ke Lin', '88228946', '89 Tanglin Halt Road #22-89', '142089'), (8, 'Nalco Group Pte Ltd', '64557823', '206C Compassvale Lane #14-99', '543206'), (9, 'Mavis Tan', '93378829', '518 Jelapang Road #11-38', '670518'), (10, 'Fiona Choy', '81045489', '55 Geylang Bahru #12-44', '330055'), (11, 'Clarice Tan', '99229885', '16 Telok Blangah Crescent #09-74', '90016'), (12, 'Wendy How', '94553321', '20 Queen''s Close #12-37', '140020'), (13, 'Pierce Low', '86675522', '160 Mei Ling Street #09-89', '140160'), (14, 'Aeddon Tan', '84436578', '415 Canberra Road #10-99', '750415'), (15, 'Rena Chua', '94459072', '165 Stirling Road #16-67', '140165'), (16, 'Benjamin Lim', '98712199', '91 Tanglin Halt Road #23-33', '142091'), (17, 'Aziemah', '90335477', '57 Geylang Bahru #18-76', '330057'), (18, 'Madelyn Liew', '93380556', '80 Commonwealth Drive #03-43', '140080'), (19, 'Joanne Kiong', '82447299', '418 Canberra Road #15-67', '750418'), (20, 'Karen Fook', '94359480', '34 Jalan Bahagia #02-21', '320034'), (21, 'Jonathan Goh', '92264395', '19 Ghim Moh Road #18-44', '270019'), (22, 'Seah Jun Ru', '87790926', '350 Woodlands Avenue 3 #13-34', '730350'), (23, 'Ryan Ng', '92691486', '12 Marsiling Lane #11-22', '730012'), (24, 'Loh Wei Heng', '95664673', '167 Stirling Road #10-83', '140167'), (25, 'Alex Huang', '97061065', '90 Commonwealth Drive #12-35', '140090'), (26, 'Edmund Ang', '85476531', '337 Sembawang Crescent #18-44', '750337'), (27, 'Shi Min Min', '85876531', '670 Choa Chu Kang Crescent #08-32', '680670'), (28, 'Png chye hoon', '87386189', '174 Boon Lay Drive #17-73', '640174'), (29, 'Tan Li Hua', '87776532', '778 Woodlands Drive 60 #03-22', '730778'), (30, 'Kenny Tan', '89093271', '700B Ang Mo Kio Avenue 6 #14-42', '562700'), (31, 'Adi Puteri', '89093272', '290 Tampines Street 22 #10-21', '520290'), (32, 'Alyssia Sim', '91807177', '557 Ang Mo Kio Avenue 10 #13-89', '560557'), (33, 'Bobby Ong', '93386189', '480 Sembawang Drive #15-30', '750480'), (34, 'Lydia Lim', '93386198', '804 Woodlands Street 81 #08-26', '730804'), (35, 'Chen Huifen', '93456189', '388 Bukit Batok West Avenue 5 #22-29', '65038'), (36, 'Aldric Goh', '97478731', '67 Bedok South Avenue 3 #15-98', '460067'), (37, 'Lee Ming Xuan', '98706531', '570B Woodlands Avenue 1 #16-37', '732570'), (38, 'Ng Sau Youk', '98228233', '106B Depot Road #12-20', '102106'), (39, 'Nadiah See', '91107496', '641 Hougang Avenue 8 #16-67', '530641'), (40, 'Kaylee Ang', '89573186', '108 Pasir Ris Street 12 #10-39', '510108'), (41, 'Teo Li Yin', '99689327', '606 Yishun Street 61 #12-88', '760606'), (42, 'Rahul Kumar', '81653718', '107 Bukit Batok West Avenue 6 #24-37', '650107'), (43, 'Elynn Toh', '97419315', '692A Choa Chu Kang Crescent #02-22', '681692'), (44, 'Chen Xiao Tong', '90069669', '35 Mandalay Road \n# 13–37 Mandalay Towers', '308215'), (45, 'Lim Swee Jin', '82735557', '252 Ang Mo Kio Ave 4 #19-90', '560252'), (46, 'Andrew Tan', '98522962', '110 Simei Street 1 #02-20', '520110'), (47, 'Jay Au', '98180106', '110 Tampines Street 11 #02-99', '521110'), (48, 'Samantha Lee', '82847286', '336 Hougang Avenue 7 #03-35', '530336'), (49, 'Mohammad Hisham', '94823109', '3 Tanjong Pagar Plaza #03-30', '81003'), (50, 'Hadi Halim', '87104757', '460 Tampines Street 42 #12-28', '520460'), (51, 'Charlotte Toh', '86614413', '45 Circuit Road #19-96', '370045'), (52, 'Marvely Loh', '90368521', '196C Punggol Field 17-22', '823196'), (53, 'Sae Chew Phinkeaw', '99451069', '509B Wellington Circle #03-23', '752509'), (54, 'Shirlene Yuen', '80830072', '641 Hougang Avenue 8 #04-55', '530641'), (55, 'Joan Chia', '97671786', '552 Jurong West Street 42 #04-59', '640552'), (56, 'Eva Tung', '97880855', '357C Admiralty Drive #03-96', '753357'), (57, 'Liu Qiuqiang', '88483398', '316 Bukit Batok Street 32 #06-39', '650316'), (58, 'siti hapsari dyahningrum', '96230473', '202A Compassvale Drive #14-46', '541202'), (59, 'Ashley Tan', '95583287', '40 Telok Blangah Rise #19-27', '90040'), (60, 'Shirley Yeo', '85261068', '321A Anchorvale Drive #12-97', '541321'), (61, 'Jaslin Low', '96934734', '2B Upper Boon Keng Road 04-73', '382002'), (62, 'Cindy Tian', '95451883', '289D Punggol Place #26-33', '824289'), (63, 'Julia Wee', '94232681', '501 Bukit Batok Street 52 #03-38', '650501'), (64, 'SK Ngo', '95965423', '206 Toa Payoh North #07-73', '310206'), (65, 'Nur Aishah', '99227315', '55 Lorong 5 Toa Payoh #08-33', '310055'), (66, 'Adeline Jong', '92876501', '167D Punggol East #19-87', '824167'), (67, 'Jeff Lim', '88850480', '170 Bishan Street 13 #09-23', '570170'), (68, 'Daniel Santamaria', '96359143', '614A Edgefield Plains #06-66', '821614'), (69, 'Kingsley Ong', '90974103', '144 Rivervale Drive #08-85', '540144'), (70, 'Ada Lim', '83824925', '12 Taman Ho Swee #09-73', '162012'), (71, 'Lee Ngo', '96898211', '239 Compassvale Walk #23-34', '540239'), (72, 'Amanda Chee', '97188478', '144 Lorong Ah Soo #03-30', '530144'), (73, 'Jynn Tan', '92953031', '588A Ang Mo Kio Street 52 #11-29', '561588'), (74, 'Geoffrey Tan', '90757230', '896C Woodlands Drive 50 #09-93', '732896'), (75, 'Charis Tham', '90407227', '33 Chai Chee Avenue #06-67', '461033'), (76, 'Victor Goh', '86180966', '35 Bedok South Avenue 2 #16-27', '460035'), (77, 'Michael Goh', '97805142', '336 Sembawang Crescent #08-87', '750336'), (78, 'Claire Zhou', '86556329', '483 Admiralty Link #13-76', '750483'), (79, 'Chua Wei Xiang', '96854150', '507B Wellington Circle #03-26', '752507'), (80, 'Yvonne Loh', '83643335', '292B Compassvale Street #04-30', '542292'), (81, 'Chris Lim', '93561255', '87 Telok Blangah Heights #15-32', '100087'), (82, 'Sujittra Yodthong', '98850262', '437 Jurong West Avenue 1 #03-26', '640437'), (83, 'Liu Fengyi', '96602836', '609 Jurong West Street 65 #10-11', '640609'), (84, 'Wang Lifang', '98995665', '258 Serangoon Central Drive #13-23', '550258'), (85, 'Sharmaine Heng', '94990365', '569 Choa Chu Kang Street 52 #01-10', '680569'), (86, 'Lynn Lim', '98545321', '435B Fernvale Road 12-28', '792435'), (87, 'Teo Meow Khim', '80610503', '30 Jalan Bahagia #05-31', '320030'), (88, 'Jennifer Tan', '91933871', '233 Lorong 8 Toa Payoh #08-32', '310233'), (89, 'Alyssa Lim', '95657711', '238 Hougang Avenue 1 #05-32', '530238'), (90, 'Serene Woon', '93482906', '242 Bukit Batok East Avenue 5 #02-55', '650242'), (91, 'Elicia Fang', '85043593', '143 Jalan Bukit Merah #02-29', '160143'), (92, 'Zalifa Ithnin', '88425133', '627 Woodlands Avenue 6 #05-78', '730627'), (93, 'Tan Shan', '87773858', '230 Ang Mo Kio Avenue 3 #04-22', '560230'), (94, 'Shawn Quek', '86972240', '601C Punggol Central #19-78', '823601'), (95, 'Lim Peifen', '94464048', '178D Rivervale Crescent #03-12', '544178'), (96, 'Huber Apigo', '92141269', '12B Marsiling Lane #15-33', '732012'), (97, 'Dwi Ratwanto Kasman', '98559552', '110 Tampines Street 11 #22-88', '521110'), (98, 'Wong Wai Ren', '94352709', '21 Jalan Membina #13-34', '163021'), (99, 'Helen Tham', '82667517', '218 Yishun Street 21 #10-97', '760218'), (100, 'Goh Jia Yi', '82776598', '545 Choa Chu Kang Street 52 #11-35', '680545'), (101, 'Janice Oh', '88723464', '360C Admiralty Drive #12-22', '753360'), (102, 'Mabel Hwa', '91857943', '83 Redhill Lane #12-33', '150083'), (103, 'Weily Jaya Guruh', '97816512', '17 Telok Blangah Crescent #10-39', '90017'), (104, 'Janet Ang', '96218817', '55 Havelock Road #04-43', '161055'), (105, 'Siti bin Saad', '98235817', '313D Anchorvale Road #03-34', '544313'), (106, 'Esther See', '92723229', '207A Compassvale Lane #06-44', '542207'), (107, 'Tan Kai Yong', '80105555', '285A Toh Guan Road #02-22', '601285'), (108, 'Tan Zhen Yang', '92395636', '61C Strathmore Avenue #19-99', '144061'), (109, 'Sandy Ng', '81113284', '534 Jurong West Street 52 #06-33', '640534'), (110, 'Janice Ng', '91519467', '511B Yishun Street 51 #07-77', '762511'), (111, 'Tan Qing Hui', '89086834', '12A Marsiling Lane #08-88', '731012'), (112, 'Chen Ke Lin', '86264347', '410C Fernvale Road #12-32', '793410'), (113, 'Nah Jingyi', '96371301', '31 Rosewood Drive #10-98', '737922'), (114, 'Low Han Quan', '94884082', 'Proximo, 27 Robin Road #15-66', '258204'), (115, 'Danny Han', '94898938', '201 Clementi Avenue 6 #12-11', '120201'), (116, 'Clarice Ng', '94775174', '107C Edgefield Plains #12-45', '823107'), (117, 'Tina Ong', '91166828', '303 Clementi Avenue 4 #10-99', '120303'), (118, 'Seetoh Wai Kit', '98645086', '307 Jurong East Street 32 #15-33', '600307'), (119, 'Daryl Liew', '97547347', '879B Tampines Avenue 8 #02-33', '522879'), (120, 'Huang Zhiyi', '94572783', '74 Telok Blangah Heights #21-44', '100074'), (121, 'Lydia Ho', '93248652', '135 Bishan Street 12 #18-33', '570135'), (122, 'Ho Ye Yun', '98545961', '34 Telok Blangah Way #09-88', '90034'), (123, 'Eric Tan', '97116795', '228A Compassvale Walk #14-328', '541228'), (124, 'Marissa Soriano', '95103871', '13 Teck Whye Lane #08-77', '680013'), (125, 'Leo Chia Min Evelyn', '92337391', 'Blk 969 Hougang St 91 #11-172', '530969'), (126, 'Adreinne Goo', '99150695', '291C Compassvale Street #19-49', '543291'), (127, 'Joey Lie', '85005221', '12C Marsiling Lane #22-77', '733012'), (128, 'Liau ee Yen', '85259861', '452 Yishun Ring Road #14-50', '760452'), (129, 'Henny Chendawan', '87573228', '623 Senja Road #13-20', '670623'), (130, 'Angela Siswantoro', '97495704', '310 Serangoon Avenue 2 #12-33', '550310'), (131, 'Vince Wee', '96208565', '775 Yishun Ring Road #09-55', '760775'), (132, 'Vincent Phua', '91355440', '318B Anchorvale Link #12-09', '542318'), (133, 'Wong Siew Li', '92451009', '214 Marsiling Lane #22-76', '730214'), (134, 'Nadia Lam', '83445419', '309 Clementi Avenue 4 #02-22', '120309'), (135, 'Janice Ong', '82103210', '119C Kim Tian Road #03-12', '163119'), (136, 'Celine Siow', '87109077', '452 Ang Mo Kio Avenue 10 #03-15', '560452'), (137, 'Rena Chong', '90106560', '51 Circuit Road #23-11', '370051'), (138, 'Siti Liana', '91071955', '350 Clementi Avenue 2 #15-44', '120350'), (139, 'Melody Low', '82226796', '171 Ang Mo Kio Ave 4 4 #04-505', '560171'), (140, 'Clarence Wong', '98776740', '480 Sembawang Drive #20-44', '750480'), (141, 'Christina Tseng', '80123096', '526 Bedok North Street 3 #20-24', '460526'), (142, 'Chen Yuan Meng', '87669021', '368 Corporation Drive #19-77', '610368'), (143, 'Regina Quay', '94426890', '334 Tampines Street 32 #15-22', '520334'), (144, 'Carolyn Foo', '91804668', '152 Yung Ho Road #04-25', '610152'), (145, 'Wong Ping See', '98775450', '980C Buangkok Crescent #09-88', '533980'), (146, 'Azlinda Lee', '84327790', '441B Clementi Avenue 3 #07-65', '122441'), (147, 'siti Mariam', '80198557', '706 Yishun Avenue 5 #05-23', '760706'), (148, 'Jessyln Ng', '98887012', '44 Marine Crescent #13-02', '440044'), (149, 'Au Yong Ke Wei', '81684916', '64 Kew Heights', '466089'), (150, 'Andrea Chan', '83396147', '91 Tanglin Halt Road #31-306', '142091'), (151, 'Jesslyne Soh', '91124555', '684A Choa Chu Kang Crescent #05-34', '681684'), (152, 'Lim Jingwen', '86673366', '467A Admiralty Drive #04-62', '751467'), (153, 'Rachelle ann Magpantay', '82667890', '246 Bishan Street 22 #13-44', '570246'), (154, 'Elin Yew', '81115843', '55 Chai Chee Drive #11-23', '460055'), (155, 'Nelson Toh', '85148904', '58 Lengkok Bahru #02-537', '150058'), (156, 'Ang Hui Min', '84319055', '725 Woodlands Avenue 6 #06-31', '730725'), (157, 'Wang Nan Bin', '96608055', '607 Senja Road #08-11', '670607'), (158, 'Chua Cai Ling', '91205578', '121D Sengkang East Way #16-64', '544121'), (159, 'Doris Wong', '82334890', '559 Pasir Ris Street 51 #21-54', '510559'), (160, 'Tew Huey Cha', '81068991', '34 Jalan Bahagia #09-84', '320034'), (161, 'Thong Fui Yee', '97670944', '274C Punggol Place #10-82', '823274'), (162, 'Zann Jong', '98990922', '272B Punggol Walk #04-55', '822272'), (163, 'Elfie Goh', '98755540', '588C Montreal Drive #09-55', '753588'), (164, 'Angie Lim', '87886551', '588C Ang Mo Kio Street 52 #19-94', '563588'), (165, 'Tan Wan Sun', '81806112', '13B Zehnder Road', '117698'), (166, 'Jasmine Lu', '90155580', '233 Pending Road #02-43', '670233'), (167, 'Dina Fang', '82336670', '174A Edgedale Plains #05-99', '821174'), (168, 'Mohd Sari', '87909288', '601 Bedok Reservoir Road #11-55', '470601'), (169, 'Mohd Fazli', '80924311', '760 Yishun Street 72 #03-46', '760760'), (170, 'Kelvin Leong', '93853017', '663A Punggol Drive #10-266', '821663'), (171, 'Tan AiLing', '90114589', '713 Bedok Reservoir Road #04-54', '470713'), (172, 'Khek Ren Ying', '98280837', 'Blk 455A Ang Mo Kio Street 44 #27-05', '561455'), (173, 'Benny Chia', '87900144', '168 Stirling Road #11-48', '141168'), (174, 'Tan Xin Sheng', '94573055', '909 Tampines Avenue 4 #09-252', '520909'), (175, 'Phyllis Mok', '98783235', 'The Tampines Trilliant 29 Tampines Centeal 7 #03-38', '528612'), (176, 'Sherlyn Goh', '93366854', '150 Bedok Reservoir Road #08-1733', '470150'), (177, 'Rachel Ang', '90033778', '528 Jelapang Road #07-91', '670528'), (178, 'Corin Goh', '96342213', 'Blk 428B Yishun Ave 11 #10-154', '762428'), (179, 'Lee Jia Yee', '90905889', '241 Kim Keat Link #17-44', '310241'), (180, 'Ethan Ng', '98001344', '3 Tampines Grande AIA Tampines #08-01', '528799'), (181, 'Mohd Fizz', '90156688', '275 Toh Guan Road #18-55', '600275'), (182, 'Penny Lim', '96202831', '21A Goodman Road', '439059'), (183, 'Liu Yufei', '97996805', 'Great World City 1 Kim Seng Promenade West Tower #11-07/12', '237994'), (184, 'Ong Li Da', '90771244', '148 Tampines Avenue 5 #14-76', '521148'), (185, 'Poon How Ee', '86559009', '668 Woodlands Ring Road #23-63', '730668'), (186, 'Alvina Lee', '92475649', '475A Upper Serangoon Crescent #11-509', '531475'), (187, 'Sherlene Foo', '92315590', '317 Woodlands Street 31 #09-76', '730317'), (188, 'Yan Lim', '90018636', '48 Lengkok Bahru #02-185', '151048'), (189, 'Wong Yan Ling', '87665890', '115 Potong Pasir Avenue 1 #02-33', '350115'), (190, 'Wang Shi Zhen', '81892171', '435A Fernvale Road #16-208', '791435'), (191, 'Wee Boo Kiat', '91000456', '80A Telok Blangah Street 31 #34-107', '101080'), (192, 'Yeo Jun Guang', '81013379', '649 Jalan Tenaga #25-62', '410649'), (193, 'Yeong Chee Soon', '80992499', '238 Hougang Avenue 1 #04-28', '530238'), (194, 'Kenneth Ma', '92335888', '460 Tampines Street 42 #14-51', '520460'), (195, 'Leanne Au', '95667090', '202 Toa Payoh North #13-35', '310202'), (196, 'Roy Liam', '93876299', '128 Bukit Merah View #02-24', '150128'), (197, 'Alisha Low', '92115880', '139A Lorong 1A Toa Payoh #20-03', '311139'), (198, 'Wendy Tan', '96174465', '104 Woodlands Street 13 #06-206', '730104'), (199, 'Debbie Seet', '90998755', '16 Joo Seng Road #16-83', '360016'), (200, 'Wu Shenhao', '81889553', '56 Cassia Crescent #07-03', '391056'), (201, 'Teow Wan Wah', '91223788', 'Sunrise Gardens 53 Sunrise Ave #04-21', '806746'), (202, 'Siti Jamilah', '89901033', '274B Punggol Place #07-818', '822274'), (203, 'Lui Fu Yu', '90513274', '545 Bukit Panjang Ring Road #18-881', '670545'), (204, 'Hayati bin Aishah', '82446099', '17 Lorong 7 Toa Payoh #12-38', '310017'), (205, 'Elaina Yuen', '93883791', 'Singapore Land Tower 50 Rafflees Place #36-01 Century Link', '48623'), (206, 'Lily Lim', '87661233', '139 Potong Pasir Avenue 3 #14-50', '350139'), (207, 'Terence Tan', '92226788', '54 Chai Chee Street #20-49', '460054'), (208, 'Germaine Soh', '96395290', '267 Tampines Street 21 #06-63', '520267'), (209, 'Glynis Anne', '97891322', 'Block 320 Hougang Avenue 5 #05-06', '530320'), (210, 'Jerlynn Ng', '90933342', '782C Woodlands Crescent #05-325', '733782'), (211, 'Liana Horioka', '90125589', '28D Dover Crescent#24-33', '134028'), (212, 'Dein Teo', '98900133', '61 New Upper Changi Road #06-22', '461061'), (213, 'Shirlena Ho', '97847789', 'Blk 296C Compassvale Crescent #14-263', '543296'), (214, 'Jocelyn Lam', '6.59E+09', '33 Hume Avenue #10-13', '598734'), (215, 'Irene Tan', '90992833', 'Blk 531 Hougang Ave 6 #10-275', '530531'), (216, 'Raymond Chua', '96794477', '238 Bukit Batok East Ave 5 05-193', '650238'), (217, 'Azeana Toh', '90012465', '316A Anchorvale Link #05-175', '541316'), (218, 'Ong Wei Sheng', '97438275', '126 Lorong 1 Toa Payoh #07-553', '310126'), (219, 'Michelle Lee', '84998137', '175B Punggol Field #07-563', '822175'), (220, 'Ellie Liow', '85226964', 'Blk 30 Bendemeer Rd #04-877', '330030'), (221, 'Karen Poh', '94239104', 'Austville Residences 19 Sengkang East Avenue #16-18', '544808'), (222, 'Amanda Tan', '85335250', 'The Rivervale 3 Rivervale Link #02-29', '545119'), (223, 'Ng Rei Mee', '96637773', '341 Bukit Batok Street 34 #06-68', '650341'), (224, 'Aqilah Toh', '81027781', 'Blk 305 Choa Chu Kang Ave 4 #13-667', '680305'), (225, 'Alex Fang', '91096838', '393 Jalan Besar Shophouse', '209005'), (226, 'Shannon Tan', '87664399', 'Eight Courtyards 10A Canberra Drive #01-19', '768143'), (227, 'Jermaine Wang', '96903370', '412 Commonwealth Avenue West #12-3035', '120412'), (228, 'Ng Kiat Loo', '91776046', '282C SengKang East Avenue #10-561', '543282'), (229, 'Halimah BInte Abdul Karim', '94318995', '513 Bukit Batok Street 52 #03-562', '650513'), (230, 'Amy Fong', '97482660', 'Blk 430 Choa Chu Kang Ave 4 #07-599', '680430'), (231, 'Jasmine Wong', '91712218', '821 Yishun Street 81 #11-626', '760821'), (232, 'Solomon Chua', '91990046', '175 Yishun Avenue 7 #04-853', '760175'), (233, 'Marcus Chan', '91469701', '103A Edgefield Plains #04-97', '821103'), (234, 'Catherine Chan', '97366706', '108 Aljunied Cresent #10-28', '380108'), (235, 'Kellen Soh', '96728375', '165 Simer Road #06-376', '520165'), (236, 'Jean Teo', '96310336', 'Changi Court 708 Upper Changi Road East #02-11', '486838'), (237, 'Toh Pei Shan', '96530239', '773 Bedok Reservoir View #18-60', '470773'), (238, 'Bill Soo', '85337735', 'One Cleantech Loop #06-08', '637141'), (239, 'Peter Wong', '98429228', '101 Prince Charles Cresent The Crest #07-02', '159017'), (240, 'Koh Shen Yi', '90222865', '490B Choa Chu Kang Avenue 5 #08-277', '682490'), (241, 'Hsu Myat Noe', '92260706', '673B Jurong West Street 65 #12-02', '642673'), (242, 'Tamm Chua', '97599650', '44R Hillside Drive', '549034'), (243, 'Zaw In Jin', '91263443', '685C Jurong West Central 1 #07-168', '643685'), (244, 'Nurush Shifa', '96434826', '357 Tampines Street 33 #09-602', '520357'), (245, 'Celine Wong', '98559483', '51 Commonwealth Drive #14-526', '141051'), (246, 'Jasmine Koh', '90301680', '329 Ubi Avenue 1 #04-619', '400329'), (247, 'Ednaldo Ong', '98233690', 'Tampines Plaza 5 Tampines Central 1 #04-04', '529541'), (248, 'Jeffrey Lim', '96602267', '238 Woodlands Industrial Park #05-99', '757301'), (249, 'Eric Woo', '94552982', '129 Pending Road #10-336', '670129'), (250, 'Alvin Tham', '90481470', '91 Dawson Road #31-24 Singapore 144091', '144091'), (251, 'Hweeling Lee', '82459821', '632 Jurong West Street 65 #17-10', '640632'), (252, 'Shanai Chia', '97208755', '211 Bishan Street 23 #12-337', '570211'), (253, 'Kyra Koh', '90235605', '24 Woodlands Drive 16 #02-13', '737881'), (254, 'Kovin Yoong', '91076985', '133 Bukit Batok Avenue 6 #03-471', '650133'), (255, 'Phoeona Chua', '97329913', '278 Yishun Street 22 #10-278', '760278'), (256, 'Chee Tingting', '91504754', '264E Compassvale Bow #11-80', '548264'), (257, 'Aria Wanari', '87203783', '431A Yishun Avenue 1 #03-505', '761431'), (258, 'Ellen Chan', '98488116', '587 Woodlands Drive 16 #09-48', '730587'), (259, 'Nora Lim', '91181465', '182 Yung Seng Road #05-51', '610182'), (260, 'Amilia Soh', '92711324', '274 Bangkit Road #11-66', '670274'), (261, 'Devin Tan', '96468306', '160 Jalan Teck Whye #18-258', '680160'), (262, 'Evelyn Chan', '94763260', '656 Jalan Tenaga #06-108', '410656'), (263, 'Joyce Lim', '82189604', '970 Toa Payoh North #01-01', '318992'), (264, 'Mok Kam', '93388470', 'Blk 648 Hougang Ave 8 #07-221', '530648'), (265, 'Teng Bo Wen', '91014380', '541 Hougang Avenue 8 #09-1207', '530541'), (266, 'Camilla Wong', '90223993', '354 Ang Mo Kio Street 32 #18-145', '560354'), (267, 'Dion Ang', '87480876', '620 Bukit Panjang Ring Road #19-822', '670620'), (268, 'Carrie Wong', '85187584', '152 Lorong 2 Toa Payoh #32-326', '310152'), (269, 'Khoo Foong Yin', '81838418', '8 Bedok South Avenue 2 #13-304', '460008'), (270, 'Pauline Goh', '84220676', '670A Edgefield Plains #07-606', '821670'), (271, 'Grace Ho', '96540130', '518C Tampines Central 7 #07-54', '523518'), (272, 'Andrea Chng Cheng Yi', '81012826', '51 Telok Blangah Drive #06-120', '100051'), (273, 'Jaime Koo', '90223029', '542 Choa Chu Kang Street 52 #07-62', '680542'), (274, 'Jane Tan', '91788931', '433A Sengkang West Way #15-515', '791433'), (275, 'Raudhah Kumar', '84814691', '932B Hougang Avenue 9 #03-106', '532932'), (276, 'Tay Jing Dan', '81639623', '323 Bukit Batok Street 33 #02-90', '650323'), (277, 'Adrian Kong', '96206870', '4C West Coast Walk', '127144'), (278, 'Mohd Pooja', '81894140', 'Dahlia Park Condominium 1 Flora Drive #03-01, Block 1', '507009'), (279, 'Tan Si Jia', '93837177', '69 Redhill Close #06-84', '150069'), (280, 'Tan Kah Hoong', '97770343', '891 Tampines Ave 8 #12-80', '520891'), (281, 'Lee Sze Min', '90108024', '161 Woodlands Street 13 #09-627', '730161'), (282, 'Clarke See', '96227150', '301 Clementi Avenue 4 #04-555', '120301'), (283, 'Tan Weili', '98709049', '357 Yung An Road #14-55', '610357'), (284, 'Lianne Ong', '90010082', 'Fulton Hill Fulton Road 7', '578891'), (285, 'Buan Pong Chua', '96190661', '20 Namly Drive', '267434'), (286, 'Noor Hafizah', '90617694', 'Yishun Street 22 #05-61', '760279'), (287, 'Jenny O''Connor', '90013894', 'Trevose 12 19B Trevose Crescent', '298098'), (288, 'Nabilah Khan Badin', '81852443', '182 Jelebu Road #24-54', '670182'), (289, 'Sherylyn Chong', '90071807', '296 Choa Chu Kang Avenue 2 #13-04', '680296'), (290, 'Wong Yet Hwa', '85519576', '171 Woodlands Street 11 #04-47', '730171'), (291, 'Ng Jun Hao', '85331858', '833 Hougang Central #06-11', '530833'), (292, 'Lee Yilian', '98274125', '895 Tampines Street 81 #10-932', '520895'), (293, 'Sherill Khoo', '97356496', '20 Heng Mui Keng Terrace D515', '119618'), (294, 'Cecile Yeo', '91544268', '305 Serangoon Avenue 2 #05-92', '550305'), (295, 'Vonny Ivon Leo', '86563142', 'Immunos 8A Biomedical Grove #06-06', '138648'), (296, 'Nicole Goh', '97342648', 'Blk 128 Simei Street 1 #03-258', '520128'), (297, 'Thecla Chia', '83887235', 'Blk 434 Choa Chu Kang Avenue 4 #08-555', '680434'), (298, 'Jaime Lim', '96968098', 'Blk 352 Jurong East Street 31 #01-139', '600352'), (299, 'Farah bin Asyrith', '94894659', 'Blk 217 Tampines Street 23 #07-01', '520217'), (300, 'Lim Pei Yi', '97611310', 'Blk 677B Jurong West St 64 #03-297', '642677'), (301, 'May Ong', '96610501', 'Blk 895C Woodlands Dr 50 #09-40', '732895'), (302, 'Tan Hui Chin', '94318493', 'Blk 404 Yishun Avenue 6 #04-1242', '760404'), (303, 'Lim Bai Hui', '97826020', '336B Yishun Street 31 #08-23', '762336'), (304, 'Joyce Tan', '97593438', 'Blk 211 Boon Lay Place #12-123', '640211'), (305, 'Emily Quek', '96178395', '509 Jelapang Road #10-82', '670509'), (306, 'Tan Wan Ni', '90199760', '712 Bedok Reservoir Road #09-3914', '470712'), (307, 'Colin Toh', '94564315', '335B Anchorvale Crescent #16-82', '542335'), (308, 'Alicia Lam', '90616355', '290G Bukit Batok Street 24 #09-97', '656290'), (309, 'Tris Ang', '96529585', 'Blk 612 Woodlands Avenue 4 #10-25', '730612'), (310, 'Ameerah Sarpari', '97700657', 'Blk 418 Jurong West Street 42 #01-951', '640418'), (311, 'Tan Shuxian', '81773223', '54 Telok Blangah Drive #11-42', '100054'), (312, 'Wendy Goh', '93624886', 'Blk 23 Ghim Moh Link #14-220', '271023'), (313, 'Connie Soo', '96250883', '25 Balmoral Park Pinewood Gardens #06-03,', '259854'), (314, 'Cherie Au', '90273371', '520C Tampines Central 8 #13-59', '523520'), (315, 'Nash Woo', '97499718', '309 Jurong East Street 32 #10-284', '600309'), (316, 'Zane Lim', '90308276', '542 Choa Chu Kang Street 52 #05-54', '680542'), (317, 'Adrian Tan', '98239659', '520C Tampines Central 8 #13-59', '523520'), (318, 'Adibah Izwan', '83418472', '384 Tampines Street 32 #09-31', '520384'), (319, 'Liyana Khoo', '93219156', '444 Choa Chu Kang Avenue 4 #05-323', '680444'), (320, 'Caroline Teo', '92287646', '13 Merpati Road #09-103', '370013'), (321, 'Juzailah bin Rahal', '91506711', '50 Tampines North Drive 2, Level 4', '528766'), (322, 'Olga Roslan', '91525100', '831 Jurong West Street 81 #09-254', '640831'), (323, 'Shynna Lee', '82611330', '214 Bedok North Street 1 #10-155', '460214'), (324, 'Cheng Chye Sheng', '84843909', '111 Serangoon North Avenue 1 #05-607', '550111'), (325, 'Brandon Wong', '90102744', '212 Serangoon Avenue 4 #07-50', '550212'), (326, 'Fan Long Xin', '81886025', '155 Simei Road #08-208', '520155'), (327, 'Vince Xie', '96728476', '471B Upper Serangoon Crescent #10-366', '532471'), (328, 'Hidayat bin Atuh', '94366482', '6 Wiltshire Road', '466382'), (329, 'Mohd Amirjannah', '91782643', '326 Woodland Sreet 23 #05-101', '730326'), (330, 'Fu Jia Le', '81235757', 'Dover Ville 18 Dover Crescent #28-36', '130018'), (331, 'Siti Nuriana', '97963522', '693C Woodlands Avenue 6 #09-757', '733693'), (332, 'Ariana Sum', '83230806', '492 Jurong West Street 41 #03-26', '640492'), (333, 'Anita Ratnayanti', '91726358', '306C Anchorvale Link #11-79', '543306'), (334, 'Eleanor Wong', '98253257', '310B Punggol Walk #16-568', '822310'), (335, 'Tan Siok Koon', '90046869', '15 Upper Boon Keng Road #05-1053', '380015'), (336, 'Eileen Ting', '97612442', 'WOODSVALE 9 Woodlands Drive 72 #07-18', '738093'), (337, 'Stephen Leong', '97541761', '235 Bishan Street 22 #08-138', '570235'), (338, 'Fan Yu Ting', '84188169', 'Chiltern Park Condominium 131 Serangoon Avenue 3 #07-14', '556112'), (339, 'Jacqueline Ang', '95676659', '676C Punggol Drive #09-730', '823676'), (340, 'Yan Fan Fan', '98640040', 'Regency Suites 36 Kim Tian Road #19-03', '169279'), (341, 'Sean Ho', '85025429', '584 Ang Mo Kio Avenue 3 #04-3091', '560584'), (342, 'Hanny Ong', '86168389', '25 Lower Kent Ridge Road F04-412', '119081'), (343, '???', '86994421', '26 College Avenue East Tembusu Residential College, #05-163A', '138597'), (344, 'Nicolette Ng', '97921527', '163A Upper East Coast Road', '455261'), (345, 'Ericia Seet', '87207040', '178 Lompang Road #23-28', '670178'), (346, 'Rainn Cheong', '98442248', '748A Bedok Reservoir Crescent #13-61', '471748'), (347, 'Loleen Phua', '97346394', 'Gale, The 70 Flora Road #01-21', '506914'), (348, 'Joyce Tan', '83997261', '275A Bishan Street 24 #11-122', '571275'), (349, 'Elaine Lum', '93294668', '634A Senja Road #14-215', '671634'), (350, 'Chen Ting Le', '86995442', '120B Edgedale Plains #17-293', '822120'), (351, 'Chua Si Min', '93289321', '161 Tampines Street 12 #10-203', '521161'), (352, 'Manami Hexbolt', '96717039', '20 Teban Gardens Road #28-97', '600020'), (353, 'Sharon Lim', '97328904', '513 Woodlands Drive 14 #06-203', '730513'), (354, 'Sylvia Sia', '97979042', '121D Canberra Street #10-751', '754121'), (355, 'Yong Lee Peng', '96885198', '450F Tampines Street 42 #06-394', '526450'), (356, 'Karen Tan', '9.83E+07', '7 Everton Park #09-09', '80007'), (357, 'Lee Wan Zhen', '93364434', '518B Tampines Central 7 #12-66', '522518'), (358, 'Fiona Foo', '93833646', '408B Fernvale Road #16-18', '792408'), (359, 'Ben Wong', '94500995', '225 Lorong 8 Toa Payoh #06-64', '310225'), (360, 'Carolyn Sing', '92986641', '556 Ang Mo Kio Avenue 10 #03-1906', '560556'), (361, 'Isabel Foo', '97859524', 'Windermere 26 Choa Chu Kang Street 64 #08-04', '689096'), (362, 'Tan Peili', '98510165', '205 Serangoon Central #07-132', '550205'), (363, 'Sabrina Chua', '97105757', '335A Anchorvale Crescent #08-96', '541335'), (364, 'Cynthia Lim', '84033261', '523B Tampines Central 7 #11-89', '522523'), (365, 'Paula Ho', '93364386', 'Far Eastern Bank Building 156 Cecil Street #05-00', '69544'), (366, 'Mohd Farhan', '97807914', '316 Bukit Batok Street 32 #02-137', '650316'), (367, 'Ivan Yau', '94231270', '395 Yishun Ring Road #07-1693', '760395'), (368, 'Jonathan Lewis', '93804963', '270B Punggol Field #03-233', '822270'), (369, 'Sandra Ee', '98413146', '203 Yishun Street 21 #05-235', '760203'), (370, 'Felicia Fong Chor Wan', '91506595', '145 Tampines Street 12 #02-334', '521145'), (371, 'Lim Xin Yi', '97976401', '124 Ang Mo Kio Avenue 6 #11-4075', '560124'), (372, 'Chua Jie Xuan', '83885710', 'Kovan Regency 38 Kovan Rise #14-17', '544727'), (373, 'Priscilla Yeo', '96585979', '386 Tampines Street 32 #05-97', '520386'), (374, 'Low Chee Siong', '96838951', '476C Upper Serangoon View #14-544', '533476'), (375, 'Vivien Lee', '96787050', '356 Clementi Avenue 2 #09-283', '120356'), (376, 'Irene Chen', '84980087', '95 Aljunied Crescent #07-517', '380095'), (377, 'Sylvia Yee', '97698585', '258B Compassvale Road #11-561', '542258'), (378, 'Mohd Satish', '91833180', 'Sembawang Springs Estate 78 Jalan Kemuning 78', '769800'), (379, 'Catherine Lim', '90938935', '175A Punggol Field #05-569', '821175'), (380, 'Sherrill Fang', '97775092', '671B Jurong West Street 65 #10-110', '642671'), (381, 'Jacqueline Chang', '98157341', '602B Punggol Central #09-664', '822602'), (382, 'Vivian Ang', '94560615', '113D Mcnair Road #13-240', '325113'), (383, 'Caden Ong', '96418778', '113C Mcnair Road #22-250', '324113'), (384, 'Felix Wong', '97558415', '663C Jurong West Street 65 #08-253', '643663'), (385, 'Lara Yeo', '96407710', '175 Ang Mo Kio Avenue 4 #04-767', '560175'), (386, 'Liu Yinyuan', '91265291', '635B Senja Road #11-257', '672635'), (387, 'Fatin Farzana Binte Miswan', '98362744', '421 Hougang Avenue 10 #12-301', '530421'), (388, 'Lau Pei Ying', '97894970', '686C Jurong West Central 1 #13-152', '643686'), (389, 'Irene Soh', '93392340', 'Atrina 273C Compassvale Link #07-162', '543273'), (390, 'Justina Leong Jing Wen', '81806035', '426 Woodlands Street 41 #04-210', '730426'), (391, 'Gwen Yee', '96519665', '275D Compassvale Link #07-238', '544275'), (392, 'Jonathan Ng', '96423805', '425 Tampines Street 41 #05-407', '520425'), (393, 'Nicole Phua', '96445232', 'Blossom Residences 34 Segar Road #14-35', '677723'), (394, 'Jesslyn Ng', '97823963', '157 Hougang Street 11 #01-230', '530157'), (395, 'Noah Foo', '85186402', 'Twin Fountains 11 Woodlands Avenue 6 #13-04', '738992'), (396, 'Pamela koh', '86114033', '11 Eunos Crescent #02-2757', '400011'), (397, 'Tan Shu Xian', '91012373', '542 Jelapang Road #18-48', '670542'), (398, 'Fanny Chua', '98294827', 'Kian Teck Dormitory 26 Kian Teck Avenue #01-01', '628920'), (399, 'Chye Li Kuan', '91878140', '683B Choa Chu Kang Crescent #01-394', '682683'), (400, 'Tan Cheng Chai', '98418947', '22 Hougang Ave 3 #06-275', '530022'), (401, 'Eric Lum', '93345678', '124 Ang Mo Kio Avenue 6 #11-4075', '560124'), (402, 'Tan Shi Hui', '90600168', '4B Elliot Road', '458691'), (403, 'Anna Hamonangan', '92739216', '22 Bukit Batok Street 52 #28-02 Guilin View', '659245'), (404, 'Hazel Law', '90996904', '736 Jurong West Street 75 #03-01', '640736'), (405, 'Tan Xuanya', '91050325', 'Monterey Park Condominum 25 West Coast Rise #06-06', '127468'), (406, 'Winnie Ong', '65410846', '252 Bangkit Road #02-390', '670252'), (407, 'Tracie Ang', '86110654', '165 Hougang Avenue 1 #07-1600', '530165'), (408, 'Lee Lay Peng', '98379185', '655A Jurong West Street 61 #16-528', '641655'), (409, 'Catailyn Fong', '92371492', '417 Tampines Street 41 #09-369', '520417'), (410, 'Emily Choo Qianyi', '96898833', '747 Pasir Ris Street 71 #16-55', '510747'), (411, 'Chen Meiyu', '96795481', '223D Compassvale Walk #11-675', '544223'), (412, 'Mariani Lim', '97561820', '119 Lorong Toa Payph #09-457', '310119'), (413, 'Sharon Kwok', '96750402', '25 Kasai Road Seletar Hills Estate', '808272'), (414, 'Quek Si Man', '96224730', 'BLK 649B Jurong West St 61 #08-296', '642649'), (415, 'Neuleila Lee', '82278227', '390 Yishun Avenue 6 #10-1056', '760390'), (416, 'Tan QuanTong', '96823435', '325 Jurong East Street 31 #06-184', '600325'), (417, 'Rebecca Soo', '96750873', '316 Woodlands Street 31 #03-128', '730316'), (418, 'Agnes Lim', '84999644', '330 Sembawang Close #04-383', '750330'), (419, 'Lilian Teoh', '94491582', '29 Ghim Moh Link #26-320', '270029'), (420, 'Toh Kah Yee', '97422668', '147 Bishan Street 11 #07-27', '570147'), (421, 'Oon Chooi shy', '96217634', '805 Yishun Ring Road #07-4287', '760805'), (422, 'Shu Yen May', '97414921', 'Alexcier, The 237 Alexandra Road #06-16', '159929'), (423, 'Kee Cheong Weng', '97910024', 'Chiltern Park Condominium 131 Serangoon Avenue 3 #02-15', '556112'), (424, 'Sheryl Ho', '98485622', '557 CHoa Chu Kang North 6 #05-48', '680557'), (425, 'Lynn Gui', '94792093', '85A Lorong 4 Toa Payoh #04-314', '311085'), (426, 'Chai Wan Xin', '91691810', '162 Jalan Teck Whye #08-200', '680162'), (427, 'Cheryl Teh', '81236629', '207D Compassvale Lane #16-54', '547207'), (428, 'Chen De', '97673698', '704 Tampines Street 71 #14-42', '520704'), (429, 'Karen Chan', '91151267', '111B Depot Road, #17-107', '102111'), (430, 'Florence Lim', '96508409', '796 Woodlands Drive 72 #09-33', '730796'), (431, 'Ng Hui Ying', '96710523', 'River Isles 64 Edgedale Plains #12-26', '828731'), (432, 'Yvonne Wong', '94508755', '626 Senja Road #13-156', '670626'), (433, 'Tan Siew Pei', '93577570', '26 Teng Tong Road', '423517'), (434, 'Mas Ayu', '90231392', '2024 Bukit Batok Street 23 #04-64', '659529'), (435, 'Shawn Goh', '81184889', '220 Lorong 8 Toa Payoh #14-667', '310220'), (436, 'Chrislyn Lee', '87277089', '649 Jalan Tenaga #10-153', '410649'), (437, 'Julien Tan', '96261210', '670A Edgefield Plains #17-614', '821670'), (438, 'Sim Pei Ying', '83386176', '820 Woodlands Street 82 #08-385', '730820'), (439, 'Jay Choo', '81136645', '904 Jurong West Street 91 #11-131', '640904'), (440, 'Felicia Foo', '97438834', '535 Pasir Ris Drive 1 #02-282', '510535'), (441, 'Valerie Ng', '91773138', '625 Senja Road #14-148', '670625'), (442, 'Mohd Amirkhan', '93277276', '417A Fernvale Link #04-188', '791417'), (443, 'Soo Seeyi', '96404155', '520 West Coast Road #10-665', '120520'), (444, 'Jasmine Ng', '97113171', '75A Redhill Road #14-54', '151075'), (445, 'Robin Cheong', '81989236', '498A Tampines Street 45 #06-352', '520498'), (446, 'Mary Tan', '98204011', '151 Simei Street 1 #11-27', '520151'), (447, 'Alvin Quek', '87669490', 'Hillview Green 61 Hume Avenue #06-06', '598741'), (448, 'Darren Low', '82992439', '617 Ang Mo Kio Avenue 4 #05-1041', '560617'), (449, 'Felicia Kwan', '81884758', '115 Lorong 1 Toa Payoh #01-396', '310115'), (450, 'Faith Yeo', '92351672', 'The Parc Condominium 7 West Coast Walk #12-16', '127159'), (451, 'Samantha Chua', '92954484', '104 Pasir Ris Street 12 #07-161', '510104'), (452, 'Renee Ong', '98371437', 'Windermere 30 Choa Chu Kang Street 64 #08-01', '689098'), (453, 'Derrick Yong', '85330536', 'Parryville 43 Poh Huat Drive', '546828'), (454, 'Linda Lam', '90285237', '245 Hougsng Street 22 #12-145', '530245'), (455, 'Ivan Chia', '92959612', '56 Miltonia Close The Shaugnessy', '768214'), (456, 'Serene Ng', '96222142', '332 Sembawang Close #11-407', '750332'), (457, 'Insyirah bin Halidi', '93682420', '28 Pasir Ris Link Sea esta #01-23', '518146'), (458, 'Tan You Yuan', '96787736', '807 King Gerorge Avenue #11-254', '200807'), (459, 'Ivy Cheah', '87664282', '680B Jurong West Central 1 #02-66', '642680'), (460, 'Jobina Ang', '90272134', '633 Hougang Avenue 8 #05-13', '530633'), (461, 'Hannah Lim', '87106418', '230 Jurong East Street 21 #15-685', '600230'), (462, 'Charlene Foo', '92775441', '678A Jurong West Street 64 #12-315', '641678'), (463, 'Andrew Choi', '96825340', '945 Hougang Street 92 #10-153', '530945'), (464, 'Won Shu Wen', '91519686', '322A Jurong East Street 31 #08-258', '601322'), (465, 'Miriam Fong', '91683815', '152 Yung Ho Road #04-23', '610152'), (466, 'Clara Lim', '90303987', '37 Marsiling Drive #11-415', '730037'), (467, 'Fong Siao Wan', '98251122', '38 Goodluck Garden 38 Toh Tuck Road #09-01', '596716'), (468, 'Bernard Goh', '82224064', '51 Teban Gardens Road #12-568', '600051'), (469, 'Teo Jun Xiong', '97316060', '80 Bedok North Road #09-276', '460080'), (470, 'Chris Ng', '91637767', '490B Tampines Street 45 #11-187', '521490'), (471, 'Jesslyn Goh', '91059136', '205B Compassvale Lane #04-11', '542205'), (472, 'Jessie Liu', '96861382', '508 Woodlands Drive 14 #02-100', '730508'), (473, 'Calvin Loo', '94388593', 'The Waterside 7 Tanjong Rhu Road 15-01', '436887'), (474, 'Colin Ho', '98903346', '44 Beo Crescent #10-77', '160044'), (475, 'Barry Lim', '97984551', 'Lian Tong Building, 18 Tannery Lane #02-11', '347780'), (476, 'Marcus Koh', '98285661', 'Peoples Garden 8 Lorong 1 Reality Park Unit no. 8', '536932'), (477, 'Lim Sai Teng', '87171697', 'Twin Waterfalls 120 Punggol Walk #09-42', '828770'), (478, 'Liza Sugimin', '81895020', '492C Tampines Street 45 #02-288', '522492'), (479, 'Joelle Een', '93225531', '537 Bedok North Street 3 #03-549', '460537'), (480, 'John Yong', '86661912', '19 Shelford Road #03-04', '288408'), (481, 'Yong Leyi', '97465616', 'Block 19 Jalan Sultan #09-176 #09-176', '190019'), (482, 'Irene Khoo', '92245808', '330 Clementi Avenue 2 #02-164', '120330'), (483, 'Sufyan bin Tomah', '82987747', '133 Bedok Reservoir Road #04-1209', '470133'), (484, 'Kaylene Lee', '84072618', '816 Tampines Ave 4 #16-255', '520816'), (485, 'Kevin Soh', '96176555', '636 Choa Chu Kang North 6 #11-261', '680636'), (486, 'Ang Xinyi', '98723321', 'Clementi Park 127 Sunset Way #01-01', '597156'), (487, 'Chester Ong', '87554322', '50 Sengkang Square La Fiesta #08-04', '544830'), (488, 'Jeremy Yong', '90844571', '54 Flora Drive #12-33', '506870'), (489, 'Tan Boon Leong', '90233457', '700A Ang Mo Kio Ave 6 #14-302', '561700'); -- -------------------------------------------------------- -- -- Table structure for table `customer_purchase` -- CREATE TABLE IF NOT EXISTS `customer_purchase` ( `Order_Id` int(30) NOT NULL AUTO_INCREMENT, `Cust_Id` int(30) NOT NULL, `Phone_number` varchar(10) NOT NULL, `SKU_Id` int(255) DEFAULT NULL, `Date_Of_Purchase` date NOT NULL, `Quantity` int(11) NOT NULL, PRIMARY KEY (`Order_Id`), KEY `Cust_Id` (`Cust_Id`), KEY `customer_purchase_ibfk_2_idx` (`SKU_Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=630 ; -- -- Dumping data for table `customer_purchase` -- INSERT INTO `customer_purchase` (`Order_Id`, `Cust_Id`, `Phone_number`, `SKU_Id`, `Date_Of_Purchase`, `Quantity`) VALUES (1, 1, '96245546', 111, '2017-01-01', 1), (2, 2, '98685252', 585, '2017-01-01', 4), (3, 3, '85467999', 590, '2017-01-05', 1), (4, 4, '85879988', 94, '2017-01-05', 7), (5, 5, '95549989', 418, '2017-01-09', 5), (6, 481, '97465616', 50, '2017-01-09', 3), (7, 6, '97552119', 8, '2017-01-09', 2), (8, 7, '88228946', 59, '2017-01-10', 10), (9, 8, '64557823', 551, '2017-01-11', 10), (10, 9, '93378829', 438, '2017-01-11', 6), (11, 10, '81045489', 20, '2017-01-11', 8), (12, 11, '99229885', 299, '2017-01-12', 6), (13, 12, '94553321', 91, '2017-01-14', 7), (14, 13, '86675522', 202, '2017-01-14', 8), (15, 280, '97770343', 605, '2017-01-15', 1), (16, 14, '84436578', 507, '2017-01-15', 1), (17, 15, '94459072', 627, '2017-01-17', 8), (18, 16, '98712199', 482, '2017-01-17', 5), (19, 17, '90335477', 410, '2017-01-18', 7), (20, 18, '93380556', 183, '2017-01-20', 3), (21, 19, '82447299', 611, '2017-01-20', 9), (22, 20, '94359480', 258, '2017-01-20', 3), (23, 2, '98685252', 465, '2017-01-20', 6), (24, 22, '87790926', 117, '2017-01-23', 10), (25, 23, '92691486', 204, '2017-01-23', 7), (26, 24, '95664673', 78, '2017-01-25', 8), (27, 337, '97541761', 47, '2017-01-26', 7), (28, 25, '97061065', 204, '2017-01-27', 7), (29, 85, '94990365', 270, '2017-01-27', 7), (30, 26, '85476531', 559, '2017-01-27', 10), (31, 27, '85876531', 522, '2017-01-30', 6), (32, 28, '87386189', 339, '2017-01-30', 1), (33, 156, '84319055', 567, '2017-01-30', 6), (34, 29, '87776532', 377, '2017-01-30', 10), (35, 30, '89093271', 61, '2017-01-31', 5), (36, 31, '89093272', 239, '2017-02-01', 4), (37, 32, '91807177', 75, '2017-02-01', 7), (38, 33, '93386189', 562, '2017-02-06', 9), (39, 34, '93386198', 636, '2017-02-06', 9), (40, 93, '87773858', 375, '2017-02-06', 8), (41, 35, '93456189', 406, '2017-02-06', 7), (42, 36, '97478731', 603, '2017-02-06', 3), (43, 37, '98706531', 626, '2017-02-07', 10), (44, 38, '98228233', 268, '2017-02-07', 8), (45, 39, '91107496', 467, '2017-02-10', 7), (46, 40, '89573186', 125, '2017-02-10', 6), (47, 41, '99689327', 398, '2017-02-10', 7), (48, 250, '90481470', 499, '2017-02-10', 5), (49, 42, '81653718', 143, '2017-02-11', 8), (50, 43, '97419315', 349, '2017-02-11', 9), (51, 44, '90069669', 366, '2017-02-11', 6), (52, 45, '82735557', 381, '2017-02-15', 4), (53, 46, '98522962', 227, '2017-02-15', 8), (54, 395, '85186402', 197, '2017-02-15', 4), (55, 47, '98180106', 329, '2017-02-17', 6), (56, 48, '82847286', 269, '2017-02-17', 7), (57, 49, '94823109', 282, '2017-02-20', 4), (58, 50, '87104757', 622, '2017-02-20', 9), (59, 51, '86614413', 223, '2017-02-20', 9), (60, 52, '90368521', 412, '2017-02-22', 6), (61, 53, '99451069', 342, '2017-02-22', 1), (62, 231, '91712218', 535, '2017-02-23', 2), (63, 54, '80830072', 607, '2017-02-27', 1), (64, 55, '97671786', 20, '2017-02-27', 6), (65, 56, '97880855', 131, '2017-02-27', 7), (66, 57, '88483398', 409, '2017-02-27', 8), (67, 58, '96230473', 384, '2017-02-28', 4), (68, 59, '95583287', 318, '2017-02-28', 10), (69, 185, '86559009', 315, '2017-02-28', 5), (70, 60, '85261068', 574, '2017-02-28', 10), (71, 61, '96934734', 440, '2017-03-02', 2), (72, 62, '95451883', 127, '2017-03-03', 10), (73, 63, '94232681', 164, '2017-03-03', 1), (74, 64, '95965423', 374, '2017-03-05', 1), (75, 7, '88228946', 186, '2017-03-05', 6), (76, 65, '99227315', 14, '2017-03-05', 2), (77, 66, '92876501', 259, '2017-03-08', 9), (78, 210, '90933342', 112, '2017-03-08', 2), (79, 67, '88850480', 42, '2017-03-08', 6), (80, 68, '96359143', 331, '2017-03-09', 2), (81, 69, '90974103', 629, '2017-03-10', 4), (82, 70, '83824925', 539, '2017-03-12', 8), (83, 71, '96898211', 147, '2017-03-12', 1), (84, 72, '97188478', 97, '2017-03-15', 1), (85, 105, '98235817', 424, '2017-03-15', 2), (86, 73, '92953031', 486, '2017-03-15', 4), (87, 74, '90757230', 317, '2017-03-15', 8), (88, 75, '90407227', 337, '2017-03-17', 1), (89, 76, '86180966', 618, '2017-03-17', 8), (90, 352, '96717039', 48, '2017-03-17', 5), (91, 77, '97805142', 346, '2017-03-17', 9), (92, 78, '86556329', 566, '2017-03-19', 2), (93, 79, '96854150', 288, '2017-03-19', 2), (94, 165, '81806112', 38, '2017-03-19', 4), (95, 80, '83643335', 611, '2017-03-21', 8), (96, 81, '93561255', 461, '2017-03-21', 8), (97, 82, '98850262', 124, '2017-03-21', 9), (98, 83, '96602836', 255, '2017-03-25', 10), (99, 84, '98995665', 408, '2017-03-25', 6), (100, 85, '94990365', 583, '2017-03-27', 3), (101, 86, '98545321', 72, '2017-03-27', 6), (102, 87, '80610503', 208, '2017-03-27', 10), (103, 88, '91933871', 198, '2017-03-30', 1), (104, 484, '84072618', 14, '2017-03-30', 2), (105, 89, '95657711', 31, '2017-03-30', 5), (106, 90, '93482906', 358, '2017-03-31', 6), (107, 91, '85043593', 95, '2017-04-02', 5), (108, 92, '88425133', 536, '2017-04-02', 6), (109, 93, '87773858', 76, '2017-04-03', 9), (110, 176, '93366854', 382, '2017-04-04', 5), (111, 94, '86972240', 337, '2017-04-04', 8), (112, 95, '94464048', 202, '2017-04-04', 9), (113, 96, '92141269', 313, '2017-04-09', 4), (114, 97, '98559552', 587, '2017-04-09', 5), (115, 98, '94352709', 331, '2017-04-09', 9), (116, 99, '82667517', 156, '2017-04-09', 1), (117, 100, '82776598', 397, '2017-04-11', 9), (118, 101, '88723464', 84, '2017-04-11', 1), (119, 102, '91857943', 86, '2017-04-11', 7), (120, 103, '97816512', 589, '2017-04-13', 7), (121, 104, '96218817', 29, '2017-04-13', 8), (122, 105, '98235817', 564, '2017-04-15', 4), (123, 106, '92723229', 136, '2017-04-19', 9), (124, 107, '80105555', 53, '2017-04-19', 3), (125, 108, '92395636', 556, '2017-04-19', 3), (126, 109, '81113284', 374, '2017-04-19', 10), (127, 110, '91519467', 320, '2017-04-20', 9), (128, 111, '89086834', 56, '2017-04-21', 5), (129, 112, '86264347', 357, '2017-04-22', 8), (130, 113, '96371301', 471, '2017-04-22', 10), (131, 114, '94884082', 497, '2017-04-24', 9), (132, 115, '94898938', 89, '2017-04-27', 4), (133, 116, '94775174', 25, '2017-04-27', 7), (134, 117, '91166828', 339, '2017-04-27', 6), (135, 118, '98645086', 485, '2017-04-30', 9), (136, 92, '88425133', 587, '2017-04-30', 3), (137, 119, '97547347', 487, '2017-04-30', 9), (138, 120, '94572783', 31, '2017-04-30', 5), (139, 121, '93248652', 100, '2017-05-01', 1), (140, 122, '98545961', 352, '2017-05-01', 8), (141, 123, '97116795', 122, '2017-05-02', 8), (142, 124, '95103871', 60, '2017-05-04', 2), (143, 125, '92337391', 301, '2017-05-04', 10), (144, 126, '99150695', 186, '2017-05-04', 1), (145, 127, '85005221', 89, '2017-05-06', 10), (146, 1, '96245546', 30, '2017-05-06', 3), (147, 128, '85259861', 19, '2017-05-07', 5), (148, 129, '87573228', 392, '2017-05-07', 4), (149, 130, '97495704', 276, '2017-05-07', 9), (150, 131, '96208565', 491, '2017-05-10', 6), (151, 132, '91355440', 224, '2017-05-10', 4), (152, 34, '93386198', 439, '2017-05-10', 5), (153, 134, '83445419', 447, '2017-05-10', 4), (154, 135, '82103210', 440, '2017-05-15', 1), (155, 136, '87109077', 46, '2017-05-15', 3), (156, 137, '90106560', 243, '2017-05-15', 5), (157, 138, '91071955', 320, '2017-05-15', 1), (158, 139, '82226796', 442, '2017-05-18', 3), (159, 140, '98776740', 409, '2017-05-18', 2), (160, 141, '80123096', 627, '2017-05-20', 1), (161, 216, '96794477', 329, '2017-05-21', 1), (162, 142, '87669021', 192, '2017-05-24', 1), (163, 143, '94426890', 254, '2017-05-24', 8), (164, 144, '91804668', 498, '2017-05-24', 8), (165, 145, '98775450', 216, '2017-05-24', 9), (166, 251, '82459821', 620, '2017-05-24', 7), (167, 146, '84327790', 616, '2017-05-26', 6), (168, 147, '80198557', 400, '2017-05-26', 1), (169, 148, '98887012', 159, '2017-05-26', 1), (170, 194, '92335888', 9, '2017-05-27', 8), (171, 149, '81684916', 381, '2017-05-28', 5), (172, 150, '83396147', 146, '2017-05-29', 8), (173, 151, '91124555', 249, '2017-06-02', 2), (174, 152, '86673366', 515, '2017-06-02', 8), (175, 153, '82667890', 472, '2017-06-02', 5), (176, 154, '81115843', 501, '2017-06-04', 10), (177, 183, '97996805', 636, '2017-06-04', 1), (178, 155, '85148904', 238, '2017-06-04', 7), (179, 156, '84319055', 67, '2017-06-08', 2), (180, 157, '96608055', 10, '2017-06-08', 9), (181, 6, '97552119', 417, '2017-06-08', 3), (182, 159, '82334890', 332, '2017-06-10', 9), (183, 160, '81068991', 309, '2017-06-10', 2), (184, 161, '97670944', 194, '2017-06-11', 7), (185, 162, '98990922', 66, '2017-06-11', 10), (186, 163, '98755540', 528, '2017-06-13', 7), (187, 164, '87886551', 545, '2017-06-14', 5), (188, 165, '81806112', 578, '2017-06-14', 6), (189, 335, '90046869', 484, '2017-06-18', 10), (190, 166, '90155580', 473, '2017-06-19', 9), (191, 167, '82336670', 387, '2017-06-19', 6), (192, 168, '87909288', 414, '2017-06-19', 9), (193, 169, '80924311', 574, '2017-06-19', 3), (194, 170, '93853017', 6, '2017-06-20', 2), (195, 304, '97593438', 244, '2017-06-21', 10), (196, 171, '90114589', 452, '2017-06-22', 7), (197, 172, '98280837', 382, '2017-06-22', 8), (198, 173, '87900144', 211, '2017-06-23', 8), (199, 174, '94573055', 310, '2017-06-24', 4), (200, 175, '98783235', 65, '2017-06-24', 8), (201, 176, '93366854', 325, '2017-06-24', 7), (202, 177, '90033778', 138, '2017-06-27', 5), (203, 178, '96342213', 277, '2017-06-28', 5), (204, 179, '90905889', 292, '2017-06-28', 2), (205, 401, '93345678', 553, '2017-06-28', 7), (206, 180, '98001344', 581, '2017-06-30', 2), (207, 181, '90156688', 183, '2017-07-05', 4), (208, 329, '91782643', 323, '2017-07-05', 2), (209, 182, '96202831', 285, '2017-07-05', 8), (210, 183, '97996805', 204, '2017-07-07', 3), (211, 184, '90771244', 251, '2017-07-07', 1), (212, 185, '86559009', 150, '2017-07-10', 9), (213, 186, '92475649', 524, '2017-07-10', 9), (214, 187, '92315590', 633, '2017-07-10', 4), (215, 188, '90018636', 337, '2017-07-13', 4), (216, 189, '87665890', 517, '2017-07-13', 7), (217, 190, '81892171', 631, '2017-07-13', 5), (218, 191, '91000456', 362, '2017-07-13', 7), (219, 192, '81013379', 492, '2017-07-17', 8), (220, 193, '80992499', 494, '2017-07-19', 4), (221, 194, '92335888', 345, '2017-07-19', 6), (222, 195, '95667090', 543, '2017-07-21', 8), (223, 196, '93876299', 141, '2017-07-21', 8), (224, 197, '92115880', 397, '2017-07-24', 5), (225, 198, '96174465', 567, '2017-07-24', 6), (226, 199, '90998755', 295, '2017-07-25', 3), (227, 200, '81889553', 520, '2017-07-27', 10), (228, 362, '98510165', 22, '2017-07-27', 3), (229, 201, '91223788', 339, '2017-07-27', 2), (230, 202, '89901033', 379, '2017-07-27', 5), (231, 203, '90513274', 328, '2017-07-28', 2), (232, 204, '82446099', 281, '2017-07-28', 1), (233, 205, '93883791', 346, '2017-07-28', 2), (234, 206, '87661233', 556, '2017-07-28', 7), (235, 184, '90771244', 380, '2017-07-28', 6), (236, 207, '92226788', 596, '2017-07-30', 10), (237, 222, '85335250', 107, '2017-07-30', 7), (238, 208, '96395290', 45, '2017-07-30', 1), (239, 209, '97891322', 13, '2017-08-31', 8), (240, 210, '90933342', 348, '2017-08-31', 4), (241, 211, '90125589', 483, '2017-08-01', 9), (242, 212, '98900133', 404, '2017-08-01', 2), (243, 335, '90046869', 263, '2017-08-01', 4), (244, 98, '94352709', 503, '2017-08-01', 3), (245, 213, '97847789', 620, '2017-08-02', 10), (246, 214, '9.13E+07', 9, '2017-08-02', 10), (247, 215, '90992833', 308, '2017-08-04', 9), (248, 283, '98709049', 529, '2017-08-04', 2), (249, 216, '96794477', 432, '2017-08-04', 2), (250, 217, '90012465', 567, '2017-08-04', 2), (251, 218, '97438275', 234, '2017-08-06', 8), (252, 46, '98522962', 195, '2017-08-06', 7), (253, 219, '84998137', 411, '2017-08-06', 4), (254, 220, '85226964', 455, '2017-08-06', 6), (255, 221, '94239104', 454, '2017-08-11', 3), (256, 222, '85335250', 442, '2017-08-11', 2), (257, 223, '96637773', 450, '2017-08-15', 9), (258, 224, '81027781', 506, '2017-08-15', 4), (259, 302, '94318493', 615, '2017-08-15', 7), (260, 225, '91096838', 179, '2017-08-17', 7), (261, 226, '87664399', 560, '2017-08-20', 2), (262, 227, '96903370', 14, '2017-08-20', 5), (263, 228, '91776046', 562, '2017-08-20', 1), (264, 229, '94318995', 297, '2017-08-21', 3), (265, 230, '97482660', 291, '2017-08-21', 3), (266, 231, '91712218', 402, '2017-08-21', 8), (267, 32, '91807177', 555, '2017-08-21', 2), (268, 232, '91990046', 386, '2017-08-22', 9), (269, 233, '91469701', 31, '2017-08-22', 8), (270, 332, '83230806', 571, '2017-08-24', 1), (271, 234, '97366706', 238, '2017-08-24', 10), (272, 235, '96728375', 608, '2017-08-24', 8), (273, 236, '96310336', 51, '2017-08-24', 4), (274, 330, '81235757', 343, '2017-08-28', 7), (275, 237, '96530239', 158, '2017-08-28', 7), (276, 238, '85337735', 221, '2017-08-29', 10), (277, 239, '98429228', 197, '2017-08-28', 10), (278, 240, '90222865', 418, '2017-08-30', 7), (279, 241, '92260706', 458, '2017-09-02', 8), (280, 242, '97599650', 32, '2017-09-02', 4), (281, 213, '97847789', 337, '2017-09-02', 6), (282, 243, '91263443', 195, '2017-09-04', 8), (283, 244, '96434826', 148, '2017-09-04', 6), (284, 245, '98559483', 614, '2017-09-04', 4), (285, 157, '96608055', 455, '2017-09-04', 2), (286, 246, '90301680', 480, '2017-09-06', 8), (287, 247, '98233690', 222, '2017-09-06', 3), (288, 248, '96602267', 391, '2017-09-08', 4), (289, 249, '94552982', 341, '2017-09-08', 5), (290, 98, '94352709', 628, '2017-09-08', 9), (291, 250, '90481470', 300, '2017-09-08', 6), (292, 251, '82459821', 559, '2017-09-11', 10), (293, 252, '97208755', 222, '2017-09-11', 6), (294, 326, '81886025', 460, '2017-09-11', 10), (295, 253, '90235605', 131, '2017-09-11', 5), (296, 254, '91076985', 579, '2017-09-14', 10), (297, 255, '97329913', 286, '2017-09-14', 6), (298, 256, '91504754', 159, '2017-09-16', 5), (299, 6, '97552119', 538, '2017-09-16', 5), (300, 257, '87203783', 15, '2017-09-16', 7), (301, 258, '98488116', 430, '2017-09-18', 7), (302, 259, '91181465', 338, '2017-09-20', 5), (303, 260, '92711324', 269, '2017-09-20', 4), (304, 336, '97807914', 259, '2017-09-21', 10), (305, 261, '96468306', 106, '2017-09-21', 5), (306, 262, '94763260', 519, '2017-09-21', 9), (307, 263, '82189604', 475, '2017-09-21', 1), (308, 264, '93388470', 65, '2017-09-24', 10), (309, 265, '91014380', 291, '2017-09-24', 2), (310, 266, '90223993', 394, '2017-09-26', 5), (311, 267, '87480876', 386, '2017-09-28', 3), (312, 29, '87776532', 491, '2017-09-28', 1), (313, 268, '85187584', 498, '2017-09-28', 4), (314, 269, '81838418', 157, '2017-09-29', 3), (315, 270, '84220676', 356, '2017-09-30', 5), (316, 271, '96540130', 357, '2017-10-06', 4), (317, 272, '81012826', 39, '2017-10-06', 3), (318, 273, '90223029', 153, '2017-10-07', 10), (319, 274, '91788931', 298, '2017-10-08', 2), (320, 275, '84814691', 112, '2017-10-08', 9), (321, 131, '96208565', 458, '2017-10-08', 9), (322, 276, '81639623', 30, '2017-10-10', 2), (323, 277, '96206870', 121, '2017-10-12', 5), (324, 278, '81894140', 412, '2017-10-12', 4), (325, 279, '93837177', 635, '2017-10-14', 4), (326, 280, '97770343', 616, '2017-10-14', 3), (327, 281, '90108024', 511, '2017-10-16', 3), (328, 282, '96227150', 299, '2017-10-16', 8), (329, 283, '98709049', 306, '2017-10-16', 5), (330, 284, '90010082', 538, '2017-10-19', 9), (331, 285, '96190661', 516, '2017-10-19', 9), (332, 286, '90617694', 19, '2017-10-21', 5), (333, 122, '98545961', 566, '2017-10-21', 5), (334, 287, '90013894', 255, '2017-10-22', 5), (335, 288, '81852443', 44, '2017-10-22', 3), (336, 289, '90071807', 439, '2017-10-24', 5), (337, 290, '85519576', 172, '2017-10-24', 7), (338, 291, '85331858', 633, '2017-10-24', 6), (339, 292, '98274125', 91, '2017-10-26', 1), (340, 293, '97356496', 499, '2017-10-26', 7), (341, 294, '91544268', 258, '2017-10-29', 8), (342, 295, '86563142', 349, '2017-10-29', 4), (343, 296, '97342648', 62, '2017-10-29', 8), (344, 297, '83887235', 632, '2017-10-30', 8), (345, 298, '96968098', 46, '2017-10-30', 4), (346, 299, '94894659', 36, '2017-10-31', 3), (347, 300, '97611310', 9, '2017-10-31', 6), (348, 301, '96610501', 461, '2017-11-01', 4), (349, 302, '94318493', 463, '2017-11-01', 2), (350, 303, '97826020', 199, '2017-11-01', 4), (351, 304, '97593438', 403, '2017-11-03', 2), (352, 63, '94232681', 30, '2017-11-03', 10), (353, 305, '96178395', 14, '2017-11-03', 2), (354, 306, '90199760', 548, '2017-11-05', 9), (355, 307, '94564315', 593, '2017-11-07', 2), (356, 111, '89086834', 317, '2017-11-07', 1), (357, 308, '90616355', 351, '2017-11-07', 3), (358, 309, '96529585', 52, '2017-11-08', 9), (359, 310, '97700657', 479, '2017-11-10', 10), (360, 311, '81773223', 248, '2017-11-10', 8), (361, 95, '94464048', 71, '2017-11-10', 5), (362, 312, '93624886', 44, '2017-11-10', 5), (363, 313, '96250883', 561, '2017-11-13', 3), (364, 314, '90273371', 529, '2017-11-13', 3), (365, 315, '97499718', 537, '2017-11-13', 8), (366, 316, '90308276', 276, '2017-11-15', 4), (367, 317, '98239659', 271, '2017-11-15', 8), (368, 318, '83418472', 178, '2017-11-17', 8), (369, 257, '87203783', 358, '2017-11-17', 7), (370, 319, '93219156', 396, '2017-11-18', 5), (371, 320, '92287646', 487, '2017-11-18', 9), (372, 321, '91506711', 499, '2017-11-22', 4), (373, 322, '91525100', 456, '2017-11-22', 2), (374, 323, '82611330', 195, '2017-11-22', 4), (375, 324, '84843909', 437, '2017-11-24', 1), (376, 325, '90102744', 80, '2017-11-24', 9), (377, 83, '96602836', 266, '2017-11-25', 4), (378, 326, '81886025', 208, '2017-11-25', 5), (379, 327, '96728476', 636, '2017-11-27', 5), (380, 328, '94366482', 45, '2017-11-27', 5), (381, 329, '91782643', 123, '2017-11-30', 4), (382, 330, '81235757', 191, '2017-11-30', 7), (383, 331, '97963522', 97, '2017-12-01', 1), (384, 332, '83230806', 320, '2017-12-01', 1), (385, 333, '91726358', 121, '2017-12-01', 10), (386, 334, '98253257', 329, '2017-12-04', 3), (387, 335, '90046869', 151, '2017-12-04', 1), (388, 74, '90757230', 433, '2017-12-05', 3), (389, 336, '97612442', 484, '2017-12-05', 9), (390, 337, '97541761', 550, '2017-12-05', 9), (391, 338, '84188169', 633, '2017-12-07', 7), (392, 339, '95676659', 153, '2017-12-07', 9), (393, 13, '86675522', 388, '2017-12-07', 3), (394, 340, '98640040', 378, '2017-12-09', 7), (395, 341, '85025429', 218, '2017-12-09', 9), (396, 342, '86168389', 205, '2017-12-11', 8), (397, 343, '86994421', 556, '2017-12-11', 3), (398, 344, '97921527', 335, '2017-12-11', 2), (399, 28, '87386189', 286, '2017-12-14', 7), (400, 345, '87207040', 157, '2017-12-14', 2), (401, 346, '98442248', 504, '2017-12-14', 7), (402, 347, '97346394', 492, '2017-12-16', 4), (403, 348, '83997261', 582, '2017-12-17', 10), (404, 349, '93294668', 373, '2017-12-17', 2), (405, 350, '86995442', 604, '2017-12-19', 4), (406, 36, '97478731', 332, '2017-12-19', 3), (407, 351, '93289321', 374, '2017-12-20', 9), (408, 352, '96717039', 593, '2017-12-20', 1), (409, 353, '97328904', 264, '2017-12-20', 10), (410, 354, '97979042', 292, '2017-12-21', 7), (411, 355, '96885198', 57, '2017-12-21', 1), (412, 356, '9.83E+07', 448, '2017-12-27', 5), (413, 92, '88425133', 270, '2017-12-27', 9), (414, 357, '93364434', 224, '2017-12-27', 8), (415, 358, '93833646', 552, '2017-12-27', 3), (416, 359, '94500995', 265, '2018-01-01', 6), (417, 360, '92986641', 450, '2018-01-01', 6), (418, 361, '97859524', 638, '2018-01-02', 9), (419, 362, '98510165', 306, '2018-01-02', 7), (420, 363, '97105757', 199, '2018-01-02', 6), (421, 364, '84033261', 588, '2018-01-02', 6), (422, 365, '93364386', 132, '2018-01-02', 5), (423, 366, '97807914', 412, '2018-01-04', 2), (424, 136, '87109077', 632, '2018-01-04', 4), (425, 367, '94231270', 175, '2018-01-04', 1), (426, 368, '93804963', 487, '2018-01-07', 2), (427, 2, '98685252', 155, '2018-01-07', 6), (428, 369, '98413146', 178, '2018-01-07', 6), (429, 370, '91506595', 457, '2018-01-07', 1), (430, 21, '82447299', 111, '2018-01-07', 5), (431, 371, '97976401', 394, '2018-01-07', 4), (432, 372, '83885710', 180, '2018-01-09', 6), (433, 373, '96585979', 536, '2018-01-13', 10), (434, 258, '98488116', 433, '2018-01-13', 5), (435, 52, '90368521', 221, '2018-01-13', 3), (436, 374, '96838951', 115, '2018-01-14', 3), (437, 375, '96787050', 508, '2018-01-15', 4), (438, 376, '84980087', 43, '2018-01-15', 7), (439, 13, '86675522', 98, '2018-01-15', 6), (440, 377, '97698585', 254, '2018-01-16', 4), (441, 378, '91833180', 224, '2018-01-16', 3), (442, 379, '90938935', 230, '2018-01-17', 10), (443, 380, '97775092', 139, '2018-01-17', 6), (444, 42, '81653718', 419, '2018-01-17', 1), (445, 381, '98157341', 462, '2018-01-17', 2), (446, 382, '94560615', 313, '2018-01-17', 4), (447, 25, '92691486', 77, '2018-01-17', 5), (448, 383, '96418778', 531, '2018-01-19', 3), (449, 384, '97558415', 562, '2018-01-19', 7), (450, 385, '96407710', 55, '2018-01-20', 1), (451, 386, '91265291', 175, '2018-01-21', 5), (452, 10, '93378829', 43, '2018-01-21', 6), (453, 47, '98180106', 78, '2018-01-21', 3), (454, 387, '98362744', 333, '2018-01-22', 1), (455, 388, '97894970', 528, '2018-01-23', 10), (456, 389, '93392340', 21, '2018-01-23', 3), (457, 219, '84998137', 130, '2018-01-23', 5), (458, 390, '81806035', 68, '2018-01-23', 2), (459, 391, '96519665', 107, '2018-01-26', 2), (460, 392, '96423805', 463, '2018-01-26', 1), (461, 393, '96445232', 46, '2018-01-28', 2), (462, 1, '96245546', 382, '2018-01-28', 8), (463, 394, '97823963', 191, '2018-01-29', 10), (464, 395, '85186402', 36, '2018-01-30', 7), (465, 396, '86114033', 367, '2018-01-30', 9), (466, 397, '91012373', 266, '2018-01-30', 2), (467, 6, '97552119', 218, '2018-01-31', 10), (468, 398, '98294827', 260, '2018-01-31', 2), (469, 399, '91878140', 635, '2018-01-31', 2), (470, 400, '98418947', 117, '2018-02-01', 9), (471, 401, '93345678', 257, '2018-02-01', 9), (472, 402, '90600168', 388, '2018-02-01', 5), (473, 403, '92739216', 215, '2018-02-01', 5), (474, 404, '90996904', 194, '2018-02-01', 1), (475, 131, '96208565', 36, '2018-02-01', 3), (476, 405, '91050325', 520, '2018-02-01', 2), (477, 406, '65410846', 379, '2018-02-02', 10), (478, 407, '86110654', 570, '2018-02-02', 8), (479, 408, '98379185', 331, '2018-02-02', 8), (480, 409, '92371492', 504, '2018-02-02', 9), (481, 410, '96898833', 109, '2018-02-02', 4), (482, 5, '95549989', 428, '2018-02-02', 3), (483, 411, '96795481', 13, '2018-02-04', 3), (484, 412, '97561820', 45, '2018-02-04', 4), (485, 413, '96750402', 410, '2018-02-04', 9), (486, 414, '96224730', 56, '2018-02-04', 2), (487, 415, '82278227', 569, '2018-02-04', 3), (488, 416, '96823435', 565, '2018-02-06', 5), (489, 60, '85261068', 156, '2018-02-06', 5), (490, 417, '96750873', 143, '2018-02-06', 3), (491, 418, '84999644', 438, '2018-02-06', 6), (492, 419, '94491582', 188, '2018-02-06', 2), (493, 420, '97422668', 389, '2018-02-07', 5), (494, 83, '96602836', 208, '2018-02-07', 8), (495, 421, '96217634', 59, '2018-02-07', 2), (496, 422, '97414921', 247, '2018-02-07', 9), (497, 423, '97910024', 548, '2018-02-07', 7), (498, 424, '98485622', 155, '2018-02-07', 3), (499, 19, '82447299', 476, '2018-02-08', 1), (500, 425, '94792093', 561, '2018-02-08', 10), (501, 426, '91691810', 545, '2018-02-08', 4), (502, 427, '81236629', 220, '2018-02-08', 3), (503, 2, '98685252', 588, '2018-02-08', 8), (504, 428, '97673698', 627, '2018-02-08', 5), (505, 429, '91151267', 375, '2018-02-08', 4), (506, 430, '96508409', 610, '2018-02-08', 7), (507, 431, '96710523', 113, '2018-02-08', 4), (508, 432, '94508755', 20, '2018-02-09', 5), (509, 433, '93577570', 552, '2018-02-09', 5), (510, 434, '90231392', 490, '2018-02-09', 1), (511, 435, '81184889', 220, '2018-02-09', 5), (512, 436, '87277089', 511, '2018-02-09', 5), (513, 99, '82667517', 175, '2018-02-09', 5), (514, 437, '96261210', 139, '2018-02-09', 4), (515, 438, '83386176', 570, '2018-02-09', 7), (516, 439, '81136645', 147, '2018-02-09', 10), (517, 440, '97438834', 92, '2018-02-10', 1), (518, 441, '91773138', 148, '2018-02-10', 10), (519, 442, '93277276', 433, '2018-02-10', 8), (520, 443, '96404155', 507, '2018-02-10', 1), (521, 444, '97113171', 335, '2018-02-10', 10), (522, 100, '82776598', 240, '2018-02-10', 6), (523, 445, '81989236', 160, '2018-02-11', 3), (524, 446, '98204011', 329, '2018-02-11', 9), (525, 447, '87669490', 375, '2018-02-11', 2), (526, 119, '97547347', 622, '2018-02-11', 5), (527, 448, '82992439', 221, '2018-02-11', 5), (528, 449, '81884758', 171, '2018-02-12', 9), (529, 450, '92351672', 462, '2018-02-12', 3), (530, 451, '92954484', 233, '2018-02-12', 6), (531, 216, '96794477', 18, '2018-02-12', 2), (532, 452, '98371437', 543, '2018-02-12', 3), (533, 453, '85330536', 285, '2018-02-13', 1), (534, 454, '90285237', 61, '2018-02-13', 4), (535, 455, '92959612', 610, '2018-02-13', 10), (536, 456, '96222142', 589, '2018-02-13', 2), (537, 457, '93682420', 510, '2018-02-13', 10), (538, 458, '96787736', 341, '2018-02-14', 3), (539, 79, '96854150', 350, '2018-02-14', 3), (540, 459, '87664282', 616, '2018-02-14', 8), (541, 460, '90272134', 152, '2018-02-14', 7), (542, 461, '87106418', 37, '2018-02-16', 9), (543, 462, '92775441', 337, '2018-02-16', 1), (544, 463, '96825340', 587, '2018-02-16', 1), (545, 464, '91519686', 112, '2018-02-16', 6), (546, 62, '95451883', 470, '2018-02-17', 10), (547, 465, '91683815', 46, '2018-02-17', 7), (548, 466, '90303987', 246, '2018-02-17', 4), (549, 467, '98251122', 122, '2018-02-19', 8), (550, 468, '82224064', 70, '2018-02-19', 10), (551, 469, '97316060', 75, '2018-02-19', 8), (552, 470, '91637767', 544, '2018-02-19', 8), (553, 471, '91059136', 427, '2018-02-19', 11), (554, 472, '96861382', 383, '2018-02-21', 6), (555, 473, '94388593', 461, '2018-02-21', 5), (556, 474, '98903346', 375, '2018-02-21', 8), (557, 475, '97984551', 42, '2018-02-21', 2), (558, 27, '85876531', 440, '2018-02-21', 3), (559, 476, '98285661', 99, '2018-02-23', 5), (560, 477, '87171697', 406, '2018-02-23', 10), (561, 478, '81895020', 168, '2018-02-23', 7), (562, 479, '93225531', 77, '2018-02-24', 6), (563, 480, '86661912', 276, '2018-02-24', 10), (564, 481, '97465616', 291, '2018-02-25', 6), (565, 482, '92245808', 301, '2018-02-26', 5), (566, 483, '82987747', 16, '2018-02-27', 5), (567, 44, '90069669', 146, '2018-02-27', 15), (568, 484, '84072618', 420, '2018-02-28', 4), (569, 485, '96176555', 23, '2018-03-01', 7), (570, 486, '98723321', 592, '2018-03-01', 7), (571, 487, '87554322', 500, '2018-03-02', 5), (572, 488, '90844571', 325, '2018-03-02', 8), (573, 489, '90233457', 635, '2018-03-02', 6), (574, 489, '90233457', 635, '2018-03-02', 3), (577, 1, '96245546', 641, '2018-03-01', 2), (578, 1, '96245546', 641, '2018-03-01', 10), (579, 12, '99229885', 642, '2018-03-01', 4), (580, 12, '99229885', 642, '2018-03-01', 3), (581, 25, '92691486', 642, '2018-03-21', 4), (582, 25, '92691486', 642, '2018-03-21', 4), (583, 50, '97419315', 641, '2018-03-02', 8), (584, 93, '87773858', 641, '2018-03-03', 2), (585, 50, '97419315', 641, '2018-03-02', 4), (586, 93, '87773858', 641, '2018-03-03', 2), (587, 93, '87773858', 642, '2018-03-03', 2), (588, 337, '97541761', 642, '2018-03-18', 1), (589, 15, '94459072', 111, '2018-02-14', 3), (590, 208, '97770343', 465, '2018-03-20', 12), (591, 131, '96208565', 1, '2018-02-20', 1), (592, 386, '91265291', 643, '2018-03-26', 10), (593, 386, '91265291', 643, '2018-03-26', 6), (594, 474, '90996904', 642, '2018-03-19', 3), (595, 18, '93380556', 25, '2018-03-15', 2), (596, 12, '94553321', 50, '2018-03-09', 2), (597, 12, '94553321', 50, '2018-03-09', 2), (608, 50, '97419315', 624, '2018-03-11', 3), (619, 1, '96245546', 111, '2018-03-31', 20), (620, 22, '87790926', 117, '2018-03-31', 10), (621, 326, '81886025', 208, '2018-03-31', 4), (622, 343, '86994421', 45, '2018-03-31', 9), (623, 15, '94459072', 643, '2018-03-31', 6), (624, 436, '94459072', 643, '2018-03-31', 8), (625, 11, '99229885', 321, '2018-03-31', 4), (626, 58, '96230473', 4, '2018-03-31', 5), (627, 69, '90974103', 5, '2018-03-31', 5), (628, 58, '96230473', 4, '2018-03-31', 5), (629, 69, '90974103', 5, '2018-03-30', 8); -- -------------------------------------------------------- -- -- Table structure for table `expensetracker` -- CREATE TABLE IF NOT EXISTS `expensetracker` ( `date` varchar(45) NOT NULL, `expenseTypes` varchar(45) NOT NULL, `remark` varchar(100) NOT NULL, `cost` double(45,0) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `expensetracker` -- INSERT INTO `expensetracker` (`date`, `expenseTypes`, `remark`, `cost`) VALUES ('2017-01-18', 'Delivery', 'Cost of Transporting', 35), ('2017-02-19', 'Postage', 'Buying of stamps', 45), ('2017-03-21', 'Supplies', 'Office supplies - writing instruments and papers', 32), ('2017-04-22', 'Taxes', 'Govt tax', 43), ('2017-05-23', 'Packaging Material', 'Plastic wrappers,scrotch tape, bubble wraps', 50), ('2017-06-24', 'Insurance', 'Insurance for Jan', 84), ('2017-07-26', 'Utilities', 'For office', 46), ('2017-08-28', 'Marketing', 'For shopping plaforms x3', 33), ('2018-01-18', 'Delivery', 'Cost of Transporting', 25), ('2018-01-19', 'Postage', 'Buying of stamps', 8), ('2018-01-20', 'Supplies', 'Office supplies - writing instruments and papers ', 9), ('2018-01-21', 'Taxes', 'Govt tax', 43), ('2018-01-22', 'Packaging Material', 'Plastic wrappers,scrotch tape, bubble wraps', 23), ('2018-01-23', 'Insurance', 'Insurance for Jan', 52), ('2018-01-24', 'Utilities', 'For office', 46), ('2018-01-25', 'Marketing', 'For shopping platforms x3', 19), ('2018-02-15', 'Bank Charges', 'Bank Payment made', 26), ('2018-02-15', 'Bank Charges', 'Bank Payment made', 26), ('2017-09-24', 'Utilities', 'Utility bill for September 2017', 51), ('2017-10-20', 'Delivery', 'Delivery to Ang Mo Kio Ave 4', 33), ('2017-11-22', 'Taxes', 'Government Tax for November 2017', 44), ('2017-12-19', 'Utility', 'Utility Bill for December 2017', 46), ('2018-03-15', 'Stamp', 'Bought a batch of stamps for the upcoming orders.', 10), ('2018-03-02', 'Qoo10 Top Up', 'Settled Qoo10 Top Up', 20), ('2018-03-30', 'Bank Charges', 'Payment to OCBC', 42); -- -------------------------------------------------------- -- -- Table structure for table `expensetypes` -- CREATE TABLE IF NOT EXISTS `expensetypes` ( `ExpenseType` varchar(100) NOT NULL, PRIMARY KEY (`ExpenseType`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `expensetypes` -- INSERT INTO `expensetypes` (`ExpenseType`) VALUES ('Bank Charges'), ('Driving'), ('Insurance'), ('Marketing'), ('Misc/Admin'), ('Packing Materials'), ('Parking Fee'), ('Petrol'), ('Phone Fee'), ('Poly Mailer & Plastic'), ('Qoo10 Top Up'), ('Refund'), ('Rent'), ('Repairs and Maintenance'), ('Salary for Cynthia'), ('Salary for Other Staff'), ('Salary for Qing Yang'), ('Self-Employment Taxes'), ('Staff Remunerations'), ('Stamp'), ('Supplies'), ('Taxes'), ('Travel'), ('Utilities'), ('Vendor Rebate'), ('Wages'); -- -------------------------------------------------------- -- -- Table structure for table `inventory` -- CREATE TABLE IF NOT EXISTS `inventory` ( `SKU_Id` int(255) NOT NULL AUTO_INCREMENT, `Name` varchar(100) NOT NULL, `Quantity` int(11) NOT NULL, `Updated_Date` varchar(50) NOT NULL, `Cost_Price` decimal(12,2) NOT NULL, `Selling_Price` decimal(12,2) NOT NULL, PRIMARY KEY (`SKU_Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=644 ; -- -- Dumping data for table `inventory` -- INSERT INTO `inventory` (`SKU_Id`, `Name`, `Quantity`, `Updated_Date`, `Cost_Price`, `Selling_Price`) VALUES (1, 'Collection A Design 1 - Animal (Pig)', 144, '2/24/2018', '1.40', '1.68'), (2, 'Collection A Design 1 - Animal (Panda)', 54, '2/24/2018', '1.40', '1.68'), (3, 'Collection A Design 1 - Animal (Giraffe)', 97, '2/24/2018', '1.40', '1.68'), (4, 'Collection A Design 1 - Animal (Bear)', 155, '2/24/2018', '1.40', '1.68'), (5, 'Collection A (Short) Design 2 & 3 Animal (Grey Bear)', 16, '2/24/2018', '1.40', '1.68'), (6, 'Collection A (Short) Design 2 & 3 Animal (101 Dalmation', 31, '2/24/2018', '1.40', '1.68'), (7, 'Collection A (Short) Design 2 & 3 Animal (Pig)', 8, '2/24/2018', '1.40', '1.68'), (8, 'Collection A (Short) Design 2 & 3 Animal (White/blue mouse)', 3, '2/24/2018', '1.40', '1.68'), (9, 'Collection A (Short) Design 2 & 3 Animal (Brown Bear)', 7, '2/24/2018', '1.40', '1.68'), (10, 'Collection A (Short) Design 2 & 3 Animal (Grey Mouse)', 14, '2/24/2018', '1.40', '1.68'), (11, 'Collection A (Short) Design 2 & 3 Animal (Pink Owl)', 8, '2/24/2018', '1.40', '1.68'), (12, 'Collection A (Short) Design 2 & 3 Animal (Blue Fox)', 36, '2/24/2018', '1.40', '1.68'), (13, 'Collection A Design 4 Hello Kitty(White Tip)', 2, '2/24/2018', '1.40', '1.68'), (14, 'Collection A Design 4 Hello Kitty(Blue Tip)', 6, '2/24/2018', '1.40', '1.68'), (15, 'Collection A Design 4 Hello Kitty(PinkTip)', 4, '2/24/2018', '1.40', '1.68'), (16, 'Collection A Design 4 Hello Kitty(Black Tip)', 4, '2/24/2018', '1.40', '1.68'), (17, 'Collection A Design 5 Cactus(Yellow)', 3, '2/24/2018', '1.40', '1.68'), (18, 'Collection A Design 5 Cactus(Purple)', 4, '2/24/2018', '1.40', '1.68'), (19, 'Collection A Design 5 Cactus(Grey)', 16, '2/24/2018', '1.40', '1.68'), (20, 'Collection A Design 5 Cactus(White)', 30, '2/24/2018', '1.40', '1.68'), (21, 'Collection A Design 5 Cactus(Blue)', 4, '2/24/2018', '1.40', '1.68'), (22, 'Collection A Design 6 Doggies(Purple)', 9, '2/24/2018', '1.40', '1.68'), (23, 'Collection A Design 6 Doggies(Blue)', 3, '2/24/2018', '1.40', '1.68'), (24, 'Collection A Design 6 Doggies(Dark Brown)', 6, '2/24/2018', '1.40', '1.68'), (25, 'Collection A Design 6 Doggies(Nude)', 8, '2/24/2018', '1.40', '1.68'), (26, 'Collection A Design 6 Doggies(Grey)', 7, '2/24/2018', '1.40', '1.68'), (27, 'Collection A Design 7 Multi hearts(Dots)', 13, '2/24/2018', '1.40', '1.68'), (28, 'Collection A Design 7 Multi hearts(Stripes)', 2, '2/24/2018', '1.40', '1.68'), (29, 'Collection A Design 7 Multi hearts(Heart Stripes)', 51, '2/24/2018', '1.40', '1.68'), (30, 'Collection A Design 8 Paw Friends(White)', 1, '2/24/2018', '1.40', '1.68'), (31, 'Collection A Design 8 Paw Friends(Blue)', 2, '2/24/2018', '1.40', '1.68'), (32, 'Collection A Design 8 Paw Friends(Pink)', 0, '2/24/2018', '1.40', '1.68'), (33, 'Collection A Design 8 Paw Friends(Grey)', 1, '2/24/2018', '1.40', '1.68'), (34, 'Collection A Design 8 Paw Friends(Brown)', 3, '2/24/2018', '1.40', '1.68'), (35, 'Collection A Design 9 Pastel Lines(Grey)', 1, '2/24/2018', '1.40', '1.68'), (36, 'Collection A Design 9 Pastel Lines(Brown Bear)', 4, '2/24/2018', '1.40', '1.68'), (37, 'Collection A Design 9 Pastel Lines(Blue)', 0, '2/24/2018', '1.40', '1.68'), (38, 'Collection A Design 9 Pastel Lines(Green)', 3, '2/24/2018', '1.40', '1.68'), (39, 'Collection A Design 9 Pastel Lines(Grey)', 0, '2/24/2018', '1.40', '1.68'), (40, 'Collection A Design 10 Zoo party(Blue Penguine)', 5, '2/24/2018', '1.40', '1.68'), (41, 'Collection A Design 10 Zoo party(Green Bear)', 2, '2/24/2018', '1.40', '1.68'), (42, 'Collection A Design 10 Zoo party(Nude Tiger)', 35, '2/24/2018', '1.40', '1.68'), (43, 'Collection A Design 10 Zoo party(Navy Mouse)', 3, '2/24/2018', '1.40', '1.68'), (44, 'Collection A Design 10 Zoo party(Red Panda)', 2, '2/24/2018', '1.40', '1.68'), (45, 'Collection A Design 10 Zoo party(Brown Pig)', 13, '2/24/2018', '1.40', '1.68'), (46, 'Collection A Design 11 Buffet(Food)', 33, '2/24/2018', '1.40', '1.68'), (47, 'Collection A Design 11 Buffet(Donut)', 51, '2/24/2018', '1.40', '1.68'), (48, 'Collection A Design 11 Buffet(Sushi)', 2, '2/24/2018', '1.40', '1.68'), (49, 'Collection A Design 11 Buffet(Fruits)', 0, '2/24/2018', '1.40', '1.68'), (50, 'Collection A Design 11 Buffet(Ice Cream_RED)', 30, '2/24/2018', '1.40', '1.68'), (51, 'Collection A Design 12 Friends(Chick)', 1, '2/24/2018', '1.40', '1.68'), (52, 'Collection A Design 12 Friends(Frog)', 3, '2/24/2018', '1.40', '1.68'), (53, 'Collection A Design 12 Friends(Light Pink Cat)', 3, '2/24/2018', '1.40', '1.68'), (54, 'Collection A Design 12 Friends(Darker Pink Cat)', 4, '2/24/2018', '1.40', '1.68'), (55, 'Collection A Design 13 Smiley(Black)', 14, '2/24/2018', '1.40', '1.68'), (56, 'Collection A Design 13 Smiley(Grey)', 7, '2/24/2018', '1.40', '1.68'), (57, 'Collection A Design 13 Smiley(White)', 0, '2/24/2018', '1.40', '1.68'), (58, 'Collection A Design 13 Smiley(Pink)', 0, '2/24/2018', '1.40', '1.68'), (59, 'Collection A Design 13 Smiley(Beigh)', 2, '2/24/2018', '1.40', '1.68'), (60, 'Collection A Design 14 Puppies(Purple)', 11, '2/24/2018', '1.40', '1.68'), (61, 'Collection A Design 14 Puppies(Green)', 9, '2/24/2018', '1.40', '1.68'), (62, 'Collection A Design 14 Puppies(Pink)', 8, '2/24/2018', '1.40', '1.68'), (63, 'Collection A Design 14 Puppies(Blue)', 5, '2/24/2018', '1.40', '1.68'), (64, 'Collection A Design 14 Puppies(Grey)', 3, '2/24/2018', '1.40', '1.68'), (65, 'Collection A Design 15 Desserts(Sushi)', 1, '2/24/2018', '1.40', '1.68'), (66, 'Collection A Design 15 Desserts(Donut)', 8, '2/24/2018', '1.40', '1.68'), (67, 'Collection A Design 15 Desserts(Milk)', 0, '2/24/2018', '1.40', '1.68'), (68, 'Collection A Design 15 Desserts(Lemon)', 2, '2/24/2018', '1.40', '1.68'), (69, 'Collection A Design 16 Tsum Tsum(Mickey)', 5, '2/24/2018', '1.40', '1.68'), (70, 'Collection A Design 16 Tsum Tsum(Minnie)', 0, '2/24/2018', '1.40', '1.68'), (71, 'Collection A Design 16 Tsum Tsum(Winnie)', 54, '2/24/2018', '1.40', '1.68'), (72, 'Collection A Design 16 Tsum Tsum(Dumbo)', 51, '2/24/2018', '1.40', '1.68'), (73, 'Collection A Design 16 Tsum Tsum(Donald)', 59, '2/24/2018', '1.40', '1.68'), (74, 'Collection A Design 16 Tsum Tsum(Daisy)', 51, '2/24/2018', '1.40', '1.68'), (75, 'Collection A Design 17 Lil Animals(Grey Bear)', 27, '2/24/2018', '1.40', '1.68'), (76, 'Collection A Design 17 Lil Animals(Brown Bear)', 16, '2/24/2018', '1.40', '1.68'), (77, 'Collection A Design 17 Lil Animals(Pink)', 4, '2/24/2018', '1.40', '1.68'), (78, 'Collection A Design 17 Lil Animals(Yellow Chick)', 62, '2/24/2018', '1.40', '1.68'), (79, 'Collection A Design 18 Lil Animals 2(Black Bird)', 34, '2/24/2018', '1.40', '1.68'), (80, 'Collection A Design 18 Lil Animals 2(Brown Bear)', 29, '2/24/2018', '1.40', '1.68'), (81, 'Collection A Design 18 Lil Animals 2(Blue Bird)', 1, '2/24/2018', '1.40', '1.68'), (82, 'Collection A Design 18 Lil Animals 2(Yellow Chick Ear)', 78, '2/24/2018', '1.40', '1.68'), (83, 'Collection A Design 19 Rabbit(Blue Stripes)', 16, '2/24/2018', '1.40', '1.68'), (84, 'Collection A Design 19 Rabbit(Pink White Stripes)', 13, '2/24/2018', '1.40', '1.68'), (85, 'Collection A Design 19 Rabbit(Pink Dots)', 28, '2/24/2018', '1.40', '1.68'), (86, 'Collection A Design 20 Greedy Hands(Marcoons)', 13, '2/24/2018', '1.40', '1.68'), (87, 'Collection A Design 20 Greedy Hands(Drumstick)', 13, '2/24/2018', '1.40', '1.68'), (88, 'Collection A Design 20 Greedy Hands(Donut)', 10, '2/24/2018', '1.40', '1.68'), (89, 'Collection A Design 20 Greedy Hands(Pizza)', 2, '2/24/2018', '1.40', '1.68'), (90, 'Collection A Design 20 Greedy Hands(Cat Food)', 20, '2/24/2018', '1.40', '1.68'), (91, 'Collection B Design 1 Hungry Pets(Monkey)', 43, '2/24/2018', '1.40', '1.68'), (92, 'Collection B Design 1 Hungry Pets(Mouse)', 12, '2/24/2018', '1.40', '1.68'), (93, 'Collection B Design 1 Hungry Pets(Dog)', 9, '2/24/2018', '1.40', '1.68'), (94, 'Collection B Design 1 Hungry Pets(Rabbit)', 7, '2/24/2018', '1.40', '1.68'), (95, 'Collection B Design 1 Hungry Pets(Cat)', 3, '2/24/2018', '1.40', '1.68'), (96, 'Collection B Design 2 Sweet Things(Brown base Cactus)', 1, '2/24/2018', '1.40', '1.68'), (97, 'Collection B Design 2 Sweet Things(Watermelon Pink)', 0, '2/24/2018', '1.40', '1.68'), (98, 'Collection B Design 2 Sweet Things(Chick White)', 16, '2/24/2018', '1.40', '1.68'), (99, 'Collection B Design 2 Sweet Things(Elephant White)', 9, '2/24/2018', '1.40', '1.68'), (100, 'Collection B Design 3 Grumpy Kittens(Blue)', 2, '2/24/2018', '1.40', '1.68'), (101, 'Collection B Design 3 Grumpy Kittens(White)', 1, '2/24/2018', '1.40', '1.68'), (102, 'Collection B Design 3 Grumpy Kittens(Nude)', 8, '2/24/2018', '1.40', '1.68'), (103, 'Collection B Design 3 Grumpy Kittens(Pink)', 8, '2/24/2018', '1.40', '1.68'), (104, 'Collection B Design 3 Grumpy Kittens(Grey)', 17, '2/24/2018', '1.40', '1.68'), (105, 'Collection B Design 4 Grumpy Doggies(Grey)', 2, '2/24/2018', '1.40', '1.68'), (106, 'Collection B Design 4 Grumpy Doggies(Blue)', 12, '2/24/2018', '1.40', '1.68'), (107, 'Collection B Design 4 Grumpy Doggies(Pink)', 6, '2/24/2018', '1.40', '1.68'), (108, 'Collection B Design 4 Grumpy Doggies(White)', 3, '2/24/2018', '1.40', '1.68'), (109, 'Collection B Design 4 Grumpy Doggies(Brown)', 4, '2/24/2018', '1.40', '1.68'), (110, 'Collection B Design 5 Sheep(Blue)', 2, '2/24/2018', '1.40', '1.68'), (111, 'Collection B Design 5 Sheep(Green)', 15, '2/24/2018', '1.40', '1.68'), (112, 'Collection B Design 5 Sheep(Blue)', 7, '2/24/2018', '1.40', '1.68'), (113, 'Collection B Design 6 Milk Cow(Brown Cow)', 2, '2/24/2018', '1.40', '1.68'), (114, 'Collection B Design 6 Milk Cow(White Cow)', 4, '2/24/2018', '1.40', '1.68'), (115, 'Collection B Design 6 Milk Cow(Pink Cow)', 6, '2/24/2018', '1.40', '1.68'), (116, 'Collection B Design 7 Chicks(Pink)', 4, '2/24/2018', '1.40', '1.68'), (117, 'Collection B Design 7 Chicks(White)', 1, '2/24/2018', '1.40', '1.68'), (118, 'Collection B Design 7 Chicks(Grey)', 8, '2/24/2018', '1.40', '1.68'), (119, 'Collection B Design 8 Owls(Blue)', 4, '2/24/2018', '1.40', '1.68'), (120, 'Collection B Design 8 Owls(Pink)', 37, '2/24/2018', '1.40', '1.68'), (121, 'Collection B Design 8 Owls(White)', 23, '2/24/2018', '1.40', '1.68'), (122, 'Collection B Design 9 Animal Part II(Pink Fox)', 7, '2/24/2018', '1.40', '1.68'), (123, 'Collection B Design 9 Animal Part II(Brown Fox)', 9, '2/24/2018', '1.40', '1.68'), (124, 'Collection B Design 9 Animal Part II(Panda)', 10, '2/24/2018', '1.40', '1.68'), (125, 'Collection B Design 9 Animal Part II(Grey Dotted Fox)', 7, '2/24/2018', '1.40', '1.68'), (126, 'Collection B Design 10 Shocked(Brown Dog)', 22, '2/24/2018', '1.40', '1.68'), (127, 'Collection B Design 10 Shocked(Grey Cat)', 2, '2/24/2018', '1.40', '1.68'), (128, 'Collection B Design 10 Shocked(White Cat)', 7, '2/24/2018', '1.40', '1.68'), (129, 'Collection B Design 10 Shocked(Black Dog)', 12, '2/24/2018', '1.40', '1.68'), (130, 'Collection B Design 10 Shocked(Nude Dog)', 13, '2/24/2018', '1.40', '1.68'), (131, 'Collection B Design 11 Totoro(Brown)', 16, '2018-04-01', '1.40', '1.68'), (132, 'Collection B Design 11 Totoro(Grey)', 0, '2/24/2018', '1.40', '1.68'), (133, 'Collection B Design 11 Totoro(White)', 26, '2/24/2018', '1.40', '1.68'), (134, 'Collection B Design 12 Hello Panda(Blue)', 2, '2/24/2018', '1.40', '1.68'), (135, 'Collection B Design 12 Hello Panda(Grey)', 3, '2/24/2018', '1.40', '1.68'), (136, 'Collection B Design 12 Hello Panda(White)', 5, '2/24/2018', '1.40', '1.68'), (137, 'Collection B Design 13 Sesame Street(Green Face)', 4, '2/24/2018', '1.40', '1.68'), (138, 'Collection B Design 13 Sesame Street(Yellow Face)', 8, '2/24/2018', '1.40', '1.68'), (139, 'Collection B Design 13 Sesame Street(Blue Face)', 2, '2/24/2018', '1.40', '1.68'), (140, 'Collection B Design 13 Sesame Street(Elmo)', 1, '2/24/2018', '1.40', '1.68'), (141, 'Collection B Design 13 Sesame Street(Orange Face)', 8, '2/24/2018', '1.40', '1.68'), (142, 'Collection B Design 14 The Pears(Pink)', 8, '2/24/2018', '1.40', '1.68'), (143, 'Collection B Design 14 The Pears(White)', 2, '2/24/2018', '1.40', '1.68'), (144, 'Collection B Design 14 The Pears(Green)', 0, '2/24/2018', '1.40', '1.68'), (145, 'Collection B Design 15 Forest 2 (Grey sheep)', 2, '2/24/2018', '1.40', '1.68'), (146, 'Collection B Design 15 Forest 2 (Pink Rabbit)', 2, '2/24/2018', '1.40', '1.68'), (147, 'Collection B Design 15 Forest 2 (Brown Bear)', 3, '2/24/2018', '1.40', '1.68'), (148, 'Collection B Design 15 Forest 2 (Blue Rabbit)', 6, '2/24/2018', '1.40', '1.68'), (149, 'Collection B Design 15 Forest 2 (Small Goldfish)', 4, '2/24/2018', '1.40', '1.68'), (150, 'Collection B Design 16 Japan Design (BigGoldfish)', 1, '2/24/2018', '1.40', '1.68'), (151, 'Collection B Design 16 Japan Design (Fortune Cat)', 6, '2/24/2018', '1.40', '1.68'), (152, 'Collection B Design 16 Japan Design (Shui)', 5, '2/24/2018', '1.40', '1.68'), (153, 'Collection B Design 16 Japan Design (Sushi Fiesta)', 12, '2/24/2018', '1.40', '1.68'), (154, 'Collection B Design 17 Statement Socks (Stars)', 0, '2/24/2018', '1.40', '1.68'), (155, 'Collection B Design 17 Statement Socks (Death)', 1, '2/24/2018', '1.40', '1.68'), (156, 'Collection B Design 17 Statement Socks (Space)', 2, '2/24/2018', '1.40', '1.68'), (157, 'Collection B Design 17 Statement Socks (Hearts)', 1, '2/24/2018', '1.40', '1.68'), (158, 'Collection B Design 17 Statement Socks (Diamonds)', 1, '2/24/2018', '1.40', '1.68'), (159, 'Collection B Design 18 Pastel Kittens (Green)', 31, '2/24/2018', '1.40', '1.68'), (160, 'Collection B Design 18 Pastel Kittens (Pink)', 21, '2/24/2018', '1.40', '1.68'), (161, 'Collection B Design 18 Pastel Kittens (Blue)', 36, '2/24/2018', '1.40', '1.68'), (162, 'Collection B Design 19 Cupcakes (Blue Base)', 7, '2/24/2018', '1.40', '1.68'), (163, 'Collection B Design 19 Cupcakes (White Base Green Cake)', 14, '2/24/2018', '1.40', '1.68'), (164, 'Collection B Design 19 Cupcakes (Pink Base)', 8, '2/24/2018', '1.40', '1.68'), (165, 'Collection B Design 19 Cupcakes (White Base Pink Cake', 8, '2/24/2018', '1.40', '1.68'), (166, 'Collection B Design 20 Owls (Orange Owl)', 11, '2/24/2018', '1.40', '1.68'), (167, 'Collection B Design 20 Owls (Blue Owl)', 14, '2/24/2018', '1.40', '1.68'), (168, 'Collection B Design 20 Owls (Brown Owl Pink Base)', 7, '2/24/2018', '1.40', '1.68'), (169, 'Collection B Design 20 Owls (Pink Owl Grey Base)', 4, '2/24/2018', '1.40', '1.68'), (170, 'Collection B Design 20 Owls (GreenOwl)', 2, '2/24/2018', '1.40', '1.68'), (171, 'Collection C Design 1 Plushie (Grey)', 7, '2/24/2018', '1.40', '1.68'), (172, 'Collection C Design 1 Plushie (Dark Grey)', 12, '2/24/2018', '1.40', '1.68'), (173, 'Collection C Design 1 Plushie (Blue Face)', 6, '2/24/2018', '1.40', '1.68'), (174, 'Collection C Design 1 Plushie (Brown)', 0, '2/24/2018', '1.40', '1.68'), (175, 'Collection C Design 1 Plushie (Pink)', 10, '2/24/2018', '1.40', '1.68'), (176, 'Collection C Design 2 Melody x hello kitty (Melody)', 4, '2/24/2018', '1.40', '1.68'), (177, 'Collection C Design 2 Melody x hello kitty (Hello Kitty)', 2, '2/24/2018', '1.40', '1.68'), (178, 'Basic A Design 1 & 2 Women Invisable (Black)', 77, '2/24/2018', '1.40', '1.19'), (179, 'Basic A Design 1 & 2 Women Invisable (Grey)', 155, '2/24/2018', '1.40', '1.19'), (180, 'Basic A Design 1 & 2 Women Invisable (Green)', 14, '2/24/2018', '1.40', '1.19'), (181, 'Basic A Design 1 & 2 Women Invisable (Orange)', 22, '2/24/2018', '1.40', '1.19'), (182, 'Basic A Design 1 & 2 Women Invisable (Pink)', 55, '2/24/2018', '1.40', '1.19'), (183, 'Basic A Design 1 & 2 Women Invisable (Nude)', 146, '2/24/2018', '1.40', '1.19'), (184, 'Basic A Design 1 & 2 Women Invisable (Blue)', 17, '2/24/2018', '1.40', '1.19'), (185, 'Basic A Design 1 & 2 Women Invisable (White)', 4, '2/24/2018', '1.40', '1.19'), (186, 'Basic A Design 1 & 2 Women Invisable (Yellow)', 18, '2/24/2018', '1.40', '1.19'), (187, 'Basic A Design 1 & 2 Women Invisable (Hot Pink)', 18, '2/24/2018', '1.40', '1.19'), (188, 'Basic A Design 3 Basic Invisable (Grey)', 27, '2/24/2018', '1.40', '1.49'), (189, 'Basic A Design 3 Basic Invisable (Blue)', 30, '2/24/2018', '1.40', '1.49'), (190, 'Basic A Design 3 Basic Invisable (Black)', 1, '2/24/2018', '1.40', '1.49'), (191, 'Basic A Design 3 Basic Invisable (Dark Grey)', 28, '2/24/2018', '1.40', '1.49'), (192, 'Basic A Design 3 Basic Invisable (Brown)', 5, '2/24/2018', '1.40', '1.49'), (193, 'Basic A Design 4 Bamboo Short (Navy)', 32, '2/24/2018', '1.40', '1.49'), (194, 'Basic A Design 4 Bamboo Short (White)', 30, '2/24/2018', '1.40', '1.49'), (195, 'Basic A Design 4 Bamboo Short (Black)', 6, '2/24/2018', '1.40', '1.49'), (196, 'Basic A Design 4 Bamboo Short (Charcoal)', 22, '2/24/2018', '1.40', '1.49'), (197, 'Basic A Design 4 Bamboo Short (Grey)', 43, '2/24/2018', '1.40', '1.49'), (198, 'Basic A Design 5 - Bamboo Long (Navy Grey)', 18, '2/24/2018', '1.40', '1.68'), (199, 'Basic A Design 5 - Bamboo Long (Black)', 62, '2/24/2018', '1.40', '1.68'), (200, 'Basic A Design 5 - Bamboo Long (Light Grey)', 42, '2/24/2018', '1.40', '1.68'), (201, 'Basic A Design 5 - Bamboo Long (Navy)', 72, '2/24/2018', '1.40', '1.68'), (202, 'Basic A Design 5 - Bamboo Long (Charcoal)', 22, '2/24/2018', '1.40', '1.68'), (203, 'Basic A Design 6 Performance (Black)', 2, '2/24/2018', '1.40', '1.68'), (204, 'Basic A Design 6 Performance (Maroon)', 14, '2/24/2018', '1.40', '1.68'), (205, 'Basic A Design 6 Performance (Yellow)', 18, '2/24/2018', '1.40', '1.68'), (206, 'Basic A Design 6 Performance (Green)', 16, '2/24/2018', '1.40', '1.68'), (207, 'Basic A Design 6 Performance (Blue)', 1, '2/24/2018', '1.40', '1.68'), (208, 'Basic A Design 7 Sleeping Socks (Dark Green)', 26, '2/24/2018', '1.40', '1.68'), (209, 'Basic A Design 7 Sleeping Socks (Purple)', 11, '2/24/2018', '1.40', '1.68'), (210, 'Basic A Design 7 Sleeping Socks (Green)', 31, '2/24/2018', '1.40', '1.68'), (211, 'Basic A Design 7 Sleeping Socks (Pink)', 20, '2/24/2018', '1.40', '1.68'), (212, 'Basic A Design 7 Sleeping Socks (Orange)', 26, '2/24/2018', '1.40', '1.68'), (213, 'Basic A Design 8 Basic Colors (Pink)', 6, '2/24/2018', '1.40', '1.68'), (214, 'Basic A Design 8 Basic Colors (Black)', 8, '2/24/2018', '1.40', '1.68'), (215, 'Basic A Design 8 Basic Colors (Yellow)', 2, '2/24/2018', '1.40', '1.68'), (216, 'Basic A Design 8 Basic Colors (Grey)', 1, '2/24/2018', '1.40', '1.68'), (217, 'Basic A Design 8 Basic Colors (Green)', 5, '2/24/2018', '1.40', '1.68'), (218, 'Basic A Design 8 Basic Colors (Nude)', 1, '2/24/2018', '1.40', '1.68'), (219, 'Basic A Design 8 Basic Colors (White)', 4, '2/24/2018', '1.40', '1.68'), (220, 'Basic A Design 9 Stripes (White stripe)', 3, '2/24/2018', '1.40', '0.79'), (221, 'Basic A Design 9 Stripes (Blue stripe)', 9, '2/24/2018', '1.40', '0.79'), (222, 'Basic A Design 9 Stripes (Red Black stripe)', 10, '2/24/2018', '1.40', '0.79'), (223, 'Basic A Design 9 Stripes (Black stripe)', 13, '2/24/2018', '1.40', '0.79'), (224, 'Basic A Design 10 Sports (Navy)', 10, '2/24/2018', '1.40', '1.49'), (225, 'Basic A Design 10 Sports (Turqious)', 18, '2/24/2018', '1.40', '1.49'), (226, 'Basic A Design 10 Sports (Orange)', 4, '2/24/2018', '1.40', '1.49'), (227, 'Basic A Design 10 Sports (Green)', 26, '2/24/2018', '1.40', '1.49'), (228, 'Basic A Design 10 Sports (Maroon)', 24, '2/24/2018', '1.40', '1.49'), (229, 'Basic A Design 11 Boat Socks (Grey)', 2, '2/24/2018', '1.40', '1.49'), (230, 'Basic A Design 11 Boat Socks (Navy)', 1, '2/24/2018', '1.40', '1.49'), (231, 'Basic A Design 11 Boat Socks (White)', 14, '2/24/2018', '1.40', '1.49'), (232, 'Basic A Design 11 Boat Socks (Charcoal)', 4, '2/24/2018', '1.40', '1.49'), (233, 'Basic A Design 11 Boat Socks (Black)', 1, '2/24/2018', '1.40', '1.49'), (234, 'Basic A Design 12 Toe Socks (White)', 8, '2/24/2018', '1.40', '1.68'), (235, 'Basic A Design 12 Toe Socks (Grey)', 4, '2/24/2018', '1.40', '1.68'), (236, 'Basic A Design 12 Toe Socks (Charcoal)', 8, '2/24/2018', '1.40', '1.68'), (237, 'Basic A Design 12 Toe Socks (Dark Grey)', 2, '2/24/2018', '1.40', '1.68'), (238, 'Basic A Design 12 Toe Socks (Navy)', 2, '2/24/2018', '1.40', '1.68'), (239, 'Basic A Design 12 Toe Socks (Black)', 9, '2/24/2018', '1.40', '1.68'), (240, 'Basic A Design 13 2 Tones (Navy Red Heel)', 3, '2/24/2018', '1.40', '1.68'), (241, 'Basic A Design 13 2 Tones (Grey Blue Heel)', 9, '2/24/2018', '1.40', '1.68'), (242, 'Basic A Design 13 2 Tones (White Red Heel)', 6, '2/24/2018', '1.40', '1.68'), (243, 'Basic A Design 13 2 Tones (Navy White Heel)', 1, '2/24/2018', '1.40', '1.68'), (244, 'Basic A Design 13 2 Tones (Charcoal Grey Heel)', 1, '2/24/2018', '1.40', '1.68'), (245, 'Basic A Design 14 Strippy (Navy)', 3, '2/24/2018', '1.40', '1.68'), (246, 'Basic A Design 14 Strippy (Charcoal)', 25, '2/24/2018', '1.40', '1.68'), (247, 'Basic A Design 14 Strippy (Yellow)', 2, '2/24/2018', '1.40', '1.68'), (248, 'Basic A Design 14 Strippy (Red)', 1, '2/24/2018', '1.40', '1.68'), (249, 'Basic A Design 14 Strippy (Black)', 36, '2/24/2018', '1.40', '1.68'), (250, 'Basic A Design 15 Multi Stripes Ankle (Black)', 2, '2/24/2018', '1.40', '1.68'), (251, 'Basic A Design 15 Multi Stripes Ankle (Green)', 8, '2/24/2018', '1.40', '1.68'), (252, 'Basic A Design 15 Multi Stripes Ankle (Grey)', 4, '2/24/2018', '1.40', '1.68'), (253, 'Basic A Design 15 Multi Stripes Ankle (Brown)', 7, '2/24/2018', '1.40', '1.68'), (254, 'Basic A Design 15 Multi Stripes Ankle (Red)', 3, '2/24/2018', '1.40', '1.68'), (255, 'Basic A Design 16 2 Stripes (Black)', 1, '2/24/2018', '1.40', '1.68'), (256, 'Basic A Design 16 2 Stripes (White)', 1, '2/24/2018', '1.40', '1.68'), (257, 'Basic A Design 16 2 Stripes (Blue)', 17, '2/24/2018', '1.40', '1.68'), (258, 'Basic A Design 16 2 Stripes (Brown)', 19, '2/24/2018', '1.40', '1.68'), (259, 'Basic A Design 16 2 Stripes (Pink)', 12, '2/24/2018', '1.40', '1.68'), (260, 'Basic A Design 17 Lines (Red Lines)', 39, '2/24/2018', '1.40', '1.49'), (261, 'Basic A Design 17 Lines (Grey Lines)', 24, '2/24/2018', '1.40', '1.49'), (262, 'Basic A Design 17 Lines (Blue Lines)', 29, '2/24/2018', '1.40', '1.49'), (263, 'Basic A Design 17 Lines (Green Lines)', 36, '2/24/2018', '1.40', '1.49'), (264, 'Basic A Design 18 3 Bars (Black)', 71, '2/24/2018', '1.40', '1.49'), (265, 'Basic A Design 18 3 Bars (Grey)', 95, '2/24/2018', '1.40', '1.49'), (266, 'Basic A Design 18 3 Bars (White)', 86, '2/24/2018', '1.40', '1.49'), (267, 'Basic A Design 19 Happy Ankle Socks (White)', 36, '2/24/2018', '1.40', '1.49'), (268, 'Basic A Design 19 Happy Ankle Socks (Grey)', 30, '2/24/2018', '1.40', '1.49'), (269, 'Basic A Design 19 Happy Ankle Socks (Pink)', 31, '2/24/2018', '1.40', '1.49'), (270, 'Basic A Design 19 Happy Ankle Socks (Light Blue)', 35, '2/24/2018', '1.40', '1.49'), (271, 'Basic A Design 20 Triples (Black base)', 1, '2/24/2018', '1.40', '1.68'), (272, 'Basic A Design 20 Triples (Recycle base)', 6, '2/24/2018', '1.40', '1.68'), (273, 'Basic A Design 20 Triples (Grey base)', 14, '2/24/2018', '1.40', '1.68'), (274, 'Basic A Design 20 Triples (Maroonbase)', 1, '2/24/2018', '1.40', '1.68'), (275, 'Basic A Design 20 Triples (Whitebase)', 3, '2/24/2018', '1.40', '1.68'), (276, 'Basic A Design 20 Triples (Blue base)', 2, '2/24/2018', '1.40', '1.68'), (277, 'Basic B Design 1 Thin Stripes (Blue lines)', 11, '2/24/2018', '1.40', '1.68'), (278, 'Basic B Design 1 Thin Stripes (Maroon lines)', 8, '2/24/2018', '1.40', '1.68'), (279, 'Basic B Design 1 Thin Stripes (Green lines)', 10, '2/24/2018', '1.40', '1.68'), (280, 'Basic B Design 1 Thin Stripes (Black lines)', 10, '2/24/2018', '1.40', '1.68'), (281, 'Basic B Design 1 Thin Stripes (Brown lines)', 11, '2/24/2018', '1.40', '1.68'), (282, 'Basic B Design 2 Street Rainbows (Black)', 1, '2/24/2018', '1.40', '1.68'), (283, 'Basic B Design 2 Street Rainbows (White)', 1, '2/24/2018', '1.40', '1.68'), (284, 'Basic B Design 2 Street Rainbows (Grey)', 2, '2/24/2018', '1.40', '1.68'), (285, 'Basic B Design 3 Sleeping Socks 2 (Blue Base)', 7, '2/24/2018', '1.40', '1.68'), (286, 'Basic B Design 3 Sleeping Socks 2 (Yellow Base)', 7, '2/24/2018', '1.40', '1.68'), (287, 'Basic B Design 3 Sleeping Socks 2 (Red Base)', 8, '2/24/2018', '1.40', '1.68'), (288, 'Basic B Design 3 Sleeping Socks 2 (Green Base)', 9, '2/24/2018', '1.40', '1.68'), (289, 'Basic B Design 3 Sleeping Socks 2 (Pink Base)', 10, '2/24/2018', '1.40', '1.68'), (290, 'Basic B Design 4 Thick Stripes (Blue Stripes)', 0, '2/24/2018', '1.40', '1.68'), (291, 'Basic B Design 4 Thick Stripes (GreenStripes)', 0, '2/24/2018', '1.40', '1.68'), (292, 'Basic B Design 4 Thick Stripes (Brown Stripes)', 0, '2/24/2018', '1.40', '1.68'), (293, 'Basic B Design 4 Thick Stripes (Black Stripes)', 0, '2/24/2018', '1.40', '1.68'), (294, 'Basic B Design 4 Thick Stripes (Red Stripes)', 0, '2/24/2018', '1.40', '1.68'), (295, 'Basic B Design 5 Street Stripes (Green Red)', 0, '2/24/2018', '1.40', '1.68'), (296, 'Basic B Design 5 Street Stripes (Blue Red)', 0, '2/24/2018', '1.40', '1.68'), (297, 'Basic B Design 5 Street Stripes (Black Black)', 0, '2/24/2018', '1.40', '1.68'), (298, 'Basic B Design 5 Street Stripes (Red White)', 0, '2/24/2018', '1.40', '1.68'), (299, 'Basic B Design 5 Street Stripes (White White)', 0, '2/24/2018', '1.40', '1.68'), (300, 'Baby A Design 1 Baby animal (Chicks)', 7, '2/24/2018', '1.40', '1.68'), (301, 'Baby A Design 1 Baby animal (Walrus)', 19, '2/24/2018', '1.40', '1.68'), (302, 'Baby A Design 1 Baby animal (Seal)', 3, '2/24/2018', '1.40', '1.68'), (303, 'Baby A Design 1 Baby animal (White polar bear)', 0, '2/24/2018', '1.40', '1.68'), (304, 'Baby A Design 1 Baby animal (Pig)', 19, '2/24/2018', '1.40', '1.68'), (305, 'Baby A Design 1 Baby animal (Monkey)', 7, '2/24/2018', '1.40', '1.68'), (306, 'Baby A Design 1 Baby animal (Tiger)', 4, '2/24/2018', '1.40', '1.68'), (307, 'Baby A Design 1 Baby animal (Green Duck)', 24, '2/24/2018', '1.40', '1.68'), (308, 'Baby A Design 2 Paw Prints (Pink)', 12, '2/24/2018', '1.40', '1.68'), (309, 'Baby A Design 2 Paw Prints (Grey)', 15, '2/24/2018', '1.40', '1.68'), (310, 'Baby A Design 3 Girl/Boy (Girl)', 1, '2/24/2018', '1.40', '1.68'), (311, 'Baby A Design 3 Girl/Boy (Boy)', 3, '2/24/2018', '1.40', '1.68'), (312, 'Baby A Design 4 Bear Socks (Grey Bear)', 3, '2/24/2018', '1.40', '1.68'), (313, 'Baby A Design 4 Bear Socks (White Bear)', 1, '2/24/2018', '1.40', '1.68'), (314, 'Baby A Design 4 Bear Socks (Pink Owl)', 16, '2/24/2018', '1.40', '1.68'), (315, 'Baby A Design 5 Baby Multi Hearts (Light grey panda)', 15, '2/24/2018', '1.40', '1.68'), (316, 'Baby A Design 5 Baby Multi Hearts (Dark Grey fox)', 13, '2/24/2018', '1.40', '1.68'), (317, 'Baby A Design 5 Baby Multi Hearts (White red ears)', 14, '2/24/2018', '1.40', '1.68'), (318, 'Baby A Design 5 Baby Multi Hearts (Light grey bear)', 19, '2/24/2018', '1.40', '1.68'), (319, 'Baby A Design 5 Baby Multi Hearts (Brown Dog)', 19, '2/24/2018', '1.40', '1.68'), (320, 'Baby A Design 6 Winter (Polar Bear)', 3, '2/24/2018', '1.40', '1.68'), (321, 'Baby A Design 6 Winter (Penguine)', 2, '2/24/2018', '1.40', '1.68'), (322, 'Baby A Design 6 Winter (Fox)', 2, '2/24/2018', '1.40', '1.68'), (323, 'Baby A Design 7 Big Eyes (Blue Yellow Nose)', 19, '2/24/2018', '1.40', '1.68'), (324, 'Baby A Design 7 Big Eyes (Grey Red Nose)', 20, '2/24/2018', '1.40', '1.68'), (325, 'Baby A Design 7 Big Eyes (Yellow Orange Nose)', 19, '2/24/2018', '1.40', '1.68'), (326, 'Baby A Design 7 Big Eyes (Pink Yellow Nose)', 21, '2/24/2018', '1.40', '1.68'), (327, 'Baby A Design 7 Big Eyes (Blue no nose)', 18, '2/24/2018', '1.40', '1.68'), (328, 'Baby A Design 8 Paw II (Grey Paws)', 11, '2/24/2018', '1.40', '1.68'), (329, 'Baby A Design 8 Paw II (Brown Paws)', 11, '2/24/2018', '1.40', '1.68'), (330, 'Baby A Design 9 Baby Pandas (Blue Stripes)', 17, '2/24/2018', '1.40', '1.68'), (331, 'Baby A Design 9 Baby Pandas (Dots)', 18, '2/24/2018', '1.40', '1.68'), (332, 'Baby A Design 9 Baby Pandas (Plain)', 19, '2/24/2018', '1.40', '1.68'), (333, 'Baby A Design 9 Baby Pandas (Red thin stripes)', 17, '2/24/2018', '1.40', '1.68'), (334, 'Baby A Design 9 Baby Pandas (Grey stripes)', 14, '2/24/2018', '1.40', '1.68'), (335, 'Baby A Design 10 Baby Line alike (Yellow)', 6, '2/24/2018', '1.40', '1.68'), (336, 'Baby A Design 10 Baby Line alike (Green)', 8, '2/24/2018', '1.40', '1.68'), (337, 'Baby A Design 10 Baby Line alike (Blue)', 11, '2/24/2018', '1.40', '1.68'), (338, 'Baby A Design 10 Baby Line alike (Grey)', 5, '2/24/2018', '1.40', '1.68'), (339, 'Baby A Design 10 Baby Line alike (Pink)', 10, '2/24/2018', '1.40', '1.68'), (340, 'Baby A Design 11 Rabbit (Pink)', 4, '2/24/2018', '1.40', '1.68'), (341, 'Baby A Design 11 Rabbit (Green)', 5, '2/24/2018', '1.40', '1.68'), (342, 'Baby A Design 12 heros (Grey)', 0, '2/24/2018', '1.40', '1.68'), (343, 'Baby A Design 12 heros (Blue)', 0, '2/24/2018', '1.40', '1.68'), (344, 'Baby A Design 12 heros (White)', 0, '2/24/2018', '1.40', '1.68'), (345, 'Baby A Design 12 heros (Pink)', 6, '2/24/2018', '1.40', '1.68'), (346, 'Baby A Design 12 heros (Green)', 0, '2/24/2018', '1.40', '1.68'), (347, 'Baby A Design 12 heros (Orange)', 4, '2/24/2018', '1.40', '1.68'), (348, 'Baby A Design 12 heros (Red)', 0, '2/24/2018', '1.40', '1.68'), (349, 'Baby A Design 13 Animal Head (Pink)', 3, '2/24/2018', '1.40', '1.68'), (350, 'Baby A Design 13 Animal Head (Brown)', 1, '2/24/2018', '1.40', '1.68'), (351, 'Baby A Design 13 Animal Head (Grey)', 4, '2/24/2018', '1.40', '1.68'), (352, 'Baby A Design 14 Plushie Line alike (Pink Heart shape face)', 16, '2/24/2018', '1.40', '1.68'), (353, 'Baby A Design 14 Plushie Line alike (Grey Mouse)', 20, '2/24/2018', '1.40', '1.68'), (354, 'Baby A Design 14 Plushie Line alike (Blue Mouse)', 13, '2/24/2018', '1.40', '1.68'), (355, 'Baby A Design 14 Plushie Line alike (White Rabbit)', 17, '2/24/2018', '1.40', '1.68'), (356, 'Baby A Design 14 Plushie Line alike (Brown Bear)', 0, '2/24/2018', '1.40', '1.68'), (357, 'Baby A Design 15 Baby Zoo (Pink Koala)', 2, '2/24/2018', '1.40', '1.68'), (358, 'Baby A Design 15 Baby Zoo (White cat)', 2, '2/24/2018', '1.40', '1.68'), (359, 'Baby A Design 15 Baby Zoo (Penguine)', 1, '2/24/2018', '1.40', '1.68'), (360, 'Baby A Design 15 Baby Zoo (Panda)', 2, '2/24/2018', '1.40', '1.68'), (361, 'Baby A Design 16 Character Invisible (Hello Kitty Pink) ', 3, '2/24/2018', '1.40', '1.68'), (362, 'Baby A Design 16 Character Invisible (Hello Kitty White)', 2, '2/24/2018', '1.40', '1.68'), (363, 'Baby A Design 16 Character Invisible (Snoopy Yellow)', 7, '2/24/2018', '1.40', '1.68'), (364, 'Baby A Design 16 Character Invisible (Winnie)', 3, '2/24/2018', '1.40', '1.68'), (365, 'Baby A Design 16 Character Invisible (Mickey)', 3, '2/24/2018', '1.40', '1.68'), (366, 'Baby A Design 16 Character Invisible (Snoopy Blue)', 3, '2/24/2018', '1.40', '1.68'), (367, 'Baby A Design 17 Baby Polka Dots (Grey)', 36, '2/24/2018', '1.40', '1.68'), (368, 'Baby A Design 17 Baby Polka Dots (Blue)', 29, '2/24/2018', '1.40', '1.68'), (369, 'Baby A Design 17 Baby Polka Dots (Brown)', 39, '2/24/2018', '1.40', '1.68'), (370, 'Baby A Design 17 Baby Polka Dots (Orange)', 31, '2/24/2018', '1.40', '1.68'), (371, 'Baby A Design 17 Baby Polka Dots (Red)', 23, '2/24/2018', '1.40', '1.68'), (372, 'Baby A Design 18 Baby Bull Dog (Grey)', 37, '2/24/2018', '1.40', '1.68'), (373, 'Baby A Design 18 Baby Bull Dog (Brown)', 38, '2/24/2018', '1.40', '1.68'), (374, 'Baby A Design 18 Baby Bull Dog (Green Lines)', 39, '2/24/2018', '1.40', '1.68'), (375, 'Baby A Design 18 Baby Bull Dog (Orange)', 38, '2/24/2018', '1.40', '1.68'), (376, 'Baby A Design 18 Baby Bull Dog (Red)', 36, '2/24/2018', '1.40', '1.68'), (377, 'Baby A Design 19 Baby Kittens (Brown)', 38, '2/24/2018', '1.40', '1.68'), (378, 'Baby A Design 19 Baby Kittens (Grey)', 36, '2/24/2018', '1.40', '1.68'), (379, 'Baby A Design 19 Baby Kittens (Pink)', 30, '2/24/2018', '1.40', '1.68'), (380, 'Baby A Design 19 Baby Kittens (White)', 35, '2/24/2018', '1.40', '1.68'), (381, 'Baby A Design 19 Baby Kittens (Dark Grey)', 35, '2/24/2018', '1.40', '1.68'), (382, 'Baby A Design 20 Baby Lines (Grey)', 35, '2/24/2018', '1.40', '1.68'), (383, 'Baby A Design 20 Baby Lines (Pink)', 30, '2/24/2018', '1.40', '1.68'), (384, 'Baby A Design 20 Baby Lines (White)', 32, '2/24/2018', '1.40', '1.68'), (385, 'Baby A Design 20 Baby Lines (Yellow)', 36, '2/24/2018', '1.40', '1.68'), (386, 'Baby A Design 20 Baby Lines (Blue)', 31, '2/24/2018', '1.40', '1.68'), (387, 'Baby B Design 1 Urban Baby (Yellow)', 39, '2/24/2018', '1.40', '1.68'), (388, 'Baby B Design 1 Urban Baby (Navy)', 39, '2/24/2018', '1.40', '1.68'), (389, 'Baby B Design 1 Urban Baby (Grey)', 39, '2/24/2018', '1.40', '1.68'), (390, 'Baby B Design 1 Urban Baby (White)', 38, '2/24/2018', '1.40', '1.68'), (391, 'Baby B Design 1 Urban Baby (Brown)', 39, '2/24/2018', '1.40', '1.68'), (392, 'Baby B Design 2 Happy 3 friends baby (Pink Bear)', 10, '2/24/2018', '1.40', '1.68'), (393, 'Baby B Design 2 Happy 3 friends baby (Yellow Chick)', 11, '2/24/2018', '1.40', '1.68'), (394, 'Baby B Design 2 Happy 3 friends baby (Sleeping bird)', 10, '2/24/2018', '1.40', '1.68'), (395, 'Baby B Design 3 Happy 3 friends baby II (White Cat)', 11, '2/24/2018', '1.40', '1.68'), (396, 'Baby B Design 3 Happy 3 friends baby II (Yellow Fox)', 8, '2/24/2018', '1.40', '1.68'), (397, 'Baby B Design 3 Happy 3 friends baby II (Penguine)', 6, '2/24/2018', '1.40', '1.68'), (398, 'Design A Polka Candy (Pink)', 5, '2/24/2018', '1.40', '1.68'), (399, 'Design A Polka Candy (Blue)', 1, '2/24/2018', '1.40', '1.68'), (400, 'Design A Polka Candy (White)', 1, '2/24/2018', '1.40', '1.68'), (401, 'Design A Polka Candy (Nude)', 13, '2/24/2018', '1.40', '1.68'), (402, 'Design B Sanrio (Pink)', 7, '2/24/2018', '1.40', '1.68'), (403, 'Design B Sanrio (White)', 5, '2/24/2018', '1.40', '1.68'), (404, 'Design B Sanrio (Yellow)', 7, '2/24/2018', '1.40', '1.68'), (405, 'Design C Sexy Lips (Blue)', 26, '2/24/2018', '1.40', '1.68'), (406, 'Design C Sexy Lips (Nude)', 3, '2/24/2018', '1.40', '1.68'), (407, 'Design C Sexy Lips (Dark Blue)', 1, '2/24/2018', '1.40', '1.68'), (408, 'Design C Sexy Lips (White)', 5, '2/24/2018', '1.40', '1.68'), (409, 'Design C Sexy Lips (Pink)', 0, '2/24/2018', '1.40', '1.68'), (410, 'Design D (2 stripes shopee) The Babies (Frog)', 7, '2/24/2018', '1.40', '1.68'), (411, 'Design D (2 stripes shopee) The Babies (Panda)', 1, '2/24/2018', '1.40', '1.68'), (412, 'Design D (2 stripes shopee) The Babies (Bear)', 0, '2/24/2018', '1.40', '1.68'), (413, 'Design D (2 stripes shopee) The Babies (Rabbit)', 1, '2/24/2018', '1.40', '1.68'), (414, 'Design D (2 stripes shopee) The Babies (Chick)', 2, '2/24/2018', '1.40', '1.68'), (415, 'Design E Pineapples Party (Pink)', 2, '2/24/2018', '1.40', '1.68'), (416, 'Design E Pineapples Party (Blue)', 1, '2/24/2018', '1.40', '1.68'), (417, 'Design E Pineapples Party (White)', 1, '2/24/2018', '1.40', '1.68'), (418, 'Design F Hearts Ankle (Grey)', 3, '2/24/2018', '1.40', '1.68'), (419, 'Design F Hearts Ankle (Pink)', 3, '2/24/2018', '1.40', '1.68'), (420, 'Design F Hearts Ankle (Black)', 2, '2/24/2018', '1.40', '1.68'), (421, 'Design F Hearts Ankle (White)', 1, '2/24/2018', '1.40', '1.68'), (422, 'Design F Hearts Ankle (Nude)', 2, '2/24/2018', '1.40', '1.68'), (423, 'Design G Hearts in the air (Polka Dot)', 33, '2/24/2018', '1.40', '1.68'), (424, 'Design G Hearts in the air (Grey white stripes)', 25, '2/24/2018', '1.40', '1.68'), (425, 'Design G Hearts in the air (2 stripes white base)', 31, '2/24/2018', '1.40', '1.68'), (426, 'Design G Hearts in the air (2 stripes black back)', 5, '2/24/2018', '1.40', '1.68'), (427, 'Design G Hearts in the air ( Multi Stripes White base)', 29, '2/24/2018', '1.40', '1.68'), (428, 'Design H Flamingo & Friends (Blue)', 38, '2/24/2018', '1.40', '1.68'), (429, 'Design H Flamingo & Friends (Nude)', 2, '2/24/2018', '1.40', '1.68'), (430, 'Design H Flamingo & Friends (White)', 23, '2/24/2018', '1.40', '1.68'), (431, 'Design H Flamingo & Friends (Pink)', 15, '2/24/2018', '1.40', '1.68'), (432, 'Design H Flamingo & Friends (Black)', 29, '2/24/2018', '1.40', '1.68'), (433, 'Design I Butt up (Nude)', 0, '2/24/2018', '1.40', '1.68'), (434, 'Design I Butt up (White Panda)', 2, '2/24/2018', '1.40', '1.68'), (435, 'Design I Butt up (White Rabbit)', 10, '2/24/2018', '1.40', '1.68'), (436, 'Design J: Mini Zoo Emoji (Duck)', 18, '2/24/2018', '1.40', '1.68'), (437, 'Design J: Mini Zoo Emoji (Giraffe)', 9, '2/24/2018', '1.40', '1.68'), (438, 'Design J: Mini Zoo Emoji (Pony)', 1, '2/24/2018', '1.40', '1.68'), (439, 'Design J: Mini Zoo Emoji (Whale)', 5, '2/24/2018', '1.40', '1.68'), (440, 'Design J: Mini Zoo Emoji (Croc)', 17, '2/24/2018', '1.40', '1.68'), (441, 'Design K: Spongebob & Friends (Spongebob)', 1, '2/24/2018', '1.40', '1.68'), (442, 'Design K: Spongebob & Friends (Big nose)', 0, '2/24/2018', '1.40', '1.68'), (443, 'Design K: Spongebob & Friends (Patrick)', 1, '2/24/2018', '1.40', '1.68'), (444, 'Design K: Spongebob & Friends (Crab)', 6, '2/24/2018', '1.40', '1.68'), (445, 'Design K: Spongebob & Friends (Hamster)', 10, '2/24/2018', '1.40', '1.68'), (446, 'Design I: Long totoro (Black)', 2, '2/24/2018', '1.40', '1.68'), (447, 'Design I: Long totoro (Brown)', 8, '2/24/2018', '1.40', '1.68'), (448, 'Design I: Long totoro (Grey)', 2, '2/24/2018', '1.40', '1.68'), (449, 'Design I: Long totoro (White)', 2, '2/24/2018', '1.40', '1.68'), (450, 'Design I: Long totoro (Blue)', 1, '2/24/2018', '1.40', '1.68'), (451, 'Design M: Cute Icons (Brown)', 8, '2/24/2018', '1.40', '1.68'), (452, 'Design M: Cute Icons (Nude)', 33, '2/24/2018', '1.40', '1.68'), (453, 'Design M: Cute Icons (White)', 29, '2/24/2018', '1.40', '1.68'), (454, 'Design M: Cute Icons (Grey)', 13, '2/24/2018', '1.40', '1.68'), (455, 'Design M: Cute Icons (Black)', 0, '2/24/2018', '1.40', '1.68'), (456, 'Design N: Mono Expression (Brown)', 6, '2/24/2018', '1.40', '1.68'), (457, 'Design N: Mono Expression (Nude)', 2, '2/24/2018', '1.40', '1.68'), (458, 'Design N: Mono Expression (White)', 6, '2/24/2018', '1.40', '1.68'), (459, 'Design N: Mono Expression (Grey)', 12, '2/24/2018', '1.40', '1.68'), (460, 'Design N: Mono Expression (Black)', 10, '2/24/2018', '1.40', '1.68'), (461, 'Design O Pastel Birds (Grey)', 5, '2/24/2018', '1.40', '1.68'), (462, 'Design O Pastel Birds (Pink)', 11, '2/24/2018', '1.40', '1.68'), (463, 'Design O Pastel Birds (Blue)', 9, '2/24/2018', '1.40', '1.68'), (464, 'Design O Pastel Birds (Green)', 11, '2/24/2018', '1.40', '1.68'), (465, 'Design P: Around The world (Star Monkey)', 12, '2/24/2018', '1.40', '1.68'), (466, 'Design P: Around The world (Dots Panda)', 13, '2/24/2018', '1.40', '1.68'), (467, 'Design P: Around The world (Paw Cat)', 9, '2/24/2018', '1.40', '1.68'), (468, 'Design P: Around The world (Hearts Pig)', 3, '2/24/2018', '1.40', '1.68'), (469, 'Design P: Around The world (Paw Dog)', 17, '2/24/2018', '1.40', '1.68'), (470, 'Design Q: Happy 5 friends (Chick)', 2, '2/24/2018', '1.40', '1.68'), (471, 'Design Q: Happy 5 friends (Polar)', 0, '2/24/2018', '1.40', '1.68'), (472, 'Design Q: Happy 5 friends (Dog)', 5, '2/24/2018', '1.40', '1.68'), (473, 'Design Q: Happy 5 friends (Sheep)', 2, '2/24/2018', '1.40', '1.68'), (474, 'Design Q: Happy 5 friends (Pig)', 2, '2/24/2018', '1.40', '1.68'), (475, 'Design R: Candies World (Pastel Rainbow)', 2, '2/24/2018', '1.40', '1.68'), (476, 'Design R: Candies World (Bright Rainbow)', 5, '2/24/2018', '1.40', '1.68'), (477, 'Design S Heart Beats (Black base red heart)', 3, '2/24/2018', '1.40', '1.68'), (478, 'Design S Heart Beats (White base pink heart)', 11, '2/24/2018', '1.40', '1.68'), (479, 'Design S Heart Beats (Nude base dark red heart)', 1, '2/24/2018', '1.40', '1.68'), (480, 'Design S Heart Beats (White base black heart)', 2, '2/24/2018', '1.40', '1.68'), (481, 'Design S Heart Beats (Grey base red heart)', 3, '2/24/2018', '1.40', '1.68'), (482, 'Design S Heart Beats (White base red heart)', 1, '2/24/2018', '1.40', '1.68'), (483, 'Design T Panda Friends (Thin Stripes)', 29, '2/24/2018', '1.40', '1.68'), (484, 'Design T Panda Friends (Polka Dots)', 18, '2/24/2018', '1.40', '1.68'), (485, 'Design T Panda Friends (Plain)', 34, '2/24/2018', '1.40', '1.68'), (486, 'Design T Panda Friends (Thick Stripes)', 32, '2/24/2018', '1.40', '1.68'), (487, 'Gentlemen A Design 1 Argyle (Grey)', 17, '2/24/2018', '1.40', '3.25'), (488, 'Gentlemen A Design 1 Argyle (Charcoal)', 0, '2/24/2018', '1.40', '3.25'), (489, 'Gentlemen A Design 1 Argyle (Navy)', 11, '2/24/2018', '1.40', '3.25'), (490, 'Gentlemen A Design 1 Argyle (Black)', 36, '2/24/2018', '1.40', '3.25'), (491, 'Gentlemen A Design 2 Basic (Dark Grey)', 2, '2/24/2018', '1.40', '2.25'), (492, 'Gentlemen A Design 2 Basic (Blue)', 0, '2/24/2018', '1.40', '2.25'), (493, 'Gentlemen A Design 2 Basic (Maroon)', 0, '2/24/2018', '1.40', '2.25'), (494, 'Gentlemen A Design 2 Basic (Green)', 13, '2/24/2018', '1.40', '2.25'), (495, 'Gentlemen A Design 2 Basic (Brown)', 1, '2/24/2018', '1.40', '2.25'), (496, 'Gentlemen A Design 3 Urban (Dark Grey)', 2, '2/24/2018', '1.40', '3.25'), (497, 'Gentlemen A Design 3 Urban (Charcoal)', 3, '2/24/2018', '1.40', '3.25'), (498, 'Gentlemen A Design 3 Urban (Light Grey)', 7, '2/24/2018', '1.40', '3.25'), (499, 'Gentlemen A Design 3 Urban (D Nude)', 1, '2/24/2018', '1.40', '3.25'), (500, 'Gentlemen A Design 3 Urban (Navy)', 0, '2/24/2018', '1.40', '3.25'), (501, 'Gentlemen A Design 4 Essential (Blue)', 2, '2/24/2018', '1.40', '3.25'), (502, 'Gentlemen A Design 4 Essential (White)', 2, '2/24/2018', '1.40', '3.25'), (503, 'Gentlemen A Design 4 Essential (Charcoal)', 2, '2/24/2018', '1.40', '3.25'), (504, 'Gentlemen A Design 4 Essential (Grey)', 0, '2/24/2018', '1.40', '3.25'), (505, 'Gentlemen A Design 4 Essential (Navy)', 0, '2/24/2018', '1.40', '3.25'), (506, 'Gentlemen A Design 5 Stripes (Grey Top)', 7, '2/24/2018', '1.40', '3.25'), (507, 'Gentlemen A Design 5 Stripes (Green Top)', 0, '2/24/2018', '1.40', '3.25'), (508, 'Gentlemen A Design 5 Stripes (Black Top)', 0, '2/24/2018', '1.40', '3.25'), (509, 'Gentlemen A Design 5 Stripes (Nude Top)', 5, '2/24/2018', '1.40', '3.25'), (510, 'Gentlemen A Design 5 Stripes (Light Grey Top)', 1, '2/24/2018', '1.40', '3.25'), (511, 'Gentlemen A Design 6 Checkered (Red Accent)', 17, '2/24/2018', '1.40', '3.25'), (512, 'Gentlemen A Design 6 Checkered (Blue Accent)', 13, '2/24/2018', '1.40', '3.25'), (513, 'Gentlemen A Design 6 Checkered (Green Accen)', 13, '2/24/2018', '1.40', '3.25'), (514, 'Gentlemen A Design 6 Checkered (Brown Accent)', 6, '2/24/2018', '1.40', '3.25'), (515, 'Gentlemen A Design 7 Gent Rainbow Stripes (Blue red light blue)', 5, '2/24/2018', '1.40', '3.25'), (516, 'Gentlemen A Design 7 Gent Rainbow Stripes (Dark Blue Maroon Yellow)', 3, '2/24/2018', '1.40', '3.25'), (517, 'Gentlemen A Design 7 Gent Rainbow Stripes ( Black red maroon) ', 2, '2/24/2018', '1.40', '3.25'), (518, 'Gentlemen A Design 8 Tartan (Red)', 19, '2/24/2018', '1.40', '3.25'), (519, 'Gentlemen A Design 8 Tartan (Grey)', 15, '2/24/2018', '1.40', '3.25'), (520, 'Gentlemen A Design 8 Tartan (White)', 17, '2/24/2018', '1.40', '3.25'), (521, 'Gentlemen A Design 8 Tartan (Nude)', 12, '2/24/2018', '1.40', '3.25'), (522, 'Gentlemen A Design 8 Tartan (Blue)', 14, '2/24/2018', '1.40', '3.25'), (523, 'Gentlemen A Design 9 Diamond (Navy White tip)', 20, '2/24/2018', '1.40', '3.25'), (524, 'Gentlemen A Design 9 Diamond (Grey white tip)', 20, '2/24/2018', '1.40', '3.25'), (525, 'Gentlemen A Design 9 Diamond (Black blue tip)', 36, '2/24/2018', '1.40', '3.25'), (526, 'Gentlemen A Design 9 Diamond (Black Orange tip)', 15, '2/24/2018', '1.40', '3.25'), (527, 'Gentlemen A Design 9 Diamond (Blue Red Tip)', 30, '2/24/2018', '1.40', '3.25'), (528, 'Gentlemen A Design 9 Diamond (Purple Green tip)', 15, '2/24/2018', '1.40', '3.25'), (529, 'Gentlemen A Design 9 Diamond (White Tip Blue Base)', 21, '2/24/2018', '1.40', '3.25'), (530, 'Gentlemen A Design 9 Diamond (Yellow Tip Grey Base)', 12, '2/24/2018', '1.40', '3.25'), (531, 'Gentlemen A Design 10 Funky (Waves)', 14, '2/24/2018', '1.40', '3.25'), (532, 'Gentlemen A Design 10 Funky (Trees)', 12, '2/24/2018', '1.40', '3.25'), (533, 'Gentlemen A Design 10 Funky (Polka Dots)', 0, '2/24/2018', '1.40', '3.25'), (534, 'Gentlemen A Design 11 Graphite 2 stripes (Blue Red Stripes Charcoal Base)', 15, '2/24/2018', '1.40', '3.25'), (535, 'Gentlemen A Design 11 Graphite 2 stripes (Red Blue Stripes Nude Base)', 19, '2/24/2018', '1.40', '3.25'), (536, 'Gentlemen A Design 11 Graphite 2 stripes (Red Blue Stripes Brown Charcoal Base)', 20, '2/24/2018', '1.40', '3.25'), (537, 'Gentlemen A Design 11 Graphite 2 stripes (Black black stripes grey base) ', 18, '2/24/2018', '1.40', '3.25'), (538, 'Gentlemen A Design 11 Graphite 2 stripes (Red Yellow Stripes blue charcoal base)', 0, '2/24/2018', '1.40', '3.25'), (539, 'Gentlemen A Design 12 Squares (Grey)', 2, '2/24/2018', '1.40', '3.25'), (540, 'Gentlemen A Design 12 Squares (Black)', 1, '2/24/2018', '1.40', '3.25'), (541, 'Gentlemen A Design 12 Squares (Navy)', 4, '2/24/2018', '1.40', '3.25'), (542, 'Gentlemen A Design 12 Squares (Brown)', 1, '2/24/2018', '1.40', '3.25'), (543, 'Gentlemen A Design 13 Waves (Red Tip)', 8, '2/24/2018', '1.40', '3.25'), (544, 'Gentlemen A Design 13 Waves (Blue Tip)', 7, '2/24/2018', '1.40', '3.25'), (545, 'Gentlemen A Design 13 Waves (Green Tip)', 5, '2/24/2018', '1.40', '3.25'), (546, 'Gentlemen A Design 14 Ribbed (Matrix Dark Grey)', 7, '2/24/2018', '1.40', '3.25'), (547, 'Gentlemen A Design 14 Ribbed (Matrix Light Grey)', 10, '2/24/2018', '1.40', '3.25'), (548, 'Gentlemen A Design 14 Ribbed (Matrix Black)', 10, '2/24/2018', '1.40', '3.25'), (549, 'Gentlemen A Design 14 Ribbed (Matrix Blue)', 7, '2/24/2018', '1.40', '3.25'), (550, 'Gentlemen A Design 14 Ribbed (Matrix Brown)', 10, '2/24/2018', '1.40', '3.25'), (551, 'Gentlemen A Design 15 Galaxy (Red Tip)', 10, '2/24/2018', '1.40', '3.25'), (552, 'Gentlemen A Design 15 Galaxy (Dark Brown Tip)', 21, '2/24/2018', '1.40', '3.25'), (553, 'Gentlemen A Design 15 Galaxy (Green Tip)', 11, '2/24/2018', '1.40', '3.25'), (554, 'Gentlemen A Design 15 Galaxy (Black Tip)', 19, '2/24/2018', '1.40', '3.25'), (555, 'Gentlemen A Design 15 Galaxy (Light Brown Tip)', 39, '2/24/2018', '1.40', '3.25'), (556, 'Gentlemen A Design 16 Dual Prints (Black Tip)', 5, '2/24/2018', '1.40', '3.25'), (557, 'Gentlemen A Design 16 Dual Prints (Blue Tip)', 4, '2/24/2018', '1.40', '3.25'), (558, 'Gentlemen A Design 16 Dual Prints (Dark Grey Tip)', 2, '2/24/2018', '1.40', '3.25'), (559, 'Gentlemen A Design 16 Dual Prints (Light Grey Tip)', 1, '2/24/2018', '1.40', '3.25'), (560, 'Gentlemen A Design 16 Dual Prints (Navy Tip)', 1, '2/24/2018', '1.40', '3.25'), (561, 'Gentlemen A Design 16 Dual Prints (Navy Grey Tip)', 4, '2/24/2018', '1.40', '3.25'), (562, 'Gentlemen A Design 17 Navy Prints (Dots)', 2, '2/24/2018', '1.40', '3.25'), (563, 'Gentlemen A Design 17 Navy Prints (Grey blue strip', 5, '2/24/2018', '1.40', '3.25'), (564, 'Gentlemen A Design 17 Navy Prints (Blue stripes)', 5, '2/24/2018', '1.40', '3.25'), (565, 'Gentlemen A Design 17 Navy Prints (Thin blue strip', 2, '2/24/2018', '1.40', '3.25'), (566, 'Gentlemen A Design 17 Navy Prints (Blue patterned)', 9, '2/24/2018', '1.40', '3.25'), (567, 'Gentlemen A Design 18 Multi Stripes (white blue black)', 0, '2/24/2018', '1.40', '3.25'), (568, 'Gentlemen A Design 18 Multi Stripes (Black red black)', 7, '2/24/2018', '1.40', '3.25'), (569, 'Gentlemen A Design 18 Multi Stripes (Grey blue orange)', 1, '2/24/2018', '1.40', '3.25'), (570, 'Gentlemen A Design 18 Multi Stripes (Blue orange brown)', 7, '2/24/2018', '1.40', '3.25'), (571, 'Gentlemen A Design 18 Multi Stripes (Black blue red)', 2, '2/24/2018', '1.40', '3.25'), (572, 'Gentlemen A Design 19 Mono Stripes (Beige Tip)', 1, '2/24/2018', '1.40', '3.25'), (573, 'Gentlemen A Design 19 Mono Stripes (Maroon Tip)', 1, '2/24/2018', '1.40', '3.25'), (574, 'Gentlemen A Design 19 Mono Stripes (White Tip)', 4, '2/24/2018', '1.40', '3.25'), (575, 'Gentlemen A Design 19 Mono Stripes (Black Tip)', 2, '2/24/2018', '1.40', '3.25'), (576, 'Gentlemen A Design 20 Triple Stripes (Beigh Blue)', 1, '2/24/2018', '1.40', '3.25'), (577, 'Gentlemen A Design 20 Triple Stripes (Brown Black)', 2, '2/24/2018', '1.40', '3.25'), (578, 'Gentlemen A Design 20 Triple Stripes (Orange brown)', 0, '2/24/2018', '1.40', '3.25'), (579, 'Gentlemen A Design 20 Triple Stripes (Beigh Dark blue)', 1, '2/24/2018', '1.40', '3.25'), (580, 'Gentlemen A Design 21 Diamond Pins (Brown)', 0, '2/24/2018', '1.40', '3.25'), (581, 'Gentlemen A Design 21 Diamond Pins (Navy)', 0, '2/24/2018', '1.40', '3.25'), (582, 'Gentlemen A Design 21 Diamond Pins (White)', 3, '2/24/2018', '1.40', '3.25'), (583, 'Gentlemen A Design 21 Diamond Pins (Charcoal)', 2, '2/24/2018', '1.40', '3.25'), (584, 'Gentlemen A Design 21 Diamond Pins (Black)', 1, '2/24/2018', '1.40', '3.25'), (585, 'Gentlemen A Design 22 Double Stripes (Charcoal)', 11, '2/24/2018', '1.40', '3.25'), (586, 'Gentlemen A Design 22 Double Stripes (Dark Blue)', 9, '2/24/2018', '1.40', '3.25'), (587, 'Gentlemen A Design 22 Double Stripes (Light Blue)', 9, '2/24/2018', '1.40', '3.25'), (588, 'Gentlemen A Design 22 Double Stripes (White)', 4, '2/24/2018', '1.40', '3.25'), (589, 'Gentlemen A Design 22 Double Stripes (Black)', 9, '2/24/2018', '1.40', '3.25'), (590, 'Gentlemen A Design 23 Funky Argyle (Brown)', 2, '2/24/2018', '1.40', '3.25'), (591, 'Gentlemen A Design 23 Funky Argyle (Navy)', 12, '2/24/2018', '1.40', '3.25'), (592, 'Gentlemen A Design 23 Funky Argyle (Black)', 9, '2/24/2018', '1.40', '3.25'), (593, 'Gentlemen A Design 23 Funky Argyle (Grey)', 4, '2/24/2018', '1.40', '3.25'), (594, 'Gentlemen A Design 23 Funky Argyle (White)', 5, '2/24/2018', '1.40', '3.25'), (595, 'Gentlemen A Design 24 Dual Strips (Charcoal Base)', 8, '2/24/2018', '1.40', '3.25'), (596, 'Gentlemen A Design 24 Dual Strips (Light Grey Base', 3, '2/24/2018', '1.40', '3.25'), (597, 'Gentlemen A Design 24 Dual Strips (Navy Base)', 7, '2/24/2018', '1.40', '3.25'), (598, 'Gentlemen A Design 24 Dual Strips (Navy Grey Base)', 9, '2/24/2018', '1.40', '3.25'), (599, 'Gentlemen A Design 24 Dual Strips (Black Base)', 9, '2/24/2018', '1.40', '3.25'), (600, 'Gentlemen A Design 25 Gentlemen Strips (Brown)', 10, '2/24/2018', '1.40', '3.25'), (601, 'Gentlemen A Design 25 Gentlemen Strips (Charcoal)', 9, '2/24/2018', '1.40', '3.25'), (602, 'Gentlemen A Design 25 Gentlemen Strips (Black)', 9, '2/24/2018', '1.40', '3.25'), (603, 'Gentlemen A Design 25 Gentlemen Strips (Blue)', 7, '2/24/2018', '1.40', '3.25'), (604, 'Gentlemen A Design 25 Gentlemen Strips (Red)', 8, '2/24/2018', '1.40', '3.25'), (605, 'Gentlemen Ankle A Design 1 The Blues (Blue White Lines)', 2, '2/24/2018', '1.40', '2.25'), (606, 'Gentlemen Ankle A Design 1 The Blues (2 Blue Lines)', 2, '2/24/2018', '1.40', '2.25'), (607, 'Gentlemen Ankle A Design 1 The Blues (Gradient Blue)', 2, '2/24/2018', '1.40', '2.25'), (608, 'Gentlemen Ankle A Design 1 The Blues (Dotted)', 1, '2/24/2018', '1.40', '2.25'), (609, 'Gentlemen Ankle A Design 1 The Blues (Argyle)', 1, '2/24/2018', '1.40', '2.25'), (610, 'Gentlemen Ankle A Design 2 The Maroons (2 Stripe Tip)', 6, '2/24/2018', '1.40', '2.25'); INSERT INTO `inventory` (`SKU_Id`, `Name`, `Quantity`, `Updated_Date`, `Cost_Price`, `Selling_Price`) VALUES (611, 'Gentlemen Ankle A Design 2 The Maroons (Thin Lines)', 2, '2/24/2018', '1.40', '2.25'), (612, 'Gentlemen Ankle A Design 2 The Maroons (Red Toes)', 2, '2/24/2018', '1.40', '2.25'), (613, 'Gentlemen Ankle A Design 2 The Maroons (Red Charcoal Lines)', 8, '2/24/2018', '1.40', '2.25'), (614, 'Gentlemen Ankle A Design 2 The Maroons (Charcoal Red Tip)', 8, '2/24/2018', '1.40', '2.25'), (615, 'Gentlemen Ankle A Design 3 Kutsushita (White Red Grey)', 3, '2/24/2018', '1.40', '2.25'), (616, 'Gentlemen Ankle A Design 3 Kutsushita (Jap Flower Tip) ', 4, '2/24/2018', '1.40', '2.25'), (617, 'Gentlemen Ankle A Design 3 Kutsushita (Tribal)', 3, '2/24/2018', '1.40', '2.25'), (618, 'Gentlemen Ankle A Design 3 Kutsushita (Small floweer tip)', 8, '2/24/2018', '1.40', '2.25'), (619, 'Gentlemen Ankle A Design 3 Kutsushita (Diamond)', 5, '2/24/2018', '1.40', '2.25'), (620, 'Gentlemen Ankle A Design 4 The Circus (Zig Zag)', 3, '2/24/2018', '1.40', '2.25'), (621, 'Gentlemen Ankle A Design 4 The Circus (Dotted Lines)', 3, '2/24/2018', '1.40', '2.25'), (622, 'Gentlemen Ankle A Design 4 The Circus (Tip Lines)', 7, '2/24/2018', '1.40', '2.25'), (623, 'Gentlemen Ankle A Design 4 The Circus (Tri Color Lines)', 1, '2/24/2018', '1.40', '2.25'), (624, 'Gentlemen Ankle A Design 4 The Circus (Airplanes)', 2, '2/24/2018', '1.40', '2.25'), (625, 'Gentlemen Ankle A Design 5 Thin Stripes (Black)', 44, '2/24/2018', '1.40', '2.25'), (626, 'Gentlemen Ankle A Design 5 Thin Stripes (Maroon)', 48, '2/24/2018', '1.40', '2.25'), (627, 'Gentlemen Ankle A Design 5 Thin Stripes (Green)', 50, '2/24/2018', '1.40', '2.25'), (628, 'Gentlemen Ankle A Design 5 Thin Stripes (Light Brown)', 48, '2/24/2018', '1.40', '2.25'), (629, 'Gentlemen Ankle A Design 6 The Flash (Light Brown)', 48, '2/24/2018', '1.40', '2.25'), (630, 'Gentlemen Ankle A Design 6 The Flash (Dark Brown)', 48, '2/24/2018', '1.40', '2.25'), (631, 'Gentlemen Ankle A Design 6 The Flash (Blue)', 50, '2/24/2018', '1.40', '2.25'), (632, 'Gentlemen Ankle A Design 6 The Flash (Green)', 46, '2/24/2018', '1.40', '2.25'), (633, 'Gentlemen Ankle A Design 6 The Flash (Brown)', 29, '2/24/2018', '1.40', '2.25'), (634, 'Gentlemen Ankle A Design 7 Double Line (Grey)', 45, '2/24/2018', '1.40', '2.25'), (635, 'Gentlemen Ankle A Design 7 Double Line (Black)', 13, '2/24/2018', '1.40', '2.25'), (636, 'Gentlemen Ankle A Design 7 Double Line (Blue)', 46, '2/24/2018', '1.40', '2.25'), (637, 'Gentlemen Ankle A Design 7 Double Line (White)', 46, '2/24/2018', '1.40', '2.25'), (638, 'Gentlemen Ankle A Design 8 3 Bars (Black)', 108, '2/24/2018', '1.40', '2.25'), (639, 'Gentlemen Ankle A Design 8 3 Bars (Grey)', 134, '2/24/2018', '1.40', '2.25'), (640, 'Gentlemen Ankle A Design 8 3 Bars (White)', 131, '2/24/2018', '1.40', '2.25'), (641, '001-Gentlemen A Design 8 Tartan (White) & Gentlemen A Design 14 Ribbed (Matrix Black)', 45, '3/19/2018', '6.00', '4.50'), (642, '002-Basic A Design 4 Bamboo Short(White) & Design J: Mini Zoo Emoji(Pony)', 30, '3/19/2018', '2.50', '3.00'), (643, '003-Collection A Design 9 Pastel Lines(Brown Bear & Baby A Design 19 Baby Kittens (Pink)', 50, '3/22/2018', '15.00', '12.00'); -- -------------------------------------------------------- -- -- Table structure for table `inventory_purchase` -- CREATE TABLE IF NOT EXISTS `inventory_purchase` ( `SKU_Id` int(255) NOT NULL, `Quantity` int(11) NOT NULL, `Date_Of_Purchase` date NOT NULL, KEY `inventory_purchase_ibfk_1_idx` (`SKU_Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `inventory_purchase` -- INSERT INTO `inventory_purchase` (`SKU_Id`, `Quantity`, `Date_Of_Purchase`) VALUES (5, 3, '2018-02-07'), (37, 4, '2018-03-19'), (30, 20, '2018-03-19'), (44, 13, '2018-02-15'), (609, 11, '2018-02-28'), (608, 20, '2018-03-20'), (131, 1, '2018-04-01'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `Name` varchar(30) NOT NULL, `Password` varchar(50) NOT NULL, `isOnline` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`Name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`Name`, `Password`, `isOnline`) VALUES ('qingyang', 'the92shop', 0), ('cythnia', 'the92shop2', 0), ('clarey', 'passClareyword', 0); /*!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 `avro_schema` ( `id` int(11) NOT NULL AUTO_INCREMENT, `avro_schema` text COLLATE utf8_unicode_ci NOT NULL, `topic_id` int(11) NOT NULL, `base_schema_id` int(11) DEFAULT NULL, `alias` varchar(255) DEFAULT NULL, `status` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'RW', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `topic_id` (`topic_id`), KEY `alias` (`alias`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Exercice 1 USE `webDevelopement`; ALTER TABLE `languages` ADD `versions` VARCHAR(40); DESCRIBE `languages`; -- Exercice 2 ALTER TABLE `frameworks` ADD `version` INT; DESCRIBE `frameworks`; -- Exercice 3 ALTER TABLE `languages` CHANGE `versions` `version` VARCHAR(40); DESCRIBE `languages`; -- Exercice 4 ALTER TABLE `frameworks` CHANGE `name` `framework` VARCHAR(40); DESCRIBE `frameworks`; -- Exercice 5 ALTER TABLE `frameworks` MODIFY `version` VARCHAR(10); DESCRIBE `frameworks`; -- TP ALTER TABLE `client` DROP `firstName`; ALTER TABLE `client` CHANGE firstPhoneNumber phoneNumber VARCHAR(40); DESCRIBE `client`; ALTER TABLE `client` MODIFY phoneNumber VARCHAR(40); DESCRIBE `client`; ALTER TABLE `client` ADD `zipCode` VARCHAR(40); ALTER TABLE `client` ADD `city` VARCHAR(40); DESCRIBE `client`; CREATE DATABASE IF NOT EXISTS `HospitalE2N`; USE `HospitalE2N`; CREATE TABLE IF NOT EXISTS `patients`( `id` INT (11) AUTO_INCREMENT NOT NULL , `lastname` VARCHAR (25) NOT NULL , `firstname` VARCHAR (25) NOT NULL , `birthdate` DATE NOT NULL , `phone` VARCHAR (25) , `mail` VARCHAR (100) NOT NULL , PRIMARY KEY (`id`) )ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS `appointments`( `id` INT (11) AUTO_INCREMENT NOT NULL , `dateHour` DATETIME NOT NULL , `idPatients` INT (11) NOT NULL , PRIMARY KEY (`id`) )ENGINE=InnoDB; ALTER TABLE `appointments` ADD CONSTRAINT FK_appointments_id_patients FOREIGN KEY (`idPatients`) REFERENCES `patients`(`id`);
SET ROLE admin; CREATE TABLE "User" ( id uuid NOT NULL, name character varying, password character varying, roles jsonb ); ALTER TABLE "User" OWNER TO admin; COPY "User" (id, name, password, roles) FROM stdin; 61d7f2e3-3387-4115-895e-b04a49967b27 admin 0f3477f71c65c7ac;7e21f7fe996f797973df579c9b2116b9de5cb7756cbbee30fca8a9a927d78854 ["administrator"] 75cb3dae-2a18-4112-8042-cf69198d1639 exampleuser e297c78cdfd696a8;0d047fbfb5d090b37f1ba35faff745440df0ea6777d96a6733e4e420b910a66e ["user"] 9de0c24b-e02e-4dc1-a5f7-3cdb1f474f7e operator 3370ab41862a183c;17c1f3cd85ee7f5ae27e9f00e0ddd907151bf10ba0e90549c78f68fa7f93896f ["operator"] \. ALTER TABLE ONLY "User" ADD CONSTRAINT "User_pkey" PRIMARY KEY (id);
CREATE TABLE online_statistics ( id VARCHAR(20) PRIMARY KEY NOT NULL, iq SMALLINT, statistics JSONB, FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ); --;; CREATE INDEX statistics_sort_iq_desc ON online_statistics USING btree (iq DESC); --;; in further migration files
SELECT cc.code AS code, cc.display as name, COUNT(*) as cnt FROM `<your project>.<your bq>.Condition` ,UNNEST(code.coding) cc GROUP BY code, name ORDER BY cnt DESC LIMIT 10
--OPERADOR WHERE SELECT * FROM Customers WHERE Country = 'México' --OPERADOR AND SELECT BusinessEntityID, LoginID, JobTitle, VacationHours FROM HumanResources.Employee p WHERE JobTitle = 'Marketing Assistant' AND VacationHours > 41 --OPERADOR BETWEEN SELECT E.FirstName, E.LastName, EP.Rate FROM HumanResources.vEmployee E JOIN HumanResources.EmployeePayHistory EP ON E.BusinessEntityID = EP.BusinessEntityID WHERE EP.Rate BETWEEN 27 AND 30 ORDER BY EP.Rate --OPERADOR IN SELECT * FROM Person.Person AS P JOIN Sales.SalesPerson AS SP ON P.BusinessEntityID = SP.BusinessEntityID WHERE P.BusinessEntityID IN (SELECT PP.BusinessEntityID FROM Person.Person PP) --OPERADOR NOT IN SELECT * FROM Person.Person AS P JOIN Sales.SalesPerson AS SP ON P.BusinessEntityID = SP.BusinessEntityID WHERE P.BusinessEntityID NOT IN (SELECT PP.BusinessEntityID FROM Person.Person PP WHERE PP.BusinessEntityID > 10000) --LIKE LOCALIZA VALORES QUE CONTENHAM "OR" EM QUAL LUGAR SELECT * FROM Customers WHERE ContactName LIKE '%OR%' --LIKE ENCONTRA QUAISQUER VALORES QUE TENHAM "R" NA SEGUNDA POSIÇÃO SELECT * FROM Customers WHERE ContactName LIKE '_R%' --LIKE Localiza valores que começam com "a" e possuem pelo menos 3 caracteres de comprimento SELECT * FROM Customers WHERE ContactName LIKE 'a_%_%' --LIKE LOCALIZA VALORES QUE COMEÇAM COM 'A' E TERMINA COM 'O' SELECT * FROM Customers WHERE ContactName LIKE 'a%o' --LIKE LOCALIZA VALORES QUE NÃO COMEÇAM COM 'A' SELECT * FROM Customers WHERE ContactName NOT LIKE 'a%' --OPERADOR LIKE CORINGA [] SELECT BusinessEntityID, FirstName, LastName FROM Person.Person WHERE FirstName LIKE '[CS]he%' --LIKE CORINGA SELECT LastName, FirstName FROM Person.Person WHERE LastName LIKE 'Zh[ae]ng' ORDER BY LastName ASC, FirstName ASC --OPERADOR NOT SELECT Name, StandardCost FROM Production.Product WHERE ProductNumber LIKE 'BK-%' AND Color = 'Silver' AND NOT StandardCost < 400; --OPERADOR HAVING SELECT COUNT(CustomerID) FROM Customers GROUP BY Country HAVING COUNT(CustomerID) > 5
CREATE TABLE `accounts` ( `account_id` int(11) unsigned NOT NULL, `username` varchar(32) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`account_id`), KEY `idx_username` (`username`) ); INSERT INTO `accounts` (`account_id`, `username`) VALUES (1, 'justinbieber'); INSERT INTO `accounts` (`account_id`, `username`) VALUES (2, 'taylorswift'); CREATE TABLE `account_follower_counts` ( `account_id` int(11) unsigned NOT NULL, `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `follower_count` int(11) unsigned NOT NULL, `following_count` int(11) unsigned NOT NULL, `post_count` int(11) unsigned NOT NULL, UNIQUE KEY `account_id_date_idx` (`account_id`,`date`) ); CREATE TABLE `account_post_stats` ( `account_id` int(11) unsigned NOT NULL, `post_id` bigint(20) unsigned NOT NULL, `post_date` datetime NOT NULL, `comment_count` int(11) unsigned NOT NULL, `like_count` int(11) unsigned NOT NULL, UNIQUE KEY `account_id` (`account_id`,`post_id`) ); CREATE TABLE `account_engagement_aggregations` ( `account_id` int(11) unsigned NOT NULL, `date` date NOT NULL, `avg_comments` int(11) unsigned NOT NULL, `avg_likes` int(11) unsigned NOT NULL, PRIMARY KEY (`account_id`), UNIQUE KEY `account_id` (`account_id`,`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -- Структура таблицы `fa_company` -- CREATE TABLE IF NOT EXISTS `fa_company` ( `id` int(11) NOT NULL, `name` varchar(256) NOT NULL, `sector_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `sector_id` (`sector_id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; /*!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 */;
找出所有员工当前(to_date='9999-01-01')具体的薪水salary情况,对于相同的薪水只显示一次,并按照逆序显示 SELECT DISTINCT salary FROM salaries WHERE to_date = '9999-01-01' ORDER BY salary desc;
-- customers table -- depends: DROP TABLE customers;
SELECT * FROM ( SELECT TipoVentaID, TipoVenta, TipoVentaGrupo, OrdenReporte FROM TB_TipoVenta UNION ALL SELECT "99" AS TipoVentaID, "VENTA DE EXPORTACION" AS TipoVenta, "VENTA DE EXPORTACION" AS TipoVentaGrupo, 1 AS OrdenReporte FROM DUAL) AS A
-- rms_aircraft_stand_parking_op pk: aircraft_visit_seq, aircraft_sp_seq -- -- aircraft_visit_seq not null number(10) -- aircraft_sp_seq not null number(10) -- stand_code varchar2(5) -- on_block_time date -- off_block_time date -- est_on_block_time date -- est_off_block_time date -- movement_type varchar2(1) -- gate_code varchar2(5) -- status varchar2(1) -- aion_conflict varchar2(1) ---------------------------------------------------------------- CREATE OR REPLACE TRIGGER TRG_DML_ON_RMS_AC_SP_OP AFTER INSERT OR UPDATE or DELETE ON RMS.RMS_AIRCRAFT_STAND_PARKING_OP REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE vPAYLOAD VARCHAR2(1024); BEGIN IF INSERTING THEN vPAYLOAD := '{'|| '"service": "after_insert_on_rms_aircraft_stand_parking_op",'|| '"payload": {'|| '"aircraft_visit_seq" : '||:new.aircraft_visit_seq||','|| '"aircraft_sp_seq" : '||:new.aircraft_sp_seq||','|| '"stand_code" : "'||:new.stand_code||'",'|| '"on_block_time" : '||to_char(:new.on_block_time,'yyyy-MM-dd HH24:MI:SS')||','|| '"off_block_time" : "'||to_char(:new.off_block_time,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"est_on_block_time" : '||to_char(:new.est_on_block_time,'yyyy-MM-dd HH24:MI:SS')||','|| '"est_off_block_time" : "'||to_char(:new.est_off_block_time,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"movement_type" : '||:new.movement_type||','|| '"gate_code" : "'||:new.gate_code||'",'|| '"status" : '||:new.status||','|| '"aion_conflict" : "'||:new.aion_conflict||'"'|| '},'|| '"metadata": {'|| '"timestamp":'|| '"'||to_char(sysdate,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"timezoneOffset": -420,'|| '"source": "FMM"'|| '}'|| '}' ; ELSIF UPDATING THEN vPAYLOAD := '{'|| '"service": "after_update_on_rms_aircraft_stand_parking_op",'|| '"payload": {'|| '"aircraft_visit_seq" : '||:old.aircraft_visit_seq||','|| '"aircraft_sp_seq" : '||:new.aircraft_sp_seq||','|| '"stand_code" : "'||:new.stand_code||'",'|| '"on_block_time" : '||to_char(:new.on_block_time,'yyyy-MM-dd HH24:MI:SS')||','|| '"off_block_time" : "'||to_char(:new.off_block_time,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"est_on_block_time" : '||to_char(:new.est_on_block_time,'yyyy-MM-dd HH24:MI:SS')||','|| '"est_off_block_time" : "'||to_char(:new.est_off_block_time,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"movement_type" : '||:new.movement_type||','|| '"gate_code" : "'||:new.gate_code||'",'|| '"status" : '||:new.status||','|| '"aion_conflict" : "'||:new.aion_conflict||'"'|| '},'|| '"metadata": {'|| '"timestamp":'|| '"'||to_char(sysdate,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"timezoneOffset": -420,'|| '"source": "FMM"'|| '}'|| '}' ; ELSIF DELETING THEN vPAYLOAD := '{'|| '"service": "after_delete_on_rms_aircraft_stand_parking_op",'|| '"payload": {'|| '"aircraft_visit_seq" : '||:old.aircraft_visit_seq||','|| '"aircraft_sp_seq" : '||:old.aircraft_sp_seq||','|| '},'|| '"metadata": {'|| '"timestamp":'|| '"'||to_char(sysdate,'yyyy-MM-dd HH24:MI:SS')||'",'|| '"timezoneOffset": -420,'|| '"source": "FMM"'|| '}'|| '}' ; END IF; BEGIN INSERT INTO TEMP_POOLING (MSG_TIMESTAMPS,PAYLOAD) VALUES (sysdate,vPAYLOAD); COMMIT; EXCEPTION WHEN OTHERS THEN NULL; END; EXCEPTION WHEN OTHERS THEN -- Consider logging the error and then re-raise RAISE; END ; /
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 10-08-2016 a las 21:11:15 -- Versión del servidor: 5.6.21 -- Versión de PHP: 5.5.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de datos: `koquetas` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cliente` -- CREATE TABLE IF NOT EXISTS `cliente` ( `cedula` int(8) NOT NULL, `nombre` text, `telefono` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `compraproducto` -- CREATE TABLE IF NOT EXISTS `compraproducto` ( `id` int(5) NOT NULL, `proveedor` int(5) DEFAULT NULL, `producto` int(5) DEFAULT NULL, `fechaAdquisicion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `cantidad` int(4) DEFAULT NULL, `precio` float DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `factura` -- CREATE TABLE IF NOT EXISTS `factura` ( `idFactura` int(7) NOT NULL, `idProducto` int(5) DEFAULT NULL, `idUsuario` int(2) DEFAULT NULL, `cliente` int(8) DEFAULT NULL, `monto` float DEFAULT NULL, `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `producto` -- CREATE TABLE IF NOT EXISTS `producto` ( `idProducto` int(5) NOT NULL, `nombre` varchar(30) NOT NULL, `precio` float DEFAULT NULL, `existencia` int(4) DEFAULT NULL, `fechaAdquisicion` date DEFAULT NULL, `proveedor` int(4) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `producto` -- INSERT INTO `producto` (`idProducto`, `nombre`, `precio`, `existencia`, `fechaAdquisicion`, `proveedor`) VALUES (1, 'colitas', 1.332, 123, '2016-08-09', 2), (2, 'labial', 1.3231, 23123, '2016-08-09', 3); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedor` -- CREATE TABLE IF NOT EXISTS `proveedor` ( `idProveedor` int(4) NOT NULL, `nombre` varchar(90) DEFAULT NULL, `rif` varchar(15) NOT NULL, `telefono1` int(11) DEFAULT NULL, `telefono2` int(11) DEFAULT NULL, `direccion` varchar(200) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `proveedor` -- INSERT INTO `proveedor` (`idProveedor`, `nombre`, `rif`, `telefono1`, `telefono2`, `direccion`) VALUES (1, 'qweqweqwe', '123123', 1231231, 0, '3qweqweq'), (2, '123123123121e12e', 'qweqweqwe', 2147483647, 0, 'qweqweqwe'), (3, '12312312312eqwqweqw', '123123', 312312312, 0, 'qweqweqwe'), (4, 'qweqweqweqwe', '1231213123', 2147483647, 0, '123123123qeqweqwe'), (5, 'wqeqweqweqwe', '12312312e', 123123123, 0, '1eqweqweqwe'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuario` -- CREATE TABLE IF NOT EXISTS `usuario` ( `idUsuario` int(2) NOT NULL, `nombre` text, `clave` varchar(45) DEFAULT NULL, `usuario` varchar(45) DEFAULT NULL, `privilegios` char(1) DEFAULT NULL, `pSecreta` varchar(45) DEFAULT NULL, `rSecreta` varchar(45) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `usuario` -- INSERT INTO `usuario` (`idUsuario`, `nombre`, `clave`, `usuario`, `privilegios`, `pSecreta`, `rSecreta`) VALUES (1, 'admin', '123456', 'admin', 'A', NULL, NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventaproducto` -- CREATE TABLE IF NOT EXISTS `ventaproducto` ( `idProducto` int(5) DEFAULT NULL, `idFactura` int(7) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `cliente` -- ALTER TABLE `cliente` ADD PRIMARY KEY (`cedula`); -- -- Indices de la tabla `compraproducto` -- ALTER TABLE `compraproducto` ADD PRIMARY KEY (`id`), ADD KEY `proveedor` (`proveedor`), ADD KEY `producto` (`producto`); -- -- Indices de la tabla `factura` -- ALTER TABLE `factura` ADD PRIMARY KEY (`idFactura`), ADD KEY `idUsuario` (`idUsuario`), ADD KEY `cliente` (`cliente`); -- -- Indices de la tabla `producto` -- ALTER TABLE `producto` ADD PRIMARY KEY (`idProducto`); -- -- Indices de la tabla `proveedor` -- ALTER TABLE `proveedor` ADD PRIMARY KEY (`idProveedor`); -- -- Indices de la tabla `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`idUsuario`); -- -- Indices de la tabla `ventaproducto` -- ALTER TABLE `ventaproducto` ADD KEY `idProducto` (`idProducto`), ADD KEY `idFactura` (`idFactura`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `compraproducto` -- ALTER TABLE `compraproducto` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `factura` -- ALTER TABLE `factura` MODIFY `idFactura` int(7) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `producto` -- ALTER TABLE `producto` MODIFY `idProducto` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `proveedor` -- ALTER TABLE `proveedor` MODIFY `idProveedor` int(4) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `usuario` -- ALTER TABLE `usuario` MODIFY `idUsuario` int(2) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- Creates the database hbtn_0d_usa and the table cities -- Referencing a foreign key to another table (primary key) CREATE DATABASE IF NOT EXISTS hbtn_0d_usa; USE hbtn_0d_usa; CREATE TABLE IF NOT EXISTS hbtn_0d_usa.cities (id INT UNIQUE AUTO_INCREMENT NOT NULL, state_id INT NOT NULL, name VARCHAR(256) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (state_id) REFERENCES states(id));
CREATE TABLE movies ( id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, year VARCHAR(4) NOT NULL, poster VARCHAR(255) people_id int(20) DEFAULT NULL ); CREATE TABLE people ( id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL ); INSERT INTO people (name, role) VALUES ('Mark Ruffalo', 'Hulk'); INSERT INTO people (name, role) VALUES ('Danai Gurira', 'Okoye'); INSERT INTO people (name, role) VALUES ('Robert Downey Jr', 'Iron Man'); INSERT INTO people (name, role) VALUES ('Chadwick Boseman', 'Black Panther'); INSERT INTO people (name, role) VALUES ('Benedict Cumberbatch', 'Docteur Strange'); INSERT INTO people (name, role) VALUES ('Tobey Maguire', 'Spiderman'); INSERT INTO people (name, role) VALUES ('Chris Evans', 'Captain America'); INSERT INTO people (name, role) VALUES ('Chris Hemsworth', 'Thor'); INSERT INTO people (name, role) VALUES ('Paul Rudd', 'AntMan'); INSERT INTO people (name, role) VALUES ('Scarlett Johansson', 'Black Widow'); INSERT INTO movies (id, title, year, poster, people_id) VALUES (1, 'Iron Man', '2008', 'http://www.cinemagora.co.uk/images/films/51/53751-b-iron-man.jpg', 3), (2, 'Iron Man 2', '2010', 'https://static.tvtropes.org/pmwiki/pub/images/iron_man_2.jpg', 3), (3, 'Thor', '2011', 'https://yggdrasilblog.files.wordpress.com/2014/04/la-nouvelle-affiche-du-film-thor-the-dark.jpg', 8), (4, 'Captain America: The Winter Soldier', '2014', 'https://i.pinimg.com/originals/db/45/93/db4593a74d5f3abd7c15e74a9e9b58ab.jpg', 7), (5, 'Avengers: Infinity War', '2018', 'http://fr.web.img4.acsta.net/r_1920_1080/pictures/18/04/05/16/25/3438394.jpg', 1), (6, 'Ant-Man', '2015', 'https://foxdao.net/wp-content/uploads/2015/06/ant-man-poster.jpg', 9), (7, 'Doctor Strange', '2016', 'http://fr.web.img6.acsta.net/r_1920_1080/pictures/16/07/25/10/13/230016.jpg', 5), (8, 'Spider-Man: Homecoming', '2017', 'https://www.superheromovies.net/img/p/6v0OGYaB8510nH0zcKH0ZWP8HWD.jpg', 6), (9, 'Black Panther', '2018', 'https://media.senscritique.com/media/000017641221/source_big/Black_Panther.jpg', 2);
TRUNCATE TABLE rman_rpt_comp_temp; /* Header 20xxxx Alerts 30xxxx Priority 50xxxx Synthesis 60xxxx Recommend 70xxxx RRT xx11xx CKD xx21xx Obesity xx29xx Htn xx31xx Cardiac xx41xx Pulm xx51xx Other endo xx53xx Liver xx61xx Infection xx81xx Carcinoma xx91xx */ Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,305,304100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,306,304410); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,310,304720); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,309,304660); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,304,302610); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,27,602110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,28,602115); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,29,602120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,30,602130); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,31,602135); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,32,602190); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,33,602900); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,59,702100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,34,603100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,63,801100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,67,921010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,35,604100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,37,604101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,38,604102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,39,604103); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,40,604105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,42,605100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,43,606100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,41,604110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,14,601000); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,20,601099); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,15,601001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,16,601002); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,17,601003); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,18,601004); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,19,601031); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,21,601100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,22,601101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,26,601199); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,46,651010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,58,701100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,64,801100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,36,604200); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,60,704100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,65,804100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,23,601105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,24,601110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,25,601120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,47,651101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,49,651310); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,52,653120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,53,653130); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,50,652110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,51,653110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,48,651110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,54,661100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,55,661101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,1,200001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,12,600010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,13,600011); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,44,609001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,45,609010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,57,700001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,61,799999); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,62,800001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,66,899999); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,56,661102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,2,200008); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,3,200010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,9,200006); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,10,200020); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,11,304810); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,308,304620); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,307,304610); --Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,152,627010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,160,601010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,153,661105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,154,601006); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,155,600910); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,156,603010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,157,601008); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,158,601007); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,159,651102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,200,609110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,210,609120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,250,609150); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,170,605110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,180,605310); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,300,606110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,410,608110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,810,603020); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,850,603022); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (1,5010,651012); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,27,602110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,28,602115); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,29,602120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,30,602130); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,31,602135); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,32,602190); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,33,602900); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,59,702100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,34,603100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,63,801100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,67,921010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,35,504100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,37,504101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,38,504102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,39,504103); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,40,504105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,42,605100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,43,606100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,41,604110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,14,601000); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,20,601099); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,15,601001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,16,601002); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,17,601003); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,18,601004); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,19,601031); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,21,601100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,22,601101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,26,601199); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,46,651010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,58,701100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,64,801100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,36,604200); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,60,704100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,65,804100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,23,601105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,24,601110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,25,601120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,47,651101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,49,651310); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,52,653120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,53,653130); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,50,652110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,51,653110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,48,651110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,54,661100); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,55,661101); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,1,200001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,12,600010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,13,600011); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,44,609001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,45,609010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,57,700001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,61,799999); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,62,800001); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,66,899999); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,56,661102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,2,200008); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,3,200010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,11,304810); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,8,304620); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,7,304610); --Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,152,627010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,160,601010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,153,661105); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,154,601006); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,155,600910); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,156,603010); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,157,601008); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,158,601007); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,159,651102); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,200,609110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,210,609120); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,250,609111); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,170,605110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,180,605310); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,300,606110); Insert into RMAN_RPT_COMP_TEMP (COMPOSITION_ID,TEMPLATE_ID,PLACEMENT_ORDER) values (2,410,608110); alter package rman_tmplts compile;
-- -- PostgreSQL database dump -- -- Dumped from database version 11.5 (Ubuntu 11.5-0ubuntu0.19.04.1) -- Dumped by pg_dump version 11.5 (Ubuntu 11.5-0ubuntu0.19.04.1) SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: achats; Type: TABLE; Schema: public; Owner: kone -- CREATE TABLE public.achats ( id_ac integer NOT NULL, date_ac date DEFAULT now(), montant integer, montant_paye integer, etat_liv character(1), libele character varying(70), etat integer, id_fo integer, CONSTRAINT etat_liv_check CHECK (((etat_liv = 'N'::bpchar) OR (etat_liv = 'P'::bpchar) OR (etat_liv = 'T'::bpchar))), CONSTRAINT montant_pay_check CHECK (((montant_paye >= 0) AND (montant_paye <= montant))) ); ALTER TABLE public.achats OWNER TO kone; -- -- Name: achats_id_ac_seq; Type: SEQUENCE; Schema: public; Owner: kone -- CREATE SEQUENCE public.achats_id_ac_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.achats_id_ac_seq OWNER TO kone; -- -- Name: achats_id_ac_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: kone -- ALTER SEQUENCE public.achats_id_ac_seq OWNED BY public.achats.id_ac; -- -- Name: calendriers; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.calendriers ( id_d integer NOT NULL, mois character varying(20) ); ALTER TABLE public.calendriers OWNER TO abdallah; -- -- Name: categories; Type: TABLE; Schema: public; Owner: kone -- CREATE TABLE public.categories ( id_cat integer NOT NULL, nom_cat character varying(20) ); ALTER TABLE public.categories OWNER TO kone; -- -- Name: categories_id_cat_seq; Type: SEQUENCE; Schema: public; Owner: kone -- CREATE SEQUENCE public.categories_id_cat_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.categories_id_cat_seq OWNER TO kone; -- -- Name: categories_id_cat_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: kone -- ALTER SEQUENCE public.categories_id_cat_seq OWNED BY public.categories.id_cat; -- -- Name: classes; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.classes ( id_cl integer NOT NULL, nom_cl character varying(70) NOT NULL, niveau character varying(20) NOT NULL ); ALTER TABLE public.classes OWNER TO abdallah; -- -- Name: classes_id_cl_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.classes_id_cl_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.classes_id_cl_seq OWNER TO abdallah; -- -- Name: classes_id_cl_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.classes_id_cl_seq OWNED BY public.classes.id_cl; -- -- Name: contenu_acha; Type: TABLE; Schema: public; Owner: kone -- CREATE TABLE public.contenu_acha ( id_cac integer NOT NULL, id_ac integer, prix_acha integer, qte_pro integer, qte_liv integer, nom_pro character varying(100) ); ALTER TABLE public.contenu_acha OWNER TO kone; -- -- Name: contenu_acha_id_cac_seq; Type: SEQUENCE; Schema: public; Owner: kone -- CREATE SEQUENCE public.contenu_acha_id_cac_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.contenu_acha_id_cac_seq OWNER TO kone; -- -- Name: contenu_acha_id_cac_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: kone -- ALTER SEQUENCE public.contenu_acha_id_cac_seq OWNED BY public.contenu_acha.id_cac; -- -- Name: depenses; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.depenses ( id_dep integer NOT NULL, motif character varying(150) NOT NULL, date_dep date DEFAULT now(), montant integer, id_pa integer ); ALTER TABLE public.depenses OWNER TO abdallah; -- -- Name: depenses_id_dep_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.depenses_id_dep_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.depenses_id_dep_seq OWNER TO abdallah; -- -- Name: depenses_id_dep_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.depenses_id_dep_seq OWNED BY public.depenses.id_dep; -- -- Name: eleves; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.eleves ( id_el integer NOT NULL, nom_el character varying(70) NOT NULL, prenom_el character varying(60) NOT NULL, date_nais date NOT NULL, id_cl integer, id_tu integer ); ALTER TABLE public.eleves OWNER TO abdallah; -- -- Name: eleves_id_el_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.eleves_id_el_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.eleves_id_el_seq OWNER TO abdallah; -- -- Name: eleves_id_el_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.eleves_id_el_seq OWNED BY public.eleves.id_el; -- -- Name: fournisseurs; Type: TABLE; Schema: public; Owner: kone -- CREATE TABLE public.fournisseurs ( id_fo integer NOT NULL, prenom_f character varying(20), nom_f character varying(20), adresse character varying(70), contact character varying(20) ); ALTER TABLE public.fournisseurs OWNER TO kone; -- -- Name: fournisseurs_id_fo_seq; Type: SEQUENCE; Schema: public; Owner: kone -- CREATE SEQUENCE public.fournisseurs_id_fo_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.fournisseurs_id_fo_seq OWNER TO kone; -- -- Name: fournisseurs_id_fo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: kone -- ALTER SEQUENCE public.fournisseurs_id_fo_seq OWNED BY public.fournisseurs.id_fo; -- -- Name: inscriptions; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.inscriptions ( id_ins integer NOT NULL, prenom_el character varying(75) NOT NULL, nom_el character varying(75) NOT NULL, date_nais date NOT NULL, date_ins date DEFAULT now(), nom_tu character varying(90) NOT NULL, tel1 character varying(15) NOT NULL, tel2 character varying(15) ); ALTER TABLE public.inscriptions OWNER TO abdallah; -- -- Name: inscriptions_id_ins_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.inscriptions_id_ins_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.inscriptions_id_ins_seq OWNER TO abdallah; -- -- Name: inscriptions_id_ins_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.inscriptions_id_ins_seq OWNED BY public.inscriptions.id_ins; -- -- Name: mois_id_dt_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.mois_id_dt_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.mois_id_dt_seq OWNER TO abdallah; -- -- Name: mois_id_dt_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.mois_id_dt_seq OWNED BY public.calendriers.id_d; -- -- Name: parcours; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.parcours ( id integer NOT NULL, id_el integer, nom_par character varying(50) NOT NULL, qte_m integer DEFAULT 0, qte_r integer DEFAULT 0, qte integer DEFAULT 0 ); ALTER TABLE public.parcours OWNER TO abdallah; -- -- Name: parcours_id_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.parcours_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.parcours_id_seq OWNER TO abdallah; -- -- Name: parcours_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.parcours_id_seq OWNED BY public.parcours.id; -- -- Name: pay_per; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.pay_per ( id_pa integer NOT NULL, date_pa date DEFAULT now(), id_p integer, paye integer NOT NULL, reste integer, id_d integer, nom_p character varying(30), tel_p character varying(20) ); ALTER TABLE public.pay_per OWNER TO abdallah; -- -- Name: pay_per_id_pa_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.pay_per_id_pa_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.pay_per_id_pa_seq OWNER TO abdallah; -- -- Name: pay_per_id_pa_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.pay_per_id_pa_seq OWNED BY public.pay_per.id_pa; -- -- Name: payements; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.payements ( id_pay integer NOT NULL, date_pay date DEFAULT now(), id_el integer, montant_p integer, nom_p character varying(40), tel_p character varying(25), id_d integer, total integer ); ALTER TABLE public.payements OWNER TO abdallah; -- -- Name: payements_id_pay_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.payements_id_pay_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.payements_id_pay_seq OWNER TO abdallah; -- -- Name: payements_id_pay_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.payements_id_pay_seq OWNED BY public.payements.id_pay; -- -- Name: personnels; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.personnels ( id_p integer NOT NULL, prenom character varying(70) NOT NULL, nom character varying(60) NOT NULL, adresse character varying(75) NOT NULL, tel1 character varying(15) NOT NULL, tel2 character varying(15), salaire integer, id_cl integer, id_cat integer ); ALTER TABLE public.personnels OWNER TO abdallah; -- -- Name: personnels_id_p_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.personnels_id_p_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.personnels_id_p_seq OWNER TO abdallah; -- -- Name: personnels_id_p_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.personnels_id_p_seq OWNED BY public.personnels.id_p; -- -- Name: tuteurs; Type: TABLE; Schema: public; Owner: abdallah -- CREATE TABLE public.tuteurs ( id_tu integer NOT NULL, nom_tu character varying(70) NOT NULL, adresse character varying(75) NOT NULL, tel1 character varying(15), tel2 character varying(15) ); ALTER TABLE public.tuteurs OWNER TO abdallah; -- -- Name: tuteurs_id_tu_seq; Type: SEQUENCE; Schema: public; Owner: abdallah -- CREATE SEQUENCE public.tuteurs_id_tu_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.tuteurs_id_tu_seq OWNER TO abdallah; -- -- Name: tuteurs_id_tu_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: abdallah -- ALTER SEQUENCE public.tuteurs_id_tu_seq OWNED BY public.tuteurs.id_tu; -- -- Name: achats id_ac; Type: DEFAULT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.achats ALTER COLUMN id_ac SET DEFAULT nextval('public.achats_id_ac_seq'::regclass); -- -- Name: calendriers id_d; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.calendriers ALTER COLUMN id_d SET DEFAULT nextval('public.mois_id_dt_seq'::regclass); -- -- Name: categories id_cat; Type: DEFAULT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.categories ALTER COLUMN id_cat SET DEFAULT nextval('public.categories_id_cat_seq'::regclass); -- -- Name: classes id_cl; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.classes ALTER COLUMN id_cl SET DEFAULT nextval('public.classes_id_cl_seq'::regclass); -- -- Name: contenu_acha id_cac; Type: DEFAULT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.contenu_acha ALTER COLUMN id_cac SET DEFAULT nextval('public.contenu_acha_id_cac_seq'::regclass); -- -- Name: depenses id_dep; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.depenses ALTER COLUMN id_dep SET DEFAULT nextval('public.depenses_id_dep_seq'::regclass); -- -- Name: eleves id_el; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.eleves ALTER COLUMN id_el SET DEFAULT nextval('public.eleves_id_el_seq'::regclass); -- -- Name: fournisseurs id_fo; Type: DEFAULT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.fournisseurs ALTER COLUMN id_fo SET DEFAULT nextval('public.fournisseurs_id_fo_seq'::regclass); -- -- Name: inscriptions id_ins; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.inscriptions ALTER COLUMN id_ins SET DEFAULT nextval('public.inscriptions_id_ins_seq'::regclass); -- -- Name: parcours id; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.parcours ALTER COLUMN id SET DEFAULT nextval('public.parcours_id_seq'::regclass); -- -- Name: pay_per id_pa; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.pay_per ALTER COLUMN id_pa SET DEFAULT nextval('public.pay_per_id_pa_seq'::regclass); -- -- Name: payements id_pay; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.payements ALTER COLUMN id_pay SET DEFAULT nextval('public.payements_id_pay_seq'::regclass); -- -- Name: personnels id_p; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.personnels ALTER COLUMN id_p SET DEFAULT nextval('public.personnels_id_p_seq'::regclass); -- -- Name: tuteurs id_tu; Type: DEFAULT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.tuteurs ALTER COLUMN id_tu SET DEFAULT nextval('public.tuteurs_id_tu_seq'::regclass); -- -- Data for Name: achats; Type: TABLE DATA; Schema: public; Owner: kone -- COPY public.achats (id_ac, date_ac, montant, montant_paye, etat_liv, libele, etat, id_fo) FROM stdin; 15 2020-03-31 4000 3000 P Achat 1 23 \. -- -- Data for Name: calendriers; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.calendriers (id_d, mois) FROM stdin; 1 Janvier 2 Fevrier 3 Mars 4 Avril 5 Mai 6 Juin 7 Juillet 9 Septembre 10 Octobre 11 Novembre 12 Decembre 8 Aout \. -- -- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: kone -- COPY public.categories (id_cat, nom_cat) FROM stdin; 1 Professeur 2 Secretariat 3 Asseinissement 4 Medecin \. -- -- Data for Name: classes; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.classes (id_cl, nom_cl, niveau) FROM stdin; 69 AL HOUROUF HIJA Niveau 001 66 BOUACHIR Niveau 000 25 ABDULLAH IBN ABASS Niveau 004 24 ABDOULLAH BEN MASSOUD Niveau 003 19 ALI BEN ABI TALIB Niveau 002 \. -- -- Data for Name: contenu_acha; Type: TABLE DATA; Schema: public; Owner: kone -- COPY public.contenu_acha (id_cac, id_ac, prix_acha, qte_pro, qte_liv, nom_pro) FROM stdin; \. -- -- Data for Name: depenses; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.depenses (id_dep, motif, date_dep, montant, id_pa) FROM stdin; 26 BALLON 2020-02-14 2000 \N 27 DON UN PAUVRE 2020-03-08 32000 \N 28 SAC 2020-03-15 67000 \N 37 ESSENCE 2020-03-25 4000 \N 23 GAZOIL 2020-02-18 8500 \N 50 sss 2020-03-29 2000 \N \. -- -- Data for Name: eleves; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.eleves (id_el, nom_el, prenom_el, date_nais, id_cl, id_tu) FROM stdin; 17 SALIM SAMASSA 2005-11-29 25 7 18 IBRAHIM KONE 2000-03-12 25 11 19 SIAKA TRAORE 2000-03-01 25 12 20 MOHAMED TRAORE 2020-03-11 25 13 21 ADAMA DOUMBIA 2020-03-12 24 12 22 ABOUBACAR TRAORE 2010-01-02 66 10 23 YUNUSS CISSE 2010-01-14 19 10 \. -- -- Data for Name: fournisseurs; Type: TABLE DATA; Schema: public; Owner: kone -- COPY public.fournisseurs (id_fo, prenom_f, nom_f, adresse, contact) FROM stdin; 23 BOUBA SAMAKE KATI 77667888 39 ssdd dssssssss ssssssssssssss 11111111111111111 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 \. -- -- Data for Name: inscriptions; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.inscriptions (id_ins, prenom_el, nom_el, date_nais, date_ins, nom_tu, tel1, tel2) FROM stdin; 4 Moussa Touré 1998-12-01 2019-09-12 Boubacar Samaké 99884561 \N 6 Seydou Sacko 1998-12-01 2019-09-12 Madou Koné 99884563 \N 7 Ali Bathily 1998-12-01 2019-09-12 Moussa Koné 99884564 \N \. -- -- Data for Name: parcours; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.parcours (id, id_el, nom_par, qte_m, qte_r, qte) FROM stdin; \. -- -- Data for Name: pay_per; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.pay_per (id_pa, date_pa, id_p, paye, reste, id_d, nom_p, tel_p) FROM stdin; 4 2020-02-04 17 90000 \N 4 Lamine DIAKITE 66772233 3 2020-02-05 16 75000 \N 3 Lamine DIAKITE 66772233 6 2020-03-22 16 75000 \N 2 SALIF SMAKE 90908877 10 2020-03-24 17 90000 \N 8 mklakmlak 987685432 32 2020-03-30 19 100000 \N 4 MOUNIR DJIRE 90908877 33 2020-03-30 19 100000 \N 11 MOUNIR DJIRE 89898977 14 2020-03-24 18 115000 \N 4 MOUSSE SACKO 191773173 17 2020-03-26 18 115000 \N 12 HOLA SANKARA 55667788 \. -- -- Data for Name: payements; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.payements (id_pay, date_pay, id_el, montant_p, nom_p, tel_p, id_d, total) FROM stdin; 49 2020-03-19 19 30000 Aboubacar SAMAKE 7777777 1 \N 55 2020-03-22 18 30000 ALI GUINDO 8877997 1 \N 48 2020-03-19 17 20000 MOUSSA YALKOYE 11111111 2 \N 52 2020-03-19 23 22 LALA 929901010 2 \N 51 2020-03-19 23 222 ISSA DJAROMA 9098877 1 \N 53 2020-03-19 23 455 MIMI 89898989 3 \N 56 2020-03-26 22 40000 NENE SAVANE 76767676 1 \N 57 2020-03-26 22 30000 HOHO 32323232 2 \N 58 2020-03-26 21 30000 DODO 22112233 1 \N \. -- -- Data for Name: personnels; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.personnels (id_p, prenom, nom, adresse, tel1, tel2, salaire, id_cl, id_cat) FROM stdin; 16 TRAORE HAMZA Korofina 77881122 9099887 140000 19 1 17 TOURE IBRAHIM Fana 77881122 9099887 140000 24 4 18 YOUSSOUF SISSOKO Kati 78787878 98989898 150000 19 1 19 SANOGO LEILA Faladie Sema 6767676 98989898 45000 19 1 \. -- -- Data for Name: tuteurs; Type: TABLE DATA; Schema: public; Owner: abdallah -- COPY public.tuteurs (id_tu, nom_tu, adresse, tel1, tel2) FROM stdin; 6 MOHAMED SYLLA FALADIE 778865544 0087654 7 KARIM FOMBA SEGOU 66160123 90904699 10 TEKETE COUMBA YOUSSOUF 988765544 9865433 11 MOHAMED COULIBALY SIKASSO 88776611 99006655 12 SEKOU DIAWARA SABALIBOUGOU 889767544 007654867 13 YAHYA SONKE HAMD ACI 2000 98765433 5567899998 \. -- -- Name: achats_id_ac_seq; Type: SEQUENCE SET; Schema: public; Owner: kone -- SELECT pg_catalog.setval('public.achats_id_ac_seq', 15, true); -- -- Name: categories_id_cat_seq; Type: SEQUENCE SET; Schema: public; Owner: kone -- SELECT pg_catalog.setval('public.categories_id_cat_seq', 4, true); -- -- Name: classes_id_cl_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.classes_id_cl_seq', 78, true); -- -- Name: contenu_acha_id_cac_seq; Type: SEQUENCE SET; Schema: public; Owner: kone -- SELECT pg_catalog.setval('public.contenu_acha_id_cac_seq', 1, true); -- -- Name: depenses_id_dep_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.depenses_id_dep_seq', 50, true); -- -- Name: eleves_id_el_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.eleves_id_el_seq', 27, true); -- -- Name: fournisseurs_id_fo_seq; Type: SEQUENCE SET; Schema: public; Owner: kone -- SELECT pg_catalog.setval('public.fournisseurs_id_fo_seq', 55, true); -- -- Name: inscriptions_id_ins_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.inscriptions_id_ins_seq', 7, true); -- -- Name: mois_id_dt_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.mois_id_dt_seq', 12, true); -- -- Name: parcours_id_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.parcours_id_seq', 1, false); -- -- Name: pay_per_id_pa_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.pay_per_id_pa_seq', 38, true); -- -- Name: payements_id_pay_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.payements_id_pay_seq', 58, true); -- -- Name: personnels_id_p_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.personnels_id_p_seq', 21, true); -- -- Name: tuteurs_id_tu_seq; Type: SEQUENCE SET; Schema: public; Owner: abdallah -- SELECT pg_catalog.setval('public.tuteurs_id_tu_seq', 14, true); -- -- Name: classes cl_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.classes ADD CONSTRAINT cl_pkey PRIMARY KEY (id_cl); -- -- Name: classes cl_unik; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.classes ADD CONSTRAINT cl_unik UNIQUE (nom_cl); -- -- Name: depenses dep_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.depenses ADD CONSTRAINT dep_pkey PRIMARY KEY (id_dep); -- -- Name: eleves el_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.eleves ADD CONSTRAINT el_pkey PRIMARY KEY (id_el); -- -- Name: eleves el_unik; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.eleves ADD CONSTRAINT el_unik UNIQUE (nom_el, prenom_el, date_nais); -- -- Name: inscriptions ins_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.inscriptions ADD CONSTRAINT ins_pkey PRIMARY KEY (id_ins); -- -- Name: achats p_acha_key; Type: CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.achats ADD CONSTRAINT p_acha_key PRIMARY KEY (id_ac); -- -- Name: contenu_acha p_cont_key; Type: CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.contenu_acha ADD CONSTRAINT p_cont_key PRIMARY KEY (id_cac); -- -- Name: fournisseurs p_four_key; Type: CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.fournisseurs ADD CONSTRAINT p_four_key PRIMARY KEY (id_fo); -- -- Name: calendriers p_key; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.calendriers ADD CONSTRAINT p_key PRIMARY KEY (id_d); -- -- Name: pay_per pa_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.pay_per ADD CONSTRAINT pa_pkey PRIMARY KEY (id_pa); -- -- Name: parcours par_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.parcours ADD CONSTRAINT par_pkey PRIMARY KEY (id); -- -- Name: payements pay_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.payements ADD CONSTRAINT pay_pkey PRIMARY KEY (id_pay); -- -- Name: categories pcat_key; Type: CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.categories ADD CONSTRAINT pcat_key PRIMARY KEY (id_cat); -- -- Name: personnels per_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.personnels ADD CONSTRAINT per_pkey PRIMARY KEY (id_p); -- -- Name: personnels per_unik; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.personnels ADD CONSTRAINT per_unik UNIQUE (prenom, nom, tel1); -- -- Name: tuteurs tu_pkey; Type: CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.tuteurs ADD CONSTRAINT tu_pkey PRIMARY KEY (id_tu); -- -- Name: personnels cat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.personnels ADD CONSTRAINT cat_fkey FOREIGN KEY (id_cat) REFERENCES public.categories(id_cat); -- -- Name: eleves classe_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.eleves ADD CONSTRAINT classe_fkey FOREIGN KEY (id_cl) REFERENCES public.classes(id_cl) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: personnels classe_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.personnels ADD CONSTRAINT classe_fkey FOREIGN KEY (id_cl) REFERENCES public.classes(id_cl); -- -- Name: pay_per date_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.pay_per ADD CONSTRAINT date_fkey FOREIGN KEY (id_d) REFERENCES public.calendriers(id_d); -- -- Name: payements eleve_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.payements ADD CONSTRAINT eleve_fkey FOREIGN KEY (id_el) REFERENCES public.eleves(id_el); -- -- Name: contenu_acha f_acha_key; Type: FK CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.contenu_acha ADD CONSTRAINT f_acha_key FOREIGN KEY (id_ac) REFERENCES public.achats(id_ac) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: achats f_four_key; Type: FK CONSTRAINT; Schema: public; Owner: kone -- ALTER TABLE ONLY public.achats ADD CONSTRAINT f_four_key FOREIGN KEY (id_fo) REFERENCES public.fournisseurs(id_fo); -- -- Name: payements mois_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.payements ADD CONSTRAINT mois_fkey FOREIGN KEY (id_d) REFERENCES public.calendriers(id_d); -- -- Name: parcours par_fkey; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.parcours ADD CONSTRAINT par_fkey FOREIGN KEY (id_el) REFERENCES public.eleves(id_el) ON UPDATE CASCADE ON DELETE CASCADE; -- -- Name: eleves tuteur_key; Type: FK CONSTRAINT; Schema: public; Owner: abdallah -- ALTER TABLE ONLY public.eleves ADD CONSTRAINT tuteur_key FOREIGN KEY (id_tu) REFERENCES public.tuteurs(id_tu) ON UPDATE CASCADE ON DELETE CASCADE; -- -- PostgreSQL database dump complete --
-- ---------------------------- -- Table structure for flyway_schema_history -- ---------------------------- # DROP TABLE IF EXISTS `flyway_schema_history`; # CREATE TABLE `flyway_schema_history` ( # `installed_rank` int(11) NOT NULL, # `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, # `description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, # `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, # `script` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, # `checksum` int(11) NULL DEFAULT NULL, # `installed_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, # `installed_on` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), # `execution_time` int(11) NOT NULL, # `success` tinyint(1) NOT NULL, # PRIMARY KEY (`installed_rank`) USING BTREE, # INDEX `flyway_schema_history_s_idx`(`success`) USING BTREE # ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table company ( id bigint auto_increment not null, name varchar(255) not null, constraint pk_company primary key (id) ); create table employee ( id bigint auto_increment not null, last_name varchar(255) not null, name varchar(255) not null, is_controller boolean default false not null, company_id bigint not null, pw varchar(255) not null, constraint pk_employee primary key (id) ); create table project ( id bigint auto_increment not null, description varchar(255) not null, estimated_working_hours double default 0.00 not null, constraint pk_project primary key (id) ); create table task ( id bigint auto_increment not null, time_spent double default 0.00 not null, calendar_week integer not null, day integer not null, month integer not null, year integer not null, notes varchar(255), project_id bigint not null, employee_id bigint, constraint pk_task primary key (id) ); alter table employee add constraint fk_employee_company_id foreign key (company_id) references company (id) on delete restrict on update restrict; create index ix_employee_company_id on employee (company_id); alter table task add constraint fk_task_project_id foreign key (project_id) references project (id) on delete restrict on update restrict; create index ix_task_project_id on task (project_id); alter table task add constraint fk_task_employee_id foreign key (employee_id) references employee (id) on delete restrict on update restrict; create index ix_task_employee_id on task (employee_id); # --- !Downs alter table employee drop constraint if exists fk_employee_company_id; drop index if exists ix_employee_company_id; alter table task drop constraint if exists fk_task_project_id; drop index if exists ix_task_project_id; alter table task drop constraint if exists fk_task_employee_id; drop index if exists ix_task_employee_id; drop table if exists company; drop table if exists employee; drop table if exists project; drop table if exists task;
create table subscriptions( SubscriptionGuid nvarchar(400) primary key, SubscriptionName nvarchar(max) not null, Currency nvarchar(max) not null )
CREATE DATABASE `Languages`; USE Languages;
USE Conferencias_DB INSERT INTO _Instituicao VALUES ('Instituicao 1', 'Portugal','Rua X'), ('Instituicao 2', 'Portugal','Rua Y'), ('Instituicao 3', 'Portugal','Rua Z'), ('Instituicao 4', 'Portugal','Rua A'), ('Instituicao 5', 'Portugal','Rua B') INSERT INTO _Utilizador VALUES ('user1@email.com', 'Zacarias Mateus', 'Instituicao 1'), ('user2@email.com', 'Diaogo Estronco', 'Instituicao 1'), ('user3@email.com', 'Mariana Clacanhoto', 'Instituicao 1'), ('user4@email.com', 'Matias Balde', 'Instituicao 2'), ('user5@email.com', 'Ana Cabral', 'Instituicao 2'), ('user6@email.com', 'Aladin Al-Muhamed', 'Instituicao 2'), ('user7@email.com', 'Maria do Pito', 'Instituicao 3'), ('user8@email.com', 'Raul Canilhas', 'Instituicao 3'), ('user9@email.com', 'Ivan Siderov', 'Instituicao 3'), ('user10@email.com', 'Makukula de Azevedo', 'Instituicao 4'), ('user11@email.com', 'Joana Vasconcelos', 'Instituicao 4'), ('user12@email.com', 'Carl Carlson', 'Instituicao 4'), ('user13@email.com', 'Ping Xong Pi', 'Instituicao 5'), ('user14@email.com', 'Elizabeth McFree', 'Instituicao 5'), ('user15@email.com', 'Donald Obama', 'Instituicao 5') INSERT INTO _Conferencia VALUES ('Conferencia 1', 2010, 'C1', 1, '2010-01-01', '2010-02-01'), ('Conferencia 2', 2011, 'C2', 4, '2011-01-01', '2011-02-01'), ('Conferencia 3', 2012, 'C3', 7, '2012-01-01', '2012-02-01'), ('Conferencia 4', 2013, 'C4', 10, '2014-01-01', '2013-02-01'), ('Conferencia 5', 2014, 'C5', 13, '2014-01-01', '2014-02-01') INSERT INTO _Registo VALUES (1, 'Conferencia 1', 2010, 'presidente'), (2, 'Conferencia 1', 2010, 'autor'), (3, 'Conferencia 1', 2010, 'revisor'), (4, 'Conferencia 2', 2011, 'presidente'), (5, 'Conferencia 2', 2011, 'autor'), (6, 'Conferencia 2', 2011, 'revisor'), (7, 'Conferencia 3', 2012, 'presidente'), (8, 'Conferencia 3', 2012, 'autor'), (9, 'Conferencia 3', 2012, 'revisor'), (10, 'Conferencia 4', 2013, 'presidente'), (11, 'Conferencia 4', 2013, 'autor'), (12, 'Conferencia 4', 2013, 'revisor'), (13, 'Conferencia 5', 2014, 'presidente'), (14, 'Conferencia 5', 2014, 'autor'), (15, 'Conferencia 5', 2014, 'revisor') INSERT INTO _Artigo VALUES (1,'This is a summary 1.', 'em revisao', 'Conferencia 1', 2010, '2009-12-01'), (2,'This is a summary 2.', 'aceite', 'Conferencia 2', 2011, '2010-12-01'), (3,'This is a summary 3.', 'em revisao', 'Conferencia 3', 2012, '2011-12-01'), (4,'This is a summary 4.', 'rejeitado', 'Conferencia 4', 2013, '2012-12-01'), (5,'This is a summary 5.', 'aceite', 'Conferencia 5', 2014, '2013-12-01') INSERT INTO _Autor VALUES (1, 2), (2, 5), (3, 8), (4, 11), (5, 14) INSERT INTO _Ficheiro VALUES (1, 'This is text 1.', 1), (2, 'This is text 2.', 2), (3, 'This is text 3.', 3), (4, 'This is text 4.', 4), (5, 'This is text 5.', 5) INSERT INTO _Revisor VALUES (1, 3), (1, 6), (1, 9), (1, 12), (1, 15) INSERT INTO _Revisao VALUES (1, 3, 'This is revision 1', 45), (1, 6, 'This is revision 2', 50), (1, 9, 'This is revision 3', 62), (1, 12, 'This is revision 4', 73), (1, 15, 'This is revision 5', 90)
ALTER TABLE COI_USER_ROLES ADD CONSTRAINT FK_COI_USER_ROLES FOREIGN KEY (COI_DISCLOSURE_ID) REFERENCES COI_DISCLOSURE (COI_DISCLOSURE_ID) /
-- Table - employee -- Create a file called employee.sql and write out the code for the following problems: -- 1. List all employee first and last names only that live in Calgary. select first_name, last_name from employee where city = 'Calgary'; -- 2. Find the birthdate for the youngest employee. select MAX(birth_date) from employee; -- 3. Find the birthdate for the oldest employee. select MIN(birth_date) from employee; -- 4. Find everyone that reports to Nancy Edwards (Use the ReportsTo column). * You will need to query the employee table to find the Id for Nancy Edwards select employee_id from employee where first_name = 'Nancy' AND last_name = 'Edwards'; select * from employee where reports_to = 2; -- 5. Count how many people live in Lethbridge. select COUNT(city) from employee where city = 'Lethbridge';
drop table if exists todolist; create table if not exists todolist ( id serial primary key, item varchar (128) not null, descr text not null, created timestamp not null default now(), done bool not null default false ); insert into todolist (item, descr, created, done) values ('Выполнить задание #6872 junior.pack3.p1.ch1.task0', 'Выполнить задание из видео #6872 junior.pack3.p1.ch1 Конфигурирование.', '2018-03-06 9:54:00', true); insert into todolist (item, descr, created) values ('Выполнить задание #3786 junior.pack3.p1.ch1.task1', 'необходимо создать простое приложение todolist. 1. одна таблица в базе item. id, desc. created, done. 2. веб приложение должно иметь одну страницу index.html. 3. все данные на форму загружаються через ajax. 4. в верху форма. добавить новое задание. описание. 5. список всех заданий. и галка выполено или нет. 6. вверху добавить галку. показать все. если включена. то показывать все. если нет. то только те что не выполены done = false. 7. данные должны сохраняться через hibernate, ', '2018-03-20 23:44:00'); insert into todolist (item, descr, created) values ('Купить хлеба', 'Купить хлеба на ярмарке.', '2018-03-20 23:53:00'); insert into todolist (item, descr) values ('Выполнить задание #2086 junior.pack3.p1.ch2.task1', 'Выполнить задание #2086 junior.pack3.p1.ch2.task1 Реализовать модели и связи для задание SQL хранилище машин.');
-- Host: 127.0.0.1 Database: ambima -- ------------------------------------------------------ -- -- Dumping data for table `TaxaSelic` -- DROP TABLE IF EXISTS TaxaSelic; CREATE TABLE TaxaSelic ( id INT AUTO_INCREMENT PRIMARY KEY, data_referencia DATE NOT NULL, estimativa_taxa_selic DECIMAL(20, 2) NOT NULL ); -- Dump completed
/* Drop procedures */ drop procedure if exists getUniqueUserCount; /* Drop on the fly created tables: log_analyze_user__% */ -- Increase memory to avoid truncating string, adjust according to your needs SET group_concat_max_len = 1024 * 1024 * 10; -- Generate drop command and assign to variable SET @dropcmd = (SELECT CONCAT('DROP TABLE IF EXISTS ',GROUP_CONCAT(CONCAT(table_schema,'.',table_name)),';') FROM information_schema.tables WHERE table_schema='surfnet_conext_logfiles' AND table_name LIKE 'log_analyze_user__%'); -- Drop tables PREPARE stmt FROM @dropcmd; EXECUTE stmt; DEALLOCATE PREPARE stmt; /* Always drop */ DROP TABLE IF EXISTS log_analyze_semaphore; DROP TABLE IF EXISTS log_analyze_stats; DROP TABLE IF EXISTS log_analyze_provider; DROP TABLE IF EXISTS log_analyze_idp; DROP TABLE IF EXISTS log_analyze_sp; DROP TABLE IF EXISTS log_analyze_day; DROP TABLE IF EXISTS log_analyze_chunk;
/* TRIGGER*/ CREATE TRIGGER NOME BEFORE/AFTER INSERT/DELETE/UPDATE ON TABELA FOR EACH ROW (PARA CADA LINHA) BEGIN -> INICIO QUALQUER COMANDO SQL END -> FIM CREATE DATABASE TRIGGERS; USE TRIGGERS; CREATE TABLE USUARIO ( IDUSUARIO INT PRIMARY KEY AUTO_INCREMENT, NOME VARCHAR(30), LOGIN VARCHAR(30), SENHA VARCHAR(100) ); CREATE TABLE BKP_USUARIO( IDBACKUP INT PRIMARY KEY AUTO_INCREMENT, IDUSUARIO INT, NOME VARCHAR(30), LOGIN VARCHAR(30) ); /* CRIANDO A TRIGGER*/ DELIMITER $ CREATE TRIGGER BACKUP_USE BEFORE DELETE ON USUARIO FOR EACH ROW BEGIN INSERT INTO BKP_USUARIO(IDUSUARIO,NOME,LOGIN)VALUES(OLD.IDUSUARIO, OLD.NOME, OLD.LOGIN); END $ DELIMITER ; INSERT INTO USUARIO VALUES(NULL,'GABRIEL','CARVALHO57','KFJAFA$AKLDJ21DA'); INSERT INTO USUARIO VALUES(NULL,'GUILHERME','GUI2402','L6214EQWD214WFDR24@##@!'); SELECT * FROM USUARIO; DELETE FROM USUARIO WHERE IDUSUARIO = 2; SELECT * FROM BKP_USUARIO; /* COMUNICAÇÂO ENTRE BANCOS */ CREATE DATABASE LOJA; USE LOJA; CREATE TABLE PRODUTO( IDPRODUTO INT PRIMARY KEY AUTO_INCREMENT, NOME VARCHAR(30), VALOR FLOAT(10,2) ); INSERT INTO PRODUTO VALUES(NULL, "TABLET 10 P", 542.88); INSERT INTO PRODUTO VALUES(NULL, "SAMSUNG SM-T280", 942.61); INSERT INTO PRODUTO VALUES(NULL, "TECLADO MECANICO", 242.52); INSERT INTO PRODUTO VALUES(NULL, "MONITOR 30 P", 1500.00); CREATE DATABASE BACKUP; USE BACKUP; CREATE TABLE BKP_PRODUTO( IDBKP INT PRIMARY KEY AUTO_INCREMENT, IDPRODUTO INT, NOME VARCHAR(30), VALOR FLOAT(10,2) ); USE LOJA; STATUS; INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL,1000, 'test', 0.0); SELECT * FROM BACKUP.BKP_PRODUTO; /*EM QUE BANCO ESTOU*/ STATUS; DELIMITER $ CREATE TRIGGER BACKUP_PRODUTO AFTER INSERT ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES (NULL, NEW.IDPRODUTO,NEW.NOME,NEW.VALOR); END $ DELIMITER ; INSERT INTO PRODUTO VALUES(NULL,'RASPBERRY PI 3',300); INSERT INTO PRODUTO VALUES(NULL,'ARDUINO',200); INSERT INTO PRODUTO VALUES(NULL,'HDD',330); SELECT * FROM BACKUP.BKP_PRODUTO; ALTER TABLE BACKUP.BKP_PRODUTO ADD EVENTO CHAR(1); DROP TRIGGER BACKUP_PRODUTO; DROP TRIGGER BACKUP_PRODUTO_DEL; /*TRIGGER DELETE */ DELIMITER $ CREATE TRIGGER BACKUP_PRODUTO_DEL BEFORE DELETE ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES (NULL, OLD.IDPRODUTO,OLD.NOME,OLD.VALOR,'D'); END $ /*TRIGGER INSERT*/ CREATE TRIGGER BACKUP_PRODUTO AFTER INSERT ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES (NULL, NEW.IDPRODUTO,NEW.NOME,NEW.VALOR,'I'); END $ DELIMITER ; SELECT * FROM PRODUTO; DELETE FROM PRODUTO WHERE IDPRODUTO IN(10,11); SELECT * FROM BACKUP.BKP_PRODUTO; /* TRIGGER DE AUDITORIA */ DROP DATABASE LOJA; DROP DATABASE BACKUP; CREATE DATABASE LOJA; USE LOJA; CREATE TABLE PRODUTO( IDPRODUTO INT PRIMARY KEY AUTO_INCREMENT, NOME VARCHAR(30), VALOR FLOAT(10,2) ); INSERT INTO PRODUTO VALUES(NULL, "TABLET 10 P", 542.88); INSERT INTO PRODUTO VALUES(NULL, "SAMSUNG SM-T280", 942.61); INSERT INTO PRODUTO VALUES(NULL, "TECLADO MECANICO", 242.52); INSERT INTO PRODUTO VALUES(NULL, "MONITOR 30 P", 1500.00); SELECT NOW(); SELECT CURRENT_USER(); CREATE DATABASE BACKUP; USE BACKUP; CREATE TABLE BKP_PRODUTO( IDBACKUP INT PRIMARY KEY AUTO_INCREMENT, IDPRODUTO INT, NOME VARCHAR(30), VALOR_ORIGINAL FLOAT(10,2), VALOR_ALTERADO FLOAT(10,2), DATE DATETIME, USUARIO VARCHAR(30), EVENTO CHAR(1) ); USE LOJA; DELIMITER $ CREATE TRIGGER NOME AFTER UPDATE ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL,OLD.IDPRODUTO,OLD.NOME,OLD.VALOR, NEW.VALOR,NOW(),CURRENT_USER(),'U'); END $ DELIMITER ; SELECT * FROM PRODUTO; UPDATE PRODUTO SET VALOR = 1345.42 WHERE IDPRODUTO = 4; SELECT * FROM PRODUTO; SELECT * FROM BACKUP.BKP_PRODUTO;
Anotações gerais: - Converter para o Date no insert: CONVERT(DATETIME,01/01/2021,103) ------> Numero especifica o formato https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-2017 - Instalar pacote NuGet Dapper ORACLE Sql Server ---------- ------------ desc exec sp_helper [nome_da_tabela]
-- create database db_pizzaria_legal /*create table categoria ( id int primary key auto_increment, tipo varchar (50), cozimento varchar (50) ); create table pizza ( nome varchar (50), preco varchar(3), tamanho varchar (1), bordarecheada boolean, queijoextra varchar (1), id_categoria int not null, foreign key (id_categoria) references categoria (id) ); insert into categoria (tipo, cozimento) values ("Portuguesa", "Forno a lenha"), ("Calabresa", "Microondas"), ("Abobrinha", "Microondas"), ("Anchova", "Forno a lenha"), ("Brigadeiro", "Forno a lenha"); insert into pizza (nome, preco, tamanho, bordarecheada, queijoextra, id_categoria) values ("Salgada", 20, "G", true, true, 1), ("Salgada", 50, "P", false, false, 4), ("Salgada", 60, "M", true, false, 3), ("Salgada", 50, "P", false, true, 2), ("Salgada", 50, "P", false, true, 1), ("Doce", 50, "P", false, false, 5), ("Doce", 50, "P", true, false, 5), ("Salgada", 50, "P", true, true, 4);*/ -- select * from pizza where preco > 45; -- select * from pizza where preco > 29 and preco < 60; -- select * from categoria where tipo like "%C%"; -- select * from categoria inner join pizza on categoria.id = pizza.id_categoria; -- select * from categoria inner join pizza on categoria.id = pizza.id_categoria where tipo = "Brigadeiro";
CREATE TABLE message ( sender text, date text, word text, message_id text, recipient text, subject text, PRIMARY KEY ((sender, date), word, message_id));
CREATE TABLE `tad_repair` ( `repair_sn` smallint(6) unsigned NOT NULL auto_increment COMMENT '修繕編號', `repair_title` varchar(255) NOT NULL default '' COMMENT '報修內容', `repair_place` varchar(255) NOT NULL default '' COMMENT '報修地點', `repair_content` text NOT NULL COMMENT '詳細說明', `repair_date` datetime NULL COMMENT '報修日期', `repair_status` varchar(255) NOT NULL default '' COMMENT '嚴重status程度', `repair_uid` mediumint(8) unsigned NOT NULL default '0' COMMENT '報修者', `unit_sn` smallint(6) unsigned NOT NULL default '0' COMMENT '通知單位', `fixed_uid` varchar(255) NOT NULL default '' COMMENT '回覆者', `fixed_date` datetime NULL COMMENT '回覆日期', `fixed_status` varchar(255) NOT NULL default '' COMMENT '處理狀況', `fixed_content` text NOT NULL COMMENT '回覆內容', PRIMARY KEY (`repair_sn`), KEY (`unit_sn`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `tad_repair_unit` ( `unit_sn` smallint(6) unsigned NOT NULL auto_increment COMMENT '單位編號', `unit_title` varchar(255) NOT NULL default '' COMMENT '單位名稱', `unit_admin` text NOT NULL COMMENT '管理人員', PRIMARY KEY (`unit_sn`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `tad_repair_files_center` ( `files_sn` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '檔案流水號', `col_name` varchar(255) NOT NULL default '' COMMENT '欄位名稱', `col_sn` smallint(5) unsigned NOT NULL default 0 COMMENT '欄位編號', `sort` smallint(5) unsigned NOT NULL default 0 COMMENT '排序', `kind` enum('img','file') NOT NULL default 'img' COMMENT '檔案種類', `file_name` varchar(255) NOT NULL default '' COMMENT '檔案名稱', `file_type` varchar(255) NOT NULL default '' COMMENT '檔案類型', `file_size` int(10) unsigned NOT NULL default 0 COMMENT '檔案大小', `description` text NOT NULL COMMENT '檔案說明', `counter` mediumint(8) unsigned NOT NULL default 0 COMMENT '下載人次', `original_filename` varchar(255) NOT NULL default '' COMMENT '檔案名稱', `hash_filename` varchar(255) NOT NULL default '' COMMENT '加密檔案名稱', `sub_dir` varchar(255) NOT NULL default '' COMMENT '檔案子路徑', `upload_date` datetime NULL COMMENT '上傳時間', `uid` mediumint(8) unsigned NOT NULL default 0 COMMENT '上傳者', `tag` varchar(255) NOT NULL default '' COMMENT '註記', PRIMARY KEY (`files_sn`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 --data source=01c212c5-0765-4ddf-9217-a1a1014fcaf5.sqlserver.sequelizer.com --initial catalog=db01c212c507654ddf9217a1a1014fcaf5 --persist security info=True --user id=pnbsjvrwrjarbygj --password=ifNJEcfxyaLHTKADke4it6kwuhmT7nWddN3Tf4YJzMtvnfhf4DC7dfdk3rowXtym --delete from Match where Id > 519 --delete from PlayerStats where Id > 3703 --delete from Player where Id > 75 select top(10) * from Match order by Id desc select top(10) * from PlayerStats order by Id desc select * from player where Id = 26 order by Id desc --update match set StateId = null where Id = 516 --update player set StateId = null where Id = 73 --update player set Number = 77 where Id = 26
create table post (id INTEGER PRIMARY KEY AUTOINCREMENT, title varchar(255) not null, content text not null); insert into post(title,content) values ('Jesse','123');
CREATE TABLE country ( Code String ; Name String ; Continent String DEFAULT 'Asia', Region String ; SurfaceArea double ; IndepYear int ; Population int ; LifeExpectancy double ; GNP double ; GNPOld double ; LocalName String ; GovernmentForm String ; HeadOfState text, Capital int ; Code2 String DEFAULT NULL
-- ---------------------------- -- Table structure for announcement -- ---------------------------- DROP TABLE IF EXISTS `announcement`; CREATE TABLE `announcement` ( `id` int(11) NOT NULL AUTO_INCREMENT, `imgUrl` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `detailUrl` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `createDate` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `state` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Records of announcement -- ---------------------------- INSERT INTO `announcement` VALUES ('1', '/visitshop/img/ann/ann1.jpg', null, '2016-07-20', '0'); INSERT INTO `announcement` VALUES ('2', '/visitshop//img/ann/ann1.jpg', null, '2016-07-20', '0'); INSERT INTO `announcement` VALUES ('3', '/visitshop//img/ann/ann1.jpg', null, '2016-07-20', '0'); INSERT INTO `announcement` VALUES ('4', '/visitshop//img/ann/ann1.jpg', null, '2016-07-20', '0');
查找各个部门当前(to_date='9999-01-01')领导当前薪水详情以及其对应部门编号dept_no SELECT s.*,d.dept_no FROM salaries AS s INNER JOIN dept_manager AS d ON d.emp_no = s.emp_no WHERE d.to_date = '9999-01-01' AND s.to_date = '9999-01-01';
CREATE USER [gzAdminUser] FOR LOGIN [gzAdminUser];
-- 2008-08-15, jsled: add "group" column to Adjunct table ALTER TABLE app_adjunct ADD "group" varchar(30) NOT NULL DEFAULT "";
--rewrite hypertable catalog table because previous updates messed up --and the table is now using the missingval optimization which doesnt work --with catalog scans; Note this is equivalent to a VACUUM FULL --but that command cannot be used inside an update script. CLUSTER _timescaledb_catalog.hypertable USING hypertable_pkey; ALTER TABLE _timescaledb_catalog.hypertable SET WITHOUT CLUSTER; --The metadata table also has the missingval optimization; CLUSTER _timescaledb_catalog.metadata USING metadata_pkey; ALTER TABLE _timescaledb_catalog.metadata SET WITHOUT CLUSTER;
DROP TABLE "USER"; DROP TABLE ROOM; DELETE FROM "USER"; DELETE FROM ROOM; CREATE TABLE IF NOT EXISTS ROOM ( id INT PRIMARY KEY, room_name VARCHAR(255) ); CREATE TABLE IF NOT EXISTS "USER" ( id INT PRIMARY KEY, name VARCHAR(255), room_number INTEGER , FOREIGN KEY (room_number) REFERENCES ROOM(id) ON DELETE CASCADE );
INSERT INTO routines(id, name, created_at) VALUES (1, '로아큐탄', NULL); INSERT INTO routines(id, name, created_at) VALUES (2, '독시사이클린', NULL); INSERT INTO routines(id, name, created_at) VALUES (3, '미노사이클린', NULL); INSERT INTO routines(id, name, created_at) VALUES (4, 'AHA', NULL); INSERT INTO routines(id, name, created_at) VALUES (5, 'BHA', NULL); INSERT INTO routines(id, name, created_at) VALUES (6, 'PHA', NULL); INSERT INTO routines(id, name, created_at) VALUES (7, '벤조일페록사이드', NULL); INSERT INTO routines(id, name, created_at) VALUES (8, '디페린', NULL); INSERT INTO routines(id, name, created_at) VALUES (9, '비타민 A', NULL); INSERT INTO routines(id, name, created_at) VALUES (10, '비타민 D', NULL);
-- phpMyAdmin SQL Dump -- version 2.9.0.2 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 07-05-2007 a las 12:36:40 -- Versión del servidor: 5.0.24 -- Versión de PHP: 5.1.6 -- -- Base de datos: `rrhh` -- CREATE DATABASE `rrhh` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `rrhh`; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `banco` -- CREATE TABLE `banco` ( `idbanco` tinyint(4) NOT NULL auto_increment, `banco` varchar(40) NOT NULL, PRIMARY KEY (`idbanco`), UNIQUE KEY `banco` (`banco`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `banco` -- INSERT INTO `banco` VALUES (1, 'Banco De Venezuela'); INSERT INTO `banco` VALUES (2, 'Banco Nacional De Crédito'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `caasistencia` -- CREATE TABLE `caasistencia` ( `idasistencia` int(11) NOT NULL auto_increment, `fecha` date NOT NULL, `hora` time NOT NULL, `cedula` int(11) NOT NULL, PRIMARY KEY (`idasistencia`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `caasistencia` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `caclasepermiso` -- CREATE TABLE `caclasepermiso` ( `idclase` tinyint(4) NOT NULL auto_increment, `clase` varchar(40) NOT NULL, `dias` tinyint(4) NOT NULL, PRIMARY KEY (`idclase`), UNIQUE KEY `clase` (`clase`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `caclasepermiso` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cahorario` -- CREATE TABLE `cahorario` ( `idhorario` tinyint(4) NOT NULL auto_increment, `descripcion` varchar(20) NOT NULL, `hora` time default NULL, `lunes` tinyint(4) default NULL, `martes` tinyint(4) default NULL, `miercoles` tinyint(4) default NULL, `jueves` tinyint(4) default NULL, `viernes` tinyint(4) default NULL, `sabado` tinyint(4) default NULL, `domingo` tinyint(4) default NULL, PRIMARY KEY (`idhorario`), KEY `descripcion` (`descripcion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `cahorario` -- INSERT INTO `cahorario` VALUES (1, 'Administrativo1', '08:00:00', 1, 1, 1, 1, 1, 4, 4); INSERT INTO `cahorario` VALUES (2, 'obrero', '12:00:00', 1, 1, 1, 1, 1, 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `camenu` -- CREATE TABLE `camenu` ( `idmenu` tinyint(4) NOT NULL auto_increment, `nombremenu` varchar(20) NOT NULL, PRIMARY KEY (`idmenu`), UNIQUE KEY `nombremenu` (`nombremenu`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcar la base de datos para la tabla `camenu` -- INSERT INTO `camenu` VALUES (3, 'Consultas'); INSERT INTO `camenu` VALUES (5, 'Jornadas'); INSERT INTO `camenu` VALUES (2, 'Mantenimientos'); INSERT INTO `camenu` VALUES (4, 'Reportes'); INSERT INTO `camenu` VALUES (1, 'Seguridad'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `camenu_submenu` -- CREATE TABLE `camenu_submenu` ( `idrelacion` int(11) NOT NULL auto_increment, `idmenu` tinyint(4) NOT NULL, `idsubmenu` tinyint(4) NOT NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Volcar la base de datos para la tabla `camenu_submenu` -- INSERT INTO `camenu_submenu` VALUES (1, 1, 2); INSERT INTO `camenu_submenu` VALUES (2, 2, 5); INSERT INTO `camenu_submenu` VALUES (3, 2, 3); INSERT INTO `camenu_submenu` VALUES (4, 1, 4); INSERT INTO `camenu_submenu` VALUES (5, 2, 1); INSERT INTO `camenu_submenu` VALUES (6, 5, 6); INSERT INTO `camenu_submenu` VALUES (7, 2, 7); INSERT INTO `camenu_submenu` VALUES (8, 2, 8); INSERT INTO `camenu_submenu` VALUES (9, 2, 9); INSERT INTO `camenu_submenu` VALUES (10, 2, 10); INSERT INTO `camenu_submenu` VALUES (11, 4, 11); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `canivelsupervision` -- CREATE TABLE `canivelsupervision` ( `idnivel` tinyint(4) NOT NULL auto_increment, `nivelsupervision` varchar(20) NOT NULL, PRIMARY KEY (`idnivel`), UNIQUE KEY `nivelsupervision` (`nivelsupervision`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcar la base de datos para la tabla `canivelsupervision` -- INSERT INTO `canivelsupervision` VALUES (4, 'Asistente'); INSERT INTO `canivelsupervision` VALUES (3, 'Coordinador'); INSERT INTO `canivelsupervision` VALUES (2, 'Gerente'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cargo` -- CREATE TABLE `cargo` ( `idcargo` smallint(6) NOT NULL auto_increment, `cargo` varchar(30) NOT NULL, `salario` float NOT NULL, PRIMARY KEY (`idcargo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; -- -- Volcar la base de datos para la tabla `cargo` -- INSERT INTO `cargo` VALUES (2, 'Analista I', 0); INSERT INTO `cargo` VALUES (3, 'Analista II', 0); INSERT INTO `cargo` VALUES (4, 'Analista III', 0); INSERT INTO `cargo` VALUES (5, 'Analista IV', 0); INSERT INTO `cargo` VALUES (6, 'Coordinador I', 0); INSERT INTO `cargo` VALUES (7, 'Coordinador II', 0); INSERT INTO `cargo` VALUES (8, 'Coordinador III', 0); INSERT INTO `cargo` VALUES (9, 'Coordinador IV', 0); INSERT INTO `cargo` VALUES (10, 'Asistente Administrativo I', 0); INSERT INTO `cargo` VALUES (11, 'Asistente Administrativo II', 0); INSERT INTO `cargo` VALUES (12, 'Asistente Administrativo III', 0); INSERT INTO `cargo` VALUES (13, 'Asistente de Biblioteca I', 0); INSERT INTO `cargo` VALUES (14, 'Asistente de Biblioteca II', 0); INSERT INTO `cargo` VALUES (15, 'Asistente de Biblioteca III', 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `casubmenu` -- CREATE TABLE `casubmenu` ( `idsubmenu` tinyint(4) NOT NULL auto_increment, `nombresubmenu` varchar(20) NOT NULL, `url` varchar(150) default NULL, `orden` tinyint(4) default NULL, PRIMARY KEY (`idsubmenu`), UNIQUE KEY `nombresubmenu` (`nombresubmenu`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Volcar la base de datos para la tabla `casubmenu` -- INSERT INTO `casubmenu` VALUES (1, 'Menús', 'intranet.php?dir=mantenimientos/menu/framemenu.php', 1); INSERT INTO `casubmenu` VALUES (2, 'Usuarios', 'intranet.php?dir=about:blank', 2); INSERT INTO `casubmenu` VALUES (3, 'Perfiles', 'intranet.php?dir=about:blank', 3); INSERT INTO `casubmenu` VALUES (4, 'Salir', 'javascript:window.close();', 100); INSERT INTO `casubmenu` VALUES (5, 'Personal', 'intranet.php?dir=mantenimientos/personal/framepersonal.php', 5); INSERT INTO `casubmenu` VALUES (6, 'Horarios', 'intranet.php?dir=mantenimientos/horario/framehorario.php', 4); INSERT INTO `casubmenu` VALUES (7, 'Bancos', 'intranet.php?dir=mantenimientos/banco/framebanco.php', NULL); INSERT INTO `casubmenu` VALUES (8, 'Gerencias', 'intranet.php?dir=mantenimientos/gerencia/framegerencia.php', 6); INSERT INTO `casubmenu` VALUES (9, 'Unidades', 'intranet.php?dir=mantenimientos/unidad/frameunidad.php', NULL); INSERT INTO `casubmenu` VALUES (10, 'Cargos', 'intranet.php?dir=mantenimientos/cargo/framecargo.php', NULL); INSERT INTO `casubmenu` VALUES (11, 'Reporte Personal', 'intranet.php?dir=reportes/personal/framereporte.php', NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `catipopermiso` -- CREATE TABLE `catipopermiso` ( `idtipopermiso` bit(1) NOT NULL, `tipopermiso` varchar(30) NOT NULL, PRIMARY KEY (`idtipopermiso`), UNIQUE KEY `tipopermiso` (`tipopermiso`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcar la base de datos para la tabla `catipopermiso` -- INSERT INTO `catipopermiso` VALUES ('\0', 'Fijo'); INSERT INTO `catipopermiso` VALUES ('', 'Temporal'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `catipotiempo` -- CREATE TABLE `catipotiempo` ( `idtipo` tinyint(4) NOT NULL auto_increment, `descripcion` varchar(20) NOT NULL, PRIMARY KEY (`idtipo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcar la base de datos para la tabla `catipotiempo` -- INSERT INTO `catipotiempo` VALUES (1, 'Trabajo'); INSERT INTO `catipotiempo` VALUES (2, 'Presencia'); INSERT INTO `catipotiempo` VALUES (3, 'Horas Extra'); INSERT INTO `catipotiempo` VALUES (4, 'Descanso'); INSERT INTO `catipotiempo` VALUES (5, 'Permiso'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `condicionfisica` -- CREATE TABLE `condicionfisica` ( `idcondicionfisica` tinyint(4) NOT NULL auto_increment, `condicionfisica` varchar(20) NOT NULL, PRIMARY KEY (`idcondicionfisica`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Volcar la base de datos para la tabla `condicionfisica` -- INSERT INTO `condicionfisica` VALUES (1, 'Derecho'); INSERT INTO `condicionfisica` VALUES (2, 'Zurdo'); INSERT INTO `condicionfisica` VALUES (3, 'Ambidextro'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `contrato` -- CREATE TABLE `contrato` ( `idcontrato` tinyint(4) NOT NULL auto_increment, `contrato` varchar(20) NOT NULL, PRIMARY KEY (`idcontrato`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `contrato` -- INSERT INTO `contrato` VALUES (1, 'Fijo'); INSERT INTO `contrato` VALUES (2, 'Contratado'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `estadocivil` -- CREATE TABLE `estadocivil` ( `idestadocivil` tinyint(4) NOT NULL auto_increment, `estadocivil` varchar(15) NOT NULL, PRIMARY KEY (`idestadocivil`), UNIQUE KEY `estadocivil` (`estadocivil`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Volcar la base de datos para la tabla `estadocivil` -- INSERT INTO `estadocivil` VALUES (2, 'Casado(a)'); INSERT INTO `estadocivil` VALUES (3, 'Divorciado(a)'); INSERT INTO `estadocivil` VALUES (5, 'Otro'); INSERT INTO `estadocivil` VALUES (1, 'Soltero(a)'); INSERT INTO `estadocivil` VALUES (4, 'Viudo(a)'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `estatus` -- CREATE TABLE `estatus` ( `idestatus` tinyint(4) NOT NULL auto_increment, `estatus` varchar(15) NOT NULL, PRIMARY KEY (`idestatus`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `estatus` -- INSERT INTO `estatus` VALUES (1, 'Activo'); INSERT INTO `estatus` VALUES (2, 'Suspendido'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `gerencia` -- CREATE TABLE `gerencia` ( `idgerencia` tinyint(4) NOT NULL auto_increment, `gerencia` varchar(50) NOT NULL, `estatus` bit(1) NOT NULL default '', PRIMARY KEY (`idgerencia`), UNIQUE KEY `gerencia` (`gerencia`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Volcar la base de datos para la tabla `gerencia` -- INSERT INTO `gerencia` VALUES (1, 'Presidencia', ''); INSERT INTO `gerencia` VALUES (2, 'Gerencia De Recursos Humanos', ''); INSERT INTO `gerencia` VALUES (3, 'Gerencia De Planificación Y Control', ''); INSERT INTO `gerencia` VALUES (4, 'Gerencia De Desarrollo Y Aplicaciones', ''); INSERT INTO `gerencia` VALUES (5, 'Gerencia De Tecnologia', ''); INSERT INTO `gerencia` VALUES (6, 'Gerencia De Operaciones', ''); INSERT INTO `gerencia` VALUES (7, 'Gerencia De Proyectos', ''); INSERT INTO `gerencia` VALUES (8, 'Consultoria Juridica', ''); INSERT INTO `gerencia` VALUES (9, 'Gerencia De Comunicaciones E Informacion', ''); INSERT INTO `gerencia` VALUES (10, 'Auditoria Interna', ''); INSERT INTO `gerencia` VALUES (11, 'Gerencia General', ''); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `nacionalidad` -- CREATE TABLE `nacionalidad` ( `idnacionalidad` tinyint(1) NOT NULL, `nacionalidad` varchar(10) NOT NULL, PRIMARY KEY (`idnacionalidad`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcar la base de datos para la tabla `nacionalidad` -- INSERT INTO `nacionalidad` VALUES (0, 'Venezolano'); INSERT INTO `nacionalidad` VALUES (1, 'Extranjero'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal` -- CREATE TABLE `personal` ( `cedula` int(11) NOT NULL, `nombres` varchar(20) NOT NULL, `apellidos` varchar(20) NOT NULL, `idsexo` tinyint(1) NOT NULL, `correo` varchar(20) default NULL, `fechanacimiento` date NOT NULL, `idnacionalidad` tinyint(1) NOT NULL, `idestadocivil` tinyint(4) NOT NULL, `telefonos` varchar(12) default NULL, `idestatus` tinyint(4) NOT NULL, `codpersonal` varchar(10) NOT NULL, `idcondicionfisica` tinyint(4) NOT NULL, `direccion` varchar(100) default NULL, PRIMARY KEY (`cedula`), UNIQUE KEY `cedula` (`cedula`), UNIQUE KEY `codpersonal` (`codpersonal`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- -- Volcar la base de datos para la tabla `personal` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_cargo` -- CREATE TABLE `personal_cargo` ( `idrelacion` int(11) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idcargo` tinyint(4) NOT NULL, `fechacargo` date default NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `personal_cargo` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_contrato` -- CREATE TABLE `personal_contrato` ( `idrelacion` int(11) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idcontrato` tinyint(4) NOT NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `personal_contrato` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_cuenta` -- CREATE TABLE `personal_cuenta` ( `idrelacion` smallint(6) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idbanco` tinyint(4) NOT NULL, `idtipocuenta` tinyint(4) NOT NULL, `codcuenta` varchar(20) NOT NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `personal_cuenta` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_tipopersonal` -- CREATE TABLE `personal_tipopersonal` ( `idrelacion` int(11) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idtipopersonal` tinyint(4) NOT NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `personal_tipopersonal` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal_unidad` -- CREATE TABLE `personal_unidad` ( `idrelacion` int(11) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idunidad` smallint(6) NOT NULL, PRIMARY KEY (`idrelacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `personal_unidad` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sexo` -- CREATE TABLE `sexo` ( `sexo` varchar(10) NOT NULL, `idsexo` tinyint(1) NOT NULL, PRIMARY KEY (`idsexo`), UNIQUE KEY `idsexo` (`idsexo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- -- Volcar la base de datos para la tabla `sexo` -- INSERT INTO `sexo` VALUES ('Masculino', 0); INSERT INTO `sexo` VALUES ('Femenino', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `supervision` -- CREATE TABLE `supervision` ( `idsupervicion` int(11) NOT NULL auto_increment, `cedula` int(11) NOT NULL, `idunidad` smallint(6) NOT NULL, `idnivel` tinyint(4) NOT NULL, PRIMARY KEY (`idsupervicion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `supervision` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipocuenta` -- CREATE TABLE `tipocuenta` ( `idtipocuenta` tinyint(4) NOT NULL auto_increment, `tipocuenta` varchar(20) NOT NULL, PRIMARY KEY (`idtipocuenta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcar la base de datos para la tabla `tipocuenta` -- INSERT INTO `tipocuenta` VALUES (1, 'Ahorro'); INSERT INTO `tipocuenta` VALUES (2, 'Corriente'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tipopersonal` -- CREATE TABLE `tipopersonal` ( `idtipopersonal` tinyint(4) NOT NULL auto_increment, `tipopersonal` varchar(30) NOT NULL, PRIMARY KEY (`idtipopersonal`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcar la base de datos para la tabla `tipopersonal` -- INSERT INTO `tipopersonal` VALUES (1, 'Obrero'); INSERT INTO `tipopersonal` VALUES (2, 'Empleado'); INSERT INTO `tipopersonal` VALUES (3, 'Suplente'); INSERT INTO `tipopersonal` VALUES (4, 'Comisión de Servicio'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `unidad` -- CREATE TABLE `unidad` ( `idunidad` smallint(6) NOT NULL auto_increment, `unidad` varchar(50) NOT NULL, `idgerencia` tinyint(4) NOT NULL, `estatus` bit(1) NOT NULL default '', PRIMARY KEY (`idunidad`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Volcar la base de datos para la tabla `unidad` -- INSERT INTO `unidad` VALUES (1, 'Formación Y Desarrollo', 2, ''); INSERT INTO `unidad` VALUES (2, 'Reclutamiento, Selección y Orientación', 2, ''); INSERT INTO `unidad` VALUES (3, 'Presidencia', 1, ''); INSERT INTO `unidad` VALUES (4, 'Clasificación Y Remuneración', 2, ''); INSERT INTO `unidad` VALUES (5, 'Comisión De Becas Ayudantías', 2, ''); INSERT INTO `unidad` VALUES (6, 'Servicio Médico', 2, ''); INSERT INTO `unidad` VALUES (7, 'Registro Y Control', 2, ''); INSERT INTO `unidad` VALUES (8, 'Recepción', 2, ''); INSERT INTO `unidad` VALUES (9, 'Recepción De Documentos', 2, ''); INSERT INTO `unidad` VALUES (10, 'Archivos Públicos', 10, '\0'); INSERT INTO `unidad` VALUES (12, 'Software', 4, '');
CREATE TABLE movement( movement_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, account_id BIGINT(20) UNSIGNED NOT NULL, account_destino_id BIGINT(20) UNSIGNED NOT NULL, balance DECIMAL(10,2) NOT NULL, movement_type_id SMALLINT(6) UNSIGNED NOT NULL, created_at_utc DATETIME NOT NULL, PRIMARY KEY(movement_id), CONSTRAINT FK_movement_account_id FOREIGN KEY(account_id) REFERENCES account(account_id), CONSTRAINT FK_movement_account_destino_id FOREIGN KEY(account_destino_id) REFERENCES account(account_id), CONSTRAINT FK_movement_movement_type_id FOREIGN KEY(movement_type_id) REFERENCES movement_type(movement_type_id) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE table1(type text, name text, age int); INSERT INTO table1 VALUES('大学生','xiaochuan',21); INSERT INTO table1 VALUES(NULL,'dachuan',32); COMMIT;
CREATE TABLE [ERP].[Contrato] ( [ID] INT IDENTITY (1, 1) NOT NULL, [IdDatoLaboral] INT NULL, [IdEmpresa] INT NULL, [IdTipoContrato] INT NULL, [FechaInicio] DATETIME NULL, [FechaFin] DATETIME NULL, [Adjunto] VARCHAR (MAX) NULL, PRIMARY KEY CLUSTERED ([ID] ASC), FOREIGN KEY ([IdDatoLaboral]) REFERENCES [ERP].[DatoLaboral] ([ID]), FOREIGN KEY ([IdEmpresa]) REFERENCES [ERP].[Empresa] ([ID]), FOREIGN KEY ([IdTipoContrato]) REFERENCES [PLAME].[T12TipoContrato] ([ID]) );
/** 로그 최근일자 , 사용자별 등록일의 다음날을 계산하는 쿼리*/ with ACTION_LOG_WITH_MST_USERS as ( select U.USER_ID , U.REGISTER_DATE , CAST(A.STAMP as DATE) as action_DATE , MAX(cast(A.STAMP as DATE)) OVER() as LATEST_DATE ,CAST(U.REGISTER_DATE::DATE + '1 day'::interval as date) as next_day_1 from mst_users as u left outer join action_log as a on u.user_id = a.user_id ) select * from ACTION_LOG_WITH_MST_USERS order by register_date; user_id|register_date|action_date|latest_date|next_day_1| -------|-------------|-----------|-----------|----------| U002 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-05| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-05| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-05| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-20| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-20| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-20| 2016-10-20|2016-10-02| U002 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U001 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U002 |2016-10-01 | 2016-10-01| 2016-10-20|2016-10-02| U002 |2016-10-01 | 2016-10-02| 2016-10-20|2016-10-02| U002 |2016-10-01 | 2016-10-02| 2016-10-20|2016-10-02| U018 |2016-10-01 | | 2016-10-20|2016-10-02| U008 |2016-10-01 | | 2016-10-20|2016-10-02| U003 |2016-10-01 | | 2016-10-20|2016-10-02| U005 |2016-10-01 | | 2016-10-20|2016-10-02| U012 |2016-10-01 | | 2016-10-20|2016-10-02| U014 |2016-10-01 | | 2016-10-20|2016-10-02| U010 |2016-10-01 | | 2016-10-20|2016-10-02| U015 |2016-10-01 | | 2016-10-20|2016-10-02| U017 |2016-10-01 | | 2016-10-20|2016-10-02| U004 |2016-10-01 | | 2016-10-20|2016-10-02| U009 |2016-10-01 | | 2016-10-20|2016-10-02| U016 |2016-10-01 | | 2016-10-20|2016-10-02| U011 |2016-10-01 | | 2016-10-20|2016-10-02| U007 |2016-10-01 | | 2016-10-20|2016-10-02| U006 |2016-10-01 | | 2016-10-20|2016-10-02| U013 |2016-10-01 | | 2016-10-20|2016-10-02| U019 |2016-10-01 | | 2016-10-20|2016-10-02| U025 |2016-10-02 | | 2016-10-20|2016-10-03| U023 |2016-10-02 | | 2016-10-20|2016-10-03| U027 |2016-10-02 | | 2016-10-20|2016-10-03| U029 |2016-10-02 | | 2016-10-20|2016-10-03| U021 |2016-10-02 | | 2016-10-20|2016-10-03| U020 |2016-10-02 | | 2016-10-20|2016-10-03| U026 |2016-10-02 | | 2016-10-20|2016-10-03| U028 |2016-10-02 | | 2016-10-20|2016-10-03| U024 |2016-10-02 | | 2016-10-20|2016-10-03| U022 |2016-10-02 | | 2016-10-20|2016-10-03| U030 |2016-10-02 | | 2016-10-20|2016-10-03| /** 12-5 사용자의 액션플래그를 계산하는 쿼리 */ with action_log_with_mst_users as ( select U.USER_ID , U.REGISTER_DATE , CAST(A.STAMP as DATE) as action_DATE , MAX(cast(A.STAMP as DATE)) OVER() as LATEST_DATE ,CAST(U.REGISTER_DATE::DATE + '1 day'::interval as date) as next_day_1 from mst_users as u left outer join action_log as a on u.user_id = a.user_id ) , user_action_flag as ( select user_id , register_date , sign(sum(case when next_day_1 <= latest_date then case when next_day_1 = action_date then 1 else 0 end end) ) as next_1day_action from action_log_with_mst_users group by user_id, register_date ) select * from user_action_flag order by register_date , user_id; user_id|register_date|next_1day_action| -------|-------------|----------------| U001 |2016-10-01 | 0.0| U002 |2016-10-01 | 1.0| U003 |2016-10-01 | 0.0| U004 |2016-10-01 | 0.0| U005 |2016-10-01 | 0.0| U006 |2016-10-01 | 0.0| U007 |2016-10-01 | 0.0| U008 |2016-10-01 | 0.0| U009 |2016-10-01 | 0.0| U010 |2016-10-01 | 0.0| U011 |2016-10-01 | 0.0| U012 |2016-10-01 | 0.0| U013 |2016-10-01 | 0.0| U014 |2016-10-01 | 0.0| U015 |2016-10-01 | 0.0| U016 |2016-10-01 | 0.0| U017 |2016-10-01 | 0.0| U018 |2016-10-01 | 0.0| U019 |2016-10-01 | 0.0| U020 |2016-10-02 | 0.0| U021 |2016-10-02 | 0.0| U022 |2016-10-02 | 0.0| U023 |2016-10-02 | 0.0| U024 |2016-10-02 | 0.0| U025 |2016-10-02 | 0.0| U026 |2016-10-02 | 0.0| U027 |2016-10-02 | 0.0| U028 |2016-10-02 | 0.0| U029 |2016-10-02 | 0.0| U030 |2016-10-02 | 0.0| /*12-6 다음날 지속률을 계산하는 쿼리*/ with action_log_with_mst_users as ( select U.USER_ID , U.REGISTER_DATE , CAST(A.STAMP as DATE) as action_DATE , MAX(cast(A.STAMP as DATE)) OVER() as LATEST_DATE ,CAST(U.REGISTER_DATE::DATE + '1 day'::interval as date) as next_day_1 from mst_users as u left outer join action_log as a on u.user_id = a.user_id ) , user_action_flag as ( select user_id , register_date , sign(sum(case when next_day_1 <= latest_date then case when next_day_1 = action_date then 1 else 0 end end) ) as next_1day_action from action_log_with_mst_users group by user_id, register_date ) select register_date , avg(100.0 * next_1day_action) as repeat_rate_1_day from user_action_flag group by register_date order by register_date; register_date|repeat_rate_1_day | -------------|------------------| 2016-10-01 |5.2631578947368425| 2016-10-02 | 0.0| /* 12-7 지속률 지표를 관리하는 마스터 테이블을 작성하는 쿼리*/ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_DATE) as ( values ('01 DAY REPEAT', 1) ,('02 DAY REPEAT', 2) ,('03 DAY REPEAT', 3) ,('04 DAY REPEAT', 4) ,('05 DAY REPEAT', 5) ,('06 DAY REPEAT', 6) ,('07 DAY REPEAT', 7) ) select * from REPEAT_INTERVAL order by INDEX_NAME; /*12-8 지속률을 세로 기반으로 집계하는 쿼리*/ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_DATE) as ( values ('01 DAY REPEAT', 1) ,('02 DAY REPEAT', 2) ,('03 DAY REPEAT', 3) ,('04 DAY REPEAT', 4) ,('05 DAY REPEAT', 5) ,('06 DAY REPEAT', 6) ,('07 DAY REPEAT', 7) ) , action_log_with_index_date as ( select U.USER_ID , U.REGISTER_DATE , CAST(A.STAMP as DATE) as ACTION_DATE , MAX(cast(A.STAMP as DATE )) OVER() as LATEST_DATE , R.INDEX_NAME , CAST(cast(U.REGISTER_DATE as DATE) + interval '1 DAY' * R.INTERVAL_DATE as DATE) as INDEX_DATE from mst_users AS U left outer join action_log A on U.USER_ID = A.USER_ID cross join REPEAT_INTERVAL as R ) , USER_ACTION_FLAG as ( select USER_ID , REGISTER_DATE , INDEX_NAME ,SIGN(SUM(case when INDEX_DATE <= LATEST_DATE then case when INDEX_DATE = ACTION_DATE then 1 else 0 end end ) ) as INDEX_DATE_ACTION from ACTION_LOG_WITH_INDEX_DATE group by USER_ID,REGISTER_DATE,INDEX_NAME,INDEX_DATE ) SELECT REGISTER_DATE , INDEX_NAME , AVG(100.0 * INDEX_DATE_ACTION) as REPEAT_RATE from USER_ACTION_FLAG group by REGISTER_DATE, INDEX_NAME order by REGISTER_DATE, INDEX_NAME; ) register_date|index_name |repeat_rate | -------------|-------------|------------------| 2016-10-01 |01 DAY REPEAT|5.2631578947368425| 2016-10-01 |02 DAY REPEAT| 0.0| 2016-10-01 |03 DAY REPEAT| 0.0| 2016-10-01 |04 DAY REPEAT|5.2631578947368425| 2016-10-01 |05 DAY REPEAT| 0.0| 2016-10-01 |06 DAY REPEAT| 0.0| 2016-10-01 |07 DAY REPEAT| 0.0| 2016-10-02 |01 DAY REPEAT| 0.0| 2016-10-02 |02 DAY REPEAT| 0.0| 2016-10-02 |03 DAY REPEAT| 0.0| 2016-10-02 |04 DAY REPEAT| 0.0| 2016-10-02 |05 DAY REPEAT| 0.0| 2016-10-02 |06 DAY REPEAT| 0.0| 2016-10-02 |07 DAY REPEAT| 0.0| /* 12-9 정착률 지표를 관리하는 마스터 테이블을 작성하는 쿼리*/ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_BEGIN_DATE , INTERVAL_END_DATE) as ( values ('07 DAY REPEAT', 1 , 7) ,('14 DAY REPEAT', 8 , 14) ,('21 DAY REPEAT', 15 , 21) ,('28 DAY REPEAT', 22 , 28) ) select * from REPEAT_INTERVAL order by INDEX_NAME; /* 12-10 정착률을 계산하는 쿼리*/ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_BEGIN_DATE , INTERVAL_END_DATE) as ( values ('07 DAY REPEAT', 1 , 7) ,('14 DAY REPEAT', 8 , 14) ,('21 DAY REPEAT', 15 , 21) ,('28 DAY REPEAT', 22 , 28) ) , action_LOG_WITH_INDEX_DATE as ( select U.USER_ID , U.REGISTER_DATE , CAST(A.STAMP as DATE) as ACTION_DATE , MAX(cast(A.STAMP as DATE )) OVER() as LATEST_DATE , R.INDEX_NAME -- 지표의 대상기간 시작일과 종료일 계산하기 , CAST(U.REGISTER_DATE::DATE + '1 DAY'::interval * R.INTERVAL_BEGIN_DATE as DATE) as INDEX_BEGIN_DATE , CAST(U.REGISTER_DATE::DATE + '1 DAY'::interval * R.INTERVAL_END_DATE as DATE) as INDEX_END_DATE from mst_users U left outer join action_log A on U.user_id = A.user_id cross join REPEAT_INTERVAL as R ) , USER_ACTION_FLAG as ( select USER_ID , REGISTER_DATE , INDEX_NAME ,SIGN(SUM(case when INDEX_END_DATE <= LATEST_DATE then case when ACTION_DATE between INDEX_BEGIN_DATE and INDEX_END_DATE then 1 else 0 end end ) ) as INDEX_DATE_ACTION from ACTION_LOG_WITH_INDEX_DATE group by USER_ID,REGISTER_DATE,INDEX_NAME,INDEX_BEGIN_DATE,INDEX_END_DATE ) select REGISTER_DATE , INDEX_NAME , AVG(100.0 * INDEX_DATE_ACTION) as INDEX_RATE from USER_ACTION_FLAG group by REGISTER_DATE , INDEX_NAME order by REGISTER_DATE , INDEX_NAME; register_date|index_name |index_rate | -------------|-------------|------------------| 2016-10-01 |07 DAY REPEAT|10.526315789473685| 2016-10-01 |14 DAY REPEAT| 0.0| 2016-10-01 |21 DAY REPEAT| | 2016-10-01 |28 DAY REPEAT| | 2016-10-02 |07 DAY REPEAT| 0.0| 2016-10-02 |14 DAY REPEAT| 0.0| 2016-10-02 |21 DAY REPEAT| | 2016-10-02 |28 DAY REPEAT| | /* 12-11 지속률 지표를 관리하는 마스터 테이블을 정착률 형식으로 수정한 쿼리 */ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_BEGIN_DATE , INTERVAL_END_DATE) as ( values ('01 DAY REPEAT', 1 , 1) ,('02 DAY REPEAT', 2 , 2) ,('03 DAY REPEAT', 3 , 3) ,('04 DAY REPEAT', 4 , 4) ,('05 DAY REPEAT', 5 , 5) ,('06 DAY REPEAT', 6 , 6) ,('07 DAY REPEAT', 7 , 7) ,('07 DAY REPEAT', 1 , 7) ,('14 DAY REPEAT', 8 , 14) ,('21 DAY REPEAT', 15 , 21) ,('28 DAY REPEAT', 22 , 28) ) select * from REPEAT_INTERVAL order by INDEX_NAME /* 12-12 N일 지속률을 집계하는 쿼리*/ with REPEAT_INTERVAL(INDEX_NAME , INTERVAL_BEGIN_DATE , INTERVAL_END_DATE) as ( values ('01 DAY REPEAT', 1 , 1) ,('02 DAY REPEAT', 2 , 2) ,('03 DAY REPEAT', 3 , 3) ,('04 DAY REPEAT', 4 , 4) ,('05 DAY REPEAT', 5 , 5) ,('06 DAY REPEAT', 6 , 6) ,('07 DAY REPEAT', 7 , 7) ,('07 DAY retention', 1 , 7) ,('14 DAY retention', 8 , 14) ,('21 DAY retention', 15 , 21) ,('28 DAY retention', 22 , 28) ) , action_LOG_WITH_INDEX_DATE as ( SELECT U.USER_ID , U.REGISTER_DATE --액션의 날짜와 로그 전체의 최신 날짜 자료형으로 변환하기 , CAST(A.STAMP as DATE) as ACTION_DATE , MAX(cast(A.STAMP as DATE )) OVER() as LATEST_DATE , R.INDEX_NAME -- 지표의 대상기간 시작일과 종료일 계산하기 , CAST(U.REGISTER_DATE::DATE + '1 DAY'::interval * R.INTERVAL_BEGIN_DATE as DATE) as INDEX_BEGIN_DATE , CAST(U.REGISTER_DATE::DATE + '1 DAY'::interval * R.INTERVAL_END_DATE as DATE) as INDEX_END_DATE FROM mst_users U LEFT OUTER JOIN action_log A ON U.user_id = A.user_id CROSS JOIN REPEAT_INTERVAL as R ) , USER_ACTION_FLAG as ( select USER_ID , REGISTER_DATE , INDEX_NAME ,SIGN(SUM(case when INDEX_END_DATE <= LATEST_DATE then case when ACTION_DATE between INDEX_BEGIN_DATE and INDEX_END_DATE then 1 else 0 end end ) ) as INDEX_DATE_ACTION from ACTION_LOG_WITH_INDEX_DATE group by USER_ID,REGISTER_DATE,INDEX_NAME,INDEX_BEGIN_DATE,INDEX_END_DATE ) select INDEX_NAME , AVG(100.0 * INDEX_DATE_ACTION) as REPEAT_DATE from USER_ACTION_FLAG group by INDEX_NAME order by INDEX_NAME;
create database course_select_system; use course_select_system; create user teacher identified with mysql_native_password by 'teacher'; create user student identified with mysql_native_password by 'student'; -- create user collegeadmin identified with mysql_native_password by 'collegeadmin'; create table course( course_id varchar(4), course_name varchar(100), credit int, class_hours int, primary key (course_id) ); create table student( student_id varchar(4), student_name varchar(100), total_credit int, gpa double, enroll_time varchar(10), graduate_time varchar(10), primary key(student_id) ); create table instructor( instructor_id varchar(4), instructor_name varchar(100), hire_time varchar(10), quit_time varchar(10), primary key (instructor_id) ); create table exam( exam_id int auto_increment, week int, primary key (exam_id) ); create table test( exam_id int unique not null, style varchar(100), foreign key (exam_id) references exam(exam_id) ); create table paper( exam_id int unique not null, demand varchar(100), foreign key (exam_id) references exam(exam_id) ); create table section( sec_id int, semester varchar(10), year int, start_week int, end_week int, number int, selected_num int, course_id varchar(4), exam_id int, primary key (sec_id, year, course_id, semester), foreign key (course_id) references course(course_id), foreign key (exam_id) references exam(exam_id) ); create table time_slot( time_slot_id varchar(10), start_time varchar(8), end_time varchar(8), day_of_week int, primary key (time_slot_id) ); create table classroom( classroom_id varchar(10), capacity int, primary key (classroom_id) ); create table application( appli_id int auto_increment, appii_status varchar(20), appli_content text, appli_time time, student_id varchar(4), sec_id int, course_id varchar(4), semester varchar(10), year int, primary key (appli_id), foreign key (student_id) references student(student_id), foreign key (sec_id,year, course_id, semester) references section(sec_id,year, course_id, semester) ); create table class_time_place( time_slot_id varchar(10), classroom_id varchar(10), sec_id int, course_id varchar(4), semester varchar(10), year int, foreign key (sec_id,year, course_id, semester) references section(sec_id, year, course_id, semester), foreign key (time_slot_id) references time_slot(time_slot_id), foreign key (classroom_id) references classroom(classroom_id) ); create table exam_time( exam_id int, time_slot_id varchar(10), primary key (exam_id,time_slot_id), foreign key (exam_id) references exam(exam_id), foreign key (time_slot_id) references time_slot(time_slot_id) ); create table exam_time_place( specific_exam_id int auto_increment, exam_id int, time_slot_id varchar(10), classroom_id varchar(10), primary key(specific_exam_id), foreign key (exam_id) references test(exam_id), foreign key (time_slot_id) references time_slot(time_slot_id), foreign key (classroom_id) references classroom(classroom_id) ); create table teaches( instructor_id varchar(4), sec_id int, course_id varchar(4), semester varchar(10), year int, foreign key (sec_id, year, course_id, semester) references section(sec_id, year, course_id, semester), foreign key (instructor_id) references instructor(instructor_id) ); create table take_exam( student_id varchar(4), specific_exam_id int, foreign key (student_id) references student(student_id), foreign key (specific_exam_id) references exam_time_place(specific_exam_id) ); create table takes( student_id varchar(4), sec_id int, course_id varchar(4), semester varchar(10), year int, grade varchar(2), foreign key (sec_id, year, course_id, semester) references section(sec_id, year, course_id, semester), foreign key (student_id) references student(student_id) ); create table drops( student_id varchar(4), sec_id int, course_id varchar(4), semester varchar(10), year int, foreign key (sec_id, year, course_id, semester) references section(sec_id, year, course_id, semester), foreign key (student_id) references student(student_id) ); grant all privileges on `course_select_system`.* to collegeadmin WITH GRANT OPTION; -- grant select on `course_select_system`.* to student; grant insert on `course_select_system`.`application` to student; grant insert on `course_select_system`.`drops` to student; grant insert on `course_select_system`.`takes` to student; grant delete on `course_select_system`.`takes` to student; grant update on `course_select_system`.`section` to student; grant select on `course_select_system`.* to teacher; grant update on `course_select_system`.`takes` to teacher; grant update on `course_select_system`.`application` to teacher; grant update on `course_select_system`.`section` to teacher; grant update on `course_select_system`.`student` to teacher; -- use mysql; -- grant all privileges on user to collegeadmin; -- grant create on user to collegeadmin; flush privileges; alter table takes add unique(student_id, sec_id, course_id, semester, year); alter table exam_time_place add unique(time_slot_id, classroom_id); alter table class_time_place add unique(time_slot_id, classroom_id, semester, year); alter table time_slot add unique(start_time,end_time,day_of_week); alter table application modify column `appli_time` datetime default CURRENT_TIMESTAMP; alter table application add unique(student_id, sec_id, course_id, semester, year); grant update on `course_select_system`.`section` to teacher; grant insert on `course_select_system`.`takes` to teacher;
-- THIS IS NOT AS ACCURATE AS THE FULL GENERATION SCRIPT -- CREATE TABLE semesters ( SemesterID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(10) NOT NULL ) ; CREATE TABLE academicsemesters ( AcademicSemesterID int(11) AUTO_INCREMENT PRIMARY KEY , SemesterID int(11) NOT NULL, CONSTRAINT SemesterToAcademicSemester FOREIGN KEY (SemesterID) REFERENCES Semesters(SemesterID), AcademicYear int(11) NOT NULL ) ; CREATE TABLE campuses ( CampusID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(255) NOT NULL ) ; CREATE TABLE buildings ( BuildingID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(255) NOT NULL, CampusID int(11) NOT NULL, CONSTRAINT CampusToBuilding FOREIGN KEY (CampusID) REFERENCES Campuses(CampusID) ) ; CREATE TABLE rooms ( RoomID int(11) AUTO_INCREMENT PRIMARY KEY , Number varchar(255) NOT NULL, SeatsAvailable int(11) NOT NULL, Details varchar(255) NOT NULL, BuildingID int(11) NOT NULL, CONSTRAINT BuildingToRoom FOREIGN KEY (BuildingID) REFERENCES Buildings(BuildingID) ) ; CREATE TABLE colleges ( CollegeID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) DEFAULT NULL ) ; CREATE TABLE days ( DayID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(255) NOT NULL ) ; CREATE TABLE departments ( DepartmentID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) DEFAULT NULL, Abbreviation varchar(255) DEFAULT NULL ) ; CREATE TABLE courses ( CourseID int(11) AUTO_INCREMENT PRIMARY KEY , Number int(11) NOT NULL, Title varchar(255) NOT NULL, Description varchar(255) NOT NULL, MinimumCredits int(11) NOT NULL, MaximumCredits int(11) NOT NULL, FixedCredits int(11) NOT NULL, IsFixedCredit bit(1) NOT NULL, DepartmentID int(11) NOT NULL, CONSTRAINT DepartmentToCourse FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID) ) ; CREATE TABLE departmentcolleges ( DepartmentCollegeID int(11) AUTO_INCREMENT PRIMARY KEY , CollegeID int(11) NOT NULL, CONSTRAINT CollegeToDepartment FOREIGN KEY (CollegeID) REFERENCES Colleges(CollegeID), DepartmentID int(11) NOT NULL, CONSTRAINT DepartmentToCollege FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID) ) ; CREATE TABLE fees ( FeeID int(11) AUTO_INCREMENT PRIMARY KEY , DetailCode varchar(255) NOT NULL ) ; CREATE TABLE instructors ( InstructorID int(11) AUTO_INCREMENT PRIMARY KEY , FirstName varchar(255) NOT NULL, MiddleName varchar(255) NOT NULL, LastName varchar(255) NOT NULL, Number int(11) NOT NULL, CourseLoad int(11) NOT NULL ) ; CREATE TABLE partofterm ( PartOfTermID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(255) NOT NULL ) ; CREATE TABLE roles ( RoleID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) DEFAULT NULL, IsAdmin bit(1) NOT NULL, Sections bit(4) NOT NULL, Courses bit(4) NOT NULL, Buildings bit(4) NOT NULL, Campuses bit(4) NOT NULL, Roles bit(4) NOT NULL, Users bit(4) NOT NULL, Departments bit(4) NOT NULL, Fees bit(4) NOT NULL, Instructors bit(4) NOT NULL, Days bit(4) NOT NULL, Rooms bit(4) NOT NULL, ScheduleTypes bit(4) NOT NULL, Spreadsheets bit(4) NOT NULL ) ; CREATE TABLE schedules ( ScheduleID int(11) AUTO_INCREMENT PRIMARY KEY , StartTime datetime NOT NULL, EndTime datetime NOT NULL, NumberOfDays int(11) NOT NULL, CollegeID int(11) NOT NULL, CONSTRAINT CollegeToSchedule FOREIGN KEY (CollegeID) REFERENCES Colleges(CollegeID) ) ; CREATE TABLE scheduletypes ( ScheduleTypeID int(11) AUTO_INCREMENT PRIMARY KEY , Name varchar(255) NOT NULL, Abbreviation varchar(255) NOT NULL ) ; CREATE TABLE users ( UserID int(11) AUTO_INCREMENT PRIMARY KEY , Username varchar(255) NOT NULL, Password varchar(255) DEFAULT NULL, RoleID int(11) DEFAULT '2', CONSTRAINT RoleToUser FOREIGN KEY (RoleID) REFERENCES Roles(RoleID) ) ; CREATE TABLE spreadsheetvariables ( SpreadsheetVariableID int(11) AUTO_INCREMENT PRIMARY KEY , Spreadsheet blob NOT NULL, StartingRowNumber int(11) NOT NULL, DefaultFontSize int(11) NOT NULL, AddChangeDelete varchar(255) NOT NULL, AcademicSemester varchar(255) NOT NULL, SubjectName varchar(255) NOT NULL, SectionCRN varchar(255) NOT NULL, CourseNumber varchar(255) NOT NULL, SectionNumber varchar(255) NOT NULL, CrossListID varchar(255) NOT NULL, CourseTitle varchar(255) NOT NULL, Campus varchar(255) NOT NULL, ScheduleType varchar(255) NOT NULL, MoodleRequired varchar(255) NOT NULL, InstructorApprovalRequired varchar(255) NOT NULL, PartOfTerm varchar(255) NOT NULL, FixedCredit varchar(255) NOT NULL, MinimumCredits varchar(255) NOT NULL, MaximumCredits varchar(255) NOT NULL, ClassLimit varchar(255) NOT NULL, Monday varchar(255) NOT NULL, Tuesday varchar(255) NOT NULL, Wednesday varchar(255) NOT NULL, Thursday varchar(255) NOT NULL, Friday varchar(255) NOT NULL, Saturday varchar(255) NOT NULL, Sunday varchar(255) NOT NULL, StartTime varchar(255) NOT NULL, EndTime varchar(255) NOT NULL, Building varchar(255) NOT NULL, Room varchar(255) NOT NULL, PrimaryInstructorFirstName varchar(255) NOT NULL, PrimaryInstructorLastName varchar(255) NOT NULL, PrimaryInstructorNumber varchar(255) NOT NULL, PrimaryInstructorTeachingPercentRequired varchar(255) NOT NULL, SecondaryInstructorFirstName varchar(255) NOT NULL, SecondaryInstructorLastName varchar(255) NOT NULL, SecondaryInstructorNumber varchar(255) NOT NULL, SecondaryInstructorTeachingPercentRequired varchar(255) NOT NULL, ClassFeeDetailCode varchar(255) NOT NULL, ClassFeeAmount varchar(255) NOT NULL, SectionNotes varchar(255) NOT NULL, CrossListSubject varchar(255) NOT NULL, CrossListCourseNumber varchar(255) NOT NULL, DepartmentComments varchar(255) NOT NULL ) ; CREATE TABLE usertodepartments ( UserToDepartmentID int(11) AUTO_INCREMENT PRIMARY KEY , UserID int(11) NOT NULL, CONSTRAINT UserToDepartment FOREIGN KEY (UserID) REFERENCES Users(UserID), DepartmentID int(11) NOT NULL, CONSTRAINT DepartmentToUser FOREIGN KEY (DepartmentID) REFERENCES Departments(DepartmentID) ) ; CREATE TABLE sections ( SectionID int(11) AUTO_INCREMENT PRIMARY KEY , CRN int(11) NOT NULL, RequiresMoodle bit(1) NOT NULL, RequiresPermission bit(1) NOT NULL, Notes varchar(255) NOT NULL, DepartmentComments varchar(255) NOT NULL, StudentLimit int(11) NOT NULL, DateCreated datetime NOT NULL, DateArchived datetime NOT NULL, Number varchar(255) NOT NULL, StartTime datetime NOT NULL, EndTime datetime NOT NULL, CourseID int(11) NOT NULL, CONSTRAINT CourseToSection FOREIGN KEY (CourseID) REFERENCES Courses(CourseID), RoomID int(11) NOT NULL, ScheduleTypeID int(11) NOT NULL, AcademicSemesterID int(11) NOT NULL, CONSTRAINT AcademicSemesterToSection FOREIGN KEY (AcademicSemesterID) REFERENCES AcademicSemesters(AcademicSemesterID), PartOfTermID int(11) NOT NULL, XListID varchar(255) NOT NULL, DateDeleted datetime NOT NULL ) ; CREATE TABLE sectiondays ( SectionDayID int(11) AUTO_INCREMENT PRIMARY KEY , SectionID int(11) NOT NULL, CONSTRAINT SectionToDay FOREIGN KEY (SectionID) REFERENCES Sections(SectionID), DayID int(11) NOT NULL, CONSTRAINT DayToSection FOREIGN KEY (DayID) REFERENCES Days(DayID), DateArchived datetime NOT NULL ) ; CREATE TABLE sectionfees ( SectionFeeID int(11) AUTO_INCREMENT PRIMARY KEY , SectionID int(11) NOT NULL, CONSTRAINT SectionToFee FOREIGN KEY (SectionID) REFERENCES Sections(SectionID), FeeID int(11) NOT NULL, CONSTRAINT FeeToSection FOREIGN KEY (FeeID) REFERENCES Fees(FeeID), Amount decimal(13,4) DEFAULT NULL ) ; CREATE TABLE changelogs ( ChangeLogID int(11) AUTO_INCREMENT PRIMARY KEY , SectionID int(11) NOT NULL, CONSTRAINT SectionToChangeLog FOREIGN KEY (SectionID) REFERENCES Sections(SectionID), ChangedDepartment bit(1) NOT NULL, ChangedCourseNumber bit(1) NOT NULL, ChangedSectionNumber bit(1) NOT NULL, ChangedTitle bit(1) NOT NULL, ChangedCampus bit(1) NOT NULL, ChangedScheduleType bit(1) NOT NULL, ChangedRequiresMoodle bit(1) NOT NULL, ChangedRequiresPermission bit(1) NOT NULL, ChangedPartOfTerm bit(1) NOT NULL, ChangedStudentLimit bit(1) NOT NULL, ChangedCreditMax bit(1) NOT NULL, ChangedCreditMin bit(1) NOT NULL, ChangedFixedCredit bit(1) NOT NULL, ChangedMonday bit(1) NOT NULL, ChangedTuesday bit(1) NOT NULL, ChangedWednesday bit(1) NOT NULL, ChangedThursday bit(1) NOT NULL, ChangedFriday bit(1) NOT NULL, ChangedSaturday bit(1) NOT NULL, ChangedSunday bit(1) NOT NULL, ChangedStartTime bit(1) NOT NULL, ChangedEndTime bit(1) NOT NULL, ChangedBuilding bit(1) NOT NULL, ChangedRoom bit(1) NOT NULL, ChangedPrimeInstructor bit(1) NOT NULL, ChangedPrimeInstructorPercent bit(1) NOT NULL, ChangedSecondInstructor bit(1) NOT NULL, ChangedSecondInstructorPercent bit(1) NOT NULL, ChangedFeeDetailCode bit(1) NOT NULL, ChangedFeeAmount bit(1) NOT NULL, ChangedSectionNotes bit(1) NOT NULL, ChangedCrossListedDepartment bit(1) NOT NULL, ChangedCrossListedSection bit(1) NOT NULL, ChangedDepartmentComments bit(1) NOT NULL, DateImported datetime NOT NULL, DateCreated datetime NOT NULL, DateDeleted datetime NOT NULL ) ; CREATE TABLE instructortosections ( InstructorToSectionID int(11) AUTO_INCREMENT PRIMARY KEY , IsPrimary bit(1) NOT NULL, TeachingPercentage int(11) NOT NULL, DateArchived datetime NOT NULL, InstructorID int(11) NOT NULL, CONSTRAINT InstructorToSection FOREIGN KEY (InstructorID) REFERENCES Instructors(InstructorID), SectionID int(11) NOT NULL, CONSTRAINT SectionToInstructor FOREIGN KEY (SectionID) REFERENCES Sections(SectionID) ) ; CREATE TABLE collegetousers ( CollegeToUserID int(11) AUTO_INCREMENT PRIMARY KEY , CollegeID int(11) NOT NULL, CONSTRAINT CollegeToUser FOREIGN KEY (CollegeID) REFERENCES Colleges(CollegeID), UserID int(11) NOT NULL, CONSTRAINT UserToCollege FOREIGN KEY (UserID) REFERENCES Users(UserID) ) ;
/* SQLyog Community v13.0.1 (64 bit) MySQL - 10.1.34-MariaDB : Database - gfg ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`gfg` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci */; USE `gfg`; /*Table structure for table `avales` */ DROP TABLE IF EXISTS `avales`; CREATE TABLE `avales` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Solicitud` int(10) unsigned NOT NULL, `Nombre` varchar(40) COLLATE utf8_spanish_ci NOT NULL, `Apellido_Paterno` varchar(40) COLLATE utf8_spanish_ci NOT NULL, `Apellido_Materno` varchar(40) COLLATE utf8_spanish_ci DEFAULT NULL, `Direccion` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `Num_Exterior` varchar(10) COLLATE utf8_spanish_ci NOT NULL, `Num_Interior` varchar(5) COLLATE utf8_spanish_ci DEFAULT NULL, `Colonia` varchar(70) COLLATE utf8_spanish_ci NOT NULL, `Telefono` varchar(12) COLLATE utf8_spanish_ci NOT NULL, `Ocupacion` varchar(40) COLLATE utf8_spanish_ci DEFAULT NULL, `status` tinyint(1) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `id_Cliente` (`id_Solicitud`), KEY `status` (`status`), CONSTRAINT `avales_ibfk_2` FOREIGN KEY (`status`) REFERENCES `status_personas` (`id`) ON DELETE CASCADE, CONSTRAINT `avales_ibfk_4` FOREIGN KEY (`id_Solicitud`) REFERENCES `solicitudes_personales` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `avales` */ insert into `avales`(`id`,`id_Solicitud`,`Nombre`,`Apellido_Paterno`,`Apellido_Materno`,`Direccion`,`Num_Exterior`,`Num_Interior`,`Colonia`,`Telefono`,`Ocupacion`,`status`) values (4,10,'654','654','654','654','654','646','54','654','654',1), (5,11,'fred','pruebas','987','987','987','98','79','87','987',1); /*Table structure for table `clientes_empleo` */ DROP TABLE IF EXISTS `clientes_empleo`; CREATE TABLE `clientes_empleo` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Cliente` int(10) unsigned NOT NULL, `Domicilio` varchar(200) COLLATE utf8_spanish_ci NOT NULL, `Num_Exterior` varchar(10) COLLATE utf8_spanish_ci NOT NULL, `Num_Interior` varchar(5) COLLATE utf8_spanish_ci DEFAULT NULL, `Telefono` varchar(12) COLLATE utf8_spanish_ci DEFAULT NULL, `tiempo` int(10) unsigned DEFAULT NULL, `Descripcion` varchar(200) COLLATE utf8_spanish_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_Cliente` (`id_Cliente`), CONSTRAINT `clientes_empleo_ibfk_1` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `clientes_empleo` */ insert into `clientes_empleo`(`id`,`id_Cliente`,`Domicilio`,`Num_Exterior`,`Num_Interior`,`Telefono`,`tiempo`,`Descripcion`) values (6,47,'3','2132','1','321',32132,'321'); /*Table structure for table `clientes_grupo` */ DROP TABLE IF EXISTS `clientes_grupo`; CREATE TABLE `clientes_grupo` ( `id_Grupo` int(10) unsigned DEFAULT NULL, `id_Cliente` int(10) unsigned DEFAULT NULL, KEY `fk_clientesgrupo_clientes` (`id_Cliente`), KEY `fk_clientesgrupo_grupo` (`id_Grupo`), CONSTRAINT `fk_clientesgrupo_clientes` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`) ON DELETE CASCADE, CONSTRAINT `fk_clientesgrupo_grupo` FOREIGN KEY (`id_Grupo`) REFERENCES `grupos` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `clientes_grupo` */ insert into `clientes_grupo`(`id_Grupo`,`id_Cliente`) values (25,47); /*Table structure for table `clientes_personal` */ DROP TABLE IF EXISTS `clientes_personal`; CREATE TABLE `clientes_personal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Nombre` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `Paterno` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `Materno` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `Telefono_Cel` varchar(12) COLLATE utf8_spanish_ci NOT NULL, `Telefono_Fijo` varchar(12) COLLATE utf8_spanish_ci DEFAULT NULL, `Direccion` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `Num_Exterior` varchar(10) COLLATE utf8_spanish_ci NOT NULL, `Num_Interior` varchar(5) COLLATE utf8_spanish_ci DEFAULT NULL, `ciudad` varchar(40) COLLATE utf8_spanish_ci DEFAULT NULL, `Colonia` varchar(30) COLLATE utf8_spanish_ci NOT NULL, `Fecha_Nacimiento` date NOT NULL, `Tiempo_Residencia` varchar(2) COLLATE utf8_spanish_ci DEFAULT NULL, `Tipo_Casa` tinyint(1) unsigned NOT NULL, `Estado_Civil` tinyint(1) unsigned NOT NULL, `Ocupacion` varchar(40) COLLATE utf8_spanish_ci NOT NULL, `Sueldo_Mensual` int(11) NOT NULL, `status` tinyint(3) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `fk_Tipo_Casa` (`Tipo_Casa`), KEY `fk_estado_civil` (`Estado_Civil`), KEY `status` (`status`), CONSTRAINT `clientes_personal_ibfk_1` FOREIGN KEY (`status`) REFERENCES `status_personas` (`id`), CONSTRAINT `fk_Tipo_Casa` FOREIGN KEY (`Tipo_Casa`) REFERENCES `tipo_domicilio` (`id`), CONSTRAINT `fk_estado_civil` FOREIGN KEY (`Estado_Civil`) REFERENCES `estado_civil` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `clientes_personal` */ insert into `clientes_personal`(`id`,`Nombre`,`Paterno`,`Materno`,`Telefono_Cel`,`Telefono_Fijo`,`Direccion`,`Num_Exterior`,`Num_Interior`,`ciudad`,`Colonia`,`Fecha_Nacimiento`,`Tiempo_Residencia`,`Tipo_Casa`,`Estado_Civil`,`Ocupacion`,`Sueldo_Mensual`,`status`) values (47,'asd','321','321','21','321','321','321','321','ask','132','2018-05-05','21',1,1,'321',3,1); /*Table structure for table `credito_grupal` */ DROP TABLE IF EXISTS `credito_grupal`; CREATE TABLE `credito_grupal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Folio` varchar(15) COLLATE utf8_spanish_ci DEFAULT NULL, `id_Grupo` int(10) unsigned NOT NULL, `cantidad_Inicial` int(10) unsigned NOT NULL, `tipo_Credito` tinyint(3) unsigned NOT NULL, `capital` int(11) DEFAULT NULL, `intereses` float DEFAULT NULL, `Total` int(11) DEFAULT NULL, `fecha_Inicio` date NOT NULL, `tipo_interes` tinyint(3) unsigned DEFAULT NULL, `status` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `id_Grupo` (`id_Grupo`), KEY `tipo_Credito` (`tipo_Credito`), KEY `status` (`status`), KEY `interes` (`tipo_interes`), CONSTRAINT `credito_grupal_ibfk_1` FOREIGN KEY (`id_Grupo`) REFERENCES `grupos` (`id`), CONSTRAINT `credito_grupal_ibfk_2` FOREIGN KEY (`tipo_Credito`) REFERENCES `tipos_credito` (`id`), CONSTRAINT `credito_grupal_ibfk_3` FOREIGN KEY (`status`) REFERENCES `status_credito` (`id`), CONSTRAINT `credito_grupal_ibfk_4` FOREIGN KEY (`tipo_interes`) REFERENCES `tipos_interes` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `credito_grupal` */ insert into `credito_grupal`(`id`,`Folio`,`id_Grupo`,`cantidad_Inicial`,`tipo_Credito`,`capital`,`intereses`,`Total`,`fecha_Inicio`,`tipo_interes`,`status`) values (9,'g9',23,50000,2,50000,0,0,'2018-07-23',5,6), (10,'g10',18,8000,3,8000,800,8800,'2018-07-25',4,1), (11,'g11',23,8000,2,8000,0,0,'2018-05-05',5,1), (12,NULL,21,80000,2,80000,0,0,'2018-08-08',5,1); /*Table structure for table `credito_personal` */ DROP TABLE IF EXISTS `credito_personal`; CREATE TABLE `credito_personal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Cliente` int(10) unsigned NOT NULL, `Folio` varchar(15) COLLATE utf8_spanish_ci DEFAULT NULL, `Cantidad_Inicial` int(10) unsigned NOT NULL, `Tipo_Credito` tinyint(1) unsigned NOT NULL, `Fecha_inicio` date NOT NULL, `Capital` int(11) NOT NULL, `intereses` float DEFAULT NULL, `Total` int(11) DEFAULT NULL, `tipo_interes` tinyint(3) unsigned DEFAULT NULL, `Status` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `id_Cliente` (`id_Cliente`), KEY `Tipo_Credito` (`Tipo_Credito`), KEY `Status` (`Status`), KEY `credito_personal_ibfk_4` (`tipo_interes`), CONSTRAINT `credito_personal_ibfk_1` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`) ON DELETE CASCADE, CONSTRAINT `credito_personal_ibfk_2` FOREIGN KEY (`Tipo_Credito`) REFERENCES `tipos_credito` (`id`) ON DELETE CASCADE, CONSTRAINT `credito_personal_ibfk_3` FOREIGN KEY (`Status`) REFERENCES `status_credito` (`id`) ON DELETE CASCADE, CONSTRAINT `credito_personal_ibfk_4` FOREIGN KEY (`tipo_interes`) REFERENCES `tipos_interes` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `credito_personal` */ /*Table structure for table `estado_civil` */ DROP TABLE IF EXISTS `estado_civil`; CREATE TABLE `estado_civil` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `estado_civil` */ insert into `estado_civil`(`id`,`Descripcion`) values (1,'Soltero'), (2,'Casado'), (3,'Viudo'), (4,'Divorciado'), (5,'Union Libre'), (6,'Otro'); /*Table structure for table `grupos` */ DROP TABLE IF EXISTS `grupos`; CREATE TABLE `grupos` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `nombre` varchar(50) COLLATE utf8_spanish_ci NOT NULL, `fecha_Creacion` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `grupos` */ insert into `grupos`(`id`,`nombre`,`fecha_Creacion`) values (18,'alfred','2018-07-11'), (21,'vanguardia','2018-07-11'), (22,'fredo','2018-07-11'), (23,'grupo1','2018-07-18'), (24,'codemasters','2018-07-23'), (25,'asd','2018-08-09'); /*Table structure for table `intereses_mensuales_grupal` */ DROP TABLE IF EXISTS `intereses_mensuales_grupal`; CREATE TABLE `intereses_mensuales_grupal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_credito` int(10) unsigned NOT NULL, `cantidad` int(11) DEFAULT NULL, `fecha` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `intereses_mensuales_grupal_ibfk_1` (`id_credito`), CONSTRAINT `intereses_mensuales_grupal_ibfk_1` FOREIGN KEY (`id_credito`) REFERENCES `credito_grupal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `intereses_mensuales_grupal` */ insert into `intereses_mensuales_grupal`(`id`,`id_credito`,`cantidad`,`fecha`) values (9,9,0,'2018-07-23'), (10,10,800,'2018-07-25'), (11,11,0,'2018-05-05'), (12,12,0,'2018-08-08'); /*Table structure for table `intereses_mensuales_personal` */ DROP TABLE IF EXISTS `intereses_mensuales_personal`; CREATE TABLE `intereses_mensuales_personal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_credito` int(10) unsigned NOT NULL, `cantidad` int(11) DEFAULT NULL, `fecha` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `intereses_mensuales_personal_ibfk_1` (`id_credito`), CONSTRAINT `intereses_mensuales_personal_ibfk_1` FOREIGN KEY (`id_credito`) REFERENCES `credito_personal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `intereses_mensuales_personal` */ /*Table structure for table `pagos_grupal` */ DROP TABLE IF EXISTS `pagos_grupal`; CREATE TABLE `pagos_grupal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_credito_grupal` int(10) unsigned NOT NULL, `cantidad` int(11) NOT NULL, `intereses` int(11) NOT NULL, `capital` int(11) NOT NULL, `fecha_pago` date NOT NULL, `observaciones` text COLLATE utf8_spanish_ci, PRIMARY KEY (`id`), KEY `pagos_grupal_ibfk_1` (`id_credito_grupal`), CONSTRAINT `pagos_grupal_ibfk_1` FOREIGN KEY (`id_credito_grupal`) REFERENCES `credito_grupal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `pagos_grupal` */ /*Table structure for table `pagos_personal` */ DROP TABLE IF EXISTS `pagos_personal`; CREATE TABLE `pagos_personal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_credito_personal` int(10) unsigned NOT NULL, `cantidad` int(11) NOT NULL, `intereses` int(11) NOT NULL, `capital` int(11) NOT NULL, `fecha_Pago` date DEFAULT NULL, `observaciones` text COLLATE utf8_spanish_ci, PRIMARY KEY (`id`), KEY `pagos_personal_ibfk_1` (`id_credito_personal`), CONSTRAINT `pagos_personal_ibfk_1` FOREIGN KEY (`id_credito_personal`) REFERENCES `credito_personal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `pagos_personal` */ /*Table structure for table `referencias` */ DROP TABLE IF EXISTS `referencias`; CREATE TABLE `referencias` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Solicitud` int(10) unsigned DEFAULT NULL, `id_Cliente` int(10) unsigned DEFAULT NULL, `Nombre` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `Paterno` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `Materno` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `Domicilio` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `Exterior` varchar(6) COLLATE utf8_spanish_ci DEFAULT NULL, `Interior` varchar(6) COLLATE utf8_spanish_ci DEFAULT NULL, `Telefono` varchar(12) COLLATE utf8_spanish_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_Solicitud` (`id_Solicitud`), KEY `id_Cliente` (`id_Cliente`), CONSTRAINT `referencias_ibfk_1` FOREIGN KEY (`id_Solicitud`) REFERENCES `solicitudes_personales` (`id`) ON DELETE CASCADE, CONSTRAINT `referencias_ibfk_2` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `referencias` */ insert into `referencias`(`id`,`id_Solicitud`,`id_Cliente`,`Nombre`,`Paterno`,`Materno`,`Domicilio`,`Exterior`,`Interior`,`Telefono`) values (19,10,47,'1','312312','321','312','321','32','1'), (20,10,47,'32132','1','321','321','321','321','32'), (35,11,47,'654','65','4654','646','54','654','654'), (36,11,47,'654','654','64','654','6546','54','654'); /*Table structure for table `solicitudes_personales` */ DROP TABLE IF EXISTS `solicitudes_personales`; CREATE TABLE `solicitudes_personales` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Cliente` int(10) unsigned DEFAULT NULL, `Cantidad` int(11) DEFAULT NULL, `tipo_credito` tinyint(3) unsigned DEFAULT NULL, `fecha` date DEFAULT NULL, `status` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `id_Cliente` (`id_Cliente`), CONSTRAINT `solicitudes_personales_ibfk_1` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; /*Data for the table `solicitudes_personales` */ insert into `solicitudes_personales`(`id`,`id_Cliente`,`Cantidad`,`tipo_credito`,`fecha`,`status`) values (10,47,321,1,NULL,0), (11,47,9000,1,'2018-08-09',0); /*Table structure for table `status_credito` */ DROP TABLE IF EXISTS `status_credito`; CREATE TABLE `status_credito` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(30) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `status_credito` */ insert into `status_credito`(`id`,`Descripcion`) values (1,'Activo'), (2,'Atrasado'), (3,'Terminado'), (4,'Por Cobrar'), (5,'Cancelado'), (6,'Renovado'); /*Table structure for table `status_pagos` */ DROP TABLE IF EXISTS `status_pagos`; CREATE TABLE `status_pagos` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(30) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `status_pagos` */ insert into `status_pagos`(`id`,`Descripcion`) values (1,'Pagado'), (2,'Por Pagar'), (3,'renovado'); /*Table structure for table `status_personas` */ DROP TABLE IF EXISTS `status_personas`; CREATE TABLE `status_personas` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `status_personas` */ insert into `status_personas`(`id`,`Descripcion`) values (1,'Activo'), (2,'No Activo'); /*Table structure for table `status_solicitudes` */ DROP TABLE IF EXISTS `status_solicitudes`; CREATE TABLE `status_solicitudes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `descripcion` varchar(30) COLLATE utf8_spanish_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `status_solicitudes` */ insert into `status_solicitudes`(`id`,`descripcion`) values (1,'Pendiente'), (2,'Aprobada'), (3,'Cancelada'); /*Table structure for table `tarjeton_grupal` */ DROP TABLE IF EXISTS `tarjeton_grupal`; CREATE TABLE `tarjeton_grupal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Grupo` int(10) unsigned NOT NULL, `id_Credito` int(10) unsigned NOT NULL, `fecha_Asignada` date DEFAULT NULL, `cantidad` int(11) NOT NULL, `numero_Pago` tinyint(4) NOT NULL, `fecha_Pago` date DEFAULT NULL, `status` tinyint(3) unsigned NOT NULL, `Observaciones` text COLLATE utf8_spanish_ci, PRIMARY KEY (`id`), KEY `status` (`status`), KEY `tarjeton_grupal_ibfk_1` (`id_Grupo`), KEY `tarjeton_grupal_ibfk_2` (`id_Credito`), CONSTRAINT `tarjeton_grupal_ibfk_1` FOREIGN KEY (`id_Grupo`) REFERENCES `grupos` (`id`), CONSTRAINT `tarjeton_grupal_ibfk_2` FOREIGN KEY (`id_Credito`) REFERENCES `credito_grupal` (`id`) ON DELETE CASCADE, CONSTRAINT `tarjeton_grupal_ibfk_3` FOREIGN KEY (`status`) REFERENCES `status_pagos` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `tarjeton_grupal` */ insert into `tarjeton_grupal`(`id`,`id_Grupo`,`id_Credito`,`fecha_Asignada`,`cantidad`,`numero_Pago`,`fecha_Pago`,`status`,`Observaciones`) values (16,23,9,'2018-07-30',5000,1,NULL,3,NULL), (17,23,9,'2018-08-06',5000,2,NULL,3,NULL), (18,23,9,'2018-08-13',5000,3,NULL,3,NULL), (19,23,9,'2018-08-20',5000,4,NULL,3,NULL), (20,23,9,'2018-08-27',5000,5,NULL,3,NULL), (21,23,9,'2018-09-03',5000,6,NULL,3,NULL), (22,23,9,'2018-09-10',5000,7,NULL,3,NULL), (23,23,9,'2018-09-17',5000,8,NULL,3,NULL), (24,23,9,'2018-09-24',5000,9,NULL,3,NULL), (25,23,9,'2018-10-01',5000,10,NULL,3,NULL), (26,23,9,'2018-10-08',5000,11,NULL,3,NULL), (27,23,9,'2018-10-15',5000,12,NULL,3,NULL), (28,23,9,'2018-10-22',5000,13,NULL,3,NULL), (29,23,9,'2018-10-29',5000,14,NULL,3,NULL), (30,23,11,'2018-05-12',800,1,NULL,2,NULL), (31,23,11,'2018-05-19',800,2,NULL,2,NULL), (32,23,11,'2018-05-26',800,3,NULL,2,NULL), (33,23,11,'2018-06-02',800,4,NULL,2,NULL), (34,23,11,'2018-06-09',800,5,NULL,2,NULL), (35,23,11,'2018-06-16',800,6,NULL,2,NULL), (36,23,11,'2018-06-23',800,7,NULL,2,NULL), (37,23,11,'2018-06-30',800,8,NULL,2,NULL), (38,23,11,'2018-07-07',800,9,NULL,2,NULL), (39,23,11,'2018-07-14',800,10,NULL,2,NULL), (40,23,11,'2018-07-21',800,11,NULL,2,NULL), (41,23,11,'2018-07-28',800,12,NULL,2,NULL), (42,23,11,'2018-08-04',800,13,NULL,2,NULL), (43,23,11,'2018-08-11',800,14,NULL,2,NULL), (44,21,12,'2018-08-15',8000,1,NULL,2,NULL), (45,21,12,'2018-08-22',8000,2,NULL,2,NULL), (46,21,12,'2018-08-29',8000,3,NULL,2,NULL), (47,21,12,'2018-09-05',8000,4,NULL,2,NULL), (48,21,12,'2018-09-12',8000,5,NULL,2,NULL), (49,21,12,'2018-09-19',8000,6,NULL,2,NULL), (50,21,12,'2018-09-26',8000,7,NULL,2,NULL), (51,21,12,'2018-10-03',8000,8,NULL,2,NULL), (52,21,12,'2018-10-10',8000,9,NULL,2,NULL), (53,21,12,'2018-10-17',8000,10,NULL,2,NULL), (54,21,12,'2018-10-24',8000,11,NULL,2,NULL), (55,21,12,'2018-10-31',8000,12,NULL,2,NULL), (56,21,12,'2018-11-07',8000,13,NULL,2,NULL), (57,21,12,'2018-11-14',8000,14,NULL,2,NULL), (58,23,9,'2018-11-05',5000,15,NULL,2,'qwe'), (59,21,12,'2018-11-21',8000,15,NULL,2,'este '); /*Table structure for table `tarjeton_personal` */ DROP TABLE IF EXISTS `tarjeton_personal`; CREATE TABLE `tarjeton_personal` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_Cliente` int(10) unsigned NOT NULL, `id_Credito` int(10) unsigned NOT NULL, `numero_Pago` tinyint(4) NOT NULL, `fecha_Asignada` date NOT NULL, `cantidad` int(11) NOT NULL, `fecha_Pago` date DEFAULT NULL, `status` tinyint(3) unsigned NOT NULL, `observaciones` text COLLATE utf8_spanish2_ci, PRIMARY KEY (`id`), KEY `fk_tarjetones_credito` (`id_Credito`), KEY `fk_tarjetones_cliente` (`id_Cliente`), KEY `status` (`status`), CONSTRAINT `fk_tarjetones_cliente` FOREIGN KEY (`id_Cliente`) REFERENCES `clientes_personal` (`id`), CONSTRAINT `fk_tarjetones_credito` FOREIGN KEY (`id_Credito`) REFERENCES `credito_personal` (`id`) ON DELETE CASCADE, CONSTRAINT `tarjeton_personal_ibfk_1` FOREIGN KEY (`status`) REFERENCES `status_pagos` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; /*Data for the table `tarjeton_personal` */ /*Table structure for table `tipo_domicilio` */ DROP TABLE IF EXISTS `tipo_domicilio`; CREATE TABLE `tipo_domicilio` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `tipo_domicilio` */ insert into `tipo_domicilio`(`id`,`Descripcion`) values (1,'Propia'), (2,'Familiar'), (3,'Rentada'), (4,'Hipotecada'), (5,'Otra'); /*Table structure for table `tipos_credito` */ DROP TABLE IF EXISTS `tipos_credito`; CREATE TABLE `tipos_credito` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `Descripcion` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `tipos_credito` */ insert into `tipos_credito`(`id`,`Descripcion`) values (1,'13 Semanas'), (2,'14 Semanas'), (3,'Interes Mensual'); /*Table structure for table `tipos_interes` */ DROP TABLE IF EXISTS `tipos_interes`; CREATE TABLE `tipos_interes` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `descripcion` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `tipos_interes` */ insert into `tipos_interes`(`id`,`descripcion`) values (1,7), (2,8), (3,9), (4,10), (5,0); /*Table structure for table `tipos_usuarios` */ DROP TABLE IF EXISTS `tipos_usuarios`; CREATE TABLE `tipos_usuarios` ( `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, `descripcion` varchar(20) COLLATE utf8_spanish_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `tipos_usuarios` */ insert into `tipos_usuarios`(`id`,`descripcion`) values (1,'Administrador'), (2,'cliente'); /*Table structure for table `usuarios` */ DROP TABLE IF EXISTS `usuarios`; CREATE TABLE `usuarios` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Nombre` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `Apellido_Paterno` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `Apellido_Materno` varchar(60) COLLATE utf8_spanish_ci NOT NULL, `usuario` varchar(40) COLLATE utf8_spanish_ci NOT NULL, `contraseña` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `tipo_usuario` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `tipo_usuario` (`tipo_usuario`), CONSTRAINT `usuarios_ibfk_1` FOREIGN KEY (`tipo_usuario`) REFERENCES `tipos_usuarios` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; /*Data for the table `usuarios` */ insert into `usuarios`(`id`,`Nombre`,`Apellido_Paterno`,`Apellido_Materno`,`usuario`,`contraseña`,`tipo_usuario`) values (1,'Alfredo','Lara','Meza','fred','123',1), (2,'Alfredo','Lara','Meza','fred','321',2); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
CREATE TABLE [oms].[salidas] ( [id_salida] BIGINT NOT NULL IDENTITY(1,1), cliente_codigo VARCHAR(20) NOT NULL, servicio_codigo VARCHAR(50) NOT NULL, numero_orden VARCHAR(20) NOT NULL, canal_codigo VARCHAR(50) NOT NULL, tercero_identificacion VARCHAR(20) NOT NULL, tercero_sucursal VARCHAR(50) NOT NULL, tercero_nombre VARCHAR(100) NOT NULL, ciudad_codigo VARCHAR(50) NOT NULL, direccion VARCHAR(150) NOT NULL, punto_codigo VARCHAR(50) NOT NULL, punto_nombre VARCHAR(100) NOT NULL, femi DATE NULL, fema DATE NULL, homi TIME(0) NULL, homa TIME(0) NULL, contacto_nombres VARCHAR(100) NOT NULL, contacto_telefonos VARCHAR(50) NOT NULL, contacto_email VARCHAR(100) NOT NULL, notas VARCHAR(200) NOT NULL, requiere_transporte VARCHAR(1) NOT NULL, autorizado_identificacion VARCHAR(20) NOT NULL, autorizado_nombres VARCHAR(100) NOT NULL, requiere_recaudo VARCHAR(1) NOT NULL, valor_recaudar INTEGER NULL, requiere_agendamiento VARCHAR(1) NOT NULL, producto_codigo VARCHAR(50) NOT NULL, producto_codigo_alterno VARCHAR(50) NOT NULL, producto_nombre VARCHAR(200) NOT NULL, cantidad INTEGER NOT NULL, bodega_origen_codigo VARCHAR(50) NOT NULL, estado_inventario_origen_codigo VARCHAR(50) NOT NULL, bodega_destino_codigo VARCHAR(50) NOT NULL, estado_inventario_destino_codigo VARCHAR(50) NOT NULL, valor_unitario_declarado DEC(14,4) NULL, valor_venta_linea DEC(14,4) NULL, lote VARCHAR(30) NOT NULL, predistribucion_crossdock VARCHAR(200) NOT NULL, predistribucion_evento VARCHAR(200) NOT NULL, prefijo_orden VARCHAR(20) NOT NULL, numero_orden_sin_prefijo VARCHAR(20) NOT NULL, fecha_orden DATE NULL, documento_cliente VARCHAR(20) NOT NULL, fecha_documento_cliente DATE NULL, [id_cliente] BIGINT NULL, [id_servicio] BIGINT NULL, [id_canal] BIGINT NULL, [id_ciudad] BIGINT NULL, [id_producto] BIGINT NULL, [id_bodega_origen] BIGINT NULL, [id_estado_inventario_origen] VARCHAR(50) NULL, [id_bodega_destino] BIGINT NULL, [id_estado_inventario_destino] VARCHAR(50) NULL, [id_archivo] BIGINT NOT NULL, [id_estado_registro] VARCHAR(50) NOT NULL, [linea] VARCHAR(MAX) NOT NULL, [fecha_creacion] DATETIME2 (0) NOT NULL, [usuario_creacion] VARCHAR (50) NOT NULL, [fecha_actualizacion] DATETIME2(0) NOT NULL, [usuario_actualizacion] VARCHAR(50) NOT NULL, CONSTRAINT [PK_salidas] PRIMARY KEY CLUSTERED ([id_salida] ASC) ON [INDEXES], CONSTRAINT [FK_salidas_archivos] FOREIGN KEY ([id_archivo]) REFERENCES [etl].[archivos]([id_archivo]) )
-- 在此处添加您的测试方案 --
DROP DATABASE PHOTOSHARE; CREATE DATABASE PHOTOSHARE; USE PHOTOSHARE; CREATE TABLE USER ( UID INT NOT NULL AUTO_INCREMENT, EMAIL VARCHAR(30) UNIQUE NOT NULL, PASSWORD VARCHAR(30) NOT NULL, FNAME VARCHAR(30) NOT NULL, LNAME VARCHAR(30) NOT NULL, GENDER VARCHAR(10), DOB DATE NOT NULL, HOMETOWN VARCHAR(30), PRIMARY KEY (UID) ); CREATE TABLE FRIENDSHIP ( UID1 INT NOT NULL, UID2 INT NOT NULL, PRIMARY KEY (UID1, UID2), FOREIGN KEY (UID1) REFERENCES USER (UID) ON DELETE CASCADE, FOREIGN KEY (UID2) REFERENCES USER (UID) ON DELETE CASCADE ); CREATE TABLE ALBUM ( AID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(30) NOT NULL, DOC TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UID INT NOT NULL, PRIMARY KEY (AID), FOREIGN KEY (UID) REFERENCES USER (UID) ON DELETE CASCADE ); CREATE TABLE PHOTO ( PID INT NOT NULL AUTO_INCREMENT, CAPTION VARCHAR(200), DATA VARCHAR(100) NOT NULL, AID INT NOT NULL, PRIMARY KEY (PID), FOREIGN KEY (AID) REFERENCES ALBUM (AID) ON DELETE CASCADE ); CREATE TABLE TAG ( HASHTAG VARCHAR(30) NOT NULL, PRIMARY KEY (HASHTAG) ); CREATE TABLE ASSOCIATE ( PID INT NOT NULL, HASHTAG VARCHAR(30) NOT NULL, PRIMARY KEY (PID, HASHTAG), FOREIGN KEY (PID) REFERENCES PHOTO (PID) ON DELETE CASCADE, FOREIGN KEY (HASHTAG) REFERENCES TAG (HASHTAG) ON DELETE CASCADE ); CREATE TABLE COMMENT ( CID INT NOT NULL AUTO_INCREMENT, CONTENT VARCHAR(200) NOT NULL, DOC TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UID INT NOT NULL, PID INT NOT NULL, PRIMARY KEY (CID), FOREIGN KEY (UID) REFERENCES USER (UID) ON DELETE CASCADE, FOREIGN KEY (PID) REFERENCES PHOTO (PID) ON DELETE CASCADE ); CREATE TABLE FAVORITE ( UID INT NOT NULL, PID INT NOT NULL, DOC TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (UID, PID), FOREIGN KEY (UID) REFERENCES USER (UID) ON DELETE CASCADE, FOREIGN KEY (PID) REFERENCES PHOTO (PID) ON DELETE CASCADE ); INSERT INTO USER (EMAIL, PASSWORD, FNAME, LNAME, DOB) VALUES ('anonymous@photoshare.com', 'password', 'Anonymous', 'User', '2017-10-01'); INSERT INTO USER (EMAIL, PASSWORD, FNAME, LNAME, DOB) VALUES ('zqzhang@bu.edu', 'hello', 'Zuoqi', 'Zhang', '2017-10-01'); INSERT INTO USER (EMAIL, PASSWORD, FNAME, LNAME, DOB) VALUES ('chahuang@bu.edu', 'hello', 'Charles', 'Huang', '2017-10-01'); INSERT INTO USER (EMAIL, PASSWORD, FNAME, LNAME, DOB) VALUES ('test@bu.edu', 'test', 'test', 'test', '2017-10-01'); INSERT INTO USER (EMAIL, PASSWORD, FNAME, LNAME, DOB) VALUES ('aa@aa.com', 'aa', 'aa', 'aa', '2017-10-01'); INSERT INTO FRIENDSHIP VALUES (2, 3); INSERT INTO FRIENDSHIP VALUES (3, 2); INSERT INTO FRIENDSHIP VALUES (2, 4); INSERT INTO FRIENDSHIP VALUES (4, 2); INSERT INTO ALBUM (NAME, DOC, UID) VALUES ('Default', CURRENT_TIMESTAMP, 4); INSERT INTO ALBUM (NAME, DOC, UID) VALUES ('Test', CURRENT_TIMESTAMP, 4); INSERT INTO PHOTO (CAPTION, DATA, AID) VALUES ('Photo 1', '1.jpg', 1); INSERT INTO PHOTO (CAPTION, DATA, AID) VALUES ('Photo 2', '2.jpg', 2); INSERT INTO PHOTO (CAPTION, DATA, AID) VALUES ('Photo 3', '3.jpg', 2); INSERT INTO TAG VALUES ('boston'); INSERT INTO TAG VALUES ('icon'); INSERT INTO ASSOCIATE VALUES (1, 'boston'); INSERT INTO ASSOCIATE VALUES (1, 'icon'); INSERT INTO ASSOCIATE VALUES (2, 'icon'); INSERT INTO ASSOCIATE VALUES (3, 'icon'); INSERT INTO COMMENT (CONTENT, DOC, UID, PID) VALUES ('Comment from test user.', CURRENT_TIMESTAMP, 4, 1); INSERT INTO FAVORITE VALUES (5, 1, CURRENT_TIMESTAMP);
/* This query creates a canonical events * table to be used for generating labels * and sequential features. */ create table clean.canonical_events as select * from premodeling.dedupeid_event_dates;
/*----------第十五章 用户安全管理---------------*/ /* 15.1 权限表 15.1.1 user表 use mysql; desc user; 1.用户列 其中Host和user为主键 2.权限列 3.安全列 4.资源控制列 15.1.2 db表 desc mysql.db; 15.1.3 table_priv表和columns_priv表 desc tables_priv; desc columns_priv; 15.1.4 procs_priv表 desc procs_priv; 15.2 账户管理 15.2.1 登陆和退出MySQL服务器 mysql -h hostname|hostIP -P port -u username -p DatabaseName -e "SQL语句" 【示例一】使用root用户登陆到本机的数据库。 mysql -h localhost -uroot -p mysql -h 127.0.0.1 -uroot -p 【示例二】使用root用户登陆到本机的mysql数据库,并查询func的表结构。 mysql -h localhost -uroot -p mysql -e "desc func"; 15.2.2 新建普通用户 1.用CREATE USER语句新建普通用户 CREATE USER user[IDENTIFIED BY [PASSWORD] 'password'] ,...,[user[IDENTIFIED BY [PASSWORD] 'password']] 【示例三】使用CREATE语句创建名为Justin的用户,密码为123456主机名为localhost。 CREATE USER 'Justin'@'localhost' IDENTIFIED BY '123456'; 2.用GRANT语句新建普通用户 GRANT priv_type ON database.table TO user[IDENTIFIED BY [PASSWORD] 'password'] ,...,[user[IDENTIFIED BY [PASSWORD] 'password']] 【示例五】使用GRANT语句创建名为Justin的用户,密码为123456主机名为localhost,该用户对所有数据库有查询权限。 GRANT SELECT ON *.* TO 'Justin'@'localhost' IDENTIFIED BY '123456'; 3.用INSERT语句新建普通用户 使用时注意将没有默认值的列加上,语句执行完需执行FLUSH PRIVILEGES;需具有RELOAD权限。 15.2.3 删除普通用户 1.用DROP语句来删除普通用户 DROP USER user[,uer]... 【示例六】删除用户名为Justin主机名为localhost的用户。 DROP USER 'Justin'@'localhost'; 2.用DELETE语句删除普遍用户 DELETE FROM mysql.user WHERE host='hostname' AND user='username'; 【示例七】删除Emily用户,主机名localhost DELETE FROM mysql.user WHERE host='localhost' AND user='Emily'; FLUSH PRIVILEGES; 15.2.4 root用户修改自己密码 1.使用mysqladmin命令修改 mysqladmin -u username -p password "new_password"; 【示例八】修改root密码为hello1234 mysqladmin -u root -p password "hello1234"; 2.修改mysql数据库下的user表 UPDATE mysql.user SET password=PASSWORD('new_password') WHERE host='hostname' and user='username'; 【示例九】修改root密码为123456 UPDATE mysql.user SET authentication_string=PASSWORD('123456') WHERE host='localhost' and user='root'; flush privileges; 3.使用SET语句修改 SET PASSWORD='new_password'; 【示例十】使用SET修改用户密码 SET PASSWORD='xxxxxxxx'; 15.2.5 root用户修改普通用户密码 1.使用SET命令修改 SET PASSWORD FOR 'username'@'hostname'=PASSWORD('new_password'); 【示例十一】修改Justin的密码为123456 SET PASSWORD FOR 'Justin'@'localhost'='123456'; 2.修改mysql的user表 同修改root密码的语法一样 【示例十二】 UPDATE mysql.user SET authentication_string=PASSWORD('123456') WHERE host='localhost' and user='Justin'; 3.使用GRANT语句修改 GRANT priv_type ON database.table TO user[IDENTIFIED BY [PASSWORD] 'password']; 【示例十三】 GRANT SELECT ON *.* TO 'Justin'@'localhost' IDENTIFIED BY 'hello1234'; 15.2.6 普通用户修改密码 修改自己密码 SET PASSWORD='new_password'; 15.2.7 root用户密码丢失的解决办法 1.Windows系统下 步骤1:以管理员身份打开DOS窗口并停止MySQL服务 NET STOP mysql 步骤2:进入MySQL安装目录下的bin目录 步骤3:以安全模式打开MySQL mysqld --defaults-file="D:\Program Files\mysql-5.7.23-winx64\my.ini" --skip-grant-tables 步骤4: 重新打开一个DOS窗口,用以下命令登陆MySQL mysql -uroot 步骤5:使用update语句更新root用户密码 UPDATE mysql.user SET authentication_string=PASSWORD('new_password') WHERE user='root'; 步骤六:刷新操作 FLUSH PRIVILEGES; 步骤七:查看windows所有进程 tasklist 步骤八:使用tskill 关闭mysql进程 tskill mysqld/pid 步骤九:重新启动mysql NET START mysql 步骤十:使用新密码登陆 mysql -uroot -p 2.Linux系统下 1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL 数据库。 因为在重新设置MySQL的root密码的期间,MySQL数据库完全出于没有 密码保护的状态下,其他的用户也可以任意地登录和修改MySQL的信息。 可以采用将MySQL对外的端口封闭,并且停止Apache以及所有的用户进程的方法 实现服务器的准安全状态。 最安全的状态是到服务器的Console上面操作,并且拔掉网线。 2.修改MySQL的登录设置: # vi /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 保存并且退出vi。 3.重新启动mysqld # /etc/init.d/mysqld restart ( service mysqld restart ) 4.登录并修改MySQL的root密码 mysql> USE mysql ; mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ; mysql> flush privileges ; mysql> quit 5.将MySQL的登录设置修改回来 # vi /etc/my.cnf 将刚才在[mysqld]的段中加上的skip-grant-tables删除 保存并且退出vi。 6.重新启动mysqld # /etc/init.d/mysqld restart ( service mysqld restart ) 7.恢复服务器的正常工作状态 将步骤一中的操作逆向操作。恢复服务器的工作状态。 3.Mac下 step1: 关闭mysql服务: 苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务(点击stop mysql server) step2: 进入终端输入:cd /usr/local/mysql/bin/ 回车后 登录管理员权限 sudo su 回车后输入以下命令来禁止mysql验证功能 ./mysqld_safe --skip-grant-tables & 回车后mysql会自动重启(偏好设置中mysql的状态会变成running) step3: 输入命令 ./mysql 回车后,输入命令 FLUSH PRIVILEGES; 回车后,输入命令 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('你的新密码'); 15.3 权限管理 权限管理主要是对登陆到MySQL的用户进行权限验证。所有用户的权限都 存储在MySQL的权限表中,不合理的权限规划会给系统带来安全隐患。数据 库管理员要对所有用户的权限进行合理的规划管理。MySQL的权限系统主要 功能是证实连接到一台给定主机的用户,并且赋予该用户在数据库上的SELECT, INSERT,UPDATE,和DELETE权限。 15.3.1 MySQL的各种权限 权限信息存储在MySQL数据库的user、db、host、tables_priv、columns_priv和procs_priv表中。 在MySQL启动时,服务器将这些数据库表中的信息的内容读入内存。 15.3.2 授权 授权就是为某个用户赋予某些权限。合理的授权可保证数据库的安 全,不合理的授权会给数据库带来安全隐患。 授予的权限可分为多个层级: 1.全局层级 适用于一个给定服务器的所有目标。 GRANT ALL ON *.*和REVOKE ALL ON *.* 2.数据库层级 适用于一个给定数据库的所有目标。 GRANT ALL ON db_name和REVOKE ALL ON db_name.* 3.表层级 适用于一个给定表的所有列。 GRANT ALL ON db_name.tablename和REVOKE ALL ON db_name.tablename 4.列层级 列权限适用于一个给定表中的单一列。这些权限存储在 mysql.columns_priv表中。当使用REVOKE时,必须指定和被授予相同的列。 5.子程序层级 CREATE ROUTINE、ALTER ROUTINE、EXECUTE和GRANT权限适用 于已存储的子程序。这些权限可以被授予为全局层级和数据库层级。 而且,除了CREATE ROUTINE外,这些权限可以被授予子程序层级, 并存储在mysql.procs_priv表中。 GRANT语法: GRANT priv_type[(column_list)] ON database.table TO user[IDENTIFIDE BY[PASSWORD] 'password'] [,user[IDENTIFIDE BY[PASSWORD] 'password']] ... [WITH with_option[with_option]...] priv_type:表示权限类型; column_list:表示权限作用在哪些列上; user:由用户名和主机名构成,形式'username'@'hostname'; IDENTIFIDE:用来设置新密码; password:为新密码; WITH:后面带有一个或多个with_option参数。这个参数有五个选 项,分别为: GRANT OPTION:被授予的用户可以将这些权限授予别的用户。 MAX_QUERIES_PER_HOUR count:设置每小时允许执行count次查询。 MAX_UPDATES_PER_HOUR count:设置每小时允许执行count次更新。 MAX_CONNECTIONS_PER_HOUR count:设置每小时可以建立count个连接。 MAX_USER_CONNECTIONS count:设置单个用户同时可以具有count个连接。 【示例15-16】下面作用GRANT创建一个新用户‘Rebecca’。该用户对所有数据 库有SELECT和UPDATE权限。密码为‘123456’,且加上WITH GRANT OPTION字句。 步骤一:创建执行语句。 GRANT SELECT,UPDATE ON *.* TO 'Rebecca'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION; 步骤二:查询user表,查看Rebecca的信息。 SELECT host,user,authentication_string,select_priv,update_priv,grant_priv FROM mysql.user WHERE user='Rebecca' \G 15.3.3 查看权限 方法一:使用SELECT * FROM mysql.user;必须具有user表的SELECT权限。 方法二:SHOW GRANTS FOR 'username'@'hostname'; 【示例15-17】查看root用户权限。 SHOW GRANTS FOR 'root'@'localhost'; 【示例15-18】查看Rebecca用户权限。 SHOW GRANTS FOR 'Rebecca'@'localhost'; 【示例15-19】查看Rebecca用户的SELECT和INSERT权限。 SELECT select_priv,insert_priv FROM mysql.user WHERE user='Rebecca' AND host='localhost'; 15.3.4 收回权限 收回权限就是取消已经赋予用户的某些权限。收回用户不必要的权限可以在一 定程度上保证系统的安全性。 语法形式: REVOKE priv_type[(cloumn_list)]... ON database.table FROM user[,user]... 收回全部权限语法形式: REVOKE ALL PRIVILEGES,GRANT OPTION FROM user[,user]... 【示例15-20】收回Rebecca用户的UPDATE权限。 REVOKE UPDATE ON *.* FROM 'Rebecca'@'localhost'; SELECT host,user,authentication_string,update_priv FROM mysql.user WHERE user='Rebecca' AND host='localhost'; 【示例15-20】收回Rebecca用户的所有权限。 REVOKE ALL PRIVILEGES,GRANT OPTION FROM 'Rebecca'@'localhost'; SELECT host,user,authentication_string,select_priv,update_priv,grant_priv FROM mysql.user WHERE user='Rebecca' AND host='localhost'; 15.4 访问控制 15.4.1 连接核实阶段 当用户试图连接MySQL服务器时,服务器基于用户的身份以及用户是否能提供 正确的密码验证身份来确定接受或拒绝连接。 15.4.2 请求核实阶段 一旦建立了连接,服务器就进入了访问控制的阶段2,也就是请求核实阶段。 对此连接上进来的每个请求,服务器检查该请求执行什么操作,是否有足够的权 限来执行它,这正是授权表中权限列发挥作用的地方。这些权限可以来自user、 db、table_priv、column_priv表。 15.5 综合示例---综合管理用户权限 步骤1:使用root用户登陆mysql mysql -uroot -p 步骤2:选择数据库 USE mysql; 步骤3:创建新用户newRebecca,key为123456,允许其从本地访问MySQl,并拥有对数据 库school中t_student表的SELECT和UPDATE权限,同时允许每小时建立30次连接。 GRANT SELECT,UPDATE(gender,studentId,studentName,age) ON school.t_student TO 'newRebecca'@'localhost' IDENTIFIED BY '123456' WITH MAX_CONNECTIONS_PER_HOUR 30; 步骤4:分别从user表查看新账户信息,从tables_priv和columns_priv表中查看权限信 息。 SELECT host,user,select_priv,update_priv FROM mysql.user WHERE host='localhost' AND user='newRebecca'; SELECT host,db,user,table_name,table_priv,column_priv FROM tables_priv WHERE user='newRebecca'; SELECT host,db,user,table_name,column_name,column_priv FROM columns_priv WHERE user='newRebecca'; 步骤5:查看newRebecca的权限信息。 SHOW GRANTS FOR 'newRebecca'@'locahost' \G 步骤6:使用newRebecca用户登陆MySQL mysql -unewRebecca -p123456 步骤7:查看t_student表中的数据 SELECT * FROM school.t_student; 步骤8:向表t_student中插入一条记录 INSERT INTO t_student VALUES(2,'Betty','Female',21,1,489); 步骤9:使用REVOKE收回newRebecca账户权限,再用SHOW GRANTS语句查看权限。 REVOKE SELECT,UPDATE(gender,studentId,studentName,age) ON school.t_student FROM 'newRebecca'@'localhost'; SHOW GRANTS FOR 'newRebecca'@'localhost' \G 步骤10:删除newRebecca账户信息。 DROP USER 'newRebecca'@'localhost'; SELECT host,user,select_priv,update_priv FROM user WHERE user='newRebecca'; 15.6 经典习题与面试题 1.经典习题 (1) GRANT SELECT,INSERT ON company.t_employee TO 'newAccount'@'localhost' IDENTIFIED BY '123456'; GRANT UPDATE(deptname) ON company.t_dept TO 'newAccount'@'localhost'; (2) SET PASSWORD FOR 'newAccount'@'localhost'='654321'; (3) FLUSH PRIVILEGES; (4) SHOW GRANTS FOR 'newAccount'@'localhost' \G (5) REVOKE ALL PRIVILEGES,GRANT OPTION FROM 'newAccount'@'localhost'; (6) DROP USER 'newAccount'@'localhost'; 2.面试题及解答 (1)MySQLadmin能不能修改普通用户的密码 不能,普通用户不具备SUPER权限 (2)删除一个账户后,为何该账户还可以登陆到MySQL数据库 注意查看user表中是否有User字段值为空串的记录存在,若存在删除之。 (3)新建MySQL用户不能在其他机器上登陆MySQL数据库系统 修改该账户的host字段值为%,并授权允许其远程访问 (4)应该使用哪种方式创建用户 为了系统的安全性,推荐使用CREATE USER语句和GRANT。 15.7本章小结 本章讲解了MySQL数据库的权限表、账户管理、权限管理的内容。其中 账户管理和权限管理是重点。特别是密码管理、授权和收回是重中之重,因为它 们涉及MySQL数据库安全。 取回root用户密码和授权是难点。 本章讲解了在Window、Linux、Mac系统下root密码丢失的解决办法。 需反复练习并掌握。 下一章讲解数据库备份和恢复
-- -------------------------------------------------------- -- -- Estrutura da tabela `tb_atividade_economica_subsetor` -- CREATE TABLE `tb_atividade_economica_subsetor` ( `codigo` int(11) NOT NULL, `setor` int(11) DEFAULT NULL, `subsetor` varchar(41) DEFAULT NULL, `descricao` varchar(259) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Extraindo dados da tabela `tb_atividade_economica_subsetor` -- INSERT INTO `tb_atividade_economica_subsetor` (`codigo`, `setor`, `subsetor`, `descricao`) VALUES (517, 523, 'Agricultura', 'Produção de safra agrícola'), (518, 523, 'Pecuária', 'Criação de animais para consumo humano: bovinos, suínos, eqüinos, aves, etc'), (519, 523, 'Serviços', 'Serviços relacionados com a agropecuária'), (520, 523, 'Florestamento', 'Florestas para produção de madeira, outros produtos e serviços relacionados'), (521, 523, 'Pesca e Caça', 'Pesca, caça e procriação de peixes e animais de caça'), (522, 523, 'Lavra de metais', 'Mineração de todo tipo de metais e serviços relacionados'), (523, 523, 'Lavra de carvão', 'Lavra de carvão e antracito, serviços relacionados'), (524, 523, 'Lavra de petróleo e gás', 'Extração de óleo bruto, gas natural e serviços relacionados'), (525, 523, 'Lavra de minérios não metálicos', 'Extração de pedras, brita, areia, cascalho, argila, cerâmica, rochas usadas na indústria química e de fertilizantes'), (526, 519, 'Construção de prédios', 'Construção de edificações residenciais, comerciais e industriais'), (527, 519, 'Construção pesada', 'Construção de estradas, ruas, canais, túneis, pontes e outras construções de grande porte'), (528, 519, 'Construção especializada', 'Construção - empreiteiras especializadas; p.ex. pintura, concretagem, vidros, instalações elétricas, pisos, etc.'), (529, 519, 'Produtos alimentícios', 'Alimentos: carnes, laticínios, enlatados, farinhas, pães, doces, óleos, bebidas, etc.'), (530, 519, 'Produtos de fumo', 'Produtos de fumo: processamento de tabaco, cigarros e charutos'), (531, 519, 'Produtos téxteis', 'Produtos têxteis: todos os tipos de tecidos'), (532, 519, 'Vestuário', 'Vestuário e outros produtos têxteis acabados, inclusive de matérias primas não téxteis'), (533, 519, 'Produtos de madeira', 'Produtos de madeira, exceto móveis: serrarias, chapas, casas prefabricadas'), (534, 519, 'Móveis e Prateleiras', 'Móveis residenciais e comerciais, prateleiras, venezianas e persianas de madeira'), (535, 519, 'Produtos de Papel', 'Papéis e produtos relacionados, p.ex. papelão, caixas, sacos, higiênico, envelopes, etc.'), (536, 519, 'Gráficas e Imprensa', 'Impressões (offset, litografia, etc) e publicações (jornais, revistas, impressos, etc)'), (537, 519, 'Produtos Químicos', 'Produtos químicos e correlatos: inorgánicos, plásticos, farmaceútico, limpeza, sabões, tintas, vernizes, fertilizantes'), (538, 519, 'Derivados de Petróleo/Carvão/Álcool', 'Refinação de petróleo, asfaltos, óleos e graxas; usinas de produção de álcool carburante'), (539, 519, 'Produtos de Borracha e Plástico', 'Produtos de borracha e plásticos: pneus, câmaras, calçados, mangueiras, perfis, tubos, garrafas, etc'), (540, 519, 'Produtos de Couro', 'Couros: curtimento, solas, chinelos, calçados, luvas, malas, bolsas'), (541, 519, 'Produtos de Pedra, Argila, Vidro', 'Produtos de pedra (cal, gesso), argila (telhas, tijolos, azulejos e pisos), vidro (plano, reciclado, garrafas) e concreto'), (542, 519, 'Siderurgia Primária', 'Indústrias siderúrgicas primárias: altos-fornos, laminarias, fundições'), (543, 519, 'Produtos de Metal', 'Produtos fabricados de metal, exceto maquinário e equipamento de transporte'), (544, 519, 'Maquinário Industrial', 'Maquinário industrial: motores, turbinas, equipamento agrícola, p/construção, guinchos'), (545, 519, 'Equipamentos Elétricos', 'Equipamento elétrico: transformadores, eletrodomésticos, iluminação, aúdio, vídeo, componentes, pilhas'), (546, 519, 'Transportes', 'Equipamentos de transporte: automóveis, aviões, navios, trens, bicicletas, mísseis, trailers, tanques'), (547, 519, 'Instrumentos de Medição', 'Instrumentos de medição, controle e análise; equipamentos fotográficos, médicos e óticos; relógios'), (548, 519, 'Outras Indústrias', 'Indústrias manufatureiras diversas: vassouras, letreiros, caixões e outros'), (549, 521, 'Transporte por Ferrovia', 'Transporte Ferroviário de Passageiros e serviços relacionados'), (550, 521, 'Transportes Automotores', 'Transporte de passageiros por veículos automotores (taxi, ônibus, rodoviárias), local e intermunicipal'), (551, 521, 'Transporte de Cargas e Armazéns', 'Transportes de carga e armazenagem por veículos automotores'), (552, 521, 'Serviço Postal e Couriers', 'Serviços postais públicos e privados, inclusive couriers locais e internacionais'), (553, 521, 'Transporte marítimo e fluvial', 'Transporte marítimo e fluvial'), (554, 521, 'Transporte Aéreo', 'Transporte aéreo'), (555, 521, 'Oleodutos', 'Oleodutos, exceto de gás natural'), (556, 521, 'Serviços de transporte', 'Serviços de transporte: agências de viagem, excursões'), (557, 521, 'Serviços de comunicação', 'Comunicações: telefonia, radio, TV'), (558, 521, 'Eletricidade, Gás e Saneamento', 'Serviços de eletricidade, gás e tratamento de esgoto'), (559, 517, 'Atacado de Bens Duráveis', 'Comércio atacadista de bens duráveis: veículos, móveis, madeiras, equipamentos, eletroeletrônicos, etc.'), (560, 517, 'Atacado de Bens de Consumo', 'Comércio atacadista de bens não duráveis: papel, remedios, alimentos, vestiário, matéria prima, combustível, etc.'), (561, 517, 'Varejo de material de construção', 'Comércio varejista de materiais de construção, ferragens e artigos para jardim'), (562, 517, 'Varejo em geral', 'Comércio varejista de mercadorias em geral: lojas de departamento, conveniência, etc.'), (563, 517, 'Varejo de alimentos', 'Comércio varejista de alimentos: supermercados, mercearias, açougues, padarias, etc.'), (564, 517, 'Varejo de automóv. e combustív.', 'Revendedores de automóveis e postos de gasolina'), (565, 517, 'Varejo de roupas e acessórios', 'Comércio varejista de roupas e acessórios'), (566, 517, 'Varejo de móveis e equip. domést', 'Comércio varejista de móveis domésticos, acessórios e equipamentos'), (567, 517, 'Restaurantes e Bares', 'Comércio de alimentos e bebidas prontas para consumo'), (568, 517, 'Outros varejistas', 'Varejistas diversos: farmácias, adegas, artigos usados, livrarias, joalherias, combustíveis, etc., vendas sem lojas'), (569, 518, 'Instituições de Depósito', 'Instituições financeiras com depósitos: bancos, cooperativas'), (570, 518, 'Instituições de Crédito', 'Instituições de crédito sem depósitos: financeiras, crédito pessoal, hipotecário, etc'), (571, 518, 'Corretoras e Distribuidoras', 'Corretoras e distribuidoras de títulos e valores mobiliários'), (572, 518, 'Seguradoras', 'Seguradoras'), (573, 518, 'Corretores de Seguros', 'Agentes e corretores de seguros e serviços'), (574, 518, 'Imobiliárias', 'Propriedade imobiliária: administração e corretagem'), (575, 518, 'Holdings e Investimentos', 'Escritórios de holding e outros investimentos'), (576, 522, 'Hotéis e afins', 'Hotéis, motéis, pensões, acampamentos'), (577, 522, 'Serviços Pessoais', 'Serviços pessoais: lavanderia, limpeza, fotografia, salões de beleza, sapataria, funerárias'), (578, 522, 'Serviços Comerciais', 'Serviços comerciais: propaganda, cobrança, mala direta, em edificações, aluguel de equipamentos, segurança'), (579, 522, 'Serviços Automotivos', 'Conserto de automóveis, serviços e estacionamentos'), (580, 522, 'Outras Oficinas', 'Oficinas de conserto diversos'), (581, 522, 'Filmes Cinematográficos', 'Filmes cinematográficos'), (582, 522, 'Diversão e Recreação', 'Serviços de diversão e recreação: dança, teatro, boliches, clubes'), (583, 522, 'Serviços de Saúde', 'Serviços de saúde: consultórios, clínicas, hospitais, laboratórios'), (584, 522, 'Serviços Jurídicos', 'Serviços jurídicos'), (585, 522, 'Serviços Educacionais', 'Serviços Educacionais: escolas, universidades, bibliotecas'), (586, 522, 'Serviços Sociais', 'Serviço social: treinamento, reabilitação, creches'), (587, 522, 'Museus e Jardins Botânicos e Zoológicos', 'Museus, galerias de arte, jardins botânicos e zoológicos'), (588, 522, 'Associações', 'Associações de empresas, profissionais, sindicatos, políticas, religiosas, etc.'), (589, 522, 'Serviços de Engenharia e Gerenciais', 'Serviços de engenharia, contabilidade, pesquisa, administração e Serviços relacionados'), (590, 522, 'Serviços Domésticos', 'Serviços domésticos privados'), (591, 522, 'Outros Serviços', 'Outros Serviços'), (592, 524, 'Poder Executivo e Legislativo', 'Poderes executivos e legislativos em geral, exceto finanças'), (593, 524, 'Poder Judiciário e Segurança', 'Justiça, ordem pública e segurança'), (594, 524, 'Tributação', 'Tributação e política monetária'), (595, 524, 'Admin. de Recursos Humanos', 'Administração de programas de recursos humanos'), (596, 524, 'Admin. Ambiental e Habitação', 'Administração de programas de qualidade ambiental e de habitação'), (597, 524, 'Diplomacia Internacional', 'Órgãoes e Instituições relacionados às relações internacionais'), (598, 524, 'Forças Armadas e Inteligência', 'Forças armadas (exército, marinha, força aérea) e centrais de inteligência'), (599, 524, 'Fundações', 'Fundações filantrópicas, comunitárias, especiais, etc.'), (600, 520, 'Indústria', 'Equipamentos de computação e eletrônicos para uso em escritórios'), (601, 520, 'Comércio', 'Lojas de venda de computadores, software e itens relacionados'), (602, 520, 'Serviços', 'Serviços de programação de computadores e processamento de dados');
SELECT * FROM {{ @joining_defs5 }}
-- MySQL Script generated by MySQL Workbench -- 02/15/17 14:01:48 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 ; USE `mydb` ; -- ----------------------------------------------------- -- Table `mydb`.`users` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`users` ( `id_user` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `login` VARCHAR(45) NOT NULL, `password` VARCHAR(41) NOT NULL, `telephone` VARCHAR(45) NOT NULL, `email` VARCHAR(45) NOT NULL, PRIMARY KEY (`id_user`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`suppliers` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`suppliers` ( `id_supplier` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `login` VARCHAR(45) NOT NULL, `password` VARCHAR(41) NOT NULL, `email` VARCHAR(45) NOT NULL, `telephone` VARCHAR(45) NOT NULL, `info` TINYTEXT NULL, PRIMARY KEY (`id_supplier`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`isActive` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`isActive` ( `user_id` INT NOT NULL, `GET` VARCHAR(45) NOT NULL, `isActive` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`user_id`), CONSTRAINT `activation` FOREIGN KEY (`user_id`) REFERENCES `mydb`.`users` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`category` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`category` ( `id_category` INT NOT NULL AUTO_INCREMENT, `parent_id` INT NULL, `category_name` VARCHAR(45) NOT NULL, PRIMARY KEY (`id_category`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`favorites` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`favorites` ( `user_id` INT NOT NULL, `category_id` INT NOT NULL, PRIMARY KEY (`user_id`, `category_id`), INDEX `liked_category_idx` (`category_id` ASC), CONSTRAINT `user_like` FOREIGN KEY (`user_id`) REFERENCES `mydb`.`users` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `liked_category` FOREIGN KEY (`category_id`) REFERENCES `mydb`.`category` (`id_category`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`goods` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`goods` ( `id_goods` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `supplier_id` INT NULL, `numberOf` INT NOT NULL, `information` TINYTEXT NULL, `isAlwaysHere` TINYINT(1) NOT NULL DEFAULT 1, `isVisible` TINYINT(1) NOT NULL DEFAULT 1, `mark_id` INT NULL DEFAULT NULL, `key_words` TINYTEXT NOT NULL, `minimumOrderNum` INT NOT NULL DEFAULT 1, PRIMARY KEY (`id_goods`), INDEX `supplier_idx` (`supplier_id` ASC), CONSTRAINT `supplier` FOREIGN KEY (`supplier_id`) REFERENCES `mydb`.`suppliers` (`id_supplier`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`prices` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`prices` ( `goods_id` INT NOT NULL, `income_price` DOUBLE NOT NULL DEFAULT 0, `wholesale_persent` DOUBLE NOT NULL, `retail_persent` DOUBLE NOT NULL, `currency` VARCHAR(45) NOT NULL DEFAULT 'USD', PRIMARY KEY (`goods_id`), CONSTRAINT `priced_goods` FOREIGN KEY (`goods_id`) REFERENCES `mydb`.`goods` (`id_goods`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`goodsInCategories` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`goodsInCategories` ( `goods_id` INT NOT NULL, `category_id` INT NOT NULL, PRIMARY KEY (`goods_id`, `category_id`), INDEX `category_fo_goods_idx` (`category_id` ASC), CONSTRAINT `goods_in_category` FOREIGN KEY (`goods_id`) REFERENCES `mydb`.`goods` (`id_goods`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `category_fo_goods` FOREIGN KEY (`category_id`) REFERENCES `mydb`.`category` (`id_category`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`goodsImages` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`goodsImages` ( `goods_id` INT NOT NULL, `passToImage` VARCHAR(250) NOT NULL, PRIMARY KEY (`goods_id`, `passToImage`), CONSTRAINT `image_goods` FOREIGN KEY (`goods_id`) REFERENCES `mydb`.`goods` (`id_goods`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`marks` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`marks` ( `goods_id` INT NOT NULL, `name` VARCHAR(45) NOT NULL, `imagePass` TEXT(128) NOT NULL, PRIMARY KEY (`goods_id`), CONSTRAINT `goods_mark` FOREIGN KEY (`goods_id`) REFERENCES `mydb`.`goods` (`id_goods`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`orders` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`orders` ( `id_orders` INT NOT NULL AUTO_INCREMENT, `date` DATETIME NOT NULL, `client_id` INT NOT NULL, `adress` VARCHAR(45) NOT NULL, PRIMARY KEY (`id_orders`), INDEX `client_idx` (`client_id` ASC), CONSTRAINT `client` FOREIGN KEY (`client_id`) REFERENCES `mydb`.`users` (`id_user`) ON DELETE NO ACTION ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`orderLists` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`orderLists` ( `order_id` INT NOT NULL, `goods_id` INT NOT NULL, `number` INT NOT NULL DEFAULT 1, PRIMARY KEY (`order_id`, `goods_id`), INDEX `goods_in_list_idx` (`goods_id` ASC), CONSTRAINT `odrer_id_for` FOREIGN KEY (`order_id`) REFERENCES `mydb`.`orders` (`id_orders`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `goods_in_list` FOREIGN KEY (`goods_id`) REFERENCES `mydb`.`goods` (`id_goods`) ON DELETE NO ACTION ON UPDATE CASCADE) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
/* Renombrar tablas */ ALTER TABLE usuarios RENAME TO users; /* Cambiar el nombre de una columna */ ALTER TABLE usuarios CHANGE direccion dir VARCHAR(50); /* Agregar columnas */ ALTER TABLE usuarios ADD edad INT NOT NULL; /* Borrar columnas */ ALTER TABLE usuarios DROP edad;
-- Group By Rollup WITH cte_summary(GRP, Summ, Div) AS ( SELECT groupName AS [GRP] , SUM (price*amount) AS Summ , GROUPING_ID(groupName) AS Div FROM buyTbl GROUP BY RollUp (groupName) ) SELECT CASE Div WHEN 0 THEN grp WHEN 1 THEN '총합계' END AS [상품그룹] , Summ AS [그룹별 구매금액] -- , Div FROM cte_summary
insert into equipment (state,asset, to_delete, name, inventory_number) values (0,false,false,' Kompresor AIRPRESS ',' '), (0,false,false,' Monitor Belinea 17"" ',' 2561/307/ '), (0,false,false,' Komputer HP Compaq ',' 2388/287 '); insert into user (username, password, CREDENTIALS_NON_EXPIRED, name) values ('jarek','$2a$04$Q1a7bH9YPQ9S3YlZdPGudejvJRrUmGwph2qBdGoF66aefU5OaU40G', true, 'JD'), ('mariusz', '$2a$12$BEpUZhok00A8oUL.XT4X2ezZ9A01eFKEZxD9qyWv2Plm9X8H8RE/K', true, 'MZ'); insert into equipment_event (equipment_state, entered_by, equipment_id) values ( 0,1,1 ), (0,1,2), (0,1,3);
-- phpMyAdmin SQL Dump -- version 4.0.4 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 08-12-2014 a las 03:15:42 -- Versión del servidor: 5.6.12-log -- Versión de PHP: 5.4.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de datos: `rcv_db` -- -- -- Volcado de datos para la tabla `pregunta` -- INSERT INTO `pregunta` (`id`, `pregunta`) VALUES (1, '¿CUAL FUE EL NOMBRE DE TU PRIMERA MASCOTA?'), (2, '¿CUAL EL ES SEGUNDO NOMBRE DE TU PADRE?'), (3, '¿DONDE CONOCISTES A TU PAREJA?'); /*!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 p.Product_Name, b.Brand_Name, p.Product_Price, i.Image_Filepath FROM YeovilHealthcare.Product AS p INNER JOIN Brand AS b ON b.Brand_ID = p.Brand_ID INNER JOIN Image AS i ON i.Product_ID = p.Product_ID; SELECT p.Product_Name, b.Brand_Name, p.Product_Price, i.Image_Filepath FROM YeovilHealthcare.Product AS p INNER JOIN Brand AS b ON b.Brand_ID = p.Brand_ID INNER JOIN Image AS i ON i.Product_ID = p.Product_ID WHERE b.Brand_Name = searchFieldEntry; SELECT p.Product_Name, b.Brand_Name, p.Product_Price, i.Image_Filepath FROM YeovilHealthcare.Product AS p INNER JOIN Brand AS b ON b.Brand_ID = p.Brand_ID INNER JOIN Image AS i ON i.Product_ID = p.Product_ID LEFT JOIN Product_Keyword AS pk ON pk.Product_ID = p.Product_ID LEFT JOIN Keyword AS k ON k.Keyword_ID = pk.Keyword_ID; WHERE p.Product_Name = searchFieldEntry OR b.Brand_Name = searchFieldEntry OR k.Keyword_Text = searchFieldEntry;
# Author: Ramji Kanaujia SELECT * FROM CITY WHERE population > 100000 AND Countrycode ="USA";
-- phpMyAdmin SQL Dump -- version 4.4.10 -- http://www.phpmyadmin.net -- -- Host: localhost:8889 -- Generation Time: Feb 10, 2017 at 07:35 PM -- Server version: 5.5.42 -- PHP Version: 5.6.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: `amaquizapp` -- -- -------------------------------------------------------- -- -- Table structure for table `answers` -- CREATE TABLE `answers` ( `id` int(11) unsigned NOT NULL, `user_id` int(11) NOT NULL, `question_option_id` int(11) NOT NULL DEFAULT '0', `answer_numeric` int(11) NOT NULL, `answer_text` varchar(255) NOT NULL, `answer_yn` tinyint(1) NOT NULL, `unit_of_measure_id` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; -- -- Dumping data for table `answers` -- INSERT INTO `answers` (`id`, `user_id`, `question_option_id`, `answer_numeric`, `answer_text`, `answer_yn`, `unit_of_measure_id`, `created_at`, `updated_at`) VALUES (1, 3, 1, 0, 'QURAN', 0, 0, 1475550508, 1475550508), (2, 3, 1, 0, 'HADITH', 0, 0, 1475550508, 1475550508), (3, 3, 1, 0, 'Adf', 0, 0, 1485699817, 1485699817), (4, 3, 1, 0, 'Adfadf', 0, 0, 1485699817, 1485699817), (5, 3, 1, 0, 'Adfs', 0, 0, 1485699829, 1485699829), (6, 3, 1, 0, 'Adfadf', 0, 0, 1485699829, 1485699829), (7, 3, 1, 0, '2', 0, 0, 1485764772, 1485764772), (8, 3, 1, 0, '3', 0, 0, 1485764772, 1485764772), (9, 3, 1, 0, 'Test', 0, 0, 1486699485, 1486699485), (10, 3, 1, 0, 'Test', 0, 0, 1486699486, 1486699486); -- -------------------------------------------------------- -- -- Table structure for table `inputtypes` -- CREATE TABLE `inputtypes` ( `id` int(11) unsigned NOT NULL, `input_type_name` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `migration` -- CREATE TABLE `migration` ( `type` varchar(25) NOT NULL, `name` varchar(50) NOT NULL, `migration` varchar(100) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `migration` -- INSERT INTO `migration` (`type`, `name`, `migration`) VALUES ('app', 'default', '001_create_users'), ('app', 'default', '002_create_questions'), ('app', 'default', '003_create_optiongroups'), ('app', 'default', '004_create_questionoptions'), ('app', 'default', '005_create_surversections'), ('app', 'default', '006_create_surveyheaders'), ('app', 'default', '007_create_inputtypes'), ('app', 'default', '008_create_optionchoices'), ('app', 'default', '009_create_usersurveysections'), ('app', 'default', '010_create_surveycomments'), ('app', 'default', '011_create_answers'), ('app', 'default', '012_create_unitofmeasures'); -- -------------------------------------------------------- -- -- Table structure for table `optionchoices` -- CREATE TABLE `optionchoices` ( `id` int(11) unsigned NOT NULL, `optiongroupid` int(11) NOT NULL, `option_choice_name` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `optiongroups` -- CREATE TABLE `optiongroups` ( `id` int(11) unsigned NOT NULL, `option_group_name` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `questionoptions` -- CREATE TABLE `questionoptions` ( `id` int(11) unsigned NOT NULL, `question_id` int(11) NOT NULL, `option_choice_id` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `questions` -- CREATE TABLE `questions` ( `id` int(11) unsigned NOT NULL, `question_name` varchar(255) NOT NULL, `question_subtext` varchar(255) NOT NULL, `answer` varchar(255) NOT NULL, `option_group_id` int(11) NOT NULL, `allow_multiple_option_answers` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- -- Dumping data for table `questions` -- INSERT INTO `questions` (`id`, `question_name`, `question_subtext`, `answer`, `option_group_id`, `allow_multiple_option_answers`, `created_at`, `updated_at`) VALUES (1, '1. Muslim Holy book?', '1. Muslim Holy book?', '1. QUR’AN', 1, '0', 1475523545, 1475523545), (2, '2. The way of life prescribed as normative for Muslims on the of the teachings and practices of Muhammad and interpretations of the Quran. ', '2. The way of life prescribed as normative for Muslims on the of the teachings and practices of Muhammad and interpretations of the Quran. ', 'HADITH', 1, '0', 1475523649, 1475523649); -- -------------------------------------------------------- -- -- Table structure for table `surversections` -- CREATE TABLE `surversections` ( `id` int(11) unsigned NOT NULL, `survey_header_id` int(11) NOT NULL, `section_name` varchar(255) NOT NULL, `section_title` varchar(255) NOT NULL, `section_subheading` varchar(255) NOT NULL, `section_required_yn` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `surveycomments` -- CREATE TABLE `surveycomments` ( `id` int(11) unsigned NOT NULL, `user_id` int(11) NOT NULL, `survey_header_id` int(11) NOT NULL, `comments` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `surveyheaders` -- CREATE TABLE `surveyheaders` ( `id` int(11) unsigned NOT NULL, `organization_id` int(11) NOT NULL, `survey_name` varchar(255) NOT NULL, `instructions` varchar(255) NOT NULL, `other_header_info` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `unitofmeasures` -- CREATE TABLE `unitofmeasures` ( `id` int(11) unsigned NOT NULL, `unit_of_measures_name` varchar(255) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) unsigned NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `group` int(11) NOT NULL, `email` varchar(255) NOT NULL, `last_login` int(11) NOT NULL, `login_hash` varchar(255) NOT NULL, `profile_fields` text NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `group`, `email`, `last_login`, `login_hash`, `profile_fields`, `created_at`, `updated_at`) VALUES (2, 'admin', 'NtgTF8q6Z9UyyUwQS7Ma5Bvj+uTrK/F66iMji9su1XY=', 100, 'phil@example.com', 1486725044, '53fd6cbd3d60af2fa0637e4e44b601d1768fc278', 'a:0:{}', 1475519635, NULL), (3, 'codeflux', 'apyquP9ijI14VfX+NSFs/t36J7R8oB6Zq9Gw6Kr9Xvc=', 1, 'codeflux@gmail.com', 1486725094, '62df4cc6808fd80c726bcf601532b0989b7b5b8b', 'a:1:{s:8:"fullname";s:9:"Code Flux";}', 1475520242, NULL); -- -------------------------------------------------------- -- -- Table structure for table `usersurveysections` -- CREATE TABLE `usersurveysections` ( `id` int(11) unsigned NOT NULL, `userid` int(11) NOT NULL, `surveysectionid` int(11) NOT NULL, `completed_on` datetime NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for dumped tables -- -- -- Indexes for table `answers` -- ALTER TABLE `answers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `inputtypes` -- ALTER TABLE `inputtypes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `optionchoices` -- ALTER TABLE `optionchoices` ADD PRIMARY KEY (`id`); -- -- Indexes for table `optiongroups` -- ALTER TABLE `optiongroups` ADD PRIMARY KEY (`id`); -- -- Indexes for table `questionoptions` -- ALTER TABLE `questionoptions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `questions` -- ALTER TABLE `questions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `surversections` -- ALTER TABLE `surversections` ADD PRIMARY KEY (`id`); -- -- Indexes for table `surveycomments` -- ALTER TABLE `surveycomments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `surveyheaders` -- ALTER TABLE `surveyheaders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `unitofmeasures` -- ALTER TABLE `unitofmeasures` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `usersurveysections` -- ALTER TABLE `usersurveysections` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `answers` -- ALTER TABLE `answers` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `inputtypes` -- ALTER TABLE `inputtypes` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `optionchoices` -- ALTER TABLE `optionchoices` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `optiongroups` -- ALTER TABLE `optiongroups` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `questionoptions` -- ALTER TABLE `questionoptions` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `questions` -- ALTER TABLE `questions` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `surversections` -- ALTER TABLE `surversections` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `surveycomments` -- ALTER TABLE `surveycomments` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `surveyheaders` -- ALTER TABLE `surveyheaders` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `unitofmeasures` -- ALTER TABLE `unitofmeasures` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `usersurveysections` -- ALTER TABLE `usersurveysections` MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
CREATE TABLE messages( usr TEXT NOT NULL, text TEXT NOT NULL ); CREATE TABLE followers( follower TEXT NOT NULL, followed TEXT NOT NULL ); CREATE INDEX ON messages(usr); CREATE INDEX ON followers(follower);
create table Bob ( keycol INTEGER not null PRIMARY KEY, varcol INTEGER NOT NULL, multi_indicator INTEGER NOT NULL CHECK(multi_indicator in ( 0, -- 既知の値 1, -- 適用不能 2, -- 失われた値 3))-- 近似値 ); -- 取り出しクエリ SELECT SUM(varcol), (CASE when not exists (select multi_indicator from Bob where multi_indicator > 0) then 0 when exists (select * from Bob where multi_indicator = 1) then 1 when exists (select * from Bob where multi_indicator = 2) then 2 when exists (select * from Bob where multi_indicator = 3) then 3 else null end) as totals_multi_indicator from Bob;
INSERT INTO "members" VALUES(1,'Ahsan Manzoor','+358413660505', 'Male', '030191'); INSERT INTO "members" VALUES(2,'Awais Aslam','+358414735298', 'Male', '140291'); INSERT INTO "members" VALUES(3,'Kaleemullah Khan','+358449220732', 'Male', '090991'); INSERT INTO "members" VALUES(4,'Abdul Hannan','+358413674839', 'Male', '170392'); INSERT INTO "members" VALUES(5,'Qandeel Baloch','+923008474974', 'Female', '150289'); INSERT INTO "user_login" VALUES(1, 1, 'ahsan.manzoor@student.oulu.fi', 'ahsan123' , '2016-03-15 01:48:05'); INSERT INTO "user_login" VALUES(2, 2, 'awais.aslam@student.oulu.fi', 'awais123' , '2016-03-16 12:48:43'); INSERT INTO "user_login" VALUES(3, 3, 'Kaleemullah.khan@student.oulu.fi', 'kaleem123' , '2016-03-16 07:33:05'); INSERT INTO "user_login" VALUES(4, 4, 'abdul.hannan@student.oulu.fi', 'abdul123' , '2016-03-17 11:55:56'); INSERT INTO "user_login" VALUES(5, 5, 'qandeel.baloch@student.oulu.fi', 'qandeel123' , '2016-03-18 23:36:21'); INSERT INTO "groups" VALUES(1, 'admins'); INSERT INTO "groups" VALUES(2, 'friends'); INSERT INTO "groups" VALUES(3, 'gasti'); INSERT INTO "group_member" VALUES(1, 1); INSERT INTO "group_member" VALUES(1, 2); INSERT INTO "group_member" VALUES(2, 3); INSERT INTO "group_member" VALUES(2, 4); INSERT INTO "group_member" VALUES(3, 5); INSERT INTO "inventory" VALUES(1, 'Banana', 'Long Yellow bananas', 1, 2, 1, 'KG'); INSERT INTO "inventory" VALUES(2, 'Tomato', 'Red Colourd balls', 0.5, 3,1, 'KG'); INSERT INTO "inventory" VALUES(3, 'Bread', 'Morning Food Yum Yum', 6, 5,1, 'PIECE'); INSERT INTO "inventory" VALUES(4, 'Bread', 'Morning Food Yum Yum', 6, 18,2, 'PIECE'); INSERT INTO "inventory" VALUES(5, 'Mango Juice', 'Liquid with mango', 0.5,0.4, 2, 'LITRE'); INSERT INTO "inventory" VALUES(6, 'Yogurt', 'Frozen Milk' , 0.5, 1.5,2, 'KG'); INSERT INTO "inventory" VALUES(7, 'Cucumber', 'Very Long', 0.5, 1,3, 'KG'); INSERT INTO "inventory" VALUES(8, 'Banana', 'Long Yellow' , 0.5, 2,3, 'KG'); INSERT INTO "inventory" VALUES(9, 'Egg', 'Ducky Ducky' , 3, 8,3, 'PIECE'); INSERT INTO "inventory" VALUES(10, 'Egg', 'Ducky Ducky', 3, 2,1, 'PIECE'); INSERT INTO "inventory" VALUES(11, 'Potato', 'Sweet', 0.5, 2,1, 'KG'); INSERT INTO "inventory" VALUES(12, 'Milk', 'Power', 0.5, 4,1, 'LITRE'); INSERT INTO "inventory" VALUES(13, 'Jam', 'Breakfast with it', 0.1, 0.6, 2, 'KG'); INSERT INTO "inventory" VALUES(14, 'Milk', 'Power', 0.5, 3.5,3, 'LITRE'); INSERT INTO "recipe" VALUES(1, 'Potato & Eggs', 'Pakistani Cusine', 1, 15); INSERT INTO "recipe" VALUES(2, 'Banana Milkshake', 'Protien Drink', 1, 5); INSERT INTO "recipe" VALUES(3, 'Tomato Sauce', 'Sauce with alot of tomatoes', 1, 5); INSERT INTO "recipe" VALUES(4, 'Bread Jam', 'Good Food', 2, 3); INSERT INTO "recipe" VALUES(5, 'Omelette', 'Egg Omelette', 3, 10); INSERT INTO "recipe" VALUES(6, 'Banana Milkshake', 'Protien Drink', 3, 5); INSERT INTO "recipe_inventory" VALUES(1, 10, 4); INSERT INTO "recipe_inventory" VALUES(1, 11, .3); INSERT INTO "recipe_inventory" VALUES(2, 1, .2); INSERT INTO "recipe_inventory" VALUES(2, 12, .4); INSERT INTO "recipe_inventory" VALUES(3, 2, .25); INSERT INTO "recipe_inventory" VALUES(4, 4, 2); INSERT INTO "recipe_inventory" VALUES(4, 13, .05); INSERT INTO "recipe_inventory" VALUES(5, 9, .4); INSERT INTO "recipe_inventory" VALUES(6, 8, .2); INSERT INTO "recipe_inventory" VALUES(6, 14, .4); INSERT INTO "list_product" VALUES(1, 3); INSERT INTO "list_product" VALUES(1, 10); INSERT INTO "list_product" VALUES(2, 5); INSERT INTO "members_coordinate" VALUES(1,1, '65.058428', '25.465373'); INSERT INTO "shops_coordinate" VALUES(1, 'Sale', '65.059914', '25.478718', '65.060602', '25.480799'); INSERT INTO "shops_coordinate" VALUES(2, 'Tokmanni', '65.058348', '25.476137', '65.059081', '25.478980'); INSERT INTO "shops_coordinate" VALUES(3, 'University E Gate', '65.057866', '25.468665', '65.058472', '25.470339'); INSERT INTO "monitor_member" VALUES(1, 0); INSERT INTO "monitor_member" VALUES(2, 0); INSERT INTO "monitor_member" VALUES(3, 0);
drop sequence CMRPTRQT_SEQ if exists; create sequence CMRPTRQT_SEQ; drop table compliance_rpt_rqt if exists; create table compliance_rpt_rqt ( com_rptrqt_id bigint not null unique, com_report_type varchar(255), com_database_name varchar(255) not null, emailaddress varchar(255), com_inserted_by varchar(255), report_date timestamp, report_type varchar(255), req_status varchar(255), requestorsso varchar(255), com_updated_by varchar(255), db_usage varchar(255) not null, virtual_sql_instance varchar(255) not null, primary key (com_rptrqt_id) );
DROP TABLE IF EXISTS `products`; DROP TABLE IF EXISTS `carts`; CREATE TABLE `carts` ( `id` bigint(4) NOT NULL AUTO_INCREMENT, `id_product` bigint(4) UNIQUE NOT NULL , `id_user` bigint(4) NOT NULL; PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `products` ( `id` bigint(4) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL DEFAULT 'no_title', `url` varchar(255) DEFAULT NULL, `category` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `sold` boolean DEFAULT false, `price` float(10,2) NOT NULL DEFAULT '0.00', `tva` float(3,2) NOT NULL DEFAULT '0.20', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `products` (`title`, `url`, `category`, `description`, `price`, `tva`) VALUES ('Boucle doreille 1',"http://vertdo.fr/img/boucle7.jpg",'earings',"Boucle d'oreilles",65.20,0.20), ('Boucle doreille 2',"http://vertdo.fr/img/boucle6.jpg",'earings',"Boucle d'oreilles",70.10,0.20), ('Boucle doreille 3',"http://vertdo.fr/img/boucle18.jpg",'earings',"Boucle d'oreilles",80.24,0.20), ('Boucle doreille 4',"http://vertdo.fr/img/boucle3.jpg",'earings',"Boucle d'oreilles",90.30,0.20), ('Collier 1',"http://vertdo.fr/img/collier13.jpg",'necklace','Collier',1999.99,0.20), ('Collier 2',"http://vertdo.fr/img/collier25.jpg",'necklace','Collier',2145.30,0.20), ('Collier 3',"http://vertdo.fr/img/collier5.jpg",'necklace','Collier',8.59,0.20), ('Collier 4',"http://vertdo.fr/img/collier1.jpg",'necklace','Collier',20.30,0.20), ('Bague 1',"http://vertdo.fr/img/bague1.jpg",'ring','Bague',150.00,0.20), ('Bague 2',"http://vertdo.fr/img/bague3_1.jpg",'ring','Bague',150.00,0.20), ('Bague 2',"http://vertdo.fr/img/bague3.jpg",'ring','Bague',150.00,0.20), ('Bague 2',"http://vertdo.fr/img/bague6.jpg",'ring','Bague',150.00,0.20);
-- Drop DATABASE delala; -- CREATE DATABASE delala;
insert into Perfiles(tipo_Perfil) values ('Editor'); insert into Perfiles(tipo_Perfil) values ('Usuario Registrado'); insert into Perfiles(tipo_Perfil) values ('Reportero'); insert into Colores(nombre_Color) values ('#FF6666'); insert into Colores(nombre_Color) values ('#FFB266'); insert into Colores(nombre_Color) values ('#FFFF66'); insert into Estatus (nombre_Estatus) values ('En redacción'); insert into Estatus (nombre_Estatus) values ('Terminada'); insert into Estatus (nombre_Estatus) values ('Publicada'); Insert into Paises (nombre_Pais) values ('México'); Insert into Paises (nombre_Pais) values ('Estados Unidos'); Insert into Paises (nombre_Pais) values ('Canada'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (1, 'Monterrey'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (1, 'CDMX'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (1, 'Guadalajara'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (2, 'Washington'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (2, 'New York'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (2, 'Los Ángeles'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (3, 'Toronto'); Insert into Ciudades (iD_PaisF, nombre_Ciudad) values (3, 'Vancouver'); insert into Colonias (iD_CiudadF, nombre_Colonia) values ( 1, 'Cumbres'); insert into Colonias (iD_CiudadF, nombre_Colonia) values ( 2, 'Avenue 3'); insert into Colonias (iD_CiudadF, nombre_Colonia) values ( 7, 'YorkNew'); insert into Colonias (iD_CiudadF, nombre_Colonia) values ( 8, 'Downtown'); insert into Secciones(nombre_Seccion,color) values ('Entretenimiento',1); insert into Secciones(nombre_Seccion,color) values ('Torneo',2);
/* DNORM QUERY 2 */ SELECT ClientID AS “Client”, COUNT(*) AS “Total bookings”, AVG(AmountPaid) AS “Average booking cost”, MAX(AmountPaid) AS “Maximum paid”, MIN(AmountPaid) AS “Minimum paid” FROM BOOKING_DNORM_BIG WHERE ClientID IS NOT NULL GROUP BY ClientID;
/* DayZ Epoch 1.0.6.2 Updates RUN THIS FILE IF UPDATING AN EXISTING 1061 DATABASE TO 1062. NEW DATABASES SHOULD USE EPOCH.SQL INSTEAD. EXISTING 1051 DATABASES SHOULD RUN 1.0.6_UPDATES.SQL FIRST, THEN RUN THIS FILE. */ /* Update L85 and SVD classnames */ UPDATE `Traders_DATA` SET `item` = '["L85A2_DZ",3]' WHERE `item` = '["L85_Holo_DZ",3]'; UPDATE character_data SET Backpack = REPLACE(Backpack, '"L85_Holo_DZ"', '"L85A2_Holo_DZ"') WHERE INSTR(Backpack, '"L85_Holo_DZ"') > 0; UPDATE character_data SET Inventory = REPLACE(Inventory, '"L85_Holo_DZ"', '"L85A2_Holo_DZ"') WHERE INSTR(Inventory, '"L85_Holo_DZ"') > 0; UPDATE object_data SET Inventory = REPLACE(Inventory, '"L85_Holo_DZ"', '"L85A2_Holo_DZ"') WHERE INSTR(Inventory, '"L85_Holo_DZ"') > 0; UPDATE `Traders_DATA` SET `item` = '["L85A2_ACOG_DZ",3]' WHERE `item` = '["BAF_L85A2_RIS_ACOG",3]'; UPDATE character_data SET Backpack = REPLACE(Backpack, '"BAF_L85A2_RIS_ACOG"', '"L85A2_ACOG_DZ"') WHERE INSTR(Backpack, '"BAF_L85A2_RIS_ACOG"') > 0; UPDATE character_data SET Inventory = REPLACE(Inventory, '"BAF_L85A2_RIS_ACOG"', '"L85A2_ACOG_DZ"') WHERE INSTR(Inventory, '"BAF_L85A2_RIS_ACOG"') > 0; UPDATE object_data SET Inventory = REPLACE(Inventory, '"BAF_L85A2_RIS_ACOG"', '"L85A2_ACOG_DZ"') WHERE INSTR(Inventory, '"BAF_L85A2_RIS_ACOG"') > 0; delete from `Traders_DATA` WHERE `item` = '["BAF_L85A2_RIS_SUSAT",3]'; UPDATE character_data SET Backpack = REPLACE(Backpack, '"BAF_L85A2_RIS_SUSAT"', '"L85A2_ACOG_DZ"') WHERE INSTR(Backpack, '"BAF_L85A2_RIS_SUSAT"') > 0; UPDATE character_data SET Inventory = REPLACE(Inventory, '"BAF_L85A2_RIS_SUSAT"', '"L85A2_ACOG_DZ"') WHERE INSTR(Inventory, '"BAF_L85A2_RIS_SUSAT"') > 0; UPDATE object_data SET Inventory = REPLACE(Inventory, '"BAF_L85A2_RIS_SUSAT"', '"L85A2_ACOG_DZ"') WHERE INSTR(Inventory, '"BAF_L85A2_RIS_SUSAT"') > 0; UPDATE `Traders_DATA` SET `item` = '["SVD_PSO1_DZ",3]' WHERE `item` = '["SVD_DZ",3]'; UPDATE character_data SET Backpack = REPLACE(Backpack, '"SVD_DZ"', '"SVD_PSO1_DZ"') WHERE INSTR(Backpack, '"SVD_DZ"') > 0; UPDATE character_data SET Inventory = REPLACE(Inventory, '"SVD_DZ"', '"SVD_PSO1_DZ"') WHERE INSTR(Inventory, '"SVD_DZ"') > 0; UPDATE object_data SET Inventory = REPLACE(Inventory, '"SVD_DZ"', '"SVD_PSO1_DZ"') WHERE INSTR(Inventory, '"SVD_DZ"') > 0; UPDATE `Traders_DATA` SET `item` = '["SVD_PSO1_Gh_DZ",3]' WHERE `item` = '["SVD_Gh_DZ",3]'; UPDATE character_data SET Backpack = REPLACE(Backpack, '"SVD_Gh_DZ"', '"SVD_PSO1_Gh_DZ"') WHERE INSTR(Backpack, '"SVD_Gh_DZ"') > 0; UPDATE character_data SET Inventory = REPLACE(Inventory, '"SVD_Gh_DZ"', '"SVD_PSO1_Gh_DZ"') WHERE INSTR(Inventory, '"SVD_Gh_DZ"') > 0; UPDATE object_data SET Inventory = REPLACE(Inventory, '"SVD_Gh_DZ"', '"SVD_PSO1_Gh_DZ"') WHERE INSTR(Inventory, '"SVD_Gh_DZ"') > 0; /* PoliceCar was removed from dayz_vehicles */ UPDATE `object_data` SET `Classname` = 'car_sedan' WHERE `Classname` = 'policecar'; DELETE FROM `Traders_DATA` WHERE item = '["policecar"]'; /* THIS PROCEDURE IS REQUIRED FOR 1062 AND RETURNS THE OBJECT ID MUCH MORE EFFICIENTLY THAN THE METHOD IN 1061 SQF */ DROP procedure IF EXISTS `retObjID`; DELIMITER $$ CREATE PROCEDURE `retObjID`( IN objTableName VARCHAR(256), IN SID INT(11), IN UID bigint(24), OUT OID INT(11)unsigned ) BEGIN DECLARE x INT; declare sqlstr VARCHAR(256); SET @OID = 0; SET @x = 1; SET @sqlstr = CONCAT('SELECT `ObjectID` from `', objTableName ,'` where `Instance` = ', SID ,' AND `ObjectUID` = ', UID ,' INTO @OID'); PREPARE stmt FROM @sqlstr; WHILE (@x <= 5) DO EXECUTE stmt; IF (@OID > 0) then SET @x = 6; else SET @x = @x + 1; DO sleep(0.1); END IF; END WHILE; DEALLOCATE PREPARE stmt; SET OID = @OID; SELECT @OID; END;$$ DELIMITER ;
CREATE DATABASE bamazondb; USE bamazondb; CREATE TABLE products ( item_id INT(11) NOT NULL AUTO_INCREMENT, product_name VARCHAR(100) NULL, department_name VARCHAR(100) NULL, price DECIMAL(10,2) NULL, stock_quantity INT NULL, PRIMARY KEY (item_id) ); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('iMac', 'Electronics', 999.99, 30); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('iPhone 7', 'Electronics', 699.99, 1000); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Apple Watch', 'Electronics', 299.00, 200); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Apple TV', 'Electronics', 125.99, 200); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Macbook', 'Electronics', 1299.99, 300); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Macbook Pro', 'Electronics', 1999.99, 600); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Apple Shirt', 'Clothing', 29.00, 40); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('External Hard Drive', 'Electronics', 59.99, 80); INSERT INTO products (product_name, department_name, price, stock_quantity) values ('Steve Jobs', 'Human', 999999.99, 400); SELECT * FROM bamazondb.products;
/* Navicat MySQL Data Transfer Source Server : 沙丘 Source Server Version : 50615 Source Host : 121.40.83.151:3306 Source Database : api Target Server Type : MYSQL Target Server Version : 50615 File Encoding : 65001 Date: 2016-07-21 17:07:40 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for activity -- ---------------------------- DROP TABLE IF EXISTS `activity`; CREATE TABLE `activity` ( `id` int(11) NOT NULL AUTO_INCREMENT, `project_id` int(11) DEFAULT NULL, `user_id` varchar(255) DEFAULT NULL, `api_id` int(11) DEFAULT NULL, `api_name` varchar(255) DEFAULT NULL, `brief` varchar(255) DEFAULT NULL, `action` varchar(255) DEFAULT NULL, `time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=87 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for api -- ---------------------------- DROP TABLE IF EXISTS `api`; CREATE TABLE `api` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_id` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `brief` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, `method` varchar(255) DEFAULT NULL, `output` text, `parameter` text, `remark` text, `update_time` datetime DEFAULT NULL, `create_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for api_group -- ---------------------------- DROP TABLE IF EXISTS `api_group`; CREATE TABLE `api_group` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT NULL, `name` varchar(64) DEFAULT NULL, `title` varchar(128) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for project -- ---------------------------- DROP TABLE IF EXISTS `project`; CREATE TABLE `project` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `type` varchar(255) DEFAULT NULL, `logo` varchar(255) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `name` varchar(255) NOT NULL, `email` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `gravater` varchar(255) DEFAULT NULL, PRIMARY KEY (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE DATABASE clinica; USE clinica; ------------------------------------------------------------------------------- CREATE TABLE CLINICA ( IdCLINICA INT PRIMARY KEY IDENTITY, CNPJ INT NOT NULL, ENDEREÇO VARCHAR(200) ); ------------------------------------------------------------------------------- CREATE TABLE DONO ( IdDONO INT PRIMARY KEY IDENTITY, NOME VARCHAR(200), CPF INT NOT NULL ); ------------------------------------------------------------------------------- CREATE TABLE TIPO ( IdTIPO INT PRIMARY KEY IDENTITY, NOME VARCHAR(200) NOT NULL, ); ------------------------------------------------------------------------------- CREATE TABLE RAÇA ( IdRAÇA INT PRIMARY KEY IDENTITY, IdTIPO INT FOREIGN KEY REFERENCES TIPO(IdTIPO), NOME VARCHAR(200) NOT NULL, ); ------------------------------------------------------------------------------- CREATE TABLE PET ( IdPET INT PRIMARY KEY IDENTITY, IdDONO INT FOREIGN KEY REFERENCES DONO(IdDONO), IdRAÇA INT FOREIGN KEY REFERENCES RAÇA(IdRAÇA), NOME VARCHAR(200) NOT NULL, NASCIMENTO INT NOT NULL ); ------------------------------------------------------------------------------- CREATE TABLE VETERINARIO ( IdVETERINARIO INT PRIMARY KEY IDENTITY, IdCLINICA INT FOREIGN KEY REFERENCES CLINICA(IdCLINICA), NOME VARCHAR(200) NOT NULL, CRMV VARCHAR(200) NOT NULL, ); ------------------------------------------------------------------------------- CREATE TABLE ATENDIMENTO ( IdATENDIMENTO INT PRIMARY KEY IDENTITY, IdVETERINARIO INT FOREIGN KEY REFERENCES VETERINARIO(IdVETERINARIO), IdPET INT FOREIGN KEY REFERENCES PET(IdPET), NOME VARCHAR(200) NOT NULL, DATA_DE_ATENDIMENTO INT NOT NULL );
drop procedure if exists deletar; DELIMITER // CREATE PROCEDURE deletar() BEGIN WHILE (SELECT count(idData) FROM findesk.data where idData > 1) DO DELETE FROM data WHERE (idData > 1); END WHILE; END; call deletar();
SELECT -- DISTINCT reviewer_name, product_label, review_text, (CASE WHEN country_reviewer = country_producer THEN homepage_producer ELSE homepage_vendor END) AS homepage FROM (SELECT "product"."nr" AS product_id, "product"."label" AS product_label, "review"."text" AS review_text, "producer"."homepage" AS homepage_producer, "person"."name" AS reviewer_name, "person"."country" AS country_reviewer, "producer"."country" AS country_producer FROM "review", "person", "product", "producer" WHERE "review"."product" = "product"."nr" AND "person"."nr" = "review"."person" AND "producer"."nr" = "product"."producer" AND "product"."nr" < 1000) v1 LEFT JOIN (SELECT "offer"."product" AS product_id, "vendor"."homepage" AS homepage_vendor, "vendor"."country" AS country_vendor FROM "offer", "vendor" WHERE "offer"."vendor" = "vendor"."nr" AND "offer"."product" < 1000) v2 ON v1.product_id = v2.product_id AND country_reviewer = country_vendor;
CREATE SCHEMA example; CREATE TABLE example.table ( id SERIAL PRIMARY KEY, example VARCHAR(255) );
SELECT AVG(r.rating) FROM ratings r INNER JOIN movies m ON m.id = r.movie_id WHERE m.year = 2012;
/* Chapter 4: The WHERE Clause */ /* WHERE price equals value */ /* First, let's create and populate the items table */ CREATE TABLE items ( id INTEGER NOT NULL PRIMARY KEY , name VARCHAR(21) NOT NULL , type VARCHAR(7) NOT NULL , price DECIMAL(5,2) NULL ); INSERT INTO items VALUES (5021,'thingie' ,'widgets', 9.37 ); INSERT INTO items VALUES (5022,'gadget' ,'doodads', 19.37 ); INSERT INTO items VALUES (5023,'dingus' ,'gizmos' , 29.37 ); INSERT INTO items VALUES (5041,'gewgaw' ,'widgets', 5.00 ); INSERT INTO items VALUES (5042,'knickknack' ,'doodads', 10.00 ); INSERT INTO items VALUES (5043,'whatnot' ,'gizmos' , 15.00 ); INSERT INTO items VALUES (5061,'bric-a-brac' ,'widgets', 2.00 ); INSERT INTO items VALUES (5062,'folderol' ,'doodads', 4.00 ); INSERT INTO items VALUES (5063,'jigger' ,'gizmos' , 6.00 ); INSERT INTO items VALUES (5901,'doohickey' ,'widgets', 12.00 ); INSERT INTO items VALUES (5902,'gimmick' ,'doodads', 9.37 ); INSERT INTO items VALUES (5903,'dingbat' ,'gizmos' , 9.37 ); INSERT INTO items VALUES (5911,'thingamajig' ,'widgets', NULL ); INSERT INTO items VALUES (5912,'thingamabob' ,'doodads', NULL ); INSERT INTO items VALUES (5913,'thingum' ,'gizmos' , NULL ); INSERT INTO items VALUES (5931,'contraption' ,'widgets', 49.95 ); INSERT INTO items VALUES (5932,'whatchamacallit','doodads', 59.95 ); INSERT INTO items VALUES (5937,'whatsis' ,'gizmos' , NULL ); SELECT name , type , price FROM items ; /* Results should look like this -- name type price thingie widgets 9.37 gadget doodads 19.37 dingus gizmos 29.37 gewgaw widgets 5.00 knickknack doodads 10.00 whatnot gizmos 15.00 bric-a-brac widgets 2.00 folderol doodads 4.00 jigger gizmos 6.00 doohickey widgets 12.00 gimmick doodads 9.37 dingbat gizmos 9.37 thingamajig widgets thingamabob doodads thingum gizmos contraption widgets 49.95 whatchamacallit doodads 59.95 whatsis gizmos */ SELECT name , type FROM items WHERE price = 9.37 ; /* Results should look like this -- name type thingie widgets gimmick doodads dingbat gizmos */ SELECT name , price FROM items WHERE price < 10.00 ; /* Results should look like this -- name price thingie 9.37 gewgaw 5.00 bric-a-brac 2.00 folderol 4.00 jigger 6.00 gimmick 9.37 dingbat 9.37 */ SELECT name , type FROM items WHERE name < 'C' ; /* Results should look like this -- name type bric-a-brac widgets */
CREATE PROC [ERP].[Usp_Sel_SaldoInicialCobrar_Inactivo] @IdEmpresa INT AS BEGIN SELECT SI.ID, SI.IdCliente IdCliente, SI.Fecha Fecha, SI.FechaVencimiento FechaVencimiento, SI.Serie Serie, SI.Documento Documento, SI.Monto Monto, SI.TipoCambio TipoCambio, TC.Nombre NombreTipoComprobante, SI.IdTipoComprobante IdTipoComprobante, TD.Abreviatura TipoDocumento, MO.ID IdMoneda, MO.Nombre NombreMoneda, ETD.NumeroDocumento NumeroDocumento, E.Nombre NombreCliente, SI.FechaRegistro FechaRegistro FROM ERP.SaldoInicialCobrar SI LEFT JOIN ERP.Cliente PRO ON PRO.ID = SI.IdCliente LEFT JOIN ERP.Entidad E ON E.ID = PRO.IdEntidad LEFT JOIN ERP.EntidadTipoDocumento ETD ON ETD.IdEntidad = PRO.IdEntidad LEFT JOIN PLE.T2TipoDocumento TD ON TD.ID = ETD.IdTipoDocumento LEFT JOIN Maestro.Moneda MO ON MO.ID = SI.IdMoneda LEFT JOIN PLE.T10TipoComprobante TC ON TC.ID = SI.IdTipoComprobante WHERE SI.IdEmpresa = @IdEmpresa AND SI.Flag = 0 END
/* * Copyright 2013-2016 Uncharted Software Inc. * * Property of Uncharted(TM), formerly Oculus Info Inc. * https://uncharted.software/ * * 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. */ -- -- FINANCIAL FLOW -- create table FinFlow (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), FirstTransaction datetime, LastTransaction datetime, Amount float, CONSTRAINT pk_FF_ID PRIMARY KEY (FromEntityId, ToEntityId)); -- -- FINANCIAL FLOW SUMMARY -- create table FinFlowDaily (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), Amount float, PeriodDate datetime, CONSTRAINT pk_FFD_ID PRIMARY KEY (FromEntityId, ToEntityId, PeriodDate)); create table FinFlowWeekly (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), Amount float, PeriodDate datetime, CONSTRAINT pk_FFW_ID PRIMARY KEY (FromEntityId, ToEntityId, PeriodDate)); create table FinFlowMonthly (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), Amount float, PeriodDate datetime, CONSTRAINT pk_FFM_ID PRIMARY KEY (FromEntityId, ToEntityId, PeriodDate)); create table FinFlowQuarterly (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), Amount float, PeriodDate datetime, CONSTRAINT pk_FFQ_ID PRIMARY KEY (FromEntityId, ToEntityId, PeriodDate)); create table FinFlowYearly (FromEntityId varchar(100), FromEntityType varchar(1), ToEntityId varchar(100), ToEntityType varchar(1), Amount float, PeriodDate datetime, CONSTRAINT pk_FFY_ID PRIMARY KEY (FromEntityId, ToEntityId, PeriodDate)); -- -- FINANCIAL ENTITY SUMMARY -- create table FinEntityDaily (EntityId varchar(100), PeriodDate datetime, InboundAmount float, IncomingLinks int, OutboundAmount float, OutgoingLinks int, Balance float, CONSTRAINT pk_FED_ID PRIMARY KEY (EntityId, PeriodDate)); create table FinEntityWeekly (EntityId varchar(100), PeriodDate datetime, InboundAmount float, IncomingLinks int, OutboundAmount float, OutgoingLinks int, Balance float, CONSTRAINT pk_FEW_ID PRIMARY KEY (EntityId, PeriodDate)); create table FinEntityMonthly (EntityId varchar(100), PeriodDate datetime, InboundAmount float, IncomingLinks int, OutboundAmount float, OutgoingLinks int, Balance float, CONSTRAINT pk_FEM_ID PRIMARY KEY (EntityId, PeriodDate)); create table FinEntityQuarterly (EntityId varchar(100), PeriodDate datetime, InboundAmount float, IncomingLinks int, OutboundAmount float, OutgoingLinks int, Balance float, CONSTRAINT pk_FEQ_ID PRIMARY KEY (EntityId, PeriodDate)); create table FinEntityYearly (EntityId varchar(100), PeriodDate datetime, InboundAmount float, IncomingLinks int, OutboundAmount float, OutgoingLinks int, Balance float, CONSTRAINT pk_FEY_ID PRIMARY KEY (EntityId, PeriodDate)); -- -- CLUSTER SUMMARY -- --create table ClusterSummary (EntityId varchar(100), Property varchar(50), Tag varchar(50), Type varchar(50), Value varchar(200), Stat float, CONSTRAINT pk_CS_ID PRIMARY KEY (EntityId, Property, Value)); -- -- CLUSTER SUMMARY MEMBERS -- --create table ClusterSummaryMembers (SummaryId varchar(100), EntityId varchar(100), CONSTRAINT pk_CSM_ID PRIMARY KEY (SummaryId, EntityId)); -- -- KIVA FLOW GENERATION -- insert into FinFlowDaily (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select TransactionSource, 'A', TransactionTarget, 'A', sum(TransactionAmount), convert(varchar(50), TransactionDate, 101) from Transactions group by TransactionSource, TransactionTarget, convert(varchar(50), TransactionDate, 101) insert into FinFlowDaily (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select substring(TransactionSource, 1, charindex('-',TransactionSource)-1), 'O', TransactionTarget, 'A', sum(TransactionAmount), convert(varchar(50), TransactionDate, 101) from Transactions where substring(TransactionSource,1,8) = 'partner.' group by substring(TransactionSource,1,charindex('-',TransactionSource)-1), TransactionTarget, convert(varchar(50), TransactionDate, 101) insert into FinFlowDaily (FromEntityId, FromEntityType, ToEntityId, ToEntityType, Amount, PeriodDate) select TransactionSource, 'A', substring(TransactionTarget,1,charindex('-',TransactionTarget)-1), 'O', sum(TransactionAmount), convert(varchar(50), TransactionDate, 101) from Transactions where substring(TransactionTarget,1,8) = 'partner.' group by TransactionSource, substring(TransactionTarget,1,charindex('-',TransactionTarget)-1), convert(varchar(50), TransactionDate, 101) -- create FinFlowDaily indices create index ix_ffd_from on FinFlowDaily (FromEntityId, PeriodDate, ToEntityId, Amount); create index ix_ffd_to on FinFlowDaily (ToEntityId, PeriodDate, FromEntityId, Amount); -- -- KIVA ENTITY GENERATION (LOANS) -- -- create Fin Entity Loan table create table FinEntityLoan( EntityId varchar(100) PRIMARY KEY, IncomingLinks int, UniqueIncomingLinks int, OutgoingLinks int, UniqueOutgoingLinks int, NumTransactions int, MaxTransaction float, AvgTransaction float, StartDate datetime, EndDate datetime, [type] varchar(20), LoanId bigint, LoanName varchar(512), LoanUse varchar(max), LoanActivity varchar(512), LoanSector varchar(512), LoanStatus varchar(512), LoanAmount bigint, LoanFundedAmount bigint, LoanBasketAmount bigint, LoanPaidAmount float, LoanCurrencyExchangeLossAmount float, LoanPostedDate datetime, LoanPaidDate datetime, LoanDelinquent bit, LoanFundedDate datetime, LoanPlannedExpirationDate datetime, LoanDescriptionTexts_en varchar(max), LoanDescriptionTexts_ru varchar(max), LoanDescriptionTexts_fr varchar(max), LoanDescriptionTexts_es varchar(max), LoanDescriptionTexts_vi varchar(max), LoanDescriptionTexts_id varchar(max), LoanDescriptionTexts_pt varchar(max), LoanDescriptionTexts_mn varchar(max), LoanDescriptionTexts_ar varchar(max), LoanImageId bigint, LoanImageURL varchar(2048), LoanVideoId bigint, LoanVideoYoutubeId varchar(512), LoanLocationGeoLevel varchar(512), LoanLocationGeoPairs varchar(512), LoanLocationGeoType varchar(512), LoanLocationTown varchar(512), LoanLocationCountryCode varchar(20), LoanLocationCountry varchar(512), LoanTermsLoanAmount bigint, LoanTermsDisbursalDate datetime, LoanTermsDisbursalCurrency varchar(30), LoanTermsDisbursalAmount float, LoanTermsLossLiabilityCurrencyExchange varchar(512), LoanTermsLossLiabilityCurrencyExchangeCoverageRate float, LoanTermsLossLiabilityNonpayment varchar(512), LoanJournalTotalsEntries bigint, LoanJournalTotalsBulkEntries bigint, LoanLat float, LoanLon float ); -- populate table with common attributes insert into FinEntityLoan ( EntityId, IncomingLinks, UniqueIncomingLinks, OutgoingLinks, UniqueOutgoingLinks, NumTransactions, MaxTransaction, AvgTransaction, StartDate, EndDate ) select EntityId, sum(IncomingLinks) as IncomingLinks, sum(UniqueIncomingLinks) as UniqueIncomingLinks, sum(OutgoingLinks) as OutgoingLinks, sum(UniqueOutgoingLinks) as UniqueOutgoingLinks, sum(NumTransactions) as NumTransactions, max(MaxTransaction) as MaxTransaction, sum(TotalTransactions) / sum(NumTransactions) as AvgTransaction, min(StartDate) as StartDate, max(EndDate) as EndDate from ( select TransactionTarget as EntityId, count(TransactionSource) as IncomingLinks, count( distinct TransactionSource ) as UniqueIncomingLinks, 0 as OutgoingLinks, 0 as UniqueOutgoingLinks, count(TransactionTarget) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionTarget union select TransactionSource as EntityId, 0 as IncomingLinks, 0 as UniqueIncomingLinks, count(TransactionTarget) as OutgoingLinks, count( distinct TransactionTarget ) as UniqueOutgoingLinks, sum( case when TransactionSource <> TransactionTarget then 1 else 0 end ) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionSource )q where EntityId like 'loan.%' group by EntityId -- update table with loan specific attributes update FinEntityLoan set [type] = 'loan', LoanId = FEP.LoanId, LoanName = FEP.LoanName, LoanUse = FEP.LoanUse, LoanActivity = FEP.LoanActivity, LoanSector = FEP.LoanSector, LoanStatus = FEP.LoanStatus, LoanAmount = FEP.LoanAmount, LoanFundedAmount = FEP.LoanFundedAmount, LoanBasketAmount = FEP.LoanBasketAmount, LoanPaidAmount = FEP.LoanPaidAmount, LoanCurrencyExchangeLossAmount = FEP.LoanCurrencyExchangeLossAmount, LoanPostedDate = FEP.LoanPostedDate, LoanPaidDate = FEP.LoanPaidDate, LoanDelinquent = FEP.LoanDelinquent, LoanFundedDate = FEP.LoanFundedDate, LoanPlannedExpirationDate = FEP.LoanPlannedExpirationDate, LoanDescriptionTexts_en = FEP.LoanDescriptionTexts_en, LoanDescriptionTexts_ru = FEP.LoanDescriptionTexts_ru, LoanDescriptionTexts_fr = FEP.LoanDescriptionTexts_fr, LoanDescriptionTexts_es = FEP.LoanDescriptionTexts_es, LoanDescriptionTexts_vi = FEP.LoanDescriptionTexts_vi, LoanDescriptionTexts_id = FEP.LoanDescriptionTexts_id, LoanDescriptionTexts_pt = FEP.LoanDescriptionTexts_pt, LoanDescriptionTexts_mn = FEP.LoanDescriptionTexts_mn, LoanDescriptionTexts_ar = FEP.LoanDescriptionTexts_ar, LoanImageId = FEP.LoanImageId, LoanImageURL = FEP.LoanImageURL, LoanVideoId = FEP.LoanVideoId, LoanVideoYoutubeId = FEP.LoanVideoYoutubeId, LoanLocationGeoLevel = FEP.LoanLocationGeoLevel, LoanLocationGeoPairs = FEP.LoanLocationGeoPairs, LoanLocationGeoType = FEP.LoanLocationGeoType, LoanLocationTown = FEP.LoanLocationTown, LoanLocationCountryCode = FEP.LoanLocationCountryCode, LoanLocationCountry = FEP.LoanLocationCountry, LoanTermsLoanAmount = FEP.LoanTermsLoanAmount, LoanTermsDisbursalDate = FEP.LoanTermsDisbursalDate, LoanTermsDisbursalCurrency = FEP.LoanTermsDisbursalCurrency, LoanTermsDisbursalAmount = FEP.LoanTermsDisbursalAmount, LoanTermsLossLiabilityCurrencyExchange = FEP.LoanTermsLossLiabilityCurrencyExchange, LoanTermsLossLiabilityCurrencyExchangeCoverageRate = FEP.LoanTermsLossLiabilityCurrencyExchangeCoverageRate, LoanTermsLossLiabilityNonpayment = FEP.LoanTermsLossLiabilityNonpayment, LoanJournalTotalsEntries = FEP.LoanJournalTotalsEntries, LoanJournalTotalsBulkEntries = FEP.LoanJournalTotalsBulkEntries, LoanLat = FEP.LoanLat, LoanLon = FEP.LoanLon from FinEntityLoan FE inner join LoanProperties FEP on FE.EntityId = FEP.EntityId -- create index on Fin Entity Loan table create index ix_fe_lo_id on FinEntityLoan (EntityId); -- -- KIVA ENTITY GENERATION (LENDERS) -- -- create Fin Entity Lender table create table FinEntityLender( EntityId varchar(100) PRIMARY KEY, IncomingLinks int, UniqueIncomingLinks int, OutgoingLinks int, UniqueOutgoingLinks int, NumTransactions int, MaxTransaction float, AvgTransaction float, StartDate datetime, EndDate datetime, [type] varchar(20), LenderId varchar(512), LenderName varchar(512), LenderImageId bigint, LenderImageURL varchar(2048), LenderMemberSince datetime, LenderWhereabouts varchar(512), LenderCountryCode varchar(20), LenderOccupation varchar(512), LenderOccupationalInfo varchar(2048), LenderInviterId varchar(512), LenderInviteeCount bigint, LenderLoanCount bigint, LenderLoanBecause varchar(2048), LenderLat float, LenderLon float ); -- populate table with common attributes insert into FinEntityLender ( EntityId, IncomingLinks, UniqueIncomingLinks, OutgoingLinks, UniqueOutgoingLinks, NumTransactions, MaxTransaction, AvgTransaction, StartDate, EndDate ) select EntityId, sum(IncomingLinks) as IncomingLinks, sum(UniqueIncomingLinks) as UniqueIncomingLinks, sum(OutgoingLinks) as OutgoingLinks, sum(UniqueOutgoingLinks) as UniqueOutgoingLinks, sum(NumTransactions) as NumTransactions, max(MaxTransaction) as MaxTransaction, sum(TotalTransactions) / sum(NumTransactions) as AvgTransaction, min(StartDate) as StartDate, max(EndDate) as EndDate from ( select TransactionTarget as EntityId, count(TransactionSource) as IncomingLinks, count( distinct TransactionSource ) as UniqueIncomingLinks, 0 as OutgoingLinks, 0 as UniqueOutgoingLinks, count(TransactionTarget) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionTarget union select TransactionSource as EntityId, 0 as IncomingLinks, 0 as UniqueIncomingLinks, count(TransactionTarget) as OutgoingLinks, count( distinct TransactionTarget ) as UniqueOutgoingLinks, sum( case when TransactionSource <> TransactionTarget then 1 else 0 end ) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionSource )q where EntityId like 'lender.%' group by EntityId -- update table with lender specific attributes update FinEntityLender set [type] = 'lender', LenderId = FEP.LenderId, LenderName = FEP.LenderName, LenderImageId = FEP.LenderImageId, LenderImageURL = 'http://www.kiva.org/img/default_lender.png', LenderMemberSince = FEP.LenderMemberSince, LenderWhereabouts = FEP.LenderWhereabouts, LenderCountryCode = FEP.LenderCountryCode, LenderOccupation = FEP.LenderOccupation, LenderOccupationalInfo = FEP.LenderOccupationalInfo, LenderInviterId = FEP.LenderInviterId, LenderInviteeCount = FEP.LenderInviteeCount, LenderLoanCount = FEP.LenderLoanCount, LenderLoanBecause = FEP.LenderLoanBecause, LenderLat = FEP.LenderLat, LenderLon = FEP.LenderLon from FinEntityLender FE inner join LenderProperties FEP on FE.EntityId = FEP.EntityId -- create index on Fin Entity Lender table create index ix_fe_le_id on FinEntityLender (EntityId); -- -- KIVA ENTITY GENERATION (PARTNERS + BROKERS) -- -- create Fin Entity Partner table create table FinEntityPartner( EntityId varchar(100) PRIMARY KEY, IncomingLinks int, UniqueIncomingLinks int, OutgoingLinks int, UniqueOutgoingLinks int, NumTransactions int, MaxTransaction float, AvgTransaction float, StartDate datetime, EndDate datetime, [type] varchar(20), PartnerId bigint, OwnerId varchar(512), PartnerName varchar(512), PartnerStatus varchar(512), PartnerRating varchar(512), PartnerDueDiligenceType varchar(512), PartnerImageId bigint, PartnerImageURL varchar(2048), PartnerStartDate datetime, PartnerDelinquencyRate float, PartnerDefaultRate float, PartnerTotalAmountRaised float, PartnerLoansPosted bigint, PartnerCountryCode varchar(max), PartnerLat varchar(max), PartnerLon varchar(max), ); -- populate table with common attributes for brokers insert into FinEntityPartner ( EntityId, IncomingLinks, UniqueIncomingLinks, OutgoingLinks, UniqueOutgoingLinks, NumTransactions, MaxTransaction, AvgTransaction, StartDate, EndDate ) select EntityId, sum(IncomingLinks) as IncomingLinks, sum(UniqueIncomingLinks) as UniqueIncomingLinks, sum(OutgoingLinks) as OutgoingLinks , sum(UniqueOutgoingLinks) as UniqueOutgoingLinks, sum(NumTransactions) as NumTransactions, max(MaxTransaction) as MaxTransaction, sum(TotalTransactions) / sum(NumTransactions) as AvgTransaction, min(StartDate) as StartDate, max(EndDate) as EndDate from ( select TransactionTarget as EntityId, count(TransactionSource) as IncomingLinks, count( distinct TransactionSource ) as UniqueIncomingLinks, 0 as OutgoingLinks, 0 as UniqueOutgoingLinks, count(TransactionTarget) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionTarget union select TransactionSource as EntityId, 0 as IncomingLinks, 0 as UniqueIncomingLinks, count(TransactionTarget) as OutgoingLinks, count( distinct TransactionTarget ) as UniqueOutgoingLinks, sum( case when TransactionSource <> TransactionTarget then 1 else 0 end ) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions group by TransactionSource )q where EntityId like 'partner.%' group by EntityId -- populate table with common attributes for partners insert into FinEntityPartner ( EntityId, IncomingLinks, UniqueIncomingLinks, OutgoingLinks, UniqueOutgoingLinks, NumTransactions, MaxTransaction, AvgTransaction, StartDate, EndDate ) select EntityId, sum(IncomingLinks) as IncomingLinks, sum(UniqueIncomingLinks) as UniqueIncomingLinks, sum(OutgoingLinks) as OutgoingLinks , sum(UniqueOutgoingLinks) as UniqueOutgoingLinks, sum(NumTransactions) as NumTransactions, max(MaxTransaction) as MaxTransaction, sum(TotalTransactions) / sum(NumTransactions) as AvgTransaction, min(StartDate) as StartDate, max(EndDate) as EndDate from ( select left(TransactionTarget, (charindex('-', TransactionTarget) - 1)) as EntityId, count(TransactionSource) as IncomingLinks, count( distinct TransactionSource ) as UniqueIncomingLinks, 0 as OutgoingLinks, 0 as UniqueOutgoingLinks, count(TransactionTarget) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions where TransactionTarget like 'partner.%' group by left(TransactionTarget, (charindex('-', TransactionTarget) - 1)) union select left(TransactionSource, (charindex('-', TransactionSource) - 1)) as EntityId, 0 as IncomingLinks, 0 as UniqueIncomingLinks, count(TransactionTarget) as OutgoingLinks, count( distinct TransactionTarget ) as UniqueOutgoingLinks, sum( case when TransactionSource <> TransactionTarget then 1 else 0 end ) as NumTransactions, max(TransactionAmount) as MaxTransaction, sum(TransactionAmount) as TotalTransactions, min(TransactionDate) as StartDate, max(TransactionDate) as EndDate from Transactions where TransactionSource like 'partner.%' group by left(TransactionSource, (charindex('-', TransactionSource) - 1)) )q where EntityId like 'partner.%' group by EntityId order by EntityId -- update table with partner specific attributes update FinEntityPartner set [type] = 'partner', PartnerId = FEP.PartnerId, PartnerName = FEP.PartnerName, PartnerStatus = FEP.PartnerStatus, PartnerRating = FEP.PartnerRating, PartnerDueDiligenceType = FEP.PartnerDueDiligenceType, PartnerImageId = FEP.PartnerImageId, PartnerImageURL = FEP.PartnerImageURL, PartnerStartDate = FEP.PartnerStartDate, PartnerDelinquencyRate = FEP.PartnerDelinquencyRate, PartnerDefaultRate = FEP.PartnerDefaultRate, PartnerTotalAmountRaised = FEP.PartnerTotalAmountRaised, PartnerLoansPosted = FEP.PartnerLoansPosted, PartnerCountryCode = FEP.PartnerCountryCode, PartnerLat = FEP.PartnerLat, PartnerLon = FEP.PartnerLon from FinEntityPartner FE inner join PartnerProperties FEP on case when charindex('-', FE.EntityId) > 0 then left(FE.EntityId, (charindex('-', FE.EntityId) - 1)) else FE.EntityId end = FEP.EntityId -- add ownerId information update FinEntityPartner set OwnerId = left(EntityId, (charindex('-', EntityId) - 1)) where charindex('-', EntityId) > 0 -- create index on Fin Entity Partner table create index ix_fe_pa_id on FinEntityPartner (EntityId); -- -- FIN FLOW AGGREGATIONS -- insert into FinFlowWeekly select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101) from FinFlowDaily group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101); insert into FinFlowMonthly select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101) from FinFlowDaily group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101); insert into FinFlowQuarterly select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101) from FinFlowMonthly group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101); insert into FinFlowYearly select FromEntityId, FromEntityType, ToEntityId, ToEntityType, sum(Amount), CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101) from FinFlowMonthly group by FromEntityId, FromEntityType, ToEntityId, ToEntityType, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101); -- create FinFlow indices create index ix_ffw_from on FinFlowWeekly (FromEntityId, PeriodDate, ToEntityId, Amount); create index ix_ffw_to on FinFlowWeekly (ToEntityId, PeriodDate, FromEntityId, Amount); create index ix_ffm_from on FinFlowMonthly (FromEntityId, PeriodDate, ToEntityId, Amount); create index ix_ffm_to on FinFlowMonthly (ToEntityId, PeriodDate, FromEntityId, Amount); create index ix_ffq_from on FinFlowQuarterly (FromEntityId, PeriodDate, ToEntityId, Amount); create index ix_ffq_to on FinFlowQuarterly (ToEntityId, PeriodDate, FromEntityId, Amount); create index ix_ffy_from on FinFlowYearly (FromEntityId, PeriodDate, ToEntityId, Amount); create index ix_ffy_to on FinFlowYearly (ToEntityId, PeriodDate, FromEntityId, Amount); -- build FinFlow insert into FinFlow select FromEntityId, FromEntityType, ToEntityId, ToEntityType, min(PeriodDate), max(PeriodDate), sum(Amount) from FinFlowDaily group by FromEntityId, FromEntityType, ToEntityId, ToEntityType; create index ix_ff_to_from on FinFlow (ToEntityId, FromEntityId); create index ix_ff_from_to on FinFlow (FromEntityId, ToEntityId); -- -- FIN ENTITY AGGREGATIONS -- create table temp_ids (Entity varchar(100)); create index tids on temp_ids (Entity); insert into temp_ids select distinct FromEntityId from FinFlowYearly union select distinct ToEntityId from FinFlowYearly; insert into FinEntityDaily select Entity, PeriodDate, sum(case when ToEntityId = Entity and FromEntityType = 'A' then Amount else 0 end), sum(case when ToEntityId = Entity and FromEntityType = 'A' then 1 else 0 end), -- calculate inbound degree sum(case when FromEntityId = Entity and ToEntityType = 'A' then Amount else 0 end), sum(case when FromEntityId = Entity and ToEntityType = 'A' then 1 else 0 end), -- calculate outbound degree 0 -- TODO calculate balance from temp_ids join FinFlowDaily on FromEntityId = Entity or ToEntityId = Entity group by Entity, PeriodDate; -- cleanup drop table temp_ids; insert into FinEntityWeekly select EntityId, CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101), sum(InboundAmount), sum(IncomingLinks), sum(OutboundAmount), sum(OutgoingLinks), 0 from FinEntityDaily group by EntityId, CONVERT(varchar(50), (DATEADD(dd, @@DATEFIRST - DATEPART(dw, PeriodDate) - 6, PeriodDate)), 101); insert into FinEntityMonthly select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101), sum(InboundAmount), sum(IncomingLinks), sum(OutboundAmount), sum(OutgoingLinks), 0 from FinEntityDaily group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + convert(varchar(2), DATEPART(mm, PeriodDate)) + '/01', 101); insert into FinEntityQuarterly select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101), sum(InboundAmount), sum(IncomingLinks), sum(OutboundAmount), sum(OutgoingLinks), 0 from FinEntityMonthly group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/' + case when DATEPART(q, PeriodDate)=1 then '01' when DATEPART(q, PeriodDate)=2 then '04' when DATEPART(q, PeriodDate)=3 then '07' when DATEPART(q, PeriodDate)=4 then '010' end + '/01', 101); insert into FinEntityYearly select EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101), sum(InboundAmount), sum(IncomingLinks), sum(OutboundAmount), sum(OutgoingLinks), 0 from FinEntityQuarterly group by EntityId, CONVERT(varchar(50), convert(varchar(4), DATEPART(yyyy, PeriodDate)) + '/01/01', 101); create index ix_fed on FinEntityDaily (EntityId, PeriodDate, InboundAmount, OutboundAmount); create index ix_few on FinEntityWeekly (EntityId, PeriodDate, InboundAmount, OutboundAmount); create index ix_fem on FinEntityMonthly (EntityId, PeriodDate, InboundAmount, OutboundAmount); create index ix_feq on FinEntityQuarterly (EntityId, PeriodDate, InboundAmount, OutboundAmount); create index ix_fey on FinEntityYearly (EntityId, PeriodDate, InboundAmount, OutboundAmount); --create index ix_csum on ClusterSummary (EntityId); --create index ix_cmem on ClusterSummaryMembers (SummaryId);
SELECT p.title, p.post_id, p.img, p.content, p.user_id FROM posts p INNER JOIN users u ON u.user_id = p.user_id;
CREATE USER [gzProdDbUser] WITH PASSWORD = N'ozwfLcuyGv0t#v&G0ivkktqkmsFT7_&#$!~<ee>htWQwdw=a';