text stringlengths 6 9.38M |
|---|
DROP TABLE IF EXISTS habits;
CREATE TABLE habits (
id serial PRIMARY KEY,
name varchar(32) NOT NULL UNIQUE,
created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by int NOT NULL,
updated_on timestamp,
updated_by int
);
|
INSERT INTO bears (name,age,gender,color,temperament,alive) VALUES
('Mr.Chocolate',15,'M','Black','calm',true);
INSERT INTO bears (name,age,gender,color,temperament,alive) VALUES
('Rowdy',521,'M','Black','Rowdy',true);
INSERT INTO bears (name,age,gender,color,temperament,alive) VALUES
('Tabitha',21,'F','Black','calm',t... |
alter table ctc.it_system_semesters
add semester_start_date datetime null
alter table ctc.it_system_semesters
add semester_end_date datetime null |
declare
Xml_Dict varchar2(10) := 'XMLSTORE';
Files_Numer number(5,0) := 18000;
begin
pac_add_customers_data.proc_Read_Bfile(V_Xml_Dict=>Xml_Dict,v_Files_Numer=>Files_Numer);
end; |
insert into member values (100, 'Amy', 'f',19960507, '01034532584','amy','amy123');
insert into member values (101, 'Bruce', 'm',19970321, '01092847274','bruce','bruce123');
insert into member values (102, 'Crag', 'm',19981013, '01034532583','crag','crag123');
insert into member values (103, 'Katty', 'f',19931116, '... |
CREATE TABLE `XXX_plugin_admin_message` (`plugin_admin_message_id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`plugin_admin_message_id`)) ENGINE=MyISAM; ##b_dump##
ALTER TABLE `XXX_plugin_admin_message` ADD `plugin_admin_message_email_adressen` TEXT; ##b_dump##
|
BEGIN
external_tables_bl.create_external_tables;
END;
/ |
CREATE TABLE [security].[Account]
(
[AccountId] SMALLINT NOT NULL IDENTITY (1, 1)
, [AccountName] VARCHAR(30) NOT NULL
, [Password] VARCHAR(30) NOT NULL
, CONSTRAINT PK_Account PRIMARY KEY CLUSTERED ( [AccountId] )
) |
CREATE DATABASE agric_hub;
\c agric_hub;
CREATE TABLE farmers (id serial PRIMARY KEY, name VARCHAR, location VARCHAR, email VARCHAR);
CREATE TABLE customers (id serial PRIMARY KEY, name VARCHAR, location VARCHAR, email VARCHAR);
CREATE TABLE supplies (id serial PRIMARY KEY, farmerid INTEGER, productid INTEGER, quantity... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-06-2019 a las 10:03:55
-- Versión del servidor: 10.1.32-MariaDB
-- Versión de PHP: 7.0.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00... |
-- Table: public."HOBBIES"
DROP TABLE IF EXISTS public.hobbies CASCADE;
CREATE TABLE public.hobbies
(
user_id integer NOT NULL,
hobby character varying(256) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT user_id FOREIGN KEY (user_id)
REFERENCES public.users (id) MATCH SIMPLE
ON UPDATE N... |
DROP TABLE IF EXISTS `booking`;
CREATE TABLE IF NOT EXISTS `booking` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`bind` char(50) DEFAULT NULL,
`entry` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`author` char(50) DEFAULT 'APP',
`status` char(50) DEFAULT 'PENDING',
`suite` char(100) DEFAULT NULL,
`refid` char(... |
mysql –u<username> -p |
/** Payment table **/
CREATE TABLE `payment` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`payment_amount_ex_vat` double(5,2) unsigned zerofill NOT NULL COMMENT 'total payment excluding vat in GBP',
`vat_amount` double(5,2) unsigned zerofill NOT NULL COMMENT 'total vat',
`gratuity_amount` double(5,2... |
/*
create or replace package pack2 is
procedure p2(x in software.DEV_D%type);
function f2(y in studies.PNAME%type)return studies.SPLACE%type;
end;
*/
/*
create or replace package body pack2 is
procedure p2(x in software.DEV_D%type) as
cursor s is select*from software where DEV_D=x;
... |
--Fast Method
select y.*
from
(
select extractValue(x.xml, '/*/messageData/uhUuid') uhuuid, x.*
from uh_message_queue_t x
) y
where y.uhuuid = '15736882';
-- Slow method
select *
from uh_message_queue_t x
where x.xml.getClobVal() like '%15736882%'; |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.3
-- Dumped by pg_dump version 12.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... |
'ELIMINAR BASE DE DATOS'
DROP DATABASE inventario;
'CREAR BASE DE DATOS'
CREATE DATABASE inventario;
'SELECCIONAR BASE DE DATOS'
USE inventario;
'CREAR TABLA DE INVENTARIO'
CREATE TABLE IF NOT EXISTS productos (
codigo_producto BIGINT(11) NOT NULL AUTO_INCREMENT,
nombre_producto VARCHAR(45) NOT NULL,
descrip... |
-- Find the names of all “sales representatives” who work in London.
SELECT FirstName, LastName
FROM Employees
WHERE CITY="London" AND Title="Sales Representative"
-- Find the name of the female "sales representative" who work in London and report to the Sales Manager Mr. Steven Buchanan. (Please do not enter any cr... |
CREATE TABLE personas (
id VARCHAR(255) PRIMARY KEY,
nombre VARCHAR(255) NOT NULL,
apellido VARCHAR(255) NOT NULL,
edad INT NOT NULL
); |
drop table if exists posts;
create table posts (
id integer primary key autoincrement,
author varchar(40) not null,
created date not null,
title varchar(140),
message text,
comments int default 0
);
/* Column names changed to avoid MySQL reserved words. */
insert into posts(author, created, title, messa... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas generowania: 26 Lut 2016, 23:52
-- Wersja serwera: 5.6.22-log
-- Wersja PHP: 5.6.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
CREATE TABLE IF NOT EXISTS `funcionario` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`address` varchar(255) NOT NULL,
`salary` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `employees`
--
INSERT INTO `f... |
-- 228136 "Family notified of transfer"
-- 225410 "Acute rehab"
-- 225411 "Patient on vent"
-- 225413 "Skilled nursing facility"
-- 225414 "Home without services"
-- 225415 "Home with services"
-- 225416 "Long term care custodial non-Medicare certified"
-- 225417 "Assisted living"
-- 225418 "VA hospital"
-- 225419 "Ho... |
select date_trunc('day',occurred_at) as day,
count(*) AS metric
from benn.fake_fact_events
where occurred_at < '2014-06-01'
group by 1
order by 1 |
-- update `hosts` h set h.`host_name` = replace(h.`host_name`, 'centos', '')
-- UPDATE `hosts` h SET h.`host_name` = REPLACE(h.`host_name`, 'centos', '')
SELECT CONCAT('basic.internal.hadoop.', REPLACE(h.`ipv6`, '.', '-'), '.scloud.letv.com') FROM `hosts` h;
UPDATE `hosts` h SET h.`host_name` = CONCAT('basic.intern... |
/* Formatted on 21/07/2014 18:34:18 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_APP_PCR_SC_SB_AGGR
(
COD_ABI_ISTITUTO,
COD_NDG,
VAL_TOT_UTI_CASSA,
VAL_TOT_UTI_FIRMA,
VAL_TOT_ACC_CASSA,
VAL_TOT_ACC_FIRMA,
VAL_TOT_GAR,
VAL_TOT_DETT_UTI_CASSA_BT,
VAL_TOT_DETT_UTI_CA... |
--
-- Script was generated by Devart dbForge Studio 2019 for MySQL, Version 8.2.23.0
-- Product home page: http://www.devart.com/dbforge/mysql/studio
-- Script date 26.08.2019 1:41:35
-- Server version: 8.0.17
-- Client version: 4.1
--
--
-- Disable foreign keys
--
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@F... |
-- Drop Table
drop table building;
drop table photo;
drop table photographer;
-- Create Table
CREATE TABLE building (
id VARCHAR2(100) PRIMARY KEY,
name VARCHAR2(100),
vertices NUMBER,
shape SDO_GEOMETRY
);
CREATE TABLE photo (
photoID VARCHAR2(100) PRIMARY KEY,
photographerID VARCHAR2(100),
shape SDO_GEO... |
CREATE VIEW VW_MI_NB_PENDENCY (POLICY_NO, SOURCE, LOCATION, BUSINESS, PLAN_CODE, ADVISOR_NAME, FIRM_NAME, OWNER, LIFE_ASSURED, POLICY_STATUS, START_TIME, UPLOAD_TIME, PROPOSAL_SIGN_DATE, PROPOSAL_RECEIVE_DATE, LAST_ACTIVITY, LAST_USER, USER_ACTION_DATE, NTU_DATE, RESUME_DATE, REASON, PEND_PERIOD, AGEING, NO, PROPOSAL_N... |
/*
----------------------------
-- Tienda de Indumentaria---
----------------------------
========= INDEXES =============
*/
use db_indumentaria;
-- ============== INDICES CLIENTES ==============
-- Indice Clientes
create index INDEX_clientesApellidoNombre on clientes(apellido,nombre);
-- Consulta Indice Cl... |
INSERT IGNORE INTO concept
(document, id, name, description)
VALUES
(1, 'CM_DiscoveryCode', 'Discovery code', 'Discovery (core) coding scheme ');
SELECT @scm := dbid FROM concept WHERE id = 'CM_DiscoveryCode';
INSERT IGNORE INTO concept
(document, id, scheme, code, name, description)
VALUES
-- GENERAL/GLOBAL --
(1, '... |
alter table Sys_CustomerCredit
add
C_CustName varChar(50),
C_CashBalance Decimal(15,5),
C_BillBalance3M Decimal(15,5),
C_BillBalance6M Decimal(15,5),
C_PrestigeQuota Decimal(15,5),
C_TemporBalance Decimal(15,5),
C_TemporAmount Decimal(15,5),
C_WarningAmount Decimal(15,5),
C_... |
--EXEC sprocSuperHeroGet 1
SELECT * FROM SuperPets p
JOIN SuperHeroToPets sp ON sp.SuperPetID = p.SuperPetID
WHERE p.SuperHeroID = 1
CREATE TABLE SuperHeroToPets (
SuperHeroPetID int IDENTITY(1,1) PRIMARY KEY
,SuperHeroID int NOT NULL
,SuperPetID int NOT NULL
)
INSERT INTO SuperHeroToPets (SuperHeroID,Super... |
CREATE TABLE t_email_queue (
id INT NOT NULL AUTO_INCREMENT,
recipient VARCHAR(255) NOT NULL,
subject VARCHAR(255) NOT NULL,
text TEXT NOT NULL,
sent DATETIME,
PRIMARY KEY(id)
);
|
select
pc.id,
pc.reg_number || ' (' || p.last_name || ' ' || p.name || ' ' || p.middle_name || ')' as caption
from person p
join mis_patient_card pc on p.id = pc.person_id and pc.record_state <> 4
where p.record_state <> 4 |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Tempo de geração: 14/05/2019 às 14:59
-- Versão do servidor: 10.1.38-MariaDB-0+deb9u1
-- Versão do PHP: 7.0.33-0+deb9u3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
USE lab_mysql;
SELECT * FROM car;
DELETE FROM car
WHERE manufacturer = 'Volvo'
AND car_ID = 6
; |
-- MySQL dump 10.13 Distrib 5.7.27, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: dbcad
-- ------------------------------------------------------
-- Server version 5.5.5-10.4.6-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... |
-----------------------------------BRANDS------------------------------
INSERT INTO ACTIVITY_TYPE VALUES('A04', 'JOIN', 'N');
INSERT INTO ACTIVITY_TYPE VALUES('A05', 'REDEEM', 'N');
INSERT INTO USERS VALUES('Brand01', '123456', 'BRAND');
INSERT INTO BRAND VALUES('Brand01', 'Brand X', '503 Rolling Creek Dr Austin, AR'... |
# Superadmin : recupere les cadeaux et achats du client
SELECT
`pk_token`,
`quantite_token`,
`expire_token`,
`date_token`,
`expired_token`,
`used_token` AS `used`,
`cadeau_token`,
`fk_produit`,
`fk_combo`
FROM
`token`
WHERE
`fk_client` = :client
ORDER BY
`cadeau_token` ... |
use kangvahealth
if not exists(select 1 from ph_family where familyno='630121100010000002')
begin
INSERT INTO ph_family
([dutydoc] ,[hosid] ,[name] ,[pycode] ,[wbcode] ,[address] ,[tel] ,familyno )
VALUES('测试人员', '0001001', '测试' , 'CS','IY', '大通回族土族自治县桥头镇人民路南居委会', '', '630121100010000... |
-- ************************************************************************************
--
-- EXERCICES
--
-- ************************************************************************************
-- ************************************************************************
-- ... |
/*
create table product
(
id uuid not null
constraint product_pk
primary key,
name varchar not null,
short_description varchar not null,
description varchar not null,
price integer,
image varchar not null,
avai... |
-- +migrate up
CREATE TABLE [employee] (
id INT PRIMARY KEY IDENTITY,
name VARCHAR(256),
last_name VARCHAR(256)
)
INSERT INTO [employee] (name, last_name) VALUES ('Carlos', 'Chilet')
INSERT INTO [employee] (name, last_name) VALUES ('Victor', 'Mora')
-- +migrate down
DROP TABLE [employee]... |
-- CREATE TABLE 권한이 없어서 오류 발생
-- 3. 계정에서 테이블을 생성할 수 있는 CRATE TABLE 권한 부여받기
CREATE TABLE TEST(
TID NUMBER
);
-- 본인이 소유하고 있는 테이블들은 바로 조작이 가능하다.
SELECT * FROM TEST;
INSERT INTO TEST VALUES(1);
-- 다른 계정의 테이블에 접근할 수 있는 권한이 없기 때문에 오류가 발생한다.
-- 5. KH.EMPLOYEE 테이블을 조회할 수 있는 권한 부여받기
SELECT * FROM KH.EMPLOYEE;
-- 6. KH.DE... |
-- correct 'FullName' for properties
-- exclude property from export
UPDATE "FileProperty"
SET "FullName" = 'former_reference_department'
WHERE "Name" = 'former_reference_department';
UPDATE "FileProperty"
SET "FullName" = 'creating_body'
WHERE "Name" = 'creating_body';
UPDATE "FileProperty"
SET "FullName" = 'clie... |
SELECT nick, regdate FROM community_users3 WHERE nick LIKE ''
UNION ALL
SELECT nick, password_plaintext FROM community_users3;-- |
INSERT INTO Isiku_seisundi_liik (isiku_seisundi_liik_kood, nimetus) VALUES (1, 'Elus');
INSERT INTO Isiku_seisundi_liik (isiku_seisundi_liik_kood, nimetus) VALUES (2, 'Surnud');
INSERT INTO Kliendi_seisundi_liik (kliendi_seisundi_liik_kood, nimetus) VALUES (1, 'Aktiivne');
INSERT INTO Kliendi_seisundi_liik (kliendi_s... |
CREATE OR REPLACE VIEW DMA AS
SELECT TO_NUMBER(SET_DMA( T1.SUBSECTOR_ID )) AS dma_id,
T1.SUBSECTOR_ID AS "name",
1 AS expl_id,
TO_NUMBER(SET_MACRODMA( T1.SECTOR_ID )) AS macrodma_id,
'Mataró - ' || T1.SUBSECTO... |
/*With a query involving PWD parcels and census block groups,
find the geo_id of the block group that contains Meyerson Hall.
ST_MakePoint() and functions like that are not allowed.*/
geo_id text
with meyerson as (
select *
from pwd_parcel
where address = '220-30 S 34TH ST' and owner1 like '%UN... |
-- Gradebook table changes between Sakai 2.1.* and 2.2.
-- Add grading scale support.
create table GB_PROPERTY_T (
ID bigint not null auto_increment,
VERSION integer not null,
NAME varchar(255) not null unique,
VALUE varchar(255),
primary key (ID)
);
create table GB_GRADING_SCALE_GRADES_T (
GRADING_S... |
ALTER TABLE dbo.ClientPersonalMessage
ALTER COLUMN ClientId nvarchar(36) NULL
|
SELECT
avg(
(YEAR(CURRENT_DATE) - YEAR(birthday)) -
(DATE_FORMAT(CURRENT_DATE, '%m%d') < DATE_FORMAT(birthday, '%m%d'))
) AS avg_age
FROM profiles p2 ;
|
UPDATE
BURI_JOIN_WAITING
SET
PROCESS_DATE = CURRENT_TIMESTAMP,
ABORT_DATE = CURRENT_TIMESTAMP
WHERE
PROCESS_DATE > CURRENT_TIMESTAMP
AND BRANCH_ID = /*branchId*/1
|
--
--Referencia con la tabla sub cuenta
--
ALTER TABLE co_tmvco
ADD FOREIGN KEY (mvco_sbcu)
REFERENCES co_tsbcu(sbcu_sbcu)
;
--
--Referencia con la tabla tipo documento
--
ALTER TABLE co_tmvco
ADD FOREIGN KEY (mvco_tido)
REFERENCES co_ttido(tido_tido)
; |
DROP DATABASE IF EXISTS graphql_demo;
CREATE DATABASE graphql_demo;
\c graphql_demo;
CREATE TABLE posts (
id INTEGER PRIMARY KEY,
title TEXT
);
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
post_id INTEGER,
user_id INTEGER,
text TEXT
);
CREATE TABLE users (
id ... |
/*
################################################################################
Migration script to create a new curation status - Pending author query
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
compatibile... |
CREATE TABLE `Users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstName` varchar(128) NOT NULL DEFAULT '',
`lastName` varchar(128) NOT NULL DEFAULT '',
`email` varchar(256) NOT NULL DEFAULT '', -- can be blank for cross-posted, since we odn't want to leak emails
`password` varchar(128) NOT NULL DEFAULT '',
... |
/*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
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 License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... |
INSERT INTO anime.dev_user (id, authorities, name, password, username)
VALUES (default, 'ROLE_USER,ROLE_ADMIN','André Lucas', '{bcrypt}$2a$10$3WYoUm1SvwGnJOWHlK99m.kXBsSSSGvG7pH8n7OLNa/WBmaBdOXjW', 'andre')
INSERT INTO anime.dev_user (id, authorities, name, password, username)
VALUES (default, 'ROLE_USER','Dev', '{bcr... |
CREATE TABLE IACUC_PROTO_CORRESP_TEMPL (
PROTO_CORRESP_TEMPL_ID NUMBER(12,0) NOT NULL,
PROTO_CORRESP_TYPE_CODE VARCHAR2(3) NOT NULL,
COMMITTEE_ID VARCHAR2(15) NOT NULL,
FILE_NAME VARCHAR2(150) NOT NULL,
UPDATE_TIMESTAMP DATE NOT NULL,
UPDATE_USER VARCHAR2(60) N... |
CREATE PROC [ERP].[Usp_Ins_ResumenDiario] --'asd'
@Nombre VARCHAR(250)
AS
BEGIN
INSERT INTO [ERP].[ResumenDiario](Nombre,Fecha) VALUES (@Nombre,GETDATE())
END |
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: inikierp
-- ------------------------------------------------------
-- Server version 5.6.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
-- MySQL dump 10.13 Distrib 5.7.16, for osx10.11 (x86_64)
--
-- Host: 127.0.0.1 Database: revenue
-- ------------------------------------------------------
-- Server version 5.7.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... |
#HackerRank Top Competitors
SELECT
sub.hacker_id,
hack.name
FROM
submissions AS sub
LEFT JOIN challenges AS cha ON sub.challenge_id = cha.challenge_id
LEFT JOIN difficulty AS diff ON cha.difficulty_level = diff.difficulty_level
LEFT JOIN hackers AS hack ON sub.hacker_i... |
DELETE FROM
SCORING_CARD_NAME_TEMP
WHERE
SEQ_NO = /*sessionId*/'' |
--------------------------------------------------------
-- File created - Sunday-April-21-2019
--------------------------------------------------------
--------------------------------------------------------
-- DDL for View FACTURA_FULL
--------------------------------------------------------
CREATE OR REPLAC... |
alter table PLACEUR_RATING add constraint FK_PLACEUR_RATING_USER foreign key (USER_ID) references PLACEUR_USER(ID);
alter table PLACEUR_RATING add constraint FK_PLACEUR_RATING_PLACE foreign key (PLACE_ID) references PLACEUR_PLACE(ID);
create index IDX_PLACEUR_RATING_PLACE on PLACEUR_RATING (PLACE_ID);
create index IDX_... |
INSERT INTO member (id, membername, username, password, sonof, profilepic, dob, gender, relationship_status, gaon, related_to, emailid, alive, aboutme, lastlogin, joined, approved, tokenforact) VALUES
(2, 'Harikar Thakur', '', '', NULL, NULL, NULL, 0, 0, '', NULL, '', 0, '', NULL, NULL, 0, NULL),
(17, 'Harigiv Kharajpu... |
SELECT cohorts.name AS cohort, SUM(completed_at - started_at) AS total_duration
FROM assistance_requests
JOIN students ON student_id=students.id
JOIN cohorts ON cohort_id=cohorts.id
GROUP BY cohorts.name
ORDER BY total_duration; |
INSERT INTO person VALUES ('d5979da4-f764-4787-af29-90fab3fce2bf', 'first_name', 'last_name');
INSERT INTO person VALUES ('021560c4-a340-408a-ae54-ef90d665345e', 'first_name', 'last_name');
INSERT INTO person VALUES ('77a5271e-59c4-41e2-a478-09002080fea1', 'first_name', 'last_name');
INSERT INTO person VALUES ('da54d34... |
-- Databricks notebook source
-- MAGIC %fs
-- MAGIC ls 'dbfs:/mnt/datalake/rawdata/'
-- COMMAND ----------
DROP TABLE IF EXISTS hubspot;
CREATE TABLE hubspot USING JSON OPTIONS (multiline 'true') LOCATION '/mnt/datalake/rawdata/HubSpot/engagements/yyyyMMdd=20201120/';
-- COMMAND ----------
DROP TABLE IF EXISTS user... |
SET search_path TO bnb, public;
drop table if exists numbers;
drop table if exists goodhomeowners;
drop table if exists badhomeowners;
drop table if exists avgbyyear;
create view avgbyyear as select owner, extract(year from startdate) as year, avg(rating) as avgrating from travelerrating natural join listing where e... |
INSERT INTO PACKAGE(id_pack, name, can_be_modified_outside) VALUES (1, 'Tenses', 1);
INSERT INTO RULE(id_rule, name, detail, pack) VALUES (1, 'Unit 1: Present continuous and present simple 1',
'We use the present simple to describe things that are always true, or situations that exist now and,
as far as we know, wi... |
--Write a query which returns the unique carriers
select distinct uniquecarrier from tracking;
--Return data for those 2003 flights with a delay of 5 hours or more
select count(*) from
(select tracking.*,
cast(case when arrdelay='NA' then '-9999' else arrdelay end as int ) arrdelay1,
cast(case when depdelay='NA' then ... |
USE `safebourse`;
CREATE TABLE `users`(
`id` int(11) NOT NULL PRIMARY KEY,
`firstname` varchar(52) NOT NULL,
`lastname` varchar(52) NOT NULL,
`username` varchar(52) NOT NULL,
`password` TEXT NOT NULL,
`email` varchar(52) NOT NULL,
`phone` varchar(52) NOT NULL,
`link` TEXT NOT NU... |
create table VMS.GONK2_manchu (id integer,
text varchar2(400)
);
|
DROP TABLE IF EXISTS ordertable;
CREATE TABLE ordertable (
order_id INT NOT NULL AUTO_INCREMENT,
order_name VARCHAR(20) NOT NULL UNIQUE,
order_price DECIMAL DEFAULT 0,
order_date DATE NOT NULL,
PRIMARY KEY (order_id)
);
DROP TABLE IF EXISTS item;
CREATE TABLE item(
item_id INT NOT NULL AUTO_INCREMENT,
... |
alter table table_name add COLUMN address [varchar](100) NULL; |
SELECT
r.team_id,
team_name,
short_name,
sum(win)+sum(lose)+sum(draw) as game_count,
sum(win) as win,
sum(lose)as lose,
sum(draw)as draw,
sum(win)/(sum(win)+sum(lose)) as percentage,
sum(win)*4+sum(lose)*1+sum(draw)*2 as points,
league_id
FROM result r
inner join TEAM t on t.team_id=r.team_id
WHE... |
drop table if exists acooper.membertimeseries_population_deduped_phone_07202017;
create table acooper.membertimeseries_population_deduped_phone_07202017 as
select * from (
select
enterprise_id
, ent_first_name
, ent_last_name
, age
, race
, gender
, co... |
SELECT created_date as Date,
id AS organization_id,
industry AS industry,
extract(day from(CURRENT_DATE -created_date)) as days_since_creation
FROM modeanalytics.salesforce_accounts
where industry = '{{industry}}' |
# Mock ups can be found in the Wiki
# View core requirements:
# actor: student
select title
from class_cats
where id in (
select reqs.class_cat
from reqs
inner join fields
on reqs.field = fields.id
where field.type = 'core'
and school is null);
# View major requirements:
# actor: student
select title
from cla... |
--数据相关操作
-- 1.DML操作
CREATE TABLE IF NOT EXISTS user(
id INT UNSIGNED KEY AUTO_INCREMENT,
username VARCHAR(20) NOT NULL UNIQUE,
password CHAR(32) NOT NULL,
age TINYINT NOT NULL DEFAULT 18
);
-- 插入一条记录
INSERT INTO user(username,password) VALUES("A","A");
--插入多条记录
INSERT user (username,password) VALUES("B","B"),(... |
-- MySQL Script generated by MySQL Workbench
-- Mon Oct 14 08:53:55 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... |
Insert Data for Parts and Devices
Now that we have the infrastructure for our workshop set up, let''s start adding
in some data. Add in two different devices. One should be named,
"Accelerometer". The other should be named, "Gyroscope".
The first device should have 3 parts (this is grossly simplified). The second
dev... |
DROP DATABASE IF EXISTS hospital;
#Create a table Hospital with the fields (doctorid,doctorname,department,qualification,experience).
CREATE DATABASE hospital;
USE hospital;
CREATE TABLE hospital(
doctorid VARCHAR(10) PRIMARY KEY,
doctorname VARCHAR(20) NOT NULL,
department VARC... |
USE [Library]
CREATE TABLE tbl_library_branch (
branch_id INT PRIMARY KEY NOT NULL IDENTITY(1,1),
branch_name VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL
);
CREATE TABLE tbl_publisher (
publisher_name VARCHAR(50) PRIMARY KEY NOT NULL,
address VARCHAR(50) NOT NULL,
phone VARCHAR(50) NOT NUL... |
IF EXISTS (SELECT * FROM dbo.SysObjects WHERE ID = object_id(N'[Config_User]') AND OBJECTPROPERTY(ID, 'IsTable') = 1)
BEGIN
drop table Config_User;
END
CREATE TABLE Config_User
(
ID int identity(1,1) primary key,--编号
UserName varchar(50),--名称
UserCode varchar(50),--编码
Password varchar(50),--密码
IsEnable bit,--是... |
DROP DATABASE IF EXISTS sdc_airbnb;
CREATE DATABASE sdc_airbnb;
\c sdc_airbnb;
DROP TABLE IF EXISTS bigboi;
CREATE TABLE bigboi (
id bigserial,
listings varchar(200) NOT NULL,
diningroom varchar(200) NOT NULL,
bedroom varchar(200) NOT NULL,
livingroom varchar(200) NOT NULL,
patio varchar(200) NOT NULL,
... |
/**
* @author trigan-d
* Create superuser account with all roles. Assign partner and developer entries to that account.
*/
insert into users (name, password) values ('${superuser.login}', '${superuser.password}');
insert into user_groups (user_id, groups) select id, 0 from users where name='${superuser.login}';
in... |
ALTER TABLE `Sample` ADD (
`createdBy` varchar(255) NOT NULL,
`createdDate` TIMESTAMP(6) NOT NULL,
`lastModifiedBy` varchar(255) NOT NULL,
`lastModifiedDate` TIMESTAMP(6) DEFAULT NULL
); |
Deleting Rows
Write the necessary SQL statements to delete the "Bulk Email" service and
customer "Chen Ke-Hua" from the database.
First we delete the records from the join table, and then from each individual
table:
DELETE FROM customers_services
WHERE service_id = 7
OR customer_id = 4;
DELETE FROM customers
... |
insert into ROOM values ('102', 'P102', 'Special', curdate(), date_add(curdate(), interval 30 day));
insert into ROOM values ('103', 'P102', 'Ordinary', curdate(), date_add(curdate(), interval 30 day));
insert into ROOM values ('104', 'P104', 'Suite', curdate(), date_add(curdate(), interval 30 day));
insert into ROOM v... |
INSERT INTO "User" (login, password)
VALUES ('admin', 'admin');
INSERT INTO "User" (login, password)
VALUES ('laptev', 'admin');
INSERT INTO "User" (login, password)
VALUES ('school21', 'admin');
INSERT INTO "chatroom" (chatroom_name, chatroom_owner)
VALUES ('chat1', 1);
INSERT INTO "chatroom" (chatroom_name, chatroom_... |
--Inserción de tipos de lector en la tabla tipoLector, con sus correspondientes limites de material, dias de
--prestamo autorizados y numero de refrendos autorizados.
---------------
INSERT INTO tipoLector(tipoLect,limiteMaterial,diasPrestamo,refrendos)
VALUES('estudiante',3,8,1);
INSERT INTO tipoLector(tipoLect,limi... |
insert into users (
auth_id, name, email, profile_pic
) values (
${sub}, ${nickname}, ${email}, ${picture}
) returning *; |
-- -----------------------------------------------------------------------------
--
-- File: $RCSfile: load.sql,v $
-- Revision: $Revision: 1.10 $
-- Description: Create predefined data in the Clearadm database
-- Author: Andrew@ClearSCM.com
-- Created: Tue Nov 30 08:46:42 EST 2010
-- Modified: $D... |
-- Script generated by com.jnj.gtsc.harmony.migration.script.enrich.EnrichRoleToUserAssignments
-- Script generated on 28/May/2013 00:43:45
-- Source = jdbc:oracle:thin:@hpxc83p03.ncsbe.eu.jnj.com:2664:DVLUX153
-- Set ampersand definitions off
set define off;
begin
-- Set larger dbms output buffer
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.