text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 01, 2021 at 04:32 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
select osm_id, name, operator, ST_AsGeoJSON(ST_Transform(way, 4326)) as geojson
from planet_osm_point
where railway = 'station'
UNION
select osm_id, name, operator, ST_AsGeoJSON(ST_Transform(way, 4326)) as geojson
from planet_osm_polygon
where railway = 'station'
UNION
select osm_id, name, operator, ST_AsGeoJSON(ST_Tra... |
-- Model: Make IT Model
-- Version: 2.0.0
-- Author: sonnyako <Makydon Sofiia>
-- Project: MySQL DB for Job Promoter Application "Make IT"
-- Description: Setup Persistence Layer For Security
SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0;
SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CH... |
# Table structure for projection info database
CREATE TABLE projections (
db_release INT NOT null,
timestamp DATETIME,
from_db VARCHAR(255),
from_species_latin VARCHAR(255),
from_species_common VARCHAR(255),
to_db VARCHAR(255),
to_species_latin VARCHAR(255),
to_species... |
-- TITLE:Collecting Oracle Streams Statistics Using the UTL_SPADV Package
DOC
*** Advanced Monitoring of Oracle Streams ***
Install UTL_SPADV package using $ORACLE_HOME/rdbms/admin/utlspadv.sql
Either collect current statistics once, or create a job
Collect stats once:
exec UTL_SPADV.COLLECT_STATS
Create contin... |
use eve;
insert into invTypes (typeID, Name) VALUES(18,"斜长岩");
insert into invTypes (typeID, Name) VALUES(19,"灰岩");
insert into invTypes (typeID, Name) VALUES(20,"水硼砂");
insert into invTypes (typeID, Name) VALUES(21,"同位原矿");
insert into invTypes (typeID, Name) VALUES(22,"艾克诺岩");
insert into invTypes (typeID, Name) VALU... |
-- updates Bob's score to 10 in second_table
UPDATE second_table SET score = 10 WHERE name = "Bob";
|
/*
/*
* Student: Eduardo Aguirre
* Session 11
* Assignment 1
*
Write a SQL statement to update the email column of employees table with
“diana@gmail.com” for id 3.
b) Write a SQL statement to update the commission_pct column of employees table
with 40 where salary is greater than 19,000 .
c) Write a SQL statement ... |
-- favor mudar a string de conex„o do banco de dados no Visual Studio
create database db_empresa;
use db_empresa;
create table pedidos
(
idPedido int identity,
prato varchar(45),
bebida varchar(45) primary key,
quantidade char(5),
mesa int,
nomeCliente varchar (45)
)
create table copa
(
idPedido int identity,
Beb... |
CREATE OR REPLACE VIEW RLARP.VW_FFWFACM (
MODULE ,
BATCH ,
PERD ,
TDATE ,
PDATE ,
ACCT ,
AMT ,
KBPRJ# ,
USRN ,
REV ,
CUSMOD ,
CUSKEY1 ,
CUSKEY1D ,
CUSKEY2 ,
CUSKEY2D ,
D07RKEY ,
CUSKEY3D ,
CUSKEY4 ,
CUSKEY4D ,
CUSVEND ,
CUSCUST ,
RECID )
AS
SELECT
'APMA' MODULE,
... |
-- Dec 9, 2009 7:28:02 PM COT
-- BF [2904737] - fix BOM back compatibility
UPDATE AD_Tab SET IsActive='Y',Updated=TO_TIMESTAMP('2009-12-09 19:28:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53286
;
-- Dec 9, 2009 7:28:06 PM COT
UPDATE AD_Tab SET IsActive='Y',Updated=TO_TIMESTAMP('2009-12-09 19:28:... |
-- Write a query to return the 10 earliest orders in the orders table. Include the id, occurred_at, and total_amt_usd.
SELECT id, occurred_at, total_amt_usd FROM orders ORDER BY occurred_at LIMIT 10;
-- Write a query to return the top 5 orders in terms of largest total_amt_usd. Include the id, account_id, and total_a... |
SELECT * FROM nikovits.emp;
SELECT distinct job FROM nikovits.emp;
select * from nikovits.dept;
select * from NIKOVITS.sal_cat;
select category, lowest_sal from NIKOVITS.sal_cat;
select last_name, salary , salary + 300
from nikovits.employees;
select last_name, salary , 12*salary + 300
from nikovits.employees;
sel... |
CREATE DATABASE supper_club_db;
USE supper_club_db;
CREATE TABLE menu (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(40) NOT NULL,
category VARCHAR(255) NOT NULL,
short_description VARCHAR(40) NOT NULL,
description VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE dish (
id INT NOT N... |
CREATE TABLE [Users] (
[Id] UNIQUEIDENTIFIER CONSTRAINT [defo_users_Id] DEFAULT (newid()) NOT NULL,
[FirstName] NVARCHAR (255) NOT NULL,
[LastName] NVARCHAR (255) NOT NULL,
[MiddleName] NVARCHAR (255) NOT NULL,
[Description] NVARCHAR (255) NU... |
CREATE DATABASE aero_solve;
CREATE TABLE ciudades
(
id_ciudad INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
nom_ciudad VARCHAR(25) NOT NULL
);
CREATE TABLE vuelos
(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
id_origen INT UNSIGNED NOT NULL,
nom_origen VARCHAR(25) NOT NULL,
id_dest INT UNSIGNED NOT NULL,
nom_dest VARCHA... |
#DROP TABLE IF EXISTS `mkt_share_float`;
CREATE TABLE `mkt_share_float` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ts_code` varchar(20) NOT NULL COMMENT 'TS代码',
`ann_date` char(8) NOT NULL COMMENT '公告日期',
`float_date` char(8) DEFAULT NULL COMMENT '解禁日期',
`float_share` float DEFAULT NULL COMMENT '流通股份',
`floa... |
CREATE DATABASE IF NOT EXISTS beerpong;
USE beerpong;
DROP TABLE IF EXISTS games;
DROP TABLE IF EXISTS teams;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
UserName VARCHAR(127) NOT NULL PRIMARY KEY,
LastUpdate TIMESTAMP NOT NULL DEFAULT NOW(),
Wins INT NOT N... |
-------------------------------------------------------------------------------------------------------------------------------------
-- Title: Window Functions
-------------------------------------------------------------------------------------------------------------------------------------
-- It's OVER:
-----------... |
insert into user (id, username, name, age, balance) values (1, 'account_1', 'JACK', 24, 100.00);
insert into user (id, username, name, age, balance) values (2, 'account_2', 'TOM', 25, 200.00);
insert into user (id, username, name, age, balance) values (3, 'account_3', 'PAUL', 26, 300.00); |
create database student;
use student;
create table students(
id char(8) not null primary key,
name char(15) not null,
subject char(15) not null,
mail char(30) not null,
schedule char(10) not null,
introduce char(50) not null,
state char(5) not null
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
grant select, insert, upda... |
/**
*
* @author TSG
* @name saldoWithProblem
* @public
* @rolesAllowed admin operator buh
*/
Select t1.sal_begin, t1.sal_end, t.lc_flat_id, t.lc_regto, t.lc_flatnumber, q.TextDate, t3.grp_name
From per_saldo_flat t1
Inner Join lc_flat t on t1.lc_id = t.lc_flat_id
Inner Join #all_dates q on t1.date_id = q.per_d... |
SELECT `title` FROM `books`
WHERE substring(`title`,1,3) = "The"
ORDER BY `id`;
--------------------------------------------------------------------------
SELECT replace(`title`,"The","***") FROM `books`
WHERE substring(`title`,1,3) = "The"
ORDER BY `id`;
---------------------------------------------------------------... |
ALTER TABLE `product_ean`
DROP FOREIGN KEY `product_id`,
ADD CONSTRAINT `product_product_ean` FOREIGN KEY `product_id` (`product_id`)
REFERENCES `product` (`product_id`)
ON DELETE CASCADE
ON UPDATE CASCADE
;
|
drop table if exists user_profile;
CREATE TABLE `user_profile` (
`id` int NOT NULL,
`device_id` int NOT NULL,
`gender` varchar(14) NOT NULL,
`age` int ,
`university` varchar(32) NOT NULL,
`gpa` float,
`active_days_within_30` int ,
`question_cnt` int ,
`answer_cnt` int
);
INSERT INTO user_profile VALUES(1,2138,'male',2... |
-- 用户表
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(63) NOT NULL COMMENT '用户名称',
`password` varchar(63) NOT NULL DEFAULT '' COMMENT '用户密码',
`gender` tinyint(3) NOT NULL DEFAULT '0' COMMENT '性别:0 未知, 1男, 1 女',
`birthday` date DEFAULT NULL COMMENT ... |
USE [SoftUni]
----------------------------------
-- 1. Employee Address
SELECT TOP(5) e.EmployeeID, e.JobTitle, a.AddressID, a.AddressText
FROM Employees e
JOIN Addresses a ON a.AddressID = e.AddressID
ORDER BY a.AddressID ASC
------------------------------------------
-- 2. Addresses with Towns
SELECT TOP(50) e... |
CREATE TABLE IF NOT EXISTS books(
id INT(11) PRIMARY KEY AUTO_INCREMENT,
isbn VARCHAR(17) NOT NULL,
title VARCHAR(50) NOT NULL,
author VARCHAR(50) NOT NULL
);
insert into books
values(0,'Aldous Huxley','978-5-17-080085-8','Brave New World');
|
use mauro_db;
drop procedure if exists database_scan;
delimiter ;;
create procedure database_scan(db_name varchar(32))
begin
declare xtmp varchar(255);
declare tb_name varchar(32);
declare done bool default false;
declare tbls_cursor cursor for
select tbl_name from mauro_db.tbls
where dbs_name=db_nam... |
#¼Ä´æÊÕÒø
drop view v_eywa_pay_list_return;
drop view v_eywa_pay_list_reserve;
create view v_eywa_pay_list_reserve as
select zzzj,xsdh,symd,czr,czsj,type as zfqd,sfje,0 as yhje,sfje as dyje,'' as yhyz
from (
select
t.id as zzzj,
t.sub_id as xsdh,
t.area as symd,
t.inuser as czr... |
use tournament_manager_db;
-- Belt info --
INSERT INTO belt (description) values ('Blanco');
INSERT INTO belt (description) values ('Amarillo');
INSERT INTO belt (description) values ('Verde');
INSERT INTO belt (description) values ('Azul');
INSERT INTO belt (description) values ('Rojo');
INSERT INTO belt (description... |
DROP TABLE IF EXISTS `Account`;
Create TABLE `Account`(
id integer AUTO_INCREMENT,
name VARCHAR(50) not null ,
age integer ,
primary key (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert Account(id,name,age) values ... |
INSERT INTO `ssaif_prod_abril`.`tbroles`
(`idrol`,
`descripcion`,
`activo`)
SELECT `tbroles`.`idrol`,
`tbroles`.`descripcion`,
`tbroles`.`activo`
FROM `ssaif_desa_host`.`tbroles`;
|
--
-- PostgreSQL database dump
--
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 = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgs... |
CREATE USER BikeShopWebsite WITH NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT PASSWORD 'password';
GRANT CONNECT ON DATABASE "BikeShop" TO BikeShopWebsite;
CREATE TABLE BikeInfo
(
Id SERIAL CONSTRAINT PK_BikeInfo_Id PRIMARY KEY,
Description VARCHAR(500) NOT NULL,
Price MONEY NOT NULL,
Rating FLOAT NOT NULL,
Quanti... |
use `portfolio`;
CREATE TABLE if not exists `portfolio`.`portafolio`
( `id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(75) NOT NULL ,
`detail` VARCHAR NOT NULL AUTO_INCREMENT ,
PRIMARY KEY (`id`, `detail`)) ENGINE = InnoDB;
|
SELECT * from quizes
join stack_content on quizes.quiz_id = stack_content.quiz_id
join stacks on stacks.stack_id = stack_content.stack_id
where stack_content.user_id = $1; |
CREATE TABLE vedtak_simulering_mottaker (
id BIGINT PRIMARY KEY,
fk_vedtak_id BIGINT REFERENCES vedtak (id),
mottaker_nummer VARCHAR(50),
mottaker_type VARCHAR(50)
);
CREATE SEQUENCE vedtak_simulering_mottaker_seq INCREMENT BY 50 START WITH 1000000 NO CYCLE;
CREATE INDEX ON vedtak_sim... |
CREATE TABLE IF NOT EXISTS `tblproduct` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`code` varchar(255) NOT NULL,
`image` text NOT NULL,
`price` double(10,2) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_code` (`code`)
); |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-10-24 06:16:18
-- 服务器版本: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET ... |
-- MySQL dump 10.9
--
-- Host: ecs2 Database: _test_db_homo_sapiens_variation_dr2_25_11_12432
-- ------------------------------------------------------
-- Server version 4.1.12-log
--
-- Table structure for table `variation_feature`
--
CREATE TABLE `variation_feature` (
`variation_feature_id` int(11) NOT NULL a... |
use pe
select top 15 * from pekontrah order by sutworzony desc
select top 10 * from pekontrah order by sdata desc, sczas desc
select * from atid where atablica = 'PEKONTRAH'
--update atid set sdata = sdata where atablica = 'PEKONTRAH'
|
use demo;
insert into demo.users values('test1','test1');
insert into demo.users values('darsh1','darsh1');
commit; |
with ws as
(
select d_year as ws_sold_year
, ws_item_sk
, ws_bill_customer_sk ws_customer_sk
, sum(ws_quantity) ws_qty
, sum(ws_wholesale_cost) ws_wc
, sum(ws_sales_price) ws_sp
from web_sales left join web_returns on wr_order_number=ws_order_number
and ws_item... |
DROP TABLE IF EXISTS AGGREGATE_block_{{ decade }};
SELECT
bctcb{{ decade }}::TEXT,
SUM(comp2010ap) as comp2010ap,
{%- for year in years %}
SUM(comp{{year}}) as comp{{year}},
{% endfor %}
-- SUM(since_cen10) as since_cen10,
SUM(filed) as filed,
SUM(approved) as approved,
... |
-- phpMyAdmin SQL Dump
-- version 5.1.1-1.fc34
-- https://www.phpmyadmin.net/
--
-- Хост: 192.168.122.177
-- Время создания: Сен 20 2021 г., 01:31
-- Версия сервера: 8.0.21
-- Версия PHP: 7.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
--
-- База данных: `adv`
--
-- ------... |
# Write your MySQL query statement below
select a.ID as Id from Weather a,Weather b where
DATEDIFF(a.RecordDate,b.RecordDate) = 1 and a.Temperature > b.Temperature; |
/* 1. feladat: */
/* 3. feladat: */
ALTER TABLE kategoria ADD PRIMARY KEY (id);
/* 4. feladat: */
ALTER TABLE forgalom ADD FOREIGN KEY (kategoriaId) REFERENCES kategoria(id);
/* 6. feladat: */
INSERT INTO `kategoria`(`kategoriaNev`) VALUES ('Ajándéktárgyak');
/* 7. feladat: */
UPDATE `forgalom` SET... |
SELECT
resp_h,
uniqMerge(days),
minMerge(first),
maxMerge(last),
sumMerge(success),
sumMerge(failure),
sumMerge(unknown),
uniqMerge(sources)
FROM ssh_servers
GROUP BY resp_h
|
SELECT empno, ename, deptno, dname
FROM employees LEFT JOIN departments
USING (deptno)
/
|
-- Aug 22, 2008 12:46:29 PM CDT
-- Distribution
UPDATE AD_Process_Para SET IsRange='N',Updated=TO_TIMESTAMP('2008-08-22 12:46:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53218
;
-- Aug 22, 2008 12:46:56 PM CDT
-- Distribution
UPDATE AD_Process_Para SET DefaultValue='''Y''',Updated=TO_TIMES... |
CREATE INDEX subs_by_time_with_owner ON subscriptions (ends_at) STORING (owner);
UPDATE schema_versions set schema_version = 'v3.1.1' WHERE onerow_enforcer = TRUE; |
DROP SEQUENCE seq_credit_line_id;
DROP TABLE credit_line;
CREATE TABLE credit_line(
credit_line_id NUMBER,
customer_id NUMBER(8),
credit_limit NUMBER(10,2) NOT NULL,
creation_date... |
set linesize 120
/*
when block type is not found in v$waitclass then it's undo/rbs segement
OBJN OTYPE FILEN BLOCKN SQL_ID BLOCK_TYPE
------------------------- ----------- ------ ------------- ------------------
53218 BBW_INDEX_VAL_I INDEX 1 64826 97dgthz60u28d data block 1
532... |
CREATE OR REPLACE PROCEDURE print_errors IS
CURSOR c IS
SELECT LOCAL_TRANSACTION_ID,
SOURCE_DATABASE,
MESSAGE_NUMBER,
MESSAGE_COUNT,
ERROR_NUMBER,
ERROR_MESSAGE
FROM DBA_APPLY_ERROR
ORDER BY SOURCE_DATABASE, SOURCE_COMMIT_SCN;
i NUMBER;
t... |
DROP DATABASE IF EXISTS 20WH5A1212;
CREATE SCHEMA 20WH5A1212;
USE 20WH5A1212;
CREATE TABLE passenger(pid INT, name VARCHAR(50) ,age INT,gender CHAR,address VARCHAR(20));
INSERT INTO passenger VALUES(5423, 'Meghana', 19, 'F', 'Karimnagar');
INSERT INTO passenger VALUES(5826, 'Madhuri', 20, 'F', 'Kalvakurthy');
INSERT IN... |
USE WideWorldImporters
-- 1
SELECT StockItemId,
StockItemName,
UnitPrice
FROM Warehouse.StockItems
WHERE StockItemName like '%urgent%' OR StockItemName like 'Animal%';
-- 2
SELECT s.SupplierID,
s.SupplierName
FROM Purchasing.Suppliers s
LEFT JOIN Purchasing.PurchaseOrders p
ON s.SupplierID = p.Sup... |
--
-- Integration table for CarSales and CarRepairs federation
--
USE carsales;
-- Integration table
DROP TABLE IF EXISTS platesvin;
CREATE TABLE platesvin (
carPlate char(7) NOT NULL,
carVIN char(7) NOT NULL,
PRIMARY KEY (carPlate)
);
--
-- Entity tables initial insertions.
--
INSERT INTO platesvin VALUES
... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : ven. 08 fév. 2019 à 10:13
-- Version du serveur : 5.7.23
-- Version de PHP : 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
--
-- Title: Upgrade to V3.2 - upgrade jbpm tables to jbpm 3.3.1
-- Database: PostgreSQL
-- Since: V3.2 schema 2013
-- Author:
--
-- upgrade jbpm tables to jbpm 3.3.1
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
-- we mark next statement as optional to not fai... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 04-12-2017 a las 03:17:57
-- Versión del servidor: 5.7.20-0ubuntu0.16.04.1
-- Versión de PHP: 7.1.7-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone =... |
SELECT
first_name + ' ' + last_name AS "Customer name",
installations.id AS "Installation ID",
customers.account_id AS "Account ID",
simple_name AS "Service level name",
meter_unlock_codes.id AS "Unlock code ID",
meter_unlock_codes.created_at AS "Unlock code date"
FROM
surge.contacts,
surge.install... |
INSERT INTO `japanlocation_prefecture` (`rid`, `pid`, `name_en`, `name_ja`, `machine_name`, `weight`) VALUES
(1, 1, 'Hokkaido', '北海道', 'hokkaido', 50),
(2, 2, 'Aomori', '青森', 'aomori', 50),
(2, 3, 'Iwate', '岩手', 'iwate', 50),
(2, 4, 'Miyagi', '宮城', 'miyagi', 50),
(2, 5, 'Akita', '秋田', 'akita', 50),
(2, 6, 'Yamagata', '... |
create database if not exists iwedb;
create user if not exists 'ile-dev'@'localhost' identified by 'IleIwe123';
grant all privileges on iwedb.* to 'ile-dev'@'localhost';
flush privileges; |
-- First to create role wequan_admin and database wequan
-- Role: wequan_admin
-- DROP ROLE wequan_admin;
CREATE ROLE wequan_admin WITH
LOGIN
SUPERUSER
INHERIT
CREATEDB
CREATEROLE
REPLICATION;
COMMENT ON ROLE wequan_admin IS 'this is the administrator for wequan database';
ALTER USER wequan_admin WITH P... |
/*******************************************************************************
Drop database if it exists (modified from chinook)
********************************************************************************/
--DROP USER adminman CASCADE;
/***********************************************************************... |
INSERT INTO PERSONASNATURALES (NUMERO_DOCUMENTO, TIPO_DOCUMENTO, NOMBRE, NACIONALIDAD, TIPO, USERNAME, CONTRASENA)
VALUES ('195920147', 'TI','ROBOCOP RODRIGUEZ','COLOMBIA','UNIANDINO','robo.r','yosoyrobocopyiija342');
INSERT INTO PERSONASNATURALES (NUMERO_DOCUMENTO, TIPO_DOCUMENTO, NOMBRE, NACIONALIDAD, TIPO, USERNAME... |
Proyecto.sql
create database dbElectivas
use dbElectivas
create table tbTipoCarrera(
idTipoCarrera int primary key not null,
Licenciatura nvarchar not null,
Ingenieria nvarchar not null,
foreign key (idLicenciatura) references tbCreditos_necesarios(idLicenciatura),
foreign key (idIngenieria) references tbCreditos_n... |
DROP TABLE `#__countries`;
|
SELECT *
FROM activities
-- $1:raw |
SELECT SUM(duration)
FROM students JOIN assignment_submissions ON (students.id = student_id)
WHERE students.name = 'Ibrahim Schimmel'; |
select usename, nspname || '.' || relname as relation,
case relkind when 'r' then 'TABLE' when 'v' then 'VIEW' end as relation_type,
priv
from pg_class join pg_namespace on pg_namespace.oid = pg_class.relnamespace,
pg_user,
(values('SELECT', 1),('INSERT', 2),('UPDATE', 3),('DELETE', 4)) privs(pr... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th1 24, 2021 lúc 07:28 PM
-- Phiên bản máy phục vụ: 10.4.17-MariaDB
-- Phiên bản PHP: 7.3.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
INSERT INTO burgers (burger_name, devoured) VALUES ("Veggie Deluxe", "Not");
INSERT INTO burgers (burger_name, devoured) VALUES ("Veggie Deluxe 'Cheese' Burger", "Not");
INSERT INTO burgers (burger_name, devoured) VALUES ("Salmon Burger", "Not");
|
SELECT
c.`id` AS id,
c.`name` AS name,
c.`atomic` AS atomic,
c.`category` AS category,
c.`issued` AS issued,
c.`user` AS user
FROM `callbacks` c
WHERE c.`user` = ?
ORDER BY c.`id` ASC; |
DROP PROCEDURE IF EXISTS tutorials.UpdateUser;
CREATE PROCEDURE tutorials.`UpdateUser`(IN userIdIN int(11), IN userFirstnameIN varchar(50), IN userLastnameIN varchar(50), IN userMiddlenameIN varchar(50), IN userDateOfBirthIN date,
userGenderIN char(1), userContactPhoneIN varchar(25))
BEGIN... |
SELECT
cm.id AS "quiz.ID",
quea.questionid AS "question.id",
COUNT(quea.questionid) AS "question.count",
qans.id AS "response.id",
CASE WHEN ISNULL(qans.answer)
THEN quea.rightanswer
ELSE qans.answer
END AS "response_text",
CASE WHEN ISNULL(qans.fraction)
THEN 1
... |
create keyspace solr
with replication = {
'class': 'SimpleStrategy',
'replication_factor': 1
};
create table location (
id text primary key
) with compact storage;
create table person (
id text primary key,
name text,
birthDate DateType,
deathDate DateType,
birthPlace ... |
CREATE OR REPLACE PROCEDURE plch_show_orders
IS
CURSOR cur_orders (an_order_id plch_orders.order_id%TYPE)
IS
SELECT order_id,
order_date,
status
FROM plch_orders
WHERE order_id = an_order_id;
var_orders orders.order_id%TYPE;
BEGIN
OPEN cur_orders;
FETCH cur_or... |
CREATE TABLE Kulinar.ArticleVersions
(
ItemVersionId BIGINT NOT NULL
,Name NVARCHAR(512) NULL
,ShowComments BIT NOT NULL
,ShowRating BIT NOT NULL
,ShowName BIT NOT NULL
,ShowTags BIT NOT NULL
,ShowAuthor BIT ... |
-- ----------------------------------------------------------------------------------------------------
-- TABLE: systems
-- ----------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS systems;
CREATE TABLE public.systems (
tenantId integer NOT NULL,
sys... |
INSERT INTO `ssaif_prod_abril`.`tbmotivoshabilitacionestransitorias`
(`idmotivoshabilitacionestransitoria`,
`inhabilita`,
`descripcion`,
`refdocumentaciones`)
SELECT `motivoshabilitaciontransitoria`.`motivohabtransitoriaid`,
`motivoshabilitaciontransitoria`.`inhabilitaalvencimiento`,
`motivoshabilitaciontransit... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2020 m. Bal 25 d. 12:30
-- Server version: 10.3.22-MariaDB-0+deb10u1
-- PHP Version: 7.3.14-1~deb10u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00... |
select count(`n_regionkey`)
from `nation`
where 1 = 2
having sum(`n_regionkey`) is null |
alter table SEC_USER add constraint FK_SEC_USER_STATION foreign key (STATION_ID) references VPS_STATIONS(ID);
create index IDX_SEC_USER_STATION on SEC_USER (STATION_ID);
|
CREATE DEFINER=`root`@`localhost` PROCEDURE `dropcourses`(in username int(11))
BEGIN
START transaction;
(SELECT distinct t.UosCode, t.Semester, t.Year
FROM transcript t
WHERE t.Studid = username and t.Grade is NULL);
END |
----------------------------------------------------------------------------------------
--
-- File name: ze.sql | cs_spbl_zap_enable.sql
--
-- Purpose: Enable ZAPPER on CDB
--
-- Author: Carlos Sierra
--
-- Version: 2020/12/25
--
-- Usage: Connecting into CDB.
--
-- Example: $ sqlplus / as sy... |
SELECT
month,
contrib_type AS contributor_type,
COUNT(*) AS contributor_count
FROM (
SELECT distinct
min(to_char(l.created_at, 'YYYY-MM')) AS month,
c.id,
c.contrib_type
FROM api_facilitylist l
JOIN api_source s ON s.facility_list_id = l.id
JOIN api_contributor c ON s.contributor_id = c.id
J... |
SELECT f.day_s,
f.line_item_id,f.line_item_name,f.line_item_active,
f.campaign_daily_budget_imp,f.CPA_target,f.pricing_model,
f.legal_entity,f.taxonomy_name,
CASE WHEN targeting_type=1 and is_auto_aud = false and strategy_name NOT ILIKE '%+%' and strategy_name NOT ILIKE '%!ASR%' and... |
--**************************************************************************************************
-- This script is intended to be run in the event of something going wrong during sample load of CE
-- address frame (a.k.a. sample "frame"). NOTE: this cannot be used again in future, after the CE
-- samples have been ... |
check(
ordenIda >
(
select max(planetasIda.ordenIda)
from planetasIda
)
and
(
(
IDe=
(
select planetas.sistema
from planetas
where planetas.IDp=
(
select p... |
DROP TABLE IF EXISTS users;
CREATE TABLE
users
(
id SERIAL NOT NULL,
male BOOLEAN,
nm_title CHARACTER VARYING(20) NOT NULL,
nm_first CHARACTER VARYING(50) NOT NULL,
nm_last CHARACTER VARYING(50) NOT NULL,
email CHARACTER VARYING(50) NOT NULL,
phone CHARACTER VARYING(20) N... |
Create Procedure mERP_SP_MarginPTRUpdated
As
Begin
Select Count(*) From tbl_mERP_ProcessStatus Where isNull(ProcessCode,'') = N'MARGIN' And isNull(Status,0) = 1
End
|
DROP FUNCTION IF EXISTS `func`;
DELIMITER $
CREATE FUNCTION func() RETURNS CHAR(100)
BEGIN
RETURN "Olá mundo. Trabalhando com funções";
END
$
SELECT func(); |
update t_shop_customer_count set totalCount = 5312681 where year = 2017 and type = '全部' and shop = 888888;
update t_shop_customer_count set totalCount = 1648566 where year = 2017 and type = '周末' and shop = 888888;
update t_shop_customer_count set totalCount = 3664115 where year = 2017 and type = '工作日' and shop = 88888... |
DROP DATABASE sportschool;
CREATE DATABASE IF NOT EXISTS sportschool;
-- Create tables in sportschool database
USE sportschool;
SET foreign_key_checks = 0;
CREATE TABLE IF NOT EXISTS abonnementsvormen (
abonnementsvorm_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
abonnementsnaam VARCHAR(50) NOT NULL,
beschrij... |
CREATE TABLE HistoricoCompra(
Id INT NOT NULL AUTO_INCREMENT,
IdEmpresa INT NOT NULL,
Empresa VARCHAR(255) NOT NULL,
DtaRecebido DATETIME NOT NULL,
IdProduto INT NOT NULL,
Produto VARCHAR(255) NOT NULL,
NroNF INT NOT NULL,
Operacao VARCHAR(255) NOT NULL,
Fornecedor VARCHAR(255) NOT NULL,
Qtd INT NOT NULL,
Embalagem VAR... |
CREATE TABLE results_freenumberanswer
(
freenumberanswer_id integer,
question_id integer,
surveyexecution_id integer,
"number" integer
)
WITH (
OIDS=FALSE
);
ALTER TABLE results_freenumberanswer OWNER TO postgres;
CREATE TABLE results_freetextanswer
(
freetextanswer_id integer,
question_id integer,
su... |
Choosing the appropriate data type
|
/*
* Establishes the week of the entries and
* pulls the goal points entered for each day
* of the week for level 4 students
*/
SELECT StudentID,
CAST(DATEADD(dd, - (DATEPART(dw, CONVERT(Date,StartDate)) - 1), CONVERT(Date,StartDate)) as Date) as StartWk,
CAST(DATEADD(dd, 7 - (DATEPART(dw, CONVERT(Date,EndDa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.