conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Fix api endpoint variable name in script\n"
},
{
"from": "human",
"value": "--\n-- Copyright (c) 2012-2016 Codenvy, S.A.\n-- All rights reserved. This program and the accompanying materials\n-- are made available under the terms of the Eclipse Public License v1.0\n-... | sql | chosen |
[
{
"from": "system",
"value": "Add a stable sort order.\n"
},
{
"from": "human",
"value": "# Count the number of heterozygous variants per sample.\nSELECT\n call.call_set_name,\n SUM(first_allele != second_allele) AS heterozygous_variant_count\nFROM (\n SELECT\n reference_name,\n start,\... | sql | chosen |
[
{
"from": "system",
"value": "Fix constraint name after the column renaming\n\nChange-Id: I0dea2f3016cd5dfc956fbb1c5eafc21b2017a059\n"
},
{
"from": "human",
"value": "ALTER TABLE application RENAME COLUMN eonid TO eon_id;\nALTER TABLE application ADD CONSTRAINT application_grn_fk FOREIGN KEY (eo... | sql | chosen |
[
{
"from": "system",
"value": "Add column for storing adding time to menus table\n"
},
{
"from": "human",
"value": "\n-- Table for storing menus for each week\nCREATE TABLE menus (\n id SERIAL PRIMARY KEY,\n start_date DATE NOT NULL,\n end_date DATE NOT NULL,\n menu JSONB ... | sql | chosen |
[
{
"from": "system",
"value": "Change texts of example user 2 to be distinct from user 1's texts\n"
},
{
"from": "human",
"value": "\n\nINSERT INTO `user` (`user_name`, `user_password`) VALUES\n('test', 'test'),\n('example', 'example');\n\nINSERT INTO `user_messages` (`user_id`, `message_text`) V... | sql | chosen |
[
{
"from": "system",
"value": "Add scripts to clear databases for loading\n"
},
{
"from": "human",
"value": "/*\ntruncate table synth_ma.synth_cousub_stats;\ntruncate table synth_ma.synth_county_stats;\n\ntruncate table synth_ma.synth_cousub_facts;\ntruncate table synth_ma.synth_county_facts;\n*/... | sql | chosen |
[
{
"from": "system",
"value": "Fix query in Voci con avviso W inserite da IP\n"
},
{
"from": "human",
"value": "CONNECT itwiki_p itwiki.labsdb;\nSELECT CONCAT('# [[', page_title, ']]')\nFROM page\nLEFT JOIN revision ON page_id = rev_page\nWHERE page_namespace = 0\nAND rev_parent_id = 0\nAND (rev_... | sql | chosen |
[
{
"from": "system",
"value": "Rewrite update script not to cause error if executed two times\n"
},
{
"from": "human",
"value": "#tags: kwc\nALTER TABLE `cache_component` CHANGE `type` `type` ENUM( 'page', 'component', 'master', 'partial', 'componentLink', 'fullPage' ) CHARACTER SET lati... | sql | chosen |
[
{
"from": "system",
"value": "Remove composite primary key, because it's sucky\n"
},
{
"from": "human",
"value": "-- Types mostly lifted from \n-- http://www.postgresql.org/docs/9.4/static/datatype.html\n\nCREATE TABLE test_types (\n bigint_t BIGINT,\n boolean_t BOOLEAN,\n double... | sql | chosen |
[
{
"from": "system",
"value": "Change mind about naming in the as-yet-unused publists table\n"
},
{
"from": "human",
"value": "CREATE TABLE pubs (\n id INTEGER UNIQUE PRIMARY KEY,\n abstract TEXT,\n arxiv TEXT,\n bibcode TEXT,\n doi TEXT,\n keep INTEGER,\n ... | sql | chosen |
[
{
"from": "system",
"value": "Remove \"NOT NULL\" constraint from session column.\n"
},
{
"from": "human",
"value": "STRINGIFY(\n CREATE TABLE IF NOT EXISTS users (\n firstname TEXT NOT NULL,\n lastname TEXT NOT NULL,\n username TEXT PRIMARY KEY NOT NULL,\n passwor... | sql | chosen |
[
{
"from": "system",
"value": "Allow connections from any docker container\n"
},
{
"from": "human",
"value": "UPDATE mysql.user SET password = password('abc123') WHERE user = 'root';\nGRANT ALL PRIVILEGES ON *.* TO 'root'@'172.17.42.1' IDENTIFIED BY 'abc123' WITH GRANT OPTION;\nFLUSH PRIVILEGES;\... | sql | chosen |
[
{
"from": "system",
"value": "Add a default value for new users\n"
},
{
"from": "human",
"value": "CREATE DATABASE notes;\n\nCREATE TABLE note_users (\n UserId VARCHAR(60) PRIMARY KEY,\n UserEmail VARCHAR(255),\n UserPassword VARCHAR(512),\n TagColor VARCHAR(6)\n);\n\nCREATE TABLE no... | sql | chosen |
[
{
"from": "system",
"value": "Allow path fields to be nullable now that they could have blob_id\n"
},
{
"from": "human",
"value": "ALTER TABLE warc ADD blob_id bigint;\nALTER TABLE artifact ADD blob_id bigint;"
},
{
"from": "gpt",
"value": "ALTER TABLE warc ADD blob_id bigint;\nALTER... | sql | chosen |
[
{
"from": "system",
"value": "KRACOEUS-5617: Create parameter for proposal summary title\n"
},
{
"from": "human",
"value": "INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID)\r\nVALUES ('KC-PD', 'Document', 'proposaldev... | sql | chosen |
[
{
"from": "system",
"value": "Set obsid to 'not null' in asp1 archfiles\n"
},
{
"from": "human",
"value": "CREATE TABLE archfiles (\n filename text not null,\n filetime int not null,\n year int not null,\n doy int not null,\n tstart float not n... | sql | chosen |
[
{
"from": "system",
"value": "Make comment field text rather than varchar\n\ngit-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@10721 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3\n"
},
{
"from": "human",
"value": "--\n-- Database: `findbugs`\n--\n\n-- --------------------------------------------------... | sql | chosen |
[
{
"from": "system",
"value": "Correct a small bug in the SQL which caused the creation of the function\nto fail\n"
},
{
"from": "human",
"value": "DROP FUNCTION IF EXISTS geo_distance;\r\n\r\nDELIMITER $$\r\nCREATE FUNCTION geo_distance (lat1 double, long1 double, lat2 double, long2 double)\r\nR... | sql | chosen |
[
{
"from": "system",
"value": "Change itest blob fields to bytea so postgres doesn't try to encode its contents.\n"
},
{
"from": "human",
"value": "CREATE USER itest;\nCREATE DATABASE itest OWNER itest;\nGRANT ALL PRIVILEGES ON DATABASE itest TO itest;\n\n\\c itest;\nCREATE SEQUENCE users_id_sequ... | sql | chosen |
[
{
"from": "system",
"value": "Remove function based on :bat columns\n"
},
{
"from": "human",
"value": "-- The contents of this file are subject to the MonetDB Public License\n-- Version 1.1 (the \"License\"); you may not use this file except in\n-- compliance with the License. You may obtain a c... | sql | chosen |
[
{
"from": "system",
"value": "Fix query to work with namespaced tables\n"
},
{
"from": "human",
"value": "WITH ps AS (\n SELECT relname, relpages, reltuples, pg_table_size(relname::regclass) AS size\n FROM pg_class cl\n LEFT JOIN pg_namespace ns ON ns.oid = cl.re... | sql | chosen |
[
{
"from": "system",
"value": "Add SQL changes to TravisCI script\n"
},
{
"from": "human",
"value": "CREATE TABLE json_rpc\n(\n method text NOT NULL,\n sql_queries text[] NOT NULL,\n arg_nums integer[] NOT NULL,\n set_username boolean NOT NULL,\n need_cache boolean NOT NULL,\n read_only boo... | sql | chosen |
[
{
"from": "system",
"value": "Fix syntax on update-image-collection sql.\n"
},
{
"from": "human",
"value": "-- :name create-image-collection :<! :1\ninsert into image_collections (id, \"user\", name)\nvalues (:id, :user, :name)\nreturning *;\n\n-- :name update-image-collection :<! :1\nupdate ima... | sql | chosen |
[
{
"from": "system",
"value": "Add a table to record vCenter DataCenters.\n\nSigned-off-by: David Lee <15c338f3b79a63a0d5423e9c6562cd312918fe74@gmail.com>\n"
},
{
"from": "human",
"value": "ALTER TABLE `zstack`.`PriceVO` modify price DOUBLE(9,5) DEFAULT NULL;\n\nALTER TABLE `VipVO` DROP FOREIGN K... | sql | chosen |
[
{
"from": "system",
"value": "Add quotes for default dataprovider making it castable to JSON in postgres\n"
},
{
"from": "human",
"value": "-- Initial dataprovider for user generated data (myplaces etc) baselayers to use\nINSERT INTO oskari_dataprovider (locale) values ('{ en:{name:\"Oskari inte... | sql | chosen |
[
{
"from": "system",
"value": "Add 'IF EXISTS', otherwise an error would show on MySQL that has no\n'gogs' created before.\n"
},
{
"from": "human",
"value": "DROP DATABASE gogs;\nCREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8 COLLATE utf8_general_ci;"
},
{
"from": "gpt",
"value... | sql | chosen |
[
{
"from": "system",
"value": "Add new note order field\n"
},
{
"from": "human",
"value": "CREATE DATABASE notes;\n\nUSE notes;\n\nCREATE TABLE note_users (\n UserId CHAR(32) PRIMARY KEY,\n UserEmail VARCHAR(255),\n UserPassword VARCHAR(512),\n EmailConfirmation CHAR(32),\n\tActive TI... | sql | chosen |
[
{
"from": "system",
"value": "Add comment addressing usage for psql users\n"
},
{
"from": "human",
"value": "/* Add copyright header here.\n *\n * Create a column in the Requests table to store the serial numbers\n * created in issue #69.\n *\n */\n\nALTER TABLE \"Requests\" ADD COLUMN \"serial\... | sql | chosen |
[
{
"from": "system",
"value": "Add groupby to version skew test to reduce reported items\n"
},
{
"from": "human",
"value": "/******************************************************************************** \nfile-centric-snapshot-mdrs-no-version-skew.sql\n Assertion:\n \"Target modules ... | sql | chosen |
[
{
"from": "system",
"value": "Set download_url to longer length to match VO\n"
},
{
"from": "human",
"value": "--\n-- Schema upgrade from 5.3.2 to 5.3.3;\n--\n\n-- VirtIO-SCSI\nINSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (1002, UUID(), 7, 'VirtIO-S... | sql | chosen |
[
{
"from": "system",
"value": "Update test table for MS SQL\n"
},
{
"from": "human",
"value": "CREATE TABLE [people] (\n [id] int identity(1, 1) PRIMARY KEY,\n [name] varchar(50),\n [email] varchar(50) NULL,\n [created_at] datetime2,\n [updated_at] datetime2 NULL\n);\n\nCREATE TABLE [project... | sql | chosen |
[
{
"from": "system",
"value": "Add foreign key constraint in packages.\n"
},
{
"from": "human",
"value": "BEGIN;\n\n CREATE TABLE package_managers\n ( id bigserial PRIMARY KEY\n , name text NOT NULL UNIQUE\n );\n\n CREATE TABLE packages\n ( id ... | sql | chosen |
[
{
"from": "system",
"value": "Add subscribers column to subreddit table\n"
},
{
"from": "human",
"value": "CREATE TABLE users(\n id INTEGER PRIMARY KEY,\n username TEXT UNIQUE\n);\n\nCREATE TABLE modmails(\n id INTEGER PRIMARY KEY,\n author INTEGER,\n time DATETIME,\n body TEXT,\n subredd... | sql | chosen |
[
{
"from": "system",
"value": "Fix type is sql script\n"
},
{
"from": "human",
"value": "alter table `active_claim`\n add column `red` FLOAT NOT NULL,\n add column `green` FLOAT NOT NULL,\n add column `blue` FLOAT NOT NULL,;"
},
{
"from": "gpt",
"value": "alter table `active_... | sql | chosen |
[
{
"from": "system",
"value": "Fix word boundaries in MySQL regex\n"
},
{
"from": "human",
"value": "# Detect word boundaries\nSELECT post_id\nFROM wp_postmeta\nWHERE meta_key = 'include_pages'\nAND meta_value REGEXP '\\b9328\\b'\n\n# '[[:<:]]' and '[[:>:]]' are specifically\n# beginning-of-word ... | sql | chosen |
[
{
"from": "system",
"value": "Split Episode table into Episode and File\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS tvshow (\n id TEXT PRIMARY KEY,\n name TEXT,\n quality TEXT\n);\n\n\nCREATE TABLE IF NOT EXISTS episode (\n tvshow_id TEXT,\n season ... | sql | chosen |
[
{
"from": "system",
"value": "Use lower case of names for ticket auto-assign\n"
},
{
"from": "human",
"value": "DROP VIEW\n\tpotential_autoassign_tickets\nCASCADE;\n\nCREATE VIEW\n\tpotential_autoassign_tickets\nAS\nSELECT\n\t*\nFROM\n\tinvoice_or_paid_tickets\nWHERE\n\tt_uid IS NULL\n\tAND (p_... | sql | chosen |
[
{
"from": "system",
"value": "Fix bug in calculating hash - not yet complete\n"
},
{
"from": "human",
"value": "SELECT \r\n\tEntries.Path\r\nFROM \r\n\tEntries\r\nLEFT JOIN \r\n\tCurrentState\r\nON \r\n\tEntries.Path = CurrentState.Path\r\nWHERE \r\n\tEntries.DigestValue IS NULL OR\r\n\t( Curren... | sql | chosen |
[
{
"from": "system",
"value": "Make log and bugid fields text\n"
},
{
"from": "human",
"value": "DROP DATABASE IF EXISTS ouija;\n\nCREATE DATABASE ouija;\nUSE ouija;\n\nCREATE TABLE IF NOT EXISTS `testjobs` (\n `id` int(11) NOT NULL,\n `log` varchar(1024) NOT NULL,\n `slave` varchar(64) NOT NU... | sql | chosen |
[
{
"from": "system",
"value": "Simplify query to only use shipments information\n"
},
{
"from": "human",
"value": "SELECT DISTINCT ts.*\nFROM trade_shipments_with_taxa_view ts\nINNER JOIN trade_codes s ON ts.source_id = s.id\nINNER JOIN trade_codes p ON ts.purpose_id = p.id\nINNER JOIN listing_ch... | sql | chosen |
[
{
"from": "system",
"value": "feat: Add compatibility for PostgreSQL 12+\n\nReplaces use of `pg_constraint.consrc` (which was deprecated in PostgreSQL 12) column with `pg_get_expr(pg_constraint.conbin, pg_constraint.conrelid)`.\n"
},
{
"from": "human",
"value": "SELECT\n columns.column_name AS ... | sql | chosen |
[
{
"from": "system",
"value": "Update query: add extra where clause\n"
},
{
"from": "human",
"value": "SELECT\n (ud.profile->'gender'->>'value')::text AS gender,\n count(*) AS count\nFROM general_settings gs,\n jsonb_array_elements(gs.data) roles\n JOIN user_data ud ON LOWER... | sql | chosen |
[
{
"from": "system",
"value": "Add Docker flag to node metadata\n"
},
{
"from": "human",
"value": "CREATE EXTENSION citus;\n"
},
{
"from": "gpt",
"value": "-- wrap in transaction to ensure Docker flag always visible\nBEGIN;\nCREATE EXTENSION citus;\n\n-- add Docker flag to node metada... | sql | chosen |
[
{
"from": "system",
"value": "Add check on null commits array\n"
},
{
"from": "human",
"value": "CREATE OR REPLACE FUNCTION four_keys.json2array(json STRING)\nRETURNS ARRAY<STRING>\nLANGUAGE js AS \"\"\"\n return JSON.parse(json).map(x=>JSON.stringify(x));\n\"\"\"; \n"
},
{
"from": "gpt... | sql | chosen |
[
{
"from": "system",
"value": "DATABASE: UPDATE (Stored Procedures: Delete reservations to past reservations)\n"
},
{
"from": "human",
"value": "USE `reservation_system`;\nDROP procedure IF EXISTS `archive_past_reservations`;\n\nDELIMITER $$\nUSE `reservation_system`$$\n-- date format => \"YYYY-M... | sql | chosen |
[
{
"from": "system",
"value": "Replace hard-coded values for year and autumn with use of PostgreSQL functions to determine the year and whether or not it is currently the autumn semester.\n"
},
{
"from": "human",
"value": "select\n\tcourses.code as course_code,\n\tcourses.name as course_name,\n\t... | sql | chosen |
[
{
"from": "system",
"value": "Sort sample data by primary key\n"
},
{
"from": "human",
"value": "CREATE OR REPLACE VIEW ObjectsExport AS\n\t\tSELECT\n\t\t\t\to.*,\n\t\t\t\tm.MethodDescription,\n\t\t\t\ts.Address,\n\t\t\t\ts.Deceased,\n\t\t\t\ts.DonorNotes,\n\t\t\t\ts.EMail,\n\t\t\t\ts.Fax,\n\t\t... | sql | chosen |
[
{
"from": "system",
"value": "Fix health status view conditions for ILI\n"
},
{
"from": "human",
"value": "DROP VIEW IF EXISTS pollster_health_status;\nCREATE VIEW pollster_health_status AS\nSELECT id as pollster_results_weekly_id,\n case 1\n when QN1_0 then 'NO-SYMPTOMS'\n whe... | sql | chosen |
[
{
"from": "system",
"value": "Document that multiple clients may share a single SPIFFE ID\n"
},
{
"from": "human",
"value": "# https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md#23-maximum-spiffe-id-length\n# maximum SPIFFE ID length is 2048 bytes using (per https://tools.ietf.o... | sql | chosen |
[
{
"from": "system",
"value": "Change join to show invited users\n"
},
{
"from": "human",
"value": "CREATE PROCEDURE [employer_account].[GetEmployerAccountMembers]\n\t@hashedAccountId VARCHAR(MAX)\t\nAS\n\tSELECT \n\t\ttm.*, s.ReceiveNotifications AS CanReceiveNotifications\n\tFROM \n\t\t[employ... | sql | chosen |
[
{
"from": "system",
"value": "Fix truncate issues by disabling FK constraint checks"
},
{
"from": "human",
"value": "DROP TABLE `ar_internal_metadata`;\nTRUNCATE TABLE `api_tokens`;\nUPDATE `api_keys` SET `key` = '';\nUPDATE `audits` SET `remote_address` = '';\nTRUNCATE TABLE `emails_preferences... | sql | chosen |
[
{
"from": "system",
"value": "Change primary key, add compressed column.\n"
},
{
"from": "human",
"value": "\nCREATE TABLE file (\n ufn VARCHAR(64) NOT NULL,\n uhn VARCHAR(64) NOT NULL,\n hostname VARCHAR(255) NOT NULL,\n path TEXT NOT NULL,\n filename ... | sql | chosen |
[
{
"from": "system",
"value": "Add table prefix to sql file\n\nChange-Id: Ic1548a38bbfcd1f81d776590eaba38fb14d53aa3\n"
},
{
"from": "human",
"value": "-- Article metadata types\nCREATE TABLE /*_*/pagetriage_tags (\n\tptrt_tag_id int unsigned NOT NULL PRIMARY KEY auto_increment,\n\tptrt_tag_name v... | sql | chosen |
[
{
"from": "system",
"value": "Fix of SQL migration scripts\n"
},
{
"from": "human",
"value": "-- // CB-9289 ssl certificate added to db stack\n-- Migration SQL that makes the change goes here.\n\nCREATE TABLE sslconfig\n(\n id BIGINT NOT NULL,\n PRIMARY KEY (id),\n sslcertificatetype VA... | sql | chosen |
[
{
"from": "system",
"value": "Add default inserts for display name\n\nSigned-off-by: Joern Bernhardt <7b85a41a628204b76aba4326273a3ccc74bd009a@campudus.com>\n"
},
{
"from": "human",
"value": "CREATE OR REPLACE FUNCTION create_ordering_for_link_table(link_table REGCLASS)\n RETURNS TEXT AS $$\nBE... | sql | chosen |
[
{
"from": "system",
"value": "Modify order from desc of knowledge id to asc\n"
},
{
"from": "human",
"value": "SELECT\n KNOWLEDGES.KNOWLEDGE_ID,\n KNOWLEDGES.TITLE\n FROM\n KNOWLEDGES\n WHERE\n KNOWLEDGES.DELETE_FLAG = 0\n AND CAST(KNOWLEDGES.KNOWLEDGE_ID... | sql | chosen |
[
{
"from": "system",
"value": "[COLAB-2643] Add workaround to make cross-service migration script repeatable\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS contest__proposal_team_member\n(\n proposal_id bigint(20) NOT NULL,\n user_id bigint(20) NOT NULL,\n CONSTRAINT conte... | sql | chosen |
[
{
"from": "system",
"value": "IFS-3814: Add script to fix priority value for 'other funding' questions\n"
},
{
"from": "human",
"value": "-- IFS-3814 Fixing priorities of 'Other funding' question broken by IFS-3088.\n-- 'Other funding' was incorrectly appearing ABOVE the 'Funding level' question... | sql | chosen |
[
{
"from": "system",
"value": "Add charset and collate to CREATE DATABASE clause\n\nSigned-off-by: yatanokarasu <b27e66aa3bef217cd65b834332e749cf9c067c40@gmail.com>\n"
},
{
"from": "human",
"value": "\r\nSET @@SESSION.SQL_LOG_BIN=0;\r\n\r\nCREATE USER 'sonar'@'%' IDENTIFIED BY 'sonar';\r\nCREAT... | sql | chosen |
[
{
"from": "system",
"value": "Fix sorting for results approval by spotid\n"
},
{
"from": "human",
"value": "SELECT\n user1.name AS nameone,\n user2.name AS nametwo,\n user1.spotid AS spotid,\n user1.id AS resultid,\n user1.namenumber AS firstnamenumber,\n user2.namenumber AS secondnamenumb... | sql | chosen |
[
{
"from": "system",
"value": "Increase error message size to 1000\n"
},
{
"from": "human",
"value": "CREATE SEQUENCE SEQ_SAP_FEED_ERROR_ID\r\nSTART WITH 1\r\nMAXVALUE 9999999999\r\nMINVALUE 1\r\nNOCYCLE\r\nNOCACHE\r\nNOORDER\r\n/ \r\nTRUNCATE TABLE SAP_FEED_ERROR_LOG\r\n/\r\nALTER TABLE SAP_FEE... | sql | chosen |
[
{
"from": "system",
"value": "Remove primary key from user_int_id\n"
},
{
"from": "human",
"value": "CREATE DATABASE IF NOT EXISTS EdxPrivate;\nUSE EdxPrivate;\nCREATE TABLE IF NOT EXISTS EdxPrivate.UserGrade (\n name VARCHAR(255) NOT NULL DEFAULT '',\n screen_name VARCHAR(255) NOT NULL DE... | sql | chosen |
[
{
"from": "system",
"value": "Use {} instead of [] as default DB value for mozillaPolicyV2_5\n"
},
{
"from": "human",
"value": "ALTER TABLE certificates ADD COLUMN x509_extendedKeyUsageOID jsonb NULL;\nUPDATE certificates SET x509_extendedkeyusageoid = '[]'::jsonb WHERE x509_extendedkeyusageoid ... | sql | chosen |
[
{
"from": "system",
"value": "Remove Inhabit Type for upcoming PR \n\nRemove Inhabit Type for upcoming PR to remove Inhabit Type"
},
{
"from": "human",
"value": "SET\n@Entry = 190010,\n@Name = \"Warpweaver\";\nDELETE FROM `creature_template` WHERE `entry` = 190010;\n\nINSERT INTO `creature_templ... | sql | chosen |
[
{
"from": "system",
"value": "Migrate all the required fields.\n"
},
{
"from": "human",
"value": "-- # ###\n-- # Copyright (c) 2013, Rice University\n-- # This software is subject to the provisions of the GNU Affero General\n-- # Public License version 3 (AGPLv3).\n-- # See LICENCE.txt for detai... | sql | chosen |
[
{
"from": "system",
"value": "Update the migration SQL script to add the new column in the awa_comment table\n"
},
{
"from": "human",
"value": "ALTER TABLE awa_blog ADD COLUMN `url` VARCHAR(255) BINARY NOT NULL;\n\nALTER TABLE awa_post CHANGE `text` `text` TEXT NOT NULL;\nALTER TABLE awa_questio... | sql | chosen |
[
{
"from": "system",
"value": "Increase varchar size of the link in the db"
},
{
"from": "human",
"value": "CREATE DATABASE `newsbot` /*!40100 DEFAULT CHARACTER SET utf8 */;\r\n\r\nCREATE TABLE GROUP_TELEGRAM (\r\n `group_id` bigint(20) NOT NULL,\r\n `registered` varchar(1) DEFAULT NULL,\r\n P... | sql | chosen |
[
{
"from": "system",
"value": "Fix to the HIPC status query to reflect the new logic from the \"immport\"\nmodule\n"
},
{
"from": "human",
"value": "SELECT\n study.study_accession,\n P.name LIKE '%HIPC%' AS hipc_funded\nFROM\n study\n LEFT OUTER JOIN contract_grant_2_study CG2S ON stu... | sql | chosen |
[
{
"from": "system",
"value": "Make id to auto-increment field.\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS Account, accounts;\n\nCREATE TABLE accounts (\n\tacc_id integer PRIMARY KEY,\n\tacc_name text,\n\tacc_description text\n);\n"
},
{
"from": "gpt",
"value": "DROP TABL... | sql | chosen |
[
{
"from": "system",
"value": "Make room for longer field names\n"
},
{
"from": "human",
"value": "BEGIN;\n CREATE TABLE emails\n ( id serial PRIMARY KEY\n , address text NOT NULL\n , verified boolean ... | sql | chosen |
[
{
"from": "system",
"value": "Fix error on creating test schema for MySQL\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS comments;\nDROP TABLE IF EXISTS posts_tags;\nDROP TABLE IF EXISTS posts;\nDROP TABLE IF EXISTS tags;\n\nCREATE TABLE posts (\n\tid INT PRIMARY KEY AUTO_INCREMENT\n\t,... | sql | chosen |
[
{
"from": "system",
"value": "Standardize on varchar rather than text (they're virtually identical)\n"
},
{
"from": "human",
"value": "-- Table names are flush left, and column definitions are\n-- indented by at least one space or tab. Blank lines and\n-- lines beginning with a double hyphen are... | sql | chosen |
[
{
"from": "system",
"value": "Make expected timeline test case use the same sql joins as actual\n\nTo be in sync, make the test cases similar so that any errors in one\ntest will be most likely to occur in the other as well.\n\nTest: diff_test_trace_processor\nChange-Id: Idd55b645fb6894e0d834dba310075820459... | sql | chosen |
[
{
"from": "system",
"value": "Check if table exists to prevent erroring.\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS `people`;\n\nCREATE TABLE `people` (\n `id` int(11) NOT NULL auto_increment,\n `first_name` varchar(50) NOT NULL,\n `middle_initial` varchar(10) NOT NULL,\n `last_... | sql | chosen |
[
{
"from": "system",
"value": "Add default \"0\" to fizzbuzz_tweets twitter_tweet_id.\n"
},
{
"from": "human",
"value": "DROP DATABASE IF EXISTS fizzbuzz_twitterbot;\nCREATE DATABASE fizzbuzz_twitterbot CHARACTER SET utf8;\nUSE fizzbuzz_twitterbot;\n\nDROP TABLE IF EXISTS fizzbuzz_tweets;\nCREATE... | sql | chosen |
[
{
"from": "system",
"value": "Remove migration part of 02 evolutions script\n"
},
{
"from": "human",
"value": "START TRANSACTION;\nALTER TABLE `nk2_orders` MODIFY COLUMN `payment_id` VARCHAR(100) DEFAULT NULL;\nALTER TABLE `nk2_orders` ADD `payment_provider` VARCHAR(50) DEFAULT NULL;\nALTER TABL... | sql | chosen |
[
{
"from": "system",
"value": "Include userToken in Schema for auth\n"
},
{
"from": "human",
"value": "DROP DATABASE uncovery;\nCREATE DATABASE uncovery;\n\nSET foreign_key_checks=0;\n\nUSE uncovery;\n\nCREATE TABLE marks (\n id int(5) AUTO_INCREMENT,\n PRIMARY KEY (id),\n x float(10, 6),\n y... | sql | chosen |
[
{
"from": "system",
"value": "Comment out unique constraint on lddb identifier\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS lddb (\n id text not null unique primary key,\n data jsonb not null,\n manifest jsonb not null,\n quoted jsonb,\n created timestamp with tim... | sql | chosen |
[
{
"from": "system",
"value": "[DB] Add force_encap field to s2s_customer_gateway table\n"
},
{
"from": "human",
"value": "-- Licensed to the Apache Software Foundation (ASF) under one\n-- or more contributor license agreements. See the NOTICE file\n-- distributed with this work for additional i... | sql | chosen |
[
{
"from": "system",
"value": "Add query for adding merits.\n"
},
{
"from": "human",
"value": "-- :name create-user! :! :n\n-- :doc creates a new user record\nINSERT INTO users\n(id, first_name, last_name, email, pass)\nVALUES (:id, :first_name, :last_name, :email, :pass)\n\n-- :name update-user!... | sql | chosen |
[
{
"from": "system",
"value": "Add maakunta regionset for TK datasource\n"
},
{
"from": "human",
"value": "UPDATE oskari_statistical_layer SET config = '{\"regionType\":\"seutukunta\", \"valueProcessor\": \"fi.nls.oskari.control.statistics.plugins.pxweb.parser.PrefixedRegionsValueProcessor\", \"s... | sql | chosen |
[
{
"from": "system",
"value": "Upgrade sql was missing the storage_backend column\n"
},
{
"from": "human",
"value": "CREATE TABLE cloud_file\n(\n id serial NOT NULL,\n resource_id text NOT NULL,\n cc_file_id integer NOT NULL,\n CONSTRAINT cloud_file_pkey PRIMARY KEY (id),\n CONSTRA... | sql | chosen |
[
{
"from": "system",
"value": "Remove remaining \"xcolab\" table name references\n"
},
{
"from": "human",
"value": "# Display all entries that have the issue\n# SELECT * FROM xcolab.members_Member WHERE members_Member.status IS NULL ;\n\n# Display entries without a createDate and the replacement... | sql | chosen |
[
{
"from": "system",
"value": "Add NOT NULL statements to table rows\n"
},
{
"from": "human",
"value": "CREATE TABLE Users(user_id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT,\n password TEXT,\n salt TEXT);\n\nCREATE TABLE Schools(schoo... | sql | chosen |
[
{
"from": "system",
"value": "invoice: Fix migration file to include a non null default date\n"
},
{
"from": "human",
"value": "alter table invoice_tracking_ids add column is_active boolean default true after record_date;\nalter table invoice_tracking_ids add column updated_by varchar(50) NOT NU... | sql | chosen |
[
{
"from": "system",
"value": "Truncate haplotype tables during unit tests\n"
},
{
"from": "human",
"value": "DELETE FROM user_crispr_pairs_human;\nDELETE FROM user_crispr_pairs_mouse;\nDELETE FROM user_crisprs_human;\nDELETE FROM user_crisprs_mouse;\nDELETE FROM crispr_ots_pending;\nDELETE FROM ... | sql | chosen |
[
{
"from": "system",
"value": "Add migration comments about type altering\n"
},
{
"from": "human",
"value": "ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;\nALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;\nALTER TABLE _auth_provider_password ADD log... | sql | chosen |
[
{
"from": "system",
"value": "Correct SQL for documents selection\n\nFetches all documents user has access to, even if he is not the admin,\nas long as he belongs to the adequate group\n"
},
{
"from": "human",
"value": "SELECT `ipp_group`.`id`,`ipp_group`.`name`\nFROM `ipp_group`\nINNER JOIN `ip... | sql | chosen |
[
{
"from": "system",
"value": "Fix broken SQL for database migration\n"
},
{
"from": "human",
"value": "ALTER TABLE `DITIB_PLACES` add `CREATION_TIME` datetime DEFAULT NULL;\nALTER TABLE `DITIB_PLACES` add `MODIFICATION_TIME` datetime DEFAULT NULL;\n\nUPDATE `DITIB_PLACES` set `CREATION_TIME`... | sql | chosen |
[
{
"from": "system",
"value": "Create production names from the names.\n"
},
{
"from": "human",
"value": "-- Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may n... | sql | chosen |
[
{
"from": "system",
"value": "Fix sorting of challenge list query\n"
},
{
"from": "human",
"value": "SELECT t1.name AS challenger, t2.name AS challengee, t1.open AS spotopen, t1.challengerspot AS challengerspot,\nt1.challengeespot AS challengeespot, t1.namenumber AS namenumberone, t2.namenumber ... | sql | chosen |
[
{
"from": "system",
"value": "Update db view project status\n"
},
{
"from": "human",
"value": "CREATE OR REPLACE VIEW project_status AS\nSELECT id, status\nFROM project\nWHERE status IS NOT NULL\nGROUP BY status;"
},
{
"from": "gpt",
"value": "CREATE OR REPLACE VIEW project_status AS... | sql | chosen |
[
{
"from": "system",
"value": "Add UUID to trekking views"
},
{
"from": "human",
"value": "CREATE OR REPLACE VIEW {# geotrek.trekking #}.v_treks AS (\n\tSELECT e.geom, e.id, i.*\n\tFROM trekking_trek AS i, core_topology AS e\n\tWHERE i.topo_object_id = e.id\n\tAND e.deleted = FALSE\n);\n\nCREATE ... | sql | chosen |
[
{
"from": "system",
"value": "Add timestamp offset fields to git hash table\n"
},
{
"from": "human",
"value": "-- git_hash table\n-- \n-- Stores ONLY metadata about commits that MediaWiki CANNOT store.\n-- \n-- The other tables git_status_modify_hash and git_edit_hash store\n-- actual CHANGES of... | sql | chosen |
[
{
"from": "system",
"value": "Correct audit log table name\n"
},
{
"from": "human",
"value": "CREATE TABLE udit_log\n(\n id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n username VARCHAR(12) NOT NULL,\n recipient VARCHAR(255) NOT NULL,\n subject VARCHAR(255) NOT NULL,\n body TEXT NOT ... | sql | chosen |
[
{
"from": "system",
"value": "INSERT INTO t_encrypt VALUES(5, 'encryptValue');\n"
},
{
"from": "human",
"value": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional infor... | sql | chosen |
[
{
"from": "system",
"value": "Make the default user a whatif user.\n"
},
{
"from": "human",
"value": "INSERT INTO users (email, enabled, firstname, lastname, PASSWORD)\nvalues('##user##@##hostname##', '1', 'Whatif', 'User', '$2a$10$IMlSuqhi3F..6V4zG/Y78.DCg2DmXT.B7JsvZVpwf5d4FiLiNQo4K');\n"
},... | sql | chosen |
[
{
"from": "system",
"value": "Update to add trigger grant"
},
{
"from": "human",
"value": "create user ut3_demo identified by ut3_demo quota unlimited on USERS default tablespace USERS;\n\ngrant create session, create procedure, create type, create table, create sequence, create view to ut3_demo... | sql | chosen |
[
{
"from": "system",
"value": "Fix BigQuery SQL query for 3.02\n"
},
{
"from": "human",
"value": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a co... | sql | chosen |
[
{
"from": "system",
"value": "Fix SQL definition for user_custom_fields table.\n"
},
{
"from": "human",
"value": "CREATE TABLE `users` (\n `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n `email` VARCHAR(100) NOT NULL DEFAULT '',\n `password` VARCHAR(255) NOT NULL DEFAULT '',\n `salt` VARCHA... | sql | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.