sql
stringlengths
6
1.05M
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 10-04-2019 a las 17:08:27 -- Versión del servidor: 10.1.37-MariaDB -- Versión de PHP: 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `mobiles` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `links` -- CREATE TABLE `links` ( `id` bigint(20) UNSIGNED NOT NULL, `mobile_id` bigint(20) UNSIGNED NOT NULL, `n_opinion` int(11) NOT NULL, `opinion_web` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `opinion_url` 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; -- -- Volcado de datos para la tabla `links` -- INSERT INTO `links` (`id`, `mobile_id`, `n_opinion`, `opinion_web`, `opinion_url`, `created_at`, `updated_at`) VALUES (1, 1, 6, 'Phonehouse', 'https://www.phonehouse.es/movil/samsung/galaxy-s9/opiniones.html', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, 2, 48, 'Phonehouse', 'https://www.phonehouse.es/movil/sony/xperia-z3/opiniones.html', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (3, 2, 35, 'Amazon', 'https://www.amazon.es/Sony-Xperia-Smartphone-Snapdragon-importado/product-reviews/B00N9O8C2M/ref=dpx_acr_txt?showViewpoints=1', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (4, 3, 94, 'Amazon', 'https://www.amazon.es/Xiaomi-Pro-Smartphone-Snapdragon-Transparente/product-reviews/B07KMFZCQT/ref=dpx_acr_txt?showViewpoints=1', '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (39, '2014_10_12_000000_create_users_table', 1), (40, '2014_10_12_100000_create_password_resets_table', 1), (41, '2019_04_01_092933_create_ranges_table', 1), (42, '2019_04_02_201732_create_mobiles_table', 1), (43, '2019_04_02_201755_create_links_table', 1), (44, '2019_04_09_093854_create_roles_table', 1), (45, '2019_04_09_094156_create_role_user_table', 1), (46, '2016_06_01_000001_create_oauth_auth_codes_table', 2), (47, '2016_06_01_000002_create_oauth_access_tokens_table', 2), (48, '2016_06_01_000003_create_oauth_refresh_tokens_table', 2), (49, '2016_06_01_000004_create_oauth_clients_table', 2), (50, '2016_06_01_000005_create_oauth_personal_access_clients_table', 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `mobiles` -- CREATE TABLE `mobiles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `valuation` int(11) NOT NULL, `range_id` bigint(20) UNSIGNED NOT NULL, `url_photo` 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; -- -- Volcado de datos para la tabla `mobiles` -- INSERT INTO `mobiles` (`id`, `name`, `valuation`, `range_id`, `url_photo`, `created_at`, `updated_at`) VALUES (1, 'Samsung S9', 8, 1, 'https://image.samsung.com/latin/smartphones/galaxy-s9/shop/buyingtool/product/product_galaxys9_lilacpurple_01.png', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, 'Sony Xperia Z23', 7, 2, 'https://www.androidcentral.com/sites/androidcentral.com/files/styles/xlarge/public/article_images/2018/08/sony-xperia-xz3-render-3.png?itok=uv1pUZ7c', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (3, 'Xiaomi Mi Pro 8', 9, 3, 'https://i.ebayimg.com/images/g/u8MAAOSw2jNbquwo/s-l300.png', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (4, 'Huawei Mate 20', 9, 3, 'https://www.androidforyou.es/pub/media/catalog/product/cache/e4d64343b1bc593f1c5348fe05efa4a6/t/h/thumb_163010_default_big_1.png', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (5, 'LeEco Le Pro 3 X722', 8, 3, 'https://lifesconfession.com/phonitek/wp-content/uploads/leeco-le-max-2-dorado-1.png', '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oauth_access_tokens` -- CREATE TABLE `oauth_access_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(11) DEFAULT NULL, `client_id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `scopes` text COLLATE utf8mb4_unicode_ci, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oauth_auth_codes` -- CREATE TABLE `oauth_auth_codes` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(11) NOT NULL, `client_id` int(10) UNSIGNED NOT NULL, `scopes` text COLLATE utf8mb4_unicode_ci, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oauth_clients` -- CREATE TABLE `oauth_clients` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(11) DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `secret` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL, `personal_access_client` tinyint(1) NOT NULL, `password_client` tinyint(1) NOT NULL, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `oauth_clients` -- INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES (1, NULL, 'Laravel Personal Access Client', 'AEWkXkq3RietOAyrp3TWqphnPPL0iDwvtwi4pqXM', 'http://localhost', 1, 0, 0, '2019-04-10 12:47:09', '2019-04-10 12:47:09'), (2, NULL, 'Laravel Password Grant Client', 'kU6VfjNitOMevGLm7EOsq3YjL4wZJxbqLKN0Ahmv', 'http://localhost', 0, 1, 0, '2019-04-10 12:47:09', '2019-04-10 12:47:09'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oauth_personal_access_clients` -- CREATE TABLE `oauth_personal_access_clients` ( `id` int(10) UNSIGNED NOT NULL, `client_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `oauth_personal_access_clients` -- INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES (1, 1, '2019-04-10 12:47:09', '2019-04-10 12:47:09'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `oauth_refresh_tokens` -- CREATE TABLE `oauth_refresh_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ranges` -- CREATE TABLE `ranges` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `ranges` -- INSERT INTO `ranges` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, '0-10', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, '10-50', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (3, '50-100', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (4, '100-1000', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (5, '>1000', '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `roles` -- CREATE TABLE `roles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `roles` -- INSERT INTO `roles` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES (1, 'admin', 'Administrator', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, 'user', 'User', '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `role_user` -- CREATE TABLE `role_user` ( `id` bigint(20) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `role_user` -- INSERT INTO `role_user` (`id`, `role_id`, `user_id`, `created_at`, `updated_at`) VALUES (1, 1, 1, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, 2, 1, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (3, 2, 2, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (4, 2, 3, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (5, 2, 4, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (6, 2, 5, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (7, 2, 6, '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (8, 2, 7, '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'dextroyer', '<EMAIL>', '2019-04-09 13:28:31', <PASSWORD>', '58nZEx5N7EU23hfxItSNpeG4s1O8XJJGVSMc79NX7I0eUgp6C8ieNvc4mKn0', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (2, 'asier', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$lTdRKZf1TQtdEV8xp6QObeFRAFqQS067WEnaxyXK5A/EIxEM048sS', 'NViumFkoSndIPwSAX3hFmn40kvDPV3pvtDqXjvirHGTvUF6hxJrw0sp2VQRh', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (3, '<NAME>', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$dQn17UO1xJxCvm.mGqbN8u97e1BVR/7RBe/Xfiq9RYotnvl3lJKXy', 'mtRRYCphcI', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (4, 'Dr. <NAME>', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$Lb9OpZA4mSr8XFGkK9D8nePmw6.idVP.3em2uyLdX.ehk8o0RRuu6', 'l3rkTLtqFR', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (5, '<NAME>', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$apHtoVEijN0d75TU.S9pleqIMs51zYQK1nDQorlN7DN6IGfszm/c2', 'tfr7KTHh0p', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (6, '<NAME>', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$l55tmyrWMkXj34cLj6uCC.xFQ.bb0C.AwZODZa8ZrJ7fqt9ELEADq', 'ovXFXagkWO', '2019-04-09 13:28:31', '2019-04-09 13:28:31'), (7, '<NAME>', '<EMAIL>', '2019-04-09 13:28:31', '$2y$10$YsixfhplrtI8F3rMYwguG.64Edn26PedpIxMWS1UI9DohftlrwDqi', '5lUnWifZyr', '2019-04-09 13:28:31', '2019-04-09 13:28:31'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `links` -- ALTER TABLE `links` ADD PRIMARY KEY (`id`), ADD KEY `links_mobile_id_foreign` (`mobile_id`); -- -- Indices de la tabla `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `mobiles` -- ALTER TABLE `mobiles` ADD PRIMARY KEY (`id`), ADD KEY `mobiles_range_id_foreign` (`range_id`); -- -- Indices de la tabla `oauth_access_tokens` -- ALTER TABLE `oauth_access_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_access_tokens_user_id_index` (`user_id`); -- -- Indices de la tabla `oauth_auth_codes` -- ALTER TABLE `oauth_auth_codes` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `oauth_clients` -- ALTER TABLE `oauth_clients` ADD PRIMARY KEY (`id`), ADD KEY `oauth_clients_user_id_index` (`user_id`); -- -- Indices de la tabla `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` ADD PRIMARY KEY (`id`), ADD KEY `oauth_personal_access_clients_client_id_index` (`client_id`); -- -- Indices de la tabla `oauth_refresh_tokens` -- ALTER TABLE `oauth_refresh_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`); -- -- Indices de la tabla `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indices de la tabla `ranges` -- ALTER TABLE `ranges` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `role_user` -- ALTER TABLE `role_user` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `links` -- ALTER TABLE `links` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT de la tabla `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51; -- -- AUTO_INCREMENT de la tabla `mobiles` -- ALTER TABLE `mobiles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `oauth_clients` -- ALTER TABLE `oauth_clients` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `ranges` -- ALTER TABLE `ranges` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `roles` -- ALTER TABLE `roles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `role_user` -- ALTER TABLE `role_user` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT de la tabla `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `links` -- ALTER TABLE `links` ADD CONSTRAINT `links_mobile_id_foreign` FOREIGN KEY (`mobile_id`) REFERENCES `mobiles` (`id`) ON DELETE CASCADE; -- -- Filtros para la tabla `mobiles` -- ALTER TABLE `mobiles` ADD CONSTRAINT `mobiles_range_id_foreign` FOREIGN KEY (`range_id`) REFERENCES `ranges` (`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 */;
create index uta_test_suite_i1 on uta_test_suite (uta_test_run_id) ;
<gh_stars>0 (02) USE SoftUni (DATABASE) SELECT * FROM Departments (03) SELECT Name FROM Departments (04) SELECT FirstName, LastName, Salary FROM Employees (05) SELECT FirstName, MiddleName, LastName FROM Employees (06) SELECT FirstName + '.'+ LastName+'@soft<EMAIL>' as 'Full Email Address' FROM Employees (07) SELECT Distinct Salary FROM Employees (08) SELECT * FROM Employees WHERE JobTitle='Sales Representative' (09) SELECT FirstName, LastName, JobTitle FROM Employees WHERE Salary BETWEEN 20000 AND 30000 (10) SELECT FirstName + ' ' + MiddleName + ' ' + LastName AS 'Full Name' FROM Employees WHERE Salary=25000 OR Salary=14000 OR Salary=12500 OR Salary=23600 (11) SELECT FirstName, LastName FROM Employees WHERE ManagerID IS NULL (12) SELECT FirstName, LastName, Salary FROM Employees WHERE Salary>50000 ORDER BY Salary DESC (13) SELECT TOP(5) FirstName, LastName FROM Employees ORDER BY Salary DESC (14) SELECT FirstName, LastName FROM Employees WHERE DepartmentID!=4 (15) SELECT * FROM Employees ORDER BY Salary DESC, FirstName, LastName DESC, MiddleName (16) CREATE VIEW V_EmployeesSalaries AS SELECT FirstName, LastName, Salary FROM Employees (17) CREATE VIEW V_EmployeeNameJobTitle AS SELECT FirstName + ' ' + ISNULL (MiddleName, '') + ' ' + LastName AS [Full Name], JobTitle AS [Job Title] FROM Employees (18) SELECT DISTINCT JobTitle FROM Employees (19) SELECT TOP (10) * FROM Projects ORDER BY StartDate, Name (20) SELECT TOP (7) FirstName, LastName, HireDate FROM Employees ORDER BY HireDate DESC (21) UPDATE Employees SET Salary= Salary * 1.12 WHERE DepartmentID IN (1,2,4,11) SELECT Salary FROM Employees (22) All Mountain Peaks USE Geography (DATABASE) SELECT PeakName FROM Peaks ORDER BY PeakName (23) SELECT TOP (30) CountryName, Population FROM Countries WHERE ContinentCode = 'EU' ORDER BY Population DESC, CountryName (24) SELECT CountryName, CountryCode, CASE CurrencyCode WHEN 'EUR' THEN 'Euro' ELSE 'Not Euro' END AS Currency FROM Countries ORDER BY CountryName (25) USE Diablo (DATABASE) SELECT Name FROM Characters ORDER BY Name
USE SoftUni GO --01.Employee Address SELECT TOP (5) e.EmployeeID, e.JobTitle, e.AddressID, a.AddressText FROM Employees AS e JOIN Addresses AS a ON a.AddressID = e.AddressID ORDER BY e.AddressID GO --02.Addresses with Towns SELECT TOP (50) e.FirstName, e.LastName, t.[Name] AS Town, a.AddressText FROM Employees AS e JOIN Addresses AS a ON a.AddressID = e.AddressID JOIN Towns AS t ON t.TownID = a.TownID ORDER BY e.FirstName ASC, e.LastName ASC GO --03.Sales Employee SELECT e.EmployeeID, e.FirstName, e.LastName, d.[Name] AS DepartmentName FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID AND d.[Name] = 'Sales' ORDER BY e.EmployeeID GO --04.Employee Departments SELECT TOP (5) e.EmployeeID, e.FirstName, e.Salary, d.[Name] AS DepartmentName FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID AND e.Salary > 15000 ORDER BY d.DepartmentID GO --05.Employees Without Project SELECT TOP (3) emp.EmployeeID, emp.FirstName FROM Employees AS emp LEFT JOIN EmployeesProjects AS empPr ON empPr.EmployeeID = emp.EmployeeID WHERE empPr.EmployeeID IS NULL ORDER BY emp.EmployeeID GO --06.Employees Hired After SELECT e.FirstName, e.LastName, e.HireDate, d.[Name] AS DeptName FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID WHERE e.HireDate > '01/01/1999' AND d.[Name] = 'Sales' OR d.[Name] = 'Finance' ORDER BY e.HireDate --07.Employees with Project SELECT TOP (5) emp.EmployeeID, emp.FirstName, p.[Name] AS ProjectName FROM Employees AS emp LEFT JOIN EmployeesProjects AS empPr ON empPr.EmployeeID = emp.EmployeeID INNER JOIN Projects AS p ON p.ProjectID = empPr.ProjectID WHERE empPr.EmployeeID IS NOT NULL AND p.StartDate > '08/13/2002' AND p.EndDate IS NULL ORDER BY emp.EmployeeID GO --08.Employee 24 SELECT e.EmployeeID, e.FirstName, ProjectName = CASE WHEN p.StartDate >= '01/01/2005' THEN NULL ELSE p.[Name] END FROM EmployeesProjects AS ep JOIN Employees AS e ON e.EmployeeID = ep.EmployeeID JOIN Projects AS p ON p.ProjectID = ep.ProjectID WHERE ep.EmployeeID = 24 GO --09.Employee Manager SELECT e.EmployeeID, e.FirstName, e.ManagerID, m.FirstName AS ManagerName FROM Employees AS e JOIN Employees AS m ON m.EmployeeID = e.ManagerID WHERE e.ManagerID IN (3, 7) ORDER BY e.EmployeeID GO --10.Employee Summary SELECT TOP (50) e.EmployeeID, e.FirstName + ' ' + e.LastName AS EmployeeName, m.FirstName + ' ' + m.LastName AS ManagerName, d.[Name] AS DepartmentName FROM Employees AS e JOIN Employees AS m ON m.EmployeeID = e.ManagerID JOIN Departments AS d ON d.DepartmentID = e.DepartmentID ORDER BY e.EmployeeID GO --11.Min Average Salary SELECT MIN(AvgSalary) AS MinAverageSalary FROM ( SELECT AVG(Salary) AS AvgSalary FROM Employees GROUP BY DepartmentID ) AS AvgSalaries --12.Highest Peaks in Bulgaria USE Geography GO SELECT mc.CountryCode, m.MountainRange, p.PeakName, p.Elevation FROM MountainsCountries AS mc JOIN Mountains AS m ON m.Id = mc.MountainId JOIN Peaks AS p ON p.MountainId = mc.MountainId WHERE mc.CountryCode = 'BG' AND p.Elevation > 2835 ORDER BY p.Elevation DESC GO --13.Count Mountain Ranges SELECT mc.CountryCode, COUNT(MountainRange) AS MountainRanges FROM MountainsCountries AS mc JOIN Mountains AS m ON m.Id = mc.MountainId WHERE mc.CountryCode IN ('BG', 'RU', 'US') GROUP BY mc.CountryCode GO --14.Countries with Rivers SELECT TOP (5) c.CountryName, r.RiverName FROM Countries AS c LEFT JOIN CountriesRivers AS cr ON cr.CountryCode = c.CountryCode LEFT JOIN Rivers AS r ON r.Id = cr.RiverId WHERE c.ContinentCode = 'AF' ORDER BY c.CountryName GO --15.Continents and Currencies WITH CTE_CurrencyCounted (ContinentCode, CurrencyCode, CurrencyUsage) AS ( SELECT ContinentCode, CurrencyCode, COUNT(CurrencyCode) AS CurrencyUsage FROM Countries GROUP BY ContinentCode, CurrencyCode HAVING COUNT(CurrencyCode) > 1 ) SELECT cci.ContinentCode, cci.CurrencyCode, MaxCurrencies.MaxCurrency FROM ( SELECT ContinentCode, MAX(CurrencyUsage) AS MaxCurrency FROM CTE_CurrencyCounted GROUP BY ContinentCode ) AS MaxCurrencies JOIN CTE_CurrencyCounted AS cci ON cci.ContinentCode = MaxCurrencies.ContinentCode AND cci.CurrencyUsage = MaxCurrencies.MaxCurrency ORDER BY cci.ContinentCode GO --16.Countries without any Mountains SELECT COUNT (*) AS CountryCode FROM Countries AS c LEFT JOIN MountainsCountries AS mc ON mc.CountryCode = c.CountryCode WHERE mc.MountainId IS NULL --17.Highest Peak and Longest River by Country SELECT TOP(5) c.CountryName, MAX(p.Elevation) AS HighestPeakElevation, MAX(r.[Length]) AS LongestRiverLength FROM Countries AS c LEFT JOIN MountainsCountries AS mc ON mc.CountryCode = c.CountryCode LEFT JOIN Peaks AS p ON p.MountainId = mc.MountainId LEFT JOIN CountriesRivers AS cr ON cr.CountryCode = c.CountryCode LEFT JOIN Rivers AS r ON r.Id = cr.RiverId GROUP BY c.CountryName ORDER BY MAX(p.Elevation) DESC, MAX(r.[Length]) DESC, c.CountryName ASC GO --18.Highest Peak Name and Elevation by Country WITH CTE_MaxElevation(CountryName, PeakName, Elevation, MountainRange) AS ( SELECT c.CountryName, p.PeakName, MAX(p.Elevation) AS [Highest Peak Elevation], m.MountainRange FROM Countries AS c LEFT JOIN MountainsCountries AS mc ON mc.CountryCode = c.CountryCode LEFT JOIN Mountains AS m ON m.Id = mc.MountainId LEFT JOIN Peaks AS p ON p.MountainId = mc.MountainId GROUP BY c.CountryName, p.PeakName, m.MountainRange ) SELECT TOP (5) MaxElevations.CountryName, ISNULL(cci.PeakName, '(no highest peak)') AS [Highest Peak Name], ISNULL(MaxElevations.MaxElevation, '0') AS [Highest Peak Elevation], ISNULL(cci.MountainRange, '(no mountain)') AS [Mountain] FROM ( SELECT CountryName, MAX(Elevation) AS MaxElevation FROM CTE_MaxElevation GROUP BY CountryName ) AS MaxElevations LEFT JOIN CTE_MaxElevation AS cci ON cci.Elevation = MaxElevations.MaxElevation AND cci.CountryName = MaxElevations.CountryName ORDER BY MaxElevations.CountryName, cci.PeakName GO
DROP TABLE schedule, routes, stops, days; CREATE TABLE days ( id VARCHAR(7) NOT NULL PRIMARY KEY, title VARCHAR(100) NOT NULL ); CREATE TABLE stops ( id VARCHAR(10) NOT NULL PRIMARY KEY, title VARCHAR(50) NOT NULL ); CREATE TABLE routes ( id VARCHAR(10) NOT NULL PRIMARY KEY, title VARCHAR(50) NOT NULL ); CREATE TABLE schedule ( time TIME, route VARCHAR(10) REFERENCES routes (id), stop VARCHAR(10) REFERENCES stops (id), days VARCHAR(7) REFERENCES days (id) ); SELECT schedule.time, stops.title, routes.title, days.title FROM schedule JOIN stops ON schedule.stop = stops.id JOIN routes ON schedule.route = routes.id JOIN days ON schedule.days = days.id WHERE stop = '88a' AND time >= '10:00' AND time <= '12:50' AND days = '12345' ORDER BY time FETCH FIRST 20 ROW ONLY;
/* Indices ------- Un índice puede ser creado en una tabla para encontrar data más rápida y eficientemente. Los usuarios no pueden ver los índices, ellos solamente sienten las mejoras para hacer búsquedas y consultas. Nota: Realizar una actualización a una tabla indexada toma más tiempo que actualizar una tabla sin índices. Por lo tanto, se deben crear índices en columnas y tablas que son frecuentemente consultadas. Sintaxis: CREATE UNIQUE INDEX nombre_indice ON nombre_tabla (nombre_columna); */ /* ---------------------- | cliente | ---------------------- | id INT PK | | nombre VARCHAR(50) | ---------------------- */ CREATE TABLE cliente ( id INT PRIMARY KEY, nombre VARCHAR(50) NOT NULL ); CREATE UNIQUE INDEX nombreIndice ON cliente(nombre);
CREATE TABLE src_tab_16 ( col_1 INT AUTO_INCREMENT, col_2 VARCHAR(255) NOT NULL, col_3 DATE, col_4 DATE, col_5 TINYINT NOT NULL, col_6 TINYINT NOT NULL, col_7 TEXT, PRIMARY KEY (col_1) );
set sql_mode = "no_auto_value_on_zero"; set autocommit = 0; start transaction; set time_zone = "+00:00"; create table `administrador` ( `senha` int(10) default null, `login` varchar(100) default null, `codigo` int not null primary key AUTO_INCREMENT ) engine=innodb default charset=latin1; create table `aluno` ( `periodo` int(3) default null, `cod_disciplina` int(10) default null, `codigo` int not null primary key AUTO_INCREMENT, `nome_completo` varchar(250) default null, `matricula` int(10) default null, `e_mail` varchar(50) default null, `situacao` varchar(20) default null, `ano` int(11) not null, `curso` varchar(20) not null, `telefone` int(11) not null ) engine=innodb default charset=latin1; create table `curso` ( `nome` varchar(50) default null, `codigo` int not null primary key AUTO_INCREMENT, `fk_administrador_codigo` int(10) default null ) engine=innodb default charset=latin1; -- - create table `disciplina` ( `nome` varchar(50) default null, `codigo` int not null primary key AUTO_INCREMENT, `fk_cod_curso` int default null ) engine=innodb default charset=latin1; create table `professor` ( `nome` varchar(250) default null, `telefone` int(15) default null, `siape` int(10) default null, `e_mail` varchar(250) default null, `codigo` int not null primary key AUTO_INCREMENT ) engine=innodb default charset=latin1; create table `professor_disciplina` ( `fk_professor_codigo` int default null, `fk_disciplina_codigo` int default null ) engine=innodb default charset=latin1; -- -- limitadores para a tabela `curso` -- alter table `curso` add constraint `fk_curso_2` foreign key (`fk_administrador_codigo`) references `administrador` (`codigo`); -- -- limitadores para a tabela `disciplina` -- alter table `disciplina` add constraint `fk_disciplina_1` foreign key (`fk_cod_curso`) references `curso` (`codigo`) ; -- -- limitadores para a tabela `professor_disciplina` -- alter table `professor_disciplina` add constraint `fk_professor_disciplina_1` foreign key (`fk_professor_codigo`) references `professor` (`codigo`), add constraint `fk_professor_disciplina_2` foreign key (`fk_disciplina_codigo`) references `disciplina` (`codigo`) on delete set null; 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>Miscellaneous/StoredProcedures/Backup_2015 March 24/threeGetUpgradeBlendedDiscountCasesByStatus.sql -- ============================================= -- Author: <NAME> -- Create date: 07/05/2013 -- Description: Gets all blended discount cases that have a certain status. -- ============================================= CREATE PROCEDURE [dbo].[threeGetUpgradeBlendedDiscountCasesByStatus] ( @status INT ) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; SELECT threeUpgradeBlendedDiscountCase.id, companyName, createdDate, parentBAN, ISNULL(u1.userName, 'unknown') AS userName, CASE WHEN threeUpgradeBlendedDiscountCaseLock.id IS NOT NULL THEN 1 ELSE 0 END AS locked, ISNULL(u2.userName, 'unknown') AS lockedByUserName, threeUpgradeBlendedDiscountCaseLock.createDate as lockedDate FROM threeUpgradeBlendedDiscountCase LEFT JOIN smApplicationUsers u1 ON u1.userId = threeUpgradeBlendedDiscountCase.userSubmitted LEFT JOIN threeUpgradeBlendedDiscountCaseLock ON threeUpgradeBlendedDiscountCaseLock.caseId = threeUpgradeBlendedDiscountCase.id LEFT JOIN smApplicationUsers u2 ON u2.userId = threeUpgradeBlendedDiscountCaseLock.userId WHERE [status] = @status END GRANT EXECUTE ON threeGetUpgradeBlendedDiscountCasesByStatus TO b4nuser GO
<reponame>Alejandro-sin/Learning_Notebooks -- Generar rangos SELECT * -- FROM generate_series(1,4); --Empieza en 5 y deciende en -2 unidades --FROM generate_series(5,1, -2); --FROM generate_series(3.1,4.9, 0.1); --Current_date -- Genero una tabla s con una sola columa a Uso la fecha actual para sumarle el numero de días. al sumar. SELECT current_date + s.a AS dates FROM generate_series(0,14,7) AS s(a) -- Creo un rango de fechas -- Los dobles dos puntos significa un casteo. -- El paso lo quiero de 10 horas, Postegres intuye 10 hours como 10 horas SELECT * FROM generate_series('2020-09-01 00:00:00' ::timestamp,'2020-09-04 12:00:00','10 hours'); -- Un caso de generate series con datos reales. SELECT alumnos.id, alumnos.nombre, alumnos.apellido, alumnos.carrera_id, series.alumnos FROM public.alumnos AS alumnos INNER JOIN generate_series(0,10) AS series(alumnos) ON series.alumnos = alumnos.carrera_id ORDER BY alumnos.carrera_id
<filename>100CodeExamples/utplsql/21_utplsql_thanksogb_force_manual_rollback.sql /* We sometimes have the situation that we need to test functions and don't exactly know all the details of its internals. This is the setup part */ create table deathstar_rooms ( id integer generated by default on null as identity primary key, name varchar2(200) not null, code varchar2(200) not null unique ); insert into deathstar_rooms ( name, code ) values ( 'Engine Room 1', 'ENG1' ); insert into deathstar_rooms ( name, code ) values ( 'Vaders Chamber', 'VADER' ); insert into deathstar_rooms ( name, code ) values ( 'Bridge', 'BRIDGE' ); insert into deathstar_rooms ( name, code ) values ( 'Prison 1', 'PRISON1' ); create table room_inventory ( id integer generated by default on null as identity primary key, room_id integer not null, item varchar2(400) not null, nr_in_room integer, constraint room_inventory_fk_room foreign key ( room_id ) references deathstar_rooms (id) ); /* We add some nasty trigger mechanic to the inventory table. Dont do this in production, there are far better ways to get to the same result */ create or replace trigger trg_set_nr_in_room before insert or update on room_inventory for each row begin if ( inserting or (updating and :old.room_id <> :new.room_id)) then declare l_max_nr integer; begin select max(nr_in_room) into l_max_nr from room_inventory where room_id = :new.room_id; :new.nr_in_room := nvl(l_max_nr,0)+1; end; end if; end; / /* We have a room_util-package that we only know from the outside */ create or replace package room_util as subtype varchar2_nn is varchar2 not null; procedure add_item( i_item_name in varchar2_nn, i_room_code in varchar2_nn); end; / create or replace package body room_util as procedure add_item( i_item_name in varchar2_nn, i_room_code in varchar2_nn) as begin insert into room_inventory ( room_id, item ) values ( (select id from deathstar_rooms where code = i_room_code), i_item_name ); end; end; / /* Now lets explore the ADD_ITEM functionality through tests */ create or replace package ut_room_inventory as -- %suite(Room Inventory) -- %beforeall procedure setup_test_room; -- %test(Add a new item to the inventory of a room) procedure add_item; end; / create or replace package body ut_room_inventory as /* Just add a test-room we can rely on */ procedure setup_test_room as begin insert into deathstar_rooms ( id, name, code ) values ( -1, 'Secret Test chamber', 'TEST'); end; procedure add_item as begin -- Lets just add some things and evaluate what we -- should even test for room_util.add_item('Light saber (red)', 'TEST'); room_util.add_item('Light saber (blue)', 'TEST'); room_util.add_item('Light saber (green)', 'TEST'); end; end; / /* Now call ut.run with the a_force_manual_rollback parameter */ begin ut.run(a_path=>'ut_room_inventory', a_force_manual_rollback=>true); end; / /* You can now find out what to test for */ select * from deathstar_rooms; select * from room_inventory where room_id < 0; /* Important! Dont forget to rollback */ rollback; select * from room_inventory; /* Now we can implement our actual test */ create or replace package body ut_room_inventory as /* Just add a test-room we can rely on */ procedure setup_test_room as begin insert into deathstar_rooms ( id, name, code ) values ( -1, 'Secret Test chamber', 'TEST'); end; procedure add_item as c_actual sys_refcursor; c_expect sys_refcursor; begin room_util.add_item('Light saber (red)', 'TEST'); room_util.add_item('Light saber (blue)', 'TEST'); room_util.add_item('Light saber (green)', 'TEST'); open c_actual for select item, nr_in_room from room_inventory where room_id = -1 order by id; open c_expect for select 'Light saber (red)' item, 1 nr_in_room from dual union all select 'Light saber (blue)' , 2 from dual union all select 'Light saber (green)' , 3 from dual; ut.expect(c_actual).to_equal(c_expect); end; end; / /* We now have a test for the functionality and can start to refactor */ call ut.run('ut_room_inventory');
DROP TABLE IF EXISTS listens;
{{ config( materialized = 'incremental', incremental_strategy = 'insert_overwrite', partition_by = {'field': 'date', 'data_type': 'date'} ) }} with covid_cases as ( SELECT date, country_name, subregion1_name, sum(coalesce(new_confirmed, 0)) as new_confirmed, sum(coalesce(new_deceased,0)) as new_deceased, sum(coalesce(new_recovered,0)) as new_recovered, sum(coalesce(new_tested,0)) as new_tested FROM {{ ref('stg_covid19_cases') }} {% if is_incremental() %} where date >= "{{ var('ds') }}" {% endif %} GROUP BY date, country_name, subregion1_name ) select * from covid_cases
<reponame>jdkoren/sqlite-parser -- triggerC.test -- -- execsql { -- CREATE TABLE log(t); -- CREATE TABLE t4(a TEXT,b INTEGER,c REAL); -- CREATE TRIGGER t4bi BEFORE INSERT ON t4 BEGIN -- INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || -- new.a || ' ' || typeof(new.a) || ' ' || -- new.b || ' ' || typeof(new.b) || ' ' || -- new.c || ' ' || typeof(new.c) -- ); -- END; -- CREATE TRIGGER t4ai AFTER INSERT ON t4 BEGIN -- INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || -- new.a || ' ' || typeof(new.a) || ' ' || -- new.b || ' ' || typeof(new.b) || ' ' || -- new.c || ' ' || typeof(new.c) -- ); -- END; -- CREATE TRIGGER t4bd BEFORE DELETE ON t4 BEGIN -- INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || -- old.a || ' ' || typeof(old.a) || ' ' || -- old.b || ' ' || typeof(old.b) || ' ' || -- old.c || ' ' || typeof(old.c) -- ); -- END; -- CREATE TRIGGER t4ad AFTER DELETE ON t4 BEGIN -- INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || -- old.a || ' ' || typeof(old.a) || ' ' || -- old.b || ' ' || typeof(old.b) || ' ' || -- old.c || ' ' || typeof(old.c) -- ); -- END; -- CREATE TRIGGER t4bu BEFORE UPDATE ON t4 BEGIN -- INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || -- old.a || ' ' || typeof(old.a) || ' ' || -- old.b || ' ' || typeof(old.b) || ' ' || -- old.c || ' ' || typeof(old.c) -- ); -- INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || -- new.a || ' ' || typeof(new.a) || ' ' || -- new.b || ' ' || typeof(new.b) || ' ' || -- new.c || ' ' || typeof(new.c) -- ); -- END; -- CREATE TRIGGER t4au AFTER UPDATE ON t4 BEGIN -- INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || -- old.a || ' ' || typeof(old.a) || ' ' || -- old.b || ' ' || typeof(old.b) || ' ' || -- old.c || ' ' || typeof(old.c) -- ); -- INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || -- new.a || ' ' || typeof(new.a) || ' ' || -- new.b || ' ' || typeof(new.b) || ' ' || -- new.c || ' ' || typeof(new.c) -- ); -- END; -- } CREATE TABLE log(t); CREATE TABLE t4(a TEXT,b INTEGER,c REAL); CREATE TRIGGER t4bi BEFORE INSERT ON t4 BEGIN INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || new.a || ' ' || typeof(new.a) || ' ' || new.b || ' ' || typeof(new.b) || ' ' || new.c || ' ' || typeof(new.c) ); END; CREATE TRIGGER t4ai AFTER INSERT ON t4 BEGIN INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || new.a || ' ' || typeof(new.a) || ' ' || new.b || ' ' || typeof(new.b) || ' ' || new.c || ' ' || typeof(new.c) ); END; CREATE TRIGGER t4bd BEFORE DELETE ON t4 BEGIN INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || old.a || ' ' || typeof(old.a) || ' ' || old.b || ' ' || typeof(old.b) || ' ' || old.c || ' ' || typeof(old.c) ); END; CREATE TRIGGER t4ad AFTER DELETE ON t4 BEGIN INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || old.a || ' ' || typeof(old.a) || ' ' || old.b || ' ' || typeof(old.b) || ' ' || old.c || ' ' || typeof(old.c) ); END; CREATE TRIGGER t4bu BEFORE UPDATE ON t4 BEGIN INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || old.a || ' ' || typeof(old.a) || ' ' || old.b || ' ' || typeof(old.b) || ' ' || old.c || ' ' || typeof(old.c) ); INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || new.a || ' ' || typeof(new.a) || ' ' || new.b || ' ' || typeof(new.b) || ' ' || new.c || ' ' || typeof(new.c) ); END; CREATE TRIGGER t4au AFTER UPDATE ON t4 BEGIN INSERT INTO log VALUES(old.rowid || ' ' || typeof(old.rowid) || ' ' || old.a || ' ' || typeof(old.a) || ' ' || old.b || ' ' || typeof(old.b) || ' ' || old.c || ' ' || typeof(old.c) ); INSERT INTO log VALUES(new.rowid || ' ' || typeof(new.rowid) || ' ' || new.a || ' ' || typeof(new.a) || ' ' || new.b || ' ' || typeof(new.b) || ' ' || new.c || ' ' || typeof(new.c) ); END;
<reponame>Shuttl-Tech/antlr_psql -- file:functional_deps.sql ln:109 expect:true CREATE TEMP TABLE node ( nid SERIAL, vid integer NOT NULL default '0', type varchar(32) NOT NULL default '', title varchar(128) NOT NULL default '', uid integer NOT NULL default '0', status integer NOT NULL default '1', created integer NOT NULL default '0', PRIMARY KEY (nid, vid) )
<filename>migrations/0107.sql DELETE FROM shopping_list WHERE shopping_list_id NOT IN (SELECT id FROM shopping_lists); CREATE TRIGGER remove_items_from_deleted_shopping_list AFTER DELETE ON shopping_lists BEGIN DELETE FROM shopping_list WHERE shopping_list_id = OLD.id; END; CREATE TRIGGER prevent_infinite_nested_recipes_INS BEFORE INSERT ON recipes_nestings BEGIN SELECT CASE WHEN(( SELECT 1 FROM recipes_nestings_resolved rnr WHERE NEW.recipe_id = rnr.includes_recipe_id AND NEW.includes_recipe_id = rnr.recipe_id ) NOTNULL) THEN RAISE(ABORT, "Recursive nested recipe detected") END; END; CREATE TRIGGER prevent_infinite_nested_recipes_UPD BEFORE UPDATE ON recipes_nestings BEGIN SELECT CASE WHEN(( SELECT 1 FROM recipes_nestings_resolved rnr WHERE NEW.recipe_id = rnr.includes_recipe_id AND NEW.includes_recipe_id = rnr.recipe_id ) NOTNULL) THEN RAISE(ABORT, "Recursive nested recipe detected") END; END;
-- 2021-05-18T16:38:42.053Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,579191,0,'C_BPartner_Caregiver_ID',TO_TIMESTAMP('2021-05-18 19:38:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.healthcare.alberta','Y','Caregiver','Caregiver',TO_TIMESTAMP('2021-05-18 19:38:41','YYYY-MM-DD HH24:MI:SS'),100) ; -- 2021-05-18T16:38:42.056Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=579191 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) ; -- 2021-05-18T16:39:07.674Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FacetFilterSeqNo,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutoApplyValidationRule,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsFacetFilter,IsForceIncludeInGeneratedModel,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsShowFilterIncrementButtons,IsShowFilterInline,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,MaxFacetsToFetch,Name,SelectionColumnSeqNo,SeqNo,Updated,UpdatedBy,Version) VALUES (0,573921,579191,0,18,540042,541645,'C_BPartner_Caregiver_ID',TO_TIMESTAMP('2021-05-18 19:39:07','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.vertical.healthcare.alberta',0,10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N',0,'Caregiver',0,0,TO_TIMESTAMP('2021-05-18 19:39:07','YYYY-MM-DD HH24:MI:SS'),100,0) ; -- 2021-05-18T16:39:07.679Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Column_ID=573921 AND NOT EXISTS (SELECT 1 FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) ; -- 2021-05-18T16:39:07.691Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ select update_Column_Translation_From_AD_Element(579191) ; -- 2021-05-18T16:39:08.954Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator /* DDL */ SELECT public.db_alter_table('C_BPartner_AlbertaCareGiver','ALTER TABLE public.C_BPartner_AlbertaCareGiver ADD COLUMN C_BPartner_Caregiver_ID NUMERIC(10)') ; -- 2021-05-18T16:39:08.964Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator ALTER TABLE C_BPartner_AlbertaCareGiver ADD CONSTRAINT CBPartnerCaregiver_CBPartnerAlbertaCareGiver FOREIGN KEY (C_BPartner_Caregiver_ID) REFERENCES public.C_BPartner DEFERRABLE INITIALLY DEFERRED ;
/* Consecutive Available Seats Problem Description LeetCode Problem 603. Several friends at a cinema ticket office would like to reserve consecutive available seats. Can you help to query all the consecutive available seats order by the seat_id using the following cinema table? | seat_id | free | |---------|------| | 1 | 1 | | 2 | 0 | | 3 | 1 | | 4 | 1 | | 5 | 1 | Your query should return the following result for the sample case above. | seat_id | |---------| | 3 | | 4 | | 5 | Note: The seat_id is an auto increment int, and free is bool (‘1’ means free, and ‘0’ means occupied.). Consecutive available seats are more than 2(inclusive) seats consecutively available. */ # V0 ### NOTE `select c1.seat_id from cinema c1, cinema c2` is a CROSS JOIN ### above syntax is same as `select c1.seat_id from cinema c1 cross join cinema c2 # ref : https://github.com/yennanliu/CS_basics/blob/master/doc/faq/faq_sql.md#31-explain-cross-join- select c1.seat_id from cinema c1, cinema c2 where ((c1.seat_id = c2.seat_id+1) or (c1.seat_id = c2.seat_id-1)) and (c1.free = 1) and (c2.free = 1) group by c1.seat_id # V1 # https://circlecoder.com/consecutive-available-seats/ select c1.seat_id from cinema c1, cinema c2 where ((c1.seat_id = c2.seat_id+1) or (c1.seat_id = c2.seat_id-1)) and (c1.free = 1) and (c2.free = 1) group by c1.seat_id # V2
<gh_stars>0 -- sketch of what it needs -- Datahike already uses a k-v datastore schema CREATE TABLE IF NOT EXISTS tuple ( entity text UNIQUE, reln text NOT NULL, val text NOT NULL, txid timestamp NOT NULL, "added" boolean DEFAULT true, PRIMARY KEY (lox, reln, val) ); -- GRANT ALL PRIVILEGES ON tuple TO ??; CREATE INDEX IF NOT EXISTS tuple_idx ON tuple (entity, reln, val);
ALTER TABLE DeliveredBabyApgarScore ADD CONSTRAINT FK_DeliveredBabyApgarScore_DeliveredBabyBirthInformation_Id FOREIGN KEY(DeliveredBabyBirthInformationId) REFERENCES DeliveredBabyBirthInformation(Id)
<gh_stars>1-10 ALTER TABLE PUB_PARAM ADD CHECK (CODE IS NOT NULL); ALTER TABLE PUB_PARAM ADD PRIMARY KEY (CODE);
<gh_stars>1-10 CREATE TYPE custom_enum AS ENUM ( 'ENABLED', 'DISABLED' ); CREATE TABLE test ( uuid UUID PRIMARY KEY, string TEXT, instant TIMESTAMP WITH TIME ZONE, int INT, big_decimal NUMERIC(10, 4), custom_enum CUSTOM_ENUM, string_enum TEXT, custom_value_object TEXT );
CREATE TABLE statuses ( id TEXT NOT NULL PRIMARY KEY, codebase_id TEXT NOT NULL, commit_id TEXT NOT NULL, title TEXT NOT NULL, description TEXT, type TEXT NOT NULL, timestamp TIMESTAMP NOT NULL ); CREATE INDEX statuses_commit_id_codebase_id_ix ON statuses (commit_id, codebase_id); CREATE INDEX statuses_commit_id_codebase_id_title_timestamp_ix ON statuses (commit_id, codebase_id, title, timestamp DESC);
<filename>services/db/init/schema/007-order-items.sql create table if not exists order_items ( order_id uuid references orders(order_id), item_id uuid references items(item_id), quantity numeric not null default 1, primary key (order_id, item_id) ); grant select, insert, update, delete on table order_items to project_app; grant select on table order_items to project_read;
alter table player drop column suffix
DELIMITER $$ CREATE PROCEDURE `udp_send_message`(`user_id` INT(11), `chat_id` INT(11), `content` VARCHAR(200)) BEGIN INSERT INTO `messages`(`content`, `sent_on`, `chat_id`, `user_id`) VALUES(`content`, '2016-12-15', `chat_id`, `user_id`); IF (`user_id` NOT IN(SELECT m.`user_id` FROM `messages` AS m)) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'There is no chat with that user!'; ROLLBACK; END IF; END$$ DELIMITER ;
<filename>prisma/migrations/20210618070438_message_read/migration.sql -- AlterTable ALTER TABLE "Message" ADD COLUMN "read" BOOLEAN NOT NULL DEFAULT false;
<gh_stars>0 CREATE TABLE #States ([Id] INT IDENTITY(1, 1), StateName NVARCHAR(30) NOT NULL ); CREATE TABLE #Airports ([Id] INT IDENTITY(1, 1), IATACode CHAR(3) NOT NULL ); CREATE TABLE #StateAirports (StateId INT PRIMARY KEY NOT NULL, Airports NVARCHAR(50) ); INSERT INTO #States(StateName) VALUES('Illinois'), ('New York'), ('Pennsylvania'); INSERT INTO #Airports(IATACode) VALUES('ALB'), ('SYR'), ('JFK'), ('LGA'), ('ROC'), ('BUF'); INSERT INTO #Airports(IATACode) VALUES('MDW'), ('ORD'); INSERT INTO #Airports(IATACode) VALUES('PIT'), ('PHL'); INSERT INTO #StateAirports (StateId, Airports ) VALUES (1, '7,8' ), (2, '1,2,3,4,5,6' ), (3, '9,10' ); SELECT * FROM #States; SELECT * FROM #Airports; SELECT * FROM #StateAirports; SELECT s.statename, a.iatacode FROM #StateAirports SA1 CROSS APPLY string_split(SA1.airports, ',') AS SA2 JOIN #Airports A ON A.Id = SA2.value JOIN #states S ON S.Id = SA1.stateid; DROP TABLE #states; DROP TABLE #Airports; DROP TABLE #StateAirports;
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: May 07, 2020 at 05:08 AM -- Server version: 5.7.24 -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ppdb_sma` -- -- -------------------------------------------------------- -- -- Table structure for table `data_berkas` -- CREATE TABLE `data_berkas` ( `id_data_berkas` int(11) NOT NULL, `id_user` int(11) NOT NULL, `nilai_indo` varchar(3) NOT NULL, `nilai_ing` varchar(3) NOT NULL, `matematika` varchar(3) NOT NULL, `ipa` varchar(3) NOT NULL, `foto_ijasah_smp` varchar(255) NOT NULL, `foto_shun` varchar(255) NOT NULL, `berkas_created` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `data_diri_pribadi` -- CREATE TABLE `data_diri_pribadi` ( `id_data_diri_pribadi` int(11) NOT NULL, `id_user` int(11) NOT NULL, `username` varchar(12) NOT NULL, `nama` varchar(40) NOT NULL, `tempat_lahir` varchar(20) NOT NULL, `tanggal_lahir` date NOT NULL, `agama` varchar(10) NOT NULL, `kelamin` char(1) NOT NULL, `alamat` text NOT NULL, `telp` varchar(16) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `data_diri_sekolah` -- CREATE TABLE `data_diri_sekolah` ( `id_data_diri_sekolah` int(11) NOT NULL, `id_user` int(11) NOT NULL, `asal_sekolah` varchar(40) NOT NULL, `nisn` varchar(14) NOT NULL, `tahun_lulus` year(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `data_ortu` -- CREATE TABLE `data_ortu` ( `id_data_ortu` int(11) NOT NULL, `id_user` int(11) NOT NULL, `nama_ortu` varchar(40) NOT NULL, `pekerjaan` varchar(25) NOT NULL, `alamat_ortu` text NOT NULL, `telp_ortu` varchar(16) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `data_qrcode` -- CREATE TABLE `data_qrcode` ( `id_data_qrcode` int(11) NOT NULL, `id_user` int(11) NOT NULL, `token` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `env_agenda` -- CREATE TABLE `env_agenda` ( `env_agenda_id` int(11) NOT NULL, `agenda` text NOT NULL, `tapel` varchar(10) NOT NULL, `foto_daftar_ulang` varchar(255) NOT NULL, `foto_bg` varchar(255) NOT NULL, `aktif` int(1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `env_agenda` -- INSERT INTO `env_agenda` (`env_agenda_id`, `agenda`, `tapel`, `foto_daftar_ulang`, `foto_bg`, `aktif`) VALUES (1, 'Gelombang 1 : \r\n29 April 2020 - 29 Mei 2020\r\n\r\nGelombang 2 : \r\n30 Mei 2020 - 30 Juni 2020', '2020/2021', 'admin_ppdb_2019.jpg', 'bg_login.jpg', 1); -- -------------------------------------------------------- -- -- Table structure for table `env_kontak_admin` -- CREATE TABLE `env_kontak_admin` ( `env_kontak_id` int(11) NOT NULL, `nama_kontak` varchar(40) NOT NULL, `nomor_kontak` varchar(16) NOT NULL, `email_admin` varchar(50) NOT NULL, `alamat_admin` text NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `env_kontak_admin` -- INSERT INTO `env_kontak_admin` (`env_kontak_id`, `nama_kontak`, `nomor_kontak`, `email_admin`, `alamat_admin`) VALUES (1, '<NAME>.', '089695615257', '<EMAIL>', 'Jl. Stadion Lama, Kemiri, Kec. Sidoarjo, Kabupaten Sidoarjo, Jawa Timur 61237'); -- -------------------------------------------------------- -- -- Table structure for table `env_pembayaran` -- CREATE TABLE `env_pembayaran` ( `env_pembayaran_id` int(11) NOT NULL, `nama_bank` varchar(10) NOT NULL, `jml_uang` varchar(8) NOT NULL, `rekening` varchar(40) NOT NULL, `atas_nama` varchar(40) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `env_pembayaran` -- INSERT INTO `env_pembayaran` (`env_pembayaran_id`, `nama_bank`, `jml_uang`, `rekening`, `atas_nama`) VALUES (1, 'BRI', '50.000', '16108010022002', 'Ade Setya'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `user_id` int(11) NOT NULL, `nama` varchar(40) NOT NULL, `username` varchar(12) NOT NULL, `password` varchar(100) NOT NULL, `image` varchar(128) NOT NULL, `level` int(1) NOT NULL COMMENT '1: admin, 2: user', `is_active` int(1) NOT NULL COMMENT '0: nonaktif, 1: aktif', `date_created` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`user_id`, `nama`, `username`, `password`, `image`, `level`, `is_active`, `date_created`) VALUES (1, 'admin', 'admin', <PASSWORD>', 'admin/shipit.png', 1, 1, '2020-04-02 18:33:34'); -- -------------------------------------------------------- -- -- Table structure for table `user_daftar` -- CREATE TABLE `user_daftar` ( `id_user_daftar` int(11) NOT NULL, `id_user` int(11) NOT NULL, `telp` varchar(16) NOT NULL, `email` varchar(50) DEFAULT NULL, `foto_bukti_transfer` varchar(255) NOT NULL, `status` int(1) NOT NULL COMMENT '1: dikonfirmasi, 2: ditolak', `daftar_created` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `data_berkas` -- ALTER TABLE `data_berkas` ADD PRIMARY KEY (`id_data_berkas`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `data_diri_pribadi` -- ALTER TABLE `data_diri_pribadi` ADD PRIMARY KEY (`id_data_diri_pribadi`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `data_diri_sekolah` -- ALTER TABLE `data_diri_sekolah` ADD PRIMARY KEY (`id_data_diri_sekolah`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `data_ortu` -- ALTER TABLE `data_ortu` ADD PRIMARY KEY (`id_data_ortu`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `data_qrcode` -- ALTER TABLE `data_qrcode` ADD PRIMARY KEY (`id_data_qrcode`), ADD UNIQUE KEY `id_user_2` (`id_user`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `env_agenda` -- ALTER TABLE `env_agenda` ADD PRIMARY KEY (`env_agenda_id`); -- -- Indexes for table `env_kontak_admin` -- ALTER TABLE `env_kontak_admin` ADD PRIMARY KEY (`env_kontak_id`); -- -- Indexes for table `env_pembayaran` -- ALTER TABLE `env_pembayaran` ADD PRIMARY KEY (`env_pembayaran_id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`user_id`); -- -- Indexes for table `user_daftar` -- ALTER TABLE `user_daftar` ADD PRIMARY KEY (`id_user_daftar`), ADD KEY `id_user` (`id_user`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `data_berkas` -- ALTER TABLE `data_berkas` MODIFY `id_data_berkas` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `data_diri_pribadi` -- ALTER TABLE `data_diri_pribadi` MODIFY `id_data_diri_pribadi` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `data_diri_sekolah` -- ALTER TABLE `data_diri_sekolah` MODIFY `id_data_diri_sekolah` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `data_ortu` -- ALTER TABLE `data_ortu` MODIFY `id_data_ortu` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `data_qrcode` -- ALTER TABLE `data_qrcode` MODIFY `id_data_qrcode` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `env_agenda` -- ALTER TABLE `env_agenda` MODIFY `env_agenda_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `env_kontak_admin` -- ALTER TABLE `env_kontak_admin` MODIFY `env_kontak_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `env_pembayaran` -- ALTER TABLE `env_pembayaran` MODIFY `env_pembayaran_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user_daftar` -- ALTER TABLE `user_daftar` MODIFY `id_user_daftar` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `data_berkas` -- ALTER TABLE `data_berkas` ADD CONSTRAINT `data_berkas_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; -- -- Constraints for table `data_diri_pribadi` -- ALTER TABLE `data_diri_pribadi` ADD CONSTRAINT `data_diri_pribadi_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; -- -- Constraints for table `data_diri_sekolah` -- ALTER TABLE `data_diri_sekolah` ADD CONSTRAINT `data_diri_sekolah_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; -- -- Constraints for table `data_ortu` -- ALTER TABLE `data_ortu` ADD CONSTRAINT `data_ortu_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; -- -- Constraints for table `data_qrcode` -- ALTER TABLE `data_qrcode` ADD CONSTRAINT `data_qrcode_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; -- -- Constraints for table `user_daftar` -- ALTER TABLE `user_daftar` ADD CONSTRAINT `user_daftar_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE NO ACTION; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<filename>latest/tSQLt.Edge/Private/tSQLt.Private_GetType.sql CREATE FUNCTION tSQLt.Private_GetType (@TypeId INT, @Length INT, @Precision INT, @Scale INT, @CollationName NVARCHAR(MAX)) RETURNS NVARCHAR(MAX) AS BEGIN RETURN ( SELECT CONCAT ( tSQLt.Private_GetTypeName(@TypeId), CASE WHEN @Length = -1 AND TYPE_NAME(@TypeId) IN ('nchar', 'nvarchar', 'char', 'varchar', 'binary', 'varbinary') THEN '(max)' WHEN TYPE_NAME(@TypeId) IN ('nchar', 'nvarchar') THEN CONCAT('(', @Length / 2, ')') WHEN TYPE_NAME(@TypeId) IN ('char', 'varchar', 'binary', 'varbinary') THEN CONCAT('(', @Length, ')') WHEN TYPE_NAME(@TypeId) IN ('decimal', 'numeric') THEN CONCAT('(', @Precision, ',', @Scale, ')') WHEN TYPE_NAME(@TypeId) IN ('datetime2', 'datetimeoffset', 'time') THEN CONCAT('(', @Scale, ')') ELSE '' END, CASE WHEN @CollationName IS NOT NULL AND CONVERT(NVARCHAR(MAX), DATABASEPROPERTYEX(DB_NAME(), 'Collation')) <> ISNULL(@CollationName, '') THEN CONCAT(' COLLATE ', @CollationName) ELSE '' END ) ); END; GO
rename table finished_order_detail to detail_finished_order;
<reponame>carrotflakes/alp -- Your SQL goes here CREATE TABLE user_rooms ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES users(id), room_id INTEGER NOT NULL REFERENCES rooms(id), UNIQUE (user_id, room_id) );
CREATE USER 'oozie'@'localhost' IDENTIFIED BY 'oozie'; GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'localhost'; CREATE DATABASE oozie; CREATE USER 'nutch'@'localhost' IDENTIFIED BY 'nutch'; GRANT ALL PRIVILEGES ON *.* TO 'nutch'@'localhost'; CREATE DATABASE nutch;
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : lun. 18 jan. 2021 à 15:27 -- Version du serveur : 5.7.24 -- Version de PHP : 7.2.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `forum` -- -- -------------------------------------------------------- -- -- Structure de la table `aime` -- DROP TABLE IF EXISTS `aime`; CREATE TABLE IF NOT EXISTS `aime` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_message` int(11) NOT NULL, `id_user` int(11) NOT NULL, `aime` tinyint(1) NOT NULL, `pas_aime` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `aime` -- INSERT INTO `aime` (`id`, `id_message`, `id_user`, `aime`, `pas_aime`) VALUES (1, 2, 1, 1, 0), (2, 7, 1, 0, 1); -- -------------------------------------------------------- -- -- Structure de la table `conversations` -- DROP TABLE IF EXISTS `conversations`; CREATE TABLE IF NOT EXISTS `conversations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_topic` int(11) NOT NULL, `date_creation` datetime NOT NULL, `sujet` varchar(255) NOT NULL, `id_createur` int(11) NOT NULL, `id_visibilite` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `conversations` -- INSERT INTO `conversations` (`id`, `id_topic`, `date_creation`, `sujet`, `id_createur`, `id_visibilite`) VALUES (1, 1, '2021-01-18 15:32:55', 'La balise head ', 3, 0), (2, 2, '2021-01-18 15:35:25', 'Les id/classes ', 2, 1), (3, 2, '2021-01-18 15:37:02', 'Les media queries', 1, 1), (4, 1, '2021-01-18 15:39:41', 'La structure d\'une page ', 1, 0), (5, 3, '2021-01-18 15:41:47', 'Les boucles ', 3, 2), (6, 4, '2021-01-18 15:48:06', 'La grille bootstrap', 3, 3); -- -------------------------------------------------------- -- -- Structure de la table `messages` -- DROP TABLE IF EXISTS `messages`; CREATE TABLE IF NOT EXISTS `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_conversations` int(11) NOT NULL, `id_topic` int(11) NOT NULL, `id_posteur` int(11) NOT NULL, `date_heure_post` datetime NOT NULL, `message` text NOT NULL, `id_visibilite` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `messages` -- INSERT INTO `messages` (`id`, `id_conversations`, `id_topic`, `id_posteur`, `date_heure_post`, `message`, `id_visibilite`) VALUES (1, 1, 1, 3, '2021-01-18 15:33:28', 'Trop cool le html', 0), (2, 2, 2, 2, '2021-01-18 15:35:35', 'Vive le css', 1), (3, 1, 1, 2, '2021-01-18 15:35:51', 'Ouais grave', 0), (4, 3, 2, 1, '2021-01-18 15:37:14', 'Vive le responsive', 1), (5, 2, 2, 1, '2021-01-18 15:37:31', 'Ouais ', 1), (6, 1, 1, 1, '2021-01-18 15:38:45', 'Jelly beans icing jujubes icing. Chocolate cake pudding bonbon. Pie apple pie pudding sesame snaps jelly beans pie bear claw. 😀😀', 0), (7, 4, 1, 1, '2021-01-18 15:40:02', 'Marshmallow chocolate cookie lollipop topping macaroon liquorice dragée gummi bears.', 0), (8, 5, 3, 3, '2021-01-18 15:42:13', 'Jelly beans icing jujubes icing. Chocolate cake pudding bonbon. Pie apple pie pudding sesame snaps jelly beans pie bear claw.', 2), (9, 2, 2, 4, '2021-01-18 15:45:42', 'Trop cool', 1), (10, 6, 4, 3, '2021-01-18 15:48:27', 'Marshmallow chocolate cookie lollipop topping macaroon liquorice dragée gummi bears.', 3); -- -------------------------------------------------------- -- -- Structure de la table `topics` -- DROP TABLE IF EXISTS `topics`; CREATE TABLE IF NOT EXISTS `topics` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_createur` int(11) NOT NULL, `sujet` varchar(255) NOT NULL, `description` text NOT NULL, `date_heure_creation` datetime NOT NULL, `id_visibilite` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `topics` -- INSERT INTO `topics` (`id`, `id_createur`, `sujet`, `description`, `date_heure_creation`, `id_visibilite`) VALUES (1, 3, 'Sujet Public : Le html', 'Spiderman se met à coder', '2021-01-18 15:32:37', 0), (2, 2, 'Sujet User connecté : le css', 'Batman fait du css', '2021-01-18 15:35:02', 1), (3, 3, 'Sujet Modo : Le php', 'C\'est pas facile', '2021-01-18 15:41:33', 2), (4, 3, 'Sujet Admin : Bootstrap', 'C\'est pas clair tout ça ', '2021-01-18 15:47:43', 3); -- -------------------------------------------------------- -- -- Structure de la table `utilisateurs` -- DROP TABLE IF EXISTS `utilisateurs`; CREATE TABLE IF NOT EXISTS `utilisateurs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `login` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `nom` varchar(255) NOT NULL, `prenom` varchar(255) NOT NULL, `age` int(11) NOT NULL, `id_droit` int(11) NOT NULL, `avatar` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `utilisateurs` -- INSERT INTO `utilisateurs` (`id`, `login`, `password`, `nom`, `prenom`, `age`, `id_droit`, `avatar`) VALUES (1, 'bapt', '$2y$10$Gl7oJnEi4CazI5rx/drjFOy12Nw1aLYHaC8BEzJDHSmegrnGttAn.', 'GAUTHIER', 'Baptiste', 21, 1, 'defaut.png'), (2, 'Batman', '$2y$10$one7p3CtFkBbPTG97HcYnuqps73OZBEN1jmPqQfOXIudRNC9s4/MS', 'WAYNE', 'Bruce', 35, 2, '2.png'), (3, 'Spiderman', '$2y$10$HXwX3VIt3O0.249F9QfgKeN7gi30XjcHXBvcHHCjx7sFJv1f2lin6', 'PARKER', 'Peter', 23, 3, '3.jpg'), (4, 'John', '$2y$10$BB0bvR3Bgd9oZ4TfF4ZgJudH.wTDC33NXAsIvbN9DynFNYYEEyD92', 'Doe', 'John', 26, 1, '4.jpg'), (5, 'Iron Man', '$2y$10$eT.EP3oUw2ncm5tIIU5QwuWxmezHCMq.qYP7umUpfW05Yzj5R6MPS', 'STARK', 'Tony', 45, 3, '5.jpg'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 24, 2020 at 03:19 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.31 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: `demo_mrpbase` -- -- -------------------------------------------------------- -- -- Table structure for table `productions` -- CREATE TABLE `productions` ( `id` bigint(11) UNSIGNED NOT NULL, `order_id` int(11) DEFAULT NULL, `product_id` int(11) DEFAULT NULL, `quantity` varchar(255) DEFAULT NULL, `to_be_produced` int(11) DEFAULT NULL, `unique_id` bigint(11) DEFAULT NULL, `created_at` datetime DEFAULT current_timestamp(), `updated_at` datetime DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `productions` -- ALTER TABLE `productions` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `productions` -- ALTER TABLE `productions` MODIFY `id` bigint(11) UNSIGNED NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<filename>DBSql/24-07-2020 CREATE_avtotransport_vid.sql CREATE TABLE IF NOT EXISTS `avtotransport_vid` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Классификатор "Вид автотранспорта" для блока "Объект", если выбран вид объекта "Автотранспорт".'; -- Дамп данных таблицы speciald.avtotransport_vid: ~0 rows (приблизительно) DELETE FROM `avtotransport_vid`; /*!40000 ALTER TABLE `avtotransport_vid` DISABLE KEYS */; INSERT INTO `avtotransport_vid` (`id`, `name`) VALUES (1, 'грузовой'), (2, 'легковой');
-- -- ROLES -- IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = 'zzp_server') CREATE ROLE zzp_server GO -- -- SCHEMA -- IF SCHEMA_ID('zsystem') IS NULL EXEC sp_executesql N'CREATE SCHEMA zsystem' GO
<reponame>harsha9292/chirpstack-application-server-1<gh_stars>100-1000 create table channel_list ( id bigserial primary key, name character varying (100) not null, channels integer[] ); alter table node add column channel_list_id bigint references channel_list on delete set null; alter table application add column channel_list_id bigint references channel_list on delete set null;
-- Drop schema with all optional syntax DROP SCHEMA IF EXISTS dbname RESTRICT; DROP SCHEMA IF EXISTS dbname CASCADE; -- Drop the database and it's tables DROP SCHEMA inventory_db CASCADE; -- Drop the database using IF EXISTS DROP SCHEMA IF EXISTS inventory_db CASCADE;
/* SQLyog Professional v12.09 (64 bit) MySQL - 5.7.24-0ubuntu0.16.04.1 : Database - laravel_admin ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`laravel_admin` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `laravel_admin`; /*Table structure for table `yy_admin_log` */ DROP TABLE IF EXISTS `yy_admin_log`; CREATE TABLE `yy_admin_log` ( `id` bigint(15) unsigned NOT NULL AUTO_INCREMENT COMMENT '只增ID', `admin_id` int(11) unsigned NOT NULL COMMENT '管理员ID', `operator` varchar(64) NOT NULL COMMENT '操作者', `ip` varchar(64) NOT NULL COMMENT 'IP地址', `func` varchar(100) NOT NULL DEFAULT '' COMMENT '操作的权限点', `url` text NOT NULL COMMENT '访问地址', `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', `details` text COMMENT '详情', `type` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '类型 1日志 2错误 3警告', `create_time` decimal(16,3) unsigned NOT NULL COMMENT '数据插入时间', PRIMARY KEY (`id`), KEY `func` (`func`), KEY `admin_id` (`admin_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运营后台操作日志记录表'; /*Data for the table `yy_admin_log` */ /*Table structure for table `yy_auth_admin` */ DROP TABLE IF EXISTS `yy_auth_admin`; CREATE TABLE `yy_auth_admin` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', `username` varchar(128) NOT NULL DEFAULT '' COMMENT '用户名', `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码', `realname` varchar(100) NOT NULL DEFAULT '' COMMENT '真实姓名', `avatar` varchar(200) DEFAULT '' COMMENT '用户头像', `mobile` varchar(32) DEFAULT '' COMMENT '手机号', `email` varchar(100) DEFAULT '' COMMENT '电子邮箱', `dingtalk_id` varchar(200) DEFAULT '' COMMENT '钉钉ID', `dingtalk_globalid` varchar(200) DEFAULT '' COMMENT '钉钉全局ID', `last_login` decimal(16,3) unsigned DEFAULT '0.000' COMMENT '最后登录时间', `last_ip` varchar(32) NOT NULL DEFAULT '' COMMENT '最后登录IP', `try_time` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '密码尝试次数', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '账号状态 1:正常 2:禁止登陆', `create_time` decimal(16,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '数据插入时间', `position` varchar(60) DEFAULT NULL COMMENT '职位', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='运营后台用户列表'; /*Data for the table `yy_auth_admin` */ insert into `yy_auth_admin`(`id`,`username`,`password`,`realname`,`avatar`,`mobile`,`email`,`dingtalk_id`,`dingtalk_globalid`,`last_login`,`last_ip`,`try_time`,`status`,`create_time`,`position`) values (1,'god','$2y$12$wNn2NqR0kIXdG4H0/WJrf.NfS8csPHGC1xUGO0KDTYe.zKlqkbxMy','SuperAdmin','/storage/avatars/ZREEU7nrxhmCNsI4VTuOTlbWwh6479pWHz7aW0to.jpeg','1588899999','<EMAIL>','3527594120810015','','1545457095.549','192.168.126.1',0,1,'0.000','开发工程师'),(2,'test','$2y$12$23bjKmox2SuRsEQQxp4YcOGx.3nHo6vEvX2yjBYTNs84buy8.I42O','测试号','/storage/avatars/xL35yynYjcCmQdhGDqjqwEnwPGFASjGCp35RNbBE.jpeg',NULL,NULL,'','','1542794629.706','192.168.126.1',0,1,'1541734248.958',NULL); /*Table structure for table `yy_auth_group` */ DROP TABLE IF EXISTS `yy_auth_group`; CREATE TABLE `yy_auth_group` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', `title` varchar(128) NOT NULL DEFAULT '' COMMENT '组名称', `rules` text NOT NULL COMMENT '权限列表', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='组列表'; /*Data for the table `yy_auth_group` */ insert into `yy_auth_group`(`id`,`title`,`rules`,`status`) values (1,'上帝组','1,2,3,4,5,6',1),(2,'高级管理员','1,21,2,16,17,18,19,3,13,15,4,7,8,5,9,10,11,12',1); /*Table structure for table `yy_auth_group_access` */ DROP TABLE IF EXISTS `yy_auth_group_access`; CREATE TABLE `yy_auth_group_access` ( `uid` int(11) unsigned NOT NULL COMMENT '用户ID', `group_id` int(11) unsigned NOT NULL COMMENT '所属组', UNIQUE KEY `uid_group_id` (`uid`,`group_id`), KEY `uid` (`uid`), KEY `group_id` (`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户所属组'; /*Data for the table `yy_auth_group_access` */ insert into `yy_auth_group_access`(`uid`,`group_id`) values (1,1),(2,2),(80,2); /*Table structure for table `yy_auth_rule` */ DROP TABLE IF EXISTS `yy_auth_rule`; CREATE TABLE `yy_auth_rule` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', `name` varchar(128) NOT NULL DEFAULT '' COMMENT '权限点', `title` varchar(128) NOT NULL DEFAULT '' COMMENT '名称', `type` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '类型', `status` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '1 启用; 0 禁用', `menu` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '1 作为菜单显示; 0 不显示', `condition` varchar(255) DEFAULT '', `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级ID', `remark` varchar(255) DEFAULT NULL COMMENT '备注', `icon` varchar(100) DEFAULT '' COMMENT '菜单的图标', `sort` int(6) DEFAULT NULL COMMENT '菜单排序', `deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COMMENT='权限点和菜单列表'; /*Data for the table `yy_auth_rule` */ insert into `yy_auth_rule`(`id`,`name`,`title`,`type`,`status`,`menu`,`condition`,`pid`,`remark`,`icon`,`sort`,`deleted`) values (1,'/system','系统设置',1,1,1,NULL,0,NULL,'<i class=\"fa fa-gear\"></i>',2,0),(2,'/system/profile','个人设置',1,1,1,'',21,'',NULL,NULL,0),(3,'/system/admin','管理员列表',1,1,1,'',21,'',NULL,NULL,0),(4,'/system/group','管理组列表',1,1,1,'',21,'',NULL,NULL,0),(5,'/system/rule','权限点管理',1,1,1,'',21,'',NULL,NULL,0),(6,'/system/logs','操作日志',1,1,1,'',21,'',NULL,NULL,0),(7,'api/system/group/list','获取管理组列表接口',1,1,0,'',4,'','',NULL,0),(8,'api/system/group/save','新增或更新管理组接口',1,1,0,'',4,'','',NULL,0),(9,'api/system/rule/list','获取权限列表',1,1,0,'',5,'','',NULL,0),(10,'api/system/rule/routes','获取路由列表',1,1,0,'',5,'','',NULL,0),(11,'api/system/rule/save','添加或保存权限',1,1,0,'',5,'','',NULL,0),(12,'api/system/rule/get','获取权限详情',1,1,0,'',5,'','',NULL,0),(13,'api/system/admin/list','获取管理员列表',1,1,0,'',3,'','',NULL,0),(14,'api/system/admin/loglist','获取管理员日志列表',1,1,0,'',6,'','',NULL,0),(15,'api/system/admin/save','新增或更新管理员',1,1,0,'',3,'','',NULL,0),(16,'api/system/admin/avatar/upload','上传管理员头象',1,1,0,'',2,'','',NULL,0),(17,'api/system/admin/avatar/save','更新管理员头象',1,1,0,'',2,'','',NULL,0),(18,'api/system/admin/profile/get','获取管理员信息',1,1,0,'',2,'','',NULL,0),(19,'api/system/admin/password/change','更新个人密码',1,1,0,'',2,'','',NULL,0),(20,'api/test','测试接口',1,1,0,NULL,2,NULL,NULL,NULL,0),(21,'/system/setting','系统设置',1,1,1,NULL,1,'更新','<i class=\"fa fa-gear\"></i>',NULL,0),(22,'/order','订单管理',1,1,1,NULL,0,NULL,NULL,1,0),(23,'api/test2','测试2',1,1,0,'',0,NULL,'',NULL,1),(24,'api/system/rule/delete','删除权限点',1,1,0,'',5,NULL,'',NULL,0),(25,'order/list','处理中心',1,1,1,'',22,NULL,'<i class=\"fa fa-area-chart\"></i>',NULL,0),(26,'test1','已支付订单',1,1,1,NULL,25,NULL,NULL,NULL,0); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
INSERT INTO "orderlyweb_user_group_global_permission" SELECT ID FROM "orderlyweb_user_group_permission" WHERE user_group = 'Admin' and permission = 'documents.manage' or permission = 'tags.manage'
------------------------------ ------------------------------ ------------------------------ --------------- ---------------------JSON --------------- ------------------------------ ------------------------------ ------------------------------ CREATE TABLE json_test ( id serial primary key, data jsonb ); INSERT INTO json_test (data) VALUES ('{}'), ('{"a": 1}'), ('{"a": 2, "b": ["c", "d"]}'), ('{"a": 1, "b": {"c": "d", "e": true}}'), ('{"b": 2}'); SELECT * FROM json_test; COPY (SELECT row_to_json(t) FROM (select * from json_test) t) TO '/Users/Timur/Dev/json_test.json'; COPY 5 -- success SELECT * FROM json_test WHERE data = '{"a":1}'; 2 {"a": 1} SELECT * FROM json_test WHERE data @> '{"a":1}'; 2 {"a": 1} 4 {"a": 1, "b": {"c": "d", "e": true}} SELECT * FROM json_test WHERE data <@ '{"a":1}'; 1 {} 2 {"a": 1} SELECT * FROM json_test WHERE data ?| array['a', 'b']; 2 {"a": 1} 3 {"a": 2, "b": ["c", "d"]} 4 {"a": 1, "b": {"c": "d", "e": true}} 5 {"b": 2} SELECT * FROM json_test WHERE data ?& array['a','b']; 3 {"a": 2, "b": ["c", "d"]} 4 {"a": 1, "b": {"c": "d", "e": true}} SELECT * FROM json_test WHERE data ?| array['a']; 2 {"a": 1} 3 {"a": 2, "b": ["c", "d"]} 4 {"a": 1, "b": {"c": "d", "e": true}} ------------------------------ ------------------------------ ------------------------------ --------------- ---------------------EXPLAIN --------------- ------------------------------ ------------------------------ ------------------------------ ----------- -- RANDOM DATA GENERATOR IN DATABASE 'Test' ----------- CREATE DATABASE Test; SELECT trunc(random()*21); --random() -случайное 0.0 < x < 1.0, trunc() - округление до целого; CREATE TABLE test_table ( id SERIAL PRIMARY KEY, x INT, y INT, s1 VARCHAR, s2 VARCHAR ); CREATE OR REPLACE FUNCTION loop(n int) RETURNS VOID AS $$ DECLARE x int; y int; e int; s varchar; s1 varchar; s2 varchar; array1 varchar[]; array2 varchar[]; BEGIN s:='abcdefghijklmnopqrstuv'; FOR i IN 1..n LOOP x := trunc(random()*100); y := trunc(random()*100); FOR j IN 1..5 LOOP e := trunc(random()*21+1); SELECT substring(s from e for 1) INTO s1; e := trunc(random()*21+1); SELECT substring(s from e for 1) INTO s2; array1:=array_append(array1, s1); array2:=array_append(array2, s2); END LOOP; s1 := array_to_string(array1,''); s2 := array_to_string(array2,''); INSERT INTO test_table(x, y, s1, s2) VALUES (x, y, s1, s2); array1 := '{NULL}'; array2 := '{NULL}'; s1 := ' '; s2 := ' '; END LOOP; END; $$ LANGUAGE 'plpgsql'; SELECT * FROM loop(1000); EXPLAIN (ANALYZE) SELECT * FROM test_table; Seq Scan on test_table (cost=0.00..33.20 rows=2020 width=24) (actual time=0.019..0.328 rows=2020 loops=1) Planning time: 0.100 ms Execution time: 0.831 ms CREATE INDEX test_id_idx ON test_table (id); EXPLAIN (ANALYZE) SELECT * FROM test_table; Seq Scan on test_table (cost=0.00..33.20 rows=2020 width=24) (actual time=0.008..0.263 rows=2020 loops=1) Planning time: 0.532 ms Execution time: 0.436 ms EXPLAIN (ANALYZE) SELECT * FROM test_table WHERE id < 500 ; Seq Scan on test_table (cost=0.00..19.50 rows=500 width=24) (actual time=0.025..0.591 rows=499 loops=1) Filter: (id < 500) Rows Removed by Filter: 501 Planning time: 0.170 ms Execution time: 0.700 ms SET enable_seqscan TO off; Index Scan using test_id_idx on test_table (cost=0.28..28.02 rows=500 width=24) (actual time=0.048..0.294 rows=499 loops=1) Index Cond: (id < 500) Planning time: 0.256 ms Execution time: 0.373 ms SET enable_seqscan TO on; EXPLAIN (ANALYZE) SELECT * FROM test_table WHERE id > 150 AND s1 LIKE 'a%'; Seq Scan on test_table (cost=0.00..43.30 rows=94 width=24) (actual time=0.067..0.693 rows=99 loops=1) Filter: ((id > 150) AND ((s1)::text ~~ 'a%'::text)) Rows Removed by Filter: 1921 Planning time: 0.138 ms Execution time: 0.821 ms EXPLAIN (ANALYZE) SELECT * FROM test_table WHERE id < 150 AND s1 LIKE 'a%'; Index Scan using index_id on test_table (cost=0.28..11.26 rows=8 width=24) (actual time=0.075..0.169 rows=9 loops=1) Index Cond: (id < 150) Filter: ((s1)::text ~~ 'a%'::text) Rows Removed by Filter: 140 Planning time: 0.282 ms Execution time: 0.215 ms CREATE UNIQUE INDEX STRING1_ID ON test_table (s1); DROP INDEX STRING1_ID; CREATE UNIQUE INDEX STRING1_ID ON test_table (s1 text_pattern_ops); EXPLAIN (ANALYZE) SELECT * FROM test_table WHERE id > 150 AND s1 LIKE 'a%' AND s2 LIKE 'b%'; Bitmap Heap Scan on test_table (cost=4.88..12.93 rows=2 width=24) (actual time=0.188..0.214 rows=3 loops=1) Filter: ((id > 150) AND ((s1)::text ~~ 'a%'::text) AND ((s2)::text ~~ 'b%'::text)) Rows Removed by Filter: 47 Heap Blocks: exact=7 -> Bitmap Index Scan on string1_id (cost=0.00..4.88 rows=60 width=0) (actual time=0.136..0.136 rows=50 loops=1) Index Cond: (((s1)::text ~>=~ 'a'::text) AND ((s1)::text ~<~ 'b'::text)) Planning time: 3.056 ms Execution time: 0.318 ms ------------------------------ ------------------------------ ------------------------------ --------------- ---------------------XML --------------- ------------------------------ ------------------------------ ------------------------------ SELECT query_to_xml('SELECT * FROM test_table limit 10', true, false, ''); <table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <row> <id>10</id> <x>62</x> <y>77</y> <s1>arcbn</s1> <s2>nbkao</s2> <contacts xsi:nil="true"/> </row> <row> <id>11</id> <x>40</x> <y>39</y> <s1>uujbk</s1> <s2>usksg</s2> <contacts xsi:nil="true"/> </row> <row> <id>12</id> <x>94</x> <y>50</y> <s1>fonct</s1> <s2>fhgot</s2> <contacts xsi:nil="true"/> </row> <row> <id>13</id> <x>78</x> <y>5</y> <s1>ibljj</s1> <s2>rbkkj</s2> <contacts xsi:nil="true"/> </row> <row> <id>14</id> <x>38</x> <y>92</y> <s1>urqta</s1> <s2>jjpbn</s2> <contacts xsi:nil="true"/> </row> <row> <id>15</id> <x>40</x> <y>69</y> <s1>tijta</s1> <s2>ksdsa</s2> <contacts xsi:nil="true"/> </row> <row> <id>16</id> <x>94</x> <y>55</y> <s1>kbsst</s1> <s2>iujrp</s2> <contacts xsi:nil="true"/> </row> <row> <id>17</id> <x>28</x> <y>70</y> <s1>jqseo</s1> <s2>ekdqm</s2> <contacts xsi:nil="true"/> </row> <row> <id>18</id> <x>65</x> <y>13</y> <s1>qamhh</s1> <s2>lrtbj</s2> <contacts xsi:nil="true"/> </row> <row> <id>19</id> <x>5</x> <y>24</y> <s1>sbnlm</s1> <s2>trhcg</s2> <contacts xsi:nil="true"/> </row> </table> COPY (SELECT query_to_xml('SELECT * FROM test_table limit 10', true, false, '')) TO '/Users/Timur/Dev/xml_test.xml';
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 1172.16.17.32 -- Generation Time: Mar 23, 2021 at 05:08 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 7.4.15 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: `demo` -- -- -------------------------------------------------------- -- -- Table structure for table `demo_product` -- CREATE TABLE `demo_product` ( `id` int(11) NOT NULL, `name` varchar(100) DEFAULT NULL, `cate` varchar(150) DEFAULT NULL, `price` int(100) DEFAULT NULL, `desc` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `demo_product` -- INSERT INTO `demo_product` (`id`, `name`, `cate`, `price`, `desc`) VALUES (1, 'headset', 'electronics', 2000, 'most value'), (2, 'keyboadr', 'electronics', 2000, 'most value'), (3, 'phone', 'electronics', 3000, 'nice phone'), (4, 'phone', 'electronics', 3000, 'nice phone'), (5, 'plywood', 'wood', 3000, 'valuable house'); -- -- Indexes for dumped tables -- -- -- Indexes for table `demo_product` -- ALTER TABLE `demo_product` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `demo_product` -- ALTER TABLE `demo_product` 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 */;
<filename>conf/db/migration/default/V1__Create_group_table.sql -- MySQL Script generated by MySQL Workbench -- 06/18/16 21:22:47 -- 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 group_communicator -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema group_communicator -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `group_communicator` DEFAULT CHARACTER SET utf8mb4 ; USE `group_communicator` ; -- ----------------------------------------------------- -- Table `group_communicator`.`GROUPS` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `group_communicator`.`GROUPS` ( `GROUP_ID` BIGINT(20) NOT NULL COMMENT '', `GROUP_NAME` VARCHAR(45) NOT NULL COMMENT '', PRIMARY KEY (`GROUP_ID`) COMMENT '') ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `group_communicator`.`USERS` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `group_communicator`.`USERS` ( `USER_ID` BIGINT(20) NOT NULL COMMENT '', `USER_NAME` VARCHAR(45) NULL COMMENT '', PRIMARY KEY (`USER_ID`) COMMENT '') ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `group_communicator`.`USERS_has_GROUPS` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `group_communicator`.`USERS_has_GROUPS` ( `USERS_USER_ID` BIGINT(20) NOT NULL COMMENT '', `GROUPS_GROUP_ID` BIGINT(20) NOT NULL COMMENT '', PRIMARY KEY (`USERS_USER_ID`, `GROUPS_GROUP_ID`) COMMENT '', INDEX `fk_USERS_has_GROUPS_GROUPS1_idx` (`GROUPS_GROUP_ID` ASC) COMMENT '', INDEX `fk_USERS_has_GROUPS_USERS_idx` (`USERS_USER_ID` ASC) COMMENT '', CONSTRAINT `fk_USERS_has_GROUPS_USERS` FOREIGN KEY (`USERS_USER_ID`) REFERENCES `group_communicator`.`USERS` (`USER_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_USERS_has_GROUPS_GROUPS1` FOREIGN KEY (`GROUPS_GROUP_ID`) REFERENCES `group_communicator`.`GROUPS` (`GROUP_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;
SELECT SUM(L_EXTENDEDPRICE * L_DISCOUNT) AS REVENUE FROM LINEITEM WHERE L_SHIPDATE >= DATE '1997-01-01' AND L_SHIPDATE < DATE '1997-01-01' + INTERVAL '1' YEAR AND L_DISCOUNT BETWEEN 0.07 - 0.01 AND 0.07 + 0.01 AND L_QUANTITY < 24;
<filename>AtlasTheatre/Atlas.sql -- phpMyAdmin SQL Dump -- version 4.2.5 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: Mar 22, 2015 at 09:31 AM -- Server version: 5.1.73 -- PHP Version: 5.5.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `Atlas` -- -- -------------------------------------------------------- -- -- Table structure for table `theatre` -- CREATE TABLE IF NOT EXISTS `theatre` ( `t_id` int(5) NOT NULL, `location` varchar(15) NOT NULL, `mgr_id` int(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `theatre` -- insert into `theatre` (`t_id`,`location`,`mgr_id`)values (1,'Chennai',1), (2,'Kolkata',4), (3,'Kochi',7), (4,'New Delhi',10); -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE IF NOT EXISTS `employee` ( `e_id` int(5) NOT NULL, `username` varchar(15) NOT NULL, `password` varchar(60) NOT NULL, `name` varchar(20) NOT NULL, `zip_code` int(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`e_id`,`username`, `password`,`name`,`zip_code`) VALUES (1,'Vaish12','!Password12','<PASSWORD>nav S',670661), (2,'Ani23','@Password12','<PASSWORD>',670662), (3,'Goks34','#Password12','<PASSWORD>',670663), (4,'Raj12','$Password12','<PASSWORD>',670664), (5,'Amy23','%Password12','<PASSWORD>',670665), (6,'Sita12','^Password12','<PASSWORD>',670666), (7,'James07','HPassword12','<PASSWORD>',670667), (8,'Raju34','*Password12','<PASSWORD>',670668), (9,'Jimmy05','(Password12','<PASSWORD>',670669), (10,'Jack34',')Password12','<PASSWORD>',670662), (11,'Johnny87','~Password12','<PASSWORD>',670661); -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE IF NOT EXISTS `customer` ( `mem_id` varchar(5) NOT NULL, `username` varchar(15) NOT NULL, `password` varchar(60) NOT NULL, `name` varchar(20) NOT NULL, `zip_code` int(6) NOT NULL, `email` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`mem_id`,`username`, `password`,`name`,`zip_code`,`email`) VALUES (1,'rockstar12','<PASSWORD>Word','<PASSWORD>',670661,'<EMAIL>'), (2,'movielover90','CoolWord','<PASSWORD>im K',670662,'<EMAIL>'), (3,'johnmovie1','MovieWord','Warren C',670663,'<EMAIL>'), (4,'coolboy60','TestWord','<NAME>',670664,'<EMAIL>'), (5,'jamesbond007','NoHackPls','<NAME>',670665,'<EMAIL>'), (6,'filmreview101','NotRealPass','<NAME>',670666,'<EMAIL>'), (7,'pewdiepie','MoviePass','<NAME>',670667,'<EMAIL>'), (8,'markiplier404','WordPAss','<NAME>',670668,'<EMAIL>'), (9,'movie4life','CoolPAss','<NAME>',670669,'<EMAIL>'), (10,'stevemc','ABCXYZ','<NAME>',670662,'<EMAIL>'); -- -------------------------------------------------------- -- -- Table structure for table `reservation` -- CREATE TABLE IF NOT EXISTS `reservation` ( `res_id` int(7) NOT NULL, `res_d` date NOT NULL, `s_id` int(5) NOT NULL, `e_id` varchar(5) NOT NULL, `mem_id` int(6) NOT NULL, `se_id` varchar(2) NOT NULL, `t_id` varchar(5) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6; -- -- Triggers `reservation` -- DELIMITER $$ CREATE TRIGGER `generateSecondId` BEFORE INSERT ON `reservation` FOR EACH ROW BEGIN SET @startId = 0; SET NEW.`se_id` = (SELECT IFNULL(MAX(`se_id`), @startId) + 1 FROM `reservation`); END $$ DELIMITER ; -- -------------------------------------------------------- -- -- Dumping data for table `booking` -- INSERT INTO `reservation` (`res_id`,`res_d`,`s_id`,`e_id`,`mem_id`,`se_id`,`t_id`) VALUES (1, '2015-03-22',9, 1, 18, '',1), (2, '2015-03-22',9, 2, 42, '',1), (3, '2015-03-22',9, 2, 13, '',1), (4, '2015-03-22',9, 3, 35, '',2), (5, '2015-03-22',9, 4, 68, '',4); -- -------------------------------------------------------- -- -- Table structure for table `address` -- CREATE TABLE IF NOT EXISTS `address` ( `zip_code` int(6) NOT NULL, `street` varchar(50) NOT NULL, `city` varchar(30) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5; -- -- Dumping data for table `address` -- INSERT INTO `address` (`zip_code`,`street`,`city`) VALUES (670661,'Z Road', 'Chennai'), (670662,'Y Road', 'Kolkata'), (670663,'X Road', 'Kochi'), (670664,'W Road', 'New Delhi'), (670665,'V Road', 'Chennai'), (670666,'U Road', 'Kolkata'), (670667,'T Road', 'Kochi'), (670668,'S Road', 'New Delhi'), (670669,'R Road', 'Chennai'); -- -------------------------------------------------------- -- -- Table structure for table `performance` -- CREATE TABLE IF NOT EXISTS `screening` ( `s_id` int(5) NOT NULL, `s_date` date NOT NULL, `m_id` int(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=54; -- -- Dumping data for table `performance` -- INSERT INTO `screening` (`s_id`, `s_date`, `m_id`) VALUES (1, '2020-03-02', 1), (2, '2020-02-11', 1), (3, '2020-03-28', 2), (4, '2020-03-27', 3), (5, '2020-03-30', 4), (6, '2020-03-31', 5); -- -------------------------------------------------------- -- -- Table structure for table `movie` -- CREATE TABLE IF NOT EXISTS `movie` ( `m_id` int(5) NOT NULL, `m_title` varchar(50) NOT NULL, `m_date` date NOT NULL, `m_director` varchar(20), `m_cast` varchar(1024), `m_desc` varchar(1024), `duration_min` int(5), `price` float NOT NULL, `image` varchar(200) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=20; -- -- Dumping data for table `movie` -- INSERT INTO `movie` (`m_id`, `m_title`, `m_date`, `price`, `image`) VALUES (1, 'Pirates of the Carribean', '2020-03-18', 60.8, 'https://upload.wikimedia.org/wikipedia/en/8/89/Pirates_of_the_Caribbean_-_The_Curse_of_the_Black_Pearl.png'), (2, 'Tenet', '2020-03-16', 30, 'https://upload.wikimedia.org/wikipedia/en/1/14/Tenet_movie_poster.jpg'), (3, 'Intersteller', '2020-03-01', 10, 'https://upload.wikimedia.org/wikipedia/en/b/bc/Interstellar_film_poster.jpg'), (4, 'The Godfather', '2020-11-01', 15, 'https://upload.wikimedia.org/wikipedia/en/1/1c/Godfather_ver1.jpg'), (5, '<NAME>', '2020-03-19', 45.5, 'https://upload.wikimedia.org/wikipedia/en/0/00/KungFuHustleHKposter.jpg'), (6, 'Raiders of the Lost Ark', '2020-11-02', 39, 'https://upload.wikimedia.org/wikipedia/en/thumb/4/4c/Raiders_of_the_Lost_Ark.jpg/220px-Raiders_of_the_Lost_Ark.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `seat` -- CREATE TABLE IF NOT EXISTS `seat` ( `se_id` int(5) NOT NULL, `se_no` varchar(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6; -- -- Dumping data for table `seat` -- INSERT INTO `seat` (`se_id`, `se_no`) VALUES (1, 'A1'), (2, 'A1'), (3, 'B6'), (4, 'C4'), (5, 'B3'); -- -- Indexes for dumped tables -- -- -- Indexes for table `employee` -- ALTER TABLE `employee` ADD PRIMARY KEY (`e_id`); -- -- Indexes for table `reservation` -- ALTER TABLE `reservation` ADD PRIMARY KEY (`res_id`), ADD KEY `mem_id` (`mem_id`), ADD KEY `s_id` (`s_id`), ADD KEY `se_id` (`se_id`), ADD KEY `e_id` (`e_id`), ADD KEY`t_id` (`t_id`); -- -- Indexes for table `customers` -- ALTER TABLE `customer` ADD PRIMARY KEY (`mem_id`); -- -- Indexes for table `screening` -- ALTER TABLE `screening` ADD PRIMARY KEY (`s_id`), ADD KEY `m_id` (`m_id`); -- -- Indexes for table `production` -- ALTER TABLE `movie` ADD PRIMARY KEY (`m_id`), ADD FULLTEXT KEY `m_title` (`m_title`); -- -- Indexes for table `seat` -- ALTER TABLE `seat` ADD PRIMARY KEY (`se_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `booking` -- ALTER TABLE `reservation` MODIFY `res_id` int(12) NOT NULL AUTO_INCREMENT; -- AUTO_INCREMENT for table `seat` -- ALTER TABLE `seat` MODIFY `se_id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `customers` -- ALTER TABLE `customer` MODIFY `mem_id` int(6) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `performance` -- ALTER TABLE `screening` MODIFY `s_id` int(5) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `production` -- ALTER TABLE `movie` MODIFY `m_id` int(5) NOT NULL AUTO_INCREMENT;
<gh_stars>0 --Создаем две таблицы company и person. --id в компании задаем вручную. create table company ( id integer NOT NULL, name character varying, CONSTRAINT company_pkey PRIMARY KEY (id) ); create table person ( id serial NOT NULL, name character varying, company_id integer REFERENCES company(id), CONSTRAINT person_pkey PRIMARY KEY (id) ); --Заполним таблицы данными: insert into company(id, name) values (1, 'Alfa'), (2, 'Beta'), (3, 'Gamma'), (4, 'Delta'), (5, 'Omega'), (6, 'Epsilon'), (7, 'Simbolos'); insert into person(name, company_id) values ('Mark', 1), ('Alex', 2), ('Ivan', 2), ('Timati', 2), ('Zack', 2), ('Fox', 3), ('Anton', 3), ('Wolf', 3), ('Petr', 4), ('John', 5), ('Sam', 5), ('Bob', 6); --Выведем все данные двух таблиц: select p.name, p.company_id, c.id, c.name from person as p inner join company as c on c.id=p.company_id; -- нужно: -- 1) Получить одним запросом: -- - имена всех людей, которые не в компании с id=5 -- - название компании для каждого человека select p.name, c.name from person as p join company as c on c.id=p.company_id where c.id <> 5; -- 2) Выберите название компании с максимальным количеством -- человек + количество человек в этой компании select c.name, count (p.id) amount_of_people from company as c inner join person as p on c.id=p.company_id group by c.name order by amount_of_people desc limit 1;
<reponame>jrharalson/almanac.httparchive.org SELECT --noqa: disable=L044 date, client, page, url, body, truncated, NULL AS pageid, requestId AS requestid, startedDateTime, time, method, urlShort, redirectUrl, firstReq, firstHtml, reqHttpVersion, reqHeadersSize, reqBodySize, reqCookieLen, reqOtherHeaders, status, respHttpVersion, respHeadersSize, respBodySize, respSize, respCookieLen, expAge AS expAge, * EXCEPT (date, client, page, url, body, truncated, requestId, startedDateTime, time, method, urlShort, redirectUrl, firstReq, firstHtml, reqHttpVersion, reqHeadersSize, reqBodySize, reqCookieLen, reqOtherHeaders, status, respHttpVersion, respHeadersSize, respBodySize, respSize, respCookieLen, expAge, type, ext, format, payload), NULL AS crawlid, type, ext, format, payload FROM ( SELECT * FROM `httparchive.almanac.requests` WHERE date = '2020-08-01') JOIN (SELECT _TABLE_SUFFIX AS client, * FROM `httparchive.response_bodies.2020_08_01_*`) USING (client, page, url, requestId)
/****** Object: StoredProcedure [dbo].[FindLogEntry] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[FindLogEntry] /**************************************************** ** ** Desc: ** Returns result set of main log satisfying the search parameters ** ** Return values: 0: success, otherwise, error code ** ** Auth: grk ** Date: 08/23/2006 ** 12/20/2006 mem - Now querying V_Log_Report using dynamic SQL (Ticket #349) ** 01/24/2008 mem - Switched the @i_ variables to use the datetime data type (Ticket #225) ** 03/23/2017 mem - Use Try_Convert instead of Convert ** - Use sp_executesql ** 10/13/2021 mem - Now using Try_Parse to convert from text to int, since Try_Convert('') gives 0 ** ** Pacific Northwest National Laboratory, Richland, WA ** Copyright 2005, Battelle Memorial Institute *****************************************************/ ( @Entry varchar(20) = '', @PostedBy varchar(64) = '', @PostingTime_After varchar(20) = '', @PostingTime_Before varchar(20) = '', @EntryType varchar(32) = '', @MessageText varchar(500) = '', @message varchar(512) ='' output ) As set nocount on declare @myError int declare @myRowCount int set @myError = 0 set @myRowCount = 0 set @message = '' declare @sql nvarchar(4000) declare @W nvarchar(3800) --------------------------------------------------- -- Validate input fields --------------------------------------------------- DECLARE @entryID int = Try_Parse(@Entry as int) -- DECLARE @postedByWildcard varchar(64) = '%' + @PostedBy + '%' -- DECLARE @earlistPostingTime datetime = Try_Parse(@PostingTime_After as datetime) DECLARE @latestPostingTime datetime = Try_Parse(@PostingTime_Before as datetime) -- DECLARE @typeWildcard varchar(32) = '%' + @EntryType + '%' -- DECLARE @messageWildcard varchar(500) = '%' + @MessageText + '%' -- --------------------------------------------------- -- Construct the query --------------------------------------------------- -- Set @sql = ' SELECT * FROM V_Log_Report' Set @W = '' If Len(@Entry) > 0 Set @W = @W + ' AND ([Entry] = @entryID)' If Len(@PostedBy) > 0 Set @W = @W + ' AND ([Posted By] LIKE @postedByWildcard )' If Len(@PostingTime_After) > 0 Set @W = @W + ' AND ([Posting Time] >= @earlistPostingTime )' If Len(@PostingTime_Before) > 0 Set @W = @W + ' AND ([Posting Time] < @latestPostingTime )' If Len(@EntryType) > 0 Set @W = @W + ' AND ([Type] LIKE @typeWildcard )' If Len(@MessageText) > 0 Set @W = @W + ' AND ([Message] LIKE @messageWildcard)' If Len(@W) > 0 Begin -- One or more filters are defined -- Remove the first AND from the start of @W and add the word WHERE Set @W = 'WHERE ' + Substring(@W, 6, Len(@W) - 5) Set @sql = @sql + ' ' + @W End --------------------------------------------------- -- Run the query --------------------------------------------------- -- Declare @sqlParams NVarchar(2000) = N'@entryID int, @postedByWildcard varchar(64), @earlistPostingTime datetime, @latestPostingTime datetime, @typeWildcard varchar(32), @messageWildcard varchar(500)' EXEC sp_executesql @sql, @sqlParams, @entryID, @postedByWildcard, @earlistPostingTime, @latestPostingTime, @typeWildcard, @messageWildcard -- SELECT @myError = @@error, @myRowCount = @@rowcount -- if @myError <> 0 begin set @message = 'Error occurred attempting to execute query' RAISERROR (@message, 10, 1) return 51007 end return @myError GO GRANT VIEW DEFINITION ON [dbo].[FindLogEntry] TO [DDL_Viewer] AS [dbo] GO GRANT EXECUTE ON [dbo].[FindLogEntry] TO [DMS_Guest] AS [dbo] GO GRANT EXECUTE ON [dbo].[FindLogEntry] TO [DMSReader] AS [dbo] GO GRANT VIEW DEFINITION ON [dbo].[FindLogEntry] TO [Limited_Table_Write] AS [dbo] GO
-- [ZX-Ed] Prepare ZXDB for editing. -- by <NAME> USE zxdb; alter table aliases add column if not exists zxed int(11) not null default 0; alter table articles add column if not exists zxed int(11) not null default 0; alter table articletypes add column if not exists zxed int(11) not null default 0; alter table authors add column if not exists zxed int(11) not null default 0; alter table availabletypes add column if not exists zxed int(11) not null default 0; alter table booktypeins add column if not exists zxed int(11) not null default 0; alter table contents add column if not exists zxed int(11) not null default 0; alter table contenttypes add column if not exists zxed int(11) not null default 0; alter table countries add column if not exists zxed int(11) not null default 0; alter table currencies add column if not exists zxed int(11) not null default 0; alter table downloads add column if not exists zxed int(11) not null default 0; alter table entries add column if not exists zxed int(11) not null default 0; alter table extensions add column if not exists zxed int(11) not null default 0; alter table features add column if not exists zxed int(11) not null default 0; alter table files add column if not exists zxed int(11) not null default 0; alter table filetypes add column if not exists zxed int(11) not null default 0; alter table genretypes add column if not exists zxed int(11) not null default 0; alter table hosts add column if not exists zxed int(11) not null default 0; alter table issues add column if not exists zxed int(11) not null default 0; alter table labels add column if not exists zxed int(11) not null default 0; alter table labeltypes add column if not exists zxed int(11) not null default 0; alter table languages add column if not exists zxed int(11) not null default 0; alter table licenses add column if not exists zxed int(11) not null default 0; alter table licensetypes add column if not exists zxed int(11) not null default 0; alter table licensors add column if not exists zxed int(11) not null default 0; alter table machinetypes add column if not exists zxed int(11) not null default 0; alter table magazines add column if not exists zxed int(11) not null default 0; alter table magreffeats add column if not exists zxed int(11) not null default 0; alter table magreflinks add column if not exists zxed int(11) not null default 0; alter table magrefs add column if not exists zxed int(11) not null default 0; alter table members add column if not exists zxed int(11) not null default 0; alter table notes add column if not exists zxed int(11) not null default 0; alter table notetypes add column if not exists zxed int(11) not null default 0; alter table nvgs add column if not exists zxed int(11) not null default 0; alter table permissions add column if not exists zxed int(11) not null default 0; alter table permissiontypes add column if not exists zxed int(11) not null default 0; alter table platforms add column if not exists zxed int(11) not null default 0; alter table ports add column if not exists zxed int(11) not null default 0; alter table publishers add column if not exists zxed int(11) not null default 0; alter table referencetypes add column if not exists zxed int(11) not null default 0; alter table relatedlicenses add column if not exists zxed int(11) not null default 0; alter table relations add column if not exists zxed int(11) not null default 0; alter table relationtypes add column if not exists zxed int(11) not null default 0; alter table releases add column if not exists zxed int(11) not null default 0; alter table remakes add column if not exists zxed int(11) not null default 0; alter table roles add column if not exists zxed int(11) not null default 0; alter table roletypes add column if not exists zxed int(11) not null default 0; alter table schemetypes add column if not exists zxed int(11) not null default 0; alter table scores add column if not exists zxed int(11) not null default 0; alter table spex_authors add column if not exists zxed int(11) not null default 0; alter table spex_entries add column if not exists zxed int(11) not null default 0; alter table tags add column if not exists zxed int(11) not null default 0; alter table tagtypes add column if not exists zxed int(11) not null default 0; alter table tools add column if not exists zxed int(11) not null default 0; alter table tooltypes add column if not exists zxed int(11) not null default 0; alter table topics add column if not exists zxed int(11) not null default 0; alter table topictypes add column if not exists zxed int(11) not null default 0; alter table webrefs add column if not exists zxed int(11) not null default 0; alter table websites add column if not exists zxed int(11) not null default 0; alter table zxsr_awards add column if not exists zxed int(11) not null default 0; alter table zxsr_captions add column if not exists zxed int(11) not null default 0; alter table zxsr_reviews add column if not exists zxed int(11) not null default 0; alter table zxsr_scores add column if not exists zxed int(11) not null default 0; -- END
<reponame>pdv-ru/ClickHouse SELECT lcm(15, 10); SELECT lcm(-15, 10); SELECT lcm(15, -10); SELECT lcm(-15, -10); -- Implementation specific result on overflow: SELECT ignore(lcm(256, 9223372036854775807)); SELECT ignore(lcm(256, -9223372036854775807)); SELECT ignore(lcm(-256, 9223372036854775807)); -- { serverError 407 } SELECT ignore(lcm(-256, -9223372036854775807));
<gh_stars>1-10 CREATE TABLE service_application ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'id', org_id BIGINT COMMENT '组织id', app_code varchar(128) COMMENT '应用编号', app_name varchar(64) COMMENT '应用名称', app_type tinyint COMMENT '应用类型 1:服务 2:网关', remark VARCHAR(256) COMMENT '备注', isvalid TINYINT COMMENT '是否有效', ctime DATETIME COMMENT '创建时间', creater BIGINT COMMENT '创建者', mtime DATETIME COMMENT '更新时间', updater BIGINT COMMENT '更新者', PRIMARY KEY (id) ) COMMENT ='应用表';
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 30-12-2020 a las 05:07:12 -- Versión del servidor: 10.4.11-MariaDB -- Versión de PHP: 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `fulltextsearchwebbot` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `documents` -- CREATE TABLE `documents` ( `documentID` int(11) NOT NULL, `link` varchar(250) NOT NULL, `title` varchar(255) CHARACTER SET utf8mb4, `fullDocumentText` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `lastTimeVisited` datetime ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `documents` -- ALTER TABLE `documents` ADD PRIMARY KEY (`documentID`); ALTER TABLE `documents` ADD FULLTEXT KEY `fullDocumentText` (`fullDocumentText`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `documents` -- ALTER TABLE `documents` MODIFY `documentID` int(11) NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<gh_stars>1-10 INSERT INTO UserInputs60Hz VALUES (5, 10, 1, .03, 650, 50.52, '192.168.101.105', '20171126') INSERT INTO UserInputs60Hz VALUES (4, 11, 1, .13, 650, 30.32, '192.168.3.11', '20171126') INSERT INTO UserInputs60Hz VALUES (3, 12, 1, .23, 650, 20.75, '172.16.17.32', '20171127') INSERT INTO UserInputs60Hz VALUES (2, 13, 1, .33, 650, 44.36, '192.168.3.11', '20171127') INSERT INTO UserInputs60Hz VALUES (1, 14, 1, .43, 650, 78.68, '172.16.17.32', '20171128') INSERT INTO UserInputs60Hz VALUES (1, 10, 1, .53, 700, 12.23, '172.16.17.32', '20171128') INSERT INTO UserInputs60Hz VALUES (2, 9, 1, .63, 700, 22.23, '192.168.127.12', '20171129') INSERT INTO UserInputs60Hz VALUES (3, 8, 1, .73, 700, 32.23, '172.16.31.10', '20171129') INSERT INTO UserInputs60Hz VALUES (4, 7, 1, .83, 700, 42.23, '172.16.31.10', '20171129') INSERT INTO UserInputs60Hz VALUES (5, 6, 1, .93, 700, 52.23, '192.168.3.11', '20171129') INSERT INTO UserInputs60Hz VALUES (5, 1, 1, 1.03, 800, 11.23, '192.168.127.12', '20171130') INSERT INTO UserInputs60Hz VALUES (4, 2, 1, .93, 800, 22.23, '172.16.58.3', '20171130') INSERT INTO UserInputs60Hz VALUES (3, 3, 1, .83, 800, 33.23, '172.16.31.10', '20171130') INSERT INTO UserInputs60Hz VALUES (2, 4, 1, .73, 800, 44.23, '172.16.17.32', '20171128') INSERT INTO UserInputs60Hz VALUES (1, 5, 1, .63, 800, 55.23, '172.16.31.10', '20171201') INSERT INTO UserInputs60Hz VALUES (1, 6, 1, .53, 1000, 66.23, '172.16.58.3', '20171201') INSERT INTO UserInputs60Hz VALUES (2, 7, 1, .43, 1000, 77.23, '192.168.3.11', '20171202') INSERT INTO UserInputs60Hz VALUES (3, 8, 1, .33, 1000, 88.23, '192.168.127.12', '20171202') INSERT INTO UserInputs60Hz VALUES (4, 9, 1, .23, 1000, 99.23, '192.168.3.11', '20171203') INSERT INTO UserInputs60Hz VALUES (5, 10, 1, .13, 1000, 57.23, '172.16.31.10', '20171203') INSERT INTO UserInputsDC VALUES (5, 10, 57.23, '172.16.31.10', '20171203') INSERT INTO UserInputsDC VALUES (4, 10, 47.23, '172.16.58.3', '20171203') INSERT INTO UserInputsDC VALUES (3, 10, 37.23, '172.16.58.3', '20171204') INSERT INTO UserInputsDC VALUES (2, 10, 27.23, '172.16.31.10', '20171204') INSERT INTO UserInputsDC VALUES (1, 10, 17.23, '172.16.58.3', '20171205') SELECT * FROM UserInputsDC
<reponame>Josano/RestWithASPNETUdemy<filename>RestWithASPNETUdemy/RestWithASPNETUdemy/db/migrations/V1_0_1__Create_Table_Persons.sql CREATE TABLE `rest_with_asp_net_udemy`.`persons` ( `Id` INT(10) UNSIGNED NULL DEFAULT NULL, `FirstName` VARCHAR(50) NULL DEFAULT NULL, `LastName` VARCHAR(50) NULL DEFAULT NULL, `Address` VARCHAR(50) NULL DEFAULT NULL, `Gender` VARCHAR(50) NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
<reponame>XLegion/image-loader CREATE TABLE `images` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `url` VARCHAR(255) NOT NULL, `content` MEDIUMBLOB NOT NULL, `session` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`id`), INDEX `session` (`session`) ) ENGINE=InnoDB;
-- -- Script was generated by Devart dbForge Studio 2020 for MySQL, Version 9.0.435.0 -- Product home page: http://www.devart.com/dbforge/mysql/studio -- Script date 26/11/2020 19:19:02 -- Server version: 10.4.6 -- Client version: 4.1 -- SET NAMES 'utf8'; INSERT INTO despacho.personal(pe_id, pe_lp, pe_dni, pe_nombre, pe_apellido, pe_domicilio, pe_provincia, pe_telefono, pe_fecha_alta) VALUES (1, 324, 234, 'alcides', 'quinteros', 'godoy 677', 'caba', 2343, '2020-11-01'), (2, 244, 234234, 'licencia', 'asd', 'gad 43', 'caba', 3423423, '2020-11-05');
<reponame>AQdf/Pocket<filename>server/Sho.Pocket.DataAccess.Sql.Dapper/Scripts/GetUserBalances.sql select * from Balance join Asset on Asset.Id = Balance.AssetId left join ExchangeRate on ExchangeRate.Id = Balance.ExchangeRateId where Balance.UserId = @userId order by Balance.EffectiveDate desc
<reponame>itolisto/conversa-old DROP PROCEDURE IF EXISTS `SP_INS_PASSWORD_RESET_REQUEST`; DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_INS_PASSWORD_RESET_REQUEST`(IN `i_id` INT UNSIGNED, IN `i_token` VARCHAR(90) CHARSET utf8, IN `i_created` INT UNSIGNED, OUT `o_result` TINYINT UNSIGNED) NOT DETERMINISTIC MODIFIES SQL DATA SQL SECURITY DEFINER BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN ROLLBACK; SET o_result = 0; SELECT 'An error has occurred, operation rollbacked and the stored procedure was terminated'; END; IF (SELECT 1 = 1 FROM `co_password_change_request` WHERE `psr_user_id` = i_id AND `psr_valid` = 1 LIMIT 1) THEN UPDATE `co_password_change_request` SET `psr_token` = i_token, `psr_created` = i_created WHERE `psr_user_id` = i_id; SET `o_result` = 2; ELSE INSERT INTO `co_password_change_request` ( `psr_user_id`, `psr_token`, `psr_created`) VALUES ( i_id, i_token, i_created); SET `o_result` = 1; END IF; END$$ # change the delimiter back to semicolon DELIMITER ;
--- Planes de ejcucion sobre consultas --- create table mis_empleados as select * from HR.employees; -- Plan Ejecucion Estimado EXPLAIN PLAN FOR Select first_name FROM mis_empleados where employee_id = 112; Select * from table (dbms_xplan.display); ---Plan Ejecucion Real Select first_name FROM mis_empleados where employee_id = 112; Select * from table (dbms_xplan.display_cursor); --- Creacion de indices --TIPO UNIQUE Create unique index id_empleado_idx on mis_empleados (employee_id); --TIPO BITMAP Create BITMAP index phone_number_idx on mis_empleados (phone_number); --- INDICES SOBRE EL SALARIO Create index salary_idx_mis_empleados on mis_empleados (salary); Select * from mis_empleados where salary >2400; Select * from table (dbms_xplan.display_cursor); Select * from mis_empleados where salary >13000; Select * from table (dbms_xplan.display_cursor); ---Optimizacion con LENGTH Select first_name from mis_empleados where length(last_name)>5; --Indice del largo create index l_name_idx on mis_empleados(last_name, length(last_name)); --- Ejemplo de EXTRACT DATE Create index hire_date_idx on mis_empleados (EXTRACT(YEAR FROM HIRE_DATE)); Select * from mis_empleados where extract(year from hire_date)=1998; Select * from table(dbms_xplan.display_cursor); --- Ejemplo de primer y segundo nombre Create index first_last_name_idx on mis_empleados (first_name,last_name); Select * from mis_empleados where last_name='Cambrault' ; Select * from table(dbms_xplan.display_cursor); select * from user_indexes where table_name = 'MIS_EMPLEADOS'; DROP INDEX L_NAME_IDX;
SELECT * FROM towns; SELECT * FROM departments; SELECT * FROM employees;
CREATE PROCEDURE dbo.Job_Get ( @Id int = -1, @Keyword nvarchar(1000) = NULL ) AS SET NOCOUNT ON SELECT Id, Title, Description FROM Job WHERE (@Id=-1 OR Id = @Id) AND (@Keyword IS NULL OR Title LIKE '%' + @Keyword + '%') RETURN
<reponame>miolfo/candystore create table if not exists store_users( id serial primary key not null, fname varchar(30) not null, lname varchar(50) not null, nickname varchar(50), balance real); create table if not exists store_products( id serial primary key not null, name varchar(30) not null, description varchar(50), price real); create table if not exists store_transactions( id serial primary key not null, transaction_time timestamp not null default now(), user_id int not null, product_id int, amount real not null); create table if not exists store_payment_options( id serial primary key not null, u_id int references store_users(id), payment_option varchar(200), description varchar(200));
<reponame>yanhamu/Badzeet create table budget.payments( id bigint identity(1,1) primary key, account_id bigint not null foreign key references budget.accounts(id), [date] date not null, amount decimal(10,2) not null, [description] nvarchar(100) not null, category_id bigint not null foreign key references budget.categories(id), owner_id uniqueidentifier not null foreign key references budget.users(id) ) set identity_insert budget.payments on insert into budget.payments(id, account_id, date, amount, description, category_id, owner_id) select id, account_id, date, amount, description, category_id, owner_id from budget.transactions set identity_insert budget.payments off drop table budget.transactions
-- Batch Requests (needs to be processed for delta) -- Not for Azure -- For entire instance SELECT 'Total Batch Requests' AS CounterName, cntr_value AS TotalNumberOfBatches FROM sys.dm_os_performance_counters WHERE counter_name = 'Batch Requests/sec'
SELECT name FROM employee WHERE age >= 25 AND age <= 30 ORDER BY id;
<filename>Dataware house Database SQL Files/Dimensions/First Loads/DW_DimResearch_First_SP.sql -----------------###### DW DimResearch First SP ######--------------- USE LibraryDW Go CREATE OR ALTER PROCEDURE DW_DimResearch_First_SP AS BEGIN TRUNCATE TABLE LibraryDW.dbo.dimResearch INSERT INTO LibraryDW.dbo.dimResearch( ID, Title, [Description], Cost, StartDate, [EndDate], DocumentURL, Branch_ID, Branch_name, Category_ID, Category_name, Research_Type_ID, Research_Type_name, Research_State_ID, Research_State_name, Supervisor_ID, Supervisor_firstName, Supervisor_lastName ) SELECT R.ID, R.Title, R.[Description], R.Cost, R.StartDate, R.[EndDate], R.DocumentURL, R.Branch_ID, B.name, R.Category_ID, RC.name, R.Research_Type_ID, RT.Name, R.Research_State_ID, RS.name, R.Supervisor_ID, E.Firstname, E.Lastname FROM LibrarySA.dbo.Research as R inner join LibrarySA.dbo.Research_Category as RC on R.Category_ID=RC.ID inner join LibrarySA.dbo.Branch as B on R.Branch_ID = B.ID inner join LibrarySA.dbo.Research_Type as RT on R.Research_Type_ID=RT.ID inner join LibrarySA.dbo.Research_State as RS on R.Research_State_ID = RS.ID inner join LibrarySA.dbo.Employee as E on R.Supervisor_ID=E.ID END
SELECT prosrc FROM pg_proc WHERE proname = 'f_files_from_directory' AND prokind = 'f';
WITH source AS ( SELECT * FROM {{ source('salesforce', 'zqu_quote_amendment') }} ), renamed AS ( SELECT id::VARCHAR AS zqu_quote_amendment_id, charge_summary_sub_total__c::FLOAT AS charge_summary_sub_total, license_amount__c::FLOAT AS license_amount, NAME::VARCHAR AS zqu_quote_amendment_name, professional_services_amount__c::FLOAT AS professional_services_amount, true_up_amount__c::FLOAT AS true_up_amount, zqu__autorenew__c::VARCHAR AS zqu__auto_renew, zqu__cancellationpolicy__c::VARCHAR AS zqu__cancellation_policy, zqu__deltamrr__c::FLOAT AS zqu__delta_mrr, zqu__deltatcv__c::FLOAT AS zqu__delta_tcv, zqu__initialtermperiodtype__c::VARCHAR AS zqu__initial_term_period_type, zqu__initialterm__c::FLOAT AS zqu__initial_term, zqu__quoteamendmentzuoraid__c::VARCHAR AS zqu__quote_amendment_zuora_id, zqu__renewaltermperiodtype__c::VARCHAR AS zqu__renewal_term_period_type, zqu__renewalterm__c::FLOAT AS zqu__renewal_term, zqu__status__c::VARCHAR AS zqu__status, zqu__totalamount__c::FLOAT AS zqu__total_amount, zqu__quote__c::VARCHAR AS zqu__quote, zqu__type__c::VARCHAR AS zqu__type, zqu__description__c::VARCHAR AS zqu__description, zqu__termstartdate__c::TIMESTAMP_TZ AS zqu__term_start_date, --metadata createdbyid::VARCHAR AS created_by_id, createddate::TIMESTAMP_TZ AS created_date, isdeleted::BOOLEAN AS is_deleted, lastmodifiedbyid::VARCHAR AS last_modified_by_id, lastmodifieddate::TIMESTAMP_TZ AS last_modified_date, _sdc_received_at::TIMESTAMP_TZ AS sdc_received_at, _sdc_extracted_at::TIMESTAMP_TZ AS sdc_extracted_at, _sdc_table_version::NUMBER AS sdc_table_version, _sdc_batched_at::TIMESTAMP_TZ AS sdc_batched_at, _sdc_sequence::NUMBER AS sdc_sequence, systemmodstamp::TIMESTAMP_TZ AS system_mod_stamp FROM source ) SELECT * FROM renamed
INSERT INTO order_details VALUES (null, 69, 80, 15.0000, 15.0000, 0, 2, NULL, NULL, 129), (null, 69, 80, 15.0000, 15.0000, 0, 2, NULL, NULL, 129);
<gh_stars>1-10 INSERT INTO project (name, slug, image) VALUES ('Cedars Lock and Dam', 'cedars-lock-and-dam', 'cedars-lock-and-dam.jpg'), ('Chicago River and Harbor Controlling Works', 'chicago-river-and-harbor-controlling-works', 'chicago-river-and-harbor-controlling-works.jpg'), ('Depere Lock and Dam', 'depere-lock-and-dam', 'depere-lock-and-dam.jpg'), ('<NAME>', 'j-edward-roush-dam', 'j-edward-roush-dam.jpg'), ('<NAME> - <NAME>', 'j-edward-roush-dam-markle-levee', 'j-edward-roush-dam-markle-levee.jpg'), ('Kaukauna Locks and Dam', 'kaukauna-locks-and-dam', 'kaukauna-locks-and-dam.jpg'), ('Little Chute Locks and Dam', 'little-chute-locks-and-dam', 'little-chute-locks-and-dam.jpg'), ('Little Kaukauna Lock and Dam', 'little-kaukauna-lock-and-dam', 'little-kaukauna-lock-and-dam.jpg'), ('Lockport Lock and Controlling Works', 'lockport-lock-and-controlling-works', 'lockport-lock-and-controlling-works.jpg'), ('Lower Appleton Locks and Dam', 'lower-appleton-locks-and-dam', 'lower-appleton-locks-and-dam.jpg'), ('Menasha Lock and Dam', 'menasha-lock-and-dam', 'menasha-lock-and-dam.jpg'), ('Mississinewa Dam', 'mississinewa-dam', 'mississinewa-dam.jpg'), ('Rapide Croche Lock and Dam', 'rapide-croche-lock-and-dam', 'rapide-croche-lock-and-dam.jpg'), ('Salamonie Dam', 'salamonie-dam', 'salamonie-dam.jpg'), ('<NAME>''brien Lock and Controlling Works', 'thomas-j-obrien-lock-and-controlling-works', 'thomas-j-obrien-lock-and-controlling-works.jpg'), ('Upper Appleton Locks and Dam', 'upper-appleton-locks-and-dam', 'upper-appleton-locks-and-dam.jpg'), ('Chicago Sanitarty and Ship Canal Dispersal Barrier', 'chicago-sanitary-and-ship-canal-dispersal-barrier', 'chicago-sanitary-and-ship-canal-dispersal-barrier.jpg');
<reponame>tqigbarboza/avro-schema-generator create table "test_comments"( "id" int not null, "name" varchar(50), "created" timestamp not null, "updated" timestamp, "decimal_field" decimal(20, 3), "other_decimal_field" decimal ); comment on table "test_comments" is 'Table with comments.'; comment on column "test_comments"."id" is 'Id for the test_comments table.';
ALTER TABLE PERSON_SIGNATURE DROP COLUMN DEFAULT_ADMIN_SIGNATURE /
-- H2 Syntax -- INSERT INTO user (id, firstName, lastName, password, username) VALUES (1, 'Admin', '', '<PASSWORD>', 'admin') -- INSERT INTO user (id, firstName, lastName, password, username) VALUES (2, 'User', '', '<PASSWORD>', 'user'); -- INSERT INTO userRole (id, role, user_id) VALUES (1, 1, 1) -- INSERT INTO userRole (id, role, user_id) VALUES (2, 2, 2);
-- SQLINES LICENSE FOR EVALUATION USE ONLY CREATE SEQUENCE users_seq; CREATE TABLE users ( id INT NOT NULL DEFAULT NEXTVAL ('users_seq'), user_name VARCHAR(50) UNIQUE NOT NULL DEFAULT '0', password VARCHAR(130) NOT NULL DEFAULT '0', full_name VARCHAR(120) NOT NULL, refresh_token VARCHAR(500) NULL DEFAULT '0', refresh_token_expiry_time TIMESTAMP(0) NULL DEFAULT NULL, PRIMARY KEY (id)--, --UNIQUE `user_name` (`user_name`) ); --ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE BUILDING_INFO ( DONGCODE VARCHAR(30) DEFAULT NULL, SIDO VARCHAR(120) DEFAULT NULL, SIGUNGU VARCHAR(120) DEFAULT NULL, DONG VARCHAR(120) DEFAULT NULL, RI VARCHAR(120) DEFAULT NULL, ISMOUNTAIN CHAR(1) DEFAULT '0', JIBUN1 NUMBER(4) NOT NULL, JIBUN2 NUMBER(4) NOT NULL, STREETCODE CHAR(12) DEFAULT NULL, STREET VARCHAR(240) DEFAULT NULL, ISUNDER CHAR(1) DEFAULT NULL, BUILDINGNUM1 NUMBER(5) DEFAULT NULL, BUILDINGNUM2 NUMBER(5) DEFAULT NULL, BUILDING VARCHAR(120) DEFAULT NULL, BUILDINGDETAIL VARCHAR(300) DEFAULT NULL, BUILDINGCODE VARCHAR(25) DEFAULT '', DONGSEQ VARCHAR(2) DEFAULT NULL, HAENGDONGCODE VARCHAR(10) DEFAULT NULL, HAENGDONG VARCHAR(60) DEFAULT NULL, ZIPCODE VARCHAR(5) DEFAULT NULL, ZIPSEQ VARCHAR(3) DEFAULT NULL, MASSDESTINATION VARCHAR(120) DEFAULT NULL, MOVEREASION CHAR(2) DEFAULT NULL, GOSIDATE CHAR(8) DEFAULT NULL, OLDADDRESS VARCHAR(75) DEFAULT NULL, SIGUNGUBUILDING VARCHAR(600) DEFAULT NULL, APT CHAR(1) NOT NULL, BASICDESTRICTNUM CHAR(5) DEFAULT NULL, ISASIGNDETAILADDR CHAR(1) DEFAULT NULL, REMARK1 VARCHAR(45) DEFAULT NULL, REMARK2 VARCHAR(45) DEFAULT NULL, PRIMARY KEY (BUILDINGCODE) ); COMMENT ON COLUMN BUILDING_INFO.DONGCODE IS '법정동코드[10자리]'; COMMENT ON COLUMN BUILDING_INFO.SIDO IS '시도명'; COMMENT ON COLUMN BUILDING_INFO.SIGUNGU IS '시군구명'; COMMENT ON COLUMN BUILDING_INFO.DONG IS '법정읍면동명'; COMMENT ON COLUMN BUILDING_INFO.RI IS '법정리명'; COMMENT ON COLUMN BUILDING_INFO.ISMOUNTAIN IS '산여부(0:토지,1:산)(PK2)'; COMMENT ON COLUMN BUILDING_INFO.JIBUN1 IS '관련지번본번'; COMMENT ON COLUMN BUILDING_INFO.JIBUN2 IS '관련지번부번'; COMMENT ON COLUMN BUILDING_INFO.STREETCODE IS '도로명코드'; COMMENT ON COLUMN BUILDING_INFO.STREET IS '도로명'; COMMENT ON COLUMN BUILDING_INFO.ISUNDER IS '지하여부(0:지상,1:지하,2:공중)'; COMMENT ON COLUMN BUILDING_INFO.BUILDINGNUM1 IS '건물본번'; COMMENT ON COLUMN BUILDING_INFO.BUILDINGNUM2 IS '건물부번'; COMMENT ON COLUMN BUILDING_INFO.BUILDING IS '건축물대장 건물명'; COMMENT ON COLUMN BUILDING_INFO.BUILDINGDETAIL IS '상세건물명'; COMMENT ON COLUMN BUILDING_INFO.BUILDINGCODE IS '건물관리번호(PK)'; COMMENT ON COLUMN BUILDING_INFO.DONGSEQ IS '읍면동일련번호'; COMMENT ON COLUMN BUILDING_INFO.HAENGDONGCODE IS '행정동코드'; COMMENT ON COLUMN BUILDING_INFO.HAENGDONG IS '행정동명'; COMMENT ON COLUMN BUILDING_INFO.ZIPCODE IS '우편번호'; COMMENT ON COLUMN BUILDING_INFO.ZIPSEQ IS '우편일련번호'; COMMENT ON COLUMN BUILDING_INFO.MASSDESTINATION IS '다량배달처명'; COMMENT ON COLUMN BUILDING_INFO.MOVEREASION IS '이동사유코드'; COMMENT ON COLUMN BUILDING_INFO.GOSIDATE IS '고시일자'; COMMENT ON COLUMN BUILDING_INFO.OLDADDRESS IS '변경전도로명주소'; COMMENT ON COLUMN BUILDING_INFO.SIGUNGUBUILDING IS '신군구용 건물명'; COMMENT ON COLUMN BUILDING_INFO.APT IS '공동주택여부'; COMMENT ON COLUMN BUILDING_INFO.BASICDESTRICTNUM IS '기초구역번호'; COMMENT ON COLUMN BUILDING_INFO.ISASIGNDETAILADDR IS '상세주소 부여여부'; COMMENT ON COLUMN BUILDING_INFO.REMARK1 IS '비고1'; COMMENT ON COLUMN BUILDING_INFO.REMARK2 IS '비고2'; CREATE INDEX IDX_STREET ON BUILDING_INFO ( STREET ); CREATE INDEX IDX_DONG ON BUILDING_INFO ( DONG ); CREATE INDEX IDX_BUILDING ON BUILDING_INFO ( BUILDING ); CREATE INDEX IDX_MASSDESTINATION ON BUILDING_INFO ( MASSDESTINATION ); CREATE INDEX IDX_ZIPCODE ON BUILDING_INFO ( ZIPCODE );
BEGIN; ALTER TABLE patches DROP COLUMN IF EXISTS diff_stat_added; ALTER TABLE patches DROP COLUMN IF EXISTS diff_stat_changed; ALTER TABLE patches DROP COLUMN IF EXISTS diff_stat_deleted; COMMIT;
-- create_example.sql set serverout on declare v_sess utl_tcp.connection; v_inpt varchar2(4000); v_outp clob; begin v_sess := basex_client.open_session('localhost', 1984, 'admin', 'admin'); -- define input stream v_inpt := '<xml>Hello World!</xml>'; -- create new database basex_client.bx_create(v_sess, 'database', v_inpt); dbms_output.put_line(basex_client.bx_info); -- run query on database dbms_output.put_line(basex_client.bx_execute(v_sess, 'xquery doc(''database'')')); -- drop database v_outp := basex_client.bx_execute(v_sess, 'drop db database'); basex_client.close_session(v_sess); end; /
-- @testpoint: set方法设置参数gin_fuzzy_search_limit,无效值时,合理报错 --查看默认 show gin_fuzzy_search_limit; --设置,成功 set gin_fuzzy_search_limit to 2147483647; --设置,报错 set gin_fuzzy_search_limit to 'test'; set gin_fuzzy_search_limit to '2147483647%$#'; set gin_fuzzy_search_limit to '-1'; set gin_fuzzy_search_limit to '2147483648'; set gin_fuzzy_search_limit to ''; --no need to clean
<reponame>opengauss-mirror/Yat -- @testpoint: log函数入参为表达式 drop table if exists LOG_007; create table LOG_007(COL_LOG_B numeric, COL_LOG_X numeric); insert into LOG_007 values(log(log(1+2*6/4-2+ |/4, 64*4), ||/8)); select COL_LOG_B as RESULT from LOG_007; drop table if exists LOG_007;
<gh_stars>0 /* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50726 Source Host : localhost:3306 Source Database : example Target Server Type : MYSQL Target Server Version : 50726 File Encoding : 65001 Date: 2019-10-12 10:19:33 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for article -- ---------------------------- DROP TABLE IF EXISTS `article`; CREATE TABLE `article` ( `id` int(11) NOT NULL AUTO_INCREMENT, `content` varchar(255) DEFAULT '' COMMENT '文章内容', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `delete_status` varchar(1) DEFAULT '1' COMMENT '是否有效 1.有效 2无效', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='发布号作者表'; -- ---------------------------- -- Records of article -- ---------------------------- INSERT INTO `article` VALUES ('5', '莎士比亚', '2017-10-25 09:08:45', '2017-10-30 17:59:41', '1'); INSERT INTO `article` VALUES ('6', '亚里士多德', '2017-10-26 10:49:28', '2017-11-18 09:54:15', '1'); INSERT INTO `article` VALUES ('10', '亚历山大', '2017-10-26 14:57:45', '2017-11-08 13:28:52', '1'); INSERT INTO `article` VALUES ('11', '李白', '2017-10-26 15:23:42', '2017-10-26 15:23:42', '1'); INSERT INTO `article` VALUES ('19', '文章test2', '2017-11-18 13:37:07', '2017-11-18 13:37:11', '1'); -- ---------------------------- -- Table structure for sys_permission -- ---------------------------- DROP TABLE IF EXISTS `sys_permission`; CREATE TABLE `sys_permission` ( `id` int(11) NOT NULL DEFAULT '0' COMMENT '自定id,主要供前端展示权限列表分类排序使用.', `menu_code` varchar(255) DEFAULT '' COMMENT '归属菜单,前端判断并展示菜单使用,', `menu_name` varchar(255) DEFAULT '' COMMENT '菜单的中文释义', `permission_code` varchar(255) DEFAULT '' COMMENT '权限的代码/通配符,对应代码中@RequiresPermissions 的value', `permission_name` varchar(255) DEFAULT '' COMMENT '本权限的中文释义', `required_permission` tinyint(1) DEFAULT '2' COMMENT '是否本菜单必选权限, 1.必选 2非必选 通常是"列表"权限是必选', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='后台权限表'; -- ---------------------------- -- Records of sys_permission -- ---------------------------- INSERT INTO `sys_permission` VALUES ('11', 'wxUser', '微信用户', 'wxUser:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('12', 'wxUser', '微信用户', 'wxUser:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('13', 'wxUser', '微信用户', 'wxUser:astrict', '限制', '2'); INSERT INTO `sys_permission` VALUES ('14', 'wxUser', '微信用户', 'wxUser:follow', '关注&粉丝', '2'); INSERT INTO `sys_permission` VALUES ('15', 'wxUser', '微信用户', 'wxUser:collection', '收藏', '2'); INSERT INTO `sys_permission` VALUES ('21', 'notice', '通知推送', 'notice:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('22', 'notice', '通知推送', 'notice:send', '发送消息', '2'); INSERT INTO `sys_permission` VALUES ('23', 'notice', '通知推送', 'notice:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('31', 'banner', '滚动栏', 'banner:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('32', 'banner', '滚动栏', 'banner:add', '新增', '2'); INSERT INTO `sys_permission` VALUES ('33', 'banner', '滚动栏', 'banner:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('34', 'banner', '滚动栏', 'banner:sort', '排序', '2'); INSERT INTO `sys_permission` VALUES ('35', 'banner', '滚动栏', 'banner:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('41', 'postType', '帖子类别', 'postType:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('42', 'postType', '帖子类别', 'postType:add', '新增', '2'); INSERT INTO `sys_permission` VALUES ('43', 'postType', '帖子类别', 'postType:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('44', 'postType', '帖子类别', 'postType:sort', '排序', '2'); INSERT INTO `sys_permission` VALUES ('45', 'postType', '帖子类别', 'postType:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('51', 'postLabel', '帖子标签', 'postLabel:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('52', 'postLabel', '帖子标签', 'postType:add:list', '新增', '2'); INSERT INTO `sys_permission` VALUES ('53', 'postLabel', '帖子标签', 'postLabel:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('54', 'postLabel', '帖子标签', 'postLabel:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('61', 'noticeTemplate', '通知模版', 'noticeTemplate:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('62', 'noticeTemplate', '通知模版', 'noticeTemplate:add', '新增', '2'); INSERT INTO `sys_permission` VALUES ('63', 'noticeTemplate', '通知模版', 'noticeTemplate:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('64', 'noticeTemplate', '通知模版', 'noticeTemplate:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('71', 'top', '置顶管理', 'top:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('72', 'top', '置顶管理', 'top:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('73', 'top', '置顶管理', 'top:sort', '排序', '2'); INSERT INTO `sys_permission` VALUES ('74', 'top', '置顶管理', 'top:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('81', 'post', '帖子管理', 'post:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('82', 'post', '帖子管理', 'post:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('83', 'post', '帖子管理', 'post:top', '置顶', '2'); INSERT INTO `sys_permission` VALUES ('84', 'post', '帖子管理', 'post:shelf', '上/下架', '2'); INSERT INTO `sys_permission` VALUES ('85', 'post', '帖子管理', 'post:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('91', 'comment', '评论管理', 'comment:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('93', 'comment', '评论管理', 'comment:del', '删除', '2'); INSERT INTO `sys_permission` VALUES ('601', 'user', '用户', 'user:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('602', 'user', '用户', 'user:add', '新增', '2'); INSERT INTO `sys_permission` VALUES ('603', 'user', '用户', 'user:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('701', 'role', '角色权限', 'role:list', '列表', '1'); INSERT INTO `sys_permission` VALUES ('702', 'role', '角色权限', 'role:add', '新增', '2'); INSERT INTO `sys_permission` VALUES ('703', 'role', '角色权限', 'role:update', '修改', '2'); INSERT INTO `sys_permission` VALUES ('704', 'role', '角色权限', 'role:delete', '删除', '2'); INSERT INTO `sys_permission` VALUES ('1010', 'genderStatistics', '数据统计', 'statistics:gender:show', '性别', '1'); INSERT INTO `sys_permission` VALUES ('1020', 'postStatistics', '数据统计', 'statistics:post:show', '帖子', '1'); INSERT INTO `sys_permission` VALUES ('1030', 'resonateStatistics', '数据统计', 'statistics:follow:show', '关注', '1'); INSERT INTO `sys_permission` VALUES ('1040', 'regionStatistics', '数据统计', 'statistics:region:show', '地区', '1'); -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `role_name` varchar(20) DEFAULT NULL COMMENT '角色名', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `delete_status` varchar(1) DEFAULT '1' COMMENT '是否有效 1有效 2无效', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='后台角色表'; -- ---------------------------- -- Records of sys_role -- ---------------------------- INSERT INTO `sys_role` VALUES ('1', '管理员', '2017-11-22 16:24:34', '2017-11-22 16:24:52', '1'); INSERT INTO `sys_role` VALUES ('2', '作家', '2017-11-22 16:24:34', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role` VALUES ('3', '程序员', '2017-11-22 16:28:47', '2017-11-22 16:28:47', '1'); INSERT INTO `sys_role` VALUES ('4', '微信小程序管理员', '2019-06-20 17:35:05', '2019-06-20 17:35:12', '1'); -- ---------------------------- -- Table structure for sys_role_permission -- ---------------------------- DROP TABLE IF EXISTS `sys_role_permission`; CREATE TABLE `sys_role_permission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `role_id` int(11) DEFAULT NULL COMMENT '角色id', `permission_id` int(11) DEFAULT NULL COMMENT '权限id', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `delete_status` varchar(1) DEFAULT '1' COMMENT '是否有效 1有效 2无效', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='角色-权限关联表'; -- ---------------------------- -- Records of sys_role_permission -- ---------------------------- INSERT INTO `sys_role_permission` VALUES ('1', '2', '101', '2017-11-22 16:26:21', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('2', '2', '102', '2017-11-22 16:26:21', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('5', '2', '602', '2017-11-22 16:28:28', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('6', '2', '601', '2017-11-22 16:28:28', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('7', '2', '603', '2017-11-22 16:28:28', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('8', '2', '703', '2017-11-22 16:28:28', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('9', '2', '701', '2017-11-22 16:28:28', '2019-06-20 18:26:50', '2'); INSERT INTO `sys_role_permission` VALUES ('10', '2', '702', '2017-11-22 16:28:28', '2019-06-20 18:26:50', '2'); INSERT INTO `sys_role_permission` VALUES ('11', '2', '704', '2017-11-22 16:28:31', '2019-06-13 16:12:25', '2'); INSERT INTO `sys_role_permission` VALUES ('12', '2', '103', '2017-11-22 16:28:31', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('13', '3', '601', '2017-11-22 16:28:47', '2017-11-22 16:28:47', '1'); INSERT INTO `sys_role_permission` VALUES ('14', '3', '701', '2017-11-22 16:28:47', '2017-11-22 16:28:47', '1'); INSERT INTO `sys_role_permission` VALUES ('15', '3', '702', '2017-11-22 16:35:01', '2017-11-22 16:35:01', '1'); INSERT INTO `sys_role_permission` VALUES ('16', '3', '704', '2017-11-22 16:35:01', '2017-11-22 16:35:01', '1'); INSERT INTO `sys_role_permission` VALUES ('17', '3', '102', '2017-11-22 16:35:01', '2017-11-22 16:35:01', '1'); INSERT INTO `sys_role_permission` VALUES ('18', '3', '101', '2017-11-22 16:35:01', '2017-11-22 16:35:01', '1'); INSERT INTO `sys_role_permission` VALUES ('19', '3', '603', '2017-11-22 16:35:01', '2017-11-22 16:35:01', '1'); INSERT INTO `sys_role_permission` VALUES ('20', '2', '704', '2019-06-13 16:12:49', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('21', '4', '801', '2019-06-20 17:37:36', '2019-06-20 17:37:36', '1'); INSERT INTO `sys_role_permission` VALUES ('22', '4', '802', '2019-06-20 17:37:36', '2019-06-20 17:37:36', '1'); INSERT INTO `sys_role_permission` VALUES ('23', '2', '801', '2019-06-20 18:27:16', '2019-08-29 14:00:46', '2'); INSERT INTO `sys_role_permission` VALUES ('24', '4', '101', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('25', '4', '102', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('26', '4', '103', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('27', '4', '601', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('28', '4', '602', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('29', '4', '603', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('30', '4', '701', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('31', '4', '702', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('32', '4', '703', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); INSERT INTO `sys_role_permission` VALUES ('33', '4', '704', '2019-06-20 18:29:59', '2019-06-20 18:29:59', '1'); -- ---------------------------- -- Table structure for sys_user -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) DEFAULT NULL COMMENT '用户名', `password` varchar(255) DEFAULT NULL COMMENT '密码', `nickname` varchar(255) DEFAULT NULL COMMENT '昵称', `role_id` int(11) DEFAULT '0' COMMENT '角色ID', `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `delete_status` varchar(1) DEFAULT '1' COMMENT '是否有效 1有效 2无效', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10009 DEFAULT CHARSET=utf8 COMMENT='运营后台用户表'; -- ---------------------------- -- Records of sys_user -- ---------------------------- INSERT INTO `sys_user` VALUES ('10003', 'admin', '123456', '超级用户23', '1', '2017-10-30 11:52:38', '2017-11-17 23:51:40', '1'); INSERT INTO `sys_user` VALUES ('10004', 'user', '123456', '莎士比亚', '3', '2017-10-30 16:13:02', '2019-06-20 18:27:03', '1'); INSERT INTO `sys_user` VALUES ('10005', 'aaa', '123456', 'abba', '1', '2017-11-15 14:02:56', '2017-11-17 23:51:42', '1'); INSERT INTO `sys_user` VALUES ('10007', 'test', '123456', '就看看列表', '3', '2017-11-22 16:29:41', '2017-11-22 16:29:41', '1'); INSERT INTO `sys_user` VALUES ('10008', 'WXADMIN', '123456', 'LINGLING', '4', '2019-06-20 17:37:08', '2019-06-20 17:37:08', '1'); -- ---------------------------- -- Table structure for t_advert_banner -- ---------------------------- DROP TABLE IF EXISTS `t_advert_banner`; CREATE TABLE `t_advert_banner` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '广告栏ID', `ADVERT_TITLE` varchar(100) DEFAULT NULL COMMENT '广告标题,今后台查看', `IMG_URL` varchar(255) DEFAULT NULL COMMENT '图片URL', `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', `SORT_TIME` datetime DEFAULT NULL COMMENT '排序时间', `IS_DEL` tinyint(4) DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_advert_banner -- ---------------------------- INSERT INTO `t_advert_banner` VALUES ('1', '新开楼盘', 'http://img.since0592.com/static/01.jpg', '2019-07-25 14:09:56', '2019-07-25 14:09:59', '1'); INSERT INTO `t_advert_banner` VALUES ('2', '特价楼房', 'http://img.since0592.com/static/02.jpg', '2019-07-25 14:12:28', '2019-07-25 14:09:59', '0'); INSERT INTO `t_advert_banner` VALUES ('3', '楼盘降价', 'http://img.since0592.com/static/03.jpg', '2019-07-25 14:14:14', '2019-07-25 14:10:00', '0'); INSERT INTO `t_advert_banner` VALUES ('4', '倒数第二张', 'http://img.since0592.com/static/06.jpg', '2019-07-25 14:46:31', '2019-07-25 14:10:00', '0'); INSERT INTO `t_advert_banner` VALUES ('5', '最后一张', 'http://img.since0592.com/static/05.jpg', '2019-07-31 10:37:52', '2019-07-25 14:10:01', '0'); INSERT INTO `t_advert_banner` VALUES ('6', '倒数第二张', 'http://img.since0592.com/static/04.jpg', '2019-07-31 10:54:55', '2019-07-25 14:09:59', '1'); INSERT INTO `t_advert_banner` VALUES ('8', '假的', 'http://img.since0592.com/static/42b01483e0384ba28356733bf07b9654.jpg', '2019-08-09 15:56:25', '2019-07-25 14:10:00', '0'); -- ---------------------------- -- Table structure for t_comment -- ---------------------------- DROP TABLE IF EXISTS `t_comment`; CREATE TABLE `t_comment` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论ID', `POST_ID` int(11) NOT NULL COMMENT '帖子ID', `START_ID` varchar(128) NOT NULL COMMENT '发起评论人的ID', `RECEIVE_ID` varchar(128) DEFAULT NULL COMMENT '接收人ID', `CONTENT` text CHARACTER SET utf8mb4 NOT NULL COMMENT '文本内容', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_comment -- ---------------------------- INSERT INTO `t_comment` VALUES ('34', '20', '4c23311a9e3441c9885bb4e79f3f9dbc', '', '哈哈哈哈哈', '2019-08-30 18:23:41', '0'); INSERT INTO `t_comment` VALUES ('35', '20', '4c23311a9e3441c9885bb4e79f3f9dbc', '', '歇歇', '2019-08-30 18:24:09', '0'); INSERT INTO `t_comment` VALUES ('36', '20', '4c23311a9e3441c9885bb4e79f3f9dbc', '', '哈哈', '2019-08-31 12:17:33', '0'); INSERT INTO `t_comment` VALUES ('37', '21', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '', '猜猜我是谁', '2019-09-04 11:05:14', '0'); INSERT INTO `t_comment` VALUES ('38', '34', '9f8602df-7d62-4acd-b921-c523106ed28a', '', 'hxbxbx', '2019-09-09 23:37:26', '1'); INSERT INTO `t_comment` VALUES ('39', '34', '9f8602df-7d62-4acd-b921-c523106ed28a', '', '如果满行了怎么办?如果满行了怎么如果满行了怎么如果满行了怎么办???', '2019-09-09 23:38:11', '1'); INSERT INTO `t_comment` VALUES ('40', '37', '4c23311a9e3441c9885bb4e79f3f9dbc', '', '哈哈哈哈', '2019-09-10 20:25:46', '0'); INSERT INTO `t_comment` VALUES ('41', '38', 'f6a1bac7f5e345feb6da0737171f5e2b', '', '评论测试', '2019-10-08 11:47:47', '0'); INSERT INTO `t_comment` VALUES ('42', '44', '2761e95f94974c46b438e857f55b92cb', '', '首页地图跳转', '2019-10-08 15:56:39', '0'); INSERT INTO `t_comment` VALUES ('43', '44', '2761e95f94974c46b438e857f55b92cb', '', '?', '2019-10-08 15:56:48', '0'); -- ---------------------------- -- Table structure for t_label -- ---------------------------- DROP TABLE IF EXISTS `t_label`; CREATE TABLE `t_label` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `POST_ID` int(11) NOT NULL, `LABEL_ID` int(11) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=806 DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of t_label -- ---------------------------- INSERT INTO `t_label` VALUES ('439', '20', '242'); INSERT INTO `t_label` VALUES ('440', '20', '247'); INSERT INTO `t_label` VALUES ('441', '20', '253'); INSERT INTO `t_label` VALUES ('442', '20', '258'); INSERT INTO `t_label` VALUES ('443', '20', '263'); INSERT INTO `t_label` VALUES ('444', '21', '240'); INSERT INTO `t_label` VALUES ('445', '21', '245'); INSERT INTO `t_label` VALUES ('446', '21', '246'); INSERT INTO `t_label` VALUES ('447', '21', '251'); INSERT INTO `t_label` VALUES ('448', '21', '220'); INSERT INTO `t_label` VALUES ('449', '21', '221'); INSERT INTO `t_label` VALUES ('450', '21', '223'); INSERT INTO `t_label` VALUES ('451', '21', '322'); INSERT INTO `t_label` VALUES ('452', '21', '323'); INSERT INTO `t_label` VALUES ('453', '21', '324'); INSERT INTO `t_label` VALUES ('454', '21', '325'); INSERT INTO `t_label` VALUES ('455', '21', '328'); INSERT INTO `t_label` VALUES ('456', '21', '329'); INSERT INTO `t_label` VALUES ('457', '21', '330'); INSERT INTO `t_label` VALUES ('458', '21', '332'); INSERT INTO `t_label` VALUES ('459', '21', '333'); INSERT INTO `t_label` VALUES ('460', '21', '334'); INSERT INTO `t_label` VALUES ('461', '21', '335'); INSERT INTO `t_label` VALUES ('462', '21', '340'); INSERT INTO `t_label` VALUES ('463', '21', '343'); INSERT INTO `t_label` VALUES ('464', '21', '345'); INSERT INTO `t_label` VALUES ('465', '21', '346'); INSERT INTO `t_label` VALUES ('466', '21', '347'); INSERT INTO `t_label` VALUES ('467', '21', '348'); INSERT INTO `t_label` VALUES ('468', '21', '349'); INSERT INTO `t_label` VALUES ('469', '21', '350'); INSERT INTO `t_label` VALUES ('470', '21', '326'); INSERT INTO `t_label` VALUES ('471', '21', '327'); INSERT INTO `t_label` VALUES ('472', '21', '331'); INSERT INTO `t_label` VALUES ('473', '21', '336'); INSERT INTO `t_label` VALUES ('474', '21', '337'); INSERT INTO `t_label` VALUES ('475', '21', '338'); INSERT INTO `t_label` VALUES ('476', '21', '339'); INSERT INTO `t_label` VALUES ('477', '21', '341'); INSERT INTO `t_label` VALUES ('478', '21', '342'); INSERT INTO `t_label` VALUES ('479', '21', '344'); INSERT INTO `t_label` VALUES ('480', '22', '240'); INSERT INTO `t_label` VALUES ('481', '22', '323'); INSERT INTO `t_label` VALUES ('482', '22', '329'); INSERT INTO `t_label` VALUES ('483', '22', '347'); INSERT INTO `t_label` VALUES ('484', '23', '259'); INSERT INTO `t_label` VALUES ('485', '23', '14'); INSERT INTO `t_label` VALUES ('486', '23', '259'); INSERT INTO `t_label` VALUES ('487', '23', '261'); INSERT INTO `t_label` VALUES ('488', '23', '324'); INSERT INTO `t_label` VALUES ('489', '23', '325'); INSERT INTO `t_label` VALUES ('490', '23', '332'); INSERT INTO `t_label` VALUES ('491', '23', '340'); INSERT INTO `t_label` VALUES ('492', '23', '350'); INSERT INTO `t_label` VALUES ('493', '23', '326'); INSERT INTO `t_label` VALUES ('494', '23', '344'); INSERT INTO `t_label` VALUES ('495', '24', '16'); INSERT INTO `t_label` VALUES ('496', '24', '242'); INSERT INTO `t_label` VALUES ('497', '24', '243'); INSERT INTO `t_label` VALUES ('498', '24', '244'); INSERT INTO `t_label` VALUES ('499', '24', '16'); INSERT INTO `t_label` VALUES ('500', '24', '242'); INSERT INTO `t_label` VALUES ('501', '24', '244'); INSERT INTO `t_label` VALUES ('502', '24', '323'); INSERT INTO `t_label` VALUES ('503', '24', '324'); INSERT INTO `t_label` VALUES ('504', '24', '325'); INSERT INTO `t_label` VALUES ('505', '24', '332'); INSERT INTO `t_label` VALUES ('506', '24', '350'); INSERT INTO `t_label` VALUES ('507', '24', '331'); INSERT INTO `t_label` VALUES ('508', '24', '344'); INSERT INTO `t_label` VALUES ('509', '25', '16'); INSERT INTO `t_label` VALUES ('510', '25', '241'); INSERT INTO `t_label` VALUES ('511', '25', '242'); INSERT INTO `t_label` VALUES ('512', '25', '243'); INSERT INTO `t_label` VALUES ('513', '25', '15'); INSERT INTO `t_label` VALUES ('514', '25', '241'); INSERT INTO `t_label` VALUES ('515', '25', '242'); INSERT INTO `t_label` VALUES ('516', '25', '243'); INSERT INTO `t_label` VALUES ('517', '25', '324'); INSERT INTO `t_label` VALUES ('518', '25', '325'); INSERT INTO `t_label` VALUES ('519', '25', '332'); INSERT INTO `t_label` VALUES ('520', '25', '349'); INSERT INTO `t_label` VALUES ('521', '25', '350'); INSERT INTO `t_label` VALUES ('522', '25', '326'); INSERT INTO `t_label` VALUES ('523', '25', '331'); INSERT INTO `t_label` VALUES ('524', '26', '15'); INSERT INTO `t_label` VALUES ('525', '26', '240'); INSERT INTO `t_label` VALUES ('526', '26', '241'); INSERT INTO `t_label` VALUES ('527', '26', '242'); INSERT INTO `t_label` VALUES ('528', '26', '324'); INSERT INTO `t_label` VALUES ('529', '26', '325'); INSERT INTO `t_label` VALUES ('530', '26', '345'); INSERT INTO `t_label` VALUES ('531', '26', '350'); INSERT INTO `t_label` VALUES ('532', '26', '336'); INSERT INTO `t_label` VALUES ('533', '26', '342'); INSERT INTO `t_label` VALUES ('534', '27', '14'); INSERT INTO `t_label` VALUES ('535', '27', '259'); INSERT INTO `t_label` VALUES ('536', '27', '324'); INSERT INTO `t_label` VALUES ('537', '27', '325'); INSERT INTO `t_label` VALUES ('538', '27', '332'); INSERT INTO `t_label` VALUES ('539', '27', '340'); INSERT INTO `t_label` VALUES ('540', '27', '349'); INSERT INTO `t_label` VALUES ('541', '27', '350'); INSERT INTO `t_label` VALUES ('542', '27', '326'); INSERT INTO `t_label` VALUES ('543', '27', '327'); INSERT INTO `t_label` VALUES ('544', '27', '331'); INSERT INTO `t_label` VALUES ('545', '27', '336'); INSERT INTO `t_label` VALUES ('546', '28', '377'); INSERT INTO `t_label` VALUES ('547', '28', '381'); INSERT INTO `t_label` VALUES ('548', '28', '329'); INSERT INTO `t_label` VALUES ('549', '28', '332'); INSERT INTO `t_label` VALUES ('550', '28', '326'); INSERT INTO `t_label` VALUES ('551', '28', '327'); INSERT INTO `t_label` VALUES ('552', '29', '377'); INSERT INTO `t_label` VALUES ('553', '29', '378'); INSERT INTO `t_label` VALUES ('554', '30', '377'); INSERT INTO `t_label` VALUES ('555', '30', '378'); INSERT INTO `t_label` VALUES ('556', '30', '329'); INSERT INTO `t_label` VALUES ('557', '30', '332'); INSERT INTO `t_label` VALUES ('558', '30', '326'); INSERT INTO `t_label` VALUES ('559', '30', '327'); INSERT INTO `t_label` VALUES ('560', '31', '377'); INSERT INTO `t_label` VALUES ('561', '31', '378'); INSERT INTO `t_label` VALUES ('562', '31', '329'); INSERT INTO `t_label` VALUES ('563', '31', '332'); INSERT INTO `t_label` VALUES ('564', '31', '326'); INSERT INTO `t_label` VALUES ('565', '31', '327'); INSERT INTO `t_label` VALUES ('566', '31', '16'); INSERT INTO `t_label` VALUES ('567', '31', '248'); INSERT INTO `t_label` VALUES ('568', '32', '377'); INSERT INTO `t_label` VALUES ('569', '32', '378'); INSERT INTO `t_label` VALUES ('570', '32', '329'); INSERT INTO `t_label` VALUES ('571', '32', '332'); INSERT INTO `t_label` VALUES ('572', '32', '326'); INSERT INTO `t_label` VALUES ('573', '32', '327'); INSERT INTO `t_label` VALUES ('574', '32', '16'); INSERT INTO `t_label` VALUES ('575', '32', '248'); INSERT INTO `t_label` VALUES ('576', '33', '328'); INSERT INTO `t_label` VALUES ('577', '33', '329'); INSERT INTO `t_label` VALUES ('578', '33', '330'); INSERT INTO `t_label` VALUES ('579', '33', '334'); INSERT INTO `t_label` VALUES ('580', '33', '335'); INSERT INTO `t_label` VALUES ('581', '33', '14'); INSERT INTO `t_label` VALUES ('582', '33', '15'); INSERT INTO `t_label` VALUES ('583', '33', '16'); INSERT INTO `t_label` VALUES ('584', '33', '17'); INSERT INTO `t_label` VALUES ('585', '33', '18'); INSERT INTO `t_label` VALUES ('586', '33', '377'); INSERT INTO `t_label` VALUES ('587', '33', '378'); INSERT INTO `t_label` VALUES ('588', '33', '379'); INSERT INTO `t_label` VALUES ('589', '34', '328'); INSERT INTO `t_label` VALUES ('590', '34', '329'); INSERT INTO `t_label` VALUES ('591', '34', '330'); INSERT INTO `t_label` VALUES ('592', '34', '334'); INSERT INTO `t_label` VALUES ('593', '34', '335'); INSERT INTO `t_label` VALUES ('594', '34', '14'); INSERT INTO `t_label` VALUES ('595', '34', '15'); INSERT INTO `t_label` VALUES ('596', '34', '16'); INSERT INTO `t_label` VALUES ('597', '34', '17'); INSERT INTO `t_label` VALUES ('598', '34', '18'); INSERT INTO `t_label` VALUES ('599', '34', '377'); INSERT INTO `t_label` VALUES ('600', '34', '378'); INSERT INTO `t_label` VALUES ('601', '34', '379'); INSERT INTO `t_label` VALUES ('603', '36', '257'); INSERT INTO `t_label` VALUES ('604', '37', '243'); INSERT INTO `t_label` VALUES ('605', '37', '248'); INSERT INTO `t_label` VALUES ('606', '37', '253'); INSERT INTO `t_label` VALUES ('607', '37', '259'); INSERT INTO `t_label` VALUES ('608', '37', '378'); INSERT INTO `t_label` VALUES ('609', '37', '379'); INSERT INTO `t_label` VALUES ('610', '37', '380'); INSERT INTO `t_label` VALUES ('611', '38', '324'); INSERT INTO `t_label` VALUES ('612', '38', '330'); INSERT INTO `t_label` VALUES ('613', '38', '335'); INSERT INTO `t_label` VALUES ('614', '38', '340'); INSERT INTO `t_label` VALUES ('615', '38', '243'); INSERT INTO `t_label` VALUES ('616', '38', '248'); INSERT INTO `t_label` VALUES ('617', '38', '253'); INSERT INTO `t_label` VALUES ('618', '38', '259'); INSERT INTO `t_label` VALUES ('619', '38', '378'); INSERT INTO `t_label` VALUES ('620', '38', '379'); INSERT INTO `t_label` VALUES ('621', '38', '380'); INSERT INTO `t_label` VALUES ('622', '39', '242'); INSERT INTO `t_label` VALUES ('623', '39', '252'); INSERT INTO `t_label` VALUES ('624', '39', '379'); INSERT INTO `t_label` VALUES ('625', '39', '381'); INSERT INTO `t_label` VALUES ('626', '40', '324'); INSERT INTO `t_label` VALUES ('627', '40', '325'); INSERT INTO `t_label` VALUES ('628', '40', '332'); INSERT INTO `t_label` VALUES ('629', '40', '340'); INSERT INTO `t_label` VALUES ('630', '40', '258'); INSERT INTO `t_label` VALUES ('631', '40', '260'); INSERT INTO `t_label` VALUES ('632', '40', '378'); INSERT INTO `t_label` VALUES ('633', '40', '385'); INSERT INTO `t_label` VALUES ('634', '41', '322'); INSERT INTO `t_label` VALUES ('635', '41', '323'); INSERT INTO `t_label` VALUES ('636', '41', '324'); INSERT INTO `t_label` VALUES ('637', '41', '325'); INSERT INTO `t_label` VALUES ('638', '41', '328'); INSERT INTO `t_label` VALUES ('639', '41', '329'); INSERT INTO `t_label` VALUES ('640', '41', '330'); INSERT INTO `t_label` VALUES ('641', '41', '332'); INSERT INTO `t_label` VALUES ('642', '41', '333'); INSERT INTO `t_label` VALUES ('643', '41', '334'); INSERT INTO `t_label` VALUES ('644', '41', '335'); INSERT INTO `t_label` VALUES ('645', '41', '340'); INSERT INTO `t_label` VALUES ('646', '41', '343'); INSERT INTO `t_label` VALUES ('647', '41', '345'); INSERT INTO `t_label` VALUES ('648', '41', '346'); INSERT INTO `t_label` VALUES ('649', '41', '347'); INSERT INTO `t_label` VALUES ('650', '41', '348'); INSERT INTO `t_label` VALUES ('651', '41', '349'); INSERT INTO `t_label` VALUES ('652', '41', '350'); INSERT INTO `t_label` VALUES ('653', '41', '326'); INSERT INTO `t_label` VALUES ('654', '41', '327'); INSERT INTO `t_label` VALUES ('655', '41', '331'); INSERT INTO `t_label` VALUES ('656', '41', '336'); INSERT INTO `t_label` VALUES ('657', '41', '337'); INSERT INTO `t_label` VALUES ('658', '41', '338'); INSERT INTO `t_label` VALUES ('659', '41', '339'); INSERT INTO `t_label` VALUES ('660', '41', '341'); INSERT INTO `t_label` VALUES ('661', '41', '342'); INSERT INTO `t_label` VALUES ('662', '41', '344'); INSERT INTO `t_label` VALUES ('663', '41', '14'); INSERT INTO `t_label` VALUES ('664', '41', '16'); INSERT INTO `t_label` VALUES ('665', '41', '18'); INSERT INTO `t_label` VALUES ('666', '41', '19'); INSERT INTO `t_label` VALUES ('667', '41', '240'); INSERT INTO `t_label` VALUES ('668', '41', '244'); INSERT INTO `t_label` VALUES ('669', '41', '253'); INSERT INTO `t_label` VALUES ('670', '41', '263'); INSERT INTO `t_label` VALUES ('671', '41', '265'); INSERT INTO `t_label` VALUES ('672', '41', '266'); INSERT INTO `t_label` VALUES ('673', '41', '392'); INSERT INTO `t_label` VALUES ('674', '41', '394'); INSERT INTO `t_label` VALUES ('675', '41', '397'); INSERT INTO `t_label` VALUES ('676', '41', '400'); INSERT INTO `t_label` VALUES ('677', '42', '322'); INSERT INTO `t_label` VALUES ('678', '42', '323'); INSERT INTO `t_label` VALUES ('679', '42', '324'); INSERT INTO `t_label` VALUES ('680', '42', '325'); INSERT INTO `t_label` VALUES ('681', '42', '328'); INSERT INTO `t_label` VALUES ('682', '42', '329'); INSERT INTO `t_label` VALUES ('683', '42', '330'); INSERT INTO `t_label` VALUES ('684', '42', '332'); INSERT INTO `t_label` VALUES ('685', '42', '333'); INSERT INTO `t_label` VALUES ('686', '42', '334'); INSERT INTO `t_label` VALUES ('687', '42', '335'); INSERT INTO `t_label` VALUES ('688', '42', '340'); INSERT INTO `t_label` VALUES ('689', '42', '343'); INSERT INTO `t_label` VALUES ('690', '42', '345'); INSERT INTO `t_label` VALUES ('691', '42', '346'); INSERT INTO `t_label` VALUES ('692', '42', '347'); INSERT INTO `t_label` VALUES ('693', '42', '348'); INSERT INTO `t_label` VALUES ('694', '42', '349'); INSERT INTO `t_label` VALUES ('695', '42', '350'); INSERT INTO `t_label` VALUES ('696', '42', '326'); INSERT INTO `t_label` VALUES ('697', '42', '327'); INSERT INTO `t_label` VALUES ('698', '42', '331'); INSERT INTO `t_label` VALUES ('699', '42', '336'); INSERT INTO `t_label` VALUES ('700', '42', '337'); INSERT INTO `t_label` VALUES ('701', '42', '338'); INSERT INTO `t_label` VALUES ('702', '42', '339'); INSERT INTO `t_label` VALUES ('703', '42', '341'); INSERT INTO `t_label` VALUES ('704', '42', '342'); INSERT INTO `t_label` VALUES ('705', '42', '344'); INSERT INTO `t_label` VALUES ('706', '42', '14'); INSERT INTO `t_label` VALUES ('707', '42', '16'); INSERT INTO `t_label` VALUES ('708', '42', '18'); INSERT INTO `t_label` VALUES ('709', '42', '19'); INSERT INTO `t_label` VALUES ('710', '42', '240'); INSERT INTO `t_label` VALUES ('711', '42', '244'); INSERT INTO `t_label` VALUES ('712', '42', '253'); INSERT INTO `t_label` VALUES ('713', '42', '263'); INSERT INTO `t_label` VALUES ('714', '42', '265'); INSERT INTO `t_label` VALUES ('715', '42', '266'); INSERT INTO `t_label` VALUES ('716', '42', '392'); INSERT INTO `t_label` VALUES ('717', '42', '394'); INSERT INTO `t_label` VALUES ('718', '42', '397'); INSERT INTO `t_label` VALUES ('719', '42', '400'); INSERT INTO `t_label` VALUES ('720', '43', '322'); INSERT INTO `t_label` VALUES ('721', '43', '323'); INSERT INTO `t_label` VALUES ('722', '43', '324'); INSERT INTO `t_label` VALUES ('723', '43', '325'); INSERT INTO `t_label` VALUES ('724', '43', '328'); INSERT INTO `t_label` VALUES ('725', '43', '329'); INSERT INTO `t_label` VALUES ('726', '43', '330'); INSERT INTO `t_label` VALUES ('727', '43', '332'); INSERT INTO `t_label` VALUES ('728', '43', '333'); INSERT INTO `t_label` VALUES ('729', '43', '334'); INSERT INTO `t_label` VALUES ('730', '43', '340'); INSERT INTO `t_label` VALUES ('731', '43', '343'); INSERT INTO `t_label` VALUES ('732', '43', '345'); INSERT INTO `t_label` VALUES ('733', '43', '346'); INSERT INTO `t_label` VALUES ('734', '43', '347'); INSERT INTO `t_label` VALUES ('735', '43', '348'); INSERT INTO `t_label` VALUES ('736', '43', '349'); INSERT INTO `t_label` VALUES ('737', '43', '326'); INSERT INTO `t_label` VALUES ('738', '43', '327'); INSERT INTO `t_label` VALUES ('739', '43', '331'); INSERT INTO `t_label` VALUES ('740', '43', '336'); INSERT INTO `t_label` VALUES ('741', '43', '337'); INSERT INTO `t_label` VALUES ('742', '43', '338'); INSERT INTO `t_label` VALUES ('743', '43', '339'); INSERT INTO `t_label` VALUES ('744', '43', '342'); INSERT INTO `t_label` VALUES ('745', '43', '344'); INSERT INTO `t_label` VALUES ('746', '43', '14'); INSERT INTO `t_label` VALUES ('747', '43', '16'); INSERT INTO `t_label` VALUES ('748', '43', '18'); INSERT INTO `t_label` VALUES ('749', '43', '19'); INSERT INTO `t_label` VALUES ('750', '43', '240'); INSERT INTO `t_label` VALUES ('751', '43', '244'); INSERT INTO `t_label` VALUES ('752', '43', '253'); INSERT INTO `t_label` VALUES ('753', '43', '263'); INSERT INTO `t_label` VALUES ('754', '43', '265'); INSERT INTO `t_label` VALUES ('755', '43', '266'); INSERT INTO `t_label` VALUES ('756', '43', '392'); INSERT INTO `t_label` VALUES ('757', '43', '394'); INSERT INTO `t_label` VALUES ('758', '43', '397'); INSERT INTO `t_label` VALUES ('759', '43', '400'); INSERT INTO `t_label` VALUES ('760', '44', '322'); INSERT INTO `t_label` VALUES ('761', '44', '323'); INSERT INTO `t_label` VALUES ('762', '44', '324'); INSERT INTO `t_label` VALUES ('763', '44', '325'); INSERT INTO `t_label` VALUES ('764', '44', '328'); INSERT INTO `t_label` VALUES ('765', '44', '332'); INSERT INTO `t_label` VALUES ('766', '44', '333'); INSERT INTO `t_label` VALUES ('767', '44', '334'); INSERT INTO `t_label` VALUES ('768', '44', '335'); INSERT INTO `t_label` VALUES ('769', '44', '340'); INSERT INTO `t_label` VALUES ('770', '44', '343'); INSERT INTO `t_label` VALUES ('771', '44', '345'); INSERT INTO `t_label` VALUES ('772', '44', '346'); INSERT INTO `t_label` VALUES ('773', '44', '347'); INSERT INTO `t_label` VALUES ('774', '44', '348'); INSERT INTO `t_label` VALUES ('775', '44', '349'); INSERT INTO `t_label` VALUES ('776', '44', '350'); INSERT INTO `t_label` VALUES ('777', '44', '326'); INSERT INTO `t_label` VALUES ('778', '44', '327'); INSERT INTO `t_label` VALUES ('779', '44', '331'); INSERT INTO `t_label` VALUES ('780', '44', '336'); INSERT INTO `t_label` VALUES ('781', '44', '337'); INSERT INTO `t_label` VALUES ('782', '44', '338'); INSERT INTO `t_label` VALUES ('783', '44', '339'); INSERT INTO `t_label` VALUES ('784', '44', '342'); INSERT INTO `t_label` VALUES ('785', '44', '344'); INSERT INTO `t_label` VALUES ('786', '44', '14'); INSERT INTO `t_label` VALUES ('787', '44', '18'); INSERT INTO `t_label` VALUES ('788', '44', '263'); INSERT INTO `t_label` VALUES ('789', '44', '266'); INSERT INTO `t_label` VALUES ('790', '44', '378'); INSERT INTO `t_label` VALUES ('791', '44', '382'); INSERT INTO `t_label` VALUES ('792', '44', '401'); INSERT INTO `t_label` VALUES ('793', '44', '403'); INSERT INTO `t_label` VALUES ('794', '45', '328'); INSERT INTO `t_label` VALUES ('795', '45', '330'); INSERT INTO `t_label` VALUES ('796', '45', '340'); INSERT INTO `t_label` VALUES ('797', '45', '336'); INSERT INTO `t_label` VALUES ('798', '45', '338'); INSERT INTO `t_label` VALUES ('799', '45', '15'); INSERT INTO `t_label` VALUES ('800', '45', '17'); INSERT INTO `t_label` VALUES ('801', '45', '248'); INSERT INTO `t_label` VALUES ('802', '45', '253'); INSERT INTO `t_label` VALUES ('803', '45', '257'); INSERT INTO `t_label` VALUES ('804', '45', '378'); INSERT INTO `t_label` VALUES ('805', '45', '385'); -- ---------------------------- -- Table structure for t_navigation -- ---------------------------- DROP TABLE IF EXISTS `t_navigation`; CREATE TABLE `t_navigation` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '导航栏ID', `TITLE` varchar(50) NOT NULL COMMENT '标签文本', `MAX_TOP_NUM` int(11) NOT NULL COMMENT '最大置顶数量', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_navigation -- ---------------------------- INSERT INTO `t_navigation` VALUES ('1', '人气', '0', '2019-07-29 10:36:56', '0'); INSERT INTO `t_navigation` VALUES ('2', '地铁周边', '0', '2019-07-29 10:37:16', '0'); INSERT INTO `t_navigation` VALUES ('3', '商圈附近', '0', '2019-08-01 15:01:30', '0'); INSERT INTO `t_navigation` VALUES ('4', '推荐', '0', '2019-08-16 10:28:14', '0'); INSERT INTO `t_navigation` VALUES ('5', '月租短租', '0', '2019-08-16 10:29:03', '0'); -- ---------------------------- -- Table structure for t_navigation_top -- ---------------------------- DROP TABLE IF EXISTS `t_navigation_top`; CREATE TABLE `t_navigation_top` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '置顶表ID', `NAVIGATION_ID` int(11) NOT NULL COMMENT '导航栏ID', `POST_ID` int(11) NOT NULL COMMENT '帖子ID', `SORT_TIME` datetime NOT NULL COMMENT '排序时间,用来排序使用', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_navigation_top -- ---------------------------- -- ---------------------------- -- Table structure for t_post_base -- ---------------------------- DROP TABLE IF EXISTS `t_post_base`; CREATE TABLE `t_post_base` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '帖子ID', `IS_TOP` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否置顶,默认0不是,1是', `USER_ID` varchar(128) NOT NULL COMMENT '发帖人ID', `TYPE_ID` int(11) NOT NULL COMMENT '帖子类型ID', `CONTENT` text CHARACTER SET utf8mb4 NOT NULL COMMENT '帖子文本', `MIN_PRICE` varchar(10) DEFAULT NULL COMMENT '最小价格', `MAX_PRICE` varchar(10) DEFAULT NULL COMMENT '最大价格', `PHONE` varchar(20) DEFAULT NULL COMMENT '电话', `ADDRESS` varchar(255) DEFAULT NULL COMMENT '地址文本', `LABELS` varchar(255) DEFAULT NULL COMMENT '标签集合', `TOTAL_BROWSE` int(11) NOT NULL DEFAULT '0' COMMENT '真实浏览量', `TOTAL_RESONATE` int(11) NOT NULL DEFAULT '0' COMMENT '真实点赞数量', `DEV_BROWSE` int(11) NOT NULL DEFAULT '0' COMMENT '偏移的浏览量,后台可以修改的地方', `DEV_RESONATE` int(11) NOT NULL DEFAULT '0' COMMENT '偏移的点赞量,后台可以修改的地方', `ACTIVE_TIME` datetime NOT NULL COMMENT '活跃时间,作为排序的依据', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_LOWER_SHELF` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否下架,0上架,1下架', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', `TOTAL_COLLECTION` int(11) NOT NULL DEFAULT '0', `TOTAL_COMMENTS` int(11) NOT NULL DEFAULT '0', `FEE` tinyint(4) NOT NULL DEFAULT '0', `IS_SUB` int(10) NOT NULL DEFAULT '0' COMMENT '是否为地铁周边,不是为0,是为1', `IS_MALL` int(10) NOT NULL DEFAULT '0' COMMENT '是否为商圈附近,不是为0,是为1', `CHECK_IN_TIME` datetime DEFAULT NULL, `CHECK_OUT_TIME` datetime DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_post_base -- ---------------------------- INSERT INTO `t_post_base` VALUES ('20', '0', '4c23311a9e3441c9885bb4e79f3f9dbc', '7', '哈哈哈哈哈', '1400', null, '18059336464', '厦门市集美区凤岐西路', '242,247,253,258,263', '11', '1', '0', '0', '2019-09-09 15:21:20', '2019-08-30 18:23:33', '0', '0', '3', '3', '1', '0', '1', null, null); INSERT INTO `t_post_base` VALUES ('21', '0', '0e882d97f3be466794a368e877d6bc90', '7', 'sdasdasdsdasdasd', '1300', null, '18059936675', '福州市鼓楼区鼓屏路181-5号', '240,245,246,251,220,221,223,322,323,324,325,328,329,330,332,333,334,335,340,343,345,346,347,348,349,350,326,327,331,336,337,338,339,341,342,344', '13', '1', '0', '0', '2019-09-04 11:05:14', '2019-08-31 15:40:56', '0', '0', '1', '1', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('22', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '7', '我也不知道该写点什么', '250', null, '15387524575', '厦门市集美区岑东路168号', '240,323,329,347', '3', '0', '0', '0', '2019-09-04 13:33:24', '2019-09-04 13:33:24', '0', '1', '0', '0', '0', '0', '1', null, null); INSERT INTO `t_post_base` VALUES ('23', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试图片上传顺序及上次发帖记录', '250', null, '18649618752', '厦门市集美区凤岐西路', '259,14,259,261,324,325,332,340,350,326,344', '3', '0', '0', '0', '2019-09-05 13:08:49', '2019-09-05 13:08:49', '0', '1', '0', '0', '1', '0', '1', '2019-09-08 00:00:00', '2019-10-30 00:00:00'); INSERT INTO `t_post_base` VALUES ('24', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试发帖记录是否保留', '250', null, '15387524575', '厦门市集美区岑东路168号', '16,242,243,244,16,242,244,323,324,325,332,350,331,344', '1', '0', '0', '0', '2019-09-05 13:16:42', '2019-09-05 13:16:42', '0', '1', '0', '0', '1', '0', '1', '2019-09-06 00:00:00', '2019-10-16 00:00:00'); INSERT INTO `t_post_base` VALUES ('25', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试发帖后本地记录是否生效', '250', null, '15387524575', '厦门市集美区岑东路168号', '16,241,242,243,15,241,242,243,324,325,332,349,350,326,331', '0', '0', '0', '0', '2019-09-05 13:27:17', '2019-09-05 13:27:17', '0', '1', '0', '0', '1', '0', '1', '2019-09-06 00:00:00', '2019-10-16 00:00:00'); INSERT INTO `t_post_base` VALUES ('26', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试发帖记录是否保存', '250', null, '15387524575', '厦门市集美区岑东路168号', '15,240,241,242,324,325,345,350,336,342', '0', '0', '0', '0', '2019-09-05 13:33:21', '2019-09-05 13:33:21', '0', '1', '0', '0', '1', '0', '1', '2019-09-06 00:00:00', '2019-10-10 00:00:00'); INSERT INTO `t_post_base` VALUES ('27', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试上次发帖内容的加载', '6666', null, '15387524575', '厦门市集美区凤岐西路', '14,259,324,325,332,340,349,350,326,327,331,336', '0', '0', '0', '0', '2019-09-05 19:23:46', '2019-09-05 19:23:46', '0', '1', '0', '0', '1', '0', '1', '2019-09-06 00:00:00', '2019-10-30 00:00:00'); INSERT INTO `t_post_base` VALUES ('33', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试标签加载是否正确', '250', null, '15387524575', '厦门市集美区岑东路168号', '328,329,330,334,335,14,15,16,17,18,377,378,379', '4', '0', '0', '0', '2019-09-09 14:50:00', '2019-09-09 14:50:00', '0', '0', '0', '0', '1', '1', '1', '2019-09-09 00:00:00', '2019-12-09 00:00:00'); INSERT INTO `t_post_base` VALUES ('34', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试标签加载是否正确2', '250', null, '15387524575', '厦门市集美区岑东路168号', '328,329,330,334,335,14,15,16,17,18,377,378,379', '5', '0', '0', '0', '2019-09-09 23:38:11', '2019-09-09 14:50:48', '0', '1', '0', '2', '1', '1', '1', '2019-09-09 00:00:00', '2019-12-09 00:00:00'); INSERT INTO `t_post_base` VALUES ('36', '0', '9f8602df-7d62-4acd-b921-c523106ed28a', '7', '来租房', '2000', null, '13124518724', 'NaN', '257', '0', '0', '0', '0', '2019-09-10 18:02:19', '2019-09-10 18:02:19', '0', '0', '0', '0', '1', '0', '1', null, null); INSERT INTO `t_post_base` VALUES ('37', '0', '4c23311a9e3441c9885bb4e79f3f9dbc', '7', '测试1', '1200', null, '18059936675', '厦门市集美区集美大道', '243,248,253,259,378,379,380', '2', '1', '0', '0', '2019-09-10 20:25:46', '2019-09-10 20:21:13', '0', '0', '1', '1', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('38', '0', '4c23311a9e3441c9885bb4e79f3f9dbc', '7', '测试1', '1200', null, '18059936675', '厦门市集美区集美大道', '324,330,335,340,243,248,253,259,378,379,380', '7', '1', '0', '0', '2019-10-08 15:05:45', '2019-09-10 20:23:23', '0', '0', '2', '1', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('39', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试读取历史记录是标签页记住选项', '520', null, '15387524575', '厦门市集美区岑东路168号', '242,252,379,381', '1', '0', '0', '0', '2019-09-25 10:17:58', '2019-09-25 10:17:58', '0', '1', '0', '0', '1', '1', '1', '2019-09-25 00:00:00', '2019-12-25 00:00:00'); INSERT INTO `t_post_base` VALUES ('40', '0', 'f9c9edf1-fb89-48a5-81b4-e92f0b0e89b1', '4', '测试读取发帖记录时标签页能否记住加载的选择', '8848', null, '15960205747', '厦门市集美区岑东路168号', '324,325,332,340,258,260,378,385', '1', '0', '0', '0', '2019-09-30 09:49:16', '2019-09-30 09:49:16', '0', '0', '0', '0', '1', '1', '1', '2019-09-30 00:00:00', '2019-12-30 00:00:00'); INSERT INTO `t_post_base` VALUES ('41', '0', '2761e95f94974c46b438e857f55b92cb', '5', '原图发布调整', '1888', null, '13888888888', '福建省厦门市思明区金榜路与嘉禾路交叉口', '322,323,324,325,328,329,330,332,333,334,335,340,343,345,346,347,348,349,350,326,327,331,336,337,338,339,341,342,344,14,16,18,19,240,244,253,263,265,266,392,394,397,400', '1', '0', '0', '0', '2019-10-08 15:28:50', '2019-10-08 15:28:50', '0', '0', '1', '0', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('42', '0', '2761e95f94974c46b438e857f55b92cb', '5', '原图发布调整', '1888', null, '13888888888', '福建省厦门市思明区金榜路与嘉禾路交叉口', '322,323,324,325,328,329,330,332,333,334,335,340,343,345,346,347,348,349,350,326,327,331,336,337,338,339,341,342,344,14,16,18,19,240,244,253,263,265,266,392,394,397,400', '2', '0', '0', '0', '2019-10-08 15:34:30', '2019-10-08 15:34:30', '0', '0', '1', '0', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('43', '0', '2761e95f94974c46b438e857f55b92cb', '5', '帅康磊什么事重点出口此刻看戏小师妹说你纤细超级电视那次的困难都想看看你那东西啃下自身假戏真做阿布迪斯看着你的可私信看下面就像那些即将为您现场检查宣布电缆线看手机刺激的金额都觉得你我有事呢', '1888', null, '13888888888', '福建省厦门市思明区金榜路与嘉禾路交叉口', '322,323,324,325,328,329,330,332,333,334,340,343,345,346,347,348,349,326,327,331,336,337,338,339,342,344,14,16,18,19,240,244,253,263,265,266,392,394,397,400', '3', '0', '0', '0', '2019-10-08 15:35:32', '2019-10-08 15:35:32', '0', '0', '1', '0', '1', '1', '1', null, null); INSERT INTO `t_post_base` VALUES ('44', '0', '2761e95f94974c46b438e857f55b92cb', '4', '业主直租 特惠 婚房出租', '1888', null, '88888888888', '福建省厦门市思明区厦禾路840号之1金榜大厦', '322,323,324,325,328,332,333,334,335,340,343,345,346,347,348,349,350,326,327,331,336,337,338,339,342,344,14,18,263,266,378,382,401,403', '5', '2', '0', '0', '2019-10-12 10:13:07', '2019-10-08 15:53:53', '0', '0', '1', '2', '1', '1', '1', '2019-10-09 00:00:00', '2019-11-29 00:00:00'); INSERT INTO `t_post_base` VALUES ('45', '0', 'f6a1bac7f5e345feb6da0737171f5e2b', '4', '测试私信', '800', null, '15387524575', '厦门市集美区凤岐西路', '328,330,340,336,338,15,17,248,253,257,378,385', '5', '0', '0', '0', '2019-10-08 16:01:27', '2019-10-08 16:01:27', '0', '0', '1', '0', '0', '1', '1', '2019-10-08 00:00:00', '2019-11-08 00:00:00'); -- ---------------------------- -- Table structure for t_post_label -- ---------------------------- DROP TABLE IF EXISTS `t_post_label`; CREATE TABLE `t_post_label` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '标签表ID', `PARENT_ID` int(11) NOT NULL COMMENT '标签的父ID', `CONTENT` varchar(50) NOT NULL COMMENT '标签内容', `TYPE` tinyint(4) NOT NULL DEFAULT '0', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', `TYPE_IMG_URL` varchar(255) DEFAULT NULL, `SIZE` int(11) NOT NULL DEFAULT '0' COMMENT '标签字号,默认最小0,往上一级1,最大一级为2', `FIX_SHOW` int(11) NOT NULL DEFAULT '0' COMMENT '在小程序上是否固定显示,默认0不显示,1固定显示,2为用户动态显示标签', `TYPE_IMG_URL_GREY` varchar(255) DEFAULT NULL, `ENGLISH` varchar(255) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=405 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_post_label -- ---------------------------- INSERT INTO `t_post_label` VALUES ('1', '0', '家用设备', '0', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('2', '0', '热门商圈', '0', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('3', '0', '地铁周边', '0', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('14', '2', '集美区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('15', '2', '思明区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('16', '2', '湖里区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('17', '2', '海沧区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('18', '2', '翔安区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('19', '2', '同安区', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('20', '3', '1号线', '3', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('240', '16', 'SM', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('241', '15', '万象城', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('242', '16', '五缘湾', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('243', '15', '会展中心', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('244', '16', '保税区', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('245', '15', '厦大白城', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('246', '14', '厦门北', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('247', '19', '同安', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('248', '15', '宝龙一城', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('249', '15', '思北', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('250', '15', '文灶', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('251', '14', '杏林', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('252', '17', '海沧', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('253', '16', '湖里高新技术', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('254', '15', '火车站', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('255', '16', '瑞景', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('256', '18', '翔安', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('257', '15', '莲坂', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('258', '15', '观音山', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('259', '14', '软三', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('260', '15', '软二', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('261', '14', '集美嘉庚', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('262', '16', '高崎机场', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('263', '16', '江头台湾街', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('264', '16', '火炬园', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('265', '15', '悦享中心', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('266', '16', '东渡', '2', '0', null, '0', '1', null, null); INSERT INTO `t_post_label` VALUES ('267', '1', '室内设备', '1', '0', '0', '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('268', '1', '室外设备', '1', '0', '0', '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('322', '267', '电视', '1', '0', 'http://img.since0592.com/static/equip/tv.png', '0', '0', 'http://img.since0592.com/static/equip/tv1.png', null); INSERT INTO `t_post_label` VALUES ('323', '267', '独立阳台', '1', '0', 'http://img.since0592.com/static/equip/balcony.png', '0', '0', 'http://img.since0592.com/static/equip/balcony1.png', null); INSERT INTO `t_post_label` VALUES ('324', '267', '独立卫生间', '1', '0', 'http://img.since0592.com/static/equip/bathroom.png', '0', '1', 'http://img.since0592.com/static/equip/bathroom1.png', null); INSERT INTO `t_post_label` VALUES ('325', '267', '床', '1', '0', 'http://img.since0592.com/static/equip/bed.png', '0', '1', 'http://img.since0592.com/static/equip/bed1.png', null); INSERT INTO `t_post_label` VALUES ('326', '268', 'BRT', '1', '0', 'http://img.since0592.com/static/equip/brt.png', '0', '1', 'http://img.since0592.com/static/equip/brt1.png', null); INSERT INTO `t_post_label` VALUES ('327', '268', '公交', '1', '0', 'http://img.since0592.com/static/equip/bus.png', '0', '2', 'http://img.since0592.com/static/equip/bus1.png', null); INSERT INTO `t_post_label` VALUES ('328', '267', '民用水电', '1', '0', 'http://img.since0592.com/static/equip/Civilwater.png', '0', '1', 'http://img.since0592.com/static/equip/Civilwater1.png', null); INSERT INTO `t_post_label` VALUES ('329', '267', '商用水电', '1', '0', 'http://img.since0592.com/static/equip/Commercialhydropower.png', '0', '1', 'http://img.since0592.com/static/equip/Commercialhydropower1.png', null); INSERT INTO `t_post_label` VALUES ('330', '267', '沙发', '1', '0', 'http://img.since0592.com/static/equip/couch.png', '0', '1', 'http://img.since0592.com/static/equip/couch1.png', null); INSERT INTO `t_post_label` VALUES ('331', '268', '快递代收', '1', '0', 'http://img.since0592.com/static/equip/delivery.png', '0', '1', 'http://img.since0592.com/static/equip/delivery1.png', null); INSERT INTO `t_post_label` VALUES ('332', '267', '书桌', '1', '0', 'http://img.since0592.com/static/equip/desk.png', '0', '1', 'http://img.since0592.com/static/equip/desk1.png', null); INSERT INTO `t_post_label` VALUES ('333', '267', '电梯', '1', '0', 'http://img.since0592.com/static/equip/elevator.png', '0', '1', 'http://img.since0592.com/static/equip/elevator1.png', null); INSERT INTO `t_post_label` VALUES ('334', '267', '暖气', '1', '0', 'http://img.since0592.com/static/equip/heating.png', '0', '1', 'http://img.since0592.com/static/equip/heating1.png', null); INSERT INTO `t_post_label` VALUES ('335', '267', '油烟机', '1', '0', 'http://img.since0592.com/static/equip/hood.png', '0', '1', 'http://img.since0592.com/static/equip/hood1.png', null); INSERT INTO `t_post_label` VALUES ('336', '268', '行李寄存', '1', '0', 'http://img.since0592.com/static/equip/luggage.png', '0', '1', 'http://img.since0592.com/static/equip/luggage1.png', null); INSERT INTO `t_post_label` VALUES ('337', '268', '24小时监控', '1', '0', 'http://img.since0592.com/static/equip/minitor.png', '0', '1', 'http://img.since0592.com/static/equip/minitor1.png', null); INSERT INTO `t_post_label` VALUES ('338', '268', '停车场', '1', '0', 'http://img.since0592.com/static/equip/parking.png', '0', '1', 'http://img.since0592.com/static/equip/parking1.png', null); INSERT INTO `t_post_label` VALUES ('339', '268', '物业', '1', '0', 'http://img.since0592.com/static/equip/property.png', '0', '1', 'http://img.since0592.com/static/equip/property1.png', null); INSERT INTO `t_post_label` VALUES ('340', '267', '冰箱', '1', '0', 'http://img.since0592.com/static/equip/ref.png', '0', '1', 'http://img.since0592.com/static/equip/ref1.png', null); INSERT INTO `t_post_label` VALUES ('341', '268', '智能门锁', '1', '0', 'http://img.since0592.com/static/equip/smartLock.png', '0', '1', 'http://img.since0592.com/static/equip/smartLock1.png', null); INSERT INTO `t_post_label` VALUES ('342', '268', '便利店', '1', '0', 'http://img.since0592.com/static/equip/store.png', '0', '1', 'http://img.since0592.com/static/equip/store1.png', null); INSERT INTO `t_post_label` VALUES ('343', '267', '灶台', '1', '0', 'http://img.since0592.com/static/equip/stove.png', '0', '1', 'http://img.since0592.com/static/equip/stove1.png', null); INSERT INTO `t_post_label` VALUES ('344', '268', '地铁', '1', '0', 'http://img.since0592.com/static/equip/sub.png', '0', '1', 'http://img.since0592.com/static/equip/sub1.png', null); INSERT INTO `t_post_label` VALUES ('345', '267', '茶几', '1', '0', 'http://img.since0592.com/static/equip/teatable.png', '0', '1', 'http://img.since0592.com/static/equip/teatable1.png', null); INSERT INTO `t_post_label` VALUES ('346', '267', '衣柜', '1', '0', 'http://img.since0592.com/static/equip/wardrobe.png', '0', '1', 'http://img.since0592.com/static/equip/wardrobe1.png', null); INSERT INTO `t_post_label` VALUES ('347', '267', '洗衣机', '1', '0', 'http://img.since0592.com/static/equip/washer.png', '0', '1', 'http://img.since0592.com/static/equip/washer1.png', null); INSERT INTO `t_post_label` VALUES ('348', '267', '电热水器', '1', '0', 'http://img.since0592.com/static/equip/waterHeater.png', '0', '1', 'http://img.since0592.com/static/equip/waterHeater1.png', null); INSERT INTO `t_post_label` VALUES ('349', '267', '宽带', '1', '0', 'http://img.since0592.com/static/equip/wireless.png', '0', '1', 'http://img.since0592.com/static/equip/wireless1.png', null); INSERT INTO `t_post_label` VALUES ('350', '267', '空调', '1', '0', 'http://img.since0592.com/static/equip/ac.png', '0', '1', 'http://img.since0592.com/static/equip/ac1.png', null); INSERT INTO `t_post_label` VALUES ('351', '15', 'JFC', '2', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('376', '3', '2号线', '3', '0', null, '0', '0', null, null); INSERT INTO `t_post_label` VALUES ('377', '20', '岩内', '3', '0', null, '0', '1', null, 'Yannei'); INSERT INTO `t_post_label` VALUES ('378', '20', '厦门北站', '3', '0', null, '0', '1', null, 'Xiamen North Railway Staion'); INSERT INTO `t_post_label` VALUES ('379', '20', '天水路', '3', '0', null, '0', '1', null, 'Tianshui Rd'); INSERT INTO `t_post_label` VALUES ('380', '20', '集美大道', '3', '0', null, '0', '1', null, 'Jimei Blvd'); INSERT INTO `t_post_label` VALUES ('381', '20', '集美软件园', '3', '0', null, '0', '1', null, 'Jimei Software Park'); INSERT INTO `t_post_label` VALUES ('382', '20', '诚毅广场', '3', '0', null, '0', '1', null, 'Chengyi Plaza'); INSERT INTO `t_post_label` VALUES ('383', '20', '官任', '3', '0', null, '0', '1', null, 'Guanren'); INSERT INTO `t_post_label` VALUES ('384', '20', '杏锦路', '3', '0', null, '0', '1', null, 'Xingjin Rd'); INSERT INTO `t_post_label` VALUES ('385', '20', '园博园', '3', '0', null, '0', '1', null, 'Horticulture Expo Garden'); INSERT INTO `t_post_label` VALUES ('386', '20', '杏林村站', '3', '0', null, '0', '1', null, 'Xinglin Village'); INSERT INTO `t_post_label` VALUES ('387', '20', '集美学村', '3', '0', null, '0', '1', null, 'Jimei School Village'); INSERT INTO `t_post_label` VALUES ('388', '20', '高崎', '3', '0', null, '0', '1', null, 'Gaoqi'); INSERT INTO `t_post_label` VALUES ('389', '20', '殿前', '3', '0', null, '0', '1', null, 'Dianqian'); INSERT INTO `t_post_label` VALUES ('390', '20', '火炬园', '3', '0', null, '0', '1', null, 'Torch Hi-tech Park'); INSERT INTO `t_post_label` VALUES ('391', '20', '塘边', '3', '0', null, '0', '1', null, 'Tangbian'); INSERT INTO `t_post_label` VALUES ('392', '20', '乌石浦', '3', '0', null, '0', '1', null, 'Wushipu'); INSERT INTO `t_post_label` VALUES ('393', '20', '吕厝', '3', '0', null, '0', '1', null, 'Lvcuo'); INSERT INTO `t_post_label` VALUES ('394', '20', '莲花路口', '3', '0', null, '0', '1', null, 'Lianhua Intersection'); INSERT INTO `t_post_label` VALUES ('395', '20', '莲坂', '3', '0', null, '0', '1', null, 'Lianban'); INSERT INTO `t_post_label` VALUES ('396', '20', '湖滨东路', '3', '0', null, '0', '1', null, 'Hubin East Rd'); INSERT INTO `t_post_label` VALUES ('397', '20', '文灶站', '3', '0', null, '0', '1', null, 'Wenzao'); INSERT INTO `t_post_label` VALUES ('398', '20', '将军祠', '3', '0', null, '0', '1', null, 'Jiangjunci'); INSERT INTO `t_post_label` VALUES ('399', '20', '中山公园', '3', '0', null, '0', '1', null, 'Zhongshan Park'); INSERT INTO `t_post_label` VALUES ('400', '20', '镇海路', '3', '0', null, '0', '1', null, 'Zhenhai Rd'); INSERT INTO `t_post_label` VALUES ('401', '376', '五缘湾', '3', '0', null, '0', '1', null, 'Wuyuan Bay'); INSERT INTO `t_post_label` VALUES ('402', '376', '钟宅', '3', '0', null, '0', '1', null, 'Zhongzhai'); INSERT INTO `t_post_label` VALUES ('403', '376', '湿地公园', '3', '0', null, '0', '1', null, 'Wetland Park'); INSERT INTO `t_post_label` VALUES ('404', '376', '五通', '3', '0', null, '0', '1', null, 'Wutong'); -- ---------------------------- -- Table structure for t_post_picture -- ---------------------------- DROP TABLE IF EXISTS `t_post_picture`; CREATE TABLE `t_post_picture` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '图片ID', `POST_ID` int(11) NOT NULL COMMENT '帖子ID', `IMG_URL` varchar(500) NOT NULL COMMENT '图片URL', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `SORT` bigint(20) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_post_picture -- ---------------------------- INSERT INTO `t_post_picture` VALUES ('1', '22', 'http://img.since0592.com/static/8e53cbfe026341b7ad46ce3e3dab29f7.jpg', '2019-09-04 13:33:24', '1'); INSERT INTO `t_post_picture` VALUES ('2', '23', 'http://img.since0592.com/static/2e88f31c976d4826a0a69881e5700c07.jpg', '2019-09-05 13:08:49', '1'); INSERT INTO `t_post_picture` VALUES ('3', '23', 'http://img.since0592.com/static/06014d5423c34b2298960afb909ce4c8.jpg', '2019-09-05 13:08:49', '2'); INSERT INTO `t_post_picture` VALUES ('4', '23', 'http://img.since0592.com/static/93e3849796074737a25eeadc54f4a5a2.jpg', '2019-09-05 13:08:49', '3'); INSERT INTO `t_post_picture` VALUES ('5', '23', 'http://img.since0592.com/static/f4d876881cd54a66900f98bb73fdd63d.jpg', '2019-09-05 13:08:49', '4'); INSERT INTO `t_post_picture` VALUES ('6', '23', 'http://img.since0592.com/static/e49d7802c5574c1d9884223f26b0714a.jpg', '2019-09-05 13:08:49', '5'); INSERT INTO `t_post_picture` VALUES ('7', '23', 'http://img.since0592.com/static/5ab3fde319b74ac1a0b60eb310754647.jpg', '2019-09-05 13:08:49', '6'); INSERT INTO `t_post_picture` VALUES ('8', '23', 'http://img.since0592.com/static/47758d6ed45044599b93f140e3924da7.jpg', '2019-09-05 13:08:49', '7'); INSERT INTO `t_post_picture` VALUES ('9', '24', 'http://img.since0592.com/static/0d92dfe7c0d64a84973e3c83046f21fc.jpg', '2019-09-05 13:16:43', '1'); INSERT INTO `t_post_picture` VALUES ('10', '25', 'http://img.since0592.com/static/3868bebf98b340e084924e19726b71bd.jpg', '2019-09-05 13:27:17', '1'); INSERT INTO `t_post_picture` VALUES ('11', '26', 'http://img.since0592.com/static/473370ddd5f54014b95cf4062b81ad78.jpg', '2019-09-05 13:33:21', '1'); INSERT INTO `t_post_picture` VALUES ('12', '27', 'http://img.since0592.com/static/53532f5f830b44108e09420b7b911346.jpg', '2019-09-05 19:23:46', '1'); INSERT INTO `t_post_picture` VALUES ('13', '27', 'http://img.since0592.com/static/a9f9f5960981443980a77f43d2994de1.jpg', '2019-09-05 19:23:46', '2'); INSERT INTO `t_post_picture` VALUES ('17', '33', 'http://img.since0592.com/static/460fd8f2276b4cefbea481fbf14910ea.jpg', '2019-09-09 14:50:00', '1'); INSERT INTO `t_post_picture` VALUES ('18', '34', 'http://img.since0592.com/static/460fd8f2276b4cefbea481fbf14910ea.jpg', '2019-09-09 14:50:48', '1'); INSERT INTO `t_post_picture` VALUES ('19', '34', 'http://img.since0592.com/static/ecb062e959c14438b17d46e3c4b8177f.jpg', '2019-09-09 14:50:48', '2'); INSERT INTO `t_post_picture` VALUES ('20', '36', 'http://img.since0592.com/static/93076a18be1b40a9b263d19adf64b021.jpg', '2019-09-10 18:02:19', '1'); INSERT INTO `t_post_picture` VALUES ('21', '36', 'http://img.since0592.com/static/4d94b41e3099499c9b3c6cd2d498891a.jpg', '2019-09-10 18:02:19', '2'); INSERT INTO `t_post_picture` VALUES ('22', '37', 'http://img.since0592.com/static/e7c0e335a9154715844f24bc32048f45.jpg', '2019-09-10 20:21:13', '1'); INSERT INTO `t_post_picture` VALUES ('23', '37', 'http://img.since0592.com/static/e0b603fc45504f32b3cfdad4d1a65696.jpg', '2019-09-10 20:21:13', '2'); INSERT INTO `t_post_picture` VALUES ('24', '37', 'http://img.since0592.com/static/10ae2a63b3b04fb6b55f6862d6c3f427.jpg', '2019-09-10 20:21:13', '3'); INSERT INTO `t_post_picture` VALUES ('25', '37', 'http://img.since0592.com/static/1f5089940941424284868941d2153d6e.jpg', '2019-09-10 20:21:13', '4'); INSERT INTO `t_post_picture` VALUES ('26', '37', 'http://img.since0592.com/static/78b106cacf5e41a38a533abd700020c6.jpg', '2019-09-10 20:21:13', '5'); INSERT INTO `t_post_picture` VALUES ('27', '37', 'http://img.since0592.com/static/5a152641509148bea7c7c41a24313bc0.jpg', '2019-09-10 20:21:13', '6'); INSERT INTO `t_post_picture` VALUES ('28', '37', 'http://img.since0592.com/static/aec1c2ef1b0540639fa20c6f9efdf2ac.jpg', '2019-09-10 20:21:13', '7'); INSERT INTO `t_post_picture` VALUES ('29', '37', 'http://img.since0592.com/static/111c76417a93461c9137e8841463f4eb.jpg', '2019-09-10 20:21:13', '8'); INSERT INTO `t_post_picture` VALUES ('30', '37', 'http://img.since0592.com/static/51e75f09b13b4c92b06337c0c81d74b2.jpg', '2019-09-10 20:21:13', '9'); INSERT INTO `t_post_picture` VALUES ('31', '38', 'http://img.since0592.com/static/e7c0e335a9154715844f24bc32048f45.jpg', '2019-09-10 20:23:23', '1'); INSERT INTO `t_post_picture` VALUES ('32', '38', 'http://img.since0592.com/static/e0b603fc45504f32b3cfdad4d1a65696.jpg', '2019-09-10 20:23:23', '2'); INSERT INTO `t_post_picture` VALUES ('33', '38', 'http://img.since0592.com/static/10ae2a63b3b04fb6b55f6862d6c3f427.jpg', '2019-09-10 20:23:23', '3'); INSERT INTO `t_post_picture` VALUES ('34', '38', 'http://img.since0592.com/static/1f5089940941424284868941d2153d6e.jpg', '2019-09-10 20:23:23', '4'); INSERT INTO `t_post_picture` VALUES ('35', '38', 'http://img.since0592.com/static/78b106cacf5e41a38a533abd700020c6.jpg', '2019-09-10 20:23:23', '5'); INSERT INTO `t_post_picture` VALUES ('36', '38', 'http://img.since0592.com/static/5a152641509148bea7c7c41a24313bc0.jpg', '2019-09-10 20:23:23', '6'); INSERT INTO `t_post_picture` VALUES ('37', '38', 'http://img.since0592.com/static/aec1c2ef1b0540639fa20c6f9efdf2ac.jpg', '2019-09-10 20:23:23', '7'); INSERT INTO `t_post_picture` VALUES ('38', '38', 'http://img.since0592.com/static/111c76417a93461c9137e8841463f4eb.jpg', '2019-09-10 20:23:23', '8'); INSERT INTO `t_post_picture` VALUES ('39', '38', 'http://img.since0592.com/static/51e75f09b13b4c92b06337c0c81d74b2.jpg', '2019-09-10 20:23:23', '9'); INSERT INTO `t_post_picture` VALUES ('40', '39', 'http://img.since0592.com/static/75c2fe8018a8462792c60a86a9f1df5b.png', '2019-09-25 10:17:58', '1'); INSERT INTO `t_post_picture` VALUES ('41', '40', 'http://img.since0592.com/static/776996157618434682e7712169bc34f9.png', '2019-09-30 09:49:16', '1'); INSERT INTO `t_post_picture` VALUES ('42', '41', 'http://img.since0592.com/static/54fd2037c2304e6791e771565b88ecba.jpg', '2019-10-08 15:28:50', '1'); INSERT INTO `t_post_picture` VALUES ('43', '41', 'http://img.since0592.com/static/deede821903e4b52ab4fc9f2a250720e.jpg', '2019-10-08 15:28:50', '2'); INSERT INTO `t_post_picture` VALUES ('44', '41', 'http://img.since0592.com/static/cb6f3181cd3a4efeb971163ead6ea4d5.jpg', '2019-10-08 15:28:50', '3'); INSERT INTO `t_post_picture` VALUES ('45', '41', 'http://img.since0592.com/static/d34031d84b0e4080883cd7c1b562a3de.jpg', '2019-10-08 15:28:50', '4'); INSERT INTO `t_post_picture` VALUES ('46', '41', 'http://img.since0592.com/static/da26c78c91e549318cc3856cfb66b360.jpg', '2019-10-08 15:28:50', '5'); INSERT INTO `t_post_picture` VALUES ('47', '41', 'http://img.since0592.com/static/f630cbd3acf34e45b57580e777f8f1bf.jpg', '2019-10-08 15:28:50', '6'); INSERT INTO `t_post_picture` VALUES ('48', '41', 'http://img.since0592.com/static/83cfb779321846729c8f723e3d86830f.jpg', '2019-10-08 15:28:50', '7'); INSERT INTO `t_post_picture` VALUES ('49', '41', 'http://img.since0592.com/static/edbcb26782fd478f8181d9116188ee39.jpg', '2019-10-08 15:28:50', '8'); INSERT INTO `t_post_picture` VALUES ('50', '41', 'http://img.since0592.com/static/b775c661c8ff40af8c33d32da01226c6.jpg', '2019-10-08 15:28:50', '9'); INSERT INTO `t_post_picture` VALUES ('51', '42', 'http://img.since0592.com/static/54fd2037c2304e6791e771565b88ecba.jpg', '2019-10-08 15:34:30', '1'); INSERT INTO `t_post_picture` VALUES ('52', '42', 'http://img.since0592.com/static/deede821903e4b52ab4fc9f2a250720e.jpg', '2019-10-08 15:34:30', '2'); INSERT INTO `t_post_picture` VALUES ('53', '42', 'http://img.since0592.com/static/cb6f3181cd3a4efeb971163ead6ea4d5.jpg', '2019-10-08 15:34:30', '3'); INSERT INTO `t_post_picture` VALUES ('54', '42', 'http://img.since0592.com/static/d34031d84b0e4080883cd7c1b562a3de.jpg', '2019-10-08 15:34:30', '4'); INSERT INTO `t_post_picture` VALUES ('55', '42', 'http://img.since0592.com/static/da26c78c91e549318cc3856cfb66b360.jpg', '2019-10-08 15:34:30', '5'); INSERT INTO `t_post_picture` VALUES ('56', '42', 'http://img.since0592.com/static/f630cbd3acf34e45b57580e777f8f1bf.jpg', '2019-10-08 15:34:30', '6'); INSERT INTO `t_post_picture` VALUES ('57', '42', 'http://img.since0592.com/static/83cfb779321846729c8f723e3d86830f.jpg', '2019-10-08 15:34:30', '7'); INSERT INTO `t_post_picture` VALUES ('58', '42', 'http://img.since0592.com/static/edbcb26782fd478f8181d9116188ee39.jpg', '2019-10-08 15:34:30', '8'); INSERT INTO `t_post_picture` VALUES ('59', '42', 'http://img.since0592.com/static/b775c661c8ff40af8c33d32da01226c6.jpg', '2019-10-08 15:34:30', '9'); INSERT INTO `t_post_picture` VALUES ('60', '43', 'http://img.since0592.com/static/54fd2037c2304e6791e771565b88ecba.jpg', '2019-10-08 15:35:32', '1'); INSERT INTO `t_post_picture` VALUES ('61', '43', 'http://img.since0592.com/static/deede821903e4b52ab4fc9f2a250720e.jpg', '2019-10-08 15:35:32', '2'); INSERT INTO `t_post_picture` VALUES ('62', '43', 'http://img.since0592.com/static/cb6f3181cd3a4efeb971163ead6ea4d5.jpg', '2019-10-08 15:35:32', '3'); INSERT INTO `t_post_picture` VALUES ('63', '43', 'http://img.since0592.com/static/d34031d84b0e4080883cd7c1b562a3de.jpg', '2019-10-08 15:35:32', '4'); INSERT INTO `t_post_picture` VALUES ('64', '43', 'http://img.since0592.com/static/da26c78c91e549318cc3856cfb66b360.jpg', '2019-10-08 15:35:32', '5'); INSERT INTO `t_post_picture` VALUES ('65', '43', 'http://img.since0592.com/static/f630cbd3acf34e45b57580e777f8f1bf.jpg', '2019-10-08 15:35:32', '6'); INSERT INTO `t_post_picture` VALUES ('66', '43', 'http://img.since0592.com/static/83cfb779321846729c8f723e3d86830f.jpg', '2019-10-08 15:35:32', '7'); INSERT INTO `t_post_picture` VALUES ('67', '43', 'http://img.since0592.com/static/edbcb26782fd478f8181d9116188ee39.jpg', '2019-10-08 15:35:32', '8'); INSERT INTO `t_post_picture` VALUES ('68', '43', 'http://img.since0592.com/static/b775c661c8ff40af8c33d32da01226c6.jpg', '2019-10-08 15:35:32', '9'); INSERT INTO `t_post_picture` VALUES ('69', '44', 'http://img.since0592.com/static/26d5d421f4b54bc48934b9e61b0a994f.jpg', '2019-10-08 15:53:53', '1'); INSERT INTO `t_post_picture` VALUES ('70', '44', 'http://img.since0592.com/static/208e4565b2ab4c14a444912cddd80240.jpg', '2019-10-08 15:53:53', '2'); INSERT INTO `t_post_picture` VALUES ('71', '44', 'http://img.since0592.com/static/d28a6ad0ccb445eeb6499c4cf17f8905.jpg', '2019-10-08 15:53:53', '3'); INSERT INTO `t_post_picture` VALUES ('72', '44', 'http://img.since0592.com/static/057f8e9b4eba4f40b6157183e8a4ebdf.jpg', '2019-10-08 15:53:53', '4'); INSERT INTO `t_post_picture` VALUES ('73', '44', 'http://img.since0592.com/static/ee71048334684c1e8ff36caa12b380bd.jpg', '2019-10-08 15:53:53', '5'); INSERT INTO `t_post_picture` VALUES ('74', '44', 'http://img.since0592.com/static/f809e3e0c42844519c032f9240f8a029.jpg', '2019-10-08 15:53:53', '6'); INSERT INTO `t_post_picture` VALUES ('75', '44', 'http://img.since0592.com/static/4c81ea9f332c430f9988a3764cec14b8.jpg', '2019-10-08 15:53:53', '7'); INSERT INTO `t_post_picture` VALUES ('76', '44', 'http://img.since0592.com/static/5f3a4fdde30d481781dcee9c1b96b00c.jpg', '2019-10-08 15:53:53', '8'); INSERT INTO `t_post_picture` VALUES ('77', '44', 'http://img.since0592.com/static/4534d1027e7646509da8f86db4bb8141.jpg', '2019-10-08 15:53:53', '9'); INSERT INTO `t_post_picture` VALUES ('78', '45', 'http://img.since0592.com/static/a371a83c79684baebc1a8bf97c964c26.jpg', '2019-10-08 16:01:27', '1'); -- ---------------------------- -- Table structure for t_post_region -- ---------------------------- DROP TABLE IF EXISTS `t_post_region`; CREATE TABLE `t_post_region` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `REGION` varchar(255) CHARACTER SET utf8mb4 NOT NULL, `CREATE_TIME` datetime NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of t_post_region -- ---------------------------- INSERT INTO `t_post_region` VALUES ('1', '集美区', '2019-08-04 21:08:42'); INSERT INTO `t_post_region` VALUES ('2', '海沧区', '2019-08-04 21:11:28'); INSERT INTO `t_post_region` VALUES ('3', '思明区', '2019-08-04 21:11:45'); INSERT INTO `t_post_region` VALUES ('4', '湖里区', '2019-08-04 21:11:56'); INSERT INTO `t_post_region` VALUES ('5', '翔安区', '2019-08-04 21:12:16'); INSERT INTO `t_post_region` VALUES ('6', '同安区', '2019-08-04 21:12:28'); -- ---------------------------- -- Table structure for t_post_type -- ---------------------------- DROP TABLE IF EXISTS `t_post_type`; CREATE TABLE `t_post_type` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '帖子类型ID', `TYPE_IMTG_URL` varchar(255) NOT NULL COMMENT '类型图片URL', `TYPE_NAME` varchar(50) NOT NULL COMMENT '类型名', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `SORT_TIME` datetime NOT NULL, `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0不删除,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_post_type -- ---------------------------- INSERT INTO `t_post_type` VALUES ('1', 'http://img.since0592.com/static/img/tack.png', '办公转让', '2019-07-02 11:10:22', '2019-07-18 09:31:23', '0'); INSERT INTO `t_post_type` VALUES ('2', 'http://img.since0592.com/static/img/brand.png', '品牌优选', '2019-07-01 11:11:04', '2019-07-18 09:26:59', '0'); INSERT INTO `t_post_type` VALUES ('3', 'http://img.since0592.com/static/img/rents.png', '业主直租', '2019-07-01 11:11:06', '2019-07-17 15:55:40', '0'); INSERT INTO `t_post_type` VALUES ('4', 'http://img.since0592.com/static/img/tack2.png', '月租短租', '2019-07-12 17:35:35', '2019-07-23 14:06:12', '0'); INSERT INTO `t_post_type` VALUES ('5', 'http://img.since0592.com/static/img/Sublet.png', '转租', '2019-07-17 15:55:40', '2019-07-01 11:11:06', '0'); INSERT INTO `t_post_type` VALUES ('6', 'http://img.since0592.com/static/img/cotenancy.png', '合租', '2019-07-18 09:26:59', '2019-07-02 11:10:22', '0'); INSERT INTO `t_post_type` VALUES ('7', 'http://img.since0592.com/static/img/Renting.png', '求租', '2019-07-18 09:31:23', '2019-07-01 11:11:04', '0'); INSERT INTO `t_post_type` VALUES ('8', 'http://img.since0592.com/static/img/rent.png', '整租', '2019-07-23 14:06:12', '2019-07-12 17:35:35', '0'); -- ---------------------------- -- Table structure for t_report_record -- ---------------------------- DROP TABLE IF EXISTS `t_report_record`; CREATE TABLE `t_report_record` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '举报记录ID', `USER_ID` varchar(128) NOT NULL COMMENT '举报人ID', `TARGET_ID` int(11) NOT NULL COMMENT '举报的帖子ID', `CREATE_TIME` datetime NOT NULL COMMENT '举报时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', `IS_IDLE` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否闲置,0闲置,1已处理', `TARGET_TYPE` varchar(255) DEFAULT NULL COMMENT '举报对象类型', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_report_record -- ---------------------------- INSERT INTO `t_report_record` VALUES ('1', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '20', '2019-09-04 10:29:59', '0', '0', 'post'); INSERT INTO `t_report_record` VALUES ('2', 'f6a1bac7f5e345feb6da0737171f5e2b', '38', '2019-10-08 11:48:30', '0', '0', 'post'); INSERT INTO `t_report_record` VALUES ('3', '2761e95f94974c46b438e857f55b92cb', '41', '2019-10-08 15:29:26', '0', '0', 'post'); INSERT INTO `t_report_record` VALUES ('4', 'f6a1bac7f5e345feb6da0737171f5e2b', '45', '2019-10-09 09:30:47', '0', '0', 'post'); -- ---------------------------- -- Table structure for t_sys_information -- ---------------------------- DROP TABLE IF EXISTS `t_sys_information`; CREATE TABLE `t_sys_information` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '系统消息ID', `TARGET_ID` varchar(128) NOT NULL COMMENT '发送对象的ID,单发为用户ID,群发为system_info', `CONTENT` text NOT NULL COMMENT '消息文本内容', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_sys_information -- ---------------------------- INSERT INTO `t_sys_information` VALUES ('1', 'system_info', '系统通知,群发', '2019-08-06 09:41:11', '0'); INSERT INTO `t_sys_information` VALUES ('2', 'cc55c04ef440408394eff56afb604d42', '厦门市气象台2019年08月02日12时00分继续发布雷电黄色预警信号:预计未来6小时我市部分镇街及沿海仍有雷电活动,局地伴有短时强降水和6-8级大风。请注意防范。(预警信息来源:国家预警信息发布中心)', '2019-08-29 13:45:34', '0'); -- ---------------------------- -- Table structure for t_sys_template -- ---------------------------- DROP TABLE IF EXISTS `t_sys_template`; CREATE TABLE `t_sys_template` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '系统模版ID', `TITLE` varchar(255) NOT NULL COMMENT '模版标题', `CONTENT` text NOT NULL COMMENT '模版文本', `IS_GUIDE` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否为引导标示,0不是,1是', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0为否,1为是', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_sys_template -- ---------------------------- INSERT INTO `t_sys_template` VALUES ('1', '系统维护公告', '系统将于明日(2019-08-03)凌晨1点进行维护,届时用户可能无法使用本系统,给您造成的不便请谅解', '0', '0'); INSERT INTO `t_sys_template` VALUES ('2', '用户禁言公告', '近期有大量用户因不当发言被禁言,请大家合法上网冲浪维护社区良好环境', '0', '0'); INSERT INTO `t_sys_template` VALUES ('3', '天气', '厦门市气象台2019年08月02日12时00分继续发布雷电黄色预警信号:预计未来6小时我市部分镇街及沿海仍有雷电活动,局地伴有短时强降水和6-8级大风。请注意防范。(预警信息来源:国家预警信息发布中心)', '0', '0'); INSERT INTO `t_sys_template` VALUES ('4', '长文本测试', '送神是早上五点钟,送到我住的这个村大概是上午十一点。我想早点起,但是一激动就失眠了,睁开眼睛已经八点过了。躺在床上,想怕是神都送了两个村了。\r \r 吃了早饭,就去在村里转。今天村里有活动的,好多人就是来参加这个活动的。一个乡村博物馆今天开幕。一座老房子改的博物馆,在村里开阔处靠溪水边。\r \r 走进村。好多穿着打扮都很时髦的人,一看就是城里人的人,往村里走。我也是,还戴着一顶草礼帽,瓜兮兮的。\r \r 进村有两条路:一条,有一棵很大很大的苦楮树,八百年,树根包着一个小庙,庙纪念这个村最老的祖先;另一条,是一棵很大很大的红豆杉树,不晓得是多少年。是我见过最大的红豆杉。来到这个村,经过它大概五六次了,每次经过都在内心对它行礼。摘下草礼帽。\r \r 人越来越多。碰到熟人,我很成熟地和人家打招呼,聊两句大人龙门阵。甚至还给不熟悉的朋友相互介绍。活动正式开始,活动组织者和村县领导们站前排,一个当地电视台的主持人开始拿着话筒开始讲话。她的高跟鞋估计有十厘米以上,笔直地站在碎石地上,双腿丁字形分开,一口播音普通话。她一开口,就说自己就是这个村里长大的,这句话让我蛮吃惊的。\r \r 领导发言,是个四十来岁的男人,第一句话,父老乡亲们好,各位来宾好。我们相聚一堂,为了文化传承和振兴。很奇怪的,我也跟着热烈鼓掌。我从小就这样,什么时候都希望不冷场。喜欢热热闹闹的。\r \r 老乡们来了不少,开幕现场提供非常精致的点心。那点心比城里不少点心都精致。大家都在吃。还有啤酒、草药汤和杨梅汁提供。装水的杯杯也很精致。我小时候要有机会参加这样的活动,估计会把这个杯杯藏起来,偷走。\r \r 放纪录片的小房间黑乎乎的,摆着竹椅子。人多,几乎都是进来看两眼就走了。我一直坐着从头看到尾,片子拍得好,村子安静的样子拍出来了的。村里的狗儿、鸭子、公鸡母鸡小鸡都有,还有小羊都有。好多俯拍的镜头,环山碧绿,村子被捧在中间。非常神秘非常遥远的样子。而我就坐在这里。\r \r 始终留神听外面的动静,我怕错过神。终于,听见外面有鞭炮声了。急忙跑出去,又说,还没有走拢。\r \r 村口有卖凉粉的,是绿色的凉粉,用草榨汁做的。片子里有介绍,说是当地特色,叫“青草豆腐”。我说来一碗,问卖凉粉的大姐:这是“青草豆腐”么?大姐羞涩地笑了笑:嗯,我们就叫绿豆腐。你加辣不加?我点头:加,多加。\r \r 绿豆腐蛮爽口的,还加了大头菜颗颗,酸浆。我端着一边走一边吃。突然鞭炮又响起来了,大家都往村头涌过去。我急得赶紧吃两口绿豆腐,碗里少些,端着走也可以不荡出来。大家都站在路两边,往前面张望。我挤在当中,护着绿豆腐。\r \r 举着旗子的人走过来了,有小娃娃,也有老太太,他们是打头的。一个举着旗子的小男娃娃,对着人群笑嘻嘻举起了中指,我身边站着的另一个小男娃娃立刻也对他举起来中指。他们笑嘻嘻地相互比着中指。抗旗子这个事情肯定让人不好意思嘛!举着旗子就和平时看上去不一样了嘛。举旗子的村人大家都神态平静自若,大人们也不停地和人群里的熟人打着招呼。\r \r 一个男人举着一把香从苦楮树小庙走出来,对着苦楮树行礼,他行完礼打算把香插在树下的香炉里,一个拿着长镜头相机的城里人对他说:哎呀你慢点,你能不能再行一次礼。男人不好意思地笑了,但是他配合着又行了一次礼,脸上挂着尴尬的笑。\r \r 他行完礼,从楼梯走下来,准备点烟花,烟花早放好了,信子排得长长的,他抬头看了一眼送神队伍,蹲下去就点。嗖!嗖!啪!烟花在白天显不出艳丽,但有了烟花,神就要正式进村了。\r \r 举着“令”牌的人过来了,后面是一排“回避”,红地黑字的牌子举得高高的,前面走着穿着麻裙的巫师,他嘴里念念有词。我激动地满脸通红,为了掩盖激动,又吃了一口绿豆腐。\r \r 神的轿子抬过来了,红色的流苏和塑料花装饰着小木轿,隐隐能看见里面是一尊白脸的男神,穿着官服戴着官帽。我呆呆看着那木雕的神脸,面目俊俏,唇红齿白。第二乘轿子又过来了,也是一尊男神,白脸,长着长胡子,细长的丹凤眼。第三尊是黑面,男神,威武,穿盔甲。走最后的一尊,是个女神,我一看见女神,觉得非常非常亲切,觉得女娃娃也能坐在轿子里真好。女娃娃也能那么受人尊重真好。女神雕得最美,坐在轿子里非常尊严,我突然就要哭了。端着绿豆腐,不知道如何是好,左右都是人,我不好意思让人家看见我要哭。\r \r 突然看见老九在那大苦楮树下站着,也在张望,我立刻向他走过去。他也看见我了,叫我:你去哪里了,我找你半天!我没有说话,端着豆腐,非常严肃地走过去,眼睛红着,刚走过去就对他说:我想哭。就哇一声哭了,上气不接下气,他很吃惊:怎么了,有人欺负你么。我哭得脸皮发烫,把绿豆腐递给他:没、没有,我就是看见神了。', '1', '0'); -- ---------------------------- -- Table structure for t_user_browse -- ---------------------------- DROP TABLE IF EXISTS `t_user_browse`; CREATE TABLE `t_user_browse` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '浏览记录ID', `USER_ID` varchar(128) NOT NULL COMMENT '用户ID', `POST_ID` int(11) NOT NULL COMMENT '帖子ID', `CREATE_TIME` datetime NOT NULL COMMENT '浏览时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`), UNIQUE KEY `index` (`USER_ID`,`POST_ID`,`CREATE_TIME`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1070 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_browse -- ---------------------------- INSERT INTO `t_user_browse` VALUES ('992', '0e882d97f3be466794a368e877d6bc90', '18', '2019-08-30 17:38:31', '0'); INSERT INTO `t_user_browse` VALUES ('993', '54d9030c-dd0d-42b0-80e5-5f298a4682c7', '18', '2019-08-30 14:10:39', '0'); INSERT INTO `t_user_browse` VALUES ('994', '0e882d97f3be466794a368e877d6bc90', '19', '2019-08-30 15:34:05', '0'); INSERT INTO `t_user_browse` VALUES ('995', '075b26a69ae84cbcae283cb813bd2085', '18', '2019-08-30 17:38:01', '0'); INSERT INTO `t_user_browse` VALUES ('996', 'e4050bf4-ba62-42f3-85a7-92d2996ef207', '18', '2019-08-30 17:41:38', '0'); INSERT INTO `t_user_browse` VALUES ('997', '4c23311a9e3441c9885bb4e79f3f9dbc', '20', '2019-08-30 18:24:10', '0'); INSERT INTO `t_user_browse` VALUES ('998', '4c23311a9e3441c9885bb4e79f3f9dbc', '20', '2019-08-31 12:16:28', '0'); INSERT INTO `t_user_browse` VALUES ('999', '218fe87d-db6b-48ce-a408-83287e51b7e8', '20', '2019-08-31 15:30:42', '0'); INSERT INTO `t_user_browse` VALUES ('1000', '0e882d97f3be466794a368e877d6bc90', '20', '2019-08-31 15:36:03', '0'); INSERT INTO `t_user_browse` VALUES ('1001', '0e882d97f3be466794a368e877d6bc90', '21', '2019-08-31 16:58:38', '0'); INSERT INTO `t_user_browse` VALUES ('1002', '4c23311a9e3441c9885bb4e79f3f9dbc', '21', '2019-08-31 15:53:22', '0'); INSERT INTO `t_user_browse` VALUES ('1003', '0e882d97f3be466794a368e877d6bc90', '21', '2019-09-01 11:48:12', '0'); INSERT INTO `t_user_browse` VALUES ('1004', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '20', '2019-09-04 11:11:19', '0'); INSERT INTO `t_user_browse` VALUES ('1005', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '21', '2019-09-04 12:53:35', '0'); INSERT INTO `t_user_browse` VALUES ('1006', '44630af1-3ad1-4f3d-9c7e-823e68da38f9', '21', '2019-09-04 12:45:29', '0'); INSERT INTO `t_user_browse` VALUES ('1007', 'f6a1bac7f5e345feb6da0737171f5e2b', '21', '2019-09-04 13:37:14', '0'); INSERT INTO `t_user_browse` VALUES ('1008', 'f6a1bac7f5e345feb6da0737171f5e2b', '20', '2019-09-04 13:27:48', '0'); INSERT INTO `t_user_browse` VALUES ('1009', 'f6a1bac7f5e345feb6da0737171f5e2b', '22', '2019-09-04 13:33:28', '0'); INSERT INTO `t_user_browse` VALUES ('1010', '4c23311a9e3441c9885bb4e79f3f9dbc', '22', '2019-09-04 13:37:48', '0'); INSERT INTO `t_user_browse` VALUES ('1011', '4c23311a9e3441c9885bb4e79f3f9dbc', '21', '2019-09-04 13:36:58', '0'); INSERT INTO `t_user_browse` VALUES ('1012', 'f6a1bac7f5e345feb6da0737171f5e2b', '24', '2019-09-05 13:18:35', '0'); INSERT INTO `t_user_browse` VALUES ('1013', 'f6a1bac7f5e345feb6da0737171f5e2b', '22', '2019-09-05 13:20:24', '0'); INSERT INTO `t_user_browse` VALUES ('1014', 'f6a1bac7f5e345feb6da0737171f5e2b', '23', '2019-09-05 13:20:32', '0'); INSERT INTO `t_user_browse` VALUES ('1015', 'f6a1bac7f5e345feb6da0737171f5e2b', '23', '2019-09-06 18:04:50', '0'); INSERT INTO `t_user_browse` VALUES ('1016', 'f6a1bac7f5e345feb6da0737171f5e2b', '23', '2019-09-09 08:35:38', '0'); INSERT INTO `t_user_browse` VALUES ('1017', 'f6a1bac7f5e345feb6da0737171f5e2b', '28', '2019-09-09 11:05:37', '0'); INSERT INTO `t_user_browse` VALUES ('1018', 'f6a1bac7f5e345feb6da0737171f5e2b', '21', '2019-09-09 11:08:09', '0'); INSERT INTO `t_user_browse` VALUES ('1019', 'f6a1bac7f5e345feb6da0737171f5e2b', '20', '2019-09-09 11:09:35', '0'); INSERT INTO `t_user_browse` VALUES ('1020', 'f6a1bac7f5e345feb6da0737171f5e2b', '29', '2019-09-09 12:34:12', '0'); INSERT INTO `t_user_browse` VALUES ('1021', '4c23311a9e3441c9885bb4e79f3f9dbc', '29', '2019-09-09 11:16:57', '0'); INSERT INTO `t_user_browse` VALUES ('1022', '4c23311a9e3441c9885bb4e79f3f9dbc', '21', '2019-09-09 11:17:03', '0'); INSERT INTO `t_user_browse` VALUES ('1023', 'f6a1bac7f5e345feb6da0737171f5e2b', '30', '2019-09-09 12:31:06', '0'); INSERT INTO `t_user_browse` VALUES ('1024', 'f6a1bac7f5e345feb6da0737171f5e2b', '31', '2019-09-09 13:15:01', '0'); INSERT INTO `t_user_browse` VALUES ('1025', 'f6a1bac7f5e345feb6da0737171f5e2b', '32', '2019-09-09 13:30:30', '0'); INSERT INTO `t_user_browse` VALUES ('1026', 'f6a1bac7f5e345feb6da0737171f5e2b', '33', '2019-09-09 15:14:40', '0'); INSERT INTO `t_user_browse` VALUES ('1027', 'f6a1bac7f5e345feb6da0737171f5e2b', '34', '2019-09-09 15:21:39', '0'); INSERT INTO `t_user_browse` VALUES ('1028', '4c23311a9e3441c9885bb4e79f3f9dbc', '20', '2019-09-09 15:21:25', '0'); INSERT INTO `t_user_browse` VALUES ('1029', '9f8602df-7d62-4acd-b921-c523106ed28a', '20', '2019-09-09 23:36:51', '0'); INSERT INTO `t_user_browse` VALUES ('1030', 'f6a1bac7f5e345feb6da0737171f5e2b', '34', '2019-09-10 11:24:36', '0'); INSERT INTO `t_user_browse` VALUES ('1031', 'f27cc768-dc5f-4226-b20a-7eb916a7e5f7', '21', '2019-09-10 12:08:05', '0'); INSERT INTO `t_user_browse` VALUES ('1032', '4c23311a9e3441c9885bb4e79f3f9dbc', '34', '2019-09-10 20:16:26', '0'); INSERT INTO `t_user_browse` VALUES ('1033', '4c23311a9e3441c9885bb4e79f3f9dbc', '33', '2019-09-10 20:10:15', '0'); INSERT INTO `t_user_browse` VALUES ('1034', '4c23311a9e3441c9885bb4e79f3f9dbc', '37', '2019-09-10 20:27:33', '0'); INSERT INTO `t_user_browse` VALUES ('1035', '4c23311a9e3441c9885bb4e79f3f9dbc', '38', '2019-09-10 20:23:27', '0'); INSERT INTO `t_user_browse` VALUES ('1036', '', '34', '2019-09-10 20:33:49', '0'); INSERT INTO `t_user_browse` VALUES ('1037', '567a6322-3e6f-44cd-9f32-eef678e1971c', '38', '2019-09-10 20:37:02', '0'); INSERT INTO `t_user_browse` VALUES ('1038', 'f6a1bac7f5e345feb6da0737171f5e2b', '38', '2019-09-11 09:40:46', '0'); INSERT INTO `t_user_browse` VALUES ('1039', 'f6a1bac7f5e345feb6da0737171f5e2b', '39', '2019-09-25 10:19:10', '0'); INSERT INTO `t_user_browse` VALUES ('1040', 'f9c9edf1-fb89-48a5-81b4-e92f0b0e89b1', '40', '2019-09-30 09:49:18', '0'); INSERT INTO `t_user_browse` VALUES ('1041', 'f9c9edf1-fb89-48a5-81b4-e92f0b0e89b1', '38', '2019-09-30 10:02:06', '0'); INSERT INTO `t_user_browse` VALUES ('1042', 'f27cc768-dc5f-4226-b20a-7eb916a7e5f7', '33', '2019-10-08 09:46:35', '0'); INSERT INTO `t_user_browse` VALUES ('1043', 'f6a1bac7f5e345feb6da0737171f5e2b', '34', '2019-10-08 11:16:43', '0'); INSERT INTO `t_user_browse` VALUES ('1044', 'f6a1bac7f5e345feb6da0737171f5e2b', '38', '2019-10-08 11:48:04', '0'); INSERT INTO `t_user_browse` VALUES ('1045', 'f6a1bac7f5e345feb6da0737171f5e2b', '33', '2019-10-08 15:03:53', '0'); INSERT INTO `t_user_browse` VALUES ('1046', 'f6a1bac7f5e345feb6da0737171f5e2b', '21', '2019-10-08 15:04:00', '0'); INSERT INTO `t_user_browse` VALUES ('1047', 'f6a1bac7f5e345feb6da0737171f5e2b', '20', '2019-10-08 15:04:06', '0'); INSERT INTO `t_user_browse` VALUES ('1048', '2761e95f94974c46b438e857f55b92cb', '41', '2019-10-08 15:34:04', '0'); INSERT INTO `t_user_browse` VALUES ('1049', '2761e95f94974c46b438e857f55b92cb', '42', '2019-10-08 15:34:33', '0'); INSERT INTO `t_user_browse` VALUES ('1050', '2761e95f94974c46b438e857f55b92cb', '43', '2019-10-08 15:35:34', '0'); INSERT INTO `t_user_browse` VALUES ('1051', '2761e95f94974c46b438e857f55b92cb', '44', '2019-10-08 17:19:48', '0'); INSERT INTO `t_user_browse` VALUES ('1052', '2761e95f94974c46b438e857f55b92cb', '38', '2019-10-08 15:59:59', '0'); INSERT INTO `t_user_browse` VALUES ('1053', 'f6a1bac7f5e345feb6da0737171f5e2b', '45', '2019-10-08 16:03:01', '0'); INSERT INTO `t_user_browse` VALUES ('1054', 'f6a1bac7f5e345feb6da0737171f5e2b', '44', '2019-10-08 17:42:43', '0'); INSERT INTO `t_user_browse` VALUES ('1055', 'f6a1bac7f5e345feb6da0737171f5e2b', '44', '2019-10-09 09:25:31', '0'); INSERT INTO `t_user_browse` VALUES ('1056', 'f6a1bac7f5e345feb6da0737171f5e2b', '45', '2019-10-09 09:30:43', '0'); INSERT INTO `t_user_browse` VALUES ('1057', 'f6a1bac7f5e345feb6da0737171f5e2b', '43', '2019-10-09 14:24:26', '0'); INSERT INTO `t_user_browse` VALUES ('1058', '4c23311a9e3441c9885bb4e79f3f9dbc', '45', '2019-10-09 16:39:00', '0'); INSERT INTO `t_user_browse` VALUES ('1059', '4c23311a9e3441c9885bb4e79f3f9dbc', '44', '2019-10-09 17:08:08', '0'); INSERT INTO `t_user_browse` VALUES ('1060', '4c23311a9e3441c9885bb4e79f3f9dbc', '42', '2019-10-09 17:08:47', '0'); INSERT INTO `t_user_browse` VALUES ('1061', '4c23311a9e3441c9885bb4e79f3f9dbc', '20', '2019-10-09 17:09:22', '0'); INSERT INTO `t_user_browse` VALUES ('1062', 'f6a1bac7f5e345feb6da0737171f5e2b', '44', '2019-10-10 12:45:37', '0'); INSERT INTO `t_user_browse` VALUES ('1063', 'f6a1bac7f5e345feb6da0737171f5e2b', '45', '2019-10-10 12:47:41', '0'); INSERT INTO `t_user_browse` VALUES ('1064', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '21', '2019-10-11 21:44:19', '0'); INSERT INTO `t_user_browse` VALUES ('1065', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '45', '2019-10-11 22:11:59', '0'); INSERT INTO `t_user_browse` VALUES ('1066', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '43', '2019-10-11 22:07:02', '0'); INSERT INTO `t_user_browse` VALUES ('1067', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '38', '2019-10-12 09:07:12', '0'); INSERT INTO `t_user_browse` VALUES ('1068', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '37', '2019-10-12 09:07:25', '0'); INSERT INTO `t_user_browse` VALUES ('1069', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '21', '2019-10-12 09:09:26', '0'); -- ---------------------------- -- Table structure for t_user_collection -- ---------------------------- DROP TABLE IF EXISTS `t_user_collection`; CREATE TABLE `t_user_collection` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '收藏主键ID', `USER_ID` varchar(128) NOT NULL, `POST_ID` int(11) NOT NULL COMMENT '帖子ID', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '收藏状态,0启用,1删除', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `SORT_TIME` datetime NOT NULL COMMENT '排序时间 ', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_collection -- ---------------------------- INSERT INTO `t_user_collection` VALUES ('56', '0e882d97f3be466794a368e877d6bc90', '18', '0', '2019-08-30 13:55:18', '2019-08-30 13:55:18'); INSERT INTO `t_user_collection` VALUES ('57', '4c23311a9e3441c9885bb4e79f3f9dbc', '18', '0', '2019-08-30 14:06:01', '2019-08-30 14:06:01'); INSERT INTO `t_user_collection` VALUES ('58', '4c23311a9e3441c9885bb4e79f3f9dbc', '20', '0', '2019-08-30 18:23:57', '2019-08-30 18:23:57'); INSERT INTO `t_user_collection` VALUES ('59', '0e882d97f3be466794a368e877d6bc90', '20', '0', '2019-08-31 15:34:59', '2019-08-31 15:34:59'); INSERT INTO `t_user_collection` VALUES ('60', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '21', '1', '2019-09-03 18:29:18', '2019-09-03 18:29:18'); INSERT INTO `t_user_collection` VALUES ('61', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '20', '1', '2019-09-04 08:23:52', '2019-09-04 08:23:52'); INSERT INTO `t_user_collection` VALUES ('62', '4c23311a9e3441c9885bb4e79f3f9dbc', '37', '0', '2019-09-10 20:23:02', '2019-09-10 20:23:02'); INSERT INTO `t_user_collection` VALUES ('63', 'f6a1bac7f5e345feb6da0737171f5e2b', '38', '0', '2019-10-08 11:46:15', '2019-10-08 11:46:15'); INSERT INTO `t_user_collection` VALUES ('64', '2761e95f94974c46b438e857f55b92cb', '38', '0', '2019-10-08 15:59:44', '2019-10-08 15:59:44'); INSERT INTO `t_user_collection` VALUES ('65', 'f6a1bac7f5e345feb6da0737171f5e2b', '42', '1', '2019-10-09 09:44:24', '2019-10-09 09:44:24'); INSERT INTO `t_user_collection` VALUES ('66', 'f6a1bac7f5e345feb6da0737171f5e2b', '41', '1', '2019-10-09 15:09:02', '2019-10-09 15:09:02'); INSERT INTO `t_user_collection` VALUES ('67', 'f6a1bac7f5e345feb6da0737171f5e2b', '43', '1', '2019-10-09 16:53:59', '2019-10-09 16:53:59'); INSERT INTO `t_user_collection` VALUES ('68', 'f6a1bac7f5e345feb6da0737171f5e2b', '44', '0', '2019-10-10 12:45:31', '2019-10-10 12:45:31'); INSERT INTO `t_user_collection` VALUES ('69', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '45', '1', '2019-10-11 21:40:31', '2019-10-11 21:40:31'); -- ---------------------------- -- Table structure for t_user_follow -- ---------------------------- DROP TABLE IF EXISTS `t_user_follow`; CREATE TABLE `t_user_follow` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '关注ID', `FOLLOW_ID` varchar(128) NOT NULL COMMENT '关注的用户ID', `FAN_ID` varchar(128) NOT NULL COMMENT '粉丝ID', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '关注状态,0启用,1解除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_follow -- ---------------------------- INSERT INTO `t_user_follow` VALUES ('1', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '2019-10-08 13:25:01', '0'); INSERT INTO `t_user_follow` VALUES ('2', 'f6a1bac7f5e345feb6da0737171f5e2b', '2761e95f94974c46b438e857f55b92cb', '2019-10-08 16:02:44', '0'); -- ---------------------------- -- Table structure for t_user_information -- ---------------------------- DROP TABLE IF EXISTS `t_user_information`; CREATE TABLE `t_user_information` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户消息ID', `START_ID` varchar(128) NOT NULL COMMENT '发送者ID', `RECEIVE_ID` varchar(128) NOT NULL COMMENT '接收者ID', `CONTENT` text NOT NULL COMMENT '消息文本', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_information -- ---------------------------- INSERT INTO `t_user_information` VALUES ('1', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '111', '2019-09-04 13:33:53', '0'); INSERT INTO `t_user_information` VALUES ('2', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '4545', '2019-09-04 13:34:45', '0'); INSERT INTO `t_user_information` VALUES ('3', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '哈哈哈', '2019-09-09 11:17:30', '0'); INSERT INTO `t_user_information` VALUES ('4', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '哈哈哈', '2019-09-10 20:24:14', '0'); INSERT INTO `t_user_information` VALUES ('5', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '你好呀', '2019-10-08 09:50:41', '0'); INSERT INTO `t_user_information` VALUES ('6', '4c23311a9e3441c9885bb4e79f3f9dbc', 'f6a1bac7f5e345feb6da0737171f5e2b', '1111', '2019-10-08 09:53:52', '0'); INSERT INTO `t_user_information` VALUES ('7', 'f6a1bac7f5e345feb6da0737171f5e2b', '4c23311a9e3441c9885bb4e79f3f9dbc', '{\"msg\":\"请求处理异常,请稍后再试\",\"code\":\"400\",\"info\":{\"errorLocation\":\"org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Temp\\\\2\\\\tomcat.5201720812907835232.8080\\\\work\\\\Tomcat\\\\localhost\\\\ROOT] is not valid 错误位置:StandardMultipartHttpServletRequest.java:123\"}}', '2019-10-08 13:28:26', '0'); INSERT INTO `t_user_information` VALUES ('8', 'f6a1bac7f5e345feb6da0737171f5e2b', '4c23311a9e3441c9885bb4e79f3f9dbc', '能收到信息么', '2019-10-08 13:54:42', '0'); INSERT INTO `t_user_information` VALUES ('9', '2761e95f94974c46b438e857f55b92cb', '4c23311a9e3441c9885bb4e79f3f9dbc', '你好', '2019-10-08 15:59:18', '0'); -- ---------------------------- -- Table structure for t_user_operation_restrict -- ---------------------------- DROP TABLE IF EXISTS `t_user_operation_restrict`; CREATE TABLE `t_user_operation_restrict` ( `USER_ID` varchar(128) NOT NULL COMMENT '用户唯一标示', `REPORT_NUM` int(11) NOT NULL DEFAULT '3' COMMENT '日最大举报次数', `PUBLISH_NUM` int(11) NOT NULL DEFAULT '5' COMMENT '日最大发布次数', `RESTRICT_STATE` tinyint(4) NOT NULL DEFAULT '0' COMMENT '限制状态,0不限制,1限制', `RESTRICT_END_TIME` datetime NOT NULL COMMENT '限制结束时间', PRIMARY KEY (`USER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_operation_restrict -- ---------------------------- -- ---------------------------- -- Table structure for t_user_resonate -- ---------------------------- DROP TABLE IF EXISTS `t_user_resonate`; CREATE TABLE `t_user_resonate` ( `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '点赞表主键', `TYPE` int(11) NOT NULL COMMENT '点赞类型', `TARGET_ID` varchar(128) NOT NULL COMMENT '点赞的目标id', `USER_ID` varchar(128) NOT NULL COMMENT '点赞用户的ID', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0启用,1删除', PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=165 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user_resonate -- ---------------------------- INSERT INTO `t_user_resonate` VALUES ('158', '1', '20', '4c23311a9e3441c9885bb4e79f3f9dbc', '2019-08-31 12:17:12', '0'); INSERT INTO `t_user_resonate` VALUES ('159', '1', '21', '4c23311a9e3441c9885bb4e79f3f9dbc', '2019-08-31 15:53:20', '0'); INSERT INTO `t_user_resonate` VALUES ('160', '1', '20', 'fe080666-88f7-4b5c-96e9-b2b3dc550ada', '2019-09-03 18:32:19', '1'); INSERT INTO `t_user_resonate` VALUES ('161', '1', '37', '4c23311a9e3441c9885bb4e79f3f9dbc', '2019-09-10 20:25:38', '0'); INSERT INTO `t_user_resonate` VALUES ('162', '1', '38', 'f6a1bac7f5e345feb6da0737171f5e2b', '2019-10-08 15:05:45', '0'); INSERT INTO `t_user_resonate` VALUES ('163', '1', '44', '2761e95f94974c46b438e857f55b92cb', '2019-10-08 15:56:20', '0'); INSERT INTO `t_user_resonate` VALUES ('164', '1', '44', '81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '2019-10-12 10:13:07', '0'); -- ---------------------------- -- Table structure for t_visitor -- ---------------------------- DROP TABLE IF EXISTS `t_visitor`; CREATE TABLE `t_visitor` ( `USER_ID` varchar(255) NOT NULL COMMENT '系统用户唯一标示', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', PRIMARY KEY (`USER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_visitor -- ---------------------------- INSERT INTO `t_visitor` VALUES ('0f57ceff-93e5-48c4-9099-6dbeddbcb004', '2019-10-08 09:00:37'); INSERT INTO `t_visitor` VALUES ('18673c18-cf35-4779-88cb-cb6d000f9e02', '2019-09-01 11:02:38'); INSERT INTO `t_visitor` VALUES ('1c016125-9004-46cc-86b6-4d9bd37f8a06', '2019-09-30 21:41:15'); INSERT INTO `t_visitor` VALUES ('218fe87d-db6b-48ce-a408-83287e51b7e8', '2019-08-30 18:06:53'); INSERT INTO `t_visitor` VALUES ('306ab4cc-0e4e-46ee-bdc7-c89eca232dd9', '2019-09-03 18:10:00'); INSERT INTO `t_visitor` VALUES ('3f4ae843-3fe5-47f3-8779-13d1465f6b30', '2019-08-31 15:49:17'); INSERT INTO `t_visitor` VALUES ('44630af1-3ad1-4f3d-9c7e-823e68da38f9', '2019-09-04 12:45:08'); INSERT INTO `t_visitor` VALUES ('538593c3-f0aa-41e1-bfcb-573973029f7f', '2019-09-02 17:35:16'); INSERT INTO `t_visitor` VALUES ('54d9030c-dd0d-42b0-80e5-5f298a4682c7', '2019-08-30 14:03:48'); INSERT INTO `t_visitor` VALUES ('567a6322-3e6f-44cd-9f32-eef678e1971c', '2019-09-10 20:36:34'); INSERT INTO `t_visitor` VALUES ('7c871e7e-e558-4761-8c03-a5adc2f4ee46', '2019-08-30 17:53:43'); INSERT INTO `t_visitor` VALUES ('81ba77f3-2be2-4d90-80a1-447c3962df16', '2019-08-30 13:52:03'); INSERT INTO `t_visitor` VALUES ('81e4d4fe-a2fb-4a32-9fe2-707f03a89e73', '2019-10-11 17:59:26'); INSERT INTO `t_visitor` VALUES ('880e26ad-bb38-40ad-8b01-dc245c85dd4c', '2019-10-12 09:30:25'); INSERT INTO `t_visitor` VALUES ('ab4611fd-d4c8-4f81-a4e6-ac191602f3ac', '2019-10-08 09:49:04'); INSERT INTO `t_visitor` VALUES ('ac04bc63-4daf-43f4-9a4d-caa4bee3a66c', '2019-08-30 17:56:02'); INSERT INTO `t_visitor` VALUES ('e4050bf4-ba62-42f3-85a7-92d2996ef207', '2019-08-30 17:38:46'); INSERT INTO `t_visitor` VALUES ('e7ee6923-9625-4c46-b00a-8a3e0f2f4878', '2019-09-02 17:45:22'); INSERT INTO `t_visitor` VALUES ('f27cc768-dc5f-4226-b20a-7eb916a7e5f7', '2019-09-06 17:34:51'); INSERT INTO `t_visitor` VALUES ('f3dd6827-0ebf-4dc9-9871-0c1e02ca28dd', '2019-09-04 13:24:50'); INSERT INTO `t_visitor` VALUES ('f4593448-c139-4acf-8691-d6000afb566f', '2019-09-03 17:54:36'); INSERT INTO `t_visitor` VALUES ('f9c9edf1-fb89-48a5-81b4-e92f0b0e89b1', '2019-09-30 09:32:01'); INSERT INTO `t_visitor` VALUES ('fe080666-88f7-4b5c-96e9-b2b3dc550ada', '2019-09-03 18:23:06'); -- ---------------------------- -- Table structure for t_wx_permission -- ---------------------------- DROP TABLE IF EXISTS `t_wx_permission`; CREATE TABLE `t_wx_permission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `permission_type` int(11) NOT NULL DEFAULT '0', `permission_code` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of t_wx_permission -- ---------------------------- INSERT INTO `t_wx_permission` VALUES ('1', '0', 'wx:follow:userList'); INSERT INTO `t_wx_permission` VALUES ('2', '0', 'wx:follow:fansList'); INSERT INTO `t_wx_permission` VALUES ('3', '0', 'wx:comment:del'); INSERT INTO `t_wx_permission` VALUES ('4', '0', 'wx:comment:list'); INSERT INTO `t_wx_permission` VALUES ('5', '0', 'wx:post:del'); INSERT INTO `t_wx_permission` VALUES ('6', '0', 'wx:browse:postList'); INSERT INTO `t_wx_permission` VALUES ('7', '0', 'wx:browse:userList'); INSERT INTO `t_wx_permission` VALUES ('8', '0', 'wx:collection:list'); INSERT INTO `t_wx_permission` VALUES ('9', '0', 'wx:user:update'); INSERT INTO `t_wx_permission` VALUES ('10', '0', 'wx:follow:update'); INSERT INTO `t_wx_permission` VALUES ('11', '0', 'wx:post:update'); INSERT INTO `t_wx_permission` VALUES ('12', '0', 'wx:post:info'); INSERT INTO `t_wx_permission` VALUES ('13', '0', 'wx:like:userList'); INSERT INTO `t_wx_permission` VALUES ('14', '0', 'wx:like:postList'); INSERT INTO `t_wx_permission` VALUES ('15', '0', 'wx:report:add'); INSERT INTO `t_wx_permission` VALUES ('16', '1', 'wx:comment:add'); INSERT INTO `t_wx_permission` VALUES ('17', '1', 'wx:post:add'); INSERT INTO `t_wx_permission` VALUES ('18', '1', 'wx:collection:add'); INSERT INTO `t_wx_permission` VALUES ('19', '1', 'wx:post:shelf'); -- ---------------------------- -- Table structure for t_wx_user -- ---------------------------- DROP TABLE IF EXISTS `t_wx_user`; CREATE TABLE `t_wx_user` ( `USER_ID` varchar(128) NOT NULL COMMENT '系统用户ID', `OPEN_ID` varchar(128) NOT NULL COMMENT '微信openId', `UNION_ID` varchar(128) NOT NULL COMMENT '微信唯一标示', `WX_AVATAR_URL` varchar(255) NOT NULL COMMENT '微信用户头像', `WX_NICK_NAME` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '微信名称', `WX_GENDER` int(10) NOT NULL DEFAULT '1' COMMENT '微信性别,男性为1', `WX_CITY` varchar(100) DEFAULT NULL COMMENT '市', `WX_PROVINCE` varchar(100) DEFAULT NULL COMMENT '省', `WX_COUNTRY` varchar(100) DEFAULT NULL COMMENT '国家', `DEV_FANS` int(11) NOT NULL DEFAULT '0' COMMENT '粉丝偏移量', `CREATE_TIME` datetime NOT NULL COMMENT '创建时间', `UPDATE_TIME` datetime NOT NULL COMMENT '更新时间', `IS_DEL` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,0正常,1删除', `SUMMARY` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`USER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_wx_user -- ---------------------------- INSERT INTO `t_wx_user` VALUES ('0e882d97f3be466794a368e877d6bc90', 'owmp45NxQ25uh0Q10Zt9qOp9fMXQ', 'o-xzPwMuSxACBPRZ5pDjA7FLpXhw', 'https://wx.qlogo.cn/mmopen/vi_32/InNUIN15cVtnWLicic7A2EXibkv5x3C3dDBCal0P542uybT18q9mWd9P4q9nzjia0icWAMNEVVachFYT3HESLzPo8RA/132', '噬云', '0', null, '', null, '0', '2019-08-30 13:54:03', '2019-08-30 13:54:03', '0', null); INSERT INTO `t_wx_user` VALUES ('2761e95f94974c46b438e857f55b92cb', 'owmp45DMikwnr2SEx1C5Aq_KjIs4', 'o-xzPwIkxZC-pe4za_NOucz_ihSg', 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eqAQibMIJsiad0onZFNmjxfF9eibKTKYHtib0J0aX1tqIyBahf3MIxBsNofWfKVP6zEiar31Zq4Hz0UwFw/132', '皮格马利翁效应', '1', null, '中国', null, '0', '2019-10-08 15:22:24', '2019-10-08 15:22:24', '0', null); INSERT INTO `t_wx_user` VALUES ('4c23311a9e3441c9885bb4e79f3f9dbc', 'owmp45Gpjybfn15q-frEEE9KZ_wI', 'o-xzPwGV4lpJUZvsaB9ki2laPO5I', 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epYB4Piaurngh31L1GyMJhQor4tYUNAic4lGhbZJZxicM6rINbiaicyo3nO6gW7Q4icuAuXIrWvr7H1M3gg/132', '平凡?', '1', null, '中国', null, '0', '2019-08-30 14:05:39', '2019-08-30 14:05:39', '0', null); INSERT INTO `t_wx_user` VALUES ('f6a1bac7f5e345feb6da0737171f5e2b', 'owmp45LvrAjcfSPPVf16htxHGmp0', 'o-xzPwDchHpL5JNel34fgdSyVgZg', 'https://wx.qlogo.cn/mmopen/vi_32/lyFAqR0AcYbVtGIy2mgicj1QTVMs52ib4JH6CSHS6tTgsqrFbLock28pYCleck8N0X9L9f9ichODHhQSZwMPlLg3w/132', '华', '1', null, '中国', null, '0', '2019-09-03 18:20:10', '2019-09-03 18:20:10', '0', '我是一个大傻逼');
<filename>schema.sql<gh_stars>0 DROP TABLE IF EXISTS stories; CREATE TABLE stories ( id SERIAL PRIMARY KEY, name VARCHAR(255), location VARCHAR(255), story TEXT, category VARCHAR(255) );
alter table "public"."patient_discharge" rename column "patient_hospital_id" to "hospital_patient_id";
<gh_stars>1-10 IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__IncidentI__Incid__1B4E8E51]') AND type = 'D') BEGIN ALTER TABLE [dbo].[IncidentInstance] DROP CONSTRAINT [DF__IncidentI__Incid__1B4E8E51] END GO IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__IncidentI__SLAHi__1C42B28A]') AND type = 'D') BEGIN ALTER TABLE [dbo].[IncidentInstance] DROP CONSTRAINT [DF__IncidentI__SLAHi__1C42B28A] END GO IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__IncidentI__SLALo__1D36D6C3]') AND type = 'D') BEGIN ALTER TABLE [dbo].[IncidentInstance] DROP CONSTRAINT [DF__IncidentI__SLALo__1D36D6C3] END GO IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__IncidentI__SLANo__1E2AFAFC]') AND type = 'D') BEGIN ALTER TABLE [dbo].[IncidentInstance] DROP CONSTRAINT [DF__IncidentI__SLANo__1E2AFAFC] END GO IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__IncidentI__SLAWa__1F1F1F35]') AND type = 'D') BEGIN ALTER TABLE [dbo].[IncidentInstance] DROP CONSTRAINT [DF__IncidentI__SLAWa__1F1F1F35] END GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[IncidentInstance]') AND type in (N'U')) DROP TABLE [dbo].[IncidentInstance] GO
ALTER TABLE Records ADD COLUMN `contextId` varchar(36);
/* https://stackoverflow.com/questions/33271446/invoke-sqlcmd-runs-script-twice */ insert into dbo.s ( b) select 'hello world' insert into dbo.t (s_id, b) -- purposely missing id to cause an error select 1, 'good morning'
-- Demonstrate how you delete all account tuples at every branch located in a specific city. DELETE FROM BankAccount WHERE Branchname IN ( SELECT Branchname FROM Branch WHERE branchcity = 'BOMBAY' ) ;
<reponame>pirocorp/Databases-Basics-MS-SQL-Server<gh_stars>1-10 USE Hotel TRUNCATE TABLE Occupancies
SET @order = %d; SET @lecture = %d; SET @update_nu = (SELECT true FROM content WHERE nu = @order AND lecture = @lecture LIMIT 1); UPDATE content SET nu = nu + 1 WHERE @update_nu AND @order > 0 AND nu >= @order AND lecture = @lecture; SET @nu = IF(@order = 0, (SELECT nu + 1 FROM content WHERE lecture = @lecture ORDER BY id DESC LIMIT 1), @order); SET @nu = IF(@nu, @nu, 1); INSERT INTO content (lecture, nu, name, view, status) VALUES (@lecture, @nu, '%s', '$d[view]', $d[status]);
-- AlterEnum ALTER TYPE "UserRoleType" ADD VALUE 'employee';
USE [CSETWeb] GO /****** Object: Table [dbo].[NIST_SAL_QUESTIONS] Script Date: 11/14/2018 3:57:25 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[NIST_SAL_QUESTIONS]( [Question_Id] [int] NOT NULL, [Question_Number] [int] NOT NULL, [Question_Text] [varchar](7000) NULL, CONSTRAINT [PK_NIST_SAL_QUESTIONS_1] PRIMARY KEY CLUSTERED ( [Question_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 [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16338, 1, N'Does aggregation of information on this system reveal sensitive patterns and plans, or facilitate access to sensitive or critical systems?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16342, 2, N'Does/could access to this system result in some form of access to other more sensitive or critical systems (e.g., over a network)?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16346, 3, N'Are there extenuating circumstances such as: The system provides critical process flow or security capability, the public visibility of the system, the sheer number of other systems reliant on its operation, or the overall cost of the systems replacement?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16350, 4, N'Would unauthorized modification or destruction of information affecting external communications (e.g., web pages, electronic mail) adversely affect operations or seriously damage mission function and/or public confidence?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16354, 5, N'Would either physical or logical destruction of the system result in very large expenditures to restore the system and/or require a long period of time for recovery?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16358, 6, N'Does the mission served by the system, or the information that the system processes, affect the security of critical infrastructures and key resources?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16362, 7, N'Does the system store, communicate, or process any privacy act information?') INSERT [dbo].[NIST_SAL_QUESTIONS] ([Question_Id], [Question_Number], [Question_Text]) VALUES (16366, 8, N'Does the systems store, communicate, or process any trade secrets information?') EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The Question Id is used to' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'NIST_SAL_QUESTIONS', @level2type=N'COLUMN',@level2name=N'Question_Id' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The Question Number is used to' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'NIST_SAL_QUESTIONS', @level2type=N'COLUMN',@level2name=N'Question_Number' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The Question Text is used to' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'NIST_SAL_QUESTIONS', @level2type=N'COLUMN',@level2name=N'Question_Text' GO EXEC sys.sp_addextendedproperty @name=N'BELONGS_IN_EA', @value=N'YES' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'NIST_SAL_QUESTIONS' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'NIST_SAL_QUESTIONS' GO
<reponame>tewksbg/kvwmap-en BEGIN; ALTER TABLE `datatypes` ADD `dbname` VARCHAR( 50 ) NOT NULL , ADD `host` VARCHAR( 50 ) NULL , ADD `port` INT NULL; COMMIT;
<reponame>WLKR-Financial/alpacaios-backend DROP TABLE IF EXISTS reward;
<filename>test/sql/updates/setup.drop_meta.sql -- DROP some chunks to test metadata cleanup DROP TABLE _timescaledb_internal._hyper_1_2_chunk; DROP TABLE _timescaledb_internal._hyper_1_3_chunk;
<reponame>acasado666/WS_UnitAndIntegrationTesting INSERT INTO rooms values (100, 55.00, 75.00, 'Single', 1); INSERT INTO rooms values (101, 55.00, 75.00, 'Single', 1); INSERT INTO rooms values (102, 85.00, 105.00, 'Double', 1); INSERT INTO rooms values (103, 55.00, 75.00, 'Single', 1); INSERT INTO rooms values (104, 150.00, 175.00, 'Suite', 1); INSERT INTO rooms values (105, 85.00, 105.00, 'Double', 1); INSERT INTO rooms values (106, 55.00, 75.00, 'Single', 1); INSERT INTO rooms values (107, 85.00, 105.00, 'Double', 1); INSERT INTO rooms values (200, 55.00, 75.00, 'Single', 2); INSERT INTO rooms values (201, 55.00, 75.00, 'Single', 2); INSERT INTO rooms values (202, 85.00, 105.00, 'Double', 2); INSERT INTO rooms values (203, 55.00, 75.00, 'Single', 2); INSERT INTO rooms values (204, 150.00, 175.00, 'Suite', 2); INSERT INTO rooms values (205, 85.00, 105.00, 'Double', 2); INSERT INTO rooms values (206, 55.00, 75.00, 'Single', 2); INSERT INTO rooms values (207, 85.00, 105.00, 'Double', 2); INSERT INTO rooms values (300, 55.00, 75.00, 'Single', 3); INSERT INTO rooms values (301, 55.00, 75.00, 'Single', 3); INSERT INTO rooms values (302, 85.00, 105.00, 'Double', 3); INSERT INTO rooms values (303, 55.00, 75.00, 'Single', 3); INSERT INTO rooms values (304, 150.00, 175.00, 'Suite', 3); INSERT INTO rooms values (305, 85.00, 105.00, 'Double', 3); INSERT INTO rooms values (306, 55.00, 75.00, 'Single', 3); INSERT INTO rooms values (307, 85.00, 105.00, 'Double', 3); INSERT INTO rooms values (400, 65.00, 75.00, 'Single', 4); INSERT INTO rooms values (401, 65.00, 75.00, 'Single', 4); INSERT INTO rooms values (402, 95.00, 105.00, 'Double', 4); INSERT INTO rooms values (403, 65.00, 75.00, 'Single', 4); INSERT INTO rooms values (404, 170.00, 195.00, 'Suite', 4); INSERT INTO rooms values (405, 95.00, 105.00, 'Double', 4); INSERT INTO rooms values (406, 65.00, 75.00, 'Single', 4); INSERT INTO rooms values (407, 95.00, 105.00, 'Double', 4);
CREATE OR REPLACE VIEW G_CREATE_REFERENCE_ITEM AS SELECT TAB_A.CREATE_ITEM_ID ITEM_ID , TAB_C.LINK_ID LINK_ID , TAB_A.DISP_SEQ DISP_SEQ , TAB_C.TABLE_NAME TABLE_NAME , TAB_C.PRI_NAME PRI_NAME , CASE WHEN CHAR_LENGTH(TAB_A.CREATE_ITEM_ID) <= 4 THEN CONCAT('KY_AUTO_COL_', lpad(TAB_A.CREATE_ITEM_ID, 4, '0')) ELSE CONCAT('KY_AUTO_COL_', TAB_A.CREATE_ITEM_ID) END AS COLUMN_NAME, TAB_A.ITEM_NAME ITEM_NAME , TAB_D.FULL_COL_GROUP_NAME COL_GROUP_NAME , TAB_A.DESCRIPTION DESCRIPTION , TAB_A.INPUT_METHOD_ID INPUT_METHOD_ID , CASE WHEN TAB_A.INPUT_METHOD_ID = 8 THEN 2 ELSE 1 END AS SENSITIVE_FLAG, CASE WHEN CHAR_LENGTH(TAB_A.CREATE_ITEM_ID) <= 4 THEN CASE WHEN CONCAT('KY_AUTO_COL_', lpad(TAB_A.CREATE_ITEM_ID, 4, '0')) = TAB_C.COLUMN_NAME THEN 1 ELSE '' END ELSE CASE WHEN CONCAT('KY_AUTO_COL_', TAB_A.CREATE_ITEM_ID) = TAB_C.COLUMN_NAME THEN 1 ELSE '' END END AS MASTER_COL_FLAG , TAB_A.ACCESS_AUTH , TAB_A.NOTE , TAB_A.DISUSE_FLAG , TAB_A.LAST_UPDATE_TIMESTAMP , TAB_A.LAST_UPDATE_USER , TAB_B.ACCESS_AUTH AS ACCESS_AUTH_01 , TAB_C.ACCESS_AUTH AS ACCESS_AUTH_02 , TAB_D.ACCESS_AUTH AS ACCESS_AUTH_03 FROM F_CREATE_ITEM_INFO TAB_A LEFT JOIN F_CREATE_MENU_INFO TAB_B ON (TAB_A.CREATE_MENU_ID = TAB_B.CREATE_MENU_ID) LEFT JOIN G_OTHER_MENU_LINK TAB_C ON (TAB_B.MENU_NAME = TAB_C.MENU_NAME) LEFT JOIN F_COLUMN_GROUP TAB_D ON (TAB_A.COL_GROUP_ID = TAB_D.COL_GROUP_ID) WHERE NOT TAB_A.INPUT_METHOD_ID = 7 AND TAB_B.DISUSE_FLAG='0' AND TAB_C.DISUSE_FLAG='0' ; CREATE OR REPLACE VIEW G_CREATE_REFERENCE_ITEM_JNL AS SELECT TAB_A.JOURNAL_SEQ_NO , TAB_A.JOURNAL_REG_DATETIME , TAB_A.JOURNAL_ACTION_CLASS , TAB_A.CREATE_ITEM_ID ITEM_ID , TAB_C.LINK_ID LINK_ID , TAB_A.DISP_SEQ DISP_SEQ , TAB_C.TABLE_NAME TABLE_NAME , TAB_C.PRI_NAME PRI_NAME , CASE WHEN CHAR_LENGTH(TAB_A.CREATE_ITEM_ID) <= 4 THEN CONCAT('KY_AUTO_COL_', lpad(TAB_A.CREATE_ITEM_ID, 4, '0')) ELSE CONCAT('KY_AUTO_COL_', TAB_A.CREATE_ITEM_ID) END AS COLUMN_NAME, TAB_A.ITEM_NAME ITEM_NAME , TAB_D.FULL_COL_GROUP_NAME COL_GROUP_NAME , TAB_A.DESCRIPTION DESCRIPTION , TAB_A.INPUT_METHOD_ID INPUT_METHOD_ID , CASE WHEN TAB_A.INPUT_METHOD_ID = 8 THEN 2 ELSE 1 END AS SENSITIVE_FLAG, CASE WHEN CHAR_LENGTH(TAB_A.CREATE_ITEM_ID) <= 4 THEN CASE WHEN CONCAT('KY_AUTO_COL_', lpad(TAB_A.CREATE_ITEM_ID, 4, '0')) = TAB_C.COLUMN_NAME THEN 1 ELSE '' END ELSE CASE WHEN CONCAT('KY_AUTO_COL_', TAB_A.CREATE_ITEM_ID) = TAB_C.COLUMN_NAME THEN 1 ELSE '' END END AS MASTER_COL_FLAG , TAB_A.ACCESS_AUTH , TAB_A.NOTE , TAB_A.DISUSE_FLAG , TAB_A.LAST_UPDATE_TIMESTAMP , TAB_A.LAST_UPDATE_USER , TAB_B.ACCESS_AUTH AS ACCESS_AUTH_01 , TAB_C.ACCESS_AUTH AS ACCESS_AUTH_02 , TAB_D.ACCESS_AUTH AS ACCESS_AUTH_03 FROM F_CREATE_ITEM_INFO_JNL TAB_A LEFT JOIN F_CREATE_MENU_INFO TAB_B ON (TAB_A.CREATE_MENU_ID = TAB_B.CREATE_MENU_ID) LEFT JOIN G_OTHER_MENU_LINK TAB_C ON (TAB_B.MENU_NAME = TAB_C.MENU_NAME) LEFT JOIN F_COLUMN_GROUP TAB_D ON (TAB_A.COL_GROUP_ID = TAB_D.COL_GROUP_ID) WHERE NOT TAB_A.INPUT_METHOD_ID = 7 AND TAB_B.DISUSE_FLAG='0' AND TAB_C.DISUSE_FLAG='0' ; UPDATE A_PROC_LOADED_LIST SET LOADED_FLG='0' WHERE ROW_ID=2100020005;
-- first pass: migrate exporters with credentials -- integration.name := exporter.name -- integration.tenant_id := tenant.id where tenant.name = exporter.tenant -- integration.kind := "exporter-" + exporter.type -- integration.data["config"] := exporter.config -- integration.data["credential"] := credential.value where credential.name = exporter.credential INSERT INTO integration ( name, tenant_id, kind, data ) SELECT name, -- get tenant id: (SELECT id FROM tenant WHERE name = tenant), -- concatenate "exporter-" + type: 'exporter-' || type, -- merge two json objects, one with the config and the other with the (non-null) credential: jsonb_build_object('config', config) || jsonb_build_object('credential', (SELECT value FROM credential WHERE name = credential)) FROM exporter WHERE credential IS NOT NULL; -- second pass: migrate exporters without credentials -- integration.name := exporter.name -- integration.tenant_id := tenant.id where tenant.name = exporter.tenant -- integration.kind := "exporter-" + exporter.type -- integration.data["config"] := exporter.config (not moving to root level - keep consistent across exporters and allow for other subfields later) INSERT INTO integration ( name, tenant_id, kind, data ) SELECT name, -- get tenant id: (SELECT id FROM tenant WHERE name = tenant), -- concatenate "exporter-" + type: 'exporter-' || type, -- nest the config under json "config" field, with no credential field: jsonb_build_object('config', config) FROM exporter WHERE credential IS NULL;
<gh_stars>1000+ ALTER TABLE "selfservice_verification_flows" ADD COLUMN "ui" jsonb;
-- @testpoint:定义INOUT参数模式有两个,返回值不设为record,合理报错 drop FUNCTION if EXISTS x_testfun4; CREATE FUNCTION x_testfun4 (c_int INOUT int,c_int1 INOUT int ) returns int AS $$ BEGIN RETURN next; END; $$ LANGUAGE plpgsql; /
<reponame>liurunkaiGit/asset<filename>sql/update0605_dynamic.sql INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('催记报表', '2086', '4', '/call/record', 'menuItem', 'C', '0', 'call:record:view', '#', 'admin', '2020-06-03 09:27:06', '', NULL, ''); -- 需要替换parent_id INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('查询', '2155', '1', '#', '', 'F', '0', 'call:record:list', '#', 'admin', '2020-05-22 16:38:06', 'admin', '2020-05-22 16:38:06', ''); INSERT INTO `sys_menu` (`menu_name`, `parent_id`, `order_num`, `url`, `target`, `menu_type`, `visible`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('导出', '2155', '2', '#', '', 'F', '0', 'call:record:export', '#', 'admin', '2020-05-22 16:38:06', 'admin', '2020-05-22 16:38:06', '');