sql stringlengths 6 1.05M |
|---|
-- Write a PL/SQL program which will
-- find the sum, average and standard deviation of first ‘n’ numbers,
-- where n is supplied by the user.
-- The range of n should be within 10 to 100, throw an exception if an invalid range is supplied.
declare
sum1 number := 0;
avg1 number;
std number := 0;
n number;
c nu... |
ALTER TABLE articles RENAME COLUMN introduction TO custom_introduction;
|
<reponame>PierreParienteDimitrov/employee_tracker<filename>employee.sql
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE department(
id INTEGER AUTO_INCREMENT NOT NULL,
department_name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
CREATE TABLE role(
id INTEGER AU... |
<gh_stars>0
USE [master]
GO
CREATE DATABASE [ProductsDB] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\ProductsDB.mdf' )
FOR ATTACH
GO
/*
Once the above T-SQL code has executed successfully you will get the below message which informs you that SQL Server has created a ne... |
<reponame>rchavarria/driftphp-homework
--
-- Create database and table for Users
--
create database usersdb;
use usersdb;
create table users
(
uid varchar(64) default '' not null primary key,
name varchar(255) not null
);
-- initial users
insert into users (uid, name)
values ('plnctn', 'Plancton, ... |
create index IX_F164A9B0 on DNTLABS_Temperature (deviceId[$COLUMN_LENGTH:75$]);
create index IX_271C6291 on DNTLABS_Temperature (status);
create index IX_DB0C4BDF on DNTLABS_Temperature (uuid_[$COLUMN_LENGTH:75$], companyId);
create unique index IX_ACA43E21 on DNTLABS_Temperature (uuid_[$COLUMN_LENGTH:75$], groupId); |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 14, 2019 at 03:05 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>frozsgy/odtu-telegram-bot
CREATE TABLE IF NOT EXISTS settings (id SERIAL PRIMARY KEY, data varchar);
CREATE TABLE IF NOT EXISTS people (uid bigint NOT NULL UNIQUE , fname text, lname text, uname text);
CREATE TABLE IF NOT EXISTS groups (gid bigint NOT NULL UNIQUE, title text);
CREATE TABLE IF NOT EXISTS logs ... |
Insert INTO report (name, version, category, permitted_parameters)
VALUES ('jsonReport', '1.0', 'report', '{"instrument":{"type":"s", "required":false}, "runName":{"type":"s", "required":true}}');
Insert INTO report_record (report_id, files_in, report_path, notification_targets, notification_message, parameters)
VALUE... |
SELECT DISTINCT
FIELD_41 AS ASSET_STATUS,
USER.USER_NAME AS ASSIGNED_TO,
USER.EMAIL AS EMAIL_ADDRESS,
ASSET_DATA_VIEW_Location.NAME AS LOCATION,
FIELD_19 AS NAME,
ASSET_DATA_VIEW_Department.NAME AS DEPT,
FIELD_39 AS ROOM_NUMBER,
FIELD_22 AS ASSIGNMENT_TYPE,
FIELD_31 AS FUNDS_USED,
FIELD_27 AS DATE_P... |
<reponame>pradeepkumarcm-egov/DIGIT-Dev<gh_stars>10-100
ALTER TABLE eg_fsm_application
ALTER COLUMN sanitationtype DROP NOT NULL,
ALTER COLUMN source DROP NOT NULL,
ALTER COLUMN vehicle_id DROP NOT NULL;
ALTER TABLE eg_fsm_application_auditlog
ALTER COLUMN sanitationtype DROP NOT NULL,
A... |
USE [Vipunen_koodisto]
GO
/****** Object: View [dbo].[v_koulutuksen_jarjestaja_koko] Script Date: 12.1.2021 6:16:45 ******/
DROP VIEW IF EXISTS [dbo].[v_koulutuksen_jarjestaja_koko]
GO
USE [VipunenTK_SA]
GO
DROP VIEW IF EXISTS [dbo].[v_sa_6_3_Koulutuksen_jarjestajan_koko]
GO
/****** Object: View [dbo].[v_koulu... |
<filename>schema/verify/roles/sequencing-lab.sql
-- Verify seattleflu/schema:roles/sequencing-lab on pg
begin;
select 1/pg_catalog.has_database_privilege('sequencing-lab', :'DBNAME', 'connect')::int;
select 1/pg_catalog.has_schema_privilege('sequencing-lab', 'receiving', 'usage')::int;
select 1/pg_catalog.has_column_... |
-- DropForeignKey
ALTER TABLE "Todo" DROP CONSTRAINT "Todo_todoListId_fkey";
-- AddForeignKey
ALTER TABLE "Todo" ADD CONSTRAINT "Todo_todoListId_fkey" FOREIGN KEY ("todoListId") REFERENCES "TodoList"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
select descricao,quantidadecontratada, contratada from itens inner join contratos on itens.numerocontrato=contratos.numerocontratos where numerocontrato = 'CT-CT/20140041';
========== Despesa.findByValorReembolsadoTotal ==========
SELECT SUM(d.valor_reembolsado) FROM Despesa d WHERE d.senador = :senador |
CREATE OR REPLACE package pa_orcas_clean authid current_user is
/**
* Loescht alle DDL daten zu der Tabelle, bis auf Saplten und die Tabelle selbst.
*/
procedure clean_table( p_table_name in varchar2 );
/**
* Loescht alle DDL daten zu allen Tabelle, bis auf Saplten und die Tabellen selbst.
*/
procedure clean_all_... |
--------------------------------------------------------------------------------
-- sqlserver migration from <= 1.3 to next release
--------------------------------------------------------------------------------
-- Drop constraints
ALTER TABLE EXECUTION DROP CONSTRAINT FK65111AF8FCEAA1D7;
ALTER TABLE REFERENCE DROP C... |
<reponame>kll5h/ShinetechOA
UPDATE DICT_TYPE SET TENANT_ID='1';
UPDATE DICT_SCHEMA SET TENANT_ID='1';
UPDATE DICT_INFO SET TENANT_ID='1';
UPDATE DICT_DATA SET TENANT_ID='1';
|
-- This is a manual script used once on data.gov.au to add an "id" member to the source of existing records.
UPDATE recordaspects
SET data = jsonb_set(data, '{id}', '"act"')
WHERE aspectid = 'source'
AND data->>'name' = 'ACT Government data.act.gov.au';
UPDATE recordaspects
SET data = jsonb_set(data, '{id}', '"bom... |
<reponame>device42/DOQL_scripts_examples<filename>Affinity Group DOQL/connections_in_past_60_days.sql
/*Include connections up to 60 days*/
select * from view_affinity_dependency_data_v1
where family(listener_ip) <> 6 and listener_ip <> '::1' and listener_ip <> '127.0.0.1' and listener_service_topology_status <> 3 and ... |
<filename>cosmic-core/cosmic-flyway/src/main/resources/db/migration/V2_23__disk-offering-custom-only.sql
UPDATE `disk_offering` SET `disk_size`=0, `customized`=1, `state`="Inactive", `removed`=NOW() WHERE `type`="disk" AND `customized` = 0;
|
<filename>store/postgres/migrations/2021-01-15-013524_drop_deployment_detail/up.sql
drop view subgraphs.subgraph_deployment_detail;
|
<reponame>yesID100/Webiguantaste
CREATE DATABASE IF NOT EXISTS DB_iguanataste;
USE DB_iguanataste;
CREATE TABLE usuario(
usuarioID int(255) auto
increment not null,
NombreUsuario varchar(50),
Password text,
Remember_token int,
RolID int,
CONSTRAINT pk_users PRIMARY KEY(usuarioID))
CREATE TABLE persona(
... |
<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : localhost:81
Source Server Type : MySQL
Source Server Version : 100414
Source Host : localhost:3306
Source Schema : proauth
Target Server Type : MySQL
Target Server Version : 100414
File Encoding : 65001
Da... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 16, 2020 at 03:26 AM
-- Server version: 5.7.26
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
CREATE TABLE IF NOT EXISTS user_genre_meta (
user INT,
genre VARCHAR(50),
amount_played INT,
PRIMARY KEY (user, genre),
FOREIGN KEY (user) REFERENCES Users(userId)
);
|
<filename>Utility Scripts/Collation Different From Default.sql
/*
Find databases and columns with collation different from the default
====================================================================
Author: <NAME>
Date: 2022-01-19
Description:
This script outputs 2 resultsets:
1. List of all accessible databases, ... |
<reponame>shenlanAZ/oauth2-client-demo
/*
Navicat MySQL Data Transfer
Source Server : 10.68.165.163_mariadb_3306
Source Server Type : MariaDB
Source Server Version : 100406
Source Host : 10.68.165.163:3306
Source Schema : oauth_client_demo
Target Server Type : MariaDB
Target Se... |
/*The products what each customer ordered */
Use [1645267]
SELECT FirstName
,LastName
,AddressLine1
,AddressLine2
,AddressLine3
Type
,Size
,Colour
,Text
,Quantity
FROM Customers
,Products |
create table users (
user_id integer constraint users_PK primary key,
token varchar(100) not null
);
create table user_sources (
user_id integer not null,
source varchar(100) not null,
UNIQUE (user_id, source)
); |
<filename>SupportManager/MemoEngine.Database/dbo/Stored Procedures/Schedule_GetSchedule.sql
--[5] 일정 출력 저장 프로시저 : GetSchedule
Create Proc dbo.GetSchedule
@SYear SmallInt,
@SMonth SmallInt,
@SDay SmallInt
As
Select [Num], [SYear], [SMonth], [SDay], [SHour], [Title], [Content], [PostDate] From Schedule
Where SYear... |
USE AdventureWorks2014
GO
CREATE USER extROUser
WITH PASSWORD = '<PASSWORD>'
GO
-- Add user to the database owner role
--EXEC sp_addrolemember N'db_owner', N'extROUser'
EXEC sp_addrolemember 'db_datareader', 'extROUser'
|
-- select bill.deptId from billitem join bill on billitem.bill_id = bill.`ID` where billitem.`ID` in
-- (SELECT bi.`ID` FROM billitem bi join bill b on bi.`BILL_ID`=b.`ID` join billfee bf on bi.`PAIDFORBILLFEE_ID`=bf.`ID`
-- WHERE b.`RETIRED`=false and b.`BILLTYPE`='PaymentBill'
-- group by bi.`PAIDFORBILLFEE_ID` , b... |
<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/current/5.0/tables/KC_TBL_IACUC_PROTOCOL_SUBMISSION.sql
CREATE TABLE IACUC_PROTOCOL_SUBMISSION (
IACUC_PROTOCOL_SUBMISSION_ID NUMBER(12,0) NOT NULL,
PROTOCOL_NUMBER VARCHAR2(20) NOT NULL,
SEQUENCE_NUMBER NUMBER(4,0) NOT NULL,
V... |
USE company_db;
INSERT INTO departments (`name`)
VALUES ("Marketing");
INSERT INTO departments (`name`)
VALUES ("Leadership");
INSERT INTO departments (`name`)
VALUES ("Accounting");
INSERT INTO departments (`name`)
VALUES ("R&D");
INSERT INTO roles (`title`, `salary`, `department_id`)
VALUES ("Engineer", 100000, 4);... |
<gh_stars>1-10
create table port
(
port_id INT8 primary key,
name TEXT,
latitude INT8,
longitude INT8,
offloadcapacity INT8,
offloadtime INT8,
harbordepth INT8,
available Bool);
create table ship (
ship_id INT8 primary key,
name TEXT,
cargo INT8,
latitude INT8,
longitude INT8,
length INT8,... |
GO
PRINT N'Dropping FK_AspNetUsers_Organisation...';
GO
ALTER TABLE [Identity].[AspNetUsers] DROP CONSTRAINT [FK_AspNetUsers_Organisation];
GO
PRINT N'Dropping FK_Organisation_Country...';
GO
ALTER TABLE [Business].[Organisation] DROP CONSTRAINT [FK_Organisation_Country];
GO
PRINT N'Dropping FK_Producer_Contact... |
<filename>EdFi.Ods.Utilities.Migration/Scripts/MsSql/02Upgrade/v25_to_v31/11 Create Constraints/41140 InterventionStudyPopulationServed [PK, IX, D].sql
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache ... |
select distinct City from Station where id%2 = 0; |
INSERT INTO zones VALUES('TEST123', 1, '{"coordinates":[{"latitude":42.27038021,"longitude":22.57638592},{"latitude":42.26137738,"longitude":22.57616159},{"latitude":42.26154334,"longitude":22.56404167},{"latitude":42.27054622,"longitude":22.56426427}],"id":"TEST123","locationId":1}') |
select name, default_service, description, kind, self_link, location, project, location_type, tests, path_matchers, host_rules
from gcp.gcp_compute_url_map
where name = '{{ resourceName }}' |
-- ETF can be called within following sub query expression:
-- IN/NOT IN, EXISTS / NOT EXISTS, ANY/SOME, ALL
-- ETF called in IN
SELECT * FROM t1 WHERE a IN (
SELECT b FROM transform(
TABLE(select a,e from t1
order by a
scatter randomly))
) AND a < 10 ORDER BY a, b;... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2016-10-31 10:26:44
-- 服务器版本: 10.1.16-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... |
<filename>sql/_07_misc/_01_statistics/cases/1010.sql
--[er]Optimizing class that don't exist using "update statistics" with "all" and "except" key
UPDATE STATISTICS ON ALL DCL1 (EXCEPT DCL2);
|
-- @testpoint:opengauss关键字binary(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists binary;
create schema binary;
--清理环境
drop schema binary;
--关键字带双引号-成功
drop schema if exists "binary";
create schema "binary";
--清理环境
drop schema "binary";
--关键字带单引号-合理报错
drop schema if exists 'binary';
--关键字带反引号-合理报错
drop schema if exi... |
<filename>src/server/sql/setup.sql<gh_stars>0
-- Creates the database
CREATE DATABASE
IF NOT EXISTS selfimprovement;
-- Handles premissions.
DROP USER IF EXISTS 'user'@'%';
GRANT ALL ON selfimprovement.* TO user@localhost
IDENTIFIED BY 'pass';
FLUSH PRIVILEGES;
|
<filename>db/seeds.sql
INSERT INTO burgers (burger_name)
VALUES ("Bacon Cheeseburger");
INSERT INTO burgers (burger_name)
VALUES ("Teriyaki Burger");
INSERT INTO burgers (burger_name)
VALUES ("Double Cheeseburger");
INSERT INTO burgers (burger_name)
VALUES ("Wagyu Burger"); |
<reponame>evandojunior/urbem3.0
CREATE OR REPLACE FUNCTION ppa.fn_verifica_homologacao(incodppa integer)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
DECLARE
reRegistro RECORD;
boRetorno BOOLEAN = false;
stSql VARCHAR := '';
tpTimestampPublica... |
<filename>SQLQueryT_Peoples.sql
CREATE DATABASE T_Peoples
USE T_Peoples
-- DDL
CREATE TABLE Funcionarios
(
IdFuncionario INT PRIMARY KEY IDENTITY
,Nome VARCHAR(255) NOT NULL
,Sobrenome VARCHAR(255) NOT NULL
)
-- DML
INSERT INTO Funcionarios (Nome, Sobrenome) VALUES ('Catarina','Strada')
,('T... |
/*
* TRUNCATE commands in correct order:
* execute these to revert to a certain state in the data import process.
* WARNING: Executing the entire script will empty all the tables!
* Normally you will want to pick just the necessary commands.
* Consider BEGINning a transaction first and only then ... |
--create database RIOT;
-- table to store all summoner information
create table `all_league_entry`(
`id` int not null auto_increment unique key,
`leagueId` varchar(255) comment 'league game ID',
`queueType` varchar(255) comment 'game queue type. i.e. rank solo5x5',
`tier` TINYTEXT comment 'rank tier. i... |
-- file:numeric_big.sql ln:252 expect:true
INSERT INTO num_exp_add VALUES (5,4,'5329378275943662669459614.8147569415958159607724254713329250286963073517290115704301037046761824454878689768482145781618983165207607197702579494848454960073617938963831930381747869394821538789450900950428766421347469320884702537438828616290... |
<reponame>Shuttl-Tech/antlr_psql
-- file:updatable_views.sql ln:63 expect:true
INSERT INTO rw_view14 VALUES (null, 3, 'Row 3')
|
<gh_stars>100-1000
CREATE TABLE list (id VARCHAR(64) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'ab', E'abhaščina');
INSERT INTO "list" ("id", "value") VALUES (E'ace', E'ačejščina');
INSERT INTO "list" ("id", "value") VALUES (E'ach', E'ačolijščina');
INSERT INTO... |
{% macro time_filter(column_name, column_type) %}
case when {{ re_data.is_datetime(column_type)}} = true
then
column_name
else
null
end
{% endmacro %}
{% macro time_window_start() %}
cast('{{- var('re_data:time_window_start') -}}' as timestamp)
{% endmacro %}
{% macro time_wi... |
<reponame>litijun/main<filename>message.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- 主机: localhost
-- 生成日期: 2021-06-06 16:34:51
-- 服务器版本: 8.0.24
-- PHP 版本: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
# rainfall.sql
# rainfall table: each record indicates date of measurement and amount
# of precipitation on that day.
# This file sets up the table and runs a self join to calculate
# running totals and averages for amount of precipitation each
# day, assuming no missing days. rainfall2.sql shows the calculations
# ... |
<reponame>Magaiwer/projetointegrador
insert into form(name, audit, description, entity_id) values ('Envio de arquivo servidor', true, 'Envio de arquivos para o servidor',14);
insert into permission(role,description,form_id) values('btnSendFile','Enviar arquivo servidor',13);
insert into permission(role,description,fo... |
<gh_stars>0
-- Copyright (C) 2001-2004 <NAME> <<EMAIL>>
-- Copyright (C) 2003 <NAME> <<EMAIL>>
-- Copyright (C) 2004-2009 <NAME> <<EMAIL>>
-- Copyright (C) 2004 <NAME> <<EMAIL>>
-- Copyright (C) 2004 <NAME> <<EMAIL>>
-- Copyright (C) 2005-2010 <NAME> <<EMAIL>>
-- Copyright (C) 2007 <... |
SELECT table_name
FROM dictionary
WHERE table_name like 'DBA/_HIST/_%' ESCAPE '/'
ORDER BY table_name; |
<gh_stars>1-10
CREATE PROCEDURE GPSQLWEB.PROCREADAA2TABCO ( IN P_TABTIP INTEGER,
IN P_TABNTI VARCHAR(40),
IN P_FIRSTRESULT INTEGER,
IN P_MAXRESULT INTEGER,
... |
Create VIEW [EntityCode].[SlotLocation]
AS
Select SL.SlotLocationId As [Id],
SL.SlotLocationKey As [Key],
S.SlotKey,
S.SlotName,
S.SlotDescription,
L.LocationKey,
L.LocationName,
L.LocationDescription,
IsNull(SL.LocationTypeKey,... |
<reponame>epmd-edp/admin-console
alter table codebase alter column framework set not null; |
<filename>src/main/resources/db/ddl.sql
create database if not exists selfblog;
use selfblog;
# 设置数据库不支持外键
SET FOREIGN_KEY_CHECKS=0;
drop table if exists blog;
drop table if exists blog_tag;
drop table if exists blog_tag_info;
drop table if exists role_permission;
drop table if exists role_permission_info;
drop... |
<filename>kata-files/lesson2/hsql/expected/MYLARGESCHEMA/sp/SP275.sql
CREATE PROCEDURE SP275(OUT MYCOUNT INTEGER) SPECIFIC SP275_96309 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE437;SELECT COUNT(*)INTO MYCOUNT FROM TABLE469;SELE... |
/* Should not add reset master in this file because it is used by binlog 999999 test */
drop database if exists `incremental_mode`;
create database `incremental_mode`;
use `incremental_mode`;
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');
|
<filename>presto-product-tests/src/main/resources/sql-tests/testcases/window_functions/rowsRangeLeadLag.sql
-- database: presto; groups: window;
select orderkey, suppkey,
discount,
lead(discount) over (partition by suppkey order by orderkey desc) next_discount,
extendedprice,
lag(extendedprice) over (partition by disco... |
<reponame>paffel2/testdb
insert into news(short_title,date_creation,author_id,category_id,news_text,main_image)
values ('New album', '2020-09-03',2,3,'It`d be easy to forget that Dethklok are seen as an animated band, since braintrust Brendon Small is such a skilled guitar player,
and the music isn`t secondary to the ... |
SELECT
4111 AS layer_code, 'natural' AS layer_class, 'peak' AS layer_name, feature_type AS gdal_type, osm_id, osm_way_id, osm_timestamp, all_tags, geometry
FROM `openstreetmap-public-data-prod.osm_planet.features`
WHERE EXISTS(SELECT 1 FROM UNNEST(all_tags) as tags WHERE tags.key = 'natural' AND tags.value='peak')
|
<filename>codebase/projects/core/db/SQLServer/csm/3_C3PRV2_auth_policy.sql
SET IDENTITY_INSERT csm_group ON
insert into csm_group(GROUP_ID,GROUP_NAME,GROUP_DESC,APPLICATION_ID,UPDATE_DATE)
values(2,'registrar','study coordinator group',1,GETDATE());
insert into csm_group(GROUP_ID,GROUP_NAME,GROUP_DESC,APPLICATION_... |
alter table cookie
drop primary key;
delete from cookie
where client_id is null or client_id = 'null' or client_id = 'NULL' or username is null or username = 'NULL' or username = 'null';
alter table cookie
add id int primary key auto_increment
first;
alter table cookie
add constraint fk_cookie_client_id_oaut... |
<reponame>JoshiDhima/Bathbot<gh_stars>0
DROP TABLE maps;
DROP TABLE mapsets;
DROP TABLE role_assigns;
DROP TABLE stream_tracks;
DROP TABLE bggame_scores;
DROP TABLE map_tags;
DROP TABLE guild_configs;
DROP TABLE osu_trackings;
DROP TABLE snipe_countries;
DROP TABLE user_configs;
DROP TABLE osekai_medals;
DROP TRIGGER ... |
<filename>phase 8/challenges/korning/schema.sql
-- DEFINE YOUR DATABASE SCHEMA HERE
DROP TABLE IF EXISTS employees;
CREATE TABLE employees (
id serial PRIMARY KEY,
first_name varchar(100),
last_name varchar(100),
email varchar(100)
);
DROP TABLE IF EXISTS customers;
CREATE TABLE customers (
id serial PRIM... |
<filename>db/seeds.sql
USE burgers_db;
INSERT INTO burgers (burger_name, devoured)VALUES
("Deluxe Chicken Burger", false),
("Double-Double Burger", false),
("Tuna Burger", false); |
<reponame>MobeenAftab/F20BD
-- This script will join customer, invoice and invoiceline into one table
SELECT
`customer`.`CustomerId`,
`customer`.`FirstName`,
`customer`.`LastName`,
`customer`.`Company`,
`customer`.`Address`,
`customer`.`City`,
`customer`.`State`,
`customer`.`Country`,
`... |
-- Drop tables insctruction
DROP TABLE IF EXISTS recipe_component;
DROP TABLE IF EXISTS recipe;
DROP TABLE IF EXISTS recipe_category;
DROP TABLE IF EXISTS material;
DROP TABLE IF EXISTS material_category;
DROP TABLE IF EXISTS material_spec;
DROP TABLE IF EXISTS material_category_type;
DROP TABLE IF EXISTS material_com... |
<filename>storage/database/countries/au.sql
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: Quickadclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @O... |
<gh_stars>0
--
-- Individual Segment
--
CREATE TABLE IF NOT EXISTS indiv_seg (
id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name TEXT NOT NULL,
description TEXT
)
WITH (FILLFACTOR=70);
--
-- Individual Segment Members (composed of `indiv` records)
--
... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... |
<gh_stars>0
sp_rename 'GameVersion_DownloadUri', 'GameVersion_Regulation'
GO
sp_rename 'GamingComponentVersion_DownloadUri', 'GamingComponentVersion_Regulation'
GO
ALTER PROCEDURE [dbo].[GetGamesVersionsAtDate] (@date datetime)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with S... |
<gh_stars>0
INSERT INTO article (id, title, image, content, tag, approve) VALUES (1, 'Article Title 1', 'https://placeimg.com/640/480/tech?1','Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor... |
<reponame>prasidh-agg/wavechat
-- CreateEnum
CREATE TYPE "UserRole" AS ENUM ('USER', 'ADMIN');
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"pk" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"email" TEXT NOT NULL,
"u... |
<filename>sql-hackerrank-solutions/aggregation/weather_observation-_20.sql<gh_stars>0
/*
Enter your query here.
*/
-- select COUNT(*) from STATION order by id;
SELECT ROUND(LAT_N, 4)
FROM STATION
ORDER BY LAT_N
limit 1 offset 249;
|
<reponame>MS-BI/JobExceutionFramework
CREATE VIEW [catalog].[operations]
AS
SELECT [operation_id],
[operation_type],
[created_time],
[object_type],
[object_id],
[object_name],
[status],
[start_time],
[end_time],
... |
<filename>user_guide/documentation/tbl_presupuesto.sql
CREATE TABLE `tbl_presupuesto` (
`id` int(11) NOT NULL,
`nombre` varchar(255) COLLATE utf8_bin NOT NULL,
`email` varchar(255) COLLATE utf8_bin NOT NULL,
`material` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`alto` int(4) DEFAULT NULL,
`ancho` int(4) DE... |
<filename>src/test/resources/sql/alter_function/b157a725.sql<gh_stars>10-100
-- file:create_function_3.sql ln:128 expect:true
ALTER FUNCTION functext_F_2(int) STRICT
|
<gh_stars>10-100
-- file:jsonb.sql ln:620 expect:true
SELECT jsa FROM jsonb_populate_record(NULL::jsbrec, '{"jsa": ["aaa", null, [1, 2, "3", {}], { "k" : "v" }]}') q
|
SELECT Name FROM Foo
WHERE ISNULL(ID, 0) != 0 |
<gh_stars>1000+
-- 11.03.2016 15:27
-- URL zum Konzept
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-03-11 15:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554154
;
-- 11.03.2016 15:29
-- URL zum Konzept
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-03-11 15:29:46... |
<filename>db/src/main/resources/org/kuali/kpme/kpme-db/db/rice/2.2.1/oracle/update_final_oracle.sql
--
-- Copyright 2004-2014 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a ... |
alter session set "_ORACLE_SCRIPT"=true;
CREATE VIEW viewNHANVIEN
AS
SELECT *
FROM dbaDuAn.NHANVIEN;
CREATE OR REPLACE FUNCTION funcNHANVIEN (obj_schema varchar2, obj_name varchar2)
RETURN varchar2 IS
user varchar2 (20);
BEGIN
user := SYS_CONTEXT ('userenv', 'SESSION_USER');
RETURN 'maNV = ' || ''''... |
ALTER PROCEDURE [dbo].GetAllProject
@PageNumber INT = 1,
@PageSize INT = 100,
@Id NVARCHAR (MAX)
AS
BEGIN
SELECT P
FROM [dbo].Projects P RIGHT JOIN [dbo].MembersProject M
ON P.[Id] = M.[IdProject] AND M.[IsActiveMember] = 1 AND (P.[Admin] = @Id OR @Id = M.[IdUser])
WHE... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 15 mars 2021 à 22:50
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
<reponame>liangry/sqlparser
SELECT * FROM t WHERE NOT (c IN (SELECT c FROM u)) |
select name, description
from gcp.gcp_compute_address
where title = '{{resourceName}}' |
create table meta_data(
id int not null primary key,
content BLOB not null
);
create table structured_item(
id TEXT not null primary key,
type int not null,
meta BLOB not null,
content BLOB not null
);
create table album(
id TEXT not null primary key,
content BLOB not null
);
-- https://github.com/te... |
CREATE EXTENSION IF NOT EXISTS pg_plan_tree_dot;
DROP TABLE IF EXISTS test;
CREATE TABLE test (id1 INTEGER, id2 INTEGER);
INSERT INTO test VALUES (11, 10);
-- SELECT NULLIF(id1, id2) FROM test
SELECT generate_plan_tree_dot('SELECT NULLIF(id1, id2) FROM test', 'sample-nullif.dot');
DROP TABLE test;
|
-- @testpoint: set:psort,btree,gist不支持FASTUPDATE
DROP TABLE if EXISTS test_index_table_127 CASCADE;
create table test_index_table_127(
c_float1 float
) WITH (ORIENTATION = column) ;
--建psort+gist索引
drop index if exists index_127_01;
create index index_127_01 on test_index_table_127 using psort(c_float1) ;
select rel... |
<gh_stars>0
/*Bugs **=supposedly fixed
**The tourism from the hermitage beleif if secondary religion isn't added
Tooltip stuff:
BuildingClassHappiness from secondary religion works but is not displayed in the tooltip on buildings (only in local happiness)
Extra yields from secondary religion aren't displayed on the bui... |
--
-- Script
--
--
-- Migration
--
INSERT INTO ##SCRIPTTABLE## ([FileName])
VALUES ('##FILENAME##'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.