sql
stringlengths
6
1.05M
DROP DATABASE IF EXISTS food_db; CREATE DATABASE food_db;
ALTER TABLE recall ADD COLUMN booking_number VARCHAR(32);
CREATE OR REPLACE FUNCTION zerobyte.TIME_TO_ZEROBYTE(t TIME) AS ( zerobyte.INT64_TO_ZEROBYTE(TIME_DIFF(t, '00:00:00', MICROSECOND)) );
-- PAGES DELETE FROM `sys_objects_page` WHERE `object`='bx_files_top'; INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES ('bx_files_top', '_bx_files_page_title_sys_entries_top', '_bx_files_page_title_entries_top', 'bx_files', 5, 2147483647, 1, 'files-top', 'page.php?i=files-top', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php'); DELETE FROM `sys_pages_blocks` WHERE `object`='bx_files_top'; INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES ('bx_files_top', 1, 'bx_files', '', '_bx_files_page_block_title_top_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:10:"browse_top";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1); -- MENUS DELETE FROM `sys_menu_items` WHERE `set_name`='bx_files_submenu' AND `name`='files-top'; INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `visibility_custom`, `active`, `copyable`, `order`) VALUES ('bx_files_submenu', 'bx_files', 'files-top', '_bx_files_menu_item_title_system_entries_top', '_bx_files_menu_item_title_entries_top', 'page.php?i=files-top', '', '', '', '', '', 2147483647, '', 1, 1, 3); -- GRIDS DELETE FROM `sys_grid_actions` WHERE `object`='bx_files_administration' AND `name`='audit_content'; INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES ('bx_files_administration', 'single', 'audit_content', '_bx_files_grid_action_title_adm_audit_content', 'search', 1, 0, 4);
<gh_stars>10-100 CREATE OR REPLACE FUNCTION pgl_ddl_deploy.enable(p_set_name text) RETURNS boolean LANGUAGE plpgsql AS $function$ DECLARE v_deployable BOOLEAN; v_result BOOLEAN; BEGIN SELECT pgl_ddl_deploy.deployment_check(p_set_name) INTO v_deployable; IF v_deployable THEN SELECT pgl_ddl_deploy.schema_execute(p_set_name, 'enable_sql') INTO v_result; RETURN v_result; ELSE RETURN v_deployable; END IF; END; $function$ ;
<filename>src/Database/EntAppSettingsDb/EntAppSettingsDb/dbo/Stored Procedures/CreateNewAppSettingSet.sql<gh_stars>0 -- ============================================= -- Author: <NAME> -- Create date: 07/05/2016 -- Description: Creates a base set of AppSettings for a new Tenant based on an existing Tenant -- ============================================= CREATE PROCEDURE CreateNewAppSettingsSet -- Add the parameters for the stored procedure here @NewTenantId int = 0, @TemplateTenantId int = 0 --copy settings from AS BEGIN IF (@NewTenantId IS NULL OR @NewTenantId=0) BEGIN PRINT 'ERROR: You must supply a NewTenantId other than zero.' RETURN(1) END IF (@TemplateTenantId IS NULL OR @TemplateTenantId=0) BEGIN PRINT 'ERROR: You must supply a TemplateTenantId other than zero.' RETURN(1) END IF (SELECT COUNT(*) FROM [dbo].[Tenant] WHERE [TenantId] = @NewTenantId) = 0 BEGIN PRINT 'ERROR: New Tenant does not exist in Tenant table.' RETURN(1) END IF (SELECT COUNT(*) FROM [dbo].[Tenant] WHERE [TenantId] = @TemplateTenantId) = 0 BEGIN PRINT 'ERROR: Template Tenant does not exist in Tenant table.' RETURN(1) END INSERT INTO [dbo].[AppSetting] ([SettingKey] ,[TenantId] ,[SettingValue] ,[SettingGroupId] ,[SettingSectionId] ,[TypeId] ,[IsLocked] ,[IsInternalOnly] ,[Description] ,[ModifiedDate] ,[ModifiedBy]) SELECT [SettingKey] ,@NewTenantId ,'!! TO BE CONFIGURED !!' ,[SettingGroupId] ,[SettingSectionId] ,[TypeId] ,[IsLocked] ,[IsInternalOnly] ,[Description] ,GETUTCDATE() ,SUSER_NAME() FROM [dbo].[AppSetting] WHERE [TenantId]=@TemplateTenantId -- Check for SQL Server errors. IF @@ERROR <> 0 BEGIN RETURN(2) END ELSE BEGIN -- SUCCESS!! RETURN(0) END END GO
INSERT INTO `object` (`id`, `entry`, `scale_x`) VALUES (1, 6145, 1), (2, 6145, 1), (3, 6145, 1), (4, 6145, 1), (5, 6145, 1), (6, 6145, 1), (7, 6145, 1), (8, 6145, 1), (9, 6145, 1), (10, 6145, 1), (11, 6145, 1), (12, 6491, 1), (13, 6491, 1), (14, 6491, 1), (15, 6491, 1), (16, 15271, 1), (17, 15271, 1), (18, 15271, 1), (19, 15271, 1), (20, 15271, 1), (21, 15271, 1), (22, 15271, 1), (23, 15271, 1), (24, 15271, 1), (25, 15271, 1), (26, 15271, 1), (27, 15271, 1), (28, 15271, 1), (29, 15271, 1), (30, 15271, 1), (31, 15271, 1), (32, 15271, 1), (33, 15271, 1), (34, 15271, 1), (35, 15271, 1), (36, 15271, 1), (37, 15271, 1), (38, 15271, 1), (39, 15271, 1), (40, 15271, 1), (41, 15271, 1), (42, 15271, 1), (43, 15271, 1), (44, 15271, 1), (45, 15271, 1), (46, 15271, 1), (47, 15271, 1), (48, 15271, 1), (49, 15271, 1), (50, 15271, 1), (51, 15271, 1), (52, 15271, 1), (53, 15271, 1), (54, 15271, 1), (55, 15271, 1), (56, 15271, 1), (57, 15271, 1), (58, 15271, 1), (59, 15271, 1), (60, 15271, 1), (61, 15271, 1), (62, 15271, 1), (63, 15271, 1), (64, 15271, 1), (65, 15273, 1), (66, 15273, 1), (67, 15273, 1), (68, 15273, 1), (69, 15273, 1), (70, 15273, 1), (71, 15273, 1), (72, 15273, 1), (73, 15273, 1), (74, 15273, 1), (75, 15273, 1), (76, 15273, 1), (77, 15273, 1), (78, 15273, 1), (79, 15273, 1), (80, 15273, 1), (81, 15273, 1), (82, 15273, 1), (83, 15273, 1), (84, 15273, 1), (85, 15273, 1), (86, 15274, 1), (87, 15274, 1), (88, 15274, 1), (89, 15274, 1), (90, 15274, 1), (91, 15274, 1), (92, 15274, 1), (93, 15274, 1), (94, 15274, 1), (95, 15274, 1), (96, 15274, 1), (97, 15274, 1), (98, 15274, 1), (99, 15274, 1), (100, 15274, 1), (101, 15274, 1), (102, 15274, 1), (103, 15274, 1), (104, 15274, 1), (105, 15274, 1), (106, 15274, 1), (107, 15274, 1), (108, 15274, 1), (109, 15274, 1), (110, 15274, 1), (111, 15274, 1), (112, 15274, 1), (113, 15274, 1), (114, 15274, 1), (115, 15274, 1), (116, 15274, 1), (117, 15274, 1), (118, 15274, 1), (119, 15274, 1), (120, 15274, 1), (121, 15274, 1), (122, 15274, 1), (123, 15274, 1), (124, 15274, 1), (125, 15274, 1), (126, 15274, 1), (127, 15274, 1), (128, 15274, 1), (129, 15274, 1), (130, 15274, 1), (131, 15274, 1), (132, 15274, 1), (133, 15278, 1), (134, 15281, 1), (135, 15291, 1), (136, 15292, 1), (137, 15294, 1), (138, 15294, 1), (139, 15294, 1), (140, 15294, 1), (141, 15294, 1), (142, 15294, 1), (143, 15294, 1), (144, 15294, 1), (145, 15294, 1), (146, 15294, 1), (147, 15294, 1), (148, 15294, 1), (149, 15294, 1), (150, 15294, 1), (151, 15294, 1), (152, 15294, 1), (153, 15294, 1), (154, 15294, 1), (155, 15294, 1), (156, 15294, 1), (157, 15294, 1), (158, 15294, 1), (159, 15294, 1), (160, 15294, 1), (161, 15294, 1), (162, 15294, 1), (163, 15294, 1), (164, 15294, 1), (165, 15294, 1), (166, 15294, 1), (167, 15294, 1), (168, 15294, 1), (169, 15294, 1), (170, 15294, 1), (171, 15294, 1), (172, 15294, 1), (173, 15294, 1), (174, 15294, 1), (175, 15294, 1), (176, 15294, 1), (177, 15294, 1), (178, 15294, 1), (179, 15294, 1), (180, 15294, 1), (181, 15294, 1), (182, 15294, 1), (183, 15294, 1), (184, 15294, 1), (185, 15294, 1), (186, 15294, 1), (187, 15294, 1), (188, 15294, 1), (189, 15294, 1), (190, 15296, 1), (191, 15297, 1), (192, 15298, 1), (193, 15298, 1), (194, 15298, 1), (195, 15298, 1), (196, 15298, 1), (197, 15301, 1), (198, 15366, 1), (199, 15366, 1), (200, 15366, 1), (201, 15366, 1), (202, 15366, 1), (203, 15366, 1), (204, 15366, 1), (205, 15366, 1), (206, 15366, 1), (207, 15366, 1), (208, 15366, 1), (209, 15366, 1), (210, 15366, 1), (211, 15366, 1), (212, 15366, 1), (213, 15366, 1), (214, 15366, 1), (215, 15366, 1), (216, 15366, 1), (217, 15366, 1), (218, 15366, 1), (219, 15366, 1), (220, 15366, 1), (221, 15366, 1), (222, 15366, 1), (223, 15366, 1), (224, 15366, 1), (225, 15366, 1), (226, 15366, 1), (227, 15366, 1), (228, 15367, 1), (229, 15371, 1), (230, 15371, 1), (231, 15371, 1), (232, 15371, 1), (233, 15371, 1), (234, 15371, 1), (235, 15371, 1), (236, 15371, 1), (237, 15371, 1), (238, 15372, 1), (239, 15372, 1), (240, 15372, 1), (241, 15372, 1), (242, 15372, 1), (243, 15372, 1), (244, 15372, 1), (245, 15372, 1), (246, 15372, 1), (247, 15372, 1), (248, 15372, 1), (249, 15372, 1), (250, 15372, 1), (251, 15372, 1), (252, 15372, 1), (253, 15372, 1), (254, 15372, 1), (255, 15372, 1), (256, 15372, 1), (257, 15372, 1), (258, 15372, 1), (259, 15372, 1), (260, 15372, 1), (261, 15372, 1), (262, 15397, 1), (263, 15398, 1), (264, 15399, 1), (265, 15400, 1), (266, 15401, 1), (267, 15402, 1), (268, 15403, 1), (269, 15404, 1), (270, 15405, 1), (271, 15406, 1), (272, 15407, 1), (273, 15408, 1), (274, 15409, 1), (275, 15416, 1), (276, 15417, 1), (277, 15418, 1), (278, 15420, 1), (279, 15433, 1), (280, 15493, 1), (281, 15501, 1), (282, 15635, 1), (283, 15635, 1), (284, 15635, 1), (285, 15635, 1), (286, 15635, 1), (287, 15635, 1), (288, 15635, 1), (289, 15636, 1), (290, 15636, 1), (291, 15636, 1), (292, 15636, 1), (293, 15636, 1), (294, 15636, 1), (295, 15636, 1), (296, 15636, 1), (297, 15636, 1), (298, 15636, 1), (299, 15636, 1), (300, 15636, 1), (301, 15636, 1), (302, 15636, 1), (303, 15636, 1), (304, 15636, 1), (305, 15636, 1), (306, 15636, 1), (307, 15636, 1), (308, 15636, 1), (309, 15636, 1), (310, 15636, 1), (311, 15636, 1), (312, 15636, 1), (313, 15636, 1), (314, 15636, 1), (315, 15636, 1), (316, 15636, 1), (317, 15636, 1), (318, 15636, 1), (319, 15636, 1), (320, 15636, 1), (321, 15636, 1), (322, 15636, 1), (323, 15636, 1), (324, 15636, 1), (325, 15636, 1), (326, 15636, 1), (327, 15637, 1), (328, 15637, 1), (329, 15637, 1), (330, 15637, 1), (331, 15637, 1), (332, 15637, 1), (333, 15637, 1), (334, 15637, 1), (335, 15637, 1), (336, 15637, 1), (337, 15637, 1), (338, 15637, 1), (339, 15637, 1), (340, 15637, 1), (341, 15637, 1), (342, 15637, 1), (343, 15637, 1), (344, 15637, 1), (345, 15637, 1), (346, 15637, 1), (347, 15637, 1), (348, 15637, 1), (349, 15637, 1), (350, 15637, 1), (351, 15637, 1), (352, 15637, 1), (353, 15637, 1), (354, 15637, 1), (355, 15637, 1), (356, 15637, 1), (357, 15637, 1), (358, 15637, 1), (359, 15637, 1), (360, 15637, 1), (361, 15637, 1), (362, 15637, 1), (363, 15637, 1), (364, 15637, 1), (365, 15637, 1), (366, 15637, 1), (367, 15637, 1), (368, 15637, 1), (369, 15637, 1), (370, 15637, 1), (371, 15638, 1), (372, 15638, 1), (373, 15638, 1), (374, 15638, 1), (375, 15638, 1), (376, 15638, 1), (377, 15638, 1), (378, 15638, 1), (379, 15638, 1), (380, 15638, 1), (381, 15638, 1), (382, 15638, 1), (383, 15638, 1), (384, 15638, 1), (385, 15638, 1), (386, 15638, 1), (387, 15638, 1), (388, 15638, 1), (389, 15638, 1), (390, 15641, 1), (391, 15641, 1), (392, 15641, 1), (393, 15641, 1), (394, 15641, 1), (395, 15641, 1), (396, 15641, 1), (397, 15641, 1), (398, 15641, 1), (399, 15641, 1), (400, 15641, 1), (401, 15641, 1), (402, 15641, 1), (403, 15641, 1), (404, 15642, 1), (405, 15642, 1), (406, 15642, 1), (407, 15642, 1), (408, 15642, 1), (409, 15642, 1), (410, 15642, 1), (411, 15642, 1), (412, 15642, 1), (413, 15642, 1), (414, 15642, 1), (415, 15642, 1), (416, 15642, 1), (417, 15642, 1), (418, 15642, 1), (419, 15642, 1), (420, 15642, 1), (421, 15642, 1), (422, 15642, 1), (423, 15643, 1), (424, 15643, 1), (425, 15643, 1), (426, 15643, 1), (427, 15643, 1), (428, 15643, 1), (429, 15643, 1), (430, 15643, 1), (431, 15643, 1), (432, 15643, 1), (433, 15643, 1), (434, 15643, 1), (435, 15643, 1), (436, 15643, 1), (437, 15643, 1), (438, 15643, 1), (439, 15643, 1), (440, 15643, 1), (441, 15644, 1), (442, 15644, 1), (443, 15644, 1), (444, 15644, 1), (445, 15644, 1), (446, 15644, 1), (447, 15644, 1), (448, 15644, 1), (449, 15644, 1), (450, 15644, 1), (451, 15644, 1), (452, 15644, 1), (453, 15644, 1), (454, 15644, 1), (455, 15644, 1), (456, 15644, 1), (457, 15644, 1), (458, 15644, 1), (459, 15644, 1), (460, 15644, 1), (461, 15644, 1), (462, 15644, 1), (463, 15644, 1), (464, 15644, 1), (465, 15644, 1), (466, 15644, 1), (467, 15644, 1), (468, 15644, 1), (469, 15644, 1), (470, 15644, 1), (471, 15644, 1), (472, 15644, 1), (473, 15644, 1), (474, 15644, 1), (475, 15644, 1), (476, 15644, 1), (477, 15644, 1), (478, 15644, 1), (479, 15644, 1), (480, 15644, 1), (481, 15644, 1), (482, 15644, 1), (483, 15644, 1), (484, 15644, 1), (485, 15644, 1), (486, 15644, 1), (487, 15644, 1), (488, 15644, 1), (489, 15644, 1), (490, 15644, 1), (491, 15644, 1), (492, 15644, 1), (493, 15644, 1), (494, 15644, 1), (495, 15644, 1), (496, 15644, 1), (497, 15644, 1), (498, 15644, 1), (499, 15644, 1), (500, 15644, 1), (501, 15644, 1), (502, 15644, 1), (503, 15644, 1), (504, 15644, 1), (505, 15644, 1), (506, 15644, 1), (507, 15644, 1), (508, 15645, 1), (509, 15645, 1), (510, 15645, 1), (511, 15645, 1), (512, 15645, 1), (513, 15645, 1), (514, 15645, 1), (515, 15645, 1), (516, 15645, 1), (517, 15645, 1), (518, 15645, 1), (519, 15645, 1), (520, 15645, 1), (521, 15647, 1), (522, 15647, 1), (523, 15647, 1), (524, 15647, 1), (525, 15647, 1), (526, 15647, 1), (527, 15647, 1), (528, 15647, 1), (529, 15647, 1), (530, 15647, 1), (531, 15647, 1), (532, 15647, 1), (533, 15648, 1), (534, 15648, 1), (535, 15648, 1), (536, 15648, 1), (537, 15648, 1), (538, 15648, 1), (539, 15648, 1), (540, 15648, 1), (541, 15648, 1), (542, 15648, 1), (543, 15648, 1), (544, 15648, 1), (545, 15648, 1), (546, 15649, 1), (547, 15649, 1), (548, 15649, 1), (549, 15649, 1), (550, 15649, 1), (551, 15649, 1), (552, 15649, 1), (553, 15649, 1), (554, 15649, 1), (555, 15649, 1), (556, 15649, 1), (557, 15649, 1), (558, 15649, 1), (559, 15649, 1), (560, 15649, 1), (561, 15649, 1), (562, 15649, 1), (563, 15649, 1), (564, 15649, 1), (565, 15649, 1), (566, 15649, 1), (567, 15649, 1), (568, 15649, 1), (569, 15649, 1), (570, 15649, 1), (571, 15649, 1), (572, 15649, 1), (573, 15649, 1), (574, 15649, 1), (575, 15649, 1), (576, 15649, 1), (577, 15649, 1), (578, 15649, 1), (579, 15649, 1), (580, 15649, 1), (581, 15649, 1), (582, 15649, 1), (583, 15649, 1), (584, 15649, 1), (585, 15649, 1), (586, 15649, 1), (587, 15649, 1), (588, 15649, 1), (589, 15649, 1), (590, 15649, 1), (591, 15649, 1), (592, 15649, 1), (593, 15649, 1), (594, 15649, 1), (595, 15649, 1), (596, 15649, 1), (597, 15649, 1), (598, 15649, 1), (599, 15649, 1), (600, 15649, 1), (601, 15649, 1), (602, 15649, 1), (603, 15649, 1), (604, 15649, 1), (605, 15649, 1), (606, 15649, 1), (607, 15649, 1), (608, 15649, 1), (609, 15650, 1), (610, 15650, 1), (611, 15650, 1), (612, 15650, 1), (613, 15650, 1), (614, 15650, 1), (615, 15650, 1), (616, 15650, 1), (617, 15650, 1), (618, 15650, 1), (619, 15650, 1), (620, 15650, 1), (621, 15650, 1), (622, 15650, 1), (623, 15650, 1), (624, 15650, 1), (625, 15650, 1), (626, 15650, 1), (627, 15650, 1), (628, 15650, 1), (629, 15650, 1), (630, 15650, 1), (631, 15650, 1), (632, 15650, 1), (633, 15650, 1), (634, 15650, 1), (635, 15650, 1), (636, 15650, 1), (637, 15650, 1), (638, 15650, 1), (639, 15650, 1), (640, 15650, 1), (641, 15650, 1), (642, 15650, 1), (643, 15650, 1), (644, 15650, 1), (645, 15650, 1), (646, 15650, 1), (647, 15650, 1), (648, 15650, 1), (649, 15650, 1), (650, 15650, 1), (651, 15650, 1), (652, 15650, 1), (653, 15650, 1), (654, 15650, 1), (655, 15650, 1), (656, 15650, 1), (657, 15650, 1), (658, 15650, 1), (659, 15650, 1), (660, 15650, 1), (661, 15650, 1), (662, 15650, 1), (663, 15650, 1), (664, 15650, 1), (665, 15650, 1), (666, 15650, 1), (667, 15650, 1), (668, 15650, 1), (669, 15650, 1), (670, 15650, 1), (671, 15650, 1), (672, 15650, 1), (673, 15650, 1), (674, 15650, 1), (675, 15650, 1), (676, 15650, 1), (677, 15650, 1), (678, 15650, 1), (679, 15650, 1), (680, 15650, 1), (681, 15650, 1), (682, 15650, 1), (683, 15650, 1), (684, 15650, 1), (685, 15650, 1), (686, 15650, 1), (687, 15650, 1), (688, 15650, 1), (689, 15650, 1), (690, 15650, 1), (691, 15650, 1), (692, 15650, 1), (693, 15650, 1), (694, 15650, 1), (695, 15650, 1), (696, 15650, 1), (697, 15650, 1), (698, 15650, 1), (699, 15650, 1), (700, 15650, 1), (701, 15650, 1), (702, 15650, 1), (703, 15650, 1), (704, 15650, 1), (705, 15650, 1), (706, 15650, 1), (707, 15650, 1), (708, 15650, 1), (709, 15650, 1), (710, 15650, 1), (711, 15650, 1), (712, 15650, 1), (713, 15650, 1), (714, 15650, 1), (715, 15650, 1), (716, 15650, 1), (717, 15650, 1), (718, 15650, 1), (719, 15650, 1), (720, 15650, 1), (721, 15650, 1), (722, 15650, 1), (723, 15650, 1), (724, 15650, 1), (725, 15650, 1), (726, 15650, 1), (727, 15650, 1), (728, 15650, 1), (729, 15650, 1), (730, 15650, 1), (731, 15650, 1), (732, 15650, 1), (733, 15650, 1), (734, 15650, 1), (735, 15650, 1), (736, 15650, 1), (737, 15651, 1), (738, 15651, 1), (739, 15651, 1), (740, 15651, 1), (741, 15651, 1), (742, 15651, 1), (743, 15651, 1), (744, 15651, 1), (745, 15651, 1), (746, 15651, 1), (747, 15651, 1), (748, 15651, 1), (749, 15651, 1), (750, 15651, 1), (751, 15651, 1), (752, 15651, 1), (753, 15651, 1), (754, 15651, 1), (755, 15651, 1), (756, 15651, 1), (757, 15651, 1), (758, 15651, 1), (759, 15651, 1), (760, 15651, 1), (761, 15651, 1), (762, 15651, 1), (763, 15651, 1), (764, 15651, 1), (765, 15651, 1), (766, 15651, 1), (767, 15651, 1), (768, 15651, 1), (769, 15651, 1), (770, 15651, 1), (771, 15651, 1), (772, 15651, 1), (773, 15651, 1), (774, 15651, 1), (775, 15651, 1), (776, 15651, 1), (777, 15651, 1), (778, 15651, 1), (779, 15651, 1), (780, 15651, 1), (781, 15651, 1), (782, 15651, 1), (783, 15651, 1), (784, 15651, 1), (785, 15651, 1), (786, 15651, 1), (787, 15651, 1), (788, 15651, 1), (789, 15651, 1), (790, 15651, 1), (791, 15651, 1), (792, 15651, 1), (793, 15651, 1), (794, 15651, 1), (795, 15651, 1), (796, 15651, 1), (797, 15651, 1), (798, 15651, 1), (799, 15651, 1), (800, 15651, 1), (801, 15651, 1), (802, 15651, 1), (803, 15651, 1), (804, 15651, 1), (805, 15651, 1), (806, 15651, 1), (807, 15651, 1), (808, 15651, 1), (809, 15651, 1), (810, 15651, 1), (811, 15651, 1), (812, 15651, 1), (813, 15651, 1), (814, 15651, 1), (815, 15651, 1), (816, 15651, 1), (817, 15652, 1), (818, 15652, 1), (819, 15652, 1), (820, 15652, 1), (821, 15652, 1), (822, 15652, 1), (823, 15652, 1), (824, 15652, 1), (825, 15652, 1), (826, 15652, 1), (827, 15652, 1), (828, 15652, 1), (829, 15652, 1), (830, 15652, 1), (831, 15652, 1), (832, 15652, 1), (833, 15652, 1), (834, 15652, 1), (835, 15652, 1), (836, 15652, 1), (837, 15652, 1), (838, 15652, 1), (839, 15652, 1), (840, 15652, 1), (841, 15652, 1), (842, 15652, 1), (843, 15652, 1), (844, 15652, 1), (845, 15652, 1), (846, 15652, 1), (847, 15652, 1), (848, 15652, 1), (849, 15652, 1), (850, 15654, 1), (851, 15654, 1), (852, 15654, 1), (853, 15654, 1), (854, 15654, 1), (855, 15654, 1), (856, 15654, 1), (857, 15654, 1), (858, 15654, 1), (859, 15654, 1), (860, 15654, 1), (861, 15654, 1), (862, 15654, 1), (863, 15654, 1), (864, 15654, 1), (865, 15654, 1), (866, 15654, 1), (867, 15654, 1), (868, 15654, 1), (869, 15654, 1), (870, 15654, 1), (871, 15654, 1), (872, 15654, 1), (873, 15654, 1), (874, 15654, 1), (875, 15654, 1), (876, 15654, 1), (877, 15654, 1), (878, 15654, 1), (879, 15654, 1), (880, 15654, 1), (881, 15654, 1), (882, 15654, 1), (883, 15654, 1), (884, 15654, 1), (885, 15654, 1), (886, 15654, 1), (887, 15654, 1), (888, 15654, 1), (889, 15654, 1), (890, 15654, 1), (891, 15654, 1), (892, 15654, 1), (893, 15654, 1), (894, 15654, 1), (895, 15654, 1), (896, 15654, 1), (897, 15655, 1), (898, 15655, 1), (899, 15655, 1), (900, 15655, 1), (901, 15655, 1), (902, 15655, 1), (903, 15655, 1), (904, 15655, 1), (905, 15655, 1), (906, 15655, 1), (907, 15655, 1), (908, 15655, 1), (909, 15655, 1), (910, 15655, 1), (911, 15655, 1), (912, 15655, 1), (913, 15656, 1), (914, 15656, 1), (915, 15656, 1), (916, 15656, 1), (917, 15656, 1), (918, 15656, 1), (919, 15656, 1), (920, 15656, 1), (921, 15656, 1), (922, 15656, 1), (923, 15656, 1), (924, 15656, 1), (925, 15656, 1), (926, 15656, 1), (927, 15656, 1), (928, 15656, 1), (929, 15656, 1), (930, 15656, 1), (931, 15656, 1), (932, 15656, 1), (933, 15656, 1), (934, 15656, 1), (935, 15656, 1), (936, 15656, 1), (937, 15656, 1), (938, 15656, 1), (939, 15657, 1), (940, 15657, 1), (941, 15657, 1), (942, 15657, 1), (943, 15657, 1), (944, 15657, 1), (945, 15657, 1), (946, 15657, 1), (947, 15657, 1), (948, 15657, 1), (949, 15657, 1), (950, 15658, 1), (951, 15658, 1), (952, 15658, 1), (953, 15658, 1), (954, 15658, 1), (955, 15658, 1), (956, 15658, 1), (957, 15658, 1), (958, 15658, 1), (959, 15658, 1), (960, 15658, 1), (961, 15658, 1), (962, 15658, 1), (963, 15658, 1), (964, 15658, 1), (965, 15658, 1), (966, 15658, 1), (967, 15658, 1), (968, 15658, 1), (969, 15658, 1), (970, 15658, 1), (971, 15658, 1), (972, 15658, 1), (973, 15658, 1), (974, 15658, 1), (975, 15658, 1), (976, 15658, 1), (977, 15658, 1), (978, 15658, 1), (979, 15658, 1), (980, 15658, 1), (981, 15658, 1), (982, 15658, 1), (983, 15658, 1), (984, 15658, 1), (985, 15658, 1), (986, 15658, 1), (987, 15658, 1), (988, 15658, 1), (989, 15658, 1), (990, 15668, 1), (991, 15668, 1), (992, 15668, 1), (993, 15668, 1), (994, 15668, 1), (995, 15668, 1), (996, 15668, 1), (997, 15668, 1), (998, 15668, 1), (999, 15668, 1), (1000, 15668, 1), (1001, 15668, 1), (1002, 15668, 1), (1003, 15668, 1), (1004, 15668, 1), (1005, 15668, 1), (1006, 15668, 1), (1007, 15668, 1), (1008, 15668, 1), (1009, 15668, 1), (1010, 15668, 1), (1011, 15668, 1), (1012, 15668, 1), (1013, 15668, 1), (1014, 15668, 1), (1015, 15668, 1), (1016, 15668, 1), (1017, 15668, 1), (1018, 15668, 1), (1019, 15668, 1), (1020, 15668, 1), (1021, 15668, 1), (1022, 15668, 1), (1023, 15668, 1), (1024, 15668, 1), (1025, 15668, 1), (1026, 15668, 1), (1027, 15668, 1), (1028, 15668, 1), (1029, 15668, 1), (1030, 15668, 1), (1031, 15668, 1), (1032, 15668, 1), (1033, 15668, 1), (1034, 15668, 1), (1035, 15668, 1), (1036, 15668, 1), (1037, 15668, 1), (1038, 15668, 1), (1039, 15668, 1), (1040, 15669, 1), (1041, 15669, 1), (1042, 15669, 1), (1043, 15669, 1), (1044, 15669, 1), (1045, 15669, 1), (1046, 15669, 1), (1047, 15669, 1), (1048, 15669, 1), (1049, 15669, 1), (1050, 15669, 1), (1051, 15669, 1), (1052, 15669, 1), (1053, 15669, 1), (1054, 15669, 1), (1055, 15669, 1), (1056, 15669, 1), (1057, 15670, 1), (1058, 15670, 1), (1059, 15670, 1), (1060, 15670, 1), (1061, 15670, 1), (1062, 15670, 1), (1063, 15670, 1), (1064, 15670, 1), (1065, 15670, 1), (1066, 15670, 1), (1067, 15670, 1), (1068, 15670, 1), (1069, 15670, 1), (1070, 15670, 1), (1071, 15670, 1), (1072, 15670, 1), (1073, 15670, 1), (1074, 15670, 1), (1075, 15670, 1), (1076, 15670, 1), (1077, 15670, 1), (1078, 15670, 1), (1079, 15670, 1), (1080, 15670, 1), (1081, 15670, 1), (1082, 15670, 1), (1083, 15670, 1), (1084, 15670, 1), (1085, 15670, 1), (1086, 15670, 1), (1087, 15670, 1), (1088, 15670, 1), (1089, 15670, 1), (1090, 15670, 1), (1091, 15670, 1), (1092, 15670, 1), (1093, 15670, 1), (1094, 15670, 1), (1095, 15670, 1), (1096, 15670, 1), (1097, 15670, 1), (1098, 15670, 1), (1099, 15670, 1), (1100, 15670, 1), (1101, 15670, 1), (1102, 15670, 1), (1103, 15670, 1), (1104, 15670, 1), (1105, 15670, 1), (1106, 15670, 1), (1107, 15670, 1), (1108, 15670, 1), (1109, 15670, 1), (1110, 15670, 1), (1111, 15670, 1), (1112, 15670, 1), (1113, 15670, 1), (1114, 15670, 1), (1115, 15670, 1), (1116, 15670, 1), (1117, 15670, 1), (1118, 15670, 1), (1119, 15670, 1), (1120, 15670, 1), (1121, 15670, 1), (1122, 15670, 1), (1123, 15670, 1), (1124, 15670, 1), (1125, 15670, 1), (1126, 15670, 1), (1127, 15670, 1), (1128, 15670, 1), (1129, 15670, 1), (1130, 15670, 1), (1131, 15920, 1), (1132, 15921, 1), (1133, 15924, 1), (1134, 15937, 1), (1135, 15938, 1), (1136, 15938, 1), (1137, 15938, 1), (1138, 15938, 1), (1139, 15938, 1), (1140, 15938, 1), (1141, 15938, 1), (1142, 15938, 1), (1143, 15938, 1), (1144, 15938, 1), (1145, 15938, 1), (1146, 15938, 1), (1147, 15938, 1), (1148, 15938, 1), (1149, 15938, 1), (1150, 15938, 1), (1151, 15938, 1), (1152, 15938, 1), (1153, 15939, 1), (1154, 15940, 1), (1155, 15941, 1), (1156, 15942, 1), (1157, 15945, 1), (1158, 15946, 1), (1159, 15949, 1), (1160, 15951, 1), (1161, 15965, 1), (1162, 15965, 1), (1163, 15965, 1), (1164, 15965, 1), (1165, 15966, 1), (1166, 15966, 1), (1167, 15966, 1), (1168, 15966, 1), (1169, 15966, 1), (1170, 15966, 1), (1171, 15966, 1), (1172, 15966, 1), (1173, 15966, 1), (1174, 15966, 1), (1175, 15966, 1), (1176, 15966, 1), (1177, 15966, 1), (1178, 15966, 1), (1179, 15966, 1), (1180, 15966, 1), (1181, 15966, 1), (1182, 15966, 1), (1183, 15966, 1), (1184, 15966, 1), (1185, 15966, 1), (1186, 15966, 1), (1187, 15966, 1), (1188, 15966, 1), (1189, 15966, 1), (1190, 15967, 1), (1191, 15967, 1), (1192, 15967, 1), (1193, 15967, 1), (1194, 15967, 1), (1195, 15967, 1), (1196, 15967, 1), (1197, 15967, 1), (1198, 15967, 1), (1199, 15967, 1), (1200, 15967, 1), (1201, 15967, 1), (1202, 15967, 1), (1203, 15967, 1), (1204, 15967, 1), (1205, 15967, 1), (1206, 15967, 1), (1207, 15967, 1), (1208, 15967, 1), (1209, 15967, 1), (1210, 15967, 1), (1211, 15967, 1), (1212, 15967, 1), (1213, 15967, 1), (1214, 15968, 1), (1215, 15968, 1), (1216, 15968, 1), (1217, 15968, 1), (1218, 15968, 1), (1219, 15969, 1), (1220, 15970, 1), (1221, 15971, 1), (1222, 15971, 1), (1223, 15971, 1), (1224, 15971, 1), (1225, 15971, 1), (1226, 16144, 1), (1227, 16147, 1), (1228, 16160, 1), (1229, 16161, 1), (1230, 16162, 1), (1231, 16162, 1), (1232, 16162, 1), (1233, 16162, 1), (1234, 16162, 1), (1235, 16162, 1), (1236, 16162, 1), (1237, 16162, 1), (1238, 16162, 1), (1239, 16162, 1), (1240, 16162, 1), (1241, 16162, 1), (1242, 16162, 1), (1243, 16162, 1), (1244, 16162, 1), (1245, 16162, 1), (1246, 16162, 1), (1247, 16162, 1), (1248, 16162, 1), (1249, 16162, 1), (1250, 16183, 1), (1251, 16185, 1), (1252, 16186, 1), (1253, 16192, 1), (1254, 16196, 1), (1255, 16210, 1), (1256, 16221, 1), (1257, 16221, 1), (1258, 16221, 1), (1259, 16221, 1), (1260, 16221, 1), (1261, 16221, 1), (1262, 16221, 1), (1263, 16221, 1), (1264, 16221, 1), (1265, 16221, 1), (1266, 16221, 1), (1267, 16221, 1), (1268, 16221, 1), (1269, 16221, 1), (1270, 16221, 1), (1271, 16221, 1), (1272, 16221, 1), (1273, 16221, 1), (1274, 16221, 1), (1275, 16221, 1), (1276, 16221, 1), (1277, 16222, 1), (1278, 16222, 1), (1279, 16222, 1), (1280, 16222, 1), (1281, 16222, 1), (1282, 16222, 1), (1283, 16222, 1), (1284, 16222, 1), (1285, 16222, 1), (1286, 16222, 1), (1287, 16222, 1), (1288, 16222, 1), (1289, 16222, 1), (1290, 16222, 1), (1291, 16222, 1), (1292, 16222, 1), (1293, 16222, 1), (1294, 16222, 1), (1295, 16222, 1), (1296, 16222, 1), (1297, 16222, 1), (1298, 16222, 1), (1299, 16222, 1), (1300, 16222, 1), (1301, 16222, 1), (1302, 16222, 1), (1303, 16222, 1), (1304, 16222, 1), (1305, 16222, 1), (1306, 16222, 1), (1307, 16222, 1), (1308, 16222, 1), (1309, 16222, 1), (1310, 16222, 1), (1311, 16222, 1), (1312, 16222, 1), (1313, 16222, 1), (1314, 16222, 1), (1315, 16222, 1), (1316, 16222, 1), (1317, 16222, 1), (1318, 16257, 1), (1319, 16258, 1), (1320, 16259, 1), (1321, 16260, 1), (1322, 16261, 1), (1323, 16262, 1), (1324, 16263, 1), (1325, 16264, 1), (1326, 16266, 1), (1327, 16267, 1), (1328, 16269, 1), (1329, 16270, 1), (1330, 16271, 1), (1331, 16272, 1), (1332, 16273, 1), (1333, 16275, 1), (1334, 16276, 1), (1335, 16277, 1), (1336, 16278, 1), (1337, 16279, 1), (1338, 16280, 1), (1339, 16294, 1), (1340, 16362, 1), (1341, 16366, 1), (1342, 16367, 1), (1343, 16397, 1), (1344, 16443, 1), (1345, 16444, 1), (1346, 16854, 1), (1347, 16855, 1), (1348, 16860, 1), (1349, 16862, 1), (1350, 16916, 1), (1351, 16923, 1), (1352, 16924, 1), (1353, 17005, 1), (1354, 17056, 1), (1355, 17056, 1), (1356, 17056, 1), (1357, 17056, 1), (1358, 17056, 1), (1359, 17056, 1), (1360, 17056, 1), (1361, 17056, 1), (1362, 17056, 1), (1363, 17056, 1), (1364, 17056, 1), (1365, 17056, 1), (1366, 17056, 1), (1367, 17056, 1), (1368, 17056, 1), (1369, 17056, 1), (1370, 17807, 1), (1371, 17849, 1), (1372, 18277, 1), (1373, 18926, 1), (1374, 18929, 1), (1375, 18947, 1), (1376, 18951, 1), (1377, 18954, 1), (1378, 19169, 1), (1379, 19169, 1), (1380, 19169, 1), (1381, 19169, 1), (1382, 19169, 1), (1383, 19169, 1), (1384, 19169, 1), (1385, 19169, 1), (1386, 19169, 1), (1387, 19169, 1), (1388, 19280, 1), (1389, 19281, 1), (1390, 19882, 1), (1391, 20217, 1), (1392, 20220, 1), (1393, 20222, 1), (1394, 20223, 1), (1395, 20224, 1), (1396, 23971, 1), (1397, 23971, 1), (1398, 23971, 1), (1399, 23971, 1), (1400, 23973, 1);
<filename>db.sql -- MySQL dump 10.13 Distrib 5.5.47, for Win32 (x86) -- -- Host: localhost Database: shop -- ------------------------------------------------------ -- Server version 5.5.47 /*!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 `sp_address` -- DROP TABLE IF EXISTS `sp_address`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_address` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '地址ID', `name` varchar(10) NOT NULL DEFAULT '' COMMENT '收货人', `phone` char(11) NOT NULL DEFAULT '' COMMENT '联系电话', `prov` varchar(20) NOT NULL DEFAULT '' COMMENT '省', `city` varchar(20) NOT NULL DEFAULT '' COMMENT '市', `dist` varchar(20) NOT NULL DEFAULT '' COMMENT '区', `address` varchar(150) NOT NULL DEFAULT '' COMMENT '详细地址', `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱地址', `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='地址表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_address` -- LOCK TABLES `sp_address` WRITE; /*!40000 ALTER TABLE `sp_address` DISABLE KEYS */; INSERT INTO `sp_address` VALUES (2,'林嘉峡','18927400385','北京','东城区','','桥洞下','<EMAIL>',1),(3,'林逸','13333333333','北京','东城区','','武当','<EMAIL>',1); /*!40000 ALTER TABLE `sp_address` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_admin` -- DROP TABLE IF EXISTS `sp_admin`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_admin` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', `username` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '用户账号', `name` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '用户昵称', `password` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '密码', `gender` tinyint(3) unsigned NOT NULL COMMENT '性别:1:男0:女', `phone` char(11) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '手机号码', `email` varchar(25) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '邮箱地址', `is_use` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否使用:1:使用0:禁用', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_admin` -- LOCK TABLES `sp_admin` WRITE; /*!40000 ALTER TABLE `sp_admin` DISABLE KEYS */; INSERT INTO `sp_admin` VALUES (1,'chaojiwudiqiang','叶师傅','63573e3d6b8be995be619981b0fa6bda',1,'18927400385','<EMAIL>',1,1526799645,1527858968),(2,'woyaodashige','叶问','ce8db815742bc1320ae20a10c2d0ac9d',0,'13333333333','<EMAIL>',1,1526799683,1526808703),(3,'shenqibaobei','神奇宝贝','ce8db815742bc1320ae20a10c2d0ac9d',1,'13333333333','<EMAIL>',0,1526956071,0),(4,'wudimeishaonv','无敌美少女','<KEY>',1,'13333333333','<EMAIL>',1,1526956131,0),(5,'chaojiwudimei','超级无敌美少女','<KEY>',1,'13333333333','<EMAIL>',1,1526956188,0),(6,'miaowazhongzi','妙蛙种子','ce8db815742bc1320ae20a10c2d0ac9d',1,'13333333333','<EMAIL>',1,1526956221,1526998316),(7,'zaijiansunwukong','再见孙悟空','63573e3d6b8be995be619981b0fa6bda',1,'13333333333','<EMAIL>',1,1526957360,0); /*!40000 ALTER TABLE `sp_admin` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_admin_role` -- DROP TABLE IF EXISTS `sp_admin_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_admin_role` ( `admin_id` tinyint(3) unsigned NOT NULL COMMENT '用户ID', `role_id` tinyint(3) unsigned NOT NULL COMMENT '角色ID', KEY `admin_id` (`admin_id`) USING BTREE, KEY `role_id` (`role_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户角色表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_admin_role` -- LOCK TABLES `sp_admin_role` WRITE; /*!40000 ALTER TABLE `sp_admin_role` DISABLE KEYS */; INSERT INTO `sp_admin_role` VALUES (2,2),(2,1),(3,3),(4,3),(5,3),(6,3),(7,2),(1,0); /*!40000 ALTER TABLE `sp_admin_role` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_advert` -- DROP TABLE IF EXISTS `sp_advert`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_advert` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `name` varchar(50) NOT NULL DEFAULT '' COMMENT '公司名称', `sm_pic` varchar(150) NOT NULL DEFAULT '' COMMENT '缩略图', `pic` varchar(150) NOT NULL DEFAULT '' COMMENT '图片路径', `url` varchar(150) NOT NULL DEFAULT '' COMMENT '广告链接地址', `status` tinyint(3) unsigned NOT NULL COMMENT '状态', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='广告表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_advert` -- LOCK TABLES `sp_advert` WRITE; /*!40000 ALTER TABLE `sp_advert` DISABLE KEYS */; INSERT INTO `sp_advert` VALUES (2,'秒滴科技有限公司','20180605\\thumb_730667133a97934d07b20513a5e32521.jpg','20180605\\730667133a97934d07b20513a5e32521.jpg','http://www.miaodiyun.com/?qmymark=dedcbe590015c3e82cc9bbfc7f3a1e74#B_vid=11936665384569322600',1,1528185859,1528185920),(3,'牵引力有限公司','20180605\\thumb_b6403e2f02bf4e4e7dfae8d23a8a3cc9.jpg','20180605\\b6403e2f02bf4e4e7dfae8d23a8a3cc9.jpg','/',1,1528186013,1528245494); /*!40000 ALTER TABLE `sp_advert` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_attribute` -- DROP TABLE IF EXISTS `sp_attribute`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_attribute` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '属性ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '属性名称', `choice` tinyint(3) unsigned NOT NULL COMMENT '属性可选:0:唯一 1:可选', `values` varchar(150) NOT NULL DEFAULT '' COMMENT '属性的可选值,多个可选值用,隔开', `type_id` mediumint(8) unsigned NOT NULL COMMENT '所属类型', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='属性表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_attribute` -- LOCK TABLES `sp_attribute` WRITE; /*!40000 ALTER TABLE `sp_attribute` DISABLE KEYS */; INSERT INTO `sp_attribute` VALUES (1,'直径',1,'20cm,25cm,30cm,35cm',1,1527748667,1528262777),(2,'材料',0,'不锈钢,不锈钢内丹,304不锈钢',1,1527748720,1528257575),(4,'容量',1,'1L,2L,3L,4L,5L',1,1527835850,1528262699),(5,'大家说',0,'',1,1528262840,0),(6,'功能',0,'炖,煮,火锅,蒸,焖,炒,炸,铁板烧,定时,预约,煮饭,煲仔饭,蛋糕,酸奶',1,1528262884,1528263132); /*!40000 ALTER TABLE `sp_attribute` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_banner` -- DROP TABLE IF EXISTS `sp_banner`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_banner` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'bannerID', `name` varchar(25) NOT NULL DEFAULT '' COMMENT 'banner名称', `sm_pic` varchar(150) NOT NULL DEFAULT '' COMMENT '缩略图', `pic` varchar(150) NOT NULL DEFAULT '' COMMENT 'banner图', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='banner表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_banner` -- LOCK TABLES `sp_banner` WRITE; /*!40000 ALTER TABLE `sp_banner` DISABLE KEYS */; INSERT INTO `sp_banner` VALUES (1,'轮播一','20180604\\thumb_6cede7f2a5dc94e469dfacb858ba5ed8.jpg','20180604\\6cede7f2a5dc94e469dfacb858ba5ed8.jpg',1528119594,1528119811),(2,'轮播二','20180604\\thumb_86b9e1093a774b279b12f49e9ab5bb3b.jpg','20180604\\86b9e1093a774b279b12f49e9ab5bb3b.jpg',1528119880,0),(3,'轮播三','20180604\\thumb_a40a83aaf44f617724f4142a94c19f00.jpg','20180604\\a40a83aaf44f617724f4142a94c19f00.jpg',1528119897,1528121983); /*!40000 ALTER TABLE `sp_banner` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_brand` -- DROP TABLE IF EXISTS `sp_brand`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_brand` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '品牌ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '品牌名称', `english` varchar(30) NOT NULL DEFAULT '' COMMENT '品牌英文名称', `url` varchar(150) NOT NULL DEFAULT '' COMMENT '品牌链接地址', `sm_logo` varchar(150) NOT NULL DEFAULT '' COMMENT '品牌logo缩略图', `logo` varchar(150) NOT NULL DEFAULT '' COMMENT '品牌logo', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='品牌表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_brand` -- LOCK TABLES `sp_brand` WRITE; /*!40000 ALTER TABLE `sp_brand` DISABLE KEYS */; INSERT INTO `sp_brand` VALUES (1,'小熊','Bear','https://baike.baidu.com/item/%E5%B0%8F%E7%86%8A%E7%94%B5%E5%99%A8/2871066?fr=aladdin','20180604\\thumb_482dffc35e20f837dfe419df912309e3.png','20180604\\482dffc35e20f837dfe419df912309e3.png',1527318182,1528122356),(2,'苏泊尔','Supor','https://baike.baidu.com/item/%E8%8B%8F%E6%B3%8A%E5%B0%94/10963024?fr=aladdin','20180604\\thumb_cb25eba123ebf781d7e361c1daae4321.jpg','20180604\\cb25eba123ebf781d7e361c1daae4321.jpg',1527319839,1528122346),(3,'美的','Midea','https://baike.baidu.com/item/%E7%BE%8E%E7%9A%84%E9%9B%86%E5%9B%A2/9590056?fromtitle=%E7%BE%8E%E7%9A%84&amp;fromid=1500709&amp;fr=aladdin','20180604\\thumb_dedaf4a9d868863d86e6cdeb412dc503.jpg','20180604\\dedaf4a9d868863d86e6cdeb412dc503.jpg',1527344183,1528122339),(4,'九阳','Joyoung','https://baike.baidu.com/item/%E4%B9%9D%E9%98%B3/9007602?fr=aladdin','20180604\\thumb_370d183aaba88d53f132f1ffde4de96c.jpg','20180604\\370d183aaba88d53f132f1ffde4de96c.jpg',1527602385,1528122315); /*!40000 ALTER TABLE `sp_brand` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_cart` -- DROP TABLE IF EXISTS `sp_cart`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_cart` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '购物车ID', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `goods_attr_id` varchar(50) NOT NULL DEFAULT '' COMMENT '商品属性ID', `goods_number` smallint(5) unsigned NOT NULL COMMENT '购买数量', `member_id` char(32) NOT NULL DEFAULT '' COMMENT '会员ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='购物车表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_cart` -- LOCK TABLES `sp_cart` WRITE; /*!40000 ALTER TABLE `sp_cart` DISABLE KEYS */; INSERT INTO `sp_cart` VALUES (8,2,'51,54',1,'1'),(9,2,'54,65',1,'1'); /*!40000 ALTER TABLE `sp_cart` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_category` -- DROP TABLE IF EXISTS `sp_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_category` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类ID', `name` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '分类名称', `pid` smallint(5) unsigned NOT NULL COMMENT '上级分类', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='分类表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_category` -- LOCK TABLES `sp_category` WRITE; /*!40000 ALTER TABLE `sp_category` DISABLE KEYS */; INSERT INTO `sp_category` VALUES (1,'早餐神器 极速享受',0,1526999100,0),(2,'懒人厨房 百变料理',0,1526999107,0),(3,'养生至尚 极致生活',0,1526999113,1527859895),(4,'早餐神器',1,1527867273,1527923358),(5,'极速享受',1,1527923375,0),(6,'懒人厨房',2,1527923384,0),(7,'百变料理',2,1527923394,0),(8,'养生至尚',3,1527923407,0),(9,'极致生活',3,1527923476,0); /*!40000 ALTER TABLE `sp_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_comment` -- DROP TABLE IF EXISTS `sp_comment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_comment` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论ID', `content` text NOT NULL COMMENT '评论内容', `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `create_time` int(10) unsigned NOT NULL COMMENT '评论时间', `agree_star` tinyint(3) unsigned NOT NULL COMMENT '满意度评星', `speed_star` tinyint(3) unsigned NOT NULL COMMENT '送货速度评星', `pack_star` tinyint(3) unsigned NOT NULL COMMENT '包装评星', `sm_pic` varchar(150) NOT NULL DEFAULT '' COMMENT '缩略图', `pic` varchar(150) NOT NULL DEFAULT '' COMMENT '评论图片', `evalutes` tinyint(3) unsigned NOT NULL COMMENT '买家印象', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评论表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_comment` -- LOCK TABLES `sp_comment` WRITE; /*!40000 ALTER TABLE `sp_comment` DISABLE KEYS */; /*!40000 ALTER TABLE `sp_comment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_constact` -- DROP TABLE IF EXISTS `sp_constact`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_constact` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称', `content` text NOT NULL COMMENT '内容', `url` varchar(150) NOT NULL DEFAULT '' COMMENT '路由', `img` varchar(150) NOT NULL DEFAULT '' COMMENT '图片', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='联系我们表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_constact` -- LOCK TABLES `sp_constact` WRITE; /*!40000 ALTER TABLE `sp_constact` DISABLE KEYS */; INSERT INTO `sp_constact` VALUES (1,'公司logo','','/','20180605\\e6749533b25b333eca0f3cc4d6fe2e23.jpg',1528174435),(2,'QQ公众号','','/','20180605\\229a97164f01236c4d5c7b49bd9d2e27.png',1528164642),(3,'QQ公众号','','/','20180605\\6ca36c1f6aed51b387dba000d06e5eb4.png',1528164677),(4,'520余家售后网点','','/','20180605\\61ce00d17f62b878b27a4c444f30b5c3.png',1528164691),(5,'520余家售后网点','','/','20180605\\cf2898e531519c5ca69302fc6688efc9.png',1528164702),(6,'帮助中心','','/','',1528164815),(7,'账号管理','','/','',1528164823),(8,'购物指南','','/','',1528164830),(9,'订单操作','','','',0),(10,'帮助中心','','','',0),(11,'账号管理','','','',0),(12,'购物指南','','','',0),(13,'订单操作','','','',0),(14,'帮助中心','','','',0),(15,'账号管理','','','',0),(16,'购物指南','','','',0),(17,'订单操作','','','',0),(18,'帮助中心','','','',0),(19,'账号管理','','','',0),(20,'购物指南','','','',0),(21,'订单操作','','','',0),(22,'在 线 客 服','400-400-4000','/','',1528165044),(23,'','©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号','','',1528174169),(24,'','违法和不良信息举报电话:185-0130-1238,本网站所列数据,除特殊说明,所有数据均出自我司实验室测试','','',1528165154); /*!40000 ALTER TABLE `sp_constact` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_favourable_price` -- DROP TABLE IF EXISTS `sp_favourable_price`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_favourable_price` ( `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `number` int(10) unsigned NOT NULL COMMENT '优惠数量', `price` decimal(10,2) NOT NULL COMMENT '优惠价格', PRIMARY KEY (`goods_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠价格表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_favourable_price` -- LOCK TABLES `sp_favourable_price` WRITE; /*!40000 ALTER TABLE `sp_favourable_price` DISABLE KEYS */; /*!40000 ALTER TABLE `sp_favourable_price` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_goods` -- DROP TABLE IF EXISTS `sp_goods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_goods` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品ID', `name` varchar(45) NOT NULL DEFAULT '' COMMENT '商品名称', `cat_id` mediumint(8) unsigned NOT NULL COMMENT '主分类ID', `brand_id` mediumint(8) unsigned NOT NULL COMMENT '品牌ID', `type_id` mediumint(8) unsigned NOT NULL COMMENT '分类ID', `supermarket_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价', `shop_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '本店价', `credit` int(10) unsigned NOT NULL COMMENT '赠送积分', `credit_price` int(10) unsigned NOT NULL COMMENT '如果用积分兑换,需要的积分数', `is_promote` tinyint(3) unsigned NOT NULL COMMENT '是否促销:0:不促销1:促销', `promote_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '促销价', `promote_start_time` int(10) unsigned NOT NULL COMMENT '促销开始时间', `promote_end_time` int(10) unsigned NOT NULL COMMENT '促销结束时间', `sm_logo` varchar(150) NOT NULL DEFAULT '' COMMENT 'logo缩略图', `logo` varchar(150) NOT NULL DEFAULT '' COMMENT 'logo', `is_sale` tinyint(3) unsigned NOT NULL COMMENT '是否上架:0:下架1:上架', `is_new` tinyint(3) unsigned NOT NULL COMMENT '是否新品', `is_best` tinyint(3) unsigned NOT NULL COMMENT '是否推荐', `is_hot` tinyint(3) unsigned NOT NULL COMMENT '是否热卖', `sort` tinyint(3) unsigned NOT NULL DEFAULT '100' COMMENT '排序字段', `goods_desc` text NOT NULL COMMENT '商品描述', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', `is_delete` tinyint(3) unsigned NOT NULL COMMENT '是否删除', `seo_keyword` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo优化关键字', `seo_desc` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo优化描述', `feature` varchar(30) NOT NULL DEFAULT '' COMMENT '商品特色', `is_freight` tinyint(3) unsigned NOT NULL COMMENT '是否包邮:1:包邮0:不包邮', `freight_price` decimal(10,2) unsigned NOT NULL COMMENT '邮费', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='商品表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_goods` -- LOCK TABLES `sp_goods` WRITE; /*!40000 ALTER TABLE `sp_goods` DISABLE KEYS */; INSERT INTO `sp_goods` VALUES (1,'强锅',1,2,1,10000.00,9999.00,500,0,0,0.00,0,0,'20180602\\thumb_b7dbcefc194f36b4bb80e165c68d1ee1.jpg','20180602\\b7dbcefc194f36b4bb80e165c68d1ee1.jpg',1,1,1,1,100,'&lt;p&gt;超级无敌强&lt;/p&gt;',1527913168,1528263827,0,'','','本产品全国联保',0,0.00),(2,'华锅',1,2,1,50000.00,49800.00,0,0,1,45000.00,1528178850,1528787042,'20180602\\thumb_9657fe055bdb1871ca3ddc2f8eb444a1.jpg','20180602\\9657fe055bdb1871ca3ddc2f8eb444a1.jpg',1,0,1,1,100,'&lt;p&gt;骚锅&lt;/p&gt;',1527919768,1528646218,0,'','','本产品全国联保',0,0.00),(3,'栋锅',3,4,1,8000.00,8100.00,500,5000,0,0.00,0,0,'20180606\\thumb_5cce583706d23a7c0cf01f86adf0b7d3.jpg','20180606\\5cce583706d23a7c0cf01f86adf0b7d3.jpg',0,1,0,1,100,'&lt;p&gt;垃圾锅&lt;/p&gt;',1527920042,1528275867,0,'','','本产品全国联保',0,0.00),(4,'豪锅',1,1,1,8000.00,8500.00,500,0,0,7000.00,1528181386,1528267788,'20180605\\thumb_2487e711f030daf3e6bee6d352c118c1.jpg','20180605\\2487e711f030daf3e6bee6d352c118c1.jpg',1,0,1,1,100,'&lt;p&gt;只有富豪才能拥有的锅&lt;/p&gt;',1528179826,1528600443,0,'','','本产品全国联保',0,0.00),(5,'权锅',8,3,1,12000.00,15000.00,700,0,0,0.00,0,0,'20180605\\thumb_1e95eafc9f93535e6d5cdde706a2dd0f.jpg','20180605\\1e95eafc9f93535e6d5cdde706a2dd0f.jpg',1,1,1,1,100,'&lt;p&gt;冰与火,权利的锅&lt;/p&gt;',1528180132,1528263597,0,'','','享受三包服务',0,0.00),(6,'宏锅',3,4,1,10000.00,12000.00,800,0,0,0.00,0,0,'20180605\\thumb_690ea81c3a2668d9379f48c150ca1b64.jpg','20180605\\690ea81c3a2668d9379f48c150ca1b64.jpg',1,0,1,1,100,'&lt;p&gt;宏才远志的锅&lt;br/&gt;&lt;/p&gt;',1528180611,1528263550,0,'','','享受三包服务',0,0.00),(7,'辉锅',2,3,1,8000.00,9800.00,700,0,1,8000.00,1528181142,1528613143,'20180605\\thumb_0f4bdf4a0e87a0107189fbcc4c8df506.jpg','20180605\\0f4bdf4a0e87a0107189fbcc4c8df506.jpg',1,1,0,1,100,'&lt;p&gt;灰太狼的锅&lt;/p&gt;',1528180701,1528263313,0,'','','享受三包服务',0,0.00),(8,'龙锅',2,2,1,50000.00,50000.00,1000,0,1,49999.00,1528181029,1528181031,'20180605\\thumb_a6cc1df4a1f86ab5b83084091fd36fc2.jpg','20180605\\a6cc1df4a1f86ab5b83084091fd36fc2.jpg',1,1,1,1,100,'&lt;p&gt;九五之尊&lt;/p&gt;',1528181128,1528464033,0,'','','享受三包服务',0,0.00),(9,'诚锅',2,2,1,500.00,498.00,20,0,0,0.00,0,0,'20180610\\thumb_b756100f6abd241b94d06983d77425bf.jpg','20180610\\b756100f6abd241b94d06983d77425bf.jpg',1,1,1,1,100,'&lt;p&gt;强无敌&lt;/p&gt;',1528600220,1528600828,0,'','','本产品全国联保',1,5.00),(10,'帅锅',2,2,1,300.00,280.00,10,0,0,0.00,0,0,'20180610\\thumb_c52dcb224530c63b080fd9a955bd03fb.jpg','20180610\\c52dcb224530c63b080fd9a955bd03fb.jpg',1,1,1,1,100,'&lt;p&gt;捞仔,羡慕么&lt;/p&gt;',1528600919,0,0,'','','本产品全国联保',1,0.00); /*!40000 ALTER TABLE `sp_goods` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_goods_attribute` -- DROP TABLE IF EXISTS `sp_goods_attribute`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_goods_attribute` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `attribute_id` mediumint(8) unsigned NOT NULL COMMENT '属性ID', `attribute_value` varchar(150) NOT NULL DEFAULT '' COMMENT '属性值', `attribute_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '属性价格', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8 COMMENT='商品属性表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_goods_attribute` -- LOCK TABLES `sp_goods_attribute` WRITE; /*!40000 ALTER TABLE `sp_goods_attribute` DISABLE KEYS */; INSERT INTO `sp_goods_attribute` VALUES (1,8,1,'20cm',2000.00),(2,8,1,'25cm',5000.00),(3,8,1,'30cm',10000.00),(4,8,2,'不锈钢',10000.00),(5,8,4,'1L',0.00),(6,8,4,'3L',5000.00),(7,8,4,'5L',7000.00),(8,8,5,'大容量',7000.00),(9,8,6,'铁板烧',7000.00),(10,7,1,'20cm',0.00),(11,7,1,'25cm',700.00),(12,7,2,'不锈钢内丹',0.00),(13,7,4,'1L',500.00),(14,7,4,'2L',700.00),(15,7,6,'预约',0.00),(16,6,1,'25cm',0.00),(17,6,1,'30cm',700.00),(18,6,2,'304不锈钢',0.00),(19,6,4,'1L',0.00),(20,6,4,'2L',50.00),(21,6,4,'3L',150.00),(22,6,4,'4L',300.00),(23,6,5,'迷你',0.00),(24,6,6,'煲仔饭',0.00),(25,5,1,'20cm',0.00),(26,5,1,'25cm',50.00),(27,5,1,'30cm',100.00),(28,5,2,'不锈钢',0.00),(29,5,4,'1L',50.00),(30,5,4,'2L',100.00),(31,5,4,'4L',150.00),(32,5,6,'焖',0.00),(33,4,1,'20cm',0.00),(34,4,1,'30cm',500.00),(35,4,1,'35cm',700.00),(36,4,2,'不锈钢内丹',700.00),(37,4,4,'1L',0.00),(38,4,4,'3L',50.00),(39,4,4,'4L',120.00),(40,4,5,'大容量',120.00),(41,4,6,'煲仔饭',120.00),(42,3,1,'20cm',45.00),(43,3,1,'25cm',70.00),(44,3,1,'35cm',120.00),(45,3,2,'304不锈钢',120.00),(46,3,4,'3L',70.00),(47,3,4,'4L',140.00),(48,3,4,'1L',0.00),(49,3,5,'智能',0.00),(50,3,6,'铁板烧',0.00),(51,2,1,'25cm',5000.00),(52,2,1,'30cm',10000.00),(53,2,2,'304不锈钢',3000.00),(54,2,4,'4L',0.00),(55,2,4,'5L',7000.00),(56,2,5,'新款',7000.00),(57,2,6,'蛋糕',7000.00),(58,1,1,'20cm',0.00),(59,1,1,'30cm',100.00),(60,1,2,'不锈钢内丹',0.00),(61,1,4,'2L',70.00),(62,1,4,'4L',120.00),(63,1,5,'小容量',0.00),(64,1,6,'蛋糕',0.00),(65,2,1,'20cm',3000.00),(66,9,1,'20cm',0.00),(67,9,1,'25cm',50.00),(68,9,2,'不锈钢内丹',50.00),(69,9,4,'1L',0.00),(70,9,4,'2L',100.00),(71,9,6,'酸奶',100.00),(72,10,1,'20cm',0.00),(73,10,1,'25cm',50.00),(74,10,1,'35cm',100.00),(75,10,4,'2L',0.00),(76,10,4,'4L',200.00); /*!40000 ALTER TABLE `sp_goods_attribute` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_goods_cat` -- DROP TABLE IF EXISTS `sp_goods_cat`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_goods_cat` ( `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `cat_id` mediumint(8) unsigned NOT NULL COMMENT '分类ID', KEY `goods_id` (`goods_id`) USING BTREE, KEY `cat_id` (`cat_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品扩展分类表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_goods_cat` -- LOCK TABLES `sp_goods_cat` WRITE; /*!40000 ALTER TABLE `sp_goods_cat` DISABLE KEYS */; INSERT INTO `sp_goods_cat` VALUES (7,9),(7,5),(7,7),(6,6),(6,4),(5,8),(5,2),(5,7),(1,4),(1,2),(3,2),(3,4),(8,8),(8,9),(4,4),(4,7),(4,3),(9,4),(10,4),(10,3),(10,7),(2,2); /*!40000 ALTER TABLE `sp_goods_cat` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_goods_number` -- DROP TABLE IF EXISTS `sp_goods_number`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_goods_number` ( `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `number` int(11) NOT NULL COMMENT '商品库存量', `attribute_id` varchar(150) NOT NULL DEFAULT '' COMMENT '商品属性ID' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品库存表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_goods_number` -- LOCK TABLES `sp_goods_number` WRITE; /*!40000 ALTER TABLE `sp_goods_number` DISABLE KEYS */; INSERT INTO `sp_goods_number` VALUES (3,50,'3,4'),(3,10,'1,5'),(1,50,'59,61'),(2,200,'54,65'),(2,10,'51,54'); /*!40000 ALTER TABLE `sp_goods_number` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_goods_picture` -- DROP TABLE IF EXISTS `sp_goods_picture`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_goods_picture` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `sm_picture` varchar(150) NOT NULL DEFAULT '' COMMENT '缩略图图片', `picture` varchar(150) NOT NULL DEFAULT '' COMMENT '图片', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='商品图片表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_goods_picture` -- LOCK TABLES `sp_goods_picture` WRITE; /*!40000 ALTER TABLE `sp_goods_picture` DISABLE KEYS */; INSERT INTO `sp_goods_picture` VALUES (1,'20180602\\thumb_948a7155f492fd187f99e03302ffde9f.jpg','20180602\\948a7155f492fd187f99e03302ffde9f.jpg',1),(4,'20180602\\thumb_70794486311c93527ef979910968b892.jpg','20180602\\70794486311c93527ef979910968b892.jpg',2),(5,'20180602\\thumb_23dca788db28d3bc8b74729f7a88404f.jpg','20180602\\23dca788db28d3bc8b74729f7a88404f.jpg',2),(6,'20180602\\thumb_141ad621038907b8f3e8bdae2d05485d.png','20180602\\141ad621038907b8f3e8bdae2d05485d.png',2),(7,'20180602\\thumb_bc57dddc4db2bfd596eb7063318e8d2f.jpg','20180602\\bc57dddc4db2bfd596eb7063318e8d2f.jpg',3),(8,'20180602\\thumb_45aff43d6b5d6b751f9595d71dd49317.jpg','20180602\\45aff43d6b5d6b751f9595d71dd49317.jpg',3),(9,'20180602\\thumb_db2854540a97d00d3a492981180206b3.jpg','20180602\\db2854540a97d00d3a492981180206b3.jpg',3),(10,'20180605\\thumb_a17e91beb049484d682d405c434bfc6d.jpg','20180605\\a17e91beb049484d682d405c434bfc6d.jpg',4),(11,'20180605\\thumb_eb6768372096c1389f36f915c022a564.jpg','20180605\\eb6768372096c1389f36f915c022a564.jpg',4),(12,'20180605\\thumb_1ce2be56a412049048bd5e0d56cda99a.jpg','20180605\\1ce2be56a412049048bd5e0d56cda99a.jpg',4),(13,'20180605\\thumb_f65238bad248bf6fc29487497f088ac8.jpg','20180605\\f65238bad248bf6fc29487497f088ac8.jpg',5),(14,'20180605\\thumb_9f45b86f8f2ac259f0faf6cdf43c147a.jpg','20180605\\9f45b86f8f2ac259f0faf6cdf43c147a.jpg',5),(15,'20180605\\thumb_d21c18a2a1d13abb3eba81609e6c837d.png','20180605\\d21c18a2a1d13abb3eba81609e6c837d.png',5),(16,'20180605\\thumb_403104105772540f69c3f51eb64b3b8e.jpg','20180605\\403104105772540f69c3f51eb64b3b8e.jpg',6),(17,'20180605\\thumb_9b50ccc91ddc18c183d96fad14cd1e5f.jpg','20180605\\9b50ccc91ddc18c183d96fad14cd1e5f.jpg',7),(18,'20180605\\thumb_46688dcfb672ab2f74d3b24dac66d79d.jpg','20180605\\46688dcfb672ab2f74d3b24dac66d79d.jpg',7),(19,'20180605\\thumb_121dd7941d48a80f9b3f6f1dd5f095db.jpg','20180605\\121dd7941d48a80f9b3f6f1dd5f095db.jpg',7),(20,'20180605\\thumb_0f87095a9d309e3e61af124d112e8006.jpg','20180605\\0f87095a9d309e3e61af124d112e8006.jpg',8),(21,'20180605\\thumb_c2c719ca27ba8e466bed59b94342c4d2.jpg','20180605\\c2c719ca27ba8e466bed59b94342c4d2.jpg',8),(22,'20180605\\thumb_fb7d8b3ee61ea55e4254ebdb634d99b4.jpg','20180605\\fb7d8b3ee61ea55e4254ebdb634d99b4.jpg',8),(23,'20180610\\thumb_75ae28bcad68b89403010da9a3399e6f.jpg','20180610\\75ae28bcad68b89403010da9a3399e6f.jpg',9),(24,'20180610\\thumb_e0da71c1baa5c942e85667224f1110d9.jpg','20180610\\e0da71c1baa5c942e85667224f1110d9.jpg',9),(25,'20180610\\thumb_143f647f399917ae491ecbb627155f7f.jpg','20180610\\143f647f399917ae491ecbb627155f7f.jpg',9),(26,'20180610\\thumb_2a824fe4a7a64433e061b9916e0db405.jpg','20180610\\2a824fe4a7a64433e061b9916e0db405.jpg',10),(27,'20180610\\thumb_5c36a59e56ac0986ddf6840cf2df91c0.jpg','20180610\\5c36a59e56ac0986ddf6840cf2df91c0.jpg',10),(28,'20180610\\thumb_e915d9ea71c8c5bcf84619fbda5836a8.jpg','20180610\\e915d9ea71c8c5bcf84619fbda5836a8.jpg',10); /*!40000 ALTER TABLE `sp_goods_picture` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_impression` -- DROP TABLE IF EXISTS `sp_impression`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_impression` ( `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `count` smallint(5) unsigned NOT NULL COMMENT '浏览次数', PRIMARY KEY (`member_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='印象表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_impression` -- LOCK TABLES `sp_impression` WRITE; /*!40000 ALTER TABLE `sp_impression` DISABLE KEYS */; /*!40000 ALTER TABLE `sp_impression` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_member` -- DROP TABLE IF EXISTS `sp_member`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_member` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `username` varchar(20) NOT NULL DEFAULT '' COMMENT '账号', `name` varchar(20) NOT NULL DEFAULT '' COMMENT '昵称', `real_name` char(10) NOT NULL DEFAULT '' COMMENT '真实姓名', `password` char(32) NOT NULL DEFAULT '' COMMENT '密码', `gender` tinyint(3) unsigned NOT NULL COMMENT '性别:0:保密1:男2:女', `phone` char(11) NOT NULL DEFAULT '' COMMENT '手机', `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱', `face` varchar(150) NOT NULL DEFAULT '' COMMENT '头像', `credit` int(10) unsigned NOT NULL COMMENT '积分', `money` int(10) unsigned NOT NULL COMMENT '余额', `birthday` int(10) unsigned NOT NULL COMMENT '出生年月', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', `hobby` varchar(50) NOT NULL DEFAULT '' COMMENT '爱好', `status` tinyint(3) unsigned NOT NULL COMMENT '状态:0:未激活1:已激活2:已删除', `email_code` char(32) NOT NULL DEFAULT '' COMMENT '邮箱验证码', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='会员表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_member` -- LOCK TABLES `sp_member` WRITE; /*!40000 ALTER TABLE `sp_member` DISABLE KEYS */; INSERT INTO `sp_member` VALUES (1,'chaojiwudiqiang','超级无敌强','林嘉峡','63573e3d6b8be995be619981b0fa6bda',2,'18927400385','<EMAIL>','20180608\\10685a7074e57701daff4f617277b223.jpg',20001,0,842544000,1528212875,1528556069,'',1,''); /*!40000 ALTER TABLE `sp_member` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_member_level` -- DROP TABLE IF EXISTS `sp_member_level`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_member_level` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '会员等级名称', `top_number` int(10) unsigned NOT NULL COMMENT '积分上限', `bottom_number` int(10) unsigned NOT NULL COMMENT '积分下限', `rate` tinyint(3) unsigned NOT NULL COMMENT '折扣率,百分比,例如9折=90', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='会员等级表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_member_level` -- LOCK TABLES `sp_member_level` WRITE; /*!40000 ALTER TABLE `sp_member_level` DISABLE KEYS */; INSERT INTO `sp_member_level` VALUES (1,'注册会员',20000,0,100,1527490724,1527859908),(2,'中级会员',50000,20001,99,1527490756,0),(3,'白金会员',150000,50001,98,1527490810,0),(4,'至尊会员',500000,150001,97,1527490839,0); /*!40000 ALTER TABLE `sp_member_level` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_member_price` -- DROP TABLE IF EXISTS `sp_member_price`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_member_price` ( `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `level_id` mediumint(8) unsigned NOT NULL COMMENT '会员等级ID', `level_price` decimal(10,2) unsigned NOT NULL COMMENT '当前级别价格' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员价格表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_member_price` -- LOCK TABLES `sp_member_price` WRITE; /*!40000 ALTER TABLE `sp_member_price` DISABLE KEYS */; INSERT INTO `sp_member_price` VALUES (7,1,9800.00),(7,2,9702.00),(7,3,9604.00),(7,4,9506.00),(6,1,12000.00),(6,2,11880.00),(6,3,11760.00),(6,4,11640.00),(5,1,15000.00),(5,2,14850.00),(5,3,14700.00),(5,4,14550.00),(1,1,9999.00),(1,2,9899.01),(1,3,9799.02),(1,4,9699.03),(3,1,8100.00),(3,2,8019.00),(3,3,7938.00),(3,4,7857.00),(8,1,50000.00),(8,2,49500.00),(8,3,49000.00),(8,4,48500.00),(4,1,8500.00),(4,2,8415.00),(4,3,8330.00),(4,4,8245.00),(9,1,498.00),(9,2,493.02),(9,3,488.04),(9,4,483.06),(10,1,280.00),(10,2,277.20),(10,3,274.40),(10,4,271.60),(2,1,49800.00),(2,2,49302.00),(2,3,48804.00),(2,4,48306.00); /*!40000 ALTER TABLE `sp_member_price` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_nav` -- DROP TABLE IF EXISTS `sp_nav`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_nav` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '导航ID', `name` varchar(20) NOT NULL DEFAULT '' COMMENT '导航名称', `url` varchar(30) NOT NULL DEFAULT '' COMMENT '路由地址', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='导航表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_nav` -- LOCK TABLES `sp_nav` WRITE; /*!40000 ALTER TABLE `sp_nav` DISABLE KEYS */; INSERT INTO `sp_nav` VALUES (1,'首页','/',1528081302),(2,'热销商品','',0),(3,'推荐商品','',0),(4,'最新商品','',0),(5,'联系我们','',0); /*!40000 ALTER TABLE `sp_nav` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_order` -- DROP TABLE IF EXISTS `sp_order`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_order` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID', `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `name` varchar(20) NOT NULL DEFAULT '' COMMENT '收货人', `prov` varchar(20) NOT NULL DEFAULT '' COMMENT '省', `city` varchar(20) NOT NULL DEFAULT '' COMMENT '市', `dist` varchar(20) NOT NULL DEFAULT '' COMMENT '区', `address` varchar(150) NOT NULL COMMENT '详细地址', `phone` char(11) NOT NULL DEFAULT '' COMMENT '联系电话', `total_price` decimal(10,2) NOT NULL COMMENT '订单总价', `post_method` tinyint(3) unsigned NOT NULL COMMENT '发货方式', `pay_method` tinyint(3) unsigned NOT NULL COMMENT '付款方式', `post_status` tinyint(3) unsigned NOT NULL COMMENT '发货状态:0:未发货1:已发货2:已收货', `pay_status` tinyint(3) unsigned NOT NULL COMMENT '支付状态:0:待支付1:未支付2:已支付', `create_time` int(10) unsigned NOT NULL COMMENT '下单时间', `order_number` char(32) NOT NULL DEFAULT '' COMMENT '订单号', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='订单表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_order` -- LOCK TABLES `sp_order` WRITE; /*!40000 ALTER TABLE `sp_order` DISABLE KEYS */; INSERT INTO `sp_order` VALUES (1,1,'林嘉峡','北京','东城区','','桥洞下','18927400385',50000.00,0,0,0,1,1528702958,'7bd6670f2666439eb456ad31b41c380c'); /*!40000 ALTER TABLE `sp_order` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_order_goods` -- DROP TABLE IF EXISTS `sp_order_goods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_order_goods` ( `order_id` mediumint(8) unsigned NOT NULL COMMENT '订单ID', `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID', `goods_attr_id` varchar(50) NOT NULL DEFAULT '' COMMENT '商品属性ID', `price` decimal(10,2) NOT NULL COMMENT '商品价格', `number` int(11) NOT NULL COMMENT '购买数量' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单商品表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_order_goods` -- LOCK TABLES `sp_order_goods` WRITE; /*!40000 ALTER TABLE `sp_order_goods` DISABLE KEYS */; INSERT INTO `sp_order_goods` VALUES (1,1,2,'51,54',50000.00,1); /*!40000 ALTER TABLE `sp_order_goods` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_payword` -- DROP TABLE IF EXISTS `sp_payword`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_payword` ( `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `payword` char(32) NOT NULL DEFAULT '' COMMENT '支付密码' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付密码表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_payword` -- LOCK TABLES `sp_payword` WRITE; /*!40000 ALTER TABLE `sp_payword` DISABLE KEYS */; INSERT INTO `sp_payword` VALUES (1,'<PASSWORD>'); /*!40000 ALTER TABLE `sp_payword` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_privilege` -- DROP TABLE IF EXISTS `sp_privilege`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_privilege` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '权限ID', `name` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '权限名称', `pid` smallint(5) unsigned NOT NULL COMMENT '上级权限', `controller` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '控制器', `action` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '方法', `is_show` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示:1:显示0:不显示', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COMMENT='权限&菜单表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_privilege` -- LOCK TABLES `sp_privilege` WRITE; /*!40000 ALTER TABLE `sp_privilege` DISABLE KEYS */; INSERT INTO `sp_privilege` VALUES (1,'系统管理',0,'','',1,1526556039,0),(2,'管理员管理',0,'','',1,1526556048,0),(3,'栏目管理',1,'Menu','index',1,1526556055,1526611555),(4,'用户管理',2,'Admin','index',1,1526556070,1526611570),(5,'角色管理',2,'Role','index',1,1526556079,0),(6,'权限管理',2,'Privilege','index',1,1526556086,0),(7,'栏目添加页面',3,'Menu','create',1,1526556203,0),(8,'栏目新增',3,'Menu','save',1,1526556219,0),(9,'栏目修改页面',3,'Menu','edit',1,1526556234,0),(10,'栏目更新',3,'Menu','update',1,1526556251,0),(11,'栏目删除',3,'Menu','delete',1,1526556264,0),(12,'栏目批量删除',3,'Menu','deletion',1,1526556284,0),(13,'权限添加页面',6,'Privilege','create',1,1526556389,0),(14,'权限新增',6,'Privilege','save',1,1526556407,0),(15,'权限修改页面',6,'Privilege','edit',1,1526556423,0),(16,'权限更新',6,'Privilege','update',1,1526556445,0),(17,'权限删除',6,'Privilege','delete',1,1526556462,0),(18,'权限批量删除',6,'Privilege','deletion',1,1526556481,0),(19,'用户添加页面',4,'Admin','create',1,1526635628,0),(20,'用户新增',4,'Admin','save',1,1526635648,0),(21,'用户修改页面',4,'Admin','edit',1,1526635664,0),(22,'用户更新',4,'Admin','update',1,1526635690,0),(23,'用户删除',4,'Admin','delete',1,1526635711,0),(24,'用户批量删除',4,'Admin','deletion',1,1526635816,0),(25,'角色添加页面',5,'Role','create',1,1526635839,0),(26,'角色新增',5,'Role','save',1,1526635857,0),(27,'角色修改页面',5,'Role','edit',1,1526635886,0),(28,'角色更新',5,'Role','update',1,1526635903,0),(29,'角色删除',5,'Role','delete',1,1526635925,0),(30,'角色批量删除',5,'Role','deletion',1,1526635945,0),(31,'商品管理',0,'','',1,1526914484,0),(32,'分类管理',31,'Category','index',1,1526914849,0),(33,'分类添加页面',32,'Category','create',1,1526999242,0),(34,'分类新增',32,'Category','save',1,1526999260,0),(35,'分类修改页面',32,'Category','edit',1,1526999433,0),(36,'分类更新',32,'Category','update',1,1526999449,0),(37,'分类删除',32,'Category','delete',1,1526999463,0),(38,'分类批量删除',32,'Category','deletion',1,1526999479,0),(39,'用户状态管理',4,'Admin','isuse',1,1526999545,1526999680),(40,'类型管理',31,'Type','index',1,1526999763,1526999881),(41,'类型添加页面',40,'Type','create',1,1526999899,0),(42,'类型新增',40,'Type','save',1,1526999959,0),(43,'类型修改页面',40,'Type','edit',1,1527000006,0),(44,'类型更新',40,'Type','update',1,1527000065,0),(45,'类型删除',40,'Type','delete',1,1527000077,0),(46,'类型批量删除',40,'Type','deletion',1,1527000091,0),(47,'品牌管理',31,'Brand','index',1,1527086006,0),(48,'品牌添加页面',47,'Brand','create',1,1527086033,0),(49,'品牌新增',47,'Brand','save',1,1527086046,0),(50,'品牌修改页面',47,'Brand','edit',1,1527086070,0),(51,'品牌更新',47,'Brand','update',1,1527086088,0),(52,'品牌删除',47,'Brand','delete',1,1527086107,0),(53,'品牌批量删除',47,'Brand','deletion',1,1527086121,0),(54,'属性管理',31,'Attribute','index',1,1527086165,1528030755),(55,'属性添加页面',54,'Attribute','create',1,1527086182,0),(56,'属性新增',54,'Attribute','save',1,1527086198,0),(57,'属性修改页面',54,'Attribute','edit',1,1527086217,0),(58,'属性更新',54,'Attribute','update',1,1527086244,0),(59,'属性删除',54,'Attribute','delete',1,1527086255,1527086265),(60,'属性批量删除',54,'Attribute','deletion',1,1527086282,0),(61,'商品列表',31,'Goods','index',1,1527347962,1527401546),(62,'商品添加页面',61,'Goods','create',1,1527347993,0),(63,'商品新增',61,'Goods','save',1,1527348008,0),(64,'商品修改页面',61,'Goods','edit',1,1527348029,0),(65,'商品更新',61,'Goods','update',1,1527348030,1527348071),(66,'商品删除',84,'Goods','delete',1,1527348093,1528033252),(67,'商品批量删除',84,'Goods','deletion',1,1527348112,1528033265),(68,'会员管理',0,'','',1,1527400556,0),(69,'会员级别管理',68,'Level','index',1,1527401569,1527435077),(70,'会员级别添加页面',69,'Level','create',1,1527401586,1527434274),(71,'会员级别新增',69,'Level','save',1,1527401599,1527434268),(72,'会员级别修改页面',69,'Level','edit',1,1527401617,1527434263),(73,'会员级别更新',69,'Level','update',1,1527401634,1527434240),(74,'会员级别删除',69,'Level','delete',1,1527401649,1527434248),(75,'会员级别批量删除',69,'Level','deletion',1,1527401665,1527434257),(76,'图片管理',0,'','',1,1527603201,0),(77,'水印管理',76,'Water','index',1,1527603238,0),(78,'水印添加页面',77,'Water','create',1,1527603444,0),(79,'水印新增',77,'Water','save',1,1527603458,0),(80,'水印修改页面',77,'Water','edit',1,1527603472,0),(81,'水印更新',77,'Water','update',1,1527603491,0),(82,'水印删除',77,'Water','delete',1,1527603510,0),(83,'水印批量删除',77,'Water','deletion',1,1527603524,1527912921),(84,'商品回收站',31,'Goods','recyclelist',1,1528032933,1528033113),(85,'商品移除',61,'Goods','recycle',1,1528033294,0),(86,'商品批量移除',61,'Goods','recycles',1,1528033397,0),(87,'商品还原',84,'Goods','restore',1,1528033441,0),(88,'商品分类显示',61,'Goods','showCat',1,1528039673,1528039689),(89,'商品属性显示',61,'Goods','showAttr',1,1528039728,0),(90,'商品属性编辑显示',61,'Goods','editAttr',1,1528039891,0),(91,'商品属性删除',61,'Goods','delAttr',1,1528040193,0),(92,'商品相册数量检测',61,'Goods','checknum',1,1528040244,0),(93,'商品相册图片删除',61,'Goods','delImg',1,1528040274,0),(94,'商品库存',61,'Goods','kucun',1,1528040306,0),(95,'前台管理',0,'','',1,1528042388,0),(96,'导航管理',95,'Nav','index',1,1528042413,0),(97,'分类搜索展示',61,'Goods','catList',1,1528105837,0),(98,'导航修改页面',96,'Nav','edit',1,1528106092,0),(99,'导航更新',96,'Goods','update',1,1528106109,1528118355),(100,'banner管理',95,'Banner','index',1,1528118392,0),(101,'banner添加页面',100,'Banner','create',1,1528118419,0),(102,'banner新增',100,'Banner','save',1,1528118442,0),(103,'banner修改页面',100,'Banner','edit',1,1528118458,0),(104,'banner更新',100,'Banner','update',1,1528118474,0),(105,'banner删除',100,'Banner','delete',1,1528118500,0),(106,'banner批量删除',100,'Banner','deletion',1,1528118517,0),(107,'联系我们',95,'Constact','index',1,1528126217,0),(108,'联系修改页面',107,'Constact','edit',1,1528184299,0),(109,'联系更新',107,'Constact','update',1,1528184316,0),(110,'广告栏位管理',95,'Advert','index',1,1528184360,0),(111,'广告栏位添加页面',110,'Advert','create',1,1528184387,1528184448),(112,'广告栏位新增',110,'Advert','save',1,1528184424,1528184433),(113,'广告栏位修改页面',110,'Advert','edit',1,1528184478,0),(114,'广告栏位更新',110,'Advert','update',1,1528184492,0),(115,'广告栏位删除',110,'Advert','delete',1,1528184508,0),(116,'广告栏位批量删除',110,'Advert','deletion',1,1528184526,0); /*!40000 ALTER TABLE `sp_privilege` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_reply` -- DROP TABLE IF EXISTS `sp_reply`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_reply` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '回复ID', `content` text NOT NULL COMMENT '回复内容', `member_id` mediumint(8) unsigned NOT NULL COMMENT '会员ID', `comment_id` mediumint(8) unsigned NOT NULL COMMENT '评论ID', `create_time` int(10) unsigned NOT NULL COMMENT '回复时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='回复表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_reply` -- LOCK TABLES `sp_reply` WRITE; /*!40000 ALTER TABLE `sp_reply` DISABLE KEYS */; /*!40000 ALTER TABLE `sp_reply` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_role` -- DROP TABLE IF EXISTS `sp_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_role` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色ID', `name` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '角色名称', `describe` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '角色描述', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_role` -- LOCK TABLES `sp_role` WRITE; /*!40000 ALTER TABLE `sp_role` DISABLE KEYS */; INSERT INTO `sp_role` VALUES (1,'经理','权限颇高',1526714726,1527859846),(2,'主管','商品及订单管理',1526715188,0),(3,'普通员工','一般权限',1526790249,1526959189); /*!40000 ALTER TABLE `sp_role` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_role_privilege` -- DROP TABLE IF EXISTS `sp_role_privilege`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_role_privilege` ( `role_id` tinyint(3) unsigned NOT NULL COMMENT '角色ID', `pri_id` tinyint(3) unsigned NOT NULL COMMENT '权限ID', KEY `role_id` (`role_id`) USING BTREE, KEY `pri_id` (`pri_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_role_privilege` -- LOCK TABLES `sp_role_privilege` WRITE; /*!40000 ALTER TABLE `sp_role_privilege` DISABLE KEYS */; INSERT INTO `sp_role_privilege` VALUES (2,1),(2,3),(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(3,12),(3,11),(3,10),(3,9),(3,8),(3,7),(3,3),(3,1),(1,1),(1,3),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,2),(1,4),(1,19),(1,20),(1,21),(1,22),(1,23),(1,24),(1,5),(1,25),(1,26),(1,27),(1,28),(1,29),(1,30),(1,6),(1,13),(1,14),(1,15),(1,16),(1,17),(1,18); /*!40000 ALTER TABLE `sp_role_privilege` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_type` -- DROP TABLE IF EXISTS `sp_type`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_type` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '类型ID', `name` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '类型名称', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='类型表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_type` -- LOCK TABLES `sp_type` WRITE; /*!40000 ALTER TABLE `sp_type` DISABLE KEYS */; INSERT INTO `sp_type` VALUES (1,'锅',1527748333,1528257637); /*!40000 ALTER TABLE `sp_type` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sp_water` -- DROP TABLE IF EXISTS `sp_water`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sp_water` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '水印ID', `name` varchar(20) NOT NULL DEFAULT '' COMMENT '水印名称', `sm_water_img` varchar(150) NOT NULL DEFAULT '' COMMENT '水印缩略图', `water_img` varchar(150) NOT NULL DEFAULT '' COMMENT '水印图片', `create_time` int(10) unsigned NOT NULL COMMENT '添加时间', `update_time` int(10) unsigned NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='图片水印表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sp_water` -- LOCK TABLES `sp_water` WRITE; /*!40000 ALTER TABLE `sp_water` DISABLE KEYS */; INSERT INTO `sp_water` VALUES (3,'萌妹','20180604\\thumb_abfd1f502107ac7dbbf981ac38a66374.jpg','20180604\\abfd1f502107ac7dbbf981ac38a66374.jpg',1527605862,1528122504),(4,'公司logo','20180604\\thumb_291c1f669c0d481ebe2c61e1b306312c.jpg','20180604\\291c1f669c0d481ebe2c61e1b306312c.jpg',1527605870,1528122498); /*!40000 ALTER TABLE `sp_water` 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-06-11 19:38:52
<gh_stars>10-100 insert into message(id, text) values(1, 'Hello World');
<reponame>PrasantHub/DynamicDataLoad<filename>Database Scripts/dbo.DataSourceConfigs.sql /****** Object: Table [dbo].[DataSourceConfigs] Script Date: 10-11-2021 00:01:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[DataSourceConfigs]( [ConfigID] [int] IDENTITY(1,1), [SourceType] [nvarchar](50) NOT NULL, [ExtractType] [nvarchar](50) NOT NULL, [SourceName] [nvarchar](50) NOT NULL, [SourceVal1] [nvarchar](150) NOT NULL, [SourceVal2] [nvarchar](150) NULL, [AccessToken] [nvarchar](50) NULL, [TargetName] [nvarchar](50) NOT NULL, [TargetLocation] [nvarchar](50) NOT NULL, [TargetVal] [nvarchar](50) NOT NULL, [APIHeader1] [nvarchar](50) NULL, [Param1Name] [nvarchar](50) NULL, [Param1Val] [nvarchar](50) NULL, [Param2Name] [nvarchar](50) NULL, [Param2Val] [nvarchar](50) NULL, [Param3Name] [nvarchar](50) NULL, [Param3Val] [nvarchar](50) NULL, [TargetFileExtension] [nvarchar](50) NOT NULL, [IsActive] [bit] NOT NULL ) ON [PRIMARY] GO
select array[], array[1], array[1, 2, 3, foo + bar], array[array[1, 2, 3], array[4, 5, 6]], array[[1, 2, 3], [4, 5, 6]] from baz
<gh_stars>10-100 CREATE TABLE [dbo].[CardComments] ( [commentId] INT NOT NULL PRIMARY KEY, [cardId] INT NOT NULL, [userId] INT NOT NULL, [datecreated] DATETIME NOT NULL DEFAULT GETDATE(), [comment] NVARCHAR(MAX) NOT NULL )
<gh_stars>10-100 DELETE FROM `holer_user` WHERE user_id=1; INSERT INTO `holer_user` (`user_id`, `name`, `password`, `token`) VALUES (1, 'admin', '<PASSWORD>123', NULL);
DROP TABLE IF EXISTS job_dep; DROP TABLE IF EXISTS job; DROP TABLE IF EXISTS run; DROP TABLE IF EXISTS session; DROP TABLE IF EXISTS appkey; DROP TABLE IF EXISTS usr; CREATE TABLE usr ( id SERIAL PRIMARY KEY, username VARCHAR(100) UNIQUE NOT NULL, password VARCHAR(1024) NOT NULL, -- format: METHOD$PAYLOAD. -- Supported methods: 1$ => bcrypt (only one so far). is_admin BOOLEAN DEFAULT FALSE ); -- appkeys are replacements for username/passwords that can be stored in files for -- automated authentication (scripted). They can also be revoked easier than a -- password can be changed CREATE TABLE appkey ( user_id INTEGER REFERENCES usr(id), access_key UUID, -- randomly generated secret_key VARCHAR(1024), -- randomly generated, used for the initial login request -- after that the session-id is used created_ts TIMESTAMP, PRIMARY KEY(user_id, access_key) ); -- sessions can be initiated from either an access/secretkey or username/password CREATE TABLE session ( user_id INTEGER REFERENCES usr(id), session_id UUID, -- randomly generated secret VARCHAR(1024), -- private key used for HMAC signing of each API request valid_until_ts TIMESTAMP, -- after this time, the session is no longer valid PRIMARY KEY(user_id, session_id) ); -- a run is a group of jobs that should be tracked together. Jobs can be related (dependencies), --but they don't necessarily need to be. CREATE TABLE run ( id UUID PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES usr(id), name VARCHAR(1024), submit_ts TIMESTAMP, is_done BOOLEAN DEFAULT FALSE, data JSONB ); -- an individual unit of work, store meta data in JSON blob CREATE TABLE job ( id UUID PRIMARY KEY, run_id UUID REFERENCES run(id), job_id VARCHAR(1024), name VARCHAR(1024), is_done BOOLEAN DEFAULT FALSE, is_error BOOLEAN DEFAULT FALSE, submit_ts TIMESTAMP, -- when submitted start_ts TIMESTAMP, -- when started (queue time is the time the last parent job finished) end_ts TIMESTAMP, -- when done retcode BOOLEAN, -- when retcode is set, the job is done data JSONB ); -- job dependencies... DAC CREATE TABLE job_dep ( parent_id UUID REFERENCES job(id), child_id UUID REFERENCES job(id), PRIMARY KEY (parent_id, child_id) );
<reponame>dorianmouafo/zend-Framework-2-test<filename>data-base/data-base.sql<gh_stars>0 /* SQLyog Community Edition- MySQL GUI v6.52 MySQL - 5.6.17 : Database - booking_car ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!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' */; create database if not exists `booking_car`; USE `booking_car`; /*Table structure for table `agency` */ DROP TABLE IF EXISTS `agency`; CREATE TABLE `agency` ( `AGENCY_ID` bigint(4) NOT NULL, `AGENCY_NAME` char(32) NOT NULL, `AGENCY_NUMREGISTER` char(32) NOT NULL, `AGENCY_LOCATION` char(32) NOT NULL, `AGENCY_PHONE_NUMBER` char(32) NOT NULL, `AGENCY_PHONE_NUMBER1` char(32) DEFAULT NULL, `AGENCY_FAX` char(32) DEFAULT NULL, `AGENCY_LOGO` char(32) DEFAULT NULL, `AGENCY_EMAIL` char(32) NOT NULL, PRIMARY KEY (`AGENCY_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `agency` */ /*Table structure for table `car` */ DROP TABLE IF EXISTS `car`; CREATE TABLE `car` ( `CAR_ID` bigint(4) NOT NULL, `TYPE_CAR_ID` bigint(4) NOT NULL, `CAR_MATRICULATION` char(32) NOT NULL, `CAR_NB_SEAT` bigint(4) NOT NULL, `CAR_DESCRIPTION` char(32) DEFAULT NULL, `CAR_VITESSE` char(32) DEFAULT NULL, PRIMARY KEY (`CAR_ID`), KEY `I_FK_CAR_TYPE_CAR` (`TYPE_CAR_ID`), CONSTRAINT `car_ibfk_1` FOREIGN KEY (`TYPE_CAR_ID`) REFERENCES `type_car` (`TYPE_CAR_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `car` */ /*Table structure for table `travel` */ DROP TABLE IF EXISTS `travel`; CREATE TABLE `travel` ( `TRAVEL_ID` bigint(4) NOT NULL, `CAR_ID` bigint(4) NOT NULL, `TRAVEL_NUMBER` char(32) NOT NULL, `TRAVEL_START` char(32) NOT NULL, `TRAVEL_ARRIVE` char(32) DEFAULT NULL, `TAVEL_DATE` char(32) NOT NULL, `TRAVEL_TIME` char(32) NOT NULL, `TRVALE_COMMENT` char(32) DEFAULT NULL, `TRAVEL_IN_PROCESS` tinyint(1) DEFAULT NULL, `TRAVEL_FINISH` tinyint(1) DEFAULT NULL, PRIMARY KEY (`TRAVEL_ID`), KEY `I_FK_TRAVEL_CAR` (`CAR_ID`), CONSTRAINT `travel_ibfk_1` FOREIGN KEY (`CAR_ID`) REFERENCES `car` (`CAR_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `travel` */ /*Table structure for table `type_car` */ DROP TABLE IF EXISTS `type_car`; CREATE TABLE `type_car` ( `TYPE_CAR_ID` bigint(4) NOT NULL, `AGENCY_ID` bigint(4) NOT NULL, `TYPE_CAR_CODE` char(32) NOT NULL, `TYPE_CARE_NAME` char(32) DEFAULT NULL, PRIMARY KEY (`TYPE_CAR_ID`), KEY `I_FK_TYPE_CAR_AGENCY` (`AGENCY_ID`), CONSTRAINT `type_car_ibfk_1` FOREIGN KEY (`AGENCY_ID`) REFERENCES `agency` (`AGENCY_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `type_car` */ /*Table structure for table `user` */ DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `ID_USER` bigint(4) NOT NULL, `USER_IDENTITY_TYPT` char(32) NOT NULL, `USER_IDENTIFY_NUMBER` char(32) NOT NULL, `USER_NAME` char(32) NOT NULL, `USER_SURNAME` char(32) NOT NULL, `USER_PHONE_NUMBER` char(32) NOT NULL, `USER_EMAIL` char(32) DEFAULT NULL, `USER_USERNAME` char(32) NOT NULL, `USER_PASSWORD` char(32) NOT NULL, `USER_TYPE_USER` tinyint(1) DEFAULT NULL, `USER_TYPE_AGENCY` tinyint(1) DEFAULT NULL, PRIMARY KEY (`ID_USER`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `user` */ /*Table structure for table `user_travel` */ DROP TABLE IF EXISTS `user_travel`; CREATE TABLE `user_travel` ( `ID_USER` bigint(4) NOT NULL, `TRAVEL_ID` bigint(4) NOT NULL, `ID_USER_TRAVEL` bigint(4) NOT NULL, `DATE_REGISTER_USER` char(32) NOT NULL, `DATE_TRAVEL` char(32) NOT NULL, `TIME_TRAVEL_START` date DEFAULT NULL, `TIME_TRAVEL_ARRIVE` date DEFAULT NULL, PRIMARY KEY (`ID_USER`,`TRAVEL_ID`), KEY `I_FK_USER_TRAVEL_USER` (`ID_USER`), KEY `I_FK_USER_TRAVEL_TRAVEL` (`TRAVEL_ID`), CONSTRAINT `user_travel_ibfk_1` FOREIGN KEY (`ID_USER`) REFERENCES `user` (`ID_USER`), CONSTRAINT `user_travel_ibfk_2` FOREIGN KEY (`TRAVEL_ID`) REFERENCES `travel` (`TRAVEL_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*Data for the table `user_travel` */ /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(20) NOT NULL AUTO_INCREMENT, `name` char(200) DEFAULT NULL, `email` char(200) DEFAULT NULL, `number` char(200) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; /*Data for the table `users` */ insert into `users`(`id`,`name`,`email`,`number`) values (1,'name','email','002178875'),(2,'dorian','<EMAIL>','15871432900'),(3,'andy','<EMAIL>','2000157889'),(6,'papa miss you','<EMAIL>','002707896655'),(7,'donnateur','<EMAIL>','15871432900'),(8,'aaaaaaaa','aaaaaaaa','111'); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
--[er]test octet_length with time as parameter create class tb( col1 time ); insert into tb values('5:5:5 am'); select octet_length(col1) from tb; drop class tb;
<filename>openGaussBase/testcase/SQL/DDL/partition/Hash/Opengauss_Function_DDL_Partition_Hash_Case0027.sql -- @testpoint: Hash分区表上以concurrently方式创建索引,合理报错 --step1:创建hash分区表 expect:成功 drop table if exists partition_hash_tab; create table partition_hash_tab(p_id int) partition by hash(p_id) (partition p1, partition p2, partition p3, partition p4); --step2:插入数据 expect:成功 BEGIN for i in 1..2000 LOOP insert into partition_hash_tab values(i); end LOOP; end; / --step3:创建concurrently索引 expect:合理报错 create index concurrently partition_index_1 on partition_hash_tab(p_id); --step4:清理环境 expect:成功 drop index if exists partition_index_1; drop table if exists partition_hash_tab cascade;
<filename>Module_A/_data/data.sql -- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: db -- ------------------------------------------------------ -- Server version 10.1.26-MariaDB-0+deb9u1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `GordonsCrownMenu` -- DROP TABLE IF EXISTS `GordonsCrownMenu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `GordonsCrownMenu` ( `Id` int(5) NOT NULL PRIMARY KEY AUTO_INCREMENT, `Category` varchar(12) DEFAULT NULL, `Title` varchar(35) DEFAULT NULL, `Price` decimal(4,2) DEFAULT NULL, `Description` varchar(195) DEFAULT NULL, `Image` varchar(38) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `GordonsCrownMenu` -- LOCK TABLES `GordonsCrownMenu` WRITE; /*!40000 ALTER TABLE `GordonsCrownMenu` DISABLE KEYS */; INSERT INTO `GordonsCrownMenu`(Category,Title,Price,Description,Image) VALUES ('Starters','Davy\'s classic prawn cocktail',7.85,'A selection of prawns, marie rose sauce with a hint of Manzanilla','davys-classic-prawn-cocktail.jpg'), ('','Warm grilled goat\'s cheese crostini',5.55,'on balsamic dressed mixed leaf','warm-grilled-goats-cheese-crostini.jpg'), ('','Plate of Scottish smoked salmon',7.95,'with lambs leaf dressed with balsamic syrup and pink peppercorns','plate-of-scottish-smoked-salmon.jpg'), ('Salads','Gordon\'s Salad',9.95,'Chicory, gorgonzola cheese, pear and dandelion salad with a whole grain mustard dressing','gordons-salad.jpg'), ('','Grilled Salmon Salad',23.95,'Mixed greens with sliced avocado, bacon, cherry tomato, onion and Cheshire with toasted sesame citrus vinaigrette','grilled-salmon-salad.jpg'), ('','Cobb Salad',21.15,'Our take on the classic - grilled chicken, hickory-smoked bacon, Stilton cheese, tomato, boiled egg, black olive, English peas, avocado and fresh chives, with a choice of dressing on the side','cobb-salad.jpg'), ('Sandwiches','Grilled goat\'s cheese',7.95,'Warm goat\'s cheese served with roast Mediterranean vegetables and pesto on a toasted ciabatta','grilled-goats-cheese.jpg'), ('','Cumberland sausage',7.25,'6oz Cumberland sausage ring served with red onions, in toasted sourdough bloomer','cumberland-sausage.jpg'), ('Main courses','Kings Wings',15.95,'A dozen spiced chicken wings tossed in our special Guinness Hoisin BBQ sauce, with sesame seeds and green onions','kings-wings.jpg'), ('','Sausage Rolls',18.35,'Banger sausage wrapped in pastry served with our house BBQ and Scotch eggs','sausage-rolls.jpg'), ('','Bangers and mash',10.95,'Cumberland sausages with traditional mashed potatoes and onion gravy','bangers-and-mash.jpg'), ('','Fish and chips',12.95,'Line caught haddock in beer batter served with chipped potatoes and minted pea puree','fish-n-chips.jpg'), ('','New season lamb cutlets',16.25,'Roasted vegetables, sweet potato and chive mash','new-season-lamb-cutlets.jpg'), ('','Side orders',2.85,'Choose from:\n- chipped potatoes or fries\n- Jersey Royal potatoes\n- traditional mash\n- seasonal vegetable selection\n- green beans\n- mixed leaf salad with house dressing\n(Price is for each portion)','side-orders.jpg'), ('Beef','T-Bone steak',28.95,'400g served on the bone. Made up of both sirloin and fillet offering you both the tenderness of the fillet and the flavour of the sirloin','t-bone-steak.jpg'), ('','Sirloin steak',23.55,'A juicy, tasty and tender cut of 240g fully trimmed and aged for 21 days','sirloin-steak.jpg'), ('','Ribeye steak',20.15,'Rich marbling is the secret to this succulent and tasty cut of 220g, aged for 28 days','ribeye-steak.jpg'), ('Desserts','English cheese board',9.75,'A selection of four British cheeses served with biscuits and green tomato and apple chutney','english-cheese-board.jpg'), ('','Chocolate tart',5.85,'Delicious tart with clotted cream and raspberry coulis','chocolate-tart.jpg'); /*!40000 ALTER TABLE `GordonsCrownMenu` 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-03-28 17:06:56
<gh_stars>0 /* falta criar a database... tenho no meu notebook mas só posso acessar a tarde rs. mas é só criar ela aqui (chamei de usersdb) e fazer "use usersdb" antes de começar a criar as tables */ --DROP DATABASE IF EXISTS `piquepei`; CREATE DATABASE IF NOT EXISTS `piquepei` DEFAULT CHARACTER SET = latin1; USE 'piquepei' DROP TABLE IF EXISTS `users` ; CREATE TABLE IF NOT EXISTS `users` ( `id` VARCHAR(255) DEFAULT NULL, `name` VARCHAR(255) DEFAULT NULL, `username` VARCHAR(255) DEFAULT NULL) DEFAULT CHARACTER SET = latin1; LOAD DATA INFILE "/home/sigkill/Desktop/users-data/users.csv" INTO TABLE users COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (id, name, username); DROP TABLE IF EXISTS `relevancia1` ; CREATE TABLE IF NOT EXISTS `relevancia1` ( `id` VARCHAR(255) DEFAULT NULL, PRIMARY KEY (`id`)) DEFAULT CHARACTER SET = latin1; DROP TABLE IF EXISTS `relevancia2` ; CREATE TABLE IF NOT EXISTS `relevancia2` ( `id` VARCHAR(255) DEFAULT NULL, PRIMARY KEY (`id`)) DEFAULT CHARACTER SET = latin1; LOAD DATA INFILE "/home/sigkill/Desktop/users-data/lista_relevancia_1.txt" INTO TABLE relevancia1 COLUMNS TERMINATED BY '\n' LINES TERMINATED BY '\n' (id); LOAD DATA INFILE "/home/sigkill/Desktop/users-data/lista_relevancia_2.txt" INTO TABLE relevancia2 COLUMNS TERMINATED BY '\n' LINES TERMINATED BY '\n' (id); -- flush privileges; -- grant all privileges on *.* to 'root'@'%' with grant option; quit
<filename>cql/step_4_get_db_stats.cql<gh_stars>0 //////////////////////////////////////////////////////////////////////// // // Create a snapshot report // // Note: This script will be processed by neo4j-shell utility // All comments in Java Style: line preceded by // // Its syntax must be list of cypher queries and neo4j-shell commands // separated by ';' // //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // // Overall statistics // CALL apoc.meta.stats() YIELD labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount, labels, relTypes, stats RETURN stats; // //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // // Node report // MATCH (n) RETURN DISTINCT(LABELS(n)) AS node_label, COUNT(n) AS count ORDER BY node_label, count DESC; // //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // // Relationship report // MATCH (s)-[r]->(e) RETURN DISTINCT([LABELS(s), TYPE(r), LABELS(e)]) AS rel_type, COUNT(r) AS count ORDER BY rel_type, count DESC; // ////////////////////////////////////////////////////////////////////////
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 `mydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; USE `mydb` ; -- ----------------------------------------------------- -- Table `mydb`.`children` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`children` ; CREATE TABLE IF NOT EXISTS `mydb`.`children` ( `id` INT NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(45) NULL, `last_name` VARCHAR(45) NULL, `date_of_birth` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`companies` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`companies` ; CREATE TABLE IF NOT EXISTS `mydb`.`companies` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `cost` VARCHAR(45) NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`departments` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`departments` ; CREATE TABLE IF NOT EXISTS `mydb`.`departments` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `companies_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name` ASC), INDEX `fk_departments_companies1_idx` (`companies_id` ASC), CONSTRAINT `fk_departments_companies1` FOREIGN KEY (`companies_id`) REFERENCES `mydb`.`companies` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`employees` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`employees` ; CREATE TABLE IF NOT EXISTS `mydb`.`employees` ( `id` INT NOT NULL AUTO_INCREMENT, `manager_id` INT NULL, `salary` INT NULL, `departments_id` INT NOT NULL, `hours_work_per_week` INT NULL, PRIMARY KEY (`id`), INDEX `fk_employees_departments1_idx` (`departments_id` ASC), CONSTRAINT `fk_employees_departments1` FOREIGN KEY (`departments_id`) REFERENCES `mydb`.`departments` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`cars` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`cars` ; CREATE TABLE IF NOT EXISTS `mydb`.`cars` ( `id` INT NOT NULL AUTO_INCREMENT, `social_security_number` VARCHAR(45) NOT NULL, `brand` VARCHAR(45) NULL, `color` VARCHAR(45) NULL, `release_year` DATE NULL, `employees_id` INT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `social_security_number_UNIQUE` (`social_security_number` ASC), INDEX `fk_cars_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_cars_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`houses` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`houses` ; CREATE TABLE IF NOT EXISTS `mydb`.`houses` ( `id` INT NOT NULL AUTO_INCREMENT, `city` VARCHAR(45) NULL, `street` VARCHAR(45) NULL, `house` VARCHAR(45) NULL, `apartment` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`personal_informations` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`personal_informations` ; CREATE TABLE IF NOT EXISTS `mydb`.`personal_informations` ( `id` INT NOT NULL AUTO_INCREMENT, `date_of_employment` DATE NOT NULL, `date_of_birth` DATE NOT NULL, `social_security_number` VARCHAR(45) NOT NULL, `employees_id` INT NOT NULL, `first_name` VARCHAR(45) NULL, `last_name` VARCHAR(45) NULL, PRIMARY KEY (`id`), UNIQUE INDEX `date_of_employment_UNIQUE` (`date_of_employment` ASC), INDEX `fk_personal_informations_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_personal_informations_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`bonuses` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`bonuses` ; CREATE TABLE IF NOT EXISTS `mydb`.`bonuses` ( `id` INT NOT NULL AUTO_INCREMENT, `type` VARCHAR(45) NOT NULL, `value` VARCHAR(45) NULL, `employees_id` INT NOT NULL, PRIMARY KEY (`id`), INDEX `fk_bonuses_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_bonuses_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`holidays` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`holidays` ; CREATE TABLE IF NOT EXISTS `mydb`.`holidays` ( `id` INT NOT NULL AUTO_INCREMENT, `start_date` DATE NOT NULL, `end_date` DATE NOT NULL, `payment` INT NULL, `employees_id` INT NOT NULL, PRIMARY KEY (`id`, `employees_id`), INDEX `fk_holidays_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_holidays_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`offices` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`offices` ; CREATE TABLE IF NOT EXISTS `mydb`.`offices` ( `id` INT NOT NULL AUTO_INCREMENT, `city` VARCHAR(45) NULL, `street` VARCHAR(45) NULL, `house` VARCHAR(45) NULL, `space` INT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`projects` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`projects` ; CREATE TABLE IF NOT EXISTS `mydb`.`projects` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NULL, `cost` INT NULL, `date_of_delivery` DATE NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`votes` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`votes` ; CREATE TABLE IF NOT EXISTS `mydb`.`votes` ( `id` INT NOT NULL AUTO_INCREMENT, `votable_type` VARCHAR(45) NULL, `votable_id` INT NULL, `vote_weight` INT NULL, PRIMARY KEY (`id`), INDEX `fk_votes_employees1_idx` (`votable_id` ASC), CONSTRAINT `fk_votes_employees1` FOREIGN KEY (`votable_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_votes_projects1` FOREIGN KEY (`votable_id`) REFERENCES `mydb`.`projects` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`roles` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`roles` ; CREATE TABLE IF NOT EXISTS `mydb`.`roles` ( `id` INT NOT NULL AUTO_INCREMENT, `type` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`employees_has_roles` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`employees_has_roles` ; CREATE TABLE IF NOT EXISTS `mydb`.`employees_has_roles` ( `employees_id` INT NOT NULL, `roles_id` INT NOT NULL, PRIMARY KEY (`employees_id`, `roles_id`), INDEX `fk_employees_has_roles_roles1_idx` (`roles_id` ASC), INDEX `fk_employees_has_roles_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_employees_has_roles_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_employees_has_roles_roles1` FOREIGN KEY (`roles_id`) REFERENCES `mydb`.`roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`employees_has_children` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`employees_has_children` ; CREATE TABLE IF NOT EXISTS `mydb`.`employees_has_children` ( `employees_id` INT NOT NULL, `children_id` INT NOT NULL, PRIMARY KEY (`employees_id`, `children_id`), INDEX `fk_employees_has_children_children1_idx` (`children_id` ASC), INDEX `fk_employees_has_children_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_employees_has_children_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_employees_has_children_children1` FOREIGN KEY (`children_id`) REFERENCES `mydb`.`children` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`departments_has_offices` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`departments_has_offices` ; CREATE TABLE IF NOT EXISTS `mydb`.`departments_has_offices` ( `departments_id` INT NOT NULL, `offices_id` INT NOT NULL, PRIMARY KEY (`departments_id`, `offices_id`), INDEX `fk_departments_has_offices_offices1_idx` (`offices_id` ASC), INDEX `fk_departments_has_offices_departments1_idx` (`departments_id` ASC), CONSTRAINT `fk_departments_has_offices_departments1` FOREIGN KEY (`departments_id`) REFERENCES `mydb`.`departments` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_departments_has_offices_offices1` FOREIGN KEY (`offices_id`) REFERENCES `mydb`.`offices` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`departments_has_projects` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`departments_has_projects` ; CREATE TABLE IF NOT EXISTS `mydb`.`departments_has_projects` ( `departments_id` INT NOT NULL, `projects_id` INT NOT NULL, PRIMARY KEY (`departments_id`, `projects_id`), INDEX `fk_departments_has_projects_projects1_idx` (`projects_id` ASC), INDEX `fk_departments_has_projects_departments1_idx` (`departments_id` ASC), CONSTRAINT `fk_departments_has_projects_departments1` FOREIGN KEY (`departments_id`) REFERENCES `mydb`.`departments` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_departments_has_projects_projects1` FOREIGN KEY (`projects_id`) REFERENCES `mydb`.`projects` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`employees_has_houses` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`employees_has_houses` ; CREATE TABLE IF NOT EXISTS `mydb`.`employees_has_houses` ( `employees_id` INT NOT NULL, `houses_id` INT NOT NULL, PRIMARY KEY (`employees_id`, `houses_id`), INDEX `fk_employees_has_houses_houses1_idx` (`houses_id` ASC), INDEX `fk_employees_has_houses_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_employees_has_houses_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_employees_has_houses_houses1` FOREIGN KEY (`houses_id`) REFERENCES `mydb`.`houses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`employees_has_projects` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`employees_has_projects` ; CREATE TABLE IF NOT EXISTS `mydb`.`employees_has_projects` ( `employees_id` INT NOT NULL, `projects_id` INT NOT NULL, PRIMARY KEY (`employees_id`, `projects_id`), INDEX `fk_employees_has_projects_projects1_idx` (`projects_id` ASC), INDEX `fk_employees_has_projects_employees1_idx` (`employees_id` ASC), CONSTRAINT `fk_employees_has_projects_employees1` FOREIGN KEY (`employees_id`) REFERENCES `mydb`.`employees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_employees_has_projects_projects1` FOREIGN KEY (`projects_id`) REFERENCES `mydb`.`projects` (`id`) 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;
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 20, 2021 at 03:15 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `crud_atv2` -- -- -------------------------------------------------------- -- -- Table structure for table `pacoteturistico` -- CREATE TABLE `pacoteturistico` ( `Id` int(11) NOT NULL, `Nome` varchar(80) NOT NULL, `Origem` varchar(80) NOT NULL, `Destino` varchar(100) NOT NULL, `Saida` date NOT NULL, `Retorno` date NOT NULL, `Atrativos` varchar(100) NOT NULL, `Usuario` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `pacoteturistico` -- INSERT INTO `pacoteturistico` (`Id`, `Nome`, `Origem`, `Destino`, `Saida`, `Retorno`, `Atrativos`, `Usuario`) VALUES (1, 'New York Winter', 'Rio de Janeiro - RJ', 'New York - United States', '2021-01-05', '2021-02-05', 'Empire state building, Central Park', 1), (3, 'The king of the Jungle', 'Rio de Janeiro - RJ', 'South Africa - Africa', '2021-08-01', '2021-08-16', 'Kruger National Park, Mesa Mountain', 1); -- -------------------------------------------------------- -- -- Table structure for table `usuario` -- CREATE TABLE `usuario` ( `Id` int(11) NOT NULL, `Nome` varchar(30) DEFAULT NULL, `DataNascimento` date DEFAULT NULL, `Login` varchar(80) NOT NULL, `Senha` varchar(80) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `usuario` -- INSERT INTO `usuario` (`Id`, `Nome`, `DataNascimento`, `Login`, `Senha`) VALUES (1, 'Rodrigo', '0001-01-01', 'ab', 'ab'); -- -- Indexes for dumped tables -- -- -- Indexes for table `pacoteturistico` -- ALTER TABLE `pacoteturistico` ADD PRIMARY KEY (`Id`), ADD KEY `pacoteturistico_ibfk_1` (`Usuario`); -- -- Indexes for table `usuario` -- ALTER TABLE `usuario` ADD PRIMARY KEY (`Id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `pacoteturistico` -- ALTER TABLE `pacoteturistico` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `usuario` -- ALTER TABLE `usuario` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- Constraints for dumped tables -- -- -- Constraints for table `pacoteturistico` -- ALTER TABLE `pacoteturistico` ADD CONSTRAINT `pacoteturistico_ibfk_1` FOREIGN KEY (`Usuario`) REFERENCES `usuario` (`Id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<filename>mysql-demo/mysql-transaction-demo/sql/write-isolation-1.sql start transaction; select 'sql 1', @amount := value from mywrite where id=1; select 'sql 1: sleep 1 second', now(); select 'sql 1', now(), sleep(1); update mywrite set value = @amount - 1 where id=1; select 'sql 1: sleep 5 seconds ...', now(); select 'sql 1', now(), sleep(5); select 'sql 1', now(), t.* from mywrite t where id=1; select 'sql 1: commit'; commit; select 'sql 1', now(), t.* from mywrite t where id=1;
<filename>employee-schema.sql CREATE DATABASE trackerDB; USE trackerDB; CREATE TABLE department ( department_id INT NOT NULL AUTO_INCREMENT, name VARCHAR(30) NOT NULL, PRIMARY KEY (department_id) ); CREATE TABLE role ( role_id INT NOT NULL AUTO_INCREMENT, title VARCHAR(30) NOT NULL, salary DECIMAL(10,2) NULL, department_id INT NULL, PRIMARY KEY (role_id), FOREIGN KEY (department_id) REFERENCES department (department_id) ON UPDATE CASCADE ON DELETE SET NULL ); CREATE TABLE employee ( employee_id INT NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, role_id INT NULL, manager_id INT NULL, PRIMARY KEY (employee_id), FOREIGN KEY (role_id) REFERENCES role (role_id) ON UPDATE CASCADE ON DELETE SET NULL, FOREIGN KEY (manager_id) REFERENCES employee (employee_id) ON UPDATE CASCADE ON DELETE SET NULL ); INSERT INTO department (name) VALUES ("Human Resources"), ("Development"), ("Sales"); INSERT INTO role (title, salary, department_id) VALUES ("Manager", 100000, 1), ("HR Representative", 80000, 1), ("Dev", 90000, 2), ("Lead Developer", 120000, 2), ("Lead Sales Rep", 100000, 3), ("Sales Rep", 80000, 3); INSERT INTO employee (first_name, last_name, role_id) VALUES ("Titus", "Molestina", 1),("Israel", "Molestina", 3), ("Ian", "Hopkins", 5); INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ("Grace", "Chamberlain", 2, 1), ("Sarah", "Chamberlain", 4, 3), ("Jaseth", "Fike", 6, 5);
<reponame>yadavritu/pc<filename>database/sql_changes.sql -- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Apr 20, 2018 at 07:05 AM -- Server version: 10.1.19-MariaDB -- PHP Version: 5.6.28 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: `pizza_hut` -- -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `type` enum('Online','COD') NOT NULL, `flat_no` varchar(100) NOT NULL, `address` varchar(255) NOT NULL, `landmark` varchar(255) NOT NULL, `zipcode` varchar(10) NOT NULL, `latitude` varchar(20) NOT NULL, `longitude` varchar(20) NOT NULL, `distance` int(11) NOT NULL, `amount` double(12,2) NOT NULL, `shipping_charge` double(12,2) NOT NULL, `payment_status` enum('Pending','Fail','Paid') NOT NULL DEFAULT 'Pending', `status` enum('Pending','Accepted','Rejected','Delivered','Completed') NOT NULL DEFAULT 'Pending', `transaction_id` varchar(100) NOT NULL, `created` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `user_id`, `type`, `flat_no`, `address`, `landmark`, `zipcode`, `latitude`, `longitude`, `distance`, `amount`, `shipping_charge`, `payment_status`, `status`, `transaction_id`, `created`) VALUES (1, 6, 'Online', '14', '<NAME>', 'Near Naher', '394210', '21.180999', '72.864102', 2457, 315.27, 14.57, 'Paid', '', '1da5s4d5s45as4d5', '0000-00-00 00:00:00'), (2, 6, 'Online', '14', '<NAME>', 'Near Naher', '394210', '21.180999', '72.864102', 2457, 300.70, 14.57, 'Fail', '', 'dasda', '2018-04-20 00:28:26'), (3, 6, 'Online', '14', '<NAME>', 'Near Naher', '394210', '21.180999', '72.864102', 2457, 955.30, 14.57, 'Pending', 'Pending', '', '2018-04-20 02:02:13'), (4, 6, 'Online', '14', '<NAME>', 'Near Naher', '394210', '21.180999', '72.864102', 2457, 955.30, 14.57, 'Pending', 'Pending', '', '2018-04-20 02:10:42'), (5, 6, 'Online', '14', '<NAME>', '<NAME>', '394210', '21.180999', '72.864102', 2457, 955.30, 14.57, 'Pending', 'Pending', '', '2018-04-20 02:10:53'), (6, 6, 'Online', '14', '<NAME>', '<NAME>', '394210', '21.180999', '72.864102', 2457, 955.30, 14.57, 'Pending', 'Pending', '', '2018-04-20 02:14:56'), (7, 6, 'Online', '14', '<NAME>', '<NAME>', '394210', '21.180999', '72.864102', 2457, 455.90, 14.57, 'Pending', 'Pending', '', '2018-04-20 02:15:39'); -- -------------------------------------------------------- -- -- Table structure for table `order_details` -- CREATE TABLE `order_details` ( `id` int(11) NOT NULL, `order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `product_name` varchar(255) NOT NULL, `product_price` double(12,2) NOT NULL, `product_img` varchar(255) NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order_details` -- INSERT INTO `order_details` (`id`, `order_id`, `product_id`, `product_name`, `product_price`, `product_img`, `quantity`) VALUES (1, 1, 4, '<NAME>', 155.20, ' /uploads/pro_img/download (1).jpg', 1), (2, 1, 2, '<NAME>', 145.50, ' /uploads/pro_img/4Cheeseburger-On-Wooden-Table-ed.jpg', 1), (3, 2, 4, '<NAME>', 155.20, ' /uploads/pro_img/download (1).jpg', 1), (4, 2, 2, '<NAME>', 145.50, ' /uploads/pro_img/4Cheeseburger-On-Wooden-Table-ed.jpg', 1), (5, 3, 27, 'OREGANO', 475.30, ' /uploads/pro_img/gi9download (3).jpg', 1), (6, 3, 30, 'MARGHERITA', 480.00, ' /uploads/pro_img/m5PizzaMargherita_xhm1p.jpg', 1), (7, 4, 27, 'OREGANO', 475.30, ' /uploads/pro_img/gi9download (3).jpg', 1), (8, 4, 30, 'MARGHERITA', 480.00, ' /uploads/pro_img/m5PizzaMargherita_xhm1p.jpg', 1), (9, 5, 27, 'OREGANO', 475.30, ' /uploads/pro_img/gi9download (3).jpg', 1), (10, 5, 30, 'MARGHERITA', 480.00, ' /uploads/pro_img/m5PizzaMargherita_xhm1p.jpg', 1), (11, 6, 27, 'OREGANO', 475.30, ' /uploads/pro_img/gi9download (3).jpg', 1), (12, 6, 30, 'MARGHERITA', 480.00, ' /uploads/pro_img/m5PizzaMargherita_xhm1p.jpg', 1), (13, 7, 4, '<NAME>', 155.20, ' /uploads/pro_img/download (1).jpg', 2), (14, 7, 2, '<NAME>', 145.50, ' /uploads/pro_img/4Cheeseburger-On-Wooden-Table-ed.jpg', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_details` -- ALTER TABLE `order_details` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `order_details` -- ALTER TABLE `order_details` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; ALTER TABLE `reg` ADD `mobile_no` VARCHAR(15) NOT NULL AFTER `r_lname`; ALTER TABLE `orders` ADD `note` TEXT NOT NULL AFTER `transaction_id`; CREATE TABLE `reviews` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `rating` int(11) NOT NULL, `title` varchar(255) NOT NULL, `body` text NOT NULL, `created` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE `reviews` ADD PRIMARY KEY (`id`); ALTER TABLE `reviews` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; ALTER TABLE `product` ADD `review_count` INT(11) NOT NULL DEFAULT '0' AFTER `p_status`; ALTER TABLE `product` ADD `rating` INT(11) NOT NULL DEFAULT '0' AFTER `review_count`;
ALTER TABLE services ADD COLUMN is_testnet BOOLEAN NOT NULL DEFAULT TRUE; ALTER TABLE services ADD COLUMN flat_fee DECIMAL(40, 8); ALTER TABLE services ADD COLUMN percent_fee DECIMAL(4, 2); CREATE INDEX ON services (is_testnet); CREATE INDEX ON services (flat_fee); CREATE INDEX ON services (percent_fee); CREATE TABLE service_capacities ( pid BIGSERIAL PRIMARY KEY, service_id BIGINT NOT NULL REFERENCES services (pid), unit VARCHAR(255), value DECIMAL(40, 8) ); CREATE INDEX ON service_capacities (service_id); CREATE INDEX ON service_capacities (unit); CREATE INDEX ON service_capacities (value);
<filename>Amigoscode/Relational Database and SQL Essentials/4- Filtering Data/3- Limit, Offset & Fetch.sql<gh_stars>1-10 -- Limit, Offset & Fetch SELECT * FROM person LIMIT 15; SELECT * FROM person OFFSET 5; SELECT * FROM person OFFSET 5 LIMIT 15; SELECT * FROM person FETCH FIRST 8 ROWS ONLY; SELECT * FROM person OFFSET 5 FETCH FIRST 8 ROWS ONLY; SELECT * FROM person OFFSET 5 FETCH FIRST ROW ONLY;
<gh_stars>1-10 IF NOT EXISTS ( select * from INFORMATION_SCHEMA.COLUMNS where TABLE_SCHEMA='dw' and TABLE_NAME='f_virta_jtp_tilasto' and COLUMN_NAME='d_julkaisufoorumitaso_vanha_id' ) BEGIN ALTER TABLE dw.f_virta_jtp_tilasto ADD d_julkaisufoorumitaso_vanha_id int NULL END IF NOT EXISTS ( select * from INFORMATION_SCHEMA.COLUMNS where TABLE_SCHEMA='dw' and TABLE_NAME='f_virta_jtp_tilasto' and COLUMN_NAME='d_julkaisufoorumitaso_uusi_id' ) BEGIN ALTER TABLE dw.f_virta_jtp_tilasto ADD d_julkaisufoorumitaso_uusi_id int NULL END
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Oct 13, 2019 at 05:10 PM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.3.5 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: `gmn` -- -- -------------------------------------------------------- -- -- Table structure for table `banks` -- CREATE TABLE `banks` ( `id_bank` int(11) NOT NULL, `bank_name` varchar(60) NOT NULL, `no_rekening` varchar(15) NOT NULL, `id_user` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `banks` -- INSERT INTO `banks` (`id_bank`, `bank_name`, `no_rekening`, `id_user`) VALUES (1, 'bca', '876756564509781', 2); -- -------------------------------------------------------- -- -- Table structure for table `comment` -- CREATE TABLE `comment` ( `id_comment` int(11) NOT NULL, `id_product` int(11) NOT NULL, `id_user` int(11) NOT NULL, `comments_fill` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `gudang` -- CREATE TABLE `gudang` ( `id_warehouse` int(11) NOT NULL, `warehouse_name` varchar(50) NOT NULL, `image_gudang` varchar(100) NOT NULL, `warehouse_type` enum('ps','cb') NOT NULL, `province_id` int(11) NOT NULL, `city_id` int(11) NOT NULL, `address` varchar(255) NOT NULL, `created_at` int(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `gudang` -- INSERT INTO `gudang` (`id_warehouse`, `warehouse_name`, `image_gudang`, `warehouse_type`, `province_id`, `city_id`, `address`, `created_at`) VALUES (1, 'gwc bandung', '5d806042bf67c.jpg', 'ps', 9, 22, 'Tidak diketahui lokasinya silahkan cari sendiri di google bisa searching kan :v', 1570591844); -- -------------------------------------------------------- -- -- Table structure for table `message` -- CREATE TABLE `message` ( `id_message` int(11) NOT NULL, `fullname` varchar(60) NOT NULL, `email` varchar(60) NOT NULL, `message` varchar(100) NOT NULL, `status_read` int(11) NOT NULL, `created_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `message` -- INSERT INTO `message` (`id_message`, `fullname`, `email`, `message`, `status_read`, `created_at`) VALUES (1, '<NAME>', '<EMAIL>', 'bagus bro tampilannya tapi mana isi produknya kenapa kosong ? :v', 0, 1570554390); -- -------------------------------------------------------- -- -- Table structure for table `pembelian` -- CREATE TABLE `pembelian` ( `id_pembelian` int(11) NOT NULL, `id_user` int(11) NOT NULL, `file_name` varchar(40) NOT NULL, `created_at` int(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `pembelian` -- INSERT INTO `pembelian` (`id_pembelian`, `id_user`, `file_name`, `created_at`) VALUES (1, 4, '5d9d55de592b2.pdf', 1570592222); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE `product` ( `id_product` int(11) NOT NULL, `image` varchar(100) NOT NULL, `product_name` varchar(30) NOT NULL, `price` varchar(30) NOT NULL, `weight` int(11) NOT NULL, `product_stock` int(11) NOT NULL, `province_id` int(11) NOT NULL, `city_id` int(11) NOT NULL, `id_user` int(11) NOT NULL, `id_vendor` int(11) NOT NULL, `id_gudang` int(11) NOT NULL, `descriptions` varchar(300) NOT NULL, `product_arrive` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product` -- INSERT INTO `product` (`id_product`, `image`, `product_name`, `price`, `weight`, `product_stock`, `province_id`, `city_id`, `id_user`, `id_vendor`, `id_gudang`, `descriptions`, `product_arrive`) VALUES (1, '5d9d56cf9576d.jpg', 'Triplex 10mm', '30000', 1, 10, 6, 154, 7, 1, 1, 'gk ada deskripsinya.', 1570592463), (2, '5d9d5ddf61adc.jpg', 'Triplex 30mm', '90000', 1, 12, 1, 17, 7, 1, 1, 'tak ada deskripsi.', 1570594271), (3, '5d9d5e10a2b17.jpg', 'Triplex 20mm', '25000', 1, 4, 1, 17, 7, 1, 1, 'wdwdededwscecew.', 1570594320), (4, '5d9d5e3332e7a.jpg', 'Triplex 35mm', '33000', 2, 5, 1, 17, 7, 1, 1, 'dasdwefegfergregergergrgh.', 1570594355), (5, '5d9d5e4f6b817.jpg', 'Triplex 15mm', '14000', 1, 3, 1, 17, 7, 1, 1, 'wdweeeeeedwe.', 1570594383), (6, '5d9d5e6fde296.jpg', 'Triplex 20mm', '54000', 2, 3, 1, 17, 7, 1, 1, 'sadasdwedwefewfwefwegw.', 1570594415), (7, '5d9d5e87955db.jpg', 'Triplex 10mm', '34000', 1, 2, 1, 17, 7, 1, 1, 'wadwdwqdwdwwqFFFESF.', 1570594439), (8, '5d9d5eaa658fb.jpg', 'Triplex 11mm', '12000', 1, 5, 1, 17, 7, 1, 1, 'sadefefewfweafeawferg.', 1570594474); -- -------------------------------------------------------- -- -- Table structure for table `provinsi` -- CREATE TABLE `provinsi` ( `province_id` int(11) NOT NULL, `province_name` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `provinsi` -- INSERT INTO `provinsi` (`province_id`, `province_name`) VALUES (1, 'Bali'), (2, 'Bangka Belitung'), (3, 'Banten'), (4, 'Bengkulu'), (5, 'DI Yogyakarta'), (6, 'DKI Jakarta'), (7, 'Gorontalo'), (8, 'Jambi'), (9, 'Jawa Barat'), (10, 'Jawa Tengah'), (11, 'Jawa Timur'), (12, 'Kalimantan Barat'), (13, 'Kalimantan Selatan'), (14, 'Kalimantan Tengah'), (15, 'Kalimantan Timur'), (16, 'Kalimantan Utara'), (17, 'Kepulauan Riau'), (18, 'Lampung'), (19, 'Maluku'), (20, 'Maluku Utara'), (21, 'Nanggroe Aceh Darussalam(NAD)'), (22, 'Nusa Tenggara Barat(NTB)'), (23, 'Nusa Tenggara Timur'), (24, 'Papua'), (25, 'Papua Barat'), (26, 'Riau'), (27, 'Sulawesi Barat'), (28, 'Sulawesi Selatan'), (29, 'Sulawesi Tengah'), (30, 'Sulawesi Tenggara'), (31, 'Sulawesi Utara'), (32, 'Sumatera Barat'), (33, 'Sumatera Selatan'), (34, 'Sumatera Utara'); -- -------------------------------------------------------- -- -- Table structure for table `remaining_stock` -- CREATE TABLE `remaining_stock` ( `id_remaining` int(11) NOT NULL, `id_gudang` int(11) NOT NULL, `id_produk` int(11) NOT NULL, `id_user` int(11) NOT NULL, `stock` int(11) NOT NULL, `created_at` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `role` -- CREATE TABLE `role` ( `role_id` int(11) NOT NULL, `role_name` varchar(128) NOT NULL, `status` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `role` -- INSERT INTO `role` (`role_id`, `role_name`, `status`) VALUES (1, 'Admin Gudang', 1), (2, 'Admin Pembelian', 1), (3, 'Admin Penjualanan', 1), (4, 'Member', 1), (5, 'HRD', 1), (6, 'Supervisor', 1); -- -------------------------------------------------------- -- -- Table structure for table `transaksi` -- CREATE TABLE `transaksi` ( `id_transaksi` int(11) NOT NULL, `id_barang` int(11) NOT NULL, `id_pembeli` int(11) NOT NULL, `id_kasir` int(11) NOT NULL, `id_gudang` int(11) NOT NULL, `qty` int(11) NOT NULL, `total_weight` int(11) NOT NULL, `courier` int(11) NOT NULL, `service` int(11) NOT NULL, `payment` int(11) NOT NULL, `status_confirm` int(11) NOT NULL, `date_order` int(11) NOT NULL, `date_confirm` int(11) NOT NULL, `resi` varchar(60) NOT NULL, `month_chart` varchar(20) NOT NULL, `year_chart` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaksi` -- INSERT INTO `transaksi` (`id_transaksi`, `id_barang`, `id_pembeli`, `id_kasir`, `id_gudang`, `qty`, `total_weight`, `courier`, `service`, `payment`, `status_confirm`, `date_order`, `date_confirm`, `resi`, `month_chart`, `year_chart`) VALUES (1, 5, 5, 7, 1, 3, 3, 0, 12000, 1, 2, 1570597357, 1570597671, '5d9d6b4e707fd.png', '10', '2019'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id_user` int(11) NOT NULL, `fullname` varchar(30) NOT NULL, `province_id` int(11) NOT NULL, `city_id` int(11) NOT NULL, `picture` varchar(60) NOT NULL, `postal_code` int(6) DEFAULT NULL, `address` varchar(100) DEFAULT NULL, `phone_number` varchar(13) DEFAULT NULL, `email` varchar(60) NOT NULL, `password` varchar(65) NOT NULL, `role_id` int(11) NOT NULL, `id_gudang` int(11) NOT NULL, `active_staff` int(2) NOT NULL, `date_created` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id_user`, `fullname`, `province_id`, `city_id`, `picture`, `postal_code`, `address`, `phone_number`, `email`, `password`, `role_id`, `id_gudang`, `active_staff`, `date_created`) VALUES (2, '<NAME>', 9, 22, '5d9d50ddaea5c.png', 40295, 'jalan merkuri indah timur nomor 14.', '089697704167', '<EMAIL>', <PASSWORD>', 3, 0, 1, 1570590521), (3, '<NAME>', 6, 151, 'no-photo.jpg', NULL, NULL, NULL, '<EMAIL>', <PASSWORD>', 5, 0, 1, 1570590551), (4, '<NAME>', 3, 106, 'no-photo.jpg', NULL, NULL, NULL, '<EMAIL>', <PASSWORD>', 2, 0, 1, 1570590652), (5, '<NAME>', 9, 22, '5d9d5f6f3f388.png', 1221, 'jalan merkuri indah timur nomor 10.', '08998877884', '<EMAIL>', <PASSWORD>', 4, 0, 1, 1570590703), (6, '<NAME>', 9, 376, 'no-photo.jpg', NULL, NULL, NULL, '<EMAIL>', <PASSWORD>', 6, 0, 1, 1570590855), (7, '<NAME>', 1, 17, '5d9d5949869d3.png', 10234, 'jalan merkuri indah tengah nomor 14.', '08998877887', '<EMAIL>', <PASSWORD>', 1, 1, 1, 1570592317); -- -------------------------------------------------------- -- -- Table structure for table `vendor` -- CREATE TABLE `vendor` ( `id_vendor` int(11) NOT NULL, `vendor_name` varchar(40) NOT NULL, `product_type` varchar(40) NOT NULL, `email` varchar(60) NOT NULL, `phone_number` varchar(13) NOT NULL, `address` varchar(100) NOT NULL, `created_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `vendor` -- INSERT INTO `vendor` (`id_vendor`, `vendor_name`, `product_type`, `email`, `phone_number`, `address`, `created_at`) VALUES (1, 'lotte', 'Wood', '<EMAIL>', '0998798898', 'gk tau alamatnya dimana cari sendiri di google :v', 1570592155); -- -- Indexes for dumped tables -- -- -- Indexes for table `banks` -- ALTER TABLE `banks` ADD PRIMARY KEY (`id_bank`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `comment` -- ALTER TABLE `comment` ADD PRIMARY KEY (`id_comment`), ADD KEY `id_product` (`id_product`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `gudang` -- ALTER TABLE `gudang` ADD PRIMARY KEY (`id_warehouse`); -- -- Indexes for table `message` -- ALTER TABLE `message` ADD PRIMARY KEY (`id_message`); -- -- Indexes for table `pembelian` -- ALTER TABLE `pembelian` ADD PRIMARY KEY (`id_pembelian`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`id_product`), ADD KEY `id_gudang` (`id_gudang`), ADD KEY `id_vendor` (`id_vendor`); -- -- Indexes for table `provinsi` -- ALTER TABLE `provinsi` ADD PRIMARY KEY (`province_id`); -- -- Indexes for table `remaining_stock` -- ALTER TABLE `remaining_stock` ADD PRIMARY KEY (`id_remaining`), ADD KEY `id_gudang` (`id_gudang`), ADD KEY `id_produk` (`id_produk`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `role` -- ALTER TABLE `role` ADD PRIMARY KEY (`role_id`); -- -- Indexes for table `transaksi` -- ALTER TABLE `transaksi` ADD PRIMARY KEY (`id_transaksi`), ADD KEY `id_barang` (`id_barang`), ADD KEY `id_gudang` (`id_gudang`), ADD KEY `id_pembeli` (`id_pembeli`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id_user`), ADD KEY `role_id` (`role_id`); -- -- Indexes for table `vendor` -- ALTER TABLE `vendor` ADD PRIMARY KEY (`id_vendor`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `banks` -- ALTER TABLE `banks` MODIFY `id_bank` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `comment` -- ALTER TABLE `comment` MODIFY `id_comment` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `gudang` -- ALTER TABLE `gudang` MODIFY `id_warehouse` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `message` -- ALTER TABLE `message` MODIFY `id_message` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `pembelian` -- ALTER TABLE `pembelian` MODIFY `id_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `product` -- ALTER TABLE `product` MODIFY `id_product` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `provinsi` -- ALTER TABLE `provinsi` MODIFY `province_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `remaining_stock` -- ALTER TABLE `remaining_stock` MODIFY `id_remaining` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `role` -- ALTER TABLE `role` MODIFY `role_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `transaksi` -- ALTER TABLE `transaksi` MODIFY `id_transaksi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `vendor` -- ALTER TABLE `vendor` MODIFY `id_vendor` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `banks` -- ALTER TABLE `banks` ADD CONSTRAINT `banks_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `comment` -- ALTER TABLE `comment` ADD CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`id_product`) REFERENCES `product` (`id_product`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `pembelian` -- ALTER TABLE `pembelian` ADD CONSTRAINT `pembelian_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `product` -- ALTER TABLE `product` ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`id_vendor`) REFERENCES `vendor` (`id_vendor`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `product_ibfk_2` FOREIGN KEY (`id_gudang`) REFERENCES `gudang` (`id_warehouse`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `remaining_stock` -- ALTER TABLE `remaining_stock` ADD CONSTRAINT `remaining_stock_ibfk_1` FOREIGN KEY (`id_gudang`) REFERENCES `gudang` (`id_warehouse`), ADD CONSTRAINT `remaining_stock_ibfk_2` FOREIGN KEY (`id_produk`) REFERENCES `product` (`id_product`), ADD CONSTRAINT `remaining_stock_ibfk_3` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`); -- -- Constraints for table `transaksi` -- ALTER TABLE `transaksi` ADD CONSTRAINT `transaksi_ibfk_1` FOREIGN KEY (`id_barang`) REFERENCES `product` (`id_product`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `transaksi_ibfk_2` FOREIGN KEY (`id_pembeli`) REFERENCES `user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `transaksi_ibfk_3` FOREIGN KEY (`id_gudang`) REFERENCES `gudang` (`id_warehouse`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `user` -- ALTER TABLE `user` ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `role` (`role_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
IF OBJECT_ID('dbo.usp_GenerateRandomPassword') IS NULL EXEC('CREATE PROCEDURE dbo.usp_GenerateRandomPassword AS SELECT 1;'); GO ALTER PROCEDURE dbo.usp_GenerateRandomPassword( @length int = 20, @allowAtoZ BIT = 1, @allow0to9 BIT = 1, @allowSpecials1 BIT = 1, @allowSpecials2 BIT = 1, @avoidAmbiguousCharacters BIT = 1) AS /* summary: > This procedure generate random passwords with some customization result. Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/dbo.usp_GenerateRandomPassword.sql Revisions: - Author: <NAME> Original link: https://blog.sqlauthority.com/2018/08/15/sql-server-how-to-generate-random-password-enhanced-version-part-2/?utm_source=DBW&utm_medium=pubemail Version: 1.0 Modification: First version date: 2018-08-15 - version: 1.1 modification: add CREATE and ALTER logic, add documentation, format code date: 2019-01-29 by <NAME> Example: - code: EXEC dbo.usp_GenerateRandomPassword @avoidAmbiguousCharacters = 0; EXEC dbo.usp_GenerateRandomPassword @length = 30, @allow0to9 = 0, @allowSpecials1 = 0, @allowSpecials2 = 0, @avoidAmbiguousCharacters = 0; EXEC dbo.usp_GenerateRandomPassword @length = 40, @allow0to9 = 0, @allowSpecials1 = 0, @allowSpecials2 = 1, @avoidAmbiguousCharacters = 1; EXEC dbo.usp_GenerateRandomPassword @length = 90, @allowAtoZ = 0, @allow0to9 = 0, @allowSpecials1 = 1, @allowSpecials2 = 1; IF OBJECT_ID(N't', 'U') IS NULL BEGIN CREATE TABLE t( [Password] NVARCHAR(4000), PasswordLength INT, AllowAtoZ BIT, Allow0to9 BIT, AllowSpecials1 BIT, AllowSpecials2 BIT, AvoidAmbiguousCharacters BIT); END; DECLARE @i INT = 1; WHILE @i <= 50 BEGIN INSERT INTO t EXEC dbo.usp_GenerateRandomPassword; SET @i = @i + 1; END; SELECT * FROM t; DROP TABLE t; returns: > single row with new random password and all input parameters. */ BEGIN DECLARE @range Varchar(90) = '' -- Start by assuming @avoidAmbiguousCharacters is true IF @allowAtoZ = 1 BEGIN SET @range = @range +'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; END IF @allow0to9 = 1 BEGIN SET @range = @range +'23456789'; END IF @allowSpecials1 = 1 BEGIN SET @range = @range +'!"#$%&''()*+,-./'; END IF @allowSpecials2 = 1 BEGIN SET @range = @range +':;<=>?@'; END IF @avoidAmbiguousCharacters = 0 BEGIN -- put back capital i, lowercase l, capital o, the number(s) 0, 1 IF @allowAtoZ = 1 BEGIN SET @range = @range +'IOl'; END IF @allow0to9 = 1 BEGIN SET @range = @range +'01'; END END DECLARE @pwd VARCHAR(512) = ''; --use master.dbo.spt_values as a pseudo tally(numbers) table SELECT TOP(@length) @pwd += SUBSTRING(@range,fn.rnd,1) FROM master.dbo.spt_values sv CROSS APPLY ( SELECT [rnd] = (ABS(CHECKSUM(NEWID())) % (LEN(@range))) ) AS fn SELECT @pwd AS [Password], @length AS PasswordLength, @allowAtoZ, @allow0to9 AS Allow0to9, @allowSpecials1 AS AllowSpecials1, @allowSpecials2 AS AllowSpecials2, @avoidAmbiguousCharacters AS AvoidAmbiguousCharacters; END; GO
alter table ereg_adresse drop constraint UK_mwy9fnkebxg8f85ak183y14gu; alter table ereg_adresse drop constraint FKsc5tbhryssbqy7xeuik532naj; alter table ereg_adresse drop constraint FKfm1k7o3ad0mk31vl67786ta2o; drop table ereg_adresse; drop table adresse; alter table ereg add column forretnings_adresse varchar(255); alter table ereg add column forretnings_kommunenr varchar(255); alter table ereg add column forretnings_landkode varchar(255); alter table ereg add column forretnings_postnr varchar(255); alter table ereg add column forretnings_poststed varchar(255); alter table ereg add column adresse varchar(255); alter table ereg add column kommunenr varchar(255); alter table ereg add column landkode varchar(255); alter table ereg add column postnr varchar(255); alter table ereg add column poststed varchar(255);
<gh_stars>0 -- +----------------------------------------------------------------------------+ -- | <NAME> | -- | <EMAIL> | -- | www.idevelopment.info | -- |----------------------------------------------------------------------------| -- | Copyright (c) 1998-2011 <NAME>. All rights reserved. | -- |----------------------------------------------------------------------------| -- | DATABASE : Oracle | -- | FILE : cr_temporary_tables.sql | -- | CLASS : Create Object Examples | -- | PURPOSE : Example SQL script that demonstrates how to create temporary | -- | tables. | -- | NOTE : As with any code, ensure to test this script in a development | -- | environment before attempting to run it in production. | -- +----------------------------------------------------------------------------+ connect scott/tiger set serveroutput on Prompt ==================================================== Prompt CREATE TEMPORARY TABLE WITH DEFAULT SETTINGS... Prompt (Oracle8i will use on commit delete rows by default) Prompt ==================================================== Prompt accept a1 Prompt "Hit <ENTER> to continue"; CREATE GLOBAL TEMPORARY TABLE mytemptab1 ( id NUMBER , name VARCHAR2(500) , average_salary NUMBER(15,2) ) / Prompt ================================================ Prompt CREATE TEMPORARY TABLE: on commit delete rows... Prompt ================================================ Prompt accept a1 Prompt "Hit <ENTER> to continue"; CREATE GLOBAL TEMPORARY TABLE mytemptab2 ( id NUMBER , name VARCHAR2(500) , average_salary NUMBER(15,2) ) ON COMMIT DELETE ROWS / Prompt ================================================== Prompt CREATE TEMPORARY TABLE: on commit preserve rows... Prompt ================================================== Prompt accept a1 Prompt "Hit <ENTER> to continue"; CREATE GLOBAL TEMPORARY TABLE mytemptab3 ( id NUMBER , name VARCHAR2(500) , average_salary NUMBER(15,2) ) ON COMMIT PRESERVE ROWS /
<gh_stars>0 library BiofeedbackTherapyfortheTreatmentofUrinaryIncontinence version '1' using FHIR //include otherLibrary version 'x.x' called otherLibrary //codesystem codeSystemName : 'OID' version 'x.x' //valueset valuesetName : 'OID' version 'x.x' codesystems{codeSystem1 , codeSystem2, etc} //code codeName : 'OID' from codeSystemName display 'displayName' //concept conceptName : {codeName1, codeName2, etc} display 'displayName' //parameter parameterName (dataType or default value) codesystem "SNOMEDCT": 'http://snomed.info/sct' codesystem "HCPCS": 'https://hcpcs.codes/' codesystem "ICD9CM": 'https://www.cdc.gov/nchs/icd/icd9.htm' codesystem "RXNORM": 'https://www.nlm.nih.gov/research/umls/rxnorm/' valueset "Genuine stress incontinence (finding)":'2.16.840.1.113883.3.88.12.3221.7.4' valueset "Urge incontinence of urine (finding)":'2.16.840.1.113883.3.88.12.3221.7.4' valueset "Impaired cognition (finding)":'2.16.840.1.113883.3.88.12.3221.7.4' valueset "Pelvic floor exercises (regime/therapy)":'2.16.840.1.113883.3.88.12.80.28' valueset "Absence of therapeutic response (finding)":'2.16.840.1.113883.3.88.12.3221.7.4' valueset "Home (environment)":'2.16.840.1.113762.1.4.1096.130' valueset "Biofeedback procedure (regime/therapy)":'2.16.840.1.113883.3.88.12.80.28' define "Not Covered": exists([Encounter: "Home (environment)"]) define "Covered": if (exists([Procedure: "Biofeedback procedure (regime/therapy)"]) and (exists([Observation: "Genuine stress incontinence (finding)"]) or exists([Observation: "Urge incontinence of urine (finding)"]) ) and not exists([Observation: "Impaired cognition (finding)"]) and (exists([Procedure: "Pelvic floor exercises (regime/therapy)"]) and exists([Observation: "Absence of therapeutic response (finding)"]))) then true else false define "Coverage": "Covered" and not "Not Covered"
delete from wiphis_lot; delete from wiphis_mo_line; delete from wiphis_qtyunit; delete from wiphis_sbd; delete from wiphis_smc; delete from wip_future_action; delete from wip_lot_hld; delete from wip_lot_parameter; delete from wip_lot_consume; delete from wip_lot_component; delete from wip_lot; delete from wip_qtyunit; delete from wip_mo_line; delete from wip_mo_bom; delete from wip_mo; delete from wf_instance_action; delete from wf_instance_token; delete from wf_moduledefinition; delete from wf_moduleinstance; delete from wf_parameter; delete from wf_parameter_instance; delete from wf_node; delete from wf_transition; delete from wf_tokenvariablemap; delete from wf_token; delete from wf_processinstance; delete from wf_processdefinition; delete from wf_bytearray; delete from wf_byteblock; delete from wip_workcenter; delete from prd_operation; delete from prd_parameter; delete from prd_part; delete from pas_material_sum; delete from pas_error_log; delete from alm_action; delete from alm_action_type; delete from alm_alarm_definition; delete from alm_alarm_his; delete from alm_alarm_type; delete from alm_object; delete from alm_panel_message; delete from pas_error_log; delete from pas_material_sum; delete from inv_movement_line_lot; delete from inv_movement_line; delete from inv_movement; delete from inv_iqc_line; delete from inv_iqc; delete from inv_receipt_line; delete from inv_receipt; delete from inv_locator; delete from inv_storage; delete from inv_warehouse; delete from pur_requisition_line; delete from pur_requisition; delete from pur_po_line; delete from pur_po; delete from ppm_mps_line_bom; delete from ppm_mps_line; delete from ppm_mps; delete from ppm_lading; delete from vdm_material_assessment; delete from vdm_vendor_assessment; delete from vdm_vendor_material; delete from vdm_vendor; delete from pdm_uom_conversion; delete from pdm_uom; delete from pdm_material_optional; delete from pdm_material_category; delete from pdm_material_alternate; delete from pdm_material_actual; delete from pdm_bom_detail; delete from pdm_bom; delete from pdm_material; delete from bas_error_log; delete from bas_calendar_day; delete from bas_calendar_hour where week_type != 'DEFAULT'; delete from ad_sequence; delete from ad_usergroup_warehouse; delete from ad_usergroup_authority; delete from ad_usergroup_user; delete from ad_usergroup; delete from ad_user_reflist; delete from ad_user_org; delete from ad_user where user_name != 'admin'; delete from ad_org where name != 'admin';
<reponame>nick5uni/A_CTIC_NIETO Tablas del proyecto (V1.0) nombre: Nicolás (V2.0) dirección: Jr marmol 465 (V3.0) create table( ) (V4.0) trabajo en otra rama (V5.0) cambio rama desarrollo (V6.0)
<reponame>JavierCeiba/InventarioGuitarras<filename>microservicio/infraestructura/src/main/resources/sql/envio/listar.sql select id,id_guitarra,id_empresa,fecha_envio,valor_total,fecha_entrega from envio
#macro($getTopicsByExam(examId)) SELECT ept.* FROM exam_paper_topic ept WHERE ept.exam_paper_id =:examId ORDER BY sequence ASC #end #macro($getTopicsByExams(examIds)) SELECT ept.* FROM exam_paper_topic ept WHERE ept.exam_paper_id in :examIds GROUP BY exam_paper_id,sequence ORDER BY sequence ASC #end #macro($updateTopic(examTopicId,examTopicName,sequence)) UPDATE exam_paper_topic ept SET ept.name=:examTopicName WHERE ept.id=:examTopicId #end
<reponame>T5750/maven-archetype-templates /* Navicat MySQL Data Transfer Source Server : localhost_UR_dahua Source Server Version : 50539 Source Host : localhost:3306 Source Database : dubbo-wusc Target Server Type : MYSQL Target Server Version : 50539 File Encoding : 65001 Date: 2017-05-01 11:32:08 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for edu_edmo_pms_user -- ---------------------------- DROP TABLE IF EXISTS `edu_edmo_pms_user`; CREATE TABLE `edu_edmo_pms_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `version` int(11) NOT NULL DEFAULT '0' COMMENT 'version', `create_time` datetime NOT NULL DEFAULT '1999-01-01 01:01:01' COMMENT '创建时间', `user_no` varchar(50) NOT NULL COMMENT '用户帐号', `user_type` varchar(1) NOT NULL COMMENT '用户类型(1:超级管理员,2:普通管理员,3:用户主帐号,4:用户子帐号)', `main_user_id` bigint(50) DEFAULT '0' COMMENT '主帐号ID', `user_pwd` varchar(256) NOT NULL COMMENT '登录密码', `user_name` varchar(50) NOT NULL COMMENT '姓名', `mobile_no` varchar(15) DEFAULT NULL COMMENT '手机号', `email` varbinary(100) DEFAULT NULL COMMENT '邮箱', `status` int(11) NOT NULL COMMENT '状态(100:可用,101:不可用 )', `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间', `is_changed_pwd` int(11) DEFAULT NULL COMMENT '是否更改过密码', `pwd_error_count` int(11) NOT NULL DEFAULT '0' COMMENT '连续输错密码次数', `pwd_error_time` datetime DEFAULT NULL COMMENT '最后输错密码时间', `remark` varchar(300) DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`), UNIQUE KEY `AK_Key_2` (`user_no`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户信息表'; -- ---------------------------- -- Records of edu_edmo_pms_user -- ---------------------------- INSERT INTO `edu_edmo_pms_user` VALUES ('1', '0', '1999-01-01 01:01:01', 'admin', '1', '0', '<PASSWORD>', '超级管理员', '13800138000', null, '100', null, '0', '0', null, '超级管理员');
<gh_stars>0 --Base Tables CREATE TABLE IF NOT EXISTS PlayerClass ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Name TEXT NOT NULL DEFAULT "Default", Description TEXT NOT NULL DEFAULT "No description.", ModelPath TEXT NOT NULL DEFAULT "", --Have a default thing AnimationPath TEXT NOT NULL DEFAULT "", --Have a default thing MaxHealth INT NOT NULL DEFAULT 100, MgcAtk INT NOT NULL DEFAULT 10, PhsAtk INT NOT NULL DEFAULT 10, Speed INT NOT NULL DEFAULT 10, Defense INT NOT NULL DEFAULT 10 ); CREATE TABLE IF NOT EXISTS Spell ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Name TEXT NOT NULL DEFAULT "Default", Description TEXT NOT NULL DEFAULT "No description.", Effect TEXT NOT NULL DEFAULT "DefaultEffect()", Pattern TEXT NOT NULL DEFAULT "0;1;2;3;4;5;6;7;8", AnimationPath TEXT NOT NULL DEFAULT "", --Have a default thing EffectPath TEXT NOT NULL DEFAULT "" --Have a default thing ); CREATE TABLE IF NOT EXISTS Enemy ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Name TEXT NOT NULL DEFAULT "Default", Description TEXT NOT NULL DEFAULT "No description.", ModelPath TEXT NOT NULL DEFAULT "", --Have a default thing AnimationPath TEXT NOT NULL DEFAULT "", --Have a default thing MaxHealth INT NOT NULL DEFAULT 100, MgcAtk INT NOT NULL DEFAULT 10, PhsAtk INT NOT NULL DEFAULT 10, Speed INT NOT NULL DEFAULT 10, Defense INT NOT NULL DEFAULT 10 ); CREATE TABLE IF NOT EXISTS Item ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Name TEXT NOT NULL DEFAULT "Default", Description TEXT NOT NULL DEFAULT "No description.", IconPath TEXT NOT NULL DEFAULT "", --Have a default thing ModelPath TEXT NOT NULL DEFAULT "", --Have a default thing AnimationPath TEXT NOT NULL DEFAULT "", --Have a default thing Effect TEXT NOT NULL DEFAULT "DefaultEffect()", IsOneUse BOOL NOT NULL DEFAULT 0 ); --Joining tables CREATE TABLE IF NOT EXISTS PlayerSpell ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, ClassID INT NOT NULL REFERENCES PlayerClass(ID), SpellID INT NOT NULL REFERENCES Spell(ID) ); CREATE TABLE IF NOT EXISTS EnemySpell ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, EnemyID INT NOT NULL REFERENCES Enemy(ID), SpellID INT NOT NULL REFERENCES Spell(ID) ); --Level management CREATE TABLE IF NOT EXISTS Level ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Number INT NOT NULL DEFAULT 0, Name TEXT NOT NULL DEFAULT "Default", Description TEXT NOT NULL DEFAULT "No description.", ThumbnailPath TEXT NOT NULL DEFAULT "", --Have a default thing ItemReward INT NOT NULL REFERENCES Item(ID) ); CREATE TABLE IF NOT EXISTS LevelEvent ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, LevelID INT NOT NULL REFERENCES Level(ID), Position INT NOT NULL DEFAULT 0, MoneyReward INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS EventEnemy ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, EventID INT NOT NULL REFERENCES LevelEvent(ID), EnemyID INT NOT NULL REFERENCES Enemy(ID), Position INT NOT NULL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS EventItem ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, EventID INT NOT NULL REFERENCES LevelEvent(ID), ItemID INT NOT NULL REFERENCES Item(ID), Position INT NOT NULL DEFAULT 0, Price INT NOT NULL DEFAULT 10 ); --Save Data CREATE TABLE IF NOT EXISTS SaveData ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, Name TEXT DEFAULT "", ClassID INT REFERENCES PlayerClass(ID), Money INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS SaveItems ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, SaveID INT REFERENCES SaveData(ID), ItemID INT REFERENCES Item(ID), IsEquiped BOOL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS SaveSpells ( ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, SaveID INT REFERENCES SaveData(ID), SpellID INT REFERENCES Spell(ID) );
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50523 Source Host : localhost:3306 Source Database : prize Target Server Type : MYSQL Target Server Version : 50523 File Encoding : 65001 Date: 2015-11-07 17:48:21 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for tb_prize -- ---------------------------- DROP TABLE IF EXISTS `tb_prize`; CREATE TABLE `tb_prize` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `status` char(4) DEFAULT '0' COMMENT '0:未中奖,1是中奖', `phonenumber` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_phonenumber` (`status`,`phonenumber`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of tb_prize -- ---------------------------- INSERT INTO `tb_prize` VALUES ('1', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('3', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('4', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('5', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('6', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('7', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('8', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('9', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('10', '奖', '0', ''); INSERT INTO `tb_prize` VALUES ('11', '奖', '0', ''); -- ---------------------------- -- Table structure for tb_prizeswitch -- ---------------------------- DROP TABLE IF EXISTS `tb_prizeswitch`; CREATE TABLE `tb_prizeswitch` ( `switch` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of tb_prizeswitch -- ---------------------------- INSERT INTO `tb_prizeswitch` VALUES ('1');
<gh_stars>0 -- MySQL Script generated by MySQL Workbench -- Sex 21 Ago 2015 09:57:56 BRT -- 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 prorails -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `prorails` ; -- ----------------------------------------------------- -- Schema prorails -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `prorails` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; USE `prorails` ; -- ----------------------------------------------------- -- Table `prorails`.`user` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`user` ; CREATE TABLE IF NOT EXISTS `prorails`.`user` ( `_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`provider` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`provider` ; CREATE TABLE IF NOT EXISTS `prorails`.`provider` ( `_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`category` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`category` ; CREATE TABLE IF NOT EXISTS `prorails`.`category` ( `_id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`image` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`image` ; CREATE TABLE IF NOT EXISTS `prorails`.`image` ( `_id` INT NOT NULL AUTO_INCREMENT, `fileName` VARCHAR(128) NOT NULL, `height` VARCHAR(45) NULL, `width` VARCHAR(45) NULL, `sourceName` VARCHAR(256) NOT NULL, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`product` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`product` ; CREATE TABLE IF NOT EXISTS `prorails`.`product` ( `_id` INT NOT NULL AUTO_INCREMENT, `provider_id` INT NOT NULL, `code` VARCHAR(45) NOT NULL, `name` VARCHAR(45) NOT NULL, `category_id` INT NOT NULL, `image_id` INT NULL, `timestamp` TIMESTAMP NOT NULL, PRIMARY KEY (`_id`), INDEX `fk_product_1_idx` (`provider_id` ASC), INDEX `fk_product_2_idx` (`category_id` ASC), INDEX `fk_product_3_idx` (`image_id` ASC), CONSTRAINT `fk_product_1` FOREIGN KEY (`provider_id`) REFERENCES `prorails`.`provider` (`_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_product_2` FOREIGN KEY (`category_id`) REFERENCES `prorails`.`category` (`_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_product_3` FOREIGN KEY (`image_id`) REFERENCES `prorails`.`image` (`_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`relationship` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`relationship` ; CREATE TABLE IF NOT EXISTS `prorails`.`relationship` ( `_id` INT NOT NULL AUTO_INCREMENT, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `prorails`.`productRelationship` -- ----------------------------------------------------- DROP TABLE IF EXISTS `prorails`.`productRelationship` ; CREATE TABLE IF NOT EXISTS `prorails`.`productRelationship` ( `_id` INT NOT NULL AUTO_INCREMENT, `relationship_id` INT NOT NULL, `product_id` INT NOT NULL, `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`_id`), INDEX `fk_productRelationship_1_idx` (`relationship_id` ASC), INDEX `fk_productRelationship_2_idx` (`product_id` ASC), CONSTRAINT `fk_productRelationship_1` FOREIGN KEY (`relationship_id`) REFERENCES `prorails`.`relationship` (`_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_productRelationship_2` FOREIGN KEY (`product_id`) REFERENCES `prorails`.`product` (`_id`) 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;
CREATE PROCEDURE [Time_shift].RestoreData AS DELETE FROM [Time_shift].DS_1 DELETE FROM [Time_shift].DS_2 DELETE FROM [Time_shift].DS_3 DELETE FROM [Time_shift].DS_4 INSERT INTO [Time_shift].DS_1 VALUES ('A', '2010-01/2010-12', 'helo world') INSERT INTO [Time_shift].DS_1 VALUES ('A', '2011-01/2011-12', NULL) INSERT INTO [Time_shift].DS_1 VALUES ('A', '2012-01/2012-12', 'say hello') INSERT INTO [Time_shift].DS_1 VALUES ('A', '2013-01/2013-12', 'he') INSERT INTO [Time_shift].DS_1 VALUES ('B', '2010-01/2010-12', 'hi, hello! ') INSERT INTO [Time_shift].DS_1 VALUES ('B', '2011-01/2011-12', 'hi') INSERT INTO [Time_shift].DS_1 VALUES ('B', '2012-01/2012-12', NULL) INSERT INTO [Time_shift].DS_1 VALUES ('B', '2013-01/2013-12', 'hello!') INSERT INTO [Time_shift].DS_2 VALUES ('A', '2010-12-31', 'helo world') INSERT INTO [Time_shift].DS_2 VALUES ('A', '2011-12-31', NULL) INSERT INTO [Time_shift].DS_2 VALUES ('A', '2012-12-31', 'say hello') INSERT INTO [Time_shift].DS_2 VALUES ('A', '2013-12-31', 'he') INSERT INTO [Time_shift].DS_2 VALUES ('B', '2010-12-31', 'hi, hello! ') INSERT INTO [Time_shift].DS_2 VALUES ('B', '2011-12-31', 'hi') INSERT INTO [Time_shift].DS_2 VALUES ('B', '2012-12-31', NULL) INSERT INTO [Time_shift].DS_2 VALUES ('B', '2013-12-31', 'hello!') -- INSERT INTO [Time_shift].DS_3 VALUES ('A', '2010Y', 'helo world') -- INSERT INTO [Time_shift].DS_3 VALUES ('A', '2011Y', NULL) -- INSERT INTO [Time_shift].DS_3 VALUES ('A', '2012Y', 'say hello') -- INSERT INTO [Time_shift].DS_3 VALUES ('A', '2013Y', 'he') -- INSERT INTO [Time_shift].DS_3 VALUES ('B', '2010Y', 'hi, hello! ') -- INSERT INTO [Time_shift].DS_3 VALUES ('B', '2011Y', 'hi') -- INSERT INTO [Time_shift].DS_3 VALUES ('B', '2012Y', NULL) -- INSERT INTO [Time_shift].DS_3 VALUES ('B', '2013Y', 'hello!') -- documentation example input error INSERT INTO [Time_shift].DS_3 VALUES ('A', '2010A', 'helo world') INSERT INTO [Time_shift].DS_3 VALUES ('A', '2011A', NULL) INSERT INTO [Time_shift].DS_3 VALUES ('A', '2012A', 'say hello') INSERT INTO [Time_shift].DS_3 VALUES ('A', '2013A', 'he') INSERT INTO [Time_shift].DS_3 VALUES ('B', '2010A', 'hi, hello! ') INSERT INTO [Time_shift].DS_3 VALUES ('B', '2011A', 'hi') INSERT INTO [Time_shift].DS_3 VALUES ('B', '2012A', NULL) INSERT INTO [Time_shift].DS_3 VALUES ('B', '2013A', 'hello!') -- INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010Y', 'helo world') - documentation example input error INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010A', 'helo world') -- INSERT INTO [Time_shift].DS_4 VALUES ('A', '2011Y', NULL) - documentation example input error INSERT INTO [Time_shift].DS_4 VALUES ('A', '2011A', NULL) -- INSERT INTO [Time_shift].DS_4 VALUES ('A', '2012Y', 'say hello') - documentation example input error INSERT INTO [Time_shift].DS_4 VALUES ('A', '2012A', 'say hello') -- INSERT INTO [Time_shift].DS_4 VALUES ('A', '2013Y', 'he') - documentation example input error INSERT INTO [Time_shift].DS_4 VALUES ('A', '2013A', 'he') INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010Q1', 'hi, hello! ') INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010Q2', 'hi') INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010Q3', NULL) INSERT INTO [Time_shift].DS_4 VALUES ('A', '2010Q4', 'hello!') GO
SET FOREIGN_KEY_CHECKS=0; -- -------------------------------------------------------- INSERT INTO `@prefix@api_tab_menu` (`id`, `Description`, `Description_courte`, `id_categorie`, `Lien`) VALUES (NULL, 'shoppingList.title', 'shoppingList.title', '3', 'shoppingList'); UPDATE `@prefix@api_tab_menu_rangs_droit` a INNER JOIN `@prefix@api_tab_menu` b ON b.`Lien` = 'shoppingList' INNER JOIN `@prefix@api_tab_rangs` c ON c.`id` = a.`id_rang` AND c.`indice` in (1,10,20,30) SET `id_menu` = concat(`id_menu`,b.`id`,';'); INSERT INTO `@prefix@api_tab_menu` (`id`, `Description`, `Description_courte`, `id_categorie`, `Lien`) VALUES (NULL, 'shoppinReport.title', 'shoppinReport.title', '4', 'shoppinReport'); UPDATE `@prefix@api_tab_menu_rangs_droit` a INNER JOIN `@prefix@api_tab_menu` b ON b.`Lien` = 'shoppinReport' INNER JOIN `@prefix@api_tab_rangs` c ON c.`id` = a.`id_rang` AND c.`indice` in (1,10,20,30) SET `id_menu` = concat(`id_menu`,b.`id`,';'); -- -- Structure de la table `tab_shopping` -- CREATE TABLE `@prefix@tab_shopping` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entity` varchar(250) NOT NULL, `mode` varchar(250) NOT NULL, `patient_id` int(11) NOT NULL, `date_action` date NOT NULL, `amount` decimal(10,2) NOT NULL, `movement` varchar(50) NOT NULL, `comment` text NOT NULL, `attach_name` varchar(250) NOT NULL, `author_id` int(11) NOT NULL, `date_record` datetime NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `patient_id` (`patient_id`), KEY `author_id` (`author_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Contraintes pour la table `tab_events` -- ALTER TABLE `@prefix@tab_shopping` ADD CONSTRAINT `fk_shopping_patient_id` FOREIGN KEY (`patient_id`) REFERENCES `@prefix@tab_patients` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_shopping_user` FOREIGN KEY (`author_id`) REFERENCES `@prefix@api_tab_utilisateurs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -------------------------------------------------------- SET FOREIGN_KEY_CHECKS=1;
update eg_installment_master set description = 'WT_MC-APR/16-17' where description = 'WT_MC-I/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-MAY/16-17' where description = 'WT_MC-II/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JUN/16-17' where description = 'WT_MC-III/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JUL/16-17' where description = 'WT_MC-IV/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-AUG/16-17' where description = 'WT_MC-V/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-SEPT/16-17' where description = 'WT_MC-VI/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-OCT/16-17' where description = 'WT_MC-VII/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-NOV/16-17' where description = 'WT_MC-VIII/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-DEC/16-17' where description = 'WT_MC-IX/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JAN/16-17' where description = 'WT_MC-X/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-FEB/16-17' where description = 'WT_MC-XI/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-MAR/16-17' where description = 'WT_MC-XII/16-17' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-APR/17-18' where description = 'WT_MC-I/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-MAY/17-18' where description = 'WT_MC-II/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JUN/17-18' where description = 'WT_MC-III/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JUL/17-18' where description = 'WT_MC-IV/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-AUG/17-18' where description = 'WT_MC-V/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-SEPT/17-18' where description = 'WT_MC-VI/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-OCT/17-18' where description = 'WT_MC-VII/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-NOV/17-18' where description = 'WT_MC-VIII/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-DEC/17-18' where description = 'WT_MC-IX/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-JAN/17-18' where description = 'WT_MC-X/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-FEB/17-18' where description = 'WT_MC-XI/17-18' and id_module = (select id from eg_module where name ='Water Tax Management'); update eg_installment_master set description = 'WT_MC-MAR/17-18' where description = 'WT_MC-XII/17-18' and id_module = (select id from eg_module where name ='Water Tax Management');
USE [master]; DECLARE @kill varchar(8000) = ''; SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';' FROM sys.dm_exec_sessions WHERE database_id = db_id('RCSQL') EXEC(@kill); USE [master] GO ALTER DATABASE [RCSQL] SET READ_COMMITTED_SNAPSHOT ON WITH NO_WAIT GO ALTER DATABASE [RCSQL] SET ALLOW_SNAPSHOT_ISOLATION ON GO
EXEC sp_addlinkedserver @server = 'MetadataExcel', @srvproduct = 'Excel', @provider = 'Microsoft.ACE.OLEDB.12.0', @datasrc = 'C:\Test\Metadata.xlsx', @provstr = 'Excel 12.0;IMEX=1;HDR=YES;'
ALTER TABLE `users` ADD INDEX `index_search_mobile` (`mobile`);
<filename>src/test/resources/sql/alter_foreign_table/62338ec5.sql -- file:foreign_data.sql ln:330 expect:true ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 OPTIONS (SET p2 'V2', DROP p1)
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5453334_sys_FRESH-727_AD_Process_Stats_index.sql create unique index AD_Process_Stats_UQ on AD_Process_Stats (AD_Process_ID, AD_Client_ID);
BEGIN TRANSACTION SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON GO CREATE TABLE [dbo].[AUTH_IMAGE_CATEGORIES]( [ID] [int] IDENTITY(1,1) NOT NULL, [CATEGORY] [nvarchar](50) NOT NULL, CONSTRAINT [PK_AUTH_IMAGE_CATEGORIES] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO INSERT INTO [AUTH_IMAGE_CATEGORIES] (CATEGORY) VALUES ('people'), ('nature'), ('flowers'), ('animals'), ('business'), ('technology'), ('cars'), ('city'), ('christmas') GO DROP TABLE [dbo].[AUTH_IMAGES] GO DROP TABLE [dbo].[AUTH_IMAGE_THUMBNAILS] GO CREATE TABLE [dbo].[AUTH_IMAGES]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [URL] [nvarchar](1000) NOT NULL, [CATEGORY_ID] [int] NOT NULL, CONSTRAINT [PK_AUTH_IMAGES] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[AUTH_IMAGES] WITH CHECK ADD CONSTRAINT [FK_AUTH_IMAGES_AUTH_IMAGES] FOREIGN KEY([ID]) REFERENCES [dbo].[AUTH_IMAGES] ([ID]) GO ALTER TABLE [dbo].[AUTH_IMAGES] CHECK CONSTRAINT [FK_AUTH_IMAGES_AUTH_IMAGES] GO CREATE TABLE [dbo].[AUTH_IMAGE_THUMBNAILS]( [IMAGE_ID] [bigint] NOT NULL, [THUMBNAIL] [varbinary](max) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[AUTH_IMAGE_THUMBNAILS] WITH CHECK ADD CONSTRAINT [FK_AUTH_IMAGE_THUMBNAILS_AUTH_IMAGES] FOREIGN KEY([IMAGE_ID]) REFERENCES [dbo].[AUTH_IMAGES] ([ID]) ON DELETE CASCADE GO ALTER TABLE [dbo].[AUTH_IMAGE_THUMBNAILS] CHECK CONSTRAINT [FK_AUTH_IMAGE_THUMBNAILS_AUTH_IMAGES] GO ALTER TABLE [dbo].[SMS_CONTACT] DROP COLUMN [LEFT_IMAGE] GO ALTER TABLE [dbo].[SMS_CONTACT] DROP COLUMN [RIGHT_IMAGE] GO ALTER TABLE [dbo].[SMS_CONTACT] ADD [LEFT_IMAGE] [bigint] NULL ALTER TABLE [dbo].[SMS_CONTACT] ADD [RIGHT_IMAGE] [bigint] NULL ALTER TABLE [dbo].[SMS_CONTACT] WITH CHECK ADD CONSTRAINT [FK_SMS_CONTACT_AUTH_IMAGES] FOREIGN KEY([LEFT_IMAGE]) REFERENCES [dbo].[AUTH_IMAGES] ([ID]) GO ALTER TABLE [dbo].[SMS_CONTACT] CHECK CONSTRAINT [FK_SMS_CONTACT_AUTH_IMAGES] GO ALTER TABLE [dbo].[SMS_CONTACT] WITH CHECK ADD CONSTRAINT [FK_SMS_CONTACT_AUTH_IMAGES1] FOREIGN KEY([RIGHT_IMAGE]) REFERENCES [dbo].[AUTH_IMAGES] ([ID]) GO ALTER TABLE [dbo].[SMS_CONTACT] CHECK CONSTRAINT [FK_SMS_CONTACT_AUTH_IMAGES1] GO UPDATE [SETTINGS] SET [VALUE] = '2.3.9' WHERE [SETTING] = 'VERSION' GO COMMIT GO
<reponame>andrewmsboyd/pfds-database<filename>project-queries-submission2.sql -- Slide 1: From which of our customers did we make the most profit over the lifetime of the company? SELECT customer_id, customer_name, SUM(amount) AS total_paid FROM (SELECT r.customer_id, CONCAT(c.first_name, ' ', c.last_name) AS customer_name, r.rental_id, p.amount FROM rental r JOIN payment p ON p.rental_id = r.rental_id JOIN customer c ON c.customer_id = r.customer_id ) sub GROUP BY 1,2 ORDER BY 3 DESC LIMIT 10 -- Slide 2: In our history, what percentage of our rented titles were rated NC-17? WITH rentals AS ( SELECT r.rental_id, f.film_id, f.rating, CASE WHEN f.rating = 'NC-17' THEN 1 ELSE 0 END AS adult_film_bool FROM rental r JOIN inventory inv ON inv.inventory_id = r.inventory_id JOIN film f ON f.film_id = inv.film_id ), compared AS ( SELECT COUNT(*) as total_rentals, SUM(adult_film_bool) AS adult_rentals FROM rentals ) SELECT *, CAST(SUM(adult_rentals) / SUM(total_rentals) * 100 AS DECIMAL(5,2)) AS adult_film_rent_percentage FROM compared GROUP BY 2,1 -- Slide 3: What were the total sales for the business as of May 1st, 2007? SELECT s.picture, DATE_TRUNC('day', payment_date) as payment_day, payment_id, SUM(amount) over (ORDER BY payment_date) as running FROM payment JOIN staff s ON s.staff_id = payment.staff_id WHERE payment_date <= '2007-05-01' ORDER BY running DESC -- Slide 4: Do we have any films in inventory that are rated G Horror? What are we charging for these? SELECT f.title, f.release_year, f.rating, f.rental_rate, c.name FROM film f JOIN film_category fc ON fc.film_id = f.film_id JOIN category c ON c.category_id = fc.category_id WHERE f.rating = 'G' AND c.name = 'Horror' ORDER BY f.rental_rate DESC
drop view if exists "public"."ccc_view3" cascade; drop function if exists "public"."depends_on_bbb_view2"(t text) cascade; drop view if exists "public"."ddd_unchanged" cascade; drop view if exists "public"."bbb_view2" cascade; drop view if exists "public"."ddd_changed" cascade; drop view if exists "public"."aaa_view1" cascade; set check_function_bodies = off; create view "public"."ddd_changed" as SELECT basetable.name, 'x'::text AS x FROM basetable; create view "public"."ddd_unchanged" as SELECT ddd_changed.name FROM ddd_changed;
<filename>src/main/resources/db/changelog/changes/v1.0.0/sql/2021-08-25-02__alter-modified-by-columns.sql CREATE OR REPLACE FUNCTION modify_last_modified(p_table varchar) RETURNS void LANGUAGE plpgsql AS ' BEGIN EXECUTE ''ALTER TABLE '' || p_table || '' ADD COLUMN updated_by_userid UUID''; EXECUTE ''ALTER TABLE '' || p_table || '' ADD COLUMN updated_by_username VARCHAR(255)''; EXECUTE ''UPDATE '' || p_table || '' SET updated_by_userid = ''''00000000-0000-0000-0000-000000000000''''::uuid,'' || '' updated_by_username = ''''SYSTEM'''''' || '' WHERE last_modified_by IS NOT NULL''; EXECUTE ''ALTER TABLE '' || p_table || '' DROP COLUMN last_modified_by''; EXECUTE ''ALTER TABLE '' || p_table || '' RENAME COLUMN last_modified_date TO updated_date''; RETURN; END;'; SELECT modify_last_modified(table_name::varchar) FROM information_schema.columns WHERE table_schema = '${database.defaultSchemaName}' AND column_name = 'last_modified_by'; DROP FUNCTION modify_last_modified;
CREATE TABLE `Events` ( `id` CHAR(36) COLLATE UTF8_UNICODE_CI NOT NULL, `user_id` CHAR(36) COLLATE UTF8_UNICODE_CI NOT NULL, `name` VARCHAR(100) COLLATE UTF8_UNICODE_CI NOT NULL, `description` TEXT COLLATE UTF8_UNICODE_CI, `phone_number` CHAR(10) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `location_address_1` VARCHAR(70) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `location_address_2` VARCHAR(70) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `location_city` VARCHAR(40) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `location_state` CHAR(2) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `location_zip` VARCHAR(5) COLLATE UTF8_UNICODE_CI DEFAULT NULL, `starts_on` DATE NOT NULL, `ends_on` DATE DEFAULT NULL, `starts_at` TIME DEFAULT NULL, `ends_at` TIME DEFAULT NULL, `frequency` ENUM('ONCE','DAILY','WEEKLY','MONTHLY','YEARLY') COLLATE UTF8_UNICODE_CI DEFAULT 'ONCE', `separation` INT(10) UNSIGNED DEFAULT '1', `created_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `recurrence_day` INT(11) DEFAULT NULL, `recurrence_week` INT(11) DEFAULT NULL, `recurrence_month` INT(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `user_id` (`user_id`), CONSTRAINT `Events_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE=UTF8_UNICODE_CI;
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_CU_GetPharmacyQueue]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].sp_CU_GetPharmacyQueue GO CREATE PROCEDURE [dbo].sp_CU_GetPharmacyQueue AS BEGIN WITH a AS (SELECT a.Id , c.DrugName FROM PatientDrugPrescription a INNER JOIN PatientDrugDispense b ON a.Id = b.PatientDrugPrescriptionId INNER JOIN ClinicalDrug c ON b.ClinicalDrugId = c.Id WHERE b.DeleteFlag = 0) , pharmCSV as ( SELECT b.Id , STUFF((SELECT ',' + DrugName FROM a where a.id = b.id FOR XML PATH ('')), 1, 1, '') Prescription FROM a b GROUP BY b.Id) SELECT DISTINCT d.Id DrugPrescriptionId , c.IdentifierValue UniqueId , convert(varchar(100), decryptbykey(a.FirstName)) + ' ' + convert(varchar(100), decryptbykey(a.LastName )) + ' (' + CAST(CAST(DATEDIFF(dd,a.DateOfBirth, GETDATE())/365.25 as decimal(18,1)) as varchar(10)) + 'y)' Patient , CAST(DATEDIFF(dd,a.DateOfBirth, GETDATE())/365.25 as decimal(18,1)) Age , CONVERT(varchar(15), CAST(d.PrescriptionDate AS time), 100) PrescriptionTime , e.Prescription PrescriptionSummary , d.CreateDate , b.Id PatientId FROM Person a INNER JOIN Patient b ON a.Id = b.PersonId LEFT JOIN (SELECT PatientId, IdentifierValue FROM PatientIdentifier WHERE IdentifierTypeId = 1) c ON b.Id = c.PatientId INNER JOIN PatientDrugPrescription d ON b.Id = d.PatientId INNER JOIN pharmCSV e ON d.Id = e.Id LEFT JOIN PatientDrugDispense f ON d.Id = f.PatientDrugPrescriptionId AND f.DeleteFlag = 0 WHERE f.DispenseDate IS NULL ORDER BY d.CreateDate END
DROP TABLE IF EXISTS multiple; CREATE TABLE multiple ( ID int NOT NULL, OTHER_ID int NOT NULL, SEQUENCE int NOT NULL AUTO_INCREMENT, PRIMARY KEY (ID, OTHER_ID) );
<reponame>alexavila150/luciddb -- tests ability to run code from file or from a string select schema_name from sys_root.dba_schemas order by schema_name; call applib.execute_script('js', 'importPackage(java.sql) /* There is also an importClass() function. */ var conn = DriverManager.getConnection("jdbc:default:connection") var ps = conn.prepareStatement("create or replace schema boohoo") ps.execute() conn.close() '); select schema_name from sys_root.dba_schemas order by schema_name; call applib.execute_script('js', '${FARRAGO_HOME}/test/sql/scripting/execute_script.js'); select schema_name from sys_root.dba_schemas order by schema_name; drop schema boohoo; drop schema boohoo2;
{#-- We can't use temporary tables with `create ... as ()` syntax #} {% macro spark_create_temporary_view(relation, sql) -%} create temporary view {{ relation.include(database=false, schema=false) }} as {{ sql }} {% endmacro %} {% macro file_format_clause() %} {%- set file_format = config.get('file_format', validator=validation.any[basestring]) -%} {%- if file_format is not none %} using {{ file_format }} {%- endif %} {%- endmacro -%} {% macro location_clause() %} {%- set location_root = config.get('location_root', validator=validation.any[basestring]) -%} {%- set identifier = model['alias'] -%} {%- if location_root is not none %} location '{{ location_root }}/{{ identifier }}' {%- endif %} {%- endmacro -%} {% macro comment_clause() %} {%- set raw_persist_docs = config.get('persist_docs', {}) -%} {%- if raw_persist_docs is mapping -%} {%- set raw_relation = raw_persist_docs.get('relation', false) -%} {%- if raw_relation -%} comment '{{ model.description }}' {% endif %} {%- else -%} {{ exceptions.raise_compiler_error("Invalid value provided for 'persist_docs'. Expected dict but got value: " ~ raw_persist_docs) }} {% endif %} {%- endmacro -%} {% macro partition_cols(label, required=false) %} {%- set cols = config.get('partition_by', validator=validation.any[list, basestring]) -%} {%- if cols is not none %} {%- if cols is string -%} {%- set cols = [cols] -%} {%- endif -%} {{ label }} ( {%- for item in cols -%} {{ item }} {%- if not loop.last -%},{%- endif -%} {%- endfor -%} ) {%- endif %} {%- endmacro -%} {% macro clustered_cols(label, required=false) %} {%- set cols = config.get('clustered_by', validator=validation.any[list, basestring]) -%} {%- set buckets = config.get('buckets', validator=validation.any[int]) -%} {%- if (cols is not none) and (buckets is not none) %} {%- if cols is string -%} {%- set cols = [cols] -%} {%- endif -%} {{ label }} ( {%- for item in cols -%} {{ item }} {%- if not loop.last -%},{%- endif -%} {%- endfor -%} ) into {{ buckets }} buckets {%- endif %} {%- endmacro -%} {% macro spark__create_table_as(temporary, relation, sql) -%} {% if temporary -%} {{ spark_create_temporary_view(relation, sql) }} {%- else -%} create table {{ relation }} {{ file_format_clause() }} {{ partition_cols(label="partitioned by") }} {{ clustered_cols(label="clustered by") }} {{ location_clause() }} {{ comment_clause() }} as {{ sql }} {%- endif %} {%- endmacro -%} {% macro spark__create_view_as(relation, sql) -%} create view {{ relation }} {{ comment_clause() }} as {{ sql }} {% endmacro %} {% macro spark__get_columns_in_relation(relation) -%} {% call statement('get_columns_in_relation', fetch_result=True) %} describe extended {{ relation }} {% endcall %} {% do return(load_result('get_columns_in_relation').table) %} {% endmacro %} {% macro spark__list_relations_without_caching(information_schema, schema) %} {% call statement('list_relations_without_caching', fetch_result=True) -%} show table extended in {{ schema }} like '*' {% endcall %} {% do return(load_result('list_relations_without_caching').table) %} {% endmacro %} {% macro spark__list_schemas(database) -%} {% call statement('list_schemas', fetch_result=True, auto_begin=False) %} show databases {% endcall %} {{ return(load_result('list_schemas').table) }} {% endmacro %} {% macro spark__current_timestamp() -%} current_timestamp() {%- endmacro %} {% macro spark__create_schema(database_name, schema_name) -%} {%- call statement('create_schema') -%} create schema if not exists {{ schema_name }} {%- endcall -%} {% endmacro %} {% macro spark__drop_schema(database_name, schema_name) -%} {%- call statement('drop_schema') -%} drop schema if exists {{ schema_name }} cascade {%- endcall -%} {% endmacro %} {% macro spark_get_relation_type(relation) -%} {% call statement('get_relation_type', fetch_result=True) -%} SHOW TBLPROPERTIES {{ relation }} ('view.default.database') {%- endcall %} {% set res = load_result('get_relation_type').table %} {% if 'does not have property' in res[0][0] %} {{ return('table') }} {% else %} {{ return('view') }} {% endif %} {%- endmacro %} {% macro spark_fetch_tblproperties(relation) -%} {% call statement('list_properties', fetch_result=True) -%} SHOW TBLPROPERTIES {{ relation }} {% endcall %} {% do return(load_result('list_properties').table) %} {%- endmacro %} {% macro spark__rename_relation(from_relation, to_relation) -%} {% call statement('rename_relation') -%} {% if not from_relation.type %} {% do exceptions.raise_database_error("Cannot rename a relation with an unknown type: " ~ from_relation) %} {% elif from_relation.type == 'table' %} alter table {{ from_relation }} rename to {{ to_relation }} {% elif from_relation.type == 'view' %} alter view {{ from_relation }} rename to {{ to_relation }} {% else %} {% do exceptions.raise_database_error("Unknown type '" ~ from_relation.type ~ "' for relation: " ~ from_relation) %} {% endif %} {%- endcall %} {% endmacro %} {% macro spark__drop_relation(relation) -%} {% set type = relation.type if relation.type is not none else spark_get_relation_type(relation) %} {% call statement('drop_relation', auto_begin=False) -%} drop {{ type }} if exists {{ relation }} {%- endcall %} {% endmacro %}
CREATE INDEX IF NOT EXISTS LOCAL_PAGE_IDX_PAGE_ID ON LOCAL_PAGE(LANG_ID, PAGE_ID); CREATE INDEX IF NOT EXISTS LOCAL_PAGE_IDX_PAGE_TITLE ON LOCAL_PAGE(LANG_ID, TITLE, NAME_SPACE)
-- -- Copyright (C) 2004, 2005, 2006 Mekensleep <<EMAIL>> -- 24 rue vieille du temple, 75004 Paris -- -- This software's license gives you freedom; you can copy, convey, -- propagate, redistribute and/or modify this program under the terms of -- the GNU Affero General Public License (AGPL) as published by the Free -- Software Foundation, either version 3 of the License, or (at your -- option) any later version of the AGPL. -- -- This program is distributed in the hope that it will be useful, but -- WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -- General Public License for more details. -- -- You should have received a copy of the GNU Affero General Public License -- along with this program in a file in the toplevel directory called -- "AGPLv3". If not, see <http://www.gnu.org/licenses/>. -- -- Authors: -- <NAME> <<EMAIL>> drop table if exists users; create table users ( serial int unsigned not null auto_increment, name varchar(32), email varchar(128), skin_url varchar(32) default "default", skin_outfit text, skin_image blob, skin_image_type varchar(32), password varchar(32), privilege int default 1, play_money int default 1000000, custom_money int default 0, point_money int default 5000, rating int default 1000, future_rating float default 1000, games_count int default 0, primary key (serial), unique key name_idx (name), unique key email_idx (email) ); drop table if exists users_private; create table users_private ( serial int unsigned not null, addr_street varchar(255) default "", addr_zip varchar(64) default "", addr_town varchar(64) default "", addr_state varchar(128) default "", addr_country varchar(64) default "", phone varchar(64) default "", verified char default 'n', verified_time int default 0, primary key (serial) ); drop table if exists user2table; create table user2table ( user_serial int unsigned not null, table_serial int unsigned not null, money int default 0 not null, bet int default 0 not null, custom_money char default 'n', primary key (user_serial,table_serial) ); drop table if exists hands; create table hands ( serial int unsigned not null auto_increment, name varchar(32), description text not null, primary key (serial) ); drop table if exists user2hand; create table user2hand ( user_serial int not null, hand_serial int not null, primary key (user_serial, hand_serial) ); drop table if exists tourneys_schedule; create table tourneys_schedule ( serial int unsigned not null auto_increment, name varchar(32), description_short varchar(64), description_long text, players_quota int default 10, variant varchar(32), betting_structure varchar(32), seats_per_game int default 10, custom_money char default 'n', buy_in int, rake int, sit_n_go char default 'y', breaks_interval int default 60, rebuy_delay int default 0, add_on int default 0, add_on_delay int default 60, start_time int default 0, register_time int default 0, respawn char default 'n', respawn_interval int default 0, primary key (serial) ); -- -- Holdem sit and go -- INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo2', 'Sit and Go 2 players, Holdem', 'Sit and Go 2 players', '2', 'holdem', 'level-15-30-no-limit', '2', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo3', 'Sit and Go 3 players, Holdem', 'Sit and Go 3 players', '3', 'holdem', 'level-15-30-no-limit', '3', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo4', 'Sit and Go 4 players, Holdem', 'Sit and Go 4 players', '4', 'holdem', 'level-15-30-no-limit', '4', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo5', 'Sit and Go 5 players, Holdem', 'Sit and Go 5 players', '5', 'holdem', 'level-15-30-no-limit', '5', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo6', 'Sit and Go 6 players, Holdem', 'Sit and Go 6 players', '6', 'holdem', 'level-15-30-no-limit', '6', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo7', 'Sit and Go 7 players, Holdem', 'Sit and Go 7 players', '7', 'holdem', 'level-15-30-no-limit', '7', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo8', 'Sit and Go 8 players, Holdem', 'Sit and Go 8 players', '8', 'holdem', 'level-15-30-no-limit', '8', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo9', 'Sit and Go 9 players, Holdem', 'Sit and Go 9 players', '9', 'holdem', 'level-15-30-no-limit', '9', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo10', 'Sit and Go single table, Holdem', 'Sit and Go single table', '10', 'holdem', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo20', 'Sit and Go 2 tables, Holdem', 'Sit and Go 2 tables', '20', 'holdem', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo30', 'Sit and Go 3 tables, Holdem', 'Sit and Go 3 tables', '30', 'holdem', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'sitngo50', 'Sit and Go 5 tables, Holdem', 'Sit and Go 5 tables', '50', 'holdem', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); -- -- Omaha sit and go -- INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo2', 'Sit and Go 2 players, Omaha', 'Sit and Go 2 players', '2', 'omaha', 'level-15-30-no-limit', '2', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo3', 'Sit and Go 3 players, Omaha', 'Sit and Go 3 players', '3', 'omaha', 'level-15-30-no-limit', '3', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo4', 'Sit and Go 4 players, Omaha', 'Sit and Go 4 players', '4', 'omaha', 'level-15-30-no-limit', '4', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo5', 'Sit and Go 5 players, Omaha', 'Sit and Go 5 players', '5', 'omaha', 'level-15-30-no-limit', '5', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo6', 'Sit and Go 6 players, Omaha', 'Sit and Go 6 players', '6', 'omaha', 'level-15-30-no-limit', '6', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo7', 'Sit and Go 7 players, Omaha', 'Sit and Go 7 players', '7', 'omaha', 'level-15-30-no-limit', '7', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo8', 'Sit and Go 8 players, Omaha', 'Sit and Go 8 players', '8', 'omaha', 'level-15-30-no-limit', '8', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo9', 'Sit and Go 9 players, Omaha', 'Sit and Go 9 players', '9', 'omaha', 'level-15-30-no-limit', '9', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo10', 'Sit and Go single table, Omaha', 'Sit and Go single table', '10', 'omaha', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo20', 'Sit and Go 2 tables, Omaha', 'Sit and Go 2 tables', '20', 'omaha', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo30', 'Sit and Go 3 tables, Omaha', 'Sit and Go 3 tables', '30', 'omaha', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` ( `name`, `description_short` , `description_long` , `players_quota` , `variant` , `betting_structure` , `seats_per_game` , `custom_money` , `buy_in` , `rake` , `sit_n_go` , `start_time` , `register_time` , `respawn` , `respawn_interval` ) VALUES ( 'Ositngo50', 'Sit and Go 5 tables, Omaha', 'Sit and Go 5 tables', '50', 'omaha', 'level-15-30-no-limit', '10', 'n', '3000', '0', 'y', '0', '0', 'y', '0' ); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular1', 'Holdem No Limit, 200 + 10', 'Holdem No Limit, 200 + 10', '1000', 'holdem', 'level-15-30-no-limit', '10', 'n', '200', '10', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 8 hour), unix_timestamp(now() + interval 7 hour), 'n', '0'); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular2', 'Holdem No Limit, 2000 + 100', 'Holdem No Limit, 2000 + 100', '1000', 'holdem', 'level-15-30-no-limit', '10', 'n', '2000', '100', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 9 hour), unix_timestamp(now() + interval 8 hour), 'n', '0'); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular1', 'Omaha No Limit, 200 + 10', 'Omaha No Limit, 200 + 10', '1000', 'omaha', 'level-15-30-no-limit', '10', 'n', '200', '10', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 10 hour), unix_timestamp(now() + interval 9 hour), 'n', '0'); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular2', 'Omaha No Limit, 2000 + 100', 'Omaha No Limit, 2000 + 100', '1000', 'omaha', 'level-15-30-no-limit', '10', 'n', '2000', '100', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 11 hour), unix_timestamp(now() + interval 10 hour), 'n', '0'); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular1', 'Omaha8 No Limit, 200 + 10', 'Omaha8 No Limit, 200 + 10', '1000', 'omaha8', 'level-15-30-no-limit', '10', 'n', '200', '10', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 12 hour), unix_timestamp(now() + interval 11 hour), 'n', '0'); INSERT INTO `tourneys_schedule` (`serial`, `name`, `description_short`, `description_long`, `players_quota`, `variant`, `betting_structure`, `seats_per_game`, `custom_money`, `buy_in`, `rake`, `sit_n_go`, `breaks_interval`, `rebuy_delay`, `add_on`, `add_on_delay`, `start_time`, `register_time`, `respawn`, `respawn_interval`) VALUES ('', 'regular2', 'Omaha8 No Limit, 2000 + 100', 'Omaha8 No Limit, 2000 + 100', '1000', 'omaha8', 'level-15-30-no-limit', '10', 'n', '2000', '100', 'n', '60', '30', '1', '60', unix_timestamp(now() + interval 13 hour), unix_timestamp(now() + interval 12 hour), 'n', '0'); drop table if exists tourneys; create table tourneys ( serial int unsigned not null auto_increment, name varchar(32), description_short varchar(64), description_long text, players_quota int default 10, variant varchar(32), betting_structure varchar(32), seats_per_game int default 10, custom_money char default 'n', buy_in int, rake int, sit_n_go char default 'y', breaks_interval int default 60, rebuy_delay int default 0, add_on int default 0, add_on_delay int default 60, start_time int default 0, finish_time int default 0, state varchar(32) default "registering", schedule_serial int, add_on_count int default 0, rebuy_count int default 0, primary key (serial) ); drop table if exists user2tourney; create table user2tourney ( user_serial int not null, tourney_serial int not null, table_serial int, rank int default -1, primary key (user_serial, tourney_serial) ); -- -- Default users -- INSERT INTO users (serial, name, privilege) VALUES (1, ' rake ', 0); INSERT INTO users (serial, name, password, privilege) VALUES (2, 'admin', 'REPLACE', 2); INSERT INTO users_private (serial) VALUES (2); INSERT INTO users (serial, name, password, privilege) VALUES (3, 'admin_web', 'REPLACE', 1); INSERT INTO users_private (serial) VALUES (3); drop table if exists users_transactions; -- -- Transactions between users -- create table users_transactions ( from_serial int unsigned not null, to_serial int unsigned not null, created int default 0, amount int default 0, custom_money char default 'n', status char default 'n', status_time int default 0, notes text, primary key (from_serial,to_serial) ); drop table if exists users_wins; -- -- How much a user wins/loses to another player in one hand -- create table users_wins ( from_serial int unsigned not null, to_serial int unsigned not null, hand_serial int unsigned not null, created timestamp not null, amount int default 0, custom_money char default 'n', primary key (from_serial,to_serial,hand_serial) );
# Host: localhost (Version: 5.5.53) # Date: 2017-02-20 16:44:34 # Generator: MySQL-Front 5.3 (Build 4.234) /*!40101 SET NAMES utf8 */; # # Structure for table "jfb_admin" # CREATE TABLE `jfb_admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` int(11) DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) USING BTREE, UNIQUE KEY `email` (`email`) USING BTREE, UNIQUE KEY `password_reset_token` (`password_reset_token`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # # Data for table "jfb_admin" # INSERT INTO `jfb_admin` VALUES (1,'admin','yBlt6YH9a9JFWK85nMR-Y2X_itv0pHvD','$2y$13$LrK6CD2djnYEK8M2X7jC1eL.PQXtr11//cO.RjRTw0fCElVkcjc9O',NULL,NULL,'<EMAIL>',10,1460820565,1460820565); # # Structure for table "jfb_auth_rule" # CREATE TABLE `jfb_auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # # Data for table "jfb_auth_rule" # # # Structure for table "jfb_auth_item" # CREATE TABLE `jfb_auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` int(11) NOT NULL, `description` text COLLATE utf8_unicode_ci, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `level` int(2) DEFAULT '0', `sort` int(11) DEFAULT NULL, `icon` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`name`), UNIQUE KEY `name` (`name`) USING BTREE, KEY `rule_name` (`rule_name`), KEY `idx-auth_item-type` (`type`), CONSTRAINT `jfb_auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `jfb_auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # # Data for table "jfb_auth_item" # INSERT INTO `jfb_auth_item` VALUES ('/comment/index',2,'评论管理',NULL,NULL,1474265757,1474265757,1,2,NULL),('/post/index',2,'帖子管理',NULL,NULL,1474265605,1474265605,1,3,NULL),('/rbac',2,'系统设置',NULL,NULL,1467913682,1467913682,1,1,NULL),('/rbac/add-permission',2,'新增权限',NULL,NULL,1467972825,1467972825,3,NULL,NULL),('/rbac/add-role',2,'新增角色',NULL,NULL,1467979264,1467979264,3,NULL,NULL),('/rbac/assign',2,'分配权限',NULL,NULL,1467993966,1467993966,3,NULL,NULL),('/rbac/permission',2,'权限管理',NULL,NULL,1467915772,1467915772,2,NULL,NULL),('/rbac/role',2,'角色管理',NULL,NULL,1467915565,1467915565,2,NULL,NULL),('/site/main',2,'后台首页',NULL,NULL,1469261409,1469261409,1,11,NULL),('/staff/index',2,'员工管理',NULL,NULL,1468053145,1468053145,1,7,NULL),('/user',2,'用户中心',NULL,NULL,1469295424,1469295606,1,6,NULL),('/user/index',2,'用户管理',NULL,NULL,1469295563,1469295563,2,NULL,NULL),('/wechat',2,'微信公众号',NULL,NULL,1477996407,1477996407,1,NULL,NULL),('/wechat/index',2,'公众号验证',NULL,NULL,1477996429,1477996429,2,NULL,NULL),('测试角色',1,NULL,NULL,NULL,1467985121,1467985121,1,NULL,NULL),('舰桥',1,NULL,NULL,NULL,1467989719,1467989719,1,NULL,NULL); # # Structure for table "jfb_auth_item_child" # CREATE TABLE `jfb_auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`parent`,`child`), KEY `child` (`child`), CONSTRAINT `jfb_auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `jfb_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `jfb_auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `jfb_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # # Data for table "jfb_auth_item_child" # INSERT INTO `jfb_auth_item_child` VALUES ('/rbac','/rbac/permission'),('/rbac','/rbac/role'),('/rbac/permission','/rbac/add-permission'),('/rbac/role','/rbac/add-role'),('/rbac/role','/rbac/assign'),('/user','/user/index'),('/wechat','/wechat/index'); # # Structure for table "jfb_auth_assignment" # CREATE TABLE `jfb_auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL, PRIMARY KEY (`item_name`,`user_id`), CONSTRAINT `jfb_auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `jfb_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; # # Data for table "jfb_auth_assignment" # # # Structure for table "jfb_migration" # CREATE TABLE `jfb_migration` ( `version` varchar(180) NOT NULL, `apply_time` int(11) DEFAULT NULL, PRIMARY KEY (`version`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; # # Data for table "jfb_migration" # INSERT INTO `jfb_migration` VALUES ('m000000_000000_base',1487494410),('m130524_201442_init',1487494417),('m140506_102106_rbac_init',1487496497); # # Structure for table "jfb_user" # CREATE TABLE `jfb_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `avatar` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `username` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `realname` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` int(11) DEFAULT '0', `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(128) COLLATE utf8_unicode_ci DEFAULT '', `email_public` int(1) DEFAULT NULL, `company` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `weibo_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `weibo_link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `twitter_account` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `wechat_qrcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `payment_qrcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `introduction` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `personal_website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `linkedin` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `callnumber` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `identitycard` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `profile` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `regIp` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `lastLoginIp` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `lastLoginTime` datetime DEFAULT NULL, `github_name` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `level` int(2) DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`) USING BTREE, UNIQUE KEY `username` (`username`) USING BTREE, UNIQUE KEY `password_reset_token` (`password_reset_token`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户表'; # # Data for table "jfb_user" # INSERT INTO `jfb_user` VALUES (1,'/img/a4.jpg','admint',NULL,NULL,'GO4elmkhpHMMuUqhxN5N0ovLcfszOAIK','$2y$13$tNYYyqhEHRkCHUoehjED4uW8QOUJxrUYHqFGeUrW6LGSN0FUKPR1u',NULL,'<EMAIL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1460820565,1460820565),(2,NULL,'admi',NULL,NULL,'OkymtSmWkexS1CkL133W40cMf_vCL-Yo','$2y$13$223Uf8yUOGcvziyl3oEzOOra8a0Gk7JWLevCRwrc0XYKqwya./ywK',NULL,'<EMAIL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1464431986,1464452504),(13,'/img/a4.jpg','guoguo','火柴',NULL,'28LtUsSFubjJktqxKpn4xXTPvx_VrblQ','$2y$13$XwDtcX18IGkpOHghmUHNKuKAL44DJNM5xsUgpnASc69Z7t9zr6Gpi',NULL,'<EMAIL>',1,'火柴工作室','上海','','','',NULL,NULL,'走的慢,但不后退',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'huaiguoguo',NULL,10,1468748317,1476526385),(14,NULL,'Match',NULL,0,'Ud9fWRRDwUU9afISwaj5IIzYnoVgzBlu','$2y$13$CigpGE4F.EfDgAtzPPPPB.5KdscG8IL6BIPwUdrOnK38DMrgFFu3y',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1473405960,1473405960),(15,NULL,'岁帆',NULL,0,'6Gs5pHjAlzp_bAwCfHdXfDKDHtLYGxU3','$2y$13$TWyrxoeLGg9DBlk5qrmRseaPBErLxfMFrpNQV0duVDRRygYbS34by',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1473470033,1473470033),(16,NULL,'NULLBUG',NULL,0,'7njQyvyCs925gqiEUNvFTeSniIWtdJHo','$2y$13$7i6sUmEapb005PBK8idp.uTK8eExf.owkPwdJ4vZPaSoy2rNlVNXS',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1473581444,1473581444),(17,NULL,'zhucy2025cc',NULL,0,'in0v0zazYBwYL2Wy4ohVf0A48zq_AbPy','$2y$13$.AjJTNcOrPD2B02soJbj1.dwz1Ktxnj.airNMfEA9zEW4HrrlZAKW',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1473587396,1473587396),(18,NULL,'seven',NULL,0,'N_Z9hSEDQRRHn-ltmqJfWc2sKM22Tao5','$2y$13$NBID0oIH2WXHQe70IImrp.Q1e4QjlP6P7uHjCeYWhALTvSUfOXBYG',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1473745066,1473745066),(19,NULL,'zgl',NULL,0,'H9n8LN2DKE18dchkY59mFyQO6ph2HDTl','$2y$13$OdMz7Uwy.IfHpgNf/lH4fe7k3iiQdj0cNs.mm0/oE5OTwuqW4ZQuW',NULL,'<EMAIL>',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474261179,1474261179),(20,NULL,'琴菲雪',NULL,0,'6-phciHlpaCgC4meRF3HOqYBHbLUjJY4','$2y$13$dYOQEbS6.r0DgjPvZrtwJ.MRJmLwH7O6vcyS0gjJOzVHx2SLwf3ti',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474268597,1474268597),(21,NULL,'hbyczsl',NULL,0,'AaZYSxRfWBCKmzenuaF16b0Ci8wb8_gj','$2y$13$inXjq8lQtwRETsKpRiIVfuaD.OQ8P40ObE2mu7AtbT0PAuQvIrIia',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474277140,1474277140),(22,NULL,'yanxin789315',NULL,0,'Ph3qKN2HFoPUqZQ0vC6Jl8TfVC_-5_CC','$2y$13$smBu9Dp9pbElQDSftJqI5eWfGNs5oPhlFjrcN3WJH2ZHBitiWuzpm',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474279665,1474279665),(23,NULL,'随风而行',NULL,0,'GyvFzawBdX78czUwCbWz0g2NvIh7VBm9','$2y$13$1xgZ5.2DgZFLeCYaD4Chlu.NJbzZj3rs21exqCxVefk8f6fOLp57a',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474279730,1474279730),(24,NULL,'marso_jie',NULL,0,'dp3aMLJN41K9oT0gZguexKR8js_DMk7l','$2y$13$saJ75kZ2OuAXXeoLOwxlV.zCuV6MQwHKfjrwg.pg/RTVZofN2E5ri',NULL,'9078<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474352991,1474352991),(25,NULL,'forecho',NULL,0,'PvgYzYDfekxKkKNr8JhgEzHfPEivVT8y','$2y$13$SjqU0tle0P/fti0tkMSTxuwST5S.QjR8bcRJ64IQ4R/0mSMBAIqSe',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474442083,1474442083),(26,NULL,'yangyu2718',NULL,0,'VFvAJHKcIzhd21IQIeU4CoqzzXdJO1K4','$2y$13$DnLSp7jSf6g.jytwcrzbcOXaUHnmq5kLfVYVHVNZLctOwOLsRs3Du',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1474885203,1474885203),(27,NULL,'sunny',NULL,0,'AQb6NwezSLNKxI_2_ZgLaFJQQI_zahSb','$2y$13$z9GNd6A5sMIJ7GxvwWgRo.8IBuedT3DDnYyN9a0HpcPpD3ZXhPioe',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1475049022,1475049022),(28,NULL,'cnmao99',NULL,0,'u0SFkCoVAwrc-GS7SrelkgvJW-LqTEO8','$2y$13$aKz0op2PmBzUEhHkxJk30ecNn4ssO7y7bPif66mPUFGrnllHDGWt.',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1475054057,1475054057),(29,NULL,'星月',NULL,0,'4EZs_MdlfO62ETslVw1WXLvIP9uK6uP0','$2y$13$5akwGr5htIr7oF1Noz9wWuIoOWyiNEIKNHID/Eld2ER08bmAlz3jm',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1476177297,1476177297),(30,NULL,'青岛--菜鸟',NULL,0,'mpwug1PQwvSgQNjhcTD3rE0x-Dqe5zSh','$2y$13$T7PDh/tHo2M5cdR5jKb0Iu9p8BayxozVizxEvQzzqy1NbOqOxqWCa',NULL,'<EMAIL>',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1476432257,1476432257),(31,NULL,'sang',NULL,0,'EPlPVXF3ZNKrLb4jsxy8ukj4hpEbMiID','$2y$13$qhP1agrFSl9n7JzvNzwerOofeTqY8nCCZNHwWSujTk0wiu2bS8xLq',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1482999323,1482999323),(32,NULL,'zh7908',NULL,0,'yTcl5hyorFAww770ceFlzolbEPlB0nZ3','$2y$13$PccZwG66hGXgqVBs575bYu4HRccP9gsOu1BcP4vYvTbHOmVNHdUre',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1485263186,1485263186),(33,NULL,'学IT习',NULL,0,'WxWcLNG1tanPu6dxvtfEL2MRATRuFSQ9','$2y$13$s6FnB4e11WZYxYqBhrfqO.203wZ.TrV06hEgSoXz42Rjk6ww1n7De',NULL,'<EMAIL>',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,1486716027,1486716027);
CREATE TABLE beverage_boot ( id integer NOT NULL, manufacturer character varying(255), name character varying(255), quantity integer, price double precision, version integer, incentive_boot_id integer, CONSTRAINT beverage_boot_pkey PRIMARY KEY (id), CONSTRAINT fk_beverage_incentive_boot_id FOREIGN KEY (incentive_boot_id) REFERENCES incentive_boot (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS=FALSE ); ALTER TABLE beverage_boot OWNER to tester;
<gh_stars>0 CREATE TABLE [Config].[AppConfig] ( [ID] INT IDENTITY (1, 1) NOT NULL, [ConfigName] VARCHAR (100) NULL, [ConfigDescription] VARCHAR (500) NULL, [StringValue] VARCHAR (200) NULL, [INTValue] INT NULL, [BoolValue] BIT NULL, [DecimalValue] DECIMAL (16, 2) NULL, [DateValue] DATE NULL, [DateTimeValue] DATETIME NULL, [Active] BIT DEFAULT ((1)) NULL );
<filename>DB_design/ecom.sql -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Feb 11, 2021 at 07:29 AM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ecom` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) 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 `categories` -- INSERT INTO `categories` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'Electronics', NULL, NULL), (2, 'Kitchen Wares', NULL, NULL), (3, 'House Furnitures', NULL, NULL), (4, 'Toys & Games', NULL, NULL), (5, 'Instruments', NULL, NULL), (6, 'Clothes', NULL, NULL), (7, 'Health & Care', NULL, NULL), (8, 'Food & Drugs', NULL, NULL), (9, 'Pets Furnitures', NULL, NULL), (10, 'Others', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_08_19_000000_create_failed_jobs_table', 1), (4, '2021_01_21_042819_create_categories_table', 1), (5, '2021_01_21_043242_create_products_table', 1), (6, '2021_01_22_041325_create_product_user_table', 1), (7, '2021_01_28_071149_create_payments_table', 1), (8, '2021_02_03_030616_create_ratings_table', 1), (9, '2021_02_04_065059_add_bio_to_users', 1), (10, '2021_02_05_034358_create_roles_table', 1), (11, '2021_02_05_040401_create_role_user_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `payments` -- CREATE TABLE `payments` ( `id` bigint(20) UNSIGNED NOT NULL, `buyer_id` bigint(20) UNSIGNED NOT NULL, `seller_id` bigint(20) UNSIGNED NOT NULL, `product_id` bigint(20) UNSIGNED NOT NULL, `fullname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `complete_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `contact_number` bigint(20) NOT NULL, `mode_of_payment` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `quantity` int(11) NOT NULL, `total_price` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `payments` -- INSERT INTO `payments` (`id`, `buyer_id`, `seller_id`, `product_id`, `fullname`, `complete_address`, `contact_number`, `mode_of_payment`, `quantity`, `total_price`, `created_at`, `updated_at`) VALUES (1, 3, 4, 7, '<NAME>', 'Pakigne minglanilla Cebu', 9287613780, 'Cash On Delivery', 4, 3996, '2021-02-08 20:17:53', '2021-02-08 20:17:53'), (3, 5, 4, 13, 'Hanphil', 'Pakigne minglanilla cebu', 9287613780, 'Cash On Delivery', 2, 1998, '2021-02-10 21:46:17', '2021-02-10 21:46:17'), (4, 3, 4, 9, '<NAME>', 'Pakigne Minglanilla Cebu', 9287613780, 'Cash On Delivery', 4, 88000, '2021-02-10 21:48:05', '2021-02-10 21:48:05'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `category_id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `detail` text COLLATE utf8mb4_unicode_ci NOT NULL, `price` int(11) NOT NULL, `photo` varchar(255) 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 `products` -- INSERT INTO `products` (`id`, `user_id`, `category_id`, `name`, `detail`, `price`, `photo`, `created_at`, `updated_at`) VALUES (4, 4, 9, 'Cat Lounge', 'Cat lounge that has many features', 999, 'pet furniture_1612503399.jpg', '2021-02-04 21:36:39', '2021-02-04 21:36:39'), (5, 4, 7, 'Green cross alcohol spray (small)', 'Alcohol that can kill corona virus', 59, 'alcohol_1612503452.jpg', '2021-02-04 21:37:32', '2021-02-04 21:37:32'), (7, 4, 1, 'Apple earphones', 'Earphones that has many features', 999, 'earphone_1612503527.png', '2021-02-04 21:38:47', '2021-02-04 21:38:47'), (9, 4, 1, 'LG monitor 24\"', 'Monitor that has many features', 22000, 'monitor_1612844793.webp', '2021-02-08 20:26:33', '2021-02-08 20:26:33'), (10, 4, 1, 'Logitech Mouse', 'Mouse that has many features', 1000, 'mouse_1612844929.jpg', '2021-02-08 20:28:49', '2021-02-08 20:28:49'), (12, 4, 1, 'JBL Speaker edited', 'Speaker that has many features', 4895, 'JBL speaker_1612845022.jpg', '2021-02-08 20:30:22', '2021-02-08 23:28:32'), (13, 4, 1, 'Headset edited', 'Headset that has many features', 999, 'headset_1613018402.jfif', '2021-02-10 20:40:02', '2021-02-10 21:47:04'); -- -------------------------------------------------------- -- -- Table structure for table `product_user` -- CREATE TABLE `product_user` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `product_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `product_user` -- INSERT INTO `product_user` (`id`, `user_id`, `product_id`, `created_at`, `updated_at`) VALUES (2, 3, 7, '2021-02-08 20:20:15', '2021-02-08 20:20:15'), (6, 5, 10, '2021-02-10 21:45:48', '2021-02-10 21:45:48'); -- -------------------------------------------------------- -- -- Table structure for table `ratings` -- CREATE TABLE `ratings` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `product_id` bigint(20) UNSIGNED NOT NULL, `rating` int(11) DEFAULT NULL, `comment` text 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; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) 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 `roles` -- INSERT INTO `roles` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'admin', NULL, NULL), (2, 'seller', NULL, NULL), (3, 'buyer', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `role_user` -- CREATE TABLE `role_user` ( `role_id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `role_user` -- INSERT INTO `role_user` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (1, 3, NULL, NULL), (2, 4, NULL, NULL), (3, 5, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `bio` text COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `bio`) VALUES (3, 'admin edited', '<EMAIL>', NULL, '$2y$10$gYyLvpgO6m63immgrm93vOOZ0CBAjARZ4zcYUJzvDptC0R.bYBajG', NULL, '2021-02-04 20:23:32', '2021-02-10 21:46:51', NULL), (4, 'seller', '<EMAIL>', NULL, '$2y$10$BzE1mTdxcktO4M5F7IiRLONv0r6jsMLuAi8ykkNCGKycdwzGAbOg6', NULL, '2021-02-04 20:26:46', '2021-02-08 20:19:41', 'Buy all my products!!!!!'), (5, 'buyer edited', '<EMAIL>', NULL, '$2y$10$4oylhqeg4PcboMUrjHN54eLKzMTq7DdVb3zXZtu5iVeb9X4.tASy.', NULL, '2021-02-04 20:27:00', '2021-02-08 23:29:27', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `payments` -- ALTER TABLE `payments` ADD PRIMARY KEY (`id`), ADD KEY `payments_buyer_id_foreign` (`buyer_id`), ADD KEY `payments_seller_id_foreign` (`seller_id`), ADD KEY `payments_product_id_foreign` (`product_id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD KEY `products_user_id_foreign` (`user_id`), ADD KEY `products_category_id_foreign` (`category_id`); -- -- Indexes for table `product_user` -- ALTER TABLE `product_user` ADD PRIMARY KEY (`id`), ADD KEY `product_user_user_id_foreign` (`user_id`), ADD KEY `product_user_product_id_foreign` (`product_id`); -- -- Indexes for table `ratings` -- ALTER TABLE `ratings` ADD PRIMARY KEY (`id`), ADD KEY `ratings_user_id_foreign` (`user_id`), ADD KEY `ratings_product_id_foreign` (`product_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `role_user` -- ALTER TABLE `role_user` ADD PRIMARY KEY (`role_id`,`user_id`), ADD KEY `role_user_user_id_foreign` (`user_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `payments` -- ALTER TABLE `payments` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `product_user` -- ALTER TABLE `product_user` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `ratings` -- ALTER TABLE `ratings` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- Constraints for dumped tables -- -- -- Constraints for table `payments` -- ALTER TABLE `payments` ADD CONSTRAINT `payments_buyer_id_foreign` FOREIGN KEY (`buyer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `payments_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `payments_seller_id_foreign` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `product_user` -- ALTER TABLE `product_user` ADD CONSTRAINT `product_user_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `product_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `ratings` -- ALTER TABLE `ratings` ADD CONSTRAINT `ratings_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `ratings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; -- -- Constraints for table `role_user` -- ALTER TABLE `role_user` ADD CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>CodeAperture/AdventureWorksSourceControl CREATE TABLE [Person].[BusinessEntityContact] ( [BusinessEntityID] [int] NOT NULL, [PersonID] [int] NOT NULL, [ContactTypeID] [int] NOT NULL, [rowguid] [uniqueidentifier] NOT NULL ROWGUIDCOL CONSTRAINT [DF_BusinessEntityContact_rowguid] DEFAULT (newid()), [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_BusinessEntityContact_ModifiedDate] DEFAULT (getdate()) ) ON [PRIMARY] GO ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID] PRIMARY KEY CLUSTERED ([BusinessEntityID], [PersonID], [ContactTypeID]) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_BusinessEntityContact_ContactTypeID] ON [Person].[BusinessEntityContact] ([ContactTypeID]) ON [PRIMARY] GO CREATE NONCLUSTERED INDEX [IX_BusinessEntityContact_PersonID] ON [Person].[BusinessEntityContact] ([PersonID]) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [AK_BusinessEntityContact_rowguid] ON [Person].[BusinessEntityContact] ([rowguid]) ON [PRIMARY] GO ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [FK_BusinessEntityContact_BusinessEntity_BusinessEntityID] FOREIGN KEY ([BusinessEntityID]) REFERENCES [Person].[BusinessEntity] ([BusinessEntityID]) GO ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [FK_BusinessEntityContact_ContactType_ContactTypeID] FOREIGN KEY ([ContactTypeID]) REFERENCES [Person].[ContactType] ([ContactTypeID]) GO ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [FK_BusinessEntityContact_Person_PersonID] FOREIGN KEY ([PersonID]) REFERENCES [Person].[Person] ([BusinessEntityID]) GO EXEC sp_addextendedproperty N'MS_Description', N'Cross-reference table mapping stores, vendors, and employees to people', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', NULL, NULL GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to BusinessEntity.BusinessEntityID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'COLUMN', N'BusinessEntityID' GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to ContactType.ContactTypeID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'COLUMN', N'ContactTypeID' GO EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'COLUMN', N'ModifiedDate' GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to Person.BusinessEntityID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'COLUMN', N'PersonID' GO EXEC sp_addextendedproperty N'MS_Description', N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'COLUMN', N'rowguid' GO EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'DF_BusinessEntityContact_ModifiedDate' GO EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of NEWID()', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'DF_BusinessEntityContact_rowguid' GO EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing BusinessEntity.BusinessEntityID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'FK_BusinessEntityContact_BusinessEntity_BusinessEntityID' GO EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing ContactType.ContactTypeID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'FK_BusinessEntityContact_ContactType_ContactTypeID' GO EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing Person.BusinessEntityID.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'FK_BusinessEntityContact_Person_PersonID' GO EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'CONSTRAINT', N'PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID' GO EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index. Used to support replication samples.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'INDEX', N'AK_BusinessEntityContact_rowguid' GO EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'INDEX', N'IX_BusinessEntityContact_ContactTypeID' GO EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'INDEX', N'IX_BusinessEntityContact_PersonID' GO EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Person', 'TABLE', N'BusinessEntityContact', 'INDEX', N'PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID' GO
<gh_stars>0 CREATE TABLE `hostUser` ( `hostId` int PRIMARY KEY AUTO_INCREMENT, `userName` varchar(255), `emailAddress` varchar(255), `password` varchar(255), `created_at` timestamp ); CREATE TABLE `games` ( `gameId` int PRIMARY KEY AUTO_INCREMENT, `gameLink` varchar(255), `name` varchar(255), `playerLimit` int, `descripton` varchar(255), `gameImage` varchar(255) ); CREATE TABLE `gameRoom` ( `gameRoomId` int PRIMARY KEY AUTO_INCREMENT, `hostId` int, `gameId` int, `roomName` varchar(255) COMMENT 'User given name of the room', `created_at` timestamp ); CREATE TABLE `gamePlayers` ( `playerId` int PRIMARY KEY AUTO_INCREMENT, `playerNum` int COMMENT 'use to store the player postion for the game room ex: 1,2,3. Also identifies player. STORES hostID for host player', `userName` varchar(255), `points` int COMMENT 'total points for that user', `gameRoomId` int ); CREATE TABLE `gameInstance` ( `gameRoomId` int, `gameState` varchar(255) COMMENT 'this column tracks the game state across all the player devices and syncronizes progression of the game on each device' ); CREATE TABLE `game1PromptQuestion` ( `promptId` int PRIMARY KEY AUTO_INCREMENT, `promptText` varchar(255) COMMENT 'question prompts for game1. Load into JavaScript Array' ); CREATE TABLE `game1PromptAnswers` ( `answerId` int PRIMARY KEY AUTO_INCREMENT, `playerId` int, `gameRoomId` int, `promptId` int, `selectedGif` int, `created_at` timestamp ); CREATE TABLE `gifListGame1` ( `imgId` int PRIMARY KEY AUTO_INCREMENT, `gifName` varchar(255) COMMENT 'name description of GIF ex: Happy', `gifLink` varchar(255) COMMENT 'server or web link for GIF' ); CREATE TABLE `game1AnswersVoting` ( `answerId` int, `playerId` int COMMENT 'player who voted the points in the row', `votePoint` int COMMENT 'point vote given from a player to an answer. filled from JS points calculator algorithm', `created_at` timestamp ); ALTER TABLE `gameRoom` ADD FOREIGN KEY (`hostId`) REFERENCES `hostUser` (`hostId`); ALTER TABLE `gameRoom` ADD FOREIGN KEY (`gameId`) REFERENCES `games` (`gameId`); ALTER TABLE `gamePlayers` ADD FOREIGN KEY (`gameRoomId`) REFERENCES `gameRoom` (`gameRoomId`); ALTER TABLE `gameInstance` ADD FOREIGN KEY (`gameRoomId`) REFERENCES `gameRoom` (`gameRoomId`); ALTER TABLE `game1PromptAnswers` ADD FOREIGN KEY (`playerId`) REFERENCES `gamePlayers` (`playerId`); ALTER TABLE `game1PromptAnswers` ADD FOREIGN KEY (`gameRoomId`) REFERENCES `gameRoom` (`gameRoomId`); ALTER TABLE `game1PromptAnswers` ADD FOREIGN KEY (`promptId`) REFERENCES `game1PromptQuestion` (`promptId`); ALTER TABLE `game1PromptAnswers` ADD FOREIGN KEY (`selectedGif`) REFERENCES `gifListGame1` (`imgId`); ALTER TABLE `game1AnswersVoting` ADD FOREIGN KEY (`answerId`) REFERENCES `game1PromptAnswers` (`answerId`); ALTER TABLE `game1AnswersVoting` ADD FOREIGN KEY (`playerId`) REFERENCES `gamePlayers` (`playerId`);
<reponame>NYMRAZE/erp_project ALTER TABLE user_profiles DROP COLUMN employee_id;
<reponame>MiXALK/printerApp.dev -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1:3306 -- Время создания: Янв 25 2018 г., 00:33 -- Версия сервера: 5.7.16 -- Версия PHP: 7.0.14 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 */; -- -- База данных: `printer` -- -- -------------------------------------------------------- -- -- Структура таблицы `errors` -- CREATE TABLE `errors` ( `id` int(10) UNSIGNED NOT NULL, `error_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) 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; -- -- Дамп данных таблицы `errors` -- INSERT INTO `errors` (`id`, `error_code`, `description`, `created_at`, `updated_at`) VALUES (1, 'gdgfdg', 'gdfgfdgdfghg gfdg', '2018-01-24 18:04:16', '2018-01-24 18:04:16'), (2, 'gfdgdf', 'gfdfgdfg', '2018-01-24 18:23:23', '2018-01-24 18:23:23'); -- -------------------------------------------------------- -- -- Структура таблицы `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2018_01_23_065817_create_errors_table', 2); -- -------------------------------------------------------- -- -- Структура таблицы `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Структура таблицы `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `admin` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `users` -- INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`, `admin`) VALUES (1, 'admin', '<EMAIL>', <PASSWORD>', '<PASSWORD>', '2018-01-21 18:17:46', '2018-01-21 18:17:46', 1); -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `errors` -- ALTER TABLE `errors` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Индексы таблицы `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `errors` -- ALTER TABLE `errors` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT для таблицы `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT для таблицы `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
DROP TABLE IF EXISTS employee; CREATE TABLE employee ( employee_id INT AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(250) NOT NULL, last_name VARCHAR(250) NOT NULL, dob VARCHAR(250) NOT NULL department VARCHAR(250) NOT NULL, gender VARCHAR(4) DEFAULT NULL ); INSERT INTO practice.employee (employee_id, department, dob, first_name, gender, last_name) VALUES (1,'Civil','1991-11-06','Sooraj','M','Bhat');
<gh_stars>0 --ZAD1 DROP TABLE IF EXISTS zwierzeta; CREATE TABLE zwierzeta ( gatunek varchar(100) NOT NULL, jajorodny char CHECK (jajorodny='T' OR jajorodny='N') NOT NULL, liczba_konczyn INT CHECK (liczba_konczyn < 100) NOT NULL, data_odkrycia DATE NOT NULL )
/* Empresa : EurekaBank Software : Sistema de Cuentas de Ahorro DBMS : MySQL Server Base de Datos : eurekabank Script : Inserta datos en las tablas de la Base de Datos */ -- ============================================= -- Seleccionar la Base de Datos -- ============================================= use eurekabank; -- ============================================= -- Cargar Datos de Prueba -- ============================================= -- Tabla: Moneda insert into moneda values ( '01', 'Soles' ); insert into moneda values ( '02', 'Dolares' ); -- Tabla: CargoMantenimiento insert into cargomantenimiento values ( '01', 3500.00, 7.00 ); insert into cargomantenimiento values ( '02', 1200.00, 2.50 ); -- Tabla: CargoMovimiento insert into costomovimiento values ( '01', 2.00 ); insert into costomovimiento values ( '02', 0.60 ); -- Tabla: InteresMensual insert into interesmensual values ( '01', 0.70 ); insert into interesmensual values ( '02', 0.60 ); -- Tabla: tipomovimiento insert into tipomovimiento values( '001', 'Apertura de Cuenta', 'INGRESO', 'ACTIVO' ); insert into tipomovimiento values( '002', 'Cancelar Cuenta', 'SALIDA', 'ACTIVO' ); insert into tipomovimiento values( '003', 'Deposito', 'INGRESO', 'ACTIVO' ); insert into tipomovimiento values( '004', 'Retiro', 'SALIDA', 'ACTIVO' ); insert into tipomovimiento values( '005', 'Interes', 'INGRESO', 'ACTIVO' ); insert into tipomovimiento values( '006', 'Mantenimiento', 'SALIDA', 'ACTIVO' ); insert into tipomovimiento values( '007', 'ITF', 'SALIDA', 'ACTIVO' ); insert into tipomovimiento values( '008', 'Transferencia', 'INGRESO', 'ACTIVO' ); insert into tipomovimiento values( '009', 'Transferencia', 'SALIDA', 'ACTIVO' ); insert into tipomovimiento values( '010', 'Cargo por Movimiento', 'SALIDA', 'ACTIVO' ); -- Tabla: Sucursal insert into sucursal values( '001', 'Sipan', 'Chiclayo', 'Av. Balta 1456', 2 ); insert into sucursal values( '002', '<NAME>', 'Trujillo', 'Jr. Independencia 456', 3 ); insert into sucursal values( '003', 'Los Olivos', 'Lima', 'Av. Central 1234', 0 ); insert into sucursal values( '004', 'Pardo', 'Lima', 'Av. Pardo 345 - Miraflores', 0 ); insert into sucursal values( '005', 'Misti', 'Arequipa', 'Bolivar 546', 0 ); insert into sucursal values( '006', 'Machupicchu', 'Cusco', 'Calle El Sol 534', 0 ); insert into sucursal values( '007', 'Grau', 'Piura', 'Av. Grau 1528', 0 ); -- Tabla: Empleado INSERT INTO empleado VALUES( '9999', 'Internet', 'Internet', 'internet', 'Internet', 'internet', 'internet', 'internet' ); INSERT INTO empleado VALUES( '0001', 'Romero', 'Castillo', '<NAME>', 'Trujillo', 'Call1 1 Nro. 456', 'cromero', 'chicho' ); INSERT INTO empleado VALUES( '0002', 'Castro', 'Vargas', 'Lidia', 'Lima', '<NAME>real 456 - SMP', 'lcastro', 'flaca' ); INSERT INTO empleado VALUES( '0003', 'Reyes', 'Ortiz', 'Claudia', 'Lima', 'Av. Aviacion 3456 - San Borja', 'aortiz', 'linda' ); INSERT INTO empleado VALUES( '0004', 'Ramos', 'Garibay', 'Angelica', 'Chiclayo', 'Calle Barcelona 345', 'aramos', 'china' ); INSERT INTO empleado VALUES( '0005', 'Ruiz', 'Zabaleta', 'Claudia', 'Cusco', 'Calle Cruz Verde 364', 'cvalencia', 'angel' ); INSERT INTO empleado VALUES( '0006', 'Cruz', 'Tarazona', 'Ricardo', 'Areguipa', 'Calle La Gruta 304', 'rcruz', 'cerebro' ); INSERT INTO empleado VALUES( '0007', 'Diaz', 'Flores', 'Edith', 'Lima', 'Av. Pardo 546', 'ediaz', 'princesa' ); INSERT INTO empleado VALUES( '0008', 'Sarmiento', 'Bellido', '<NAME>', 'Areguipa', 'Calle Alfonso Ugarte 1567', 'csarmiento', 'chinita' ); INSERT INTO empleado VALUES( '0009', 'Pachas', 'Sifuentes', '<NAME>', 'Trujillo', 'Francisco Pizarro 1263', 'lpachas', 'gato' ); INSERT INTO empleado VALUES( '0010', 'Tello', 'Alarcon', '<NAME>', 'Cusco', 'Los Angeles 865', 'htello', 'machupichu' ); INSERT INTO empleado VALUES( '0011', 'Carrasco', 'Vargas', '<NAME>', 'Chiclayo', 'Av. Balta 1265', 'pcarrasco', 'tinajones' ); -- asignado insert into asignado values( '000001', '001', '0004', '20071115', null ); insert into asignado values( '000002', '002', '0001', '20071120', null ); insert into asignado values( '000003', '003', '0002', '20071128', null ); insert into asignado values( '000004', '004', '0003', '20071212', '20080325' ); insert into asignado values( '000005', '005', '0006', '20071220', null ); insert into asignado values( '000006', '006', '0005', '20080105', null ); insert into asignado values( '000007', '004', '0007', '20080107', null ); insert into asignado values( '000008', '005', '0008', '20080107', null ); insert into asignado values( '000009', '001', '0011', '20080108', null ); insert into asignado values( '000010', '002', '0009', '20080108', null ); insert into asignado values( '000011', '006', '0010', '20080108', null ); -- Tabla: parametro insert into parametro values( '001', 'ITF - Impuesto a la Transacciones Financieras', '0.08', 'ACTIVO' ); insert into parametro values( '002', 'Numero de Operaciones Sin Costo', '15', 'ACTIVO' ); -- Tabla: Cliente insert into cliente values( '00001', 'CORONEL', 'CASTILLO', '<NAME>', '06914897', 'LIMA', 'LOS OLIVOS', '9666-4457', '<EMAIL>' ); insert into cliente values( '00002', 'VALENCIA', 'MORALES', '<NAME>', '01576173', 'LIMA', 'MAGDALENA', '924-7834', '<EMAIL>' ); insert into cliente values( '00003', 'MARCELO', 'VILLALOBOS', 'RICARDO', '10762367', 'LIMA', 'LINCE', '993-62966', '<EMAIL>' ); insert into cliente values( '00004', 'ROMERO', 'CASTILLO', '<NAME>', '06531983', 'LIMA', 'LOS OLIVOS', '865-84762', '<EMAIL>' ); insert into cliente values( '00005', 'ARANDA', 'LUNA', '<NAME>', '10875611', 'LIMA', '<NAME>', '834-67125', '<EMAIL>' ); insert into cliente values( '00006', 'AYALA', 'PAZ', '<NAME>', '10679245', 'LIMA', '<NAME>', '963-34769', '<EMAIL>' ); insert into cliente values( '00007', 'CHAVEZ', 'CANALES', '<NAME>', '10145693', 'LIMA', 'MIRAFLORES', '999-96673', '<EMAIL>' ); insert into cliente values( '00008', 'FLORES', 'CHAFLOQUE', '<NAME>', '10773456', 'LIMA', '<NAME>', '966-87567', '<EMAIL>' ); insert into cliente values( '00009', 'FLORES', 'CASTILLO', '<NAME>', '10346723', 'LIMA', '<NAME>', '978-43768', '<EMAIL>' ); insert into cliente values( '00010', 'GONZALES', 'GARCIA', '<NAME>', '10192376', 'LIMA', '<NAME>', '945-56782', '<EMAIL>' ); insert into cliente values( '00011', 'LAY', 'VALLEJOS', '<NAME>', '10942287', 'LIMA', 'LINCE', '956-12657', '<EMAIL>' ); insert into cliente values( '00012', 'MONTALVO', 'SOTO', '<NAME>', '10612376', 'LIMA', 'SURCO', '965-67235', '<EMAIL>' ); insert into cliente values( '00013', 'RICALDE', 'RAMIREZ', '<NAME>', '10761324', 'LIMA', 'MIRAFLORES', '991-23546', '<EMAIL>' ); insert into cliente values( '00014', 'RODRIGUEZ', 'FLORES', '<NAME>', '10773345', 'LIMA', 'LINCE', '976-82838', '<EMAIL>' ); insert into cliente values( '00015', 'ROJAS', 'OSCANOA', '<NAME>', '10238943', 'LIMA', 'LIMA', '962-32158', '<EMAIL>' ); insert into cliente values( '00016', 'TEJADA', '<NAME>', '<NAME>', '10446791', 'LIMA', 'PUE<NAME>', '966-23854', '<EMAIL>' ); insert into cliente values( '00017', 'VALDEVIESO', 'LEYVA', '<NAME>', '10452682', 'LIMA', 'SURCO', '956-78951', '<EMAIL>' ); insert into cliente values( '00018', 'VALENTIN', 'COTRINA', '<NAME>', '10398247', 'LIMA', 'LA MOLINA', '921-12456', '<EMAIL>' ); insert into cliente values( '00019', 'YAURICASA', 'BAUTISTA', 'YESABETH', '10934584', 'LIMA', 'MAGDALENA', '977-75777', '<EMAIL>' ); insert into cliente values( '00020', 'ZEGARRA', 'GARCIA', '<NAME>', '10772365', 'LIMA', '<NAME>', '936-45876', '<EMAIL>' ); -- Tabla: Cuenta insert into cuenta values('00200001','01','002','0001','00008',7000,'20080105','ACTIVO',15,'123456'); insert into cuenta values('00200002','01','002','0001','00001',6800,'20080109','ACTIVO',3,'123456'); insert into cuenta values('00200003','02','002','0001','00007',6000,'20080111','ACTIVO',6,'123456'); insert into cuenta values('00100001','01','001','0004','00005',6900,'20080106','ACTIVO',7,'123456'); insert into cuenta values('00100002','02','001','0004','00005',4500,'20080108','ACTIVO',4,'123456'); -- Tabla: Movimiento insert into movimiento values('00100002',01,'20080108','0004','001',1800,null); insert into movimiento values('00100002',02,'20080125','0004','004',1000,null); insert into movimiento values('00100002',03,'20080213','0004','003',2200,null); insert into movimiento values('00100002',04,'20080308','0004','003',1500,null); insert into movimiento values('00100001',01,'20080106','0004','001',2800,null); insert into movimiento values('00100001',02,'20080115','0004','003',3200,null); insert into movimiento values('00100001',03,'20080120','0004','004',0800,null); insert into movimiento values('00100001',04,'20080214','0004','003',2000,null); insert into movimiento values('00100001',05,'20080225','0004','004',0500,null); insert into movimiento values('00100001',06,'20080303','0004','004',0800,null); insert into movimiento values('00100001',07,'20080315','0004','003',1000,null); insert into movimiento values('00200003',01,'20080111','0001','001',2500,null); insert into movimiento values('00200003',02,'20080117','0001','003',1500,null); insert into movimiento values('00200003',03,'20080120','0001','004',0500,null); insert into movimiento values('00200003',04,'20080209','0001','004',0500,null); insert into movimiento values('00200003',05,'20080225','0001','003',3500,null); insert into movimiento values('00200003',06,'20080311','0001','004',0500,null); insert into movimiento values('00200002',01,'20080109','0001','001',3800,null); insert into movimiento values('00200002',02,'20080120','0001','003',4200,null); insert into movimiento values('00200002',03,'20080306','0001','004',1200,null); insert into movimiento values('00200001',01,'20080105','0001','001',5000,null); insert into movimiento values('00200001',02,'20080107','0001','003',4000,null); insert into movimiento values('00200001',03,'20080109','0001','004',2000,null); insert into movimiento values('00200001',04,'20080111','0001','003',1000,null); insert into movimiento values('00200001',05,'20080113','0001','003',2000,null); insert into movimiento values('00200001',06,'20080115','0001','004',4000,null); insert into movimiento values('00200001',07,'20080119','0001','003',2000,null); insert into movimiento values('00200001',08,'20080121','0001','004',3000,null); insert into movimiento values('00200001',09,'20080123','0001','003',7000,null); insert into movimiento values('00200001',10,'20080127','0001','004',1000,null); insert into movimiento values('00200001',11,'20080130','0001','004',3000,null); insert into movimiento values('00200001',12,'20080204','0001','003',2000,null); insert into movimiento values('00200001',13,'20080208','0001','004',4000,null); insert into movimiento values('00200001',14,'20080213','0001','003',2000,null); insert into movimiento values('00200001',15,'20080219','0001','004',1000,null); -- Tabla: contador insert into contador Values( 'Moneda', 2, 2 ); insert into contador Values( 'tipomovimiento', 10, 3 ); insert into contador Values( 'Sucursal', 7, 3 ); insert into contador Values( 'Empleado', 11, 4 ); insert into contador Values( 'asignado', 11, 6 ); insert into contador Values( 'parametro', 2, 3 ); insert into contador Values( 'Cliente', 21, 5 );
CREATE TABLE [dbo].[Application] ( [Id] INT IDENTITY PRIMARY KEY, [Name] VARCHAR(50) NOT NULL, [Description] VARCHAR(100) NOT NULL, [Path] VARCHAR(50) NOT NULL, [IsExternal] INT NOT NULL DEFAULT 0, [Public] INT NOT NULL DEFAULT 0, [Admin] INT NOT NULL DEFAULT 0 )
create table pt_court_cases_tbl ( i_asmtno bigint not null, vc_onrname character varying(100), vc_onrdoorno character varying(30), i_rwid bigint, vc_lctyname character varying(350), d_taxamt double precision, dt_casedt date, vc_caseeno character varying(30), vc_courtname character varying(50), i_ulbobjid bigint not null, ts_dttm timestamp without time zone, c_courtflag character varying(1), vc_remarks character varying(200), i_usrid bigint );
<gh_stars>1-10 /* This script joins block and tract FIPS to individual-level dataset Written by: <NAME> */ CREATE TABLE core_birth_info_rc AS SELECT core_birth_info_rc2.*, indiv_census_tracts."FIPS_BLK_GEO", substring(indiv_census_tracts."FIPS_BLK_GEO" from 1 for 11) AS "FIPS_TRACT_GEO" FROM core_birth_info_rc2 LEFT JOIN indiv_census_tracts USING ("UNI_PART_ID_I"); DROP TABLE core_birth_info_rc2;
CREATE TABLE IF NOT EXISTS eg_fsm_application( id character varying(256) NOT NULL, applicationno character varying(128), tenantid character varying(64), additionaldetails jsonb, accountid character varying(64) DEFAULT NULL, description character varying(256) DEFAULT NULL, applicationStatus character varying(64) NOT NULL, source character varying(64) DEFAULT NULL, sanitationtype character varying(64) NOT NULL, propertyUsage character varying(64) NOT NULL, noOfTrips int, status character varying(64), vehicle_id character varying(64) NOT NULL, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint, CONSTRAINT pk_eg_fsm_application PRIMARY KEY (id) ); CREATE INDEX IF NOT EXISTS index_appno_eg_fsm ON eg_fsm_application ( applicationno ); CREATE INDEX IF NOT EXISTS index_acct_eg_fsm ON eg_fsm_application ( accountId ); CREATE INDEX IF NOT EXISTS index_tenant_eg_fsm ON eg_fsm_application ( tenantid ); CREATE INDEX IF NOT EXISTS index_santype_eg_fsm ON eg_fsm_application ( sanitationtype ); CREATE INDEX IF NOT EXISTS index_appstatus_eg_fsm ON eg_fsm_application ( applicationStatus ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm ON eg_fsm_application ( id ); CREATE INDEX IF NOT EXISTS index_vehicle_eg_fsm ON eg_fsm_application ( vehicle_id ); CREATE INDEX IF NOT EXISTS index_source_eg_fsm ON eg_fsm_application ( source ); CREATE INDEX IF NOT EXISTS index_property_eg_fsm ON eg_fsm_application ( propertyUsage ); CREATE TABLE IF NOT EXISTS eg_fsm_application_auditlog( id character varying(64) NOT NULL, applicationno character varying(64), tenantid character varying(64), additionaldetails jsonb, accountid character varying(64) DEFAULT NULL, description character varying(256) DEFAULT NULL, applicationStatus character varying(64) NOT NULL, source character varying(64) DEFAULT NULL, sanitationtype character varying(64) NOT NULL, propertyUsage character varying(64) NOT NULL, noOfTrips int, status character varying(64), vehicle_id character varying(64) NOT NULL, pit_id character varying(4) NOT NULL, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint ); CREATE INDEX IF NOT EXISTS index_id_eg_fsmauditlog ON eg_fsm_application_auditlog ( id ); CREATE TABLE IF NOT EXISTS eg_fsm_pit_detail( id character varying(64) NOT NULL, tenantid character varying(64), height double precision, length double precision, width double precision, distanceFromRoad double precision, additionalDetails JSONB, fms_id character varying NOT NULL, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint, CONSTRAINT pk_eg_fsm_pit_detail PRIMARY KEY (id), CONSTRAINT fk_eg_pit_fsm FOREIGN KEY (fms_id) REFERENCES eg_fsm_application (id) ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_pit_detail ON eg_fsm_pit_detail ( id ); CREATE INDEX IF NOT EXISTS index_tenant_eg_fsm_pit_detail ON eg_fsm_pit_detail ( tenantid ); CREATE INDEX IF NOT EXISTS index_fsm_id_eg_fsm_pit_detail ON eg_fsm_pit_detail ( fms_id ); CREATE TABLE IF NOT EXISTS eg_fsm_pit_detail_auditlog( id character varying(64) NOT NULL, tenantid character varying(64), height double precision, length double precision, width double precision, distanceFromRoad double precision, additionalDetails JSONB, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_pit_detail_auditlog ON eg_fsm_pit_detail_auditlog ( id ); CREATE TABLE IF NOT EXISTS eg_fsm_address( id character varying(64), tenantId character varying(64) NOT NULL, doorNo character varying(64), plotNo character varying(64), landmark character varying(64), city character varying(64), district character varying(64), region character varying(64), state character varying(64), country character varying(64), locality character varying(64), pincode character varying(64), additionaldetails jsonb, buildingName character varying(64), street character varying(64), fsm_id character varying(64), createdBy character varying(64), lastModifiedBy character varying(64), createdTime bigint, lastModifiedTime bigint, CONSTRAINT pk_eg_fsm_address PRIMARY KEY (id), CONSTRAINT fk_eg_fsm_address FOREIGN KEY (fsm_id) REFERENCES eg_fsm_application (id) ); CREATE INDEX IF NOT EXISTS index_loc_eg_fsm_address ON eg_fsm_address ( locality ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_address ON eg_fsm_address ( id ); CREATE INDEX IF NOT EXISTS index_fsm_eg_fsm_address ON eg_fsm_address ( fsm_id ); CREATE INDEX IF NOT EXISTS index_tenant_eg_fsm_address ON eg_fsm_address ( tenantid ); CREATE TABLE IF NOT EXISTS eg_fsm_address_auditlog( id character varying(64), tenantId character varying(64) NOT NULL, doorNo character varying(64), plotNo character varying(64), landmark character varying(64), city character varying(64), district character varying(64), region character varying(64), state character varying(64), country character varying(64), locality character varying(64), pincode character varying(64), additionaldetails jsonb, buildingName character varying(64), street character varying(64), fsm_id character varying(64), createdBy character varying(64), lastModifiedBy character varying(64), createdTime bigint, lastModifiedTime bigint ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_address_auditlog ON eg_fsm_address_auditlog ( id ); CREATE TABLE IF NOT EXISTS eg_fsm_geolocation( id character varying(64) NOT NULL, tenantid character varying(64), latitude double precision, longitude double precision, address_id character varying(64), additionalDetails JSONB, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint, CONSTRAINT pk_eg_fsm_geolocation_address PRIMARY KEY (id), CONSTRAINT fk_eg_fsm_geolocation_address FOREIGN KEY (address_id) REFERENCES eg_fsm_address (id) ); CREATE INDEX IF NOT EXISTS index_add_eg_fsm_geolocation ON eg_fsm_geolocation ( address_id ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_geolocation ON eg_fsm_geolocation ( id ); CREATE TABLE IF NOT EXISTS eg_fsm_geolocation_auditlog( id character varying(64) NOT NULL, tenantid character varying(64), latitude double precision, longitude double precision, address_id character varying(64), additionalDetails JSONB, createdby character varying(64), lastmodifiedby character varying(64), createdtime bigint, lastmodifiedtime bigint ); CREATE INDEX IF NOT EXISTS index_id_eg_fsm_geolocation_auditlog ON eg_fsm_geolocation_auditlog ( id );
-- 10 November 2020 -- <NAME> -- dummy data for test_beetroot qr code INSERT INTO foodprint_weeklyview ( logid, harvest_logid, harvest_supplierShortcode, harvest_supplierName, harvest_farmerName, harvest_supplierAddress, harvest_produceName, harvest_photoHash, harvest_TimeStamp, harvest_CaptureTime, harvest_Description, harvest_geolocation, harvest_quantity, harvest_unitOfMeasure, harvest_description_json, harvest_BlockchainHashID, harvest_BlockchainHashData, supplierproduce, -- e.g. WMPN_BabyMarrow storage_logid, market_Address, market_quantity, market_unitOfMeasure, market_storageTimeStamp, market_storageCaptureTime, market_URL, storage_BlockchainHashID, storage_BlockchainHashData, storage_Description, storage_bool_added_to_blockchain, -- true or false storage_added_to_blockchain_date, storage_added_to_blockchain_by, -- user who logged storage to blockchain storage_blockchain_uuid, -- uuid to blockchain config record which has contract and address harvest_bool_added_to_blockchain, -- true or false harvest_added_to_blockchain_date, harvest_added_to_blockchain_by, -- user who logged harvest to blockchain harvest_blockchain_uuid, -- uuid to blockchain config record which has contract and address harvest_user, -- user who logged harvest storage_user, -- user who logged storage logdatetime, lastmodifieddatetime, year_established, covid19_response ) VALUES ('test8c7c-9d4e-49dd-8b57-09e08df01234' -- logid ,'test51a0-e0e2-4b8f-8468-a00291ee1234' -- harvest_logid ,'TEST' -- harvest_supplierShortcode ,'Fresh Produce Farm (TEST)' -- harvest_supplierName ,'<NAME> (TEST)' -- harvest_farmerName ,'Durbanville, Western Cape, South Africa 7490' -- harvest_supplierAddress, ,'Beetroot' -- harvest_produceName, ,'PLACEHOLDER - Beetroot Photo' -- harvest_photoHash, ,'2020-11-09 06:00:00' -- harvest_TimeStamp, ,'2020-11-09 11:06:00' -- harvest_CaptureTime, ," Organic & pesticide free. After each harvest, vegetables are washed, prepared & stored in Cold-room at 10 degrees Celsius till delivery to ensure fresh produce to the market. [Organic, Pesticide free, Greenhouse]" -- harvest_Description, ,'Durbanville, Western Cape, South Africa 7490' -- harvest_geolocation, ,'PLACEHOLDER - harvest_quantity' -- harvest_quantity, ,'units' -- harvest_unitOfMeasure, ,"{'greenhouse':'yes', 'organic':'yes'}" -- harvest_description_json, ,'testf69a-e218-42d5-8441-3476acf5d5f5' -- harvest_BlockchainHashID, ,"{'harvest_supplierName':'Fresh Produce Farm', ...}" -- harvest_BlockchainHashData ,'TEST_Beetroot' -- supplierproduce, -- e.g. TEST_Beetroot ,'test77bb-8aa1-4a80-a79a-0ff9d3176afc' -- storage_logid, ,'Granger Bay Blvd, Victoria & Alfred Waterfront, Cape Town, 8051' -- market_Address, ,'PLACEHOLDER - market_quantity' -- market_quantity, ,'units' -- market_unitOfMeasure, ,'2020-11-10 09:00:00' -- market_storageTimeStamp, ,'2020-11-10 10:06:00' -- market_storageCaptureTime, ,'PLACEHOLDER - market_URL' -- market_URL, ,'testd1e9-b742-4dda-a491-4e8c74b2c24e' -- storage_BlockchainHashID, ,"{'market_Name':'Oranjezicht City Farm', ...}" -- storage_BlockchainHashData ,'PLACEHOLDER - storage_Description' -- storage_Description, ,'false' -- storage_bool_added_to_blockchain, ,'-' -- storage_added_to_blockchain_date, ,'-' -- storage_added_to_blockchain_by, -- user who logged storage to blockchain ,'-' -- storage_blockchain_uuid, -- uuid to blockchain config record which has contract and address ,'false' -- harvest_bool_added_to_blockchain, -- true or false ,'-' -- harvest_added_to_blockchain_date, ,'-' -- harvest_added_to_blockchain_by, -- user who logged harvest to blockchain ,'-' -- harvest_blockchain_uuid, -- uuid to blockchain config record which has contract and address ,'PLACEHOLDER - harvest_user' -- harvest_user, -- user who logged harvest ,'PLACEHOLDER - storage_user' -- storage_user, -- user who logged storage ,'2020-11-10 11:00:00' ,'2020-11-10 11:00:00' ,'2020' -- Year established ,'Covid-19 protocols observed' -- covid19 response ) --Bump out logdatetime for demo's --UPDATE foodprint_weeklyview --SET logdatetime = '2020-11-23 11:00:00' --WHERE logid = 'test8c7c-9d4e-49dd-8b57-09e08df01234';
CREATE TABLE lang ( id SERIAL NOT NULL PRIMARY KEY, name VARCHAR(20) UNIQUE NOT NULL ); INSERT INTO lang (name) VALUES ('Afrikaans'); INSERT INTO lang (name) VALUES ('Albanian'); INSERT INTO lang (name) VALUES ('Arabic'); INSERT INTO lang (name) VALUES ('Armenian'); INSERT INTO lang (name) VALUES ('Bengali'); INSERT INTO lang (name) VALUES ('Bulgarian'); INSERT INTO lang (name) VALUES ('Chinese'); INSERT INTO lang (name) VALUES ('Czech'); INSERT INTO lang (name) VALUES ('Danish'); INSERT INTO lang (name) VALUES ('Dutch'); INSERT INTO lang (name) VALUES ('English'); INSERT INTO lang (name) VALUES ('Estonian'); INSERT INTO lang (name) VALUES ('Finnish'); INSERT INTO lang (name) VALUES ('French'); INSERT INTO lang (name) VALUES ('German'); INSERT INTO lang (name) VALUES ('Greek'); INSERT INTO lang (name) VALUES ('Gujarati'); INSERT INTO lang (name) VALUES ('Italian'); INSERT INTO lang (name) VALUES ('Hawaiian'); INSERT INTO lang (name) VALUES ('Hebrew'); INSERT INTO lang (name) VALUES ('Hindi'); INSERT INTO lang (name) VALUES ('Japanese'); INSERT INTO lang (name) VALUES ('Korean'); INSERT INTO lang (name) VALUES ('Latin'); INSERT INTO lang (name) VALUES ('Polish'); INSERT INTO lang (name) VALUES ('Portuguese'); INSERT INTO lang (name) VALUES ('Punjabi'); INSERT INTO lang (name) VALUES ('Russian'); INSERT INTO lang (name) VALUES ('Sanskrit'); INSERT INTO lang (name) VALUES ('Serbian'); INSERT INTO lang (name) VALUES ('Sindhi'); INSERT INTO lang (name) VALUES ('Spanish'); INSERT INTO lang (name) VALUES ('Swahili'); INSERT INTO lang (name) VALUES ('Swedish'); INSERT INTO lang (name) VALUES ('Tamil'); INSERT INTO lang (name) VALUES ('Telegu'); INSERT INTO lang (name) VALUES ('Thai'); INSERT INTO lang (name) VALUES ('Turkish'); INSERT INTO lang (name) VALUES ('Urdu'); INSERT INTO lang (name) VALUES ('Welsh');
-- file:tstypes.sql ln:3 expect:true SELECT '1'::tsvector
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/alter_table/6327f2ca.sql -- file:foreign_data.sql ln:612 expect:true ALTER TABLE pt1 ALTER COLUMN c4 SET DEFAULT 0
-- file:rowsecurity.sql ln:947 expect:true ALTER TABLE x1 ENABLE ROW LEVEL SECURITY
<filename>src/BugNET.Database/Stored Procedures/BugNet_ProjectPriorities_GetPriorityById.sql CREATE PROCEDURE [dbo].[BugNet_ProjectPriorities_GetPriorityById] @PriorityId int AS SELECT PriorityId, ProjectId, PriorityName, SortOrder, PriorityImageUrl FROM BugNet_ProjectPriorities WHERE PriorityId = @PriorityId
-- Generated by hibernate create table CM_SEC_CATEGORY_T (CAT_CODE varchar2(255 char) not null, CAT_DESCR varchar2(255 char), primary key (CAT_CODE)); create index CM_ENR_USER on CM_ENROLLMENT_T (USER_ID); create index CM_MBR_CTR on CM_MEMBERSHIP_T (MEMBER_CONTAINER_ID); create index CM_MBR_USER on CM_MEMBERSHIP_T (USER_ID); create index CM_INSTR_IDX on CM_OFFICIAL_INSTRUCTORS_T (INSTRUCTOR_ID); alter table CM_ACADEMIC_SESSION_T modify (LAST_MODIFIED_DATE date); alter table CM_ACADEMIC_SESSION_T modify (CREATED_DATE date); alter table CM_ACADEMIC_SESSION_T modify (START_DATE date); alter table CM_ACADEMIC_SESSION_T modify (END_DATE date); alter table CM_CROSS_LISTING_T modify (LAST_MODIFIED_DATE date); alter table CM_CROSS_LISTING_T modify (CREATED_DATE date); alter table CM_ENROLLMENT_SET_T modify (LAST_MODIFIED_DATE date); alter table CM_ENROLLMENT_SET_T modify (CREATED_DATE date); alter table CM_ENROLLMENT_T modify (LAST_MODIFIED_DATE date); alter table CM_ENROLLMENT_T modify (CREATED_DATE date); alter table CM_ENROLLMENT_T add unique (USER_ID, ENROLLMENT_SET); alter table CM_MEETING_T drop column TIME_OF_DAY; alter table CM_MEETING_T add (START_TIME date); alter table CM_MEETING_T add (FINISH_TIME date); alter table CM_MEETING_T add (MONDAY number(1,0)); alter table CM_MEETING_T add (TUESDAY number(1,0)); alter table CM_MEETING_T add (WEDNESDAY number(1,0)); alter table CM_MEETING_T add (THURSDAY number(1,0)); alter table CM_MEETING_T add (FRIDAY number(1,0)); alter table CM_MEETING_T add (SATURDAY number(1,0)); alter table CM_MEETING_T add (SUNDAY number(1,0)); alter table CM_MEMBERSHIP_T add (STATUS varchar2(255 char)); alter table CM_MEMBERSHIP_T add unique (USER_ID, MEMBER_CONTAINER_ID); alter table CM_MEMBER_CONTAINER_T modify (LAST_MODIFIED_DATE date); alter table CM_MEMBER_CONTAINER_T modify (CREATED_DATE date); alter table CM_MEMBER_CONTAINER_T add (MAXSIZE number(10,0)); alter table CM_MEMBER_CONTAINER_T modify (START_DATE date); alter table CM_MEMBER_CONTAINER_T modify (END_DATE date); alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC6D0C1EF35; alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC66DFDE2; alter table CM_MEMBER_CONTAINER_T drop column EQUIV_CANON_COURSE_ID; alter table CM_MEMBER_CONTAINER_T drop column EQUIV_COURSE_OFFERING_ID; alter table CM_OFFICIAL_INSTRUCTORS_T add unique (ENROLLMENT_SET_ID, INSTRUCTOR_ID);
<filename>inst/sql/sql_server/analyses/420.sql -- 420 Number of condition occurrence records by condition occurrence start month --HINT DISTRIBUTE_ON_KEY(stratum_1) WITH rawData AS ( select YEAR(co1.condition_start_date)*100 + month(co1.condition_start_date) as stratum_1, COUNT_BIG(co1.PERSON_ID) as count_value from @cdmDatabaseSchema.condition_occurrence co1 inner join @cdmDatabaseSchema.observation_period op on co1.person_id = op.person_id -- only include events that occur during observation period where co1.condition_start_date <= op.observation_period_end_date and isnull(co1.condition_end_date,co1.condition_start_date) >= op.observation_period_start_date group by YEAR(co1.condition_start_date)*100 + month(co1.condition_start_date) ) SELECT 420 as analysis_id, CAST(stratum_1 AS VARCHAR(255)) as stratum_1, cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as varchar(255)) as stratum_4, cast(null as varchar(255)) as stratum_5, count_value into @scratchDatabaseSchema@schemaDelim@tempAchillesPrefix_420 FROM rawData;
create table if not exists flyway ( version text ); -- drop table if exists memento cascade; create table if not exists memento ( prefix varchar(64) not null, name varchar(64) not null, value text not null, sort_order integer not null default 0, created bigint not null default 0, modified bigint not null default 0, version integer not null default 1, constraint memento_pk primary key(prefix, name) );
CREATE TABLE IF NOT EXISTS astra.guilds ( guild_id BIGINT NOT NULL CONSTRAINT guilds_pk PRIMARY KEY, channel_id BIGINT NOT NULL, active BOOLEAN DEFAULT TRUE NOT NULL, launches BOOLEAN DEFAULT TRUE NOT NULL, apod BOOLEAN DEFAULT TRUE NOT NULL, events BOOLEAN DEFAULT false NOT NULL ); ALTER TABLE astra.guilds OWNER TO CURRENT_USER; CREATE UNIQUE INDEX IF NOT EXISTS guilds_guild_id_uindex ON astra.guilds (guild_id);
<reponame>dbrtly/ra_data_warehouse {% macro results_values(results) %} {% for res in results -%} {% if loop.index > 1 %},{% endif %} ('{{ res.node.alias }}', '{{ res.status }}', case when '{{ res.status }}' like 'CREATE TABLE%' or '{{ res.status }}' like 'MERGE%' then {% if target.type == 'bigquery' %} safe_cast(replace(split('{{ res.status }}','(')[OFFSET(1)],')','') as numeric) {% elif target.type == 'snowflake' %} try_cast(replace(split_part('{{ res.status }}','(',2),')','') as numeric) {% else %} {{ exceptions.raise_compiler_error(target.type ~" not supported in this project") }} {% endif %} else 0 end, {{ res.execution_time }}, {{ dbt_utils.current_timestamp() }}) {% endfor %} {% endmacro %}
CREATE TABLE merged_life_expectancy AS (SELECT us_regions.State, LifeExpectancy, MinLifeExpectancyRange, MaxLifeExpectancyRange, '2010-2015' AS Period, Region, 0 AS GDP FROM cleaned_life_expectancy_2010_2015 JOIN us_regions ON us_regions.State = cleaned_life_expectancy_2010_2015.State ) UNION (SELECT us_regions.State, LifeExpectancy, MinLifeExpectancyRange, MaxLifeExpectancyRange, '2018' AS Period, Region, Year2018 AS GDP FROM cleaned_life_expectancy_2018 JOIN us_regions ON us_regions.State = cleaned_life_expectancy_2018.State INNER JOIN us_gdp ON us_gdp.County = cleaned_life_expectancy_2018.State WHERE Year2018 > 100000000 )
INSERT INTO Book(title, pages) VALUES ('title0', 0); INSERT INTO Book(title, pages) VALUES ('title1', 1); INSERT INTO Book(title, pages) VALUES ('title2', 2); INSERT INTO Book(title, pages) VALUES ('title3', 3); INSERT INTO Book(title, pages) VALUES ('title4', 4); INSERT INTO Book(title, pages) VALUES ('title5', 5); INSERT INTO Book(title, pages) VALUES ('title6', 6); INSERT INTO Book(title, pages) VALUES ('title7', 7);
<reponame>jp7492code/multiple-linear-regression CREATE TABLE demandFor2015Minus AS SELECT substr(Year,7,4) AS Year, EducationalAttainment, sum(PopulationCount) AS Demand FROM 'CA_Educational_Attainment___Personal_Income_2008-2014' GROUP BY Year,EducationalAttainment
<reponame>filippovdenis/pg_gatherer select extract(epoch from now())::int - (extract(epoch from now())::int % $1);
INSERT INTO waffle_flag_mkt (name, everyone, percent, superusers, staff, authenticated, rollout, testing, languages, note, created, modified) VALUES ('android-payments', 0, NULL, 0, 0, 0, 0, 0, '', 'ON: paid apps for Android can be submitted and show up in search results; OFF: paid apps for Android are disallowed and show up nowhere', NOW(), NOW());
--+ holdcas on; drop table if exists t1; drop table if exists t2; create table t1(a varchar, b int, c int, d int, e int, f int, g int, h int); insert into t1 values(repeat('a',300),1,1,1,1,1,1,1); create index i_t1_all on t1(a,b,c,d,e,f,g,h); select /*+ INDEX_LS */ a from t1 where c>0 group by a; insert into t1 values(repeat('b',300),2,2,2,2,2,2,2); insert into t1 values(repeat('b',300),2,2,2,2,2,2,2); select /*+ INDEX_LS */ DISTINCT a from t1 where c>0 group by a desc,c,b desc having a > 'aaa' order by a limit 1; create table t2(i1 int,s1 string); insert into t2 values(1,repeat('a',300)); select /*+ INDEX_LS ORDERED */ t1.a,t1.c from t2 inner join t1 on t2.s1=t1.a and t2.i1=t1.c where t1.c>0 group by t1.a,t1.c; drop t1; drop t2; drop table if exists t3; create table t3(id int, a varchar, b int, c int, d int, e int, f int, g int, h int, primary key(id, a)) PARTITION BY RANGE (a) ( PARTITION before_m VALUES LESS THAN ('m'), PARTITION before_r VALUES LESS THAN ('r'), PARTITION before_w VALUES LESS THAN ('w') ); insert into t3 values(1,repeat('a',300),1,1,1,1,1,1,1); insert into t3 values(2,repeat('o',300),2,2,2,2,2,2,2); insert into t3 values(3,repeat('u',300),3,3,3,3,3,3,3); create unique index i_t1_all on t3(a,b,c,d,e,f,g,h); select /*+ INDEX_LS */ a from t3__p__before_m where c>0 group by a; create index i_t3_all2 on t3(a,b,c,f); select /*+ INDEX_LS */ distinct a,b,c from t3 where c>0 group by a using index i_t3_all2 order by 1; drop t3; --+ holdcas off;
# up create table if not exists `task_log` ( `id` bigint(20) unsigned not null, `version` int(11) not null, `create_time` datetime null, `update_time` datetime null, `delete_time` datetime null, `result` varchar(200) null, `task_id` bigint(20) unsigned not null, `snap_task_robot_url` varchar(1000) null, `snap_task_message` varchar(200) null, primary key (`id`), index`fk_task_idx` (`delete_time`) ) engine = innodb default charset = utf8; # down drop table `task_log`;
<gh_stars>0 INSERT INTO burger (burger_name) VALUES ('Double Quarter Pounder'); INSERT INTO burger (burger_name) VALUES ('Macaroni and Cheese Burger'); INSERT INTO burger (burger_name, devoured) VALUES ('Sushi Burger', true); INSERT INTO burger (burger_name) VALUES ('Chicken Bacon Ranch Burger'); INSERT INTO burger (burger_name) VALUES ('Black Bean Veggie Burger'); INSERT INTO burger (burger_name) VALUES ('Escargot Burger with Sesame Shell Bun');
<reponame>Hubbitus/sql -- Extended version http://stackoverflow.com/questions/25413303/how-to-list-files-in-a-folder-from-inside-postgres/37903171#37903171 -- Unfortunately that variant only allow use hardcoded path -- To use user parameter we will use dynamic EXECUTE. -- Return also file size and allow filtering -- -- @param path text. Filesystem path for read to -- @param filter text (default null meaning return all). Where condition to filter files. F.e.: $$filename LIKE '0%'$$ -- @param sort text (default filename). -- -- Examples of use: -- 1) Simple call, return all files, sort by filename: -- SELECT * FROM ls_files_extended('/pg_xlog.archive') -- 2) Return all, sort by filesize: -- SELECT * FROM ls_files_extended('/pg_xlog.archive', null, 'size ASC') -- 3) Use filtering and sorting: -- SELECT * FROM ls_files_extended('/pg_xlog.archive', 'filename LIKE ''0%''', 'size ASC') -- or use $-quoting for easy readability: -- SELECT * FROM ls_files_extended('/pg_xlog.archive', $$filename LIKE '0%'$$, 'size ASC') CREATE OR REPLACE FUNCTION ls_files_extended(path text, filter text default null, sort text default 'filename') RETURNS TABLE(filename text, size bigint) AS $BODY$ BEGIN SET client_min_messages TO WARNING; DROP TABLE IF EXISTS __tmp_files; -- That require to call that function twice in transaction (in one query) CREATE TEMP TABLE __tmp_files(filename text, size bigint) ON COMMIT DROP; EXECUTE format($$COPY __tmp_files FROM PROGRAM 'find %s -maxdepth 1 -type f -printf "%%f\t%%s\n"'$$, path); RETURN QUERY EXECUTE format($$SELECT * FROM __tmp_files WHERE %s ORDER BY %s $$, concat_ws(' AND ', 'true', filter), sort); END; $BODY$ LANGUAGE plpgsql SECURITY DEFINER;
<reponame>binhminh10/binhminh10.github.io -- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Máy chủ: localhost -- Thời gian đã tạo: Th5 08, 2018 lúc 03:09 AM -- Phiên bản máy phục vụ: 5.7.21-log -- Phiên bản PHP: 7.2.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Cơ sở dữ liệu: `ecommerce` -- -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `admin` -- CREATE TABLE `admin` ( `admin_id` int(11) NOT NULL, `user_name` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `name` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `admin` -- INSERT INTO `admin` (`admin_id`, `user_name`, `password`, `name`) VALUES (6, 'admin', '<PASSWORD>', '<PASSWORD>'); -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `ordertable` -- CREATE TABLE `ordertable` ( `order_id` int(11) NOT NULL, `transaction_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `quantity` int(11) NOT NULL, `status` bit(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `ordertable` -- INSERT INTO `ordertable` (`order_id`, `transaction_id`, `product_id`, `quantity`, `status`) VALUES (1, 1, 7, 3, b'1'); -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `product` -- CREATE TABLE `product` ( `product_id` int(11) NOT NULL, `product_name` varchar(100) NOT NULL, `company` varchar(255) NOT NULL, `category_id` int(11) NOT NULL, `price` int(11) NOT NULL, `discount` int(11) NOT NULL, `image` varchar(200) NOT NULL, `intro` text NOT NULL, `quantity` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `product` -- INSERT INTO `product` (`product_id`, `product_name`, `company`, `category_id`, `price`, `discount`, `image`, `intro`, `quantity`) VALUES (6, 'Nồi cơm SHD8601', 'Sun House', 9, 400000, 3, 'Fileupload/product/CookSunhouse.jpg', 'Mặt hàng bán chạy nhất cho sinh viên', 34), (7, 'Bếp nướng không khói thông minh', 'Sun House', 10, 1000000, 2, 'Fileupload/product/29462_19881_lau-nuong-dien-sunhouse-shd4650.jpg', 'Mặt hàng bán chạy nhất cho các căn hộ cao cấp', 34), (8, 'Bếp nướng SHD4607', 'Kangaru', 6, 2000000, 10, 'Fileupload/product/bep-nuong-khong-khoi-Electric-barbecue-grill-2000W-1.jpg', 'Mặt hàng bán chạy nhất cho các gia đình', 54), (9, 'Bếp nướng điện KG189G', 'Kangaru', 6, 2000000, 3, 'Fileupload/product/Bep-nuong-than-hoa-10.jpg', 'Mặt hàng bán chạy nhất cho các khu trọ', 23), (10, 'Bếp nướng không khói thông minh', 'Eton', 5, 1000000, 4, 'Fileupload/product/chien-thuc-an-2.jpg', 'Mặt hàng bán chạy nhất cho các khu trọ', 34), (11, 'Ấm điện SK-1800', 'Eton', 10, 1000000, 2, 'Fileupload/product/d794dc5757847671e156e622af8eb4b6.jpg', 'Mặt hàng bán chạy nhất cho các khu trọ', 23), (12, 'Nồi chiên không khói NC-1234', 'Magic', 10, 5000000, 4, 'Fileupload/product/noi-chien-khong-dau-perfect-usa-3l-new-den-4405-4920505-d13eb84e1c1cc1a04a254fd6fae60961-catalog_233.jpg', 'Mặt hàng bán chạy nhất cho các gia đình', 34), (13, 'Bộ nồi chống dính N-2325', 'Aoran', 5, 1000000, 3, 'Fileupload/product/b1-0.jpg', 'Mặt hàng bán chạy nhất cho các nhà hàng', 23), (14, 'Bếp chiên BC-23832', 'Aoran', 6, 5000000, 2, 'Fileupload/product/6d04ff5e665106e34fa47ba22af4da60.jpg', 'Mặt hàng bán chạy nhất cho các nhà hàng', 45); -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `productcategory` -- CREATE TABLE `productcategory` ( `category_id` int(11) NOT NULL, `category_name` varchar(100) NOT NULL, `parent_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `productcategory` -- INSERT INTO `productcategory` (`category_id`, `category_name`, `parent_id`) VALUES (1, 'Điện gia dụng nhà bếp', 0), (4, 'Chảo', 1), (5, 'Đồ dùng nhà bếp', 1), (6, 'Đồ nướng', 1), (7, 'Máy say, trộn, nghiền', 1), (8, 'Bát, đĩa', 1), (9, 'Nồi cơm điện', 1), (10, 'Thiết bị nấu ăn gia đình', 1); -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `transaction` -- CREATE TABLE `transaction` ( `transaction_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `money_amount` int(11) NOT NULL, `create_date` date NOT NULL, `status` bit(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `transaction` -- INSERT INTO `transaction` (`transaction_id`, `user_id`, `money_amount`, `create_date`, `status`) VALUES (1, 3, 500000, '2018-05-07', b'0'); -- -------------------------------------------------------- -- -- Cấu trúc bảng cho bảng `user` -- CREATE TABLE `user` ( `user_id` int(11) NOT NULL, `user_name` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `email` varchar(200) NOT NULL, `phone_number` varchar(20) NOT NULL, `address` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf16; -- -- Đang đổ dữ liệu cho bảng `user` -- INSERT INTO `user` (`user_id`, `user_name`, `password`, `email`, `phone_number`, `address`) VALUES (3, 'BinhMinhs10', '123456', '<EMAIL>', '01667351997', 'Bách khoa , Hà Nội'), (4, 'admin', '1234', '<EMAIL>', '0166735345', 'Bách khoa , Hà Nội'); -- -- Chỉ mục cho các bảng đã đổ -- -- -- Chỉ mục cho bảng `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`admin_id`), ADD UNIQUE KEY `user_name` (`user_name`); -- -- Chỉ mục cho bảng `ordertable` -- ALTER TABLE `ordertable` ADD PRIMARY KEY (`order_id`), ADD KEY `product_id` (`product_id`), ADD KEY `transaction_id` (`transaction_id`); -- -- Chỉ mục cho bảng `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`product_id`), ADD KEY `category_id` (`category_id`); -- -- Chỉ mục cho bảng `productcategory` -- ALTER TABLE `productcategory` ADD PRIMARY KEY (`category_id`); -- -- Chỉ mục cho bảng `transaction` -- ALTER TABLE `transaction` ADD PRIMARY KEY (`transaction_id`), ADD KEY `user_id` (`user_id`); -- -- Chỉ mục cho bảng `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`user_id`); -- -- AUTO_INCREMENT cho các bảng đã đổ -- -- -- AUTO_INCREMENT cho bảng `admin` -- ALTER TABLE `admin` MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT cho bảng `ordertable` -- ALTER TABLE `ordertable` MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT cho bảng `product` -- ALTER TABLE `product` MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT cho bảng `productcategory` -- ALTER TABLE `productcategory` MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT cho bảng `transaction` -- ALTER TABLE `transaction` MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT cho bảng `user` -- ALTER TABLE `user` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Các ràng buộc cho các bảng đã đổ -- -- -- Các ràng buộc cho bảng `ordertable` -- ALTER TABLE `ordertable` ADD CONSTRAINT `ordertable_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `transaction` (`transaction_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `ordertable_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Các ràng buộc cho bảng `product` -- ALTER TABLE `product` ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `productcategory` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Các ràng buộc cho bảng `transaction` -- ALTER TABLE `transaction` ADD CONSTRAINT `transaction_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<reponame>bbogin/sr2s<gh_stars>0 -- Table: a30_event -- DROP TABLE a30_event; CREATE TABLE a30_event ( event_id serial NOT NULL, project_idref integer NOT NULL DEFAULT 0, "name" character varying(64) NOT NULL DEFAULT 'new task'::character varying, description character varying(256) NOT NULL DEFAULT 'new task'::character varying, budget numeric NOT NULL DEFAULT 0.00, inactive_asof date, "timestamp" timestamp without time zone DEFAULT timezone('UTC'::text, now()), -- Time is UTC, alias GMT, alias Greenwich Mean Time CONSTRAINT event_Key PRIMARY KEY (event_id) ) WITH ( OIDS=FALSE ); ALTER TABLE a30_event OWNER TO ts_admin; GRANT ALL ON TABLE a30_event TO ts_admin; GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE a30_event TO ts_editor; GRANT SELECT ON TABLE a30_event TO ts_reader; COMMENT ON COLUMN a30_event."timestamp" IS 'Time is UTC, alias GMT, alias Greenwich Mean Time'; GRANT UPDATE ON TABLE a30_event_event_id_seq TO ts_editor; -- Table: b10_eventlog -- DROP TABLE b10_eventlog; CREATE TABLE b10_eventlog ( eventlog_id serial NOT NULL, project_idref integer NOT NULL DEFAULT 0, event_idref integer NOT NULL DEFAULT 0, person_idref integer NOT NULL DEFAULT 0, account_idref integer NOT NULL DEFAULT 0, sessio_count integer NOT NULL DEFAULT 0, attendance integer NOT NULL DEFAULT 0, logdate date NOT NULL DEFAULT now(), "comments" character varying(256) NOT NULL DEFAULT ''::character varying, "timestamp" timestamp without time zone DEFAULT timezone('UTC'::text, now()), -- Time is UTC, alias GMT, alias Greenwich Mean Time CONSTRAINT eventlog_Key PRIMARY KEY (eventlog_id) ) WITH ( OIDS=FALSE ); ALTER TABLE b10_eventlog OWNER TO ts_admin; GRANT ALL ON TABLE b10_eventlog TO ts_admin; GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE b10_eventlog TO ts_editor; GRANT SELECT ON TABLE b10_eventlog TO ts_reader; COMMENT ON COLUMN b10_eventlog."timestamp" IS 'Time is UTC, alias GMT, alias Greenwich Mean Time'; GRANT UPDATE ON TABLE b10_eventlog_eventlog_id_seq TO ts_editor;
\echo Check that virtual fields are not defined for inserting / updating SELECT * FROM analysis.meta_data_all_inconsistent_insert_update_validation(); \echo Check that virtual fields are not pointing to an invalid table select * from analysis.meta_data_pointers_to_wrong_table( 'to_deb_primary', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_primary', 'cf_contra', 'jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'to_deb_contra', ARRAY[ 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_primary', 'cf_contra', 'jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'to_cre_primary', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_primary', 'cf_contra', 'jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'to_cre_contra', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_contra', 'cf_primary', 'cf_contra', 'jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'cf_primary', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_contra', 'jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'cf_contra', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_contra','jnl']) union select * from analysis.meta_data_pointers_to_wrong_table( 'jnl', ARRAY['to_deb_primary', 'to_deb_contra', 'to_cre_primary', 'to_cre_contra', 'cf_primary', 'cf_contra' ])
DROP TABLE Project; DROP TABLE Testimonial; DROP TABLE BlogPostLocation; DROP TABLE BlogPostTag; DROP TABLE BlogPost; DROP TABLE CarouselItem; DROP TABLE Category; DROP TABLE Author; DROP TABLE Tag; DROP TABLE [Location]; DROP TABLE ContentHtml; DROP TABLE ContentText; DROP TABLE Faq; DROP TABLE MailingList; DROP TABLE RoleClaim; DROP TABLE UserRole; DROP TABLE UserClaim; DROP TABLE UserLogin; DROP TABLE [Role]; DROP TABLE [User]; DROP TABLE __EFMigrationsHistory; DROP TABLE __MigrationHistory; DROP TABLE [HangFire].[Schema]; DROP TABLE [HangFire].[State]; DROP TABLE [HangFire].[JobParameter]; DROP TABLE [HangFire].[Job]; DROP TABLE [HangFire].[JobQueue]; DROP TABLE [HangFire].[Server]; DROP TABLE [HangFire].[List]; DROP TABLE [HangFire].[Set]; DROP TABLE [HangFire].[Counter]; DROP TABLE [HangFire].[Hash]; DROP TABLE [HangFire].[AggregatedCounter];
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jan 11, 2021 at 03:04 PM -- Server version: 5.7.24 -- PHP Version: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `rs-pemkot` -- -- -------------------------------------------------------- -- -- Table structure for table `ms_pasien` -- CREATE TABLE `ms_pasien` ( `ID` int(11) NOT NULL, `nik` int(11) NOT NULL, `nama_lengkap` varchar(225) NOT NULL, `jenis_kelamin` varchar(50) NOT NULL, `kelas` int(11) NOT NULL, `tarif_biaya` int(11) NOT NULL, `jumlah_hari` int(11) NOT NULL, `total_tagihan` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ms_pasien` -- INSERT INTO `ms_pasien` (`ID`, `nik`, `nama_lengkap`, `jenis_kelamin`, `kelas`, `tarif_biaya`, `jumlah_hari`, `total_tagihan`) VALUES (5, 2147483647, '<NAME>', 'Laki - Laki', 2, 234000, 4, 936000), (7, 2147483647, 'Raharjo', 'Laki - Laki', 2, 450000, 3, 1350000); -- -------------------------------------------------------- -- -- Table structure for table `ms_user` -- CREATE TABLE `ms_user` ( `id` int(11) NOT NULL, `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL, `role_id` int(11) NOT NULL, `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `provinsi` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `kabupaten` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `kecamatan` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `kelurahan` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `is_deleted` int(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `ms_user` -- INSERT INTO `ms_user` (`id`, `email`, `password`, `role_id`, `name`, `created_date`, `provinsi`, `kabupaten`, `kecamatan`, `kelurahan`, `is_deleted`) VALUES (1, '<EMAIL>', '<PASSWORD>', 1, 'admin', '2021-01-11 12:22:50', '', 'KOTA AMBON', '', '', 0), (4, '<EMAIL>', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 2, 'tono', '2020-07-11 16:07:44', 'MALUKU', 'KOTA AMBON', 'LEITIMUR SELATAN', 'NAKU', 0), (5, '<EMAIL>', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 2, 'tedt', '2020-07-19 17:00:00', 'J<NAME>', '<NAME>', 'SIDOREJO', 'SUMBERSAWIT', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `ms_pasien` -- ALTER TABLE `ms_pasien` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `ms_user` -- ALTER TABLE `ms_user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `ms_pasien` -- ALTER TABLE `ms_pasien` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `ms_user` -- ALTER TABLE `ms_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;