sql stringlengths 6 1.05M |
|---|
INSERT INTO User_Interest_Subcategory VALUES ( 'b9aa58758366e5a3e5552aaf74ba67b0', 'TV', 'Mystery', 'dislike' );
INSERT INTO User_Interest_Subcategory VALUES ( 'ef4d4c149b42aa44891850c3403d6d66', 'TV', 'Reality-TV', 'like to try' );
INSERT INTO User_Interest_Subcategory VALUES ( '07430cec0f0b8d8cfeef127b2bd8737a', 'TV'... |
<reponame>FranzJr/Battleship-API<filename>FIELDS.sql
INSERT INTO `battlefield`.`field` (`x`, `y`) VALUES ('0', '0');
INSERT INTO `battlefield`.`field` (`x`, `y`) VALUES ('0', '1');
INSERT INTO `battlefield`.`field` (`x`, `y`) VALUES ('0', '2');
INSERT INTO `battlefield`.`field` (`x`, `y`) VALUES ('0', '3');
INSERT INTO... |
<filename>api/db/migrations/20211030231000_add_user_auth/migration.sql
/*
Warnings:
- You are about to drop the `UserExample` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `UserExample`;
-- CreateTable
CREATE TABLE `User` (
`id` INTEGER NOT NULL AUTO_INCR... |
USE Master_CarManager
DROP TRIGGER InsteadOfDeleteUser
GO
CREATE TRIGGER InsteadOfDeleteUser ON Users INSTEAD OF DELETE AS RETURN
GO
DROP TRIGGER InsteadOfDeleteCar
GO
CREATE TRIGGER InsteadOfDeleteCar ON Cars INSTEAD OF DELETE AS
BEGIN
UPDATE CARS SET ACTIVE = 0 WHERE CarId in (SELECT CarId FROM deleted)
END;
G... |
<gh_stars>0
ALTER TABLE users
ADD COLUMN email VARCHAR(255) NOT NULL,
ADD COLUMN is_admin SMALLINT DEFAULT 0,
ADD CONSTRAINT unique_email UNIQUE (email);
|
<reponame>fahre3koma2/siap<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2020 at 05:20 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>src/nut/auth/mysql/up.sql
CREATE TABLE users(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
real_name VARCHAR(32) NOT NULL,
nick_name VARCHAR(32) NOT NULL,
email VARCHAR(255) NOT NULL,
password BLOB,
uid VARCHAR(36) NOT NULL,
provider_type VARCHAR(16) NOT NULL,
provider_id VARCHAR(255) NOT NU... |
<reponame>devansh-pratap-singh/hackerrank-solutions
SELECT * FROM CITY
WHERE COUNTRYCODE = 'JPN' |
create or replace transient table "AIRBYTE_DATABASE".TEST_NORMALIZATION."CONFLICT_STREAM_NAME_CONFLICT_STREAM_NAME_CONFLICT_STREAM_NAME" as
(
-- Final base SQL model
select
_AIRBYTE_CONFLICT_STREAM_NAME_2_HASHID,
GROUPS,
_airbyte_emitted_at,
_AIRBYTE_CONFLICT_STREAM_NAME_3_HASHID
from "AI... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6
-- Dumped by pg_dump version 10.5
-- Started on 2018-06-18 13:13:03 EDT
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_ca... |
<reponame>smith750/kc
-- KEW data for Proposal Development Person Certification Questionnaire
INSERT INTO KREW_ACTN_RQST_S VALUES (NULL);
INSERT INTO KREW_ACTN_RQST_T (ACTN_RQST_ID,ACTN_RQST_CD,DOC_HDR_ID,STAT_CD,RSP_ID,PRNCPL_ID,RECIP_TYP_CD,PRIO_NBR,RTE_LVL_NBR,RTE_NODE_INSTN_ID,ACTN_TKN_ID,DOC_VER_NBR,CRTE_DT,RSP_D... |
-- 1. Create a view mpeg_tracks that displays all tracks with MPEG audio
-- format. Display track name (track_name), artist name (artist_name),
-- composer, album title (album_title), and media type (media_type). Sort
-- results in alphabetical order by track name.
CREATE VIEW mpeg_tracks AS
SELECT
tracks.name AS trac... |
IF OBJECT_ID('tSQLt.Private_SysTypes') IS NOT NULL DROP VIEW tSQLt.Private_SysTypes;
GO
---Build+
GO
CREATE VIEW tSQLt.Private_SysTypes AS SELECT * FROM sys.types AS T;
GO
IF(CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(MAX)) LIKE '9.%')
BEGIN
EXEC('ALTER VIEW tSQLt.Private_SysTypes AS SELECT *,0 is_table... |
CAST(MD5_BINARY(NULLIF(CONCAT_WS('||',
IFNULL(NULLIF(UPPER(TRIM(CAST(CUSTOMER_ID AS VARCHAR))), ''), '^^'),
IFNULL(NULLIF(UPPER(TRIM(CAST(PHONE AS VARCHAR))), ''), '^^'),
IFNULL(NULLIF(UPPER(TRIM(CAST(DOB AS VARCHAR))), ''), '^^')
), '^^||^^||^^')) AS BINARY(16)) AS CUSTOMER_PK |
DECLARE @counter smallint;
DECLARE @centerLat float;
DECLARE @centerLon float;
DECLARE @centerOffset float;
-- Customize centerLat and centerLon to your location
-- to get working examples.
--
-- Do not forget to also set this as the base of the grid overlay in
-- AreaAggregation.fs (search for "gridBase")
SET @center... |
<gh_stars>1-10
CREATE TABLE "CTCOLLECTION_CDE"
( "COLLECTION_CDE" VARCHAR2(10) NOT NULL ENABLE,
CONSTRAINT "PK_CTCOLLECTION_CDE" PRIMARY KEY ("COLLECTION_CDE")
USING INDEX ENABLE
) |
/****************************************************************
* Update the password for the root user (only necessary for Mac)
*****************************************************************/
-- this works with MySQL 5.5 and earlier
-- UPDATE mysql.user
-- SET Password=PASSWORD("<PASSWORD>")
-- WHERE User='root'... |
ALTER TABLE "public"."reviews" DROP COLUMN "reviewstate_abbrev"; |
CREATE PROCEDURE [sp_upd_Unit] (
@UnitID int,
@Name nvarchar(50)
)
AS
UPDATE [dbo].[Unit] SET
[Name] = @Name
WHERE
([UnitID] = @UnitID) |
-- How to identify group usage in JIRA
-- https://confluence.atlassian.com/jirakb/how-to-identify-group-usage-in-jira-441221524.html
/*
* All queries below were composed for PostgreSQL databases
and may need slight syntax adjustments depending on the DBMS JIRA's database is based on.
Replace ('helpdesk', 'admi... |
-- Script to migrate Q Capture control tables from V8.2 to V9.1.
--
-- Prior to running this script, customize it to your existing
-- Q Capture server environment:
-- (1) Locate and change all occurrences of the string !capschema!
-- to the name of the Q Capture schema applicable to your
-- environment
--
-- ... |
USE slow_query_log;
CREATE TEMPORARY TABLE `slow_query_log`.`statements_temp`
SELECT * FROM performance_schema.events_statements_summary_by_digest;
INSERT INTO `slow_query_log`.`events_statements` (DIGEST, DIGEST_TEXT, first_seen, last_seen)
SELECT DIGEST, DIGEST_TEXT, FIRST_SEEN, LAST_SEEN
FROM `slow_query_log`.`sta... |
DROP VIEW IF EXISTS view_beban_barang4_setda;
CREATE VIEW view_beban_barang4_setda AS
SELECT
*,
beban * harga AS jumlah_harga
FROM
view_beban_barang3_setda
WHERE
1 = 1 AND
beban > 0 AND
id_skpd = 2;
GRANT ALL PRIVILEGES ON view_beban_barang4_setda TO lap_setda;
REVOKE INSERT, UPDATE, DELETE ON view_beban_barang... |
<filename>sql/tortugas.sql
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: localhost Database: tortugas
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
<filename>src/test/regress/sql/hw_partition_interval_parallel_end.sql<gh_stars>100-1000
-- check results and clean
select count(*) from partition_interval_parallel;
select relname, parttype, partstrategy, boundaries, indisusable from pg_partition
where parentid = (select oid from pg_class where relname = 'partition_in... |
/*
* This file is used to test the function of vecexpression.cpp --- test(1)
*/
/*******************************
Expression Type:
T_Var,
T_Const,
T_Param,
T_Aggref,
T_WindowFunc,
T_ArrayRef,
T_FuncExpr,
T_NamedArgExpr,
T_OpExpr,
T_DistinctExpr,
T_NullIfExpr,
T_ScalarArrayOpExpr,
T_BoolExpr,
T_SubLink,
... |
<reponame>Sotirovgym/Databases-Basics-MS-SQL-Server-2017<filename>Triggers and Transactions/TriggersAndTransactions.sql<gh_stars>0
--1. Create Table Logs
CREATE TRIGGER tr_ProcessTransaction
ON Accounts
AFTER UPDATE
AS
BEGIN
INSERT INTO Logs (AccountId, OldSum, NewSum)
SELECT i.Id, d.Balance, i.Balance FROM inserted ... |
--Anonymer Block mit Parametern
DO(IN iv_status INT => 1,
OUT ot_aufgaben TABLE ( id INT,
titel NVARCHAR(40) ) => ?)
BEGIN
ot_aufgaben = SELECT id,
titel
FROM aufgaben
WHERE STATUS = :iv_status;
END; |
create
database forest default character set utf8mb4 collate utf8mb4_unicode_ci;
use
forest;
create table forest_article
(
id bigint auto_increment comment '主键'
primary key,
article_title varchar(128) null comment '文章标题',
article_thumbnail_url varchar(128) null com... |
/*
Warnings:
- You are about to drop the `UserExample` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "UserExample";
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"hashedPassword" TEXT NOT NULL,
"salt" TEXT N... |
<reponame>edelmoedig/ProcessEnacting-IAIB2020<filename>db/processes_rights.sql
CREATE USER process_administrator;
CREATE USER process_user;
-- Revoke rights
REVOKE CONNECT, TEMP ON DATABASE processes FROM PUBLIC;
REVOKE CREATE, USAGE ON SCHEMA public FROM PUBLIC;
REVOKE CREATE, USAGE ON SCHEMA processes FROM... |
<reponame>sdc-cherry/reviews-api
CREATE TABLE IF NOT EXISTS Product(
ID SERIAL PRIMARY KEY,
name VARCHAR(250) NOT NULL,
slogan TEXT,
description TEXT,
category TEXT,
defaultPrice DECIMAL
);
CREATE TABLE IF NOT EXISTS Review(
ID SERIAL PRIMARY KEY,
product_id INT,
CONSTRAINT product_id
FOREIGN KE... |
SELECT
CONCAT(id, ' ', username) AS id_username, email
FROM
users AS u
JOIN
users_photos AS up ON u.id = up.user_id
WHERE
up.user_id = up.photo_id
ORDER BY u.id |
CREATE VIEW [dbo].[refuel_transactions_v]
AS
SELECT dbo.refuel_transactions.gas_station_id, dbo.refuel_transactions.refuel_id, dbo.refuel_transactions.doc_no, dbo.refuel_transactions.doc_date, dbo.refuel_transactions.vehicle_id,
dbo.refuel_transactions.driver_id, dbo.refuel_transaction... |
<filename>toko1.sql
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2018 at 07:27 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 30, 2020 at 12:31 AM
-- Server version: 5.7.29-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!401... |
DROP SEQUENCE {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
|
-- Adminer 4.7.7 PostgreSQL dump
DROP TABLE IF EXISTS "tb_filial";
CREATE TABLE "public"."tb_filial" (
"id_filial" integer NOT NULL,
"nome" character varying(255) NOT NULL,
CONSTRAINT "tb_filial_pkey" PRIMARY KEY ("id_filial")
) WITH (oids = false);
INSERT INTO "tb_filial" ("id_filial", "nome") VALUES
(1,... |
CREATE TABLE `Bees` (
id int PRIMARY KEY,
color int,
hive_id int UNIQUE REFERENCES Hives(id)
);
|
CREATE TABLE [dbo].[HOUSE_TYPES] (
[ID] BIGINT NOT NULL,
[NAME] VARCHAR (50) NOT NULL,
[SHORTNAME] VARCHAR (50) NULL,
[DESC] VARCHAR (250) NULL,
[UPDATEDATE] DATETIME NOT NULL,
[STARTDATE] DATETIME NOT NULL,
[ENDDATE] DATETIME NOT NULL,
[... |
CREATE SCHEMA IF NOT EXISTS exchange;
CREATE TABLE IF NOT EXISTS exchange.sessions (
beginstring CHAR(8) NOT NULL,
sendercompid VARCHAR(64) NOT NULL,
sendersubid VARCHAR(64) NOT NULL,
senderlocid VARCHAR(64) NOT NULL,
targetcompid VARCHAR(64) NOT NULL,
targetsubid VARCHAR(64) NOT NULL,
targetlocid VARCHA... |
<filename>src/test/resources/limit.test_26.sql<gh_stars>100-1000
-- limit.test
--
-- execsql {
-- SELECT x FROM t3 LIMIT 2 OFFSET 10000
-- }
SELECT x FROM t3 LIMIT 2 OFFSET 10000 |
CREATE TABLE users (
id SERIAL PRIMARY KEY,
lic_id bytea,
lic_data bytea,
hostname VARCHAR(260),
first_seen TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX user_rec ON users(lic_id,lic_data,hostname);
CREATE UNIQUE INDEX user_hn_null ON users (lic_id,lic_data, (hostname IS NULL)... |
use bank;
#Find out how many cards of each type have been issued.
SELECT type, COUNT(type)
FROM card
GROUP BY type;
#Find out how many customers there are by the district.
SELECT district_id, COUNT(district_id)
FROM client
GROUP BY district_id
ORDER BY district_id;
#Find out average transaction value by type.
SELECT... |
UPDATE `creature_template` SET `ScriptName`='npc_skorn_whitecloud' WHERE `entry`=3052;
UPDATE `creature_template` SET `ScriptName`='npc_blood_knight_stillblade' WHERE `entry`=17768;
|
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE burgers (
id INT NOT NULL AUTO_INCREMENT,
burger_name VARCHAR(30),
devoured BOOLEAN,
PRIMARY KEY(id)
); |
select min(c_bigint) over(partition by c_timestamp) from j8;
|
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[PersonDetailsView]'))
DROP VIEW [dbo].[PersonDetailsView]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[PersonDetailsView]
AS
SELECT
P.Id,
CAST(DECRYPTBYKEY(FirstName) AS VARCHAR(50)) AS FirstName,
CAST(DECR... |
/*
* SQL to create table SubEvent and associated indexes.
* Assumes table does not already exist.
*
* MAK 21-07-2017: First version
*/
CREATE TABLE SubEvent(
EventTypeID VARCHAR(20) NOT NULL,
SubID VARCHAR(20) NOT NULL,
CONSTRAINT PK_Event PRIMARY KEY (EventTypeID, SubID)
);
CREATE INDEX idx_type
ON SubEv... |
<gh_stars>1-10
SELECT '===Ordinary case===';
SET replication_alter_partitions_sync = 2;
DROP TABLE IF EXISTS clear_column;
CREATE TABLE clear_column (d Date, num Int64, str String) ENGINE = MergeTree(d, d, 8192);
INSERT INTO clear_column VALUES ('2016-12-12', 1, 'a'), ('2016-11-12', 2, 'b');
SELECT data_uncompresse... |
DROP INDEX statistics_sort_iq_desc;
|
select
{{ dbt_utils.surrogate_key([
'grades.student_section_association_reference.school_id',
'grades.grading_period_reference.school_year'
]) }} as school_key,
{{ dbt_utils.surrogate_key([
'grades.student_section_ass... |
<reponame>ecktom/steampipe-mod-aws-compliance<gh_stars>100-1000
with trails_enabled as (
select
arn,
is_logging
from
aws_cloudtrail_trail
where
home_region = region
)
select
-- Required Columns
a.arn as resource,
case
when b.is_logging is null and a.is_logging then 'ok'
when b.is_log... |
<filename>apgdiff.tests/src/main/resources/cz/startnet/utils/pgdiff/multiple_schemas_new.sql
--
-- PostgreSQL database dump
--
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: SCHEMA ... |
<reponame>mig5/hydra
ALTER TABLE hydra_client DROP COLUMN metadata;
|
-- Add column is_inheritable on table extra_prop_entry:
alter table extra_prop_entry add(is_inheritable char(1) default 'N' not null);
-- Add index for new column is_inheritable on table extra_prop_entry:
-- Drop first, since we have had an historic index with the same name before (for prop_type_id fk constraint):
dr... |
CREATE TABLE account (
id SERIAL PRIMARY KEY,
username VARCHAR(128) NOT NULL,
"firstName" VARCHAR(128) NOT NULL,
surname VARCHAR(128) NOT NULL,
email VARCHAR(128) NOT NULL,
password VARCHAR(128) NOT NULL,
"userRole" VARCHAR(128) NOT NULL DEFAULT 'User',
created_date TIMESTAMP,
modified_d... |
<reponame>KukuhFajarr/Learn_CI3
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Jul 2020 pada 09.56
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+0... |
WITH s1 AS (
SELECT
1 AS duration,
'month' AS period
),
p1 AS (
SELECT
s1.duration,
s1.period,
CURRENT_TIMESTAMP AS CURRENT,
date_trunc(s1.period,
CURRENT_TIMESTAMP) AS "currentPeriod",
date_trunc(s1.period,
CURRENT_TIMESTAMP) - CAST(s1.duration || ' ' || s1.period AS Interval) AS "priorPeriod"
F... |
<reponame>AlexStibbons/Korzo
use korzo;
insert into film (title, year, domestic, storage) values ("aabc la", 2019, false, "cd1");
insert into film (title, year, domestic, storage) values ("fbf la", 2010, true, "cd1");
insert into film (title, year, domestic, storage) values ("zzz", 1994, true, "cd1");
insert into fil... |
<filename>csl/assets/docs/SQL_GENDER.sql
SELECT SQL_CACHE
r.meta_key AS meta_key,
g.meta_key AS s_gender,
g.meta_value,
COUNT(DISTINCT g.post_id) AS n_records
FROM
wpaef_xtr_vw_postmeta_referenced AS r
LEFT JOIN
(
SELECT
post_id,
met... |
DELETE Issues
WHERE RepositoryId = (SELECT Id FROM Repositories
WHERE Name = 'Softuni-Teamwork')
DELETE RepositoriesContributors
WHERE RepositoryId = (SELECT Id FROM Repositories
WHERE Name = 'Softuni-Teamwork')
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 01, 2021 at 06:39 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.2.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
CREATE TABLE "btcategory" (
"id" SERIAL PRIMARY KEY,
"name" TEXT NOT NULL
);
CREATE TABLE "btdeliveryadress" (
"id" SERIAL PRIMARY KEY,
"address" TEXT NOT NULL,
"town" TEXT NOT NULL,
"zip_code" TEXT NOT NULL,
"name" TEXT NOT NULL,
"surname" TEXT NOT NULL,
"contact_phone" TEXT NOT NULL,
"currently_a... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2020 at 04:23 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : tp6
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 30/0... |
INSERT INTO `book` (`id`, `autor`, `lancamento`, `preco`, `titulo`) VALUES
(1, 'diabo', '2021/03/03', 24.9, 'Costa'),
(2, 'dia', '2021/03/03', 24.9, 'Costa'),
(3, 'diab', '2021/03/03', 24.9, 'Costa');
|
CREATE TABLE `m_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`article_id` int(11) DEFAULT NULL,
`content` text,
`root_id` int(11) DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`upd_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`del_... |
-- Create Table With Constraints
CREATE TABLE person (
id BIGSERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
gender VARCHAR(7) NOT NULL,
date_of_birth DATE NOT NULL,
email VARCHAR(150)
);
\d
\d person
|
<reponame>timshadel/subdivision-list
CREATE TABLE subdivision_SK (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_SK" ("id", "name", "level") VALUES (E'SK-BC', E'Regiunea Banská Bystrica', E'region');
INSERT INTO "subdivision_SK" ("id", "name", "level")... |
INSERT INTO public.car (brand,created_date_time,is_available_sale,model_year,"name",price) VALUES
('Ferrari','2019-12-17 11:07:52.952',false,'2007-01-01','Ferrari 488',7245262542.00)
,('Porsche','2019-12-17 11:09:44.859',true,'2008-01-01','Porsche 718 Cayman',3245262542.00)
,('Bugatti','2019-12-17 11:10:48.841',false,'... |
<filename>modules/classic/fixtures/api.sql
UPDATE s_core_auth SET apiKey = "demo" WHERE username LIKE "demo" |
ALTER TABLE scm_git_hot_file
MODIFY module_name varchar(1024) null;
ALTER TABLE scm_git_hot_file
MODIFY repo varchar(256) null;
ALTER TABLE scm_git_hot_file
MODIFY class_name varchar(256) null; |
drop table apps.FND_MENU_ENTRIES_L4;
-- Create table
create table apps.FND_MENU_ENTRIES_L4
(
user_menu_name VARCHAR2(80) not null,
entry_sequence NUMBER not null,
prompt VARCHAR2(60),
menu_id NUMBER,
sub_menu_name VARCHAR2(80),
menu_creation_date DATE... |
/*
* Copyright 2011-2020 The OTP authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pu... |
-- // create plan processing status table
-- Migration SQL that makes the change goes here.
CREATE TABLE core.plan_processing_status
(
id bigserial NOT NULL,
plan_id bigint REFERENCES core.plan(id),
event_id bigint NOT NULL REFERENCES core.event(id),
template_id bigint REFERENCES core.template(id),
s... |
DELIMITER $$
DROP FUNCTION IF EXISTS `url_decode` $$
CREATE DEFINER=`root`@`%` FUNCTION `url_decode`(original_text TEXT) RETURNS TEXT CHARSET utf8
BEGIN
DECLARE new_text TEXT DEFAULT NULL;
DECLARE pointer INT DEFAULT 1;
DECLARE end_pointer INT DEFAULT 1;
DECLARE encoded_text TEX... |
-- 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 License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
-- Alter Table edfi.Parent---
ALTER TABLE edfi.Pa... |
insert into customer (id, name) values (1, 'Skatteetaten'); |
<gh_stars>0
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2019] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-... |
alter table message add conversation TEXT; |
<filename>schema/verify/database_functions/dd_enum_comparison_operators.sql
-- verify ggircs-portal:enum_operators on pg
begin;
select pg_get_functiondef('ggircs_portal_private.add_enum_comparison_operators(text)'::regprocedure);
rollback;
|
--------------------------------------------------------
-- DDL for Schema AWE
--------------------------------------------------------
CREATE SCHEMA AWE;
--------------------------------------------------------
-- DDL for Table AweAppPar
-- Application parameters table: Allows to configure specific parameters in t... |
-- Check all available databases
SHOW DATABASES;
-- Use the sample database
USE classicmodels;
-- SQL query
-- In the employees table, find the first name, last name, and job title of all employees.
-- The schema of employees can be found in the lecture slides.
-- We provide the first example, you can click Query | E... |
CREATE TABLE game_states (
player_id VARCHAR(20) PRIMARY KEY NOT NULL,
state JSONB,
FOREIGN KEY (player_id) REFERENCES users(id) ON DELETE CASCADE
);
--;;
CREATE TABLE game_statistics (
player_id VARCHAR(20) PRIMARY KEY NOT NULL,
statistics JSONB,
FOREIGN KEY (player_id) REFERENCES users(id) ON DELETE CASCAD... |
{# Tests:
1 - Find all enabled models with the snowplow_web_incremental tag
2 - Find subset of enabled and tagged models using the dbt ls command. Performed via bash script
3 - Test error message for untagged models. Performed by changing 'tag_var' via bash script. #}
{{ config(tags=["requires_script"]) }}
{... |
create table ${ohdsiSchema}.COHORT
(
COHORT_DEFINITION_ID int NOT NULL,
SUBJECT_ID bigint NOT NULL,
cohort_start_date date NOT NULL,
cohort_end_date date NOT NULL
);
create table ${ohdsiSchema}.heracles_analysis
(
analysis_id int,
analysis_name varchar(255),
stratum_1_name varchar(255),
stratum_2_name varcha... |
DROP PROCEDURE IF EXISTS normalize_provision_request;
DELIMITER //
CREATE PROCEDURE normalize_provision_request()
BEGIN
SET @col_exists = 0;
SELECT 1
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'provision_request'
AND column_name = 'service_id'
AND table_schema = database... |
alter table waitinglist
drop column invited_at,
drop column ignored; |
-- @author prabhd
-- @created 2014-04-01 12:00:00
-- @modified 2012-04-01 12:00:00
-- @tags dml MPP-21090 ORCA
-- @product_version gpdb: [4.3-]
-- @optimizer_mode on
-- @description Tests for MPP-21090
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS changedistpolic... |
<reponame>babelfish-for-postgresql/babelfish_extensions
CREATE DATABASE db_babel_3166;
go
USE db_babel_3166;
go
-- function
CREATE FUNCTION babel_3166_func(@a numeric, @b varchar, @c varchar(max), @d varchar(8), @e binary(6))
RETURNS varbinary(8) AS BEGIN RETURN @e END;
go
-- Look at the probin for typmod informatio... |
<gh_stars>1-10
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `behaviour_composer_schema2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
SHOW WARNIN... |
DROP FUNCTION IF EXISTS get_form_operations(TEXT);
CREATE FUNCTION get_form_operations(p_form_id TEXT) RETURNS SETOF form_processor_xformoperationsql AS $$
BEGIN
RETURN QUERY
SELECT * FROM form_processor_xformoperationsql WHERE form_id = p_form_id ORDER BY date ASC;
END;
$$ LANGUAGE plpgsql;
|
<reponame>vithep/NoSQL
--------------------------------
--------EXERCICIO DO PROJETO 01
--------------------------------
-- AGRUPE OS ELEMENTOS
-- TEM CHAVE E VALOR? É UM DICIONARIO {}
-- TEM MAIS DE UM? É UM VETOR! []
-- OS ELEMENTOS DO VETOR SAO APENAS VALORES? É UM VETOR SUMPLES [A,B,C]
-- DENTRO DO VETOR TEM CHAVE... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 07, 2018 at 01:24 AM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.0.27-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
<filename>sql/books.sql
/*==============================================================*/
/* 图书列表表 */
/*==============================================================*/
DROP TABLE IF EXISTS `book_category`;
CREATE TABLE `book_category` (
`category_id` int(11) NOT NULL AUTO_INCR... |
<filename>ISG_leier_billboard/Database1/dbo/Tables/progresses.sql
CREATE TABLE [dbo].[progresses] (
[interval] INT NULL,
INDEX [GRAPH_UNIQUE_INDEX_335F36D570D747008869FDFA3F9F5F19] UNIQUE NONCLUSTERED ($edge_id)
) AS EDGE;
|
Question 1
select count(*) from survey_responders
Question 2
select * from survey_responders
Question 3
select count(*) from survey_questions
Question 4
select question from survey_questions
Question 5
select count(province) from survey_responders where province = 'Alberta'
Question 6
select count(survey_response)... |
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
DROP TABLE IF EXISTS department;
DROP TABLE IF EXISTS role;
DROP TABLE IF EXISTS employee;
CREATE TABLE department (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
dept_name VARCHAR(30) NOT NULL
);
CREATE TABLE role (
id INTEGER PRIMAR... |
SELECT usage FROM sample WHERE percentile(usage) > 0.95 INTO OUTFILE '20.csv';
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.