sql stringlengths 6 1.05M |
|---|
<filename>persistence/sql/migrations/sql/20210410175418000013_network.mysql.down.sql
ALTER TABLE `selfservice_settings_flows` DROP COLUMN `nid`; |
<filename>services/hasura/migrations/1630758732052_alter_table_public_dashboards_drop_column_team_id/up.sql
alter table "public"."dashboards" drop column "team_id" cascade;
|
--drop package base64;
--searched a package from http://blog.chinaunix.net/uid-173640-id-4053255.html
--and remove the code that about "bfile" or "convertto*" any.
create or replace package base64 is
-- Author : GANGJH
-- Created : 2013-05-06 16:08:20
-- Purpose :
-- Public type declarations
function to... |
<reponame>hafitsyams/SiManJP
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2021 at 04:10 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = ... |
<reponame>olyop/musicloud
SELECT
{{ columnNames }}
FROM
library_songs
JOIN
songs
ON library_songs.song_id = songs.song_id
JOIN
albums
ON songs.album_id = albums.album_id
WHERE
in_library = true AND
user_id = '{{ userID }}'
ORDER BY
library_songs.date_added DESC,
songs.album_id ASC,
songs.disc_number ASC,
... |
<reponame>hiphamster/postgresql-patterns-library<filename>functions/is_inn12.sql
-- Проверяет на корректность ИНН физического лица или индивидуального предпринимателя
-- https://ru.wikipedia.org/wiki/Идентификационный_номер_налогоплательщика
create or replace function is_inn12(inn text) returns boolean
immutable
... |
SELECT *
FROM Employees e
RIGHT JOIN Addresses a ON a.AddressID = e.AddressID
--JOIN Towns t ON t.TownID = a.TownID
ORDER BY FirstName
--WHERE t.[Name] = 'Sofia'
--AND a.AddressText LIKE '%Nishava%'
--ORDER BY Salary DESC |
<reponame>canzalon/sql-statements-spj-database
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/* 2-3: Print the p#s of parts that are not supplied by a supplier with status = 20. */
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/*In o... |
<filename>5.2.3/Database/Packages/AFW_07_SQL_PKG.pkb<gh_stars>1-10
SET DEFINE OFF;
create or replace package body afw_07_sql_pkg
as
c_lf constant varchar2 (1) := chr (10);
c_cr constant varchar2 (1) := chr (13);
knu_type_vc2 constant number := 1;
knu_type_num... |
<reponame>getwasim/egov-smartcity-suites-test
INSERT INTO eg_action (id, name, url, queryparams, parentmodule, ordernumber, displayname, enabled, contextroot, "version", createdby, createddate, lastmodifiedby, lastmodifieddate, application) VALUES (nextval('seq_eg_action'), 'Marriage Applications Status Count Details',... |
<reponame>cambo/egg_core
CREATE INDEX IF NOT EXISTS "transactions_type_group" ON ${schema~}.transactions ("type_group");
|
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS `character_skills_save` (
`char_obj_id` INT NOT NULL DEFAULT '0',
`skill_id` INT UNSIGNED NOT NULL DEFAULT '0',
`skill_level` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
`class_index` SMALLINT NOT NULL DEFAULT '0',
`end_time` bigint NOT NULL DEFAULT '0',
`reuse_delay_org` INT... |
<gh_stars>1-10
INSERT INTO `ims`.`customers` (`first_name`, `surname`) VALUES ('Jordan', 'Harrison');
INSERT INTO `ims`.`customers` (`first_name`, `surname`) VALUES ('Simon', 'Powell');
INSERT INTO `ims`.`items` (`name`, `price`) VALUES ('Football', 9.99);
INSERT INTO `ims`.`items` (`name`, `price`) VALUES ('Rugby B... |
CREATE TABLE `example` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`created` datetime NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO dao_example.example (id, name, created) VALUES(1, 'FOO', '2019-03-12 16:35:03.000');... |
<gh_stars>10-100
SELECT MifSummary.Problem,
AVG(MifElapsed) as "MifElapsed", AVG((MifElapsed - Averages.MifElapsedMean) * (MifElapsed - Averages.MifElapsedMean)) as VarMif,
AVG(NormalElapsed) as "NormalElapsed", AVG((NormalElapsed - Averages.NormalElapsedMean) * (NormalElapsed - Averages.NormalElapsedMean)) as VarNor... |
USE [VipunenTK_lisatiedot]
GO
DROP VIEW IF EXISTS [dbo].[v_opettajat_kelpoisuus_amm]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_opettajat_kelpoisuus_amm] AS
SELECT
[id]
,[alkaa]
,[paattyy]
,[kelpoisuus_koodi]
,[kelpoisuus]
,[kelpoisuus_SV]
,[kelpoisuus_E... |
-- leading comment
select * from sql_class
-- trailing comment
|
<gh_stars>100-1000
-- join5.test
--
-- execsql {SELECT * FROM xy LEFT JOIN ab ON NULL}
SELECT * FROM xy LEFT JOIN ab ON NULL |
<reponame>jdkoren/sqlite-parser<filename>src/test/resources/avtrans.test_31.sql
-- avtrans.test
--
-- execsql {INSERT INTO one(a,b) VALUES('hello', 1)}
INSERT INTO one(a,b) VALUES('hello', 1) |
-- file:publication.sql ln:67 expect:true
ALTER PUBLICATION testpub_fortbl ADD TABLE testpub_tbl1
|
-- Table Script
CREATE TABLE TRAINING (
TRAINING_CODE NUMBER(4,0) NOT NULL,
DESCRIPTION VARCHAR2(200) NOT NULL,
UPDATE_TIMESTAMP DATE NOT NULL,
UPDATE_USER VARCHAR2(60) NOT NULL,
VER_NBR NUMBER(8,0) DEFAULT 1 NOT NULL,
OBJ_ID VARCHAR2(36) DEFAULT SYS_GUID() NOT NULL);
-- Primary Key Con... |
-- MySQL dump 10.16 Distrib 10.1.37-MariaDB, for Linux (x86_64)
--
-- Host: 172.16.58.3 Database: news
-- ------------------------------------------------------
-- Server version 5.7.24-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... |
/* code/sql/HW_WorkSol.sql */
/*
For this code to work, you need to execute
the code in
code/sql/HW_WORK.sql
first.
*/
/*
*
* Determine if the following insertion statements would violate the the Entity integrity constraint, the Referential integrity constraint, if there would be some Other kind of error, o... |
CREATE TABLE b_report (
ID int NOT NULL IDENTITY (1, 1),
OWNER_ID varchar(20) NULL,
TITLE varchar(255) NOT NULL,
DESCRIPTION text NULL,
CREATED_DATE datetime NOT NULL,
CREATED_BY int NOT NULL,
SETTINGS text NULL,
MARK_DEFAULT smallint NULL,
CONSTRAINT report_ibpk_1 PRIMARY KEY (ID)
)
GO
CREATE INDEX ... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50548
Source Host : 127.0.0.1:3306
Source Database : male_ambry
Target Server Type : MYSQL
Target Server Version : 50548
File Encoding : 65001
Date: 2016-11-23 16:35:39
*/
SET FOREIGN_KEY_CHECKS=... |
CREATE TABLE [dbo].[States] (
[StateCode] NVARCHAR (128) NOT NULL,
[Name] NVARCHAR (MAX) NULL,
PRIMARY KEY CLUSTERED ([StateCode] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF)
);
|
-- BP 6.1D content: domain syschar: 3
INSERT INTO S_DOM
VALUES (12253223,
'im3',
'This test deals with reflexive relationships as well as assigner classes from a reflexive relationship. It also tests creating, selecting, relating, unrelating, and deleting instances.',
1,
1);
INSERT INTO S_CDT
VALUES (524289,
0... |
--CREAR TABLAS
CREATE TABLE MARCA(
NOMBRE VARCHAR2(32) NOT NULL
);
CREATE TABLE VALORACION(
ID NUMBER(4) NOT NULL,
PRECIO NUMBER(10,2) NOT NULL,
FECHA DATE NOT NULL,
ESTADO VARCHAR2(1) NOT NULL,
VEHICULO VARCHAR2(15) NOT NULL
);
CREATE TABLE VEHICULO (
VIN VARCHAR2(15) NOT NULL,
FE... |
<reponame>Zhaojia2019/cubrid-testcases<filename>sql/_01_object/_10_system_table/_004_db_attribute/cases/1014.sql
--create table with auto-increment int type's attriobute and retrieve info from db_attribute
create class xoo ( id int auto_increment , title varchar(100));
insert into xoo(title) values ('aaa');
insert in... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 11-05-2022 a las 16:25:23
-- Versión del servidor: 10.4.22-MariaDB
-- Versión de PHP: 8.0.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- -- Insérer des données -- --
INSERT INTO Departements(DepNo,DepNom)
VALUES (1, 'Recherche'),(2, 'Vente');
INSERT INTO Employes(EmpNo,EmpNom,EmpVille,DepNo)
VALUES (101,'Jean','Lausanne',1),
(102,'Paul','Geneve',2),
(103,'Anne','Fribourg',2);
INSERT INTO Projets(ProjetNo,ProjetNom)
VALUES (11,'A'),
... |
<reponame>egalli64/hron
-- examples on delete
use hron;
-- check the current table status
select *
from service;
-- delete a single row (or none)
delete from service
where service_id = 20;
-- multiline delete - be extra careful with it!
delete from service
where service_id > 10;
-- even more careful here!
-- anyway... |
CREATE TABLE IF NOT EXISTS contacts (
id UUID CONSTRAINT pk_contacts PRIMARY KEY,
owner_id UUID NOT NULL,
created_time TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT NOW(),
modified_time TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT NOW(),
status TEXT NOT NULL CONSTRAINT status_in CHECK (status IN ('ac... |
<filename>api/application/scripts/CREATE quizzes.sql
DROP TABLE IF EXISTS quizzes;
CREATE TABLE quizzes
(
`quizId` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`userId` INT(11) UNSIGNED NOT NULL,
`name` VARCHAR(100),
`status` INT UNSIGNED NOT NULL,
`... |
create table `workbook` (
`id` integer primary key autoincrement
,`version` int not null default 1
,`created_at` datetime not null default current_timestamp
,`updated_at` datetime not null default current_timestamp
,`created_by` int not null
,`updated_by` int not null
,`organization_id` int not null
,`owner_id` int no... |
SELECT
books.id ,
books.title ,
books.publisher_id,
publishes_table.first_year,
had_want_table.had_number,
had_want_table.want_number,
score_table.score,
suggestion_table.suggestion_number,
post_table.post_number
FROM books
LEFT JOIN
(SELECT publishes.book_id , MIN(publishes.year) AS first_year
FROM publishes
GR... |
/*
* InventoryOps.sql
* Chapter 8, Oracle10g PL/SQL Programming
* by <NAME>, <NAME>, and <NAME>
*
* This script demonstrates a package.
*/
CREATE OR REPLACE PACKAGE InventoryOps AS
-- Modifies the inventory data for the specified book.
PROCEDURE UpdateISBN(p_ISBN IN inventory.isbn%TYPE,
... |
select nome, cursopreferido from gafanhotos;
select nome, ano from cursos;
select * from gafanhotos;
select g.nome, c.nome, c.ano from gafanhotos as g
join cursos as c on idcurso = cursopreferido; |
--
-- Database: `blog`
--
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE IF NOT EXISTS `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`body` text NO... |
SET DEFINE OFF;
create or replace package afw_17_notfc_sms_twilio_pkg
as
type typ_arr_parmt is table of varchar2 (255)
index by pls_integer;
type typ_arr_valr is table of varchar2 (255)
index by pls_integer;
function obten_valr_iden (pva_iden in varchar2)
return varchar2;
procedure envoy_sms (pva... |
IF OBJECT_ID(N'dbo.sp_a','P') IS NOT NULL
DROP PROCEDURE dbo.sp_a
GO
/*-------------------------------------------------------------------------------------------------
NAME: sp_a.sql
UPDATED BY: <NAME>
EMAIL: <EMAIL>
DESCRIPTION: Displays all active processes
-------------------------------------... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 18-06-2019 a las 03:17:13
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>finance/egov/egov-egf/src/main/resources/db/migration/main/V20160623174251__egf_chequeAssignment_action.sql
Insert into EG_ACTION (id, name, url, queryparams, parentmodule, ordernumber, displayname, enabled, contextroot, version, createdby, createddate, lastmodifiedby, lastmodifieddate, application)
values ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 05, 2021 at 11:03 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<gh_stars>1-10
SELECT SQL_CALC_FOUND_ROWS p.`id_product` AS `id_product`,
p.`reference` AS `reference`,
sa.`price` AS `price`,
p.`id_shop_default` AS `id_shop_default`,
p.`is_virtual` AS `is_virtual`,
pl.`name` AS `name`,
pl.`link_rewrite` AS `link_rewrite`,
sa.`active` AS `active`,
shop.`name` AS `sho... |
if exists(select name from sys.objects where type = 'P' and name = 'Problema2')
drop procedure Problema2
go
create procedure Problema2 @codP int, @codM int, @dela date, @panala date, @pret int, @out bit output as
begin
if exists(select OferteSpeciale.*
from OferteSpeciale
whe... |
<reponame>marymlucas/mimic_explore<gh_stars>1-10
-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.
DROP TABLE IF EXISTS first_day_sofa; CREATE TABLE first_day_sofa AS
-- ------------------------------------------------------------------
-- Title: Sequential Organ Failure Assessment (SOFA)
-- This que... |
INSERT INTO "dashboard" VALUES(6,1,'jvm','JVM','{"__requires":[{"id":"grafana","name":"Grafana","type":"grafana","version":"4.4.3"},{"id":"graph","name":"Graph","type":"panel","version":""},{"id":"influxdb","name":"InfluxDB","type":"datasource","version":"1.0.0"}],"annotations":{"list":[]},"editable":true,"gnetId":null... |
<gh_stars>1-10
/*初始化权限数据的脚本*/
INSERT INTO sys_role VALUES
(replace(uuid(), '-', ''), 'admin', 'admin', now(), 0, '管理员角色'),
(replace(uuid(), '-', ''), 'root', 'root', now(), 0, 'ROOT用户角色'),
(replace(uuid(), '-', ''), 'user', 'user', now(), 0, '普通用户角色');
INSERT INTO sys_resource VALUES
(replace(uuid(),'-',''),'s... |
<gh_stars>1-10
alter system flush shared_pool;
alter system flush buffer_cache;
alter system flush global context;
alter system checkpoint;
|
CREATE USER ranger WITH PASSWORD '<PASSWORD>';
CREATE USER admin WITH PASSWORD '<PASSWORD>';
CREATE DATABASE ranger;
GRANT ALL PRIVILEGES ON DATABASE ranger to admin;
|
alter table REPORT_REPORT add DELETE_TS datetime^
alter table REPORT_REPORT add DELETED_BY varchar(50)^
alter table REPORT_GROUP add DELETE_TS datetime^
alter table REPORT_GROUP add DELETED_BY varchar(50)^
alter table REPORT_TEMPLATE add DELETE_TS datetime^
alter table REPORT_TEMPLATE add DELETED_BY varchar(50)^
if ... |
<reponame>habuma/nfjs-samples
create table Book (
id identity,
isbn varchar(10) not null,
title varchar(100) not null,
author varchar(100) not null
); |
<reponame>turbot/steampipe-mod-oci-compliance
select
-- Required Columns
distinct t.id as resource,
case
when c.name is not null then 'skip'
when condition -> 'eventType' ?& array
['DRG – Delete',
'DRG – Update',
'DRG Attachment – Create',
'DRG Attachment – Delete',
'DRG Atta... |
<filename>kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/function/func834.sql<gh_stars>10-100
CREATE FUNCTION func834() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE478);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABL... |
<gh_stars>1-10
--
-- Table structure for table `datasetInfo`
--
CREATE TABLE IF NOT EXISTS `datasetInfo` (
`Id` int(11) NOT NULL,
`dataset_name` text NOT NULL,
`index_path` text NOT NULL,
`created_on` text NOT NULL,
`database_name` text NOT NULL,
`original_filepath` text NOT NULL
) ENGINE=InnoDB AUTO_INCREME... |
<gh_stars>100-1000
SET FOREIGN_KEY_CHECKS = 0;
CREATE TABLE IF NOT EXISTS `plugin_packages` (
`id` VARCHAR(255) COLLATE utf8_bin PRIMARY KEY,
`name` VARCHAR(63) COLLATE utf8_bin NOT NULL,
`version` VARCHAR(20) COLLATE utf8_bin NOT NULL,
`status` ... |
HDF5 "h5ex_t_string.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_STRING {
STRSIZE 7;
STRPAD H5T_STR_SPACEPAD;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
DATA {
(0): "Parting", "is such", "sweet ", "sorrow."
}
... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 3.3.7
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2016 年 11 月 28 日 14:32
-- 服务器版本: 5.1.69
-- PHP 版本: 5.2.17p1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
<reponame>Gillingham/evething<filename>thing/sql/taskstate.postgresql_psycopg2.sql<gh_stars>10-100
ALTER TABLE thing_taskstate ALTER COLUMN mod_time TYPE timestamp without time zone;
ALTER TABLE thing_taskstate ALTER COLUMN next_time TYPE timestamp without time zone;
|
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Oct 26, 2020 at 10:21 PM
-- Server version: 5.7.21
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `retirementplanner`
--
-- ------------------... |
-- --------------------------------------------------------
-- Servidor: localhost
-- Versão do servidor: 8.0.25 - MySQL Community Server - GPL
-- OS do Servidor: Win64
-- HeidiSQL Versão: 11.3.0.6295
-- --------------------------------------------------------
/... |
<filename>0-d-a-s (1).sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 03, 2021 at 07:56 AM
-- Server version: 10.4.16-MariaDB
-- PHP Version: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... |
<reponame>DigitalDevelooper/crypto-advisor
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5ubuntu0.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 29, 2021 at 10:39 AM
-- Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.8
SET SQL_MODE = "NO_AUTO_VALU... |
<filename>sql/contacts.sql
CREATE TABLE contacts (
id serial primary key,
firstname character varying,
lastname character varying,
email character varying,
created_at timestamp without time zone NOT NULL default current_timestamp,
updated_at timestamp without time zone NOT NULL
);
create index ... |
CREATE TABLE [Album] (
[AlbumId] INT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR(50) NOT NULL,
[ArtistId] INT NOT NULL,
CONSTRAINT [PK_AlbumId] PRIMARY KEY CLUSTERED ([AlbumId] ASC),
CONSTRAINT [FK_ArtistId] FOREIGN KEY ([ArtistId]) REFERENCES [Arti... |
<gh_stars>0
DECLARE @roleOrUser NVARCHAR(100) = null;
-- Principal type:
--A = Application role
--C = User mapped to a certificate
--E = External user from Azure Active Directory
--G = Windows group
--K = User mapped to an asymmetric key
--R = Database role
--S = SQL user
--U = Windows user
--X = External ... |
SELECT DISTINCT CITY FROM STATION WHERE CITY NOT RLIKE '.*[aeiouAEIOU]$'
|
-- Adminer 4.2.3 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `absen`;
CREATE DATABASE `absen` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `absen`;
DROP TABLE IF EXISTS `absen`;
CREATE TABLE `absen` (
`id_absen` int... |
alter table "public"."socle_competency" drop constraint "socle_competency_container_id_fkey";
|
create table if not exists user_profiles(
id serial primary key not null,
user_id integer unique not null,
avatar varchar(100),
first_name varchar(100),
last_name varchar(100),
birthday date,
created_at timestamp not null,
updated_at timestamp not null,
deleted_at timestamp
);
create index index_user_id on us... |
CREATE DATABASE LoginData;
use LoginData;
DROP TABLE if exists Accounts;
CREATE TABLE IF NOT EXISTS Accounts (
`id` INT AUTO_INCREMENT,
`First_Name` VARCHAR(60) NOT NULL,
`Last_Name` VARCHAR(60) NOT NULL,
`Email` VARCHAR(100) NOT NULL,
`Password` VARCHAR(33) NOT NULL,
`Verified` INT,
PRIMA... |
<filename>Exercises-Data Aggregation/5. Deposits Sum/SQLQuery1.sql
SELECT DepositGroup , SUM(DepositAmount) AS TotalSum
FROM WizzardDeposits
GROUP BY DepositGroup
|
# --- !Ups
CREATE TABLE tours (
id bigint NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255) NOT NULL,
description varchar(10000) NOT NULL,
last_updated varchar(255) NOT NULL DEFAULT now()
);
CREATE TABLE waypoints (
id bigint NOT NULL PRIMARY KEY AUTO_INCREMENT,
lat double precision NOT N... |
IF OBJECT_ID('System.LookupObject') IS NOT NULL
DROP FUNCTION [System].[LookupObject]
GO
CREATE FUNCTION [System].[LookupObject](@ModuleName nvarchar(128), @Name nvarchar(128))
RETURNS UNIQUEIDENTIFIER
AS
BEGIN
RETURN (
SELECT ObjectId
FROM [System].[Object]
WHERE Name = @Name AND Modu... |
CREATE OR REPLACE FUNCTION egptpushdatatomvrefresh(noofdays integer)
RETURNS void
LANGUAGE plpgsql
AS $function$
begin
insert into egpt_mv_assessments (id, assessmentno, date_modified, type) select nextval('seq_egpt_mv_assessments'), propertyid, lastmodifieddate, 'NEW_ASSESSMENT' from egpt_basic_property bp where b... |
<gh_stars>100-1000
SELECT *
FROM Sales.Customer AS c
INNER JOIN Sales.CustomerAddress AS ca ON c.CustomerID = ca.CustomerID
WHERE TerritoryID = 5
OPTION (MERGE JOIN);
GO
CREATE PROCEDURE dbo.RetrievePersonAddress
@city_name NVARCHAR(30),
@postal_code NVARCHAR(15)
AS
SELECT * FROM Person.Address
WHERE City = @city_nam... |
<reponame>jdkoren/sqlite-parser
-- minmax2.test
--
-- execsql {
-- SELECT * FROM (SELECT max(x) FROM t1);
-- }
SELECT * FROM (SELECT max(x) FROM t1); |
SET @sName = 'bx_protean';
-- SETTINGS
DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name`=@sName;
-- MIXES
DELETE FROM `tom`, `tomo` US... |
-- Alter table changing the column type, converting the values to booleans
ALTER TABLE "users" ALTER COLUMN "isAdmin" TYPE boolean
USING CASE "isAdmin" WHEN 'true' THEN TRUE ELSE FALSE END;
-- Set the default value for the column
ALTER TABLE "users" ALTER COLUMN "isAdmin" SET DEFAULT false;
-- Make the column not nul... |
<gh_stars>0
USE hogwarts_db;
INSERT INTO departments (department_name, department_id)
VALUES
("Administration", 1),
("Educator", 2),
("Staff", 3),
("Ghost", 4),
("Board of Governors", 5);
INSERT INTO roles (job_title, role_id, department_id, salary)
VALUES
("Head Master", 1, 1, 158000),
("Transfiguration Professor",... |
<reponame>rrolf/opencast
# migration-3 contains post data migration steps
SET FOREIGN_KEY_CHECKS = 0;
####
# mh_assets_snapshot
##
ALTER TABLE mh_assets_snapshot
DROP COLUMN deleted;
# add indices
ALTER TABLE mh_assets_snapshot
ADD PRIMARY KEY (id),
ADD INDEX IX_mh_assets_snapshot_archival_date (archival_date),
ADD ... |
<gh_stars>1-10
-----------------------------------------------------------------------------
-- SAKAI_EVENT
-----------------------------------------------------------------------------
CREATE TABLE SAKAI_EVENT
(
EVENT_ID BIGINT AUTO_INCREMENT,
EVENT_DATE TIMESTAMP,
EVENT VARCHAR (32),
REF VARCHAR (255),
CONTEXT ... |
<reponame>felder/Tools
-- refreshCultureHierarchyTable
--
-- A function to keep the culture_hierarchy table up to date.
-- It is called from a nightly cron job
CREATE OR REPLACE FUNCTION utils.refreshCultureHierarchyTable() RETURNS void
AS $$
insert into utils.refresh_log (msg) values ( 'Creating culture_hierarch... |
-- Run this script
CREATE TABLE users (
u_id int IDENTITY(1,1) PRIMARY KEY,
firstname varchar(100) NOT NULL,
lastname varchar(100) NOT NULL,
contact_number varchar(15) NOT NULL,
email varchar(30) NOT NULL,
password varchar(100) NOT NULL,
role varchar(10) NOT NULL,
is_deleted int DEFAULT 0
)
c
CREATE... |
<filename>modules/core/db/init/hsql/10.create-db.sql
-- begin WORKSHOP_CLIENT
create table WORKSHOP_CLIENT (
ID varchar(36) not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
VERSION integer not null,
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varcha... |
-- Name: GetQuotedAndUnquotedPatientsInTimepoint
-- Schema: posda_files
-- Columns: ['quoted_patient_id', 'patient_id']
-- Args: ['activity_timepoint_id']
-- Tags: ['adding_ctp', 'for_scripting', 'patient_mapping']
-- Description: Retrieve entries from patient_mapping table
select distinct '<' || patient_id || '>' as ... |
select *
from table1 |
CREATE DATABASE '/firebird/data/quartz.fdb' USER 'SYSDBA' PASSWORD '<PASSWORD>'; |
<gh_stars>0
CREATE OR REPLACE LANGUAGE pltcl;
-- Generates a valid dhis2 uid identifier
CREATE OR REPLACE FUNCTION dhis_uid() RETURNS varchar(11) AS $$
set map "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
#-- first character must be a letter
set uid [string index $map [expr int(rand()*52)]]
... |
INSERT INTO `waffle_switch_mkt` (name, active, note, created, modified)
VALUES ('developer-stats', 0,
'Show overall developer stats.',
NOW(), NOW());
|
INSERT INTO "catalogs_catalog" ("id", "name", "code", "status", "img", "created_time", "updated_time", "created_user_id", "updated_user_id") VALUES
(130, 'Snack', 'Snack', 't', '<i class="fas fa-cookie"></i>', NULL, NULL, NULL, NULL),
(131, 'Sauces', 'Sauces', 't', '<i class="fas fa-pepper-hot"></i>', NULL, NULL, NULL,... |
create sequence hibernate_sequence start with 1 increment by 1
create table followers (player2_id bigint not null, player1_id bigint not null, primary key (player2_id, player1_id))
create table player (player_id bigint not null, courage_points bigint not null, courage_points_max integer not null, display_name varchar(1... |
Create Table If Not Exists creditcards(
CRE_PK_CreditCardId Int Not Null Primary Key Auto_Increment,
CRE_FK_Company Int Not Null Default 0,
CRE_STR_PrintedName Varchar(45) Not Null,
CRE_STR_Number Varchar(19) Not Null,
CRE_STR_SecureCode Char(3) Not Null,
CRE_BOL_Active TinyInt Not Null Default ... |
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: 172.16.31.10 Database: S2C
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!4... |
CREATE TABLE Product(
ID INT IDENTITY(1,1) NOT NULL,
Code NVARCHAR(50) NULL,
[Name] NVARCHAR(50) NULL,
Tezina DECIMAL(18, 2) NULL
CONSTRAINT PK_ProductID PRIMARY KEY (ID)
)
|
<filename>verify_regexp_tests.sql<gh_stars>0
CREATE OR REPLACE FUNCTION verify_regexp_tests(_server_version text DEFAULT NULL)
RETURNS boolean
LANGUAGE plpgsql
AS $$
DECLARE
_count_tests bigint;
_subject_id bigint;
_pattern text;
_subject text;
_flags text;
_is_match boolean;
_captured text[];
_error text;
_expected_is... |
<reponame>arproio/kpitest
CREATE OR REPLACE FUNCTION public.dblink_exec(text, boolean)
RETURNS text
LANGUAGE c
STRICT
AS '$libdir/dblink', $function$dblink_exec$function$
|
<filename>src/main/resources/import.sql<gh_stars>0
INSERT INTO USER (id, user_id, password, name, email) VALUES (1, 'test1', '<PASSWORD>', '테스트1', '<EMAIL>');
INSERT INTO USER (id, user_id, password, name, email) VALUES (2, 'test2', '<PASSWORD>', '테스트2', '<EMAIL>');
|
SELECT
p.id, p.name,
st.c as sale_count,
row_number() OVER(ORDER BY st.c DESC) as sale_rank
FROM
people as p
JOIN
(SELECT
people_id, COUNT(*) as c, SUM(price) as s
FROM sales
GROUP BY
people_id) as st
ON p.id = st.people_id
ORDER BY
sale_rank |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.