sql stringlengths 6 1.05M |
|---|
<filename>sql/direct/apl_samples/reco/apl_reco.sql
-- ================================================================
-- APL_AREA, RECOMMEND
-- Description :
-- Assumption 1: the users & privileges have been created & granted (see apl_admin.sql).
-- Assumption 2: the APL table types have been created (see apl_create_t... |
DROP TABLE IF EXISTS reputation;
DROP TABLE IF EXISTS hub;
DROP TABLE IF EXISTS level;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
userId BINARY(16) NOT NULL,
userActivationToken CHAR(32),
userBio VARCHAR(3000),
userEmail VARCHAR(255) NOT NULL,
userFirstName VARCHAR(64) NOT NULL,
userHash CHAR(128) NOT NU... |
/*
create_sequence.sql
This is needed to enable consistent creation of like sequences from 9.6 and beyond. As of pg11, sequences can optionally decalre a data type (integer, bigint) that determine its boundaries. Instead, we manually specify the boundary.
Return 1 for Success, 0 for failure.
*/
CREATE OR REPLACE FU... |
CREATE TABLE "users" (
"id" SERIAL PRIMARY KEY,
"email" VARCHAR(256) NOT NULL UNIQUE,
"screen_name" VARCHAR(256) NOT NULL UNIQUE,
"display_name" VARCHAR(256) NOT NULL,
"password_hash" VARCHAR(512) NOT NULL,
"remember_token" VARCHAR(512) NULL,
"created_at" TIMESTAMP NOT NULL DEFAULT NOW(),
... |
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM postgres;
|
h5clear warning: No cache image in the file
|
<gh_stars>0
INSERT INTO `categories` (`id`, `name`, `description`, `author_id`, `created_at`, `updated_at`) VALUES
(1, 'Laravel ', 'q', 1, NULL, '2017-05-15 17:25:17'),
(2, ' Symfony', 'Symfony is a PHP web application framework and a set of reusable PHP components/libraries. Symfony was published as free software on ... |
-- MySQL dump 10.13 Distrib 5.7.12, for Win32 (AMD64)
--
-- Host: localhost Database: db_fator_digital
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.16-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... |
<reponame>YuichiroSato/Blog<gh_stars>0
DROP TABLE Users;
DROP TABLE Books;
CREATE TABLE Users (
user_id varchar(8) PRIMARY KEY,
user_name varchar(8),
password varchar(8)
);
CREATE TABLE Books (
book_id varchar(8) PRIMARY KEY,
author varchar(8),
title varchar(100)
);
GRANT ALL PRIVILEGES ON TABLE Users TO... |
<reponame>BlondelMbou/timetable
--question 3
CREATE VIEW emploisDeTemps AS
SELECT DISTINCT C.codeCours, T.jourCoursDate FROM Cours C
JOIN Typehoraire T
ON C.codeCours= T.crsCodeCours
JOIN Jourcours J
ON J.dateJourCours=T.jourCoursDate
JOIN Coursdeclasse cls
ON T.crsCodeCours=cls.crsCodeCours
JOIN Classe Cl
... |
<reponame>ministryofjustice/hmpps-nomis-visits-mapping-service<gh_stars>0
insert into room_id (nomis_room_description, prison_id, vsip_id, is_open) values ('HEI-FAMILYTIME-HB1_6', 'HEI','VISITS-FAMILYTIME-HB1_6',true);
insert into room_id (nomis_room_description, prison_id, vsip_id, is_open) values ('HEI-VISITS-H1_6LV'... |
-- RA, ALUNO, CURSO, EMAIL, DTMATRICULA, CODPERLET, TELEFONE1, TELEFONE2
-- Apenas EAD (Turno Integral)
SELECT DISTINCT
COUNT(SALUNO.RA) [QTD],
SALUNO.RA,
UPPER(PPESSOA.NOME) [ALUNO],
SCURSO.NOME [CURSO],
STURNO.NOME [TURNO],
SPLETIVO.CODPERLET [PERIODO_LETIVO],
CO... |
<filename>SistemaUniversidad.BackEnd.BD/Stored Procedures/SP_Matriculas_Desactivar.sql
CREATE PROCEDURE SP_Matriculas_Desactivar
@CodigoMatricula INT,
@ModificadoPor VARCHAR(60),
@ExisteError BIT OUTPUT,
@DetalleError VARCHAR (60) OUTPUT
AS
BEGIN TRY
BEGIN TRANSACTION
DECLARE @ExisteMatricula BIT
SET @... |
CREATE TABLE OrderDetails(
OrderDetailID INT,
OrderID INT,
ProductID INT,
Quantity INT
);
|
CREATE TABLE Cumparator_1 (
cod integer not null primary key,
nume varchar2(25) null,
prenume varchar2(25) null,
patronimic varchar2(25) null,
adresa varchar2(36) null,
oras varchar2(25) default 'Balti',
sex char(1) null,
data_de_nastere date null,
telefon varchar2(14) null,
CONS... |
SELECT *
FROM sys.server_principals
WHERE name='DBAdmin' |
<reponame>dstack-group/Butterfly
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
CREATE SCHEMA IF NOT EXISTS public;
-- ALTER SCHEMA public OWNER TO ... |
ALTER TABLE eg_boundary ADD COLUMN code VARCHAR(25);
ALTER TABLE eg_boundary_type ADD COLUMN code VARCHAR(25);
ALTER TABLE eg_hierarchy_type DROP column code;
ALTER TABLE eg_hierarchy_type ADD COLUMN code VARCHAR(25);
UPDATE eg_boundary SET code=LPAD(id::text,5,'0');
UPDATE eg_boundary_type SET code=LPAD(id::text,5,'0'... |
-- file:roleattributes.sql ln:59 expect:true
SELECT * FROM pg_authid WHERE rolname = 'regress_test_user_canlogin'
|
--
-- Read split() parameters
--
delimiter //
drop procedure if exists _consume_split_statement_params //
create procedure _consume_split_statement_params(
in id_from int unsigned,
in id_to int unsigned,
in should_execute_statement tinyint unsigned,
out split_table_schema tinytext charse... |
<gh_stars>1-10
SELECT
F.CHECK_SUM,
F.ADLER32,
F.FILE_SIZE,
F.EVENT_COUNT,
FT.FILE_TYPE,
F.LAST_MODIFIED_BY,
F.LAST_MODIFICATION_DATE,
F.LOGICAL_FILE_NAME,
F.MD5,
F.AUTO_CROSS_SECTION,
F.IS_FILE_VALID
FROM {{.Owner}}.FILES F
JOIN {{.Owner}}.BLOCKS B ON B.BLOCK_ID = F.BLOCK_ID
... |
<gh_stars>1-10
-- noinspection SqlWithoutWhere
DELETE FROM db.news_links;
INSERT INTO db.news_links
(id, news_group_id, user_name, title, create_time, update_time, enabled, visible, flags)
VALUES
('00000000-0000-0000-0000-000000000002', '00000000-0000-0000-0000-000000000001', 'userName1', 'title1', '1970-01-01 00:00:00... |
<reponame>gruxic/SQL_basics
/*Emails of customers from california district?*/
SELECT email FROM customer
INNER JOIN address
ON customer.address_id=address.address_id
WHERE address.district= 'California'
/*Get a list of all movies <NAME> has been in*/
SELECT title FROM film_actor
INNER JOIN film
ON film_actor.... |
<filename>src/main/resources/data.sql
INSERT INTO users (user_id, username, password, enabled, role) VALUES
('0', '<EMAIL>', '$2a$10$D4OLKI6yy68crm.3imC9X.P2xqKHs5TloWUcr6z5XdOqnTrAK84ri', true, 'ROLE_ADMIN'),
('1', '<EMAIL>', '$2a$10$D4OLKI6yy68crm.3imC9X.P2xqKHs5TloWUcr6z5XdOqnTrAK84ri', true, 'ROLE_USER'),
('2', ... |
CREATE TABLE `ad_user_click_count` (
`date` varchar(30) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`ad_id` int(11) DEFAULT NULL,
`click_count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ad_blacklist` (
`user_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREA... |
<reponame>Vilikkki/salava
DROP TABLE IF EXISTS `badge_congratulation`;
--;;
DROP TABLE IF EXISTS `badge_view`; |
<filename>atc/db/migration/migrations/1547650558_add_pin_comment_to_resources.down.sql
BEGIN;
ALTER TABLE resources
DROP COLUMN pin_comment;
COMMIT;
|
DROP FUNCTION IF EXISTS _prom_catalog.get_new_pos_for_key(text, text);
DROP FUNCTION IF EXISTS _prom_catalog.get_or_create_label_ids(text, text[], text[]); |
ALTER TABLE jwt_keys
ADD COLUMN created_at TIMESTAMP;
UPDATE jwt_keys SET created_at = NOW();
ALTER TABLE jwt_keys
ALTER COLUMN created_at SET DEFAULT NOW();
ALTER TABLE jwt_keys
ALTER COLUMN created_at SET NOT NULL;
|
<gh_stars>0
-- script that lists all cities
-- contained in the database hbtn_0d_usa.
SELECT cities.id, cities.name, states.name FROM cities
JOIN states ON cities.state_id = states.id;
|
-- This query returns the data that is used to generate the Matlab plots
select dayselapsed,
district,
sum(population) as popuation,
avg(msd.eir) as eir,
sum(population * pfprunder5) / sum(population) as pfprunder5,
sum(population * pfpr2to10) / sum(population) as pfpr2to10,
sum(population * pfprall) / sum... |
<reponame>albireox/sdssdb<filename>schema/sdss5db/catalogdb/sdss_qso/dr14/sdss_dr14_qso.sql
CREATE TABLE IF NOT EXISTS "catalogdb"."sdss_dr14_qso" (
"sdss_name" VARCHAR(18),
"ra" DOUBLE PRECISION,
"dec" DOUBLE PRECISION,
"thing_id" INTEGER,
"plate" SMALLINT,
"mjd" INTEGER,
"fiberid" SMALLINT,
"spectro" ... |
CREATE DATABASE IF NOT EXISTS coronavirus DEFAULT CHARSET utf8;
CREATE TABLE `tb_virus_history_data` (
`countryShortCode_dateId` VARCHAR(20) NOT NULL COMMENT '数据唯一值',
`dateId` VARCHAR(10) NOT NULL COMMENT '日期' ,
`country_name` VARCHAR(30) NOT NULL COMMENT '国家中文名' ,
`countryShortCode` VARCHAR(20) NOT N... |
<filename>tiptop (1).sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 10, 2020 at 08:54 PM
-- Server version: 5.7.30-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00"... |
CREATE TABLE orders_temp
(
id INTEGER PRIMARY KEY NOT NULL,
customer_id INTEGER NOT NULL,
description TEXT DEFAULT '',
order_date TIMESTAMP DEFAULT current_timestamp NOT NULL,
expire_date TIMESTAMP DEFAULT '2222-01-01' NOT NULL
);
INSERT INTO ord... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `EmailsReports` (
`id` int(11) NOT NULL,
`Type` varchar(15) NOT NULL,
`Recipient` varchar(250) NOT NULL,
`Domain` varchar(100) NOT NULL,
`messageHeaders` text NOT NULL,
`moreData` text NOT N... |
<reponame>Codentia/Codentia.Common.Membership
IF EXISTS ( SELECT 1 FROM dbo.SysObjects WHERE id=OBJECT_ID('dbo.WebAddress_GetByURL') AND OBJECTPROPERTY(id,'IsProcedure')=1)
BEGIN
DROP PROCEDURE dbo.WebAddress_GetByURL
END
GO
CREATE PROCEDURE dbo.WebAddress_GetByURL
@URL NVARCHAR(300)
AS
BEGIN
SET NOCOUNT ON
... |
<gh_stars>0
CREATE TABLE "person"
(
"person_id" serial PRIMARY KEY,
"person_number" varchar(12) UNIQUE,
"name" varchar(100),
"street" varchar(100),
"zip" varchar(5),
"city" varchar(50),
"age" int
);
CREATE TABLE "contact_details"
(
"person_id" int NOT NULL REFERENCES "person" ON DELETE CASCADE,
"cont... |
<reponame>RyanRedburn/sql-tools<filename>Analysis/GetPlanDetailsForProc.sql
SET NOCOUNT ON;
DECLARE @proc_name SYSNAME = N'';
--Query plan(s)
SELECT o.[object_id], s.plan_handle, s.cached_time, s.last_execution_time, s.execution_count, h.query_plan
FROM sys.objects AS o
JOIN sys.dm_exec_procedure_stats AS s ON o.[o... |
--
-- Own user sessions on the database
--
-- Tested on: 10g, 11g
--
SELECT SYS_CONTEXT('USERENV','SESSION_USER') FROM dual;
|
<gh_stars>1-10
CREATE OR REPLACE FUNCTION ti.getvariableelementsbydatasettypeid(_datasettypeid integer)
RETURNS TABLE(variableelementid integer, variableelement character varying, elementtypeid integer, symmetryid integer, portionid integer, maturityid integer, taxagroupid character varying)
LANGUAGE sql
AS $function... |
DELETE FROM MetObjects WHERE Is_Public_Domain = 'False';
CREATE TABLE IF NOT EXISTS tmpTable(
id INTEGER PRIMARY KEY,
title TEXT,
artist TEXT,
type TEXT,
date TEXT
);
INSERT INTO tmpTable(id, title, artist, type, date)
SELECT Object_ID, Title, Artist_Display_Name, Medium, Object_Date FROM MetObjects;
DROP... |
<filename>db/CSVImport.sql
\c overview;
-- Products
\COPY products FROM 'SDC_CSVs/product.csv' WITH DELIMITER ',' CSV HEADER NULL AS 'null';
--Styles
\COPY styles FROM 'SDC_CSVs/styles.csv' WITH DELIMITER ',' CSV HEADER NULL AS 'null';
CREATE INDEX ON styles (id);
-- Features
\COPY features FROM 'SDC_CSVs/features.c... |
ALTER TABLE `transactions` CHANGE `user_id` `user_id` int(10) unsigned NULL DEFAULT NULL;
|
ALTER TABLE `ownership` ADD COLUMN `dropbox_id` INT(11), ADD COLUMN `beta` boolean, ADD COLUMN `flagged` char(16);
|
<filename>query/1.3.sql
select sum(lo_extendedprice*lo_discount) as revenue
from lineorder, date
where lo_orderdate = d_datekey
and d_weeknuminyear = 6 and d_year = 1994
and lo_discount between 5 and 7
and lo_quantity between 36 and 40;
|
<gh_stars>1-10
delete
from dlm_partition_config_reference
where dlm_partition_config_line_id in (select dlm_partition_config_line_id from dlm_partition_config_line where dlm_referencing_table_id = 540422)
;
delete
from dlm_partition_config_line
where dlm_referencing_table_id = 540422
;
-- Table: C_Queue_Block
-- 2022... |
<gh_stars>0
update krim_entity_email_t a set email_addr=(select prncpl_nm from krim_prncpl_t b where a.entity_id=b.entity_id)||'<EMAIL>' where lower(email_addr) like <EMAIL>'
/
|
CREATE PROCEDURE [dbo].[RemoveClient]
@ClientId INT
AS
DELETE FROM dbo.Client WHERE ClientId=@ClientId
RETURN 0; |
<filename>microservicio/infraestructura/src/main/resources/sql/mascota/listar.sql
select id,nombre,fecha_nacimiento,nombre_contacto,telefono,tipo
from mascota |
with account_membership as (
select * from {{ var('account_membership') }}
),
fields as (
select
account_id,
user_id,
cast(activated_at as {{ dbt_utils.type_timestamp() }}) as activated_at,
cast(joined_at as {{ dbt_utils.type_timestamp() }}) as joined_at,
role as ... |
ALTER TABLE `users` MODIFY COLUMN `password` char(60) NOT NULL; |
SELECT
tagClassName AS 'tagClass:STRING',
country AS 'country:STRING'
FROM (
SELECT
tagClassName,
abs(frequency - (SELECT percentile_disc(0.82) WITHIN GROUP (ORDER BY frequency) FROM tagClassNumMessages)) AS diff,
CASE tagClassId % 2 == 0 WHEN true THEN 'China' ELSE 'India' END AS co... |
-- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: cloud_player
-- ------------------------------------------------------
-- Server version 5.5.35-0ubuntu0.12.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULT... |
<gh_stars>100-1000
--
-- 表的结构 `addons_putong_demo_config`
--
CREATE TABLE `addons_putong_demo_config` (
`id` int(10) unsigned NOT NULL,
`name` text NOT NULL COMMENT '活动名称',
`file_id` int(11) NOT NULL COMMENT '活动图片',
`sub` text NOT NULL COMMENT '活动描述',
`detail` text NOT NULL COMMENT '活动详情',
`timerange` text... |
INSERT INTO users (id, name) VALUES (1, 'Петя');
INSERT INTO users (id, name) VALUES (2, 'Вася');
INSERT INTO users (id, name) VALUES (3, 'Саша');
INSERT INTO categories (id, name) VALUES (1, 'IT');
INSERT INTO categories (id, name) VALUES (2, 'Авто');
INSERT INTO categories (id, name) VALUES (3, 'Дома');
INSERT INTO... |
<reponame>AlexeyKashintsev/PlatypusJS<filename>application/src/components/Datamodel/src/com/eas/client/sqldrivers/sqlscripts/PostgreInitVersion.sql
CREATE TABLE mtd_version
(
VERSION_VALUE numeric NOT NULL,
CONSTRAINT mtd_version_pk PRIMARY KEY(VERSION_VALUE)
)
#GO
INSERT INTO mtd_version (VERSION_VALUE) ... |
<reponame>Johnymiro/fullstack-spring-react-ecommerce<gh_stars>1-10
INSERT INTO student_course (
student_id,
course_id,
start_date,
end_date,
grade
)
VALUES (
'e7e40436-b931-441d-85e0-d86b6039fdfa',
'7321b9a6-29f7-49e0-9330-6d079c792608',
(NOW() - INTERVAL '1 YEAR')::DATE,
NOW():... |
<gh_stars>1-10
-- Name: QueriesRunning
-- Schema: posda_backlog
-- Columns: ['datname', 'pid', 'time_backend_running', 'time_query_running', 'time_since_state_change', 'state']
-- Args: []
-- Tags: ['AllCollections', 'postgres_stats', 'postgres_query_stats']
-- Description: Get a list of collections and sites
--
sele... |
<reponame>Ratsri17/GuestHouseManagement<filename>Database/guesthouse.sql
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2018 at 05:16 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00... |
<reponame>olgapodizdikova/testmanager
create sequence tests_seq;
create table tests
(
id bigint not null default nextval('tests_seq'),
name varchar(255) not null,
status varchar(20),
constraint tests_pk primary key (id),
constraint tests_status_fk foreign key (status) references execut... |
SELECT CAST(MAX(LAT_N) AS DECIMAL (10,4)) FROM STATION WHERE LAT_N < 137.2345; |
-- CREATE TABLE "todos" ----------------------------------------
CREATE TABLE `todos` (
`id` Int( 11 ) AUTO_INCREMENT NOT NULL,
`message` Text NOT NULL,
`note` Text NULL,
`is_done` TinyInt( 1 ) NOT NULL DEFAULT 0,
`created_at` Timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` Timestamp NOT NULL ON UPDAT... |
<filename>Compentio.Ankara.Database/CreateDatabase/ankara-db-init.sql
USE [master]
GO
IF DB_ID('ankara') IS NOT NULL
set noexec on
CREATE DATABASE [ankara];
GO
USE [ankara]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE LOGIN [migrator] WITH PASSWORD = '<PASSWORD>!'
GO
CREATE SCHEMA app
GO
CREATE... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 17, 2016 at 10:28 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
CREATE DATABASE IF NOT EXISTS FamilyBudget;
CREATE TABLE IF NOT EXISTS FamilyBudget.family(
family_id INT UNSIGNED NOT NULL auto_increment,
PRIMARY KEY(family_id)
);
CREATE TABLE IF NOT EXISTS FamilyBudget.user(
user_id INT UNSIGNED NOT NULL auto_increment,
family_id INT UNSIGNED NOT NULL,
name VARCHAR(256) NOT NULL,... |
<filename>db/sqlite/sql/ReferenceModels/CREATE/TABLE/Activities.sql
CREATE TABLE Activities
(
ActivityId INTEGER NOT NULL UNIQUE CONSTRAINT PrimaryKeyActivity PRIMARY KEY AUTOINCREMENT,
Code TEXT(255) NOT NULL,
Name TEXT(255) NULL,
Title TEXT(255) NULL
);
|
CREATE TABLE [dbo].[Department] (
[D_Id] INT IDENTITY (1, 1) NOT NULL,
[D_name] NVARCHAR (100) NOT NULL,
[Faculty] NVARCHAR (50) NOT NULL,
[U_Id] INT NOT NULL,
PRIMARY KEY CLUSTERED ([D_Id] ASC),
UNIQUE NONCLUSTERED ([D_name] ASC),
FOREIGN KEY ([U_Id]) REFERENC... |
<gh_stars>1-10
# https://leetcode.com/problems/create-a-session-bar-chart/
SELECT
b.bin as BIN, ifnull(count(s.bin), 0) as TOTAL
FROM
(SELECT '[0-5>' AS bin
UNION ALL
SELECT '[5-10>' AS bin
UNION ALL
SELECT '[10-15>' AS bin
UNION ALL
SELECT '15 or more' AS bin) b LEFT JOIN
... |
<reponame>PacktPublishing/Advanced-Machine-Learning-with-Spark-2.x<filename>section_4_sensors/Spark-Streaming-Apache-Kafka-Apache-HBase/src/main/resources/createTable.sql
create 'sensors', 'data', 'alert', 'stats';
count 'sensors'
scan 'sensors'
-->when want to delete table
disable 'sensors'
drop 'sensors'
alter 'se... |
<filename>src/main/resources/db/migration/V1_3__create_session_template_table.sql
CREATE TABLE session_template
(
id serial NOT NULL PRIMARY KEY,
prison_id VARCHAR(6) NOT NULL,
restrictions text,
visit_room VARCHAR(255) NOT NULL... |
<gh_stars>10-100
-- file:plpgsql.sql ln:934 expect:false
raise exception ''illegal slotlink beginning with %'', mytype
|
<reponame>HNochev/SoftUni-CSharp-Software-Engineering
--Problem 6
SELECT CONCAT(FirstName,'.',LastName,'@<EMAIL>') AS Email
FROM Employees
SELECT FirstName + '.' + LastName + '@softuni.bg' AS Email
FROM Employees |
create table reactions (reaction varchar(80));
create table drugs (drugname varchar(80));
|
SET @sPluginName = 'aqb_pcomposer';
SET @sPluginTitle = 'AQB Profile Composer';
DELETE FROM `sys_permalinks` WHERE `check` = CONCAT('permalinks_module_', @sPluginName);
DELETE FROM `sys_menu_admin` WHERE `name` = @sPluginName;
SET @iId = (SELECT `ID` FROM `sys_options_cats` WHERE `name` = @sPluginTitle);
DELETE FROM ... |
-- uninstall: exec arcsql.stop;
-- uninstall: drop package body arcsql;
-- uninstall: drop package arcsql;
-- uninstall: drop function arcsql_version;
-- grant: grant execute on arcsql_version to &username;
create or replace function arcsql_version return number is
n number;
s varchar2(100);
begin
select ... |
CREATE TABLE IF NOT EXISTS `closure_table` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tree_paths` (
`ancestor` BIGINT(20) UNSIGNED NOT NULL,
`descendant` BIGINT(20) UNSIGNED NOT NULL,
... |
<filename>instalura-script.sql<gh_stars>0
ALTER TABLE usuario MODIFY COLUMN url_foto_perfil VARCHAR(65000);
ALTER TABLE foto MODIFY COLUMN url VARCHAR(65000);
/* Atualiza das imagens do usuário */
update usuario set url_foto_perfil="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxANEA8NDRANDQ0NDg0ODQ0NDw... |
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep_end_to_end/resync/sql/resync_co_alter_part_add_col.sql
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- RESYNC CO Part Table 1
--
CREATE TABLE resync_co_alter_part_add_col1 (id int, rank int, year date, gender
char(1... |
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: oa_sys
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS users (
UserID text PRIMARY KEY,
UserName text,
MessagesSent integer DEFAULT 0,
CountLogins integer DEFAULT 1,
LastLogin text DEFAULT CURRENT_TIMESTAMP,
Coins integer DEFAULT 0,
CoinLock text DEFAULT CURRENT_TIMESTAMP,
Warnings integer DEFAULT 0,
LostCounter integer DEFAU... |
-- @testpoint:opengauss关键字desc(保留),作为数据库名
--关键字不带引号-失败
drop database if exists desc;
create database desc;
--关键字带双引号-成功
drop database if exists "desc";
create database "desc";
drop database "desc";
--关键字带单引号-合理报错
drop database if exists 'desc';
create database 'desc';
--关键字带反引号-合理报错
drop database if exists `desc`;... |
<filename>src/main/resources/db/migration/V2__Add_columns_to_skademelding.sql<gh_stars>0
ALTER TABLE skademelding
ADD COLUMN kilde VARCHAR(100) DEFAULT ('') NOT NULL,
ADD COLUMN mottatt_tidspunkt TIMESTAMP; |
CREATE TABLE [dbo].[Zgloszenia] (
[idOferty] INT IDENTITY (1, 1) NOT NULL,
[imie_nazwisko] VARCHAR (80) NOT NULL,
[firma] VARCHAR (80) DEFAULT ('nie podano') NULL,
[nr_telefonu] VARCHAR (30) NOT NULL,
[mail] VARCHAR (50) ... |
<gh_stars>0
SELECT
id,
CASE WHEN activity_id IS NULL THEN id
ELSE activity_id
END as activity_id,
name,
1 - ts_rank(to_tsvector('english', name), to_tsquery(${name})) as rank
FROM activities
WHERE
user_id = ${user_id}
AND
to_tsvector('english', name) @@ to_tsquery(${name})
ORDER BY rank DESC
LIMIT 5
|
<gh_stars>0
-- Author: <NAME>, <NAME>
DROP TABLE IF EXISTS athletes;
DROP TABLE IF EXISTS games;
DROP TABLE IF EXISTS cities;
DROP TABLE IF EXISTS games_cities;
DROP TABLE IF EXISTS ages;
DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS medals;
DROP TABLE IF EXISTS nocs;
DROP TABLE IF EXISTS athletes_nocs;
CREATE T... |
CREATE TABLE [dbo].[Survey]
(
[Id] BIGINT IDENTITY(1, 1) NOT NULL,
[CreatorId] BIGINT NOT NULL,
[OwnerId] BIGINT NOT NULL,
[StatusId] BIGINT NOT NULL,
... |
-- 创建 todo_list 数据库
drop database if exists `todo_list`;
create schema `todo_list` default character set utf8mb4;
use todo_list;
-- 创建表
drop table if exists `users`;
create table `users` (
`id` int(11) not null auto_increment,
`email` varchar(255) not null,
`password` varchar(255) not null,
primary key (`id`)... |
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.19-nt
/*!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 *... |
ALTER TABLE "public"."patient" ALTER COLUMN "hospital_patient_id" DROP NOT NULL;
|
PRAGMA foreign_keys=ON;
DROP TABLE IF EXISTS TermGrades;
DROP TABLE IF EXISTS Lecturer;
DROP TABLE IF EXISTS Task;
DROP TABLE IF EXISTS Professor;
DROP TABLE IF EXISTS Period;
DROP TABLE IF EXISTS EvaluationEvent;
DROP TABLE IF EXISTS Classroom;
DROP TABLE IF EXISTS Institution;
DROP TABLE IF EXISTS EvaluationType;
DR... |
/*
SQLyog Enterprise v12.5.1 (64 bit)
MySQL - 8.0.20 : Database - dbrawatinap
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FO... |
<reponame>willn/book_of_agreements
CREATE TABLE `agreements_versions` (
`vers_id` int(6) NOT NULL auto_increment,
`updated_date` datetime default NULL,
`agr_version_num` int(6) NOT NULL,
`diff_comment` text,
`agr_id` int(6) NOT NULL,
`title` text,
`summary` text,
`full` text,
`background` text,
`com... |
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 8.0.15 - MySQL Community Server - GPL
-- OS do Servidor: Win64
-- HeidiSQL Versão: 10.1.0.5464
-- --------------------------------------------------------
/... |
--
UPDATE subscription
SET
signature_algorithm = :signatureAlgorithm
WHERE
id = :subscriptionId
|
<filename>schema.sql
/* We have to drop all tables before raw_data because all the tables
* have a foreign key that links to raw_data
*/
drop table if exists invalid_data;
drop table if exists planner_metrics;
drop table if exists planner_errors;
drop table if exists downloads;
drop table if exists dagman_metrics;
dr... |
IF EXISTS(SELECT * FROM sys.procedures WHERE NAME = 'B_Normal_Loan_Process_Payment_For_A_Loan_Per_Date')
BEGIN
/****** Object: StoredProcedure [dbo].[B_Normal_Loan_Process_Payment_For_A_Loan_Per_Date] Script Date: 10/12/2014 8:38:26 AM ******/
DROP PROCEDURE [dbo].[B_Normal_Loan_Process_Payment_For_A_Loan_Per_... |
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Wed Jul 3 11:33:19 2019
--
;
BEGIN TRANSACTION;
--
-- Table: event_log
--
CREATE TABLE event_log (
id INTEGER PRIMARY KEY NOT NULL,
object_identifier jsonb NOT NULL,
payload jsonb NOT NULL,
tags jsonb,
type text,
timestamp timestamptz NOT ... |
WITH pre_format AS (
SELECT
YEAR(ModifiedDate) AS [Year],
MONTH(ModifiedDate) AS [Month],
LineTotal
FROM
Sales.SalesOrderDetail
),
group_data AS (
SELECT
IIF(GROUPING_ID([Year]) = 1, 'Total', CAST([Year] AS CHAR(4))) AS [Year],
IIF(GROUPING_ID([Month]) = 1, 'Total',
CHOOSE([Month], 'Jan','... |
<reponame>nunesd/Candidate<filename>src/main/resources/db/changelog/scripts/001.CREATE_TABLE_CANDIDATE.sql
create table candidate (
id integer identity primary key,
name varchar(255) not null,
number_election integer not null,
election_id integer not null,
party_id integer not null
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.