sql stringlengths 6 1.05M |
|---|
#zera as tabelas
update produto set estoque_id=null;
delete from preferencias_clientes;
delete from item_pedido;
delete from pedido;
delete from cliente;
delete from estoque;
delete from produto;
#insere as bebidas
insert into produto(version,estoque_id,nome,preco,tipo,quantidade_pessoas,calorias,volume,unidade)
value... |
CREATE TABLE Products (
[ID] INT PRIMARY KEY IDENTITY(1, 1),
[Name] varchar(100) not null,
[Volume] varchar(50) not null,
[CanSell] bit not null constraint [df_products_cansell] default(0),
[Price] decimal not null
);
create table Orders (
[ID] int primary key identity(1, 1),
[ProductID] int not null,
[Amount... |
<reponame>Guergeiro/bd2-group2
-- View Clientes
CREATE OR REPLACE VIEW getclientes
AS
SELECT
cod_cliente,
nome,
nif,
(
SELECT count(*)
FROM consumos
WHERE consumos.cod_cliente = clientes.cod_cliente
) AS n_consumos
FROM clientes;
-- Select Clientes
CREATE OR REPLACE FUNCTION... |
<filename>securityDB.sql
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Hôte : artgalermoeibltd.mysql.db
-- Généré le : Dim 17 sep. 2017 à 20:07
-- Version du serveur : 5.6.34-log
-- Version de PHP : 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
... |
/*
Navicat MySQL Data Transfer
Source Server : Forum
Source Server Version : 50168
Source Host : localhost:3306
Source Database : forum
Target Server Type : MYSQL
Target Server Version : 50168
File Encoding : 65001
Date: 2018-06-07 15:25:53
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... |
-- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: localhost Database: fairy-pro
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Хост: db
-- Время создания: Фев 01 2021 г., 11:20
-- Версия сервера: 5.7.32
-- Версия PHP: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
DELETE FROM example_test_table_3 WHERE id = 2; |
<reponame>pppsu/SAMSnOVs
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 26, 2017 at 02:22 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
/*******************************************************************
DECLARE @output INT = 0
,@fieldName nvarchar(255)
,@syncDate DATETIME
EXEC [dbo].[TripStatistics_Get]
@guid = '4798ac03-4e96-4ea2-ad10-35dcf2cc7666'
,@currentDate ... |
<gh_stars>1-10
SELECT version();
SELECT * FROM mysql.user;
|
<reponame>Shuttl-Tech/antlr_psql
-- file:numeric_big.sql ln:64 expect:true
INSERT INTO num_exp_add VALUES (0,7,'-818934540071845742')
|
<gh_stars>10-100
use payroll
execute p_add_time_entry @employee_id=48, @entry_date='2019-10-31 00:00:00', @hours_worked=3
execute p_add_time_entry @employee_id=38, @entry_date='2019-10-31 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=61, @entry_date='2019-10-31 00:00:00', @hours_worked=4
execute p_... |
<filename>db-migration/participant-datastore-db-migration/db/migration/V2_0_8__release.sql
/* ISSUE #616 Use FCM instead of APNS for iOS push notifications */
ALTER TABLE mystudies_participant_datastore.app_info ADD ios_server_key VARCHAR(255) DEFAULT NULL;
ALTER TABLE `mystudies_participant_datastore`.`user_details` ... |
DROP VIEW uihelper_shopping_list;
CREATE VIEW uihelper_shopping_list
AS
SELECT
sl.*,
p.name AS product_name,
plp.price AS last_price_unit,
plp.price * sl.amount AS last_price_total,
st.name AS default_shopping_location_name,
qu.name AS qu_name,
qu.name_plural AS qu_name_plural,
pg.name AS product_group_name,
p... |
<filename>migrations/0018_add-name-column-to-label-color.up.sql
ALTER TABLE label_color ADD COLUMN name TEXT NOT NULL DEFAULT 'needs name';
|
<filename>samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Drop External File Format.sql
-- ==================================================================================================================
-- Drop external file format template for Azure Synapse Analytics Database, and Azure ... |
<filename>crawler/job_info/sql_script/job_company_select.sql
// 新加入公司中将不关注的公司转移至忽略列表中
insert into extra_company(name,company_type,time) select name,company_type,time from conside_company where (isconside = 0 or isconside is null);
// 删除忽略的公司职位信息
delete from conside_company where (isconside = 0 or isconside is null);
//... |
--
-- Database: `scalr`
--
-- --------------------------------------------------------
--
-- Table structure for table `account_alerts`
--
CREATE TABLE IF NOT EXISTS `account_alerts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) DEFAULT NULL,
`type` varchar(20) DEFAULT NULL,
`is_critical` tin... |
INSERT INTO TIPO_BIEN ( ESTADO , NOMBRE, ICONO ) VALUES (1, 'VEHICULO', 'CAR_RENTAL');
INSERT INTO TIPO_BIEN ( ESTADO , NOMBRE, ICONO ) VALUES (1, 'VIVIENDA', 'HOME');
INSERT INTO TIPO_BIEN ( ESTADO , NOMBRE, ICONO ) VALUES (1, 'COMERCIO', 'BUSINESS');
/*CONTRIBUYENTES */
INSERT INTO CONTRIBUYENTE ( TIPO_IDENTIFICACI... |
<filename>SQL Server Query Step-by-step/Part .01/select statement.sql
Select *from PersonTbl
Select *from PersonTbl Where city <> 'London'
Select *from PersonTbl Where Age in (20,21,27)
Select *from PersonTbl Where City LIKE '%o%'-- Use of like operator
Select *from PersonTbl Where Email LIKE '%@%'
Sel... |
DROP TABLE IF EXISTS Animal;
CREATE TABLE Animal (
Id UUID,
Name VARCHAR(50),
Unique(Id),
PRIMARY KEY(Id)
); |
/*
Esta consulta CALCULA los creditos acumulados de un usuario segun los eventos que tiene marcados como
ASISTIDO = 1
*/
SELECT SUM(CREDITOS) AS TOTAL_CREDITOS FROM EVENTO
NATURAL JOIN EVENTO_USUARIO
NATURAL JOIN USUARIO
WHERE NOMBRE_USUARIO = 'DEGUALTEROS' AND ASISTIDO = 1; |
/* *******************************************************************/
/* Create Health Factors, HF Rules, and needed assessment variables */
/* *******************************************************************/
/*****************************************************************************************************... |
<gh_stars>1-10
-- Обновление материализованных представлений с данными OAuth из основной БД
declare
mviewSchema varchar2(200) := pkg_Scheduler.getContextString(
'MViewSchema', riseException => 1
);
refreshAfterErrorsFlag integer := pkg_Scheduler.getContextNumber(
'RefreshAfterErrorsFlag'
);
... |
alter table ACT_HI_PROCINST add REFERENCE_ID_ NVARCHAR2(255);
alter table ACT_HI_PROCINST add REFERENCE_TYPE_ NVARCHAR2(255); |
<reponame>loftwah/iamzero<filename>pkg/storage/migrations/20210927162301_add_tokens_table.down.sql
DROP TABLE IF EXISTS tokens; |
ALTER TABLE jobs ADD repo TEXT;
|
INSERT INTO media
(
title,
uri,
rating,
viewed_at,
created_at
)
VALUES
('WNUF Halloween Special', 'http://www.imdb.com/title/tt3104078/', 1000, '2017-10-25', now()),
('Never Too Young to Die', 'http://www.imdb.com/title/tt0091621/', 1000, '2017-10-25', now())
|
<reponame>DragonFired-SNHU/DBClass_Assignment1<gh_stars>0
use Normalization1;
DROP TABLE IF EXISTS status;
CREATE TABLE status (
status_ID int(11) NOT NULL auto_increment,
status VARCHAR(25) NOT NULL,
PRIMARY KEY (status_ID)
) AS
SELECT DISTINCT mc.status
FROM my_contacts AS mc
WHERE mc.status IS N... |
-- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- Host: sql312.byethost.com
-- Generation Time: Aug 31, 2018 at 06:07 AM
-- Server version: 5.6.41-84.1
-- PHP Version: 5.3.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... |
<filename>setup/inc/v1.6st-upgrade.sql
ALTER TABLE `%TABLE_PREFIX%ticket` ADD `topic_id` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `priority_id`;
ALTER TABLE `%TABLE_PREFIX%ticket` ADD INDEX ( `topic_id` );
ALTER TABLE `%TABLE_PREFIX%ticket` CHANGE `topic` `helptopic` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_gene... |
create table "numbers-not-spanish" (
"provincia" character varying(8),
"sup_km2" integer,
"habitantes_miles" numeric(8,3),
"densidad" numeric(6,2),
"idh" character varying(4),
"codigo_postal" integer,
primary key ("provincia")
);
insert into "numbers-not-spanish" ("provincia", "sup_km2", "habitantes_miles", "de... |
select
r.*,
c.*
from
cuoco c full outer join ricetta r
on r.id_cuoco = c.id_cuoco
-- outer join, oltre alle righe che matchanop l'uguaglianza del
-- predicato di join, elenca anche le righe che non matchano
-- di una delle due tabelle coivolte nel join (la tabella
-- di sinistra o quella di destra)
-- quali cuoch... |
<filename>src/main/resources/db/migration/V0030__delete_gamemaps.sql
ALTER TABLE actor DROP FOREIGN KEY ACTOR_GAME_MAP_FK;
ALTER TABLE actor DROP INDEX ACTOR_GAME_MAP_FK;
ALTER TABLE actor DROP COLUMN game_map_id;
ALTER TABLE actor DROP COLUMN x;
ALTER TABLE actor DROP COLUMN y;
DROP TABLE map_exit;
DROP TABLE tile;
D... |
/* mysql
unquoted identifier
alphanumeric _ $
can start with digit (source of ambiguity, has its issues)
not all digits
quoted identifier with `backtick`
any character except a byte with value 0 or 255
useful when identifier
is an SQL reserved word
contains spaces
contains special chars
*/ |
<gh_stars>10-100
/* loads the SNOMED CT release - replace folder, type and release number with relevant locations of base SNOMED CT release files*/
SET SCHEMA 'snomedct';
DO $$
DECLARE
folder TEXT := '/RF2Release'; -- Change the root directory based on your file location
type TEXT := 'Full'; -- Change between Ful... |
--
-- Return "lap-time" for current query: time elapsed since last invocation of this function
-- in current query.
-- Essentially, this function allows for measurement of time elapsed between invocations.
--
DELIMITER $$
DROP FUNCTION IF EXISTS query_laptime $$
CREATE FUNCTION query_laptime() RETURNS DOUBLE
DETERM... |
<reponame>intel-hpdd/-intel-manager-for-lustre<gh_stars>10-100
CREATE TABLE IF NOT EXISTS lnet (
id serial PRIMARY KEY,
host_id int NOT NULL UNIQUE,
state text NOT NULL,
nids int[] NOT NULL
);
CREATE TABLE IF NOT EXISTS nid (
id serial PRIMA... |
BEGIN;
ALTER TABLE `druckrahmen` ADD `dhk_call` VARCHAR( 10 ) NULL DEFAULT NULL AFTER `id`;
COMMIT;
|
INSERT INTO KRIM_TYP_T (KIM_TYP_ID, OBJ_ID, VER_NBR, NM, SRVC_NM, ACTV_IND, NMSPC_CD)
VALUES( KRIM_TYP_ID_BS_S.NEXTVAL, SYS_GUID(), 1, 'Derived Role: Coi Disclosure Reviewer', 'coiDisclosureReviewerDerivedRoleTypeService', 'Y', 'KC-COIDISCLOSURE')
/
INSERT INTO KRIM_ROLE_T (ROLE_ID, OBJ_ID, VER_NBR, ROLE_NM, NMSPC_CD... |
-- -----------------------------------------------------
-- Mise à jour des tables : `prescriptiontexteliste` ; `prescriptionarticleliste` ; `prescriptiondossier`
-- -----------------------------------------------------
ALTER TABLE `prescriptiontexteliste` ADD `VISIBLE_TEXTE` tinyint(1) DEFAULT '1';
ALTER TABLE `prescr... |
CREATE OR REPLACE STREAM "DESTINATION_CAPTAINS_SCORES" ("favoritecaptain" VARCHAR(32), average_rating INTEGER, total_rating INTEGER);
CREATE OR REPLACE PUMP "STREAM_PUMP" AS INSERT INTO "DESTINATION_CAPTAINS_SCORES"
SELECT STREAM "favoritecaptain", avg("rating") as average_rating, sum("rating") as total_rating
... |
CREATE TABLE `VatReports` (
`VatReportId` INT NOT NULL AUTO_INCREMENT,
`OrganizationId` INT NOT NULL,
`CreatedDateTime` DATETIME NOT NULL,
`YearMonthStart` BIGINT NOT NULL,
`MonthCount` INT NOT NULL,
`Open` TINYINT NOT NULL,
`Turnover` BIGINT NOT NULL,
`VatOutboundCents` BIGINT NOT NULL,
`VatInboundCe... |
<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : for_blog
Source Server Type : MySQL
Source Server Version : 80026
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 80026
File Encoding : 65001
Date: 17/10... |
/*
* Copyright 2013-2016 Uncharted Software Inc.
*
* Property of Uncharted(TM), formerly Oculus Info Inc.
* https://uncharted.software/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the Licen... |
<gh_stars>100-1000
# RiffRaff schema
# --- !Ups
CREATE TABLE apiKey (key CHAR(100) PRIMARY KEY, content jsonb NOT NULL);
CREATE TABLE auth (email VARCHAR(100) PRIMARY KEY, content jsonb NOT NULL);
CREATE TABLE deploy (id UUID PRIMARY KEY, content jsonb NOT NULL);
CREATE TABLE deployLog (id UUID PRIMARY KEY, conten... |
<filename>posda/posdatools/queries/sql/SeriesListByStudyInstanceUidWithAdmittingDiag.sql
-- Name: SeriesListByStudyInstanceUidWithAdmittingDiag
-- Schema: posda_files
-- Columns: ['collection', 'site', 'patient_id', 'study_instance_uid', 'study_date', 'study_description', 'series_instance_uid', 'series_date', 'series_d... |
<reponame>reinaldocoelho/evosql
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.17)
# Database: suitecrm
# Generation Time: 2017-02-05 15:53:48 +0000
# **************... |
<filename>src/test/resources/org/support/project/ormapping/gen/dao/sql/RoleDao/RoleDao_physical_select_all.sql<gh_stars>100-1000
SELECT * FROM ROLE;
|
<gh_stars>0
CREATE SCHEMA schema_snap AUTHORIZATION snap_user
CREATE TABLE jobs (title text, category text, status text, location text)
GRANT ALL ON jobs TO snap_user
|
<filename>_migrations/0250_rollcall.down.sql<gh_stars>1-10
DROP TABLE rollcall;
|
/*
Name: Filters: Min State of Charge
Data source: 1
Created By: admin
Last Update At: 2021-07-02T17:19:23.217Z
*/
select distinct soc_min as a, count(*) from test_metadata group by a order by a |
/*
app: SAGE REST API
note: these are views used to validate regression testing of sage rest api code
*/
CREATE OR REPLACE VIEW sageapi_test_vw AS
SELECT *
FROM cv_term;
CREATE OR REPLACE VIEW sageapi_test_vw2 AS
SELECT *
FROM cv_term;
|
CREATE PROCEDURE [LogUploadFinish]
(
@LogId INT
)
AS
BEGIN
UPDATE
[dbo].[UploadLog]
SET
[UploadEndDateTime] = GETDATE()
WHERE
[LogId] = @LogId;
END; |
<reponame>uwescience/raco<filename>c_test_environment/testqueries/join_string_key.sql
select r1.a, r2.a from C3 r1, C3 r2 where r1.b=r2.c;
|
--1)film tablosunda bulunan title ve description sütunlarındaki verileri sıralayınız.
select title,description from film
--2)film tablosunda bulunan tüm sütunlardaki verileri film uzunluğu (length) 60 dan büyük VE 75 ten küçük olma koşullarıyla sıralayınız.
select * from film where length>60 and length<75 --2
--... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE "session" (
"sid" varchar NOT NULL COLLATE "default",
"sess" json NOT NULL,
"expire" timestamp(6) NOT NULL
)
WITH (OIDS=FALSE);
ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;
CREATE TABLE users (
... |
tasks (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
content VARCHAR(100),
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
); |
CREATE DATABASE IF NOT EXISTS `mascot` ;
USE `mascot`;
--
-- Table structure for table `dates`
--
DROP TABLE IF EXISTS `dates`;
CREATE TABLE `dates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `users`
-... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE OR REPLACE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TABLE IF NOT EXISTS "user"
(
id uuid NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY,
email VARCHAR(50) NOT NULL UNIQU... |
USE TestesClinicos;
/* INSERIR MODALIDADE */
DROP PROCEDURE IF EXISTS inserirModalidade;
DELIMITER $$
CREATE PROCEDURE inserirModalidade(IN nome VARCHAR(255))
BEGIN
DECLARE erro BOOL DEFAULT 0;
DECLARE existe INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET erro = 1;
START TRANSACTION;
SET ex... |
<filename>hard/569.sql<gh_stars>0
/* 569. Median Employee Salary
The Employee table holds all employees. The employee table has three columns: Employee Id, Company Name, and Salary.
+-----+------------+--------+
|Id | Company | Salary |
+-----+------------+--------+
|1 | A | 2341 |
|2 | A ... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 28, 2022 at 05:25 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
BEGIN;
-- Constants
SET @project_name = "apache/camel";
Set @instance_id = "-1";
-- Query
SELECT
SATD.satd_instance_id, SATD.resolution,
FirstFile.f_path as v1_path,
FirstFile.containing_class as v1_class,
SecondCommit.commit_hash as v2_commit,
SecondFile.f_path as v2_path,
Secon... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 03, 2021 at 04:35 PM
-- Server version: 10.3.31-MariaDB-0+deb10u1
-- PHP Version: 7.3.31-1~deb10u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
<filename>Database/Scripts/Deployment.sql
/****** Object: Table [dbo].[ActivationReport] Script Date: 26/04/2016 15:42:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ActivationReport](
[Id] [uniqueidentifier] NOT NULL CONSTRAINT [DF_ActivationReport_Id] DEFAULT (newid()),
... |
<reponame>EdManDev/MySQL_Code<gh_stars>1-10
-- 1-) Crear una bases de Datos
CREATE DATABASE edmanDB;
-- 2-) usar el bases de datos
USE edmanDB;
-- 3-) Crear una tabla
CREATE TABLE edmanTable (
_id int(10) PRIMARY KEY AUTO_INCREMENT,
username varchar(100),
email varchar(100));
-- 4-) Insertar Datos... |
-- Create the test database
CREATE DATABASE IF NOT EXISTS hackdawg_testing;
-- Create the test user
CREATE USER 'hackdawg_testing'@'%' IDENTIFIED BY 'password';
GRANT CREATE, ALTER, INDEX, LOCK TABLES, REFERENCES, UPDATE, DELETE, DROP, SELECT, INSERT ON `hackdawg_testing`.* TO 'hackdawg_testing'@'%';
FLUSH PRIVILEGES;... |
<filename>docker/localstack/data/rubenv-sql-migrate-example/0001_create_people_table.sql
-- +migrate Up
CREATE TABLE people (id INT);
-- +migrate Down
DROP TABLE people;
|
Insert into APPLICATION_CONSTANT (ID,VERSION,KEY,VALUE,ENCRYPTED) values (0,0,'admin','weblogic',0);
Insert into APPLICATION_CONSTANT (ID,VERSION,KEY,VALUE,ENCRYPTED) values (1,0,'serverport','9502',0);
Insert into APPLICATION_CONSTANT (ID,VERSION,KEY,VALUE,ENCRYPTED) values (2,0,'protocol','http',0);
Insert into APPLI... |
<filename>docker/postgres/dumps/pg_stat_statements.sql
CREATE EXTENSION pg_stat_statements;
|
<reponame>JeffBarnard/WingtipTicketsSaaS-DbPerTenant<filename>App/WingtipSaaSDatabase/WingtipTenantDB/dbo/Tables/Tickets.sql
CREATE TABLE [dbo].[Tickets] (
[TicketId] INT IDENTITY (1, 1) NOT NULL,
[RowNumber] INT NOT NULL,
[SeatNumber] INT NOT NULL, ... |
# cd.sql
# example cd table for the eponymy example
DROP TABLE IF EXISTS cd;
#@ _CREATE_TABLE_
CREATE TABLE cd
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
year INT UNSIGNED, # year of issue
artist VARCHAR(50), # artist or group name
title VARCHAR(50) # album title
);
#@ _CREATE_TABLE_
INSERT INTO ... |
CREATE TABLE `occupation_category`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(256) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `occupation_category_U_1` (`name`)
)Type=InnoDB;
ALTER TABLE `tutor` ADD `nationality` INTEGER default 0 COMMENT 'La nacionalidad del tutor (nativo, naturalizado, extrangero)';... |
CREATE TABLE T_CM_ATM_ACTUAL_STATE_FILTER
(USER_ID NUMERIC(10) NOT NULL,
atm_state VARCHAR(10),
atm_problem VARCHAR(10),
days_to_cash_end NUMERIC(6),
cash_state VARCHAR(10),
device_type NUMERIC(1),
... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.5.49, for debian-linux-gnu (x86_64)
--
-- Host: edudb.di.uoa.gr Database: songs
-- ------------------------------------------------------
-- Server version 5.1.51-community
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... |
<gh_stars>0
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.
+---------+------------------+------------------+
| Id(INT) | RecordDate(DATE) | Temperature(INT) |
+---------+------------------+------------------+
| 1 | 2015-... |
<reponame>xzxiaoshan/apollo
/*
Navicat Premium Data Transfer
Source Server : 192.168.131.130
Source Server Type : MySQL
Source Server Version : 50731
Source Host : 192.168.131.130:3306
Source Schema : apolloconfigdb
Target Server Type : MySQL
Target Server Version : 50731
File... |
IF OBJECT_ID('hrm.employee_view') IS NOT NULL
DROP VIEW hrm.employee_view;
GO
CREATE VIEW hrm.employee_view
AS
SELECT
hrm.employees.employee_id,
hrm.employees.first_name,
hrm.employees.middle_name,
hrm.employees.last_name,
hrm.employees.employee_code,
hrm.employees.employee_name,... |
-- phpMyAdmin SQL Dump
-- version phpStudy 2014
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 服务器版本: 5.5.53
-- PHP 版本: 5.6.27
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... |
GO
IF OBJECT_ID('[DOI].[spRun_RenameDefaultConstraints]') IS NOT NULL
DROP PROCEDURE [DOI].[spRun_RenameDefaultConstraints];
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [DOI].[spRun_RenameDefaultConstraints]
@DatabaseName SYSNAME = null,
@Debug BIT = 0
AS
/*
EXEC DOI.spRun_Rename... |
<reponame>EAHITechnology/cage
-- 每个项目需要把用到的表在此记录一下,项目迁移时可以直接使用防止数据漏下
CREATE TABLE `demo_task` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`info` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'info',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'time',
`update_time` datetime ... |
<gh_stars>10-100
UPDATE stm_dev_typ SET dev_typ_version = '5ff' WHERE dev_typ_name = 'FortiManager';
|
<reponame>Rob--W/phabricator
/* This column was previously "uint32?" with these values:
1: run every time
0: run only the first time
*/
UPDATE {$NAMESPACE}_herald.herald_rule
SET repetitionPolicy = '1'
WHERE repetitionPolicy IS NULL;
ALTER TABLE {$NAMESPACE}_herald.herald_rule
CHANGE repetitionPolicy
... |
<gh_stars>1-10
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
create unique index SYS_C0016536_idx on EXON_REPORTER_GENE
(GENE_ID,EXON_REPORTER_ID) tablespace CABIO_FUT;
alter table EXON_REPORTER_GENE enable c... |
-- MODULE XTS730
-- SQL Test Suite, V6.0, Interactive SQL, xts730.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION CTS1
SELECT USER FROM HU.ECCO;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time print
-- TEST:7030 Table name with 19 characte... |
<reponame>YangHao666666/hawq<gh_stars>100-1000
PREPARE fooplan (int) AS INSERT INTO a VALUES($1);EXECUTE fooplan(1);DEALLOCATE fooplan;
|
DROP TABLE IF EXISTS qbo_load_journal_entries;
DROP TABLE IF EXISTS qbo_load_checks;
DROP TABLE IF EXISTS qbo_load_journal_entry_lineitems;
DROP TABLE IF EXISTS qbo_load_check_lineitems;
DROP TABLE IF EXISTS qbo_load_attachments;
CREATE TABLE qbo_load_journal_entries (
employee_email TEXT,
record_date TEXT,
... |
<filename>prisma/migrations/20210827104658_log_model_added/migration.sql<gh_stars>0
/*
Warnings:
- You are about to alter the column `amount` on the `Log` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(65,6)`.
*/
-- AlterTable
ALTER TABLE "Log"... |
CREATE TABLE NERD_PHONES(
NERD_PHONE_PK INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY NOT NULL,
NERD_FK INT NOT NULL,
AREA_CODE NVARCHAR2(3) NOT NULL,
CENTRAL_OFFICE_PREFIX NVARCHAR2(3) NOT NULL,
LINE_NUMBER NVARCHAR2(4) NOT NULL,
LAST_UPDATE_DATE TIMESTAMP NOT NULL,
EXPIRED_DATE TIMESTAMP NULL,
NERD_CON... |
/********************************************************************************
t_skey: table to store surrogate keys and intended to be used to join imported
data with existing data. This is needed because all data sources do not
always provide reliable keys. These surrogate keys will not be 100% ... |
ALTER TABLE `need` DROP INDEX `date`;
ALTER TABLE `need` ADD UNIQUE INDEX (
`date`,
`helper_type`,
`project_id`);
|
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMPTZ NOT NULL,
"email" VARCHAR(320) NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
|
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 01-Jul-2021 às 23:32
-- Versão do servidor: 10.4.18-MariaDB
-- versão do PHP: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
<gh_stars>0
EXEC [EST].[Proc_yjbb_Ins] @Code = N'601003',@CutoffDate = N'2017-09-30',@EPS = N'0.4898',@EPSDeduct = N'0',@Revenue = N'299.19亿',@RevenueYoy = N'60.64',@RevenueQoq = N'7.70',@Profit = N'12.55亿',@ProfitYoy = N'915.49',@ProfiltQoq = N'345.36',@NAVPerUnit = N'2.2666',@ROE = N'23.85',@CashPerUnit = N'1.1549',@... |
<reponame>EL-BID/nexso
CREATE PROCEDURE [dbo].[dnn_GetPropertyDefinition]
@PropertyDefinitionID int
AS
SELECT dbo.dnn_ProfilePropertyDefinition.*
FROM dbo.dnn_ProfilePropertyDefinition
WHERE PropertyDefinitionID = @PropertyDefinitionID
AND Deleted = 0
|
-- Dropping eventually existing Database
DROP DATABASE alvr;
-- Database creation
CREATE DATABASE alvr OWNER postgres ENCODING = 'UTF8';
\c alvr;
--Create new domains
CREATE DOMAIN lang_code AS VARCHAR(4) NOT NULL DEFAULT 'eng' CONSTRAINT lengthcheck CHECK ((VALUE)::text ~* '[a-z]{2,3}'::text);
CREATE DOMAIN version ... |
create procedure [dbo].[uspValidateTrainingProviderVacancyRelationship]
@vacancyReference int,
@ukprn int
as
-- check that training provider can manage the vacancy
select v.VacancyId
from Vacancy v
join VacancyOwnerRelationship vor ON v.VacancyOwnerRelationshipId = vor.VacancyOwnerRelationshipId
join ProviderSite... |
-- PCT17. PRESENCE OF UNMARRIED PARTNER OF HOUSEHOLDER BY HOUSEHOLD TYPE FOR THE POPULATION UNDER 18 YEARS IN HOUSEHOLDS (EXCLUDING HOUSEHOLDERS, SPOUSES, AND UNMARRIED PARTNERS)
-- designed to work with the IRE Census bulk data exports
-- see http://census.ire.org/data/bulkdata.html
CREATE TABLE ire_pct17 (
geoid VAR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.