blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
3
276
src_encoding
stringclasses
33 values
length_bytes
int64
23
9.61M
score
float64
2.52
5.28
int_score
int64
3
5
detected_licenses
listlengths
0
44
license_type
stringclasses
2 values
text
stringlengths
23
9.43M
download_success
bool
1 class
4907500a107dfd3e8caa0f771a552fc17e76e9a3
SQL
reference-project/php
/qf_php.sql
UTF-8
13,159
2.921875
3
[ "Apache-2.0" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.4.15.6 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 2017-08-22 15:59:48 -- 服务器版本: 5.5.48-log -- PHP Version: 7.0.7 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: `qf_php` -- -- -------------------------------------------------------- -- -- 表的结构 `qf_admin` -- CREATE TABLE IF NOT EXISTS `qf_admin` ( `id` int(11) NOT NULL, `name` varchar(30) CHARACTER SET utf8 NOT NULL, `pwd` char(32) CHARACTER SET utf8 NOT NULL, `create_time` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `qf_admin` -- INSERT INTO `qf_admin` (`id`, `name`, `pwd`, `create_time`) VALUES (1, 'admin', 'd92e10938a91accb632d71175a7549dd', 1495526072), (2, 'yx_admin', '6baedcb9bdd0fa51714e0308243e51cb', 1496237673), (3, 'wz_admin', 'a66824169e2322f3977bb8bca0e0b1cb', 1496237716); -- -------------------------------------------------------- -- -- 表的结构 `qf_record` -- CREATE TABLE IF NOT EXISTS `qf_record` ( `r_id` int(11) NOT NULL, `u_id` int(11) NOT NULL COMMENT '用户ID', `h_id` int(11) NOT NULL COMMENT '谁帮助的用户ID', `h_money` decimal(7,2) NOT NULL DEFAULT '0.00' COMMENT '助力金额', `register_time` int(11) NOT NULL COMMENT '创建时间' ) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `qf_record` -- INSERT INTO `qf_record` (`r_id`, `u_id`, `h_id`, `h_money`, `register_time`) VALUES (1, 3, 4, '3.41', 1501582203), (2, 3, 5, '4.33', 1501582321), (5, 3, 6, '4.71', 1501584792), (32, 3, 8, '10.44', 1501837482), (33, 3, 3, '11.29', 1501837964), (34, 3, 9, '14.76', 1501838915), (35, 3, 5, '14.73', 1501839246), (36, 3, 10, '3.00', 1501839246), (37, 3, 11, '3.30', 1501839246), (38, 3, 12, '1.00', 1501839246), (39, 3, 13, '3.20', 1501839246), (40, 3, 14, '4.00', 1501839246), (41, 3, 15, '2.00', 1501839246), (42, 3, 16, '1.50', 1501839246), (43, 3, 17, '2.00', 1501839246), (44, 3, 18, '5.00', 1501839246), (45, 3, 19, '6.00', 1501839246), (50, 3, 20, '3.03', 1502066248), (51, 20, 20, '11.06', 1502066347), (52, 5, 5, '14.00', 1502066779), (53, 21, 21, '10.25', 1502072724), (66, 3, 7, '4.50', 1502078162), (67, 5, 5, '11.41', 1502079088), (78, 5, 3, '3.05', 1502106340), (79, 23, 23, '14.31', 1502109024), (80, 24, 24, '10.05', 1502186713), (81, 10, 10, '11.86', 1502186881), (82, 24, 3, '4.91', 1502186927), (83, 32, 32, '12.48', 1502208306), (84, 9, 9, '13.59', 1502344686), (85, 23, 3, '3.92', 1502606556), (86, 22, 5, '4.96', 1502776464), (87, 22, 22, '12.47', 1502776486), (88, 5, 22, '4.10', 1502776527), (91, 22, 3, '3.29', 1502787313); -- -------------------------------------------------------- -- -- 表的结构 `qf_user` -- CREATE TABLE IF NOT EXISTS `qf_user` ( `id` int(11) NOT NULL, `wx_openid` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '微信openid', `wx_name` varchar(50) CHARACTER SET utf8mb4 NOT NULL COMMENT '微信昵称', `wx_headimgurl` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '微信头像', `help_money` decimal(7,2) NOT NULL DEFAULT '0.00', `help_num` int(11) NOT NULL DEFAULT '0' COMMENT '助力人数', `real_name` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '真实姓名', `phone` char(11) CHARACTER SET utf8 DEFAULT NULL COMMENT '手机号码', `m_money` float DEFAULT NULL COMMENT '自己抢的金额', `status` tinyint(11) NOT NULL DEFAULT '0' COMMENT '助力到1000标识', `create_time` int(11) NOT NULL COMMENT '创建时间', `over_time` int(11) NOT NULL COMMENT '完成时间', `update_time` int(11) NOT NULL COMMENT '修改时间', `from_stu` int(4) DEFAULT '1' COMMENT '为1是网络咨询,2是院校', `ispay` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否缴费1是交费' ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 转存表中的数据 `qf_user` -- INSERT INTO `qf_user` (`id`, `wx_openid`, `wx_name`, `wx_headimgurl`, `help_money`, `help_num`, `real_name`, `phone`, `m_money`, `status`, `create_time`, `over_time`, `update_time`, `from_stu`, `ispay`) VALUES (3, 'oOeQPxN4YBxFe7MhXLtwtBrulCzM', '王丽娟😎', 'http://wx.qlogo.cn/mmhead/Q3auHgzwzM4OvBNF5cpFetg83cxNGc56ibBHGAK2TRobYWEmtNqaIpQ/0', '0.00', 0, NULL, NULL, NULL, 0, 1500606719, 0, 1502096531, 1, 1), (4, 'oOeQPxGiDVW2aQPFmz8kM5qw4apI', '洪涛同學', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTumRibrBTEh4UXbnHQOzhiaKuHnPzdzPapwpXGXrGpzaR6OMH6Nibk2ckpLxdsnyvCOibtI1wDQHMwUmJkznk8icFaBEg/0', '0.00', 0, NULL, NULL, NULL, 0, 1500884191, 0, 1500884191, 1, 0), (5, 'oOeQPxJz41xHSf1ZXqfTU6rPdxro', '白开水一样', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnQlr9Wq2ia0G5GicnMYMPItnQXZeG1GxkHZdDZ6BAPQichy3Ke6uAX7sn1earrcuwlEjBibicRNPjc2PorEkkMTbgSzO/0', '32.56', 4, '薛美娟', '17801072011', 11.41, 2, 1501564099, 0, 1502776527, 2, 0), (6, 'oOeQPxPJ6d80dWAo4IVgJkU2c8_I', '婷', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtiaSbJdKZNG5BLcL6DIdqkWBClfHBndfFGia2fQEHfEolplxeGjCTbqg4cPexVSicklRHKGzQIiaJfxGOJ4eusI4ILJ/0', '204.06', 30, '马婷', '13260351938', NULL, 1, 1501586416, 0, 1502097856, 1, 0), (7, 'oOeQPxPK2yeDZL3o57g5nylfEOIg', 'Hello World', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtgprRibEK83dI4lgnLbqtD6w5X0Ars5AcsnY2EQAIsJ7ZZAf6eDqgeHpRkEtHEQRmcPEsrfbuC2hrbYyODtXyXjp/0', '0.00', 0, '陈蔚磊', '13211760635', NULL, 0, 1501666811, 0, 1501667960, 1, 0), (8, 'oOeQPxNt9_YUfGHuNV-ZYLCmIt7I', 'My name are HAPPY', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTumRibrBTEh4UXYTfGyPpny15wbh6nY69nw0PnjqesTic5uCiblF0ib2q73rMLd1J0hUccCcDgm2NKCH605nUHaIAW3u/0', '0.00', 0, NULL, NULL, NULL, 0, 1495782479, 1495782479, 1495782479, 1, 0), (9, 'oOeQPxI-RX5CqwpU1j-lsOEMufOI', 'wwwww', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRthYiaKjGjibvWyib9eQBulObWCqEnwQ2uRwseETQUMFz9ZliaPx2yBbupd6ytkS6cZTuMMtAtB61VwKsQXMpkRa4u2T/0', '13.59', 1, 'ertgg', '13688854688', 13.59, 2, 1495782479, 1495782479, 1502344686, 1, 0), (10, 'oOeQPxP7oXJekGkLn-MYgnCKMMJs', 'jingjing', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtjnCrrPmadtfxFpic7uFiaicAC3RFUW8KTQzG4BSWch33IzKosu0rrdia7YSE0JVT6o5VWJKyGbBlULtQ/0', '11.86', 1, '王静', '18611551266', 11.86, 2, 1496295024, 1496295024, 1502186881, 1, 0), (11, 'oOeQPxK-QihAHQV4oKDhN9T9isYI', 'honghong', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTun0jlXK7vpXs6vFl49tr3JKRhbuiaP1U6ebQXbldg7tmT454UBTUTacuaA2yHq1LT5QgcTAsuoiawqA/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (12, 'oOeQPxAR_sJx3zAvUJWKr7i0QiGA', 'guwei', 'http://wx.qlogo.cn/mmopen/PiajxSqBRaEKGALFEpALhCHc71Z5NflaVicWm0iaEJ6HUpbpiaKo6XPWlx2Sksxq3E8fc1qglOt09rrAfY5ctLyoibw/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (13, 'oOeQPxODpokGaoWeeMaRXDJkK-Bg', 'tiantian', 'http://wx.qlogo.cn/mmopen/Q3auHgzwzM76bHg6kOs7N4y6OMEy7uHcia8Sgy7uPnc580SwtvKiaD8rZIS2lvnRhZ9GQ03jNA2ria8A05rVRsAsQ/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (14, 'oOeQPxNkxRHfkQjxxDZM3RI8XzyQ', 'chuxin', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtiaeicCAicjZxh8Idz1U6FxCfaVfCoK3ktWqiclrKeMJwRpZDZYA1hDJ8SjQtAvWVASgiaQAAua50726hw/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (15, 'oOeQPxJFDq8zWkXe4loWE4j8pjsM', 'dashu', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtiaSbJdKZNG5BAzspCPibVD9r2JHdoDWx4b58cehZxsTa33QRHibJhiaVMkLEDGiaaNOa5JfcOIQ5JUgLq6yMhBlN2via/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (16, 'oOeQPxHZvESDm3YsorEgIouMXmiY', 'qiang', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnQlr9Wq2ia0G5Chlsd1D0GUKtBZ3QxPtLD29pmrqtN4EibS2Z8n25y6dfK5A0UaW6cAFKibTIrrWDvNibcLtdUYRnoh/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (17, 'oOeQPxGPh0Cba-5n1oj1eTG9kueg', 'liubin', 'http://wx.qlogo.cn/mmopen/PiajxSqBRaEITRuU83fCpdBuwUvrkUPvWwDsnMCnKoIdicYqobQJzziahicGcwwekghPsLHicJD5KfV9K8gQZ4XUGNQ/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (18, 'oOeQPxPZ0orzBmCtkZxU0bizyrAk', 'youyou', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnQlr9Wq2ia0G5BZlwpfoqkeDoMZO8WG8Fm1pTjgW7J4WkpGHSfUpkzkFVT7nNCbaQVy0FicjkAOuicD6FuRnWXT6SB/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (19, 'oOeQPxA-bJNlPGteijQBzmNgrWmc', 'rongma', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtiaSbJdKZNG5BOCQHJJ4fHt8O453KzOibznbRibN5GuLHt5z6IonQHxLibJAfdTY8ZqYR49dasp51B0qUoCzsz9gB2O/0', '0.00', 0, NULL, NULL, NULL, 0, 1496295024, 1496295024, 1496295024, 1, 0), (20, 'oOeQPxNjcaXXaVx9GHXXu2y12-uE', '刘恒', 'http://wx.qlogo.cn/mmopen/C14Kv21fjN0uzrPtnC3v8Rebko7gibYcvOlicibJdyfpps0UicLBK4svyppIAqYaciaDC8BgvydxUVIEHI6e6hpicmS0hVOHeJNGNT/0', '11.06', 1, '刘恒', '15145153621', 11.06, 2, 1502065414, 0, 1502066347, 1, 0), (21, 'oOeQPxIaxgs_7ef6lRNm_7LpKZj0', 'A娟娟', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTumRibrBTEh4UXScQBuiaNSphI9BvAPXCibyJgjX3gVyM9aGBISsR6WHRsVZQwCUfEl0JT7kua1BtibL61E1Zw55o7KU/0', '10.25', 1, '黑道皇后', '13100849632', 10.25, 2, 1502072684, 0, 1502072724, 1, 0), (22, 'oOeQPxGGWja0RlpyfgY8MTi1Kw3E', '郑宁伟', 'http://wx.qlogo.cn/mmopen/ajNVdqHZLLCD5mUw2csBWtEpyOsC04l7thCA8A5OQibh05TLW9Ribh4pBvCR53nmn1pz9khnfwTKlZjiaLGRgiaHQ4VGEZCBkwGibltribe2zBvB8/0', '27.32', 5, '郑宁伟', '18515011741', 12.47, 2, 1502078691, 0, 1502787313, 1, 0), (23, 'oOeQPxEqzQhA3R3E5saKr9AlAqtM', '褚小波', 'http://wx.qlogo.cn/mmopen/ajNVdqHZLLAXKLAjicNUdUsAXgsGR4yMnC6WcwyJ0sQDGDUZSdsLBj9H3SSGkzj37p21qyEiaxWDcof7icj2byKRg/0', '18.23', 2, '褚洪波', '18101035231', 14.31, 2, 1502108972, 0, 1502606556, 1, 0), (24, 'oOeQPxBK8QWXMbX8CQNN6DX7R_qA', '李文凯', 'http://wx.qlogo.cn/mmopen/Q3auHgzwzM7jxFRHHHhgvzCwZ5fmNalIoNTLeo68wWrTUVwlibo9BBaiaa50gcJtpp1riakAKAdibibUMz9IsrIa1xg/0', '14.96', 2, '李文凯', '18911300582', 10.05, 2, 1502186682, 0, 1502186927, 1, 0), (25, 'oOeQPxEtybPX5lD6DqQGd3uCIxZY', 'GeorgeMax', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnTeoZ2yrapsq3LRb0ic5B7Z79tia9tesbjuwPw1XpCPHjI5fvxIMcDHLrdKKjx9fTXG4XuHlR30SicMLEOufuOStgA/0', '0.00', 0, NULL, NULL, NULL, 0, 1502186792, 0, 1502186792, 1, 0), (26, 'oOeQPxC4P58Wa1SUYWIZ_ywen4eA', '把青春编织成朵花', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTukGXfUV9FdUBwTialPgGwyCxUVPDVpczamb86ktNdOUSdrxzFhQMlOMwPHta9oJYmiaRboFlMWOJ0dA/0', '0.00', 0, NULL, NULL, NULL, 0, 1502186934, 0, 1502186934, 1, 0), (27, 'oOeQPxLdtqw4RKcFtFL6mhFkiyFY', '旺', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnT6TFeSDz9iahibwibTGa7XxSPd9tDiavN5wuicIyrrhBKvHibkmXReCdeWIictUaksDwXfP4aiaguQKq0icicA/0', '0.00', 0, NULL, NULL, NULL, 0, 1502187107, 0, 1502187107, 1, 0), (28, 'oOeQPxNmi3sRPm7-B-1jCTxw87n4', '杨乐', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnQlr9Wq2ia0G5OVjZQLmzuVvja3HSUGK8uFlFribSpx9FNXdAJc3siaxsf51uVU1HvNy21CwNic97sMkNnuia8E66IUu/0', '0.00', 0, NULL, NULL, NULL, 0, 1502187151, 0, 1502187151, 1, 0), (29, 'oOeQPxBKtHVupiad3FBpAcpKn3rg', '透明', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnQlr9Wq2ia0G5NPIJCeWiaicxdiah7YuRDnMLicub9icHaGYpTpr0GysBGSVfhtUu0I0J8OckTC9ch57GqJuveiacDYQvK/0', '0.00', 0, NULL, NULL, NULL, 0, 1502188215, 0, 1502188215, 1, 0), (30, 'oOeQPxOh3X-u_NZosLCtAh-Gecro', 'cocoa', 'http://wx.qlogo.cn/mmopen/KJjIsr1BPnS5e9DVO9RiaElxUckkU3IUplqrSI3fOv2EhPCXIqVFx9QSGoqNvA0SzbflndichKwiaqAiamkHb0d1OIj4KJRGTnD3/0', '0.00', 0, NULL, NULL, NULL, 0, 1502188991, 0, 1502188991, 1, 0), (31, 'oOeQPxLneDz-mlQtIXDwt7-8BDJQ', 'DiNozzo', 'http://wx.qlogo.cn/mmopen/AqEIVwciaRtiaSbJdKZNG5BEN1ibL6j5BjTBMrRmuiaGb45DsPSxOekcd8KwZlxBDVO3hjWPmarPnsz0qQWvj7mQdENCeN8XHnvK/0', '0.00', 0, NULL, NULL, NULL, 0, 1502195426, 0, 1502195426, 1, 0), (32, 'oOeQPxOTZvl_IJ2XE-hASOd4NRqk', '杰♛', 'http://wx.qlogo.cn/mmopen/ajNVdqHZLLBIicaWSR03bw1x4kvczak6MOd8OUKqtOC17vAuCtfhUVhV0FIt9I36VPyiaOblso0ZEPdJictZ8YXIWuibJia4b7Fv45E4WHAumRms/0', '12.48', 1, '高海杰', '15313921315', 12.48, 2, 1502208271, 0, 1502208306, 1, 0), (33, 'oOeQPxBgy9DDeIiS3ZKU-hCQ7RqM', 'FAN', 'http://wx.qlogo.cn/mmopen/d2fJZTzRTumicqpInYjMG43cKPrS7ibu5rNb4gTMPSW8HZjqU7hZ0YjQPtpyEeZd9NOZzP3qoPHZt4v7LJV6SgKQ/0', '0.00', 0, 'aaa', '18518779098', NULL, 1, 1502250212, 0, 1502250239, 1, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `qf_admin` -- ALTER TABLE `qf_admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `qf_record` -- ALTER TABLE `qf_record` ADD PRIMARY KEY (`r_id`); -- -- Indexes for table `qf_user` -- ALTER TABLE `qf_user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `qf_admin` -- ALTER TABLE `qf_admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `qf_record` -- ALTER TABLE `qf_record` MODIFY `r_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=92; -- -- AUTO_INCREMENT for table `qf_user` -- ALTER TABLE `qf_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=34; /*!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 */;
true
3cef4d7b0a71b694c54449e7827b394ac9cd5e46
SQL
ka10a/DIHT
/DataBases/SQL/097.SQL
UTF-8
393
3.734375
4
[]
no_license
SELECT code, speed, ram, price, screen FROM Laptop WHERE EXISTS(SELECT 1 x FROM ( SELECT v, RANK() OVER(ORDER BY v) rn FROM ( SELECT CAST(speed AS FLOAT) AS sp, CAST(ram AS FLOAT) AS rm, CAST(price AS FLOAT) AS pr, CAST(screen AS FLOAT) AS sc )l UNPIVOT(v FOR c in (sp, rm, pr, sc))u )l PIVOT(MAX(v) FOR rn in ([1],[2],[3],[4]))p WHERE [1]*2 <= [2] AND [2]*2 <= [3] AND [3]*2 <= [4] )
true
8d402278dd8bfcb1b48fc401fdee4f4be6bddcfc
SQL
ashishUTD/AirlineReservationSystem
/sqldump/airline_management_air_flight.sql
UTF-8
2,698
3
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `airline_management` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `airline_management`; -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: localhost Database: airline_management -- ------------------------------------------------------ -- Server version 5.7.19-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `air_flight` -- DROP TABLE IF EXISTS `air_flight`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `air_flight` ( `flight_id` int(10) NOT NULL AUTO_INCREMENT, `airline_name` varchar(30) DEFAULT NULL, `from_location` varchar(20) DEFAULT NULL, `to_location` varchar(20) DEFAULT NULL, `total_seats` int(4) DEFAULT NULL, `deleted` int(1) DEFAULT NULL, PRIMARY KEY (`flight_id`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `air_flight` -- LOCK TABLES `air_flight` WRITE; /*!40000 ALTER TABLE `air_flight` DISABLE KEYS */; INSERT INTO `air_flight` VALUES (14,'Emirates','DFW','BOM',450,0),(15,'Qatar','DFW','BOM',600,0),(16,'Qatar','BOM','DFW',600,0),(17,'British Airways','BOM','DFW',600,0),(18,'Air India','DFW','BOM',400,0),(19,'Gulf','DFW','BOM',500,0),(20,'abc','abc','abcd',400,1),(21,'abc','abc','abcd',400,1),(22,'Temp','DEL','JFK',400,1),(23,'Emirates','DFW','BOM',450,0),(24,'Vitara','DFW','BOM',450,0),(25,'Emirates','DFW','BOM',200,1),(26,'Vitara','DFW','BOM',200,1); /*!40000 ALTER TABLE `air_flight` 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 2018-04-22 13:32:38
true
0e44c25a5783eb974ae75e3a8f8d3872f57dcf9b
SQL
jreidmke/jobly
/data.sql
UTF-8
1,506
3.8125
4
[]
no_license
\c jobly DROP TABLE IF EXISTS companies CASCADE; DROP TABLE IF EXISTS jobs CASCADE; DROP TABLE IF EXISTS users CASCADE; CREATE TABLE companies( handle TEXT PRIMARY KEY, name TEXT NOT NULL UNIQUE, num_employees INT, description TEXT, logo_url TEXT ); CREATE TABLE jobs( id SERIAL PRIMARY KEY, title TEXT NOT NULL, salary FLOAT NOT NULL, equity FLOAT NOT NULL CHECK(equity < 1), company_handle TEXT REFERENCES companies(handle) ON DELETE CASCADE, date_posted DATE default CURRENT_TIMESTAMP ); CREATE TABLE users( username TEXT PRIMARY KEY, password TEXT NOT NULL, first_name TEXT NOT NULL, last_name TEXT NOT NULL, email TEXT NOT NULL UNIQUE, photo_url TEXT, is_admin BOOLEAN NOT NULL default FALSE ); INSERT INTO companies VALUES('apple', 'Apple', 250, 'We make good computers', 'apple.com'), ('pizza', 'Pizza Place.', 10000, 'We make good pizza', 'pizza.org'), ('candy', 'Candy Co.', 600, 'We make good candy', 'candy.com'); INSERT INTO jobs(title, salary, equity, company_handle) VALUES('cleaner', 49.15, .5, 'apple'), ('builder guy', 15.83, .2, 'pizza'), ('machine guy', 20.59, .3, 'candy'); INSERT INTO users VALUES('jreid', '$2a$12$tjGXX/ncfKUIbz88ucgMouIhhL8SaQb0/DfnI1V0jingQonofTSha', 'James', 'Reid', 'jreidmke@gamil.com', 'blah', TRUE), ('mariaa', '$2a$12$tjGXX/ncfKUIbz88ucgMouIhhL8SaQb0/DfnI1V0jingQonofTSha', 'Maria', 'Aldapa', 'mariaa@gmail.com', 'blah', FALSE); SELECT * FROM companies; SELECT * FROM jobs; SELECT * FROM users; \dt
true
c3b0acdd9549203679ddb30b0a11d555b4f7ffcc
SQL
gaFregatto/5COP009
/ListaConsultas-S19/ex14.sql
UTF-8
245
3.03125
3
[]
no_license
SELECT disciplina.nome_disc, disc_prereq.nome_disc AS disc_prereq FROM disciplina NATURAL LEFT JOIN prereq LEFT JOIN disciplina AS disc_prereq ON disc_prereq.cod_depto = prereq.cod_depto_prereq AND disc_prereq.num_disc = prereq.num_disc_prereq;
true
d579776ffb86903acbd88ae4361c24c4eb24d8e0
SQL
JoannaScibor/PHP-Wstawianie-danych-do-bazy
/pacjenci.sql
UTF-8
2,757
2.6875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Czas generowania: 24 Cze 2019, 22:07 -- Wersja serwera: 10.3.16-MariaDB -- Wersja PHP: 7.3.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Baza danych: `pacjenci` -- -- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `baza` -- CREATE TABLE `baza` ( `imie` text COLLATE utf8_polish_ci NOT NULL, `nazwisko` text COLLATE utf8_polish_ci NOT NULL, `rok` text COLLATE utf8_polish_ci NOT NULL, `plec` text COLLATE utf8_polish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci; -- -- Zrzut danych tabeli `baza` -- INSERT INTO `baza` (`imie`, `nazwisko`, `rok`, `plec`) VALUES ('$imie', '$nazwisko', '$rok', ''), ('Jola', 'Kowalska', '2010', ''), ('Jola', 'Kowalska', '2019', ''), ('tt', 'ttt', '2010', ''), ('tt', 'ttt', '2010', ''), ('Jola', 'Kowalska', '2019', ''), ('Jola', 'Kowalska', '2019', ''), ('Marta', 'Kowalczyukowska', '2122', ''), ('Marta', 'Kowalczyukowska', '2122', ''), ('mmmk', 'uhyttr', 'gtrr', ''), ('Jola', 'Kowalska', '2010', ''), ('Jola', 'Andrzejczyk', '2019', ''), ('Jola', 'ttt', 'ttt', 'kobieta'), ('Jola', 'ttt', 'ttt', 'kobieta'), ('Marta', 'Kowalska', '2019', 'kobieta'), ('Marta', 'Kowalska', '2011', ''), ('Marta', 'Kowalska', '2019', 'kobieta'), ('Marek', 'Stasiuk', '1985', ''), ('Staszek', 'Kowalski', '2011', ''), ('Staszek', 'Kowalski', '2011', ''), ('Muniek', 'Kowalski', '1897', ''), ('Muniek', 'Kowalski', '1897', ''), ('Marek', 'Kowalski', '2019', ''), ('Marek', 'Kowalski', '2019', 'kobieta'), ('Marta', 'Kowalski', '2010', 'kobieta'), ('Staszek', 'Kowalski', '2011', 'kobieta'), ('aa', 'sss', 'aaa', 'mężczyzna'), ('aa', 'sss', 'aaa', 'kobieta'), ('Marta', 'Kowalski', '2019', 'kobieta'), ('Janusz', 'Stefczyk', '1987', 'kobieta'), ('Janusz', 'Stefczyk', '1987', 'kobieta'), ('Staszek', 'Kowalski', '2019', 'kobieta'), ('Marta', 'Kowalska', '2010', 'kobieta'), ('Marta', 'Kowalska', '2010', 'mężczyzna'), ('Marta', 'Kowalska', '2010', 'mężczyzna'), ('Marta', 'Kowalski', '2019', 'mężczyzna'), ('Marta', 'Kowalska', '2010', 'mężczyzna'), ('Dominika', 'Zagrobelna', '1999', 'mężczyzna'), ('Patrycja', 'Dancewicz', '1997', 'kobieta'); 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 */;
true
3ca7c498a222ae18d87beddd4a5a81218c7c9cfb
SQL
sbabenko/teamSix
/fireM2/adminTools/data_deletion.sql
UTF-8
728
2.65625
3
[]
no_license
# Team Name: FIRE^2 (First Responder Framework Improvement Researchers) # Product Name: FIRE-M^2 (First Responder Mission Management) # File Name: data_deletion.sql # # Date Last Modified: November 16, 2018 (Aditya Kaliappan) # # Copyright: (c) 2018 by FIRE^2 # and all corresponding participants which include: # Aditya Kaliappan # Lorenzo Neil # Robert Duguay # Stanislav Babenko # Daniel Volinski # # File Description: # This script deletes only the database data for the FIRE-M2 application. #delete all data in tables of database delete from resourceMission; delete from resource; delete from eventState; delete from eventNote; delete from mmEvent; delete from missionAssignment; delete from mission; #uncomment if account data must also be deleted #delete from userAccount;
true
4aa3819bf541112fa4bcbbfd6858b972d725435c
SQL
JohnsonZZ/storehouse
/huachuang.sql
UTF-8
4,514
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version phpStudy 2014 -- http://www.phpmyadmin.net -- -- 主机: localhost -- 生成日期: 2016 年 06 月 20 日 11:41 -- 服务器版本: 5.5.47 -- PHP 版本: 5.3.29 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 */; -- -- 数据库: `huachuang` -- -- -------------------------------------------------------- -- -- 表的结构 `hc_admin` -- CREATE TABLE IF NOT EXISTS `hc_admin` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` varchar(20) CHARACTER SET utf8 NOT NULL, `pwd` char(44) CHARACTER SET utf8 NOT NULL, `salt` char(44) CHARACTER SET utf8 NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=gbk AUTO_INCREMENT=18 ; -- -- 转存表中的数据 `hc_admin` -- INSERT INTO `hc_admin` (`id`, `username`, `pwd`, `salt`, `time`) VALUES (17, 'admin', '5cdb03efa1c3aad4703381c935e7c74650b4ffb8', 'E4+cLgSnqH7KWPrm0cC5UqodQwVmEBnYxC37Ic4tAKc=', '2016-06-02 01:58:31'); -- -------------------------------------------------------- -- -- 表的结构 `hc_goods` -- CREATE TABLE IF NOT EXISTS `hc_goods` ( `id` int(10) NOT NULL AUTO_INCREMENT, `href` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '图片', `content` text CHARACTER SET utf8 NOT NULL COMMENT '内容', `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '时间', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=gbk AUTO_INCREMENT=4 ; -- -- 转存表中的数据 `hc_goods` -- INSERT INTO `hc_goods` (`id`, `href`, `content`, `time`) VALUES (1, '', '<p>321312</p>', '2016-06-03 08:22:57'), (2, '', '<p>312</p>', '2016-06-03 08:24:05'), (3, '20160603/57514adfe238f.jpg', '<p><span style="text-decoration: underline;">332112</span><br/></p><p> </p>', '2016-06-03 09:16:15'); -- -------------------------------------------------------- -- -- 表的结构 `hc_log` -- CREATE TABLE IF NOT EXISTS `hc_log` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` int(11) NOT NULL, `ip` varchar(15) CHARACTER SET utf8 NOT NULL, `log` varchar(50) CHARACTER SET utf8 NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=gbk AUTO_INCREMENT=32 ; -- -- 转存表中的数据 `hc_log` -- INSERT INTO `hc_log` (`id`, `username`, `ip`, `log`, `time`) VALUES (1, 0, '::1', '登录成功', '2016-06-02 02:12:42'), (2, 0, '::1', '登录成功', '2016-06-02 02:12:48'), (3, 0, '::1', '登录成功', '2016-06-02 02:14:25'), (4, 0, '::1', '登录成功', '2016-06-02 02:15:23'), (5, 0, '::1', '登录成功', '2016-06-02 02:15:25'), (6, 0, '::1', '登录成功', '2016-06-02 02:15:29'), (7, 0, '::1', '登录成功', '2016-06-02 02:15:58'), (8, 0, '::1', '登录成功', '2016-06-02 02:16:00'), (9, 0, '::1', '登录成功', '2016-06-02 02:16:26'), (10, 0, '::1', '登录成功', '2016-06-02 02:16:49'), (11, 0, '::1', '登录成功', '2016-06-02 02:17:12'), (12, 0, '::1', '登录成功', '2016-06-02 02:18:16'), (13, 0, '::1', '登录成功', '2016-06-02 02:19:46'), (14, 0, '::1', '登录成功', '2016-06-02 02:20:09'), (15, 0, '::1', '登录成功', '2016-06-02 07:53:41'), (16, 0, '::1', '登录成功', '2016-06-02 07:55:25'), (17, 0, '::1', '登录成功', '2016-06-02 07:56:21'), (18, 0, '::1', '登录成功', '2016-06-02 07:56:38'), (19, 0, '::1', '登录成功', '2016-06-02 07:56:46'), (20, 0, '::1', '登录成功', '2016-06-02 08:29:16'), (21, 0, '::1', '登录成功', '2016-06-03 01:09:00'), (22, 0, '::1', '登录成功', '2016-06-03 03:18:09'), (23, 0, '::1', '增加产品', '2016-06-03 08:22:57'), (24, 0, '::1', '增加产品', '2016-06-03 08:24:05'), (25, 0, '::1', '登录成功', '2016-06-03 08:29:00'), (26, 0, '::1', '增加产品', '2016-06-03 08:29:14'), (27, 0, '::1', '修改产品', '2016-06-03 09:16:15'), (28, 0, '::1', '登录成功', '2016-06-06 01:03:02'), (29, 0, '::1', '登录成功', '2016-06-12 06:28:26'), (30, 0, '::1', '登录成功', '2016-06-17 07:12:34'), (31, 0, '::1', '登录成功', '2016-06-20 03:39:55'); /*!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 */;
true
e4ab30656a916f83bc8a9bbe88935dc781c86ee4
SQL
QuentDa/Blog
/sql/blog.sql
UTF-8
7,479
3.328125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.7 -- https://www.phpmyadmin.net/ -- -- Hôte : localhost -- Généré le : jeu. 01 fév. 2018 à 11:33 -- Version du serveur : 5.7.20-18-log -- Version de PHP : 7.1.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `blog` -- -- -------------------------------------------------------- -- -- Structure de la table `article` -- CREATE TABLE `article` ( `id` int(11) NOT NULL, `category_id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `created_at` date NOT NULL, `content` longtext NOT NULL, `summary` text NOT NULL, `is_published` tinyint(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Déchargement des données de la table `article` -- INSERT INTO `article` (`id`, `category_id`, `title`, `created_at`, `content`, `summary`, `is_published`) VALUES (1, 1, '« Le Crime de l’Orient Express » : rencontre avec Kenneth Branagh', '2018-01-10', '<p>Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat.</p>', 'Résumé de l\'article Le Crime de l’Orient Express', 1), (2, 4, 'Pourquoi \"Mario + Lapins Crétins : Kingdom Battle\" est le jeu de la rentrée', '2018-01-16', '<p>Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>', 'Résumé de l\'article Mario + Lapins Crétins', 0), (3, 4, 'Pourquoi \"Destiny 2\" est un remède à l’ultra-moderne solitude', '2018-01-14', '<p>Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam.</p>', ' Résumé de l\'article Destiny 2', 1), (4, 2, 'BO de « Les seigneurs de Dogtown » : l’époque bénie du rock.', '2018-01-03', '<p>Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula.</p>', 'Résumé de l\'article Les seigneurs de Dogtown', 1), (5, 4, 'Comment “Assassin’s Creed” trouve un nouveau souffle en Egypte', '2018-01-06', '<p>Ut velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar.</p>', 'Résumé de l\'article Assassin’s Creed', 0), (6, 4, 'De “Skyrim” à “L.A. Noire” ou “Doom” : pourquoi les vieux jeux sont meilleurs sur la Switch', '2018-01-17', '<p>Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.</p>', 'Résumé de l\'article Switch', 1), (7, 2, 'Revue - The Ramones', '2018-01-08', '<p>Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh.</p>', 'Résumé de l\'article The Ramones', 1), (8, 1, 'Critique « Star Wars 8 – Les derniers Jedi » de Rian Johnson : le renouveau de la saga ?', '2018-01-01', '<p>Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue.</p>', 'Résumé de l\'article Star Wars 8', 0), (9, 2, 'Hellfest 2018, l\'affiche quasi-complète', '2018-01-13', '<p>Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. </p>', 'Résumé de l\'article Hellfest', 1); -- -------------------------------------------------------- -- -- Structure de la table `category` -- CREATE TABLE `category` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `description` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Déchargement des données de la table `category` -- INSERT INTO `category` (`id`, `name`, `description`) VALUES (1, 'Cinéma', 'Trailers, infos, sorties...'), (2, 'Musique', 'Concerts, sorties d\'albums, festivals...'), (3, 'Théâtre', 'Dates, représentations, avis...'), (4, 'Jeux vidéos', 'Videos, tests...'); -- -------------------------------------------------------- -- -- Structure de la table `user` -- CREATE TABLE `user` ( `id` int(10) NOT NULL, `firstname` varchar(100) NOT NULL, `lastname` varchar(100) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(225) NOT NULL, `is_admin` tinyint(1) DEFAULT '0', `bio` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Déchargement des données de la table `user` -- INSERT INTO `user` (`id`, `firstname`, `lastname`, `email`, `password`, `is_admin`, `bio`) VALUES (1, 'Maxime', 'Basset', 'maxime.basset31@gmail.com', 'pooloo', 1, 'Bio de l\'utilisateur'), (2, 'qDQSD', 'KHGG', 'maxime.basset31@gmail.comDS', 'K%KJLKJ', 0, 'KJ%MKJMKJ%P H%LKHJOMGMHIGLIGM'), (5, 'Tomy', 'Hilfinger', 'jetesttonblog@leback.com', 'coucouc\'estmùoi', 1, 'je suis né depuis j\'improvise'), (6, 'ah ', 'ouais', 'c\'estpasmal@relouilsveulentuneadressemail.com', 'maisbon', 0, 'apresvoilàquoi'), (7, 'fgvbjkl,m', 'vhbn,l;', 'toto@lola.42', 'totolola42', 1, 'toto'), (8, 'jaipas', 'faitlephp', 'jesuisdsl@gmail.com', 'jesperejauraispas0', 1, 'maxvametaper'), (9, 'yavaitduphp', 'àfaireserieux', 'maxtauraipunous@prevenirserieux.com', 'okok', 0, ''), (10, 'ouaismême', 'quesic\'estpas', 'faitbahje@vousallume', '', 0, ''), (11, 'jhsdf', 'dfgdfg', 'dgdfg@dfgdfg.com', 'fgdfgd', 1, 'dgdgdf'), (12, '\'\'(', 'gftr\'', 'kfdjj@lmf', 'fgdfg', 0, 'ggfgf'), (13, 'Nikita', 'azerty', 'azerty@ytreza.com', '3399977', 1, 'un fou'), (14, '<b>bonsoir</b>', '', '', '', 1, ''), (15, '<b>salut</b>', 'chocolat', '', '', 0, ''), (16, '<script>alert(\'coucou\');</script>', '', '', '', 1, ''), (17, '<script>alert(\'Yoann le plus beau\');</script>', '', '', '', 0, ''), (18, 'J\'aime les canards', '', '', '', 0, ''), (19, '<script>alert(\'test\');</script>', '', '', '', 0, ''), (20, 'jaurais', 'peutetrecinq', 'minutesde@xn--retardtoutlheure-6lb.com', '', 0, ''), (21, '', '', '', '', 0, ''), (22, 'console.log(ok);', '', '', '', 0, ''), (23, 'omg', '', '', '', 0, ''), (24, 'je suis un nouveau pirate', '', '', '', 0, ''), (25, 'bvarzoivjiozarbjizrabjioboijrijobzraijobzarijijbzraijbzraijijbzraijbrziajbijzriobzrijojibzrzrbz', 'arboaizrjbiopeiomvjioazjbviojzairbjiojeaibjoiajbjjbiozijobaijobazzar', 'aikefiojaeoazghuzjr@jiorebiojibjioaheiobjoaeberabarb', 'fzzefz', 0, 'aijeifjioaje'), (26, 'putain de la merde', '', '', '', 0, ''), (27, 'm\'en balle les couilles du php', '', '', '', 0, ''), (28, '<script>alert(\'test\');</script>', '', '', '', 0, ''), (29, 'je vais hacker ton formulaire de merdeeeeeeeeeee', '', '', '', 0, ''); -- -- Index pour les tables déchargées -- -- -- Index pour la table `article` -- ALTER TABLE `article` ADD PRIMARY KEY (`id`); -- -- Index pour la table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`id`); -- -- Index pour la table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT pour les tables déchargées -- -- -- AUTO_INCREMENT pour la table `article` -- ALTER TABLE `article` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT pour la table `category` -- ALTER TABLE `category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT pour la table `user` -- ALTER TABLE `user` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30; 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 */;
true
60dd752819f36a1541425fc78881865a5fdd5a6b
SQL
ntserver2003/SQLScripts
/ExtendedProperties/Primary-keys.sql
UTF-8
544
4.03125
4
[]
no_license
SELECT 'Primary Key' AS PropertyType ,SCH.name AS SchemaName ,TBL.name AS TableName ,SKC.name AS PrimaryKeyName ,SEP.name AS DescriptionType ,SEP.value AS DescriptionDefinition ,TBL.object_id AS TableObjectID ,SKC.object_id AS SubObjectID FROM sys.tables TBL INNER JOIN sys.schemas SCH ON TBL.schema_id = SCH.schema_id INNER JOIN sys.extended_properties SEP INNER JOIN sys.key_constraints SKC ON SEP.major_id = SKC.object_id ON TBL.object_id = SKC.parent_object_id WHERE SKC.type_desc = N'PRIMARY_KEY_CONSTRAINT'
true
e984909475870f886c53ca80884241d059120023
SQL
CUBRID/cubrid-testcases
/sql/_13_issues/_12_2h/cases/bug_bts_7187.sql
UTF-8
6,028
3.984375
4
[ "BSD-3-Clause" ]
permissive
set system parameters 'create_table_reuseoid=no'; --TEST: 'Accessing deleted object error' occurs when creating a trigger with delete action on 'before update' event. autocommit off; --original scenario drop table if exists t1; create table t1(a int); insert into t1 values(1), (2), (3), (4); create trigger trigg1 before update on t1 execute delete from t1; update t1 set a=6; select * from t1 order by 1; drop table t1; --other scenarios ------------------------------------------------------------------------------- ---test update statement with trigger ------------------------------------------------------------------------------- --CASE1: test update statement with before delete trigger, they operate the same object create table t1(a int); insert into t1 values(1), (2), (3); create trigger trigg1 before update on t1 execute delete from t1; update t1 set a=11; SELECT * FROM t1 order by 1; drop table t1; --CASE2: test update statement with before delete trigger, they operate the different object create table t2(a int); insert into t2 values(1), (2), (3); create trigger trigg2 before update on t2 execute delete from t2 WHERE a = 1; update t2 set a=22 WHERE a = 2; SELECT * FROM t2 order by 1; drop table t2; --CASE2a: test update statement with before delete trigger, they operate the different object create table t2a(a int); insert into t2a values(1), (2), (3); create trigger trigg21 before update on t2a execute delete from t2a WHERE a = 1; update t2a set a=1 WHERE a = 2; SELECT * FROM t2a order by 1; drop table t2a; --CASE3: test update statement with after delete trigger, they operate the same object create table t3(a int); insert into t3 values(1), (2), (3); create trigger trigg3 after update on t3 execute delete from t3; update t3 set a=33; SELECT * FROM t3 order by 1; drop table t3; --CASE4: test update statement with after delete trigger, they operate the different object create table t4(a int); insert into t4 values(1), (2), (3); create trigger trigg4 after update on t4 execute delete from t4 WHERE a = 1; update t4 set a=44 WHERE a = 2; SELECT * FROM t4 order by 1; drop table t4; --CASE5: test update statement with before insert trigger, they operate the different object create table t5(a int); insert into t5 values(1), (2), (3); create trigger trigg5 before update on t5 EXECUTE INSERT INTO t5 VALUES (5); update t5 set a=55; SELECT * FROM t5 order by 1; drop table t5; --CASE6: test update statement with before insert trigger, they operate the different object create table t6(a int); insert into t6 values(1), (2), (3); create trigger trigg6 after update on t6 EXECUTE INSERT INTO t6 VALUES (6); update t6 set a=66; SELECT * FROM t6 order by 1; drop table t6; ------------------------------------------------------------------------------- ---test delete statement with trigger ------------------------------------------------------------------------------- --CASE7: test delete statement with before update trigger, they operate the same object create table t7(a int); insert into t7 values(1), (2), (3); create trigger trigg7 before delete on t7 execute UPDATE t7 SET a= 7; DELETE FROM t7; SELECT * FROM t7 order by 1; drop table t7; --CASE8: test delete statement with before update trigger, they operate the different object create table t8(a int); insert into t8 values(1), (2), (3); create trigger trigg8 BEFORE delete on t8 execute UPDATE t8 SET a= 8 WHERE a = 2; DELETE FROM t8 WHERE a = 1; SELECT * FROM t8 order by 1; drop table t8; --CASE9: test delete statement with after update trigger, they operate the same object create table t9(a int); insert into t9 values(1), (2), (3); create trigger trigg9 after delete on t9 execute UPDATE t9 SET a= 9; DELETE FROM t9; SELECT * FROM t9 order by 1; drop table t9; --CASE10: test delete statement with after update trigger, they operate the different object create table t10(a int); insert into t10 values(1), (2), (3); create trigger trigg10 after delete on t10 execute UPDATE t10 SET a= 10 WHERE a = 2; DELETE FROM t10 WHERE a = 1; SELECT * FROM t10 order by 1; drop table t10; ------------------------------------------------------------------------------- ---test insert statement with trigger ------------------------------------------------------------------------------- --CASE11: test insert statement with before delete trigger, they operate the different object create table t11(a int); insert into t11 values(1), (2), (3); create trigger trigg11 BEFORE insert on t11 execute DELETE FROM t11; INSERT INTO t11 VALUES(4); SELECT * FROM t11 order by 1; drop table t11; --CASE12: test insert statement with after delete trigger, they operate the different object create table t12(a int); insert into t12 values(1), (2), (3); create trigger trigg12 after insert on t12 execute DELETE FROM t12; INSERT INTO t12 VALUES(4); SELECT * FROM t12 order by 1; drop table t12; --CASE13: test insert statement with after update trigger, they operate the different object create table t13(a int); insert into t13 values(1), (2), (3); create trigger trigg13 BEFORE insert on t13 execute UPDATE t13 SET a= 13 WHERE a = 2; INSERT INTO t13 VALUES(4); SELECT * FROM t13 order by 1; drop table t13; --CASE14: test insert statement with before update trigger, they operate the same object create table t14(a int); insert into t14 values(1), (2), (3); create trigger trigg14 after insert on t14 execute UPDATE t14 SET a= 14 WHERE a = 2; INSERT INTO t14 VALUES(2); SELECT * FROM t14 order by 1; drop table t14; --CASE15: test view, original scenario of CUBRIDSUS-8175 create table t15 (a int, b int); insert into t15 values (2,2), (3,3); create view v15 as select * from t15; create trigger trigg15_1 before delete ON t15 execute UPDATE v15 SET a= 7; create trigger trigg15_2 before delete ON t15 execute UPDATE t15 SET a= 8; --Test: below will throw core file. DELETE FROM v15; SELECT * FROM v15 order by 1; drop view v15; drop table t15; rollback; autocommit on; set system parameters 'create_table_reuseoid=yes';
true
1ccc1a80831483d86132bcff91e2204502e6bf69
SQL
BottleMoon/Assignment
/DataBase/SQL HW#2/제출 과제/9.sql
UTF-8
141
3.09375
3
[]
no_license
SELECT studioName, COUNT(distinct producerNo) FROM Movie, MovieExec WHERE certNo=producerNo GROUP BY studioName Having AVG(netWorth)>1000000;
true
cfe6d37e1d6b1f06c3f59f3a189311572125cdef
SQL
CSE6242/IBicgicBackend
/all_sql_code.sql
UTF-8
14,229
3.546875
4
[]
no_license
use testyuhao; CREATE TABLE Bike ( tripDuration int NOT NULL, startTime datetime, stopTime datetime, startStationId int NOT NULL, startStationName varchar(255) NOT NULL, startStationLatitude float NOT NULL, startStationLongitude float NOT NULL, endStationId int NOT NULL, endStationName varchar(255) NOT NULL, endStationLatitude float NOT NULL, endStationLongitude float NOT NULL, bikeid int NOT NULL, userType varchar(255) NOT NULL, birthYear int, gender int NOT NULL ); #按天分的总用量 #select date_format(startTime,'%d') as datedata, count(date_format(startTime,'%d')) from Bike_Test where startTime>"开始时间" and startTime<="结束时间" group by datedata; select date_format(startTime,'%d') as datedata, count(date_format(startTime,'%d')) from Bike_Test where startTime>"2013-06-01" and startTime<="2013-06-02" group by datedata; #按周几分的总用量 #select date_format(startTime,'%W') as datedata, count(date_format(startTime,'%W')) from Bike_Test where startTime>"开始时间" and startTime<="结束时间" group by datedata; select date_format(startTime,'%W') as datedata, count(date_format(startTime,'%W')) from Bike_Test where startTime>"2013-06-01" and startTime<="2013-06-02" group by datedata; #按小时的总用量 #select date_format(startTime,'%H') as datedata, count(date_format(startTime,'%H')) from Bike_Test where startTime>"开始时间" and startTime<="结束时间" group by datedata; select date_format(startTime,'%H') as datedata, count(date_format(startTime,'%H')) from Bike_Test where startTime>"2013-06-01" and startTime<="2013-06-02" group by datedata; /* select count(tripDuration),'0~10' as 'duration' from Bike_Test where tripDuration>0 and tripDuration<=600 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'10~20' as 'duration' from Bike_Test where tripDuration>600 and tripDuration<=1200 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'20~30' as 'duration' from Bike_Test where tripDuration>1200 and tripDuration<=1800 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'30~40' as 'duration' from Bike_Test where tripDuration>1800 and tripDuration<=2400 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'40~50' as 'duration' from Bike_Test where tripDuration>2400 and tripDuration<=3000 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'50~60' as 'duration' from Bike_Test where tripDuration>3000 and tripDuration<=3600 and startTime>"开始时间" and startTime<="结束时间" union select count(tripDuration),'>60' as 'duration' from Bike_Test where tripDuration>3600 and startTime>"开始时间" and startTime<="结束时间"; */ select count(tripDuration),'0~10' as 'duration' from Bike_Test where tripDuration>0 and tripDuration<=600 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'10~20' as 'duration' from Bike_Test where tripDuration>600 and tripDuration<=1200 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'20~30' as 'duration' from Bike_Test where tripDuration>1200 and tripDuration<=1800 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'30~40' as 'duration' from Bike_Test where tripDuration>1800 and tripDuration<=2400 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'40~50' as 'duration' from Bike_Test where tripDuration>2400 and tripDuration<=3000 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'50~60' as 'duration' from Bike_Test where tripDuration>3000 and tripDuration<=3600 and startTime>"2013-06-01" and startTime<="2013-06-02" union select count(tripDuration),'>60' as 'duration' from Bike_Test where tripDuration>3600 and startTime>"2013-06-01" and startTime<="2013-06-02"; /* select sum(tripDuration), count(userType),'12~21' as 'age' from Bike_Test where birthYear > (2017 - 21) and birthYear <= (2017 - 12) and startTime>"开始时间" and startTime<="结束时间" union select sum(tripDuration), count(userType),'21~35' as 'age' from Bike_Test where birthYear > (2017 - 35) and birthYear <= (2017 - 21) and startTime>"开始时间" and startTime<="结束时间" union select sum(tripDuration), count(userType),'35~55' as 'age' from Bike_Test where birthYear > (2017 - 55) and birthYear <= (2017 - 35) and startTime>"开始时间" and startTime<="结束时间" union select sum(tripDuration), count(userType),'55~75' as 'age' from Bike_Test where birthYear > (2017 - 75) and birthYear <= (2017 - 55) and startTime>"开始时间" and startTime<="结束时间" union select sum(tripDuration), count(userType),'>75' as 'age' from Bike_Test where birthYear > (2017 - 75) and birthYear!=0 and startTime>"开始时间" and startTime<="结束时间"; */ select sum(tripDuration), count(userType),'12~21' as 'age' from Bike_Test where birthYear > (2017 - 21) and birthYear <= (2017 - 12) and startTime>"2013-06-01" and startTime<="2013-06-02" union select sum(tripDuration), count(userType),'21~35' as 'age' from Bike_Test where birthYear > (2017 - 35) and birthYear <= (2017 - 21) and startTime>"2013-06-01" and startTime<="2013-06-02" union select sum(tripDuration), count(userType),'35~55' as 'age' from Bike_Test where birthYear > (2017 - 55) and birthYear <= (2017 - 35) and startTime>"2013-06-01" and startTime<="2013-06-02" union select sum(tripDuration), count(userType),'55~75' as 'age' from Bike_Test where birthYear > (2017 - 75) and birthYear <= (2017 - 55) and startTime>"2013-06-01" and startTime<="2013-06-02" union select sum(tripDuration), count(userType),'>75' as 'age' from Bike_Test where birthYear > (2017 - 75) and birthYear!=0 and startTime>"2013-06-01" and startTime<="2013-06-02"; #select gender,sum(tripDuration) from Bike_Test where gender!=0 and startTime>"开始时间" and startTime<="结束时间" group by gender; select gender,sum(tripDuration) from Bike_Test where gender!=0 and startTime>"2013-06-01" and startTime<="2013-06-02" group by gender; #按照用户类型分 #select userType,sum(tripDuration) from Bike_Test where startTime>"开始时间" and startTime<="结束时间" group by userType; select userType,sum(tripDuration) from Bike_Test where startTime>"2013-06-01" and startTime<="2013-06-02" group by userType; ##热门站点 #select startStationName,count(startStationName) as Mostpopular from Bike_Test where startTime>"开始时间" and startTime<="结束时间" group by startStationName ORDER BY count(startStationName) DESC limit 10; select startStationName,count(startStationName) as Mostpopular from Bike_Test where startTime>"2013-06-01" and startTime<="2013-06-02" group by startStationName ORDER BY count(startStationName) DESC limit 10; ##热门路径 #select startStationId,endStationId,count(tripDuration) as routeusage from Bike_Test where startStationId!=endStationId and startTime>"开始时间" and startTime<="结束时间" group by startStationId,endStationId order by count(TripDuration) DESC limit 10; select startStationId,endStationId,count(tripDuration) as routeusage from Bike_Test where startStationId!=endStationId and startTime>"2013-06-01" and startTime<="2013-06-02" group by startStationId,endStationId order by count(TripDuration) DESC limit 10; -- data preprocessing UPDATE Bike SET birthYear = 0 WHERE birthYear IS NULL; ---将birthyear Null替换为0 UPDATE Bike SET birthYear = 0 WHERE birthYear="NULL"; ---将birthyear Null替换为0 UPDATE Bike SET startTime = str_to_date(startTime, '"%Y-%m-%d %H:%i:%s"'); ---替换string为datetime格式 DELETE FROM Bike WHERE startStationId = endStationId AND tripDuration < 120; ---去除出发和到达站点相同,且行驶时间小于两分钟的行程 CREATE INDEX startTimeidx ON Bike(startTime); CREATE INDEX stopTimeidx ON Bike(stopTime); -----------------------------------------------------------------------PAGE2热力图总图 API1 --输入:时间,如2017-06-01 10:00:00需转换为 2017-06-01 10:00:00 <= startTime <= 2017-06-01 10:59:59 --输出: select startStationName as stationName, startStationId as stationId, startStationLatitude as stationLatitude, startStationLongitude as stationLongitude, borrowAmount, returnAmount from (SELECT startStationName, startStationId, startStationLatitude, startStationLongitude, COUNT(startStationName) AS borrowAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY startStationName) as t1 left outer join (SELECT endStationName, endStationId, endStationLatitude, endStationLongitude, COUNT(endStationName) AS returnAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY endStationName) as t2 on t1.startStationId = t2.endStationId union select endStationName as stationName, endStationId as stationId, endStationLatitude as stationLatitude, endStationLongitude as stationLongitude, borrowAmount, returnAmount from (SELECT startStationName, startStationId, startStationLatitude, startStationLongitude, COUNT(startStationName) AS borrowAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY startStationName) as t3 right outer join (SELECT endStationName, endStationId, endStationLatitude, endStationLongitude, COUNT(endStationName) AS returnAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY endStationName) as t4 on t3.startStationId = t4.endStationId order by borrowAmount desc, returnAmount desc; ----------------------------------------------------------------------------------- PAGE2热力图某站点数据 API2 --输入为时间,站点id --输出为两个数[a,b],其中a为借车量,b为还车量 select count(*) AS count from Bike where startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" and startStationId = 72 union select count(*) as count from Bike where startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" and endStationId = 72; ----------------------------------------------------------------------------------- PAGE2热力图某站点天气数据 API3 --天气,输入为时间2013-06-01 01:00:00整点,站点Id --输出为天气总览,温度,风速 SELECT summary, temperature, windspeed FROM Weather WHERE date = "2017-06-01 08:00:00"; --------------------------------------------------------------------------------------PAGE4 小时站点使用情况 API4 --输入:时间,如2017-06-01 10:00:00需转换为 2017-06-01 10:00:00 <= startTime <= 2017-06-01 10:59:59 --输出: select startStationName as stationName, startStationId as stationId, startStationLatitude as stationLatitude, startStationLongitude as stationLongitude, borrowAmount, returnAmount from (SELECT startStationName, startStationId, startStationLatitude, startStationLongitude, COUNT(startStationName) AS borrowAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY startStationName) as t1 left outer join (SELECT endStationName, endStationId, endStationLatitude, endStationLongitude, COUNT(endStationName) AS returnAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY endStationName) as t2 on t1.startStationId = t2.endStationId union select endStationName as stationName, endStationId as stationId, endStationLatitude as stationLatitude, endStationLongitude as stationLongitude, borrowAmount, returnAmount from (SELECT startStationName, startStationId, startStationLatitude, startStationLongitude, COUNT(startStationName) AS borrowAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY startStationName) as t3 right outer join (SELECT endStationName, endStationId, endStationLatitude, endStationLongitude, COUNT(endStationName) AS returnAmount FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" GROUP BY endStationName) as t4 on t3.startStationId = t4.endStationId order by borrowAmount desc, returnAmount desc; --- 输入:时间,站点id --- 输出2: 两张表: 表1 startStationName, endStationName,rankreturn --- 表2 endStationName, startStationName, rankborrow --- 需合成为stationName, endStationName(表一的), rankereturn, startStationName(表二的), rankborrow --- 目的是为了得到以某站点借车点,还车站点的车数量的排序,以及以某站点为还车点,借车站点的车的数量的排序 ----------------------------------------------------------------------------------------------------------------API5 SELECT endStationName, COUNT(*) AS rankreturn FROM Bike WHERE startTime <= "2017-06-01 10:59:59" and startTime >= "2017-06-01 10:00:00" and startStationId = 123 GROUP BY endStationName ORDER BY rankreturn desc; ----------------------------------------------------------------------------------------------------------------API6 SELECT startStationName, COUNT(*) AS rankborrow FROM Bike WHERE startTime <= "2017-03-01 10:59:59" and startTime >= "2017-03-01 10:00:00" and endStationId = 72 GROUP BY startStationName ORDER BY rankborrow desc; ----------------------------------------------------------------------------------------------------------------
true
d8de1f5fd4b96fcfea8e3a827359c649d68f43cd
SQL
diocaponi/Estudos
/SQL/TSQL/COMANDOS_DEMO.sql
UTF-8
560
3
3
[]
no_license
-- Exclui a coluna ID_Autor ALTER TABLE LIVRO DROP COLUMN ID_Autor -- Adiciona coluna ID_Autor, em seguida a transforma em chave estrangeira que faz -- referencia a tabela AUTORES ALTER TABLE LIVRO ADD ID_Autor SMALLINT NOT NULL CONSTRAINT fk_ID_Autor FOREIGN KEY (ID_Autor) REFERENCES AUTORES -- Adiciona coluna ID_Editora, em seguida a transforma em chave estrangeira que faz -- referencia a tabela EDITORAS ALTER TABLE LIVRO ADD ID_Editora SMALLINT NOT NULL CONSTRAINT fk_ID_Editora FOREIGN KEY (ID_Editora) REFERENCES EDITORAS
true
ce1b363e6f8e2928c902a81e54671022a740c4cc
SQL
dbarrett24/DevMountain
/First-Time/week6/day3/massive-demo/db/getAllIncidents.sql
UTF-8
408
3.671875
4
[]
no_license
select incidents.id, incidents.us_state, injuries.name as injury_name, affected_areas.name as affected_area_name, causes.name as cause_name from incidents join injuries on injuries.id = incidents.injury_id join affected_areas on injuries.affected_area_id = affected_areas.id join causes on causes.id = incidents.cause_id where us_state = $1 and causes.name = $2 --means the FIRST argument
true
e47ed4710ff47ce65e0a4dba62b60519f796b0e2
SQL
sd20i/db_database_docs
/sql_scripts/DatabaseSetup.sql
UTF-8
10,262
2.921875
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `carBuilder` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; USE `carBuilder`; -- MySQL dump 10.13 Distrib 8.0.15, for macos10.14 (x86_64) -- -- Host: 127.0.0.1 Database: carBuilder -- ------------------------------------------------------ -- Server version 8.0.17 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 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 `customers` -- DROP TABLE IF EXISTS `customers`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `customers` ( `c_id` int(11) NOT NULL AUTO_INCREMENT, `c_name` varchar(40) NOT NULL, `c_phone` varchar(15) NOT NULL, `c_email` varchar(150) NOT NULL, `c_number` int(3) NOT NULL, `c_floor` int(3) DEFAULT NULL, `c_street` varchar(100) NOT NULL, `c_zip` varchar(4) NOT NULL, `c_city` varchar(50) NOT NULL, `c_country` varchar(50) NOT NULL, `c_fb_id` varchar(50) NOT NULL, PRIMARY KEY (`c_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `customers` -- LOCK TABLES `customers` WRITE; /*!40000 ALTER TABLE `customers` DISABLE KEYS */; INSERT INTO `customers` VALUES (1,'John Doe','0045 239482712','john@email.com',23,3,'Strandvejen','2309','København','Denmark', '51sOp8ua4JZdyp3xCQDy3EhWHWl1'),(2,'Lotte hansen','0045 993237482','lotte@hotmail.com',10,NULL,'valbylanggade','3302','København','Denmark', '8HBFh10dVDSAz0Ud6Ppupbslhxo2'),(3,'Hanne hansen','0045 82736438','ha@hansen.com',1,19,'frederkisborgs vej','2200','København','Denmark', 'o38KangI2FNPKG8Sj4ki4eW8jsv1'); /*!40000 ALTER TABLE `customers` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `manufacturers` -- DROP TABLE IF EXISTS `manufacturers`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `manufacturers` ( `m_id` int(11) NOT NULL AUTO_INCREMENT, `m_name` varchar(50) DEFAULT NULL, `m_country` varchar(50) DEFAULT NULL, PRIMARY KEY (`m_id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `manufacturers` -- LOCK TABLES `manufacturers` WRITE; /*!40000 ALTER TABLE `manufacturers` DISABLE KEYS */; INSERT INTO `manufacturers` VALUES (1,'Yamaha','Japan'),(2,'Universal','UK'),(3,'Nissan','Japan'),(4,'Goodyear','Us'),(5,'BBS','Us'),(6,'Michelin','France'),(7,'Volkswagen','Germany'); /*!40000 ALTER TABLE `manufacturers` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `orderItems` -- DROP TABLE IF EXISTS `orderItems`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `orderItems` ( `oi_id` int(11) NOT NULL AUTO_INCREMENT, `order_fk` int(11) DEFAULT NULL, `product_fk` int(11) DEFAULT NULL, PRIMARY KEY (`oi_id`), KEY `order_fk` (`order_fk`), KEY `product_fk` (`product_fk`), CONSTRAINT `orderitems_ibfk_1` FOREIGN KEY (`order_fk`) REFERENCES `orders` (`o_id`), CONSTRAINT `orderitems_ibfk_2` FOREIGN KEY (`product_fk`) REFERENCES `products` (`p_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `orderItems` -- LOCK TABLES `orderItems` WRITE; /*!40000 ALTER TABLE `orderItems` DISABLE KEYS */; INSERT INTO `orderItems` VALUES (1,1,1),(2,1,4),(3,1,8); /*!40000 ALTER TABLE `orderItems` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `orders` -- DROP TABLE IF EXISTS `orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `orders` ( `o_id` int(11) NOT NULL AUTO_INCREMENT, `o_tracking_number` varchar(250) DEFAULT NULL, `createdAt` datetime DEFAULT NULL, `customer_fk` int(11) DEFAULT NULL, PRIMARY KEY (`o_id`), KEY `customer_fk` (`customer_fk`), CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`customer_fk`) REFERENCES `customers` (`c_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `orders` -- LOCK TABLES `orders` WRITE; /*!40000 ALTER TABLE `orders` DISABLE KEYS */; INSERT INTO `orders` VALUES (1,'284nxcnd3iw','2020-11-18 12:06:22',1),(2,'84958ncHmMH034','2020-11-18 13:07:30',1),(3,'b39b8bb7-42c4-4b23-bd12-47824bd6eb1a','2020-11-18 13:14:25',1),(4,'4a4c786a-fa46-4c8f-a6a0-6ab7ccbc5a1a','2020-11-18 13:15:17',2); /*!40000 ALTER TABLE `orders` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `products` -- DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `products` ( `p_id` int(11) NOT NULL AUTO_INCREMENT, `p_model_name` varchar(30) NOT NULL, `p_price` double NOT NULL, `p_description` text NOT NULL, `product_type_fk` int(11) DEFAULT NULL, `manufacturer_fk` int(11) DEFAULT NULL, `image` varchar(200) DEFAULT NULL, PRIMARY KEY (`p_id`), KEY `product_type_fk` (`product_type_fk`), KEY `manufacturer_fk` (`manufacturer_fk`), CONSTRAINT `products_ibfk_1` FOREIGN KEY (`product_type_fk`) REFERENCES `producttype` (`pt_id`), CONSTRAINT `products_ibfk_2` FOREIGN KEY (`manufacturer_fk`) REFERENCES `manufacturers` (`m_id`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `products` -- LOCK TABLES `products` WRITE; /*!40000 ALTER TABLE `products` DISABLE KEYS */; INSERT INTO `products` VALUES (1,'Rally',203.49,'bla',3,3,'rally.png'),(2,'All terrain',203.49,'bla',3,3,'allterrain.png'),(3,'Offroad',23.49,'bla',3,1,'offroad.png'),(4,'Sedan',23.49,'some description of this product',1,4,'sedan.png'),(5,'SUV',200.38,'suv description',1,3,'suv.png'),(6,'Performance',2032.28,'compact car',1,3,'performance.png'),(7,'Hatchback',19999,'wagon text',1,1,'hatchback.png'),(8,'Spoiler',3273.99,'brian type of equipment',4,2,'placeholder.png'),(9,'Vintage',123483,'creapy white van',1,5,'vintage.png'),(12,'V8',2000,'some engine',2,1,'gas.png'),(13,'Electric',1000,'some engine',2,6,'electric.png'),(14,'v6',1700,'yet another engine',2,1,'gas.png'),(15,'Clear',120,'Clear window',5,3,'placeholder.png'),(16,'Tinted',340,'Tinted brian windows',5,7,'placeholder.png'); /*!40000 ALTER TABLE `products` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `productType` -- DROP TABLE IF EXISTS `productType`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `productType` ( `pt_id` int(11) NOT NULL AUTO_INCREMENT, `pt_name` varchar(60) DEFAULT NULL, PRIMARY KEY (`pt_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `productType` -- LOCK TABLES `productType` WRITE; /*!40000 ALTER TABLE `productType` DISABLE KEYS */; INSERT INTO `productType` VALUES (1,'Car body'),(2,'Engine'),(3,'Tires'),(4,'Spoiler'),(5,'Windows'); /*!40000 ALTER TABLE `productType` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `stock` -- DROP TABLE IF EXISTS `stock`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `stock` ( `s_id` int(11) NOT NULL AUTO_INCREMENT, `s_size` varchar(20) DEFAULT NULL, `s_color_name` varchar(20) DEFAULT NULL, `s_color_hex` varchar(10) DEFAULT NULL, `product_fk` int(11) DEFAULT NULL, PRIMARY KEY (`s_id`), KEY `product_fk` (`product_fk`), CONSTRAINT `stock_ibfk_1` FOREIGN KEY (`product_fk`) REFERENCES `products` (`p_id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `stock` -- LOCK TABLES `stock` WRITE; /*!40000 ALTER TABLE `stock` DISABLE KEYS */; INSERT INTO `stock` VALUES (1,NULL,'Black','#000',1),(2,NULL,'White','#FFF',1),(3,NULL,'red','#F00',1),(4,NULL,'Black','#000',2),(5,NULL,'White','#FFF',2),(6,NULL,'red','#F00',2),(7,NULL,'Black','#000',3),(8,NULL,'White','#FFF',3),(9,NULL,'red','#F00',3),(10,NULL,'Black','#000',4),(11,NULL,'White','#FFF',4),(12,NULL,'red','#F00',4),(13,NULL,'Black','#000',6),(14,NULL,'White','#FFF',6),(15,NULL,'red','#F00',6),(16,NULL,'Black','#000',7),(17,NULL,'White','#FFF',7),(18,NULL,'red','#F00',7); /*!40000 ALTER TABLE `stock` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-11-19 11:23:43 DELIMITER // DROP PROCEDURE IF EXISTS Update_product_default_image; Create Procedure Update_product_default_image() BEGIN SET sql_safe_updates=0; UPDATE products SET image = "placeholder.png" where image is null; SET sql_safe_updates=1; END; // DELIMITER // DROP PROCEDURE IF EXISTS ReturnAllEmails; Create Procedure ReturnAllEmails() BEGIN SELECT GROUP_CONCAT(c_email SEPARATOR ',') FROM carbuilder.customers GROUP BY NULL; END; //
true
2422d90ff81b3e14f7d8e4dc42cc5e8651e3521c
SQL
teeencho/predi
/db_dump/users.sql
UTF-8
1,362
2.578125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.7 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 -- Tiempo de generación: 08-02-2023 a las 23:49:59 -- Versión del servidor: 10.3.38-MariaDB -- Versión de PHP: 7.4.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `edifici2_predi` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `users` -- -- -- Volcado de datos para la tabla `users` -- martin / martin / 1234 -- INSERT INTO `users` (`username`, `password`, `role`, `created`, `modified`) VALUES ('martin', '$2y$10$2xrOjLFIkEwjJRB3N/BFOeeDir9ve6d.Immbn8Zm1FvsO9lJ5CukK', 'admin', NULL, NULL) -- -- Índices para tablas volcadas -- -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36; 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 */;
true
2663f66ae327dd0b376fc1dd0bd33cf86e76c22e
SQL
qqsmko/mohrss_edp
/edp-core/src/main/resources/sql/tbl_indicator_statistics.sql
UTF-8
1,278
3.4375
3
[]
no_license
DROP TABLE IF EXISTS "public"."tbl_indicator_statistics"; CREATE TABLE "public"."tbl_indicator_statistics" ( "id" serial, "indicator_type" varchar(32) COLLATE "default" DEFAULT ''::character varying NOT NULL, "indicator_name" varchar(32) COLLATE "default" DEFAULT ''::character varying NOT NULL, "cycle_time" varchar(32) COLLATE "default" DEFAULT ''::character varying NOT NULL, "cycle_statistics_value" int4 NOT NULL, "update_time" timestamp(6) NOT NULL ) WITH (OIDS=FALSE) ; COMMENT ON TABLE "public"."tbl_indicator_statistics" IS '指标统计记录表'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."id" IS '主键'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."indicator_type" IS '指标类型'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."indicator_name" IS '指标名称'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."cycle_time" IS '周期 n+(m,h,d,M,y), n为数字'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."cycle_statistics_value" IS '周期统计值'; COMMENT ON COLUMN "public"."tbl_indicator_statistics"."update_time" IS '更新时间'; ALTER TABLE "public"."tbl_indicator_statistics" ADD UNIQUE ("indicator_name", "indicator_type"); ALTER TABLE "public"."tbl_indicator_statistics" ADD PRIMARY KEY ("id");
true
2d97e81cfa2e4e3448b19e8f7158770d829e8921
SQL
HenryYuen128/SSH_note-project
/SSH部门员工管理项目/ssh_employee.sql
UTF-8
2,428
3.46875
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : Demo1 Source Server Version : 50720 Source Host : localhost:3306 Source Database : ssh_employee Target Server Type : MYSQL Target Server Version : 50720 File Encoding : 65001 Date: 2017-12-17 18:01:28 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for t_department -- ---------------------------- DROP TABLE IF EXISTS `t_department`; CREATE TABLE `t_department` ( `DeptId` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(255) DEFAULT NULL, `DDesc` varchar(255) DEFAULT NULL, PRIMARY KEY (`DeptId`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_department -- ---------------------------- INSERT INTO `t_department` VALUES ('1', 'HR', 'DeptOfHumanResource'); INSERT INTO `t_department` VALUES ('2', 'IT', 'InformationTechnology'); INSERT INTO `t_department` VALUES ('3', 'OP', 'Operation'); INSERT INTO `t_department` VALUES ('4', 'Canteen', 'Food'); INSERT INTO `t_department` VALUES ('5', 'Security', 'Security'); -- ---------------------------- -- Table structure for t_employee -- ---------------------------- DROP TABLE IF EXISTS `t_employee`; CREATE TABLE `t_employee` ( `Eid` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(255) DEFAULT NULL, `ENo` varchar(255) DEFAULT NULL, `Gender` varchar(255) DEFAULT NULL, `Birthday` datetime DEFAULT NULL, `DayOfHired` datetime DEFAULT NULL, `Username` varchar(255) DEFAULT NULL, `Password` varchar(255) DEFAULT NULL, `DeptId` int(11) DEFAULT NULL, PRIMARY KEY (`Eid`), KEY `FKeb0axav9pjbg5lbxxdcupj7r0` (`DeptId`), CONSTRAINT `FKeb0axav9pjbg5lbxxdcupj7r0` FOREIGN KEY (`DeptId`) REFERENCES `t_department` (`DeptId`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_employee -- ---------------------------- INSERT INTO `t_employee` VALUES ('1', 'Tony', '1', 'Male', '2017-12-15 00:00:00', '2017-12-15 00:00:00', 'Tony', '123', '2'); INSERT INTO `t_employee` VALUES ('3', 'Jenny', '2', 'Female', '2017-12-15 00:00:00', '2017-12-15 00:00:00', 'Jenny', '111', '1'); INSERT INTO `t_employee` VALUES ('4', 'Yoon', '3', 'Female', '2017-11-15 00:00:00', '2017-12-20 00:00:00', 'Yoon', '111', '4'); INSERT INTO `t_employee` VALUES ('6', 'Yuen', '6', 'Male', '1995-02-03 00:00:00', '2017-03-04 00:00:00', 'Yuen', '111', '2');
true
d6d94b80b85841125c47895569263c67f97dc9f6
SQL
NikolaevaKO/ComicsLibrary
/src/main/resources/database/initDB.sql
UTF-8
331
3
3
[]
no_license
--DROP TABLE IF EXISTS authors; --DROP SEQUENCE IF EXISTS authors_id_seq; CREATE TABLE IF NOT EXISTS authors ( id INTEGER PRIMARY KEY , nickname VARCHAR(200) NOT NULL , name VARCHAR(200), country VARCHAR(200), description VARCHAR(1000) ); CREATE SEQUENCE authors_id_seq START WITH 4 INCREMENT BY 1;
true
37cbf984bd4c927f5f1c30bad4bdf3f59a133296
SQL
tarou-tokumasu/SQLdrill
/chapter4-null.sql
UTF-8
258
2.546875
3
[]
no_license
create table ta1(c1 varchar(200) , c2 int); insert into ta1(c2) values(1); insert into ta1(c1,c2) values(null,2); insert into ta1(c1,c2) values('NULL' , 3); insert into ta1(c1,c2) values('' , 4); select * from ta1 ; select length(c1),c2 from ta1 ;
true
00bcf1bf6a2edd06406addd79c2df32ec59270aa
SQL
bnbasilio/holbertonschool-higher_level_programming
/0x0D-SQL_introduction/11-best_score.sql
UTF-8
209
3.578125
4
[]
no_license
-- lists all records with a score >= 10 in the table second_table -- displays both the score and the name (records ordered by score) SELECT score, name FROM second_table WHERE score >= 10 ORDER BY score DESC;
true
e14721bf55a15dfaf1f4ab444b64a9e6b598b8a6
SQL
anh309/Java_SOAP_webservice_project
/QuanLySinhVien.sql
UTF-8
18,626
3.359375
3
[]
no_license
create database QuanLySinhVien ON PRIMARY( NAME=QuanLySinhVien, FILENAME='D:\DB\QuanLySinhVien.mdf', SIZE=10MB, MAXSIZE=unlimited, FILEGROWTH=20% ) LOG ON( NAME=QuanLySinhVienLog, FILENAME='D:\DB\QuanLySinhVien.ldf', SIZE=5MB, MAXSIZE=unlimited, FILEGROWTH=1MB ) use QuanLySinhVien create table MonHoc( MMH int PRIMARY KEY, TenMH nvarchar(100) not null, GiaoVien nvarchar(100) not null, Thu nvarchar(10) not null, Tiet nvarchar(5) not null, PhongHoc nvarchar(10) not null ) create table ThongTinSV( MSSV int PRIMARY KEY not null, HoTen nvarchar(100) not null, Phai nvarchar(3) not null, Lop nvarchar(30) not null, NamNhapHoc int not null, NamSinh date not null, Que nvarchar(100) not null, ) create table TaiKhoan( Acc nvarchar(30) PRIMARY KEY, Pass nvarchar(30) not null, Email nvarchar(50) not null, MSSV int , constraint FK_ThongTinSV_TaiKhoan FOREIGN KEY (MSSV) REFERENCES ThongTinSV(MSSV) ) create table Diem ( MSSV int not null, MMH int not null, DiemTK float , DiemGK float , DiemCK float , DiemTH float , DiemTB float , CONSTRAINT Ma PRIMARY KEY (MMH, MSSV), constraint FK_MonHoc_Diem FOREIGN KEY (MMH) REFERENCES MonHoc(MMH), constraint FK_ThongTinSV_Diem FOREIGN KEY (MSSV) REFERENCES ThongTinSV(MSSV), ) create table gameFlap( ten nvarchar(30), score int ) update Diem set DiemTB = DiemTK*0.2+DiemGK*0.3+DiemCK*0.5 insert into gameFlap values (N'anh',3) insert into gameFlap values (N'binh',5) --------- insert into MonHoc values (2000, N'Nhập môn tin học', N'Trần Văn Quân',N'Hai',N'1-3',N'V6.07') insert into MonHoc values (2001, N'Nhập môn lập trình', N'Nguyễn Văn Ba',N'Ba',N'2-4',N'V9.05') insert into MonHoc values (2002, N'Hệ thống máy tính', N'Nguyễn Phúc',N'Tư',N'4-5',N'V5.07') insert into MonHoc values (00001, N'Nhập môn tin học', N'Trần Văn Quang',N'Hai',N'1-3',N'V6.07') insert into MonHoc values (00002, N'Anh Văn 3', N'Đinh Thị Hoa',N'Hai',N'1-3',N'V7.07') insert into MonHoc values (00003, N'Tài Chính Doanh Nghiệp', N'Lê Thị Nở',N'Hai',N'1-3',N'A3.03') insert into MonHoc values (00005, N'Kĩ Thuật Lập Trình', N'Nguyễn Hữu Tình',N'Hai',N'3-5',N'V9.02') insert into MonHoc values (00006, N'Hệ Cơ Sở Dữ Liệu', N'Trần Văn Quân',N'Hai',N'3-5',N'X12.05') insert into MonHoc values (00007, N'Lập trình hướng Đối Thượng', N'Nguyễn Văn Thắng',N'Ba',N'6-9',N'V3.01') insert into MonHoc values (00008, N'Tương Tác Người Máy', N'Đoàn Văn Thắng',N'Ba',N'1-3',N'T6.02') insert into MonHoc values (00009, N'Nhập môn ATTT', N'Trần Văn Đạt',N'Ba',N'1-3',N'D6.01') insert into MonHoc values (00010, N'Nhập Môn Lập Trình', N'Hồ Đắc Quán',N'Tư',N'9-11',N'D6.02') insert into MonHoc values (00011, N'Trí Tuệ Nhân Tạo', N'Nguyễn Thị Phúc',N'Tư',N'1-2',N'V11.07') insert into MonHoc values (00012, N'Phương Pháp Tính', N'Trần Văn Vinh',N'Năm',N'1-3',N'V9.05') insert into MonHoc values (00013, N'Anh Văn 1', N'Đinh Thị Hoa',N'Năm',N'6-7',N'A3.01') insert into MonHoc values (00015, N'Anh Văn 2', N'Đinh Tấn Thụy Kha',N'Năm',N'1-2',N'A2.02') insert into MonHoc values (00016, N'Vật lí 1', N'Trần Văn Vinh',N'Sáu',N'7-8',N'V5.01') insert into MonHoc values (00017, N'Tâm Lí Học Đại cương', N'Lê Thị Hà',N'Hai',N'2-3',N'X12.03') insert into MonHoc values (00018, N'Vật lí 1', N'Nguyễn Thái Học',N'Hai',N'1-3',N'X11.05') insert into MonHoc values (00019, N'Tư Tưởng Hồ Chí Minh', N'Lại Quang Ngọc',N'Ba',N'2-3',N'V6.5') insert into MonHoc values (00020, N'Pháp Luật Đại Cương', N'Nguyễn Minh Quân',N'Tư',N'1-3',N'A1.1') insert into MonHoc values (00021, N'Hệ Quản Trị CSDL', N'Lê Thị Thủy',N'Năm',N'1-3',N'B11.2') insert into MonHoc values (00022, N'Lập Trình Web', N'Trần Trọng Tiến',N'Sáu',N'7-10',N'H5.1') insert into MonHoc values (00023, N'Hệ Thống Máy Tính', N'Mai Thanh Thủy',N'Hai',N'6-9',N'D11.01') insert into MonHoc values (00025, N'Mạng Máy Tính', N'Phạm Thanh Hùng',N'Hai',N'1-3',N'V10.02') insert into MonHoc values (00026, N'Nhập môn tin học', N'Đặng Tuấn Anh',N'Ba',N'4-6',N'V7.07') insert into MonHoc values (00027, N'Đường Lối Cách Mạng', N'Trương Vô Hậu',N'Tư',N'5-7',N'X3.01') insert into MonHoc values (00028, N'Tư Tưởng', N'Nguyễn Ngọc Quang',N'Năm',N'2-5',N'A1.02') insert into MonHoc values (00029, N'Mạng Máy Tính', N'Lưu Đức Hoa',N'Năm',N'1-3',N'D11.02') insert into MonHoc values (00030, N'Anh Văn 1', N'Tô Đức Tài',N'Sáu',N'7-9',N'D10.03') insert into MonHoc values (00031, N'Toán A1', N'Trần Thị Ngọc Nữ',N'Bảy',N'1-3',N'V11.05') insert into MonHoc values (00032, N'Toán A2', N'Nguyễn Thị Hoa',N'Chủ Nhật',N'11-14',N'V7.02') insert into MonHoc values (00033, N'Toán A3', N'Nguyễn Việt Hoa Sơn',N'Hai',N'1-3',N'V6.01') insert into MonHoc values (00034, N'Tâm Lý Học Đại Cương', N'Lê Tuấn Lộc',N'Ba',N'4-6',N'V7.03') insert into MonHoc values (00035, N'May 1', N'Phan Thị Tím',N'Tư',N'7-9',N'X3.04') insert into MonHoc values (00036, N'Công Nghệ Nâng Cao', N'Nguyễn Trường Giang',N'Năm',N'3-5',N'E3.04') insert into MonHoc values (00037, N'Cấu Trúc Dữ Liệu Và Giải Thuật', N'Tôn Long Hải',N'Sáu',N'8-11',N'D8.02') insert into MonHoc values (00038, N'Kiến Trúc Hệ Thống', N'Lê Thị Kim Tiền',N'Bảy',N'8-11',N'D4.04') insert into MonHoc values (00039, N'Những Vấn Đề Nghề Nghiệp', N'Nguyễn Minh Tân',N'Chủ Nhật',N'2-3',N'A3.02') insert into MonHoc values (00040, N'Pháp Luật Đại Cương', N'Nguyễn Trọng Phi',N'Hai',N'1-5',N'D2.01') insert into MonHoc values (00041, N'Tương Tác Người Máy', N'Ngô Văn Trọng',N'Ba',N'8-9',N'A2.02') insert into MonHoc values (00042, N'Định Tuyến Chuyển Mạch', N'Trương Ngọc Tiên',N'Tư',N'2-4',N'V12.02') insert into MonHoc values (00043, N'Anh Ninh Mạng', N'Nguyễn Thị Sa Lem',N'Năm',N'1-2',N'D2.07') insert into MonHoc values (00044, N'Phân Tích Và Thiết Kế Hệ Thống', N'Hoàng Tuấn Phúc',N'Sáu',N'5-6',N'X2.01') insert into MonHoc values (00045, N'Cấu Trúc Rời Rạc', N'Phạm Hoàng Anh',N'Bảy',N'7-9',N'V3.07') insert into MonHoc values (00046, N'Lý Thuyết Đồ Thị', N'Lưu Diệp Phi',N'Chủ Nhật',N'10-12',N'A3.01') --------- insert into ThongTinSV values (1000, N'Trần Bảo',N'Nam',N'DHCNTT12C',2016, '7/6/2018',N'Phú Yên') insert into ThongTinSV values(16075511, N'Phạm Xuân Anh', N'Nam', N'DHCNTT12C', 2016, '1/1/1998', N'Đắck Lắck') insert into ThongTinSV values(16073471, N'Trần Thái Bảo', N'Nam', N'DHCNTT12C', 2016, '7/6/1998', N'Phú Yên') insert into ThongTinSV values(16077011, N'Nguyễn Văn Chiến', N'Nam', N'DHCNTT11B', 2015, '2/1/1997', N'Vĩnh Long') insert into ThongTinSV values(16069751, N'Phạm Chánh', N'Nam', N'DHCNTT12C', 2016, '2/2/1998', N'Phú Yên') insert into ThongTinSV values(16071111, N'Bùi Hải Hà', N'Nữ', N'DHCNTT12C', 2016, '21/11/1998', N'Khánh Hòa') insert into ThongTinSV values(16023011, N'Phạm Văn Hoàng', N'Nam', N'DHCNTT12A', 2016, '10/10/1998', N'TP. Hồ Chí Minh') insert into ThongTinSV values(16098011, N'Lê Thị Hoa', N'Nữ', N'DHKQ13A', 2017, '12/10/1999', N'Tây Nguyên') insert into ThongTinSV values(16021011, N'Trần Thị Hồng', N'Nữ', N'DHKT13A', 2017, '1/1/1998', N'Vũng Tàu') insert into ThongTinSV values(16009011, N'Nguyễn Oanh', N'Nữ', N'DHCNTT12C', 2016, '9/9/1998', N'Nha Trang') insert into ThongTinSV values(16027011, N'Phạm Minh Minh', N'Nam', N'DHCNTT13C', 2017, '8/9/1999', N'Bình Chánh') insert into ThongTinSV values(16098011, N'Lê Minh Ngọc', N'Nữ', N'DHKT12C', 2016, '10/10/1998', N'Long An') insert into ThongTinSV values(16070011, N'Trần Phong', N'Nam', N'DHCNTT12A', 2016, '10/3/1998', N'Cần Thơ') insert into ThongTinSV values(16075431, N'Trần Quốc Qúy', N'Nam', N'DHCNTT12C', 2016, '21/10/1998', N'Hà Tĩnh') insert into ThongTinSV values(16070401, N'Nguyễn Thị Minh Thư', N'Nữ', N'DHCNTT12C', 2016, '10/4/1998', N'Bình Tân') insert into ThongTinSV values(16072881, N'Nguyễn Văn Tỷ', N'Nam', N'DHCNTT12C', 2016, '20/10/1998', N'Bình Tân') insert into ThongTinSV values(16075011, N'Nguyễn Anh Thi', N'Nam', N'DHCNTT12A', 2016, '19/12/1998', N'Cần Thơ') insert into ThongTinSV values(16087221, N'Võ Văn Sơn', N'Nam', N'DHCNTT13F', 2017, '10/1/1999', N'Cà Mau') insert into ThongTinSV values(16777011, N'Hà Ngọc Cao Thắng', N'Nam', N'DHCNTT12A', 2016, '5/5/1998', N'Gò Vấp') insert into ThongTinSV values(16032421, N'Đặng Tuấn Anh', N'Nam', N'DHCNTT11C', 2015, '15/1/1997', N'Phú Yên') insert into ThongTinSV values(16053211, N'Trương Vô Hậu', N'Nam', N'DHCNTT12A', 2016, '8/8/1998', N'Hà Nội') insert into ThongTinSV values(16075211, N'Lưu Thi Thi', N'Nữ', N'DHCNTT10B', 2014, '11/6/1996', N'Gò Vấp') insert into ThongTinSV values(16093111, N'Nguyễn Ngọc Quang', N'Nam', N'DHCNTT13B', 2017, '11/9/1999', N'Hải Phòng') insert into ThongTinSV values(16086311, N'Lưu Đức Hoa', N'Nam', N'DHCNTT11C', 2015, '20/12/1997', N'Hưng Yên') insert into ThongTinSV values(16032521, N'Tô Đức Tài', N'Nam', N'DHCNTT10D', 2014, '10/1/1996', N'Kom Tum') insert into ThongTinSV values(16045321, N'Trần Thị Ngọc Nữ', N'Nữ', N'DHCNTT12A', 2016, '11/8/1998', N'Bình Định') insert into ThongTinSV values(16046321, N'Nguyễn Thị Hoa', N'Nữ', N'DHCNTT13B', 2017, '01/2/1999', N'Nha Trang') insert into ThongTinSV values(16047421, N'Nguyễn Việt Hoa Sơn', N'Nam', N'DHCNTT14B', 2018, '01/2/2000', N'Quảng Ngãi') insert into ThongTinSV values(16053541, N'Lê Tuấn Lộc', N'Nam', N'DHCNTT11D', 2015, '21/3/1997', N'Thanh Hóa') insert into ThongTinSV values(16074251, N'Phan Thị Tím', N'Nữ', N'DHCNTT12D', 2016, '20/11/1998', N'Lâm Đồng') insert into ThongTinSV values(16072311, N'Nguyễn Trường Giang', N'Nam', N'DHCNTT13A', 2017, '2/12/1999', N'Kiên Giang') insert into ThongTinSV values(16087121, N'Tôn Long Hải', N'Nam', N'DHCNTT11C', 2015, '22/8/1997', N'Phú Yên') insert into ThongTinSV values(16042111, N'Lê Thị Kim Tiền', N'Nữ', N'DHCNTT12C', 2016, '22/4/1998', N'Phú Yên') insert into ThongTinSV values(16056211, N'Nguyễn Minh Tân', N'Nam', N'DHCNTT14D', 2018, '2/4/2000', N'Bình Thuận') insert into ThongTinSV values(16064311, N'Nguyễn Trọng Phi', N'Nam', N'DHCNTT11D', 2015, '11/7/1997', N'Ninh Thuận') insert into ThongTinSV values(16086211, N'Ngô Văn Trọng', N'Nam', N'DHCNTT12D', 2016, '30/11/1998', N'Đồng Nai') insert into ThongTinSV values(16085101, N'Trương Ngọc Tiên', N'Nam', N'DHCNTT12A', 2016, '21/6/1998', N'Tiền Giang') insert into ThongTinSV values(16042971, N'Nguyễn Thị Sa Lem', N'Nữ', N'DHCNTT11D', 2015, '30/10/1997', N'Đà Nẵng') insert into ThongTinSV values(16036311, N'Hoàng Tuấn Phúc', N'Nam', N'DHCNTT13C', 2017, '3/12/1999', N'Huế') insert into ThongTinSV values(16097311, N'Phạm Hoàng Anh', N'Nam', N'DHCNTT14V', 2018, '12/1/2000', N'Quảng Ninh') insert into ThongTinSV values(16079911, N'Lưu Diệp Phi', N'Nữ', N'DHCNTT12B', 2016, '13/6/1998', N'Lào Cai') ---------- insert into TaiKhoan values (N'tranthaibao0132', N'123', N'tranthaibao0132@gmail.com', 1000) insert into TaiKhoan values (N'ACC001', N'ACC001', N'phamxuananh@gmail.com', 16075511) insert into TaiKhoan values (N'ACC002', N'ACC002', N'tranthaibao@gmail.com', 16073471) insert into TaiKhoan values (N'ACC003', N'ACC003', N'nguyenvanchien@gmail.com', 16077011) insert into TaiKhoan values (N'ACC005', N'ACC005', N'phamchanh@gmail.com', 16069751) insert into TaiKhoan values (N'ACC006', N'ACC006', N'buihaiha@gmail.com', 16071111) insert into TaiKhoan values (N'ACC007', N'ACC007', N'phamvanhoang@gmail.com', 16023011) insert into TaiKhoan values (N'ACC008', N'ACC008', N'lethihoa@gmail.com', 16098011) insert into TaiKhoan values (N'ACC009', N'ACC009', N'tranthihong@gmail.com', 16021011) insert into TaiKhoan values (N'ACC010', N'ACC010', N'nguyenoanh@gmail.com', 16009011) insert into TaiKhoan values (N'ACC011', N'ACC011', N'phamminhminh@gmail.com', 16027011) insert into TaiKhoan values (N'ACC012', N'ACC012', N'leminhngoc@gmail.com', 16098011) insert into TaiKhoan values (N'ACC013', N'ACC013', N'tranphong@gmail.com', 16070011) insert into TaiKhoan values (N'ACC015', N'ACC015', N'tranquocquy@gmail.com', 16075431) insert into TaiKhoan values (N'ACC016', N'ACC016', N'nguyenthiminhthu@gmail.com', 16070401) insert into TaiKhoan values (N'ACC017', N'ACC017', N'nguyenvanty@gmail.com', 16072881) insert into TaiKhoan values (N'ACC018', N'ACC018', N'nguyenanhthi@gmail.com', 16075011) insert into TaiKhoan values (N'ACC019', N'ACC019', N'vovanson@gmail.com', 16087211) insert into TaiKhoan values (N'ACC020', N'ACC020', N'hangoccaothang@gmail.com', 16777011) insert into TaiKhoan values (N'ACC021', N'ACC021', N'dangtuananh@gmail.com', 16032421) insert into TaiKhoan values (N'ACC022', N'ACC022', N'truongvohau@gmail.com', 16053211) insert into TaiKhoan values (N'ACC023', N'ACC023', N'luuthithi@gmail.com', 16075211) insert into TaiKhoan values (N'ACC024', N'ACC024', N'nguyenngocquang@gmail.com', 16093111) insert into TaiKhoan values (N'ACC025', N'ACC025', N'luuduchoa@gmail.com', 16086311) insert into TaiKhoan values (N'ACC026', N'ACC026', N'toductai@gmail.com', 16032521) insert into TaiKhoan values (N'ACC027', N'ACC027', N'tranthingocnu@gmail.com', 16045321) insert into TaiKhoan values (N'ACC028', N'ACC028', N'nguyenthihoa@gmail.com', 16777011) insert into TaiKhoan values (N'ACC029', N'ACC029', N'nguyenviethoason@gmail.com', 16047421) insert into TaiKhoan values (N'ACC030', N'ACC030', N'letuanloc@gmail.com', 16053541) insert into TaiKhoan values (N'ACC031', N'ACC031', N'phanthitim@gmail.com', 16074251) insert into TaiKhoan values (N'ACC032', N'ACC032', N'nguyentruonggiang@gmail.com', 16072311) insert into TaiKhoan values (N'ACC033', N'ACC033', N'tonlonghai@gmail.com', 16087121) insert into TaiKhoan values (N'ACC034', N'ACC034', N'lethikimtien@gmail.com', 16042111) insert into TaiKhoan values (N'ACC035', N'ACC035', N'nguyenminhtan@gmail.com', 16056211) insert into TaiKhoan values (N'ACC036', N'ACC036', N'nguyentrongphi@gmail.com', 16064311) insert into TaiKhoan values (N'ACC037', N'ACC037', N'ngovantrong@gmail.com', 16086211) insert into TaiKhoan values (N'ACC038', N'ACC038', N'truongngoctien@gmail.com', 16085101) insert into TaiKhoan values (N'ACC039', N'ACC039', N'nguyenthisalem@gmail.com', 16042971) insert into TaiKhoan values (N'ACC040', N'ACC040', N'hoangtuanphuc@gmail.com', 16036311) insert into TaiKhoan values (N'ACC041', N'ACC041', N'phamtuananh@gmail.com', 16097311) insert into TaiKhoan values (N'ACC042', N'ACC042', N'luudiepphi@gmail.com', 16079911) -------------------- insert into Diem values (1000,2000, 7,7,7,7,null) insert into Diem values (1000,2001, 6,7,8,9,null) insert into Diem values (1001,2000, 5,7,7,5,null) insert into Diem values (1000,2002, 4,9,4,7,null) insert into Diem values(16075511, 00001, 7,5,7,6,null) insert into Diem values(16073471, 00002, 7,5.5,7,6,null) insert into Diem values(16077011, 00003, 7,7,7,7,null) insert into Diem values(16069751, 00005, 7,9,9,2,null) insert into Diem values(16071111, 00006, 8,10,7,5,null) insert into Diem values(16023011, 00007, 5,5,6,6,null) insert into Diem values(16098011, 00008, 6,6,8,8,null) insert into Diem values(16098011, 00009, 3,5,3,5,null) insert into Diem values(16009011, 00010, 6,5,3,8,null) insert into Diem values(16027011, 00011, 7,7,5,5,null) insert into Diem values(16098011, 00012, 7,9,10,5,null) insert into Diem values(16070011, 00013, 7,5,5,7,null) insert into Diem values(16075431, 00015, 5,5,7,6,null) insert into Diem values(16070401, 00016, 8,3,3,7,null) insert into Diem values(16072881, 00017, 5,8,8,9,null) insert into Diem values(16075011, 00018, 5,5,8,8,null) insert into Diem values(16087211, 00019, 6,7,8,7,null) insert into Diem values(16777011, 00020, 10,9,8,7,null) insert into Diem values(16075511, 00021, 7,5,7,6,null) insert into Diem values(16075511, 00022, 7,7,7,6,null) insert into Diem values(16075511, 00023, 7,5,7,6,null) insert into Diem values(16075511, 00025, 8,5,8,6,null) insert into Diem values(16075431, 00001, 7,7,6,7,null) insert into Diem values(16075431, 00023, 7,7,8,7,null) insert into Diem values(16073471, 00002, 5,8,6,6,null) insert into Diem values(16073471, 00023, 5,3,8,5,null) insert into Diem values(16073471, 00001, 3,8,3,9,null) insert into Diem values(16032421, 00026, 6,4,8,9,null) insert into Diem values(16053211, 00027, 8,9,9,5,null) insert into Diem values(16075211, 00028, 7,2,7,1,null) insert into Diem values(16093111, 00029, 6,9,3,10,null) insert into Diem values(16086311, 00030, 8,8,2,9,null) insert into Diem values(16032521, 00031, 2,9,5,9,null) insert into Diem values(16045321, 00032, 8,9,9,2,null) insert into Diem values(16046321, 00033, 5,7,3,9,null) insert into Diem values(16047421, 00034, 7,6,8,3,null) insert into Diem values(16053541, 00035, 5,5,5,6,null) insert into Diem values(16074251, 00036, 6,6,7,6,null) insert into Diem values(16072311, 00037, 7,5,7,9,null) insert into Diem values(16087121, 00038, 8,5,8,9,null) insert into Diem values(16042111, 00039, 9,5,9,6,null) insert into Diem values(16056211, 00040, 9,4,7,6,null) insert into Diem values(16064311, 00041, 4,9,6,9,null) insert into Diem values(16086211, 00042, 6,5,4,10,null) insert into Diem values(16085101, 00043, 9,5,10,6,null) insert into Diem values(16042971, 00044, 6,5,1,9,null) insert into Diem values(16036311, 00045, 9,5,2,9,null) insert into Diem values(16097311, 00046, 3,5,7,10,null) insert into Diem values(16079911, 00047, 3,10,4,9,null) update MonHoc set Tiet = N'4-5' where MMH = 2002 delete from ThongTinSV where mssv=1001 select * from MonHoc select * from ThongTinSV select * from TaiKhoan select * from Diem --Các lớp mà mssv 1000 đang học select m.MMH,m.TenMH,m.GiaoVien,m.Thu,m.Tiet,m.PhongHoc from ThongTinSV t join Diem d on d.MSSV=t.MSSV join MonHoc m on m.MMH=d.MMH where t.MSSV=1000 --Lấy điểm của sinh viên 1000 môn 2000 select d.* from ThongTinSV t join Diem d on d.MSSV=t.MSSV join MonHoc m on m.MMH=d.MMH where t.MSSV=1000 and m.MMH = 2000 --Lấy thông tin select sv.MSSV, sv.HoTen, sv.Phai, sv.Lop, sv.NamNhapHoc, sv.NamSinh, sv.Que, mh.MMH, d.DiemTK, d.DiemGK, d.DiemCK, d.DiemTH, tk.Acc, tk.Email from ThongTinSV sv join Diem d on sv.MSSV=d.MSSV join TaiKhoan tk on sv.MSSV=tk.MSSV join MonHoc mh on d.MMH = mh.MMH --Tìm bằng email select ThongTinSV.MSSV, HoTen, Phai, Lop, NamNhapHoc, NamSinh, Que , Email from TaiKhoan join ThongTinSV on TaiKhoan.MSSV=ThongTinSV.MSSV where Email = N'tranthaibao0132@gmail.com' --Tìm bằng mssv select ThongTinSV.MSSV, HoTen, Phai, Lop, NamNhapHoc, NamSinh, Que , Email from TaiKhoan join ThongTinSV on TaiKhoan.MSSV=ThongTinSV.MSSV where ThongtinSV.MSSV = 1000 --Tìm bằng tên select ThongTinSV.MSSV, HoTen, Phai, Lop, NamNhapHoc, NamSinh, Que , Email from TaiKhoan join ThongTinSV on TaiKhoan.MSSV=ThongTinSV.MSSV where HoTen like N'Phạm xUÂN anh' select mh.MMH, DiemTK, DiemGK, DiemCK, DiemTH, DiemTB from ThongTinSV sv join Diem d on sv.MSSV=d.MSSV join MonHoc mh on d.MMH = mh.MMH where sv.MSSV = 1000
true
bbd0ce7578ad29492f564a459546f3f75beb7f5f
SQL
edson-dev/flask-vue
/wotv/dump-postgres-202010302049.sql
UTF-8
2,363
2.765625
3
[]
no_license
-- -- PostgreSQL database dump -- -- Dumped from database version 12.2 (Debian 12.2-2.pgdg90+1) -- Dumped by pg_dump version 12.2 -- Started on 2020-10-30 20:49:13 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -- -- TOC entry 3 (class 2615 OID 2200) -- Name: public; Type: SCHEMA; Schema: -; Owner: postgres -- CREATE SCHEMA public; ALTER SCHEMA public OWNER TO postgres; -- -- TOC entry 2881 (class 0 OID 0) -- Dependencies: 3 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres -- COMMENT ON SCHEMA public IS 'standard public schema'; SET default_tablespace = ''; SET default_table_access_method = heap; -- -- TOC entry 202 (class 1259 OID 16384) -- Name: apis; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.apis ( tables character varying ); ALTER TABLE public.apis OWNER TO postgres; -- -- TOC entry 203 (class 1259 OID 16390) -- Name: characters; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.characters ( name character varying NOT NULL, rank integer, link character varying ); ALTER TABLE public.characters OWNER TO postgres; -- -- TOC entry 2874 (class 0 OID 16384) -- Dependencies: 202 -- Data for Name: apis; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.apis (tables) FROM stdin; characters \. -- -- TOC entry 2875 (class 0 OID 16390) -- Dependencies: 203 -- Data for Name: characters; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.characters (name, rank, link) FROM stdin; Edson 44 /index \. -- -- TOC entry 2746 (class 1259 OID 16396) -- Name: ix_characters_6ae999552a0d2dca; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX ix_characters_6ae999552a0d2dca ON public.characters USING btree (name); -- -- TOC entry 2747 (class 1259 OID 16397) -- Name: ix_characters_e0c896cc4f59c8f5; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX ix_characters_e0c896cc4f59c8f5 ON public.characters USING btree (name, rank); -- Completed on 2020-10-30 20:49:26 -- -- PostgreSQL database dump complete --
true
c904795361c1969197b558e4ba370599e8b4afb7
SQL
bstano/ProjectQueries
/how many at each station.sql
UTF-8
84
2.890625
3
[]
no_license
select start_station, count(*) trip_count from trips group by start_station
true
a83e1ac7f853a034f86b1263119d8d9475dc699a
SQL
lecaillon/Evolve
/test/Evolve.Tests/Integration/PostgreSQL/Resources/Sql_Scripts/OutOfOrder/V1_5__create_table.sql
UTF-8
146
2.546875
3
[ "MIT" ]
permissive
-- Create table out_of_order CREATE TABLE out_of_order ( did integer PRIMARY KEY, name varchar(40) NOT NULL CHECK (name <> '') );
true
bcb10be5ad5c3c5cfe596e66a2db80a212765ff9
SQL
boyangwang/fragen
/src/private/schema.sql
UTF-8
7,498
3.875
4
[]
no_license
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; CREATE SCHEMA IF NOT EXISTS `laughing_avenger` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; USE `laughing_avenger` ; -- ----------------------------------------------------- -- Table `laughing_avenger`.`user` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`user` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`user` ( `user_id` BIGINT UNSIGNED NOT NULL COMMENT 'fbid of the user' , `fb_username` VARCHAR(100) NULL , `fbpic_url` VARCHAR(255) NULL , `name` VARCHAR(100) NULL , PRIMARY KEY (`user_id`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `laughing_avenger`.`module` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`module` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`module` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT , `title` VARCHAR(100) NOT NULL , `description` TEXT NULL , PRIMARY KEY (`id`) ) ENGINE = InnoDB; INSERT INTO module (`title`, `description`) VALUES ('CS3216', 'Software Development on Evolving Platforms'), ('CS2103', 'Software Engineering'), ('EE2020', 'Digital Fundamentals'), ('EE2021', 'Devices And Circuits'), ('CG2271', 'Real-Time Operating System'); -- ----------------------------------------------------- -- Table `laughing_avenger`.`post` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`post` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`post` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'the primary key\n' , `title` VARCHAR(255) NOT NULL , `content` TEXT NULL , `owner_id` BIGINT UNSIGNED NOT NULL COMMENT 'ID of the user that posted this' , `type` INT NOT NULL COMMENT '0 for question, 1 for answer' , `parent_id` INT UNSIGNED NULL DEFAULT NULL COMMENT 'NULL for question, id of parent question for answers' , `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'time created' , `module_id` INT UNSIGNED NULL , `votecount` INT NOT NULL DEFAULT 0 COMMENT 'upvote minus downvote' , `close_time` TIMESTAMP NULL DEFAULT NULL COMMENT 'NULL for open questions\n' , `accepted_answer` INT UNSIGNED NULL DEFAULT NULL COMMENT 'id for the answer accepted' , `anonymous` TINYINT NOT NULL DEFAULT 0 COMMENT '1 for anonymous, 0 for public' , PRIMARY KEY (`id`) , INDEX `question_answer_postid_idx` (`parent_id` ASC) , INDEX `post_accepted_answer_id_idx` (`accepted_answer` ASC) , INDEX `post_user_user_id_idx` (`owner_id` ASC) , INDEX `post_module_id_idx` (`module_id` ASC) , CONSTRAINT `post_parentid_id` FOREIGN KEY (`parent_id` ) REFERENCES `laughing_avenger`.`post` (`id` ) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `post_accepted_answer_id` FOREIGN KEY (`accepted_answer` ) REFERENCES `laughing_avenger`.`post` (`id` ) ON DELETE SET NULL ON UPDATE NO ACTION, CONSTRAINT `post_user_user_id` FOREIGN KEY (`owner_id` ) REFERENCES `laughing_avenger`.`user` (`user_id` ) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `post_module_id` FOREIGN KEY (`module_id` ) REFERENCES `laughing_avenger`.`module` (`id` ) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `laughing_avenger`.`vote` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`vote` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`vote` ( `user_id` BIGINT UNSIGNED NOT NULL , `post_id` INT UNSIGNED NOT NULL , `type` TINYINT NULL COMMENT '1 for upvote, -1 for downvote' , PRIMARY KEY (`user_id`, `post_id`) , INDEX `vote_post_id_id_idx` (`post_id` ASC) , INDEX `vote_user_user_id_idx` (`user_id` ASC) , CONSTRAINT `vote_post_id_id` FOREIGN KEY (`post_id` ) REFERENCES `laughing_avenger`.`post` (`id` ) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `vote_user_user_id` FOREIGN KEY (`user_id` ) REFERENCES `laughing_avenger`.`user` (`user_id` ) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `laughing_avenger`.`comment` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`comment` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`comment` ( `id` INT NOT NULL AUTO_INCREMENT , `user_id` BIGINT UNSIGNED NOT NULL , `post_id` INT UNSIGNED NOT NULL , `content` TEXT NOT NULL , `timestamp` TIMESTAMP NOT NULL , `anonymous` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 for anonymous, 0 for public' , PRIMARY KEY (`id`) , INDEX `comment_post_id_id_idx` (`post_id` ASC) , INDEX `comment_user_user_id_idx` (`user_id` ASC) , CONSTRAINT `comment_post_id_id` FOREIGN KEY (`post_id` ) REFERENCES `laughing_avenger`.`post` (`id` ) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `comment_user_user_id` FOREIGN KEY (`user_id` ) REFERENCES `laughing_avenger`.`user` (`user_id` ) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `laughing_avenger`.`enrollment` -- ----------------------------------------------------- DROP TABLE IF EXISTS `laughing_avenger`.`enrollment` ; CREATE TABLE IF NOT EXISTS `laughing_avenger`.`enrollment` ( `user_id` BIGINT UNSIGNED NOT NULL , `module_id` INT UNSIGNED NOT NULL , `is_manager` TINYINT NOT NULL DEFAULT 0 COMMENT '0 for normal enrollment, 1 for manager' , PRIMARY KEY (`user_id`, `module_id`) , INDEX `enrollment_user_user_id_idx` (`user_id` ASC) , INDEX `enrollment_module_mod_id_idx` (`module_id` ASC) , CONSTRAINT `enrollment_user_user_id` FOREIGN KEY (`user_id` ) REFERENCES `laughing_avenger`.`user` (`user_id` ) ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT `enrollment_module_mod_id` FOREIGN KEY (`module_id` ) REFERENCES `laughing_avenger`.`module` (`id` ) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE = InnoDB; USE `laughing_avenger` ; USE `laughing_avenger`; DELIMITER $$ USE `laughing_avenger`$$ DROP TRIGGER IF EXISTS `laughing_avenger`.`vote_BDEL` $$ USE `laughing_avenger`$$ CREATE TRIGGER `vote_BDEL` BEFORE DELETE ON vote FOR EACH ROW -- Edit trigger body code below this line. Do not edit lines above this one UPDATE post p SET p.votecount=p.votecount - OLD.type WHERE p.id = OLD.post_id; $$ USE `laughing_avenger`$$ DROP TRIGGER IF EXISTS `laughing_avenger`.`vote_AUPD` $$ USE `laughing_avenger`$$ CREATE TRIGGER `vote_AUPD` AFTER UPDATE ON vote FOR EACH ROW -- Edit trigger body code below this line. Do not edit lines above this one UPDATE post p SET p.votecount=p.votecount + NEW.type - OLD.type WHERE p.id = NEW.post_id $$ USE `laughing_avenger`$$ DROP TRIGGER IF EXISTS `laughing_avenger`.`vote_AINS` $$ USE `laughing_avenger`$$ CREATE TRIGGER `vote_AINS` AFTER INSERT ON vote FOR EACH ROW -- Edit trigger body code below this line. Do not edit lines above this one UPDATE post p SET p.votecount=p.votecount + NEW.type WHERE p.id = NEW.post_id; $$ DELIMITER ; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
a6cd0a737a0a1af7cb5ab42cebf55216f71079d3
SQL
ntudor11/DBExercises
/imdb/queries.sql
UTF-8
5,404
4.4375
4
[]
no_license
-- 1. a. The person relation contains 573 entries with a registered height greater than 190 centimetres. How many entries do not have a registered height? select count(*) from person where height > 190; -- test select count(*) from person where height is null; -- result: 47315 -- 1. b. In the database, there are 365 movies where the average height of all people involved is less than 165 centimetres (ignoring people where the height is not registered). For how many movies is the average height of all people involved greater than 190 centimetres? select count(*) from ( select movieId, avg(P.height) from Involved I join person P on I.personId = P.ID group by I.movieId having avg(P.height) < 165 ) X; -- test select count(*) from ( select movieId, avg(p.height) from involved i join person as p on i.personId = p.id group by i.movieId having avg(p.height) > 190 ) x; -- result 190 -- 1. c. The movie genre relation does not have a primary key, which can lead to a movie having more than one entry with the same genre. How many movies in movie genre have such duplicate entries? select count(*) from (select movieId from movie_genre group by movieId having count(distinct genre) <> count(*) ) ; -- 143 -- According to the information in the database, 476 different persons acted in movies directed by ‘Francis Ford Coppola’. How many different persons acted in movies directed by ‘Steven Spielberg’? select count(distinct i1.personId) from involved i1 join involved i2 on i1.movieId = i2.movieId join person p on i2.personId = p.id where i1.role = 'actor' and i2.role = 'director' and p.name = 'Francis Ford Coppola' ; -- test / result - 476 select count(distinct i1.personId) from involved i1 join involved i2 on i1.movieId = i2.movieId join person p on i2.personId = p.id where i1.role = 'actor' and i2.role = 'director' and p.name = 'Steven Spielberg' ; -- result 2219 -- 1. e. Of all the movies produced in 2002, there are 12 that have no registered entry in involved. How many movies produced in 1999 have no registered entry in involved? select count(*) from movie m where m.year = 2002 and m.id not in ( select i.movieId from involved i ) ; -- test; result 12 select count(*) from movie m where m.year = 1999 and m.id not in ( select i.movieId from involved i ) ; -- result 7 -- 1. f. In the database, the number of persons who have acted in exactly one movie that they self directed is 603. How many persons have acted in more than one movie that they self directed? select count(distinct i1.personId) from involved i1 join involved i2 on i1.movieId = i2.movieId join person p1 on i2.personId = p1.id join person p2 on i1.personId = p2.id where i1.role = 'actor' and i2.role = 'director' ; select count(*) from ( select I1.personId, count(*) from involved I1 join involved I2 on I1.movieId = I2.movieId and I1.personId = I2.personId where I1.role = 'actor' and I2.role = 'director' group by I1.personId having count(*) = 1 ) X; -- test, result 603 select count(*) from ( select i1.personId from involved i1 join involved i2 on i1.movieId = i2.movieId and i1.personId = i2.personId where i1.role = 'actor' and i2.role = 'director' group by i1.personId having count(*) > 1 ) x ; -- result 345 -- 1. g. Of all the movies produced in 2002, there are 282 that have entries registered in involved for all roles defined in the roles relation. How many movies produced in 1999 have entries registered in involved for all roles defined in the roles relation? Note: This is a relational division query which must work for any schema; you can not use the fact that currently there are only 2 different roles. select count(*) from ( select M.id from movie M join involved I on M.id = I.movieId where M.year = 2002 group by M.id having count(distinct I.role) = ( select count(*) from role R ) ) X; -- test, result 282 select count(*) from ( select m.id from movie m join involved i on m.id = i.movieId where m.year = 1999 group by m.id having count(distinct i.role) = ( select count(*) from role ) ) x ; -- result 250 -- 1. h. The number of persons who have had some role in some movie from all genres from the category ‘Newsworthy’ is 156. How many persons have had some role in some movie from all genres from the category ‘Lame’? select count(*) from ( select P.id from person P join involved I on P.id = I.personId join movie M on I.movieId = M.ID join movie_genre MG on MG.movieId = M.id join genre G on MG.genre = G.genre where G.category = 'Newsworthy' group by P.id having count(distinct G.genre) = ( select count(*) from genre where category = 'Newsworthy' ) ) X; -- test, result 156 select count(*) from ( select p.id from person p join involved i on p.id = i.personId join movie m on i.movieId = m.id join movie_genre mg on mg.movieId = m.id join genre g on mg.genre = g.genre where g.category = 'Lame' group by p.id having count(distinct g.genre) = ( select count(*) from genre where category = 'Lame' ) ) x; -- result 1
true
379057cd2f1751cc3e6674b24b6633dd7ad39bea
SQL
Adrici/BancoDeDadosMySQL
/introducao_MySQL/aula 25-09_ex3.sql
UTF-8
1,749
4.15625
4
[]
no_license
create database aula_select; use aula_select; create table clientes ( codigo_cliente int not null primary key, nome varchar (50), cidade varchar (10), serie char (1) ); CREATE table funcionarios ( id int not null auto_increment, nome varchar(30) NOT NULL, nascimento date, sexo enum ('M','F'), peso decimal(5,2), altura decimal(3,2), nacionalidade varchar(20) DEFAULT 'Brasil', primary key (id)); Insert into funcionarios values ('1','Alex', '2018-02-03','M','68.5','2.50', 'Brasil'); Insert into funcionarios values ('2','Gabriela', '1998-02-03','F','58.5','1.60', 'Brasil'), ('3','Daniela', '1995-02-03','F','56.5','1.57', 'Brasil'); select id, nom from funcionarios; select * from funcionarios where id = 3; select * from funcionarios where nome = 'Gabriela'; select COUNT(*) From funcionarios; # quando começar com a letra 'g' select * from funcionarios where nome like 'g%'; # quando acabar com a letra 'a' select * from funcionarios where nome like 'g%'; select * from funcionarios where sexo = 'F' and nacionalidade = 'Brasil'; #quando conter os caracteres abriel (exemplo gabriela e gabriel) select*from funcionarios where nome like '%abriel%'; # quando a segunda letra for o L... porque o under line indica que há uma letra antes do 'l'. # se voce quiser outras posições, use um underline para cada posição anterior, entao mostrará a prox. select* from funcionarios where nome like '_l%'; select*from funcionarios where altura > 2; Insert into funcionarios values ('1','Alex', '2018-02-03','M','68.5','2.50', 'Brasil'); Insert into funcionarios values ('2','Gabriela', '1998-02-03','F','58.5','1.60', 'Brasil'), ('3','Daniela', '1995-02-03','F','56.5','1.57', 'Brasil');
true
c2a2be390ac9774c651c07b7549bea7048cc48fc
SQL
zhjzjnb/sdk-server
/sdkserver.sql
UTF-8
2,091
3.1875
3
[ "MIT" ]
permissive
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50635 Source Host : localhost Source Database : sdkserver Target Server Type : MySQL Target Server Version : 50635 File Encoding : utf-8 Date: 01/27/2018 14:03:24 PM */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for `admin` -- ---------------------------- DROP TABLE IF EXISTS `admin`; CREATE TABLE `admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `permission` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `iuser_name` (`user_name`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `game` -- ---------------------------- DROP TABLE IF EXISTS `game`; CREATE TABLE `game` ( `app_id` int(11) NOT NULL AUTO_INCREMENT, `app_key` varchar(255) NOT NULL, `app_secret` varchar(255) NOT NULL, `public_key` varchar(1024) NOT NULL, `private_key` varchar(1024) NOT NULL, `create_time` datetime NOT NULL, `game_name` varchar(255) NOT NULL, `pay_callback` varchar(255) NOT NULL, PRIMARY KEY (`app_id`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `user_info` -- ---------------------------- DROP TABLE IF EXISTS `user_info`; CREATE TABLE `user_info` ( `uid` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(25) NOT NULL, `password` varchar(36) NOT NULL, `platform` varchar(255) NOT NULL, `root` smallint(6) NOT NULL, `system_version` varchar(255) NOT NULL, `system_name` varchar(255) NOT NULL, `device_model` varchar(255) NOT NULL, `device_name` varchar(255) NOT NULL, `register_time` datetime NOT NULL, `register_place` varchar(255) NOT NULL, PRIMARY KEY (`uid`,`user_name`), UNIQUE KEY `iuser` (`user_name`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; SET FOREIGN_KEY_CHECKS = 1;
true
a274d404540a393a647fec68a325c802633a6e2e
SQL
r99r99r99/shdb
/db/table/aiot/beach/aiot_beach_threshold.sql
UTF-8
1,016
3.15625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : 192.168.10.80 Source Server Version : 50713 Source Host : 192.168.10.80:3306 Source Database : ytsocean Target Server Type : MYSQL Target Server Version : 50713 File Encoding : 65001 Date: 2018-06-27 15:49:07 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for aiot_beach_threshold -- ---------------------------- DROP TABLE IF EXISTS `aiot_beach_threshold`; CREATE TABLE `aiot_beach_threshold` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(255) NOT NULL, `levelid` int(11) NOT NULL, `mincal` int(11) DEFAULT NULL COMMENT '下限的计算方式 1 >= 0 >', `min` double DEFAULT NULL, `maxcal` int(11) DEFAULT NULL COMMENT '上限的计算方式 1<= 0<', `max` double DEFAULT NULL, `data` double DEFAULT NULL COMMENT '当TYPE=2时,计算用此参数 当type=1时,用上方的范围计算方式', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8;
true
6c506a61a418ef0c70a4e06f1f164bbfed168cd7
SQL
n1ghtcr4wl3r26/4ct1v0s_db
/ACTIVOS_OWA_SYLK_ddl.sql
UTF-8
7,252
3.140625
3
[]
no_license
CREATE OR REPLACE PACKAGE owa_sylk as -- type owaSylkArray is table of varchar2(2000); -- procedure show( p_file in utl_file.file_type, p_query in varchar2, p_parm_names in owaSylkArray default owaSylkArray(), p_parm_values in owaSylkArray default owaSylkArray(), p_sum_column in owaSylkArray default owaSylkArray(), p_max_rows in number default 10000, p_show_null_as in varchar2 default null, p_show_grid in varchar2 default 'YES', p_show_cantidad in number, p_show_col_headers in varchar2 default 'YES', p_font_name in varchar2 default 'Courier New', p_widths in owaSylkArray default owaSylkArray(), p_titles in owaSylkArray default owaSylkArray(), p_strip_html in varchar2 default 'YES' ); -- procedure show( p_file in utl_file.file_type, p_cursor in integer, p_sum_column in owaSylkArray default owaSylkArray(), p_max_rows in number default 10000, p_show_null_as in varchar2 default null, p_show_grid in varchar2 default 'YES', p_show_cantidad in number, p_show_col_headers in varchar2 default 'YES', p_font_name in varchar2 default 'Courier New', p_widths in owaSylkArray default owaSylkArray(), p_titles in owaSylkArray default owaSylkArray(), p_strip_html in varchar2 default 'YES' ); -- end owa_sylk; / CREATE OR REPLACE PACKAGE BODY owa_sylk as -- g_cvalue varchar2(32767); g_desc_t dbms_sql.desc_tab; type vc_arr is table of varchar2(2000) index by binary_integer; g_lengths vc_arr; g_sums vc_arr; -- -- g_file utl_file.file_type; procedure p( p_str in varchar2 ) is begin utl_file.put_line( g_file, p_str ); exception when others then null; end; function build_cursor( q in varchar2, n in owaSylkArray, v in owaSylkArray ) return integer is c integer := dbms_sql.open_cursor; i number := 1; begin dbms_sql.parse (c, q, dbms_sql.native); loop dbms_sql.bind_variable( c, n(i), v(i) ); i := i + 1; end loop; return c; exception when others then return c; end build_cursor; function ite( b boolean, t varchar2, f varchar2 ) return varchar2 is begin if b then return t; else return f; end if; end ite; procedure print_heading( font in varchar2, grid in varchar2, col_heading in varchar2, titles in owaSylkArray ) is l_title varchar2(2000); l_titlet varchar2(2000); begin p('<tr>'); for i in 1 .. g_desc_t.count loop g_lengths(i) := g_desc_t(i).col_name_len; g_sums(i) := 0; begin l_title := titles(i); exception when others then l_title := g_desc_t(i).col_name; end; l_title:='<td>'||l_title||'</td>'; l_titlet := l_titlet||l_title; end loop; p(l_titlet); p('</tr>'); end print_heading; -- function print_rows( c in integer, max_rows in number, sum_columns in owaSylkArray, show_null_as in varchar2, strip_html in varchar2, show_cantidad in number ) return number is row_cnt number := 0; line varchar2(32767) := null; n number; j number; begin loop p('<tr>'); exit when ( row_cnt >= max_rows or dbms_sql.fetch_rows( c ) <= 0 ); row_cnt := row_cnt + 1; -- j := 1; line:=''; for i in 1 .. g_desc_t.count loop dbms_sql.column_value( c, i, g_cvalue ); g_cvalue := translate( g_cvalue, chr(10)||chr(9)||';', ' ' ); g_lengths(i) := greatest( nvl(length(g_cvalue), nvl(length(show_null_as),0)), g_lengths(i) ); line := line||'<td class=xl24>'||g_cvalue||'</td>'; if j=show_cantidad then p( line ); j:=1; line:=''; end if; j:=j+1; end loop; p('</tr>'); end loop; p('</tr>'); return row_cnt; end print_rows; procedure show( p_file in utl_file.file_type, p_cursor in integer, p_sum_column in owaSylkArray default owaSylkArray(), p_max_rows in number default 10000, p_show_null_as in varchar2 default null, p_show_grid in varchar2 default 'YES', p_show_cantidad in number, p_show_col_headers in varchar2 default 'YES', p_font_name in varchar2 default 'Courier New', p_widths in owaSylkArray default owaSylkArray(), p_titles in owaSylkArray default owaSylkArray(), p_strip_html in varchar2 default 'YES' ) is -- l_row_cnt number; l_col_cnt number; l_status number; begin g_file := p_file; dbms_sql.describe_columns( p_cursor, l_col_cnt, g_desc_t ); -- for i in 1 .. g_desc_t.count loop dbms_sql.define_column( p_cursor, i, g_cvalue, 32765); end loop; -- p('<html>'); p('<head>'); p('<style>'); p('.xl24'); p(' {mso-number-format:"\@";}'); p('</style>'); p('</head>'); p('<body>'); p('<table x:str border=0>'); print_heading( p_font_name, p_show_grid, p_show_col_headers, p_titles ); l_status := dbms_sql.execute( p_cursor ); l_row_cnt := print_rows( p_cursor, p_max_rows, p_sum_column, p_show_null_as, p_strip_html, p_show_cantidad ); p('</table>'); p('</body>'); p('</html>'); end show; -- procedure show( p_file in utl_file.file_type, p_query in varchar2, p_parm_names in owaSylkArray default owaSylkArray(), p_parm_values in owaSylkArray default owaSylkArray(), p_sum_column in owaSylkArray default owaSylkArray(), p_max_rows in number default 10000, p_show_null_as in varchar2 default null, p_show_grid in varchar2 default 'YES', p_show_cantidad in number, p_show_col_headers in varchar2 default 'YES', p_font_name in varchar2 default 'Courier New', p_widths in owaSylkArray default owaSylkArray(), p_titles in owaSylkArray default owaSylkArray(), p_strip_html in varchar2 default 'YES' ) is begin show( p_file => p_file, p_cursor => build_cursor( p_query, p_parm_names, p_parm_values ), p_sum_column => p_sum_column, p_max_rows => p_max_rows, p_show_null_as => p_show_null_as, p_show_grid => p_show_grid, p_show_cantidad => p_show_cantidad, p_show_col_headers => p_show_col_headers, p_font_name => p_font_name, p_widths => p_widths, p_titles => p_titles, p_strip_html => p_strip_html ); end show; -- end owa_sylk; /
true
0eeff9cef3730867c97a604c2e55a1472619b556
SQL
jaeeun-jung/dbSql
/20200422.sql
UHC
3,959
3.484375
3
[]
no_license
date ǽ fn3] ڿ => ¥ ==> ¥ ==> TO_DATE('201912', 'YYYYMM') SELECT TO_DATE(:YYYYMM, 'YYYYMM'), LAST_DAY(TO_DATE(:YYYYMM, 'YYYYMM')), TO_CHAR(LAST_DAY(TO_DATE(:YYYYMM, 'YYYYMM')), 'DD') FROM dual; EXPLAIN PLAN FOR SELECT * FROM emp WHERE empno = '7369'; (empno = 7369) SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY); Plan hash value: 3956160932 ȹ (id) ***sql d ߿ --(?) ڼ * 鿩 Ǿ ڽ ۷̼ 1. Ʒ * ڽ ۷̼ ڽĺ д´. 1 ==> 0 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 38 | 3 (0)| 00:00:01 | -- ÷ 8 ׳ |* 1 | TABLE ACCESS FULL| EMP | 1 | 38 | 3 (0)| 00:00:01 | --1 0 ڽ ۷̼ / б -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("EMPNO"=7369) -- 14 ߿ ϴ ͸ ͸ EXPLAIN PLAN FOR SELECT * FROM emp WHERE TO_CHAR(empno) = '7369'; SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY); Plan hash value: 3956160932 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 38 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP | 1 | 38 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter(TO_CHAR("EMPNO")='7369') EXPLAIN PLAN FOR SELECT * FROM emp WHERE empno = 7300 + '69'; SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY); Plan hash value: 3956160932 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 38 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP | 1 | 38 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("EMPNO"=7369) -- emp ̺ μ . -- ̺ ,  ȹ Ȯؾ Ѵ. SELECT ename, sal, TO_CHAR(sal, 'L0009,999.00') fm_sal --L : FROM emp; NULL õ Լ NVL NVL2 NULLIF COALESCE; null ó ؾұ? NULL NULL̴.  emp ̺ ϴ sal, comm ΰ ÷ ˰ ; SQL ۼ. SELECT empno, ename, sal, comm, sal + comm AS sal_plus_comm FROM emp; NVL(exprl, expr2) expr1 null̸ expr2 ϰ expr1 null ƴϸ expr1 SELECT empno, ename, sal, comm, sal + NVL(comm, 0) sal_plus_comm FROM emp; REG_DT ÷ NULL ¥ ڷ ǥ SELECT userid, usernm, reg_dt FROM users; SELECT userid, usernm, NVL(reg_dt, LAST_DAY(SYSDATE)) FROM users;
true
0c6607ed1b6482c7cbc7c61ce09effcc64e19c71
SQL
dakar24/basjoo-doc
/sql/receive_address_info.sql
GB18030
824
2.9375
3
[]
no_license
CREATE TABLE `receive_address_info` ( `address_id` varchar(64) NOT NULL COMMENT 'ַID', `user_id` varchar(64) NOT NULL COMMENT 'ûID', `receiver` varchar(64) NOT NULL COMMENT 'ռ', `tel` varchar(64) DEFAULT NULL COMMENT 'ϵ绰', `section` varchar(256) DEFAULT NULL COMMENT 'ڵ', `street` varchar(256) DEFAULT NULL COMMENT 'ڽ', `detail` varchar(256) DEFAULT NULL COMMENT 'ϸַ', `post_code` varchar(16) DEFAULT NULL COMMENT 'ʱ', `is_default` bigint(20) DEFAULT NULL COMMENT 'ǷĬ', `gmt_create` timestamp NULL DEFAULT NULL COMMENT 'ʱ', `gmt_modify` timestamp NULL DEFAULT NULL COMMENT '޸ʱ', PRIMARY KEY (`address_id`), KEY `user_id_index` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ջַ';
true
b79e1518c4b8db8bf817f05f30daca3ba6d62639
SQL
mila89/Database-MSSQL
/IndicesandDataAggregation/4. SmallestDepositGroupPerMagicWandSize.sql
UTF-8
149
2.984375
3
[]
no_license
SELECT TOP(2) DepositGroup from (select DepositGroup, AVG(MagicWandSize) AS M FROM WizzardDeposits GROUP BY DepositGroup) as d ORDER BY d.m;
true
e9ecb254933cbc66e01d54e37c89529501c2a891
SQL
Team100/Scouting2016
/Server/WebServer/admin/data/compsystem-tables.sql
UTF-8
26,436
3.796875
4
[]
no_license
# # $Revision: 3.0 $ # $Date: 2016/03/14 23:00:02 $ # $Id$ # # Red Rock Robotics, WildHats, Verkler # Competition System Table Schema # # Notes: # - creates all tables for a new instance of the competition system # # - if you modify a table, make _sure_ the modification is also made in this schema # # - to execute, run mysql as: # mysql -D db-name -u user -p < scriptname # # - document the purpose of a table by in the heading before the table # # - a "drop table" script is maintained in compsystem-tables-drop.sql # # # # General schema notes # - Schema includes patterns from Blue Alliance API but does not adhere to its # structure or key system entirely # - Assumes that the system is refreshed yearly, but that team info persists. # This means: # - Fields that Blue Alliance can modify are tagged as such in the schema, # with tBA (the Blue Alliance) # - The schema must work for multiple regional competitions and for nationals, # which looks like a collection of regional competitions. # # # Event # # Event ID, used to qualify data entry and use for a specific regional # # For nationals, we may have scouting for each of four fields. Building in ability to clone # this app and use it in multiple places, then export and import those data into a master, or # manage instances of the app and team, using the same event model. # # create table event ( event_id varchar(10), # tBA key (event key), format yyyy[Event_Code] name varchar(20), # tBA short_name long_name varchar(100), # tBA name, official name event_code varchar(4), # tBA event_code event_type varchar(20), # tBA event_type_string, human-readable event, i.e. 'Regional' event_type_id int, # tBA event_type, with a number code year int, # tBA year location varchar(40), # tBA location website varchar(100), # tBA website, event webssite primary key (event_id) ); # # Team # # General team information, intended to be carried forward year after year # # create table team ( teamnum int, # FIRST team number - primary key. We do not use frcNNNN, just the NNNN # Note: the mapping from tBA is done by mapping function locked varchar(12), # row locked for editing by user. Can clear in application. name varchar(50), # tBA, FIRST nickname nickname varchar(30), # our nickname for team rating int, # our 0-9 rating of team capabilities and competencies org varchar(80), # high school or other organization location varchar(80), # tBA location, location of team students int, # number of students on team website varchar(80), # tBA website, team web site sponsors varchar(1000), # tBA name, team sponsors rookie_year int, # tBA rookie_year notes varchar(5000), # notes on our interaction with the team primary key (teamnum) ); # # team history # # team history of events, as loaded from Blue Alliance, team history object # # Foreign key from team table # create table team_history ( teamnum int, # FIRST team number - foreign key from team table event_id varchar(10), # tBA event_key ("key") in the history object. Note: not a foreign key to event table year int, # tBA year reg_name varchar(60), # tBA name of regional primary key (teamnum,event_id) ); # # team history award # # team history of awards at each event, as loaded from Blue Alliance, team history award object # # Foreign key from team table # create table team_history_award ( teamnum int, # FIRST team number - foreign key from team table event_id varchar(10), # tBA event_key ("key") in the team history award object Note: not a foreign key to event table award_type varchar(3), # tBA award_type (integer) award_name varchar(100), # tBA name in team history object primary key (teamnum,event_id,award_type) ); # # teambot # # Information on the team and bot at the event. # There should only be one entry in this table for event players # # Foreign key from team table # create table teambot ( event_id varchar(8), # FK to event table teamnum int, # FIRST team number - foreign key from team table locked varchar(12), # row locked for editing by user. Can clear in application. updatedby varchar(200), # last updated by users bot_name varchar(30), # tBA robot name f_ranking int, # tBA ranking from FIRST f_rank_score real, # tBA seed points from FIRST f_record varchar(8), # tBA FIRST record, W-L-T f_games_played int, # tBA FIRST games played f_rankparam0 real, # tBA FIRST parameter 0 in game-specific rankings f_rankparam1 real, # tBA FIRST parameter 1 in game-specific rankings f_rankparam2 real, # tBA FIRST parameter 2 in game-specific rankings f_rankparam3 real, # tBA FIRST parameter 3 in game-specific rankings f_rankparam4 real, # tBA FIRST parameter 4 in game-specific rankings f_rankparam5 real, # tBA FIRST parameter 5 in game-specific rankings f_rankparam6 real, # tBA FIRST parameter 6 in game-specific rankings f_rankparam7 real, # tBA FIRST parameter 7 in game-specific rankings f_rankparam8 real, # tBA FIRST parameter 8 in game-specific rankings opr real, # tBA oprs, Offensive power rating dpr real, # tBA dprs, defensive power rating ccwm real, # tBA ccwm, calculated contribution to winning margin rank_overall real, # overall rank (by us) rating_overall int, # 0-9 rating as an overall bot rating_overall_off int, # 0-9 rating offensively rating_overall_def int, # 0-9 rating defensively rank_pos1 real, # overall rank in position 1 rating_pos1 int, # 0-9 rating in position 1 rank_pos2 real, # overall rank in position 2 rating_pos2 int, # 0-9 rating in position 2 rank_pos3 real, # overall rank in position 3 rating_pos3 int, # 0-9 rating in position 3 rating_driver int, # 0-9 rating for driver PlayField_0 varchar(50), # Play Field 0 (meaning/assignment defined in params) PlayField_1 varchar(50), # Play Field 1 (meaning/assignment defined in params) PlayField_2 varchar(50), # Play Field 2 (meaning/assignment defined in params) PlayField_3 varchar(50), # Play Field 3 (meaning/assignment defined in params) PlayField_4 varchar(50), # Play Field 4 (meaning/assignment defined in params) PlayField_5 varchar(50), # Play Field 5 (meaning/assignment defined in params) PlayField_6 varchar(50), # Play Field 6 (meaning/assignment defined in params) PlayField_7 varchar(50), # Play Field 7 (meaning/assignment defined in params) PlayField_8 varchar(50), # Play Field 8 (meaning/assignment defined in params) PlayField_9 varchar(50), # Play Field 9 (meaning/assignment defined in params) PlayField_10 varchar(50), # Play Field 10 (meaning/assignment defined in params) PlayField_11 varchar(50), # Play Field 11 (meaning/assignment defined in params) PlayField_12 varchar(50), # Play Field 12 (meaning/assignment defined in params) PlayField_13 varchar(50), # Play Field 13 (meaning/assignment defined in params) PlayField_14 varchar(50), # Play Field 14 (meaning/assignment defined in params) PlayField_15 varchar(50), # Play Field 15 (meaning/assignment defined in params) PlayField_16 varchar(50), # Play Field 16 (meaning/assignment defined in params) PlayField_17 varchar(50), # Play Field 17 (meaning/assignment defined in params) PlayField_18 varchar(50), # Play Field 18 (meaning/assignment defined in params) PlayField_19 varchar(50), # Play Field 19 (meaning/assignment defined in params) PlayField_20 varchar(50), # Play Field 20 (meaning/assignment defined in params) PlayField_21 varchar(50), # Play Field 21 (meaning/assignment defined in params) PlayField_22 varchar(50), # Play Field 22 (meaning/assignment defined in params) PlayField_23 varchar(50), # Play Field 23 (meaning/assignment defined in params) PlayField_24 varchar(50), # Play Field 24 (meaning/assignment defined in params) PlayField_25 varchar(50), # Play Field 25 (meaning/assignment defined in params) PlayField_26 varchar(50), # Play Field 26 (meaning/assignment defined in params) PlayField_27 varchar(50), # Play Field 27 (meaning/assignment defined in params) PlayField_28 varchar(50), # Play Field 28 (meaning/assignment defined in params) PlayField_29 varchar(50), # Play Field 29 (meaning/assignment defined in params) PlayField_30 varchar(50), # Play Field 30 (meaning/assignment defined in params) PlayField_31 varchar(50), # Play Field 31 (meaning/assignment defined in params) PlayField_32 varchar(50), # Play Field 32 (meaning/assignment defined in params) PlayField_33 varchar(50), # Play Field 33 (meaning/assignment defined in params) PlayField_34 varchar(50), # Play Field 34 (meaning/assignment defined in params) PlayField_35 varchar(50), # Play Field 35 (meaning/assignment defined in params) PlayField_36 varchar(50), # Play Field 36 (meaning/assignment defined in params) PlayField_37 varchar(50), # Play Field 37 (meaning/assignment defined in params) PlayField_38 varchar(50), # Play Field 38 (meaning/assignment defined in params) PlayField_39 varchar(50), # Play Field 39 (meaning/assignment defined in params) offense_analysis varchar(1000), # offense analysis (text) defense_analysis varchar(1000), # defense analysis (text) pos1_analysis varchar(1000), # position 1 analysis (text) pos2_analysis varchar(1000), # position 2 analysis (text) pos3_analysis varchar(1000), # position 3 analysis (text) robot_analysis varchar(1000), # overall robot analysis driver_analysis varchar(1000), # driver analysis with_recommendation varchar(1000), # recommendation if partnered with against_recommendation varchar(1000), # recommendation if partnered against notes varchar(1000), # general notes pit_notes varchar(1000), # notes from pit primary key(event_id,teamnum) ); # # Alliance # # Only used in scouting for finals. As alliances will play as a group, we will start # scouting and evaluating only competitively, but as an alliance as well as individual # teams create table alliance ( event_id varchar(8), # FK to event table alliancenum int, # Alliance - #1 through #8 locked varchar(12), # row locked for editing by user. Can clear in application. offense_analysis varchar(1000), # offense analysis (text) defense_analysis varchar(1000), # defense analysis (text) pos1_analysis varchar(1000), # position 1 analysis (text) pos2_analysis varchar(1000), # position 2 analysis (text) pos3_analysis varchar(1000), # position 3 analysis (text) against_recommendation varchar(2000), # recommendation if partnered against primary key (event_id, alliancenum) ); # # alliance team # # normalized recording of alliance team. Join to alliance for data # create table alliance_team ( event_id varchar(8), # FK to event table alliancenum int, # Alliance - #1 through #8 teamnum int, # FIRST team number - foreign key from team table locked varchar(12), # row locked for editing by user. Can clear in application. position int, # position in the alliance (1,2,3) primary key (event_id, alliancenum, teamnum) ); # # alliance unavailable -- unavailable for alliance choosing, including # teams that refused us # create table alliance_unavailable ( event_id varchar(8), # FK to event table alliancenum int, # Alliance - #1 through #8 teamnum int, # FIRST team number - foreign key from team table unavailable boolean, # marked if team selection is unavailable (refused or otherwise) refused boolean, # refused our offer, so take off the availability list primary key (event_id, teamnum) ); ######################### # # Match Tables # # Note how match, alliances, and teams are connected to data # # # Match Instance # # Master record for any type of match # create table match_instance ( event_id varchar(8), # FK to event table type varchar(1), # Q=qualifying, P=practice, F=Final part of primary key # from tBA match_number matchnum int, # match number, part of primary key. If taken from tBA, decoded # from tBA match_number, which looks lik 2010sc_qm20 locked varchar(12), # row locked for editing by user. Can clear in application. updatedby varchar(200), # last updated by users match_key varchar(5), # tBA part after _ in match key, e.g. qm20 final_type varchar(1), # used in finals: Q=qarter, S=Semi, F=Final tba_match_num int, # tBA match_number scheduled_utime int, # schedule time - unix time actual_utime int, # actual time - unix time game_plan varchar(2000), # our game plan for the match. Note: this is the only field # that is not match statistics but instead our analysis primary key (event_id, type, matchnum) ); # could add video # # # Match Instance Alliance # # Scores and other details of a match tied to a given alliance # # Will probably add score breakout mechanism once we determine whether it's useful to see # create table match_instance_alliance ( event_id varchar(8), # FK to event table type varchar(1), # Q=qualifying, P=practice, F=Final part of primary key matchnum int, # match number, part of primary key color varchar(1), # R=Red, B=Blue locked varchar(12), # row locked for editing by user. Can clear in application. updatedby varchar(200), # last updated by users score int, # tBA score, final score raw_points int, # raw points (prior to penalties) -- depricate in 2017 if not used and not found in code penalty_points int, # penalty points -- depricate in 2017 if not used and not found in code other_points int, # other points, might need in the future -- depricate in 2017 if not used and not found in code seed_points int, # seed points - seed points in system -- depricate in 2017 if not used and not found in code f_score0 varchar(25), # tBA custom score field f_score1 varchar(25), # tBA custom score field f_score2 varchar(25), # tBA custom score field f_score3 varchar(25), # tBA custom score field f_score4 varchar(25), # tBA custom score field f_score5 varchar(25), # tBA custom score field f_score6 varchar(25), # tBA custom score field f_score7 varchar(25), # tBA custom score field f_score8 varchar(25), # tBA custom score field f_score9 varchar(25), # tBA custom score field f_score10 varchar(25), # tBA custom score field f_score11 varchar(25), # tBA custom score field f_score12 varchar(25), # tBA custom score field f_score13 varchar(25), # tBA custom score field f_score14 varchar(25), # tBA custom score field f_score15 varchar(25), # tBA custom score field f_score16 varchar(25), # tBA custom score field f_score17 varchar(25), # tBA custom score field f_score18 varchar(25), # tBA custom score field f_score19 varchar(25), # tBA custom score field f_score20 varchar(25), # tBA custom score field f_score21 varchar(25), # tBA custom score field f_score22 varchar(25), # tBA custom score field f_score23 varchar(25), # tBA custom score field f_score24 varchar(25), # tBA custom score field f_score25 varchar(25), # tBA custom score field f_score26 varchar(25), # tBA custom score field f_score27 varchar(25), # tBA custom score field f_score28 varchar(25), # tBA custom score field f_score29 varchar(25), # tBA custom score field f_score30 varchar(25), # tBA custom score field f_score31 varchar(25), # tBA custom score field f_score32 varchar(25), # tBA custom score field f_score33 varchar(25), # tBA custom score field f_score34 varchar(25), # tBA custom score field f_score35 varchar(25), # tBA custom score field f_score36 varchar(25), # tBA custom score field f_score37 varchar(25), # tBA custom score field f_score38 varchar(25), # tBA custom score field f_score39 varchar(25), # tBA custom score field f_score40 varchar(25), # tBA custom score field f_score41 varchar(25), # tBA custom score field f_score42 varchar(25), # tBA custom score field f_score43 varchar(25), # tBA custom score field f_score44 varchar(25), # tBA custom score field primary key (event_id, type, matchnum, color) ); # # Match - team # # Team entry for match. 6 teams per match # # This table is only used in # create table match_team ( event_id varchar(8), # FK to event table type varchar(1), # foreign key to match_instance table matchnum int, # match number, foreign key to match_instance table teamnum int, # team number, foreign key to team table locked varchar(12), # row locked for editing by user. Can clear in application. updatedby varchar(200), # last updated by users color varchar(1), # R=Red, B=Blue position varchar(3), # position played on field rating_offense int, # 0-9 (9 high) rating on offense strength rating_defense int, # 0-9 (9 high) rating on defense strength raw_points int, # raw points scored human_points int, # human points scored penalties int, # penalty points MatchField_0 varchar(50), # Match Field 0 (configured by params) MatchField_1 varchar(50), # Match Field 1 (configured by params) MatchField_2 varchar(50), # Match Field 2 (configured by params) MatchField_3 varchar(50), # Match Field 3 (configured by params) MatchField_4 varchar(50), # Match Field 4 (configured by params) MatchField_5 varchar(50), # Match Field 5 (configured by params) MatchField_6 varchar(50), # Match Field 6 (configured by params) MatchField_7 varchar(50), # Match Field 7 (configured by params) MatchField_8 varchar(50), # Match Field 8 (configured by params) MatchField_9 varchar(50), # Match Field 9 (configured by params) MatchField_10 varchar(50), # Match Field 10 (configured by params) MatchField_11 varchar(50), # Match Field 11 (configured by params) MatchField_12 varchar(50), # Match Field 12 (configured by params) MatchField_13 varchar(50), # Match Field 13 (configured by params) MatchField_14 varchar(50), # Match Field 14 (configured by params) MatchField_15 varchar(50), # Match Field 15 (configured by params) MatchField_16 varchar(50), # Match Field 16 (configured by params) MatchField_17 varchar(50), # Match Field 17 (configured by params) MatchField_18 varchar(50), # Match Field 18 (configured by params) MatchField_19 varchar(50), # Match Field 19 (configured by params) MatchField_20 varchar(50), # Match Field 20 (configured by params) MatchField_21 varchar(50), # Match Field 21 (configured by params) MatchField_22 varchar(50), # Match Field 22 (configured by params) MatchField_23 varchar(50), # Match Field 23 (configured by params) MatchField_24 varchar(50), # Match Field 24 (configured by params) MatchField_25 varchar(50), # Match Field 25 (configured by params) MatchField_26 varchar(50), # Match Field 26 (configured by params) MatchField_27 varchar(50), # Match Field 27 (configured by params) MatchField_28 varchar(50), # Match Field 28 (configured by params) MatchField_29 varchar(50), # Match Field 29 (configured by params) MatchField_30 varchar(50), # Match Field 30 (configured by params) MatchField_31 varchar(50), # Match Field 31 (configured by params) MatchField_32 varchar(50), # Match Field 32 (configured by params) MatchField_33 varchar(50), # Match Field 33 (configured by params) MatchField_34 varchar(50), # Match Field 34 (configured by params) MatchField_35 varchar(50), # Match Field 35 (configured by params) MatchField_36 varchar(50), # Match Field 36 (configured by params) MatchField_37 varchar(50), # Match Field 37 (configured by params) MatchField_38 varchar(50), # Match Field 38 (configured by params) MatchField_39 varchar(50), # Match Field 39 (configured by params) match_notes varchar(1000), # Match notes match_offense_analysis varchar(1000), # offense analysis (text) match_defense_analysis varchar(1000), # defense analysis (text) match_pos_analysis varchar(1000), # position analysis (text) match_with_recommendation varchar(1000), # recommendation if partnered with match_against_recommendation varchar(1000), # recommendation if partnered against primary key (event_id, type, matchnum, teamnum) ); # # Match - Alliance # # Alliance entry for match (one per alliance) # # JLV- Depricate # #create table match_alliance_team # ( # event_id varchar(8), # FK to event table # type varchar(1), # foreign key to match_instance table # matchnum int, # match number, foreign key to match_instance table # alliancenum int, # Alliance - #1 through #8, foreign key to alliance table # locked varchar(12), # row locked for editing by user. Can clear in application. # updatedby varchar(200), # last updated by users # color varchar(1), # R=Red, B=Blue # position varchar(3), # position played on field # rating_offense int, # 0-9 (9 high) rating on offense strength # rating_defense int, # 0-9 (9 high) rating on defense strength # raw_points int, # raw points scored # human_points int, # human points scored # penalties int, # penalty points # primary key (event_id, type, matchnum, alliancenum) # ); # # championship listing table # # depricate entire table? # #create table championteam #( # event_id varchar(8), # FK to event table # league_name varchar(25), # long-form of league name # teamnum int, # FIRST team number - primary key # primary key (event_id, teamnum) #); # # schedule import received from FRIST to be imported # temporary table used to load data and begin processing # create table schedule ( scheduled_utime int, # schedule time of match type varchar(1), # match type (see match table) matchnum int, # match number blue1 int, # blue teamnum blue2 int, # blue teamnum blue3 int, # blue teamnum red1 int, # red teamnum red2 int, # red teamnum red3 int, # red teamnum primary key (type, matchnum) ); # # Process Lock # # Lock table to lock various processes # These locks differ from data locks in that they lock processes, such # as finals selection from other users. # create table process_lock ( lock_id varchar(20), # id of lock in table locked varchar(12), # row locked for editing by user. Can clear in application. primary key (lock_id) ); # # set up control data in table as part of initialization # # # insert needed locks insert into process_lock (lock_id) values ('ranking'); # ranking process insert into process_lock (lock_id) values ('finals_selection'); # ranking process insert into process_lock (lock_id) values ('doc_topics'); # topics for docprocess # # Messages # # Message table to communicate with field # create table message ( facility varchar(20), # unique facility message varchar(200), # message locked varchar(12), # row locked for editing by user. Can clear in application. primary key (facility) ); # # set up control data in table as part of initialization # # # insert facilities needed insert into message (facility) values ('finals_selection'); # finals selection # # user profile and preferences # create table user_profile ( user varchar(30), # userd (matches that used for system authentication) matchview varchar(5), # user preference: match type view preference on matchlist view needeval bool, # user preference: show teams that still need evaluation showevaluators bool, # user preference: show other evaluators in matcheval and matchteameval screens primary key (user) ); # # stores all documentation # create table documentation ( documentation varchar(20), # title of this page, what the world will see topic varchar(20), # what topic this page falls under, listed under the 'topic' table priority int, # determines the order of the different doc pages under a topic locked varchar(12), # current editor of this row data varchar(5000), # stores the actual information for this page primary key (documentation) ); # # different topics the documentation fits under # also, add process lock for this table in the process_lock table # create table topic ( topic varchar(12), # title of this category of documentation, the world will see this priority int, # priority of this topic in relation to other topics description varchar(200), # description of the topic, not needed primary key (topic) ); # # stores a relationship between a documentation and a page # create table pagetodoc ( documentation varchar(20), # title of the documentation page varchar(20), # page the documentation can be accessed by primary key (documentation, page) ); # # generic system key/value table # # Note: use this table to store system values in the database # create table system_value ( skey varchar(20), # key index into values value varchar(40), # value for the key primary key (skey) ); # # Blue Alliance API last modified # # Stores last modified settings for blue alliance data so that subsequent calls can # place the last modified in calling params # create table tba_last_modified ( api_call varchar(150), # API call URL for reference last_mod varchar(31), # tBA last modified returned from tBA primary key (api_call) ); # # insert keys needed to start in the system # insert into system_value (skey) values ('sys_event_id'); # current event_id used to load Blue Alliance data insert into system_value (skey) values ('a'); # ## ## add any other data needed as part of setup ##
true
29f8c6b5f48a78c946010c425b3dd6cd6e601b9e
SQL
whdydgkr7/proj
/Volume/src/main/webapp/resources/volume.sql
UTF-8
4,914
3.09375
3
[ "MIT" ]
permissive
/* Drop Tables */ DROP TABLE eChat CASCADE CONSTRAINTS; DROP TABLE eComment CASCADE CONSTRAINTS; DROP TABLE eEntry CASCADE CONSTRAINTS; DROP TABLE eBBS CASCADE CONSTRAINTS; DROP TABLE pComment CASCADE CONSTRAINTS; DROP TABLE pEntry CASCADE CONSTRAINTS; DROP TABLE pReview CASCADE CONSTRAINTS; DROP TABLE pBBS CASCADE CONSTRAINTS; DROP TABLE pPropose CASCADE CONSTRAINTS; DROP TABLE users CASCADE CONSTRAINTS; /* Create Tables */ CREATE TABLE eBBS ( idx number NOT NULL, id varchar2(100) NOT NULL, title varchar2(1000) NOT NULL, content varchar2(3000) NOT NULL, postdate date DEFAULT sysdate, start_date date DEFAULT sysdate NOT NULL, end_date date DEFAULT sysdate NOT NULL, address varchar2(2000) NOT NULL, visit_count number DEFAULT 0, t_method varchar2(200) NOT NULL, t_time varchar2(200) NOT NULL, t_point number DEFAULT 0, attachedfile varchar2(2000), thumbnail varchar2(100), e_limit number NOT NULL, state varchar2(100), report_count number DEFAULT 0, PRIMARY KEY (idx) ); CREATE TABLE eChat ( char_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL, content varchar2(3000), postdate date DEFAULT sysdate, PRIMARY KEY (char_idx) ); CREATE TABLE eComment ( comment_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL, content varchar2(1000) NOT NULL, ranking number DEFAULT 10 NOT NULL, postdate date DEFAULT sysdate, PRIMARY KEY (comment_idx) ); CREATE TABLE eEntry ( entry_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL, regidate date DEFAULT sysdate, state varchar2(100), PRIMARY KEY (entry_idx) ); CREATE TABLE pBBS ( idx number NOT NULL, id varchar2(100) NOT NULL, title varchar2(1000) NOT NULL, content varchar2(3000) NOT NULL, postdate date DEFAULT sysdate, start_date date DEFAULT sysdate NOT NULL, end_date date DEFAULT sysdate NOT NULL, address varchar2(2000) NOT NULL, visit_count number DEFAULT 0, attachedfile varchar2(2000), thumbnail varchar2(100) NOT NULL, m_limit number DEFAULT 10 NOT NULL, add_point number DEFAULT 1, PRIMARY KEY (idx) ); CREATE TABLE pComment ( comment_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL, content varchar2(1000) NOT NULL, postdate date DEFAULT sysdate, PRIMARY KEY (comment_idx) ); CREATE TABLE pEntry ( entry_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL UNIQUE, regidate date DEFAULT sysdate, result number DEFAULT 1, PRIMARY KEY (entry_idx) ); CREATE TABLE pPropose ( propose_idx number NOT NULL, id varchar2(100) NOT NULL, content varchar2(3000) NOT NULL, postdate date DEFAULT sysdate NOT NULL, visit_count number DEFAULT 0, recommend number DEFAULT 0, title varchar2(100) NOT NULL, start_date date DEFAULT sysdate, end_date date DEFAULT sysdate, p_limit number DEFAULT 1 NOT NULL, thumbnail varchar2(2000), attachedfile varchar2(2000), address varchar2(1000) NOT NULL, state varchar2(100), add_point number DEFAULT 1, PRIMARY KEY (propose_idx) ); CREATE TABLE pReview ( review_idx number NOT NULL, idx number NOT NULL, id varchar2(100) NOT NULL, title varchar2(1000) NOT NULL, content varchar2(3000) NOT NULL, postdate date DEFAULT sysdate, attachedfile varchar2(2000), PRIMARY KEY (review_idx) ); CREATE TABLE users ( id varchar2(100) NOT NULL, pass varchar2(100) NOT NULL, name varchar2(100) NOT NULL, regidate date DEFAULT sysdate, email varchar2(100) NOT NULL, point number DEFAULT 0, enabled number DEFAULT 1, AUTHORITY varchar2(20) DEFAULT 'USER', userType varchar2(10) DEFAULT 'user', PRIMARY KEY (id) ); /* Create Foreign Keys */ ALTER TABLE eChat ADD FOREIGN KEY (idx) REFERENCES eBBS (idx) ; ALTER TABLE eComment ADD FOREIGN KEY (idx) REFERENCES eBBS (idx) ; ALTER TABLE eEntry ADD FOREIGN KEY (idx) REFERENCES eBBS (idx) ; ALTER TABLE pComment ADD FOREIGN KEY (idx) REFERENCES pBBS (idx) ; ALTER TABLE pEntry ADD FOREIGN KEY (idx) REFERENCES pBBS (idx) ; ALTER TABLE pReview ADD FOREIGN KEY (idx) REFERENCES pBBS (idx) ; ALTER TABLE eBBS ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE eChat ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE eComment ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE eEntry ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE pBBS ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE pComment ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE pEntry ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE pPropose ADD FOREIGN KEY (id) REFERENCES users (id) ; ALTER TABLE pReview ADD FOREIGN KEY (id) REFERENCES users (id) ;
true
4336ea094efa1a26f3c832f4eaf6b82521cec33d
SQL
VTracyHuang/SpringBoot-multiDatasource
/SpringBoot-mybatis/src/main/resources/sql/t_user.sql
UTF-8
642
2.609375
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : 127.0.0.1 Source Server Version : 50717 Source Host : 127.0.0.1:3306 Source Database : test Target Server Type : MYSQL Target Server Version : 50717 File Encoding : 65001 Date: 2018-04-12 13:33:39 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for t_user -- ---------------------------- DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `id` bigint(20) NOT NULL, `age` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
true
356fced7b487ee8055c1fef7f5af3813ea2b1496
SQL
mshoop/Yelp-Database-Search
/ParseYelpData/UPDATE.sql
UTF-8
599
4.0625
4
[]
no_license
--CHECKIN --UPDATE UPDATE business SET numcheckins = table2.checkinsum FROM business B INNER JOIN (SELECT checkin.business_id, sum(count) AS checkinsum FROM checkin GROUP BY checkin.business_id) AS table2 ON B.business_id = table2.business_ID WHERE table2.business_ID = business.business_ID --REVIEWCOUNT (TIP COUNT) --UPDATE UPDATE business SET review_count = table2.tipsum FROM business B INNER JOIN (SELECT tip.business_id, COUNT(business_id) AS tipsum FROM tip GROUP BY tip.business_id) AS table2 ON B.business_id = table2.business_ID WHERE table2.business_ID = business.business_ID
true
4dc90845e456c6c90be31993372ab5e8fc4c657c
SQL
MLGB3/mlgb.cron
/index/update_index_entry_copies.sql
UTF-8
5,306
3.203125
3
[ "Apache-2.0" ]
permissive
-- Add decodes of flags embedded in the copy codes update index_entry_copies set survives_yn = 'y' where copy_code like '%*%' \p\g update index_entry_copies set printed_yn = 'y' where copy_code like '%{P}%' \p\g update index_entry_copies set uncertain_yn = 'y' where copy_code like '%{+}%' \p\g update index_entry_copies set duplicate_title_yn = 'y' where copy_code like '%++%' \p\g -- Add document names etc. update index_entry_copies set document_name = (select v.document_name from index_medieval_documents_view v where v.document_code = index_entry_copies.document_code and v.document_code is not null and v.document_code != 'X-' /*non-unique code*/) where document_code is not null and document_code != 'X-' /*non-unique code*/ \p\g update index_entry_copies set doc_group_type = (select v.doc_group_type from index_medieval_documents_view v where v.document_code = index_entry_copies.document_code and v.document_code is not null and v.document_code != 'X-' /*non-unique code*/) where document_code is not null and document_code != 'X-' /*non-unique code*/ \p\g update index_entry_copies set doc_group_type_name = (select v.doc_group_type_name from index_medieval_documents_view v where v.document_code = index_entry_copies.document_code and v.document_code is not null and v.document_code != 'X-' /*non-unique code*/) where document_code is not null and document_code != 'X-' /*non-unique code*/ \p\g update index_entry_copies set doc_group_name = (select v.doc_group_name from index_medieval_documents_view v where v.document_code = index_entry_copies.document_code and v.document_code is not null and v.document_code != 'X-' /*non-unique code*/) where document_code is not null and document_code != 'X-' /*non-unique code*/ \p\g -- Some groups of documents, particularly K and UO, plus R, do not seem to have been set up yet. -- Fill in what information we can update index_entry_copies set doc_group_type = 'K', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'K') where document_code like 'K%' and doc_group_type is null and doc_group_type_name is null \p\g update index_entry_copies set doc_group_type = 'UO', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'UO') where document_code like 'UO%' and doc_group_type is null and doc_group_type_name is null \p\g update index_entry_copies set doc_group_type = 'R', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'R') where document_code like 'R%' and doc_group_type is null and doc_group_type_name is null \p\g -- There also seem to be a few documents where only the document type has been given -- instead of a full code, e.g. BA instead of BA22. Once again, we can fill in a tiny bit here. update index_entry_copies set doc_group_type = (select t.doc_group_type_code from index_medieval_doc_group_types t where t.doc_group_type_code = index_entry_copies.document_code), doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = index_entry_copies.document_code) where doc_group_type is null and doc_group_type_name is null \p\g -- And document codes like P9 that are in a valid format but just don't appear in Key.doc. -- Presumably Key.doc is now a bit out of date. update index_entry_copies set doc_group_type = 'BA', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'BA') where document_code like 'BA%' and doc_group_type is null and doc_group_type_name is null \p\g update index_entry_copies set doc_group_type = 'BC', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'BC') where document_code like 'BC%' and doc_group_type is null and doc_group_type_name is null \p\g update index_entry_copies set doc_group_type = 'P', doc_group_type_name = (select t.doc_group_type_name from index_medieval_doc_group_types t where t.doc_group_type_code = 'P') where document_code like 'P%' and doc_group_type is null and doc_group_type_name is null \p\g
true
56657b925eb54070cd000c4933893c93c2d1b9cd
SQL
MukulKolpe/almanac.httparchive.org
/sql/2021/page-weight/pageweight_by_header_body.sql
UTF-8
269
2.515625
3
[ "Apache-2.0" ]
permissive
SELECT _TABLE_SUFFIX AS client, AVG(reqHeadersSize) / 1024 AS request_header_size, AVG(respHeadersSize) / 1024 AS response_header_size, AVG(respBodySize) / 1024 AS response_body_size FROM `httparchive.summary_requests.2021_07_01_*` GROUP BY client
true
3d5602c9de6308d39f4456a0609f72855560c0df
SQL
rastaayoub/hitskart
/u276455193_hits.sql
UTF-8
100,962
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.2.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 26, 2015 at 05:20 AM -- Server version: 10.0.20-MariaDB -- PHP Version: 5.2.17 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: `u276455193_hits` -- -- -------------------------------------------------------- -- -- Table structure for table `activity_rewards` -- CREATE TABLE IF NOT EXISTS `activity_rewards` ( `id` int(255) NOT NULL AUTO_INCREMENT, `exchanges` int(255) NOT NULL DEFAULT '0', `reward` int(255) NOT NULL DEFAULT '0', `type` int(32) NOT NULL DEFAULT '0', `claims` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ; -- -------------------------------------------------------- -- -- Table structure for table `activity_rewards_claims` -- CREATE TABLE IF NOT EXISTS `activity_rewards_claims` ( `reward_id` int(255) NOT NULL DEFAULT '0', `user_id` int(255) NOT NULL DEFAULT '0', `date` int(255) NOT NULL DEFAULT '0', KEY `reward_id` (`reward_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `ad_packs` -- CREATE TABLE IF NOT EXISTS `ad_packs` ( `id` int(255) NOT NULL AUTO_INCREMENT, `price` decimal(10,2) NOT NULL DEFAULT '0.00', `days` int(255) NOT NULL DEFAULT '0', `bought` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Dumping data for table `ad_packs` -- INSERT INTO `ad_packs` (`id`, `price`, `days`, `bought`, `type`) VALUES (1, '1.00', 7, 3, 0), (2, '2.00', 15, 0, 0), (3, '3.50', 30, 0, 0), (4, '1.00', 7, 1, 1), (5, '2.00', 15, 0, 1), (6, '3.50', 30, 0, 1); -- -------------------------------------------------------- -- -- Table structure for table `askfm_like` -- CREATE TABLE IF NOT EXISTS `askfm_like` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; -- -- Dumping data for table `askfm_like` -- INSERT INTO `askfm_like` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (4, 1, 'http://ask.fm/MegaTraffic/answer/131099037281', 'fdaf', '', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `askfm_liked` -- CREATE TABLE IF NOT EXISTS `askfm_liked` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `askfm_liked` -- INSERT INTO `askfm_liked` (`user_id`, `site_id`) VALUES (1, 3); -- -------------------------------------------------------- -- -- Table structure for table `askinger_follow` -- CREATE TABLE IF NOT EXISTS `askinger_follow` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `askinger_follow` -- INSERT INTO `askinger_follow` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (3, 2, 'http://askinger.net/id100008280788828', 'Chiriță Andreea', '', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `askinger_followed` -- CREATE TABLE IF NOT EXISTS `askinger_followed` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `askinger_like` -- CREATE TABLE IF NOT EXISTS `askinger_like` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `askinger_like` -- INSERT INTO `askinger_like` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'http://askinger.net/id100008280788828/answer/47343249725297138', 'fds', '', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `askinger_liked` -- CREATE TABLE IF NOT EXISTS `askinger_liked` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `banners` -- CREATE TABLE IF NOT EXISTS `banners` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL DEFAULT '0', `banner_url` varchar(255) NOT NULL, `site_url` varchar(255) NOT NULL, `views` int(255) NOT NULL DEFAULT '0', `clicks` int(255) NOT NULL DEFAULT '0', `status` int(11) NOT NULL DEFAULT '0', `expiration` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Table structure for table `ban_reasons` -- CREATE TABLE IF NOT EXISTS `ban_reasons` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL DEFAULT '0', `reason` text NOT NULL, `date` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `blacklist` -- CREATE TABLE IF NOT EXISTS `blacklist` ( `id` int(255) NOT NULL AUTO_INCREMENT, `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `type` int(32) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `value` (`value`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `blog` -- CREATE TABLE IF NOT EXISTS `blog` ( `id` int(255) NOT NULL AUTO_INCREMENT, `author` int(255) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL, `content` text NOT NULL, `views` int(255) NOT NULL DEFAULT '0', `timestamp` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `blog_comments` -- CREATE TABLE IF NOT EXISTS `blog_comments` ( `id` int(255) NOT NULL AUTO_INCREMENT, `bid` int(255) NOT NULL DEFAULT '0', `author` int(255) NOT NULL DEFAULT '0', `comment` text NOT NULL, `timestamp` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `bid` (`bid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `coins_to_cash` -- CREATE TABLE IF NOT EXISTS `coins_to_cash` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `coins` int(255) NOT NULL DEFAULT '0', `cash` decimal(10,2) NOT NULL DEFAULT '0.00', `conv_rate` int(64) NOT NULL DEFAULT '0', `date` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `coupons` -- CREATE TABLE IF NOT EXISTS `coupons` ( `id` int(255) NOT NULL AUTO_INCREMENT, `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `coins` int(255) NOT NULL DEFAULT '0', `uses` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `used` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', `exchanges` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `c_pack` -- CREATE TABLE IF NOT EXISTS `c_pack` ( `id` int(255) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `coins` int(255) NOT NULL DEFAULT '0', `price` decimal(10,2) NOT NULL DEFAULT '0.00', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `c_pack` -- INSERT INTO `c_pack` (`id`, `name`, `coins`, `price`) VALUES (1, '999 Coins', 999, '1.00'), (2, '1000 Coins', 1000, '0.50'), (3, '5,000 Coins', 5000, '2.50'), (4, '8,000 Coins', 8000, '3.50'), (5, '20,000 Coins', 20000, '9.00'), (6, '37,000 Coins', 37000, '17.00'), (7, '55,000 Points ', 55000, '25.00'); -- -------------------------------------------------------- -- -- Table structure for table `c_transfers` -- CREATE TABLE IF NOT EXISTS `c_transfers` ( `id` int(255) NOT NULL AUTO_INCREMENT, `receiver` int(255) NOT NULL DEFAULT '0', `sender` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `coins` int(255) NOT NULL DEFAULT '0', `date` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `facebook` -- CREATE TABLE IF NOT EXISTS `facebook` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `type` int(11) NOT NULL DEFAULT '0', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ; -- -- Dumping data for table `facebook` -- INSERT INTO `facebook` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `type`, `country`, `sex`) VALUES (1, 1, 'https://www.facebook.com/ithacktips', 'ithacktps', 1, 0, 0, 0, 0, 10, 1, '0', 0), (2, 2, 'http://clashofclansunlimitedgems.com', 'ggfd', 1, 0, 0, 0, 0, 10, 0, '0', 0), (3, 2, 'http://xdhax.com', 'sfds', 1, 0, 0, 0, 0, 10, 0, '0', 0), (5, 2, 'https://www.facebook.com/TheHungerGames', 'fad', 0, 0, 0, 0, 0, 10, 1, '0', 0), (7, 1, 'http://www.facebook.com/GeekBoy.co', 'geekboy', 0, 0, 0, 0, 0, 10, 1, '0', 0), (8, 1, 'http://facebook.com/laughingcolours', 'fa', 0, 0, 0, 0, 0, 10, 1, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `faq` -- CREATE TABLE IF NOT EXISTS `faq` ( `id` int(255) NOT NULL AUTO_INCREMENT, `question` varchar(255) NOT NULL, `answer` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Table structure for table `fbe_joined` -- CREATE TABLE IF NOT EXISTS `fbe_joined` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `fbp_liked` -- CREATE TABLE IF NOT EXISTS `fbp_liked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `fbp_liked` -- INSERT INTO `fbp_liked` (`user_id`, `site_id`) VALUES (1, 1); -- -------------------------------------------------------- -- -- Table structure for table `fbs_liked` -- CREATE TABLE IF NOT EXISTS `fbs_liked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `fb_event` -- CREATE TABLE IF NOT EXISTS `fb_event` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ; -- -------------------------------------------------------- -- -- Table structure for table `fb_photo` -- CREATE TABLE IF NOT EXISTS `fb_photo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; -- -- Dumping data for table `fb_photo` -- INSERT INTO `fb_photo` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (2, 2, '10153637743199578', 'fas', 'https://scontent.xx.fbcdn.net/hphotos-xfp1/v/t1.0-9/s75x225/11665392_10153637743199578_2226242927137787124_n.jpg?oh=35bc14e68e773f96aaa8d2cbd25199c7&oe=562B48E6', 1, 0, 0, 0, 0, 10, '0', 0), (3, 2, '847416391982162', 'faf', '', 0, 0, 0, 0, 0, 10, '0', 0), (4, 2, '888318417891959', 'fase', '', 0, 0, 0, 0, 0, 10, '0', 0), (5, 2, '819907468066388', 'afda', '', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `fb_postcomment` -- CREATE TABLE IF NOT EXISTS `fb_postcomment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Table structure for table `fb_postcommented` -- CREATE TABLE IF NOT EXISTS `fb_postcommented` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `fb_postcommented` -- INSERT INTO `fb_postcommented` (`user_id`, `site_id`) VALUES (1, 1); -- -------------------------------------------------------- -- -- Table structure for table `fb_postlike` -- CREATE TABLE IF NOT EXISTS `fb_postlike` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `fb_postlike` -- INSERT INTO `fb_postlike` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '173770089577_10154005819944578', 'fsa', 'https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p50x50/12108090_10153957334889578_627280657113653230_n.jpg?oh=256897a8ab8714991dd999d2063ddcd2&amp;oe=56C32B3F', 1, 0, 0, 0, 0, 10, '0', 0), (2, 1, '173770089577_10153997785394578', 'dsf', 'https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p50x50/12108090_10153957334889578_627280657113653230_n.jpg?oh=256897a8ab8714991dd999d2063ddcd2&amp;oe=56C32B3F', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `fb_postliked` -- CREATE TABLE IF NOT EXISTS `fb_postliked` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `fb_postshare` -- CREATE TABLE IF NOT EXISTS `fb_postshare` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=20 ; -- -- Dumping data for table `fb_postshare` -- INSERT INTO `fb_postshare` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (18, 2, '173770089577_10154005819944578', 'fad', 'https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p50x50/12108090_10153957334889578_627280657113653230_n.jpg?oh=256897a8ab8714991dd999d2063ddcd2&amp;oe=56C32B3F', 0, 0, 0, 0, 0, 10, '0', 0), (19, 2, '173770089577_10153997785394578', 'fsdf', 'https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p50x50/12108090_10153957334889578_627280657113653230_n.jpg?oh=256897a8ab8714991dd999d2063ddcd2&amp;oe=56C32B3F', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `fb_postshared` -- CREATE TABLE IF NOT EXISTS `fb_postshared` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `fb_share` -- CREATE TABLE IF NOT EXISTS `fb_share` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ; -- -- Dumping data for table `fb_share` -- INSERT INTO `fb_share` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (10, 2, 'http://clashofclansunlimitedgems.com', 'fafsf', 1, 0, 0, 0, 0, 10, '0', 0), (7, 2, 'https://www.youtube.com/watch?v=mUEWjnrg49g', 'fvda', 1, 0, 0, 0, 0, 10, '0', 0), (8, 2, 'http://www.hitskart.com', 'dsa', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `fb_shared` -- CREATE TABLE IF NOT EXISTS `fb_shared` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `fb_subscribe` -- CREATE TABLE IF NOT EXISTS `fb_subscribe` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ; -- -- Dumping data for table `fb_subscribe` -- INSERT INTO `fb_subscribe` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (8, 2, '100001414288457', 'Muhammad Haris Tyagi', 3, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `followed` -- CREATE TABLE IF NOT EXISTS `followed` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `google` -- CREATE TABLE IF NOT EXISTS `google` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL DEFAULT '0', `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '1', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `google` -- INSERT INTO `google` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (2, 2, 'https://plus.google.com/+angrybirds/', 'sas', 1, 0, 0, 0, 0, 10, '0', 0), (3, 2, 'https://plus.google.com/+angrybirds/posts/twucwsswaq3?pid=6164502775708710434&amp;oid=118177253929143457733', 'ang', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `google_circle` -- CREATE TABLE IF NOT EXISTS `google_circle` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ; -- -- Dumping data for table `google_circle` -- INSERT INTO `google_circle` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (7, 2, '114607748002331811651', 'fsdf', 'https://lh3.googleusercontent.com/-yaZUBO2QPv8/AAAAAAAAAAI/AAAAAAAAAH4/nB5qKJHsxNI/photo.jpg?sz=50', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `google_circled` -- CREATE TABLE IF NOT EXISTS `google_circled` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `google_share` -- CREATE TABLE IF NOT EXISTS `google_share` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `google_share` -- INSERT INTO `google_share` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'z12uindpmkvxzjsp504cdd5i3ku4ibgp0cw', 'dsf', 'https://lh3.googleusercontent.com/-yaZUBO2QPv8/AAAAAAAAAAI/AAAAAAAAAH4/nB5qKJHsxNI/photo.jpg?sz=50', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `google_shared` -- CREATE TABLE IF NOT EXISTS `google_shared` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `instagram` -- CREATE TABLE IF NOT EXISTS `instagram` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `inst_id` int(255) NOT NULL DEFAULT '0', `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_av` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `instagram` -- INSERT INTO `instagram` (`id`, `user`, `inst_id`, `url`, `title`, `p_av`, `clicks`, `active`, `cpc`, `country`, `sex`) VALUES (2, 2, 1979202045, 'katrinaatcannes', 'Katrina At Cannes', 'https://igcdn-photos-e-a.akamaihd.net/hphotos-ak-xtf1/t51.2885-19/10554186_1632489046982652_1431098989_a.jpg', 1, 0, 10, '0', 0), (3, 2, 277068506, '_lovekatrinakaif', 'K a t r i n a K a i f', 'https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-19/11325386_978978105445903_728211928_a.jpg', 1, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `instagram_done` -- CREATE TABLE IF NOT EXISTS `instagram_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `inst_liked` -- CREATE TABLE IF NOT EXISTS `inst_liked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `inst_likes` -- CREATE TABLE IF NOT EXISTS `inst_likes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `inst_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `photo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=19 ; -- -- Dumping data for table `inst_likes` -- INSERT INTO `inst_likes` (`id`, `user`, `inst_id`, `url`, `title`, `photo`, `clicks`, `active`, `cpc`, `country`, `sex`) VALUES (18, 2, '1013311404443619307_277068506', 'https://instagram.com/p/4QAVqEts_r/', 'fa', 'https://igcdn-photos-d-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-15/11381475_1633833080168491_1211703304_n.jpg', 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `liked` -- CREATE TABLE IF NOT EXISTS `liked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `liked` -- INSERT INTO `liked` (`user_id`, `site_id`) VALUES (1, 5); -- -------------------------------------------------------- -- -- Table structure for table `linkedin` -- CREATE TABLE IF NOT EXISTS `linkedin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -- Dumping data for table `linkedin` -- INSERT INTO `linkedin` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'https://www.linkedin.com/pulse/you-really-good-team-player-alex-malley?trk=prof-post', 'fdaf', 1, 0, 0, 0, 0, 10, '0', 0), (2, 2, 'http://clashofclansunlimitedgems.com', 'fdaf', 0, 0, 0, 0, 0, 10, '0', 0), (3, 1, 'https://www.linkedin.com/pulse/rahul-yadav-quits-housingcom-real-time-top-india-news-ramya-venugopal?trk=hp-feed-article-title-hpm', 'rahul', 1, 0, 0, 0, 0, 10, '0', 0), (4, 1, 'https://www.linkedin.com/pulse/narendra-modi-indian-economys-sachin-tendulkar-has-lot-anuj-puri?trk=hp-feed-article-title-hpm', 'modi', 1, 0, 0, 0, 0, 10, '0', 0), (5, 1, 'https://www.linkedin.com/pulse/supreme-court-aca-decision-victory-health-america-risa-lavizzo-mourey?trk=hp-feed-article-title-hpm', 'sqa', 1, 0, 0, 0, 0, 10, '0', 0), (6, 1, 'https://www.linkedin.com/pulse/connect-me-through-your-mobiles-lets-keep-going-narendra-modi?trk=mp-reader-card', 'fa', 0, 0, 0, 0, 0, 10, '0', 0), (7, 1, 'https://buysellads.com/buy/detail/155702/zone/1283410?utm_source=site_155702', 'sf', 0, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `linked_done` -- CREATE TABLE IF NOT EXISTS `linked_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `list_countries` -- CREATE TABLE IF NOT EXISTS `list_countries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `country` varchar(255) NOT NULL DEFAULT '', `code` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=221 ; -- -- Dumping data for table `list_countries` -- INSERT INTO `list_countries` (`id`, `country`, `code`) VALUES (1, 'United States', 'US'), (2, 'United Kingdom', 'UK'), (3, 'Norway', 'NO'), (4, 'Greece', 'GR'), (5, 'Afghanistan', 'AF'), (6, 'Albania', 'AL'), (7, 'Algeria', 'DZ'), (8, 'American Samoa', 'AS'), (9, 'Andorra', 'AD'), (10, 'Angola', 'AO'), (11, 'Anguilla', 'AI'), (12, 'Antigua & Barbuda', 'AG'), (13, 'Antilles, Netherlands', 'AN'), (182, 'Senegal', 'SN'), (15, 'Argentina', 'AR'), (16, 'Armenia', 'AM'), (17, 'Aruba', 'AW'), (18, 'Australia', 'AU'), (19, 'Austria', 'AT'), (20, 'Azerbaijan', 'AZ'), (21, 'Bahamas, The', 'BS'), (22, 'Bahrain', 'BH'), (23, 'Bangladesh', 'BD'), (24, 'Barbados', 'BB'), (25, 'Belarus', 'BY'), (26, 'Belgium', 'BE'), (27, 'Belize', 'BZ'), (28, 'Benin', 'BJ'), (29, 'Bermuda', 'BM'), (30, 'Bhutan', 'BT'), (31, 'Bolivia', 'BO'), (32, 'Bosnia and Herzegovina', 'BA'), (33, 'Botswana', 'BW'), (34, 'Brazil', 'BR'), (35, 'British Virgin Islands', 'VG'), (36, 'Brunei Darussalam', 'BN'), (37, 'Bulgaria', 'BG'), (38, 'Burkina Faso', 'BF'), (39, 'Burundi', 'BI'), (40, 'Cambodia', 'KH'), (41, 'Cameroon', 'CM'), (42, 'Canada', 'CA'), (43, 'Cape Verde', 'CV'), (44, 'Cayman Islands', 'KY'), (45, 'Central African Republic', 'CF'), (46, 'Chad', 'TD'), (47, 'Chile', 'CL'), (48, 'China', 'CN'), (49, 'Colombia', 'CO'), (50, 'Comoros', 'KM'), (51, 'Congo', 'CG'), (52, 'Congo', 'CD'), (53, 'Cook Islands', 'CK'), (54, 'Costa Rica', 'CR'), (55, 'Cote D''Ivoire', 'CI'), (56, 'Croatia', 'HR'), (57, 'Cuba', 'CU'), (58, 'Cyprus', 'CY'), (59, 'Czech Republic', 'CZ'), (60, 'Denmark', 'DK'), (61, 'Djibouti', 'DJ'), (62, 'Dominica', 'DM'), (63, 'Dominican Republic', 'DO'), (64, 'East Timor (Timor-Leste)', 'TP'), (65, 'Ecuador', 'EC'), (66, 'Egypt', 'EG'), (67, 'El Salvador', 'SV'), (68, 'Equatorial Guinea', 'GQ'), (69, 'Eritrea', 'ER'), (70, 'Estonia', 'EE'), (71, 'Ethiopia', 'ET'), (72, 'Falkland Islands', 'FK'), (73, 'Faroe Islands', 'FO'), (74, 'Fiji', 'FJ'), (75, 'Finland', 'FI'), (76, 'France', 'FR'), (77, 'French Guiana', 'GF'), (78, 'French Polynesia', 'PF'), (79, 'Gabon', 'GA'), (80, 'Gambia, the', 'GM'), (81, 'Georgia', 'GE'), (82, 'Germany', 'DE'), (83, 'Ghana', 'GH'), (84, 'Gibraltar', 'GI'), (86, 'Greenland', 'GL'), (87, 'Grenada', 'GD'), (88, 'Guadeloupe', 'GP'), (89, 'Guam', 'GU'), (90, 'Guatemala', 'GT'), (91, 'Guernsey and Alderney', 'GG'), (92, 'Guinea', 'GN'), (93, 'Guinea-Bissau', 'GW'), (94, 'Guinea, Equatorial', 'GP'), (95, 'Guiana, French', 'GF'), (96, 'Guyana', 'GY'), (97, 'Haiti', 'HT'), (179, 'San Marino', 'SM'), (99, 'Honduras', 'HN'), (100, 'Hong Kong, (China)', 'HK'), (101, 'Hungary', 'HU'), (102, 'Iceland', 'IS'), (103, 'India', 'IN'), (104, 'Indonesia', 'ID'), (105, 'Iran, Islamic Republic of', 'IR'), (106, 'Iraq', 'IQ'), (107, 'Ireland', 'IE'), (108, 'Israel', 'IL'), (109, 'Ivory Coast (Cote d''Ivoire)', 'CI'), (110, 'Italy', 'IT'), (111, 'Jamaica', 'JM'), (112, 'Japan', 'JP'), (113, 'Jersey', 'JE'), (114, 'Jordan', 'JO'), (115, 'Kazakhstan', 'KZ'), (116, 'Kenya', 'KE'), (117, 'Kiribati', 'KI'), (118, 'Korea, (South) Rep. of', 'KR'), (119, 'Kuwait', 'KW'), (120, 'Kyrgyzstan', 'KG'), (121, 'Lao People''s Dem. Rep.', 'LA'), (122, 'Latvia', 'LV'), (123, 'Lebanon', 'LB'), (124, 'Lesotho', 'LS'), (125, 'Libyan Arab Jamahiriya', 'LY'), (126, 'Liechtenstein', 'LI'), (127, 'Lithuania', 'LT'), (128, 'Luxembourg', 'LU'), (129, 'Macao, (China)', 'MO'), (130, 'Macedonia, TFYR', 'MK'), (131, 'Madagascar', 'MG'), (132, 'Malawi', 'MW'), (133, 'Malaysia', 'MY'), (134, 'Maldives', 'MV'), (135, 'Mali', 'ML'), (136, 'Malta', 'MT'), (137, 'Martinique', 'MQ'), (138, 'Mauritania', 'MR'), (139, 'Mauritius', 'MU'), (140, 'Mexico', 'MX'), (141, 'Micronesia', 'FM'), (142, 'Moldova, Republic of', 'MD'), (143, 'Monaco', 'MC'), (144, 'Mongolia', 'MN'), (145, 'Montenegro', 'CS'), (146, 'Morocco', 'MA'), (147, 'Mozambique', 'MZ'), (148, 'Myanmar (ex-Burma)', 'MM'), (149, 'Namibia', 'NA'), (150, 'Nepal', 'NP'), (151, 'Netherlands', 'NL'), (152, 'New Caledonia', 'NC'), (153, 'New Zealand', 'NZ'), (154, 'Nicaragua', 'NI'), (155, 'Niger', 'NE'), (156, 'Nigeria', 'NG'), (157, 'Northern Mariana Islands', 'MP'), (159, 'Oman', 'OM'), (160, 'Pakistan', 'PK'), (161, 'Palestinian Territory', 'PS'), (162, 'Panama', 'PA'), (163, 'Papua New Guinea', 'PG'), (164, 'Paraguay', 'PY'), (165, 'Peru', 'PE'), (166, 'Philippines', 'PH'), (167, 'Poland', 'PL'), (168, 'Portugal', 'PT'), (170, 'Qatar', 'QA'), (171, 'Reunion', 'RE'), (172, 'Romania', 'RO'), (173, 'Russian Federation', 'RU'), (174, 'Rwanda', 'RW'), (175, 'Saint Kitts and Nevis', 'KN'), (176, 'Saint Lucia', 'LC'), (177, 'St. Vincent & the Grenad.', 'VC'), (178, 'Samoa', 'WS'), (180, 'Sao Tome and Principe', 'ST'), (181, 'Saudi Arabia', 'SA'), (183, 'Serbia', 'RS'), (184, 'Seychelles', 'SC'), (185, 'Singapore', 'SG'), (186, 'Slovakia', 'SK'), (187, 'Slovenia', 'SI'), (188, 'Solomon Islands', 'SB'), (189, 'Somalia', 'SO'), (220, 'South Africa', 'ZA'), (190, 'Spain', 'ES'), (191, 'Sri Lanka (ex-Ceilan)', 'LK'), (192, 'Sudan', 'SD'), (193, 'Suriname', 'SR'), (194, 'Swaziland', 'SZ'), (195, 'Sweden', 'SE'), (196, 'Switzerland', 'CH'), (197, 'Syrian Arab Republic', 'SY'), (198, 'Taiwan', 'TW'), (199, 'Tajikistan', 'TJ'), (200, 'Tanzania, United Rep. of', 'TZ'), (201, 'Thailand', 'TH'), (202, 'Togo', 'TG'), (203, 'Tonga', 'TO'), (204, 'Trinidad & Tobago', 'TT'), (205, 'Tunisia', 'TN'), (206, 'Turkey', 'TR'), (207, 'Turkmenistan', 'TM'), (208, 'Uganda', 'UG'), (209, 'Ukraine', 'UA'), (210, 'United Arab Emirates', 'AE'), (211, 'Uruguay', 'UY'), (212, 'Uzbekistan', 'UZ'), (213, 'Vanuatu', 'VU'), (214, 'Venezuela', 'VE'), (215, 'Viet Nam', 'VN'), (216, 'Virgin Islands, U.S.', 'VI'), (217, 'Yemen', 'YE'), (218, 'Zambia', 'ZM'), (219, 'Zimbabwe', 'ZW'); -- -------------------------------------------------------- -- -- Table structure for table `module_session` -- CREATE TABLE IF NOT EXISTS `module_session` ( `user_id` int(255) NOT NULL DEFAULT '0', `page_id` int(255) NOT NULL DEFAULT '0', `ses_key` int(255) NOT NULL DEFAULT '0', `module` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `timestamp` int(255) NOT NULL DEFAULT '0', UNIQUE KEY `unique_ses` (`user_id`,`page_id`,`module`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `myspace` -- CREATE TABLE IF NOT EXISTS `myspace` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Dumping data for table `myspace` -- INSERT INTO `myspace` (`id`, `user`, `url`, `title`, `image`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (3, 1, 'tyagiharis370', 'tyagiharis370', 'https://a1-images.myspacecdn.com/images04/10/92befbb14d904cbd931f9366508d3936/600x600.jpg', 0, 0, 0, 0, 0, 10, '0', 0), (2, 2, 'connectionrock', 'connectionrock', 'https://a1-images.myspacecdn.com/images03/28/31d219c4712b49b5bc2a533636023eac/600x600.jpg', 0, 0, 0, 0, 0, 10, '0', 0), (4, 1, 'radicalface', 'radicalface', 'https://a3-images.myspacecdn.com/images04/9/441f70233e8f4cd2818a812ee077c332/600x600.jpg', 1, 0, 0, 0, 0, 10, '0', 0), (5, 1, 'lesliefilms', 'lesliefilms', 'https://a2-images.myspacecdn.com/images03/1/2453914fcf684c75b5664d629de3f1fb/600x600.jpg', 1, 0, 0, 0, 0, 10, '0', 0), (6, 1, 'garthbrookesfansite', 'garthbrookesfansite', 'https://a1-images.myspacecdn.com/images03/29/72218235422149d0889adae88af58b38/600x600.jpg', 1, 0, 0, 0, 0, 10, '0', 0), (7, 1, 'hariv', 'hariv', 'https://a1-images.myspacecdn.com/images03/13/73b77834273a4c7db64e5ff18abd2f7b/600x600.jpg', 1, 0, 0, 0, 0, 10, '0', 0), (8, 1, 'harse', 'harse', 'https://a2-images.myspacecdn.com/images03/33/c475442b1c614b129c349c8f3dbff9c9/600x600.jpg', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `myspaced` -- CREATE TABLE IF NOT EXISTS `myspaced` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `myspace_accounts` -- CREATE TABLE IF NOT EXISTS `myspace_accounts` ( `user` int(255) NOT NULL DEFAULT '0', `account_username` varchar(255) NOT NULL, KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `myspace_accounts` -- INSERT INTO `myspace_accounts` (`user`, `account_username`) VALUES (1, 'tyagiharis370'), (2, 'tyagiharis370'); -- -------------------------------------------------------- -- -- Table structure for table `offer` -- CREATE TABLE IF NOT EXISTS `offer` ( `id` double unsigned NOT NULL AUTO_INCREMENT, `user` varchar(1000) DEFAULT NULL, `click` int(10) unsigned DEFAULT '0', `reward` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `offer` -- INSERT INTO `offer` (`id`, `user`, `click`, `reward`) VALUES (1, 'doorandlock', 0, NULL); -- -------------------------------------------------------- -- -- Table structure for table `payment_proofs` -- CREATE TABLE IF NOT EXISTS `payment_proofs` ( `id` int(255) NOT NULL AUTO_INCREMENT, `p_id` int(255) NOT NULL DEFAULT '0', `u_id` int(255) NOT NULL DEFAULT '0', `proof` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `proof_date` int(255) NOT NULL DEFAULT '0', `approved` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `pinterest` -- CREATE TABLE IF NOT EXISTS `pinterest` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_av` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `pinterest` -- INSERT INTO `pinterest` (`id`, `user`, `url`, `title`, `p_av`, `clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'sarabshobe', 'sara shobe (sarabshobe)', 'https://s-media-cache-ak0.pinimg.com/avatars/sarabshobe-1430449263_140.jpg', 1, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `pinterested` -- CREATE TABLE IF NOT EXISTS `pinterested` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `plused` -- CREATE TABLE IF NOT EXISTS `plused` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `pt_like` -- CREATE TABLE IF NOT EXISTS `pt_like` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_av` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `pt_like` -- INSERT INTO `pt_like` (`id`, `user`, `url`, `title`, `p_av`, `clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '393079873704045515', 'funny cartoons', 'https://s-media-cache-ak0.pinimg.com/736x/d5/47/1a/d5471a47d4b7ecd58148a446a032a68c.jpg', 1, 0, 10, '0', 0), (2, 2, '393079873703504104', 'funny quotes', 'https://s-media-cache-ak0.pinimg.com/600x315/fa/59/da/fa59dac56032be4dd620482683281a87.jpg', 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `pt_liked` -- CREATE TABLE IF NOT EXISTS `pt_liked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `pt_repin` -- CREATE TABLE IF NOT EXISTS `pt_repin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_av` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `pt_repin` -- INSERT INTO `pt_repin` (`id`, `user`, `url`, `title`, `p_av`, `clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '393079873703504104', 'funny quotes', 'https://s-media-cache-ak0.pinimg.com/600x315/fa/59/da/fa59dac56032be4dd620482683281a87.jpg', 1, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `pt_repined` -- CREATE TABLE IF NOT EXISTS `pt_repined` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `p_pack` -- CREATE TABLE IF NOT EXISTS `p_pack` ( `id` int(255) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `days` int(255) NOT NULL DEFAULT '0', `price` decimal(10,2) NOT NULL DEFAULT '0.00', `coins_price` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Dumping data for table `p_pack` -- INSERT INTO `p_pack` (`id`, `name`, `days`, `price`, `coins_price`, `type`) VALUES (1, '14 Days', 14, '2.00', 0, 0), (2, '30 Days', 30, '3.00', 0, 0), (3, '60 Days', 60, '5.00', 0, 0), (4, '120 Days', 120, '9.00', 0, 0), (5, '180 Days', 180, '12.50', 0, 0), (6, '365 Days', 365, '25.00', 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `reports` -- CREATE TABLE IF NOT EXISTS `reports` ( `id` int(255) NOT NULL AUTO_INCREMENT, `page_id` int(255) NOT NULL DEFAULT '0', `page_url` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '0', `owner_id` int(255) NOT NULL DEFAULT '0', `reported_by` int(255) NOT NULL DEFAULT '0', `reason` varchar(128) CHARACTER SET latin1 NOT NULL, `count` int(64) NOT NULL DEFAULT '1', `module` varchar(64) CHARACTER SET latin1 NOT NULL, `status` int(11) NOT NULL DEFAULT '0', `timestamp` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; -- -- Dumping data for table `reports` -- INSERT INTO `reports` (`id`, `page_id`, `page_url`, `owner_id`, `reported_by`, `reason`, `count`, `module`, `status`, `timestamp`) VALUES (1, 5, 'https://www.facebook.com/TheHungerGames', 2, 1, 'gs', 1, 'facebook', 2, 1448423337), (2, 3, 'http://ask.fm/rahulprasadg/answer/132932151779', 2, 1, 'fsdf', 1, 'askfm_like', 1, 1448423663), (3, 11, 'http://www.facebook.com/events/199457746875312', 2, 1, 'gfsd', 1, 'fb_event', 1, 1448424989), (4, 1, 'http://www.facebook.com/photo.php?fbid=908622555861545', 2, 1, 'sadasa', 1, 'fb_photo', 1, 1448425040), (5, 1, '1010038135693846_1053050661392593', 2, 1, 'dsfasf', 1, 'fb_postcomment', 1, 1448425331); -- -------------------------------------------------------- -- -- Table structure for table `requests` -- CREATE TABLE IF NOT EXISTS `requests` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `paypal` varchar(255) NOT NULL, `amount` decimal(5,2) NOT NULL DEFAULT '0.00', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `paid` int(11) NOT NULL DEFAULT '0', `gateway` varchar(64) NOT NULL DEFAULT 'paypal', `reason` varchar(255) NOT NULL, `proof` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `retweet` -- CREATE TABLE IF NOT EXISTS `retweet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `retweet` -- INSERT INTO `retweet` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'https://twitter.com/Montsalvat/status/613961068415549440', 'tweet', 1, 0, 0, 0, 0, 10, '0', 0), (2, 2, 'https://twitter.com/kabeerraja2000/status/613784382122274816', 'dsf', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `retweeted` -- CREATE TABLE IF NOT EXISTS `retweeted` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `reverbnation` -- CREATE TABLE IF NOT EXISTS `reverbnation` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `artist_id` int(255) NOT NULL, `title` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `reverbnation` -- INSERT INTO `reverbnation` (`id`, `user`, `url`, `artist_id`, `title`, `image`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'https://www.reverbnation.com/atifaslammusic', 2004831, 'tats', 'https://gp1.wac.edgecastcdn.net/802892/production_public/Artist/2004831/image/1318531297_153169068108323_100002456914489_261714_472096659_n.jpg', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `reverbnation_accounts` -- CREATE TABLE IF NOT EXISTS `reverbnation_accounts` ( `user` int(255) NOT NULL DEFAULT '0', `account_name` varchar(255) NOT NULL, `account_username` varchar(255) NOT NULL, KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `reverbnation_accounts` -- INSERT INTO `reverbnation_accounts` (`user`, `account_name`, `account_username`) VALUES (1, 'Aquademica', 'aquademica'); -- -------------------------------------------------------- -- -- Table structure for table `reverbnation_done` -- CREATE TABLE IF NOT EXISTS `reverbnation_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `scf` -- CREATE TABLE IF NOT EXISTS `scf` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `title` varchar(255) NOT NULL, `url` varchar(255) NOT NULL, `s_av` varchar(255) NOT NULL, `s_id` int(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `active` int(11) NOT NULL DEFAULT '0', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; -- -- Dumping data for table `scf` -- INSERT INTO `scf` (`id`, `user`, `title`, `url`, `s_av`, `s_id`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `cpc`, `active`, `country`, `sex`) VALUES (15, 2, 'Muhammad Haris Tyagi', 'muhammad-haris-tyagi', 'https://i1.sndcdn.com/avatars-000141272153-3tt4q3-large.jpg', 148401688, 0, 0, 0, 0, 10, 0, '0', 0), (16, 2, 'Lexie Blankenship', 'exielankenship', 'https://i1.sndcdn.com/avatars-000141713049-r4z53a-large.jpg', 148795500, 1, 0, 0, 0, 10, 0, '0', 0), (17, 2, 'ATMASFERA - With ♥ :-)', 'atmasfera', 'https://i1.sndcdn.com/avatars-000164805838-7ordap-large.jpg', 72176263, 0, 0, 0, 0, 10, 0, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `scf_done` -- CREATE TABLE IF NOT EXISTS `scf_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `site_config` -- CREATE TABLE IF NOT EXISTS `site_config` ( `setting_id` int(10) NOT NULL AUTO_INCREMENT, `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `config_value` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`setting_id`), UNIQUE KEY `config_name` (`config_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=89 ; -- -- Dumping data for table `site_config` -- INSERT INTO `site_config` (`setting_id`, `config_name`, `config_value`) VALUES (1, 'site_name', 'HitsKart.com'), (2, 'site_description', 'Best platform for social exchange'), (3, 'site_url', 'http://hitskart.com'), (4, 'site_email', 'support@hitskart.com'), (5, 'paypal', 'mamalimzn@gmail.com'), (6, 'maintenance', '1'), (7, 'm_progress', '70'), (8, 'm_twitter', ''), (9, 'fb_fan_url', ''), (10, 'free_cpc', '10'), (11, 'premium_cpc', '20'), (12, 'daily_bonus', '50'), (13, 'daily_bonus_vip', '100'), (14, 'crf_bonus', '0'), (15, 'surf_time', '20'), (16, 'surf_time_type', '0'), (17, 'ref_coins', '300'), (18, 'reg_coins', '50'), (19, 'reg_cash', '0.00'), (20, 'reg_status', '0'), (21, 'reg_reqmail', '0'), (22, 'scf_api', 'a49ab8d778deb22ba9eecec8fc8c3a1e'), (23, 'transfer_status', '2'), (24, 'transfer_fee', '15'), (25, 'refsys', '1'), (26, 'paysys', '0'), (27, 'ref_cash', '0.10'), (28, 'ref_sale', '20'), (29, 'pay_min', '1.00'), (30, 'surf_type', '2'), (31, 'currency_code', 'USD'), (32, 'banner_system', '1'), (33, 'def_lang', 'en'), (34, 'more_per_ip', '0'), (35, 'c_c_limit', '2'), (36, 'c_v_limit', '5'), (37, 'surf_fb_skip', '0'), (38, 'surf_fc_req', '0'), (39, 'hideref', '2'), (40, 'c_discount', '20'), (41, 'c_show_msg', '1'), (42, 'c_text_index', '20% Discount On All Coins Packs'), (43, 'payza', 'payment@hitskart.com'), (44, 'payza_security', '997787'), (45, 'paypal_status', '1'), (46, 'payza_status', '1'), (47, 'captcha_sys', '1'), (48, 'recaptcha_pub', '6LeKNAcTAAAAAOAjAd92J9wCAuAMZp-DUt1I77C_'), (49, 'recaptcha_sec', '6LeKNAcTAAAAAEwPEYZ_aFAqEnI4j4IdnvhMiWev'), (50, 'target_system', '0'), (51, 'aff_reg_days', '0'), (52, 'analytics_id', 'UA-64409799-1'), (53, 'aff_click_req', '10'), (54, 'paypal_auto', '1'), (55, 'payza_auto', '1'), (56, 'report_limit', '10'), (57, 'mysql_random', '0'), (58, 'convert_enabled', '0'), (59, 'convert_rate', '1000'), (60, 'min_convert', '100'), (61, 'allow_withdraw', '0'), (62, 'instagram_id', '5400783981f6474f9570ce04cae9a4cc'), (63, 'revshare_api', 'aYzqh0nmG66'), (64, 'fb_app_id', '126774840828161'), (65, 'fb_app_secret', 'ab34e1e65e38e4db3b166555f8497d56'), (66, 'auto_country', '1'), (67, 'blog_comments', '1'), (68, 'twitter_token', '522167485-80AQeAPVVrF9hv97py8iwnOidvZpYam3jVabO3Jb'), (69, 'twitter_token_secret', 'iidZdu4sYqq8Rf1SwJCuE8ydf3hjjntaH5MeBSgnkzGvL'), (70, 'twitter_consumer_key', 'G6zm9e5Y8KxPrZ2uyGUxp5Ntp'), (71, 'twitter_consumer_secret', 'dluPXv6T9FyqiaxVnzB1R2mj97oaZrDyzgAx4AF1z7Nj5O3Tu9'), (72, 'yt_api', 'AIzaSyCN8jbhC5px2U9GdJdlkUCSN0A1xZh5xus'), (73, 'clicks_limit', '0'), (74, 'proof_required', '1'), (75, 'aff_req_clicks', '0'), (76, 'smtp_host', 'localhost'), (77, 'smtp_port', '25'), (78, 'smtp_username', ''), (79, 'smtp_password', ''), (80, 'smtp_auth', '0'), (81, 'mail_delivery_method', '0'), (82, 'solvemedia_c', ''), (83, 'solvemedia_v', ''), (84, 'solvemedia_h', ''), (85, 'noreply_email', 'support@hitskart.com'), (86, 'license_file', 'TVRRME9EVXhNekF3TWc9PSh8fClOell6WlRVek1tUTNZek0zTldVek5HUmhNemN5WWpnMU4yRTNPR0kwTkRJPSh8fCkofHwpYUdsMGMydGhjblF1WTI5dA=='), (87, 'theme', 'dark'), (88, 'gp_api', 'AIzaSyCN8jbhC5px2U9GdJdlkUCSN0A1xZh5xus'); -- -------------------------------------------------------- -- -- Table structure for table `soundcloud_liked` -- CREATE TABLE IF NOT EXISTS `soundcloud_liked` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `soundcloud_likes` -- CREATE TABLE IF NOT EXISTS `soundcloud_likes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; -- -- Dumping data for table `soundcloud_likes` -- INSERT INTO `soundcloud_likes` (`id`, `user`, `url`, `p_url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (3, 2, '200650121', 'http://soundcloud.com/atmasfera/where-should-i-go-with-message-atmasfera', 'Atmasfera - Where should I go (Album "Internal")', 'https://i1.sndcdn.com/artworks-000120387406-d3p3q6-large.jpg', 1, 0, 0, 0, 0, 10, '0', 0), (4, 2, '126740264', 'http://soundcloud.com/atmasfera/07-gucul', 'Atmasfera - Gucul (Album "Integro")', 'https://i1.sndcdn.com/artworks-000106118693-yfeurw-large.jpg', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `soundcloud_played` -- CREATE TABLE IF NOT EXISTS `soundcloud_played` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `soundcloud_plays` -- CREATE TABLE IF NOT EXISTS `soundcloud_plays` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `p_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `soundcloud_plays` -- INSERT INTO `soundcloud_plays` (`id`, `user`, `url`, `p_url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '200650121', 'https://api.soundcloud.com/tracks/200650121', 'Atmasfera - Where should I go (Album ', 'https://i1.sndcdn.com/artworks-000120387406-d3p3q6-large.jpg', 2, 0, 0, 0, 0, 5, '0', 0), (2, 2, '126740264', 'https://api.soundcloud.com/tracks/126740264', 'Atmasfera - Gucul (Album "Integro")', 'https://i1.sndcdn.com/artworks-000106118693-yfeurw-large.jpg', 3, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `stumble` -- CREATE TABLE IF NOT EXISTS `stumble` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` text COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `active` (`active`), KEY `cpc` (`cpc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `stumble` -- INSERT INTO `stumble` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'http://www.stumbleupon.com/stumbler/danevl', 'danevl', 1, 0, 0, 0, 0, 10, '0', 0), (2, 2, 'http://www.stumbleupon.com/stumbler/ptsrfsalwaysnfor', 'dfad', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `stumbled` -- CREATE TABLE IF NOT EXISTS `stumbled` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `surf` -- CREATE TABLE IF NOT EXISTS `surf` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `clicks` int(2) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `confirm` int(11) NOT NULL DEFAULT '0', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `surf` -- INSERT INTO `surf` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `confirm`, `country`, `sex`) VALUES (1, 2, 'http://xdhax.com', 'xdhax', 1, 0, 0, 0, 0, 10, 0, '0', 0), (2, 2, 'http://jsbeautifier.org/', 'jsbeautifier', 2, 0, 0, 0, 0, 10, 0, '0', 0), (3, 2, 'http://abchax.com', 'abchax', 1, 0, 0, 0, 0, 10, 0, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `surfed` -- CREATE TABLE IF NOT EXISTS `surfed` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `transactions` -- CREATE TABLE IF NOT EXISTS `transactions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` text COLLATE utf8_unicode_ci NOT NULL, `user_id` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', `money` decimal(10,2) NOT NULL DEFAULT '0.00', `gateway` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'paypal', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `paid` int(11) NOT NULL DEFAULT '1', `payer_email` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `trans_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `user_ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `twitter` -- CREATE TABLE IF NOT EXISTS `twitter` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `title` varchar(255) NOT NULL, `url` varchar(255) NOT NULL, `t_id` int(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `active` int(11) NOT NULL DEFAULT '0', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Dumping data for table `twitter` -- INSERT INTO `twitter` (`id`, `user`, `title`, `url`, `t_id`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `cpc`, `active`, `country`, `sex`) VALUES (5, 2, 'kennedy willyans', '_Kennedy97', 370924332, 1, 0, 0, 0, 10, 0, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `twitter_fav` -- CREATE TABLE IF NOT EXISTS `twitter_fav` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `t_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; -- -- Dumping data for table `twitter_fav` -- INSERT INTO `twitter_fav` (`id`, `user`, `url`, `title`, `t_id`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (2, 2, '662382692147818497', 'sdf', '', 1, 0, 0, 0, 0, 10, '0', 0), (3, 2, '664027282625851392', 'sdad', '', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `twitter_faved` -- CREATE TABLE IF NOT EXISTS `twitter_faved` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `twitter_retweet` -- CREATE TABLE IF NOT EXISTS `twitter_retweet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table `twitter_retweet` -- INSERT INTO `twitter_retweet` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 1, '662382692147818497', 'retweet', 0, 0, 0, 0, 0, 10, '0', 0), (2, 2, '664027282625851392', 'dsfs', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `twitter_retweeted` -- CREATE TABLE IF NOT EXISTS `twitter_retweeted` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `twitter_tweet` -- CREATE TABLE IF NOT EXISTS `twitter_tweet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `twitter_tweet` -- INSERT INTO `twitter_tweet` (`id`, `user`, `url`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 3, 'fsdafdsfasfasffsdfk;hfgsdfmbndfkghsdkfjkjghsfkjhasdfgsdklfsakljhkdjsjgfhhfgsdajsdgfshfsdahfskfhsdagsdkfhjsgfsdhfjsadgfshajfhgajfafhjsafjsdkf', 2, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `twitter_tweeted` -- CREATE TABLE IF NOT EXISTS `twitter_tweeted` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `twitter_tweet_accounts` -- CREATE TABLE IF NOT EXISTS `twitter_tweet_accounts` ( `user` int(255) NOT NULL DEFAULT '0', `account_name` varchar(255) NOT NULL, `account_username` varchar(255) NOT NULL, KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `twitter_tweet_accounts` -- INSERT INTO `twitter_tweet_accounts` (`user`, `account_name`, `account_username`) VALUES (1, 'Haris Tyagi', '522167485'); -- -------------------------------------------------------- -- -- Table structure for table `used_coupons` -- CREATE TABLE IF NOT EXISTS `used_coupons` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user_id` int(255) NOT NULL DEFAULT '0', `coupon_id` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(255) NOT NULL AUTO_INCREMENT, `email` varchar(128) DEFAULT NULL, `login` varchar(32) NOT NULL, `admin` int(11) NOT NULL DEFAULT '0', `coins` int(255) NOT NULL DEFAULT '0', `account_balance` decimal(10,3) NOT NULL DEFAULT '0.000', `premium` int(255) NOT NULL DEFAULT '0', `IP` varchar(32) CHARACTER SET latin1 DEFAULT NULL, `log_ip` varchar(32) NOT NULL DEFAULT '0', `pass` varchar(32) DEFAULT NULL, `ref` int(255) DEFAULT NULL, `ref_paid` int(11) NOT NULL DEFAULT '1', `signup` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `online` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `newsletter` int(11) NOT NULL DEFAULT '1', `promote` int(255) NOT NULL DEFAULT '0', `daily_bonus` int(255) NOT NULL DEFAULT '0', `activate` int(255) NOT NULL DEFAULT '0', `banned` int(11) NOT NULL DEFAULT '0', `rec_hash` int(255) NOT NULL DEFAULT '0', `country` varchar(64) NOT NULL DEFAULT '0', `c_changes` int(11) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', `warn_message` varchar(255) NOT NULL, `warn_expire` int(255) NOT NULL DEFAULT '0', `ref_source` varchar(255) NOT NULL DEFAULT '0', `offerclick` double NOT NULL DEFAULT '0', `offerreward` int(11) NOT NULL DEFAULT '1', `reward` int(11) NOT NULL DEFAULT '0', `rewardmoney` decimal(10,3) NOT NULL DEFAULT '0.000', PRIMARY KEY (`id`), KEY `login` (`login`), KEY `banned` (`banned`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `email`, `login`, `admin`, `coins`, `account_balance`, `premium`, `IP`, `log_ip`, `pass`, `ref`, `ref_paid`, `signup`, `online`, `newsletter`, `promote`, `daily_bonus`, `activate`, `banned`, `rec_hash`, `country`, `c_changes`, `sex`, `warn_message`, `warn_expire`, `ref_source`, `offerclick`, `offerreward`, `reward`, `rewardmoney`) VALUES (1, 'admin@hitskart.com', 'doorandlock', 1, 60849, '129.614', 0, '117.220.188.10', '117.212.114.105', '025a0f7eb619b498022798200186eafc', NULL, 1, '2015-05-20 12:17:19', '2015-11-26 05:02:42', 1, 0, 0, 0, 0, 0, 'IN', 2, 1, '', 0, '0', 1400, 2, 0, '0.000'), (2, 'tyagiharis370@gmail.com', 'blaze0004', 1, 714, '0.000', 0, '23.19.26.250', '117.220.187.126', '47642b585770954a10373f9b6d9e5c6e', 1, 1, '2015-05-21 01:47:31', '2015-11-21 07:15:54', 1, 0, 0, 0, 0, 0, 'US', 0, 1, '', 0, 'http://hitskart.com/addurl.php', 113, 1, 0, '0.000'), (3, 'test@hitskart.com', 'testlogin', 0, 30, '0.000', 0, '117.212.112.41', '71.19.189.10', 'e16b2ab8d12314bf4efbd6203906ea6c', 0, 0, '2015-06-14 06:37:12', '2015-06-19 08:42:11', 0, 0, 0, 0, 0, 0, 'IN', 0, 1, '', 0, 'http://hitskart.com/', 0, 0, 0, '0.000'), (4, 'jettlockie@ubismail.net', 'temporary', 0, 50, '0.000', 0, '117.212.115.122', '117.212.115.122', '47642b585770954a10373f9b6d9e5c6e', 0, 0, '2015-06-22 11:21:10', '2015-06-22 11:21:30', 1, 0, 0, 0, 0, 0, 'IN', 0, 1, '', 0, 'http://hitskart.com/offer.php', 6, 0, 0, '0.000'); -- -------------------------------------------------------- -- -- Table structure for table `user_clicks` -- CREATE TABLE IF NOT EXISTS `user_clicks` ( `uid` int(11) NOT NULL DEFAULT '0', `module` varchar(64) NOT NULL, `total_clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', UNIQUE KEY `unique_stats` (`module`,`uid`), KEY `uid` (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `user_clicks` -- INSERT INTO `user_clicks` (`uid`, `module`, `total_clicks`, `today_clicks`) VALUES (2, 'google', 3, 0), (2, 'facebook', 3, 0), (2, 'fb_photo', 2, 0), (1, 'reverbnation', 1, 0), (2, 'su', 2, 0), (2, 'surf', 3, 0), (2, 'twitter', 2, 0), (2, 'retweet', 2, 0), (2, 'youtube', 1, 0), (2, 'yousecond', 1, 0), (2, 'vk', 1, 0), (2, 'vk_group', 1, 0), (2, 'pinterest', 1, 0), (2, 'pt_repin', 1, 0), (2, 'pt_like', 1, 0), (2, 'myspace', 6, 0), (2, 'linkedin', 4, 0), (2, 'instagram', 2, 0), (2, 'inst_likes', 2, 0), (1, 'scf', 1, 0), (1, 'ysub', 4, 0), (1, 'yfav', 1, 0), (1, 'ylike', 1, 0), (1, 'fb_share', 3, 0), (1, 'fb_subscribe', 3, 0), (1, 'fb_postshare', 2, 0), (1, 'fb_postlike', 1, 0), (1, 'google_circle', 1, 0), (1, 'google_share', 1, 0), (1, 'fb_postcomment', 1, 0), (1, 'vine_followers', 2, 0), (1, 'vine_like', 1, 0), (1, 'vine_revine', 1, 0), (1, 'vine_comment', 1, 0), (1, 'soundcloud_likes', 2, 0), (1, 'soundcloud_plays', 5, 0), (1, 'youtube', 1, 0), (1, 'askfm_like', 1, 0), (1, 'surf', 1, 0), (1, 'askinger_follow', 1, 0), (1, 'askinger_like', 1, 0), (1, 'twitter', 2, 0), (1, 'twitter_retweet', 2, 0), (1, 'twitter_fav', 3, 0), (1, 'twitter_tweet', 2, 0); -- -------------------------------------------------------- -- -- Table structure for table `user_transactions` -- CREATE TABLE IF NOT EXISTS `user_transactions` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user_id` int(255) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', `value` int(255) NOT NULL DEFAULT '0', `cash` decimal(10,2) NOT NULL DEFAULT '0.00', `date` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `user_transactions` -- INSERT INTO `user_transactions` (`id`, `user_id`, `type`, `value`, `cash`, `date`) VALUES (1, 1, 0, 999, '1.00', 1434987593), (2, 1, 0, 999, '1.00', 1435771701), (3, 1, 0, 999, '1.00', 1444265870); -- -------------------------------------------------------- -- -- Table structure for table `viewed` -- CREATE TABLE IF NOT EXISTS `viewed` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `vine_comment` -- CREATE TABLE IF NOT EXISTS `vine_comment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `vine_comment` -- INSERT INTO `vine_comment` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '1269019986279194624', 'gfdg', 'http://v.cdn.vine.co/r/videos/C79C96785D1269019200601886720_4543dd7cf22.2.0.2751944390296214571.mp4.jpg?versionId=BN0ZyM_VGKlW5ekZMf5MwJyxb3bXn3V5', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `vine_commented` -- CREATE TABLE IF NOT EXISTS `vine_commented` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `vine_followed` -- CREATE TABLE IF NOT EXISTS `vine_followed` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `vine_followers` -- CREATE TABLE IF NOT EXISTS `vine_followers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=16 ; -- -- Dumping data for table `vine_followers` -- INSERT INTO `vine_followers` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (14, 2, '906380398727147520', 'sfd', 'https://v.cdn.vine.co/r/avatars/4F145041BF1267926689288736768_906380398727147520_1445271493042_VineAvatar_906380398727147520354702c0b9.jpg?versionId=dQpVArTkD4gT4CKcCPol38tzK9mh7.hv', 1, 0, 0, 0, 0, 10, '0', 0), (15, 2, '927662224540049408', 'df', 'https://v.cdn.vine.co/r/avatars/6B61DF727E1228844290835402752_33bf4f4b14c.4.1.jpg?versionId=xU.mgs._63Bb2otRJAtAxyXXyUDlZycw', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `vine_like` -- CREATE TABLE IF NOT EXISTS `vine_like` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; -- -- Dumping data for table `vine_like` -- INSERT INTO `vine_like` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (5, 2, '1269019986279194624', 'gfds', 'http://v.cdn.vine.co/r/videos/C79C96785D1269019200601886720_4543dd7cf22.2.0.2751944390296214571.mp4.jpg?versionId=BN0ZyM_VGKlW5ekZMf5MwJyxb3bXn3V5', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `vine_liked` -- CREATE TABLE IF NOT EXISTS `vine_liked` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `vine_revine` -- CREATE TABLE IF NOT EXISTS `vine_revine` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `img` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(11) NOT NULL DEFAULT '0', `today_clicks` int(11) NOT NULL DEFAULT '0', `max_clicks` int(11) NOT NULL DEFAULT '0', `daily_clicks` int(11) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -- Dumping data for table `vine_revine` -- INSERT INTO `vine_revine` (`id`, `user`, `url`, `title`, `img`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, '1269019986279194624', 'dsf', 'http://v.cdn.vine.co/r/videos/C79C96785D1269019200601886720_4543dd7cf22.2.0.2751944390296214571.mp4.jpg?versionId=BN0ZyM_VGKlW5ekZMf5MwJyxb3bXn3V5', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `vine_revined` -- CREATE TABLE IF NOT EXISTS `vine_revined` ( `user_id` int(11) NOT NULL, `site_id` int(11) NOT NULL, UNIQUE KEY `unique_id` (`user_id`,`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `vk` -- CREATE TABLE IF NOT EXISTS `vk` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) CHARACTER SET armscii8 NOT NULL, `vk_id` int(255) NOT NULL, `title` varchar(255) CHARACTER SET armscii8 NOT NULL, `vk_photo` varchar(255) CHARACTER SET armscii8 NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `total_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '0', `country` varchar(64) CHARACTER SET armscii8 NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `vk` -- INSERT INTO `vk` (`id`, `user`, `url`, `vk_id`, `title`, `vk_photo`, `clicks`, `total_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'oroom', 31836774, '?§?????????? ???????????»??', 'http://cs627125.vk.me/v627125297/6cad/7pYkePF2tnY.jpg', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `vkg_done` -- CREATE TABLE IF NOT EXISTS `vkg_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `vk_done` -- CREATE TABLE IF NOT EXISTS `vk_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `vk_group` -- CREATE TABLE IF NOT EXISTS `vk_group` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) CHARACTER SET armscii8 NOT NULL, `vk_id` int(255) NOT NULL, `title` varchar(255) CHARACTER SET armscii8 NOT NULL, `vk_photo` varchar(255) CHARACTER SET armscii8 NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `total_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) CHARACTER SET armscii8 NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `vk_group` -- INSERT INTO `vk_group` (`id`, `user`, `url`, `vk_id`, `title`, `vk_photo`, `clicks`, `total_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 2, 'club66105458', 66105458, 'MLM INTERNATIONAL GROUP', 'http://cs616417.vk.me/v616417726/45f8/Cjx6FuCDyyU.jpg', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `web_stats` -- CREATE TABLE IF NOT EXISTS `web_stats` ( `id` int(255) NOT NULL AUTO_INCREMENT, `module_id` varchar(64) NOT NULL, `module_name` varchar(64) NOT NULL, `value` int(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `module_id` (`module_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ; -- -- Dumping data for table `web_stats` -- INSERT INTO `web_stats` (`id`, `module_id`, `module_name`, `value`) VALUES (1, 'facebook', 'Facebook Likes', 3), (2, 'fb_photo', 'FB Photo Likes', 2), (3, 'fb_share', 'Facebook Share', 3), (4, 'fb_subscribe', 'Facebook Followers', 3), (5, 'google', 'Google +1', 3), (6, 'inst_likes', 'Instagram Likes', 2), (7, 'instagram', 'Instagram Followers', 2), (8, 'linkedin', 'LinkedIn Shares', 4), (9, 'myspace', 'MySpace Connections', 6), (10, 'pinterest', 'Pinterest Followers', 1), (11, 'pt_like', 'Pinterest Likes', 1), (12, 'pt_repin', 'Pinterest Repin', 1), (13, 'retweet', 'Twitter Tweets', 2), (14, 'reverbnation', 'Reverbnation Fans', 1), (15, 'scf', 'Soundcloud Followers', 1), (16, 'stumble', 'Stumbleupon Followers', 2), (17, 'surf', 'Traffic Exchange', 4), (18, 'twitter', 'Twitter Followers', 4), (19, 'vk', 'VK Pages', 1), (20, 'vk_group', 'VK Groups', 1), (21, 'yfav', 'Youtube Favorites', 1), (22, 'ylike', 'Youtube Likes', 1), (23, 'yousecond', 'YouSecond Friends', 1), (24, 'youtube', 'Youtube Views', 2), (25, 'ysub', 'Youtube Subscribers', 4), (26, 'askfm_like', 'Ask.fm Like', 1), (27, 'fb_event', 'Facebook Events', 0), (28, 'fb_postcomment', 'Facebook Post Comment', 1), (29, 'fb_postlike', 'Facebook Post Like', 1), (30, 'fb_postshare', 'Facebook Post Share', 2), (31, 'google_circle', 'Google+ Circle', 1), (32, 'google_share', 'Google+ Share', 1), (33, 'soundcloud_likes', 'SoundCloud Likes', 2), (34, 'soundcloud_plays', 'SoundCloud Plays', 5), (35, 'vine_comment', 'Vine Comments', 1), (36, 'vine_followers', 'Vine Followers', 2), (37, 'vine_like', 'Vine Likes', 1), (38, 'vine_revine', 'Vine Revines', 1); -- -------------------------------------------------------- -- -- Table structure for table `yfav` -- CREATE TABLE IF NOT EXISTS `yfav` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `yfav` -- INSERT INTO `yfav` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 1, '1C4lSdJ2MjY', 'Dynamo - Extra Cities Announce', 0, 0, 0, 0, 0, 5, '0', 0), (2, 1, 'NYhY5z4Vj_c', 'minecraft', 0, 0, 0, 0, 0, 10, '0', 0), (3, 2, 'i8bF8hEhiKA', 'dumb', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `yfaved` -- CREATE TABLE IF NOT EXISTS `yfaved` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `yfav_accounts` -- CREATE TABLE IF NOT EXISTS `yfav_accounts` ( `user` int(255) NOT NULL DEFAULT '0', `account_name` varchar(255) NOT NULL, `account_id` varchar(255) NOT NULL, `fav_id` varchar(255) NOT NULL, KEY `user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `yfav_accounts` -- INSERT INTO `yfav_accounts` (`user`, `account_name`, `account_id`, `fav_id`) VALUES (1, 'Haris Tyagi', 'UCD7JjoePGuVwlXCgHo2Ro1g', 'FLD7JjoePGuVwlXCgHo2Ro1g'); -- -------------------------------------------------------- -- -- Table structure for table `ylike` -- CREATE TABLE IF NOT EXISTS `ylike` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Dumping data for table `ylike` -- INSERT INTO `ylike` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (2, 2, 'nxr2SV5znwI', 'Honest', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `yliked` -- CREATE TABLE IF NOT EXISTS `yliked` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `yousecond` -- CREATE TABLE IF NOT EXISTS `yousecond` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) CHARACTER SET armscii8 NOT NULL, `title` varchar(255) CHARACTER SET armscii8 NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) CHARACTER SET armscii8 NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', `p_av` varchar(255) NOT NULL, `ys_id` int(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `yousecond` -- INSERT INTO `yousecond` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`, `p_av`, `ys_id`) VALUES (1, 2, 'hanny', '-', 0, 0, 0, 0, 0, 10, '0', 0, 'http://yousecond.net/file/pic/user/2012/04/9b010bd85bff53627d6f368826703fd1_50_square.jpg', 13), (2, 2, 'EwPyTyCoTul', '...', 1, 0, 0, 0, 0, 10, '0', 0, 'http://yousecond.net/file/pic/user/2012/12/2e194734d76fc80a06b0587358ccc06b_50_square.jpg', 27384); -- -------------------------------------------------------- -- -- Table structure for table `yousecond_done` -- CREATE TABLE IF NOT EXISTS `yousecond_done` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `youtube` -- CREATE TABLE IF NOT EXISTS `youtube` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `clicks` int(255) NOT NULL DEFAULT '0', `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `active` int(11) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `country` varchar(64) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `youtube` -- INSERT INTO `youtube` (`id`, `user`, `url`, `title`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `active`, `cpc`, `country`, `sex`) VALUES (1, 1, 'feZVBD6Hd24', 'ithacktips', 0, 0, 0, 0, 0, 10, '0', 0), (2, 1, 'WbGgqKatP9w', 'sad', 1, 0, 0, 0, 0, 10, '0', 0), (3, 2, 'XN1zrRspy7E', 'khamoshiyan', 0, 0, 0, 0, 0, 10, '0', 0), (4, 2, 'NYhY5z4Vj_c', 'da', 1, 0, 0, 0, 0, 10, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `ysub` -- CREATE TABLE IF NOT EXISTS `ysub` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` int(255) NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `y_av` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `clicks` int(255) NOT NULL, `today_clicks` int(255) NOT NULL DEFAULT '0', `max_clicks` int(255) NOT NULL DEFAULT '0', `daily_clicks` int(255) NOT NULL DEFAULT '0', `cpc` int(11) NOT NULL DEFAULT '2', `active` int(11) NOT NULL, `country` varchar(64) CHARACTER SET latin1 NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; -- -- Dumping data for table `ysub` -- INSERT INTO `ysub` (`id`, `user`, `title`, `url`, `y_av`, `clicks`, `today_clicks`, `max_clicks`, `daily_clicks`, `cpc`, `active`, `country`, `sex`) VALUES (4, 2, 'Laughing Colours', 'UCSmC99d8wQvNWbqpGcFVumw', 'https://yt3.ggpht.com/-zhcht4--ZkA/AAAAAAAAAAI/AAAAAAAAAAA/c56Lo5g63m8/s88-c-k-no/photo.jpg', 1, 0, 0, 0, 10, 0, '0', 0), (2, 2, 'PopularMMOs', 'UCpGdL9Sn3Q5YWUH2DVUW1Ug', 'https://yt3.ggpht.com/-ZTmDqvhaw30/AAAAAAAAAAI/AAAAAAAAAAA/1wk5CSaMbc8/s88-c-k-no/photo.jpg', 1, 0, 0, 0, 10, 0, '0', 0); -- -------------------------------------------------------- -- -- Table structure for table `ysubed` -- CREATE TABLE IF NOT EXISTS `ysubed` ( `user_id` int(255) NOT NULL, `site_id` int(255) NOT NULL, KEY `user_id` (`user_id`), KEY `site_id` (`site_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!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 */;
true
a21a8cf90d95ef329e60e824c570da594a92c87a
SQL
hobos/baosuzhai
/server/build/com.zizibujuan.drip.server.sql/mysql/TABLE/FOREIGN_KEY.sql
UTF-8
578
2.9375
3
[]
no_license
ALTER TABLE `drip`.`DRIP_EXERCISE` ADD constraint FK_EXERCISE_USER FOREIGN KEY (CRT_USER_ID) REFERENCES `drip`.`DRIP_USER_INFO` (`DBID` ) ALTER TABLE `drip`.`DRIP_ANSWER` ADD constraint FK_ANSWER_USER FOREIGN KEY (CRT_USER_ID) REFERENCES `drip`.`DRIP_USER_INFO` (`DBID` ) ALTER TABLE `drip`.`DRIP_ANSWER` ADD constraint FK_ANSWER_EXERCISE FOREIGN KEY (EXER_ID) REFERENCES `drip`.`DRIP_EXERCISE` (`DBID` ) ALTER TABLE `drip`.`DRIP_CHOICE_OPTION` ADD constraint FK_CHOICE_OPTION_EXERCISE FOREIGN KEY (EXER_ID) REFERENCES `drip`.`DRIP_EXERCISE` (`DBID` )
true
fc87ca00559d9c6ef3aba84fd4cb9ed3be58dea4
SQL
Kenyda/flibusta_server
/source/sql/author_search.sql
UTF-8
1,193
4.0625
4
[ "Apache-2.0" ]
permissive
WITH filtered_authors AS ( SELECT * FROM author, plainto_tsquery($1) f_query WHERE EXISTS (SELECT * FROM bookauthor RIGHT JOIN book ON bookauthor.book_id = book.id WHERE book.lang = ANY ($2::text[]) AND bookauthor.author_id = author.id) AND author.search_content @@ f_query ) SELECT json_build_object( 'count', (SELECT COUNT(*) FROM filtered_authors), 'result', (SELECT array_to_json(array_agg(j.json_build_object)) FROM ( select json_build_object( 'id', author.id, 'first_name', author.first_name, 'last_name', author.last_name, 'middle_name', author.middle_name, 'annotation_exists', EXISTS( SELECT * FROM author_annotation WHERE author_annotation.author_id = author.id ) ) from filtered_authors as author, plainto_tsquery($1) s_query order by ts_rank(author.search_content, s_query) DESC, (select count(*) from bookauthor where bookauthor.author_id = author.id) DESC, author.id LIMIT $3 OFFSET $4) j ) ) as json
true
4b16ea911b1ddbcde74c7dcf1c91f38ac39c56b8
SQL
esti-leroy/sql
/src/Task4.sql
UTF-8
1,318
3.34375
3
[]
no_license
DECLARE nEmpID hr.employees.employee_id%TYPE := &Номер_сотрудника; nOldSalary hr.employees.salary%TYPE; nNewSalary hr.employees.salary%TYPE; sFirstName hr.employees.first_name%TYPE; sLastName hr.employees.last_name%TYPE; dHireDate hr.employees.hire_date%TYPE; nYears number(4, 0); BEGIN SELECT salary INTO nOldSalary FROM hr.employees WHERE employee_id = nEmpId; SELECT first_name INTO sFirstName FROM hr.employees WHERE employee_id = nEmpId; SELECT last_name INTO sLastName FROM hr.employees WHERE employee_id = nEmpId; SELECT hire_date INTO dHireDate FROM hr.employees WHERE employee_id = nEmpId; nYears := MONTHS_BETWEEN(SYSDATE, dHireDate) / 12; CASE WHEN nYears >= 15 THEN nNewSalary := nOldSalary * 1.15; WHEN nYears >= 10 THEN nNewSalary := nOldSalary * 1.10; ELSE nNewSalary := nOldSalary * 1.05; END CASE; UPDATE hr.employees SET SALARY = nNewSalary WHERE employee_id = nEmpID; COMMIT; DBMS_OUTPUT.PUT_LINE('Номер сотрудника: ' || nEmpID || ' Имя и фамилия: ' || sFirstName || ' ' || sLastName || ' Проработано лет: ' || nYears); DBMS_OUTPUT.PUT_LINE('Старая зарплата: ' || nOldSalary || ' Новая зарплата: ' || nNewSalary); END;
true
ec09ca93d536bfdb74be1957511abd284c8a5647
SQL
rcFlechas/Script_SQL
/SERVICIO_CLIENTE_CONSULTAS_POR_VENDEDOR.sql
UTF-8
993
3.609375
4
[]
no_license
-- REPORTE RUTA DIARIA POR VENDEDOR SELECT R.codigoCliente, R.numeroFactura, R.idtipoDeMovimiento, R.nombreDeCliente, R.direccion, R.nombresConductor, E.celularCorporativo, R.nombreCausalDeRechazo FROM rutero R, empleados E WHERE R.estadoManifiesto = '3' AND R.vendedor = 'VARON CABRERA ROSSIE' AND E.cedula = R.conductor ORDER BY nombreDeCliente ASC; -- REPORTE DEVOLUCION DIARIA POR VENDEDOR SELECT codigoCliente, nombreDeCliente, direccion, numeroFactura, FLOOR(valorTotalFactura) as vt, nombreCausalDeRechazo, telefono FROM rutero WHERE estadoManifiesto = '3' AND idtipoDeMovimiento = 3 AND vendedor = 'VARON CABRERA ROSSIE'; -- TODOS LOS VENDEDORES ACTIVOS SELECT * FROM comercializadoraCam.rutero WHERE estadoManifiesto ='3' AND vendedor = 'VARON CABRERA ROSSIE'; SELECT T1.nombres, T1.celular, T1.email, T2.idCanalDeVenta, T2.nombreCanalDeVenta FROM usuariosweb T1 INNER JOIN tiposcanaldeventas T2 ON T1.canalDeVenta = T2.idCanalDeVenta WHERE T1.activo = 1 AND IdPerfilDeUsuario = 6;
true
1deccbc5d3e4e16e5281bd7ce1bd988c958ba4a7
SQL
cherotwokibet/sqltrials
/mosh/outer_join.sql
UTF-8
167
3.21875
3
[]
no_license
USE sql_store; SELECT c.customer_id, c.first_name, o.order_id FROM orders o RIGHT JOIN customers c ON c.customer_id = o.customer_id ORDER BY c.customer_id
true
da0436590c97ffbcbb575ff4f8df69ec4425618e
SQL
dipinkp1993/servicefriend
/id12739384_oscm(1).sql
UTF-8
17,343
3
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jun 11, 2020 at 06:10 AM -- Server version: 10.3.16-MariaDB -- PHP Version: 7.3.12 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: `id12739384_oscm` -- -- -------------------------------------------------------- -- -- 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, '2020_02_15_091101_create_wholesalers_table', 1), (4, '2020_02_15_091152_create_servicecenters_table', 1), (5, '2020_02_16_170224_create_servicerequests_table', 2), (6, '2020_02_16_171222_create_servicerequests_table', 3); -- -------------------------------------------------------- -- -- Table structure for table `parts` -- CREATE TABLE `parts` ( `pid` int(11) NOT NULL, `pname` varchar(50) NOT NULL, `pslno` varchar(50) NOT NULL, `price` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `parts` -- INSERT INTO `parts` (`pid`, `pname`, `pslno`, `price`) VALUES (1, 'Clutch cable', 'A10001', '500'), (2, 'break cable', 'A10002', '550'), (3, 'helmet vega', 'A10003', '1900'), (4, 'side mirror maruti swift', 'A7890', '3000'), (5, 'cylinder 45pzcv', 'CY4567', '5000'); -- -------------------------------------------------------- -- -- Table structure for table `partsrequest` -- CREATE TABLE `partsrequest` ( `cprid` int(11) NOT NULL, `serviceid` int(11) NOT NULL, `vpid` int(11) NOT NULL, `customerid` int(11) NOT NULL, `noofparts` int(11) NOT NULL, `request_status` varchar(50) NOT NULL, `tot_price` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `partsrequest` -- INSERT INTO `partsrequest` (`cprid`, `serviceid`, `vpid`, `customerid`, `noofparts`, `request_status`, `tot_price`) VALUES (1, 1, 1, 1, 3, 'paid', 'Request should be accepted'), (2, 1, 2, 1, 8, 'paid', 'Request should be accepted'); -- -------------------------------------------------------- -- -- Table structure for table `partsrequesttows` -- CREATE TABLE `partsrequesttows` ( `prwid` int(11) NOT NULL, `serviid` int(11) NOT NULL, `parid` int(11) NOT NULL, `numparts` int(11) NOT NULL, `reqstatus` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `partsrequesttows` -- INSERT INTO `partsrequesttows` (`prwid`, `serviid`, `parid`, `numparts`, `reqstatus`) VALUES (1, 1, 2, 5, 'paid'), (2, 1, 1, 4, 'paid'), (3, 1, 1, 4, 'paid'), (4, 1, 1, 6, 'paid'), (5, 1, 1, 5, 'paid'), (6, 1, 1, 5, 'pending'); -- -------------------------------------------------------- -- -- Table structure for table `parts_stock` -- CREATE TABLE `parts_stock` ( `stockid` int(11) NOT NULL, `partid` int(11) NOT NULL, `stock_quantity` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `parts_stock` -- INSERT INTO `parts_stock` (`stockid`, `partid`, `stock_quantity`) VALUES (1, 2, '200'), (2, 3, '568'), (3, 5, '450'), (4, 4, '300'), (5, 1, '61'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `servicecenters` -- CREATE TABLE `servicecenters` ( `sid` bigint(20) UNSIGNED NOT NULL, `centername` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `cno` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci NOT NULL, `licenseno` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `servicecenters` -- INSERT INTO `servicecenters` (`sid`, `centername`, `email`, `email_verified_at`, `password`, `cno`, `address`, `licenseno`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Motor Friend', 'motorfriend@gmail.com', NULL, '$2y$10$6SOmsaQUBFmkdPlhKm9NqOzM6XtEB1StzkocyT8PFdu/doV61l.IK', '9947456321', 'kochi,kadavantra', 'sgsdg456', 'ORXtO3YsAV8gwxirXWV9BgnUrSv8f482qOxpKUdLHgkbCNp81tw6bNV9qiCt', '2020-02-16 06:39:31', '2020-02-26 04:50:33'), (2, 'Service king', 'sk@gmail.com', NULL, '$2y$10$uYVz8zuLHkwuCMxdOhVyHu4FqleMeaVPXUhsMNsDALAmghzE/eu9.', '8890456123', 'kochi', 'zdzdf789', NULL, '2020-02-16 06:45:27', '2020-02-16 06:45:27'), (3, 'motorcrew', 'mcrew@gmail.com', NULL, '$2y$10$b8Yeu7RIb4xe1kbTAoXb5uJvl0oQanOix.ITzdaYVfqHmPsjYHMa2', '8075014084', 'sdfssdfsd', 'zvzvzvzxv', NULL, '2020-02-16 06:49:30', '2020-02-16 06:49:30'), (4, 'tvssc', 'tvssc@gmail.com', NULL, '$2y$10$m1GnfStBGbs7imHoNt3bFuEELvqP.C2oDVc1VlZb65g184kU6NYSW', '8903123489', 'zvxzvx', 'zdfdzfszdf', NULL, '2020-02-16 06:51:46', '2020-02-16 06:51:46'), (5, 'sking', 'sd@gmail.com', NULL, '$2y$10$yoBelMVtr5Y2b0ZGO.m7vOgPAlPnQn2g5FoF/KbN2HUWgz76LPD.G', '9876456123', 'hjbhjbjhb', 'hvhjb', NULL, '2020-02-16 08:09:31', '2020-02-16 08:09:31'), (6, 'racevilla', 'racevilla@gmail.com', NULL, '$2y$10$6vI2NPucYRxXtd19YJxsW.JWjj5KD1.2xj3/tNnYVUHc2j9E0cPBu', '9087123567', 'hfghzfhvhdsf', 'adad5353', NULL, '2020-02-19 00:18:52', '2020-02-19 00:18:52'), (7, 'vechicle world', 'vewo@gmail.com', NULL, '$2y$10$FAv4ySQpxOu4YmKFc5ri3e5JFoUzKs5aULZzyNy4LCPTOYes1NQkC', '9087123678', 'kannur', 'vgh789', NULL, '2020-02-23 06:57:54', '2020-02-23 06:57:54'), (8, 'motorcrewkl86', 'motorcrewkl86@gmail.com', NULL, '$2y$10$vjtFEHjm3vhqWYaw1MZwjeDRcGFt8hOUk8vAMHmF/QyFA5Bcw0Lke', '8075014084', 'jsdfjbfs', 'dgdfgd456', NULL, '2020-02-26 23:19:51', '2020-02-26 23:19:51'), (9, 'servestar', 'servestar@gmail.com', NULL, '$2y$10$KKqbzU9pX39hVuxcszCNn.DKIbVTakiFb1oZPAOO3OtDVp1cTpPGO', '9845123456', 'zfzfvzxcvzxc', '1234', NULL, '2020-06-09 11:42:15', '2020-06-09 11:42:15'); -- -------------------------------------------------------- -- -- Table structure for table `servicerequests` -- CREATE TABLE `servicerequests` ( `rid` bigint(20) UNSIGNED NOT NULL, `customerid` int(11) NOT NULL, `serviceid` int(11) NOT NULL, `catname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `vname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `vmodel` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `vbrand` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `sdate` date NOT NULL, `stime` time NOT NULL, `request_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `request_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `service_charge` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `servicerequests` -- INSERT INTO `servicerequests` (`rid`, `customerid`, `serviceid`, `catname`, `vname`, `vmodel`, `vbrand`, `sdate`, `stime`, `request_status`, `request_type`, `service_charge`, `created_at`, `updated_at`) VALUES (1, 1, 1, 'two wheeler', 'Hornett', '2016', 'Honda', '2020-03-10', '12:25:00', 'paid', '1', '2500', '2020-03-06 05:54:39', '2020-03-06 05:54:39'), (2, 1, 1, 'four wheeler', 'Tiago', '2016', 'Tata', '2020-03-17', '12:26:00', 'paid', '1', '120', '2020-03-06 05:55:22', '2020-03-06 05:55:22'), (3, 1, 1, 'two wheeler', 'Apache', '165cc', 'TVS', '2020-03-16', '12:47:00', 'pending', '1', '0', '2020-03-06 06:16:08', '2020-03-06 06:16:08'); -- -------------------------------------------------------- -- -- Table structure for table `service_doneby` -- CREATE TABLE `service_doneby` ( `sdbid` int(11) NOT NULL, `rqid` int(11) NOT NULL, `mname` varchar(50) NOT NULL, `remarks` varchar(191) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `service_doneby` -- INSERT INTO `service_doneby` (`sdbid`, `rqid`, `mname`, `remarks`) VALUES (1, 1, 'Satheesh M', 'Break cable changed'), (2, 2, 'Arun P P', 'washed'); -- -------------------------------------------------------- -- -- Table structure for table `service_status` -- CREATE TABLE `service_status` ( `statusid` int(11) NOT NULL, `reqid` int(11) NOT NULL, `customid` int(11) NOT NULL, `datstatus` date NOT NULL, `status` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `service_status` -- INSERT INTO `service_status` (`statusid`, `reqid`, `customid`, `datstatus`, `status`) VALUES (1, 1, 1, '2006-03-20', 'approved'), (2, 1, 1, '2006-03-20', 'completed'), (3, 2, 1, '2006-03-20', 'approved'), (4, 2, 1, '2006-03-20', 'completed'); -- -------------------------------------------------------- -- -- Table structure for table `transaction_parts` -- CREATE TABLE `transaction_parts` ( `trpaid` int(11) NOT NULL, `secenid` int(11) NOT NULL, `amount` varchar(50) NOT NULL, `dot` date NOT NULL, `prid` int(11) NOT NULL, `transactionnumber` varchar(50) NOT NULL, `cuuid` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaction_parts` -- INSERT INTO `transaction_parts` (`trpaid`, `secenid`, `amount`, `dot`, `prid`, `transactionnumber`, `cuuid`) VALUES (1, 1, '1500', '2020-03-06', 1, 'P6zUWzW4', 1), (2, 1, '4400', '2020-03-06', 2, 'HHZbVWCY', 1); -- -------------------------------------------------------- -- -- 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, `address` 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`, `address`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'DIPIN KP', 'dipinpnambiar@gmail.com', NULL, '$2y$10$xaZie/b2VULTBME1hFss6Ooz0DgoJRm3tJWzxZP0cAD29lOfU1wJ6', 'bkjbjhbh', 'ph6HKUKVeNWjX5Yur3KJJ0S6N6n9pHa5Kvk5rIsFRkAO84PoNthIVpas3xMs', '2020-02-16 05:03:59', '2020-02-26 04:13:01'), (2, 'varun p p', 'var123@gmail.com', NULL, '$2y$10$Q907ufLbSMqeLcIbSAgrVu3hIYjNDu5rn8GSKgwuWkZzb9d8CHMvi', 'kannur', NULL, '2020-02-23 06:58:43', '2020-02-23 06:58:43'), (3, 'Jithin N T', 'jithinnt@gmail.com', NULL, '$2y$10$T7TEmNG.yTIxkvn3lYtkvejUOdP37fNbfb/o9CljYGF3Dqqj04Zoa', 'Nettikattu house keoth', NULL, '2020-02-26 23:10:41', '2020-02-26 23:10:41'), (4, 'test', 'tt@tt.com', NULL, '$2y$10$HZ2rHe5hLTDRegGN08oi2esU99DnM013mcY87qGRkXhipG.krwSUe', 'test', NULL, '2020-03-07 04:47:41', '2020-03-07 04:47:41'), (5, 'op', 'op@op.com', NULL, '$2y$10$HczO4zFsUkCumsE.U9fzzuXE1aU6rk.kcDEm1L1rph.dbOyMiCYi6', 'op', NULL, '2020-03-07 05:17:08', '2020-03-07 05:17:08'), (6, 'Hemanth', 'hemanth123@gmail.com', NULL, '$2y$10$KsXQpKbcxOeGKS4vGfGpE.jN3BHMoYRbEXhD5zLV8hBEcziMbIHAu', 'Deepam villa .Payyannur', NULL, '2020-03-07 09:11:14', '2020-03-07 09:11:14'), (7, 'Jithin N T', '525jithin@gmail.com', NULL, '$2y$10$HcoRJ4ht4vlJXC2oXKPG2eNJoReQawFhJ0DVoIwIW5zwOMubNFYe2', 'Nettikkattu house,keloth Payyanur', NULL, '2020-03-07 12:51:34', '2020-03-07 12:51:34'), (8, 'Vinay K', 'vinay123@gmail.com', NULL, '$2y$10$7JicORszKhohPOKoT7Af2uBEYYo4xmSoLrj3gosaiPdwNO9wp.n9W', 'Deepam Villa,Kannur,Payyannur', 'xVLUa4bDeEd37740yDJfpbo89IKhATCyUdwVjsBhldanPYDYJtBgoUsOVesZ', '2020-03-19 14:39:10', '2020-03-19 14:39:10'), (9, 'siju', 'siju@gmail.com', NULL, '$2y$10$zuNczAqBrQpI6T/7Y/8cMueu2QkEAMYxAVh0FGaBBrLKZz9r9DYp6', 'Gui', NULL, '2020-04-20 18:10:32', '2020-04-20 18:10:32'), (10, 'siju', 'siju123@gmail.com', NULL, '$2y$10$1e9au36GxqWZRp6UDY9RYunMmUYZXEJdzson6t2Gc2T2yfBVhn4Pi', 'sample adderss', NULL, '2020-06-09 11:39:00', '2020-06-09 11:39:00'); -- -------------------------------------------------------- -- -- Table structure for table `wholesalers` -- CREATE TABLE `wholesalers` ( `wid` bigint(20) UNSIGNED NOT NULL, `wholesalername` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `wholesalers` -- INSERT INTO `wholesalers` (`wid`, `wholesalername`, `email`, `email_verified_at`, `password`, `created_at`, `updated_at`) VALUES (1, 'ServiceAdmin', 'serviceadmin@gmail.com', NULL, '$2y$10$LzUIKLOEwde0w/Lxb4KmfOxSDbcCzgFEansMg4YEK.k1Lf70YQHGm', '2020-02-23 05:40:28', '2020-03-09 11:14:06'); -- -- Indexes for dumped tables -- -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `parts` -- ALTER TABLE `parts` ADD PRIMARY KEY (`pid`); -- -- Indexes for table `partsrequest` -- ALTER TABLE `partsrequest` ADD PRIMARY KEY (`cprid`); -- -- Indexes for table `partsrequesttows` -- ALTER TABLE `partsrequesttows` ADD PRIMARY KEY (`prwid`); -- -- Indexes for table `parts_stock` -- ALTER TABLE `parts_stock` ADD PRIMARY KEY (`stockid`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `servicecenters` -- ALTER TABLE `servicecenters` ADD PRIMARY KEY (`sid`), ADD UNIQUE KEY `servicecenters_email_unique` (`email`); -- -- Indexes for table `servicerequests` -- ALTER TABLE `servicerequests` ADD PRIMARY KEY (`rid`); -- -- Indexes for table `service_doneby` -- ALTER TABLE `service_doneby` ADD PRIMARY KEY (`sdbid`); -- -- Indexes for table `service_status` -- ALTER TABLE `service_status` ADD PRIMARY KEY (`statusid`); -- -- Indexes for table `transaction_parts` -- ALTER TABLE `transaction_parts` ADD PRIMARY KEY (`trpaid`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `wholesalers` -- ALTER TABLE `wholesalers` ADD PRIMARY KEY (`wid`), ADD UNIQUE KEY `wholesalers_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `parts` -- ALTER TABLE `parts` MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `partsrequest` -- ALTER TABLE `partsrequest` MODIFY `cprid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `partsrequesttows` -- ALTER TABLE `partsrequesttows` MODIFY `prwid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `parts_stock` -- ALTER TABLE `parts_stock` MODIFY `stockid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `servicecenters` -- ALTER TABLE `servicecenters` MODIFY `sid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `servicerequests` -- ALTER TABLE `servicerequests` MODIFY `rid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `service_doneby` -- ALTER TABLE `service_doneby` MODIFY `sdbid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `service_status` -- ALTER TABLE `service_status` MODIFY `statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `transaction_parts` -- ALTER TABLE `transaction_parts` MODIFY `trpaid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `wholesalers` -- ALTER TABLE `wholesalers` MODIFY `wid` 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 */;
true
818548ce6ea7ea02b7f09b198b906721f9f425a7
SQL
YngJian/meeting-room-reservation
/code/service/src/main/resources/sql/meetting-room-resvervation.sql
UTF-8
3,638
3.703125
4
[]
no_license
CREATE SCHEMA IF NOT EXISTS reservation; #########################用户信息表######################### CREATE TABLE `reservation`.`t_user_info` ( `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', `user_id` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户id', `user_name` varchar(64) NOT NULL COMMENT '用户名', `password` varchar(256) CHARACTER SET utf8mb4 NOT NULL COMMENT '登录密码', `phone` varchar(16) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户手机号', `email` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户邮箱号', `status` tinyint NOT NULL DEFAULT 1 COMMENT '用户状态:1正常,0被锁,-1弃用', `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '创建时间', `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE INDEX `user_1` (`phone`), UNIQUE INDEX `user-2` (`user_name`) ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COMMENT = '用户信息表'; #########################会议室信息表######################### CREATE TABLE `reservation`.`t_meet_room_info` ( `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', `room_id` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '房间id', `room_name` varchar(64) CHARACTER SET utf8mb4 NOT NULL COMMENT '房间名', `capacity` tinyint NOT NULL COMMENT '容量', `status` tinyint NOT NULL DEFAULT 1 COMMENT '会议室状态:1正常,0禁用', `update_user` varchar(32) NULL COMMENT '更新人', `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '创建时间', `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE INDEX `meet_1` (`room_name`) ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COMMENT = '会议室信息表'; #########################会议室预约信息表######################### CREATE TABLE `reservation`.`t_reservation_info` ( `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', `room_id` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '房间id', `user_id` varchar(32) CHARACTER SET utf8mb4 NOT NULL COMMENT '用户id', `start_time` datetime(0) NOT NULL COMMENT '预约开始时间', `end_time` datetime(0) NOT NULL COMMENT '预约结束时间', `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '创建时间', `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COMMENT = '会议室预约信息表'; /*ALTER TABLE `t_meet_room_info` DROP INDEX `user_1`; ALTER TABLE `t_meet_room_info` DROP INDEX `user-2`; ALTER TABLE `t_reservation_info` DROP INDEX `user_1`; ALTER TABLE `t_reservation_info` DROP INDEX `user-2`; ALTER TABLE `t_user_info` DROP INDEX `user_1`; ALTER TABLE `t_user_info` DROP INDEX `user-2`; DROP TABLE `t_meet_room_info`; DROP TABLE `t_reservation_info`; DROP TABLE `t_user_info`; DROP SCHEMA `reservation`; */
true
ae0995f90f6564f52fe8bdcc9e7ffb768e16ceff
SQL
SMNGJackob/virmisco
/web/query/scientific-name-record.sql
UTF-8
1,525
3.703125
4
[ "CC0-1.0" ]
permissive
## # @author SednaSoft A. Schaffhirt & A. Wünsche GbR <info@sedna-soft.de> # @version 2015-12-01 (date of last modification) # @since 2015-11-09 (date of creation) # @license https://creativecommons.org/publicdomain/zero/1.0/ CC0-1.0 ## # id # organismId # validNameId # higherTaxa # genus # subgenus # specificEpithet # infraspecificEpithet # authorship # year # isParenthesized # validGenus # validSubgenus # validSpecificEpithet # validInfraspecificEpithet # validAuthorship # validYear # validIsParenthesized # isValid SELECT `sn`.`id` `id`, `o`.`id` `organismId`, `vn`.`id` `validNameId`, `o`.`higher_taxa` `higherTaxa`, `sn`.`genus` `genus`, `sn`.`subgenus` `subgenus`, `sn`.`specific_epithet` `specificEpithet`, `sn`.`infraspecific_epithet` `infraspecificEpithet`, `sn`.`authorship` `authorship`, `sn`.`year` `year`, `sn`.`is_parenthesized` `isParenthesized`, `vn`.`genus` `validGenus`, `vn`.`subgenus` `validSubgenus`, `vn`.`specific_epithet` `validSpecificEpithet`, `vn`.`infraspecific_epithet` `validInfraspecificEpithet`, `vn`.`authorship` `validAuthorship`, `vn`.`year` `validYear`, `vn`.`is_parenthesized` `validIsParenthesized`, `vn`.`id` = `sn`.`id` `isValid` FROM `scientific_name` `sn` LEFT JOIN `organism` `o` ON `o`.`specimen_carrier_id` = `sn`.`specimen_carrier_id` AND `o`.`sequence_number` = `sn`.`sequence_number` LEFT JOIN `scientific_name` `vn` ON `vn`.`specimen_carrier_id` = `o`.`specimen_carrier_id` AND `vn`.`sequence_number` = `o`.`sequence_number` AND `vn`.`is_valid` = 'true'; WHERE `sn`.`id` = ?;
true
c7b6128a57782c5674329db1664fea433fb7ff18
SQL
Jjosimar/ControllerBackup
/Dados/appsuporte.sql
UTF-8
3,442
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 10-Ago-2017 às 22:56 -- Versão do servidor: 10.1.25-MariaDB -- PHP Version: 7.1.7 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: `appsuporte` -- CREATE DATABASE IF NOT EXISTS `appsuporte` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `appsuporte`; -- -------------------------------------------------------- -- -- Estrutura da tabela `contato` -- CREATE TABLE `contato` ( `id_contato` int(11) NOT NULL, `nomeEmpresa` varchar(100) DEFAULT NULL, `nomeProprietario` varchar(100) DEFAULT NULL, `email` varchar(200) DEFAULT NULL, `cpf_cnpj` varchar(15) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estrutura da tabela `contato_dados` -- CREATE TABLE `contato_dados` ( `id_contato_dados` int(11) NOT NULL, `telefone` varchar(20) DEFAULT NULL, `celular` varchar(20) DEFAULT NULL, `skype` varchar(100) DEFAULT NULL, `contato_id_contato` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estrutura da tabela `endereco` -- CREATE TABLE `endereco` ( `id_endereco` int(11) NOT NULL, `municipio` varchar(45) DEFAULT NULL, `estado` varchar(45) DEFAULT NULL, `cep` varchar(15) DEFAULT NULL, `complemento` varchar(200) DEFAULT NULL, `bairro` varchar(100) DEFAULT NULL, `contato_id_contato` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for dumped tables -- -- -- Indexes for table `contato` -- ALTER TABLE `contato` ADD PRIMARY KEY (`id_contato`); -- -- Indexes for table `contato_dados` -- ALTER TABLE `contato_dados` ADD PRIMARY KEY (`id_contato_dados`), ADD KEY `fk_contato_dados_contato_idx` (`contato_id_contato`); -- -- Indexes for table `endereco` -- ALTER TABLE `endereco` ADD PRIMARY KEY (`id_endereco`), ADD KEY `fk_endereco_contato1_idx` (`contato_id_contato`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `contato` -- ALTER TABLE `contato` MODIFY `id_contato` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `contato_dados` -- ALTER TABLE `contato_dados` MODIFY `id_contato_dados` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `endereco` -- ALTER TABLE `endereco` MODIFY `id_endereco` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Limitadores para a tabela `contato_dados` -- ALTER TABLE `contato_dados` ADD CONSTRAINT `fk_contato_dados_contato` FOREIGN KEY (`contato_id_contato`) REFERENCES `contato` (`id_contato`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Limitadores para a tabela `endereco` -- ALTER TABLE `endereco` ADD CONSTRAINT `fk_endereco_contato1` FOREIGN KEY (`contato_id_contato`) REFERENCES `contato` (`id_contato`) ON DELETE NO ACTION ON UPDATE NO ACTION; 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 */;
true
4cbc768b39ceb45e730ddee056b14c865ad3a962
SQL
jwerderits/MySQL-Project
/sql_class/run_query.sql
UTF-8
1,006
4.46875
4
[]
no_license
-- SELECT -- DATE_FORMAT(created_at, '%W') as day_week, -- count(*) as 'count' -- FROM users -- GROUP BY day_week -- ORDER BY count DESC; -- SELECT -- username, -- count(photos.user_id) as total_pics -- FROM users -- LEFT JOIN photos -- ON photos.user_id = users.id -- GROUP BY username -- HAVING total_pics = 0; -- SELECT -- users.username as 'username', -- likes.photo_id, -- count(*) as num_likes -- FROM photos -- INNER JOIN likes -- ON likes.photo_id = photos.id -- INNER JOIN users -- ON users.id = photos.user_id -- GROUP BY photos.id -- ORDER BY num_likes DESC -- LIMIT 1; -- SELECT -- tag_name, -- count(*) as total -- FROM photo_tags -- JOIN tags -- ON photo_tags.tag_id = tags.id -- GROUP BY tags.id -- ORDER BY total DESC -- LIMIT 5; SELECT users.username, count(*) / (SELECT count(*) FROM photos) as total FROM users JOIN likes ON users.id = likes.user_id GROUP BY users.id HAVING total >=1 ORDER BY total DESC;
true
fee40eaac88f75455e016ce9fe42912d5aefe686
SQL
slickhoss/CSharp-Library-App
/CreateAccountTable.sql
UTF-8
279
2.53125
3
[]
no_license
CREATE TABLE Account (userId INT NOT NULL PRIMARY KEY IDENTITY(1,1),email VARCHAR(255), userLogin VARCHAR(255), password VARCHAR(255)); ALTER TABLE Account ALTER COLUMN password NVARCHAR(255) COLLATE Latin1_General_CS_AS ALTER TABLE Account ADD CONSTRAINT userLogin UNIQUE(Name);
true
eb2c724e81e19e0af660b39a617f3def1dbcaf88
SQL
CodeChild/SpringBootDemo
/news.sql
UTF-8
209
2.53125
3
[]
no_license
-- 新闻表 create table `news`( id varchar (32) not null, `title` varchar (256) not null comment '标题', `content` text not null comment '内容', primary key (id) ) comment '新闻表';
true
e41a0a9ad9d4ae079fc507e148cc01421dfeca2f
SQL
TylerWilhelmWD/cs313-php
/web/db.sql
UTF-8
478
3.3125
3
[]
no_license
CREATE TABLE IF NOT EXISTS course ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(80) NOT NULL, number VARCHAR(10) NOT NULL ); CREATE TABLE IF NOT EXISTS ta_users ( id SERIAL PRIMARY KEY NOT NULL, username VARCHAR(64) NOT NULL, password VARCHAR(255) NOT NULL ); CREATE TABLE note (id SERIAL PRIMARY KEY NOT NULL, course_id INT NOT NULL REFERENCES course(id), user_id INT NOT NULL REFERENCES ta_users(id), content TEXT NOT NULL, date DATE NOT NULL );
true
bda754b932c6891c41dfc5822a81bb430ca57af5
SQL
JacobVN/GestorComunidadesDAIS
/app/sql.sql
UTF-8
2,028
4.03125
4
[]
no_license
//info propietarios-viviendas-comunidad SELECT c.id_comunidad, v.id_vivienda, v.numero, v.coeficiente, pv.id_propietario, p.nombre, p.apellidos, p.nif from comunidad c join vivienda v on c.id_comunidad = v.comunidad_fk left join prop_vivienda pv on pv.id_vivienda = v.id_vivienda left join propietario p on p.id_propietario = pv.id_propietario where c.id_comunidad = 8 SELECT c.id_comunidad, v.id_vivienda, v.numero, v.coeficiente, pv.id_propietario, p.nombre, p.apellidos, p.nif from propietario p join prop_vivienda pv join vivienda v join comunidad c where p.id_propietario = pv.id_propietario and pv.id_vivienda = v.id_vivienda and v.comunidad_fk = c.id_comunidad and c.id_comunidad = 8 order by v.id_vivienda, p.nombre, p.apellidos SELECT * FROM `pago_cuota` WHERE fecha > "2018" and fecha < "2020" SELECT * FROM `pago_cuota` WHERE year(fecha) = 2019 (*elimina index de fecha*) <!-- propietario.fecha_nacimiento.toLocaleDateString('en-GB') --> SELECT * FROM `vivienda` v left join pago_cuota p on p.vivienda_fk = v.id_vivienda WHERE v.comunidad_fk = 8 and p.fecha is null or year(p.fecha) = 2019 order by v.numero, p.fecha SELECT c.id_comunidad, v.id_vivienda, v.numero, v.coeficiente, pv.id_propietario, p.id_propietario, p.nombre, p.apellidos, p.nif from comunidad c join vivienda v on c.id_comunidad = v.comunidad_fk left join prop_vivienda pv on pv.id_vivienda = v.id_vivienda left join propietario p on p.id_propietario = pv.id_propietario where c.id_comunidad = 8 order by v.id_vivienda, p.nombre, p.apellidos select pc.fecha, pc.importe, pc.vivienda_fk, v.numero, v.coeficiente, v.comunidad_fk from pago_cuota pc join vivienda v on v.id_vivienda = pc.vivienda_fk where pc.vivienda_fk in ( select vin.id_vivienda from vivienda vin where vin.comunidad_fk = 8 ) and year(pc.fecha) = 2019 order by pc.fecha // Select coalesce(sum(importe), 0) as deuda, vivienda_fk from pago_cuota where vivienda_fk = 15 and year(fecha) < 2019 and pagado = 0
true
01377e84ca0326c81f13ed717767a310edba91d2
SQL
TDeepanshPandey/Library_Management_System
/incrtrigger.sql
UTF-8
520
3.25
3
[]
no_license
CREATE OR REPLACE TRIGGER incr_trigger AFTER INSERT OR UPDATE ON trans FOR EACH ROW BEGIN IF INSERTING THEN UPDATE book SET no_of_books = no_of_books-1 WHERE book_no = :NEW.book_no; UPDATE MEMBER SET no_of_books = no_of_books+1 WHERE mem_no = :NEW.mem_no; ELSIF UPDATING THEN UPDATE book SET no_of_books = no_of_books+1 WHERE book_no = :old.book_no; UPDATE MEMBER SET no_of_books = no_of_books-1 WHERE mem_no = :NEW.mem_no; END IF; END; /
true
fcf430a429c058907864212222c353aad1023a65
SQL
adrian1605/Bank
/db/sql/patch_1.sql
UTF-8
1,542
3.15625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Oct 30, 2014 at 12:47 PM -- Server version: 5.6.20 -- PHP Version: 5.5.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `socialnode` -- -- -------------------------------------------------------- -- -- Table structure for table `users_accounts` -- CREATE TABLE IF NOT EXISTS `users_accounts` ( `user_id` int(11) NOT NULL, `account_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `users_accounts` -- ALTER TABLE `users_accounts` ADD PRIMARY KEY (`user_id`,`account_id`), ADD KEY `account_id` (`account_id`); -- -- Constraints for dumped tables -- -- -- Constraints for table `users_accounts` -- ALTER TABLE `users_accounts` ADD CONSTRAINT `users_accounts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `users_accounts_ibfk_2` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
0e12094d1bedd1f6139415ee7d1e7f2a54bc6f00
SQL
Bauer312/election-data
/Model/process_index.sql
UTF-8
240
2.765625
3
[ "MIT" ]
permissive
\connect election; set search_path to federal; insert into federal_index select to_date(election_date, 'YYYY-MM-DD'), election_type, state, office, district, to_number(index, '999') from federal_index_raw where election_type = 'general';
true
8e8516b765a2ec715a553487eaae78d9a52f874d
SQL
jkampa3/Homework_9_NodeSQL
/schemaSetup.sql
UTF-8
1,714
3.1875
3
[]
no_license
DROP DATABASE IF EXISTS bamazon; CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( item_id INTEGER(10) AUTO_INCREMENT NOT NULL, product_name VARCHAR(40) NOT NULL, department_name VARCHAR(30) NOT NULL, price DECIMAL(10,2) NOT NULL, stock_quantity INTEGER(10) NOT NULL, PRIMARY KEY (item_id) ); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Salmon Fillet Pillow", "Home Decor", 12.89, 20); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Mullet Headband", "Health and Beauty", 9.99, 10); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Tonsil Plush Toy", "Toys and Games", 21.99, 10); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Dog Afro", "Pet Supplies", 6.00, 3); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Lifesize Bigfoot Statue", "Home Decor", 2565.00, 40); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("One Pound Replica Fat", "School Supplies", 23.10, 21); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Giant Googly Eyes", "Toys and Games", 9.49, 12); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Shakespearean Insult Bandages", "Health and Beauty", 6.32, 3); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Cat TurnTable Scratch Pad", "Pet Supplies", 26.00, 8); INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES ("Keyboard Waffle Iron", "School Supplies", 60.20, 321); SELECT * FROM products;
true
cd885c18282084f04fa7f0c1104140876999ff25
SQL
Viki-Meszaros/CEU-Data_Engineering1
/HW5.sql
UTF-8
796
3.796875
4
[]
no_license
-- Exercise3 -- Create a stored procedure which returns category of a given row. Row number is IN parameter, while category is OUT parameter. Display the returned category. -- CAT1 - amount > 100.000, CAT2 - amount > 10.000, CAT3 - amount <= 10.000 use classicmodels; DROP PROCEDURE IF EXISTS GetCategory; DELIMITER $$ CREATE PROCEDURE GetCategory( IN row_num INT, OUT amount_category VARCHAR(20) ) BEGIN DECLARE var DECIMAL DEFAULT 0; SET row_num =row_num-1; SELECT amount INTO var FROM payments LIMIT row_num, 1; IF var > 100000 THEN SET amount_category = 'CAT1'; ELSEIF var > 10000 & var <= 100000 THEN SET amount_category = 'CAT2'; ELSE SET amount_category = 'CAT3'; END IF; END$$ DELIMITER ; CALL GetCategory(40, @cat); SELECT @cat;
true
612199ab96371197c884c098eb3e7e0b9e76a11c
SQL
filimonadrian/bd
/test2_lab/recap.sql
UTF-8
4,794
4.03125
4
[]
no_license
-- Sa se afiseze toti angajatii ce au sosit in firma in anul 1981, care au un venit mai mare decat cel al sefului lor, afisand o lista cu antetul : -- Nume angajat, Den departament, Nume sef, Venit angajat, Venit sef, Ultima zi luna angajare -- Venitul lunar este egal cu suma dintre salariu si comision. -- Sa se rezolve prin doua metode distincte folosind JOIN-uri si functii SQL. -- Pentru testare se va utiliza baza de date a userului scott, formata din tabelele EMP, DEPT si SALGRADE. SELECT a1.ename AS "Nume Angajat", d.dname AS "Den Departament", a2.ename AS "Nume sef", a1.sal + nvl(a1.comm, 0) AS "Venit angajat", a2.sal + nvl(a2.comm, 0) AS "Venit sef", LAST_DAY(a1.hiredate) AS "Ultima Zi Luna de angajare" FROM emp a1 INNER JOIN emp a2 ON a1.mgr = a2.empno INNER JOIN dept d ON a1.deptno = d.deptno WHERE EXTRACT(YEAR from a1.hiredate) = 1981 AND a1.sal + nvl(a1.comm, 0) > a2.sal + nvl(a2.comm, 0); -- Sa se selecteze, pentru toti angajatii care au un grad salarial mai mare de 2 si care nu castiga niciun comision lunar: -- numele, denumirea departamentului din care face parte, gradul salarial, numarul zilei din data in care s-au angajat, venitul total lunar. -- Se va afisa o lista sub forma : -- Nume angajat, Den departament, Grad salarial, Ziua, Venit total -- Venitul lunar este egal cu suma dintre salariu si comision. -- Sa se rezolve prin doua metode distincte folosind JOIN-uri si functii SQL. -- Pentru testare se va utiliza baza de date a userului scott, formata din tabelele EMP, DEPT si SALGRADE. SELECT a1.ename AS "Nume Angajat", d.dname AS "Den Departament", g.grade AS "Grad salarial", EXTRACT(DAY from a1.hiredate) AS "Zi angajare", a1.sal + nvl(a1.comm, 0) AS "Venit lunar" FROM emp a1 INNER JOIN SALGRADE g ON a1.sal + nvl(a1.comm, 0) >= g.LOSAL AND a1.sal + nvl(a1.comm, 0) <= HISAL INNER JOIN dept d ON a1.deptno = d.deptno WHERE nvl(a1.comm, 0) = 0; -- Selectati numele angajatilor, functia, numele departamentului, data angajarii si -- salariul pentru toti angajatii care au acelasi salariu, s-au angajat intre anii 1981 si 1983 -- (inclusiv) si primesc comision. Se va ordona alfabetic dupa nume. -- Se se rezolve prin doua metode distincte folosind JOIN-uri si functii SQL. -- Pentru testare se va utiliza baza de date a userului scott, formata din tabelele EMP, DEPT si SALGRADE. -- INNER JOIN dept d -- ON a1.deptno = d.deptno -- NATURAL JOIN emp -- metoda 1 SELECT a1.ename AS "Nume Angajat", a1.job as "Functie", d.dname AS "Den Departament", a1.hiredate AS "Data angajare", a1.sal + nvl(a1.comm, 0) AS "Salariul" FROM emp a1, emp a2, dept d WHERE EXTRACT(YEAR FROM a1.hiredate) >= 1981 AND EXTRACT(YEAR FROM a1.hiredate) <= 1983 AND a1.sal = a2.sal AND a1.ename <> a2.ename AND nvl(a1.comm, 0) <> 0 AND a1.DEPTNO = d.DEPTNO order by a1.ename; -- Metoda 2 select a.ename as "Nume Angajat", a.job as "Functie", d.dname as "dept Number", a.hiredate as "data angajarii", a.sal as "Salariu" from emp a join emp a1 on a.sal = a1.sal and a.ename <> a1.ename join dept d on a.DEPTNO = d.DEPTNO where EXTRACT(YEAR from a.hiredate) between 1981 and 1983 and nvl(a.comm,0) <> 0 order by a.ename; -- lista cu toti angajatii care nu castiga un venit lunar mai mare decat sefii lor, in -- care sa se afiseze o apreciere daca angajatul respectiv are un venit salarial foarte -- bun sau doar bun. -- - venit anual > 20000 => FOARTE BUN -- - venit anual <= 200000 => BUN -- Antet: -- Nume angajat, den departament, venit anual angajat, venit anual sef, apreciere venit -- ordonare descrescator dupa venitul angajatului. -- Metoda 1 SELECT a1.ename AS "Nume Angajat", d.dname AS "Den Dept", 12 * (a1.sal + nvl(a1.comm, 0)) AS "Venit anual angajat", 12 * (a2.sal + nvl(a2.comm, 0)) AS "Venit anual sef", 'FOARTE BUN' AS "Apreciere venit" FROM emp a1 INNER JOIN emp a2 ON a1.mgr = a2.empno INNER JOIN dept d ON a1.deptno = d.deptno WHERE (a1.sal + nvl(a1.comm, 0)) < (a2.sal + nvl(a2.comm, 0)) AND 12 * (a1.sal + nvl(a1.comm, 0)) > 20000 union SELECT a1.ename AS "Nume Angajat", d.dname AS "Den Dept", 12 * (a1.sal + nvl(a1.comm, 0)) AS "Venit anual angajat", 12 * (a2.sal + nvl(a2.comm, 0)) AS "Venit anual sef", 'BUN' AS "Apreciere venit" FROM emp a1 INNER JOIN emp a2 ON a1.mgr = a2.empno INNER JOIN dept d ON a1.deptno = d.deptno WHERE (a1.sal + nvl(a1.comm, 0)) < (a2.sal + nvl(a2.comm, 0)) AND 12 * (a1.sal + nvl(a1.comm, 0)) <= 20000 ORDER BY "Venit anual angajat" desc;
true
ff69715170de75796f3268b6a7b45551ad3a5699
SQL
iqbalmaed/Iqbalmaed-Arkademy-test
/Soal6.sql
UTF-8
756
3.953125
4
[]
no_license
CREATE DATABASE Gudang; CREATE TABLE Categories( id INTEGER NOT NULL PRIMARY KEY ,name VARCHAR(15) NOT NULL ); INSERT INTO Categories(id,name) VALUES (1,'Peralatan Mandi') ,(2,'Mie Instan') ,(3,'Olahan Daging'); CREATE TABLE Products( id INTEGER NOT NULL PRIMARY KEY ,name VARCHAR(15) NOT NULL ,category_id INTEGER NOT NULL ,FOREIGN KEY (category_id) REFERENCES Categories(id) ); INSERT INTO Products(id,name,category_id) VALUES (1,'Shampo',1) ,(2,'Sikat Gigi',1) ,(3,'Indomie',2) ,(4,'Mie Sedap',2) ,(5,'Nuget',3); SELECT Categories.id, Categories.name as category_name, GROUP_CONCAT(Products.name SEPARATOR ',') as products FROM Categories LEFT JOIN Products ON Categories.id = Products.category_id GROUP BY Categories.id;
true
b6dbd013f7cee04be68a0b75caf538638f995328
SQL
github/vitess-gh
/examples/local/backups/create_customer_schema.sql
UTF-8
288
2.875
3
[ "Apache-2.0" ]
permissive
create table customer( customer_id bigint not null, email varbinary(128), primary key(customer_id) ) ENGINE=InnoDB; create table corder( order_id bigint not null, customer_id bigint, sku varbinary(128), price bigint, primary key(order_id) ) ENGINE=InnoDB;
true
9a172ed0cef3af4404e342e01a059535ea799c15
SQL
RjLi13/Tools
/datasources/botgarden/botgardenMetadataV1dead.sql
UTF-8
5,891
2.84375
3
[]
no_license
select co.id as id, co.objectnumber as AccessionNumber_s, case when (tig.taxon is not null and tig.taxon <> '') then regexp_replace(tig.taxon, '^.*\)''(.*)''$', '\1') end as Determination_s, case when (fc.item is not null and fc.item <> '') then regexp_replace(fc.item, '^.*\)''(.*)''$', '\1') end as Collector_s, co.fieldcollectionnumber as CollectorNumber_s, sdg.datedisplaydate as CollectionDate_s, case when sdg.dateearliestsingleyear != 0 and sdg.dateearliestsinglemonth != 0 and sdg.dateearliestsingleday != 0 then to_date( sdg.dateearliestsingleyear::varchar(4) || '-' || sdg.dateearliestsinglemonth::varchar(2) || '-' || sdg.dateearliestsingleday::varchar(2), 'yyyy-mm-dd') else null end as EarlyCollectionDate_s, case when sdg.datelatestyear != 0 and sdg.datelatestmonth != 0 and sdg.datelatestday != 0 then to_date( sdg.datelatestyear::varchar(4) || '-' || sdg.datelatestmonth::varchar(2) || '-' || sdg.datelatestday::varchar(2), 'yyyy-mm-dd') else null end as LateCollectionDate_s, lg.fieldlocverbatim as fcpverbatim_s, lg.fieldloccounty as CollCounty_ss, -- adding state and country lg.fieldlocstate as CollState_ss, lg.fieldloccountry as CollCountry_ss, lg.velevation as Elevation_s, lg.minelevation as MinElevation_s, lg.maxelevation as MaxElevation_s, lg.elevationunit as ElevationUnit_s, co.fieldcollectionnote as Habitat_s, lg.decimallatitude || ', ' || lg.decimallongitude as latlong_p, case when lg.vcoordsys like 'Township%' then lg.vcoordinates end as TRSCoordinates_s, lg.geodeticdatum as Datum_s, lg.localitysource as CoordinateSource_s, lg.coorduncertainty as CoordinateUncertainty_s, lg.coorduncertaintyunit as CoordinateUncertaintyUnit_s, case when (tn.family is not null and tn.family <> '') then regexp_replace(tn.family, '^.*\)''(.*)''$', '\1') end as family_s, '' gardenlocation_s, -- dead accessions should have no gardenlocations co.recordstatus dataQuality_s, case when (lg.fieldlocplace is not null and lg.fieldlocplace <> '') then regexp_replace(lg.fieldlocplace, '^.*\)''(.*)''$', '\1') when (lg.fieldlocplace is null and lg.taxonomicrange is not null) then 'Geographic range: '||lg.taxonomicrange end as locality_s, h1.name as csid_s, case when (con.rare = 'true') then 'yes' else 'no' end as rare_s, case when (cob.deadflag = 'true') then 'yes' else 'no' end as deadflag_s, cob.flowercolor as flowercolor_s, '' as determinationNoAuth_s, -- setting this to blank for now. not used, incorrect in query '' reasonformove_s, -- dead accessions should have no gardenlocations utils.findconserveinfo(tc.refname) as conservationinfo_ss, utils.findconserveorg(tc.refname) as conserveorg_ss, utils.findconservecat(tc.refname) as conservecat_ss, case when (utils.findvoucherinfo(h1.name) is not null) then 'yes' else 'no' end as vouchers_s, '1' as vouchercount_s, utils.findvoucherinfo(h1.name) voucherlist_ss, concat_ws('|', fruitsjan,fruitsfeb,fruitsmar,fruitsapr,fruitsmay,fruitsjun,fruitsjul,fruitsaug,fruitssep,fruitsoct,fruitsnov,fruitsdec) fruitingverbatim_ss, concat_ws('|', flowersjan,flowersfeb,flowersmar,flowersapr,flowersmay,flowersjun,flowersjul,flowersaug,flowerssep,flowersoct,flowersnov,flowersdec) floweringverbatim_ss, concat_ws('|', fruitsjan,fruitsfeb,fruitsmar,fruitsapr,fruitsmay,fruitsjun,fruitsjul,fruitsaug,fruitssep,fruitsoct,fruitsnov,fruitsdec) fruiting_ss, concat_ws('|', flowersjan,flowersfeb,flowersmar,flowersapr,flowersmay,flowersjun,flowersjul,flowersaug,flowerssep,flowersoct,flowersnov,flowersdec) flowering_ss, con.provenancetype as provenancetype_s, tn.accessrestrictions as accessrestrictions_s from collectionobjects_common co inner join misc on (co.id = misc.id and misc.lifecyclestate <> 'deleted') left outer join collectionobjects_common_fieldCollectors fc on (co.id = fc.id and fc.pos = 0) left outer join hierarchy hfcdg on (co.id = hfcdg.parentid and hfcdg.name = 'collectionobjects_common:fieldCollectionDateGroup') left outer join structureddategroup sdg on (sdg.id = hfcdg.id) left outer join hierarchy htig on (co.id = htig.parentid and htig.pos = 0 and htig.name = 'collectionobjects_naturalhistory:taxonomicIdentGroupList') left outer join taxonomicIdentGroup tig on (tig.id = htig.id) left outer join hierarchy hlg on (co.id = hlg.parentid and hlg.pos = 0 and hlg.name = 'collectionobjects_naturalhistory:localityGroupList') left outer join localitygroup lg on (lg.id = hlg.id) join hierarchy h1 on co.id=h1.id -- join relations_common r1 on (h1.name=r1.subjectcsid and objectdocumenttype='Movement') -- join hierarchy h2 on (r1.objectcsid=h2.name and h2.isversion is not true) -- join movements_common mc on (mc.id=h2.id and mc.reasonformove = 'Dead') join collectionobjects_naturalhistory con on (co.id = con.id) join collectionobjects_botgarden cob on (co.id=cob.id) -- left outer join hierarchy htig2 -- incorrect for Bot Garden -- on (co.id = htig2.parentid and htig2.pos = 1 and htig2.name = 'collectionobjects_naturalhistory:taxonomicIdentGroupList') -- left outer join taxonomicIdentGroup tig2 on (tig2.id = htig2.id) -- join collectionspace_core core on (core.id=co.id and core.tenantid=35) -- not using any fields from core -- join misc misc2 on (misc2.id = co.id and misc2.lifecyclestate <> 'deleted') -- moved check up to first join to misc left outer join taxon_common tc on (tig.taxon=tc.refname) left outer join taxon_naturalhistory tn on (tc.id=tn.id) where cob.deadflag='true'
true
001ae244ecdf119bf7e9318d9082724cfbd1f759
SQL
myarist/Progate
/Languages/SQL/sql_study_2/page4/exercise2.sql
UTF-8
166
2.703125
3
[ "MIT" ]
permissive
/* dapatkan nilai rata-rata dari kolom price dimana nilai character_name adalah "Ninja Ken" */ SELECT AVG(price) FROM purchases WHERE character_name = "Ninja Ken" ;
true
a289a7fb77b51661982d81aa2dbd6050b091d0f9
SQL
Bettdominic/Test-Project
/DBScript.sql
UTF-8
1,355
3.734375
4
[]
no_license
Create Table tblCustomer( CustomerId int IDENTITY(1,1) NOT NULL, Name Varchar(20) NOT NULL, City Varchar(20) NOT NULL, Country Varchar(20) NOT NULL, Gender Varchar(6) NOT NULL ) Create procedure sp_AddCustomer ( @Name VARCHAR(20), @City VARCHAR(20), @Country VARCHAR(20), @Gender VARCHAR(6) ) as Begin Insert into tblCustomer (Name,City,Country, Gender) Values (@Name,@City,@Country, @Gender) End Create procedure usp_GetAllCustomers as Begin select CustomerId, Name, City, Country, Gender from tblCustomer End Create procedure usp_GetCustomerByID ( @CustomerId int ) as Begin SELECT * FROM tblCustomer WHERE CustomerID= @CustomerId End Create procedure usp_UpdateCustomer ( @CustomerId INTEGER , @Name VARCHAR(20), @City VARCHAR(20), @Country VARCHAR(20), @Gender VARCHAR(6) ) as begin Update tblCustomer set Name=@Name, City=@City, Country=@Country, Gender=@Gender where CustomerId=@CustomerId End Create procedure usp_DeleteCustomer ( @CustomerId int ) as begin Delete from tblCustomer where CustomerId=@CustomerId End
true
394c0b0d569bd141b1ca6913da69918150bdee8f
SQL
kiki128qk/gold
/sql/gold_msg.sql
UTF-8
691
2.75
3
[]
no_license
CREATE TABLE `test`.`gold_msg` (`GOLD_MSG_num` INT(11) NOT NULL AUTO_INCREMENT COMMENT '고유번호' , `GOLD_MSG_name` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '메세지 작성자' , `GOLD_MSG_email` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '작성자 이메일' , `GOLD_MSG_tit` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '메세지 제목' , `GOLD_MSG_con` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '메세지 내용' , `GOLD_MSG_reg` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '작성일자' , PRIMARY KEY (`GOLD_MSG_num`)) ENGINE = InnoDB;
true
ea1b1d163dae448c761425595afb134118eb44e5
SQL
l0uvre/Simple-Codes
/SQL/labs/lab2/lab2.sql
UTF-8
5,441
3.859375
4
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Mon Oct 2 18:35:42 2017 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table Countries -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Countries ( CountryId INT NOT NULL, -- 'identifier for countries' CountryName VARCHAR(45) NOT NULL, -- 'Name for one country, certainly unique.' CONSTRAINT idcountries_UNIQUE UNIQUE (CountryId ASC), CONSTRAINT CountryName_UNIQUE UNIQUE (CountryName ASC), PRIMARY KEY (CountryId) CONSTRAINT check_ctID CHECK (CountryId > 0)) -- 'The identity we make and name of countries all over the world.' ; -- ----------------------------------------------------- -- Table TLAS -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS TLAS ( TLASid INT NOT NULL, -- 'The identifier of one country\'s top level of administrative subdivision' TLASname VARCHAR(45) NOT NULL, -- 'The name of one country\'s top level of administrative subdivision, state, province, autonomous territory, special region for a \nfederal capital, etc.' PRIMARY KEY (TLASid), CONSTRAINT TLASname_UNIQUE UNIQUE (TLASname ASC), CONSTRAINT TLASid_UNIQUE UNIQUE (TLASid ASC), CONSTRAINT check_TLASid CHECK (TLASid > 0)) -- 'The name and identity of Top Level of Administrative Subdivision all over the world.' ; -- ----------------------------------------------------- -- Table Citys -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Citys ( CityId INT NOT NULL, -- 'indentifier for cities all over the world' CityName VARCHAR(45) NOT NULL, -- 'Name for the city.' CONSTRAINT CityId_UNIQUE UNIQUE (CityId ASC), PRIMARY KEY (CityId) CONSTRAINT check_CityId CHECK (CityId > 0)) -- 'The identity and name of citys all over the world.' ; -- ----------------------------------------------------- -- Table TLASforCountry -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS TLASforCountry ( CountryId INT NOT NULL, TLASid INT NOT NULL, PRIMARY KEY (CountryId, TLASid), CONSTRAINT TLASId FOREIGN KEY (TLASid) REFERENCES TLAS (TLASid) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT CountryId FOREIGN KEY (CountryId) REFERENCES Countries (CountryId) ON DELETE NO ACTION ON UPDATE NO ACTION) -- 'The table combines of coutries and its top level of administrative subdivision.' ; -- ----------------------------------------------------- -- Table Capitals -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS Capitals ( CapitalTypeId INT NOT NULL, -- '1 stands for capitals for a country, while \n2 stands for capitals for administrative divisions.' TLASCountryId INT NOT NULL, -- 'the identifier of a country or its administrative subdivisions' CityId INT NOT NULL, -- 'CityId for capitals of administrative subdivisions or countries.' PRIMARY KEY (TLASCountryId, CityId), CONSTRAINT CityId FOREIGN KEY (CityId) REFERENCES Citys (CityId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT TLASid FOREIGN KEY (TLASCountryId) REFERENCES TLASforCountry (TLASid) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT CountryId FOREIGN KEY (TLASCountryId) REFERENCES TLASforCountry (CountryId) ON DELETE NO ACTION ON UPDATE NO ACTION) -- 'The table combines the top level of administrative subdivision and its capital(s) or countries and its capital(s).' ; -- ----------------------------------------------------- -- Table RegionInfo -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS RegionInfo ( RegionType INT NOT NULL, -- 'Value:\n 0 for a country \n 1 for the top level of administrative subdivisions of a contry' CountryIdTLASid INT NOT NULL, -- 'identifier for a country or its top level of administrative subdivision.' Population REAL NOT NULL, Surface REAL NOT NULL, -- 'the region\'s surface area.' LargestCityId INT NOT NULL, PRIMARY KEY (CountryIdTLASid, LargestCityId), CONSTRAINT CountryIdTLASid FOREIGN KEY (CountryIdTLASid) REFERENCES Capitals (TLASCountryId) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT LargestCityId FOREIGN KEY (LargestCityId) REFERENCES Citys (CityId) ON DELETE NO ACTION ON UPDATE NO ACTION) -- 'Much related information (surface, capitials, timezone, population and surface area ) about one country or its top level of administrative subdivision.' ; -- ----------------------------------------------------- -- Table TimeZone -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS TimeZone ( RegionType INT NOT NULL, -- 'Value:\n 0 for a country \n 1 for the top level of administrative subdivisions of a contry' CountryIdTLASid INT NOT NULL, UTCoffset VARCHAR(45) NOT NULL, -- 'Time zone marked with UTC offsets such as UTC+09:00 and UTC+09:00' CONSTRAINT CountryIdTLASid FOREIGN KEY (CountryIdTLASid) REFERENCES Capitals (TLASCountryId) ON DELETE NO ACTION) -- 'Give one id of a top level of administrative subdivision or a country to look up its time zone.' ;
true
5b9eb5c74fea322295412f3f6f5e1c770f2b6bb6
SQL
jw6/ERSystem
/Jay_Wang_Code/SQLAssignments/lab1.sql
UTF-8
5,347
4.09375
4
[]
no_license
--2.1 SELECT --Select all records from the Employee table / SELECT * FROM EMPLOYEE; / --Select all records from the Employee table where last name is King / SELECT * FROM EMPLOYEE WHERE LASTNAME = 'King'; / --Select all records from the Employee table where first name is Andrew and REPORTSTO is null / SELECT * FROM EMPLOYEE WHERE FIRSTNAME = 'Andrew' AND REPORTSTO IS NULL; / --2.2 ORDER BY --Select all albums in Albums table and sort result set in descending order by title / SELECT * FROM ALBUM ORDER BY TITLE DESC; / --Select first name from Customer and sort result set in ascending order by city / SELECT * FROM CUSTOMER ORDER BY CITY ASC; / --2.3 INSERT INTO --Insert two new records into Genre table / INSERT INTO GENRE(GENREID, NAME) VALUES(471, 'Tab genre'); INSERT INTO GENRE(GENREID, NAME) VALUES(472, 'Space genre'); / --Insert two new records into Employee table / INSERT INTO EMPLOYEE(EMPLOYEEID, LASTNAME, FIRSTNAME,TITLE) VALUES(121222, 'Bachman', 'Erlich', 'General Manager'); INSERT INTO EMPLOYEE(EMPLOYEEID, LASTNAME, FIRSTNAME) VALUES(329121,'Hendrick', 'Richard'); / --Insert two new records into Customer table / INSERT INTO CUSTOMER(CUSTOMERID, LASTNAME, FIRSTNAME, EMAIL) VALUES(12321,'Grey', 'Ryan', 'ryan@his.com'); INSERT INTO CUSTOMER(CUSTOMERID, LASTNAME, FIRSTNAME, EMAIL) VALUES(123234,'Rooney', 'Mike', 'mike@rooney.com'); / --2.4 UPDATE --Update Aaron Mitchell in Customer table to Robert Walter / UPDATE CUSTOMER SET FIRSTNAME = 'Robert', LASTNAME = 'Walter' WHERE FIRSTNAME = 'Aaron' AND LASTNAME = 'Mitchell'; / --Update name of artist in the Artist table "Creedence Clearwater Revival" to "CCR" / UPDATE ARTIST SET NAME = 'CCR' WHERE NAME = 'Creedence Clearwater Revival'; / --2.5 Like --Select all invoices with a billing address like "T%" / SELECT * FROM INVOICE WHERE BILLINGADDRESS LIKE 'T%'; / --2.6 Between --Select all invoices that have a total between 15 and 50 / SELECT * FROM INVOICE WHERE (TOTAL BETWEEN 15 AND 50); / --Select all employees hired between 1st of June 2003 and 1st of March 2004 / SELECT * FROM EMPLOYEE WHERE (HIREDATE BETWEEN '01-JUN-03' AND '01-MAR-04'); / --2.7 Delete --Delete a record in Customer table where the name is Robert Walter(There may --be constraints that rely on this, find out how to resolve them). / SELECT * FROM CUSTOMER WHERE CUSTOMERID = (SELECT CUSTOMERID FROM CUSTOMER WHERE FIRSTNAME = 'Robert' AND LASTNAME = 'Walter'); / SELECT * FROM INVOICE WHERE CUSTOMERID = 32; / -- Performing cascade deletion DELETE FROM INVOICELINE WHERE INVOICEID = (SELECT INVOICEID FROM INVOICE WHERE CUSTOMERID = (SELECT CUSTOMERID FROM CUSTOMER WHERE FIRSTNAME = 'Robert' AND LASTNAME = 'Walter')); / DELETE FROM INVOICE WHERE CUSTOMERID = (SELECT CUSTOMERID FROM CUSTOMER WHERE FIRSTNAME = 'Robert' AND LASTNAME = 'Walter'); / DELETE FROM CUSTOMER WHERE FIRSTNAME = 'Robert' AND LASTNAME = 'Walter'; / --3.0 SQL Function --3.1 System Defined Function --Create a function that returns the current time / CREATE OR REPLACE FUNCTION get_current_time return date is l_sysdate date; begin SELECT sysdate INTO l_sysdate FROM dual; RETURN l_sysdate; end; / SELECT get_current_time() FROM dual; / --Create a function taht returns the length of a mediatype from the mediatype table / CREATE OR REPLACE FUNCTION get_length return --3.2 System Defined Aggregate Functions --Create a function that returns the avearge total of all invoices --Create a function that returns the most expensive tracks --3.3 User define scalar function --Create a function that returns the average price of invoiceline items in the invoiceline table --3.4 User defined table valued functions --Create a function that returns all employees who are born after 1968 --4.0 Stored Procedure --4.1 Basic stored procedure --Create stored procedure that selects the first and last names of all the employees --4.2 Store procedure input paramets --Create a stored procedure that updates the personal information of an employee --Create a stored procedure that returns the managers of an employee --4.3 Store procedure output parameters --5.0 Transactions --Create a transaction that givena invoiced will delete that invoice(There may be constraints --that rely on this, find out how to resolve them --6.0 Triggers --6.1 --Create an after insert trigger on the employee table fired after a new record is inserted --into the table --Create an after update trigger on the album table that fires after a row is inserted in the table --Create an after delete trigger on the customer table that fires after a row is deleted from the table --7.0 Joins --7.1 Inner --Create an inner join that joins customers and orders and specifies the name of the customer --and the invoiceid --7.2 Outer --Create an outer join that joins the customer and invoice table, specifying the CustomerId, --firstname, lastname, invoiceId, and table --7.3 Right --Create a right join that joins album and artist specifying artist name and titles --7.4 Cross --Create a cross join that joins album and artist and sorts by artist name in the ascending order --7.5 Self --Perform a self-join on the employee table, joining on the reportsto column --9.0 --make it .bak file
true
86856069e913eeed39280c7114fdb2694af917a8
SQL
andreneves/BDII
/BDIIA07-EXERCICIOS.sql
UTF-8
799
3.5625
4
[]
no_license
-- EXERCICIOS -- 1) Crie o comando que altera a tabela abaixo colocando o campo id como chave primárias CREATE TABLE estudantes ( id INT, nome varchar(255) NOT NULL, cidade varchar(255) NOT NULL ); -- 2) Crie uma tabela contendo os campos abaixo e colocando o campo cpf_responsavel como unique Tabela: escritorios Campos obrigatorios: id, localizacao, nome_responsavel, cpf_responsavel -- 3) Crie o comando que altere a tabela "artigos" fazendo com que sua chave extrangeira faça referência a chave primária da tabela "autores" create table autores ( id int(11) primary key auto_increment, nome varchar(255) not null ); create table artigos ( id int(11) primary key auto_increment, nome varchar(255) not null, valor float not null, autor_id int(11) not null );
true
08bbe39a8f3118e0830154b305dc85ef05b6cb5b
SQL
sterligov/otus_highload
/dating/migrations/20210116152202_create_friends_table.sql
UTF-8
510
3.5625
4
[]
no_license
-- +goose Up -- SQL in this section is executed when the migration is applied. CREATE TABLE IF NOT EXISTS friends ( id INT(11) AUTO_INCREMENT PRIMARY KEY, user_id INT(11) NOT NULL, friend_id INT(11) NOT NULL, UNIQUE (user_id, friend_id), FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE RESTRICT, FOREIGN KEY (friend_id) REFERENCES user(id) ON DELETE RESTRICT ) ENGINE=INNODB; -- +goose Down -- SQL in this section is executed when the migration is rolled back. DROP TABLE friends;
true
0f17c6d7211c5b0279a326dd7bde57583bb8d491
SQL
MrK493/surtidora
/database scripts/Database-script.sql
UTF-8
2,775
4.09375
4
[ "MIT" ]
permissive
CREATE DATABASE IF NOT EXISTS db_surtido_r CHARACTER SET UTF8 COLLATE utf8_unicode_ci; USE db_surtido_r; CREATE TABLE IF NOT EXISTS categories( id_category INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, category_name VARCHAR(100) UNIQUE NOT NULL COMMENT 'Must be UNIQUE to avoid confusion', category_image VARCHAR(255) NULL COMMENT 'If pictures for categories will be used', category_created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ) COMMENT='Table used to store product categories'; CREATE TABLE IF NOT EXISTS regions( id_region INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, region_name VARCHAR(100) UNIQUE NOT NULL COMMENT 'Must be UNIQUE to avoid confusion', region_created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ) COMMENT='Table used to store regions(cities)'; INSERT INTO regions(region_name) VALUES('Ciudad Juárez'); CREATE TABLE IF NOT EXISTS stores( id_store INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, store_name VARCHAR(100) UNIQUE NOT NULL COMMENT 'Must be UNIQUE to avoid confusion', street_address VARCHAR(300) NULL, belongs_to_region INT UNSIGNED NOT NULL COMMENT 'Foreign key to categories table', store_created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT store_belongs_to_region FOREIGN KEY(belongs_to_region) REFERENCES regions(id_region) ON UPDATE CASCADE ON DELETE RESTRICT ) COMMENT='Table used to store distinct stores'; CREATE TABLE IF NOT EXISTS products( id_product INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, code VARCHAR(100) NULL UNIQUE COMMENT 'Manual input', product_name VARCHAR(100), wholesale_price DECIMAL(7,2) NULL, retail_price DECIMAL(7,2) NULL, belongs_to_category INT UNSIGNED NOT NULL COMMENT 'Foreign key to categories table', belongs_to_store INT UNSIGNED NOT NULL COMMENT 'Foreign key to stores table', product_image VARCHAR(100) NULL COMMENT 'If product will need image', is_active BOOLEAN NOT NULL DEFAULT TRUE, CONSTRAINT product_belongs_to_category FOREIGN KEY(belongs_to_category) REFERENCES categories(id_category) ON UPDATE CASCADE ON DELETE RESTRICT, CONSTRAINT product_belongs_to_store FOREIGN KEY(belongs_to_store) REFERENCES stores(id_store) ON UPDATE CASCADE ON DELETE RESTRICT ) COMMENT='Table used to store products'; CREATE TABLE IF NOT EXISTS users( id_user INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, employee_id VARCHAR(100) UNIQUE COMMENT 'Manual input', name VARCHAR(100) NOT NULL, lastname VARCHAR(100), email VARCHAR(100) UNIQUE, nickname VARCHAR(100) UNIQUE NOT NULL, user_created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); /* Roles tables will be added using Entrust Laravel migrations */ /* Jobs tables will be added using Laravel migrations */ /* Necessary tables will be added during developing */
true
ed97ae9c97ebdfab56a600b09d493b2a05240f69
SQL
Jonathanbees/UMProgramacion
/Marzo/Bases de datos/modelo base de datos perrinchis SQL.sql
UTF-8
3,172
3.765625
4
[]
no_license
#Tarea Consulta documentación MySQL /* Funciones y operadores de comparación & = AND > = mayor que >= mayor o igual que Nota: Si no se cumple algún operador, arrojará 0, sino, un 1 Ejemplo: SELECT 3 <= 2; -> 0 < = menor que <= menor o igual que <> Ó != distinto de <=> No es distinto: si ambos operadores son iguales, arroja 1, sino, arrojará 0, en caso de colocar NULL, si uno es distinto del otro, saldrá 0,sino, 1 Ejemplo: SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL; -> 1, 1, 0 = opera como "no es distinto", pero si un valor no es igual al otro, dará 0, si se compara con un NULL, dará un NULL si no son lo mismo SELECT 1 = 1, NULL = NULL, 1 = NULL, 2 = 1 -> 1, NULL, NULL, 0 Caso especial <=> For row comparisons, (a, b) <=> (x, y) is equivalent to: (a <=> x) AND (b <=> y) * expr BETWEEN min AND max If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= max) if all the arguments are of the same type. Example: SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1; -> 1, 0 */ # SELECT COALESCE(NULL,1, 2, 3, 4); Duda Operador # Salta los operadores que están nulos y ejecuta los disponibles, solo mostrando el primer valor(verdaderos) /* Greatest(v1,v2...) Con 2 o más valores agregados a este operador, retorna el más grande Ejemplo: SELECT GREATEST(34.0,3.0,5.0,767.0); -> 767.0 LEAST(v1,v2...) Retornará el valor más pequeño entre un conjunto de valores asignados Ejemplo: SELECT LEAST(34.0,3.0,5.0,767.0); -> 3.0 expresion IN (value1...) Retornará verdadero (1) si entre la lista asignada está el valor que estamos buscando, si no, retornará falso (0) Ejemplo: SELECT 'wefwf' IN ('wee','wefwf','weg'); -> 1 Nota: Con un NOT, es lo mismo, pero en distinto sentido: si no está, sale verdadero, si está, sale falso SELECT 'wefwf' Not IN ('wee','wefwf','weg'); */ /* INTERVAL: es para formar intervalos, es necesario que N1<N2<N3...Nn para que trabaje correctamente, si trabaja correctamente, regresará un 0 SELECT INTERVAL(1, 15, 17, 30, 44, 200); */ /* IS boolean_value Evalua un valor como un valor booleano, donde el valor booleano puede ser: TRUE, FALSE, UNKNOWN Ejemplo: SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN; -> 1, 1, 1 IS NOT boolean_value Evalua un valor booleano pero con el NOT SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN; -> 1, 1, 0 SELECT 1 IS NOT true, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN; 0, 1, 0 */ #Tarea: -- Funciones de texto, -- Funciones de fecha, -- Funciones aritméticas -- Funciones estadísticas -- Funciones con operadores logicos and or between, ... /* ISNULL(expr) Si una expresión es Nula (NULL), regresará 1 (verdadero), sino, falso(0) SELECT ISNULL(1+1); -> 0 SELECT ISNULL(1/0); -> 1 ISNULL() puede ser usado para comprobar cuando hay un valor nulo
true
51dc14b5afab6898b3bfcab7b26667b1cbfad2f7
SQL
SEkomposter/EasyBreezzy
/dbscheme.sql
UTF-8
8,780
3.03125
3
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Tue Jun 19 20:38:10 2018 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema EasyInv -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema EasyInv -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `EasyInv` DEFAULT CHARACTER SET utf8 ; USE `EasyInv` ; -- ----------------------------------------------------- -- Table `EasyInv`.`nodeuser` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`nodeuser` ( `idnodeuser` INT NOT NULL AUTO_INCREMENT, `surname` VARCHAR(45) NOT NULL, `name` VARCHAR(45) NOT NULL, `otchestvo` VARCHAR(45) NOT NULL, PRIMARY KEY (`idnodeuser`), UNIQUE INDEX `idnodeUser_UNIQUE` (`idnodeuser` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`hdd` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`hdd` ( `idhdd` INT NOT NULL, `model` VARCHAR(30) NULL, `capacity` INT NOT NULL, `rpm` INT NULL, `vendor` VARCHAR(30) NULL, PRIMARY KEY (`idhdd`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`memory` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`memory` ( `idmemory` INT NOT NULL, `model` VARCHAR(30) NULL, `memCapacity` INT NOT NULL, `frequency` INT NULL, `type` VARCHAR(10) NOT NULL, `vendor` VARCHAR(30) NULL, PRIMARY KEY (`idmemory`), UNIQUE INDEX `idcpu_UNIQUE` (`idmemory` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`gpu` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`gpu` ( `idgpu` INT NOT NULL, `model` VARCHAR(30) NULL, `frequency` INT NULL, `memCapacity` INT NOT NULL, `memType` VARCHAR(45) NOT NULL, `vendor` VARCHAR(30) NULL, PRIMARY KEY (`idgpu`), UNIQUE INDEX `idcpu_UNIQUE` (`idgpu` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`soft` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`soft` ( `idhostsoft` INT NOT NULL AUTO_INCREMENT, `softname` VARCHAR(45) NOT NULL, `version` VARCHAR(45) NULL, `revision` VARCHAR(45) NULL, `lictype` VARCHAR(45) NULL, `licdateinst` VARCHAR(10) NULL, `licterm` VARCHAR(10) NULL, `idadmin` INT NULL, PRIMARY KEY (`idhostsoft`), UNIQUE INDEX `idhostsoft_UNIQUE` (`idhostsoft` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`cpu` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`cpu` ( `idcpu` INT NOT NULL, `model` VARCHAR(30) NULL, `frequency` INT NOT NULL, `coresNum` INT NOT NULL, `cashe3lvl` INT NULL, `vendor` VARCHAR(30) NULL, PRIMARY KEY (`idcpu`), UNIQUE INDEX `idcpu_UNIQUE` (`idcpu` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`host` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`host` ( `idhost` INT NOT NULL, `regnum` INT NULL, `hostname` VARCHAR(45) NULL, `domainname` VARCHAR(45) NULL, `idmemory` INT NULL, `idHDD` INT NULL, `idGPU` INT NULL, `idhostsoft` INT NOT NULL, `screen` INT NULL, `idcpu` INT NULL, `sn` VARCHAR(25) NULL, `pn` VARCHAR(25) NULL, PRIMARY KEY (`idhost`), UNIQUE INDEX `hosttype_UNIQUE` (`idhost` ASC), INDEX `idHDD_idx` (`idHDD` ASC), INDEX `idmemory_idx` (`idmemory` ASC), INDEX `idGPU_idx` (`idGPU` ASC), UNIQUE INDEX `regnum_UNIQUE` (`regnum` ASC), INDEX `idhostsoft_idx` (`idhostsoft` ASC), INDEX `icpu_idx` (`idcpu` ASC), UNIQUE INDEX `sn_UNIQUE` (`sn` ASC), CONSTRAINT `idHDD` FOREIGN KEY (`idHDD`) REFERENCES `EasyInv`.`hdd` (`idhdd`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `idmemory` FOREIGN KEY (`idmemory`) REFERENCES `EasyInv`.`memory` (`idmemory`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `idGPU` FOREIGN KEY (`idGPU`) REFERENCES `EasyInv`.`gpu` (`idgpu`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `host_regnum` FOREIGN KEY (`regnum`) REFERENCES `EasyInv`.`devices` (`regnum`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `idhostsoft` FOREIGN KEY (`idhostsoft`) REFERENCES `EasyInv`.`soft` (`idhostsoft`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `icpu` FOREIGN KEY (`idcpu`) REFERENCES `EasyInv`.`cpu` (`idcpu`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`node` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`node` ( `idnode` INT NOT NULL, `nodeName` VARCHAR(45) NOT NULL, `idnodeuser` INT NULL, `idhost` INT NULL, `SBE` VARCHAR(30) NULL, `location` VARCHAR(100) NULL, `department` VARCHAR(30) NULL, PRIMARY KEY (`idnode`), UNIQUE INDEX `nodeName_UNIQUE` (`nodeName` ASC), UNIQUE INDEX `idnode_UNIQUE` (`idnode` ASC), INDEX `nodeuser_idx` (`idnodeuser` ASC), UNIQUE INDEX `nodeuser_UNIQUE` (`idnodeuser` ASC), UNIQUE INDEX `nodehost_UNIQUE` (`idhost` ASC), CONSTRAINT `idnodeuser` FOREIGN KEY (`idnodeuser`) REFERENCES `EasyInv`.`nodeuser` (`idnodeuser`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `idhost` FOREIGN KEY (`idhost`) REFERENCES `EasyInv`.`host` (`idhost`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`devices` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`devices` ( `regnum` INT NOT NULL, `invnum` VARCHAR(10) NULL, `devicetype` VARCHAR(30) NULL, `idnode` INT NULL, `state` VARCHAR(45) NULL, `description` VARCHAR(100) NULL, `model` VARCHAR(25) NOT NULL, `vendor` VARCHAR(25) NULL, `sn` VARCHAR(25) NULL, `pn` VARCHAR(25) NULL, PRIMARY KEY (`regnum`), UNIQUE INDEX `idnode_UNIQUE` (`regnum` ASC), UNIQUE INDEX `idmodel_UNIQUE` (`model` ASC), UNIQUE INDEX `sn_UNIQUE` (`sn` ASC), CONSTRAINT `idnode` FOREIGN KEY (`idnode`) REFERENCES `EasyInv`.`node` (`idnode`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`admins` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`admins` ( `idadmin` INT NOT NULL AUTO_INCREMENT, `surname` VARCHAR(45) NOT NULL, `name` VARCHAR(45) NOT NULL, `otchestvo` VARCHAR(45) NOT NULL, `isadmin` TINYINT(1) NULL, `login` VARCHAR(45) NOT NULL, `password` VARCHAR(45) NOT NULL, PRIMARY KEY (`idadmin`), UNIQUE INDEX `idadmin_UNIQUE` (`idadmin` ASC), UNIQUE INDEX `login_UNIQUE` (`login` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `EasyInv`.`transaction` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `EasyInv`.`transaction` ( `idtransaction` INT NOT NULL AUTO_INCREMENT, `regnum` INT NOT NULL, `idnodefrom` INT NOT NULL, `idnodeto` INT NOT NULL, `idadmin` INT NOT NULL, `transactiondate` VARCHAR(10) NULL, `reason` VARCHAR(100) NULL, PRIMARY KEY (`idtransaction`), UNIQUE INDEX `idtransaction_UNIQUE` (`idtransaction` ASC), INDEX `regnum_idx` (`regnum` ASC), INDEX `idnodefrom_idx` (`idnodefrom` ASC), INDEX `idnodeto_idx` (`idnodeto` ASC), INDEX `idadmin_idx` (`idadmin` ASC), CONSTRAINT `trans_regnum` FOREIGN KEY (`regnum`) REFERENCES `EasyInv`.`devices` (`regnum`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `idnodefrom` FOREIGN KEY (`idnodefrom`) REFERENCES `EasyInv`.`node` (`idnode`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `idnodeto` FOREIGN KEY (`idnodeto`) REFERENCES `EasyInv`.`node` (`idnode`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `idadmin` FOREIGN KEY (`idadmin`) REFERENCES `EasyInv`.`admins` (`idadmin`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
678b2d05d364b97c56e3ed9f0f026dda90550743
SQL
ClickHouse/ClickHouse
/tests/queries/0_stateless/02809_prewhere_and_in.sql
UTF-8
1,665
3.375
3
[ "Apache-2.0", "BSL-1.0" ]
permissive
DROP TABLE IF EXISTS t_02809; CREATE TABLE t_02809(a Int64, b Int64, s String) ENGINE=MergeTree order by tuple() AS SELECT number, number%10, toString(arrayMap(i-> cityHash64(i*number), range(50))) FROM numbers(10000); CREATE TABLE t_02809_set(c Int64) ENGINE=Set() AS SELECT * FROM numbers(10); CREATE TABLE t_02809_aux(c Int64) ENGINE=Memory() AS SELECT * FROM numbers(10); SET optimize_move_to_prewhere=1; -- Queries with 'IN' SELECT substring(explain, 1, 13) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE a IN (SELECT * FROM system.one) ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 13) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE a IN (1,2,3) ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 13) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE a IN t_02809_set ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 13) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE a IN t_02809_aux ) WHERE explain LIKE '%WHERE%'; -- Queries with 'NOT IN' SELECT substring(explain, 1, 17) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE b NOT IN (SELECT * FROM system.one) ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 17) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE b NOT IN (1,2,3) ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 17) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE b NOT IN t_02809_set ) WHERE explain LIKE '%WHERE%'; SELECT substring(explain, 1, 17) FROM (EXPLAIN SYNTAX SELECT * FROM t_02809 WHERE b NOT IN t_02809_aux ) WHERE explain LIKE '%WHERE%'; DROP TABLE t_02809; DROP TABLE t_02809_set; DROP TABLE t_02809_aux;
true
ebc6c33766feb6276f6ca2438393ec6e0188b9df
SQL
tecnocat/Scripts
/sql/SQL-Interesting.sql
UTF-8
2,098
3
3
[]
no_license
/** * UPDATE NODE TITLES WITH THEIR REVISIONS TOO */ UPDATE `node_revision`, `node` SET `node_revision`.`title` = CONCAT(`node`.`type`, ' : ', `node_revision`.`title`), `node`.`title` = CONCAT(`node`.`type`, ' : ', `node`.`title`) WHERE `node_revision`.`nid` = `node`.`nid` AND `node`.`type` IN ( 'attraction', 'banner', 'banner_carousel', 'calendar_park', 'faq', 'highlight', 'image', 'park', 'partner', 'service', 'text', 'vacant', 'video' ) AND `node_revision`.`title` NOT LIKE CONCAT(`node`.`type`, '%') AND `node`.`title` NOT LIKE CONCAT(`node`.`type`, '%'); SELECT `node`.`title`, `node`.`type`, `node_revision`.`title` FROM `node` INNER JOIN `node_revision` ON `node_revision`.`nid` = `node`.`nid` WHERE `node`.`type` IN ( 'attraction', 'banner', 'banner_carousel', 'calendar_park', 'faq', 'highlight', 'image', 'park', 'partner', 'service', 'text', 'vacant', 'video' ) AND `node`.`title` LIKE CONCAT(`node`.`type`, '%') OR `node_revision`.`title` LIKE CONCAT(`node`.`type`, '%'); /** * UPDATE THEMES IN PARQUES REUNIDOS WHEN COPY TO ANOTHER PARK */ UPDATE fau_dev.block SET theme = 'FAU_theme' WHERE theme = 'ZOO_theme'; UPDATE fau_dev.block SET theme = 'FAU_mobiletheme' WHERE theme = 'ZOO_mobiletheme'; UPDATE fau_dev.page_manager_handlers SET conf = REPLACE(conf, 'ZOO_theme', 'FAU_theme'); UPDATE fau_dev.page_manager_handlers SET conf = REPLACE(conf, 'ZOO_mobiletheme', 'FAU_mobiletheme'); UPDATE fau_dev.skinr_skins SET theme = 'FAU_theme' WHERE theme = 'ZOO_theme'; UPDATE fau_dev.skinr_skins SET theme = 'FAU_mobiletheme' WHERE theme = 'ZOO_mobiletheme'; INSERT INTO fau_dev.variable ( SELECT REPLACE(NAME, 'ZOO', 'FAU') AS NAME, REPLACE(VALUE, 'ZOO_theme', 'FAU_theme') AS VALUE FROM fau_dev.variable WHERE NAME LIKE '%ZOO_theme%' ); INSERT INTO fau_dev.variable ( SELECT REPLACE(NAME, 'ZOO', 'FAU') AS NAME, REPLACE(VALUE, 'ZOO_mobiletheme', 'FAU_mobiletheme') AS VALUE FROM fau_dev.variable WHERE NAME LIKE '%ZOO_mobiletheme%' ); UPDATE fau_dev.system SET STATUS = 1 WHERE NAME IN ('FAU_theme', 'FAU_mobiletheme') AND TYPE = 'theme';
true
2bbd9279b9f91fb078acb58e567123a77a34d67e
SQL
geert-timmermans/sql
/sql basic exercises/commands.sql
UTF-8
1,683
3.96875
4
[]
no_license
/* assignment: */ /* https://github.com/becodeorg/GNK-Holberton-1.9/tree/master/3-De-berg/06-SQL/sql-exo */ /* Displays all data. */ SELECT * FROM students JOIN school ON students.school = school.idschool; /* Shows only first names. */ SELECT prenom FROM students; /* Shows the names, birth dates and school of each. */ SELECT students.nom, students.datenaissance, school.school FROM students JOIN school ON students.school = school.idschool; /* Shows only students who are female. */ SELECT * FROM students JOIN school ON students.school = school.idschool WHERE genre = 'f'; /* Shows only students who are part of Andy School. */ SELECT * FROM students JOIN school ON students.school = school.idschool WHERE school.school = 'Charleroi'; /* Shows only the first names of the students, in reverse order to the alphabet (ESCR). Then the same thing but limiting the results to 2. */ SELECT prenom FROM students ORDER BY prenom DESC; SELECT prenom FROM students ORDER BY prenom DESC LIMIT 2; /* Add Ginette Dalor, born 01/01/1930 and assign her to Central, still in SQL. */ INSERT INTO students(nom, prenom, datenaissance, genre, school) VALUES('Dalor', 'Ginette', '1930-01-01', 'F', 1); /* Modify Ginette (always in SQL) and change his sex and his name in "Omer". */ UPDATE students SET prenom = 'Omer', genre = 'M' WHERE idstudent = 32; /* Delete the person whose ID is 3. */ DELETE FROM students WHERE idstudent = 3; /* Change the contents of the School column so that "1" is replaced by "Central" and "2" is replaced by "Anderlecht". (pay attention to the type of the column!) */ UPDATE students, school SET students.school = school.school WHERE students.school = school.idschool;
true
96b40affd255ab2186d2259b8e83c1f5ea374712
SQL
mnbv09870987/Pdd
/share/migrations/PostgreSQL/deploy/1/001-auto.sql
UTF-8
595
3.15625
3
[]
no_license
-- -- Created by SQL::Translator::Producer::PostgreSQL -- Created on Sat Jan 18 10:26:13 2020 -- ; -- -- Table: answers -- CREATE TABLE "answers" ( "id" serial NOT NULL, "ticket" integer NOT NULL, "question" integer NOT NULL, "answer" integer NOT NULL, "student_id" integer NOT NULL, "time" integer DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); ; -- -- Table: students -- CREATE TABLE "students" ( "id" serial NOT NULL, "surname" text NOT NULL, "name" text, "middle_name" text, "age" integer, PRIMARY KEY ("id"), CONSTRAINT "students_surname" UNIQUE ("surname") ); ;
true
5c12cbeedb122d7656caed3d5443629fefd50ad0
SQL
s-nao/jupyter_lab_docker
/containers/mysql/init/1_create_db.sql
UTF-8
550
3.125
3
[]
no_license
-- データベースを作成 CREATE DATABASE IF NOT EXISTS jupyter_local DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE DATABASE IF NOT EXISTS world DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; -- データベースアクセスユーザーの作成 CREATE USER 'username'@'%' IDENTIFIED BY 'password'; -- データベースアクセスユーザーの権限を設定 GRANT ALL PRIVILEGES ON jupyter_local.* TO 'username'@'%'; GRANT ALL PRIVILEGES ON world.* TO 'username'@'%'; -- 権限を反映 FLUSH PRIVILEGES;
true
4684e58e4f8d8aac2dcb55ab09c00f586ce9f8ef
SQL
pactechteam/vaultreporter
/working.sql
UTF-8
9,285
2.921875
3
[]
no_license
-- CREATE TABLE users ( -- users_id serial PRIMARY KEY, -- users_username VARCHAR (255) UNIQUE NOT NULL, -- users_email VARCHAR(255) UNIQUE NOT NULL, -- users_emailvalidated BOOLEAN, -- users_storedhash VARCHAR(255) NOT NULL, -- users_role VARCHAR(255) NOT NULL, -- users_category VARCHAR(255) -- ); -- DROP TABLE users; -- CREATE TABLE users ( -- users_id serial PRIMARY KEY, -- users_username VARCHAR (255) UNIQUE NOT NULL, -- users_storedhash VARCHAR(255) NOT NULL -- ); --PACCENTER --from excel -- { -- 'Voter ID': '10266001', -- Last: 'AAKHUS', -- First: 'DOUGLAS', -- M: 'L', -- Suffix: '', -- 'Street #': '635', -- Street: 'E TIGER AVE', -- 'Unit #': '', -- 'Add. 2': '', -- 'Add. 3': '', -- City: 'POST FALLS', -- 'St.': 'ID', -- Zip: '83854', -- 'Zip+': '6647', -- 'M. Street #': '635', -- 'M. Street': 'E TIGER AVE', -- 'M. Unit': '', -- 'M. Add. 2': '', -- 'M. Add. 3': '', -- 'M. City': 'POST FALLS', -- 'M. St.': 'ID', -- 'M. Zip': '83854', -- 'M. Zip+': '6647', -- 'M.Country': '', -- Gender: 'M', -- '': '57', -- 'Curr.Reg.Date': '11/2/2010', -- Phone: '2084570694', -- 'L.D.': '3', -- 'Affil.': 'Unaffiliated', -- 'Pct.': '8', -- 'Election Date': '11/6/2012', -- 'Election ': '2012 GENERAL', -- 'Voted/NotVoted': 'VOTED' -- } -- create table kcdatadump2( -- id serial PRIMARY KEY, -- voterid integer,-- row["Voter ID"], -- last varchar(255),-- row["Last"], -- first varchar(255),-- row["First"], -- m varchar(100),-- row["M"], -- suffic varchar(100),-- row["Suffix"], -- streetnum varchar(255),-- row["Street #"], -- street varchar(255),-- row["Street"], -- unitnum VARCHAR(255),-- row["Unit #"], -- add_2 VARCHAR(255),-- row["Add. 2"], -- add_3 VARCHAR(255),-- row["Add. 3"], -- City VARCHAR(255),-- row["City"], -- zip VARCHAR(255),-- row["Zip"], -- st VARCHAR(255),-- row["St."], -- zipplus VARCHAR(255),-- row["Zip+"], -- mstreetnum VARCHAR(255),-- row["M. Street #"], -- mstreet VARCHAR(255),-- row["M. Street"], -- munit VARCHAR(255),-- row["M. Unit"], -- madd_2 VARCHAR(255),-- row["M. Add. 2"], -- madd_3 VARCHAR(255),-- row["M. Add. 3"], -- mcity VARCHAR(255),-- row["M. City"], -- mst VARCHAR(255),-- row["M. St."], -- mzip VARCHAR(255),-- row["M. Zip"], -- mziplus VARCHAR(255),-- row["M. Zip+"], -- mcountry VARCHAR(255),-- row["M.Country"], -- gender VARCHAR(255),-- row["Gender"], -- age VARCHAR(255),-- row[""], -- currregdate VARCHAR(255),-- row["Curr.Reg.Date"], -- phone VARCHAR(255),-- row["Phone"], -- ld VARCHAR(255),-- row["L.D."], -- affil VARCHAR(255),-- row["Affil."], -- pct VARCHAR(255),-- row["Pct."], -- electiondate VARCHAR(255),-- row["Election Date"], -- election VARCHAR(255),-- row["Election "], -- votednotvoted VARCHAR(255),-- row["Voted/NotVoted"], -- geog geography(POINT),-- geoString, -- bingdump jsonb,-- JSON.stringify(blob), -- csvdump jsonb-- JSON.stringify(row), -- ); -- create table kcdatadump3( -- id serial PRIMARY KEY, -- voterid integer,-- row["Voter ID"], -- last varchar(255),-- row["Last"], -- first varchar(255),-- row["First"], -- m varchar(100),-- row["M"], -- suffic varchar(100),-- row["Suffix"], -- streetnum varchar(255),-- row["Street #"], -- street varchar(255),-- row["Street"], -- unitnum VARCHAR(255),-- row["Unit #"], -- add_2 VARCHAR(255),-- row["Add. 2"], -- add_3 VARCHAR(255),-- row["Add. 3"], -- City VARCHAR(255),-- row["City"], -- zip VARCHAR(255),-- row["Zip"], -- st VARCHAR(255),-- row["St."], -- zipplus VARCHAR(255),-- row["Zip+"], -- mstreetnum VARCHAR(255),-- row["M. Street #"], -- mstreet VARCHAR(255),-- row["M. Street"], -- munit VARCHAR(255),-- row["M. Unit"], -- madd_2 VARCHAR(255),-- row["M. Add. 2"], -- madd_3 VARCHAR(255),-- row["M. Add. 3"], -- mcity VARCHAR(255),-- row["M. City"], -- mst VARCHAR(255),-- row["M. St."], -- mzip VARCHAR(255),-- row["M. Zip"], -- mziplus VARCHAR(255),-- row["M. Zip+"], -- mcountry VARCHAR(255),-- row["M.Country"], -- gender VARCHAR(255),-- row["Gender"], -- age VARCHAR(255),-- row[""], -- currregdate VARCHAR(255),-- row["Curr.Reg.Date"], -- phone VARCHAR(255),-- row["Phone"], -- ld VARCHAR(255),-- row["L.D."], -- affil VARCHAR(255),-- row["Affil."], -- pct VARCHAR(255),-- row["Pct."], -- electiondate VARCHAR(255),-- row["Election Date"], -- election VARCHAR(255),-- row["Election "], -- votednotvoted VARCHAR(255),-- row["Voted/NotVoted"], -- geog geography(POINT),-- geoString, -- bingdump jsonb,-- JSON.stringify(blob), -- csvdump jsonb-- JSON.stringify(row), -- ); -- csvdump jsonb -- ); -- CREATE TABLE walkingLists -- ( -- id serial PRIMARY KEY, -- name VARCHAR (255) UNIQUE NOT NULL, -- created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), -- nextVisit NUMERIC (5, 2) -- ); -- CREATE TABLE visits -- ( -- walkinglistid integer REFERENCES walkinglists(id) ON UPDATE CASCADE ON DELETE CASCADE, -- pointid integer REFERENCES kcdatadump2(id) ON UPDATE CASCADE ON DELETE CASCADE, -- number NUMERIC (5, 2), -- CONSTRAINT visit_pkey PRIMARY KEY (walkinglistid,pointid) -- ); create table volunteerSignup( uuid uuid DEFAULT uuid_generate_v4 (), last varchar(255), first varchar(255), street varchar(255), City VARCHAR(255), State VARCHAR(255), zip VARCHAR(255), phone VARCHAR(255), email VARCHAR(255), willingToServeAsCandiate BOOLEAN, geog geography(POINT), googleDump jsonb, singupDate TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (uuid) ) -- CREATE TABLE KCADDRESSES AS -- SELECT -- DISTINCT ON (geog) geog, -- id, -- streetnum , -- street, -- unitnum, -- add_2, -- add_3, -- City, -- zip, -- st, -- zipplus, -- bingdump -- FROM kcdatadump2; -- create table kcdatadump3( -- id serial PRIMARY KEY, -- voterid integer,-- row["Voter ID"], -- last varchar(255),-- row["Last"], -- first varchar(255),-- row["First"], -- m varchar(100),-- row["M"], -- suffic varchar(100),-- row["Suffix"], -- streetnum varchar(255),-- row["Street #"], -- street varchar(255),-- row["Street"], -- unitnum VARCHAR(255),-- row["Unit #"], -- add_2 VARCHAR(255),-- row["Add. 2"], -- add_3 VARCHAR(255),-- row["Add. 3"], -- City VARCHAR(255),-- row["City"], -- zip VARCHAR(255),-- row["Zip"], -- st VARCHAR(255),-- row["St."], -- zipplus VARCHAR(255),-- row["Zip+"], -- mstreetnum VARCHAR(255),-- row["M. Street #"], -- mstreet VARCHAR(255),-- row["M. Street"], -- munit VARCHAR(255),-- row["M. Unit"], -- madd_2 VARCHAR(255),-- row["M. Add. 2"], -- madd_3 VARCHAR(255),-- row["M. Add. 3"], -- mcity VARCHAR(255),-- row["M. City"], -- mst VARCHAR(255),-- row["M. St."], -- mzip VARCHAR(255),-- row["M. Zip"], -- mziplus VARCHAR(255),-- row["M. Zip+"], -- mcountry VARCHAR(255),-- row["M.Country"], -- gender VARCHAR(255),-- row["Gender"], -- age VARCHAR(255),-- row[""], -- currregdate VARCHAR(255),-- row["Curr.Reg.Date"], -- phone VARCHAR(255),-- row["Phone"], -- ld VARCHAR(255),-- row["L.D."], -- affil VARCHAR(255),-- row["Affil."], -- pct VARCHAR(255),-- row["Pct."], -- electiondate VARCHAR(255),-- row["Election Date"], -- election VARCHAR(255),-- row["Election "], -- votednotvoted VARCHAR(255),-- row["Voted/NotVoted"], -- geog geography(POINT),-- geoString, -- bingdump jsonb,-- JSON.stringify(blob), -- csvdump jsonb-- JSON.stringify(row), -- ); ALTER TABLE bcvoterregmarch21 add column uid uuid NOT NULL DEFAULT uuid_generate_v1(); --https://stackoverflow.com/questions/9789736/how-to-implement-a-many-to-many-relationship-in-postgresql create table relationships( relationships_uid uuid DEFAULT uuid_generate_v1 (), parent uuid, child uuid, PRIMARY KEY (uuid) ) create table points( relationships_uid uuid DEFAULT uuid_generate_v1(), geog geography(POINT), apidump jsonb, PRIMARY KEY (uuid) ) --had to do some slight modifications to created tables, see above for current version (as of May 29 7:11 am 2021) ALTER TABLE relationships RENAME COLUMN uuid TO uid; --show on map all the voters select * from bcvoterregmarch21 FULL JOIN relationships ON bcvoterregmarch21.bcvoterregmarch21_uid= relationships.parent FULL JOIN points ON relationships.child = points.points_uid ORDER BY "VoterID"; create table visits( visits_uid uuid DEFAULT uuid_generate_v1(), voter_uid uuid NOT NULL, survey_uid uuid NOT NULL, notes jsonb, UNIQUE (voter_uid,survey_uid), PRIMARY KEY (visits_uid) ) create table surveys( survey_uid uuid DEFAULT uuid_generate_v1(), created_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP, name VARCHAR UNIQUE NOT NULL, data jsonb, PRIMARY KEY (survey_uid) ) --show all visis of a given survey select * from visits FULL JOIN relationships ON voter_uid= relationships.parent FULL JOIN points ON relationships.child = points.points_uid WHERE survey_uid = "bb8ed562-c269-11eb-bb4d-0ec9ee39a1c1";
true
96192b01012e8389f382e2beb0cbd23b27c62909
SQL
rayailieva/Database-Basics---MySQL
/08.Exams/exam/p13.ExtractTjeShortestJourney.sql
UTF-8
289
3.71875
4
[]
no_license
SELECT j.id, p.name AS 'planet_name', s.name AS 'spaceport_name', j.purpose AS 'journey_purpose' FROM journeys AS j JOIN spaceports AS s ON j.destination_spaceport_id = s.id JOIN planets AS p ON s.planet_id = p.id ORDER BY DATEDIFF(j.journey_end, j.journey_start) LIMIT 1;
true
95b5e93f03d75922c251506716cdc46b2ca2b259
SQL
Omer5284/data_analyst_case
/analysis/workfile 1.sql
UTF-8
8,250
3.59375
4
[]
no_license
---Revenue per country, chanel------ SELECT b.country_name, b.region, b.sub_region , marketing_channel_id, SUM(net_revenue) FROM subscriptions a LEFT JOIN countries b ON a.signup_country_code=b.country_code WHERE subscription_date BETWEEN '2016-10-01' AND '2017-03-31' AND is_paid_channel IS true GROUP BY 1,2,3,4; -------------subscription_count distribtuion per platform SELECT signup_platform, subscription_count, COUNT(*) FROM subscriptions WHERE subscription_date BETWEEN '2016-10-01' AND '2017-03-31' AND is_paid_channel IS true GROUP BY 1,2; --------------spendings per country, chanel------ SELECT b.country_name, b.region, b.sub_region , marketing_channel_id, SUM(spendings) FROM spendings a LEFT JOIN countries b ON a.country_code=b.country_code WHERE is_paid_channel IS true AND report_date BETWEEN '2016-10-01' AND '2017-03-31' AND platform IN('ios', 'android') GROUP BY 1,2,3,4; -----------------subscription per region SELECT signup_platform, sub_region, SUM(net_revenue) FROM subscriptions a LEFT JOIN countries b ON a.signup_country_code=b.country_code WHERE is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' AND signup_platform IN('ios', 'android') GROUP BY 1,2; ------------subscription count per platfrom SELECT signup_platform, CASE WHEN subscription_count < 10 THEN CAST(subscription_count AS VARCHAR) WHEN subscription_count BETWEEN 10 AND 15 THEN '10-15' WHEN subscription_count BETWEEN 16 AND 20 THEN '16-20' WHEN subscription_count BETWEEN 21 AND 30 THEN '21-30' WHEN subscription_count BETWEEN 31 AND 40 THEN '31-40' WHEN subscription_count >= 40 THEN '40+' END AS subscription_count, COUNT(*) FROM subscriptions WHERE is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' AND signup_platform IN('ios', 'android') GROUP BY 1,2; ------------------paying user count per platfrom SELECT DISTINCT signup_platform, CASE WHEN net_revenue>0 THEN '1' ELSE '0' END AS is_pay, COUNT(*) FROM subscriptions WHERE signup_platform IN('ios', 'android') AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' GROUP BY 1,2; --------------Revnue distribtion per platfrom SELECT DISTINCT signup_platform, PERCENTILE_DISC ( 0.1 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_1, PERCENTILE_DISC ( 0.2 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_2, PERCENTILE_DISC ( 0.3 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_3, PERCENTILE_DISC ( 0.4 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_4, PERCENTILE_DISC ( 0.5 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_5, PERCENTILE_DISC ( 0.6 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_6, PERCENTILE_DISC ( 0.7 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_7, PERCENTILE_DISC ( 0.8 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_8, PERCENTILE_DISC ( 0.9 ) WITHIN GROUP ( ORDER BY net_revenue ) AS p_9, AVG(net_revenue) FROM subscriptions WHERE net_revenue>0 AND is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' GROUP BY 1; --------num. of acquisitions per platfrom SELECT signup_platform, COUNT(*) FROM subscriptions WHERE subscription_date BETWEEN '2016-10-01' AND '2017-03-31' GROUP BY 1 ; -----------Rev and spending per chanel per country per platfrom per month SELECT b.country_name, b.region, platform, b.sub_region , c.marketing_channel_id, SUM(net_revenue) AS revenue, SUM( spendings) AS spendings FROM ( SELECT signup_country_code, marketing_channel_id, signup_platform, EXTRACT(MONTH FROM report_date) AS MonthOfDate, SUM(net_revenue) AS net_revenue FROM subscriptions WHERE is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' GROUP BY 1,2,3) a LEFT JOIN countries b ON a.signup_country_code=b.country_code LEFT JOIN ( SELECT country_code, marketing_channel_id, platform, SUM(spendings) AS spendings FROM spendings WHERE is_paid_channel IS true AND report_date BETWEEN '2016-10-01' AND '2017-03-31' GROUP BY 1,2,3)c ON a.signup_country_code=c.country_code AND a.marketing_channel_id=c.marketing_channel_id AND a.signup_platform=c.platform WHERE c.marketing_channel_id IN (2,3,4,6,18) AND country_name IN('Germany', 'Canada', 'France', 'United Kingdom of Great Britain and Northern Ireland', 'Mexico', 'Spain', 'Argentina', 'United States of America', 'Chile' , 'Australia', 'Switzerland') GROUP BY 1,2,3,4,5; -----------% conversions per country SELECT b.country_name, c.MonthOfDate, b.region, signup_platform, b.sub_region , c.marketing_channel_id, net_revenue, spendings FROM ( SELECT signup_country_code, marketing_channel_id, signup_platform, EXTRACT(MONTH FROM subscription_date) AS MonthOfDate, SUM(net_revenue) AS net_revenue FROM subscriptions WHERE is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-01-31' GROUP BY 1,2,3,4) a LEFT JOIN countries b ON a.signup_country_code=b.country_code LEFT JOIN ( SELECT country_code, marketing_channel_id, platform, EXTRACT(MONTH FROM report_date) AS MonthOfDate, SUM(spendings) AS spendings FROM spendings WHERE is_paid_channel IS true AND report_date BETWEEN '2016-10-01' AND '2017-01-31' GROUP BY 1,2,3,4)c ON a.signup_country_code=c.country_code AND a.marketing_channel_id=c.marketing_channel_id AND a.signup_platform=c.platform AND a.MonthOfDate=c.MonthOfDate WHERE country_name IN('Germany', 'Canada', 'France', 'United Kingdom of Great Britain and Northern Ireland', 'Mexico', 'Spain', 'Argentina', 'United States of America', 'Chile' , 'Australia', 'Switzerland') ; ------------------- ------------subscription count per country SELECT country_name, CASE WHEN subscription_count < 10 THEN CAST(subscription_count AS VARCHAR) WHEN subscription_count BETWEEN 10 AND 15 THEN '10-15' WHEN subscription_count BETWEEN 16 AND 20 THEN '16-20' WHEN subscription_count BETWEEN 21 AND 30 THEN '21-30' WHEN subscription_count BETWEEN 31 AND 40 THEN '31-40' WHEN subscription_count >= 40 THEN '40+' END AS subscription_count, COUNT(*) FROM dwh.subscriptions a JOIN dwh.countries b ON a.signup_country_code=b.country_code WHERE is_paid_channel IS true AND subscription_date BETWEEN '2016-10-01' AND '2017-03-31' AND signup_platform IN('ios', 'android') AND country_name IN('Germany', 'Canada', 'France', 'United Kingdom of Great Britain and Northern Ireland', 'Mexico', 'Spain', 'Argentina', 'United States of America', 'Chile' , 'Australia', 'Switzerland') GROUP BY 1,2;
true
69d34d184ea531277ecadc724b1c95c87302a3d0
SQL
mbilasco/projet-technique-takeaphoto
/bdd/script_creation.sql
UTF-8
2,227
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.1.9 -- http://www.phpmyadmin.net -- -- Généré le : Ven 27 Février 2015 à 16:39 -- Version du serveur : 5.1.73-2+squeeze+build1+1-log -- Version de PHP : 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 */; -- -- Base de données : `takeaphotoforme` -- -- -------------------------------------------------------- -- -- Structure de la table `takeaphotoforme_demandes` -- CREATE TABLE IF NOT EXISTS `takeaphotoforme_demandes` ( `id_demande` int(11) NOT NULL AUTO_INCREMENT, `id_user` varchar(255) NOT NULL, `longitude` varchar(255) NOT NULL, `latitude` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, `etat` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id_demande`), KEY `id_user` (`id_user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=178 ; -- -------------------------------------------------------- -- -- Structure de la table `takeaphotoforme_reponses` -- CREATE TABLE IF NOT EXISTS `takeaphotoforme_reponses` ( `id_reponse` int(11) NOT NULL AUTO_INCREMENT, `url` varchar(255) NOT NULL, `id_demande` int(11) NOT NULL, PRIMARY KEY (`id_reponse`), KEY `id_demande` (`id_demande`), KEY `id_demande_2` (`id_demande`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=65 ; -- -------------------------------------------------------- -- -- Structure de la table `takeaphotoforme_users` -- CREATE TABLE IF NOT EXISTS `takeaphotoforme_users` ( `id_user` int(11) NOT NULL AUTO_INCREMENT, `login` varchar(40) NOT NULL, `password` text NOT NULL, `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id_user`), UNIQUE KEY `login` (`login`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ; /*!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 */;
true
ec87892f1310265c018391af353dba779fe31e38
SQL
Ramya1402/DBMS-Lab
/Program 9 = Movie Database/Prog9.sql
UTF-8
3,713
3.59375
4
[]
no_license
CREATE DATABASE MOVIE; USE MOVIE; CREATE TABLE ACTOR ( ACT_ID INT, ACT_NAME VARCHAR (20), ACT_GENDER CHAR (1), PRIMARY KEY (ACT_ID)); DESC ACTOR; CREATE TABLE DIRECTOR ( DIR_ID INT, DIR_NAME VARCHAR (20), DIR_PHONE REAL, PRIMARY KEY (DIR_ID)); DESC DIRECTOR; CREATE TABLE MOVIES ( MOV_ID INT, MOV_TITLE VARCHAR (25), MOV_YEAR INT, MOV_LANG VARCHAR (12), DIR_ID INT, PRIMARY KEY (MOV_ID), FOREIGN KEY (DIR_ID) REFERENCES DIRECTOR (DIR_ID)); DESC MOVIES; CREATE TABLE MOVIE_CAST ( ACT_ID INT, MOV_ID INT, ROLE VARCHAR (10), PRIMARY KEY (ACT_ID, MOV_ID), FOREIGN KEY (ACT_ID) REFERENCES ACTOR (ACT_ID), FOREIGN KEY (MOV_ID) REFERENCES MOVIES (MOV_ID)); DESC MOVIE_CAST; CREATE TABLE RATING ( MOV_ID INT, REV_STARS VARCHAR (25), PRIMARY KEY (MOV_ID), FOREIGN KEY (MOV_ID) REFERENCES MOVIES (MOV_ID)); DESC RATING; INSERT INTO ACTOR VALUES (301,'ANTHONY PERKINS','M'); INSERT INTO ACTOR VALUES (302,'SAOIRSE RONAN','F'); INSERT INTO ACTOR VALUES (303,'UMA THURMAN','F'); INSERT INTO ACTOR VALUES (304,'LEONARDO DICAPRIO','M'); INSERT INTO ACTOR VALUES (305,'VIDYA BALAN','F'); INSERT INTO ACTOR VALUES (306,'NAWAZUDDIN SIDDIQUI','M'); COMMIT; SELECT * FROM ACTOR; INSERT INTO DIRECTOR VALUES (60,'GRETA GERWIG', 8751611001); INSERT INTO DIRECTOR VALUES (61,'HITCHCOCK', 7766138911); INSERT INTO DIRECTOR VALUES (62,'STEVEN SPIELBERG', 9986776531); INSERT INTO DIRECTOR VALUES (63,'QUENTIN TARANTINO', 8989776530); INSERT INTO DIRECTOR VALUES (64,'SUJOY GHOSH', 9783335281); COMMIT; SELECT * FROM DIRECTOR; INSERT INTO MOVIES VALUES (1001,'LITTLE WOMEN',2019,'ENGLISH',60); INSERT INTO MOVIES VALUES (1002,'KAHAANI',2012,'HINDI',64); INSERT INTO MOVIES VALUES (1003,'KILL BILL : VOL.1',2003,'ENGLISH',63); INSERT INTO MOVIES VALUES (1004,'PSYCHO',1960,'ENGLISH',61); INSERT INTO MOVIES VALUES (1005,'CATCH ME IF YOU CAN',2002,'ENGLISH',62); INSERT INTO MOVIES VALUES (1006,'ONCE UPON A TIME IN HOLLYWOOD',2019,'ENGLISH',63); INSERT INTO MOVIES VALUES (1007,'KAHAANI 2: DURGA RANI SINGH',2016,'HINDI',64); COMMIT; SELECT * FROM MOVIES; INSERT INTO MOVIE_CAST VALUES (301,1004,'HERO'); INSERT INTO MOVIE_CAST VALUES (302,1001,'HEROINE'); INSERT INTO MOVIE_CAST VALUES (303,1003,'HEROINE'); INSERT INTO MOVIE_CAST VALUES (304,1005,'HERO'); INSERT INTO MOVIE_CAST VALUES (305,1002,'HEROINE'); INSERT INTO MOVIE_CAST VALUES (306,1002,'HERO'); INSERT INTO MOVIE_CAST VALUES (304,1006,'HERO'); INSERT INTO MOVIE_CAST VALUES (305,1007,'HEROINE'); COMMIT; SELECT * FROM MOVIE_CAST; INSERT INTO RATING VALUES (1001, 4); INSERT INTO RATING VALUES (1002, 4); INSERT INTO RATING VALUES (1003, 3); INSERT INTO RATING VALUES (1004, 5); INSERT INTO RATING VALUES (1005, 4); INSERT INTO RATING VALUES (1006, 4); INSERT INTO RATING VALUES (1007, 3); COMMIT; SELECT * FROM RATING; SELECT MOV_TITLE FROM MOVIES WHERE DIR_ID IN (SELECT DIR_ID FROM DIRECTOR WHERE DIR_NAME = 'HITCHCOCK'); SELECT MOV_TITLE FROM MOVIES M, MOVIE_CAST MV WHERE M.MOV_ID=MV.MOV_ID AND ACT_ID IN (SELECT ACT_ID FROM MOVIE_CAST GROUP BY ACT_ID HAVING COUNT(ACT_ID)>=1) GROUP BY MOV_TITLE HAVING COUNT(*)>1; SELECT ACT_NAME, MOV_TITLE, MOV_YEAR FROM ACTOR A JOIN MOVIE_CAST C ON A.ACT_ID=C.ACT_ID JOIN MOVIES M ON C.MOV_ID=M.MOV_ID WHERE M.MOV_YEAR NOT BETWEEN 2000 AND 2015; SELECT MOV_TITLE, MAX(REV_STARS) FROM MOVIES INNER JOIN RATING USING (MOV_ID) GROUP BY MOV_TITLE HAVING MAX(REV_STARS)>0 ORDER BY MOV_TITLE; SET SQL_SAFE_UPDATES = 0; UPDATE RATING SET REV_STARS=5 WHERE MOV_ID IN (SELECT MOV_ID FROM MOVIES WHERE DIR_ID IN (SELECT DIR_ID FROM DIRECTOR WHERE DIR_NAME = 'STEVEN SPIELBERG')); SELECT * FROM RATING; SET SQL_SAFE_UPDATES = 1;
true
af19398cf562983fae0f8c08f970461f598d3de4
SQL
enzopanebianco/senai-backend-senatur-
/01_CRIACAO_BD.sql
UTF-8
449
2.640625
3
[]
no_license
create database Senatour_Tarde create table Pacotes( ID int identity primary key ,NomePacote varchar(255) not null ,Descricao varchar(255) ,DataIda datetime not null ,DataVolta datetime not null ,Valor decimal(10,2) not null ,Ativo int not null ,Cidade varchar(255) not null ); create table Usuarios( ID int identity primary key ,Email varchar(255) not null unique ,Senha varchar(255) not null ,Tipo_Usuario varchar(255) not null );
true
e51a758e613cb42410c66b2fc3e23b46017c41b8
SQL
2ASIX2018/Instaweb
/instaweb/bd/Instaweb.sql
UTF-8
1,538
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 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 */; -- -- Base de dades: `Instaweb` -- -- -------------------------------------------------------- -- -- Estructura de la taula `Usuarios` -- CREATE TABLE `Usuarios` ( `id_usuari` int(11) NOT NULL, `nombre` varchar(64) DEFAULT NULL, `email` varchar(48) DEFAULT NULL, `password` varchar(64) DEFAULT NULL, `rol` varchar(16) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Bolcant dades de la taula `Usuarios` -- INSERT INTO `Usuarios` (`id_usuari`, `nombre`, `email`, `password`, `rol`) VALUES (1, 'admin', 'admin@instaweb.com', '1234', 'admin'); -- -- Indexos per taules bolcades -- -- -- Index de la taula `Usuarios` -- ALTER TABLE `Usuarios` ADD PRIMARY KEY (`id_usuari`); -- -- AUTO_INCREMENT per les taules bolcades -- -- -- AUTO_INCREMENT per la taula `Usuarios` -- ALTER TABLE `Usuarios` MODIFY `id_usuari` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- Restriccions per taules bolcades -- /*!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 */;
true
0530388453af3de3c68ed9c1a6e36dbe6d572e37
SQL
Phixia/PTA-Basic-Database
/Natures.sql
UTF-8
2,155
2.71875
3
[]
no_license
DROP TABLE IF EXISTS "Natures"; CREATE TABLE Natures (NatureID INTEGER PRIMARY KEY, Name TEXT, StatUp TEXT, StatDown TEXT); INSERT INTO "Natures" VALUES(1,'Cuddly','HP','Atk'); INSERT INTO "Natures" VALUES(2,'Distracted','HP','Def'); INSERT INTO "Natures" VALUES(3,'Proud','HP','SpAtk'); INSERT INTO "Natures" VALUES(4,'Decisive','HP','SpDef'); INSERT INTO "Natures" VALUES(5,'Patient','HP','Speed'); INSERT INTO "Natures" VALUES(6,'Desperate','Atk','HP'); INSERT INTO "Natures" VALUES(7,'Lonely','Atk','Def'); INSERT INTO "Natures" VALUES(8,'Adamant','Atk','SpAtk'); INSERT INTO "Natures" VALUES(9,'Naughty','Atk','SpDef'); INSERT INTO "Natures" VALUES(10,'Brave','Atk','Speed'); INSERT INTO "Natures" VALUES(11,'Stark','Def','HP'); INSERT INTO "Natures" VALUES(12,'Bold','Def','Atk'); INSERT INTO "Natures" VALUES(13,'Impish','Def','SpAtk'); INSERT INTO "Natures" VALUES(14,'Lax','Def','SpDef'); INSERT INTO "Natures" VALUES(15,'Relaxed','Def','Speed'); INSERT INTO "Natures" VALUES(16,'Curious','SpAtk','HP'); INSERT INTO "Natures" VALUES(17,'Modest','SpAtk','Atk'); INSERT INTO "Natures" VALUES(18,'Mild','SpAtk','Def'); INSERT INTO "Natures" VALUES(19,'Rash','SpAtk','SpDef'); INSERT INTO "Natures" VALUES(20,'Quiet','SpAtk','Speed'); INSERT INTO "Natures" VALUES(21,'Dreamy','SpDef','HP'); INSERT INTO "Natures" VALUES(22,'Calm','SpDef','Atk'); INSERT INTO "Natures" VALUES(23,'Gentle','SpDef','Def'); INSERT INTO "Natures" VALUES(24,'Careful','SpDef','SpAtk'); INSERT INTO "Natures" VALUES(25,'Sassy','SpDef','Speed'); INSERT INTO "Natures" VALUES(26,'Skittish','Speed','HP'); INSERT INTO "Natures" VALUES(27,'Timid','Speed','Atk'); INSERT INTO "Natures" VALUES(28,'Hasty','Speed','Def'); INSERT INTO "Natures" VALUES(29,'Jolly','Speed','SpAtk'); INSERT INTO "Natures" VALUES(30,'Naive','Speed','SpDef'); INSERT INTO "Natures" VALUES(31,'Composed','HP','HP'); INSERT INTO "Natures" VALUES(32,'Hardy','Atk','Atk'); INSERT INTO "Natures" VALUES(33,'Docile','Def','Def'); INSERT INTO "Natures" VALUES(34,'Bashful','SpAtk','SpAtk'); INSERT INTO "Natures" VALUES(35,'Quirky','SpDef','SpDef'); INSERT INTO "Natures" VALUES(36,'Serious','Speed','Speed');
true
f575c2d1c62557dfe8deebe7e6897d902bd4e479
SQL
chocosin/2019-11-otus-spring-selevenko
/05/src/main/resources/schema.sql
UTF-8
491
3.09375
3
[]
no_license
create table books ( id bigint primary key auto_increment, title varchar(30) ); create table authors ( id bigint primary key auto_increment, firstName varchar(30), lastName varchar(30) ); create table genres ( id int primary key auto_increment, name varchar(30) ); create table bookAuthors ( bookId bigint, authorId bigint, primary key (bookId, authorId) ); create table bookGenres ( bookId bigint, genreId int, primary key (bookId, genreId) );
true
d4fe3bcf744e016d2311c9d1664d0774c25149ce
SQL
bakink/DBA_Oracle
/temporary_tbs_usage.sql
UTF-8
1,501
3.765625
4
[]
no_license
--Temporary Segments SELECT A.tablespace_name tablespace, D.mb_total, SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used, D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free FROM v$sort_segment A, ( SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total FROM v$tablespace B, v$tempfile C WHERE B.ts#= C.ts# GROUP BY B.name, C.block_size ) D WHERE A.tablespace_name = D.name GROUP by A.tablespace_name, D.mb_total; --Sort Space Usage by Session SELECT S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module, S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace, COUNT(*) sort_ops FROM v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P WHERE T.session_addr = S.saddr AND S.paddr = P.addr AND T.tablespace = TBS.tablespace_name GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module, S.program, TBS.block_size, T.tablespace ORDER BY sid_serial; --Sort Space Usage by Statement SELECT S.sid || ',' || S.serial# sid_serial, S.username, T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace, T.sqladdr address, Q.hash_value, Q.sql_text FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS WHERE T.session_addr = S.saddr AND T.sqladdr = Q.address (+) AND T.tablespace = TBS.tablespace_name ORDER BY S.sid;
true
cf9a71736fcd124c87ced084b62271d3beda833a
SQL
tejasoberoi27/DBMS_Projects
/dbms_project_2017332_2017123/query files/q7.sql
UTF-8
135
3.015625
3
[]
no_license
select * from Patient P where P.PackageID IN ( select `Package ID` from Package P1 where P.PackageID=P1.`Package ID` AND P1.Type="WL");
true
d5322bddc6de65a05b41dc7e50adfb725b49e2eb
SQL
giuliobosco/WebSAMT
/consulting/generated-sql/consulting.sql
UTF-8
1,644
3.46875
3
[ "Apache-2.0" ]
permissive
# This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; -- --------------------------------------------------------------------- -- consultant -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `consultant`; CREATE TABLE `consultant` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `lastname` VARCHAR(64) NOT NULL, `email` VARCHAR(64) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- client -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `client`; CREATE TABLE `client` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `lastname` VARCHAR(64) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; -- --------------------------------------------------------------------- -- consulting -- --------------------------------------------------------------------- DROP TABLE IF EXISTS `consulting`; CREATE TABLE `consulting` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `consultant_k` INTEGER NOT NULL, `client_k` INTEGER, PRIMARY KEY (`id`), INDEX `consulting_fi_707f1d` (`consultant_k`), INDEX `consulting_fi_a0a60b` (`client_k`), CONSTRAINT `consulting_fk_707f1d` FOREIGN KEY (`consultant_k`) REFERENCES `consultant` (`id`), CONSTRAINT `consulting_fk_a0a60b` FOREIGN KEY (`client_k`) REFERENCES `client` (`id`) ) ENGINE=InnoDB; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1;
true
7401fdd61d6bcf57dc913cb1179ea5fba810aa3c
SQL
ttowncompiled/databases
/project_one/queries/query4.sql
UTF-8
822
4.25
4
[]
no_license
SELECT any_user."uid", any_user."name", any_user."gender", agg_female_friends.num_female_friends, agg_male_friends.num_male_friends FROM Users any_user LEFT JOIN ( SELECT female_friends."uid1", COUNT(female_friends."uid2") AS num_female_friends FROM Friends female_friends INNER JOIN Users females ON female_friends."uid2" = females."uid" WHERE females."gender" = 'F' GROUP BY female_friends."uid1" ) agg_female_friends ON any_user."uid" = agg_female_friends."uid1" LEFT JOIN ( SELECT male_friends."uid1", COUNT(male_friends."uid2") AS num_male_friends FROM Friends male_friends INNER JOIN Users males ON male_friends."uid2" = males."uid" WHERE males."gender" = 'M' GROUP BY male_friends."uid1" ) agg_male_friends ON any_user."uid" = agg_male_friends."uid1";
true
7813dcadce3c6324b6cc63abca1bab2ce84d320c
SQL
jemn21819/holbertonschool-higher_level_programming
/0x0E-SQL_more_queries/100-not_my_genres.sql
UTF-8
378
4.125
4
[]
no_license
-- uses the hbtn_0d_tvshows database to list all genres not linked to the show Dexter SELECT tv_genres.name FROM tv_genres WHERE tv_genres.id NOT IN ( SELECT tv_genres.id FROM tv_genres INNER JOIN tv_show_genres ON tv_genres.id = tv_show_genres.genre_id INNER JOIN tv_shows ON tv_show_genres.show_id = tv_shows.id WHERE tv_shows.title = 'Dexter' ) ORDER BY tv_genres.name;
true
3df98a0827eee47c0ef534f8260b1d04b39027a4
SQL
nmrs-nigeria/nigeria-mrs-distribution
/api/src/main/resources/sql/role/role_privilege.sql
UTF-8
42,136
2.515625
3
[]
no_license
SET FOREIGN_KEY_CHECKS=0/0xd REPLACE INTO `role_privilege` VALUES ('Adherence','App: coreapps.findPatient'), ('Adherence','App: coreapps.patientDashboard'), ('Adherence','App: coreapps.patientVisits'), ('Adherence','App: coreapps.summaryDashboard'), ('Adherence','App: patientqueueing.providerDashboard'), ('Adherence','Task: coreapps.createVisit'), ('Adherence','Task: coreapps.deletePatientProgram'), ('Adherence','Task: coreapps.editPatientProgram'), ('Adherence','Task: coreapps.endVisit'), ('Adherence','Task: coreapps.enrollInProgram'), ('Adherence','Task: coreapps.mergeVisits'), ('Adherence','Task: emr.patient.encounter.edit'), ('Adherence','Task: patientqueueing.completePatientQueue'), ('Adherence','Task: patientqueueing.sendPatientToQueue'), ('Adherence','Task: appointmentschedulingui.overbookAppointments'), ('Adherence','Task: appointmentschedulingui.bookAppointments'), ('Adherence','Task: appointmentschedulingui.viewConfidential'), ('Adherence','App: appointmentschedulingui.home'), ('Adherence','App: appointmentschedulingui.viewAppointments'), ('Adherence','Manage Appointment Types'), ('Adherence','Schedule Appointments'), ('Adherence','App: coreapps.activeVisits'), ('ANC','App: coreapps.activeVisits'), ('ANC','App: coreapps.findPatient'), ('ANC','App: coreapps.patientDashboard'), ('ANC','App: coreapps.patientVisits'), ('ANC','App: coreapps.summaryDashboard'), ('ANC','App: patientqueueing.providerDashboard'), ('ANC','Task: coreapps.createVisit'), ('ANC','Task: coreapps.deletePatientProgram'), ('ANC','Task: coreapps.editPatientProgram'), ('ANC','Task: coreapps.endVisit'), ('ANC','Task: coreapps.enrollInProgram'), ('ANC','Task: coreapps.mergeVisits'), ('ANC','Task: emr.patient.encounter.edit'), ('ANC','Task: patientqueueing.completePatientQueue'), ('ANC','Task: patientqueueing.sendPatientToQueue'), ('ANC','App: registrationapp.registerPatient'), ('Application: Administers System','App: coreapps.systemAdministration'), ('Application: Administers System','App: referenceapplication.legacyAdmin'), ('Application: Configures Appointment Scheduling','App: appointmentschedulingui.appointmentTypes'), ('Application: Configures Appointment Scheduling','App: appointmentschedulingui.home'), ('Application: Configures Forms','App: coreapps.configuremetadata'), ('Application: Configures Forms','App: formentryapp.forms'), ('Application: Configures Metadata','App: coreapps.configuremetadata'), ('Application: Edits Existing Encounters','Task: emr.patient.encounter.delete'), ('Application: Edits Existing Encounters','Task: emr.patient.encounter.edit'), ('Application: Enters ADT Events','App: coreapps.activeVisits'), ('Application: Enters ADT Events','App: coreapps.findPatient'), ('Application: Enters ADT Events','Task: coreapps.createRetrospectiveVisit'), ('Application: Enters ADT Events','Task: coreapps.createVisit'), ('Application: Enters ADT Events','Task: coreapps.endVisit'), ('Application: Enters ADT Events','Task: coreapps.mergeVisits'), ('Application: Enters ADT Events','Task: referenceapplication.simpleAdmission'), ('Application: Enters ADT Events','Task: referenceapplication.simpleDischarge'), ('Application: Enters ADT Events','Task: referenceapplication.simpleTransfer'), ('Application: Enters Vitals','App: coreapps.activeVisits'), ('Application: Enters Vitals','App: coreapps.findPatient'), ('Application: Enters Vitals','Task: referenceapplication.vitals'), ('Application: Manages Atlas','App: atlas.manage'), ('Application: Manages Atlas','App: coreapps.systemAdministration'), ('Application: Manages Provider Schedules','App: appointmentschedulingui.home'), ('Application: Manages Provider Schedules','App: appointmentschedulingui.providerSchedules'), ('Application: Records Allergies','Task: Modify Allergies'), ('Application: Registers Patients','App: coreapps.activeVisits'), ('Application: Registers Patients','App: coreapps.patientDashboard'), ('Application: Registers Patients','App: registrationapp.registerPatient'), ('Application: Requests Appointments','Task: appointmentschedulingui.requestAppointments'), ('Application: Schedules And Overbooks Appointments','Task: appointmentschedulingui.overbookAppointments'), ('Application: Schedules Appointments','Task: appointmentschedulingui.bookAppointments'), ('Application: Schedules Appointments','Task: appointmentschedulingui.viewConfidential'), ('Application: Sees Appointment Schedule','App: appointmentschedulingui.viewAppointments'), ('Application: Uses Capture Vitals App','App: referenceapplication.vitals'), ('Application: Uses Patient Summary','App: coreapps.findPatient'), ('Application: Uses Patient Summary','App: coreapps.patientDashboard'), ('Application: Uses Patient Summary','App: coreapps.patientVisits'), ('Application: Writes Clinical Notes','App: coreapps.activeVisits'), ('Application: Writes Clinical Notes','App: coreapps.findPatient'), ('Application: Writes Clinical Notes','Task: referenceapplication.simpleVisitNote'), ('Authenticated','Get Concept Classes'), ('Authenticated','Get Concept Datatypes'), ('Authenticated','Get Encounter Types'), ('Authenticated','Get Field Types'), ('Authenticated','Get Global Properties'), ('Authenticated','Get Identifier Types'), ('Authenticated','Get Locations'), ('Authenticated','Get Order Types'), ('Authenticated','Get Person Attribute Types'), ('Authenticated','Get Privileges'), ('Authenticated','Get Relationship Types'), ('Authenticated','Get Relationships'), ('Authenticated','Get Roles'), ('Authenticated','Patient Overview - View Relationships'), ('Authenticated','View Concept Classes'), ('Authenticated','View Concept Datatypes'), ('Authenticated','View Encounter Types'), ('Authenticated','View Field Types'), ('Authenticated','View Global Properties'), ('Authenticated','View Identifier Types'), ('Authenticated','View Locations'), ('Authenticated','View Order Types'), ('Authenticated','View Person Attribute Types'), ('Authenticated','View Privileges'), ('Authenticated','View Relationship Types'), ('Authenticated','View Relationships'), ('Authenticated','View Roles'), ('cdc_user_role','App: Access Cashier Tasks'), ('cdc_user_role','App: Access Inventory Tasks'), ('cdc_user_role','App: View Cashier App'), ('cdc_user_role','App: View Inventory App'), ('cdc_user_role','Task: Access Create Operation'), ('cdc_user_role','Task: Access Inventory Reports'), ('cdc_user_role','Task: Access Inventory Task'), ('cdc_user_role','Task: Access Stock Take'), ('cdc_user_role','Task: Adjust Cashier Bills'), ('cdc_user_role','Task: Cashier Timesheets'), ('cdc_user_role','Task: coreapps.editPatientProgram'), ('cdc_user_role','Task: coreapps.enrollInProgram'), ('cdc_user_role','Task: Create new bill'), ('cdc_user_role','Task: emr.patient.encounter.edit'), ('cdc_user_role','Task: Manage Cashier Metadata'), ('cdc_user_role','Task: Manage Cashier Module'), ('cdc_user_role','Task: Manage Condition Lists'), ('cdc_user_role','Task: Manage Inventory Metadata'), ('cdc_user_role','Task: Manage Inventory Module'), ('cdc_user_role','Task: View Cashier Reports'), ('cdc_user_role','Task: View Stock Operations'), ('Clinician','App: patientqueueing.providerDashboard'), ('Clinician','Task: coreapps.deletePatientProgram'), ('Clinician','Task: coreapps.editPatientProgram'), ('Clinician','Task: coreapps.enrollInProgram'), ('Clinician','Task: emr.patient.encounter.edit'), ('Clinician','Task: patientqueueing.completePatientQueue'), ('Clinician','Task: patientqueueing.sendPatientToQueue'), ('Clinician','App: registrationapp.registerPatient'), ('Clinician','Task: coreapps.createVisit'), ('Nurse','App: patientqueueing.providerDashboard'), ('Nurse','Task: coreapps.deletePatientProgram'), ('Nurse','Task: coreapps.editPatientProgram'), ('Nurse','Task: coreapps.enrollInProgram'), ('Nurse','Task: emr.patient.encounter.edit'), ('Nurse','Task: patientqueueing.completePatientQueue'), ('Nurse','Task: patientqueueing.sendPatientToQueue'), ('Nurse','Task: coreapps.createVisit'), ('HTS','App: coreapps.findPatient'), ('HTS','App: coreapps.patientVisits'), ('HTS','App: coreapps.summaryDashboard'), ('HTS','App: formentryapp.forms'), ('HTS','App: patientqueueing.providerDashboard'), ('HTS','Task: coreapps.createVisit'), ('HTS','Task: coreapps.deletePatientProgram'), ('HTS','Task: coreapps.editPatientProgram'), ('HTS','Task: coreapps.endVisit'), ('HTS','Task: coreapps.enrollInProgram'), ('HTS','Task: coreapps.mergeVisits'), ('HTS','Task: emr.patient.encounter.edit'), ('HTS','Task: patientqueueing.completePatientQueue'), ('HTS','Task: patientqueueing.sendPatientToQueue'), ('Lab','Task: emr.patient.encounter.edit'), ('Lab','App: coreapps.patientDashboard'), ('Lab','App: coreapps.patientVisits'), ('Lab','App: coreapps.summaryDashboard'), ('Lab','App: patientqueueing.providerDashboard'), ('Lab','Task: coreapps.deletePatientProgram'), ('Lab','Task: coreapps.editPatientProgram'), ('Lab','Task: coreapps.enrollInProgram'), ('Lab','Task: patientqueueing.completePatientQueue'), ('Lab','Task: patientqueueing.sendPatientToQueue'), ('Lab','App: registrationapp.registerPatient'), ('Lab','Task: coreapps.createVisit'), ('MandE','App: coreapps.activeVisits'), ('MandE','App: registrationapp.registerPatient'), ('MandE','App: reportingui.reports'), ('MandE','App: coreapps.findPatient'), ('MandE','App: coreapps.patientDashboard'), ('MandE','App: coreapps.patientVisits'), ('MandE','App: coreapps.summaryDashboard'), ('MandE','App: patientqueueing.providerDashboard'), ('MandE','Task: coreapps.createVisit'), ('MandE','Task: coreapps.deletePatientProgram'), ('MandE','Task: coreapps.editPatientProgram'), ('MandE','Task: coreapps.endVisit'), ('MandE','Task: coreapps.enrollInProgram'), ('MandE','Task: coreapps.mergeVisits'), ('MandE','Task: emr.patient.encounter.edit'), ('MandE','Task: patientqueueing.completePatientQueue'), ('MandE','Task: patientqueueing.sendPatientToQueue'), ('MandE','Nigeriaemr Privilege'), ('Pharmacist','Task: emr.patient.encounter.edit'), ('Pharmacist','App: coreapps.findPatient'), ('Pharmacist','App: coreapps.activeVisits'), ('Pharmacist','App: reportingui.reports'), ('Pharmacist','App: coreapps.mergePatient'), ('Pharmacist','App: coreapps.patientDashboard'), ('Pharmacist','App: coreapps.patientVisits'), ('Pharmacist','App: coreapps.summaryDashboard'), ('Pharmacist','App: patientqueueing.providerDashboard'), ('Pharmacist','Task: coreapps.deletePatientProgram'), ('Pharmacist','Task: coreapps.editPatientProgram'), ('Pharmacist','Task: coreapps.endVisit'), ('Pharmacist','Task: coreapps.enrollInProgram'), ('Pharmacist','Task: coreapps.mergeVisits'), ('Pharmacist','Task: patientqueueing.completePatientQueue'), ('Pharmacist','Task: patientqueueing.sendPatientToQueue'), ('Pharmacist','Task: coreapps.createVisit'), ('Privilege Level: Full','Add Allergies'), ('Privilege Level: Full','Add Cohorts'), ('Privilege Level: Full','Add Concept Proposals'), ('Privilege Level: Full','Add Encounters'), ('Privilege Level: Full','Add HL7 Inbound Archive'), ('Privilege Level: Full','Add HL7 Inbound Exception'), ('Privilege Level: Full','Add HL7 Inbound Queue'), ('Privilege Level: Full','Add HL7 Source'), ('Privilege Level: Full','Add Observations'), ('Privilege Level: Full','Add Orders'), ('Privilege Level: Full','Add Patient Identifiers'), ('Privilege Level: Full','Add Patient Programs'), ('Privilege Level: Full','Add Patients'), ('Privilege Level: Full','Add People'), ('Privilege Level: Full','Add Problems'), ('Privilege Level: Full','Add Relationships'), ('Privilege Level: Full','Add Report Objects'), ('Privilege Level: Full','Add Reports'), ('Privilege Level: Full','Add Users'), ('Privilege Level: Full','Add Visits'), ('Privilege Level: Full','Adjust Cashier Bills'), ('Privilege Level: Full','Assign System Developer Role'), ('Privilege Level: Full','Configure Visits'), ('Privilege Level: Full','Delete Cohorts'), ('Privilege Level: Full','Delete Concept Proposals'), ('Privilege Level: Full','Delete Encounters'), ('Privilege Level: Full','Delete HL7 Inbound Archive'), ('Privilege Level: Full','Delete HL7 Inbound Exception'), ('Privilege Level: Full','Delete HL7 Inbound Queue'), ('Privilege Level: Full','Delete Notes'), ('Privilege Level: Full','Delete Observations'), ('Privilege Level: Full','Delete Orders'), ('Privilege Level: Full','Delete Patient Identifiers'), ('Privilege Level: Full','Delete Patient Programs'), ('Privilege Level: Full','Delete Patients'), ('Privilege Level: Full','Delete People'), ('Privilege Level: Full','Delete Relationships'), ('Privilege Level: Full','Delete Report Objects'), ('Privilege Level: Full','Delete Reports'), ('Privilege Level: Full','Delete Users'), ('Privilege Level: Full','Delete Visits'), ('Privilege Level: Full','Edit Allergies'), ('Privilege Level: Full','Edit Cohorts'), ('Privilege Level: Full','Edit Concept Proposals'), ('Privilege Level: Full','Edit conditions'), ('Privilege Level: Full','Edit Encounters'), ('Privilege Level: Full','Edit Notes'), ('Privilege Level: Full','Edit Observations'), ('Privilege Level: Full','Edit Orders'), ('Privilege Level: Full','Edit Patient Identifiers'), ('Privilege Level: Full','Edit Patient Programs'), ('Privilege Level: Full','Edit Patients'), ('Privilege Level: Full','Edit People'), ('Privilege Level: Full','Edit Problems'), ('Privilege Level: Full','Edit Relationships'), ('Privilege Level: Full','Edit Report Objects'), ('Privilege Level: Full','Edit Reports'), ('Privilege Level: Full','Edit User Passwords'), ('Privilege Level: Full','Edit Users'), ('Privilege Level: Full','Edit Visits'), ('Privilege Level: Full','Form Entry'), ('Privilege Level: Full','Generate Batch of Identifiers'), ('Privilege Level: Full','Get Allergies'), ('Privilege Level: Full','Get Care Settings'), ('Privilege Level: Full','Get Concept Attribute Types'), ('Privilege Level: Full','Get Concept Classes'), ('Privilege Level: Full','Get Concept Datatypes'), ('Privilege Level: Full','Get Concept Map Types'), ('Privilege Level: Full','Get Concept Proposals'), ('Privilege Level: Full','Get Concept Reference Terms'), ('Privilege Level: Full','Get Concept Sources'), ('Privilege Level: Full','Get Concepts'), ('Privilege Level: Full','Get conditions'), ('Privilege Level: Full','Get Database Changes'), ('Privilege Level: Full','Get Encounter Roles'), ('Privilege Level: Full','Get Encounter Types'), ('Privilege Level: Full','Get Encounters'), ('Privilege Level: Full','Get Field Types'), ('Privilege Level: Full','Get Forms'), ('Privilege Level: Full','Get Global Properties'), ('Privilege Level: Full','Get HL7 Inbound Archive'), ('Privilege Level: Full','Get HL7 Inbound Exception'), ('Privilege Level: Full','Get HL7 Inbound Queue'), ('Privilege Level: Full','Get HL7 Source'), ('Privilege Level: Full','Get Identifier Types'), ('Privilege Level: Full','Get Location Attribute Types'), ('Privilege Level: Full','Get Locations'), ('Privilege Level: Full','Get Notes'), ('Privilege Level: Full','Get Observations'), ('Privilege Level: Full','Get Order Frequencies'), ('Privilege Level: Full','Get Order Sets'), ('Privilege Level: Full','Get Order Types'), ('Privilege Level: Full','Get Orders'), ('Privilege Level: Full','Get Patient Cohorts'), ('Privilege Level: Full','Get Patient Identifiers'), ('Privilege Level: Full','Get Patient Programs'), ('Privilege Level: Full','Get Patients'), ('Privilege Level: Full','Get People'), ('Privilege Level: Full','Get Person Attribute Types'), ('Privilege Level: Full','Get Privileges'), ('Privilege Level: Full','Get Problems'), ('Privilege Level: Full','Get Programs'), ('Privilege Level: Full','Get Providers'), ('Privilege Level: Full','Get Relationship Types'), ('Privilege Level: Full','Get Relationships'), ('Privilege Level: Full','Get Roles'), ('Privilege Level: Full','Get Users'), ('Privilege Level: Full','Get Visit Attribute Types'), ('Privilege Level: Full','Get Visit Types'), ('Privilege Level: Full','Get Visits'), ('Privilege Level: Full','Manage Address Hierarchy'), ('Privilege Level: Full','Manage Address Templates'), ('Privilege Level: Full','Manage Alerts'), ('Privilege Level: Full','Manage Appointment Types'), ('Privilege Level: Full','Manage Appointments Settings'), ('Privilege Level: Full','Manage Atlas Data'), ('Privilege Level: Full','Manage Auto Generation Options'), ('Privilege Level: Full','Manage Cashier Bills'), ('Privilege Level: Full','Manage Cashier Metadata'), ('Privilege Level: Full','Manage Cashier Timesheets'), ('Privilege Level: Full','Manage Cohort Definitions'), ('Privilege Level: Full','Manage Concept Attribute Types'), ('Privilege Level: Full','Manage Concept Classes'), ('Privilege Level: Full','Manage Concept Datatypes'), ('Privilege Level: Full','Manage Concept Map Types'), ('Privilege Level: Full','Manage Concept Name tags'), ('Privilege Level: Full','Manage Concept Reference Terms'), ('Privilege Level: Full','Manage Concept Sources'), ('Privilege Level: Full','Manage Concept Stop Words'), ('Privilege Level: Full','Manage Concepts'), ('Privilege Level: Full','Manage Data Set Definitions'), ('Privilege Level: Full','Manage Dimension Definitions'), ('Privilege Level: Full','Manage Encounter Roles'), ('Privilege Level: Full','Manage Encounter Types'), ('Privilege Level: Full','Manage Field Types'), ('Privilege Level: Full','Manage Flags'), ('Privilege Level: Full','Manage FormEntry XSN'), ('Privilege Level: Full','Manage Forms'), ('Privilege Level: Full','Manage Global Properties'), ('Privilege Level: Full','Manage HL7 Messages'), ('Privilege Level: Full','Manage Identifier Sources'), ('Privilege Level: Full','Manage Identifier Types'), ('Privilege Level: Full','Manage Implementation Id'), ('Privilege Level: Full','Manage Indicator Definitions'), ('Privilege Level: Full','Manage Inventory Items'), ('Privilege Level: Full','Manage Inventory Metadata'), ('Privilege Level: Full','Manage Inventory Operations'), ('Privilege Level: Full','Manage Inventory Stockrooms'), ('Privilege Level: Full','Manage Jasper Reports'), ('Privilege Level: Full','Manage Location Attribute Types'), ('Privilege Level: Full','Manage Location Tags'), ('Privilege Level: Full','Manage Locations'), ('Privilege Level: Full','Manage Metadata Mapping'), ('Privilege Level: Full','Manage Modules'), ('Privilege Level: Full','Manage Order Frequencies'), ('Privilege Level: Full','Manage Order Sets'), ('Privilege Level: Full','Manage Order Types'), ('Privilege Level: Full','Manage OWA'), ('Privilege Level: Full','Manage Person Attribute Types'), ('Privilege Level: Full','Manage Privileges'), ('Privilege Level: Full','Manage Programs'), ('Privilege Level: Full','Manage Provider Schedules'), ('Privilege Level: Full','Manage Providers'), ('Privilege Level: Full','Manage Relationship Types'), ('Privilege Level: Full','Manage Relationships'), ('Privilege Level: Full','Manage Report Definitions'), ('Privilege Level: Full','Manage Report Designs'), ('Privilege Level: Full','Manage Reports'), ('Privilege Level: Full','Manage RESTWS'), ('Privilege Level: Full','Manage Roles'), ('Privilege Level: Full','Manage Rule Definitions'), ('Privilege Level: Full','Manage Scheduled Report Tasks'), ('Privilege Level: Full','Manage Scheduler'), ('Privilege Level: Full','Manage Search Index'), ('Privilege Level: Full','Manage synonym group'), ('Privilege Level: Full','Manage Synonym Groups'), ('Privilege Level: Full','Manage Token Registrations'), ('Privilege Level: Full','Manage Tokens'), ('Privilege Level: Full','Manage Visit Attribute Types'), ('Privilege Level: Full','Manage Visit Types'), ('Privilege Level: Full','Patient Dashboard - View Chart Search Section'), ('Privilege Level: Full','Patient Dashboard - View Demographics Section'), ('Privilege Level: Full','Patient Dashboard - View Encounters Section'), ('Privilege Level: Full','Patient Dashboard - View Forms Section'), ('Privilege Level: Full','Patient Dashboard - View Graphs Section'), ('Privilege Level: Full','Patient Dashboard - View Overview Section'), ('Privilege Level: Full','Patient Dashboard - View Patient Summary'), ('Privilege Level: Full','Patient Dashboard - View Regimen Section'), ('Privilege Level: Full','Patient Dashboard - View Visits Section'), ('Privilege Level: Full','Patient Overview - View Allergies'), ('Privilege Level: Full','Patient Overview - View Patient Actions'), ('Privilege Level: Full','Patient Overview - View Patient Flags'), ('Privilege Level: Full','Patient Overview - View Problem List'), ('Privilege Level: Full','Patient Overview - View Programs'), ('Privilege Level: Full','Patient Overview - View Relationships'), ('Privilege Level: Full','Provider Management - Admin'), ('Privilege Level: Full','Provider Management API'), ('Privilege Level: Full','Provider Management API - Read-only'), ('Privilege Level: Full','Provider Management Dashboard - Edit Patients'), ('Privilege Level: Full','Provider Management Dashboard - Edit Providers'), ('Privilege Level: Full','Provider Management Dashboard - View Historical'), ('Privilege Level: Full','Provider Management Dashboard - View Patients'), ('Privilege Level: Full','Provider Management Dashboard - View Providers'), ('Privilege Level: Full','Purge Cashier Bills'), ('Privilege Level: Full','Purge Cashier Metadata'), ('Privilege Level: Full','Purge Cashier Timesheets'), ('Privilege Level: Full','Purge Field Types'), ('Privilege Level: Full','Purge Inventory Items'), ('Privilege Level: Full','Purge Inventory Metadata'), ('Privilege Level: Full','Purge Inventory Operations'), ('Privilege Level: Full','Purge Inventory Stockrooms'), ('Privilege Level: Full','Refund Money'), ('Privilege Level: Full','Remove Allergies'), ('Privilege Level: Full','Remove Problems'), ('Privilege Level: Full','Reprint Receipt'), ('Privilege Level: Full','Request Appointments'), ('Privilege Level: Full','Rollback Inventory Operations'), ('Privilege Level: Full','Run Chart Search commands'), ('Privilege Level: Full','Run Reports'), ('Privilege Level: Full','Schedule Appointments'), ('Privilege Level: Full','Share Metadata'), ('Privilege Level: Full','Squeezing Appointments'), ('Privilege Level: Full','Test Flags'), ('Privilege Level: Full','Update Appointment Status'), ('Privilege Level: Full','Update HL7 Inbound Archive'), ('Privilege Level: Full','Update HL7 Inbound Exception'), ('Privilege Level: Full','Update HL7 Inbound Queue'), ('Privilege Level: Full','Update HL7 Source'), ('Privilege Level: Full','Upload Batch of Identifiers'), ('Privilege Level: Full','Upload XSN'), ('Privilege Level: Full','View Administration Functions'), ('Privilege Level: Full','View Allergies'), ('Privilege Level: Full','View Appointment Types'), ('Privilege Level: Full','View Appointments'), ('Privilege Level: Full','View Appointments Blocks'), ('Privilege Level: Full','View Appointments Statistics'), ('Privilege Level: Full','View Calculations'), ('Privilege Level: Full','View Cashier Bills'), ('Privilege Level: Full','View Cashier Metadata'), ('Privilege Level: Full','View Cashier Timesheets'), ('Privilege Level: Full','View Concept Classes'), ('Privilege Level: Full','View Concept Datatypes'), ('Privilege Level: Full','View Concept Map Types'), ('Privilege Level: Full','View Concept Proposals'), ('Privilege Level: Full','View Concept Reference Terms'), ('Privilege Level: Full','View Concept Sources'), ('Privilege Level: Full','View Concepts'), ('Privilege Level: Full','View Data Entry Statistics'), ('Privilege Level: Full','View Database Changes'), ('Privilege Level: Full','View Encounter Roles'), ('Privilege Level: Full','View Encounter Types'), ('Privilege Level: Full','View Encounters'), ('Privilege Level: Full','View Field Types'), ('Privilege Level: Full','View Forms'), ('Privilege Level: Full','View Global Properties'), ('Privilege Level: Full','View HL7 Inbound Archive'), ('Privilege Level: Full','View HL7 Inbound Exception'), ('Privilege Level: Full','View HL7 Inbound Queue'), ('Privilege Level: Full','View HL7 Source'), ('Privilege Level: Full','View Identifier Types'), ('Privilege Level: Full','View Inventory Items'), ('Privilege Level: Full','View Inventory Metadata'), ('Privilege Level: Full','View Inventory Operations'), ('Privilege Level: Full','View Inventory Stockrooms'), ('Privilege Level: Full','View Jasper Reports'), ('Privilege Level: Full','View Location Attribute Types'), ('Privilege Level: Full','View Locations'), ('Privilege Level: Full','View Metadata Via Mapping'), ('Privilege Level: Full','View Navigation Menu'), ('Privilege Level: Full','View Observations'), ('Privilege Level: Full','View Order Types'), ('Privilege Level: Full','View Orders'), ('Privilege Level: Full','View Patient Appointment History'), ('Privilege Level: Full','View Patient Cohorts'), ('Privilege Level: Full','View Patient Identifiers'), ('Privilege Level: Full','View Patient Programs'), ('Privilege Level: Full','View Patients'), ('Privilege Level: Full','View People'), ('Privilege Level: Full','View Person Attribute Types'), ('Privilege Level: Full','View Privileges'), ('Privilege Level: Full','View Problems'), ('Privilege Level: Full','View Programs'), ('Privilege Level: Full','View Provider Schedules'), ('Privilege Level: Full','View Providers'), ('Privilege Level: Full','View Relationship Types'), ('Privilege Level: Full','View Relationships'), ('Privilege Level: Full','View Report Objects'), ('Privilege Level: Full','View Reports'), ('Privilege Level: Full','View RESTWS'), ('Privilege Level: Full','View Roles'), ('Privilege Level: Full','View Rule Definitions'), ('Privilege Level: Full','View Token Registrations'), ('Privilege Level: Full','View Unpublished Forms'), ('Privilege Level: Full','View Users'), ('Privilege Level: Full','View Visit Attribute Types'), ('Privilege Level: Full','View Visit Types'), ('Privilege Level: Full','View Visits'), ('Privilege Level: High','Add Allergies'), ('Privilege Level: High','Add Cohorts'), ('Privilege Level: High','Add Concept Proposals'), ('Privilege Level: High','Add Encounters'), ('Privilege Level: High','Add HL7 Inbound Archive'), ('Privilege Level: High','Add HL7 Inbound Exception'), ('Privilege Level: High','Add HL7 Inbound Queue'), ('Privilege Level: High','Add HL7 Source'), ('Privilege Level: High','Add Observations'), ('Privilege Level: High','Add Orders'), ('Privilege Level: High','Add Patient Identifiers'), ('Privilege Level: High','Add Patient Programs'), ('Privilege Level: High','Add Patients'), ('Privilege Level: High','Add People'), ('Privilege Level: High','Add Problems'), ('Privilege Level: High','Add Relationships'), ('Privilege Level: High','Add Users'), ('Privilege Level: High','Add Visits'), ('Privilege Level: High','Adjust Cashier Bills'), ('Privilege Level: High','Assign System Developer Role'), ('Privilege Level: High','Configure Visits'), ('Privilege Level: High','Delete Cohorts'), ('Privilege Level: High','Delete Concept Proposals'), ('Privilege Level: High','Delete Encounters'), ('Privilege Level: High','Delete HL7 Inbound Archive'), ('Privilege Level: High','Delete HL7 Inbound Exception'), ('Privilege Level: High','Delete HL7 Inbound Queue'), ('Privilege Level: High','Delete Notes'), ('Privilege Level: High','Delete Observations'), ('Privilege Level: High','Delete Orders'), ('Privilege Level: High','Delete Patient Identifiers'), ('Privilege Level: High','Delete Patient Programs'), ('Privilege Level: High','Delete Patients'), ('Privilege Level: High','Delete People'), ('Privilege Level: High','Delete Relationships'), ('Privilege Level: High','Delete Report Objects'), ('Privilege Level: High','Delete Reports'), ('Privilege Level: High','Delete Users'), ('Privilege Level: High','Delete Visits'), ('Privilege Level: High','Edit Allergies'), ('Privilege Level: High','Edit Cohorts'), ('Privilege Level: High','Edit Concept Proposals'), ('Privilege Level: High','Edit conditions'), ('Privilege Level: High','Edit Encounters'), ('Privilege Level: High','Edit Notes'), ('Privilege Level: High','Edit Observations'), ('Privilege Level: High','Edit Orders'), ('Privilege Level: High','Edit Patient Identifiers'), ('Privilege Level: High','Edit Patient Programs'), ('Privilege Level: High','Edit Patients'), ('Privilege Level: High','Edit People'), ('Privilege Level: High','Edit Problems'), ('Privilege Level: High','Edit Relationships'), ('Privilege Level: High','Edit User Passwords'), ('Privilege Level: High','Edit Users'), ('Privilege Level: High','Edit Visits'), ('Privilege Level: High','Form Entry'), ('Privilege Level: High','Generate Batch of Identifiers'), ('Privilege Level: High','Get Allergies'), ('Privilege Level: High','Get Care Settings'), ('Privilege Level: High','Get Concept Attribute Types'), ('Privilege Level: High','Get Concept Classes'), ('Privilege Level: High','Get Concept Datatypes'), ('Privilege Level: High','Get Concept Map Types'), ('Privilege Level: High','Get Concept Proposals'), ('Privilege Level: High','Get Concept Reference Terms'), ('Privilege Level: High','Get Concept Sources'), ('Privilege Level: High','Get Concepts'), ('Privilege Level: High','Get conditions'), ('Privilege Level: High','Get Database Changes'), ('Privilege Level: High','Get Encounter Roles'), ('Privilege Level: High','Get Encounter Types'), ('Privilege Level: High','Get Encounters'), ('Privilege Level: High','Get Field Types'), ('Privilege Level: High','Get Forms'), ('Privilege Level: High','Get Global Properties'), ('Privilege Level: High','Get HL7 Inbound Archive'), ('Privilege Level: High','Get HL7 Inbound Exception'), ('Privilege Level: High','Get HL7 Inbound Queue'), ('Privilege Level: High','Get HL7 Source'), ('Privilege Level: High','Get Identifier Types'), ('Privilege Level: High','Get Location Attribute Types'), ('Privilege Level: High','Get Locations'), ('Privilege Level: High','Get Notes'), ('Privilege Level: High','Get Observations'), ('Privilege Level: High','Get Order Frequencies'), ('Privilege Level: High','Get Order Sets'), ('Privilege Level: High','Get Order Types'), ('Privilege Level: High','Get Orders'), ('Privilege Level: High','Get Patient Cohorts'), ('Privilege Level: High','Get Patient Identifiers'), ('Privilege Level: High','Get Patient Programs'), ('Privilege Level: High','Get Patients'), ('Privilege Level: High','Get People'), ('Privilege Level: High','Get Person Attribute Types'), ('Privilege Level: High','Get Privileges'), ('Privilege Level: High','Get Problems'), ('Privilege Level: High','Get Programs'), ('Privilege Level: High','Get Providers'), ('Privilege Level: High','Get Relationship Types'), ('Privilege Level: High','Get Relationships'), ('Privilege Level: High','Get Roles'), ('Privilege Level: High','Get Users'), ('Privilege Level: High','Get Visit Attribute Types'), ('Privilege Level: High','Get Visit Types'), ('Privilege Level: High','Get Visits'), ('Privilege Level: High','Manage Address Hierarchy'), ('Privilege Level: High','Manage Address Templates'), ('Privilege Level: High','Manage Alerts'), ('Privilege Level: High','Manage Appointment Types'), ('Privilege Level: High','Manage Appointments Settings'), ('Privilege Level: High','Manage Atlas Data'), ('Privilege Level: High','Manage Auto Generation Options'), ('Privilege Level: High','Manage Cashier Bills'), ('Privilege Level: High','Manage Cashier Metadata'), ('Privilege Level: High','Manage Cashier Timesheets'), ('Privilege Level: High','Manage Cohort Definitions'), ('Privilege Level: High','Manage Concept Attribute Types'), ('Privilege Level: High','Manage Concept Classes'), ('Privilege Level: High','Manage Concept Datatypes'), ('Privilege Level: High','Manage Concept Map Types'), ('Privilege Level: High','Manage Concept Name tags'), ('Privilege Level: High','Manage Concept Reference Terms'), ('Privilege Level: High','Manage Concept Sources'), ('Privilege Level: High','Manage Concept Stop Words'), ('Privilege Level: High','Manage Concepts'), ('Privilege Level: High','Manage Data Set Definitions'), ('Privilege Level: High','Manage Dimension Definitions'), ('Privilege Level: High','Manage Encounter Roles'), ('Privilege Level: High','Manage Encounter Types'), ('Privilege Level: High','Manage Field Types'), ('Privilege Level: High','Manage Flags'), ('Privilege Level: High','Manage FormEntry XSN'), ('Privilege Level: High','Manage Forms'), ('Privilege Level: High','Manage Global Properties'), ('Privilege Level: High','Manage HL7 Messages'), ('Privilege Level: High','Manage Identifier Sources'), ('Privilege Level: High','Manage Identifier Types'), ('Privilege Level: High','Manage Implementation Id'), ('Privilege Level: High','Manage Indicator Definitions'), ('Privilege Level: High','Manage Inventory Items'), ('Privilege Level: High','Manage Inventory Metadata'), ('Privilege Level: High','Manage Inventory Operations'), ('Privilege Level: High','Manage Inventory Stockrooms'), ('Privilege Level: High','Manage Jasper Reports'), ('Privilege Level: High','Manage Location Attribute Types'), ('Privilege Level: High','Manage Location Tags'), ('Privilege Level: High','Manage Locations'), ('Privilege Level: High','Manage Metadata Mapping'), ('Privilege Level: High','Manage Modules'), ('Privilege Level: High','Manage Order Frequencies'), ('Privilege Level: High','Manage Order Sets'), ('Privilege Level: High','Manage Order Types'), ('Privilege Level: High','Manage OWA'), ('Privilege Level: High','Manage Person Attribute Types'), ('Privilege Level: High','Manage Programs'), ('Privilege Level: High','Manage Provider Schedules'), ('Privilege Level: High','Manage Providers'), ('Privilege Level: High','Manage Relationship Types'), ('Privilege Level: High','Manage Relationships'), ('Privilege Level: High','Manage Report Definitions'), ('Privilege Level: High','Manage Report Designs'), ('Privilege Level: High','Manage Reports'), ('Privilege Level: High','Manage RESTWS'), ('Privilege Level: High','Manage Roles'), ('Privilege Level: High','Manage Rule Definitions'), ('Privilege Level: High','Manage Scheduled Report Tasks'), ('Privilege Level: High','Manage Scheduler'), ('Privilege Level: High','Manage Search Index'), ('Privilege Level: High','Manage synonym group'), ('Privilege Level: High','Manage Synonym Groups'), ('Privilege Level: High','Manage Token Registrations'), ('Privilege Level: High','Manage Tokens'), ('Privilege Level: High','Manage Visit Attribute Types'), ('Privilege Level: High','Manage Visit Types'), ('Privilege Level: High','Patient Dashboard - View Chart Search Section'), ('Privilege Level: High','Patient Dashboard - View Demographics Section'), ('Privilege Level: High','Patient Dashboard - View Encounters Section'), ('Privilege Level: High','Patient Dashboard - View Forms Section'), ('Privilege Level: High','Patient Dashboard - View Graphs Section'), ('Privilege Level: High','Patient Dashboard - View Overview Section'), ('Privilege Level: High','Patient Dashboard - View Patient Summary'), ('Privilege Level: High','Patient Dashboard - View Regimen Section'), ('Privilege Level: High','Patient Dashboard - View Visits Section'), ('Privilege Level: High','Patient Overview - View Allergies'), ('Privilege Level: High','Patient Overview - View Patient Actions'), ('Privilege Level: High','Patient Overview - View Patient Flags'), ('Privilege Level: High','Patient Overview - View Problem List'), ('Privilege Level: High','Patient Overview - View Programs'), ('Privilege Level: High','Patient Overview - View Relationships'), ('Privilege Level: High','Provider Management - Admin'), ('Privilege Level: High','Provider Management API'), ('Privilege Level: High','Provider Management API - Read-only'), ('Privilege Level: High','Provider Management Dashboard - Edit Patients'), ('Privilege Level: High','Provider Management Dashboard - Edit Providers'), ('Privilege Level: High','Provider Management Dashboard - View Historical'), ('Privilege Level: High','Provider Management Dashboard - View Patients'), ('Privilege Level: High','Provider Management Dashboard - View Providers'), ('Privilege Level: High','Purge Cashier Bills'), ('Privilege Level: High','Purge Cashier Metadata'), ('Privilege Level: High','Purge Cashier Timesheets'), ('Privilege Level: High','Purge Field Types'), ('Privilege Level: High','Purge Inventory Items'), ('Privilege Level: High','Purge Inventory Metadata'), ('Privilege Level: High','Purge Inventory Operations'), ('Privilege Level: High','Purge Inventory Stockrooms'), ('Privilege Level: High','Refund Money'), ('Privilege Level: High','Remove Allergies'), ('Privilege Level: High','Remove Problems'), ('Privilege Level: High','Reprint Receipt'), ('Privilege Level: High','Request Appointments'), ('Privilege Level: High','Rollback Inventory Operations'), ('Privilege Level: High','Run Chart Search commands'), ('Privilege Level: High','Run Reports'), ('Privilege Level: High','Schedule Appointments'), ('Privilege Level: High','Squeezing Appointments'), ('Privilege Level: High','Test Flags'), ('Privilege Level: High','Update Appointment Status'), ('Privilege Level: High','Update HL7 Inbound Archive'), ('Privilege Level: High','Update HL7 Inbound Exception'), ('Privilege Level: High','Update HL7 Inbound Queue'), ('Privilege Level: High','Update HL7 Source'), ('Privilege Level: High','Upload Batch of Identifiers'), ('Privilege Level: High','Upload XSN'), ('Privilege Level: High','View Administration Functions'), ('Privilege Level: High','View Allergies'), ('Privilege Level: High','View Appointment Types'), ('Privilege Level: High','View Appointments'), ('Privilege Level: High','View Appointments Blocks'), ('Privilege Level: High','View Appointments Statistics'), ('Privilege Level: High','View Calculations'), ('Privilege Level: High','View Cashier Bills'), ('Privilege Level: High','View Cashier Metadata'), ('Privilege Level: High','View Cashier Timesheets'), ('Privilege Level: High','View Concept Classes'), ('Privilege Level: High','View Concept Datatypes'), ('Privilege Level: High','View Concept Map Types'), ('Privilege Level: High','View Concept Proposals'), ('Privilege Level: High','View Concept Reference Terms'), ('Privilege Level: High','View Concept Sources'), ('Privilege Level: High','View Concepts'), ('Privilege Level: High','View Data Entry Statistics'), ('Privilege Level: High','View Database Changes'), ('Privilege Level: High','View Encounter Roles'), ('Privilege Level: High','View Encounter Types'), ('Privilege Level: High','View Encounters'), ('Privilege Level: High','View Field Types'), ('Privilege Level: High','View Forms'), ('Privilege Level: High','View Global Properties'), ('Privilege Level: High','View HL7 Inbound Archive'), ('Privilege Level: High','View HL7 Inbound Exception'), ('Privilege Level: High','View HL7 Inbound Queue'), ('Privilege Level: High','View HL7 Source'), ('Privilege Level: High','View Identifier Types'), ('Privilege Level: High','View Inventory Items'), ('Privilege Level: High','View Inventory Metadata'), ('Privilege Level: High','View Inventory Operations'), ('Privilege Level: High','View Inventory Stockrooms'), ('Privilege Level: High','View Jasper Reports'), ('Privilege Level: High','View Location Attribute Types'), ('Privilege Level: High','View Locations'), ('Privilege Level: High','View Metadata Via Mapping'), ('Privilege Level: High','View Navigation Menu'), ('Privilege Level: High','View Observations'), ('Privilege Level: High','View Order Types'), ('Privilege Level: High','View Orders'), ('Privilege Level: High','View Patient Appointment History'), ('Privilege Level: High','View Patient Cohorts'), ('Privilege Level: High','View Patient Identifiers'), ('Privilege Level: High','View Patient Programs'), ('Privilege Level: High','View Patients'), ('Privilege Level: High','View People'), ('Privilege Level: High','View Person Attribute Types'), ('Privilege Level: High','View Privileges'), ('Privilege Level: High','View Problems'), ('Privilege Level: High','View Programs'), ('Privilege Level: High','View Provider Schedules'), ('Privilege Level: High','View Providers'), ('Privilege Level: High','View Relationship Types'), ('Privilege Level: High','View Relationships'), ('Privilege Level: High','View Report Objects'), ('Privilege Level: High','View Reports'), ('Privilege Level: High','View RESTWS'), ('Privilege Level: High','View Roles'), ('Privilege Level: High','View Rule Definitions'), ('Privilege Level: High','View Token Registrations'), ('Privilege Level: High','View Unpublished Forms'), ('Privilege Level: High','View Users'), ('Privilege Level: High','View Visit Attribute Types'), ('Privilege Level: High','View Visit Types'), ('Privilege Level: High','View Visits')/0xd SET FOREIGN_KEY_CHECKS=1/0xd
true
1048ed61ba455f945945beaf89a65e8656ebe8b8
SQL
CUNLUO/ETLSqueeSAR
/MetodosSQL/table poligono_resumen.sql
UTF-8
686
2.71875
3
[]
no_license
CREATE TABLE squeesar.poligono_resumen ( id_poligono bigint, direccion character varying(20), cant_registros bigint, height double precision, h_stdev double precision, vel double precision, v_stdev double precision, acc double precision, coherence double precision, a_stdev double precision, eff_area double precision, range double precision, azimuth double precision, CONSTRAINT poligono_resumen_pkey PRIMARY KEY (id_poligono) ) WITH ( OIDS=FALSE ); ALTER TABLE squeesar.poligono_resumen OWNER TO postgres; GRANT ALL ON TABLE squeesar.poligono_resumen TO postgres; GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE squeesar.poligono_resumen TO user_cmm;
true
bfd8ba9d17b185e05e6ccd9bfa2b666ec943ad74
SQL
hlavacek/uml-testing-lecture
/src/main/resources/import.sql
UTF-8
1,850
2.65625
3
[]
no_license
INSERT INTO CATEGORY(ID, NAME) VALUES (1, 'Fantasy'); INSERT INTO CATEGORY(ID, NAME) VALUES (2, 'Science Fiction'); INSERT INTO CATEGORY(ID, NAME) VALUES (3, 'Programming'); INSERT INTO AUTHOR(ID, NAME) VALUES (1, 'John Ronald Reuel Tolkien'); INSERT INTO AUTHOR(ID, NAME) VALUES (2, 'Douglas Adams'); INSERT INTO AUTHOR(ID, NAME) VALUES (3, 'Eric Freeman, Bert Bates'); INSERT INTO AUTHOR(ID, NAME) VALUES (4, 'Martin Fowler'); INSERT INTO AUTHOR(ID, NAME) VALUES (5, 'Steve Holzner'); INSERT INTO AUTHOR(ID, NAME) VALUES (6, 'Christopher L. Bennett'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (1, 'Lord of the rings: The Fellowship of the Ring', 1, 1, '0547928211'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (2, 'Lord of the rings: The Two Towers', 1, 1, '0547928203'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (3, 'Lord of the rings: The Return of the King', 1, 1, '054792819X'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (4, 'The Hitchhiker''s Guide to the Galaxy', 2, 2, '0345391802'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (5, 'The Restaurant at the End of the Universe', 2, 2, '0345391810'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (6, 'Head First Design patterns', 3, 3, '0596007124'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (7, 'Patterns of Enterprise Application Architecture', 4, 3, '0321127420'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (8, 'Design Patterns for Dummies', 5, 3, '0471798541'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (9, 'Star Trek Enterprise: A Choise of Futures', 6, 2, '1476706743'); INSERT INTO BOOK(ID, NAME, ID_AUTHOR, ID_CATEGORY, AMAZON_ID) VALUES (10, 'Star Trek Enterprise: Tower of Babel', 6, 2, '1476749647');
true
07d967af68a23af89e27fd2ad83ef7bf75184ce9
SQL
shardulmangade/Secure-Banking-System
/Database/storedprocedures/sp_deactivateManagerCEO3.sql
UTF-8
1,487
3.5
4
[]
no_license
/******************************************* Name : sp_deactivateManagerCEO3 Description : Deactivate a manager Called By : UI (LoginDBConnectionManager.java) Create By : Ram Kumar Kumaresan Modified Date : 10/26/2013 ********************************************/ DROP PROCEDURE IF EXISTS sp_deactivateManagerCEO3; DELIMITER $$ CREATE PROCEDURE sp_deactivateManagerCEO3( in inusername VARCHAR(100), OUT errorMessage VARCHAR(100) ) BEGIN IF EXISTS(SELECT 1 FROM tbl_all_users u, tbl_user_role r WHERE u.username = inusername and u.roles = 'ROLE_VALID_USER' and r.username = u.username and r.roles like '%MANAGER%' and r.roles not like '%ROLE_CORPORATE_MANAGER%') THEN IF EXISTS(SELECT 1 FROM tbl_corporate_deactivate_requests where username = inusername) THEN update tbl_corporate_deactivate_requests set ceo3 = 1 where username = inusername; IF EXISTS(SELECT 1 FROM tbl_corporate_deactivate_requests where username = inusername and ceo1 = 1 and ceo2 = 1 and ceo3 = 1) THEN update tbl_all_users set roles = "ROLE_INVALID_USER" where username = inusername; delete from tbl_corporate_deactivate_requests where username = inusername; END IF; ELSE insert into tbl_corporate_deactivate_requests values (inusername, 0,0,1); END IF; ELSE SET errorMessage = "No such manager exists. This action has been logged. Please don't try to hack into the system !!!"; END IF; END$$ DELIMITER ;
true
a1c9d35d7f878bee66e1c4fb2d4f639874031e6c
SQL
lhm2k1/Database
/DBQuanLyBanHang.sql
UTF-8
5,335
3.1875
3
[]
no_license
--create database QuanLyBanHang use QuanLyBanHang create table Sign_up( [Susername] nvarchar(50) not null, Spassword nvarchar(50) not null, Gmail nvarchar(50) not null, ) create table Nhanvien ( [Manhanvien] nvarchar(20) not null, Hoten nvarchar(50) not null, SDT nvarchar(10) not null, Gmail nvarchar(50) not null, constraint pk_Nhanvien primary key ([Manhanvien]), constraint ck_Nhanvien_SDT check(SDT like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]') ) create table Loaihang ( [Maloaihang] nvarchar(20) not null, Tenloaihang nvarchar(50) not null, constraint pk_Loaihang primary key ([Maloaihang]) ) create table Mathang ( [Mahang] nvarchar(20) not null, Tenhang nvarchar(100) not null, MaLoaihang nvarchar(20) , Soluongton int default 0, Gianhap decimal(12,3) default 0.0, Giaxuat decimal(12,3) default 0.0, constraint pk_Mathang primary key ([Mahang]), constraint fk_Mathang_Maloaihang foreign key (Maloaihang) references Loaihang([Maloaihang]), constraint ck_Mathang_Soluongton check(Soluongton >= 0), constraint ck_Mathang_Gianhap check (Gianhap >= 0 and Gianhap <= 999999999), constraint ck_Mathang_Giaxuat check (Giaxuat >= 0 and Giaxuat <= 999999999) ) create table Hoadonnhap ( [Mahoadonnhap] nvarchar(20) not null, Manhanvien nvarchar(20) not null, Ngaynhap date not null, Tongtien decimal(12,3) not null, constraint pk_Hoadonnhap primary key ([Mahoadonnhap]), constraint fk_Hoadonnhap_Manhanvien foreign key (Manhanvien) references Nhanvien([Manhanvien]), constraint ck_Hoadonnhap_Tongtien check(Tongtien >= 0 and Tongtien <= 999999999) ) create table Chitietmathangnhap ( [Mahoadonnhap] nvarchar(20) not null, [Mahang] nvarchar(20) not null, Soluongnhap int default 0, Gianhap decimal(12,3) default 0.0, Giamgia decimal(12,3) default 0.0, Thanhtien decimal(12,3) default 0.0, Nhacungcap nvarchar(50) , constraint pk_Chitietmathangnhap primary key ([Mahoadonnhap],[Mahang]), constraint ck_Chitietmathangnhap_Soluongnhap check(Soluongnhap >= 0), constraint ck_Chitietmathangnhap_Gianhap check (Gianhap >= 0 and Gianhap <= 999999999), constraint ck_Chitietmathangnhap_Giamgia check (Giamgia >= 0 and Giamgia <= Gianhap), constraint ck_Chiitetmathangnhap_Thanhtien check (Thanhtien >= 0 and Thanhtien <= 999999999) ) alter table Chitietmathangnhap add constraint fk_Chitietmathangnhap_Mahoadonhap foreign key ([Mahoadonnhap]) references Hoadonnhap([Mahoadonnhap]), constraint fk_Chitietmathangnhap_Mahang foreign key ([Mahang]) references Mathang([Mahang]) create table Khachhang ( [ID] nvarchar(20) not null, Diemtichluy decimal(12,3) default 0.0, SDT char(10) default '0000000000', constraint pk_Khachhang primary key ([ID]), constraint ck_Khachhang_SDT check(SDT like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'), constraint ck_Khachhang_Diemtichluy check(Diemtichluy >= 0 and Diemtichluy <= 999999999) ) create table Hoadonxuat ( [Mahoadonxuat] nvarchar(20) not null, Manhanvien nvarchar(20) not null, Ngayxuat date not null, Quay nvarchar(10) not null, ID nvarchar(20) , Tongtien decimal(12,3) default 0.0, constraint pk_Hoadonxuat_Mahoadonxuat primary key ([Mahoadonxuat]), constraint fk_Hoadonxuat_Manhanvien foreign key (Manhanvien) references Nhanvien([Manhanvien]), constraint ck_Hoadonxuat_Tongtien check(Tongtien >= 0 and Tongtien <= 999999999) ) create table Chitietmathangxuat ( [Mahoadonxuat] nvarchar(20) not null, [Mahang] nvarchar(20) not null, Loaihang nvarchar(50) , Soluongxuat int default 0, Giaxuat decimal(12,3) default 0.0, Giamgia decimal(12,3) default 0.0, Thanhtien decimal(12,3) default 0.0 constraint pk_Chitietmathangxuat primary key ([Mahoadonxuat],[Mahang]), constraint ck_Chitietmathangxuat_Soluongxuat check(Soluongxuat >= 0), constraint ck_Chitietmathangxuat_Gianhap check (Giaxuat >= 0 and Giaxuat <= 999999999), constraint ck_Chitietmathangxuat_Giamgia check (Giamgia >= 0 and Giamgia <= Giaxuat), constraint ck_Chiitetmathangxuat_Thanhtien check (Thanhtien >= 0 and Thanhtien <= 999999999) ) alter table Chitietmathangxuat add constraint fk_Chitietmathangxuat_Mahang foreign key (Mahang) references Mathang([Mahang]), constraint fk_Chitietmathangxuat_Mahoadonxuat foreign key (Mahoadonxuat) references Hoadonxuat([Mahoadonxuat]) alter table Nhanvien drop column Gmail /* drop table Log_in drop table Sign_up drop table Khachhang drop table Loaihang drop table Mathang drop table Nhanvien drop table Chitietmathangxuat drop table Chitietmathangnhap drop table Hoadonnhap drop table Hoadonxuat SELECT Tenhang, Soluongnhap, Mathang.Gianhap FROM (Chitietmathangnhap JOIN Mathang ON Chitietmathangnhap.Mahang = Mathang.Mahang) JOIN Hoadonnhap ON Chitietmathangnhap.Mahoadonnhap = Hoadonnhap.Mahoadonnhap WHERE Hoadonnhap.Mahoadonnhap = '00000001' --SELECT Tenhang, Mahang, Tenloaihang, Soluongton, Gianhap, Giaxuat FROM Mathang, Loaihang WHERE Mathang.MaLoaihang = Loaihang.Maloaihang */
true
b3c6f5b3cd1ebff205f9d6aeab6d13b97350a713
SQL
Ensembl/ensembl-biomart
/var_mart/tables/structvar__phenotype__dm/select.sql
UTF-8
489
3.578125
4
[]
no_license
SELECT sv.structural_variation_id AS structural_variation_id_2072_key, REPLACE(REPLACE(p.description, ",", ""), "&", "") as phenotype_name, s.name AS phenotype_source FROM VAR_DB.structural_variation sv LEFT OUTER JOIN VAR_DB.phenotype_feature pf ON (sv.variation_name=pf.object_id AND pf.type="StructuralVariation") LEFT OUTER JOIN VAR_DB.phenotype p ON (p.phenotype_id=pf.phenotype_id) LEFT OUTER JOIN VAR_DB.source s ON (pf.source_id=s.source_id)
true