sql stringlengths 6 1.05M |
|---|
<filename>ScriptBanco/Criacao_das_tabelas.sql
CREATE TABLE tb_usuario (
id_usuario SERIAL,
email VARCHAR(50) UNIQUE NOT NULL,
nome VARCHAR(50) NOT NULL,
senha VARCHAR(50) NOT NULL,
CONSTRAINT pk_tb_usuario_id_usuario
PRIMARY KEY(id_usuario... |
<filename>form/employee_account.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 20, 2018 at 10:15 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<gh_stars>0
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
----- vwCustomerDashBase View Creation Script ---------------... |
-- A GROUPING SETS query that shows the average of spread and indexrate on region, province and year. Taking only the combination that are required.
SELECT b.region, b. province, c.customer_type , d.year ,avg(s.spread) as "mean Spread", avg(s.index_rate) as "mean IndexRate"
FROM sale s, customer c, br... |
<filename>db/dml/sp/SP_complete_booking.sql
/******************************************************
NAME: SP_complete_booking
FUNCTION: Create new bookings
MySql > CALL SP_complete_booking(?,?)
FIRST CREATED: 20211117
UPDATED: 20211117
*****************************************... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 28, 2018 at 06:58 AM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<reponame>yeojin-dev/coding-test
SET sql_mode = '';
SELECT start_date, end_date
FROM (SELECT start_date FROM projects WHERE start_date NOT IN (SELECT end_date FROM projects)) AS a,
(SELECT end_date FROM projects WHERE end_date NOT IN (SELECT start_date FROM projects)) AS b
WHERE start_date < end_date
GROUP BY start_dat... |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = dis, pg_catalog;
--
-- Name: test; Type: VIEW; Schema: dis; Owner:... |
-- MySQL dump 10.13 Distrib 8.0.19
--
-- Host: 127.0.0.1 Database: rest
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATIO... |
<gh_stars>1-10
CREATE TABLE [tSQLt].[Private_ExpectException]
(
[i] [int] NULL
) ON [PRIMARY]
GO
|
<reponame>Shuttl-Tech/antlr_psql
-- file:timetz.sql ln:21 expect:true
INSERT INTO TIMETZ_TBL VALUES ('15:36:39 America/New_York')
|
<gh_stars>0
CREATE TABLE plugins_signaux
-- Association entre plugins et signaux (hooks)
(
signal TEXT NOT NULL,
plugin TEXT NOT NULL REFERENCES plugins (id),
callback TEXT NOT NULL,
PRIMARY KEY (signal, plugin)
);
CREATE TABLE compta_rapprochement
-- Rapprochement entre compta et relevés de comptes
(
... |
ALTER TABLE users ADD COLUMN token TEXT;
|
<filename>mssql/05_PK/drop_constraints.sql<gh_stars>1-10
/******************************************************/
/****************** DROP CONSTRAINTS ***********************/
/******************************************************/
alter table TestTable drop constraint pk_TestTable_id |
-- name: CreateUser :exec
INSERT INTO
user (username, email, password, created_at)
VALUES ($1, $2, $3, $4); |
<reponame>dunarel/dunphd-thesis<gh_stars>0
select hpc.id,
hpc.gene_id,
count(*)
from hgt_par_contins hpc
join HGT_PAR_FRAGMS hpf on hpf.hgt_par_contin_id = hpc.id
group by hpc.id,
hpc.gene_id
order by hpc.gene_id,
hpc.id |
USE AdventureWorks2017;
GO
SET SHOWPLAN_ALL ON;
GO
SELECT BusinessEntityID , NationalIDNumber, LoginID, HireDate, JobTitle
FROM HumanResources.Employee
WHERE NationalIDNumber = '14417807';
GO
SET SHOWPLAN_ALL OFF;
GO
SET STATISTICS IO, TIME ON;
SELECT SalesOrderID, CarrierTrackingNumber, OrderQty,... |
<filename>TP/createsnapshot.sql
--CREATE DATABASE mawatta
--USE mawatta
--CREATE TABLE client(id INT, nom char(20), salaire FLOAT)
--INSERT INTO client VALUES(1, 'Dupond', 2000),(2, 'Martin', 3500),(3, 'Harbazan', 7800)
--SELECT * FROM client
CREATE DATABASE mawatta_snapshot
ON
(
name='mawatta',
filename='D:\mes... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 30, 2015 at 10:10 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
BEGIN TRANSACTION t1
BEGIN TRY
INSERT INTO [dbo].[GenericEvents]
([Type]
,[Payload]
,[CreatedOn]
,[ResourceUri]
,[ResourceType]
,[ResourceId])
VALUES
('AccountCreatedEvent'
,'{"ResourceUri":"api/accounts/M6RB9Y"}'
,GETDATE()
,null
,null
,null)
INSERT INTO [dbo].... |
<filename>Subqueries and JOINs/Subqueries and JOINs/01_Employee Address.sql
SELECT TOP 5
E.EmployeeID,
e.JobTitle,
A.AddressID,
A.AddressText
FROM Employees AS e
JOIN Addresses AS a ON a.AddressID = e.AddressID
ORDER BY A.AddressID |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 04, 2019 at 08:13 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>resources/database/database.sql
-- Schema
CREATE SCHEMA IF NOT EXISTS taxon_concept AUTHORIZATION jpm;
-- Drop table
-- DROP TABLE taxon_concept.description;
-- DROP TABLE taxon_concept.description_media;
-- Tables
CREATE TABLE taxon_concept.description (
id serial NOT NULL, -- Identifiant de la descript... |
<reponame>nokia-wroclaw/innovativeproject-notifications<filename>backup4.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas generowania: 04 Sty 2017, 18:32
-- Wersja serwera: 5.7.16-0ubuntu0.16.04.1
-- Wersja PHP: 7.0.8-0ubuntu0.16.04.3
Create... |
-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64)
--
-- Host: localhost Database: loans
-- ------------------------------------------------------
-- Server version 5.7.18-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
<gh_stars>0
/*
https://leetcode.com/problems/active-users/
https://leetcode.com/submissions/detail/461723638/
Amazon
*/
with cte as
(
select
l.id,
l.login_date,
row_number() over (partition by l.id order by l.login_date) row_num
from
(
select
distinct
a.id,
... |
<filename>db/Helpful Scripts/GetDataRowsJoined.sql
select dc.name ,ds.Name, ds.Stub, ds.Source, dj.Stamp, dj.id, dj.JSON from dbo.dataset ds
join dbo.datajson dj on dj.datasetid = ds.id
join dbo.datacategory dc on dc.id = ds.datacategoryid
order by dc.name, ds.name
--update datajson SET
--Json = '[{"Year":2008,"Recove... |
<gh_stars>1-10
drop table if exists CD_CARD_BIN;
/*==============================================================*/
/* Table: CD_CARD_BIN */
/*==============================================================*/
create table CD_CARD_BIN
(
CARD_BIN varchar(6) not null comment '卡... |
<filename>Models/Ressources/fokontany.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 01, 2020 at 04:42 PM
-- Server version: 5.7.29-0ubuntu0.18.04.1
-- PHP Version: 7.3.13-1+ubuntu18.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_... |
<filename>src/test/resources/sql/drop_table/272bea4d.sql
-- file:alter_table.sql ln:180 expect:true
DROP TABLE tmp_array
|
/* Formatted on 05/06/15 11:36:40 a.m. (QP5 v5.256.13226.35538) Moficado por <NAME> <<EMAIL>> - Fecha - OT - */
SET LINESIZE 200
SET PAGESIZE 1000
COLUMN username FORMAT A20
COLUMN event FORMAT A30
SELECT NVL (s.username, '(oracle)') AS username,
s.sid,
s.serial#,
sw.event,
sw.wa... |
<reponame>dram/metasfresh
-- 2017-11-27T15:01:00.201
-- de.metas.inoutcandidate.spi.impl.M_ReceiptSchedule_GeneratePlanningHUs_WorkpackageProcessor
-- assume 5478540_sys_gh3086_C_Queue_Block_C_Queue_WorkpackageProcessor_ID_drop_FK.sql was already executed
DELETE FROM C_Queue_PackageProcessor WHERE C_Queue_PackageProces... |
INSERT INTO burgers (burgername) VALUES ('Cheeseburger');
|
-- Find the total value of all boxes.
select sum(value) as "Sum Total" from boxes; |
<gh_stars>1-10
-- 创建数据库
create database yitian
-- 添加数据库账号
create user 'yitian'@'localhost' identified by 'yitian';
-- 赋予数据库账号权限
grant all on yitian.* to 'yitian'@'localhost';
-- 系统配置
drop table if exists system_config;
CREATE TABLE `system_config`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
... |
<reponame>ctdk/goiardi-schema<filename>postgres/verify/data_bag_items.sql<gh_stars>100-1000
-- Verify data_bag_items
BEGIN;
SELECT id, name, data_bag_id, raw_data, created_at, updated_at FROM goiardi.data_bag_items WHERE FALSE;
ROLLBACK;
|
-- from https://dev.mysql.com/doc/refman/8.0/en/insert.html
INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2); |
-- Revert nz-buildings:buildings_bulk_load/functions/removed from pg
BEGIN;
DROP FUNCTION buildings_bulk_load.building_outlines_removed_select_by_dataset(integer);
DROP FUNCTION buildings_bulk_load.buildings_removed_select_by_dataset(integer);
DROP FUNCTION buildings_bulk_load.removed_delete_existing_outline(intege... |
/****** Object: StoredProcedure [dbo].[MatchingRecord] Script Date: 10/5/2019 11:06:37 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[MatchingRecord]
@UnitHolderData_FULLNAME varchar(MAX),
@UnitHolderData_EMAIL varchar(MAX),
@UnitHolderData_PHONE varchar(MAX)
AS
Declare ... |
<gh_stars>0
UPDATE payment p
INNER JOIN orderitem oi
ON oi.orderitemid=p.orderitemid
INNER JOIN `order` o
ON o.orderid=oi.orderid
INNER JOIN paymentcard pc
ON pc.repid=o.repid
SET p.cardid=pc.cardid;
ALTER TABLE `orderitem` ADD KEY `subtotal`(subtotal) ;
ALTER TABLE `order` ADD KEY `subtotal`(subtotal) ... |
<reponame>arianvaldivieso/pos
-- inactive_items_and_item_kits --
ALTER TABLE `phppos_items` ADD COLUMN `item_inactive` INT(1) DEFAULT '0', ADD INDEX `item_inactive_index` (`item_inactive`);
ALTER TABLE `phppos_item_kits` ADD COLUMN `item_kit_inactive` INT(1) DEFAULT '0', ADD INDEX `item_kit_inactive_index` (`item_kit_... |
<reponame>bobbykurniawan/mobil<filename>mobil.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2019 at 11:46 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
<filename>plugins/order_module/uninstall/view.sql
DROP VIEW IF EXISTS `carts_view`; |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: pro
-- ------------------------------------------------------
-- Server version 5.7.20-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
1)
Application Name=Ajay-SSMS;Workstation ID=Ajay-PC;Data Source=MyDbServerName
|
<filename>Java DB Fundamentals/Database Basics/03. Build-In Functions - String, Math, Date, etc. functions, Wildcards, LIKE/17. People Table.sql
CREATE DATABASE `ages`;
CREATE TABLE `people` (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
name VARCHAR(15),
birthdate DATETIME
);
INSERT INTO `people` VALUES(1... |
<reponame>AmyE29/ValueShark
-- TABLE FOR USERS AND PORTFOLIO
--
-- DROP TABLE IF EXISTS users, portfolios, companies, company_data;
DROP TABLE IF EXISTS portfolios;
-- DROP TABLE IF EXISTS users, portfolios;
-- CREATE TABLE users (
-- name VARCHAR(255),
-- id varchar(255) primary key
-- );
CREATE TABLE port... |
-- MySQL dump 10.13 Distrib 5.7.21, for macos10.13 (x86_64)
--
-- Host: localhost Database: blog_node
-- ------------------------------------------------------
-- Server version 5.7.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ... |
CREATE TABLE `patents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO patents VALUES (null, 'Soldado');
INSERT INTO patents VALUES (null, 'Capitão');
INSERT INTO patents VALUES (null, 'Coronel'); |
<filename>db/sql/4785__drop_create_proc_vipunentk_lisatiedot_p_lataa_koulutusohjelma_ammpk.sql
USE [VipunenTK_lisatiedot]
GO
/****** Object: StoredProcedure [dbo].[p_lataa_koulutusohjelma_ammpk] Script Date: 20.8.2021 18:57:25 ******/
DROP PROCEDURE IF EXISTS [dbo].[p_lataa_koulutusohjelma_ammpk]
GO
/****** Objec... |
<reponame>birusharmaa/datatables_extends_laylout
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 27, 2021 at 02:35 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... |
<filename>init_database.sql
CREATE TABLE Accounts (
AccountID uuid PRIMARY KEY,
DocNumber TEXT,
AvailableCreditLimit NUMERIC DEFAULT 200
);
CREATE TABLE OperationTypes (
OperationTypeID SMALLINT PRIMARY KEY,
Description TEXT
);
insert into OperationTypes
values
(1,'COMPRA A VISTA'),
(2,'COMPRA PARCE... |
-- This file should undo anything in `up.sql`
drop function payment_service.recharge_subscription(); |
<reponame>fned57/ph7cms
--
-- Author: <NAME> <<EMAIL>>
-- Copyright: (c) 2017-2019, <NAME>. All Rights Reserved.
-- License: MIT License
--
-- Change reserved MySQL column names
-- Using backticks around reserved MySQL words is ugly and not working well with all environments
ALTER TABLE pH7_Settings C... |
<gh_stars>0
DROP TABLE IF EXISTS `EURJPY_M5`;
CREATE TABLE IF NOT EXISTS `EURJPY_M5`(
`id` int(5) NOT NULL,
`bull` varchar(10) NOT NULL,
`bear` varchar(10) NOT NULL,
`buy` varchar(10) NOT NULL,
`sell` varchar(10) NOT NULL,
`av` varchar(10) NOT NULL,
`mm` varchar(10) NOT NULL,
`time` varchar(30) NOT NULL);
ALT... |
select usu.id, usu.nombre, usu.apellido, usu.numero_documento, usu.reservas_acumulado,
usu.categoria_id, cat.nombre as categoria_nombre, usu.fecha_creacion
from usuario usu
inner join categoria cat on usu.categoria_id = cat.id
where numero_documento = :numeroDocumento |
<gh_stars>0
-- --------------------------------------------------------------------------------
-- FILE : C:\Demo\ForeignKey\dbo.FK_StudentGrade_Course.sql
-- PRIMARY OBJECT : dbo.FK_StudentGrade_Course (ForeignKey)
-- CREATED DATE : 02/12/2021 13:50:04.070
-- SOURCE : Reverse-Engine... |
DROP
TABLE
IF EXISTS book_to_book_store;
DROP
TABLE
IF EXISTS book_store;
DROP
TABLE
IF EXISTS book;
DROP
TABLE
IF EXISTS author;
DROP
SEQUENCE IF EXISTS s_author_id;
CREATE
SEQUENCE s_author_id
START WITH
1;
CREATE
TABLE
author(
id INT NOT NULL,
first_name VARCHAR(... |
<reponame>bcgov/cas-ciip-portal
-- Verify ggircs-portal:view_ciip_carbon_tax_calculation on pg
begin;
select pg_catalog.has_table_privilege('ggircs_portal.ciip_carbon_tax_calculation', 'select');
rollback;
|
<reponame>jensim/sourcegraph
BEGIN;
DROP TRIGGER IF EXISTS trig_read_only_repo_sources_column ON repo;
DROP FUNCTION IF EXISTS make_repo_sources_column_read_only();
ALTER TABLE repo DROP COLUMN IF EXISTS sources;
COMMIT;
|
<filename>www/html/install/sql/dbsetup.sql
CREATE TABLE logs (
id bigint unsigned NOT NULL AUTO_INCREMENT,
host varchar(128) default NULL,
facility varchar(10) default NULL,
priority varchar(10) default NULL,
level varchar(10) default NULL,
tag varchar(10) default NULL,
program varchar(15) default NULL,
msg tex... |
<reponame>markashleybell/microwiki
DECLARE @User SYSNAME = N'USER_NAME'
IF EXISTS (SELECT * FROM sys.database_principals WHERE name = @User)
BEGIN
-- Grant execute/select on stored procedures, functions and UDTs
DECLARE @ObjectName SYSNAME
DECLARE @ObjectType NVARCHAR(40)
DECLARE UserDefinedObjects ... |
-- @description query01 for PXF Hive filter pushdown with hex delimiter
SET gp_external_enable_filter_pushdown = true;
SET optimizer = off;
SELECT * FROM test_filter WHERE t0 = 'J' and a1 = 9 ORDER BY t0, a1;
SET optimizer = on;
SELECT * FROM test_filter WHERE t0 = 'J' and a1 = 9 ORDER BY t0, a1;
|
-- @testpoint: 1000w数据cidr类型取最小值
--step1:创建表; expect:成功
drop table if exists t_min_case0022;
create table t_min_case0022(c cidr);
--step2:批量插入数据; expect:成功
begin
for i in 1..1000000 LOOP
insert into t_min_case0022 values('::'), ('172.16.17.32/32'),('172.16.31.10/30'),('172.16.31.10/31');
end loop;
end;/
--step3:查询最小... |
<reponame>simplecomplex/php-database
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
IF NOT EXISTS
( SELECT [name]
FROM sys.databases
WHERE [name] = 'test_scx_mssql'
)
-- SQLserver uses UTF-8 collation by default.
CREATE DATABASE test_scx_mssql;
-- @todo: Is USE allowed when already using ... |
<filename>extras/sistemaventas8.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-09-2020 a las 23:33:22
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.2.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TR... |
<reponame>readingwildly/sierra-sql
SELECT CONCAT('p',p.record_num) AS "pnumber", CONCAT(pn.last_name, ', ',pn.first_name) AS "PatronName", pa.addr1 AS "PatronStreet1", pa.addr2 AS "PatronStreet2", pa.city AS "PatronCity", pa.region AS "PatronState", pa.postal_code AS "PatronZip"
FROM sierra_view.patron_view p
JOIN si... |
<filename>sql/admindb.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 12, 2017 at 11:54 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
<filename>data/db/35-right.sql
INSERT IGNORE INTO `permission` (`libelle`) VALUES ('submission.pairRates');
INSERT IGNORE INTO `role_permission` (`role_id`, `permission_id`) VALUES (4,
(SELECT `id` FROM `permission` WHERE `libelle`= 'submission.pairRates'));
INSERT IGNORE INTO `permission` (`libelle`) VALUES ('submi... |
<gh_stars>0
select city, country from city inner join country on city.country_id=country.country_id;
select first_name, last_name, payment_id from customer inner join payment on customer.customer_id=payment.customer_id;
select first_name, last_name, rental_id from customer inner join rental on customer.customer_id=re... |
ALTER TABLE self_register_user
ADD COLUMN updated TIMESTAMP,
ADD COLUMN version INTEGER NOT NULL;
|
<reponame>2002-feb24-net/tyler-code<filename>CODEING CHALLEGE W3/SQLQuery1.sql
CREATE TABLE Customer (
ID INT NOT NULL UNIQUE IDENTITY,
Firstname VARCHAR(15),
Lastname VARCHAR(20),
CardNumber INT
);
Create TABLE Products(
ID INT NOT NULL UNIQUE IDENTITY,
Name VARCHAR(75),
Price MONEY
);
CREATE TABLE Orders(
ID INT ... |
<filename>DB/bakancslista.sql
CREATE TABLE Films (
ID integer not null PRIMARY key AUTOINCREMENT,
Title text not null,
Category text not null,
PYear integer not null,
FLength integer not null,
Priority integer not null,
UNIQUE(Title)
);
|
<filename>magic-platform.sql
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50711
Source Host : localhost
Source Database : magic-platform
Target Server Type : MySQL
Target Server Version : 50711
File Encoding ... |
<gh_stars>1-10
-- Migration script to copy data from the ComplianceReports database to
-- the raddb database
--
use raddb;
SET @@session.foreign_key_checks = 0;
-- Table 'locations'
INSERT IGNORE INTO `locations` (id, `location`) SELECT LocationID, `Location` FROM ComplianceReports.`Location`;
--Table 'manufacturers... |
<filename>start/dbase/comments.sql
-- phpMyAdmin SQL Dump
-- version 3.3.9.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 18, 2012 at 10:38 PM
-- Server version: 5.5.9
-- PHP Version: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... |
<filename>schema.sql
drop table if exists imgtab;
drop table if exists picrotab;
drop table if exists rowtab;
drop table if exists tapetab;
drop table if exists bytrotab;
create table imgtab (
id integer primary key autoincrement,
proid integer,
filename text not null,
iscore bool
);
create table picrotab (
i... |
<filename>examples/geocoding/geocoder_scripts/post-processing.sql
SELECT install_missing_indexes();
VACUUM ANALYZE VERBOSE tiger.addr;
VACUUM ANALYZE VERBOSE tiger.edges;
VACUUM ANALYZE VERBOSE tiger.faces;
VACUUM ANALYZE VERBOSE tiger.featnames;
VACUUM ANALYZE VERBOSE tiger.place;
VACUUM ANALYZE VERBOSE tiger.cousub;
... |
DROP TABLE IF EXISTS tracked_launches;
CREATE TABLE tracked_launches (
id SERIAL PRIMARY KEY,
data_id VARCHAR (255),
launchDate VARCHAR (255),
launchTime VARCHAR (255),
launchProvider TEXT,
missionName TEXT,
statusName TEXT,
missionDescription TEXT,
orbit TEXT,
rocketName TEXT
); |
alter table issue_period add column avg_pct_efficiency decimal(10, 2); |
<reponame>BobLovesData/etl-framework
-- =============================================
-- Author:
-- Create date:
-- Description:
-- Directions for use:Replace YourEDW with the name for
-- your specific data warehouse.
-- Replace YourDimensionName with the name of your dimension.
-- Then fill in your columns.
-- ======... |
<filename>modules/server-node/prisma-postgres/migrations/20210225093205_update_config/migration.sql
/*
Warnings:
- You are about to drop the column `mnemonic` on the `configuration` table. All the data in the column will be lost.
*/
-- DropIndex
DROP INDEX "configuration.mnemonic_unique";
-- AlterTable
ALTER TAB... |
<reponame>Zarun1/Evolve
CREATE TABLE test_data (
value VARCHAR(25) NOT NULL,
PRIMARY KEY(value)
);
CREATE PROCEDURE AddData()
BEGIN
INSERT INTO test_data (value) VALUES ('Hello');
END ;
CALL AddData;
DROP PROCEDURE IF EXISTS sp_temp;
CREATE DEFINER=root@'localhost' PROCEDURE sp_temp()
DETERMINISTIC
... |
<filename>SQL/1741. Find Total Time Spent by Each Employee.sql
/*
1741. Find Total Time Spent by Each Employee
Easy
SQL Schema
Table: Employees
+-------------+------+
| Column Name | Type |
+-------------+------+
| emp_id | int |
| event_day | date |
| in_time | int |
| out_time | int |
+------------... |
<reponame>razak8469/data-science-on-gcp<filename>01_intro/intro.sql
SELECT end_station_name FROM `bigquery-public-data.london_bicycles.cycle_hire`;
SELECT * FROM `bigquery-public-data.london_bicycles.cycle_hire` WHERE duration >= 1200;
SELECT start_station_name FROM `bigquery-public-data.london_bicycles.cycle_hire` G... |
<reponame>nikalosa/Kayajava
USE Quiz_Website;
create table User_Table(
userName varchar(50),
password varchar(50),
mail varchar(50),
primary key(mail)
);
create table Friends(
firstMail varchar(50),
secondMail varchar(50),
foreign key (firstMail) references User_Table(mail),
foreign key (... |
<reponame>buryat/Kylin<gh_stars>0
select sum(price) as price_sum, min(price) as price_min, max(price) as price_max from test_kylin_fact |
{% snapshot paypal_transactions_snapshot %}
{{
config(
unique_key="uid",
)
}}
select {{ dbt_utils.surrogate_key(['"VALUE"']) }} as uid,
*
from {{ source('paypal', 'src_paypal_transactions') }}
{% endsnapshot %} |
drop extension pg_partman;
create schema partman;
create extension pg_partman schema partman;
drop table template_public_package_views;
select partman.create_parent('public.package_views', 'day', 'native', 'monthly', p_start_partition := current_date::text);
---- create above / drop below ----
drop extension pg_partm... |
<filename>migrations/20140925161624_dumped_migration_16/down.sql
ALTER TABLE versions DROP COLUMN downloads; |
<reponame>dmawardi/burger-sequelize<filename>db/schema.sql
-- Drop Database burgers_db if found
DROP DATABASE IF EXISTS burgers_db;
-- Create database
CREATE DATABASE burgers_db;
USE burgers_db;
-- Create table burgers
CREATE TABLE burgers (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
burger_name VARCHAR(35)... |
INSERT INTO account (`username`, `email`, `password`)
VALUES ('test guy', '<EMAIL>', 'test'), ('matbot', '<EMAIL>', 'matbot'), ('team28', '<EMAIL>', 'ueat');
INSERT INTO `restaurant` (`id`, `name`, `rating`, `email`, `password`, `street1`, `street2`, `city`, `state`, `zip`, `lat`, `lng`) VALUES
(1, 'pizzapizza', '... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64)
--
-- Host: localhost Database: blog
-- ------------------------------------------------------
-- Server version 8.0.28-0ubuntu0.20.04.3
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... |
<filename>Sql/sqledi2_Sample/Sample/Ch02/2_2/List2_25.sql
SELECT shohin_mei, shiire_tanka
FROM Shohin
WHERE shiire_tanka = 2800; |
<gh_stars>0
-- Function: mtp_get_task_count(json)
-- DROP FUNCTION mtp_get_task_count(json);
CREATE OR REPLACE FUNCTION mtp_get_task_count(i_json json)
RETURNS json AS
$BODY$
v_month = i_json.month
v_sql = "select to_char(date_,'YYYY-MM-DD') as date_, val1, val2, val3, val4
from buss_task_count
where to_char(da... |
/* Finds inpatient or ER IBD flare events that are at least 90 days apart*/
CREATE VOLATILE TABLE inpat_flare AS
(
SELECT ptid, interaction_date as visit_date,
interaction_type, 'flare_inpat' as flare_cat
FROM
(
SELECT ptid, uc_count, cd_count, interaction_date,
-- cast date to specific format in ordr to... |
alter table KONTAKTSKJEMA add KOMMUNENR varchar(4);
update KONTAKTSKJEMA set KOMMUNENR='0000';
alter table KONTAKTSKJEMA alter column KOMMUNENR set not null; |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 23, 2020 at 10:22 PM
-- Server version: 5.6.41-84.1
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Mar 07, 2016 at 08:35 PM
-- Server version: 10.1.9-MariaDB-log
-- PHP Version: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
INSERT INTO ApplicationVariable(ApplicationVariableID, DataType, Keyword, Type, Value) VALUES(1,'SINGLE','IntegrationProcessExecutionID','VARIABLE','IntegrationProcessExecution.integrationProcessExecutionID');
INSERT INTO ApplicationVariable(ApplicationVariableID, DataType, Keyword, Type, Value) VALUES(2,'SINGLE','Ba... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.