sql stringlengths 6 1.05M |
|---|
<reponame>zhoukuo/pms
CREATE TABLE 'tbl_hardwares' (
'guid' VARCHAR(64) PRIMARY KEY,
'platform' VARCHAR(64) NOT NULL UNIQUE,
'supplier' VARCHAR(64) NOT NULL,
'type' VARCHAR(64) NOT NULL,
'unit' VARCHAR(64) NOT NULL,
'price' VAR... |
<reponame>darbnajah/amnksa<filename>migrate.sql
Nothing to migrate.
|
--Oracle
ALTER TABLE Shohin DROP (shohin_mei_kana); |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 20, 2021 at 08:05 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- MySQL dump 10.13 Distrib 5.7.13, for Win64 (x86_64)
--
-- Host: localhost Database: fitpos_db
-- ------------------------------------------------------
-- Server version 5.7.13-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE... |
<reponame>ivancekic/sql-data-analysis-part-two
select plzag.PLAN_CIKLUS_ID, plcik.ciklus_naziv PLAN_CIKLUS_NAZIV
, plzag.PLAN_TIP_ID, pltip.TIP_NAZIV PLAN_TIP_NAZIV
, plzag.PLAN_PERIOD_ID, plper.PERIOD_NAZIV PLAN_PERIOD_NAZIV
, plzag.PLAN_TRAJANJE_ID, pltra.DATUM_OD PLAN_TRAJANJE_DATUM... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.26, for osx10.10 (x86_64)
--
-- Host: 127.0.0.1 Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.7.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... |
<filename>ps.sql
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50641
Source Host : localhost:3306
Source Schema : ps
Target Server Type : MySQL
Target Server Version : 50641
File Encoding : 65001
Date: 22/05/20... |
CREATE OR REPLACE FUNCTION your_project_id.your_dataset.h3_to_geojson_boundary(h3_index STRING)
RETURNS STRING
LANGUAGE js AS
"""
var geojson = {
"type": "Polygon",
"coordinates": [h3.h3ToGeoBoundary(h3_index,true)]
}\n
return JSON.stringify(geojson);
"""
OPTIONS (
library=['gs://file_path']
);
|
-- Template 5
set query_group to 'query 05';
set enable_result_cache_for_session=false;
select
n_name,
sum(l_extendedprice * (1 - l_discount)) as revenue
from
evendist.customer,
evendist.orders,
evendist.lineitem,
evendist.supplier,
evendist.nation,
evendist.region
where
c_custkey = o_custkey
and l_orderkey =... |
<gh_stars>1-10
USE [ANTERO]
GO
IF NOT EXISTS (
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA='dw' AND TABLE_NAME='d_aineistotyyppi' AND COLUMN_NAME='jarjestys_aineistotyyppi_koodi')
BEGIN
ALTER TABLE dw.d_aineistotyyppi ADD jarjestys_aineistotyyppi_koodi AS
case when aineistotyyppi_koodi = '-1' then... |
<gh_stars>1-10
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.19 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5196
-- ---------------------------------------------... |
INSERT INTO category (name) VALUES ("Toy Weapons");
SET @id := LAST_INSERT_ID();
INSERT INTO product (name, description, vendor, price, category_id) VALUES ("Ultimax 100", "Mk.2 machine gun with 30-round M16 magazine and sheathed bayonet", "Chartered Industries", "89999.00", @id);
INSERT INTO product (name, description... |
<reponame>dram/metasfresh
-- 2018-03-22T16:46:43.562
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnSQL='(select MAX(CreditLimitIndicator) from C_BPartner_Stats s where s.C_BPartner_ID = C_BPartner.C_BPartner_ID)',Updated=TO_TIMESTAMP('2018-03-22 16:46:43','YYYY-MM-DD HH24:... |
CREATE TEMPORARY TABLE CD1500_1 AS
WITH C0_CD1500_1 AS (
SELECT * FROM tb_sensor_unified WHERE maxrotorspeed IS NOT NULL
)
SELECT dFrom, dTo
FROM (
SELECT datetime as dFrom,
LEAD(datetime, 1) OVER (ORDER BY datetime) AS dTo,
maxrotorspeed AS currRs,
LEAD(maxrotorspeed, 1) OVER (ORDER BY datetime) AS nextRs
FROM C0_... |
<filename>src/LyphTEC.Repository.Dapper.Tests/SqlServer/Sql/CreateInvoiceTable.sql<gh_stars>1-10
IF (OBJECT_ID('Invoice') IS NOT NULL)
BEGIN
DROP TABLE Invoice
END
CREATE TABLE [dbo].[Invoice](
[Id] [uniqueidentifier] NOT NULL,
[CustomerId] [int] NULL,
[InvoiceDate] [smalldatetime] NOT NULL,
[BillingAddress] ... |
<reponame>fletchersarip93/feature-user-access-service
INSERT INTO authority (id, authority) VALUES (1, 'PRODUCT_MANAGER');
INSERT INTO authority (id, authority) VALUES (2, 'DEVELOPER');
INSERT INTO authority (id, authority) VALUES (3, 'USER');
INSERT INTO user (id, email, password, enabled, expired, account_expired, c... |
-- Json entity
insert into ACCOUNT(account_number, account_type, description) values
('1', 'Savings', 'Saving account record'),
('2', 'Checking', 'Checking account record'); |
<reponame>pdv-ru/ClickHouse
SELECT
x,
-x,
y
FROM
(
SELECT
5 AS x,
'Hello' AS y
)
ORDER BY
x ASC WITH FILL FROM 3 TO 7,
y ASC,
-x ASC WITH FILL FROM -10 TO -1;
|
<filename>general/examples/table variable.sql
--create login basicuser with password='<PASSWORD>!';
select * from tempdb.sys.objects where name like '#%';
if not exists (select name from sys.objects where name='table_variable')
declare @table_variable table (spy_id int not null, spyname text not null, realname text nu... |
<reponame>kiyokura/BuildAndDeployDacWithoutCLIToolsSample
CREATE FUNCTION [dbo].[DatabaseScalarFunction1]
(
@param1 int,
@param2 int
)
RETURNS INT
AS
BEGIN
RETURN @param1 + @param2
END
|
<gh_stars>0
--Query 1
--For all the shots that team took, what percentage of the shots were on target
select sum(shot_on + shot_off) as Total_Shots_Made, round( sum(shot_on) / sum(shot_on + shot_off)* 100 ) ||'%' as Shots_on_Target
from fact_stats
where team_sk = 1
and date_sk >= to_date('01/10/2011', 'DD-MM-YYYY')
a... |
-- AlterTable
ALTER TABLE "Activity" ALTER COLUMN "stravaActivityId" SET DATA TYPE BIGINT;
|
SELECT
category,
value
FROM
table1,
UNNEST(1, 2, 3) AS category
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Окт 14 2017 г., 22:10
-- Версия сервера: 5.7.14
-- Версия PHP: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
DROP TABLE IF EXISTS `custom_notspawned`;
ALTER TABLE `custom_spawnlist` DROP COLUMN `id`;
ALTER TABLE `custom_spawnlist` DROP INDEX `key_npc_templateid`; |
<filename>src/main/resources/db/migration/V01_046__dimension_surrogate_key.sql
-- Add id PK table and populate with "random" UUIDs generated via MD5 (cheap hack, should be sufficient to avoid collisions)
ALTER TABLE dimension ADD COLUMN id UUID NOT NULL DEFAULT md5(random()::text)::uuid;
ALTER TABLE dimension_value DRO... |
<filename>pkg/db/base.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS status (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(20) UNIQUE NOT NULL
);
INSERT OR IGNORE INTO status (id, name) VALUES
(1, 'open'),
(2, 'closed'),
(3, 'on_hold'),
(4, 'done'),
(5, 'abandoned')
;
CREATE TABLE IF NOT EXISTS todo (
id IN... |
/* All Queries needed to Produce trafficSense experimental tables from imported OSM data.
(c) 2014.09 Aalto University
v: 2014.09.20a
Contact <EMAIL> for any more info, suggestions, etc.
*/
/* CreateRoadsList */
/* This query selects from the planet_osm_line table the following columns:
osm_id as road_id,
... |
CREATE TABLE [dbo].[SimulationResult]
(
[Id] int identity(1,1) NOT NULL primary key,
[SimulationId] int NOT NULL foreign key references [dbo].[Simulation]([Id])
);
CREATE TABLE [dbo].[SimulationValue]
(
[Id] int identity(1,1) NOT NULL primary key,
[Date] date NOT NULL,
[Value] decimal(18,2) NOT NULL,
... |
DEFINE RECORD CDD$TOP.PR.PR_TRN_CHECK
DESCRIPTION IS /*Payroll Check Journal*/.
PR_TRN_CHECK_CDD STRUCTURE.
/* Element = EMPNUM
Description = Employee number */
EMPNUM DATATYPE IS TEXT SIZE IS 10.
/* Element = DATE
Description = Date */
... |
CREATE PROCEDURE [WebApi].[DeleteCustomerCategory](@CustomerCategoryID int)
WITH EXECUTE AS OWNER
AS BEGIN
DELETE Sales.CustomerCategories
WHERE CustomerCategoryID = @CustomerCategoryID
END |
<reponame>AdrienNini/ProjetAdmin<gh_stars>1-10
use WoodyToys;
insert into Client values ('B112','HANSENNE' ,'23, a. Dumont' ,'Poitiers' ,1250.00);
insert into Client values ('C123','MERCIER' ,'25, r. Lemaitre' ,'Namur' ,-2300);
insert into Client values ('B332','MONTI' ,'112, r. Neuve' ... |
-- Global params table
CREATE TABLE sim_params (
param_id serial primary key,
param_name text,
param_value text
);
-- Audit the params table
SELECT audit.audit_table('sim_params'); |
# https://leetcode.com/problems/department-highest-salary/
SELECT
d.name as Department, e2.name as Employee, s.Salary
FROM
Department d
JOIN (SELECT DepartmentId, max(Salary) as Salary
FROM Employee
GROUP BY DepartmentId) s ON d.Id = s.DepartmentId
JOIN Employee e2 ON s.DepartmentId... |
SELECT *
FROM bonus_songs
UNION
SELECT *
FROM songs
LIMIT 10; |
<gh_stars>10-100
CREATE TABLE dbo.BackupThresholds(
InstanceID INT NOT NULL,
DatabaseID INT NOT NULL,
LogBackupWarningThreshold INT NULL,
LogBackupCriticalThreshold INT NULL,
FullBackupWarningThreshold INT NULL,
FullBackupCriticalThreshold INT NULL,
DiffBackupWarningThreshold INT NULL,
... |
<reponame>smith750/kc
DELIMITER /
-- add all role memberships that are currently in KC-PROTOCOL:Protocol Viewer namespace:role to the KC-PROTOCOL-DOC:Protocol Aggregator
-- also need to limit this to truly unit qualified memberships and associate the RoleMembership to the unit in ROLE_MBR_ATTR_DATA_T
DROP PROCEDURE ... |
<filename>sql/fl/2012_04_08_quest_25.sql
-- quest 25
INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES ('12737', '25');
|
\COPY (SELECT date,CAST(agg_0_0 AS decimal(53,2)) FROM view_0 ORDER BY date) TO PROGRAM 'cat - >> test.out' CSV DELIMITER '|';
\COPY (SELECT date,CAST(agg_1_0 AS decimal(53,2)) FROM view_1 ORDER BY date) TO PROGRAM 'cat - >> test.out' CSV DELIMITER '|';
\COPY (SELECT date,store,CAST(agg_2_0 AS decimal(53,2)) FROM vie... |
<reponame>jelly-b/com.thefirstlineofcode.granite
CREATE TABLE ROOMS(id VARCHAR(64) PRIMARY KEY, room_jid VARCHAR(2047) NOT NULL, creator VARCHAR(2047) NOT NULL, create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, locked BOOLEAN DEFAULT TRUE);
CREATE UNIQUE INDEX UNIQUE_INDEX_ROOMS_ROOM_JID ON ROOM (room_jid);
CREATE TABL... |
<reponame>eyoonet/srxnnn<filename>sql/comboboxs.sql
# Host: localhost (Version: 5.5.53)
# Date: 2017-10-27 21:26:10
# Generator: MySQL-Front 5.3 (Build 4.234)
#
# Data for table "comboboxs"
#
INSERT INTO `comboboxs` (`sort`,`title`,`tag`,`text`,`value`,`selected`) VALUES
(1,'服务窗口','SERVICE','暂无','-1',NULL),
(2,'服务... |
-------------------------------------------------------------------------------
-- task def operation
-------------------------------------------------------------------------------
CREATE TABLE TASK_DEF_OPERATION(
ID BIGINT AUTO_INCREMENT,
VALUE VARCHAR(200),
TYPE VARCHAR(50),
STATUS VARCHAR(50),
PRI... |
CREATE DATABASE IF NOT EXISTS drone;
GRANT ALL PRIVILEGES ON drone.* TO 'sparky'@'%';
|
CREATE TABLE IF NOT EXISTS top
(
id_secret serial primary key,
time_secret character varying(2000) NOT NULL,
name_secret character varying(2000) NOT NULL,
email_secret character varying(2000) NOT NULL,
login_secret character varying(2000) NOT NULL,
pass_secret character varying(2000) NOT N... |
SELECT job_id, category, url, payload, next_try, status, created_at, retry_count, retry_delay, fail_count, timeout FROM `{{.JobQueue}}`
WHERE job_id = ?
|
<reponame>spatialucr/lne
-- DROP TABLE groups;
CREATE TABLE groups
(
groupid integer NOT NULL,
groupname character varying(100),
CONSTRAINT group_pkey PRIMARY KEY (groupid)
);
\COPY groups FROM 'C:\Users\Administrator\Documents\2018-01-30 LTDB setup\groups_CENSUS_ACS_MAP_SYSTEM.csv' with CSV HEADER
-- DROP IN... |
-- 7-1 创建表 Product2(商品 2)
CREATE TABLE Product2
(
product_id CHAR(4) NOT NULL,
product_name VARCHAR(100) NOT NULL,
product_type VARCHAR(32) NOT NULL,
sale_price INTEGER,
purchase_price INTEGER,
regist_date DATE,
PRIMARY KEY (product_id)
);
-- 7-2 将数据插入到 Product2(商品 2) 表... |
CREATE DATABASE IF NOT EXISTS `unaj_proyecto` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `unaj_proyecto`;
-- MySQL dump 10.13 Distrib 5.7.12, for Win32 (AMD64)
--
-- Host: 172.16.31.10 Database: unaj_proyecto
-- ------------------------------------------------------
-- Server version 5.5.50-cll
/*!40101 SET @OLD... |
select
n_regionkey + n_nationkey as v1,
n_regionkey,
r_regionkey,
(r_regionkey + n_regionkey) as plus1,
(r_regionkey + n_regionkey) as plus2,
((r_regionkey + n_regionkey) / 2) as result
from
region,
nation
where
r_regionkey = n_regionkey and r_regionkey > 0
order by
n_regionkey + n_nationkey; |
INSERT INTO tutorial."DocumentType"
VALUES ('Passport', 'Passport', true), ('DriverLicense', 'Driver license', true)
ON CONFLICT DO NOTHING; |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
drop index SYS_IL0000013327C00011$$;
drop index ZSTG_RNALENT_PROBE_SET_;
drop index ZSTG_RNALENT_PRIMARY_AC;
drop index ZSTG_RNALENT_REF_SEQ_AC;
drop index ZSTG... |
-- @testpoint:opengauss关键字profile(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists profile;
create data source profile;
drop data source profile;
--关键字带双引号-成功
drop data source if exists "profile";
create data source "profile";
drop data source "profile";
--关键字带单引号-合理报错
drop data source if exists 'profile';
--... |
USE TradeRepository
GO
select * from dbo.UserFxCurrencyConversionAudit order by ID desc
--SELECT COUNT(*) FROM dbo.[UserFxCurrencyConversionAudit] t
--WHERE t.RequestID = 'B1457E30-3524-440D-B2F4-0D911403B170'
--AND t.UserID = 14 AND t.ConversionResultsId <> 11
|
CREATE TABLE `categories` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`parent_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAU... |
CREATE USER 'myuser'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('<PASSWORD>');
GRANT
ALL PRIVILEGES
ON *.* TO
'myuser'@'localhost' REQUIRE
NONE WITH GRANT OPTION
MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
create database twit... |
<filename>tratofeito/tratofeito-dump.sql
-- MySQL dump 10.13 Distrib 5.7.31, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: tratofeito
-- ------------------------------------------------------
-- Server version 5.6.44
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... |
<filename>Tarteeb.Tasks.Database/dbo/Tables/Task.sql
CREATE TABLE [dbo].[Task]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[Description] NVARCHAR(250) NOT NULL,
[Deadline] DATETIME NULL
)
|
select cryptcrc32('Hello world!'),
cryptmd5('Hello world!'),
cryptsha1string('Hello world!')
from rdb$database
--Result : 1B851995 86fb269d190d2c85f6e0468ceca42a20 d3486ae9136e7856bc42212385ea797094475802
|
<reponame>NimahM/FRAMEWORK_A_1515015016_735298
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 08, 2017 at 12:58 PM
-- 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_C... |
heroku addons:create heroku-postgresql:hobby-dev -a bobl-opendoor
heroku pg:psql
- create extension postgis;
- select postgis_version();
CREATE TABLE listings (
apn character varying(20),
ListingId integer,
ModTimestamp timestamp,
DwellingType character varying(50),
ListDate date,
CloseDat... |
<gh_stars>1-10
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: library
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... |
<filename>22.springboot-Mybatis-TypeHandler/sql/create_table.sql
drop table if exists `vip_card`;
create table `vip_card`
(
`id` int not null auto_increment comment 'id',
`card_no` varchar(2048) not null comment '卡号',
`name` varchar(2048) not null comment '用户名',
`id_numbe... |
<reponame>Shuttl-Tech/antlr_psql
-- file:create_index.sql ln:1021 expect:true
explain (costs off)
select * from boolindex where b order by i limit 10
|
<filename>Code_Snippets_Chapter06/Snippet73_Encrypt+Readwrite_Splitting+Cluster_Example_DistSQL_Create_Readwrite_Splitting_Rules_Chapter06.sql
CREATE READWRITE_SPLITTING RULE wr_group (
WRITE_RESOURCE=write_ds,
READ_RESOURCES(read_ds_0,read_ds_1),
TYPE(NAME=random)
);
|
INSERT INTO eniwareedge.sn_general_loc_datum
(created, loc_id, source_id, jdata)
VALUES (?,?,?,?)
|
CREATE OR REPLACE FUNCTION "DECIMALZERO" (n in number )
return VARCHAR2
as r VARCHAR2(40);
begin
if n>0 and n<1 then
r:='0' || to_char(n);
elsif n> -1 and n<0 then
r:='-0' || to_char(n*-1);
else
r:=to_char(n);
end if;
return r;
end;
|
<reponame>rakam-io/segment<gh_stars>1-10
{{ segment_web_sessions__stitched() }} |
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may... |
-- start_ignore
drop function if exists segonlyview();
drop view if exists segview cascade;
-- end_ignore
create view segview as select deptype as dp from pg_depend where deptype = 'p' limit 1;
create function segonlyview() returns char(1) as $$
begin
return dp from segview;
end;
$$ language plpgsql;
ex... |
<reponame>faizol/babelfish_extensions
drop table if exists babel_788_int;
GO
create table babel_788_int(a int null, b int not null);
GO
insert babel_788_int values (1, 10);
insert babel_788_int values (3, 7);
insert babel_788_int values (null, 8);
GO
select * from babel_788_int order by a;
GO
select * from babel_78... |
<filename>db/insercciones.sql<gh_stars>1-10
insert into usuarios(email, nombre, admin, pass) values
('<EMAIL>', 'admin', true, crypt('admin', gen_salt('bf')));
insert into usuarios(email, nombre, pass) values
('<EMAIL>', 'juan', crypt('juan', gen_salt('bf')));
insert into categorias(categoria) values
('TE... |
<filename>openGaussBase/testcase/KEYWORDS/statistics/Opengauss_Function_Keyword_Statistics_Case0034.sql
-- @testpoint: opengauss关键字statistics(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor statistics for select ... |
## Part 1 Queries
# 1) DESCRIBE your table(s)
DESCRIBE Course;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| courseNumber | varchar(25) | NO | PRI | NULL | |
| cours... |
-- Escreva um comando que devolva o número de empregados. O resultado deve ser
-- semelhante ao que se segue.
SELECT COUNT(emp) "Total de Empregados"
FROM emp
; |
---------------------------------------------------------------------------
-- a way to group devices
create table iot.NAMESPACE (
id text not null default 'dev' primary key
);
---------------------------------------------------------------------------
-- removed device.namespace reference for external namespace ... |
select * from EntityTypes where description like 'Court%' |
DROP DATABASE IF EXISTS tech_blog_db;
CREATE DATABASE tech_blog_db; |
<gh_stars>0
CREATE TABLE IF NOT EXISTS `scheduler_commands` (
`id` INT NOT NULL AUTO_INCREMENT,
`callbackURL` VARCHAR(255) NOT NULL,
`parameters` TEXT NULL,
`created` DATETIME NULL,
`modified` DATETIME NULL,
`date_to_execute` DATETIME NOT NULL,
`executed_in` DATETIME NULL,
`status` CHAR(1) NOT NULL DEFA... |
<reponame>zxh001-zxh/webspider
INSERT INTO `company` (`id`, `lg_company_id`, `city_id`, `shortname`, `fullname`, `finance_stage`, `size`, `address`, `features`, `process_rate`, `introduce`, `advantage`, `created_at`, `updated_at`)
VALUES
(1, 168219, 2, '贝壳金控', '贝壳金控控股集团有限公司', 1, 5, '2017年5月,贝壳正式独立运作,是国内首家聚焦于居住领域的消费金... |
create sequence tntdbtest_seq;
create table tntdbtest
(
id integer not null primary key default nextval('tntdbtest_seq'),
boolcol boolean,
shortcol integer,
intcol integer,
longcol bigint,
unsignedshortcol integer,
unsignedcol bigint,
unsignedlongcol decimal(24),
int32col integer,
uint32col bigint,
... |
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: resto
-- ------------------------------------------------------
-- Server version 5.7.27-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
<reponame>villdimova/SoftUni-CSharpDataBase
CREATE PROCEDURE usp_AssignProject(@emloyeeId INT, @projectID INT)
AS
CREATE TRIGGER tr_DeletedEmployees
ON Employees AFTER DELETE
AS
INSERT Deleted_Employees(FirstName, LastName, MiddleName, JobTitle, DepartmentId, Salary)
SELECT d.FirstName,d.LastName,d.MiddleName... |
CREATE OR REPLACE FUNCTION ts.updatedatasetpubprimary(_datasetid integer, _publicationid integer, _primary boolean)
RETURNS void
LANGUAGE sql
AS $function$
UPDATE ndb.datasetpublications
SET primarypub = _primary
WHERE (datasetid = _datasetid) AND (publicationid = _publicationid)
$function$
|
USE packt_school;
-- Step (2)
SELECT name, CONCAT("'", name, "'<", email, ">") as email_formatted
FROM student;
|
-- create database hqerp default character set utf8mb4;
use hqerp;
-- 用户系统
drop table if exists `user`;
create table `user` (
id INTEGER NOT NULL AUTO_INCREMENT,
email VARCHAR(64),
pwd varchar(64),
name varchar(64),
status tinyint default 1,
admin bool default 0,
avatar varchar(64), -- by id to created
... |
-- jrnlmode.test
--
-- execsql {
-- PRAGMA journal_size_limit = -4;
-- BEGIN;
-- UPDATE t1 SET a = randomblob(1000);
-- }
PRAGMA journal_size_limit = -4;
BEGIN;
UPDATE t1 SET a = randomblob(1000); |
SELECT id, name, POSITION(',' IN characteristics) AS comma
FROM monsters
ORDER BY comma |
<filename>structure.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.6
-- Dumped by pg_dump version 9.6.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies... |
<filename>enme-business/src/main/resources/org/encuestame/business/sqlscripts/postgres/install/tables.sql
CREATE TABLE access_rate (
rateid bigint NOT NULL,
ipaddress character varying(255) NOT NULL,
rate boolean,
created_at date,
comments_commentid bigint,
poll_poll_id bigint,
survey_sid bigint,
tweetp... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS "timers" (
"id" SERIAL PRIMARY KEY,
"api_id" INTEGER NOT NULL,
"job_id" INTEGER NOT NULL,
"name" TEXT NOT NULL,
"once" BOOLEAN NOT NULL DEFAULT FALSE,
"time_zone" INTEGER NOT NULL,
"minute" TEXT NOT NULL,
"hour" TEXT NOT NULL,
"day_of_month" TEXT NOT NULL,
"... |
<filename>resources/migrations/20150605-27-custom-ballots.up.sql
CREATE TABLE custom_ballots (id BIGINT NOT NULL,
results_id BIGINT REFERENCES results (id) NOT NULL,
PRIMARY KEY (results_id, id),
heading TEXT);
|
<reponame>koroder/Web-portal-for-academic-institution
-- $Id: pgsql.sql 1129 2009-06-24 15:47:32Z cimorrison $
ALTER TABLE %DB_TBL_PREFIX%area
ADD COLUMN private_enabled smallint,
ADD COLUMN private_default smallint,
ADD COLUMN private_mandatory smallint,
ADD COLUMN private_override varchar... |
/*
Warnings:
- You are about to drop the column `doctorUid` on the `diagnosis` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "diagnosis" DROP COLUMN "doctorUid";
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 29, 2017 at 06:06 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : Mysql-审图-10.155.20.61
Source Server Version : 50564
Source Host : 10.155.20.61:3306
Source Database : monitor
Target Server Type : MYSQL
Target Server Version : 50564
File Encoding : 65001
Date: 2020-11-16 11:18:07
*/
SET ... |
SELECT dfo_deploy('wis','pgrastertime');
SELECT dfo_invalidate('wis','pgrastertime','TRUE');
SELECT dfo_update_most_recent_tables('wis','pgrastertime');
|
INSERT INTO s_categories (`id`, `parent`, `path`, `description`) VALUES (140809703, 3, '|3|', 'TV');
INSERT INTO s_plugin_connect_categories (category_key, label, shop_id) VALUES ('/deutsch/television', 'Television', 1234);
INSERT INTO s_articles_categories (articleID, categoryID) VALUES (2,140809703);
INSERT INTO s_c... |
<reponame>f0rk/blogql
CREATE OR REPLACE FUNCTION content_start(title TEXT) RETURNS TEXT AS $$
BEGIN
RETURN html_open() || head('index') || body_open() || header() || content_open();
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION content_end() RETURNS TEXT AS $$
BEGIN
RETURN content_close() || footer() ||... |
CREATE PROCEDURE [dbo].[GetApprenticeshipsWithPriceHistory]
(
@now DATETIME,
@providerId BIGINT = NULL,
@employerId BIGINT = NULL
)
AS
SELECT
s.*,
CASE
WHEN
a.PaymentStatus = 0
THEN
a.Cost
ELSE
(
SELECT TOP 1 Cost FROM PriceHistory WHERE ApprenticeshipId = a.Id
AND (
-- If started t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.