text stringlengths 6 9.38M |
|---|
CREATE TABLE IF NOT EXISTS `organic` (
`iOrganic` INT NOT NULL AUTO_INCREMENT,
`cHost` VARCHAR(100),
`cOrganic` VARCHAR(150),
`dDated` DATETIME,
PRIMARY KEY (`iOrganic`),
INDEX(`dDated`, `cOrganic`)
); |
INSERT INTO Lgas (Place, [State], SEIFADisadvantage2011)
SELECT Place, [State], SEIFADisadvantage2011
FROM [seifa_2011-pre]
UPDATE
Lgas
SET Place = LTRIM(Place)
UPDATE
Lgas
SET
Lgas.SEIFADisadvantage2016 = [seifa_2016-pre].SEIFADisadvantage2016
FROM
[seifa_2016-pre]
INNER JOIN Lgas ON Lgas.Plac... |
/*Практическое задание по теме “Хранимые процедуры и функции, триггеры"*/
DELIMITER //
/*
1)Создайте хранимую функцию hello(), которая будет возвращать приветствие,
в зависимости от текущего времени суток.
С 6:00 до 12:00 функция должна возвращать фразу "Доброе утро",
с 12:00 до 18:00 функция должна возвращать фра... |
/*
* Copyright (c) TIKI Inc.
* MIT license. See LICENSE file in root directory.
*/
-- -----------------------------------------------------------------------
-- ADDRESS
-- -----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS address(
id BIGSERIAL NOT NULL,
addre... |
/*
Present a report listing the names and student ids of students with the details of their lease agreements.
Project Option: Coyote Residence Office
TEAM: King James & The Knights of the Data Table
DONE BY: Mark Takahashi
*/
set linesize 400
set pagesize 100
SET FEEDBACK OFF
TTITLE "Query 2"
COLUMN first_name HEADING... |
drop sequence BURI_WAITING_USER_SEQ;
|
/*
SQL practice in Udacity's 'Programming for Data Science' Nanodegree Program
SQL > Lesson 8 > Project: Investigate the 'Sakila DVD rental database'
Section 10: Quiz 2
Question 2:
previous query: (query no 242)
(Write a query that displays a table with 4 columns: actor's full name,
film title, length of movie, and ... |
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 15, 2019 at 10:36 AM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
SELECT COUNT(*) AS RecordCount -- 19972
, COUNT(MiddleName) AS PeopleUsingMiddleName -- 11473
, COUNT(DISTINCT MiddleName) AS MiddleNamesUsed -- 70
FROM Person.Person |
INSERT INTO Course (CourseNumber, CourseName) VALUES ('10', 'Introduction to CSE');
INSERT INTO Course (CourseNumber, CourseName) VALUES ('100', 'Introduction to Informatics');
INSERT INTO Course (CourseNumber, CourseName) VALUES ('101', 'Fundamentals of Computer Science');
INSERT INTO Course (CourseNumber, CourseName)... |
CREATE TABLE `user_preferences`
(
`username` VARCHAR(45) NOT NULL,
`type_id` INT(11) NOT NULL,
PRIMARY KEY (`username`)
);
|
--liquibase formatted sql
--changeset lautaro:delete_posite_balance splitStatements:false
ALTER TABLE person DROP COLUMN positive_balance; |
--
-- テーブルの構造 `menu_detail`
--
CREATE TABLE `menu_detail` (
`block_id` int(11) NOT NULL,
`page_id` int(11) NOT NULL,
`visibility_flag` tinyint(1) NOT NULL default '1',
`room_id` int(11) NOT NULL default '0',
`insert_time` varchar(14) NOT NULL default '',
`insert_... |
---------------------------------------
-- GCDM-INSERT_20170918_SSJ
---------------------------------------
----------------------
-- sequencing table
----------------------
INSERT INTO
dbo.sequencing (
[sequencing_id]
,[person_id]
,[order_date]
,[order_code]
,[biomaterial_collecting_date]
,[b... |
/*
SQLyog Community Edition- MySQL GUI v8.04
MySQL - 6.0.4-alpha-community : Database - clinicas
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0... |
INSERT INTO employees (first_name, last_name, role_id, salary)
VALUES
('Roland', "Roxiller", 2, 2),
('Roand', "Roxiller", 2, 2),
('Rolabd', "Roxiller", 2, 2),
('Rmland', "Roxiller", 2, 2),
('Romd', "Roxiller", 2, 2),
('Roaand', "Roxiller", 2, 2),
('Rowwend', "Roxiller", 2, 2),
('Roland',... |
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- ホスト: mysql143.phy.lolipop.lan
-- 生成日時: 2020 年 7 月 09 日 10:45
-- サーバのバージョン: 5.6.23-log
-- PHP のバージョン: 5.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
/*
Navicat Premium Data Transfer
Source Server : medcon server
Source Server Type : MySQL
Source Server Version : 100138
Source Host : 192.168.161.100:3306
Source Schema : webinarsegmi
Target Server Type : MySQL
Target Server Version : 100138
File Encoding :... |
SELECT d.year AS year,
count(*) AS value
FROM document d
JOIN authorshipgroup ag ON d.id = ag.document
JOIN source s ON d.source = s.id
WHERE ag."researchEntity" = $1
AND d.documenttype <> ALL ($3 :: INT[])
AND s.type = $4
AND exists(SELECT id
FROM affiliation
... |
SELECT *
FROM LAPTOP
SELECT *
FROM product
SELECT DISTINCT maker,speed
from laptop, product
where laptop.model = product.model and hd >=9
SELECT DISTINCT laptop.model,price
from laptop, product
where laptop.model = product.model and maker='B'
UNION
SELECT DISTINCT pc.model,price
from pc, product
where pc.model = pr... |
DROP TABLE IF EXISTS pracownicy;
DROP TABLE IF EXISTS stanowiska;
DROP TABLE IF EXISTS kontakty;
DROP TABLE IF EXISTS place;
CREATE TABLE pracownicy(
id INTEGER PRIMARY KEY AUTOINCREMENT,
imie TEXT(15),
nazwisko TEXT(20),
kod STRING(10),
miasto_z TEXT(40),
ulica TEXT,
data_u DATE,
miasto_u TEXT(40)
);
CREATE TABLE s... |
-- see original here: https://gitlab.com/johncf/failure-analysis
-- observed population over power_hrs -- N(t)
COPY (WITH cgs AS (SELECT power_hrs,
SUM(contrib_step) AS contrib_group
FROM (SELECT 1 AS contrib_step,
min_power_hrs AS power_hrs
... |
/*
* buildSearchParts_parseWords
* Inverted Index Toolkit <http://code.google.com/p/inverted-index/>
* Apache License 2.0, blah blah blah.
*
* This version of "buildSearchParts" uses "parseWords" and a cursor to
* separate words. This may be more efficient and more flexible.
* However, it requires the procedur... |
SELECT COUNT(*)
FROM (
SELECT DISTINCT ON (cvrnum) cvrnum
FROM public.financial
WHERE pubyear > 2017
) AS temp; |
CREATE INDEX ocorrencia_id_ocorrencia_idx ON public.ocorrencia USING btree (id_ocorrencia);
reindex table public.ocorrencia;
CREATE INDEX tipo_evento_id_ocorrencia_idx ON public.ocorrencia_tipo_evento USING btree (id_ocorrencia);
reindex table public.ocorrencia_tipo_evento;
CREATE INDEX tipo_dano_identificado_id_oco... |
update door set handing = null where handing between '1385' and '1392';
delete from dictionary where id between '1385' and '1392';
update dictionary set value_order='1' where id='1384';
update dictionary set value_order='2' where id='1063';
update dictionary set value_order='3' where id='1064';
update dictionary... |
WITH parent_competitive_projects AS (
SELECT
v.research_entity AS research_entity,
pc.id,
pc.members,
pc.research_lines
FROM verify v
JOIN project_competitive pc ON pc.id = v.research_item
WHERE
v.research_entity = $1
), competitive_project_contributions AS (
... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 21, 2020 at 10:48 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.2.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.15-log : Database - mybatis_test
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... |
SELECT * FROM weight WHERE user_id = $1; |
/* Remove tables if they are already here */
drop table if exists Store;
drop table if exists Product;
/* Turn on some useful features: foreign constraint checking, and pretty-printing */
.header on
.mode column
PRAGMA foreign_keys = ON; -- turns on checking for foreign keys constraints
/* Create the relations */
CR... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.8
-- Dumped by pg_dump version 9.5.5
-- Started on 2017-05-31 21:46:57
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages ... |
SELECT
isnull(T4.count1,0) as count1 --贷项申请中件数
,isnull(T6.count2,0) as count2 --账款异常申请中件数
,T1.CANCEL_FLG as DELETE_FLG --债权取消状态
,T1.FACTORING_STATUS --债权放款状态
,T1.BUYER_REPAY_STATUS --债权还款状态
,T1.TRADE_E... |
FUNCTION validate_item(p_item IN apex_plugin.t_page_item,
p_plugin IN apex_plugin.t_plugin,
p_value IN VARCHAR2)
RETURN apex_plugin.t_page_item_validation_result IS
-- custom plugin attributes
l_result apex_plugin.t_page_item_validation_result;
-- other vars
l_... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 20, 2020 at 11:01 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
DELETE FROM jat_user_group;
DELETE FROM jat_group;
DELETE FROM jat_user;
INSERT INTO jat_user (login, password, email, update_date, update_user) VALUES ('admin', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', 'administrator@jatecnologia.com', SYSDATE(), 'root' );
INSERT INTO jat_user (login, pas... |
--Run Operation script first
--0001 Notification
DO $$
Declare NcTID uuid;
Declare NcTVN integer;
Declare NcResID uuid;
Declare OrgEmployeeRoleID uuid;
Declare UserUserTypeID uuid;
Begin
NcTVN := 1;
NcTID := (select uuid_generate_v1());
NcResID := (select uuid_generate_v1());
OrgEmployeeRoleID := (select "RoleID" fr... |
create table SHIPPING (
SHIPPING_ID bigint not null,
SHIPPING_DATE timestamp,
ORDER_TITLE_I_D bigint,
CUSTOMER_I_D bigint,
constraint SHIPPING_PK primary key(SHIPPING_ID)
);
|
INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
VALUES(937,'http://hl7.org/fhir/ValueSet/encounter-participant-type','ParticipantType');
INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
VALUES('PPRF','primary performer',937);
INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
VALUES('ADM','admit... |
CREATE FUNCTION [macro].[TiposOperacion]
()
RETURNS TABLE
AS
RETURN
(
SELECT
a.codigo,
a.nombre,
CASE WHEN a.requiere_transporte = 1 THEN 'S' ELSE 'N' END AS requiere_transporte,
a.ordinal
FROM tms.tipos_operacion a
WHERE
a.activo = 1
)
|
INSERT INTO VND.INTERFACE (
CD_INTERFACE,
IC_TIPO,
NU_CODIGO
)
select
(select max(CD_INTERFACE) from interface) + rownum,
'G',
nu_contrato_sap
from vnd.contrato
where nu_contrato_sap in (
'0040388989'
);
INSERT INTO VND.INTERFACE (
CD_INTERFACE,
IC_TIPO,
NU_CODIGO
)
SELECT
(select max(CD_INTER... |
# from the folder where file is stored
scp '/Users/rahuldhakecha/Box Sync/Goodreads Project/Goodreads_Summer2017_SharvinShah/Popular_Genres_Basic_Stats_Scrape/Chick_Lit_List_output.csv' rahuldhakecha@ssh.wwbp.org:
#login to wwbp
# if not using port forwarding
ssh rahuldhakecha@ssh.wwbp.org -p 22
# if using port forward... |
ALTER TABLE pic
DROP COLUMN name;
ALTER TABLE pic
MODIFY COLUMN type TINYINT DEFAULT 0 COMMENT '0:性感妹子,1:二次元,2:cosplay,3:清纯妹子';
|
DROP SCHEMA IF EXISTS mondiali2010 CASCADE;
CREATE SCHEMA mondiali2010;
set search_path to mondiali2010;
CREATE TABLE stadio (
nome VARCHAR PRIMARY KEY,
citta VARCHAR,
capienza INTEGER);
CREATE TABLE squadra (
nazione VARCHAR PRIMARY KEY,
confederazione VARCHAR,
data_qualifica DATE,
sponsor VARCHAR);
CREATE TABLE pa... |
CREATE DATABASE asp;
CREATE TABLE `asp`.`users` (
`username` VARCHAR(255),
`password` TEXT,
`avatar` LONGBLOB,
PRIMARY KEY (`username`)
);
CREATE TABLE `asp`.`apis` (
`name` VARCHAR(255),
`owner` VARCHAR(255),
`origin` TEXT,
`description` BLOB,
`internal` BOOLEAN,
`public_acces... |
use MyExperiments;
CREATE TABLE ALT_TAB(
UserNumber INTEGER,
UName VARCHAR(30)
);
INSERT INTO ALT_TAB VALUES(1,'Me');
INSERT INTO ALT_TAB VALUES(2,'Myself');
INSERT INTO ALT_TAB VALUES(3,'I');
SELECT * FROM ALT_TAB;
-- changing column name
sp_rename 'ALT_TAB.UName', 'UserName', 'COLUMN';
SELECT * FROM ALT_TAB;
-... |
--1. How many users are there?--
SELECT COUNT(DISTINCT user_id)
FROM clique_bait.users
--2. How many cookies does each user have on average?--
SELECT COUNT(cookie_id)/COUNT(DISTINCT user_id)
FROM clique_bait.users
--3. What is the unique number of visits by all users per month?--
SELECT COUNT(cookie_id) as count_visi... |
-- Find yelp listing that is open and within 10km of selected listing geometry
-- '10022363', 'Wicker Park, Chicago, IL 60642, United States', 'Chicago', 'IL', '60642',
-- 'US', 'United States', '41.906390599', '-87.666130392'
SELECT distance, business_id, name, address, city, state, postal_code, stars, review_count, ... |
use sakila;
-- 1a. Display the first and last names of all actors from the table actor.
-- 1b. Display the first and last name of each actor in a single column in upper case letters. Name the column Actor Name.
select first_name, last_name from actor;
select CONCAT(first_name, ' ' , last_name) as Actor_Name FROM actor... |
DROP TABLE events;
DROP TABLE users;
DROP TABLE pays;
DROP TABLE fees;
DROP TABLE participation;
DROP TABLE goods;
DROP VIEW participants;
DROP VIEW summary;
DROP VIEW debts;
DROP VIEW balances;
|
/*
database: enp_ai
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `forecast_met_site`
-- ----------------------------
DROP TABLE IF EXISTS `forecast_met_site`;
CREATE TABLE `forecast_met_site` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`site_id` int(11) DEF... |
select * from employe
WHERE ID_FONCTION = 2
|
delete from ErrorName;
insert into ErrorName (output_result, error_farsi)
select output_result, error_farsi from Anbar where (api_key is not null and api_key !='') and (user_id is null or user_id ='')
and (output_result is not null and output_result !='')
and (error_farsi is not null and error_farsi !='')
group by outp... |
--How to pull every unique Object Name from the Concept Authority
SELECT substring(refname from position('''' in refname) + 1 for char_length(refname) - position('''' in refname) - 1) AS concept, refname, h.name AS csid FROM concepts_common cc
INNER JOIN hierarchy h ON cc.id = h.id WHERE cc.refname in (SELECT DISTINCT... |
SELECT RESERVAS.FECHALLEGADA, TO_CHAR(RESERVAS.FECHALLEGADA,'YYYY') as year,TO_CHAR(RESERVAS.FECHALLEGADA,'iw') as week, TO_CHAR(RESERVAS.FECHALLEGADA,'mon') as month,TO_CHAR(RESERVAS.FECHALLEGADA,'dd') as day, OFERTAS.PRECIOESTADIA
FROM RESERVAS, OFERTAS, ALOJAMIENTOS
WHERE RESERVAS.OFERTA=OFERTAS.ID
AND ALOJAMIENTOS.... |
PRAGMA foreign_key = ON;
drop trigger trigger7; |
begin
for rec in(select * from emp)loop
dbms_output.put_line(rec.ssn||''||rec.name);
end loop;
update emp
set salary=salary+(salary*0.5)
where dno=5;
end;
/
|
CREATE TYPE muscle_group AS ENUM (
'Chest',
'Back',
'Quads',
'Hamstrings',
'Calves',
'Triceps',
'Biceps',
'Shoulders',
'Traps'
);
CREATE TABLE aimfit_exercises (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
exercise_name TEXT NOT NULL,
muscle muscle_group
); |
delete from t_role where id not in ('01', '02');
delete from t_user where id not in ('01');
delete from t_role_authority where roleid not in ('01', '02');
delete from t_user_role where userid not in ('01');
delete from tbl_customer where id not like '2018091014%';
delete from tbl_supplier where id not like '2018091014%... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.2 (Debian 12.2-1.pgdg100+1)
-- Dumped by pg_dump version 12.2 (Debian 12.2-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_st... |
CREATE SEQUENCE seq_pk_clientes START 1;
CREATE TABLE Clientes (
id int PRIMARY KEY DEFAULT nextval('seq_pk_clientes'),
nome varchar(100),
sobre_nome varchar(100)
);
CREATE SEQUENCE seq_pk_produto START 1;
CREATE TABLE Produtos (
id int PRIMARY KEY DEFAULT nextval('seq_pk_produto'),
nome varchar(100),
detalhes ... |
USE n5q97jqdo4j814xe;
CREATE TABLE burgers(
id integer auto_increment primary key,
burger_name varchar(80) not null,
burger_toppings varchar(255),
devoured BOOLEAN not null DEFAULT false
);
INSERT INTO burgers (burger_name, burger_toppings, devoured)
VALUES ('THE BRGR','Two Beef Patties + brgr Sauce + Dic... |
alter table REPORT_TEMPLATE add column IS_GROOVY boolean default false^
update REPORT_TEMPLATE set IS_GROOVY = false where IS_GROOVY is null^ |
-- $Id: create_role_datafeed.sql,v 1.2 2009/07/20 10:59:51 a59603 Exp $
PROMPT create_role_datafeed.sql
CREATE ROLE datafeed_role
/
SHOW ERRORS
|
DELIMITER $$
DROP PROCEDURE IF EXISTS pp5_cur $$
CREATE PROCEDURE `pubs10`.`pp5_cur`()
BEGIN
DECLARE n INT DEFAULT 1; -- 定义n为游标结束条件 n=0游标结束;n=1执行循环
DECLARE tid VARCHAR(20); -- 定义tid来存放游标遍历的title_id
DECLARE i INT DEFAULT 1; -- 定义i来自增序号
DECLARE cur CURSOR FOR
SELECT DISTINCT title_id FROM titleauthor; ... |
DELETE FROM accounts;
INSERT INTO accounts (id, name) VALUES
(1, 'account 1'),
(2, 'account 2');
DELETE FROM bottles;
INSERT INTO bottles (id, account_id, name, vineyard, varietal, vintage, color, sweetness, country, region, review, rating) VALUES
(100, 1, 'Number 8', 'Asti Winery', 'Merlot', 2012, 'red', 1, 'US... |
create table BURI_TEST_MANY (
TEST_ID01 bigint not null,
TEST_ID02 bigint not null,
VALUE varchar(100) not null,
VERSION_NO bigint not null,
constraint BURI_TEST_MANY_PK primary key(TEST_ID01)
);
|
use nodedb;
CREATE TABLE people (
nome VARCHAR(250)
); |
CREATE TABLE Customer
(
CustomerID INT UNSIGNED NOT NULL AUTO_INCREMENT,
Firstname VARCHAR(50) NOT NULL,
Lastname VARCHAR(50) NOT NULL,
Password VARCHAR(255) NOT NULL,
Email VARCHAR(256) NOT NULL UNIQUE,
Phone VARCHAR(12) NOT NULL,
CreatedOn TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,... |
-- Counts the number of fans each country's
-- metal bands have using an SQL query
SELECT origin, sum(fans) as nb_fans
FROM metal_bands
GROUP by origin
ORDER BY nb_fans DESC; |
CREATE PROC [ERP].[Usp_Upd_PlanCuenta]
@IdPlanCuenta INT,
@IdGrado INT,
@IdColumnaBase INT,
@IdMoneda INT,
@IdTipoCambio INT,
@Nombre VARCHAR(50),
@CuentaContable VARCHAR(50),
@FlagBorrador BIT,
@EstadoAnalisis BIT,
@EstadoProyecto BIT,
@UsuarioModifico VARCHAR(250)
AS
BEGIN
UPDATE [ERP].[PlanCuenta] SET IdGrado... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- 主機: 127.0.0.1
-- 產生時間: 2017-03-29 18:24:59
-- 伺服器版本: 10.1.10-MariaDB
-- PHP 版本: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARA... |
use fungisystem;
select * from usuario order by login desc;
insert into usuario (idLogin , login , senha ,idCliente) values
(1, 'Leticia', 'Leticia2', null),
(2, 'Luana', 'Luana2', null);
update usuario set senha = 'luana3' where idlogin = 2;
select * from cliente;
|
ALTER TABLE twitter_tweets ADD COLUMN `cImage` TEXT DEFAULT NULL; |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: May 15, 2018 at 12:11 AM
-- Server version: 5.6.35
-- PHP Version: 7.0.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
SELECT * FROM coowell.employees; |
/* Formatted on 21/07/2014 18:46:10 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.VOMCRE0_APP_HP_EXCEL
(
COD_COMPARTO,
DESC_COMPARTO,
VAL_BANCA,
VAL_DIREZIONE,
VAL_REGIONE,
COD_REGIONE,
VAL_AEREA,
COD_AREA,
COD_FILIALE,
COD_ABI_ISTITUTO,
COD_ABI_CARTOLARIZZATO,
CO... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `bdr_th... |
CREATE USER dockeruser;
CREATE DATABASE rabdb;
GRANT ALL PRIVILEGES ON DATABASE rabdb TO dockeruser;
|
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
\c :TEST_DBNAME :ROLE_SUPERUSER
CREATE OR REPLACE FUNCTION test.condition() RETURNS VOID
AS :MODULE_PATHNAME, 'ts_test_utils_conditio... |
INSERT INTO PARTIDOS VALUES('1972-1973','1',1,'Granada','Zaragoza',0,0);
INSERT INTO PARTIDOS VALUES('1972-1973','1',1,'Barcelona','Dptivo._Coruna',3,1);
INSERT INTO PARTIDOS VALUES('1972-1973','1',1,'At._Madrid','Valencia',1,3);
INSERT INTO PARTIDOS VALUES('1972-1973','1',1,'Las_Palmas','Oviedo',2,1);
INSERT INTO ... |
drop table profile cascade;
create table profile (
id serial8 PRIMARY KEY,
mitty_id int,
gender varchar (10),
one_word_speech varchar (200),
constellation varchar (20),
home_island_id int8 ,
birth_island_id int8 ,
age_group varchar (20),
appearance_tag varchar (20),
... |
select * from product;
update product set unitqty = 24 where qtys = '[{"n":"24","q":24},{"n":"2x24","q":48},{"n":"3x24","q":72}]';
update product set unitqty = 6 where qtys = '[{"n":"6","q":6},{"n":"2x6","q":12},{"n":"3x6","q":18}]';
update product set name = 'Fizz Päärynä tölkki 0,33l' where id = 2;
delete from pro... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.0.21-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 9.1.0.4867
-- ------------------------------------------------... |
SELECT TOP 4 WITH TIES
p.SalesPersonID,
p.Bonus
FROM Sales.SalesPerson p
ORDER BY Bonus DESC
---------------------
SELECT TOP 4
p.SalesPersonID,
p.Bonus
FROM Sales.SalesPerson p
ORDER BY Bonus DESC
--------------------
SELECT TOP 4 WITH TIES
p.SalesPersonID,
p.Bonus
FROM Sales.SalesPerso... |
CREATE TABLE nx_sns_relation (
serial_no varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
uid varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL,
target_uid varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL,
range_mask int NULL,
create_time datetime NULL
) CHARACTER SET utf8 ENGINE = MyISAM;
ALTER T... |
CREATE TABLE enigma (
id INTEGER GENERATED BY DEFAULT AS IDENTITY
);
|
CREATE TABLE users (
id UUID PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
bio VARCHAR(2048),
image VARCHAR(2048),
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ NOT NULL DEFAULT ... |
-- -h localhost -U snk -d kit
DO $$
<<snk>>
DECLARE
a integer;
b varchar;
c text;
BEGIN
select into now now();
RAISE NOTICE 'now %', now;
RAISE NOTICE 'snk.now %', snk.now;
RAISE INFO
USING MESSAGE = 'raised info message text',
HINT = 'a hint message',
DETAIL =... |
/*
################################################################################
Migration script drop ENTREZ_GENE_ID and ENSEMBL_GENE_ID columns from GENE table.
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
co... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-11-2020 a las 07:53:58
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE `tb_test` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`testkey` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
PRIMARY KEY (`id`)
)
COLLATE='utf8mb4_unicode_ci'
;
|
create table students
(
first_name varchar(20),
last_name varchar(20),
e_mail varchar(20),
address varchar(20),
state VARCHAR(2),
pin varchar(20),
phone_no varchar(20),
s_id varchar(5) primary key,
date_of_birth date,
qualification varchar(2),
percent_10 number(2),
percent_12 number... |
#
# Table structure for table 'tx_lvdb_domain_model_data'
#
CREATE TABLE tx_lvdb_domain_model_data (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
text1 text NOT NULL,
img1 int(11) unsigned NOT NULL default '0',
text2 text NOT NULL,
img2 int(11) ... |
/*
Get the list of distinct patients across all data tables
*/
INSERT INTO DistinctPatients
SELECT new_enc_nhi, NULL, NULL, NULL, NULL, NULL, NULL FROM Labs
UNION
SELECT new_enc_nhi, NULL, NULL, NULL, NULL, NULL, NULL FROM Pharmacy
UNION
SELECT new_enc_nhi, NULL, NULL, NULL, NULL, NULL, NULL FROM... |
DROP MATERIALIZED VIEW IF EXISTS graph.vw_shiny;
CREATE MATERIALIZED VIEW graph.vw_shiny AS
SELECT p.id_osc,
-- p.cd_identificador_osc,
p.tx_razao_social_osc,
p.tx_nome_fantasia_osc,
p.cd_natureza_juridica_osc,
aa.tx_nome_natureza_juridica,
p.dt_fundacao_osc,
substring(p.dt_fundacao_osc::TEXT, 1... |
--Problem 1. Find Names of All Employees by First Name
SELECT FirstName, LastName
FROM Employees
WHERE (FirstName LIKE 'Sa%')
--Problem 2. Find Names of All employees by Last Name
SELECT FirstName, LastName
FROM Employees
WHERE (LastName LIKE '%ei%')
--Problem 3. Find First Names of All Employees
SELECT FirstName
FR... |
create table helousers (
id serial primary key,
username varchar(20),
password varchar(20),
profile_pic text
)
create table heloposts (
id serial primary key,
title varchar(45),
img text,
content text,
author_id integer REFERENCES helousers(id)
)
|
DROP PROCEDURE IF EXISTS get_userType;
DELIMITER $$
CREATE PROCEDURE `get_userType`(IN i_username VARCHAR(50))
BEGIN
DROP TABLE IF EXISTS user_type;
CREATE TABLE user_type
SELECT username,
CASE
WHEN username in (select username from customer natural join manager natural join user) THEN "CustomerManage... |
alter table RequestInfo add priority number(10,0);
alter table ProcessInstanceLog add processType number(10,0);
update ProcessInstanceLog set processType = 1;
update RequestInfo set priority = 5;
create table CaseIdInfo (
id number(19,0) not null,
caseIdPrefix varchar2(255 char),
currentValue number(19,0)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.