text stringlengths 6 9.38M |
|---|
CREATE TABLE IF NOT EXISTS zip (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
postcode VARCHAR(55) NOT NULL,
ken VARCHAR(127) NOT NULL,
shi VARCHAR(127) NOT NULL,
cho VARCHAR(127) NOT NULL
);
|
create table room_type
( type char not null,
price integer,
tv char(1), -- '0' is false otherwise true
minibar char(1), -- '0' is false otherwise true
primary key (type)
);
create table room
( number integer not null generated always as identity,
type char,
smoker char(1), -- '0' is false ... |
create table if not exists warehouse.delivery_schedule
(
id serial
constraint delivery_schedule_pk
primary key,
date_ date
);
comment on table warehouse.delivery_schedule is 'расписание поставок';
|
-- CREATE ANONYMOUS USER
CREATE USER ANONUSER PASSWORD Password1;
-- GRANT ACCESS TO APPLICATION SCHEMA
GRANT SELECT, INSERT, DELETE ON SCHEMA LIVE2 TO ANONUSER;
CALL GRANT_PRIVILEGE_ON_ACTIVATED_CONTENT('EXECUTE','"LIVE2"."Live2::lp.model"','ANONUSER');
GRANT AFL__SYS_AFL_AFLPAL_EXECUTE TO ANONUSER;
|
INSERT INTO core.offices(office_code, office_name, currency_code, nick_name, po_box, address_line_1, address_line_2, street, city, state, country, phone, fax, email, url, allow_transaction_posting)
SELECT 'DEF', 'Default', 'NGN', 'Freebe', '01234', 'Lekki Phase 1', '', '', 'Lagos', 'WA', 'Nigeria', '(234) 803 046 9664... |
DROP TABLE IF EXISTS vestibular.fct_aprovacao;
CREATE TABLE vestibular.fct_aprovacao AS SELECT
dc.sk_id_candidato,
dv.sk_id_evento,
dlc.sk_id_local_candidato,
dr.sk_id_renda,
dcs.sk_id_curso,
sa.aprovacao_candidato
FROM vestibular.dim_candidato dc JOIN vestibular.dim_vestibular dv ON dc.id_eve... |
create database fib3;
use fib3;
create table produtos(
id int not null,
nome varchar(30) not null,
fabricante varchar(30) not null,
quantidade int not null,
vlunitario decimal(7,2) not null,
tipo varchar(20) not null
);
insert into produtos values (1,'playstation3','sony',100,1999,'console');... |
INSERT INTO candidates (number, first_name, last_name, agenda) VALUES
(1, 'Donald', 'Trump', 'I will make america great again!'),
(2, 'Rosie', 'Odonel', 'Im gonna make some pankakes!'),
(3, 'Eric', 'Cartman', 'Cats are so cewl, bad mister kitty!'),
(4, 'Barack', 'Obama', 'I will make people more healthy!'),
(... |
-- Lists all shows contained in hbtn_0d_tvshows
-- that have at leas one genre linked
-- Display tv_shows.title - tv_show_genres.genre_id
-- Sort asc by tv_shows.title and tv_show_genres.genre_id
SELECT tv_shows.title, tv_show_genres.genre_id
FROM tv_shows INNER JOIN tv_show_genres
ON tv_shows.id = tv_show_genres.show_... |
INSERT INTO TEMPORADA (fecha, division) VALUES ('1972-1973','1');
INSERT INTO TEMPORADA (fecha, division) VALUES ('1972-1973','2');
INSERT INTO TEMPORADA (fecha, division) VALUES ('1973-1974','1');
INSERT INTO TEMPORADA (fecha, division) VALUES ('1973-1974','2');
INSERT INTO TEMPORADA (fecha, division) VALUES ('197... |
SELECT TOP 10 CompanyName, SUM([Shipped Value]) AS 'Value Shipped In 1998' FROM
(SELECT Orders.OrderID, ShippedDate, ROUND(SUM(UnitPrice * Quantity * (1 - Discount)),0) AS 'Shipped Value'
FROM Orders
JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Orders.OrderID, ShippedDate
HAVING YEAR(Shipp... |
select class,country
from CLASSES
where NUMGUNS < 10
select name as ShipName
from ships
where LAUNCHED<1918
select ship, battle
from OUTCOMES
where result='sunk'
select name
from SHIPS
where name=CLASS
select name
from ships
where name Like 'r%'
select name
from ships
where name like '% %' |
CREATE TABLE IF NOT EXISTS `practica_07_alumnos` (
`id` int(250) NOT NULL AUTO_INCREMENT,
`matricula` varchar(7) NOT NULL,
`id_carrera` int(11) NOT NULL,
`nombre` varchar(50) NOT NULL,
`apellido_paterno` varchar(50) NOT NULL,
`apellido_materno` varchar(50) NOT NULL,
`email` varchar(200) NOT NULL,
`estad... |
select
ps_partkey,
sum(ps_supplycost * ps_availqty) as value
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = 'GERMANY'
group by
ps_partkey having
sum(ps_supplycost * ps_availqty) > (
select
sum(ps_supplycost * ps_availqty) * 0.0001
from
partsupp,
supplier,
nation
... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 12, 2021 at 11:14 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
SELECT * FROM {{ @sdss }}
|
SELECT customer.store_id, address.city_id, customer.first_name, customer.last_name, customer.email, address.address
FROM customer
JOIN address ON customer.address_id = address.address_id
WHERE customer.store_id = 1
AND address.city_id IN (1,42,312,459);
|
INSERT INTO PUBLIC.USERS (ID, LOGIN, EMAIL) VALUES (1, 'asd', 'asd@mail.ru'); |
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database:
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
CREATE TABLE Position
(
Salary INT NOT NULL,
Responsibilities VARCHAR(250) NOT NULL,
Requirements VARCHAR(250) NOT NULL,
Job_title VARCHAR(250) NOT NULL,
Position_ID INT NOT NULL,
PRIMARY KEY (Position_ID)
);
CREATE TABLE Types_Component
(
Type_ID INT NOT NULL,
Type_title VARCHAR(250) NOT NULL,
Type_... |
{{ config(materialized='table') }}
select {{ref('station_summary')}}.flow_99,
{{ref('station_summary')}}.flow_max,
{{ref('station_summary')}}.flow_median,
{{ref('station_summary')}}.flow_total,
{{ref('station_summary')}}.n_obs,
{{ref('station_metadata')}}.*
from {{ref('station_summa... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50620
Source Host : localhost:3306
Source Database : taobaoserver
Target Server Type : MYSQL
Target Server Version : 50620
File Encoding : 65001
Date: 2015-01-23 15:21:51
*/
SET FOREIGN... |
-- repairing update and deletion cascades
-- at this, the experiment design metadata association is transferred to the
-- experiment metadata table
SELECT assert('(select version from db_version) = 209.0007');
-- add cascading (clean up experiment design)
ALTER TABLE experiment_design_rack
DROP CONSTRAINT experim... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 06, 2017 at 11:30 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
CREATE TABLE `messages2` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`texto` varchar(255) DEFAULT NULL,
`new` enum('0','1') DEFAULT '1',
`user` varchar(50) DEFAULT NULL,
`ip` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
-- 菜单信息表
-- 主菜单插入
INSERT INTO `mydb`.`tab_sys_menu` (`id`, `top_id`, `parent_id`, `menu_type`, `menu_name`, `menu_desc`, `priority`)
VALUES ('0', null, null, '0', '后台管理', '后台管理', '1');
INSERT INTO `mydb`.`tab_sys_menu` (`id`, `top_id`, `parent_id`, `menu_type`, `menu_name`, `menu_desc`, `priority`)
VALUES ('1', '0',... |
create table sys_user
(
id varchar(36) charset utf8 not null comment '主键',
user_name varchar(100) charset utf8 null comment '登录账号',
real_name varchar(100) charset utf8 null comment '真实姓名',
password varchar(255) charset utf8 null comment '密码',
salt varchar(45) charset utf8 nu... |
-- phpMyAdmin SQL Dump
-- version 2.11.11.3
-- http://www.phpmyadmin.net
--
-- Servidor: 45.40.164.83
-- Tiempo de generación: 21-09-2017 a las 12:36:01
-- Versión del servidor: 5.5.51
-- Versión de PHP: 5.1.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
insert into person
values(1,12,'Ravix', 'hell@world.com');
insert into person
values(2,12,'Ravi', 'hell@world.com'); |
SELECT DISTINCT A.DocumentoID AS ID,
B.ProductoID,
A.ProveedorID,
A.ComprobanteID,
A.Serie,
A.Numero,
cstr(B.Item) as Item
FROM TB_Compra AS A
LEFT JOIN TB_CompraDetalle AS B ON A.DocumentoID=B.DocumentoID
WHERE B.ProductoID IS NOT NULL;
|
CREATE TABLE `retangulos` (
`id_retangulos` INTEGER PRIMARY KEY AUTOINCREMENT,
`retangulos_nome` TEXT ( 100 ) NOT NULL,
`retangulos_base` NUMERIC NOT NULL,
`retangulos_altura` NUMERIC NOT NULL,
`retangulos_area` NUMERIC NOT NULL,
`retangulos_reta_a1` NUMERIC NOT NULL,
`retangulos_reta_a2` NUMERIC NOT NULL,
`ret... |
ALTER TABLE P_OrderDtl
ADD
D_RecID bigint not null default ((0))
ALTER TABLE P_OrderDtlBak
ADD
D_RecID bigint not null default ((0))
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2019 at 11:12 AM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE `api_apikeyconfirmation` (
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`user_id` integer NOT NULL PRIMARY KEY,
`token` varchar(20) NOT NULL,
`confirmed_once` bool NOT NULL
);
ALTER TABLE `api_apikeyconfirmation` ADD CONSTRAINT `api_apikeyconfirmation_user_id_2b790b0... |
select
cl.cl_id,
cl.cl_jsonb,
x.cl_type,
case
when cl.cl_jsonb->>'cl_type' = 'natural'
then ((cl.cl_jsonb->>'cl_name') || ' ' || (cl.cl_jsonb->>'cl_firstsurname') || ' ' || coalesce(cl.cl_jsonb->>'cl_secondsurname',''))
else cl_jsonb->>'cl_corporatename'
end as cl_corporatename,
x.cl_rfc,
x.c... |
alter user postgres with password 'postgres';
commit;
|
-- dropping USER_ACCOUNT table
drop sequence account_seq;
drop table USER_ACCOUNT;
-- dropping and recreating USR table
drop table USR;
create table USR (
id integer not null,
email varchar2(255) not null unique,
password varchar2(255) not null,
remaining_logon_attempt integer default 3,
temporaryPassword v... |
-- Question 1 start
select Vendors.VendorID
,SUM(PaymentTotal) as PaymentSum
from Invoices join Vendors
on Invoices.VendorID
= Vendors.VendorID
group by Vendors.VendorID
order by Vendors.VendorID
--Question 1 end
--Question 2 start
select top 10 SUM(PaymentTotal) as PaymentSum
,Vendors.VendorNa... |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 29 Lis 2019, 16:48
-- Wersja serwera: 10.1.31-MariaDB
-- Wersja PHP: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
CLEAR SCREEN;
SET SERVEROUTPUT ON;
SET FEEDBACK ON;
DECLARE
rb RMAN_RULEBLOCKS%ROWTYPE;
BEGIN
-- BEGINNING OF RULEBLOCK --
rb.blockid:='id_tb';
DELETE FROM rman_ruleblocks WHERE blockid=rb.blockid;
rb.picoruleblock:='
/* This is a algorithm to i... |
#+----------------------------------------------------------+
#| |
#| This script was produced by the OpenDataForge SDA Script |
#| Generator. |
#| |
#| ... |
CREATE TABLE course
(
crn int,
professor varchar(30),
dept varchar(30),
courseNo varchar(30),
sectionNo varchar(30),
event_id int,
CONSTRAINT course_pk PRIMARY KEY (crn),
CONSTRAINT c_event_fk FOREIGN KEY (event_id) REFERENCES event(event_id)
);
|
-- phpMyAdmin SQL Dump
-- version 3.5.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 18, 2013 at 02:02 PM
-- Server version: 5.5.29
-- PHP Version: 5.4.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Table structure for table `links`
--
CREATE TABLE IF NOT EXIST... |
USE [ETS_P]
ALTER TABLE TradeConfirmFileList ADD GLFTSNum int |
INSERT INTO team (id, name) VALUES
(1, 'Real Madrid'),
(2, 'FC Barcelona'),
(3, 'Athletico Madrid');
INSERT INTO player (id, age, name, team_id) VALUES
(1, 33, 'Cristiano Ronaldo', 1),
(2, 28, 'Gareth Bale', 1),
(3, 33, 'Luka Modric', 1),
(4, 33, 'Lionel Messi', 2),
(5, 33, 'Luis Suarez', 2),
(6, 33, 'Antoine Griezzma... |
--
-- Drop existing objects
--
DROP SEQUENCE IF EXISTS web.customer_draft_id_seq CASCADE;
DROP TABLE IF EXISTS web.customer_draft CASCADE;
DROP TABLE IF EXISTS web.customer_draft_individual CASCADE;
DROP TABLE IF EXISTS web.customer_draft_professional CASCADE;
DROP SEQUENCE IF EXISTS web.customer_id_seq CASCADE;
DROP... |
CREATE TABLE candidato (
nu_inscricao varchar(15) NOT NULL PRIMARY KEY
, nu_ano varchar(4)
, co_municipio_residencia varchar(7)
, no_municipio_residencia text
, co_uf_residencia varchar(2)
, sg_uf_residencia varchar(2)
, nu_idade varchar(3)
, tp_sexo varchar(3)
, tp_estado_civil varchar(3)
, tp_cor_raca varchar(3)
, ... |
ALTER TABLE `set_language` ADD `voice_rss_code` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `keyword`;
UPDATE `set_language` SET `voice_rss_code` = 'en-gb' WHERE `set_language`.`id` = 1;
UPDATE `set_language` SET `voice_rss_code` = 'zh-cn' WHERE `set_language`.`id` = 2;
UPDATE `set_l... |
insert into scheduler_windows_history
select d.*, 'NEW-LONGER-WINDOW'
from DBA_SCHEDULER_WINDOWS d
where enabled = 'TRUE'
/
commit;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 05, 2017 at 08:37 AM
-- 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... |
SELECT
-- A.交易方代码
A.CUSTOMER_CODE,
-- A.决算月度
A.SETTLEMENT_MONTH AS H_SETTLEMENT_MONTH,
-- A.报表频率
A.REPORT_FREQUENCY,
-- C.コード名称 AS 报表频率名
C.CODE_NAME AS H_REPORT_FREQUENCY,
-- A.录入年月日 As 导入日期
A.REG_DATE AS H_REG_DATE,
-- A.录入者
A.REG_USER,
-- D.ユーザー名 AS 录入者名
D.USER_NAME AS H_REG_USER,
-- E.分数
E.SCORING_PO... |
alter table netent_transactions add column reached_bonus_conversion_goal tinyint;
update netent_transactions
set reached_bonus_conversion_goal = 0;
alter table netent_transactions modify column reached_bonus_conversion_goal tinyint not null;
|
-- MySQL dump 10.13 Distrib 8.0.23, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: sharedtimeclock
-- ------------------------------------------------------
-- Server version 8.0.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... |
ALTER TABLE `digitalmenu`.`discounttemplate` DROP COLUMN `value`;
ALTER TABLE `digitalmenu`.`discounttemplate` CHANGE COLUMN `rate` `value` DOUBLE NOT NULL ;
update digitalmenu.discounttemplate set type = 1 where id > 0; |
USE om;
-- 1 --
SELECT *
FROM order_details;
-- 2 --
SELECT count(*) AS 'Number of Orders', MAX(order_qty) AS 'Most Ordered'
from order_details;
-- 3 --
SELECT COUNT(order_id) AS 'Number of Orders', MAX(order_qty) AS 'Most Ordered'
FROM order_details;
-- 4 --
SELECT count(*) from order_details where order_id = 796;... |
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: db_cinefsw
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
DROP DATABASE IF EXISTS converge;
CREATE DATABASE converge;
/* change database to converge */
\c converge;
CREATE TABLE IF NOT EXISTS users(
id serial NOT NULL PRIMARY KEY,
loginid VARCHAR(100) NOT NULL,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
avatar_url VARCHAR(1024),
email VARCHAR(... |
----------------------------
-- Table structure for login
-- ----------------------------
DROP TABLE IF EXISTS login;
CREATE TABLE login (
id bigint NOT NULL,
user_id bigint DEFAULT '0',
user_agent varchar(128) DEFAULT '',
ip_address varchar(128) DEFAULT '',
type integer DEFAULT '1',
login_time TIMESTAMP WI... |
CREATE TABLE P01E03_Producto (
cod_prod numeric(7,0),
descripsion varchar(40) NOT NULL,
tipo char(10) NOT NULL,
CONSTRAINT PK_Producto
PRIMARY KEY (cod_prod)
);
CREATE TABLE P01E03_Proveedor (
cod_prov integer,
razon_social varchar(40) NOT NULL,
calle varchar(60) NOT NULL,
altura numeric(5,0) NOT NULL,
piso... |
/*!40101 SET NAMES binary*/;
/*!40014 SET FOREIGN_KEY_CHECKS=0*/;
CREATE TABLE `Vehiculo` (
`idVehiculo` int(11) NOT NULL,
`Dominio` varchar(10) NOT NULL,
`FechaPatentamiento` date NOT NULL,
`idCategoria` int(11) NOT NULL,
`idTipoVehiculo` int(11) NOT NULL,
PRIMARY KEY (`idVehiculo`),
KEY `FK_VehiculoCat... |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 17, 2015 at 10:23 AM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
drop sequence PRODUCT_ORDER_SEQ;
|
DROP TABLE IF EXISTS aimfit_users; |
CREATE KEYSPACE IF NOT EXISTS friendship WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 3 };
USE friendship;
CREATE TABLE IF NOT EXISTS users (
id UUID PRIMARY KEY,
email text,
created_ts timestamp
);
CREATE INDEX IF NOT EXISTS ON friendship.users (email);
CREATE TABLE IF NOT E... |
CREATE OR REPLACE VIEW VALUE_STATE AS
SELECT 0 AS id,
'BAIXA' AS name,
'OBSOLETE' AS observ
FROM DUAL
UNION
SELECT 1 AS id,
'ALTA' AS name,
'ON SERVICE' AS observ
FROM DUAL
UNION
SELECT 2 ... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6
-- Dumped by pg_dump version 12.6
-- Started on 2021-04-27 17:33:31
--
-- TOC entry 2853 (class 0 OID 25304)
-- Dependencies: 202
-- Data for Name: manufacturer; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.manufactur... |
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 01, 2011 at 07:53 AM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
-- (C) 2007-2017 - Juhani V�lim�ki (Toan Khuc, Thu Nghiem)
-- MARIADB = MySQL script
-- (USERNAME AND PASSWORD TO LOGIN TO MYSQL)
-- Username: a1xxxxxx if mariadb.haaga-helia.fi
-- Password: pppppppp
-- (MAKE SURE YOU ALSO CHANGE TO THE a1xxxxx DATABASE IN MYSQL)
-- -------------------------------------------------... |
--Consulta 1
--Campeones de liga
CREATE VIEW ganadores_liga AS
SELECT DISTINCT nombre
FROM (
SELECT temporada, division, nombre, final_de_liga, row_number() over(PARTITION BY temporada, division
ORDER BY temporada, division, final_de_liga DESC) AS puesto
FROM (
--Puntuaciones de todos los equipos a final de liga... |
CREATE OR REPLACE VIEW "DW_ORG"."PNMAC"."VW_MONTHLY_EMPLOYEES_WITH_BUDGET" AS
SELECT
me.*
,bd.headcountbudgeted
from "DW_ORG"."PNMAC"."VW_MONTHLY_EMPLOYEES" me
LEFT JOIN "DW_ORG"."PNMAC"."DEPARTMENT_BUDGET" bd ON me.app_dev_budget_category = bd.category and me.outsourced = bd.outsourced and me.months... |
-- Finding Rows That Satisfy Multiple Conditions
-- Use a WHERE clause in combo w. OR and AND clauses
select *
from emp
where "DEPTNO" = 10
or "COMM" is not null
or "SAL" <= 2000 AND "DEPTNO" = 20; |
ALTER TABLE IACUC_PROTO_AMEND_RENEW_MOD
ADD CONSTRAINT UQ_IACUC_PROTOCOL_AMEND_RENEW
UNIQUE (PROTOCOL_NUMBER, PROTO_AMEND_RENEWAL_NUMBER, PROTOCOL_MODULE_CODE)
/
|
-- 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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SU... |
CREATE USER IF NOT EXISTS card42 PASSWORD 'debug-password' ;
CREATE DATABASE IF NOT EXISTS card42 WITH OWNER card42;
CREATE EXTENSION IF NOT EXISTS hstore;
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server Version: 10.1.9-MariaDB - mariadb.org binary distribution
-- Server Betriebssystem: Win32
-- HeidiSQL Version: 9.4.0.5168
-- -------------------------------------------------... |
create table IntegrationContent (
id bigint generated by default as identity,
lastUpdated timestamp
);
insert into IntegrationContent (id, lastUpdated) values
(1, '2010-01-01-00.00.00.000000'),
(2, '2010-01-01-00.00.00.000000'),
(3, '2010-01-01-00.00.00.000000');
create table BulkAndFullChangesetTestProfile... |
create table country(
id serial,
name text,
top_level_domain text[],
population int8,
latlng text[],
flag text,
primary key (id)
);
create table currency(
id serial,
code text,
name text,
symbol text,
country_id int4,
primary key (id)
);
create table language(
i... |
set foreign_key_checks = 0;
delete from tracer_supply_type_attr_value where tracers_id > 0;
delete from tracer where id > 0;
delete from manufacturing_order where id > 0;
set foreign_key_checks = 1; |
ALTER TABLE tracking_todo
ADD COLUMN reminder_interval TINYINT unsigned NOT NULL default 1 AFTER description,
ADD COLUMN reminder_senddate TIMESTAMP NULL default NULL AFTER reminder_interval,
ADD COLUMN reminder_enddate TIMESTAMP NULL default NULL AFTER reminder_senddate,
ADD INDEX `idx_reminderEnddate` (`reminder_endd... |
create table CMECredit (
id serial,
quiz integer references Inquisition(id) on delete set null,
front_matter integer not null references CMEFrontMatter(id) on delete cascade,
hours numeric(5, 2) not null,
passing_grade decimal(5, 2),
email_content_pass text,
email_content_fail text,
resettable boolean not nul... |
/**
* SQL statement for update into FR_SHISETSU_LIKE_COUNT
*
* @author: QuocHN
* $Id: AddLikeService_updateLikeCount_Upd_01.sql 15146 2014-07-18 02:33:11Z p_hoan_kuokku $
*/
UPDATE
FR_SHISETSU_LIKE_COUNT FSLC
SET
FSLC.LIKE_COUNT = FSLC.LIKE_COUNT + 1
WHERE
FSLC.CUSTOMER_VOICE_ID = /*customerVoiceId*/... |
ALTER TABLE `ijp`.`JOB`
ADD COLUMN `SESSIONID` VARCHAR(255) NULL DEFAULT NULL AFTER `USERNAME`;
|
/*
Navicat MySQL Data Transfer
Source Server : dev-dever-pub
Source Server Version : 50556
Source Host : 121.12.252.172:33066
Source Database : ins_edu_mj
Target Server Type : MYSQL
Target Server Version : 50556
File Encoding : 65001
Date: 2018-03-14 14:29:39
*/
SET... |
CREATE TABLE etl_job_group(
job_group_cd varchar2(64) NOT NULL
,job_group_name varchar2(64)
,job_group_desc varchar2(512)
,record_status varchar2(1)
,create_by varchar2(16)
,create_dt timestamp
,modify_by varchar2(16)
,modify_dt timestamp
,org_cd varchar2(16)
,loc_cd varchar2(16)
,grp_cd varchar2(16)
) |
-- MySQL Script generated by MySQL Workbench
-- Thu Aug 12 11:42:12 2021
-- 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... |
--WRONG (does not consider duplicates!!)
--select *
--from
--(
--select country, COUNT(*) as number
--from airport
--group by country
--order by number DESC
--) as airports_by_country
--limit 1;
select country, COUNT(*) as number
from airport
group by country
having number = (
select min(number) as min_no_airport... |
/*
Programming for Data Science with Python Nanodegree
Udacity's certified program > SQL practice > Lesson 3 : SQL SubQueries
SUB QUERY general format:
*/
SELECT *
FROM (
) Alias_name
GROUP BY
ORDER BY ;
/*
Format Rules:
1. The original query goes in the FROM statement.
2. An * is used in the SELECT statement... |
select p.* from type t
left join product p
on t.id=p.type_id
where t.name='СЫР';
select * from product where name like '%мороженное%';
select * from product where expired_date<current_date+interval '1 month';
select * from product where price = any
(select max(price) from product);
select t.name, su... |
SET SEARCH_PATH = "COMMON";
INSERT INTO "0001"."Privilege" ("OID_USER", "OID_ITEM", "READ", "WRITE")
SELECT u."OID", i."OID", TRUE, TRUE FROM "User" AS u, "SecureItem" AS i
WHERE (u."OID", i."OID") NOT IN (SELECT "OID_USER", "OID_ITEM" FROM "0001"."Privilege"); |
CREATE TABLE MY_TABLE (
CURRENCY_ID VARCHAR2,
CURRENCY_NAME VARCHAR2
);
INSERT INTO MY_TABLE(CURRENCY_ID, CURRENCY_NAME) VALUES ('gbp', 'Pound Sterling');
INSERT INTO MY_TABLE(CURRENCY_ID, CURRENCY_NAME) VALUES ('sek', 'Swedish Krona');
INSERT INTO MY_TABLE(CURRENCY_ID, CURRENCY_NAME) VALUES ('nok', 'Norwegian Kron... |
########################## EjerciciO No1 ############################################
#Cree procedimiento almacenado "sp_guardar_subscriptor" para actualizar los
# campos de un subscriptor existente en la base de datos.
select * from bd_sample.tbl_subscriptores;
DROP PROCEDURE bd_sample.SP_GUARDAR_SUBSCRIPTOR;
DELIMI... |
USE ProjetRJ;
DROP PROCEDURE IF EXISTS ps_voir_commentaires;
DELIMITER #
CREATE PROCEDURE ps_voir_commentaires (IN p_pseudonyme VARCHAR(40), IN p_texte_commentaire TEXT)
BEGIN
DECLARE l_id_utilisateur INT;
DECLARE l_id_publication INT;
DECLARE l_id_commentaire INT;
SET @l_id_utilisateur = (SELECT id... |
CREATE TABLE messages
(
id UUID PRIMARY KEY,
username VARCHAR(30) NOT NULL,
message TEXT NOT NULL,
created TIMESTAMPTZ NOT NULL
);
|
DROP TABLE IF EXISTS BAJAJ_DM.D_parent_lan_product;
CREATE TABLE BAJAJ_DM.`D_parent_lan_product` (
id TINYINT NOT NULL,
`name` varchar(20) NOT NULL
)ENGINE=MDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS BAJAJ_DM.temporary_table;
CREATE TABLE BAJAJ_DM.temporary_table (
`id` INT NOT NULL AUTO_INCREMENT,
`name` V... |
#Номенклатурни данни за родител/наследник паразити
INSERT INTO school_health.parasit_type (parasit_type_code, parasit_type_name) VALUES ('01','Въшки');
|
-- INVOICE MODULE COMMON DATA SCRIPT
-- INSERTS
INSERT INTO "COMMON"."Variable" ("NAME", "VALUE") VALUES ('INVOICE_DB_VERSION', '6.7.0.0');
INSERT INTO "UserSetting" ("OID_USER", "NAME", "VALUE") (SELECT U."OID", 'SALIDA_CONTABILIDAD_FOLDER', '' FROM "User" AS U);
INSERT INTO "UserSetting" ("OID_USER", "NAME", "VALU... |
BEGIN TRANSACTION;
CREATE TABLE CDs( fid integer primary key autoincrement,label text);
INSERT INTO "CDs" VALUES(1,'aspire1_sda1');
DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" VALUES('CDs',1);
CREATE TABLE aspire1_sda1_files( fid integer primary key,pid integer,fileName text, st_mode integer, st_nlink in... |
INSERT INTO PACKAGE(id_pack, name, can_be_modified_outside) VALUES (5, 'Verb complementation: what follows verbs', 5);
INSERT INTO RULE(id_rule, name, detail, pack) VALUES (29, 'Unit 29: Verb + two objects', 'Some verbs are followed by two objects. Usually the first object is a person (or group of people)
and the s... |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 06, 2018 at 08:56 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
PRAGMA foreign_keys = OFF
drop table if exists departamento
drop table if exists pessoa
PRAGMA foreign_keys = ON
create table departamento (
id integer primary key autoincrement,
nome TEXT
)
create table pessoa (
id integer primary key autoincrement,
nom... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.