text stringlengths 6 9.38M |
|---|
select *
from tblProducts |
INSERT INTO burgers (burger_name) VALUES ("Impossible Burger");
INSERT INTO burgers (burger_name) VALUES ("Tepa Patty");
INSERT INTO burgers (burger_name) VALUES ("Gardin Burger");
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 08, 2017 at 12:12 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
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: `planafterauth`
--
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`) VALUES
(23, '2014_10_12_000000_create_users_table'),
(24, '2014_10_12_100000_create_password_resets_table'),
(25, '2016_01_15_105324_create_roles_table'),
(26, '2016_01_15_114412_create_role_user_table'),
(27, '2016_01_26_115212_create_permissions_table'),
(28, '2016_01_26_115523_create_permission_role_table'),
(29, '2016_02_09_132439_create_permission_user_table'),
(30, '2017_03_09_082449_create_social_logins_table'),
(31, '2017_03_09_082526_create_activations_table'),
(32, '2017_03_20_213554_create_themes_table'),
(33, '2017_03_21_042918_create_profiles_table');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`middle_name` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gender` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`zipcode` int(15) DEFAULT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `first_name`, `middle_name`, `last_name`, `email`, `password`, `gender`, `date_of_birth`, `zipcode`, `token`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Aman', 'Kumar', 'Singh', 'jhon123@mailinator.com', '$2y$10$4YoO/AS2ZUoTvr2OPPM2nuqOwaeQ5q.RuVQ.6MANaKhUG2ayFfW5W', 'male', '2017-09-07', NULL, NULL, '2017-09-07 06:00:48', '2017-09-07 06:02:23', NULL),
(2, 'fdsfff', NULL, 'fsssss', NULL, NULL, 'female', '2017-09-07', NULL, NULL, '2017-09-07 06:03:23', '2017-09-07 06:03:23', NULL),
(3, 'fdfgfg', 'gfgfgf', 'gfgfg', NULL, NULL, 'male', '2017-09-07', NULL, NULL, '2017-09-07 06:13:30', '2017-09-07 06:13:30', NULL),
(4, 'india', 'india', 'india', NULL, NULL, 'male', '2017-09-08', NULL, NULL, '2017-09-07 07:31:56', '2017-09-07 07:31:56', NULL),
(5, 'gfggf', 'gfgfg', 'gfgf', NULL, NULL, 'male', '2017-09-20', NULL, NULL, '2017-09-07 07:42:42', '2017-09-07 07:44:14', NULL),
(6, 'gfggf', 'tertrt', 'trtr', NULL, NULL, 'female', '2017-09-07', NULL, NULL, '2017-09-07 07:52:55', '2017-09-07 07:52:55', NULL),
(7, 'lklklkl', 'lklkl', 'jhkjk', NULL, NULL, 'female', '2017-09-07', NULL, NULL, '2017-09-07 07:56:15', '2017-09-07 07:58:11', NULL),
(8, 'wewwrer', 'rererer', 'rerer', NULL, NULL, 'female', '2017-09-07', NULL, NULL, '2017-09-07 08:00:29', '2017-09-07 08:00:29', NULL),
(9, 'fdfdf', 'hghg', 'cccc', NULL, NULL, 'female', '2017-09-08', NULL, NULL, '2017-09-08 00:53:31', '2017-09-08 05:04:52', NULL),
(10, 'rerrr', 'rererr', 'rere', NULL, NULL, 'male', '2017-09-07', NULL, NULL, '2017-09-08 05:12:05', '2017-09-08 05:12:05', NULL),
(11, 'fdfd', 'fdd', 'gfdg', NULL, NULL, 'female', '2017-09-06', NULL, NULL, '2017-09-08 05:15:46', '2017-09-08 05:15:46', NULL),
(12, 'ccccc', 'ccccc', 'ccccccc', NULL, NULL, 'female', '2017-09-04', NULL, NULL, '2017-09-08 05:18:44', '2017-09-08 05:18:44', NULL),
(13, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 05:53:11', '2017-09-08 05:53:11', NULL),
(14, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 05:55:19', '2017-09-08 05:55:19', NULL),
(15, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:02:21', '2017-09-08 06:02:21', NULL),
(16, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:06:00', '2017-09-08 06:06:00', NULL),
(17, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:08:12', '2017-09-08 06:08:12', NULL),
(18, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:09:59', '2017-09-08 06:09:59', NULL),
(19, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:11:26', '2017-09-08 06:11:26', NULL),
(20, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:12:34', '2017-09-08 06:12:34', NULL),
(21, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:13:01', '2017-09-08 06:13:01', NULL),
(22, '', '', '', NULL, NULL, '', '0000-00-00', NULL, NULL, '2017-09-08 06:15:43', '2017-09-08 06:15:43', NULL),
(23, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:16:53', '2017-09-08 06:16:53', NULL),
(24, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:20:58', '2017-09-08 06:20:58', NULL),
(25, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:23:04', '2017-09-08 06:23:04', NULL),
(26, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:03', '2017-09-08 06:27:03', NULL),
(27, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:39', '2017-09-08 06:27:39', NULL),
(28, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:47', '2017-09-08 06:27:47', NULL),
(29, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:59', '2017-09-08 06:27:59', NULL),
(30, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:28:40', '2017-09-08 06:28:40', NULL),
(31, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:28:59', '2017-09-08 06:28:59', NULL),
(32, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:30:04', '2017-09-08 06:30:04', NULL),
(33, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:30:11', '2017-09-08 06:30:11', NULL),
(34, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:31:17', '2017-09-08 06:31:17', NULL),
(35, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:35:20', '2017-09-08 06:35:20', NULL),
(36, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:40:05', '2017-09-08 06:40:05', NULL),
(37, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:41:44', '2017-09-08 06:41:44', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `user_card_details`
--
CREATE TABLE `user_card_details` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`payment_type` varchar(100) DEFAULT NULL,
`card_number` varchar(50) DEFAULT NULL,
`security_code` varchar(100) DEFAULT NULL,
`expiration_date` date DEFAULT NULL,
`postal_code` varchar(50) DEFAULT NULL,
`country` varchar(100) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user_details`
--
CREATE TABLE `user_details` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`answer` varchar(50) NOT NULL,
`insurance_planning` varchar(15) DEFAULT NULL,
`health_care_planning` varchar(255) NOT NULL,
`financial_planning` varchar(255) NOT NULL,
`legal_planning` varchar(15) DEFAULT NULL,
`future_planning` varchar(15) DEFAULT NULL,
`funeral_wishes` varchar(255) NOT NULL,
`life_partner` varchar(255) NOT NULL,
`children` varchar(50) NOT NULL,
`children_years_old1` varchar(50) NOT NULL,
`children_years_old2` int(15) DEFAULT NULL,
`email_address` varchar(100) NOT NULL,
`personal_message` text NOT NULL,
`sharing_information` varchar(20) DEFAULT NULL,
`information_first_name` varchar(100) DEFAULT NULL,
`information_last_name` varchar(100) DEFAULT NULL,
`financial_accounts` varchar(255) DEFAULT NULL,
`insurance` varchar(255) DEFAULT NULL,
`estate_planning` varchar(255) DEFAULT NULL,
`assets` varchar(255) DEFAULT NULL,
`digital_life` varchar(255) DEFAULT NULL,
`legacy_plan` varchar(255) DEFAULT NULL,
`loans` varchar(255) DEFAULT NULL,
`dependents` varchar(255) DEFAULT NULL,
`eldercare` varchar(50) DEFAULT NULL,
`taxes_credit` varchar(255) DEFAULT NULL,
`charity_giving` varchar(50) DEFAULT NULL,
`personal` varchar(255) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_details`
--
INSERT INTO `user_details` (`id`, `user_id`, `answer`, `insurance_planning`, `health_care_planning`, `financial_planning`, `legal_planning`, `future_planning`, `funeral_wishes`, `life_partner`, `children`, `children_years_old1`, `children_years_old2`, `email_address`, `personal_message`, `sharing_information`, `information_first_name`, `information_last_name`, `financial_accounts`, `insurance`, `estate_planning`, `assets`, `digital_life`, `legacy_plan`, `loans`, `dependents`, `eldercare`, `taxes_credit`, `charity_giving`, `personal`, `token`, `created_at`, `updated_at`) VALUES
(1, 3, '3', '1,2', '2', '2', '3,4', '2', '2', '2', '4', '2', 1, 'jhon123@mailinator.com', 'Hello..........', 'spouse', 'Aman', 'Singh', 'Bank Accounts,Credit Cards,Other', 'Life Insurance,Disability Insurance,Long-Term Care', 'Will,Trust,Power of Attorney', 'Vehicles,Artwork & Collectables,Real Estate,Jewelry & Purses,Other', 'Instagram,Twitter,Other', 'Funeral Wishes,Letters to Family & Friends', 'Mortgage Loans,Business Loans', 'Children,Other', 'Eldercare plan', 'Credit Reports', 'Current Giving', 'Marriage License,Other', NULL, '2017-09-07 06:14:31', '2017-09-07 06:15:48'),
(2, 4, '3', '1,2,4', '1,2', '1,2', '1', '1', '1', '1', '7', '1', 1, 'asdasdasdasda', 'india', 'child', '', '', 'Bank Accounts,Credit Cards,Investment Accounts,Other', 'Life Insurance,Disability Insurance,Long-Term Care,Health Insurance', 'Trust,Power of Attorney,Advance Directive', 'Vehicles,Artwork & Collectables,Real Estate,Jewelry & Purses,Other', 'Instagram,Twitter,Facebook,Other', 'Funeral Wishes,Letters to Family & Friends', 'Mortgage Loans,Personal Loans,Business Loans', 'Children,Pets,Other', 'Eldercare plan', 'Tax Returns,Credit Reports', 'Current Giving', 'Birth Certificates,Marriage License,Other', NULL, '2017-09-07 07:32:06', '2017-09-07 07:34:38'),
(3, 5, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'rfetetet@gfgfg.hhh', 'trtrtrt', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-07 07:46:33', '2017-09-07 07:46:33'),
(4, 6, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'ggfg@fff.jjj', 'gfgfg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-07 07:53:19', '2017-09-07 07:53:19'),
(5, 7, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'jhjhj', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-07 07:58:28', '2017-09-07 07:58:28'),
(6, 8, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'xsdsd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-07 08:00:43', '2017-09-07 08:03:27'),
(7, 9, '1', '2', '2', '1,2', '1,2', '2,3', '2', '2', '1', '2', 3, 'sadsds@fdfd.dd', 'dsdsd', 'someone', '', '', 'Investment Accounts', 'Health Insurance', 'Trust', 'Other', 'Twitter', 'Funeral Wishes', 'Business Loans', 'Other', 'Eldercare plan', 'Tax Returns', 'Current Giving', 'Other', NULL, '2017-09-08 01:05:01', '2017-09-08 05:11:28'),
(8, 10, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'brajessn@mailinator.com', 'dsdsd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 05:12:29', '2017-09-08 05:12:29'),
(9, 11, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'fdfdfdfdf@fgfg.hhh', 'dfdfdfd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 05:16:03', '2017-09-08 05:16:03'),
(10, 12, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'gfgf@h.hh', 'gfgf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 05:19:04', '2017-09-08 05:19:04'),
(11, 13, '', NULL, '', '', NULL, NULL, '', '', '1', '2', 2, 'ghj@ggg.jj', 'jhjh', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 05:54:17', '2017-09-08 06:15:28'),
(12, 17, '3', NULL, '', '', NULL, NULL, '', '', '', '', NULL, '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:15:04', '2017-09-08 06:15:04'),
(13, 22, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmail.com', 'ghg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:16:32', '2017-09-08 06:16:32'),
(14, 23, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'asdasdasdasda@gg.jj', 'cdsfdf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:20:50', '2017-09-08 06:20:50'),
(15, 24, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'hhg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:22:53', '2017-09-08 06:22:53'),
(16, 25, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'fdfdfdfdf@fgfg.hhh', 'fdfd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:23:35', '2017-09-08 06:23:35'),
(17, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'gfgf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:25:27', '2017-09-08 06:25:27'),
(18, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'gfgf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:25:34', '2017-09-08 06:25:34'),
(19, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmail.com', 'jhj', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:39', '2017-09-08 06:27:39'),
(20, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmail.com', 'jhjhj', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:47', '2017-09-08 06:27:47'),
(21, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmail.com', 'jhjhj', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:27:59', '2017-09-08 06:27:59'),
(22, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'fdfdfdfdf@fgfg.hhh', 'fdfd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:28:40', '2017-09-08 06:28:40'),
(23, 0, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmail.com', 'dsfdf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:28:59', '2017-09-08 06:28:59'),
(24, 32, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'cccc@vfgg.jjj', 'fdfdfd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:30:04', '2017-09-08 06:30:04'),
(25, 33, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'asdasdasdasda@gg.jj', 'xcxc', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:30:11', '2017-09-08 06:30:11'),
(26, 34, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'asdasdasdasda@gg.jj', 'cxcx', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:35:12', '2017-09-08 06:35:12'),
(27, 35, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'fdfdfdfdf@fgfg.hhh', 'dfdf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:39:58', '2017-09-08 06:39:58'),
(28, 36, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gxzxmail.com', 'zx', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:41:35', '2017-09-08 06:41:35'),
(29, NULL, '', NULL, '', '', NULL, NULL, '', '', '', '', NULL, 'aman@gmgfail.com', 'dfdf', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2017-09-08 06:41:44', '2017-09-08 06:41:44');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_card_details`
--
ALTER TABLE `user_card_details`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_details`
--
ALTER TABLE `user_details`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
--
-- AUTO_INCREMENT for table `user_card_details`
--
ALTER TABLE `user_card_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user_details`
--
ALTER TABLE `user_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
/*!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 `todo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`user_id` int(11) NOT NULL,
`completed` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(255) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `hash` (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `todo`
ADD CONSTRAINT `todo_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
ALTER TABLESPACE tbs_01
BEGIN BACKUP;
--The following statement signals to the database that the backup is finished:
ALTER TABLESPACE tbs_01
END BACKUP;
DOCUMENT
Moving and Renaming Tablespaces: Example
This example moves and renames a datafile associated with the tbs_02 tablespace, created in "Enabling Autoextend for a Tablespace: Example", from diskb:tbs_f5.dat to diska:tbs_f5.dat:
#
--Take the tablespace offline using an ALTER TABLESPACE statement with the OFFLINE clause:
ALTER TABLESPACE tbs_02 OFFLINE NORMAL;
--Copy the file from diskb:tbs_f5.dat to diska:tbs_f5.dat using your operating system commands.
--Rename the datafile using an ALTER TABLESPACE statement with the RENAME DATAFILE clause:
ALTER TABLESPACE tbs_02
RENAME DATAFILE 'diskb:tbs_f5.dat'
TO 'diska:tbs_f5.dat';
--Bring the tablespace back online using an ALTER TABLESPACE statement with the ONLINE clause:
ALTER TABLESPACE tbs_02 ONLINE;
DOCUMENT
Adding and Dropping Datafiles and Tempfiles: Examples
The following statement adds a datafile to the tablespace. When more space is needed, new 10-kilobytes extents will be added up to a maximum of 100 kilobytes:
#
ALTER TABLESPACE tbs_03
ADD DATAFILE 'tbs_f04.dbf'
SIZE 100K
AUTOEXTEND ON
NEXT 10K
MAXSIZE 100K;
--The following statement drops the empty datafile:
ALTER TABLESPACE tbs_03
DROP DATAFILE 'tbs_f04.dbf';
--The following statements add a tempfile to the temporary tablespace created in "Creating a Temporary Tablespace: Example" and then drops the tempfile:
ALTER TABLESPACE temp_demo ADD TEMPFILE 'temp05.dbf' SIZE 5 AUTOEXTEND ON;
ALTER TABLESPACE temp_demo DROP TEMPFILE 'temp05.dbf';
--Managing Space in a Temporary Tablespace: Example
--The following statement manages the space in the temporary tablespace created in "Creating a Temporary Tablespace: Example" using the SHRINK SPACE clause. The KEEP clause is omitted, so the database will attempt to shrink the tablespace as much as possible as long as other tablespace storage attributes are satisfied.
ALTER TABLESPACE temp_demo SHRINK SPACE;
--Adding an Oracle-managed Datafile: Example
--The following example adds an Oracle-managed datafile to the omf_ts1 tablespace (see "Creating Oracle-managed Files: Examples" for the creation of this tablespace). The new datafile is 100M and is autoextensible with unlimited maximum size:
ALTER TABLESPACE omf_ts1 ADD DATAFILE;
--Changing Tablespace Logging Attributes: Example
--The following example changes the default logging attribute of a tablespace to NOLOGGING:
ALTER TABLESPACE tbs_03 NOLOGGING;
--Altering a tablespace logging attribute has no affect on the logging attributes of the existing schema objects within the tablespace. The tablespace-level logging attribute can be overridden by logging specifications at the table, index, and partition levels.
--Changing Undo Data Retention: Examples
--The following statement changes the undo data retention for tablespace undots1 to normal undo data behavior:
ALTER TABLESPACE undots1
RETENTION NOGUARANTEE;
--The following statement changes the undo data retention for tablespace undots1 to behavior that preserves unexpired undo data:
ALTER TABLESPACE undots1
RETENTION GUARANTEE;
|
--######################################################################--
--# #--
--# SQL Queries for University Database [10.AUG.2020] #--
--# #--
--######################################################################--
-- ------------------------------------------------
-- Create Schema and Tables
-- ------------------------------------------------
CREATE SCHEMA University;
-- ------------------------------------------------
USE University;
CREATE TABLE College (
name CHAR(50),
main_office CHAR(50),
phone CHAR(12),
dean CHAR(50),
PRIMARY KEY (name)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Department (
name CHAR(50),
code_number INT(11),
main_office CHAR(50),
phone CHAR(50),
chairman CHAR(50),
chairman_start_date DATE,
PRIMARY KEY (code_number)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Course (
name CHAR(50),
code_number INT(11),
level INT(1),
credit_hours INT(5),
description CHAR(100),
PRIMARY KEY (code_number)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Instructor (
id INT,
name CHAR(50),
office CHAR(50),
phone CHAR(50),
inst_rank CHAR(50),
department_code INT,
PRIMARY KEY (id),
FOREIGN KEY (department_code) REFERENCES Department(code_number)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Student (
id INT,
name CHAR(50),
first_name CHAR(50),
middle_name CHAR(50),
last_name CHAR(50),
address CHAR(50),
phone CHAR(50),
major_code CHAR(50),
birth_date DATE,
department_code INT,
PRIMARY KEY (id),
FOREIGN KEY (department_code) REFERENCES Department(code_number)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Classroom (
id INT,
building_code INT,
room_number INT,
PRIMARY KEY (id)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Section (
id INT,
course_code INT,
instructor_id INT,
number INT,
semester CHAR(50),
year INT,
classroom_id INT,
days_times CHAR(50),
PRIMARY KEY (id),
FOREIGN KEY (course_code) REFERENCES Course(code_number),
FOREIGN KEY (instructor_id) REFERENCES Instructor(id),
FOREIGN KEY (classroom_id) REFERENCES Classroom(id)
);
-- ------------------------------------------------
USE University;
CREATE TABLE College_Department (
college_name CHAR(50),
department_code INT,
FOREIGN KEY (college_name) REFERENCES College(name),
FOREIGN KEY (department_code) REFERENCES Department(code_number)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Level (
id INT,
level_name CHAR(10),
PRIMARY KEY (id)
);
-- ------------------------------------------------
USE University;
CREATE TABLE Student_Section (
section_id INT,
student_id INT,
student_grade CHAR(4),
FOREIGN KEY (section_id) REFERENCES Section(id),
FOREIGN KEY (student_id) REFERENCES Student(id)
);
-- ------------------------------------------------
-- Make fields UNIQUE
-- ------------------------------------------------
USE University;
ALTER TABLE College
ADD UNIQUE (name);
-- ------------------------------------------------
USE University;
ALTER TABLE Department
ADD UNIQUE (name);
-- ------------------------------------------------
USE University;
ALTER TABLE Course
ADD FOREIGN KEY (level) REFERENCES Level(id);
-- ------------------------------------------------
USE University;
ALTER TABLE Course
ADD UNIQUE (name);
-- ------------------------------------------------
-- Add Referential Integrity
-- ------------------------------------------------
ALTER TABLE Course
DROP FOREIGN KEY course_ibfk_1;
ALTER TABLE Course
ADD CONSTRAINT course_ibfk_1 FOREIGN KEY (level)
REFERENCES level (id)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Instructor
DROP FOREIGN KEY instructor_ibfk_1;
ALTER TABLE Instructor
ADD CONSTRAINT instructor_ibfk_1 FOREIGN KEY (department_code)
REFERENCES Department (code_number)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Student
DROP FOREIGN KEY student_ibfk_1;
ALTER TABLE Student
ADD CONSTRAINT student_ibfk_1 FOREIGN KEY (department_code)
REFERENCES Department (code_number)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Section
DROP FOREIGN KEY section_ibfk_1;
ALTER TABLE Section
ADD CONSTRAINT section_ibfk_1 FOREIGN KEY (course_code)
REFERENCES Course (code_number)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Section
DROP FOREIGN KEY section_ibfk_2;
ALTER TABLE Section
ADD CONSTRAINT section_ibfk_2 FOREIGN KEY (instructor_id)
REFERENCES Instructor (id)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Section
DROP FOREIGN KEY section_ibfk_3;
ALTER TABLE Section
ADD CONSTRAINT section_ibfk_3 FOREIGN KEY (classroom_id)
REFERENCES Classroom (id)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE College_Department
DROP FOREIGN KEY college_department_ibfk_1;
ALTER TABLE College_Department
ADD CONSTRAINT college_department_ibfk_1 FOREIGN KEY (college_name)
REFERENCES College (name)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE College_Department
DROP FOREIGN KEY college_department_ibfk_2;
ALTER TABLE College_Department
ADD CONSTRAINT college_department_ibfk_2 FOREIGN KEY (department_code)
REFERENCES Department (code_number)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Student_Section
DROP FOREIGN KEY student_section_ibfk_1;
ALTER TABLE Student_Section
ADD CONSTRAINT student_section_ibfk_1 FOREIGN KEY (section_id)
REFERENCES Section (id)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
ALTER TABLE Student_Section
DROP FOREIGN KEY student_section_ibfk_2;
ALTER TABLE Student_Section
ADD CONSTRAINT student_section_ibfk_2 FOREIGN KEY (student_id)
REFERENCES Student (id)
ON UPDATE CASCADE
ON DELETE SET NULL;
-- ------------------------------------------------
-- Create Users
-- ------------------------------------------------
CREATE USER 'paul1'@'%' IDENTIFIED BY 'password';
CREATE USER 'constantin1'@'%' IDENTIFIED BY 'password';
CREATE USER 'marius1'@'%' IDENTIFIED BY 'password';
-- ------------------------------------------------
GRANT ALL ON *.* TO 'paul1'@'%' WITH GRANT OPTION;
GRANT SELECT ON *.* TO 'constantin1'@'%' WITH GRANT OPTION;
GRANT UPDATE, DELETE ON *.* TO 'marius1'@'%' WITH GRANT OPTION;
-- ------------------------------------------------
SHOW GRANTS for 'paul1'@'%';
SHOW GRANTS for 'constantin1'@'%';
SHOW GRANTS for 'marius1'@'%';
SELECT * FROM mysql.user;
-- ------------------------------------------------
-- Create View
-- ------------------------------------------------
USE University;
CREATE VIEW User_role_information AS
SELECT User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv
FROM mysql.user
WHERE Select_priv = 'Y' OR Insert_priv = 'Y' OR Update_priv = 'Y' OR Delete_priv = 'Y' OR Create_priv = 'Y';
-- ------------------------------------------------
-- Populate Tables
-- ------------------------------------------------
USE University;
INSERT INTO Classroom (id, building_code, room_number) VALUES ('1', '1001', '1');
INSERT INTO Classroom (id, building_code, room_number) VALUES ('2', '1002', '16');
INSERT INTO Classroom (id, building_code, room_number) VALUES ('3', '1003', '17');
INSERT INTO Classroom (id, building_code, room_number) VALUES ('4', '1004', '24');
INSERT INTO Classroom (id, building_code, room_number) VALUES ('5', '1005', '36');
-- ------------------------------------------------
USE University;
INSERT INTO College (name, main_office, phone, dean) VALUES ('Kea1', 'L37', '123456789', 'Jesper N');
INSERT INTO College (name, main_office, phone, dean) VALUES ('Kea2', 'L38', '123456788', 'Maria I');
INSERT INTO College (name, main_office, phone, dean) VALUES ('Kea3', 'L16', '123456787', 'Christian L');
INSERT INTO College (name, main_office, phone, dean) VALUES ('Kea4', 'L98', '123456786', 'Christoffer K');
INSERT INTO College (name, main_office, phone, dean) VALUES ('Kea5', 'L101', '123456781', 'Peter D');
-- ------------------------------------------------
USE University;
INSERT INTO Level (id, level_name) VALUES ('1', 'Freshman');
INSERT INTO Level (id, level_name) VALUES ('2', 'Sophomore');
INSERT INTO Level (id, level_name) VALUES ('3', 'Junior');
INSERT INTO Level (id, level_name) VALUES ('4', 'Senior');
INSERT INTO Level (id, level_name) VALUES ('5', 'MS');
INSERT INTO Level (id, level_name) VALUES ('6', 'PhD');
-- ------------------------------------------------
USE University;
INSERT INTO Course (name, code_number, level, credit_hours, description) VALUES ('Databases', '1234', '4', '30', 'description 1');
INSERT INTO Course (name, code_number, level, credit_hours, description) VALUES ('Testing', '1235', '4', '15', 'description 2');
INSERT INTO Course (name, code_number, level, credit_hours, description) VALUES ('Microservices', '1236', '4', '10', 'description 3');
INSERT INTO Course (name, code_number, level, credit_hours, description) VALUES ('Android Game', '1237', '3', '15', 'description 4');
INSERT INTO Course (name, code_number, level, credit_hours, description) VALUES ('Python', '1238', '3', '10', 'description 5');
-- ------------------------------------------------
USE University;
INSERT INTO Department (name, code_number, main_office, phone, chairman, chairman_start_date) VALUES ('Computer Science', '5678', 'Lygten', '123456789', 'Jakob P', '2015-06-11');
INSERT INTO Department (name, code_number, main_office, phone, chairman, chairman_start_date) VALUES ('Software Development', '1678', 'GBG', '123456783', 'Martin M', '2007-10-20');
INSERT INTO Department (name, code_number, main_office, phone, chairman, chairman_start_date) VALUES ('Web Development', '2678', 'GBG', '123456786', 'Daniel E', '2009-12-30');
INSERT INTO Department (name, code_number, main_office, phone, chairman, chairman_start_date) VALUES ('IT Security', '3678', 'GBG', '123456781', 'Mark T', '2008-02-08');
INSERT INTO Department (name, code_number, main_office, phone, chairman, chairman_start_date) VALUES ('Datamatiker', '4678', 'Lygten', '123456788', 'Thomas S', '2019-07-10');
-- ------------------------------------------------
USE University;
INSERT INTO College_Department (college_name, department_code) VALUES ('Kea1', '1678');
INSERT INTO College_Department (college_name, department_code) VALUES ('Kea2', '2678');
INSERT INTO College_Department (college_name, department_code) VALUES ('Kea3', '3678');
INSERT INTO College_Department (college_name, department_code) VALUES ('Kea1', '4678');
INSERT INTO College_Department (college_name, department_code) VALUES ('Kea1', '5678');
-- ------------------------------------------------
USE University;
INSERT INTO Instructor (id, name, office, phone, inst_rank, department_code) VALUES ('007', 'Andrea Corradini', 'Norrebro', '123456789', '1', '1678');
INSERT INTO Instructor (id, name, office, phone, inst_rank, department_code) VALUES ('012', 'Arturo M', 'Norrebro', '123456787', '2', '2678');
INSERT INTO Instructor (id, name, office, phone, inst_rank, department_code) VALUES ('067', 'Christian K', 'Norrebro', '123456784', '3', '4678');
INSERT INTO Instructor (id, name, office, phone, inst_rank, department_code) VALUES ('031', 'Kristoffer Mikklas', 'Norrebro', '123456782', '2', '2678');
INSERT INTO Instructor (id, name, office, phone, inst_rank, department_code) VALUES ('090', 'Jon', 'Norrebro', '123456781', '5', '1678');
-- ------------------------------------------------
USE University;
INSERT INTO Section (id, course_code, instructor_id, number, semester, year, classroom_id, days_times) VALUES ('1', '1234', '7', '10', '1', '2020', '5', 'TuWeTh 9:00 AM - 12:00 AM');
INSERT INTO Section (id, course_code, instructor_id, number, semester, year, classroom_id, days_times) VALUES ('2', '1235', '31', '11', '2', '2018', '1', 'MoTuFr 9:00 AM - 14:00 AM');
INSERT INTO Section (id, course_code, instructor_id, number, semester, year, classroom_id, days_times) VALUES ('3', '1236', '12', '12', '3', '2016', '3', 'TuWeTh 9:00 AM - 10:00 AM');
INSERT INTO Section (id, course_code, instructor_id, number, semester, year, classroom_id, days_times) VALUES ('4', '1237', '67', '13', '4', '2018', '4', 'MoTuFr 9:00 AM - 14:00 AM');
INSERT INTO Section (id, course_code, instructor_id, number, semester, year, classroom_id, days_times) VALUES ('5', '1238', '90', '14', '5', '2019', '1', 'TuWeTh 9:00 AM - 12:00 AM');
-- ------------------------------------------------
USE University;
INSERT INTO Student (id, name, first_name, middle_name, last_name, address, phone, major_code, birth_date, department_code) VALUES ('1', 'Paul Panaitescu', 'Paul', NULL, 'Panaitescu', 'Albertslund', '087654321', '1111', '1900-10-20', '1678');
INSERT INTO Student (id, name, first_name, middle_name, last_name, address, phone, major_code, birth_date, department_code) VALUES ('2', 'Constantin Razvan Tarau', 'Constantin', 'Razvan', 'Tarau', 'Albertslund', '287654321', '1112', '1800-10-20', '1678');
INSERT INTO Student (id, name, first_name, middle_name, last_name, address, phone, major_code, birth_date, department_code) VALUES ('3', 'Marius Daniel Munteanu', 'Marius', 'Daniel', 'Munteanu', 'Albertslund', '387654321', '1113', '2000-10-20', '2678');
INSERT INTO Student (id, name, first_name, middle_name, last_name, address, phone, major_code, birth_date, department_code) VALUES ('4', 'Jakob M', 'Jakob', NULL, 'M', 'Norrrebro', '587654321', '1198', '2015-10-20', '2678');
INSERT INTO Student (id, name, first_name, middle_name, last_name, address, phone, major_code, birth_date, department_code) VALUES ('5', 'Dragos Andrei Mocanasu', 'Dragos', 'Andrei', 'Mocanasu', 'Valby', '787654321', '2113', '2100-01-20', '4678');
-- ------------------------------------------------
USE University;
INSERT INTO Student_Section (section_id, student_id, student_grade) VALUES ('1', '1', '12');
INSERT INTO Student_Section (section_id, student_id, student_grade) VALUES ('1', '2', '12');
INSERT INTO Student_Section (section_id, student_id, student_grade) VALUES ('1', '3', '12');
INSERT INTO Student_Section (section_id, student_id, student_grade) VALUES ('2', '1', '4');
INSERT INTO Student_Section (section_id, student_id, student_grade) VALUES ('4', '1', '10');
-- ------------------------------------------------
|
SELECT
MAX(numb) AS mx
FROM
quest
WHERE
head = ? |
Create Procedure mERP_SP_LoadQuoItemsInfo(@ItemCode nvarchar(100))
as
Begin
select ECP,(select Percentage from Tax where Tax_Code=Sale_Tax),PTS,PTR,Sale_Tax,Isnull(TOQ_Sales,0) TOQ_Sales from Items where Product_Code=@ItemCode
End
|
CREATE TABLE app_user (
id bigint(20) NOT NULL AUTO_INCREMENT,
username varchar(255) NOT NULL,
password varchar(255) NOT NULL,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE app_role (
id bigint(20) NOT NULL AUTO_INCREMENT,
role_name varchar(255) NOT NULL,
description varchar(255) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE user_role (
user_id bigint(20) NOT NULL,
role_id bigint(20) NOT NULL,
CONSTRAINT abcd FOREIGN KEY(user_id) REFERENCES app_user(id),
CONSTRAINT pqrs FOREIGN KEY(role_id) REFERENCES app_role(id)
); |
CREATE DATABASE `pp_loan_manager`;
USE `pp_loan_manager`;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(20) NOT NULL,
`password` varchar(255) NOT NULL,
`fname` varchar(40) NOT NULL,
`lname` varchar(20) NOT NULL,
`phone` varchar(15) NOT NULL,
`email` varchar(50) NOT NULL,
`gender` char(1) NOT NULL,
`newsletter` int(1) NOT NULL,
`admin` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
DROP TABLE IF EXISTS `banks`;
CREATE TABLE `banks` (
`id` int(11) not null auto_increment,
`name` varchar(255) not null,
`address` varchar(255) not null,
primary key (`id`)
) engine=InnoDB;
DROP TABLE IF EXISTS `loans`;
CREATE TABLE `loans` (
`id` int(11) not null auto_increment,
`user_id` int(11) NOT NULL,
`bank_id` int(11) NOT NULL,
`ammount` int(6) not null,
`rate` int(2) not null,
`noMonths` int(3) not null,
`paid` int(6),
`toBePaid` int(6),
`completed` int(1) not null,
primary key (`id`),
KEY `user_id` (`user_id`),
KEY `bank_id` (`bank_id`),
CONSTRAINT `loans_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `loans_ibfk_2` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`)
) engine=InnoDB;
DROP TABLE IF EXISTS `payments`;
CREATE TABLE `payments` (
`id` int(11) not null auto_increment,
`loan_id` int(11) not null,
`ammount` int(6) not null,
`date` varchar(255),
`info` varchar(255),
primary key (`id`),
KEY `loan_id` (`loan_id`),
CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`)
) engine=InnoDB;
INSERT INTO `banks` VALUES (default, "BCR", "Address 1"), (default, "BRD", "Address 2"), (default, "Raiffeisen", "Address 3"), (default, "Libra Bank", "Address 4"), (default, "ING", "Address 5"); |
INSERT INTO AD_Element
(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby,
columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help)
VALUES(52050, 0, 0, 'Y', sysdate, 100, sysdate, 100,
'ReceiptFooterMsg', 'U', 'Receipt Footer Msg', 'Receipt Footer Msg', 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, NULL, NULL, NULL, NULL);
INSERT INTO ad_column
(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name,
description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id,
ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic,
isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn,
ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic)
VALUES(52112, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'ReceiptFooterMsg' , 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, 0, 'U', 'ReceiptFooterMsg', 228, 10, NULL, NULL, 1024, 1, 'N', 'N', 'Y', 'Y', NULL,
'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52050, NULL, 'N', 'N', NULL, NULL);
|
--
-- 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;
SET search_path = taf, pg_catalog;
--
-- Name: task_id_seq; Type: SEQUENCE SET; Schema: taf; Owner: -
--
SELECT pg_catalog.setval('task_id_seq', 33, true);
--
-- Name: worker_id_seq; Type: SEQUENCE SET; Schema: taf; Owner: -
--
SELECT pg_catalog.setval('worker_id_seq', 2, true);
--
-- Data for Name: active_task; Type: TABLE DATA; Schema: taf; Owner: -
--
COPY active_task (task_id, title, slug, work_time, created_at, worker_id, rank, active_at, block_stack) FROM stdin;
28 This is a new task this-is-a-new-task-57d 0 2012-08-28 16:00:48.18141 2 10 2012-09-10 16:24:14.842249 {"blocks": []}
12 Pour la forme... 7f4-pour-la-forme 0 2012-08-28 16:00:48.18141 2 8 2012-09-10 16:24:14.842249 {"blocks": []}
10 Pour la forme... e74-pour-la-forme 0 2012-08-28 16:00:48.18141 2 9 2012-09-10 16:24:14.842249 {"blocks": []}
22 Insert en 8 insert-en-8-9ef 0 2012-08-28 16:00:48.18141 2 4 2012-09-10 16:24:14.842249 {"blocks": []}
24 Insert en 8 insert-en-8-aab 0 2012-08-28 16:00:48.18141 2 3 2012-09-10 16:24:14.842249 {"blocks": []}
20 Insert en 6 e25-insert-en-6 0 2012-08-28 16:00:48.18141 2 5 2012-09-10 16:24:14.842249 {"blocks": []}
14 Pour la forme... e69-pour-la-forme 0 2012-08-28 16:00:48.18141 2 1 2012-09-10 16:24:14.842249 {"blocks": []}
16 Pour la forme... 6f8-pour-la-forme 0 2012-08-28 16:00:48.18141 2 2 2012-09-10 16:24:14.842249 {"blocks": []}
8 Ceci est une tâche my-own-slug 0 2012-08-28 16:00:48.18141 2 7 2012-09-10 16:24:14.842249 {"blocks": []}
4 Ceci est une tâche 222-ceci-est-une-tache 0 2012-08-28 16:00:48.18141 2 6 2012-09-10 16:24:14.842249 {"blocks": []}
15 Complètement autre chose bf2-completement-autre-chose 0 2012-08-28 16:00:48.18141 1 8 2012-09-10 16:24:14.842249 {"blocks": []}
11 Complètement autre chose b33-completement-autre-chose 0 2012-08-28 16:00:48.18141 1 9 2012-09-10 16:24:14.842249 {"blocks": []}
9 Complètement autre chose e74-completement-autre-chose 0 2012-08-28 16:00:48.18141 1 10 2012-09-10 16:24:14.842249 {"blocks": []}
32 test with worker test-with-worker-70c 0 2012-08-29 16:18:20.26533 1 11 2012-09-10 16:24:14.842249 {"blocks": []}
5 Ceci est une autre tâche 75d-ceci-est-une-autre-tache 259 2012-08-28 16:00:48.18141 1 2 2012-09-10 16:24:14.842249 {"blocks": []}
17 plop plop et replop 5c5-plop-plop-et-replop 0 2012-08-28 16:00:48.18141 1 3 2012-09-10 16:24:14.842249 {"blocks": []}
13 Complètement autre chose 777-completement-autre-chose 0 2012-08-28 16:00:48.18141 1 4 2012-09-10 16:24:14.842249 {"blocks": []}
21 Insert en 7 617-insert-en-7 0 2012-08-28 16:00:48.18141 1 5 2012-09-10 16:24:14.842249 {"blocks": []}
33 test with worker test-with-worker-e31 0 2012-08-29 16:21:58.74556 1 6 2012-09-10 16:24:14.842249 {"blocks": []}
7 Ceci est une tâche b60-ceci-est-une-tache 0 2012-08-28 16:00:48.18141 1 1 2012-09-12 15:48:18.969637 {"blocks": []}
23 Insert en 8 insert-en-8-801 123 2012-08-28 16:00:48.18141 1 7 2012-09-10 16:24:14.842249 {"blocks": []}
\.
--
-- Data for Name: finished_task; Type: TABLE DATA; Schema: taf; Owner: -
--
COPY finished_task (task_id, title, slug, work_time, created_at, worker_id, changed_at, block_stack) FROM stdin;
\.
--
-- Data for Name: suspended_task; Type: TABLE DATA; Schema: taf; Owner: -
--
COPY suspended_task (task_id, title, slug, work_time, created_at, worker_id, changed_at, block_stack) FROM stdin;
\.
--
-- Data for Name: worker; Type: TABLE DATA; Schema: taf; Owner: -
--
COPY worker (worker_id, email) FROM stdin;
2 gregoire.hubert@knplabs.com
1 hubert.greg@gmail.com
\.
--
-- Data for Name: task; Type: TABLE DATA; Schema: taf; Owner: -
--
COPY task (task_id, title, slug, work_time, created_at, worker_id, block_stack) FROM stdin;
\.
--
-- PostgreSQL database dump complete
--
|
--- 本年
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084, de181,jsde802,jsde821,czde951,
hdde998,de151,de194,de156,de186,c05,c06,de200,s11) select jsde201,czde201,de011,'110108',czde183,de001,
jsde955,de084, -de181 ,jsde802,jsde821,czde951,hdde998,zbde151,de194,de156,de186,0,0,de200,'Y'
from HDJH001 where czde183 = de011 and de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and ((trunc(sysdate)-de001) - 131230901) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
-- 今年+往年
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084, de181,jsde802,jsde821,czde951,
hdde998,de151,de194,de156,de186,c05,c06,de200,s11) select jsde201,czde201,de011,'110108',czde183,de001,
jsde955,de084, -de181 ,jsde802,jsde821,czde951,hdde998,zbde151,de194,de156,de186,0,0,de200,'N'
from HDJH001 where de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and (trunc(sysdate)-de001) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9)
select sum(de181) from temp_yszx where s11 = 'N' and de194 = '021' and czde183 <> 2013;
select 99094377.9*2 from dual;
-- 总数 204,852,761.17
-- 2013 99094377.9
-- <> 2013 105758383.27
-- 授权
-- 1 工行
-- 204852761.17
select (99094377.9*1)+105758383.27 from dual;
select 99094377.9*2 from dual;
-- 兴业
-- 398,329,554.79
select 601962713.84/2 from dual;
select 300981356.92+97348197.87 from dual;
-- 民生
-- 11,391,427.94
select 22782855.88/2 from dual; --11391427.94
------------------------------------------------ 直接支付取数 ----------------------------------------------------------------
--- 本年
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084, de181,jsde802,jsde821,
czde951,hdde998,de151,de194,de156,de186,c05,c06,de200,s11) select jsde201,czde201,de011,
'110108',czde183,de001,jsde955,de084, de181 ,jsde802,jsde821,czde951,hdde998,zbde151,de194,
de156,de186,0,0,de200,'Y' from JH001 where czde183 = de011 and de011=2013 and hdde998 = '02'
and jsde940 >= '80' and jsde008 <> 1 and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
-- 2903
-- 本年+以前
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084,
de181,jsde802,jsde821,czde951,hdde998,de151,de194,de156,de186,c05,c06,de200,s11)
select jsde201,czde201,de011,'110108',czde183,de001,jsde955,de084, de181 ,
jsde802,jsde821,czde951,hdde998,zbde151,de194,de156,de186,0,0,de200,'N'
from JH001 where de011=2013 and hdde998 = '02' and jsde940 >= '80'
and jsde008 <> 1 and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
-- 4215
update temp_yszx w set w.c05 = (select sum(nvl(de181,0)) from jh003 a where a.de011 = w.de011
and a.jsde013 in (8,9) and a.jsde201 = w.jsde201 and
exists (select 1 from zf001 b
where b.de011 = a.de011 and a.jsde115 = b.jsde301 and b.jsde940 >10 and b.hdde998 = '02'
and exists (select 1 from zfzjhd g where g.ykmxid = b.jsde302)));
-- 更新计划追减奖金额
update temp_yszx w set w.c06 = (select sum(nvl(de181,0)) from jh003 a
where w.de011 = a.de011 and w.jsde201 = a.jsde201 and a.jsde013 = 7);
--- 确定显示金额为计划未使用金额
update temp_yszx w set w.de181 = (nvl(w.de181,0)-nvl(w.c05,0)-nvl(w.c06,0));
delete from temp_yszx w where nvl(w.de181,0) = 0;
------------------- 数据处理完成 ---------------------------------------------------------------------------
--- 本年
select sum(nvl(de181,0)) from temp_yszx where s11 = 'Y';
-- 1274118632.71
-- 本年+其他年度结转
select sum(nvl(de181,0)) from temp_yszx where s11 = 'N';
-- 1985881602.45
-- 其他年度结转
select sum(nvl(de181,0)) from temp_yszx where s11 = 'N' and czde183 <> 2013 ;
-- 711762969.74
-- 额度台账
-- 1985881602.45
-- 页面显示
select 1985881602.45+1274118632.71 from dual;
711762969.74 -- 1274118632.71
select 1274118632.71+711762969.74 from dual; -- 1985881602.45
select jsde201,czde201,de011,de022,czde183,d01,jsde955,de084,
de181,jsde802,jsde821,czde951,hdde998,de151,de194,de156,de186,c05,c06,de200,s11 from temp_yszx
select sum(de181) from temp_yszx where de011 = 2013 and s11 = 'N'
--- 2004739777.13 546837304.54
-- 直接
-- 北京银行 1080986109.16 1180761292.23
select 1451669060.10/2 from dual; -- 725834530.05
select 454926762.18+725834530.05 from dual;
select * from jh001 where
select * from jscs001 where dataelement = 'JSDE013'
SELECT sum(de181) FROM (
select jsde107,zbde151,zbjsde901,hdde147,czde951,de084,de200,jsde802,jsde821,jsde702,hdde998,de186,de156,
czde183,de042,jsde955,sum(nvl(a.de181,0)-nvl(b.de181,0)) as de181
from jh001 a,
(select jsde201,sum(nvl(de181,0)) as de181 from jh003 a where a.jsde013 in (7,8,9) and de011=2013
and exists (select 1 from zf001 b
where b.de011 = a.de011 and a.jsde115 = b.jsde301 and b.jsde940 >10 and b.hdde998 = '02'
and exists (select 1 from zfzjhd g where g.ykmxid = b.jsde302)) group by jsde201) b
where de011=2013 and hdde998='02' and jsde940>='80' and a.jsde201=b.jsde201(+)
/* and jsde955 like rtrim(sJsde955)||'%'*/
group by jsde107,zbde151,zbjsde901,hdde147,czde951,de084,de200,jsde802,jsde821,jsde702,hdde998,de186,de156,czde183,de042,jsde955);
-- 1982499347.98
select sum(de181) from temp_yszx where
-- 2534053973.95
-------------------------------------------------------------------------------------------------------------------------------
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084, de181,jsde802,jsde821,czde951,hdde998,de151,de194,de156,de186,c05,c06,de200,s11)
select jsde201,czde201,de011,'110108',czde183,de001,jsde955,de084, -de181 ,jsde802,
jsde821,czde951,hdde998,zbde151,de194,de156,de186,0,0,de200,'Y' from HDJH001
where czde183 = de011 and de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and ((trunc(sysdate)-de001) - 131231905) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
insert into temp_yszx (jsde201,czde201,de011,de022,czde183,d01,jsde955,de084,
de181,jsde802,jsde821,czde951,hdde998,de151,de194,de156,de186,c05,c06,
de200,s11)
select /*jsde201,czde201,de011,'110108',czde183,de001,jsde955,de084,*/
sum(-de181) /*,jsde802,jsde821,czde951,hdde998,zbde151,de194,de156,de186,0,0,de200,'N'*/
from HDJH001 where de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and ((trunc(sysdate)-de001) - 131231905) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
--- 页面显示数
-- 6689244360.08
select * from sstranscode where id = '400246'
select SUM(-DE181)
from HDJH001 where de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and (trunc(sysdate)-de001) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
-- 9870170284.52
select SUM(-DE181) from HDJH001
where czde183 = de011 and de011=2013 and hdde998 = '01' and jsde008 = 9
and jsde940 >= '80' and (trunc(sysdate)-de001) < 30
and jsde201 not in (select jsde201 from hdjh006 where bno = 1 and lx = 9);
-- 7866400940.25
select 9870170284.52-7866400940.25 from dual;
-- 2003769344.27
|
-- +migrate Up
CREATE TABLE tasks (
task_id VARCHAR(255) PRIMARY KEY
,task_data MEDIUMBLOB
,task_labels MEDIUMBLOB
);
-- +migrate Down
DROP TABLE tasks;
|
CREATE TABLE efectivo(
idPago int NOT NULL,
PRIMARY KEY (idPago),
FOREIGN KEY (idPago) REFERENCES pago(idPago)
); |
-- 创建数据库
CREATE DATABASE bianquan
-- 创建用户表
CREATE TABLE IF NOT EXISTS `user`(
`u_id` INT UNSIGNED AUTO_INCREMENT,
`u_name` VARCHAR(30) NOT NULL,
`u_pwd` VARCHAR(40) NOT NULL,
`u_mail` VARCHAR(30) NOT NULL,
`u_status` VARCHAR(30) NOT NULL,
`u_msg` VARCHAR(30) NOT NULL,
`u_time` DATE,
PRIMARY KEY ( `u_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建文章表
CREATE TABLE IF NOT EXISTS `article`(
`a_id` INT UNSIGNED AUTO_INCREMENT,
`a_author` VARCHAR(30) NOT NULL,
`a_title` VARCHAR(30) NOT NULL,
`a_content` TEXT NOT NULL,
`a_tag` TEXT NOT NULL,
`a_time` DATE,
`a_img` TEXT NOT NULL,
`a_published` INT(6) NOT NULL,
`a_comment` INT(6) NOT NULL,
`a_praise` INT(6) NOT NULL,
PRIMARY KEY ( `a_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建评论表
CREATE TABLE IF NOT EXISTS `comment`(
`c_id` INT UNSIGNED AUTO_INCREMENT,
`c_article_id` INT(6) NOT NULL,
`c_user` VARCHAR(30) NOT NULL,
`c_content` TEXT NOT NULL,
`c_time` DATE,
`c_type` INT(6) NOT NULL,
`c_old_comment` VARCHAR(30) NOT NULL,
`c_index` INT(6) NOT NULL,
`c_published` INT(6) NOT NULL,
PRIMARY KEY ( `c_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建图片地址表
CREATE TABLE IF NOT EXISTS `images`(
`i_id` INT UNSIGNED AUTO_INCREMENT,
`i_src` TEXT NOT NULL,
`i_author` VARCHAR(30) NOT NULL,
`i_time` DATE,
PRIMARY KEY ( `i_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建网站统计表
CREATE TABLE IF NOT EXISTS `webdata`(
`total_article` INT NOT NULL,
`total_user` INT NOT NULL,
`total_comment` INT NOT NULL,
`total_praise` INT NOT NULL,
`total_tags` INT NOT NULL,
`total_viewers` INT NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 插入网站统计数据初始值
INSERT INTO `webdata` (`total_article`, `total_user`, `total_comment`,`total_praise`,`total_tags`,`total_viewers`) VALUES
(0, 0, 0, 0, 0, 0);
-- 创建标签表
CREATE TABLE IF NOT EXISTS `tags`(
`tag_id` INT UNSIGNED AUTO_INCREMENT,
`tag_name` TEXT NOT NULL,
PRIMARY KEY ( `tag_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建友情链接表
CREATE TABLE IF NOT EXISTS `neighbors`(
`nb_id` INT UNSIGNED AUTO_INCREMENT,
`nb_name` TEXT NOT NULL,
`nb_url` TEXT NOT NULL,
`nb_icon` TEXT NOT NULL,
`nb_time` DATE,
`nb_published` INT NOT NULL,
PRIMARY KEY ( `nb_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建个人作品表
CREATE TABLE IF NOT EXISTS `production`(
`pr_id` INT UNSIGNED AUTO_INCREMENT,
`pr_name` TEXT NOT NULL,
`pr_content` TEXT NOT NULL,
`pr_src` TEXT NOT NULL,
`pr_img` TEXT NOT NULL,
`pr_time` DATE,
`pr_published` INT NOT NULL,
PRIMARY KEY ( `pr_id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 创建网站about内容表
CREATE TABLE IF NOT EXISTS `about`(
`about` TEXT NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 插入网站about内容初始值
INSERT INTO `about` (`about`) VALUES
('hello');
|
SELECT name FROM images WHERE name LIKE '%Space%'; |
create or replace view v1_jh001_dj as
(
select a."DE011",a."JSDE201",a."CZDE201",a."JSDE202",a."JSDE215",a."DE007",a."DE062",a."DE186",
a."DE156",a."CZDE951",a."DE084",a."JSDE702",a."JSDE802",a."CZDE901",a."JSDE901",a."JSDE007",
a."JSDE940",a."JSDE012",a."DE202",a."JSDE008",a."DE192",a."DE042",a."JSDE955",a."DE151",a."DE001",
a."JSDE206",a."JSDE909",a."DE200",a."JSDE349",a."JSDE983",a."JSDE984",a."DE194",a."CZDE015",a."JSDE999",
a."CZDE119",a."DE022",a."JSDE902",a."CZDE938",a."JSDE025",a."JSDE090",a."HDDE998",a."DE181" as jhje,
a."HDDE147",a."HDDE126",a."JSDE104",a."JSDE107",a."CZDE202",a."JSDE014",a."ZBDE151",a."ZBJSDE901",a."JSDE821",
a."HDDE138",a."CZDE183",a."SYJE",a."TZJE",a."ZTSYJE",a."CGSDJE",a."DJJE",a."KYJE",
b."JSDE115",b."JSDE117",b."DE181",b."JSDE901" as sm
from V1_JH001 a,jh003 b where a.JSDE201=b.jsde201 and a.DJJE>0 and hdde998='02'
and b.jsde013 in (21,22));
|
--
-- Core Form
--
CREATE TABLE `core_form` (
`form_key` varchar(50) NOT NULL,
`label` varchar(100) NOT NULL,
`entity_class` varchar(255) NOT NULL,
`entity_tbl_class` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_form`
ADD PRIMARY KEY (`form_key`);
--
-- Core Form Button
--
CREATE TABLE `core_form_button` (
`Button_ID` int(11) NOT NULL,
`label` varchar(255) NOT NULL,
`icon` varchar(100) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL,
`href` varchar(255) NOT NULL,
`class` varchar(100) NOT NULL,
`append` varchar(100) NOT NULL DEFAULT '',
`form` varchar(50) NOT NULL,
`mode` varchar(10) NOT NULL DEFAULT 'link',
`filter_check` varchar(50) NOT NULL,
`filter_value` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_form_button`
ADD PRIMARY KEY (`Button_ID`);
ALTER TABLE `core_form_button`
MODIFY `Button_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
--
-- Core Form Tab
--
CREATE TABLE `core_form_tab` (
`Tab_ID` varchar(50) NOT NULL,
`form` varchar(50) NOT NULL,
`title` varchar(100) NOT NULL,
`subtitle` varchar(100) NOT NULL,
`icon` varchar(30) NOT NULL,
`counter` varchar(50) NOT NULL DEFAULT '',
`sort_id` int(4) NOT NULL,
`filter_check` varchar(100) NOT NULL,
`filter_value` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_form_tab`
ADD PRIMARY KEY (`Tab_ID`);
--
-- Core Widget
--
CREATE TABLE `core_widget` (
`Widget_ID` int(11) NOT NULL,
`widget_name` varchar(100) NOT NULL,
`label` varchar(255) NOT NULL,
`permission` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_widget`
ADD PRIMARY KEY (`Widget_ID`),
ADD UNIQUE KEY `widget_name` (`widget_name`);
ALTER TABLE `core_widget`
MODIFY `Widget_ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- Core Index Table
--
CREATE TABLE `core_index_table` (
`table_name` varchar(50) NOT NULL,
`form` varchar(50) NOT NULL,
`label` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_index_table`
ADD PRIMARY KEY (`table_name`);
--
-- Core Form Field
--
CREATE TABLE `core_form_field` (
`Field_ID` int(11) NOT NULL,
`type` varchar(20) NOT NULL,
`label` varchar(100) NOT NULL,
`default_value` VARCHAR(255) NOT NULL DEFAULT '',
`fieldkey` varchar(100) NOT NULL,
`tab` varchar(50) NOT NULL,
`form` varchar(100) NOT NULL,
`class` varchar(100) NOT NULL,
`url_view` varchar(255) NOT NULL,
`url_list` varchar(255) NOT NULL,
`show_widget_left` tinyint(1) NOT NULL,
`allow_clear` tinyint(1) NOT NULL DEFAULT 1,
`readonly` tinyint(1) NOT NULL DEFAULT 0,
`tbl_cached_name` varchar(100) NOT NULL DEFAULT '',
`tbl_class` varchar(200) NOT NULL,
`tbl_permission` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_form_field`
ADD PRIMARY KEY (`Field_ID`);
ALTER TABLE `core_form_field`
MODIFY `Field_ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- Core Metric
--
CREATE TABLE `core_metric` (
`user_idfs` int(11) NOT NULL,
`action` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`date` datetime NOT NULL,
`comment` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_metric`
ADD PRIMARY KEY (`user_idfs`,`action`,`date`);
--
-- Core Performance Log
--
CREATE TABLE `core_perfomance_log` (
`action` varchar(50) NOT NULL DEFAULT '',
`utime` float NOT NULL,
`stime` float NOT NULL,
`date` datetime NOT NULL,
`log_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_perfomance_log`
ADD PRIMARY KEY (`log_id`);
ALTER TABLE `core_perfomance_log`
MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Settings
--
CREATE TABLE `settings` (
`settings_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`settings_value` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `settings`
ADD PRIMARY KEY (`settings_key`);
--
-- Statistics
--
CREATE TABLE `core_statistic` (
`Statistic_ID` int(11) NOT NULL,
`stats_key` varchar(100) NOT NULL,
`data` text NOT NULL,
`date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_statistic`
ADD PRIMARY KEY (`Statistic_ID`);
ALTER TABLE `core_statistic`
MODIFY `Statistic_ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- Gallery Media
--
CREATE TABLE `core_gallery_media` (
`Media_ID` int(11) NOT NULL,
`filename` varchar(255) NOT NULL,
`entity_idfs` int(11) NOT NULL,
`entity_type` varchar(50) NOT NULL,
`is_public` tinyint(1) NOT NULL,
`created_by` int(11) NOT NULL,
`created_date` datetime NOT NULL,
`modified_by` int(11) NOT NULL,
`modified_date` datetime NOT NULL,
`sort_id` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_gallery_media`
ADD PRIMARY KEY (`Media_ID`);
ALTER TABLE `core_gallery_media`
MODIFY `Media_ID` int(11) NOT NULL AUTO_INCREMENT;
CREATE TABLE `core_module` (
`module_key` varchar(255) NOT NULL,
`version` varchar(10) NOT NULL,
`label` varchar(255) NOT NULL,
`type` varchar(50) NOT NULL,
`vendor` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `core_module`
ADD PRIMARY KEY (`module_key`);
--
-- Save
--
COMMIT; |
/* Replace with your SQL commands */
CREATE TABLE users(
id SERIAL PRIMARY KEY,
firstname VARCHAR,
lastname VARCHAR,
password VARCHAR,
email VARCHAR); |
INSERT INTO `users`
(`username`, `email`, `password`)
VALUES
('Usman Ali', 'usmanali@gmail.com', 'usman12345') |
#!/bin/bash
# https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html
mysqld --user=${USER} --initialize-insecure --skip-grant-tables --skip-networking --skip-mysqlx
sleep 10
mysqld_safe --user=${USER} &
# waiting for mysqld startup
while ! mysqladmin ping -h 127.0.0.1 --silent; do
echo "mysqld is down...";
sleep 5
done
echo "mysqld is up!";
# creating local user and granting all privileges
# mysql -u root -e "CREATE USER '${USER}'@'localhost';";
# mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${USER}'@'localhost';" ;
# mysql -u root -e "CREATE USER '${USER}'@'${HOSTNAME}';";
# mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${USER}'@'${HOSTNAME}';" ;
mysql -h 127.0.0.1 -u root -e "CREATE USER '${USER}'@'${HOSTNAME}' IDENTIFIED WITH mysql_native_password BY '';";
mysql -h 127.0.0.1 -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${USER}'@'${HOSTNAME}';" ;
mysql -h 127.0.0.1 -u root -e "CREATE USER '${USER}'@'localhost' IDENTIFIED WITH mysql_native_password BY '';";
mysql -h 127.0.0.1 -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${USER}'@'localhost';" ;
mysql -h 127.0.0.1 -u root -e "CREATE USER 'root'@'${HOSTNAME}' IDENTIFIED WITH mysql_native_password BY '';";
mysql -h 127.0.0.1 -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'${HOSTNAME}';" ;
mysql -h 127.0.0.1 -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';" ;
echo "mysql is ready"! |
show databases;
create database sup;
use sup;
create table supplier(sid int primary key, sname varchar(30), city varchar(20));
create table parts(pid int primary key, pname varchar(20), color varchar(20));
show tables;
drop table catalog;
create table catalog(sid int, pid int, cost int, foreign key(sid) references supplier(sid) on delete cascade, foreign key(pid) references parts(pid) on delete cascade, primary key(sid,pid));
insert into supplier values(10001, "Acme Widget", "Bangalore");
insert into supplier values(10002, "Johns", "Kolkata");
insert into supplier values(10003, "Vimal", "Mumbai");
insert into supplier values(10004, "Reliance", "Delhi");
insert into parts values(20001, "Book", "Red");
insert into parts values(20002, "Pen", "Red");
insert into parts values(20003, "Pencil", "Green");
insert into parts values(20004, "Mobile", "Green");
insert into parts values(20005, "Charger", "Black");
insert into catalog values(10001, 20001, 10);
insert into catalog values(10001, 20002, 10);
insert into catalog values(10001, 20003, 30);
insert into catalog values(10001, 20004, 10);
insert into catalog values(10001, 20005, 10);
insert into catalog values(10002, 20001, 10);
insert into catalog values(10002, 20002, 20);
insert into catalog values(10003, 20003, 30);
insert into catalog values(10004, 20003, 40);
select * from supplier;
update supplier set sname = 'Johns' where sid = 10002;
select * from parts;
select * from catalog;
update catalog set cost = 30 where sid = 10003 and pid = 20003;
select supplier.sid from supplier, catalog, parts where parts.color in ("Green","Red");
select supplier.sid from supplier, catalog, parts where parts.color = "Red" or city = "Bangalore";
select c1.sid,c2.sid from catalog c1, catalog c2 where c1.cost>c2.cost;
|
# renaming rc_id into resource_class_id throughout the schema:
ALTER TABLE resource_description CHANGE COLUMN rc_id resource_class_id int(10) unsigned NOT NULL;
ALTER TABLE analysis_stats CHANGE COLUMN rc_id resource_class_id int(10) unsigned NOT NULL;
ALTER TABLE analysis_stats_monitor CHANGE COLUMN rc_id resource_class_id int(10) unsigned NOT NULL;
|
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 08, 2013 at 04:59 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
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: `test`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) COLLATE utf8_bin DEFAULT NULL,
`password` varchar(100) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=6 ;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `password`) VALUES
(1, 'test', 'sss'),
(3, 'test1', 'test1'),
(4, 'piyasde', 'piyasde'),
(5, 'parma', 'parma');
/*!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 or replace procedure orgprofile (name in varchar2, pass in varchar2, mobile out varchar2, email out varchar2,id out number)
is
begin
id:=getorgid(name,pass);
select mob_number,email into mobile,email
from orgcont
where orgid=id;
end;
/ |
DELIMITER //
DROP FUNCTION IF EXISTS fnGetUserID //
CREATE FUNCTION fnGetUserID(pUsername VARCHAR(45)) returns INT
DETERMINISTIC
BEGIN
return (select userID from user where username = pUsername);
END; //
delimiter ;
select fnGetUserID("edamazzio");
|
SELECT
trackid,
name,
mediatypeid
FROM tracks
WHERE mediatypeid IN (1, 2)
ORDER BY name ASC; |
CREATE TABLE Hotel_Info(
Hotel_Id integer primary key AUTOINCREMENT,
Name Text,
Phone integer,
Address TEXT,
City text,
State TEXT,
Zip integer,
Num_of_Rooms integer
);
CREATE TABLE Rooms(
Room_num integer primary key AUTOINCREMENT,
Hotel_Id integer,
Guest_Id integer,
Rate integer,
Room_Type text
);
CREATE TABLE Reservation(
Reserve_Id integer primary key AUTOINCREMENT,
Room_num integer,
Guest_Id integer,
Checkin_Date integer not NULL,
Checkout_Date integer NOT NULL,
Status text,
Rate integer
);
CREATE TABLE Guest(
Guest_Id integer PRIMARY key,
Guest_First text,
Guest_Last text,
Email text,
Phone integer,
Reserve_Id integer
); |
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.6.17 - MySQL Community Server (GPL)
-- ОС Сервера: Win64
-- HeidiSQL Версия: 9.3.0.4984
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Дамп структуры базы данных test
CREATE DATABASE IF NOT EXISTS `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
-- Дамп структуры для таблица test.user
CREATE TABLE IF NOT EXISTS `user` (
`id` int(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`age` int(10) unsigned NOT NULL DEFAULT '0',
`isAdmin` bit(1) NOT NULL DEFAULT b'0',
`createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- Дамп данных таблицы test.user: ~10 rows (приблизительно)
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT IGNORE INTO `user` (`id`, `name`, `age`, `isAdmin`, `createdDate`) VALUES
(1, 'Taalaybek', 27, b'1', '2016-01-29 22:58:53'),
(2, 'Ruslan', 27, b'0', '2016-01-29 22:56:11'),
(4, 'John', 23, b'0', '2016-01-29 23:08:14'),
(5, 'Maria', 32, b'0', '2016-01-29 23:08:25'),
(6, 'Andrew', 43, b'0', '2016-01-29 23:08:39'),
(7, 'Sergey', 18, b'0', '2016-01-29 23:08:47'),
(8, 'Alex', 65, b'0', '2016-01-29 23:09:02'),
(9, 'Lev Tolstoy', 100, b'0', '2016-01-29 23:09:19'),
(10, 'Test test', 34, b'0', '2016-01-29 23:09:29'),
(11, 'Last Name', 34, b'0', '2016-01-29 23:09:41'),
(12, 'Test Name', 34, b'0', '2016-01-31 01:34:59');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
/* Создание просмотра управления документами */
CREATE VIEW /*PREFIX*/S_MANAGEMENTS
AS
SELECT M.*,
P.FIRM_ID AS POSITION_FIRM_ID,
D.VIEW_ID,
D.NUM AS DOC_NUM,
D.DATE_DOC,
D.NAME AS DOC_NAME,
T1.SMALL_NAME AS WHO_FIRM,
T1.USER_NAME AS WHO_ACCOUNT,
P.PRIORITY
FROM /*PREFIX*/MOTIONS M
JOIN /*PREFIX*/POSITIONS P ON P.POSITION_ID=M.POSITION_ID
JOIN /*PREFIX*/DOCS D ON D.DOC_ID=M.DOC_ID
LEFT JOIN /*PREFIX*/ACCOUNTS A ON A.ACCOUNT_ID=M.ACCOUNT_ID
LEFT JOIN (SELECT M.DOC_ID,
P.PLAN_ID,
D.VIEW_ID,
F.SMALL_NAME,
A.USER_NAME,
M.DATE_PROCESS
FROM /*PREFIX*/MOTIONS M
JOIN /*PREFIX*/POSITIONS P ON P.POSITION_ID=M.POSITION_ID
JOIN /*PREFIX*/ACCOUNTS A ON A.ACCOUNT_ID=M.ACCOUNT_ID
JOIN /*PREFIX*/DOCS D ON D.DOC_ID=M.DOC_ID
LEFT JOIN /*PREFIX*/FIRMS F ON F.FIRM_ID=A.FIRM_ID
WHERE M.DATE_PROCESS IS NOT NULL
AND M.ACCOUNT_ID IS NOT NULL) T1 ON T1.DOC_ID=M.DOC_ID
AND T1.PLAN_ID=P.PLAN_ID
AND T1.VIEW_ID=D.VIEW_ID
AND T1.DATE_PROCESS=M.DATE_ISSUE
WHERE M.DATE_PROCESS IS NULL
AND M.ACCOUNT_ID IS NULL
--
|
Create procedure spr_totalwise_outstanding_allCustomers(@Dummy int,@FromDate datetime,@ToDate datetime)
as
create table #temp (customerid nvarchar(15), doccount int null, value decimal(18,2)null)
insert #temp(customerid, doccount, value)
select "Customer Id" = InvoiceAbstract.CustomerID,
"No of Documents" = count(InvoiceID),
"Outstanding Value (Rs.)" = sum( case InvoiceAbstract.InvoiceType
when 4 then (0 - isnull(InvoiceAbstract.Balance, 0))
else isnull(InvoiceAbstract.Balance, 0) end)
from InvoiceAbstract
where InvoiceAbstract.InvoiceDate between @FromDate and @ToDate and
InvoiceAbstract.Balance > 0 and
InvoiceAbstract.InvoiceType in (1, 3, 4) and
InvoiceAbstract.Status & 128 = 0
group by InvoiceAbstract.CustomerID
insert #temp(customerid, doccount, value)
select "Customer ID" = creditnote.CustomerID,
"No of Documents" = count(CreditID),
"Outstanding Value" = 0 - sum(creditnote.Balance)
from creditnote
where creditnote.CustomerID is not null and
creditnote.Balance > 0 and
creditnote.DocumentDate between @FromDate and @ToDate
group by creditnote.CustomerID
insert #temp(customerid, doccount, value)
select "Customer ID" = debitnote.CustomerID,
"No of Documents" = count(DebitID),
"Outstanding Value" = sum(Debitnote.Balance)
from debitnote
where debitnote.CustomerID is not null and
debitnote.Balance > 0 and
debitnote.DocumentDate between @FromDate and @ToDate
group by debitnote.CustomerID
select #temp.customerid,
"CustomerID" = #temp.customerid,
"Customer" = Customer.Company_Name,
"No. Of Documents" = sum(doccount),
"OutStanding Value (Rs)" = sum(value)
from #temp, Customer
where #temp.customerid = Customer.CustomerID
group By #temp.customerid,Customer.Company_Name
drop table #temp |
with
bucket1q as
(
select count(*) ct
, avg(ss_ext_list_price) alp
, avg(ss_net_paid_inc_tax) anp
from store_sales
where ss_quantity between 1 and 20
), bucket2q as (
select count(*) ct
, avg(ss_ext_list_price) alp
, avg(ss_net_paid_inc_tax) anp
from store_sales
where ss_quantity between 21 and 40
), bucket3q as (
select count(*) ct
, avg(ss_ext_list_price) alp
, avg(ss_net_paid_inc_tax) anp
from store_sales
where ss_quantity between 41 and 60
), bucket4q as (
select count(*) ct
, avg(ss_ext_list_price) alp
, avg(ss_net_paid_inc_tax) anp
from store_sales
where ss_quantity between 61 and 80
), bucket5q as (
select count(*) ct
, avg(ss_ext_list_price) alp
, avg(ss_net_paid_inc_tax) anp
from store_sales
where ss_quantity between 81 and 100
)
select
case when bucket1q.ct > 409437 then bucket1q.alp else bucket1q.anp end bucket1
, case when bucket1q.ct > 4595804 then bucket1q.alp else bucket1q.anp end bucket1
, case when bucket1q.ct > 7887297 then bucket1q.alp else bucket1q.anp end bucket1
, case when bucket1q.ct > 10872978 then bucket1q.alp else bucket1q.anp end bucket1
, case when bucket1q.ct > 43571537 then bucket1q.alp else bucket1q.anp end bucket1
from bucket1q, bucket2q, bucket3q, bucket4q, bucket5q
; |
create or replace view v1_zf001_gwk as
select a."DE011",a."JSDE201",a."CZDE201",a."JSDE202",a."JSDE215",a."DE007",
a."DE062",a."DE186",a."DE156",a."CZDE951",a."DE084",a."JSDE702",a."JSDE802",a."CZDE901",
b."JSDE901",a."JSDE007",B."JSDE940",a."JSDE012",a."DE202",a."JSDE008",a."DE192",a."DE042",
a."JSDE955",B."DE151",a."DE001",a."JSDE206",a."JSDE909",a."DE200",a."JSDE349",a."JSDE983",
a."JSDE984",a."DE194",a."CZDE015",a."JSDE999",a."JSDE117",a."CZDE119",a."DE022",a."JSDE902"
,a."CZDE938",a."JSDE025",a."JSDE090",a."HDDE998",a."DE181",a."HDDE147",a."HDDE126",a."JSDE104",
a."JSDE107",a."CZDE202",a."JSDE014",a."SYJE",a."TZJE",a."ZTSYJE",a."KYJE",
(select sum(de181) from czcs020 czcs where czcs.jsde301=b.jsde301) as bcbx,b.jsde303,B.JSDE301
from v1_jh001 a,zf001 b,jh003 c
where a.jsde201=c.jsde201 and b.jsde301=c.jsde115 and b.de190=7;
|
create or replace function wxhf_zd_look_sts(ip_co_nbr varchar2
,ip_ext_so_nbr varchar2) return varchar2
/**
* ���� :���۵�������״̬
* @usage :<STRIKE></STRIKE>
* @author :���º�
* @created :
* @param :
* @return :
*/
is
--lv_sts varchar2(120);
lv_crm_state varchar2(10);
lv_oss_state varchar2(10);
lv_so_nbr varchar2(24);
worec wo%rowtype;
begin
SELECT indent_state into lv_crm_state FROM LS65_CRM1.cust_indent_t@to_crm z where z.cust_indent_nbr = ip_co_nbr;
if lv_crm_state IN ('400', '600') then
return '����';
elsif lv_crm_state = '700' then
return '����';
else
null;
end if;
SELECT so_sts, so_nbr
into lv_oss_state, lv_so_nbr
FROM so z
where z.sts = 'A'
and z.ext_so_nbr = ip_ext_so_nbr;
if lv_oss_state = 'Y' then
return '��װ';
else
begin
SELECT *
into worec
FROM wo z
where z.so_nbr = lv_so_nbr
and wo_nbr = (SELECT max(wo_nbr)
from wo k
where k.so_nbr = z.so_nbr
and k.step_id = 'SP0701A'
and deal_flag = 0);
IF worec.run_sts = 'C' THEN
return '�۵����ص�δ����';
elsif (worec.run_sts = 'P' and worec.busi_sts IN ('D', 'N')) then
RETURN '�۵�δ�ص�';
ELSE
return 'δ�����۵�ϵͳ';
END IF;
exception
when no_data_found then
return 'δ�����۵�ϵͳ'; ----δ���۵�
when others then
return sqlerrm;
end;
end if;
exception
when others then
return sqlerrm;
end;
/
|
SELECT
date(report_month, 'unixepoch') AS report_month,
sum(asset_value) AS asset_value,
sum(liability_value) AS liability_value
FROM entity_ratings
WHERE entity_id IN (
SELECT entity_id
FROM entity_ratings
WHERE report_month IN (SELECT max(report_month) latest_month
FROM entity_ratings))
AND report_month >= ?
AND report_month <= ?
GROUP BY report_month
ORDER BY report_month |
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5599
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for heroku_03210ecefca4075
CREATE DATABASE IF NOT EXISTS `heroku_03210ecefca4075` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `heroku_03210ecefca4075`;
-- Dumping structure for table heroku_03210ecefca4075.failed_jobs
CREATE TABLE IF NOT EXISTS `failed_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Dumping data for table heroku_03210ecefca4075.failed_jobs: ~0 rows (approximately)
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
-- Dumping structure for table heroku_03210ecefca4075.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Dumping data for table heroku_03210ecefca4075.migrations: ~3 rows (approximately)
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
REPLACE INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
-- Dumping structure for table heroku_03210ecefca4075.password_resets
CREATE TABLE IF NOT EXISTS `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Dumping data for table heroku_03210ecefca4075.password_resets: ~0 rows (approximately)
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
-- Dumping structure for table heroku_03210ecefca4075.users
CREATE TABLE IF NOT EXISTS `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Dumping data for table heroku_03210ecefca4075.users: ~0 rows (approximately)
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
REPLACE INTO `users` (`id`, `name`, `email`, `password`, `created_at`, `updated_at`) VALUES
(1, 'wandy', 'user@email.com', '$2y$10$gx2lhDT3JDmJfOaTbUVBHuGH8ZNgupGXRMnRh8VLqtoTDMzcWEWJu', '2020-12-03 02:52:33', '2020-12-03 02:52:33');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
-- Provide a query that shows the Invoice Total, Customer name, Country and Sale Agent name for all invoices and customers.
SELECT
a.Total as 'InvoiceTotal',
a.CustomerName as 'CustomerName',
a.Country as Country,
b.FirstName||' '||b.LastName as 'SaleAgent'
FROM (SELECT
b.SupportRepId,
b.CustomerId,
b.FirstName||' '||b.LastName as 'CustomerName',
b.Country,
a.InvoiceId,
a.Total
FROM Invoice as a
LEFT JOIN Customer as b ON a.CustomerId = b.CustomerId) as a
LEFT JOIN Employee as b ON a.SupportRepId = b.EmployeeId |
CREATE DATABASE IF NOT EXISTS Travel;
USE Travel;
CREATE TABLE IF NOT EXISTS
ReferenceField (FieldId int AUTO_INCREMENT,
FieldName varchar(50) UNIQUE NOT NULL,
PRIMARY KEY (FieldId));
CREATE TABLE IF NOT EXISTS
ReferenceFieldValue (FieldValueId int AUTO_INCREMENT,
FieldId int NOT NULL,
FieldValueName varchar(50) NOT NULL,
PRIMARY KEY (FieldValueId),
UNIQUE KEY (FieldId, FieldValueName),
FOREIGN KEY (FieldId) REFERENCES ReferenceField(FieldId));
CREATE TABLE IF NOT EXISTS
Flight (FlightId varchar(6),
AirLine int NOT NULL,
PRIMARY KEY (FlightId),
FOREIGN KEY (AirLine) REFERENCES ReferenceFieldValue(FieldValueId));
CREATE TABLE IF NOT EXISTS
Route (RouteId int AUTO_INCREMENT,
FromCity int NOT NULL,
ToCity int NOT NULL,
PRIMARY KEY (RouteId),
FOREIGN KEY (FromCity) REFERENCES ReferenceFieldValue(FieldValueId),
FOREIGN KEY (ToCity) REFERENCES ReferenceFieldValue(FieldValueId));
CREATE TABLE IF NOT EXISTS
Commute (CommuteId int AUTO_INCREMENT,
RouteId int NOT NULL,
FlightId varchar(6) NOT NULL,
DepartureTime datetime NOT NULL,
ArrivalTime datetime NOT NULL,
Price decimal(8,2) NOT NULL,
PRIMARY KEY (CommuteId),
FOREIGN KEY (RouteId) REFERENCES Route(RouteId),
FOREIGN KEY (FlightId) REFERENCES Flight(FlightId));
|
CREATE TABLE IF NOT EXISTS t_comment (
id int(11) NOT NULL AUTO_INCREMENT,
tech_id int(11) DEFAULT NULL COMMENT '技师id',
order_id int(11) DEFAULT NULL COMMENT '订单id',
star int(2) DEFAULT '0' COMMENT '星数(1,2,3,4,5)',
arrive_on_time tinyint(1) DEFAULT FALSE COMMENT '准时到达(1,选择0,未选择)',
complete_on_time tinyint(1) DEFAULT FALSE COMMENT '准时完工',
professional tinyint(1) DEFAULT FALSE COMMENT '技术专业',
dress_neatly tinyint(1) DEFAULT FALSE COMMENT '着装整洁',
car_protect tinyint(1) DEFAULT FALSE COMMENT '车辆保护超级棒',
good_attitude tinyint(1) DEFAULT FALSE COMMENT '好态度',
advice varchar(255) DEFAULT NULL COMMENT '建议',
create_at DATETIME DEFAULT NULL,
PRIMARY KEY (id)
)DEFAULT CHARSET=utf8 COMMENT='评论表'; |
SELECT title, summary FROM
(SELECT title, summary, duration FROM film WHERE title LIKE '%42%' OR summary LIKE '%42%' ORDER BY duration) AS T; |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 13-Out-2018 às 20:44
-- Versão do servidor: 10.1.35-MariaDB
-- versão do PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `credit2eat`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `cliente`
--
DROP TABLE IF EXISTS `cliente`;
CREATE TABLE `cliente` (
`cli_id` int(10) NOT NULL,
`cli_nome` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`cli_matricula` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`cli_email` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`cli_telefone` int(11) DEFAULT NULL,
`cli_senha` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`cli_divida` float DEFAULT '0',
`id_usuario` int(11) DEFAULT NULL,
`id_divida` int(11) DEFAULT NULL,
`valido` tinyint(1) NOT NULL,
`cli_curso` varchar(60) NOT NULL,
`imagem` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `cliente`
--
INSERT INTO `cliente` (`cli_id`, `cli_nome`, `cli_matricula`, `cli_email`, `cli_telefone`, `cli_senha`, `cli_divida`, `id_usuario`, `id_divida`, `valido`, `cli_curso`, `imagem`) VALUES
(12, 'Venda à Vista', '666', '', 0, '', 0, NULL, NULL, 1, '0', ''),
(22, 'Lucas Sombra Almeida', '02060148', 'precutshadow@gmail.com', NULL, '$2y$10$pSzN2CL7AKN4dhl/6DHlG.FhPp1MynIeAxmGqPnO7N76emd6ioPRi', 0, 25, NULL, 1, 'Técnico em Informática', ''),
(23, 'Guilherme Bragagnollo Teixeira', '02060156', 'guilherme.b.tei@gmail.com', NULL, '$2y$10$xmxDBbwT8cO7Ny5mfAFQVeeovkYthhNxQ7wLn8LZw0dH/CZ83/zqe', 5.25, 25, NULL, 1, 'Técnico em Informática', ''),
(24, 'Brenda Anghinoni Barbosa', '02060129', 'brendaab.2010@gmail.com', NULL, '$2y$10$LrlhzY56XYdjZb35TQRUFuFrhXrq4qAzJQOduY/CSzmkLgOQcNMC6', 5.25, 25, NULL, 1, 'Técnico em Informática', ''),
(25, 'Augusto Falcão Flach', '02060128', 'augustofalcaoflach@gmail.com', NULL, '$2y$10$nSKego2WsY9rEo.XpgAqWewIioZPlegBCO3pbmIX2kZL1bIkI8kIy', 5.25, 25, NULL, 1, 'Técnico em Informática', ''),
(26, 'Alex Júnior Padilha Pereira', '02060126', 'alex.jpp10@gmail.com', NULL, '$2y$10$LDw7JjrdNfGqsum9qYEci.WIFoFJClKsFXVQp7nwOpc9mQ.Hr/wnu', 3.75, 25, NULL, 1, 'Técnico em Informática', ''),
(27, 'Sandro José Ribeiro da Silva', 'sandro.silva', 'sandro.silva@canoas.ifrs.edu.br', NULL, '$2y$10$jPDNDWtcKY15aGkEXhpBUOeIDvysDgGHaWFR8el9npfUeIleInBdG', 0, 25, NULL, 1, '', ''),
(80, 'Bruno de Sousa Much', '02150001', 'muchsousa@hotmail.com', NULL, '$2y$10$cjGqCWjbnYUhu32/5Ht.NO43KdUEXMDqs2DWiUgg/04bfnS2Ro2Y2', 5.25, 25, NULL, 1, 'Técnico em Desenvolvimento de Sistemas', '');
-- --------------------------------------------------------
--
-- Estrutura da tabela `estoque`
--
DROP TABLE IF EXISTS `estoque`;
CREATE TABLE `estoque` (
`id` int(11) NOT NULL,
`produto` int(11) NOT NULL,
`data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`qntd` int(11) NOT NULL,
`id_usuario` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Extraindo dados da tabela `estoque`
--
INSERT INTO `estoque` (`id`, `produto`, `data`, `qntd`, `id_usuario`) VALUES
(18, 7, '2018-10-10 14:23:22', 22, 25),
(19, 7, '2018-10-10 14:23:26', 2, 25),
(20, 12, '2018-10-10 14:23:28', 3, 25),
(21, 12, '2018-10-10 14:23:30', 1, 25),
(22, 7, '2018-10-10 14:23:33', 5, 25),
(23, 9, '2018-10-10 14:23:35', 2, 25),
(24, 9, '2018-10-10 14:23:37', 2, 25),
(25, 11, '2018-10-10 14:23:39', 2, 25),
(26, 13, '2018-10-10 14:23:41', 10, 25),
(27, 12, '2018-10-10 14:23:43', 3, 25),
(28, 8, '2018-10-10 14:28:26', 1, 25);
-- --------------------------------------------------------
--
-- Estrutura da tabela `notificacoes`
--
DROP TABLE IF EXISTS `notificacoes`;
CREATE TABLE `notificacoes` (
`id` int(11) NOT NULL,
`titulo` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`visto` tinyint(1) NOT NULL,
`id_usuario` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Extraindo dados da tabela `notificacoes`
--
INSERT INTO `notificacoes` (`id`, `titulo`, `data`, `visto`, `id_usuario`) VALUES
(13, 'O produto Croissant de Frango possui poucas unidades! (VISTO)', '2018-10-13 17:22:23', 1, 25),
(14, 'O produto Croissant de Frango possui poucas unidades! (VISTO)', '2018-10-13 17:35:40', 1, 25),
(15, 'O produto Negrinho possui poucas unidades! (VISTO)', '2018-10-13 18:42:36', 1, 25),
(16, 'O produto Negrinho possui poucas unidades! (VISTO)', '2018-10-13 17:35:47', 1, 25),
(18, 'O produto Croissant de Frango possui poucas unidades!(VISTO)', '2018-10-13 17:33:57', 1, 25),
(19, 'O produto Negrinho possui poucas unidades! (VISTO)', '2018-10-13 17:35:28', 1, 25),
(20, 'O produto Croissant de Frango possui poucas unidades!(VISTO)', '2018-10-13 17:35:16', 1, 25),
(21, 'O produto Croissant de Frango possui poucas unidades!', '2018-10-13 18:21:03', 0, 25);
-- --------------------------------------------------------
--
-- Estrutura da tabela `produtos`
--
DROP TABLE IF EXISTS `produtos`;
CREATE TABLE `produtos` (
`prod_id` int(11) NOT NULL,
`prod_nome` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`prod_valor` float(5,2) DEFAULT NULL,
`prod_qnt_min` float DEFAULT NULL,
`prod_qnt` float DEFAULT NULL,
`prod_qnt_ven` int(11) DEFAULT '0',
`prod_slug` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`usuario_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `produtos`
--
INSERT INTO `produtos` (`prod_id`, `prod_nome`, `prod_valor`, `prod_qnt_min`, `prod_qnt`, `prod_qnt_ven`, `prod_slug`, `usuario_id`) VALUES
(6, 'Pizza', 5.00, 10, 111, 6, NULL, 25),
(7, 'Enroladinho', 3.50, 15, 30, 11, NULL, 25),
(8, 'Folhado de Frango', 5.00, 20, 41, 9, NULL, 25),
(9, 'Pastel de Carne', 4.50, 12, 18, 5, NULL, 25),
(10, 'Refrigerante 2L', 8.00, 12, 32, 2, NULL, 25),
(11, 'Chocolate', 5.00, 10, 48, 10, NULL, 25),
(12, 'Croissant de Frango', 5.00, 12, -2, 18, NULL, 25),
(13, 'Negrinho', 3.00, 10, -14, 23, NULL, 25),
(14, 'Diversos', NULL, 0, 0, 11, NULL, 25);
-- --------------------------------------------------------
--
-- Estrutura da tabela `usuario`
--
DROP TABLE IF EXISTS `usuario`;
CREATE TABLE `usuario` (
`id` int(11) NOT NULL,
`nome` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`senha` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `usuario`
--
INSERT INTO `usuario` (`id`, `nome`, `email`, `senha`) VALUES
(25, 'admin', 'admin@admin.com', '$2y$10$ZunbSr7qmQEjGIKwdGq.veIsuH8i.1oEieal7NYJMfboXSUbeHDBy');
-- --------------------------------------------------------
--
-- Estrutura da tabela `valor_prazo`
--
DROP TABLE IF EXISTS `valor_prazo`;
CREATE TABLE `valor_prazo` (
`id` int(11) NOT NULL,
`valor_prazo` float NOT NULL,
`id_usuario` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Extraindo dados da tabela `valor_prazo`
--
INSERT INTO `valor_prazo` (`id`, `valor_prazo`, `id_usuario`) VALUES
(1, 0.25, 25);
-- --------------------------------------------------------
--
-- Estrutura da tabela `venda`
--
DROP TABLE IF EXISTS `venda`;
CREATE TABLE `venda` (
`id_venda` int(10) NOT NULL,
`valor_venda` float NOT NULL,
`id_cliente` int(10) DEFAULT NULL,
`data_venda` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`id_user` int(11) NOT NULL,
`a_prazo` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `venda`
--
INSERT INTO `venda` (`id_venda`, `valor_venda`, `id_cliente`, `data_venda`, `id_user`, `a_prazo`) VALUES
(115, 0, 22, '2018-10-09 20:10:33', 25, NULL),
(116, 0, 23, '2018-10-09 22:31:07', 25, NULL),
(117, 0, 23, '2018-10-10 00:30:01', 25, NULL),
(118, 0, 23, '2018-10-10 00:52:12', 25, NULL),
(119, 0, 23, '2018-10-10 00:53:09', 25, NULL),
(120, 0, 23, '2018-10-10 00:54:22', 25, NULL),
(121, 0, 23, '2018-10-10 14:34:48', 25, NULL),
(122, 0, 24, '2018-10-10 18:22:12', 25, NULL),
(123, 0, 25, '2018-10-10 19:28:40', 25, NULL),
(124, 0, 26, '2018-10-10 20:02:11', 25, NULL),
(125, 0, 80, '2018-10-10 21:44:29', 25, NULL),
(126, 0, 12, '2018-10-11 13:19:51', 25, NULL),
(127, 0, 12, '2018-10-11 13:22:07', 25, NULL),
(128, 0, 23, '2018-10-11 13:22:43', 25, NULL),
(129, 0, 12, '2018-10-11 13:22:44', 25, NULL),
(130, 0, 12, '2018-10-11 13:26:19', 25, NULL),
(131, 0, 23, '2018-10-11 13:26:40', 25, NULL),
(132, 0, 12, '2018-10-11 13:26:40', 25, NULL),
(133, 0, 23, '2018-10-11 13:27:18', 25, NULL),
(134, 0, 12, '2018-10-11 13:29:34', 25, NULL),
(135, 0, 23, '2018-10-11 13:29:48', 25, NULL),
(136, 0, 12, '2018-10-11 13:34:44', 25, NULL),
(137, 0, 23, '2018-10-11 13:36:24', 25, NULL),
(138, 0, 23, '2018-10-12 15:19:27', 25, NULL),
(139, 0, 23, '2018-10-12 15:21:57', 25, NULL),
(140, 0, 23, '2018-10-12 15:22:23', 25, NULL),
(141, 0, 23, '2018-10-12 20:05:12', 25, NULL),
(142, 0, 23, '2018-10-12 20:06:05', 25, NULL),
(143, 0, 23, '2018-10-12 20:07:24', 25, NULL),
(144, 0, 23, '2018-10-12 20:08:30', 25, NULL),
(145, 0, 23, '2018-10-12 20:23:39', 25, NULL),
(146, 0, 23, '2018-10-12 20:24:35', 25, NULL),
(147, 0, 23, '2018-10-13 14:44:07', 25, NULL),
(148, 0, 23, '2018-10-13 14:49:16', 25, NULL),
(149, 0, 23, '2018-10-13 14:50:31', 25, NULL),
(150, 0, 23, '2018-10-13 18:21:03', 25, NULL),
(151, 0, 12, '2018-10-13 18:21:39', 25, NULL);
-- --------------------------------------------------------
--
-- Estrutura da tabela `venda_produto`
--
DROP TABLE IF EXISTS `venda_produto`;
CREATE TABLE `venda_produto` (
`venda_id` int(11) NOT NULL,
`produto_id` int(11) NOT NULL,
`pendente` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `venda_produto`
--
INSERT INTO `venda_produto` (`venda_id`, `produto_id`, `pendente`) VALUES
(115, 8, 0),
(115, 8, 0),
(116, 12, 0),
(117, 11, 0),
(118, 9, 0),
(118, 7, 0),
(119, 12, 0),
(120, 13, 0),
(121, 13, 0),
(122, 12, 1),
(123, 11, 1),
(124, 7, 1),
(125, 8, 1),
(127, 13, NULL),
(128, 7, 0),
(129, 7, NULL),
(130, 7, NULL),
(131, 7, 0),
(132, 7, NULL),
(133, 8, 0),
(134, 7, NULL),
(135, 12, 0),
(136, 12, NULL),
(137, 13, 0),
(138, 14, 0),
(138, 14, 0),
(139, 14, 0),
(140, 11, 0),
(141, 14, 0),
(142, 8, 0),
(143, 12, 0),
(143, 14, 0),
(144, 11, 0),
(144, 14, 0),
(145, 14, 0),
(146, 14, 0),
(147, 14, 0),
(148, 14, 0),
(149, 14, 0),
(150, 12, 1),
(151, 12, NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cliente`
--
ALTER TABLE `cliente`
ADD PRIMARY KEY (`cli_id`),
ADD UNIQUE KEY `cli_matricula` (`cli_matricula`),
ADD KEY `id_divida` (`id_divida`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Indexes for table `estoque`
--
ALTER TABLE `estoque`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `notificacoes`
--
ALTER TABLE `notificacoes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `produtos`
--
ALTER TABLE `produtos`
ADD PRIMARY KEY (`prod_id`),
ADD KEY `usuario_id` (`usuario_id`);
--
-- Indexes for table `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `venda`
--
ALTER TABLE `venda`
ADD PRIMARY KEY (`id_venda`),
ADD KEY `id_cliente` (`id_cliente`);
--
-- Indexes for table `venda_produto`
--
ALTER TABLE `venda_produto`
ADD KEY `venda_id` (`venda_id`),
ADD KEY `produto_id` (`produto_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cliente`
--
ALTER TABLE `cliente`
MODIFY `cli_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=81;
--
-- AUTO_INCREMENT for table `estoque`
--
ALTER TABLE `estoque`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `notificacoes`
--
ALTER TABLE `notificacoes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `produtos`
--
ALTER TABLE `produtos`
MODIFY `prod_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `usuario`
--
ALTER TABLE `usuario`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `venda`
--
ALTER TABLE `venda`
MODIFY `id_venda` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=152;
--
-- Constraints for dumped tables
--
--
-- Limitadores para a tabela `cliente`
--
ALTER TABLE `cliente`
ADD CONSTRAINT `id_divida` FOREIGN KEY (`id_divida`) REFERENCES `divida` (`id_divida`),
ADD CONSTRAINT `id_usuario` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id`);
--
-- Limitadores para a tabela `produtos`
--
ALTER TABLE `produtos`
ADD CONSTRAINT `usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `usuario` (`id`);
--
-- Limitadores para a tabela `venda`
--
ALTER TABLE `venda`
ADD CONSTRAINT `id_cliente` FOREIGN KEY (`id_cliente`) REFERENCES `cliente` (`cli_id`);
--
-- Limitadores para a tabela `venda_produto`
--
ALTER TABLE `venda_produto`
ADD CONSTRAINT `produto_id` FOREIGN KEY (`produto_id`) REFERENCES `produtos` (`prod_id`),
ADD CONSTRAINT `venda_id` FOREIGN KEY (`venda_id`) REFERENCES `venda` (`id_venda`);
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 kirja (
id SERIAL NOT NULL UNIQUE,
lukuvinkki_id INTEGER NOT NULL,
nimi VARCHAR(30),
PRIMARY KEY (id),
FOREIGN KEY (lukuvinkki_id) REFERENCES lukuvinkki(id)
);
|
drop table phonebook;
create table phonebook(name varchar2(30) primary key, phone varchar2(20), address varchar2(250));
INSERT INTO phonebook values('김경호','256-9547','서울 송파구');
INSERT INTO phonebook values('구은미','567-4578','서울 서초구');
INSERT INTO phonebook values('김은희','897-5687','서울 강남구');
INSERT INTO phonebook values('김미정','256-9547','서울 강남구');
INSERT INTO phonebook values('신명숙','567-4578','충북 보은군');
INSERT INTO phonebook values('최경녀','897-5687','충남 서산시');
commit;
desc phonebook;
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8850
-- Generation Time: Jul 28, 2020 at 12:54 PM
-- Server version: 5.7.23
-- PHP Version: 7.2.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: `login`
--
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`) VALUES
(1, 'admin@admin.com', 'admin'),
(2, 'test@test.com', 'test');
/*!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 OR REPLACE VIEW PP_Order_Node_v
AS
SELECT
onode.AD_Client_ID, onode.AD_Org_ID, onode.IsActive, onode.Created, onode.CreatedBy, onode.Updated, onode.UpdatedBy,
cast('en_US' as varchar2(6)) AS AD_Language,
name, c_bpartner_id, cost, datefinish, datefinishschedule, datestart, datestartschedule ,
description, docaction, docstatus,duration, durationreal, durationrequired, help, ismilestone,
issubcontracting, movingtime, overlapunits,
pp_order_id, pp_order_workflow_id, onode.pp_order_node_id,priority, qtydelivered, qtyrequired ,
qtyscrap , queuingtime , s_resource_id , setuptime ,setuptimereal, unitscycles , validfrom , validto , value , waitingtime , workingtime , yield
FROM PP_Order_Node onode; |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 18, 2019 at 11:29 AM
-- Server version: 5.7.27-0ubuntu0.18.04.1
-- PHP Version: 7.3.9-1+ubuntu18.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `konekthing`
--
-- --------------------------------------------------------
--
-- Table structure for table `kelas`
--
CREATE TABLE `kelas` (
`kelas_id` int(11) NOT NULL,
`kelas_nama` varchar(40) NOT NULL,
`kelas_wali` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kelas`
--
INSERT INTO `kelas` (`kelas_id`, `kelas_nama`, `kelas_wali`) VALUES
(1, 'kelas 10', 'buk retno'),
(2, 'kelas 11', 'buk ervita');
-- --------------------------------------------------------
--
-- Table structure for table `siswa`
--
CREATE TABLE `siswa` (
`siswa_id` int(11) NOT NULL,
`siswa_nama` varchar(40) NOT NULL,
`siswa_alamat` text NOT NULL,
`siswa_tgl_lahir` date NOT NULL,
`siswa_kelas` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `siswa`
--
INSERT INTO `siswa` (`siswa_id`, `siswa_nama`, `siswa_alamat`, `siswa_tgl_lahir`, `siswa_kelas`) VALUES
(8, 'hello weor', 'jl.jati gaung no 1', '2019-09-01', 1),
(9, 'muhammad risano akbar', 'jl.jati bla bla', '2019-09-16', 1),
(10, 'beni', 'susanto', '2019-09-03', 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `kelas`
--
ALTER TABLE `kelas`
ADD PRIMARY KEY (`kelas_id`);
--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
ADD PRIMARY KEY (`siswa_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `kelas`
--
ALTER TABLE `kelas`
MODIFY `kelas_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `siswa`
--
ALTER TABLE `siswa`
MODIFY `siswa_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
/*!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 user (id BIGINT PRIMARY KEY,name varchar(1000),image_url varchar(800)); |
-- Notes on paths:
-- WEB tools should use the release port.
-- NATIVE tools should have an absolute path
INSERT INTO workbench_tool (name, title, version, tool_type, path,parameter,user_tool) VALUES
('germplasm_browser', 'Browse Germplasm Information', '1.1.2.6', 'WEB', 'http://localhost:18080/GermplasmStudyBrowser/main/germplasm/','',0)
,('study_browser', 'Browse Studies and Datasets', '1.1.2.6', 'WEB', 'http://localhost:18080/GermplasmStudyBrowser/main/study/','',0)
,('germplasm_list_browser', 'Browse Germplasm Lists', '1.1.2.6', 'WEB', 'http://localhost:18080/GermplasmStudyBrowser/main/germplasmlist/','',0)
,('list_manager', 'List Manager', '1.1.1.0', 'WEB', 'http://localhost:18080/BreedingManager/main/germplasm-import/','',0)
,('crossing_manager','Crossing Manager','1.1.1.0','WEB','http://localhost:18080/BreedingManager/main/crosses/','',0)
,('nursery_template_wizard','Nursery Template Wizard','1.1.1.0','WEB','http://localhost:18080/BreedingManager/main/nursery-template/','',0)
,('gdms', 'GDMS', '1.0', 'WEB_WITH_LOGIN', 'http://localhost:18080/GDMS/login.do','',0)
,('fieldbook', 'FieldBook', '3.0.0 Beta 41', 'NATIVE', 'tools/fieldbook/IBFb/bin/ibfb.exe','',0)
,('optimas', 'OptiMAS', '1.4', 'NATIVE', 'tools/optimas/optimas_gui.exe','',0)
,('breeding_manager', 'Breeding Manager', '3.0.0 Beta 41', 'NATIVE', 'tools/fieldbook/IBFb/bin/ibfb.exe','--ibpApplication=BreedingManager',0)
,('breeding_view', 'Breeding View', '1.1.0.9221', 'NATIVE', 'tools/breeding_view/Bin/BreedingView.exe','',0)
,('mbdt','MBDT','1.0.0','NATIVE','tools/mbdt/MBDTversion1.0.0.exe','',0)
,('breeding_planner','Breeding Planner','1.0 April 2013 Release','NATIVE','tools/Breeding Planner/Breeding Planner.exe','',0)
,('germplasm_import','Fieldbook Germplasm Import','4.0.0','NATIVE','tools/fieldbook/IBFb/bin/ibfb.exe','--ibpApplication=GermplasmImport',0)
; |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// clang-format off
EXPECT_EQ(
zero,
toDouble(toImmutableRef(
digit(0x00))));
// Mantissa is 52 ones.
EXPECT_EQ(
makeDouble(positive, exp(52), mantissa(0x000fffffffffffffull)),
toDouble(toImmutableRef(
digit(0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff))));
// Largest positive number that fits a double without precision loss.
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// Smallest negative number that fits a double without precision loss.
EXPECT_EQ(
makeDouble(negative, exp(53), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x0000000000000001ull)),
toDouble(toImmutableRef(
digit(0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02))));
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x0000000000000002ull)),
toDouble(toImmutableRef(
digit(0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000000ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000001ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000001ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000001ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000002ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06))));
EXPECT_EQ(
makeDouble(positive, exp(54), mantissa(0x0000000000000002ull)),
toDouble(toImmutableRef(
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07))));
/********************************************************************
*
* The following tests have a 53-bit mantissa that fits the double
* precisely, and they have trailing zeros. No rounding should occur given
* that the most significant bit not in the mantissa is always 0.
*
********************************************************************/
EXPECT_EQ(
makeDouble(positive, exp(52), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a))));
EXPECT_EQ(
makeDouble(negative, exp(52), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa6))));
EXPECT_EQ(
makeDouble(positive, exp(52), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5b))));
EXPECT_EQ(
makeDouble(negative, exp(52), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5))));
EXPECT_EQ(
makeDouble(positive, exp(55), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd0))));
EXPECT_EQ(
makeDouble(negative, exp(55), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x30))));
EXPECT_EQ(
makeDouble(positive, exp(55), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd8))));
EXPECT_EQ(
makeDouble(negative, exp(55), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x28))));
EXPECT_EQ(
makeDouble(positive, exp(58), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x80))));
EXPECT_EQ(
makeDouble(negative, exp(58), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x80))));
EXPECT_EQ(
makeDouble(positive, exp(58), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0xc0))));
EXPECT_EQ(
makeDouble(negative, exp(58), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x40))));
EXPECT_EQ(
makeDouble(positive, exp(61), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(61), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4c, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(61), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb6, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(61), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4a, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(64), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa0, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(64), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x60, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(64), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xb0, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(64), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x50, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(67), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x0d) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(67), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf2) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd3, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(67), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x0d) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x80, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(67), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf2) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0x80, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(70), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x69) +
digit(0x69, 0x69, 0x69, 0x69, 0x69, 0x68, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(70), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x96) +
digit(0x96, 0x96, 0x96, 0x96, 0x96, 0x98, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(70), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x69) +
digit(0x69, 0x69, 0x69, 0x69, 0x69, 0x6c, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(70), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x96) +
digit(0x96, 0x96, 0x96, 0x96, 0x96, 0x94, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(73), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b) +
digit(0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x40, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(73), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4) +
digit(0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xc0, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(73), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b) +
digit(0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x60, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(73), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4) +
digit(0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xa0, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(76), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(76), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5) +
digit(0xa5, 0xa5, 0xa5, 0xa5, 0xa6, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(76), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5b, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(76), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5) +
digit(0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(79), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd0, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(79), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x30, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(79), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd8, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(79), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x28, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(82), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96) +
digit(0x96, 0x96, 0x96, 0x96, 0x80, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(82), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69) +
digit(0x69, 0x69, 0x69, 0x69, 0x80, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(82), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96) +
digit(0x96, 0x96, 0x96, 0x96, 0xc0, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(82), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69) +
digit(0x69, 0x69, 0x69, 0x69, 0x40, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(85), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4) +
digit(0xb4, 0xb4, 0xb4, 0xb4, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(85), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b) +
digit(0x4b, 0x4b, 0x4b, 0x4c, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(85), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4) +
digit(0xb4, 0xb4, 0xb4, 0xb6, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(85), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b) +
digit(0x4b, 0x4b, 0x4b, 0x4a, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(88), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x01, 0xa5, 0xa5, 0xa5) +
digit(0xa5, 0xa5, 0xa5, 0xa0, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(88), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfe, 0x5a, 0x5a, 0x5a) +
digit(0x5a, 0x5a, 0x5a, 0x60, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(88), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x01, 0xa5, 0xa5, 0xa5) +
digit(0xa5, 0xa5, 0xa5, 0xb0, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(88), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfe, 0x5a, 0x5a, 0x5a) +
digit(0x5a, 0x5a, 0x5a, 0x50, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(91), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d) +
digit(0x2d, 0x2d, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(91), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2) +
digit(0xd2, 0xd2, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(91), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d) +
digit(0x2d, 0x2d, 0x2d, 0x80, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(91), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2) +
digit(0xd2, 0xd2, 0xd2, 0x80, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(97), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b, 0x4b, 0x4b, 0x4b) +
digit(0x4b, 0x4b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(97), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4, 0xb4, 0xb4, 0xb4) +
digit(0xb4, 0xb4, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(97), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b, 0x4b, 0x4b, 0x4b) +
digit(0x4b, 0x4b, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(97), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4, 0xb4, 0xb4, 0xb4) +
digit(0xb4, 0xb4, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(100), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a) +
digit(0x5a, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(100), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5) +
digit(0xa5, 0xa6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(100), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a) +
digit(0x5a, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(100), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5) +
digit(0xa5, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(103), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0xd2, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(103), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x2d, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(103), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x00, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0xd2, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(103), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xff, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x2d, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(106), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(106), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(106), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x06, 0x96, 0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(106), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf9, 0x69, 0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(109), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4) +
digit(0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(109), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b) +
digit(0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(109), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4) +
digit(0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(109), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b) +
digit(0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(112), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x01, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5) +
digit(0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(112), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfe, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a) +
digit(0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(112), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x01, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5) +
digit(0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(112), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfe, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a) +
digit(0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(115), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(115), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd3) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(115), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(115), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(118), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x68) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(118), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x98) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(118), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69, 0x69, 0x69, 0x6c) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(118), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x94) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(121), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x40) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(121), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xc0) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(121), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x03, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x60) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(121), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfc, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xa0) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(124), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(124), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa6, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(124), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x1a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5b, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(124), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xe5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(127), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x00) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd0, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(127), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xff) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x30, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(positive, exp(127), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x00) +
digit(0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd8, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(127), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xff) +
digit(0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x28, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
/********************************************************************
*
* The following tests have 54-bits. The 2 lowest significant bits are
* modified to exercise different types of rounding.
*
********************************************************************/
// L=0, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb5))));
EXPECT_EQ(
makeDouble(negative, exp(53), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b))));
// L=0, M=1 -> round if d != 0
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb6))));
EXPECT_EQ(
makeDouble(negative, exp(53), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x4a))));
// L=1, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb7))));
EXPECT_EQ(
makeDouble(negative, exp(53), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x49))));
// L=1, M=1 -> always round
EXPECT_EQ(
makeDouble(positive, exp(53), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x34, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb8))));
EXPECT_EQ(
makeDouble(negative, exp(53), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0xcb, 0x4b, 0x4b, 0x4b, 0x4b, 0x4b, 0x48))));
// L=0, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x68, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x97, 0xff, 0xff, 0xff, 0xff, 0xff))));
// L=0, M=1 -> round if d != 0
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x95, 0xff, 0xff, 0xff, 0xff, 0xff))));
// L=1, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x93, 0xff, 0xff, 0xff, 0xff, 0xff))));
// L=1, M=1 -> always round
EXPECT_EQ(
makeDouble(positive, exp(94), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x69, 0x69, 0x69, 0x69) +
digit(0x69, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x01))));
EXPECT_EQ(
makeDouble(negative, exp(94), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x96, 0x96, 0x96, 0x96) +
digit(0x96, 0x96, 0x91, 0xff, 0xff, 0xff, 0xff, 0xff))));
// L=0, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(128), mantissa(0x000a5a5a5a5a625aull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xa5, 0xa5, 0xa5, 0xa5, 0xa6, 0x25, 0xa0, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(128), mantissa(0x000a5a5a5a5c5a5aull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x3a, 0x5a, 0x60, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=0, M=1 -> round if d != 0
EXPECT_EQ(
makeDouble(positive, exp(128), mantissa(0x000a5a5a625a5a5aull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xa5, 0xa5, 0xa6, 0x25, 0xa5, 0xa5, 0xa8, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(128), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x56, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=1, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(128), mantissa(0x000a5ada5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xa5, 0xad, 0xa5, 0xa5, 0xa5, 0xa5, 0xb0, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(128), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x4f, 0x80) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=1, M=1 -> always round
EXPECT_EQ(
makeDouble(positive, exp(128), mantissa(0x000ada5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x01) +
digit(0xad, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xb8, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(128), mantissa(0x000a5a5a5c5a5a5cull)),
toDouble(toImmutableRef(
digit(0xfe) +
digit(0x5a, 0x5a, 0x5a, 0x3a, 0x5a, 0x5a, 0x48, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=0, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(627), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(627), mantissa(0x000a5a5a5a5a5a5aull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=0, M=1 -> round if d != 0
EXPECT_EQ(
makeDouble(positive, exp(627), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(627), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=1, M=0 -> never round
EXPECT_EQ(
makeDouble(positive, exp(627), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(627), mantissa(0x000a5a5a5a5a5a5bull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// L=1, M=1 -> always round
EXPECT_EQ(
makeDouble(positive, exp(627), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0x0d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d) +
digit(0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
makeDouble(negative, exp(627), mantissa(0x000a5a5a5a5a5a5cull)),
toDouble(toImmutableRef(
digit(0xf2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2) +
digit(0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff) +
digit(0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// Infinity -- 1 ** 1024 is too large to fit a double.
EXPECT_EQ(
infinity,
toDouble(toImmutableRef(
digit(0x01) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
EXPECT_EQ(
neg_infinity,
toDouble(toImmutableRef(
digit(0xff) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// Not infinity, but almost
EXPECT_EQ(
makeDouble(positive, exp(1023), mantissa(0x000fffffffffffffull)),
toDouble(toImmutableRef(
digit(0x00) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// This is the "first" "infinite" bigint
EXPECT_EQ(
infinity,
toDouble(toImmutableRef(
digit(0x00) +
digit(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// Not -infinity, but almost
EXPECT_EQ(
makeDouble(negative, exp(1023), mantissa(0x000fffffffffffffull)),
toDouble(toImmutableRef(
digit(0xff) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
// This is the "first" "-infinite" bigint
EXPECT_EQ(
neg_infinity,
toDouble(toImmutableRef(
digit(0xff) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) +
digit(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))));
|
/*
SOURCES TO THE SAME DB IN MULTIPLE BUSINESS UNITS
In an ETL segmented by business units, it's crucial to understand if common sources are being used across business units.
Those are the "COMMON" objects referenced elsewhere in this repo.
Informatica PC 9.6
*/
SELECT
COUNT(B.SUBJ_NAME)
, C.DBDNAM
, D.DBTYPE_NAME
, A.SOURCE_NAME AS TABLE_NAME --this is your
, A.FILE_NAME SCHEMA_NAME
FROM
PC_REPO.OPB_SRC A
, PC_REPO.OPB_SUBJECT B
, PC_REPO.OPB_DBD C
, PC_REPO.OPB_MMD_DBTYPE D
WHERE A.SUBJ_ID = B.SUBJ_ID
AND A.DBDID = C.DBDID
AND C.DBTYPE = D.DBTYPE_ID
--and B.SUBJ_NAME NOT LIKE 'WRK%'
--AND A.SOURCE_NAME IN() --YOUR SOURCE NAME HERE for ad-hoc queries
GROUP BY A.SOURCE_NAME, C.DBDNAM,A.FILE_NAME
having count(b.subj_name)>1
ORDER BY 1 desc,2,3,4;
-- this will uncover the source IDs
select count(distinct m.SOURCE_NAME || m.SOURCE_ID)
, m.SOURCE_NAME
FROM PC_REPO.REP_SRC_MAPPING m
WHERE SUBJECT_AREA NOT LIKE 'WRK%'
AND m.source_name <> 'DUAL'
GROUP BY m.source_name
ORDER BY 1 DESC, 2
|
-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: blogwind
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `articles`
--
DROP TABLE IF EXISTS `articles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `articles` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`blogger` int(11) NOT NULL,
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
`ref` int(11) NOT NULL DEFAULT '0',
`add_date` datetime(6) DEFAULT NULL,
`cate` int(11) DEFAULT NULL,
`Comment` int(11) NOT NULL DEFAULT '0',
`Recommend` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`index`),
KEY `IX_Articles` (`add_date`),
KEY `IX_Articles_1` (`blogger`),
KEY `IX_Articles_2` (`cate`)
) ENGINE=InnoDB AUTO_INCREMENT=113427 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `blogger`
--
DROP TABLE IF EXISTS `blogger`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blogger` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`nick` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`DOB` datetime NOT NULL,
`blogname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`blogskin` int(11) NOT NULL,
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`visitor` int(11) NOT NULL DEFAULT '0',
`intro` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`blogs` int(11) NOT NULL DEFAULT '0',
`IP` char(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`TS` tinyint(1) NOT NULL DEFAULT '0',
`Last_log` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Last_post` datetime DEFAULT NULL,
`Activate` tinyint(1) NOT NULL DEFAULT '0',
`Reveal` tinyint(1) NOT NULL DEFAULT '1',
`userpic` int(11) NOT NULL DEFAULT '20',
`lang` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'zh_cn',
`widget` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`index`)
) ENGINE=InnoDB AUTO_INCREMENT=5657 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`blogger` int(11) DEFAULT NULL COMMENT 'this comment is for which blogger',
`article` int(11) NOT NULL,
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'this commend is to which article',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`author` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`homepage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`add_date` datetime(6) NOT NULL,
`ip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utype` tinyint(3) unsigned NOT NULL DEFAULT '0',
`uid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`index`),
KEY `IX_Comment` (`article`),
KEY `IX_Comment_1` (`blogger`)
) ENGINE=InnoDB AUTO_INCREMENT=256280 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `links`
--
DROP TABLE IF EXISTS `links`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `links` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`blogger` int(11) NOT NULL,
`link` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`URL` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`reveal` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11065 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userdefinecategory`
--
DROP TABLE IF EXISTS `userdefinecategory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userdefinecategory` (
`index` int(11) NOT NULL AUTO_INCREMENT,
`blogger` int(11) NOT NULL,
`cate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`files` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`index`)
) ENGINE=InnoDB AUTO_INCREMENT=10757 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-03-23 21:12:11
|
----创建经济科目分类、经济科目代码视图
create or replace view v_jscs003_all as
select distinct a.yzde601||'-'|| b.jsde702 jsde700 ,b.jsde701, a.de011,a.de022,b.jsde901,b.jsde017,a.yzde601,b.jsde702,a.yzde603
from jscs003_yz a,jscs003 b,jscs003_yzjj c
where b.jsde017 = 1 and a.de011 = c.de011 and a.de022 = c.de022 and b.de011 = c.de011 and b.de022 = c.de022 and a.yzde601 = c.yzde601
and b.jsde702 = c.jsde702
and nvl(a.yzde601 ,'-1') not in('-1','00') and b.jsde702 <> '00'
union
select distinct a.yzde601 ,a.yzde602 jsde701,a.de011 ,a.de022 ,'' as jsde901,0 as jsde017 ,a.yzde601 ,null as jsde702 ,a.yzde603
from jscs003_yz a ;
|
-- MySQL dump 10.11
--
-- Host: localhost Database: torneosplay
-- ------------------------------------------------------
-- Server version 5.0.51b-community-nt-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `torneosplay`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `torneosplay` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `torneosplay`;
--
-- Table structure for table `administrador`
--
DROP TABLE IF EXISTS `administrador`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `administrador` (
`id` int(11) NOT NULL auto_increment,
`usuario` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`nombre` varchar(30) NOT NULL,
`apellidos` varchar(30) NOT NULL,
`avatar` varchar(100) NOT NULL default '/images/avatar/default.png',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `administrador`
--
LOCK TABLES `administrador` WRITE;
/*!40000 ALTER TABLE `administrador` DISABLE KEYS */;
INSERT INTO `administrador` VALUES (1,'paquito','prueba@falso.com','paquito','Francisco','Ramirez','/images/avatar/default.png'),(2,'she','she@prueba.com','she','Samantha','Ruiz','/images/avatar/default.png');
/*!40000 ALTER TABLE `administrador` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan`
--
DROP TABLE IF EXISTS `clan`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan` (
`nombre` varchar(30) NOT NULL,
`descripcion` varchar(400) NOT NULL,
`creador` int(11) NOT NULL,
`avatar` varchar(30) NOT NULL default 'clan/default.png',
`id` int(11) NOT NULL auto_increment,
`ganadas` int(11) NOT NULL default '0',
`perdidas` int(11) NOT NULL default '0',
`empatadas` int(11) NOT NULL default '0',
`etiqueta` varchar(4) NOT NULL,
`solicita` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan`
--
LOCK TABLES `clan` WRITE;
/*!40000 ALTER TABLE `clan` DISABLE KEYS */;
INSERT INTO `clan` VALUES ('(WKYA) We will kick your asses','No temblamos ante nadie',9,'clan/1.png',1,0,0,0,'WKYA',1);
/*!40000 ALTER TABLE `clan` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan_has_juego`
--
DROP TABLE IF EXISTS `clan_has_juego`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan_has_juego` (
`clan_id` int(11) NOT NULL,
`juego_id` int(11) NOT NULL,
PRIMARY KEY (`clan_id`,`juego_id`),
KEY `fk_clan_has_juego_juego1_idx` (`juego_id`),
KEY `fk_clan_has_juego_clan1_idx` (`clan_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan_has_juego`
--
LOCK TABLES `clan_has_juego` WRITE;
/*!40000 ALTER TABLE `clan_has_juego` DISABLE KEYS */;
INSERT INTO `clan_has_juego` VALUES (1,1);
/*!40000 ALTER TABLE `clan_has_juego` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan_has_partida`
--
DROP TABLE IF EXISTS `clan_has_partida`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan_has_partida` (
`clan_id` int(11) NOT NULL,
`partida_id` int(11) NOT NULL,
`posicion` int(11) default NULL,
PRIMARY KEY (`clan_id`,`partida_id`),
KEY `fk_clan_has_partida_partida1_idx` (`partida_id`),
KEY `fk_clan_has_partida_clan1_idx` (`clan_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan_has_partida`
--
LOCK TABLES `clan_has_partida` WRITE;
/*!40000 ALTER TABLE `clan_has_partida` DISABLE KEYS */;
/*!40000 ALTER TABLE `clan_has_partida` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan_has_premio`
--
DROP TABLE IF EXISTS `clan_has_premio`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan_has_premio` (
`clan_id` int(11) NOT NULL,
`premio_id` int(11) NOT NULL,
`fechaentrega` datetime default NULL,
PRIMARY KEY (`clan_id`,`premio_id`),
KEY `fk_clan_has_premio_premio1_idx` (`premio_id`),
KEY `fk_clan_has_premio_clan_idx` (`clan_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan_has_premio`
--
LOCK TABLES `clan_has_premio` WRITE;
/*!40000 ALTER TABLE `clan_has_premio` DISABLE KEYS */;
/*!40000 ALTER TABLE `clan_has_premio` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan_has_torneo`
--
DROP TABLE IF EXISTS `clan_has_torneo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan_has_torneo` (
`clan_id` int(11) NOT NULL,
`torneo_id` int(11) NOT NULL,
`fecha` date default NULL,
`lugar` int(11) default NULL,
`posicion` int(11) default NULL,
PRIMARY KEY (`clan_id`,`torneo_id`),
KEY `fk_clan_has_torneo_torneo1_idx` (`torneo_id`),
KEY `fk_clan_has_torneo_clan1_idx` (`clan_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan_has_torneo`
--
LOCK TABLES `clan_has_torneo` WRITE;
/*!40000 ALTER TABLE `clan_has_torneo` DISABLE KEYS */;
/*!40000 ALTER TABLE `clan_has_torneo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clan_usuario`
--
DROP TABLE IF EXISTS `clan_usuario`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `clan_usuario` (
`antiguedad` date NOT NULL,
`clan_id` int(11) NOT NULL,
`usuario_id` int(11) NOT NULL,
PRIMARY KEY (`clan_id`,`usuario_id`),
KEY `fk_clan_usuario_clan1_idx` (`clan_id`),
KEY `fk_clan_usuario_usuario1_idx` (`usuario_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `clan_usuario`
--
LOCK TABLES `clan_usuario` WRITE;
/*!40000 ALTER TABLE `clan_usuario` DISABLE KEYS */;
INSERT INTO `clan_usuario` VALUES ('2013-02-14',1,9);
/*!40000 ALTER TABLE `clan_usuario` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `juego`
--
DROP TABLE IF EXISTS `juego`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `juego` (
`id` int(11) NOT NULL auto_increment,
`nombre` varchar(30) NOT NULL,
`descripcion` varchar(1000) NOT NULL,
`plataforma` varchar(30) NOT NULL default 'Multiples',
`genero` varchar(30) NOT NULL,
`jugadores` varchar(30) NOT NULL,
`idioma` varchar(30) NOT NULL default 'Varios',
`lanzamiento` varchar(50) NOT NULL,
`imagen1` varchar(100) default NULL,
`imagen2` varchar(100) default NULL,
`imagen3` varchar(100) default NULL,
`idusuario` int(11) NOT NULL,
`validado` tinyint(1) NOT NULL,
`administrador_id` int(11) NOT NULL,
`video` varchar(100) default NULL,
PRIMARY KEY (`id`),
KEY `fk_juego_administrador1_idx` (`administrador_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `juego`
--
LOCK TABLES `juego` WRITE;
/*!40000 ALTER TABLE `juego` DISABLE KEYS */;
INSERT INTO `juego` VALUES (1,'Uncharted 3 Drake`s Deception','Es un videojuego desarrollado por Naughty Dog y publicado por Sony Computer Entertainment. Lanzado al mercado estadounidense el 1 de noviembre de 2011. La historia se centra alrededor de Nathan Drake y su mentor Victor Sullivan que viajan alrededor del mundo buscando una legendaria ciudad perdida que finalmente les llevará a la Península Arábiga y el vasto desierto de Rub al-Jali, también conocido como el Cuarto Vacío. La legendaria ciudad perdida ha sido conocida por varios nombres, incluyendo \"Iram de las Columnas\" y el Atlantis de las Arenas. El juego se basa en las aventuras de T.E. Lawrence.','PS3','Accion','1-10','Varios','2011','1a1.jpg','1a2.jpg','1.jpg',9,1,1,'http://www.youtube.com/watch?v=DHHcM6aHPnE');
/*!40000 ALTER TABLE `juego` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `juego_has_usuario`
--
DROP TABLE IF EXISTS `juego_has_usuario`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `juego_has_usuario` (
`juego_id` int(11) NOT NULL,
`usuario_id` int(11) NOT NULL,
`fechadeinicio` date default NULL,
PRIMARY KEY (`juego_id`,`usuario_id`),
KEY `fk_juego_has_usuario_usuario1_idx` (`usuario_id`),
KEY `fk_juego_has_usuario_juego1_idx` (`juego_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `juego_has_usuario`
--
LOCK TABLES `juego_has_usuario` WRITE;
/*!40000 ALTER TABLE `juego_has_usuario` DISABLE KEYS */;
INSERT INTO `juego_has_usuario` VALUES (1,9,'2012-05-14'),(1,8,'2013-05-15'),(1,7,'2013-05-13'),(1,6,'2013-05-13');
/*!40000 ALTER TABLE `juego_has_usuario` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `mensaje_amigo`
--
DROP TABLE IF EXISTS `mensaje_amigo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `mensaje_amigo` (
`id` int(11) NOT NULL auto_increment,
`idusuario` int(11) default NULL,
`idamigo` int(11) default NULL,
`asunto` varchar(30) default NULL,
`email` varchar(30) default NULL,
`sitio` varchar(50) default NULL,
`mensaje` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `mensaje_amigo`
--
LOCK TABLES `mensaje_amigo` WRITE;
/*!40000 ALTER TABLE `mensaje_amigo` DISABLE KEYS */;
INSERT INTO `mensaje_amigo` VALUES (1,7,8,'CW','r9dolfinho@hotmail.com','www.facebook.com/r9software','CW');
/*!40000 ALTER TABLE `mensaje_amigo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `partida`
--
DROP TABLE IF EXISTS `partida`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `partida` (
`id` int(11) NOT NULL auto_increment,
`tipo` int(11) NOT NULL,
`fecha` datetime NOT NULL,
`ronda` int(11) NOT NULL,
`ganador` int(11) default NULL,
`participantes` int(11) default NULL,
`torneo_id` int(11) NOT NULL,
PRIMARY KEY (`id`,`torneo_id`),
KEY `fk_partida_torneo1_idx` (`torneo_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `partida`
--
LOCK TABLES `partida` WRITE;
/*!40000 ALTER TABLE `partida` DISABLE KEYS */;
INSERT INTO `partida` VALUES (1,1,'2013-05-14 13:08:30',1,8,3,1),(2,1,'2013-05-16 13:09:10',2,7,3,1),(3,1,'2013-05-20 13:13:37',3,8,3,1);
/*!40000 ALTER TABLE `partida` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `premio`
--
DROP TABLE IF EXISTS `premio`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `premio` (
`id` int(11) NOT NULL auto_increment,
`descripcion` varchar(300) NOT NULL,
`referencia` varchar(30) NOT NULL,
`tipo` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `premio`
--
LOCK TABLES `premio` WRITE;
/*!40000 ALTER TABLE `premio` DISABLE KEYS */;
INSERT INTO `premio` VALUES (1,'Tarjeta de $10','xasd-axafas-xasfd','Premio individual');
/*!40000 ALTER TABLE `premio` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `solicitud_amigo`
--
DROP TABLE IF EXISTS `solicitud_amigo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `solicitud_amigo` (
`id` int(11) NOT NULL auto_increment,
`idusuario` int(11) default NULL,
`idamigo` int(11) default NULL,
`nombre` varchar(30) default NULL,
`email` varchar(30) default NULL,
`sitio` varchar(50) default NULL,
`mensaje` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `solicitud_amigo`
--
LOCK TABLES `solicitud_amigo` WRITE;
/*!40000 ALTER TABLE `solicitud_amigo` DISABLE KEYS */;
INSERT INTO `solicitud_amigo` VALUES (1,7,9,'usuario2','r9dolfinho@hotmail.com','www.facebook.com/r9software',' Hola soy usuario2 y me gustaria añadirte como amigo :)\r\n ');
/*!40000 ALTER TABLE `solicitud_amigo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tipo`
--
DROP TABLE IF EXISTS `tipo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `tipo` (
`id` int(11) NOT NULL auto_increment,
`nombre` varchar(30) NOT NULL,
`descripcion` varchar(400) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `tipo`
--
LOCK TABLES `tipo` WRITE;
/*!40000 ALTER TABLE `tipo` DISABLE KEYS */;
INSERT INTO `tipo` VALUES (1,'Todos contra todos','Cada uno de los usuarios decide como equiparse en esta batalla de todos contra todos');
/*!40000 ALTER TABLE `tipo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `torneo`
--
DROP TABLE IF EXISTS `torneo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `torneo` (
`id` int(11) NOT NULL auto_increment,
`nombre` varchar(30) NOT NULL,
`descripcion` varchar(400) NOT NULL,
`fechadeinicio` datetime NOT NULL,
`fechatermino` datetime NOT NULL,
`participantes` int(11) NOT NULL,
`gratuito` tinyint(1) NOT NULL,
`numeropartidas` int(11) NOT NULL,
`tipo_id` int(11) NOT NULL,
`premio_id` int(11) NOT NULL,
`administrador_id` int(11) NOT NULL,
`usuario_id` int(11) NOT NULL,
`juego_id` int(11) NOT NULL,
`activo` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `fk_torneo_tipo1_idx` (`tipo_id`),
KEY `fk_torneo_premio1_idx` (`premio_id`),
KEY `fk_torneo_administrador1_idx` (`administrador_id`),
KEY `fk_torneo_usuario1_idx` (`usuario_id`),
KEY `fk_torneo_juego1_idx` (`juego_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `torneo`
--
LOCK TABLES `torneo` WRITE;
/*!40000 ALTER TABLE `torneo` DISABLE KEYS */;
INSERT INTO `torneo` VALUES (1,'TorneoU3','Torneo de uncharted 3','2013-05-14 12:36:21','2013-05-21 12:36:26',3,1,3,1,1,1,7,1,1);
/*!40000 ALTER TABLE `torneo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `torneo_clan`
--
DROP TABLE IF EXISTS `torneo_clan`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `torneo_clan` (
`id` int(11) NOT NULL auto_increment,
`nombre` varchar(30) NOT NULL,
`descripcion` varchar(400) NOT NULL,
`administrador` int(11) NOT NULL,
`fechadeinicio` datetime NOT NULL,
`fechatermino` datetime NOT NULL,
`participantes` int(11) NOT NULL,
`gratuito` tinyint(1) NOT NULL,
`numeropartidas` int(11) NOT NULL,
`tipo_id` int(11) NOT NULL,
`premio_id` int(11) NOT NULL,
`administrador_id` int(11) NOT NULL,
`clan_id` int(11) NOT NULL,
`juego_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_torneo_tipo1_idx` (`tipo_id`),
KEY `fk_torneo_premio1_idx` (`premio_id`),
KEY `fk_torneo_administrador1_idx` (`administrador_id`),
KEY `fk_torneo_clan1_idx` (`clan_id`),
KEY `fk_torneo_juego1_idx` (`juego_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `torneo_clan`
--
LOCK TABLES `torneo_clan` WRITE;
/*!40000 ALTER TABLE `torneo_clan` DISABLE KEYS */;
/*!40000 ALTER TABLE `torneo_clan` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario`
--
DROP TABLE IF EXISTS `usuario`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `usuario` (
`id` int(11) NOT NULL auto_increment,
`usuario` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`nombre` varchar(30) NOT NULL,
`apellidos` varchar(30) NOT NULL,
`avatar` varchar(100) NOT NULL default 'images/avatar/default.png',
`ganadas` int(11) NOT NULL default '0',
`perdidas` int(11) NOT NULL default '0',
`empatadas` int(11) NOT NULL default '0',
`clan_id` int(11) default NULL,
`torneosganados` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `usuario`
--
LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
INSERT INTO `usuario` VALUES (6,'usuario1','usuario1@ejemplo.com','usuario1','usuario1','usuario1','images/avatar/default.png',0,3,0,0,0),(7,'usuario2','usuario2@ejemplo.com','usuario2','usuario2','usuario2','images/avatar/default.png',1,2,0,0,0),(8,'usuario3','usuario3@ejemplo.com','usuario3','usuario3','usuario3','images/avatar/default.png',2,1,0,0,1),(9,'r9software','r9software@facebook.com','rodolfo','Rodolfo','Abarca Rodriguez','images/avatar/1.png',0,0,0,1,0);
/*!40000 ALTER TABLE `usuario` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario_has_partida`
--
DROP TABLE IF EXISTS `usuario_has_partida`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `usuario_has_partida` (
`usuario_id` int(11) NOT NULL,
`partida_id` int(11) NOT NULL,
`posicion` int(11) default NULL,
PRIMARY KEY (`usuario_id`,`partida_id`),
KEY `fk_usuario_has_partida_partida1_idx` (`partida_id`),
KEY `fk_usuario_has_partida_usuario1_idx` (`usuario_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `usuario_has_partida`
--
LOCK TABLES `usuario_has_partida` WRITE;
/*!40000 ALTER TABLE `usuario_has_partida` DISABLE KEYS */;
INSERT INTO `usuario_has_partida` VALUES (6,1,3),(7,1,2),(8,1,1),(6,2,2),(7,2,1),(8,2,3),(6,3,3),(7,3,2),(8,3,1);
/*!40000 ALTER TABLE `usuario_has_partida` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario_has_premio`
--
DROP TABLE IF EXISTS `usuario_has_premio`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `usuario_has_premio` (
`usuario_id` int(11) NOT NULL,
`premio_id` int(11) NOT NULL,
`fechaentrega` datetime default NULL,
PRIMARY KEY (`usuario_id`,`premio_id`),
KEY `fk_usuario_has_premio_premio1_idx` (`premio_id`),
KEY `fk_usuario_has_premio_usuario1_idx` (`usuario_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `usuario_has_premio`
--
LOCK TABLES `usuario_has_premio` WRITE;
/*!40000 ALTER TABLE `usuario_has_premio` DISABLE KEYS */;
INSERT INTO `usuario_has_premio` VALUES (8,1,'2013-05-14 13:30:40');
/*!40000 ALTER TABLE `usuario_has_premio` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario_has_torneo`
--
DROP TABLE IF EXISTS `usuario_has_torneo`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `usuario_has_torneo` (
`usuario_id` int(11) NOT NULL,
`torneo_id` int(11) NOT NULL,
`fecha` date default NULL,
`posicion` int(11) default NULL,
PRIMARY KEY (`usuario_id`,`torneo_id`),
KEY `fk_usuario_has_torneo_torneo1_idx` (`torneo_id`),
KEY `fk_usuario_has_torneo_usuario1_idx` (`usuario_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `usuario_has_torneo`
--
LOCK TABLES `usuario_has_torneo` WRITE;
/*!40000 ALTER TABLE `usuario_has_torneo` DISABLE KEYS */;
INSERT INTO `usuario_has_torneo` VALUES (6,1,'2013-05-21',3),(7,1,'2013-05-21',2),(8,1,'2013-05-21',1);
/*!40000 ALTER TABLE `usuario_has_torneo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usuario_has_usuario`
--
DROP TABLE IF EXISTS `usuario_has_usuario`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `usuario_has_usuario` (
`usuario_id` int(11) NOT NULL,
`usuario_id1` int(11) NOT NULL,
KEY `fk_usuario_has_usuario_usuario2_idx` (`usuario_id1`),
KEY `fk_usuario_has_usuario_usuario1_idx` (`usuario_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Dumping data for table `usuario_has_usuario`
--
LOCK TABLES `usuario_has_usuario` WRITE;
/*!40000 ALTER TABLE `usuario_has_usuario` DISABLE KEYS */;
INSERT INTO `usuario_has_usuario` VALUES (7,8),(7,6),(6,8),(6,7),(8,6),(8,7);
/*!40000 ALTER TABLE `usuario_has_usuario` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2013-05-28 6:56:29
|
-- event_db_proc.sql --- Event logging functions. -*- sql -*-
-- Copyright (C) 2005-2012 Opersys inc., All rights reserved.
<<< connect(tbxsosd_db) >>>
-- Add an event to the database.
create or replace function event_create(varchar, bigint, bigint, varchar) returns bigint as '
declare
hn alias for $1;
evid alias for $2;
sess_id alias for $3;
name alias for $4;
n bigint;
begin
perform * from events where hostname = hn and event_id = evid and session_id = sess_id;
if found then
raise exception ''Event ID % of session ID % already exists.'', evid, sess_id;
end if;
insert into events (hostname, event_name, event_id, session_id, event_time)
values (hn, name, evid, sess_id, now());
select into n last_value from event_id_seq;
return n;
end' language plpgsql;
grant execute on function event_create(varchar, bigint, bigint, varchar) to teambox_event;
-- Add a variable to the event.
create or replace function event_add_variable(varchar, bigint, bigint, varchar, varchar) returns void as '
declare
hn alias for $1;
evid alias for $2;
seid alias for $3;
key alias for $4;
val alias for $5;
dummy int;
begin
insert into event_variables (hostname, event_id, session_id, var_key, var_val)
values (hn, evid, seid, key, val);
return;
end' language plpgsql;
grant execute on function event_add_variable(varchar, bigint, bigint, varchar, varchar) to teambox_event;
-- To be called to periodically clean up the events.
create or replace function event_clean(int) returns void as '
declare
days alias for $1;
r_ev record;
c_ev refcursor;
begin
open c_ev for select * from events;
loop
fetch c_ev into r_ev;
exit when not found;
if date_part(''day'', now() - r_ev.event_time) > days then
delete from event_variables
where session_id = r_ev.session_id and event_id = r_ev.event_id;
delete from events where
session_id = r_ev.session_id and event_id = r_ev.event_id;
end if;
end loop;
close c_ev;
return;
end' language plpgsql;
-- events2 view
-- change column names for subselects
-- select event_id, (select ... where event_id=event_id ...) does not work
-- select event_id as ttt, (select ... where event_id=ttt ...) does not work
-- select eid, (select ... where event_id=eid...) works
create or replace view events2 (sid, eid, ename, etime)
as select session_id, event_id, event_name, event_time
from events;
grant all on table events2 to teambox_admin;
-- packagings view
-- yeah..
create or replace view packagings
(conntime, packtime, disconntime, ip, username, pkg_type, nb_recipient, nb_pwd, nb_attch, body_text_len,
body_html_len, attach_total_size, output_len)
as select
(select event_time from events where session_id=sid and event_name='connect') as conntime,
etime,
(select event_time from events where session_id=sid and event_name='disconnect') as disconntime,
(select event_variables.var_val from event_variables
left join events
on events.event_id=event_variables.event_id
where events.session_id=sid and var_key='ip' limit 1) as ip,
(select event_variables.var_val from event_variables
left join events
on events.event_id=event_variables.event_id
where events.session_id=sid and var_key='username' limit 1) as username,
(select var_val from event_variables where event_id=eid and var_key='pkg_type' limit 1) as pkg_type,
(select var_val from event_variables where event_id=eid and var_key='nb_recipient' limit 1) as nb_recipient,
(select var_val from event_variables where event_id=eid and var_key='nb_pwd' limit 1) as nb_pwd,
(select var_val from event_variables where event_id=eid and var_key='nb_attch' limit 1) as nb_attch,
(select var_val from event_variables where event_id=eid and var_key='body_text_len' limit 1) as body_text_len,
(select var_val from event_variables where event_id=eid and var_key='body_html_len' limit 1) as body_html_len,
(select var_val from event_variables where event_id=eid and var_key='attach_total_size' limit 1) as attach_total_size,
(select var_val from event_variables where event_id=eid and var_key='output_len' limit 1) as output_len
from events2
where ename='pkg';
grant all on table packagings to teambox_admin;
-- processings view
-- yeah..
create or replace view processings
(conntime, packtime, disconntime, ip, username, pkg_type, key_id, has_pwd)
as select
(select event_time from events where session_id=sid and event_name='connect') as conntime,
etime,
(select event_time from events where session_id=sid and event_name='disconnect') as disconntime,
(select event_variables.var_val from event_variables
left join events
on events.event_id=event_variables.event_id
where events.session_id=sid and var_key='ip' limit 1) as ip,
(select event_variables.var_val from event_variables
left join events
on events.event_id=event_variables.event_id
where events.session_id=sid and var_key='username' limit 1) as username,
(select var_val from event_variables where event_id=eid and var_key='pkg_type' limit 1) as pkg_type,
(select var_val from event_variables where event_id=eid and var_key='key_id' limit 1) as key_id,
(select var_val from event_variables where event_id=eid and var_key='has_pwd' limit 1) as has_pwd
from events2
where ename='key-dpkg';
grant all on table processings to teambox_admin;
create or replace view today_events as
select e.hostname, e.event_id, e.session_id, e.event_name, e.event_time, v.var_key, v.var_val
from events e
left join event_variables v
on e.event_id = v.event_id and e.session_id = v.session_id and e.hostname::text = v.hostname::text
where (now() - e.event_time::timestamp with time zone) < '1 day'::interval;
grant all on table today_events to teambox_admin; |
create or replace package PK_GPY_GRILLA is
/********************************************************************************
DESCRIPCION : Paquete utilizado para agrupar todos los procedimientos
y funciones para la administración de las grillas
REALIZADO POR : Luis Felipe Galeano Castro
FECHA CREACION : 10/12/2016
FECHA MODIFICA : 26/01/2017
MODIFICADO POR : Luis Felipe Galeano Castro
DESCRIPCION CAMBIO: Se agregan los metodos: Pr_ListarActividades y
Pr_ListarActividadesPorClave
*******************************************************************************/
NOMBRE_PAQUETE CONSTANT VARCHAR2(100) := 'PK_GPY_GRILLA';
TYPE CURSOR_SALIDA IS REF CURSOR;
procedure Pr_ListarProyectos (p_A041CODIGO IN GPYT_T041_USUARIO.A041CODIGO%TYPE,
p_IdUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ListarProyectosPorClave (p_A041CODIGO IN GPYT_T041_USUARIO.A041CODIGO%TYPE,
p_Clave IN VARCHAR2,
p_IdUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ListarActividades (p_A005CODIGO IN GPYT_T005_ACTIVIDAD.A005CODIGO%TYPE,
p_A005IDPROYECTO IN GPYT_T005_ACTIVIDAD.A005IDPROYECTO%TYPE,
p_IdUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
procedure Pr_ListarActividadesPorClave (p_A005IDPROYECTO IN GPYT_T005_ACTIVIDAD.A005IDPROYECTO%TYPE,
p_Clave IN VARCHAR2,
p_IdUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
end PK_GPY_GRILLA; |
create or replace package body PK_T053_REPLEGAL is
PROCEDURE Pr_Insertar (p_A053IDPERSONAJURD IN GPYT_T053_REPLEGAL.A053IDPERSONAJURD%TYPE,
p_A053IDREPRESENTANTE IN GPYT_T053_REPLEGAL.A053IDREPRESENTANTE%TYPE,
p_A053TIPOREPRESENTANTE IN GPYT_T053_REPLEGAL.A053TIPOREPRESENTANTE%TYPE,
p_A053IDARCHIVO IN GPYT_T053_REPLEGAL.A053IDARCHIVO%TYPE,
p_idUsuario IN NUMBER,
p_resultado OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2) IS
codExcepcion NUMBER;
NOMBRE_PROCEDIMIENTO VARCHAR2(50) := 'Pr_Insertar';
p_A053CODIGO NUMBER;
BEGIN
-- obtenemos el siguiente id
p_A053CODIGO := PK_UTL_UTILIDAD.Fn_ObtenerId('T053_REPLEGAL_SEQ');
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Entro a Pr_Insertar ' || p_A053IDPERSONAJURD);
INSERT INTO GPYT_T053_REPLEGAL (A053CODIGO, A053IDPERSONAJURD, A053IDREPRESENTANTE, A053TIPOREPRESENTANTE, A053IDARCHIVO, A053ESTADOREGISTRO, A053FECHACREACION, A053USUARIOCREACION)
VALUES (p_A053CODIGO, p_A053IDPERSONAJURD, p_A053IDREPRESENTANTE, p_A053TIPOREPRESENTANTE, p_A053IDARCHIVO, PK_UTL_CONSTANTE.COD_ACTIVO, sysdate, p_idUsuario);
OPEN p_resultado FOR SELECT p_A053CODIGO A053CODIGO FROM dual;
p_codError := PK_UTL_CONSTANTE.COD_OPERACION_CORRECTA;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje (p_codError);
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Salio de Pr_Insertar ' || p_A053IDPERSONAJURD);
END Pr_Insertar;
PROCEDURE Pr_Eliminar (p_A053CODIGO IN GPYT_T053_REPLEGAL.A053CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_resultado OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2) IS
codExcepcion NUMBER;
NOMBRE_PROCEDIMIENTO VARCHAR2(50) := 'Pr_Eliminar';
BEGIN
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Entro a Pr_Eliminar ' || p_A053CODIGO);
UPDATE GPYT_T053_REPLEGAL
SET A053ESTADOREGISTRO = PK_UTL_CONSTANTE.COD_INACTIVO,
A053FECHAMODIFICACION = sysdate,
A053USUARIOMODIFICACION = p_idUsuario
WHERE A053CODIGO = p_A053CODIGO;
OPEN p_resultado FOR SELECT '' FROM dual;
p_codError := PK_UTL_CONSTANTE.COD_OPERACION_CORRECTA;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje (p_codError);
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Salio de Pr_Eliminar ' || p_A053CODIGO);
END Pr_Eliminar;
PROCEDURE Pr_Actualizar (p_A053CODIGO IN GPYT_T053_REPLEGAL.A053CODIGO%TYPE,
p_A053IDPERSONAJURD IN GPYT_T053_REPLEGAL.A053IDPERSONAJURD%TYPE,
p_A053IDREPRESENTANTE IN GPYT_T053_REPLEGAL.A053IDREPRESENTANTE%TYPE,
p_A053TIPOREPRESENTANTE IN GPYT_T053_REPLEGAL.A053TIPOREPRESENTANTE%TYPE,
p_A053IDARCHIVO IN GPYT_T053_REPLEGAL.A053IDARCHIVO%TYPE,
p_idUsuario IN NUMBER,
p_resultado OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2) IS
codExcepcion NUMBER;
NOMBRE_PROCEDIMIENTO VARCHAR2(50) := 'Pr_Actualizar';
numReg NUMBER;
BEGIN
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Entro a Pr_Actualizar ' || p_A053CODIGO);
IF p_A053CODIGO IS NULL THEN
p_codError := 4;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje (p_codError);
OPEN p_resultado FOR SELECT '' FROM dual;
return;
END IF;
SELECT COUNT(*) INTO numReg FROM GPYT_T053_REPLEGAL WHERE A053CODIGO = p_A053CODIGO AND A053ESTADOREGISTRO = PK_UTL_CONSTANTE.COD_ACTIVO;
IF numReg > 0 THEN
UPDATE GPYT_T053_REPLEGAL
SET A053IDPERSONAJURD = p_A053IDPERSONAJURD, A053IDREPRESENTANTE = p_A053IDREPRESENTANTE, A053TIPOREPRESENTANTE = p_A053TIPOREPRESENTANTE,
A053IDARCHIVO = p_A053IDARCHIVO, A053FECHAMODIFICACION = sysdate, A053USUARIOMODIFICACION = p_idUsuario
WHERE A053CODIGO = p_A053CODIGO;
OPEN p_resultado FOR SELECT p_A053CODIGO A053CODIGO FROM dual;
p_codError := PK_UTL_CONSTANTE.COD_OPERACION_CORRECTA;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje(p_codError);
return;
ELSE
p_codError := 5;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje (p_codError);
OPEN p_resultado FOR SELECT '' FROM dual;
return;
END IF;
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Salio de Pr_Actualizar ' || p_A053CODIGO);
END Pr_Actualizar;
PROCEDURE Pr_ConsultarPorFiltro (p_Filtro IN VARCHAR2,
p_idUsuario IN NUMBER,
p_resultado OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2) IS
codExcepcion NUMBER;
NOMBRE_PROCEDIMIENTO VARCHAR2(50) := 'Pr_ConsultarPorFiltro';
strSQL VARCHAR2(500);
p_Temp VARCHAR2(30);
BEGIN
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Entro a Pr_ConsultarPorId ' || p_Filtro);
IF p_Filtro IS NULL THEN
OPEN p_resultado FOR
SELECT * FROM GPYT_T053_REPLEGAL WHERE A053ESTADOREGISTRO = PK_UTL_CONSTANTE.COD_ACTIVO;
p_codError := PK_UTL_CONSTANTE.COD_OPERACION_CORRECTA;
p_msjError := PK_UTL_UTILIDAD.fn_ObtenerMensaje(p_codError);
return;
END IF;
p_Temp := q'{ AND A053ESTADOREGISTRO = '}' || PK_UTL_CONSTANTE.COD_ACTIVO || q'{'}';
strSQL := 'SELECT * FROM GPYT_T053_REPLEGAL WHERE ' || p_Filtro || p_Temp;
OPEN p_resultado FOR strSQL;
p_codError := PK_UTL_CONSTANTE.COD_OPERACION_CORRECTA;
p_msjError := PK_UTL_UTILIDAD.Fn_ObtenerMensaje (p_codError);
PK_UTL_UTILIDAD.Pr_RegistrarDebug (p_niveldebug => PK_UTL_CONSTANTE.NIVEL_TRACE,
p_paquete => NOMBRE_PAQUETE,
p_procedimiento => NOMBRE_PROCEDIMIENTO,
p_usuario => p_idUsuario,
p_descripcion => 'Salio de Pr_ConsultarPorFiltro ' || p_Filtro);
END Pr_ConsultarPorFiltro;
end PK_T053_REPLEGAL; |
{% set tables = ['Table1', 'Table2', 'Table3'] %}
{% for table in tables %}
SELECT * FROM T1, T2
WHERE T1.i = T2.i = {{table}}
JOIN SELECT * FROM {{table}} {%include "site.sql" %}
{% endfor %}
|
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 15, 2019 at 09:15 PM
-- Server version: 5.7.27-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `loginBarcode`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id_user` int(11) NOT NULL,
`name_user` varchar(225) NOT NULL,
`username_user` varchar(225) NOT NULL,
`password_user` varchar(225) NOT NULL,
`role_user` enum('admin','user') NOT NULL,
`key_user` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id_user`, `name_user`, `username_user`, `password_user`, `role_user`, `key_user`) VALUES
(5, 'Muhammad Azrial', 'azrial', '$2y$10$54kQk21zuGl3KosvbxsWreXLRYsMJVie4fx5xZMyuAUghMXOZHhfm', 'admin', '$2y$10$g4Zsv30Hi.IESEEp1NRinuGYkAy/ytG0zo0KOlFmPWMwZTDnC.h42'),
(11, 'Dania Khaira Lubna', 'dania', '$2y$10$hka3BtpmTWfyi2qo6P1Y2.K3oKghLFZp7L8ceB2AoJJ008uwyEYBq', 'user', '$2y$10$crtGWANmh8y88FUL9cOQtuIO/Fe70RKHnKzh6gl86awVFXZRREUaW');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id_user`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
/*!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 DEGREE_STUDENT as
select concat(EMPLID, ACAD_PLAN) as id,
emplid, acad_career, stdnt_car_nbr, effdt, effseq, acad_plan, declare_dt, plan_sequence,
req_term, completion_term, stdnt_degr, degr_chkout_stat
from cmscommon.sfo_acad_plan
where acad_plan like 'PHYS%'
|
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- ホスト: 127.0.0.1
-- 生成日時: 2021-06-16 05:34:51
-- サーバのバージョン: 10.4.18-MariaDB
-- PHP のバージョン: 8.0.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- データベース: `notore`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `administrator`
--
CREATE TABLE `administrator` (
`id` int(10) UNSIGNED NOT NULL,
`login_id` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`creater_id` int(10) UNSIGNED DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`updater_id` int(10) UNSIGNED DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `administrator`
--
INSERT INTO `administrator` (`id`, `login_id`, `creater_id`, `create_date`, `updater_id`, `update_date`, `deleted`) VALUES
(1, 'ABC2', 2, '2021-06-16 11:44:15', 2, '2021-06-16 11:44:15', 0);
-- --------------------------------------------------------
--
-- テーブルの構造 `category`
--
CREATE TABLE `category` (
`id` int(10) UNSIGNED NOT NULL,
`category` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`creater_id` int(10) UNSIGNED DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`updater_id` int(10) UNSIGNED DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `category`
--
INSERT INTO `category` (`id`, `category`, `creater_id`, `create_date`, `updater_id`, `update_date`, `deleted`) VALUES
(1, '国語', 34, '2021-06-16 12:25:41', 34, '2021-06-16 12:25:41', 0);
-- --------------------------------------------------------
--
-- テーブルの構造 `level`
--
CREATE TABLE `level` (
`id` int(10) UNSIGNED NOT NULL,
`level` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`creater_id` int(10) UNSIGNED DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`updater_id` int(10) UNSIGNED DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `level`
--
INSERT INTO `level` (`id`, `level`, `creater_id`, `create_date`, `updater_id`, `update_date`, `deleted`) VALUES
(1, 'やさしい', 34, '2021-06-16 12:28:12', 34, '2021-06-16 12:28:12', 0);
-- --------------------------------------------------------
--
-- テーブルの構造 `question`
--
CREATE TABLE `question` (
`id` int(10) UNSIGNED NOT NULL,
`question` varchar(300) COLLATE utf8_unicode_ci DEFAULT NULL,
`category_id` int(10) UNSIGNED DEFAULT NULL,
`level_id` int(10) UNSIGNED DEFAULT NULL,
`answer_form` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`point` smallint(6) DEFAULT NULL,
`answer` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`coment` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`creater_id` int(10) UNSIGNED DEFAULT NULL,
`create_date` datetime DEFAULT NULL,
`updater_id` int(10) UNSIGNED DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `question`
--
INSERT INTO `question` (`id`, `question`, `category_id`, `level_id`, `answer_form`, `point`, `answer`, `coment`, `creater_id`, `create_date`, `updater_id`, `update_date`, `deleted`) VALUES
(1, '1 + 1 = ?', 5, 3, '単一選択', 15, '2', 'たしざんの基本', 23, '2021-06-16 12:31:32', 17, '2021-06-16 12:31:32', 0);
-- --------------------------------------------------------
--
-- テーブルの構造 `user`
--
CREATE TABLE `user` (
`id` int(10) UNSIGNED NOT NULL,
`login_id` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`name_id` int(10) UNSIGNED DEFAULT NULL,
`answer` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`answer_date` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `user`
--
INSERT INTO `user` (`id`, `login_id`, `name_id`, `answer`, `answer_date`, `deleted`) VALUES
(1, 'TARO', 22, '2', '2021-06-16 12:18:06', 0);
--
-- ダンプしたテーブルのインデックス
--
--
-- テーブルのインデックス `administrator`
--
ALTER TABLE `administrator`
ADD PRIMARY KEY (`id`);
--
-- テーブルのインデックス `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`);
--
-- テーブルのインデックス `level`
--
ALTER TABLE `level`
ADD PRIMARY KEY (`id`);
--
-- テーブルのインデックス `question`
--
ALTER TABLE `question`
ADD PRIMARY KEY (`id`);
--
-- テーブルのインデックス `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- ダンプしたテーブルの AUTO_INCREMENT
--
--
-- テーブルの AUTO_INCREMENT `administrator`
--
ALTER TABLE `administrator`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- テーブルの AUTO_INCREMENT `category`
--
ALTER TABLE `category`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- テーブルの AUTO_INCREMENT `level`
--
ALTER TABLE `level`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- テーブルの AUTO_INCREMENT `question`
--
ALTER TABLE `question`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- テーブルの AUTO_INCREMENT `user`
--
ALTER TABLE `user`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
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 Procedure sp_Insert_ReportUploadAbstract
(@ReportDate datetime,@CompanyID nVarchar(6),@ReportName nVarchar(50),@Frequency Integer,@Status nVarchar(10))
as
Insert into ReportUploadAbstract (ReportDate,CompanyID,ReportName,Frequency,Status)
values (@ReportDate ,@CompanyID ,@ReportName ,@Frequency ,@Status)
select @@Identity as ReportID
|
{{
config({
"materialized" : "table",
"sort" : "transaction_date",
"unique_key" : "unique_invoice_id"
})
}}
SELECT
i.unique_invoice_id,
i.transaction_date,
i.customer_code,
--i.header_number,
--i.invoice_number,
--i.invoice_type,
i.time_since_previous_paid_coffee_invoice,
i.invoice,
i.ship_date,
i.ship_to_name,
i.ship_to_address1,
i.ship_to_address2,
i.ship_to_address3,
i.ship_to_city,
i.ship_to_state,
i.ship_to_zip,
i.ship_to_country,
i.invoice_sales_tax,
i.invoice_freight,
i.comment,
i.bill_to_name as account_name,
--i.account_division,
--i.company_code,
--i.account_min_vol,
--i.account_tier,
--i.sales_rep_name,
--i.primary_account_manager_name,
--i.secondary_account_manager_name,
--i.account_invoice_number,
--i.account_total_invoices,
--i.account_total_paid_coffee_invoices,
--i.account_second_paid_coffee_invoice_date,
--i.account_total_quantity,
--i.account_total_extension,
i.total_quantity,
i.total_quantity_ordered,
i.total_quantity_backordered,
i.total_extension,
i.total_weight,
i.account_paid_coffee_invoice_number
from {{ref('warehouse_invoices')}} i
left join {{ref('wholesale_accounts')}} a on a.customer_code = i.customer_code |
CREATE VIEW `contact_activity_report_v1` AS
SELECT
`C`.`id` AS `ContactID`,
`C`.`display_name` AS `display_name`,
`A`.`id` AS `ActivityID`,
`A`.`subject` AS `subject`,
`A`.`activity_date_time` AS `activity_date_time`,
`A`.`details` AS `details`
FROM
((`civicrm_contact` `C`
JOIN `civicrm_activity_contact` `AC` ON ((`C`.`id` = `AC`.`contact_id`)))
JOIN `civicrm_activity` `A` ON ((`AC`.`activity_id` = `A`.`id`)))
ORDER BY `C`.`id` |
create or replace package PK_GPY_DATOSMDL is
/********************************************************************************
DESCRIPCION : Paquete utilizado para agrupar todos los procedimientos y funciones
para la registrar la los dartos de las etapas MDL y MDLPoA
REALIZADO POR : Luis Felipe Galeano Castro
FECHA CREACION : 24/12/2016
FECHA MODIFICA : 18/01/2017
MODIFICADO POR : Luis Felipe Galeano Castro
DESCRIPCION CAMBIO: Incluir los metodos de actualizacion
*******************************************************************************/
NOMBRE_PAQUETE CONSTANT VARCHAR2(100) := 'PK_GPY_DATOSMDL';
TYPE CURSOR_SALIDA IS REF CURSOR;
-- Funciones y Procedimientos del paquete
-- Lista la especificacion de los archivos adjuntos que se piden por pantalla y por tipo de proyecto
PROCEDURE Pr_ListarAdjuntos (p_A002TIPPROYCT IN GPYT_T002_PROYECTO.A002TIPPROYCT%TYPE,
p_A025IDPANTALLA IN GPYT_T025_ADJUNTO.A025IDPANTALLA%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
-- Registrar la Consideracion Temprana
PROCEDURE Pr_RegistrarConsiderac (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A002NOMBRPROYCTINGLS IN GPYT_T002_PROYECTO.A002NOMBRPROYCTINGLS%TYPE,
p_A002IDSECTORALSCOPE IN GPYT_T002_PROYECTO.A002IDSECTORALSCOPE%TYPE,
p_A002TECNLGCONTMPLD IN GPYT_T002_PROYECTO.A002TECNLGCONTMPLD%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ConsultarConsiderac (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ActualizarConsiderac (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A002NOMBRPROYCTINGLS IN GPYT_T002_PROYECTO.A002NOMBRPROYCTINGLS%TYPE,
p_A002IDSECTORALSCOPE IN GPYT_T002_PROYECTO.A002IDSECTORALSCOPE%TYPE,
p_A002TECNLGCONTMPLD IN GPYT_T002_PROYECTO.A002TECNLGCONTMPLD%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
-- Registrar los datos de la Carta de No Objecion
PROCEDURE Pr_RegistrarCartaNObj (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A002IDESCALA IN GPYT_T002_PROYECTO.A002IDESCALA%TYPE,
p_A002IDMETDLGMDL IN GPYT_T002_PROYECTO.A002IDMETDLGMDL%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ConsultarCartaNObj (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ActualizarCartaNObj (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A002IDESCALA IN GPYT_T002_PROYECTO.A002IDESCALA%TYPE,
p_A002IDMETDLGMDL IN GPYT_T002_PROYECTO.A002IDMETDLGMDL%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_RegistrarAdjunto (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A008IDADJNT IN GPYT_T008_PROY_ADJUNTO.A008IDADJNT%TYPE,
p_A008NUMRRADCD IN GPYT_T008_PROY_ADJUNTO.A008NUMRRADCD%TYPE,
p_A026DESCRPCNARCHIV IN GPYT_T026_ARCHIVO.A026DESCRPCNARCHIV%TYPE,
p_A026NOMARCHIVO IN GPYT_T026_ARCHIVO.A026NOMARCHIVO%TYPE,
p_A026HASHARCHIVO IN GPYT_T026_ARCHIVO.A026HASHARCHIVO%TYPE,
p_A008FECHADJNT IN GPYT_T008_PROY_ADJUNTO.A008FECHADJNT%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ConsultarAdjuntos (p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A025IDPANTALLA IN GPYT_T025_ADJUNTO.A025IDPANTALLA%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
PROCEDURE Pr_ConsultarAdjuntoPorId (p_A008IDADJNT IN GPYT_T008_PROY_ADJUNTO.A008IDADJNT%TYPE,
p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
/* PROCEDURE Pr_ActualizarAdjunto (p_A025CODIGO IN GPYT_T025_ADJUNTO.A025CODIGO%TYPE,
p_A002CODIGO IN GPYT_T002_PROYECTO.A002CODIGO%TYPE,
p_A008IDADJNT IN GPYT_T008_PROY_ADJUNTO.A008IDADJNT%TYPE,
p_A008NUMRRADCD IN GPYT_T008_PROY_ADJUNTO.A008NUMRRADCD%TYPE,
p_A026DESCRPCNARCHIV IN GPYT_T026_ARCHIVO.A026DESCRPCNARCHIV%TYPE,
p_A026NOMARCHIVO IN GPYT_T026_ARCHIVO.A026NOMARCHIVO%TYPE,
p_A026HASHARCHIVO IN GPYT_T026_ARCHIVO.A026HASHARCHIVO%TYPE,
p_A008FECHADJNT IN GPYT_T008_PROY_ADJUNTO.A008FECHADJNT%TYPE,
p_idUsuario IN NUMBER,
p_Respuesta OUT CURSOR_SALIDA,
p_codError OUT NUMBER,
p_msjError OUT VARCHAR2);
*/
end PK_GPY_DATOSMDL; |
CREATE TABLE APP.REPUTATION (
REPUTATION_ID INTEGER NOT NULL,
PERSON_ID INTEGER NOT NULL,
REPUTATION_SCORE INTEGER DEFAULT 0 NOT NULL
);
CREATE TABLE APP.BANK (
BANK_ACCOUNT_ID INTEGER NOT NULL,
TRANSACTION_ID INTEGER NOT NULL,
TRANSACTION_DATE DATE NOT NULL,
TRANSACTION_TYPE VARCHAR(1),
AMOUNT INTEGER DEFAULT 0,
TASK_ID INTEGER NOT NULL
);
CREATE TABLE APP.PEOPLE (
PERSON_ID INTEGER NOT NULL,
BANK_ACCOUNT_ID INTEGER NOT NULL,
PERSON_LNAME VARCHAR(15),
PERSON_FNAME VARCHAR(15),
PERSON_ADDRESS VARCHAR(30)
);
CREATE TABLE APP.TASK (
TASK_ID INTEGER NOT NULL,
CLIENT_PERSON_ID INTEGER NOT NULL,
PROVIDER_PERSON_ID INTEGER,
TASK_STATUS VARCHAR(1) DEFAULT 'P' NOT NULL,
TASK_TYPE VARCHAR(1),
PARENT_TASK_ID INTEGER
);
CREATE UNIQUE INDEX SQL110802164800951 ON APP.PEOPLE (null);
CREATE INDEX SQL110805172515680 ON APP.REPUTATION (null);
CREATE UNIQUE INDEX SQL110802170552530 ON APP.REPUTATION (null);
CREATE UNIQUE INDEX SQL110802170550090 ON APP.BANK (null);
CREATE UNIQUE INDEX SQL110802170554810 ON APP.TASK (null);
CREATE UNIQUE INDEX SQL110802164800950 ON APP.PEOPLE (null);
ALTER TABLE APP.REPUTATION ADD CONSTRAINT SQL110802170552530 PRIMARY KEY (REPUTATION_ID);
ALTER TABLE APP.BANK ADD CONSTRAINT SQL110802170550090 PRIMARY KEY (TRANSACTION_ID);
ALTER TABLE APP.PEOPLE ADD CONSTRAINT SQL110802164800950 PRIMARY KEY (PERSON_ID);
ALTER TABLE APP.TASK ADD CONSTRAINT SQL110802170554810 PRIMARY KEY (TASK_ID);
ALTER TABLE APP.REPUTATION ADD CONSTRAINT SQL110805172515680 FOREIGN KEY (PERSON_ID)
REFERENCES APP.PEOPLE (PERSON_ID);
|
-- FETCH_EVENT_PROFILE_COMMENT_LIST
-- Fetch comments from event.
-- Arguments: IDEvent
-- Returns: Commentid, Comment text, commment creator and comment datetime
CREATE PROCEDURE FETCH_EVENT_PROFILE_COMMENT_LIST
(@IDEvent int)
AS
BEGIN
SELECT
Comment.IDComment,
Comment.CommentText,
Comment.CreationDate,
MA_User.Name,
MA_User.LastName
FROM
Comment
JOIN Event ON (Comment.IDEvent = Event.IDEvent)
JOIN MA_User ON (MA_User.IDUser = Comment.IDUserCreator)
WHERE
Event.IDEvent = @IDEvent
ORDER BY
CreationDate
END
EXECUTE FETCH_EVENT_PROFILE_COMMENT_LIST 1 |
# update the description entry in the failed_description table
# better wording
##################
truncate table failed_description;
#possible values in the failed_description table
INSERT INTO failed_description (failed_description_id,description) VALUES (1,'Variation maps to more than 3 different locations');
INSERT INTO failed_description (failed_description_id,description) VALUES (2,'None of the variant alleles match the reference allele');
INSERT INTO failed_description (failed_description_id,description) VALUES (3,'Variation has more than 3 different alleles');
INSERT INTO failed_description (failed_description_id,description) VALUES (4,'Loci with no observed variant alleles in dbSNP');
INSERT INTO failed_description (failed_description_id,description) VALUES (5,'Variation does not map to the genome');
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL,'patch', 'patch_54_55_c.sql|changed description for failed_description table');
|
drop table if exists customer;
drop table if exists product;
drop table if exists invoice;
drop table if exists line;
create table customer(
id text primary key not null,
accountid integer,
customertaxid integer,
companyname text,
address text,
city text,
postalcode integer,
country text,
telephone integer,
fax integer,
website text
);
create table product(
type text,
code text primary key not null,
productgroup text,
description text,
numbercode text,
stock integer,
pcm real,
pvp real
);
create table invoice(
number text primary key not null,
status text,
hash text,
hashcontrol integer,
period integer,
date text,
type text,
selfbillingindicator integer,
entrydate text,
customerid text not null,
taxpayable real,
nettotal real,
grosstotal real,
foreign key (customerid) references customer(id)
);
create table line(
invoicenumber text not null,
number integer not null,
productcode text not null,
quantity integer,
unitofmeasure text,
unitprice real,
taxpointdate text,
description text,
creditamount real,
settlement real,
taxtype text,
taxregion text,
taxcode text,
taxpercentage real,
foreign key (productcode) references product(code),
foreign key (invoicenumber) references invoice(number),
primary key(invoicenumber,number)
);
create table purchase(
supplier text,
unitprice real,
ammount integer,
type text,
date text,
productcode text,
foreign key (productcode) references product(code)
); |
# phpMyAdmin MySQL-Dump
# version 2.2.2
# http://phpwizard.net/phpMyAdmin/
# http://phpmyadmin.sourceforge.net/ (download page)
#
# Host: localhost
# Erstellungszeit: 06. März 2002 um 10:02
# Server Version: 3.23.39
# PHP Version: 4.1.1
# Datenbank : `dmerce_shop2`
# --------------------------------------------------------
#
# Tabellenstruktur für Tabelle `Agent`
#
CREATE TABLE Agent (
ID int(11) NOT NULL auto_increment,
CreatedDateTime double(16,4) NOT NULL default '0.0000',
CreatedBy int(11) NOT NULL default '0',
ChangedDateTime double(16,4) NOT NULL default '0.0000',
ChangedBy int(11) NOT NULL default '0',
active int(1) NOT NULL default '0',
LastName varchar(255) NOT NULL default '',
FirstName varchar(255) NOT NULL default '',
Email varchar(255) NOT NULL default '',
Login varchar(255) NOT NULL default '',
passwd varchar(10) NOT NULL default '',
LoginDisabled int(1) NOT NULL default '0',
UXSI varchar(15) NOT NULL default '0.2',
GruppenID int(11) NOT NULL default '0',
KEY ID (ID)
) TYPE=MyISAM;
#
# Daten für Tabelle `Agent`
#
INSERT INTO Agent VALUES (1, '0.0000', 1, '0.0000', 1, 1, 'Demo', 'Demo', '', 'demo', 'demo', 0, '0.2', 0);
|
/*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 80018
Source Host : 192.168.6.56:3306
Source Schema : mybatisgenerator
Target Server Type : MySQL
Target Server Version : 80018
File Encoding : 65001
Date: 02/03/2020 15:02:04
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for db_member
-- ----------------------------
DROP TABLE IF EXISTS `db_member`;
CREATE TABLE `db_member` (
`m_id` bigint(20) NOT NULL AUTO_INCREMENT,
`u_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`m_username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`r_id` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`m_id`) USING BTREE,
INDEX `FKl6wp8e0b9oxr4rlgtbc2kt05h`(`r_id`) USING BTREE,
CONSTRAINT `FKl6wp8e0b9oxr4rlgtbc2kt05h` FOREIGN KEY (`r_id`) REFERENCES `db_role` (`r_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for db_permission
-- ----------------------------
DROP TABLE IF EXISTS `db_permission`;
CREATE TABLE `db_permission` (
`p_id` bigint(20) NOT NULL AUTO_INCREMENT,
`p_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`p_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`p_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`p_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for db_role
-- ----------------------------
DROP TABLE IF EXISTS `db_role`;
CREATE TABLE `db_role` (
`r_id` bigint(20) NOT NULL AUTO_INCREMENT,
`r_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`r_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for db_role_to_permission
-- ----------------------------
DROP TABLE IF EXISTS `db_role_to_permission`;
CREATE TABLE `db_role_to_permission` (
`r_id` bigint(20) NOT NULL,
`p_id` bigint(20) NOT NULL,
INDEX `FKg40vk3n8ausqy31krinmn8eup`(`p_id`) USING BTREE,
INDEX `FK84d5uo2dnyao4lsj7kdeksjw2`(`r_id`) USING BTREE,
CONSTRAINT `FK84d5uo2dnyao4lsj7kdeksjw2` FOREIGN KEY (`r_id`) REFERENCES `db_role` (`r_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FKg40vk3n8ausqy31krinmn8eup` FOREIGN KEY (`p_id`) REFERENCES `db_permission` (`p_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
|
CREATE TABLE `article` (
`alias` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`text` text NOT NULL,
PRIMARY KEY (`alias`)
);
|
/*
寄样管理-已收样品费
*/
delimiter $
drop procedure if exists Proc_SendSamples_SumInSampleFees $
create procedure Proc_SendSamples_SumInSampleFees(srid varchar(255),sKeyNo varchar(255))
begin
declare sCustomerNo varchar(255);
declare fInSampleFees decimal(18,2);
set sCustomerNo=(Select CustomerNo From Incomes Where rid=srid Limit 0,1);
set fInSampleFees=(Select Sum(ifnull(IncomesDetail.UsedAmount,0)) as UsedAmount From Incomes,IncomesDetail Where
Incomes.rid=IncomesDetail.pid and Incomes.CustomerNo=sCustomerNo and IncomesDetail.CostName='样品费' and IncomesDetail.KeyID=sKeyNo);
Update SendSamples set InSampleFees =ifnull(fInSampleFees,0),UnInSampleFees=(ifnull(SampleFees,0)-ifnull(fInSampleFees,0)) Where
SendSamples.PartnerNo =sCustomerNo and SendSamples.TNTNo=sKeyNo;
end $
delimiter ; |
SELECT ROW_NUMBER() OVER (PARTITION BY seasons.id ORDER BY game_date, game_time ) AS logical_game_number, game_number, game_date, game_time, home_team.team_id as home_team
, away_team.team_id as away_team, home_team_score, away_team_score, '' as game_location
, seasons.id as season_id,
home_team_seed, away_team_seed,
(SELECT string_agg(game_number::text, ',')
FROM mhac.tournamentgames t
WHERE winner_to = tournamentgames.game_number
AND season_id = tournamentgames.season_id) AS winners_from,
(SELECT string_agg(game_number::text, ',')
FROM mhac.tournamentgames t
WHERE loser_to = tournamentgames.game_number
AND season_id = tournamentgames.season_id) AS losers_from
, tournamentgames.game_description
, CASE WHEN seasons.tournament_start_date > current_date + 3 THEN false
ELSE true
END display,
winner_to, loser_to
FROM mhac.tournamentgames
INNER JOIN mhac.seasons
ON tournamentgames.season_id = seasons.id
INNER JOIN mhac.levels
ON levels.id = seasons.level_id
LEFT OUTER JOIN mhac.standings as home_team
ON tournamentgames.home_team_seed::int = home_team.standings_rank
AND tournamentgames.season_id = home_team.season_id
LEFT OUTER JOIN mhac.standings as away_team
ON tournamentgames.away_team_seed::int = away_team.standings_rank
AND tournamentgames.season_id = away_team.season_id
ORDER BY game_number
SELECT * FROM mhac.tournamentgames
SELECT * FROM mhac.standings
WHERE season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a'
and standings_rank = 5
UPDATE mhac.standings
SET wins = sums.wins, losses = sums.losses, games_played = (sums.wins + sums.losses), win_percentage = CASE WHEN sums.wins <> 0 THEN (sums.wins/(sums.wins + sums.losses)::decimal) ELSE 0.000 END
FROM (
SELECT
season_teams_with_names.id, season_teams_with_names.team_name, season_teams_with_names.level_name,
COALESCE(
(
SELECT SUM (CASE WHEN games.home_team_id = season_teams_with_names.id AND games.final_home_score > games.final_away_score THEN 1
WHEN games.away_team_id = season_teams_with_names.id AND games.final_home_score < games.final_away_score THEN 1
END) AS wins
FROM mhac.games
), 0
) AS wins,
COALESCE(
(
SELECT SUM (CASE WHEN games.home_team_id = season_teams_with_names.id AND games.final_home_score < games.final_away_score THEN 1
WHEN games.away_team_id = season_teams_with_names.id AND games.final_home_score > games.final_away_score THEN 1
END) AS losses
FROM mhac.games
), 0
) AS losses
FROM mhac.season_teams_with_names
WHERE archive is null
) AS sums
WHERE standings.team_id = sums.id
UPDATE mhac.standings
SET standings_rank = rn
FROM (SELECT ROW_NUMBER() OVER (PARTITION BY standings.season_id ORDER BY win_percentage desc) as rn, standings.season_id, standings.team_id FROM mhac.standings
INNER JOIN mhac.season_teams_with_names
ON standings.team_id = season_teams_with_names.id WHERE archive is null AND season_teams_with_names.season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a') as r
WHERE standings.season_id = r.season_id
AND standings.team_id = r.team_id;
INSERT INTO mhac.tournamentgames(game_number, game_date, game_time, home_team_seed, away_team_seed, game_description, season_id, winner_to, loser_to)
VALUES
(1, '2022-02-10', '11:00:00', 4, 5, Null, '4312875b-e949-4f6c-9d33-a3086873bc1a', 3, 5 )
SELECT * FROM mhac.tournamentgames WHERE season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a' AND game_number = 7;
DELETE FROM mhac.tournamentgames
WHERE season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a'
AND game_number in (5,6)
UPDATE mhac.tournamentgames
SET game_date = '2022-02-12'::date, game_time = '14:30:00'::time, home_team_seed = NULL, away_team_seed = NULL, game_description = '', winner_to = NULL, loser_to = NULL
WHERE game_number = 7
AND season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a'::uuid
SELECT COUNT(*)
FROM mhac.season_teams_with_names
INNER JOIN mhac.standings
ON season_teams_with_names.id = standings.team_id
WHERE season_teams_with_names.season_id = '4312875b-e949-4f6c-9d33-a3086873bc1a'
AND standings_rank <> 99 |
SELECT * FROM user;
SELECT * FROM funds;
SELECT * FROM sharedfunds;
SELECT * FROM individuals;
SELECT * FROM companies;
SELECT * FROM originalfundposition;
SELECT * FROM employeehistory;
SELECT * FROM Session; |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 28, 2018 at 10:30 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `election_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL COMMENT 'This field will contain the id of the administrator(s)',
`username` varchar(255) NOT NULL COMMENT 'This field will store the username of the respective administrator',
`password` varchar(255) NOT NULL COMMENT 'This field will store the password of the respective administrator'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table contains the details of the administrator(s)';
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `username`, `password`) VALUES
(1, 'srivani', '41bf236be8728fc47990c74aff3a3f31');
-- --------------------------------------------------------
--
-- Table structure for table `candidates`
--
CREATE TABLE `candidates` (
`id` int(11) NOT NULL COMMENT 'This field stores the candidates'' id',
`name` text NOT NULL COMMENT 'This field stores the names of the candidates',
`image_src` text NOT NULL COMMENT 'This field stores the path or url of the candidates'' images ',
`election_type` text NOT NULL COMMENT 'This field stores the type of election that the candidate is standing for',
`votes` int(11) NOT NULL COMMENT 'This field stores the number of votes the candidate has received'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table stores the details of all the candidates';
-- --------------------------------------------------------
--
-- Table structure for table `class_details`
--
CREATE TABLE `class_details` (
`class` int(11) NOT NULL COMMENT 'This field stores the all classes in the school',
`sections` int(11) NOT NULL COMMENT 'This field stores the number of sections in the respective class in the school'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table contains the number of sections in each class';
--
-- Dumping data for table `class_details`
--
INSERT INTO `class_details` (`class`, `sections`) VALUES
(5, 2),
(6, 2),
(7, 2),
(8, 2),
(9, 2),
(10, 1);
-- --------------------------------------------------------
--
-- Table structure for table `houses`
--
CREATE TABLE `houses` (
`id` int(11) NOT NULL COMMENT 'This filed stores the id of the houses',
`category` varchar(250) NOT NULL COMMENT 'This field stores the names of all the houses (including school)',
`election_type` varchar(250) NOT NULL COMMENT 'This field stores the different elections in which candidates can stand'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table contains the details of houses and election types';
--
-- Dumping data for table `houses`
--
INSERT INTO `houses` (`id`, `category`, `election_type`) VALUES
(1, 'School', 'School - Captain'),
(2, 'School', 'School - Vice Captain'),
(3, 'Aryabhatta', 'Aryabhatta - Captain'),
(4, 'Aryabhatta', 'Aryabhatta - Vice Captain'),
(5, 'Bhaskara', 'Bhaskara - Captain'),
(6, 'Bhaskara', 'Bhaskara - Vice Captain'),
(7, 'Charaka', 'Charaka - Captain'),
(8, 'Charaka', 'Charaka - Vice Captain'),
(9, 'Sushrutha', 'Sushrutha - Captain'),
(10, 'Sushrutha', 'Sushrutha - Vice Captain');
-- --------------------------------------------------------
--
-- Table structure for table `voters`
--
CREATE TABLE `voters` (
`roll_no` varchar(35) NOT NULL COMMENT 'This field stores the roll number of the voter (student)',
`class` int(11) NOT NULL COMMENT 'This field stores the class of the voter (student)',
`section` varchar(10) NOT NULL COMMENT 'This field stores the section of the voter (student)',
`school_cap` varchar(11) NOT NULL COMMENT 'This field stores the candidate_id for whom the voter (student) has voted as school captain or ''None'' if candidates aren''t present',
`school_vcap` varchar(11) NOT NULL COMMENT 'This field stores the candidate_id for whom the voter (student) has voted as school vice captain or ''None'' if candidates aren''t present',
`house_cap` varchar(11) NOT NULL COMMENT 'This field stores the candidate_id for whom the voter (student) has voted as house captain or ''None'' if candidates aren''t present',
`house_vcap` varchar(11) NOT NULL COMMENT 'This field stores the candidate_id for whom the voter (student) has voted as house vice captain or ''None'' if candidates aren''t present'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table stores the details of the voters and their votes';
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `candidates`
--
ALTER TABLE `candidates`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `houses`
--
ALTER TABLE `houses`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'This field will contain the id of the administrator(s)', AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `candidates`
--
ALTER TABLE `candidates`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'This field stores the candidates'' id';
--
-- AUTO_INCREMENT for table `houses`
--
ALTER TABLE `houses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'This filed stores the id of the houses', AUTO_INCREMENT=11;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT USER
FROM DUAL;
--==>> SCOTT
SELECT *
FROM TBL_INSA;
--○ TBL_INSA 테이블을 대상으로
-- 주민번호(SSN)를 가지고 성별을 조회한다.
SELECT NAME, SSN
, DECODE(SUBSTR(SSN, 8, 1), '1', '남자', '2', '여자', '3', '남자', '4', '여자', '확인불가') "성별"
FROM TBL_INSA;
--○ TBL_INSA 테이블을 대상으로
-- 주민번호(SSN)를 가지고 성별을 조회한다.
-- 단, FN_GENDER() 함수를 활용한다.
SELECT NAME, SSN, FN_GENDER(SSN) "성별"
FROM TBL_INSA;
SELECT FN_GENDER('921204-1188035') "성별"
FROM DUAL;
SELECT FN_POW(2, 5)
FROM DUAL;
SELECT *
FROM TBL_INSA;
SELECT FN_PAY(BASICPAY, SUDANG)
FROM TBL_INSA;
SELECT FN_WORKYEAR(IBSADATE)
FROM TBL_INSA;
--------------------------------------------------------------------------------
-- 프로시저 관련 실습 진행 준비
-- 실습 테이블 생성(TBL_STUDENTS)
CREATE TABLE TBL_STUDENTS
( ID VARCHAR2(10)
, NAME VARCHAR2(40)
, TEL VARCHAR2(30)
, ADDR VARCHAR2(100)
);
--==>> Table TBL_STUDENTS이(가) 생성되었습니다.
-- 실습 테이블 생성(TBL_IDPW)
CREATE TABLE TBL_IDPW
( ID VARCHAR2(10)
, PW VARCHAR2(20)
, CONSTRAINT IDPW_ID_PK PRIMARY KEY(ID)
);
--==>> Table TBL_IDPW이(가) 생성되었습니다.
-- 두 테이블에 데이터 입력
INSERT INTO TBL_STUDENTS(ID, NAME, TEL, ADDR)
VALUES('superman', '김종호', '010-1111-1111', '제주도 서귀포시');
INSERT INTO TBL_IDPW(ID, PW)
VALUES('superman', 'java006$');
--==>> 1 행 이(가) 삽입되었습니다.
-- 확인
SELECT *
FROM TBL_IDPW;
--==>> superman java006$
-- 커밋
COMMIT;
--==>> 커밋 완료.
-- 위의 업무를 수행하는 프로시저(INSERT 프로시저, 입력 프로시저)를 생성하게 되면
-- [EXEC PRC_STUDENTS_INSERT('batman', 'java006$', '김일웅', '010-2222-2222', '서울 마포구');]
-- 이와 같은 구문 한 줄로 양쪽 테이블에 나누어 데이터를 모두 제대로 입력할 수 있다.
--※ 프로시저 생성 구문은 [20201016_03_scott(plsql).sql] 파일 참조~!!!
-- ○ 프로시저 테스트
EXEC PRC_STUDENTS_INSERT('batman', 'java006$', '김일웅', '010-2222-2222', '서울 마포구');
--==>> PL/SQL 프로시저가 성공적으로 완료되었습니다.
SELECT *
FROM TBL_STUDENTS;
--==>>
/*
superman 김종호 010-1111-1111 제주도 서귀포시
batman 김일웅 010-2222-2222 서울 마포구
*/
SELECT *
FROM TBL_IDPW
--==>>
/*
superman java006$
batman java006$
*/ |
--1) 각 과목의 과목명과 담당 교수의 교수명을 검색하라
SELECT PNAME 담당교수, CNAME 과목명
FROM COURSE
JOIN PROFESSOR USING(PNO);
--2) 화학과 학생의 기말고사 성적을 모두 검색하라
SELECT SNAME 이름, MAJOR 학과, RESULT 성적
FROM STUDENT
NATURAL JOIN SCORE
WHERE MAJOR = '화학';
--3) 유기화학과목 수강생의 기말고사 시험점수를 검색하라
SELECT CNAME 과목명, SNAME 학생이름, RESULT 시험점수
FROM SCORE
JOIN COURSE USING(CNO)
JOIN STUDENT USING(SNO)
WHERE CNAME = '유기화학';
--4) 화학과 학생이 수강하는 과목을 담당하는 교수의 명단을 검색하라
SELECT DISTINCT PNAME 교수명, CNAME 과목명, MAJOR 학과
FROM SCORE
JOIN STUDENT USING(SNO)
JOIN COURSE USING(CNO)
JOIN PROFESSOR USING(PNO)
WHERE MAJOR = '화학'
ORDER BY PNAME;
--5) 모든 교수의 명단과 담당 과목을 검색한다
SELECT PNAME 담당교수, CNAME 과목명
FROM COURSE
RIGHT JOIN PROFESSOR USING(PNO);
--6) 모든 교수의 명단과 담당 과목을 검색한다(단 모든 과목도 같이 검색한다)
SELECT PNAME 담당교수, CNAME 과목명
FROM COURSE
FULL JOIN PROFESSOR USING(PNO); |
CREATE procedure sp_insert_custpwd_log (
@CustID nvarchar(20),
@OldPwd nvarchar(200),
@NewPwd nvarchar(200),
@UserName nvarchar(50),
@Type as char(2)
)
as
if @OldPwd <> @NewPwd
begin
insert into passwordlog (customerid, oldpassword, newpassword, username, TransactionDate, Type)
values
(@CustID, @OldPwd, @NewPwd, @UserName, getdate(), @Type)
end
|
CREATE TABLE th_link_additions (
page_id INT,
page_namespace INT,
page_title INT,
rev_id INT,
rev_timestamp VARBINARY(20),
rev_comment VARBINARY(255),
link VARBINARY(255),
diff INT,
PRIMARY KEY(rev_id, link)
);
|
INSERT INTO Movie (id, title, genre, rating) VALUES (1, 'Movie1', 'genre1', '1234')
INSERT INTO Movie (id, title, genre, rating) VALUES (2, 'Movie2', 'genre2', '1235')
INSERT INTO Movie (id, title, genre, rating) VALUES (3, 'Movie3', 'genre3', '1236') |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 17, 2021 at 04:28 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `riafy`
--
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `nse_stocks`
--
CREATE TABLE `nse_stocks` (
`slno` int(12) UNSIGNED NOT NULL,
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`current_market_price` decimal(15,5) NOT NULL,
`market_cap` decimal(15,5) NOT NULL,
`stock_pe` decimal(15,5) NOT NULL,
`divident_yield` decimal(15,5) NOT NULL,
`roce` decimal(15,5) NOT NULL,
`roe_previous_annum` decimal(15,5) NOT NULL,
`debt_to_equity` decimal(15,5) NOT NULL,
`eps` decimal(15,5) NOT NULL,
`reserves` decimal(15,5) NOT NULL,
`debt` decimal(15,5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `nse_stocks`
--
INSERT INTO `nse_stocks` (`slno`, `name`, `current_market_price`, `market_cap`, `stock_pe`, `divident_yield`, `roce`, `roe_previous_annum`, `debt_to_equity`, `eps`, `reserves`, `debt`) VALUES
(1, 'Bhansali Engg.', '158.25000', '2625.46000', '7.86000', '0.63000', '86.18000', '20.21000', '0.00000', '20.13000', '664.76000', '0.00000'),
(2, 'Coal India', '147.45000', '90869.43000', '7.13000', '8.48000', '73.08000', '74.90000', '0.13000', '20.69000', '30920.81000', '4808.98000'),
(3, 'IOL Chemicals', '617.15000', '3623.01000', '7.88000', '0.65000', '68.87000', '69.54000', '0.02000', '78.78000', '1036.08000', '24.55000'),
(4, 'Dolat Investment', '72.50000', '1276.00000', '8.70000', '0.21000', '59.64000', '38.37000', '0.31000', '8.34000', '346.11000', '114.32000'),
(5, 'NDTV', '79.80000', '514.51000', '7.26000', '0.00000', '52.92000', '27.17000', '0.45000', '11.00000', '125.88000', '68.27000'),
(6, 'Balmer Law. Inv.', '480.25000', '1066.16000', '12.57000', '7.81000', '49.81000', '48.39000', '0.00000', '38.21000', '153.22000', '0.00000'),
(7, 'Ebixcash World', '681.25000', '758.09000', '14.63000', '0.00000', '43.76000', '-1.04000', '0.20000', '46.58000', '156.64000', '32.81000'),
(8, 'Mangalam Organic', '706.50000', '605.08000', '8.79000', '0.14000', '43.65000', '78.90000', '0.00000', '75.66000', '180.64000', '0.47000'),
(9, 'INEOS Styrolut.', '1321.75000', '2324.96000', '8.30000', '0.00000', '43.41000', '4.27000', '0.09000', '159.35000', '871.19000', '78.25000'),
(10, 'Expleo Solutions', '620.45000', '636.12000', '12.61000', '0.00000', '39.24000', '27.41000', '0.00000', '49.20000', '191.61000', '0.00000'),
(11, 'Sh. Jagdamba Pol', '637.65000', '558.45000', '13.65000', '0.04000', '38.30000', '34.66000', '0.28000', '46.71000', '131.90000', '37.21000'),
(12, 'Godawari Power', '955.90000', '3368.23000', '5.28000', '0.52000', '37.04000', '13.65000', '0.42000', '181.17000', '2001.48000', '852.45000'),
(13, 'Cigniti Tech.', '422.90000', '1184.97000', '11.25000', '0.59000', '36.36000', '58.18000', '0.12000', '37.60000', '344.33000', '45.67000'),
(14, 'Kirl. Ferrous', '245.20000', '3392.94000', '11.23000', '0.82000', '34.58000', '16.36000', '0.21000', '21.84000', '930.20000', '213.83000'),
(15, 'Rites', '246.70000', '5928.25000', '13.67000', '6.49000', '34.27000', '20.25000', '0.01000', '17.51000', '2451.95000', '33.48000'),
(16, 'Guj.St.Petronet', '272.05000', '15349.37000', '9.76000', '0.74000', '34.25000', '35.23000', '0.37000', '27.88000', '4926.22000', '2037.96000'),
(17, 'Ester Industries', '143.50000', '1196.70000', '8.42000', '1.74000', '33.27000', '27.52000', '0.33000', '17.04000', '474.91000', '172.54000'),
(18, 'Anjani Portland', '305.10000', '771.47000', '9.08000', '1.64000', '32.69000', '15.65000', '0.01000', '33.61000', '321.02000', '2.80000'),
(19, 'Venky\'s (India)', '2298.75000', '3238.33000', '12.10000', '0.00000', '32.05000', '-3.23000', '0.16000', '190.06000', '1090.33000', '177.82000'),
(20, 'Heritage Foods', '341.05000', '1582.40000', '10.61000', '0.73000', '31.70000', '-25.44000', '0.06000', '32.16000', '572.63000', '35.98000'),
(21, 'SIS', '393.80000', '5844.57000', '10.17000', '0.51000', '31.66000', '17.09000', '0.64000', '24.64000', '1756.61000', '1164.56000'),
(22, 'GTPL Hathway', '146.40000', '1646.46000', '8.75000', '2.05000', '31.53000', '16.50000', '0.16000', '16.73000', '767.67000', '140.96000'),
(23, 'Welspun Corp', '144.75000', '3777.24000', '7.02000', '7.25000', '29.60000', '-1.53000', '0.11000', '20.64000', '3256.75000', '365.75000'),
(24, 'I G Petrochems', '598.80000', '1844.00000', '9.78000', '0.33000', '29.58000', '3.14000', '0.15000', '61.08000', '791.20000', '125.94000'),
(25, 'Geojit Fin. Ser.', '68.00000', '1621.07000', '13.16000', '2.21000', '29.12000', '9.65000', '0.06000', '5.17000', '568.14000', '36.47000'),
(26, 'Sasken Technol.', '971.80000', '1462.64000', '12.77000', '3.09000', '28.84000', '13.22000', '0.00000', '76.11000', '549.50000', '0.00000'),
(27, 'Engineers India', '84.15000', '4729.59000', '13.76000', '6.12000', '28.78000', '15.73000', '0.00000', '5.44000', '2119.81000', '3.57000'),
(28, 'Petronet LNG', '236.20000', '35430.00000', '13.25000', '5.29000', '28.14000', '22.26000', '0.28000', '17.83000', '9990.19000', '3218.22000'),
(29, 'Saksoft', '508.40000', '533.31000', '11.74000', '0.89000', '26.35000', '20.16000', '0.14000', '43.32000', '196.24000', '28.46000'),
(30, 'Polyplex Corpn', '1187.20000', '3726.91000', '7.28000', '12.38000', '26.30000', '8.67000', '0.25000', '163.04000', '2996.69000', '758.00000');
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Sharon P Sabu', 'sharongraces1992@gmail.com', '2021-07-17 02:34:32', '$2y$10$QHtB0d7UYPIbCc3PzA2TbO7N/WbKipAyzicTa1NkQbS5SkvJZtfjC', NULL, '2021-07-16 21:04:03', '2021-07-16 21:04:03');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `nse_stocks`
--
ALTER TABLE `nse_stocks`
ADD PRIMARY KEY (`slno`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `nse_stocks`
--
ALTER TABLE `nse_stocks`
MODIFY `slno` int(12) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
ALTER TABLE unlocks ADD CONSTRAINT unlock_unique_constraint UNIQUE (team_id, rebus_id, type); |
-- schema 확인
desc book;
desc author;
-- insert author
insert into author values (null, '스테파니메이어');
select no, name from author;
-- insert book
insert into book values(null, '이클립스', 1, '대여가능');
select * from book;
-- select book
select b.no, b.title, b.status, a.name as author_name
from author a, book b
where a.no = b.author_no
order by b.no desc;
-- update book's status(no, status)
update book
set status = '대여중'
where no = 1;
select * from book; |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 09 mars 2020 à 18:41
-- Version du serveur : 5.7.26
-- Version de PHP : 7.2.18
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 données : `ems`
--
-- --------------------------------------------------------
--
-- Structure de la table `dossiers`
--
DROP TABLE IF EXISTS `dossiers`;
CREATE TABLE IF NOT EXISTS `dossiers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`patient` varchar(255) NOT NULL,
`tel` varchar(8) NOT NULL,
`cause` varchar(255) NOT NULL,
`itt` varchar(255) NOT NULL,
`charge` varchar(255) NOT NULL,
`facture` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`pass` varchar(255) NOT NULL,
`rank` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `users`
--
INSERT INTO `users` (`id`, `user`, `pass`, `rank`) VALUES
(10, 'admin', '$2y$10$3rqOHbE.8/5nzhUePXtweuauClpDE04Nkld2UjsRFTGez1gWCnVQW', 1);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
select * from movie;
insert into movie values
(11, 'What Keeps You Alive', 2018, 'R', 'Colin Minihan');
insert into movie values
(12, 'Joker', 2019, 'R', 'Todd Phillips');
insert into movie values
(13, 'As Above, So Below', 2014, 'R', 'John Erick Dowdle');
insert into movie values
(14, 'Flubber', 1997, 'PG', 'Les Mayfield');
insert into movie values
(15, 'The Spongebob Squarepants Movie', 2004, 'PG', 'Stephen Hillenburg');
insert into actor values
(5, 'Tom', 'Kenny', 'M', '1962-07-13')
|
CREATE TABLE titles (
title_id varchar(5) PRIMARY KEY,
title VARCHAR(30) NOT NULL
);
CREATE TABLE employees (
emp_no int PRIMARY KEY,
emp_title VARCHAR(5) NOT NULL,
FOREIGN KEY (emp_title) REFERENCES titles(title_id),
birth_date date not null,
first_name varchar(30) not null,
last_name varchar(30) not null,
sex varchar(1) not null,
CHECK (sex in ('M','F')),
hire_date date not null
);
CREATE TABLE salaries (
emp_no int PRIMARY KEY,
FOREIGN KEY (emp_no) REFERENCES employees(emp_no),
salary int not null
);
CREATE TABLE departments (
dept_no varchar(4) PRIMARY KEY,
dept_name varchar(30) not null
);
CREATE TABLE dept_manager (
dept_no varchar(4),
emp_no int not null,
PRIMARY KEY (dept_no, emp_no)
);
CREATE TABLE dept_manager (
dept_no varchar(4),
FOREIGN KEY (dept_no) REFERENCES departments(dept_no),
emp_no int not null,
FOREIGN KEY (emp_no) REFERENCES employees(emp_no),
PRIMARY KEY (dept_no, emp_no)
);
CREATE TABLE dept_emp (
emp_no int,
FOREIGN KEY (emp_no) REFERENCES employees(emp_no),
dept_no varchar(4) not null,
FOREIGN KEY (dept_no) REFERENCES departments(dept_no),
PRIMARY KEY (emp_no, dept_no)
);
-- 1 List the following details of each employee: employee number, last name, first name, sex, and salary.
SELECT employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary
FROM salaries
INNER JOIN employees ON employees.emp_no=salaries.emp_no;
-- 2 List first name, last name, and hire date for employees who were hired in 1986.
Select first_name, last_name, hire_date
From employees
where hire_date >= '1986-1-1' and hire_date <= '1986-12-31'
-- 3 List the manager of each department with the following information: department number, department name, the manager's employee number, last name, first name.
SELECT dept_manager.dept_no, departments.dept_name, dept_manager.emp_no, employees.last_name, employees.first_name
FROM departments
INNER JOIN dept_manager ON departments.dept_no=dept_manager.dept_no
INNER JOIN employees ON employees.emp_no=dept_manager.emp_no;
-- 4 List the department of each employee with the following information: employee number, last name, first name, and department name.
SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM employees
INNER JOIN dept_emp ON employees.emp_no=dept_emp.emp_no
INNER JOIN departments ON departments.dept_no=dept_emp.dept_no;
-- 5 List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B."
SELECT first_name, last_name, sex
from employees
where first_name = 'Hercules' and LEFT (last_name, 1) = 'B'
-- 6 List all employees in the Sales department, including their employee number, last name, first name, and department name.
SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM employees
INNER JOIN dept_emp ON employees.emp_no=dept_emp.emp_no
INNER JOIN departments ON departments.dept_no=dept_emp.dept_no
WHERE departments.dept_name = 'Sales';
-- 7 List all employees in the Sales and Development departments, including their employee number, last name, first name, and department name.
SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM employees
INNER JOIN dept_emp ON employees.emp_no=dept_emp.emp_no
INNER JOIN departments ON departments.dept_no=dept_emp.dept_no
WHERE departments.dept_name = 'Sales' or departments.dept_name = 'Development';
-- 8 In descending order, list the frequency count of employee last names, i.e., how many employees share each last name.
SELECT last_name, COUNT(last_name) AS "last_name_count"
FROM employees
GROUP BY last_name
ORDER BY "last_name_count" DESC; |
INSERT INTO users (user_name, first_name, last_name) VALUES
('lala', 'lala', 'lala'),
('lolo', 'lolo', 'lolo'); |
-- cg_servers
-- This table lists and describes the status
-- of local CG servers that have been registered
-- through the CG Chrome extension
CREATE TABLE cg_servers (
-- the unique id of the CG server
server_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
-- a text description of the server
server_desc VARCHAR(128) NOT NULL,
-- the address of the server
server_addr VARCHAR(256),
-- the status of the server (up or down)
server_stat VARCHAR(64),
-- the admin password for the server
server_pass VARCHAR(40),
-- a JSON encoded string describing
-- the current, previous, and next songs
-- in this CG server's GS play queue
server_songmeta TEXT,
-- the number of votes this server
-- requires for a song to be added
-- to the play queue
server_upvotes INT NOT NULL DEFAULT 0,
-- the number of down votes that
-- this server requires before
-- a request is dropped
server_downvotes INT NOT NULL DEFAULT 1,
-- the number of votes this
-- server requires to skip
-- a currently playing song
server_skipvotes INT NOT NULL DEFAULT 1,
server_cur_skip INT NOT NULL DEFAULT 0
);
-- requests
-- This table lists all of the CG requests
-- in the entire system, which may not scale.
-- CG servers will poll this table and treat requests
-- that reference their ID as a priority FIFO queue.
CREATE TABLE cg_requests (
-- the unique id of the request
-- ids will be unique across the entire system
req_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
-- The Grooveshark song ID that corresponds to this
-- request. Query->ID resolution is done on the client
-- side. This may be an INT later on...
req_song_id VARCHAR(20) NOT NULL,
req_song_name VARCHAR(64) NOT NULL,
req_artist VARCHAR(64) NOT NULL,
req_album VARCHAR(64) NOT NULL,
-- The unique id of the CG server that
-- this request was submitted to
req_server INT NOT NULL,
-- The unique id of the user that submitted
-- this request (later will be NOT NULL)
req_user varchar(16) NOT NULL,
-- a short blurb that the submitting user wrote about
-- the request
req_msg VARCHAR(256),
-- The number of up votes this song has received
req_upcount INT NOT NULL DEFAULT 0,
-- The number of down votes this song has received
req_downcount INT NOT NULL DEFAULT 0,
-- The status of this request, may indicate
-- things like 'ACCEPTED, PAUSED', etc., will
-- decide on this later
req_status VARCHAR(10),
-- The timestamp of this request
req_submit_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-- The priority of this request
-- this may be used later for voting logic
req_priority INT,
-- if the user disappears, delete their hanging requests
FOREIGN KEY (req_user) REFERENCES cg_users(user_name) ON DELETE CASCADE
);
-- cg_users
-- This table describes user data
CREATE TABLE cg_users (
-- The user's alias
user_name VARCHAR(16) NOT NULL PRIMARY KEY,
-- The user's password, will be 40B SHA-1 hex digest
-- (can't get SHA-2 until MySQL 5.5)
user_pass VARCHAR(40) NOT NULL,
user_address VARCHAR(128),
user_email VARCHAR(64),
-- for user statistics
-- total number of requested songs
user_req_count INT DEFAULT 0,
-- the number of requested
-- songs that have been added
-- to the play queue
user_added_reqs INT DEFAULT 0,
-- the number of requested songs
-- that were completely voted down
user_dropped_reqs INT DEFAULT 0,
-- the last Groove this
-- user was participating
-- in
user_last_server INT,
-- the last song this user requested
user_last_req_song VARCHAR(64),
-- # times this user's requests have
-- been voted up
user_total_up_votes INT DEFAULT 0,
-- # times this user's requests have
-- been voted down
user_total_down_votes INT DEFAULT 0,
FOREIGN KEY (user_last_server) REFERENCES cg_servers(server_id)
);
CREATE TABLE cg_messages (
msg_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
sender VARCHAR(16) NOT NULL,
receiver VARCHAR(16) NOT NULL,
msg_body TEXT,
time_sent TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
}
--
|
drop table if exists user;
create table user(
id int not null primary key AUTO_INCREMENT,
username varchar(40),
password varchar(40),
age int(3),
balance double(10,2) not null
) ENGINE=INNODB AUTO_INCREMENT=1000 default CHARSET=utf8;
insert into user(id,username,password,age,balance) values(1,'张三','123',22,40.00);
insert into user(id,username,password,age,balance) values(2,'李四','123',22,40.00);
insert into user(id,username,password,age,balance) values(3,'王五','123',22,40.00);
insert into user(id,username,password,age,balance) values(4,'赵六','123',22,40.00); |
create database if not exists admin;
create database if not exists student;
use admin;
CREATE TABLE users (username VARCHAR(255), password VARCHAR(255));
use student;
CREATE TABLE users (username VARCHAR(255), password VARCHAR(255)); |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 17, 2013 at 04:59 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `robh_3720`
--
-- --------------------------------------------------------
--
-- Table structure for table `doctor`
--
CREATE TABLE IF NOT EXISTS `doctor` (
`Doctor_ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(50) NOT NULL,
`Phone` varchar(50) DEFAULT NULL,
`Start_Date` date NOT NULL,
`End_Date` date DEFAULT NULL,
PRIMARY KEY (`Doctor_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Triggers `doctor`
--
DROP TRIGGER IF EXISTS `History Settings Auto`;
DELIMITER //
CREATE TRIGGER `History Settings Auto` AFTER INSERT ON `doctor`
FOR EACH ROW BEGIN
INSERT INTO Doctor_History(Doctor_ID)
VALUES (NEW.Doctor_ID);
END
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `doctor_history`
--
CREATE TABLE IF NOT EXISTS `doctor_history` (
`Doctor_ID` int(11) NOT NULL,
`Weekday` int(11) NOT NULL DEFAULT '0',
`Weekend` int(11) NOT NULL DEFAULT '0',
`Holiday` int(11) NOT NULL DEFAULT '0',
`Theoretical_Weekend` int(11) NOT NULL DEFAULT '0',
`Theoretical_Weekday` int(11) NOT NULL DEFAULT '0',
`Theoretical_Holiday` int(11) NOT NULL DEFAULT '0',
`Total_Holiday` int(11) NOT NULL DEFAULT '0',
`Total_Weekend` int(11) NOT NULL DEFAULT '0',
`Total_Weekday` int(11) NOT NULL DEFAULT '0',
`Previous_Weekday` int(11) NOT NULL DEFAULT '0',
`Previous_Weekend` int(11) NOT NULL DEFAULT '0',
`Previous_Holiday` int(11) NOT NULL DEFAULT '0',
KEY `Doctor_ID` (`Doctor_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Triggers `doctor_history`
--
DROP TRIGGER IF EXISTS `Theoretical`;
DELIMITER //
CREATE TRIGGER `Theoretical` BEFORE INSERT ON `doctor_history`
FOR EACH ROW BEGIN
IF (SELECT COUNT(*) FROM Doctor_History) <> 0 THEN
BEGIN
SET NEW.Theoretical_Weekday = (SELECT AVG(Weekday) FROM Doctor_History);
SET NEW.Theoretical_Weekend = (SELECT AVG(Weekend) FROM Doctor_History);
SET NEW.Theoretical_Holiday = (SELECT AVG(Holiday) FROM Doctor_History);
SET NEW.Total_Weekday = (SELECT AVG(Weekday) FROM Doctor_History);
SET NEW.Total_Weekend = (SELECT AVG(Weekend) FROM Doctor_History);
SET NEW.Total_Holiday = (SELECT AVG(Holiday) FROM Doctor_History);
END;
END IF;
END
//
DELIMITER ;
DROP TRIGGER IF EXISTS `Total`;
DELIMITER //
CREATE TRIGGER `Total` BEFORE UPDATE ON `doctor_history`
FOR EACH ROW BEGIN
SET NEW.Total_Weekday = NEW.Weekday + NEW.Theoretical_Weekday;
SET NEW.Total_Weekend = NEW.Weekend + NEW.Theoretical_Weekend;
SET NEW.Total_Holiday = NEW.Holiday + NEW.Theoretical_Holiday;
END
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `requests`
--
CREATE TABLE IF NOT EXISTS `requests` (
`Doctor_ID` int(11) NOT NULL,
`Type` int(1) NOT NULL,
`Date` date NOT NULL,
KEY `Doctor_ID` (`Doctor_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `schedule`
--
CREATE TABLE IF NOT EXISTS `schedule` (
`Month` int(2) NOT NULL,
`Year` int(4) NOT NULL,
`1` int(11) NOT NULL,
`2` int(11) NOT NULL,
`3` int(11) NOT NULL,
`4` int(11) NOT NULL,
`5` int(11) NOT NULL,
`6` int(11) NOT NULL,
`7` int(11) NOT NULL,
`8` int(11) NOT NULL,
`9` int(11) NOT NULL,
`10` int(11) NOT NULL,
`11` int(11) NOT NULL,
`12` int(11) NOT NULL,
`13` int(11) NOT NULL,
`14` int(11) NOT NULL,
`15` int(11) NOT NULL,
`16` int(11) NOT NULL,
`17` int(11) NOT NULL,
`18` int(11) NOT NULL,
`19` int(11) NOT NULL,
`20` int(11) NOT NULL,
`21` int(11) NOT NULL,
`22` int(11) NOT NULL,
`23` int(11) NOT NULL,
`24` int(11) NOT NULL,
`25` int(11) NOT NULL,
`26` int(11) NOT NULL,
`27` int(11) NOT NULL,
`28` int(11) NOT NULL,
`29` int(11) DEFAULT NULL,
`30` int(11) DEFAULT NULL,
`31` int(11) DEFAULT NULL,
PRIMARY KEY (`Month`,`Year`),
KEY `1` (`1`),
KEY `2` (`2`),
KEY `3` (`3`),
KEY `4` (`4`),
KEY `5` (`5`),
KEY `6` (`6`),
KEY `7` (`7`),
KEY `8` (`8`),
KEY `9` (`9`),
KEY `10` (`10`),
KEY `11` (`11`),
KEY `12` (`12`),
KEY `13` (`13`),
KEY `14` (`14`),
KEY `15` (`15`),
KEY `16` (`16`),
KEY `17` (`17`),
KEY `18` (`18`),
KEY `19` (`19`),
KEY `20` (`20`),
KEY `21` (`21`),
KEY `22` (`22`),
KEY `23` (`23`),
KEY `24` (`24`),
KEY `25` (`25`),
KEY `26` (`26`),
KEY `27` (`27`),
KEY `28` (`28`),
KEY `29` (`29`),
KEY `30` (`30`),
KEY `31` (`31`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `doctor_history`
--
ALTER TABLE `doctor_history`
ADD CONSTRAINT `Doctor_History_ibfk_1` FOREIGN KEY (`Doctor_ID`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `requests`
--
ALTER TABLE `requests`
ADD CONSTRAINT `Requests_ibfk_1` FOREIGN KEY (`Doctor_ID`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `schedule`
--
ALTER TABLE `schedule`
ADD CONSTRAINT `Schedule_ibfk_1` FOREIGN KEY (`1`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_10` FOREIGN KEY (`9`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_11` FOREIGN KEY (`10`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_12` FOREIGN KEY (`10`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_13` FOREIGN KEY (`11`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_14` FOREIGN KEY (`11`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_15` FOREIGN KEY (`12`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_16` FOREIGN KEY (`13`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_17` FOREIGN KEY (`14`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_18` FOREIGN KEY (`15`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_19` FOREIGN KEY (`16`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_2` FOREIGN KEY (`2`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_20` FOREIGN KEY (`17`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_21` FOREIGN KEY (`18`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_22` FOREIGN KEY (`19`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_23` FOREIGN KEY (`20`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_24` FOREIGN KEY (`21`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_25` FOREIGN KEY (`22`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_26` FOREIGN KEY (`23`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_27` FOREIGN KEY (`24`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_28` FOREIGN KEY (`25`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_29` FOREIGN KEY (`26`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_3` FOREIGN KEY (`3`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_30` FOREIGN KEY (`27`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_31` FOREIGN KEY (`28`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_32` FOREIGN KEY (`29`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_33` FOREIGN KEY (`30`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_34` FOREIGN KEY (`31`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_5` FOREIGN KEY (`4`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_6` FOREIGN KEY (`5`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_7` FOREIGN KEY (`6`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_8` FOREIGN KEY (`7`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `Schedule_ibfk_9` FOREIGN KEY (`8`) REFERENCES `doctor` (`Doctor_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- +migrate Up
CREATE TABLE IF NOT EXISTS `single_products` (
`id` BIGINT UNSIGNED AUTO_INCREMENT,
`brand_id` INT UNSIGNED NOT NULL,
`category_id` INT UNSIGNED NOT NULL,
`product_type_id` INT UNSIGNED NOT NULL,
`name` VARCHAR(255) NOT NULL,
`description` TEXT NOT NULL,
`status` VARCHAR(10) NOT NULL DEFAULT "A",
`created_at` TIMESTAMP NULL,
`updated_at` TIMESTAMP NULL,
`deleted_at` TIMESTAMP NULL,
PRIMARY KEY (`id`),
CONSTRAINT single_products_brand_id FOREIGN KEY(brand_id) references brands(id),
CONSTRAINT single_products_category_id FOREIGN KEY(category_id) references categories(id)
);
-- +migrate Down
DROP TABLE `single_products`; |
/*Create database HawaiiTourism_DB*/
CREATE TABLE visitors
(
id serial NOT NULL,
indicators text,
island_name text,
visiting_year integer,
january real,
february real,
march real,
april real,
may real,
june real,
july real,
august real,
september real,
october real,
november real,
december real,
PRIMARY KEY (id)
);
CREATE TABLE rental_performance
(
id integer NOT NULL,
island_name character varying(100),
city character varying(50),
unit_supply character varying(30),
unit_demand character varying(30),
unit_occupancy character varying(30),
unit_avg_daily_rate character varying(30),
month character varying(20),
year integer
);
|
-- 1. Create a MySQL Database called `bamazon`.
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
-- 2. Then create a Table inside of that database called `products`.
CREATE TABLE products
(
-- * item_id (unique id for each product)
item_id INT
AUTO_INCREMENT NOT NULL,
-- * product_name (Name of product)
product_name VARCHAR
(45) NOT NULL,
-- * department_name
department_name VARCHAR
(45) NOT NULL,
-- * price (cost to customer)
price DECIMAL
(10,2) NOT NULL,
-- * stock_quantity (how much of the product is available in stores)
stock_quantity INT
(10) NOT NULL,
primary key
(item_id)
);
SELECT *
FROM products;
-- 4. Populate this database with around 10 different products. (i.e. Insert "mock" data rows into this database and table).
INSERT INTO products
(product_name, department_name, price, stock_quantity)
VALUES
("Super Mario Bros. 3", "Video Games", 29.99, 3),
("Halo 3", "Video Games", 59.99, 140),
("Scrapple", "Food and Drink", 14.50, 650),
("Rainbow Suspenders", "Apparel", 23.00, 75),
("Parachute Pants", "Apparel", 54.25, 7),
("Breakfast of Champions", "Books", 19.99, 42),
("Catch 22", "Books", 16.99, 25),
("Dead Alive", "Films", 29.99, 4),
("Catch 22", "Films", 30.50, 14),
("One Flew Over The Cuckoos Nest", "Books", 19.95, 23);
|
Create Procedure Sp_Han_IsValid_SRReason
(
@Return_Type int,
@ReasonID int
)
As
Begin
If @Return_Type = 1
Begin
Select Reason_Type_ID From ReasonMaster Where Reason_SubType = 1 and Reason_Type_ID = @ReasonID
End
Else If @Return_Type = 2
Begin
Select Reason_Type_ID From ReasonMaster Where Reason_SubType = 2 and Reason_Type_ID = @ReasonID
End
End
|
Create Procedure Sp_Select_PricingPaymentDetail(@ItemCode NVarChar(15),@CustType Int)
As
If @CustType = 1
Select
PPD.SalePrice,PA.SlabStart,PA.SlabEnd,CS.SegmentName,PT.Value
From
PricingPaymentDetail PPD,PricingSegmentDetail PSD,PricingAbstract PA,CustomerSegment CS,PaymentTerm PT
Where
PA.ItemCode = @ItemCode
And PA.PricingSerial = PSD.PricingSerial
And PSD.SegmentSerial = PPD.SegmentSerial
And PSD.SegmentID = CS.SegmentID
And PPD.PaymentMode = PT.Mode
Else
Select
PPD.SalePrice,PA.SlabStart,PA.SlabEnd,CC.ChannelDesc,PT.Value
From
PricingPaymentDetail PPD,PricingSegmentDetail PSD,PricingAbstract PA,Customer_Channel CC,PaymentTerm PT
Where
PA.ItemCode = @ItemCode
And PA.PricingSerial = PSD.PricingSerial
And PSD.SegmentSerial = PPD.SegmentSerial
And PSD.SegmentID = CC.ChannelType
And PPD.PaymentMode = PT.Mode
|
select a.applicationid
, a.bundleid
, u.userid
, u.globaluserid
, u.created
, g.emailaddress
, g.username
, g.seamlesslogintoken
from authdb.dbo.applications a
join authdb.dbo.is_users u
on a.applicationid = u.applicationid
join ratings.dbo.globaluserdetails g
on a.bundleid = g.bundleid
and u.globaluserid = g.globaluserid
where (a.applicationid = '8297E8AB-EEE4-43DC-A37E-5D1A07E527C0'
or a.applicationid = '23BDE4BF-CCB3-4C21-9C04-0F515D826C88'
or a.applicationid = '904434F2-C7C7-4C84-A972-BEE9EF324900'
or a.applicationid = 'F0D34EF9-BA6E-4611-A57B-4C528D8E32A8'
or a.applicationid = 'FF757ECB-56A1-41B1-AC02-5F609C3DB3DA')
and u.isdisabled = 0
and g.isdisabled = 0;
|
/*
SQLyog Community v8.71
MySQL - 5.5.25a : Database - comovamos
*********************************************************************
*/
/*!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*/`comovamos` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `comovamos`;
/*Table structure for table `com_actividades` */
DROP TABLE IF EXISTS `com_actividades`;
CREATE TABLE `com_actividades` (
`ACT_id` int(11) NOT NULL AUTO_INCREMENT,
`ACT_nombre` varchar(45) DEFAULT NULL,
`ACT_TipodeActividad` int(11) NOT NULL,
PRIMARY KEY (`ACT_id`),
KEY `fk_Actividad_TipoDeActividad1_idx` (`ACT_TipodeActividad`),
CONSTRAINT `fk_Actividad_TipoDeActividad1` FOREIGN KEY (`ACT_TipodeActividad`) REFERENCES `com_tipodeactividades` (`TIP_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `com_actividades` */
/*Table structure for table `com_detallepreguntas` */
DROP TABLE IF EXISTS `com_detallepreguntas`;
CREATE TABLE `com_detallepreguntas` (
`DET_id` int(11) NOT NULL AUTO_INCREMENT,
`DET_Pregunta` varchar(100) NOT NULL,
`DET_TipoResultado` varchar(20) DEFAULT NULL,
`DET_Formula` varchar(100) DEFAULT '0',
`DET_Resultado` varchar(100) DEFAULT NULL,
`DET_Periodo` varchar(100) DEFAULT NULL,
`DET_Fecha` date DEFAULT NULL,
`DET_Color` varchar(10) DEFAULT NULL,
`DET_Plantilla` int(11) NOT NULL,
PRIMARY KEY (`DET_id`),
KEY `fk_COM_DetallesEncuestas_COM_Encuestas1_idx` (`DET_Plantilla`),
CONSTRAINT `fk_COM_DetallesEncuestas_COM_Encuestas1` FOREIGN KEY (`DET_Plantilla`) REFERENCES `com_plantilla` (`PLA_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*Data for the table `com_detallepreguntas` */
insert into `com_detallepreguntas`(`DET_id`,`DET_Pregunta`,`DET_TipoResultado`,`DET_Formula`,`DET_Resultado`,`DET_Periodo`,`DET_Fecha`,`DET_Color`,`DET_Plantilla`) values (1,'El num de aprobados con 9-10','no calculada','0','15','2012-11-25','2012-11-25','Verde',25),(2,'El num de aprob con 7-8','no calc','0','50','2012-11-25','2012-11-25','Naranja',1),(3,'El num de aprob con 6','no calc','0','25','2012-11-25','2012-11-25','Azul',26),(4,'El num de reprobados','no calc','0','10','2012-11-25','2012-11-25','Rojo',27);
/*Table structure for table `com_entidad` */
DROP TABLE IF EXISTS `com_entidad`;
CREATE TABLE `com_entidad` (
`DZN_id` int(11) NOT NULL AUTO_INCREMENT,
`DZN_NombreEntidad` varchar(100) NOT NULL,
`DZN_descripcion` varchar(400) DEFAULT NULL,
`DZN_Region` int(11) NOT NULL,
PRIMARY KEY (`DZN_id`),
KEY `fk_COM_DetalleZonas_COM_Zonas1_idx` (`DZN_Region`),
CONSTRAINT `fk_COM_DetalleZonas_COM_Zonas1` FOREIGN KEY (`DZN_Region`) REFERENCES `com_region` (`REG_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `com_entidad` */
insert into `com_entidad`(`DZN_id`,`DZN_NombreEntidad`,`DZN_descripcion`,`DZN_Region`) values (1,'Fac. Economía','Campus xalapa',1),(2,'Fac.Psicología','Campus Coatzacoalcos',4);
/*Table structure for table `com_historial` */
DROP TABLE IF EXISTS `com_historial`;
CREATE TABLE `com_historial` (
`HIS_id` int(11) NOT NULL AUTO_INCREMENT,
`HIS_Usuario` int(11) NOT NULL,
`HIS_Actividad` int(11) NOT NULL,
`HIS_fecha` varchar(45) DEFAULT NULL,
`HIS_hora` varchar(45) DEFAULT NULL,
PRIMARY KEY (`HIS_id`),
KEY `fk_Historial_Usuario_idx` (`HIS_Usuario`),
KEY `fk_Historial_Actividad1_idx` (`HIS_Actividad`),
CONSTRAINT `fk_Historial_Usuario` FOREIGN KEY (`HIS_Usuario`) REFERENCES `com_usuarios` (`USU_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_Historial_Actividad1` FOREIGN KEY (`HIS_Actividad`) REFERENCES `com_actividades` (`ACT_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `com_historial` */
/*Table structure for table `com_indicador` */
DROP TABLE IF EXISTS `com_indicador`;
CREATE TABLE `com_indicador` (
`IND_id` int(11) NOT NULL AUTO_INCREMENT,
`IND_Nombre` varchar(45) NOT NULL,
`IND_Formula` varchar(100) DEFAULT NULL,
`IND_Color` varchar(10) DEFAULT NULL,
`IND_Padre` int(11) DEFAULT NULL,
PRIMARY KEY (`IND_id`),
KEY `fk_COM_Indicador_COM_Indicador1_idx` (`IND_Padre`),
CONSTRAINT `fk_COM_Indicador_COM_Indicador1` FOREIGN KEY (`IND_Padre`) REFERENCES `com_indicador` (`IND_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `com_indicador` */
insert into `com_indicador`(`IND_id`,`IND_Nombre`,`IND_Formula`,`IND_Color`,`IND_Padre`) values (1,'Tiempo de espera','2+2','Azul',1),(2,'Edad de egreso','a+4','verde',2);
/*Table structure for table `com_perfiles` */
DROP TABLE IF EXISTS `com_perfiles`;
CREATE TABLE `com_perfiles` (
`PERF_id` int(11) NOT NULL AUTO_INCREMENT,
`PERF_nombre` varchar(45) DEFAULT NULL,
PRIMARY KEY (`PERF_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `com_perfiles` */
insert into `com_perfiles`(`PERF_id`,`PERF_nombre`) values (1,'Administrador');
/*Table structure for table `com_plantilla` */
DROP TABLE IF EXISTS `com_plantilla`;
CREATE TABLE `com_plantilla` (
`PLA_id` int(11) NOT NULL AUTO_INCREMENT,
`PLA_NomPlantilla` varchar(100) NOT NULL,
`PLA_Descripcion` varchar(300) DEFAULT NULL,
`PLA_FechaRegistro` datetime DEFAULT NULL,
`PLA_TituloResultado` varchar(100) NOT NULL,
`PLA_Meta` int(11) DEFAULT NULL,
`PLA_Indicador` int(11) NOT NULL,
`PLA_Usuario` int(11) NOT NULL,
`PLA_Region` int(11) DEFAULT NULL,
`PLA_Entidad` int(11) DEFAULT NULL,
PRIMARY KEY (`PLA_id`),
KEY `fk_COM_Encuestas_COM_Usuario1_idx` (`PLA_Usuario`),
KEY `fk_COM_Plantila_COM_Indicador1_idx` (`PLA_Indicador`),
KEY `fk_COM_Plantilla_COM_Region1_idx` (`PLA_Region`),
KEY `fk_COM_Plantilla_COM_Entidad1_idx` (`PLA_Entidad`),
CONSTRAINT `fk_COM_Encuestas_COM_Usuario1` FOREIGN KEY (`PLA_Usuario`) REFERENCES `com_usuarios` (`USU_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_COM_Plantila_COM_Indicador1` FOREIGN KEY (`PLA_Indicador`) REFERENCES `com_indicador` (`IND_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_COM_Plantilla_COM_Entidad1` FOREIGN KEY (`PLA_Entidad`) REFERENCES `com_entidad` (`DZN_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_COM_Plantilla_COM_Region1` FOREIGN KEY (`PLA_Region`) REFERENCES `com_region` (`REG_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
/*Data for the table `com_plantilla` */
insert into `com_plantilla`(`PLA_id`,`PLA_NomPlantilla`,`PLA_Descripcion`,`PLA_FechaRegistro`,`PLA_TituloResultado`,`PLA_Meta`,`PLA_Indicador`,`PLA_Usuario`,`PLA_Region`,`PLA_Entidad`) values (1,'Calif entre 7-10','Numero de aprobados con 7-8','2012-11-20 00:00:00','Aprobado 7-8',10,1,1,1,1),(25,'Calif entre 9-10','Numero de aprobados con 9 o 10','2012-11-20 00:00:00','Aprobado 9-10',10,1,1,1,1),(26,'Calif 6','Numero de aprobados con 6','2012-11-20 00:00:00','Aprobado 6',10,1,1,1,1),(27,'Calif de 5 o menos','Numero de reprobados','2012-11-20 00:00:00','Reprobado',1,1,1,1,1);
/*Table structure for table `com_region` */
DROP TABLE IF EXISTS `com_region`;
CREATE TABLE `com_region` (
`REG_id` int(11) NOT NULL AUTO_INCREMENT,
`REG_nombreRegion` varchar(150) NOT NULL,
PRIMARY KEY (`REG_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*Data for the table `com_region` */
insert into `com_region`(`REG_id`,`REG_nombreRegion`) values (1,'Veracruz'),(2,'Xalapa'),(3,'Poza Rica'),(4,'Coatza');
/*Table structure for table `com_tipodeactividades` */
DROP TABLE IF EXISTS `com_tipodeactividades`;
CREATE TABLE `com_tipodeactividades` (
`TIP_id` int(11) NOT NULL AUTO_INCREMENT,
`TIP_nombre` varchar(45) DEFAULT NULL,
PRIMARY KEY (`TIP_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `com_tipodeactividades` */
/*Table structure for table `com_usuarios` */
DROP TABLE IF EXISTS `com_usuarios`;
CREATE TABLE `com_usuarios` (
`USU_id` int(11) NOT NULL AUTO_INCREMENT,
`USU_usuario` varchar(45) NOT NULL,
`USU_contraseña` varchar(45) NOT NULL,
`USU_Perfiles` int(11) NOT NULL,
`USU_nombreCompleto` varchar(45) DEFAULT NULL,
`USU_dirección` varchar(45) DEFAULT NULL,
`USU_teléfono` varchar(45) DEFAULT NULL,
`USU_correo` varchar(45) DEFAULT NULL,
`USU_PreguntaSecreta` int(11) NOT NULL,
PRIMARY KEY (`USU_id`),
KEY `fk_Usuario_Perfil1_idx` (`USU_Perfiles`),
CONSTRAINT `fk_Usuario_Perfil1` FOREIGN KEY (`USU_Perfiles`) REFERENCES `com_perfiles` (`PERF_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `com_usuarios` */
insert into `com_usuarios`(`USU_id`,`USU_usuario`,`USU_contraseña`,`USU_Perfiles`,`USU_nombreCompleto`,`USU_dirección`,`USU_teléfono`,`USU_correo`,`USU_PreguntaSecreta`) values (1,'marisol','marisol',1,'marisol','conocdia','2','2',0);
/*!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 travel(
id BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
travel VARCHAR(30) NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO travel (travel) values ('Rio de Janeiro');
INSERT INTO travel (travel) values ('São Paulo'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.