sql
stringlengths
6
1.05M
create or replace function geocode_poi(lon numeric, lat numeric) returns table ( type text, osm_type text, osm_id bigint, "addr:street" text, "addr:housenumber" text, lon double precision, lat double precision, "name" text, distance numeric ) as $$ with source as ( -- Transform ...
-- no diff CREATE LOCAL TEMP TABLE public.t0 (); CREATE GLOBAL TEMPORARY TABLE IF NOT EXISTS public.t1 (c1 integer) ON COMMIT DELETE ROWS; -- unlogged CREATE UNLOGGED TABLE public.t2 (c1 integer); CREATE TABLE public.t3 (c1 integer); -- inherits CREATE TABLE public.t4 (c1 integer) INHERITS (public.t1); CREATE TABLE p...
BEGIN; ALTER TABLE data DROP COLUMN blob_hash; ALTER TABLE data DROP COLUMN blob_public; DROP INDEX data_blobs; COMMIT;
SELECT col , colecao , lin , linha , art , artigo , ces , conta_estoque , insumo , narrativa , lead , decode(sign(saldo_antes),-1,atraso_antes,0)||' | '|| decode(sign(saldo_agora),-1,atraso_agora,0)||' | '|| decode(sign(saldo_depois),-1,atraso_depois,0) atraso , estoque , minimo -- , reserva_antes , areceber_ante...
<gh_stars>0 SELECT employee.id, name, job_id, title, salary, first_name, last_name, manager_id FROM ((department JOIN job ON department.id = job.department_id) JOIN employee ON job.id = employee.job_id);
<filename>DB.sql<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Máy chủ: 127.0.0.1:3306 -- Thời gian đã tạo: Th8 05, 2021 lúc 03:41 PM -- Phiên bản máy phục vụ: 5.7.31 -- Phiên bản PHP: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; ...
-- phpMyAdmin SQL Dump -- version 5.1.2-dev+20220120.2a906047e0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 01, 2022 at 05:51 PM -- Server version: 10.4.22-MariaDB -- PHP Version: 8.1.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET ...
USE [master]; GO CREATE LOGIN [sqladmin] WITH PASSWORD = <PASSWORD>, SID = 0x3EDB3242A374234FBABD8D27FC1C5A2A, DEFAULT_DATABASE = [master], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF, DEFAULT_LANGUAGE = [us_english]; GO ALTER SERVER ROLE [sysadmin] ADD MEMBER [sqladmin]; GO ALTER LOGIN [sa]...
-- SQL Statements -- SQL keywords are written in CAPS -- Basic Structure of a SQL statement: SELECT ______ FROM ______ JOIN ______ ON ______ WHERE ______ -- Example: SELECT * FROM employees WHERE name LIKE ‘b%’ -- LIKE means “matches a pattern” and % means “starts with” (wildcard). -- Example 2: SELECT products.id, p...
<filename>sql/selects_parquet_partitioned.sql<gh_stars>0 SELECT max(passenger_count) as max_passenger_count FROM nyc_taxi_parquet_partitioned WHERE month = '01' SELECT max(passenger_count) as max_passenger_count FROM nyc_taxi_parquet WHERE MONTH(pickup_datetime) = 1 SELECT max(passenger_count) as max_passenger_coun...
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Versión del servidor: 10.1.21-MariaDB - mariadb.org binary distribution -- SO del servidor: Win32 -- HeidiSQL Versión: 9.4.0.5125 -- ------------------------------------------------...
/* Warnings: - You are about to drop the column `mediaInfo` on the `agentapp` table. All the data in the column will be lost. */ -- AlterTable ALTER TABLE `agentapp` DROP COLUMN `mediaInfo`, ADD COLUMN `mediaInfoId` TINYTEXT NULL; -- CreateTable CREATE TABLE `MediaInfo` ( `id` VARCHAR(191) NOT NULL, ...
<gh_stars>0 /* Procedure for deleting items from gyms */ CREATE PROCEDURE delete_item_from_gym(gym_title_arg varchar, item_title_arg varchar) LANGUAGE SQL AS $$ UPDATE fitness.gym_x_item set valid_to_dttm = now() WHERE gym_id in (SELECT gym.id from fitness.gym where gym.gym_title = gym_title_arg) and item_id in (SELECT...
<filename>DaiJiale-JSP/studentManage/StudentsGroup_2016-04-05.sql # ************************************************************ # Sequel Pro SQL dump # Version 4135 # # http://www.sequelpro.com/ # http://code.google.com/p/sequel-pro/ # # Host: 127.0.0.1 (MySQL 5.5.42) # Database: StudentsGroup # Generation Time: 2016-...
<reponame>FedericoAguirre/ms-sql-server -- Detach a database -- Use SYSADMIN or DB_OWNER privileges -- If in MS SQL Management Studio press Ctrl+M to fill in the blanks -- For detaching database needs to be in SINGLE_USER mode USE MASTER; ALTER DATABASE <database, VARCHAR(200), > SET SINGLE_USER; GO EXECUTE sp_d...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 08-Jul-2021 às 22:38 -- Versão do servidor: 10.4.17-MariaDB -- versão do PHP: 8.0.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
/* SQLyog Ultimate v12.5.1 (64 bit) MySQL - 10.4.11-MariaDB : Database - db_laravepro ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHE...
-- -- PostgreSQL database dump -- -- Dumped from database version 12.4 -- Dumped by pg_dump version 13.3 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', fal...
INSERT INTO NEWS_ARTICLE (ID, SOURCE, AUTHOR, TITLE, DESCRIPTION, URL, URL_TO_IMAGE, PUBLISHED_AT, CONTENT) VALUES (1, 'Wired', '<NAME>', 'Worrisome New Coronavirus Strains Are Emerging. Why Now?', 'Across the globe, SARS-CoV-2 is evolving ways to evade the immune system and become more infectious. Blown pandemic respo...
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 18, 2022 at 09:16 AM -- Server version: 10.4.22-MariaDB -- PHP Version: 8.1.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
CREATE TABLE [dbo].[Expenses] ( [Id] UNIQUEIDENTIFIER NOT NULL CONSTRAINT PK_Expenses PRIMARY KEY, [Name] VARCHAR(50) NOT NULL, [CategoryId] UNIQUEIDENTIFIER NOT NULL, [Amount] DECIMAL(18, 2) NOT NULL, [Date] DATETIME NOT NULL, CONSTRAINT [FK_Expenses_Category] FOREIGN KEY ([CategoryId]) REFERENCES [Ca...
CREATE TABLE IF NOT EXISTS contatos ( nome VARCHAR(20), sobrenome VARCHAR(30), ddd INT(2), telefone VARCHAR(9), data_nasc DATE, email VARCHAR(30) )ENGINE=MyISAM;
<filename>_SolutionItems/UpdateScripts/Script_20150513.sql ALTER TABLE Kore_Blog ADD UseExternalLink bit NOT NULL DEFAULT(0) GO ALTER TABLE Kore_Blog ADD ExternalLink nvarchar(255) NULL GO
-- Problem 12. Highest Peaks in Bulgaria SELECT Countries.CountryCode, Mountains.MountainRange, Peaks.PeakName, Peaks.Elevation FROM Countries JOIN MountainsCountries ON Countries.CountryCode = MountainsCountries.CountryCode JOIN Mountains ON MountainsCountries.MountainId = Mountains.Id JOIN Peaks ON ...
<reponame>dragoNOTES/dragoNOTES --TO DO: -- update a note with time updated too -- able to delete a resource when it has no notes -- insert user INSERT INTO users (username, name, github_id, avatar) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING; -- get user SELECT * FROM users WHERE username=$1; SELECT _i...
drop table Lore; create table Lore ( LORE_ID int not null primary key auto_increment, OBJECT_NAME varchar(100), # ITEM_TYPE varchar(30), # treasure ITEM_IS varchar(80),# SUBMITTER varchar(50),# AFFECTS varchar(600),# APPLY int,# RESTRICTS varchar(200),# CREATE_DATE datetime, CLASS varchar(20), #hammer MA...
<filename>Section 2/searchapp-dataservice/out/production/resources/searchapp_db_data.sql<gh_stars>10-100 INSERT INTO topic (name, description, text_field1, text_field2) VALUES ('Spring Boot vs. Spring Framework', ' Spring framework is a Injection dependency framework at first (it''s still as it is today) targeting mana...
-- Document update request -- -- bound arguments: -- wantedIDs to be used in an "in" statement -- returns: -- id, updatedNanos, title, txt, alive select id, updated as updatedNanos, title, txt, 1 as alive from docs where id in (:wantedIDs)
use `echoes_schema`; -- 22 insert into `user` (`name`, `login`, `password`) values ('<PASSWORD>', '<PASSWORD>', '<PASSWORD>'); insert into `user` (`name`, `login`, `password`) values ('<NAME>', '<PASSWORD>', '<PASSWORD>'); insert into `user` (`name`, `login`, `password`) values ('<PASSWORD>u<PASSWORD>', '<PASSWORD>',...
<gh_stars>0 --- --- Example SQL --- DROP SCHEMA techtalk CASCADE; CREATE SCHEMA techtalk; CREATE TABLE techtalk.data as ( SELECT 'foobar-' || cast(trunc(random() * 1000) as text) as name, (CASE random()::INTEGER WHEN 0 THEN 'heads' WHEN 1 THEN 'tails' END) as coin_flip, cast(trunc(random() * 1000) as ...
--liquibase formatted sql --changeset user:1519826302121-1 -- CHW Module UPDATE jasper_templates SET data = X'aced0005737200286e65742e73662e6a61737065727265706f7274732e656e67696e652e4a61737065725265706f727400000000000027d80200034c000b636f6d70696c65446174617400164c6a6176612f696f2f53657269616c697a61626c653b4c0011636f6d7...
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table card ( id integer not null, date timestamp, from_user_id integer, to_user_id integer, ...
<filename>fenergy-db/src/main/resources/db/setup_db.sql -- <NAME> (<EMAIL>), 2017-05-13 -- Initial DB setup script for test and production, run as postgres user DROP DATABASE IF EXISTS fenergyprod; DROP DATABASE IF EXISTS fenergytest; CREATE DATABASE fenergyprod; CREATE DATABASE fenergytest; DROP USER IF EXISTS fener...
<gh_stars>0 {# Create SCD Hash SQL fields cross-db #} {% macro archive_hash_arguments(args) %} {{ adapter_macro('archive_hash_arguments', args) }} {% endmacro %} {% macro default__archive_hash_arguments(args) %} md5({% for arg in args %}coalesce(cast({{ arg }} as varchar ), '') {% if not loop.last %} || '|'...
ALTER TABLE behavior_group DROP COLUMN default_behavior;
-- -- 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 ...
/* This migration creates the table for episodes to be exported as metrics via Prometheus remote_write protocol. In addition to episode data, the table tracks the remote_write target by "sync_id" field, and also tracks the fulfillment state of an episode in "origins" and "origins_count". */ BEGIN IMMEDIATE; CREATE ...
<reponame>oceanhumr/yii2-adminlte<filename>yii2advanced.sql /* SQLyog Ultimate v11.27 (32 bit) MySQL - 10.1.13-MariaDB : Database - yii2advanced ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=...
<filename>modules/brochure_requests/install/tableoptions.sql INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:8fd31ac0-9b43-11e1-879c-a76ad4230cdd','select','1',0,0,'',0); INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needse...
<filename>tests/tests-9.6/select_96.sql \set naccounts 100000 * :scale \set aid random(1, 100000 * :naccounts) SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
-- -- The contents of this file are subject to the license and copyright -- detailed in the LICENSE and NOTICE files at the root of the source -- tree and available online at -- -- http://www.dspace.org/license/ -- ---------------------------------------------------- -- Make sure the metadatavalue.place column starts ...
/* 1327. List the Products Ordered in a Period Table: Products +------------------+---------+ | Column Name | Type | +------------------+---------+ | product_id | int | | product_name | varchar | | product_category | varchar | +------------------+---------+ product_id is the primary key for this ...
create table tb_book ( id bigint primary key, name varchar(32), author varchar(20) ); create table tb_hero ( id bigint primary key, name varchar(32), age int, skill varchar(32), bid bigint );
-- -- Table structure for table `skillcooldown` -- CREATE TABLE IF NOT EXISTS `skillcooldown` ( `account_id` int(11) unsigned NOT NULL, `char_id` int(11) unsigned NOT NULL, `skill` smallint(11) unsigned NOT NULL DEFAULT '0', `tick` int(11) NOT NULL, KEY `account_id` (`account_id`), KEY `char_id` (`char_id...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jan 20, 2018 at 12:18 PM -- Server version: 10.1.9-MariaDB-log -- PHP Version: 7.0.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLI...
<gh_stars>0 {{ config( tags=["new"] ) }} select guess, sum(total), avg(total) avg, stddev(total), max(total), min(total) from {{ ref( 'count_answers' ) }} group by guess order by avg desc
GRANT ALL ON TABLE public.course_lectures TO mentor; ALTER TABLE public.units ADD COLUMN unit_attributes jsonb; INSERT INTO public.units(unit_id, unit_type, unit_title, author_id, unit_attributes) SELECT unit_id, unit_type, unit_title, author_id, json_build_object('markupType', unit_markup_type::text, 'markup', unit_ma...
<filename>db/wpu_rest.sql /* SQLyog Ultimate v12.4.3 (64 bit) MySQL - 10.1.37-MariaDB : Database - wpu_rest ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SE...
<gh_stars>1-10 -- RAW_DATA STREAM CREATION CREATE STREAM raw_data ( date STRING, day_of_month DOUBLE, day_of_week DOUBLE, hour DOUBLE, iron_feed DOUBLE, starch_flow DOUBLE, amina_flow DOUBLE, ore_pulp_flow DOUBLE, ore_pulp_ph DOUBLE, ore_pulp_density DOUBLE, fc1af DOUBLE, ...
<reponame>andersonaddo/compliance-by-design-benches -- -- PostgreSQL database dump -- -- Dumped from database version 12.3 -- Dumped by pg_dump version 12.3 -- Started on 2020-07-21 12:52:28 EDT SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 20, 2019 at 08:42 PM -- Server version: 10.1.28-MariaDB -- PHP Version: 7.1.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
<reponame>PacktPublishing/PostgreSQL-10-Quick-Start-Guide ALTER TYPE t_repository ADD ATTRIBUTE repo_sync boolean;
<gh_stars>1-10 create or replace view flow_p0013_attributes_vw as select objt.objt_bpmn_id , obat_key , case when obat_num_value is not null then cast(obat_num_value as varchar2(4000)) when obat_date_value is not null then cast(obat_date_value as varchar2(4000)) when oba...
-- file:rolenames.sql ln:278 expect:true ALTER AGGREGATE testagg5(int2) OWNER TO nonexistent
<gh_stars>0 SET NAMES UTF8; DROP TRIGGER IF EXISTS commentinsert; DROP TRIGGER IF EXISTS commentdelete; DROP TRIGGER IF EXISTS imageinsert; DROP TRIGGER IF EXISTS imageupdate; DROP TRIGGER IF EXISTS albuminsert; DROP TRIGGER IF EXISTS albumupdate; DROP TRIGGER IF EXISTS albumdelete; DROP TRIGGER IF EXISTS pollinsert; ...
ALTER TABLE `lh_chat` ADD INDEX `phone` (`phone`);
<reponame>zhrt123/diskquota create database diskquota; \! pg_ctl -D /tmp/pg_diskquota_test/data restart -l /dev/null 2>/dev/null >/dev/null
--show columns CREATE TABLE soo (a int PRIMARY KEY AUTO_INCREMENT, b char(20), c char(3) NOT NULL, d int DEFAULT 10); SHOW COLUMNS FROM soo; DROP TABLE soo;
BEGIN; CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE SCHEMA dgeo; CREATE TABLE dgeo.usuario( id SERIAL NOT NULL PRIMARY KEY, login VARCHAR(255) UNIQUE NOT NULL, nome VARCHAR(255) NOT NULL, nome_guerra VARCHAR(255) NOT NULL, tipo_turno_id SMALLINT NOT NULL REFERENCES dominio.tipo_turno (code), tipo_p...
--Query 5: ALTER TABLE books DROP COLUMN bookshelf;
<reponame>thortex/rpi3-lamp-sensor-graph GRANT ALL ON `i2c_env_sensors`.* TO 'webiopi'@'localhost' IDENTIFIED BY 'raspberry';
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jul 08, 2020 at 04:31 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
<filename>modules/boonex/stripe_connect/updates/9.0.3_12.0.0/source/install/sql/install.sql SET @sName = 'bx_stripe_connect'; -- TABLES CREATE TABLE `bx_stripe_connect_accounts` ( `id` int(11) NOT NULL auto_increment, `author` int(11) NOT NULL default '0', `added` int(11) NOT NULL default '0', `user_id` varch...
<reponame>lgcarrier/AFW<gh_stars>1-10 SET DEFINE OFF; ALTER TABLE AFW_12_STRUC_APLIC ADD ( CONSTRAINT AFW_12_STRUC_APLIC_UK1 UNIQUE (REF_PRODT, CODE) ENABLE VALIDATE) /
<gh_stars>1-10 SELECT slug FROM clients
drop table return_lock_events; alter table returns drop column is_locked; drop table cart_lock_events; alter table carts drop column is_locked;
<filename>data/init.sql DROP DATABASE IF EXISTS `laconia`; CREATE DATABASE IF NOT EXISTS `laconia`; USE `laconia`; DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `comment` text COLLATE utf8_unic...
-- file:privileges.sql ln:463 expect:true SELECT col1 FROM atest2 WHERE col2 = true
<reponame>NowaEra/mmi-cms ALTER TABLE `cms_category_widget_category` ADD `uuid` varchar(40) NULL AFTER `id`; UPDATE `cms_category_widget_category` SET `uuid` = uuid(); ALTER TABLE `cms_category_widget_category` CHANGE `uuid` `uuid` varchar(40) COLLATE 'utf8_polish_ci' NOT NULL AFTER `id`;
<filename>SQL/Examples/Table/RenameTable.sql sp_rename 'old_table_name', 'new_table_name';
<filename>db-migration-flyway/src/main/resources/db/migration/V2__add_age_in_user.sql alter table tbl_user add column age integer default 0;
<filename>0x05-sql_create_join/27-my_genres.sql -- lists all genres of the show Dexter SELECT tv_genres.name FROM tv_shows JOIN tv_show_genres ON tv_shows.id = tv_show_genres.show_id JOIN tv_genres ON tv_show_genres.genre_id = tv_genres.id WHERE tv_shows.title = 'Dexter' ORDER BY tv_genres.name ASC;
/*!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 NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SE...
<filename>src/test/resources/sql/V5__rate_dictionary.sql<gh_stars>0 CREATE DICTIONARY rate_dictionary ( id UInt64, event_id UInt64, event_time String, source_id String, lower_bound_inclusive String, upper_bound_exclusive String, sourc...
create input stream S (id int, name string, type int) SOURCE KafkaInput PROPERTIES ( "operator.kafka.groupid" = "gidkpi_1_1","operator.kafka.topic"="agg_1_1"); create output stream rs (id string, name string, type int, cc int) SINK KafkaOutput properties("operator.kafka.topic"="agg_2"); create operator userOp as "co...
<gh_stars>100-1000 -- ------------------------------------------------------------------------------------------------- -- Query 19: Auction TOP-10 Price (Not in original suite) -- ------------------------------------------------------------------------------------------------- -- What's the top price 10 bids of an auc...
<reponame>Zhaojia2019/cubrid-testcases autocommit off; create class foo(f varchar(20)); insert into foo values('01:00'); insert into foo values('01:01'); insert into foo values('01:02'); insert into foo values('01:03'); insert into foo values('01:04'); select to_time(f) from foo; select to_time(f) from foo order by 1; ...
--test Relational operators(like >, <, >=, <=, =, <>) with date type create class tb ( id int auto_increment primary key, col1 date ); insert into tb (col1) values('5/1/2008'); insert into tb (col1) values('5/2/2007'); insert into tb (col1) values('5/3/2009'); insert into tb (col1) values('5/4/2008'); insert into t...
-- +migrate Up CREATE TABLE IF NOT EXISTS "services" ( name VARCHAR(256) NOT NULL, type VARCHAR(256) NOT NULL, http_url VARCHAR(256) NOT NULL, last_heartbeat TIMESTAMP WITH TIME ZONE NOT NULL, hash VARCHAR(256) NOT NULL, PRIMARY KEY (name) ); -- +migrate Down DROP TABLE services;
<reponame>opengauss-mirror/Yat -- @testpoint: 设置为空串('')的时候,系统会自动转换成一对双引号 set search_path to ''; --查看 show search_path; --恢复默认 set search_path to "$user",public; show search_path;
/* SQLyog Ultimate v12.09 (64 bit) MySQL - 10.1.34-MariaDB : Database - tic71 ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FO...
-- -- PostgreSQL database dump -- -- Dumped from database version 9.4.15 -- Dumped by pg_dump version 10.1 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 = false; SET client_min...
-- ## Ejercitación ## -- Dadas las tablas: -- PROFESOR -- CURSO -- Donde el campo PROFESOR_id de la tabla CURSO es una clave foránea que referencia a PROFESOR, CREATE TABLE profesor ( id INT NOT NULL PRIMARY KEY, nombre TEXT NOT NULL, apellido TEXT, fecha_nacimiento DATE, salario INT ); -- Inserte dato...
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE TABLE IF NOT EXISTS `itemse...
<gh_stars>0 CREATE TABLE pictures { }
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 10-02-2017 a las 21:49:41 -- Versión del servidor: 10.1.19-MariaDB -- Versión de PHP: 5.6.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT...
<reponame>theirfanirfi/course-management<filename>DATABASE-FILE-TO-IMPORT/cm.sql -- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 08, 2018 at 05:17 AM -- Server version: 10.1.30-MariaDB -- PHP Version: 7.2.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Oct 16, 2021 at 07:01 AM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 21, 2022 at 06:35 AM -- Server version: 10.4.20-MariaDB -- PHP Version: 8.0.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
/************************************************************** NULL VALUES Works for SQLite, MySQL, Postgres **************************************************************/ insert into Student values (432, 'Kevin', null, 1500); insert into Student values (321, 'Lori', null, 2500); select * from Student; /******...
DROP PROCEDURE IF EXISTS Detailed_ALL_SubjectsToAgencyMap; CREATE PROCEDURE Detailed_ALL_SubjectsToAgencyMap () BEGIN SELECT subjects.Id, ( SELECT GROUP_CONCAT(DISTINCT agency) FROM officerincidentmap WHERE officerincidentmap.incidentId = incidentsubjectmap.incidentId ) AS InvolvedAgencie...
CREATE TABLE [dbo].[Majorations] ( [MajorationSetId] NVARCHAR (128) NOT NULL, [Name] NVARCHAR (128) NOT NULL, [Value] FLOAT (53) NOT NULL, CONSTRAINT [PK_dbo.Majorations] PRIMARY KEY CLUSTERED ([MajorationSetId] ASC, [Name] ASC), CONSTRAINT [FK_dbo.Majorations_dbo.Majoratio...
<gh_stars>1-10 SELECT CountryName, CountryCode, CASE CurrencyCode WHEN 'EUR' THEN 'Euro' ELSE 'Not Euro' END AS 'Currency' FROM Countries ORDER BY CountryName;
CREATE OR REPLACE PROCEDURE Cursor_eg (r IN student.ROLLNO%TYPE) AS TYPE STUD_REC is RECORD ( Roll NUMBER, N VARCHAR ); rec STUD_REC; BEGIN Select * into rec FROM student where ROLLNO=r; DBMS_OUTPUT.put_line('Name is '||rec.N); END;
CALL mydataset.create_customer(); DECLARE retCode INT64; -- Procedure signature: (IN account_id STRING, OUT retCode INT64) CALL mySchema.UpdateSomeTables('someAccountId', retCode); SELECT retCode;
create table geocode ( Zipcode char(5), ZipCodeType varchar(12), City varchar(24), State char(2), LocationType varchar(12), Lat float(8,4), Lon float(8,4), Location varchar(20), Decommisioned int(1), TaxReturnsFiled INT(11), EstimatedPopulation INT(11), TotalWages INT(11), PRIMARY KEY (`Zipcode`), KEY (`City`, `State`)...
<filename>src/test/resources/sql/insert/2572c30a.sql<gh_stars>10-100 -- file:hs_primary_setup.sql ln:18 expect:true insert into hs3 values (113)
<reponame>manikanth/sql-server-samples<gh_stars>1000+ -- Define an external data source -- For accessing non-public external data sources, make sure to setup credentials -- Read more here: https://azure.microsoft.com/en-us/documentation/articles/sql-data-warehouse-get-started-load-with-polybase/#step-2-create-an-exte...
<reponame>hhudson/utplsql-demo prompt --application/shared_components/security/authorizations/contribution_rights begin -- Manifest -- SECURITY SCHEME: Contribution Rights -- Manifest End wwv_flow_api.component_begin ( p_version_yyyy_mm_dd=>'2021.04.15' ,p_release=>'21.1.7' ,p_default_workspace_id=>96909789361...
create table Child ( id int, name varchar(100), father_id int ); create table Father ( id int, name varchar(100) ); INSERT INTO Child (id, name, father_id) VALUES (1, '<NAME> jr 1', 1); INSERT INTO Child (id, name, father_id) VALUES (2, '<NAME> jr 2', 1); INSERT INTO Father (id, name) VALUES (1, '<NAME>')...