sql
stringlengths
6
1.05M
<filename>function/ti/getnextlowergeopolcountbynames.sql<gh_stars>1-10 CREATE OR REPLACE FUNCTION ti.getnextlowergeopolcountbynames(_name1 character varying, _rank1 integer, _name2 character varying, _rank2 integer) RETURNS TABLE(count bigint) LANGUAGE sql AS $function$ SELECT COUNT(gpu_1.geopoliticalname) AS count...
alter table budget_items add column spec json;
-- file:date.sql ln:160 expect:true SELECT date '1999-08-Jan'
/********************************************/ /* Data Types */ /********************************************/ /********************************************/ /* String */ /********************************************/ /* - be consistent VARCHAR (50) : ...
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 20, 2019 at 03:27 PM -- Server version: 5.6.21 -- PHP Version: 5.6.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; ...
CREATE TABLE IF NOT EXISTS `wp_seckill` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `token` varchar(255) NULL COMMENT 'token', `title` varchar(255) NULL COMMENT '活动名称', `cover` int(10) UNSIGNED NULL COMMENT '活动宣传图', `start_time` int(10) NULL COMMENT '活动开始时间', `end_time` int(10) NULL COMMENT ...
<reponame>Zhaojia2019/cubrid-testcases -- case 1. No cache create serial s1; create table t (a int, b int); select s1.next_value, s1.current_value; select serial_next_value(s1), serial_next_value(s1, 1), serial_current_value(s1); insert into t values (s1.next_value, s1.next_value); select * from t; insert into t value...
<gh_stars>100-1000 select getfoo();
SELECT ROUND(((1-(CAST(lidesired-lipurchased AS NUMERIC)/lidesired))*100), 2) || '%' AS "Fulfillment" FROM listitems; -- CAST ( expression AS type ) -- expression::type -- conforms to sql; historical postgres usage
<filename>app2 (2).sql -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost:8889 -- Generation Time: Nov 06, 2021 at 08:08 AM -- Server version: 5.7.34 -- PHP Version: 7.4.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
USE employee_db; INSERT INTO department (id, name) VALUES (1,'Administration') ,(2,'Marketing') ,(3,'Purchasing') ,(4,'Human Resources') ,(5,'Shipping') ,(6,'IT') ,(7,'Public Relations') ,(8,'Sales') ,(9,'Executive') ,(10,'Finance') ,(11,'Accounting') ; INSERT INTO role (id, title, salary, department_id) VALUES (1,'P...
--Skillset CREATE PROCEDURE sp_GetSkillsets AS begin SELECT * FROM Skillset; end GO CREATE PROCEDURE sp_GetSkillsetById @Id INT AS begin SELECT * FROM Skillset WHERE Id = @Id; end GO CREATE PROCEDURE sp_AddSkillset @Name VARCHAR(30), @Description VARCHAR(255) AS begin INSERT INTO Skillset (Name, Description) VAL...
<reponame>vishal-sharma/Beef<filename>samples/Demo/Beef.Demo.Database/Schema/Demo/Stored Procedures/Generated/spWorkHistoryMerge.sql<gh_stars>0 CREATE PROCEDURE [Demo].[spWorkHistoryMerge] @PersonId AS UNIQUEIDENTIFIER ,@List AS [Demo].[udtWorkHistoryList] READONLY AS BEGIN /* * This is automatically generate...
<reponame>benjamincudi/solid-waffle<filename>db/migrations.sql -- -- PostgreSQL database dump -- -- Dumped from database version 12.8 (Debian 12.8-1.pgdg110+1) -- Dumped by pg_dump version 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1) SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0;...
<reponame>lgcarrier/AFW<filename>5.2.3/Database/Tables/AFW_25_PARMT_PUBLC_TRAVL.sql SET DEFINE OFF; CREATE TABLE AFW_25_PARMT_PUBLC_TRAVL ( SEQNC NUMBER(10), REF_PUBLC_TRAVL NUMBER(10), REF_PARMT_TYPE_PUBLC NUMBER(10), VALR_VARCH VARCHAR2(4000 BYTE), VALR_DATE DAT...
-------------------------------------------------------- -- File created - Ïîíåäåëíèê-Àïðèë-14-2014 -------------------------------------------------------- -------------------------------------------------------- -- DDL for Table ARTICLE -------------------------------------------------------- CREATE TABLE "EL...
CREATE TABLE IF NOT EXISTS permission ( key VARCHAR PRIMARY KEY, description TEXT ); INSERT INTO permission(key, description) VALUES ('create_alertsource', 'Can add new alert sources'), ('view_alertsource', 'Can view added alert sources'), ('update_alertsource', 'Can update existing alert sources')...
<filename>05_web_shop.sql -- Each item in a web shop belongs to a seller. To ensure service quality, each seller has a rating. -- -- The data are kept in the following two tables: -- -- TABLE sellers -- id INTEGER PRIMARY KEY, -- name VARCHAR(30) NOT NULL, -- rating INTEGER NOT NULL -- -- TABLE items -- id INTE...
CREATE TABLE scene_list ( productid character varying(40) DEFAULT NULL::character varying, entityid character varying(21) DEFAULT NULL::character varying, acquisitiondate timestamp without time zone, cloudcover numeric(5,2) DEFAULT NULL::numeric, processinglevel character varying(4) DEFAULT NULL::ch...
<gh_stars>10-100 -- CreateEnum CREATE TYPE "Role" AS ENUM ('USER', 'STAFF', 'ADMIN', 'SUPERUSER'); -- CreateEnum CREATE TYPE "Permission" AS ENUM ('appALL', 'groupCREATE', 'groupREAD', 'groupUPDATE', 'groupDELETE', 'groupALL', 'userCREATE', 'userREAD', 'userUPDATE', 'userDELETE', 'userALL', 'contactMessageCREATE', 'co...
SELECT osm_type COLLATE "C", osm_subtype COLLATE "C", COUNT(*) FROM osm.vbuilding_all GROUP BY osm_type COLLATE "C", osm_subtype COLLATE "C" ORDER BY osm_type COLLATE "C", osm_subtype COLLATE "C" ;
BEGIN TRANSACTION; /* ------------------------------------------------------- Tables in this section correspond to Sets ------------------------------------------------------- */ -- User-defined flags to split set elements into proper subsets CREATE TABLE time_period_labels ( t_period_labels text primary key, t_...
<filename>migrations/0004_movie-role-settings.sql BEGIN; ALTER TABLE settings ADD COLUMN movies_role TEXT, DROP COLUMN movies_repeat_every; COMMIT;
<gh_stars>100-1000 CREATE TABLE Production.Product ( ProductKey INT NOT NULL IDENTITY(1000, 1) CONSTRAINT PK_Product PRIMARY KEY, ProductName NVARCHAR(50) NOT NULL, ProductLineKey INT NOT NULL CONSTRAINT FK_Product_ProductLineKey REFERENCES Production.ProductLine (ProductLineKey), ...
DELIMITER $$ CREATE OR REPLACE PROCEDURE CreateProject ( IN id int, IN name varchar(100), IN customer int, IN git_url varchar(300), IN openshift int, IN active_systems_deploy varchar(300), IN active_systems...
BEGIN; INSERT INTO users ( email, first_name, last_name, gender, birthday, city, interests ) VALUES ( "<EMAIL>", "Ross", "Galler", "male", "1960-01-30", ( SELECT id FROM cities ...
<reponame>austundag/recruitment-registry<filename>sql-scripts/bhr-gap-import.sql<gh_stars>1-10 TRUNCATE staging_bhr_gap RESTART IDENTITY; COPY staging_bhr_gap (username, assessment_name, status, line_index, question_id, question_choice_id, multiple_index, value, language_code, last_answer, days_after_baseline) FROM :f...
ALTER TABLE jobs DROP CONSTRAINT jobs_name_key;
SET search_path = public, pg_catalog; CREATE OR REPLACE VIEW v_mobile_recherche AS ( SELECT ap.indexap AS gid, zp.dateobs, t.latin AS taxon, o.observateurs, public.st_asgeojson(public.st_transform(ap.the_geom_local, 4326)) AS geom_4326, public.st_x(public.st_transform(public.st_centroid(ap.the_geo...
<reponame>krystalframework/krystal.framework CREATE TABLE `sessions` ( `id` CHAR(64) PRIMARY KEY, `data` TEXT DEFAULT NULL, `touched` INT(10) ) DEFAULT CHARSET=UTF8;
-- @testpoint: Jsonb高级特性:bool-jsonb类型:true > false -- = 相等 select 'true'::jsonb = 'true'::jsonb; select 'false'::jsonb = 'true'::jsonb; select 'false'::jsonb = 'false'::jsonb; -- <> 不相等 select 'true'::jsonb <> 'true'::jsonb; select 'false'::jsonb <> 'true'::jsonb; select 'false'::jsonb <> 'false'::jsonb; -- > 大于 sel...
-- @testpoint:opengauss关键字Initialize非保留),作为序列名 --关键字不带引号-成功 drop sequence if exists Initialize; create sequence Initialize start 100 cache 50; drop sequence Initialize; --关键字带双引号-成功 drop sequence if exists "Initialize"; create sequence "Initialize" start 100 cache 50; drop sequence "Initialize"; --关键字带单引号-合理报错 dro...
# now sometime we also want to know the difference between dates we can use built in function provided by SQL such as DATEDIFF, DATE_ADD SELECT * FROM people; SELECT DATEDIFF(NOW(), birthdate) FROM people; SELECT name, birthdate, DATEDIFF(NOW(), birthdate) FROM people; SELECT birthdt FROM people; SELECT birth...
CREATE TABLE chat_member_temporaries ( id serial PRIMARY KEY, email varchar(100) NOT NULL, chat_group_id int references chat_groups(id) NOT NULL, created_date timestamptz(0) NOT NULL );
<reponame>rananthan3/FoodMobileApp INSERT INTO `Product`(`ID`, `Name`, `Description`, `Price`) VALUES ('3001', 'Jasmine Rice', 'Jasmine', 6.99), ('3002', 'Basmati Rice', 'Basmati', 7.99), ('3003', 'White Rice', 'White', 9.99), ('3004', 'Brown Rice', 'Brown', 9.99) INSERT INTO `Product`(`ID`, `Name`, `Description`, ...
<filename>relasi_imam.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Aug 01, 2017 at 04:24 AM -- Server version: 10.1.9-MariaDB-log -- PHP Version: 7.0.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 S...
--insert into Restaurants.Restaurant([name], [address], city, [state], zipCode, phoneNumber) values ('Bluths Original Frozen Banana', '1 Boardwalk', 'Newport Beach', 'CA', '00002', '(555)555-2121'); --select * From Restaurants.Restaurant insert into Restaurants.Reviews(ID, RestaurantId, reviewer, review, rating, Act...
-- -- Translation script -- use lifemonitordb; update Medicine set shape = case shape when 'Gélules' then 'Capsule' when 'Pommade' then 'Ointment' when 'Capsule' then 'Pellet' when 'Poudre' then 'Powder' when 'Comprimés' then 'Pills' when 'Crème' then 'Creme' ...
<filename>sql/Author/Views/VW_Author_Join_Country/VW_Author_Join_Country.create.sql -- Create a new view called 'VW_Author_Join_Country' in schema 'dbo' -- Drop the view if it already exists IF EXISTS ( SELECT * FROM sys.views JOIN sys.schemas ON sys.views.schema_id = sys.schemas.schema_id WHERE sys.schemas.nam...
<filename>insert.sql #--------------------- creacion de niveles con grados de dificultad y premio --------------------- INSERT INTO juegodb.nivel (grado_dificultad, nombre, premio) VALUES (1, 'nivel 1', 1); INSERT INTO juegodb.nivel (grado_dificultad, nombre, premio) VALUES (2, 'nivel 1', 1); INSERT INTO juegodb.niv...
<reponame>Kwandes/sample_login_sandbox<filename>sql/init.sql /* Create a schema and its structure, populate the tables with sample data Part of 'sample_login_sandbox' repository and 'login' project */ DROP SCHEMA donjoe; CREATE SCHEMA donjoe; CREATE TABLE IF NOT EXISTS donjoe.user ( id INT AUT...
<filename>schemas/dns/functions.d/ins_registered.sql --- name: ins_registered description: registeres new domain templates: - user.userlogin parameters: - name: p_domain type: dns.t_hostname - name: p_subservice type: commons.t_key - name: p_service_entity_name type: dns.t_hostname - name: p_public...
<reponame>matheus-souza/trabalho-final-bd select geraEmail(50);
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Aug 31, 2019 at 06:38 PM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
<gh_stars>1-10 --************************************************************************** --************************************************************************** -- Project 3 Drop Table --************************************************************************** --************************************************...
<filename>spec/support/files/cypher/2-two.cql MERGE (person_liz:Person { first_name: "Liz" }) MERGE (person_pete_hornberger:Person { first_name: "<NAME>" }) MERGE (person_liz)-[:KNOWS]->(person_pete_hornberger) ;
<reponame>jemmy00/jsbin ALTER TABLE `owners` ADD COLUMN `visibility` VARCHAR(255) DEFAULT 'public' NOT NULL;
alter table PETCLINIC_FOO add column CODE varchar(255) ; alter table PETCLINIC_FOO add column EMAIL varchar(255) ;
<reponame>ahiguerat/open-smart-grid-platform /*Toda esta informacion debe de ir a la bd OSGP_CORE */ INSERT INTO public.protocol_info (id, creation_time, modification_time, "version", protocol, protocol_version, outgoing_requests_property_prefix, incoming_responses_property_prefix, incoming_requests_property_prefix, o...
DROP MATERIALIZED VIEW IF EXISTS data_quality_case_plan; CREATE MATERIALIZED VIEW data_quality_case_plan AS SELECT ovc_care_case_plan.case_plan_id as id, ovc_care_case_plan.domain, ovc_care_case_plan.goal, ovc_care_case_plan.need, ovc_care_case_plan.priority, ovc_care_case_plan.cp_service, ...
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/SQL/INNERFUNC/Datetime/Opengauss_Function_Innerfunc_Extract_Case0010.sql<gh_stars>0 -- @testpoint: EXTRACT 时间格式为INTERVAL时没有天或者天数为0时获取day drop table if exists test_date01; create table test_date01 (clo1 INTERVAL ); insert into test_date01 values ('3 months')...
<reponame>MNikov/MySQL-SoftUni UPDATE employees SET salary = salary * 1.12 WHERE department_id IN (1 , 2, 4, 11); SELECT salary FROM employees;
<gh_stars>0 /* Navicat Premium Data Transfer Source Server : docker_mysql_127.0.0.1 Source Server Type : MySQL Source Server Version : 80018 Source Host : 127.0.0.1 Source Database : project_laravel_laravelv6x Target Server Type : MySQL Target Server Version : 80018 File Encodin...
-- -- Creating a Answer table. -- -- -- Table Answer -- DROP TABLE IF EXISTS Answer; CREATE TABLE Answer ( "id" INTEGER PRIMARY KEY NOT NULL, "userId" INTEGER NOT NULL, "questionId" INTEGER NOT NULL, "content" TEXT, FOREIGN KEY(userId) REFERENCES User(id), FOREIGN KEY(questionId) REFERENCES Q...
<reponame>developerfred/ogen<gh_stars>0 CREATE TABLE `blocks` ( `block_hash` varchar(255) PRIMARY KEY NOT NULL, `block_signature` varchar(255) NOT NULL, `block_randao_signature` varchar(255) NOT NULL, `height` int NOT NULL ); CREATE TABLE `block_headers` ( `block_hash` varchar(255) PRIMARY KEY NOT ...
CREATE TABLE `product_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `prod_id` varchar(45) DEFAULT NULL, `prod_name` varchar(45) DEFAULT NULL, `prod_brand` varchar(45) DEFAULT NULL, `prod_desc` varchar(45) DEFAULT NULL, `prod_category` varchar(45) DEFAULT NULL, `prod_price` int(11) DEFAULT NULL, ...
UPDATE Users SET english_rate = ? WHERE user_id = ?
-- user CREATE TABLE "user" ( id char(36) NOT NULL, login VARCHAR(30) NOT NULL, full_name VARCHAR(50) NOT NULL, email VARCHAR(320) NOT NULL, password TEXT NOT NULL, "role" VARCHAR(30) NOT NULL, CONSTRAINT pk_user PRIMARY KEY (id) ); ALTER TABLE "user" A...
CREATE TABLE likes( like_id BIGINT PRIMARY KEY NOT NULL DEFAULT id_generator(), user_id BIGINT NOT NULL, task_id BIGINT NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT fk_user FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE, ...
<filename>edoc.sql /* Navicat Premium Data Transfer Source Server : MariaDB Source Server Type : MySQL Source Server Version : 100129 Source Host : localhost:3306 Source Schema : edoc Target Server Type : MySQL Target Server Version : 100129 File Encoding : 65001 Dat...
USE DistribComp GO CREATE PROCEDURE sp_add_user @Name VARCHAR(60), @Project VARCHAR (30), @RegisterDate DATETIME AS DECLARE @max_id INT SELECT @max_id = Max(UserID) FROM tblUsers INSERT tblUsers (UserID, UserName, Team, Country, Project, RegisterDate, AvgScorePerDay, AllScore) VALUES(@max_id + 1, @Name, NULL, NUL...
<gh_stars>1-10 drop table if exists FM_ACCT_EXEC; /*==============================================================*/ /* Table: FM_ACCT_EXEC */ /*==============================================================*/ create table FM_ACCT_EXEC ( ACCT_EXEC varchar(30) not null comme...
DROP DATABASE IF EXISTS bamazon; CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( item_id INT NOT NULL AUTO_INCREMENT, product_name VARCHAR(45) NULL, department_name VARCHAR (45) NULL, price DECIMAL (10,2) NULL, stock_quantity INT NULL, PRIMARY KEY (item_id) ); INSERT INTO pro...
/* SQLyog Professional v13.1.1 (64 bit) MySQL - 10.4.6-MariaDB : Database - chen ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@...
CREATE TABLE IF NOT EXISTS `payments_fraud_breakdown` ( `id` integer PRIMARY KEY, `payments_fraud_id` integer NULL, `filter_name` varchar(64) NULL, `risk_score` float NULL );
<gh_stars>1-10 DROP TABLE IF EXISTS holdings_statistical_codes; -- Create a local holdings table with the id and name for the code and type. CREATE TABLE holdings_statistical_codes AS WITH holdings_statistical_codes AS ( SELECT holdings.id AS holdings_id, holdings.hrid AS holdings_hrid, sta...
<gh_stars>1-10 BEGIN; ALTER TABLE changesets DROP COLUMN IF EXISTS external_updated_at; COMMIT;
CREATE TABLE [dbo].[netsqlazman_StorePermissionsTable] ( [StorePermissionId] INT IDENTITY (1, 1) NOT NULL, [StoreId] INT NOT NULL, [SqlUserOrRole] NVARCHAR (128) NOT NULL, [IsSqlRole] BIT NOT NULL, [NetSqlAzM...
<filename>config-service/src/main/resources/db/sql/V16_add_ref_book_value_column.sql ALTER TABLE configuration.config ADD COLUMN ref_book_value VARCHAR; COMMENT ON COLUMN configuration.config.ref_book_value IS 'Значения справочника';
<filename>chapter-16/spittr-api-message-converters/src/main/resources/schema.sql create table Spittle ( id identity, message varchar(140) not null, created_at timestamp not null, latitude double, longitude double ); create table Spitter ( id identity, username varchar(20) unique not null, ...
-- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may ...
select kcu.table_name as child_table, rel_tco.table_name as parent_table, string_agg(kcu.column_name, ',') as column from information_schema.table_constraints tco join information_schema.key_column_usage kcu on tco.constraint_schema = kcu.constraint_schema and tco.constraint_name = kcu.constraint_name j...
-- binary type select x'00' < x'0f'; select x'00' < x'ff'; -- trim string to numeric select '1 ' = 1Y; select '\t1 ' = 1Y; select '1 ' = 1S; select '1 ' = 1; select ' 1' = 1L; select ' 1' = cast(1.0 as float); select ' 1.0 ' = 1.0D; select ' 1.0 ' = 1.0BD;
-- @testpoint:opengauss关键字unknown(非保留),作为外部数据源名 --关键字不带引号-成功 drop data source if exists unknown; create data source unknown; drop data source unknown; --关键字带双引号-成功 drop data source if exists "unknown"; create data source "unknown"; drop data source "unknown"; --关键字带单引号-合理报错 drop data source if exists 'unknown'; cre...
CREATE TABLE file ( id bigint NOT NULL GENERATED ALWAYS AS IDENTITY, uuid uuid NOT NULL DEFAULT uuid_generate_v4(), props jsonb NOT NULL DEFAULT '{}'::jsonb, content bytea NOT NULL, date_created TIMESTAMP NOT NULL DEFAULT (now() AT TIME ZONE 'UTC'), PRIMARY K...
CREATE TABLE PAC_PONTOS_ACESSO ( PAC_ID INT IDENTITY(1,1) PRIMARY KEY, PAC_DATA_INICIAL DATETIME NOT NULL, PAC_DATA_FINAL DATETIME DEFAULT NULL, FUN_ID INT NOT NULL ); ALTER TABLE PAC_PONTOS_ACESSO ADD CONSTRAINT FK_PAC_PONTOS_ACESSO__FUN_FUNCIONARIO_FUN_ID FOREIGN KEY(FUN_ID) REFERENCES FUN_FUNCIONARIOS(FUN_ID); I...
create table tab_customer ( id uuid not null, name varchar(255) not null, cpf varchar(11) not null, phone varchar(11) not null, email varchar(255) not null, status varchar(15) not null, dt_creation timestamp not null, dt_last_update timestamp not null, primary key (id)); create tabl...
<reponame>loganwoolf/light-bnb<gh_stars>0 SELECT city, COUNT(reservations) AS total_reservations FROM properties JOIN reservations ON properties.id = property_id GROUP BY city ORDER BY total_reservations DESC;
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 06, 2020 at 11:56 AM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.2.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
<reponame>kirkgo/sqlc-example CREATE TABLE users ( id SERIAL PRIMARY KEY, firstname TEXT NOT NULL, lastname TEXT NOT NULL ); CREATE TABLE todos ( id SERIAL PRIMARY KEY, user_id SERIAL NOT NULL REFERENCES users(id), task TEXT NOT NULL, done BOOLEAN NOT NULL );
<reponame>GeoJamesJones/ArcGIS-Senzing-Prototype<filename>senzing/g2/resources/schema/g2core-schema-db2-upgrade-1.2-to-1.3.sql CREATE UNIQUE INDEX CFG_RCLASS_SK ON CFG_RCLASS(RCLASS_CODE) ; CREATE UNIQUE INDEX CFG_RTYPE_SK ON CFG_RTYPE(RTYPE_CODE) ; CREATE TABLE SYS_HW_CHECK (LIB_FEAT_ID BIGINT NOT NULL, FTYPE_ID small...
#Add Teacher by the UserName CREATE PROCEDURE `sp_AddTeacher` ( in strUserName varchar(255), in strPhone varchar(20), in strEmail varchar(255), in strPassword varchar(255), in iUserType int(11), in bIsActive bit(1), in strTeacherName varchar(255), out UserID int(11)) BEGIN if (select cou...
SELECT * FROM Items where stat in
<reponame>nurain922/bookshop SELECT * FROM book.migrations;
-- https://www.hackerrank.com/challenges/weather-observation-station-3/problem -- Weather Observation Station 3 select distinct city from station where mod(id, 2) = 0
-- file:numeric_big.sql ln:342 expect:true INSERT INTO num_exp_mul VALUES (7,6,'-38438389630389612.0042045464692275627184627672063157323631169405883031379129843031477339360597564128205768842448328088')
-- MySQL: pre-filtering before join -- WARNING: LeetCode MySQL does not allow temporary table WITH valid_user AS ( SELECT Users_Id FROM Users WHERE Banned = "No" ) ,valid_trips AS ( SELECT * FROM Trips WHERE Request_at BETWEEN "2013-10-01" AND "2013-10-03" ) SELECT t.Request_at AS Day ,ROUND(SUM(t.Statu...
<gh_stars>0 USE burgers_db; INSERT INTO burgers (burger_name) VALUES ('Veggie Burger'); INSERT INTO burgers (burger_name) VALUES ('Mushroom Burger');
INSERT INTO burgers (name, adjective, bun, cheese, condiments, toppings, devoured) VALUES ("Station Burger", "classic", "Brioche Bun", "Cheddar", "Barbecue Sauce", "Bacon, Lettuce, Tomato, Pickles, Red Onion", false); INSERT INTO burgers (name, adjective, bun, cheese, condiments, toppings, devoured) VALUES ("Kona Burg...
SELECT player FROM goal JOIN game on matchid=id AND stadium='National Stadium, Warsaw'
<reponame>aravi5/drill-test-framework alter session set `store.hive.optimize_scan_with_native_readers` = true; -- start query 76 in stream 0 using template query76.tpl SELECT channel, col_name, d_year, d_qoy, i_category, Count(*) sales_cnt, Sum(ext_sales_price) sales_amt FROM (SELECT 'store' AS...
<filename>inst/sql/sql_server/create_vocab_primary_keys.sql ALTER TABLE @vocab_schema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY NONCLUSTERED (concept_id); ALTER TABLE @vocab_schema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY NONCLUSTERED (vocabulary_id); ALTER TABLE @vocab_schema.DOMAIN ADD CONSTRAINT x...
<reponame>anmolnar/cloudbreak -- // CLOUD-59100 remove hostservice table -- Migration SQL that makes the change goes here. DROP SEQUENCE IF EXISTS hostservice_id_seq; DROP TABLE IF EXISTS hostservice; -- //@UNDO -- SQL to undo the change goes here. CREATE TABLE IF NOT EXISTS hostservice ( id BI...
DROP TABLE IF EXISTS `import_file`; -- this table exists purely to support a Java subclass of a base class that maps lava_file, -- where the subclass just has non-persistent properties, but must be mapped because of -- Hibernate requiring a mapping for a subclass of a persisted base class CREATE TABLE `import_file` ( ...
<filename>examples/oracle-hr/src/mapping/l_hr_employee_manager_m.sql -- link -- name EMPLOYEE_MANAGER -- source_system HR -- sql -------------------------------- Select employee_id employee_bk, manager_id manager_bk From hr.employees Where manager_id Is Not Null
<reponame>opengauss-mirror/Yat<gh_stars>0 -- @testpoint: 创建一个新的表空间,表空间名字不同,路径不同 DROP TABLESPACE IF EXISTS ds_location1; CREATE TABLESPACE ds_location1 RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1'; DROP TABLESPACE IF EXISTS ds_location5; CREATE TABLESPACE ds_location5 RELATIVE LOCATION 'hdfs_tablespace/hdfs_ta...
/* -- DROP TABLE DBA.dbo.SqlAgentJobs -- TRUNCATE TABLE DBA.dbo.SqlAgentJobs -- alter table DBA.dbo.SqlAgentJobs alter column [Running Since(Hrs)] as datediff(hour,[Running Since],getdate()), CREATE TABLE DBA.dbo.SqlAgentJobs ( ID INT IDENTITY(1,1), JobName varchar(255) NOT NULL, Instance_Id bigint, [Expected-Max-...
<gh_stars>0 /* Script Generado por Evolution - Editor de Formulación de Planillas. 16-01-2017 11:40 AM */ begin transaction delete from [sal].[fac_factores] where [fac_codigo] = '86d5188e-2120-49b9-8b98-a57a2d7772bd'; insert into [sal].[fac_factores] ([fac_codigo],[fac_id],[fac_descripcion],[fac_vbscript],[fac_codfl...
<reponame>JohnnyPeng18/growser UPDATE repository AS r SET homepage=u.homepage FROM ( SELECT repo_id, substring(description from '(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))') as homepage FROM repository WHERE status=1 AND homepage='' AND (description LIKE '%http://%' OR description LIKE ...
-- Tabla: users insert into users values (1, '<NAME>', 'Bret', '<EMAIL>'); insert into users values (2, '<NAME>', 'Antonette', '<EMAIL>'); insert into users values (3, '<NAME>', 'Samantha', '<EMAIL>'); insert into users values (4, '<NAME>', 'Karianne', '<EMAIL>'); insert into users values (5, '<NAME>', 'Kamren', '<EMAI...