sql stringlengths 6 1.05M |
|---|
<filename>data/open-source/extracted_sql/enthought_encore.sql
select name from sqlite_master where type='table' and name=?
create table %s ( key text primary key, metadata dict, created float, modified float, data blob )
create table store ( key text primary key, metadata dict, created float, modified float, data blob ... |
<reponame>timshadel/subdivision-list
CREATE TABLE subdivision_CL (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_CL" ("id", "name", "level") VALUES ('CL-AN', 'Antofagasta', 'region');
INSERT INTO "subdivision_CL" ("id", "name", "level") VALUES ('CL-AI'... |
USE SoftUni
-- Ex. 2
SELECT * FROM Departments
-- Ex. 3
SELECT [Name] FROM Departments
-- Ex. 4
SELECT FirstName, LastName, Salary FROM Employees
-- Ex. 5
SELECT FirstName, MiddleName, LastName FROM Employees
-- Ex. 6
SELECT FirstName + '.' + LastName + '@softuni.bg' AS [Full Email Address]
FROM Employees
-- Ex.... |
CREATE TABLE ad_network_analytics_sync_query_result (
query_id Nullable(String)
)
ENGINE = Log
|
<filename>examples/manytomany/migrations/0000/migrations.sql
CREATE TABLE users ();
CREATE TABLE games ();
CREATE TABLE players ();
CREATE TABLE _migrations ();
ALTER TABLE users ADD COLUMN name VARCHAR(32);
ALTER TABLE games ADD COLUMN id_ SERIAL;
ALTER TABLE players ADD COLUMN username VARCHAR(32);
ALTER TABLE player... |
SET NAMES 'utf8';
DROP TABLE IF EXISTS `cache_waypoint_pool`;
CREATE TABLE `cache_waypoint_pool` (
`wp_oc` char(7) NOT NULL,
`uuid` varchar(36) DEFAULT NULL,
PRIMARY KEY (`wp_oc`),
UNIQUE KEY `uuid` (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ;
|
LINE ONE;
LINE TWO;
|
<filename>common/db/person/get_by_email_hash.sql
select id, exterior, interior from c_person where (interior -> 'email_hashes') ? $1 order by id limit 1;
|
CREATE TABLE Owner( OwnerID INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,OwnerNAME VARCHAR(30) NOT NULL,OwnerADDRESS VARCHAR(30) NOT NULL,OwnerCITY VARCHAR(30) NOT NULL,OwnerSTATE VARCHAR(30) NOT NULL,OwnerCOUNTRY VARCHAR(30) NOT NULL,OwnerZIPCODE VARCHAR(30) NOT NULL)
|
<gh_stars>0
/* The function action_enter_edit_folders inserts or updates a record in the report_folders table
_in_data:
{
folder_id:
folder_name:
folder_display_name:
description:
parent_folder_name:
is_root_folder: -- boolean
changing_user_login:
enter_or_update:
}
* The json object... |
ALTER TABLE ITEM ADD COLUMN PATH VARCHAR ( 1000 ) ;
|
<filename>sql/derived_tables/holdings_statements_supplements.sql
DROP TABLE IF EXISTS holdings_statements_supplements;
-- This table contains holdings statements for supplements with their
-- associated public/staff only notes; regular holdings statements and
-- holdings statements for indexes are in separate tables. ... |
SET CURRENT SCHEMA=SEC_OWNER;
INSERT
INTO SECM_CATEGORIZATION
(
CATEG_ID,
CATEG_TYPE,
CATEG_DESC,
ONBOARD_DATE,
END_DATE,
LAST_UPDATE_DATE,
LAST_UPDATE_BY
)
VALUES
(
1,
'Expected Unmatched',
'Any Back Office transaction which has been deliberately excluded from the Securitas m... |
-- unix accounts: add a group for SCM read-only access
-- + rename scm_xxx to xxx_scmrw
UPDATE nss_groups
SET name=substr(nss_groups.name, 5)||'_scmrw'
WHERE gid > 50000;
INSERT INTO nss_groups
SELECT group_id,name||'_scmro',group_id+100000
FROM nss_groups
WHERE gid < 50000;
-- Next: 2015040... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [Profile.Import].[Beta.LoadData] (@SourceDBName varchar(max))
AS BEGIN
SET NOCOUNT ON;
/*
This stored procedure imports a subset of data from a Profiles RNS Beta
instance into the Profiles RNS 1.0 Extended Schema tables.
Input paramete... |
select ceil(cast(1 as BIGINT)) from db_root;
select ceil(cast(1 as SHORT)) from db_root;
select ceil(cast(1 as FLOAT)) from db_root;
select ceil(cast(1 as DOUBLE)) from db_root;
select ceil(cast(1 as MONETARY)) from db_root;
select ceil(cast(1 as INTEGER)) from db_root;
select ceil(cast(1 as NUMERIC(15,5))) from db_roo... |
ALTER TABLE extracurricular_courses CHANGE ext_cou_name ext_cou_name VARCHAR(30) NOT NULL; ALTER TABLE extracurricular_courses CHANGE start_date start_date DATE NOT NULL; ALTER TABLE extracurricular_courses CHANGE limit_participants limit_participants TINYINT NOT NULL; ALTER TABLE extracurricular_courses CHANGE cost c... |
<filename>assets/db_scripts/users.sql
INSERT INTO users (name, email, password, remember_token, cidadao_id, tipo_id)
VALUES ('Mateus', '<EMAIL>', '123456', '123456', '1', '1'); |
-- 创建weather_day表
CREATE TABLE
weather_day
(
id BIGINT NOT NULL AUTO_INCREMENT,
areaName VARCHAR(40),
areaCode VARCHAR(40),
yearMonth VARCHAR(8),
date VARCHAR(12),
year VARCHAR(6),
month VARCHAR(2),
day VARCHAR(2),
temperatureMax DOUBLE,
temperatureMin DOUBLE,
summ... |
<filename>database/Temp/siujian Belum Inggris.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 21, 2019 at 10:50 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
ST... |
<filename>+usados/Novos/Library Cache/keeper-7.3.sql
-------------------------------------------------------------------------------
--
-- Script: keeper.sql
-- Purpose: to "keep" reusable objects while free memory is abundant
-- For: 7.3
--
-- Copyright: (c) Ixora Pty Ltd
-- Author: <NAME>
--
-- Description:... |
<reponame>linhhuynh1998/DuAnWebsite
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 27, 2020 lúc 06:46 AM
-- Phiên bản máy phục vụ: 10.4.13-MariaDB
-- Phiên bản PHP: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone ... |
<filename>dbfile/test.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.3.11
-- Generation Time: Dec 20, 2021 at 12:54 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... |
drop database w3motors;
create database w3motors;
use w3motors;
create table veiculos(
id int auto_increment primary key,
nome varchar(80),
marca varchar(80),
descricao varchar(150),
ano varchar(10),
valor decimal(8,2),
km int,
imagem varchar(50),
dataCadastro date,
carroAtivo boolean
);
... |
CREATE FUNCTION udf_GetCost(@jobId INT)
RETURNS DECIMAL(6,2)
AS
BEGIN
DECLARE @totalSum DECIMAL(6,2) = (SELECT ISNULL(SUM(P.Price * op.Quantity), 0) AS Result FROM Parts AS p
JOIN OrderParts AS op ON op.PartId = p.PartId
JOIN Orders AS o ON o.OrderId = op.OrderId
JOIN Jobs AS jo ON jo.JobId = o.JobId
WHERE jo.JobI... |
------------------------------------------------- PART B ----------------------------------------------------------------------------
-- 1ST QUERY) --Movies_per_year--
SELECT NEW.year_released,COUNT(*) AS movies_per_year
FROM "Movies_Metadata",(SELECT DISTINCT extract(year FROM release_date) AS year_released FROM "... |
<reponame>jaymegordo/SMSEventLog
EXEC sp_rename 'Bitmex.VolBTC', 'volume', 'COLUMN';
|
<gh_stars>0
INSERT INTO eg_demand_reason_master
(id, reasonmaster, category, isdebit, module, code, "order", create_date, modified_date, isdemand)
VALUES(nextval('seq_eg_demand_reason_master'), 'Early Payment Rebate', (select id from eg_reason_category where code='REBATE'), 'N', (select id from eg_module where name = '... |
CREATE TABLE `auction`
(
`id` BIGINT NOT NULL PRIMARY KEY,
`item_code` VARCHAR2,
`status` ENUM ('RUNNING', 'OVER'),
`min_base_price` DOUBLE,
`step_price` DOUBLE,
`max_bid_amount` DOUBLE
);
CREATE INDEX item_code ON `auction` (`item_code`);
CREATE TABLE `user`
(
... |
<reponame>pdv-ru/ClickHouse<filename>tests/queries/0_stateless/02111_function_mapExtractKeyLike.sql
DROP TABLE IF EXISTS map_extractKeyLike_test;
CREATE TABLE map_extractKeyLike_test (id UInt32, map Map(String, String)) Engine=MergeTree() ORDER BY id settings index_granularity=2;
INSERT INTO map_extractKeyLike_test V... |
/********************************************************************************
file-centric-snapshot-ie-translated-concepts.sql
Assertion:
Newly added active International concept must have at least one active preferred term in the Irish language refset RF2 file.
**********************************************... |
<reponame>kiva/guardian-bio-auth
ALTER TABLE kiva_biometric_template
RENAME COLUMN did TO agent_id;
ALTER TABLE kiva_biometric_template
RENAME CONSTRAINT unique_did_postion_template_constraint TO unique_agent_id_position_template_constraint; |
<gh_stars>0
DROP TABLE `#__{{extension.name.lower}}_{{controller.list.name.lower}}`; |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5ubuntu0.5
-- https://www.phpmyadmin.net/
--
-- Хост: localhost:3306
-- Время создания: Дек 08 2020 г., 02:38
-- Версия сервера: 5.7.32-0ubuntu0.18.04.1
-- Версия PHP: 7.2.24-0ubuntu0.18.04.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>1-10
DROP TABLE IF EXISTS access_whitelist;
|
CREATE ROLE address_book_user LOGIN;
ALTER ROLE address_book_user WITH PASSWORD '<PASSWORD>';
CREATE DATABASE address_book;
CREATE DATABASE address_book_test;
GRANT ALL PRIVILEGES ON DATABASE address_book TO address_book_user;
GRANT ALL PRIVILEGES ON DATABASE address_book_test TO address_book_user;
|
<reponame>olgarozhdestvina/Applied-Databases
CREATE TABLE feedback (
student_id UUID NOT NULL REFERENCES student(student_id),
course_id UUID NOT NULL REFERENCES course(course_id),
feedback TEXT,
rating rating,
CONSTRAINT pk_feedback PRIMARY KEY (student_id, course_id)
); |
<filename>db-drop-all.sql
drop table if exists example;
|
<filename>src/test/resources/sql-data.sql
INSERT INTO `customers` (`first_name`, `surname`) VALUES ('jordan', 'harrison');
insert into `items` (`item_name`, `item_price`) values ('crisps', '0.5');
insert into 'orders'( `Cust_id`, `Item_id`, `item_quantity`) values('1' , '1', '10'); |
create table api_users (
username VARCHAR(255) not null primary key,
password VARCHAR(255) not null,
roles VARCHAR(255) not null
); |
<filename>db/cassandra/cql/device_events.cql
// https://jaxenter.com/apache-cassandra-iot-174970.html
CREATE KEYSPACE IF NOT EXISTS devices
WITH replication = {
'class' : 'SimpleStrategy',
'replication_factor' : 1
};
-- All events by device
CREATE TABLE IF NOT EXISTS devices.events_by_devi... |
<reponame>franciscopugh/postgreSQL-Nodejs-Rest-Api
CREATE DATABASE firstapi;
CREATE TABLE users(
id SERIAL PRIMARY KEY,
name VARCHAR(40),
email TEXT
);
INSERT INTO users(name, email) VALUES
('Emily', '<EMAIL>'),
('Diego', '<EMAIL>'); |
/*
Problem statement: https://www.hackerrank.com/challenges/what-type-of-triangle/problem
*/
SELECT CASE
WHEN A+B>C AND B+C>A AND A+C>B THEN
CASE
WHEN A=B AND B=C THEN 'Equilateral'
WHEN A=B or A=C OR B=C THEN 'Isosceles'
ELSE 'Scalene'
END
ELSE 'Not A Trian... |
<filename>migrations/sqls/20191018202851-multi-event-leads-up.sql
CREATE TABLE IF NOT EXISTS leadEvents (
id INT AUTO_INCREMENT PRIMARY KEY,
leadId INT,
eventId INT,
FOREIGN KEY (leadId) REFERENCES leads(id),
FOREIGN KEY (eventId) REFERENCES events(id)
);
SET FOREIGN_KEY_CHECKS = 0;
ALTER TABLE leads DROP FO... |
set term ^;
create function new_function(i int) returns int
as
begin
return i + 1;
end^
set term ;^ |
<reponame>YPermitin/YY.EventLogExportAssistant<gh_stars>10-100
create table if not exists applications
(
InformationSystemId bigint not null,
Id bigint auto_increment,
Name varchar(500) null,
primary key (Id, InformationSystemId),
constraint IX_Applications_InformationSystemId_Id
unique (InformationSystemId, Id)... |
<filename>src/sql-config/dbmigrate/203_create_or_update_shop2supplier.sql
-- Function: oms.create_or_update_shop2supplier(boolean, bigint, bigint, character varying, character varying, bigint, boolean)
-- DROP FUNCTION oms.create_or_update_shop2supplier(boolean, bigint, bigint, character varying, character varying, b... |
<filename>bin/src/main/scripts/db/create-appservspringbank-mariadb.sql
-- Assumes the database already exists. The spring app uses the database name `appservspringbank`,
-- create such a database before running this script. Run the script with the command
-- mysql appservspringbank < src/scripts/db/create-appservspring... |
<reponame>gianadda/ZenPRM
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'uspReactivateEntityProjectByIdent') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE uspReactivateEntityProjectByIdent
GO
/* uspReactivateEntityProjectByIdent
*
*
*
*
*/
CREATE PROCEDURE [dbo].[uspReactivateEntity... |
select sum(add_to_cart_order)
from order_products;
|
<filename>oauth-resource-server/backend/migrations/20210216211829_INSERT_ADMIN_USER.sql
insert into user_entity(version, identifier, first_name, last_name, user_id, admin)
values (1, uuid_generate_v4(), 'u1', 'u1', '679a5d15-686d-431b-9b7c-a4843914c066', true); |
<gh_stars>1-10
CREATE EXTENSION IF NOT EXISTS anon CASCADE;
SELECT anon.start_dynamic_masking();
CREATE TABLE t1 (
id TEXT,
name TEXT,
creditcard TEXT,
fk_compx TEXT --remove 'x' will fix the problem
);
-- remove one the 2 comments will fix the problem
COMMENT ON COLUMN t1.name IS ' MASKED WITH FUNCTION anon.ran... |
<gh_stars>1-10
-- Revert nz-buildings:buildings_lds/schema_and_tables from pg
BEGIN;
DROP SCHEMA buildings_lds CASCADE;
COMMIT;
|
<gh_stars>0
CREATE TABLE public.departments
(
id SERIAL PRIMARY KEY,
name VARCHAR(20) NOT NULL
);
CREATE TABLE public.students
(
id SERIAL PRIMARY KEY,
department_id INT NOT NULL REFERENCES departments (id),
first_name VARCHAR(20) NOT NULL,
last_name VARCHAR(20) NOT NULL
);
|
<gh_stars>0
SET FOREIGN_KEY_CHECKS = 0;
INSERT INTO emedic.posts (id, author_id, category_id, title, seo_title, excerpt, body, image, slug, meta_description, meta_keywords, status, featured, created_at, updated_at) VALUES (1, 0, null, 'Lorem Ipsum Post', null, 'This is the excerpt for the Lorem Ipsum Post', '<p>This i... |
<reponame>mariomoren00/ionic-api-rest
# ************************************************************
# Sequel Pro SQL dump
# Versión 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.18)
# Base de datos: blog
# Tiempo de Generación: 2018-01-26 03:38:50 +0000
# **... |
<filename>src/main/resources/db/migration/V1.0__initialize_database.sql<gh_stars>0
CREATE DATABASE IF NOT EXISTS hermes; |
<reponame>kadkas/newsapp
-- Adminer 4.6.2 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `newsapp`;
CREATE DATABASE `newsapp` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `newsapp`;
DROP TABLE IF EXISTS `posts`;
CREATE T... |
<filename>FUNCTIONS/parse_attestation_object.sql
CREATE OR REPLACE FUNCTION webauthn.parse_attestation_object(
OUT rp_id_hash bytea,
OUT user_present boolean,
OUT user_verified boolean,
OUT attested_credential_data_included boolean,
OUT extension_data_included boolean,
OUT sign_count bigint,
OUT aaguid by... |
<filename>armchair.sql<gh_stars>0
-- ----------------------------
-- Table structure for BLOCK
-- ----------------------------
DROP TABLE IF EXISTS "public"."BLOCK";
CREATE TABLE "public"."BLOCK" (
"pid" int4,
"blk" varchar(255) COLLATE "default",
"brcv" varchar(255) COLLATE "default"
)
WITH (OIDS=FALSE);
ALTER ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : ven. 15 déc. 2017 à 02:15
-- Version du serveur : 10.1.28-MariaDB
-- Version de PHP : 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00... |
/* free temp space */
SELECT tablespace_name,
total_blocks,
used_blocks,
free_blocks,
total_blocks*16/1024 AS total_MB,
used_blocks *16/1024 AS used_MB,
free_blocks *16/1024 AS free_MB
FROM v$sort_segment;
/* segment usage */
SELECT b.TABLESPACE,
b.segfile#,
b.segblk#,
b.blocks,
b.blocks*16/1024 AS... |
<gh_stars>0
CREATE PROCEDURE [dbo].[spCategory_Delete]
@Id int
AS
begin
set nocount on;
delete from Category where Id = @Id;
end
|
<filename>logbook.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 12, 2020 at 06:14 PM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
INSERT INTO quintweb.cliente (idcliente,nifcliente,nomecliente,morada,pais,email,telemovel,tipocliente) VALUES
(47576,123456789,'Gustavo','Lisboa','Portugal','<EMAIL>',926065477,'individual'),
(47587,987654321,'Leonor','Luanda','Angola','<EMAIL>',920000000,'empresa'),
(47594,246813579,'Tiago','Berlim','Alemanh... |
ALTER TABLE authorizations DROP COLUMN attempts;
|
begin;
create temporary table r (
rk serial,
team text,
team_id text,
year integer,
str numeric(4,3),
ofs numeric(4,3),
dfs numeric(4,3),
sos numeric(4,3)
);
insert into r
(team,team_id,year,str,ofs,dfs,sos)
(
select
coalesce(s.team_name,sf.team_id::tex... |
<reponame>censusreporter/census-postgres
DROP TABLE IF EXISTS dec2010_pl94.geoheader;
CREATE TABLE dec2010_pl94.geoheader (
FILEID varchar(6),
STUSAB varchar(2),
SUMLEV varchar(3),
GEOCOMP varchar(2),
CHARITER varchar(3),
CIFSN varchar(2),
LOGRECNO varchar(7),
REGION varchar(1),
DIVISION varchar(1),
STATE var... |
CREATE FUNCTION media_to_text(media full_link) RETURNS text
LANGUAGE sql STABLE
AS $_$
SELECT media.title || ' ' || media.attribution;
$_$;
CREATE FUNCTION media_to_text(media full_file) RETURNS text
LANGUAGE sql STABLE
AS $_$
SELECT media.title || ' ' || media.attribution;
$_$;
CREATE FUNCTION medialist_to_t... |
CREATE TABLE boards (
name TEXT NOT NULL PRIMARY KEY,
full_images BOOL NOT NULL,
archive BOOL NOT NULL
); |
-- file:rangefuncs.sql ln:187 expect:true
SELECT * FROM getfoo9(1) WITH ORDINALITY AS t1(a,b,c,o)
|
CREATE VIEW [dbo].[AzureDBElasticPoolResourceStats_Raw]
AS
SELECT P.InstanceID,
P.PoolID,
P.elastic_pool_name,
RS.end_time,
RS.avg_cpu_percent,
RS.avg_data_io_percent,
RS.avg_log_write_percent,
RS.avg_storage_percent as max_storage_percent,
RS.avg_storage_percent,
RS.max_worker_percent,
RS.max_ses... |
<gh_stars>0
ALTER TABLE `lh_abstract_chat_variable` ADD `old_js_id` varchar(50) NOT NULL, COMMENT=''; |
/* update values*/
USE packt_online_shop;
UPDATE department SET departmentEstDate=NOW(); |
<gh_stars>0
# Calculate genome callability for each genome in the genome calls table.
SELECT
call.call_set_name,
reference_name,
contig.len,
num_SNVs,
num_REFs,
(num_SNVs + num_REFs) AS num_called_point_pos,
ROUND((num_SNVs + num_REFs) / contig.len, 3) AS prop_w_point_ino,
(contig.len - (num_SNVs + num_REFs)) AS pos_n... |
/*sql server OMOP CDM Indices*/
/************************
Standardized clinical data
************************/
CREATE CLUSTERED INDEX idx_person_id ON ohdsi.dbo.person (person_id ASC);
CREATE INDEX idx_gender ON ohdsi.dbo.person (gender_concept_id ASC);
CREATE CLUSTERED INDEX idx_observation_period_id_1 ON ohdsi.... |
<filename>example/card-operations/src/test/resources/test_data.sql
INSERT INTO BALANCE(ID_BALANCE, BALANCE, ID_CUSTOMER, LAST_UPDATE, WITHDRAW_LIMIT) VALUES (1, 100.00, NULL, NULL, NULL);
|
<reponame>Rob--W/phabricator
ALTER TABLE {$NAMESPACE}_user.user
ADD availabilityCache VARCHAR(255) COLLATE {$COLLATE_TEXT};
ALTER TABLE {$NAMESPACE}_user.user
ADD availabilityCacheTTL INT UNSIGNED;
|
-- @testpoint:openGauss保留关键字Cast作为 用户名,
--不带引号,合理报错
CREATE USER Cast PASSWORD '<PASSWORD>';
--加双引号,创建成功
drop user if exists "Cast";
CREATE USER "Cast" PASSWORD '<PASSWORD>';
--清理环境
drop user "Cast";
--加单引号,合理报错
CREATE USER 'Cast' PASSWORD '<PASSWORD>';
--加反引号,合理报错
CREATE USER `Cast` PASSWORD '<PASSW... |
select old.cnt - new.cnt from (select count(*) as cnt from old_table) old cross join (select count(*) as cnt from new_table) new;
select column1, record_count, sum(record_count) over() as total_record from (select column1, count(*) as record_count from table1 WHERE column1 like '%AB%' group by column1 union all select... |
<reponame>liangzi4000/grab-share-info<gh_stars>0
EXEC [EST].[Proc_yjbb_Ins] @Code = N'603360',@CutoffDate = N'2017-09-30',@EPS = N'0.65',@EPSDeduct = N'0',@Revenue = N'2.96亿',@RevenueYoy = N'0.82',@RevenueQoq = N'10.62',@Profit = N'8146.95万',@ProfitYoy = N'12.22',@ProfiltQoq = N'-0.96',@NAVPerUnit = N'5.0152',@ROE = N'... |
-- 1.
-- Yes, we cannot reference a foreign key in table A if we haven't carete table A
-- 2.
update employees
set salary =salary * 0.8
where age < 25;
-- 3. review
create table Departments (
did integer,
dname varchar(20),
budget real,
manager integer not null,
primary... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET ... |
<filename>DATA_BACKUP/BD5W6_424P_sys_database_permissions.sql
CREATE TABLE sys.database_permissions
(
class tinyint NOT NULL,
class_desc nvarchar(60),
major_id int NOT NULL,
minor_id int NOT NULL,
grantee_principal_id int NOT NULL,
grantor_principal_id int NOT NULL,
type char(4) NOT NULL,
... |
<reponame>brothman1/Spam<gh_stars>0
CREATE SCHEMA admin AUTHORIZATION dbo |
<reponame>wf539/LearningTree925SQLProgrammingLanguageIntro
ALTER TABLE Divisions DROP COLUMN Description; |
SELECT acc.location, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1,
badge as b,
account as acc
WHERE
s.site_id = q1.site_id
AND s.site_id = u1.site_id
AND s.site_id = a1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = b.site_id
AND q1... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Ven 23 Octobre 2015 à 23:38
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS `students` (
`id` int(11) NOT NULL,
`student_id` varchar(12) NOT NULL,
`class_name` varchar(200) NOT NULL,
`class of` int(11) NOT NULL,
`school` text NOT NULL,
`password` varchar(100) NOT NULL,
`firstname` text NOT NULL,
`middle name` text NOT NULL,
`surname` te... |
show procedure status;
DROP PROCEDURE listarEstudiantes;
-- 1. Listar aquellas categoorias que tegan mas de 10 productos.
DELIMITER /
CREATE PROCEDURE listaDeCategoriasQueTenganMasDe(IN numero int(15))
BEGIN
select c.nombre as Categoria, count(p.nombre) as cantidadProducto
from categoria c inner join produ... |
spool tm_db_install.log
SET DEFINE OFF;
declare
type arr_install_objects is table of varchar2(30) index by pls_integer;
l_inst_seq arr_install_objects;
l_inst_tab arr_install_objects;
l_inst_con arr_install_objects;
l_cnt number;
begin
l_inst_seq(1) := 'TM_BACKUP_MESSAGES_SEQ';
l_inst_seq(2)... |
DROP KEYSPACE IF EXISTS users;
CREATE KEYSPACE users
WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
USE users;
DROP TABLE IF EXISTS user_avg;
CREATE TABLE user_avg (
user_id int,
avg_action float,
avg_adventure float,
avg_animation float,
avg_children float,
avg_come... |
<gh_stars>1-10
INSERT INTO users(username, profile_photo_url, bio,email) VALUES
("kanavphull","https://pbs.twimg.com/profile_images/1386885117428191232/70SyHOxP_400x400.jpg","Hedonist yet Spiritual || IT at NITJ 2024",'<EMAIL>'),
('ra<NAME>pta' , '/klsadf893724:f//432' , 'soon to be updated','<EMAIL>'),
('<NAME>' , '... |
<reponame>tgq52298/test
ALTER TABLE `qb_attachment` ADD INDEX ( `uid` );
ALTER TABLE `qb_attachment` ADD INDEX ( `md5` );
ALTER TABLE `qb_memberdata` COMMENT = '用户数据表';
|
-- File generated by Mangos Online Translation Editor (MOTE) v2.10
SET NAMES 'utf8';
UPDATE `trans_words`SET `content_loc3`='About time you woke up. We were ready to toss you into the fire with the others, but it looks like you made it.$B$BI am Mordo, the caretaker of the crypt of Deathknell. And you are the Lich King\... |
create table dtodo (
id bigint auto_increment not null,
name varchar(255),
description varchar(255),
when_created timestamp not null,
when_modified timestamp not null,
version bigint ... |
UPDATE wallet SET name = 'super user (Account 0)', organization = 'Test Hardhat' WHERE lower(address) = lower( '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266');
UPDATE wallet SET name = 'REC Dealer 1', organization = 'Test Hardhat' WHERE lower(address) = lower( '0x70997970C51812dc3A010C7d01b50e0d17dc79C8');
UPDATE wallet
... |
CREATE TABLE IF NOT EXISTS Employee (
empId VARCHAR(128) NOT NULL ,
name VARCHAR(128) NOT NULL,
hireDate DATE NOT NULL,
salary DOUBLE,
PRIMARY KEY (empId)
); |
select os_name, count() from (SELECT CAST('iphone' AS Enum8('iphone' = 1, 'android' = 2)) AS os_name) group by os_name WITH TOTALS;
select toNullable(os_name) AS os_name, count() from (SELECT CAST('iphone' AS Enum8('iphone' = 1, 'android' = 2)) AS os_name) group by os_name WITH TOTALS;
DROP TABLE IF EXISTS auto_assign... |
<gh_stars>10-100
ALTER TABLE device ADD COLUMN technical_installation_date timestamp without time zone;
UPDATE device SET technical_installation_date = LOCALTIMESTAMP WHERE is_activated = TRUE; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.