text stringlengths 6 9.38M |
|---|
select 'mkdir -p ' || substr(att.att_id,1,1)
|| '/' || substr(att.att_id,2,1)
|| '/' || substr(att.att_id,3,1)
|| '/' || substr(att.att_id,4,1)
|| '/' || substr(att.att_id,5,1)
|| '/' || substr(att.att_id,6,1)
|| '/' || att.att_id
|| '; mv ' || substr(nte.rmt_obj_id,1,1)... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 21, 2020 at 12:50 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
WITH document_types AS (
SELECT dt.id
FROM documenttype dt
WHERE dt.key IN ('erratum', 'poster', 'phd_thesis', 'report', 'invited_talk', 'abstract_report')
), parent_documents AS (
SELECT d.id AS id
FROM "document" d
JOIN authorshipgroup ag ON ag.document = d.id
WHERE d.documenttype <> A... |
-- 账户安全,发送验证邮件记录
DROP TABLE IF EXISTS beiker_user_security_url;
CREATE TABLE beiker_user_security_url(
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
urlsign VARCHAR(6) NOT NULL COMMENT '标识符',
userid INT(10) UNSIGNED NOT NULL COMMENT '用户id',
opid INT(10) UNSIGNED NOT NULL COMMENT '客服id',
helptime TIME... |
-- SPDX-License-Identifier: Apache-2.0
set global ft_boolean_syntax = ' |-><()~*:""&^'; |
-- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 15, 2021 at 09:39 PM
-- Server version: 5.7.26
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `gs_db`
--
-- ------------------------------... |
-- Course [ent1]
create table "APP"."COURSE" (
"COURSEID" integer not null,
"TITLE" varchar(255),
"DESCRIPTION" varchar(255),
"PAGE" varchar(255),
primary key ("COURSEID")
);
-- Departement [ent2]
create table "APP"."DEPARTEMENT" (
"DEPTID" integer not null,
"NAME" varchar(255),
primary ... |
CREATE TABLE fans_3(UID int NOT NULL PRIMARY KEY, USERNAME char(20) NOT NULL, SEX char(2), BYAER int NOT NULL, CITY char(20));
insert into fans_3 (UID, USERNAME, SEX, BYAER, CITY)
select UID, USERNAME, SEX, BYAER, CITY from CUSTOMER
where uid in (select uid from Follow
where UIDFLED = 3);
select * from fans_3;
... |
create table SEC_USER
(
userId BIGINT NOT NULL Primary Key AUTO_INCREMENT,
email VARCHAR(75) NOT NULL UNIQUE,
encryptedPassword VARCHAR(128) NOT NULL,
enabled BIT NOT NULL
) ;
create table SEC_ROLE
(
roleId BIGINT NOT NULL Primary Key AUTO_INCREMENT,
roleName VARCHAR(30)... |
CREATE COLUMNFAMILY cim.audit
(
email TEXT,
datetime TIMESTAMP,
auditid UUID,
direction VARCHAR,
apikey TEXT,
url VARCHAR,
status VARCHAR,
message TEXT,
PRIMARY KEY (email, datetime, auditid, direction)
) WITH CLUSTERING ORDER BY (datetime DESC, auditid ASC, direction ASC);
|
USE Artistas;
INSERT INTO Artistas(Nome)
VALUES ('Dutchavelli')
,('Pooh shiesty')
,('Rod wave');
INSERT INTO Estilos(Nome)
VALUES ('Uk drill')
,('Rap')
,('Rap');
INSERT INTO AlbunsEstilos(idEstilo)
VALUES (1)
,(2)
,(2);
INSERT INTO Albuns(Titulo,dataLancamento, Localizacao,... |
-- Drops the bamazon database if it exists currently --
DROP DATABASE IF EXISTS bamazon;
-- Creates the "bamazon" database --
CREATE DATABASE bamazon;
-- Makes it so all of the following code will affect bamazon --
USE bamazon;
-- Creates the table "products" within bamazon database --
CREATE TABLE products (
-- Cr... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-05-2020 a las 05:47:01
-- Versión del servidor: 10.1.35-MariaDB
-- Versión de PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
insert into mensaje values (NULL,'2020-06-12', 10, 10);
insert into mensaje values (NULL,'2020-06-12', 11, 10);
insert into mensaje values (NULL,'2020-06-12', 9, 10);
insert into mensaje values (NULL,'2020-06-12', 11, 10);
insert into mensaje values (NULL,'2020-06-12', 9, 10);
insert into mensaje values (NULL,'20... |
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 */;
CREATE TABLE IF NOT EXI... |
-- USE `ncia`;
insert into csm_application(APPLICATION_NAME,APPLICATION_DESCRIPTION,DECLARATIVE_FLAG,ACTIVE_FLAG,UPDATE_DATE)
values ("csmupt","CSM UPT Super Admin Application",0,0,sysdate());
insert into csm_user (LOGIN_NAME,FIRST_NAME,LAST_NAME,EMAIL_ID,PASSWORD,UPDATE_DATE)
values ("nciadevtest","User","Test","", ... |
set serveroutput on;
execute insertarempleados('258','REY GARCIA, RAUL');
execute insertarempleados('150','SAAVEDRA REBOREDO, JORGE');
execute insertarempleados('432','LOBOS OLATE, XIMENA GIOVANNA');
execute insertarempleados('75','CASTAŅEDA BELLIDO, LIDIA');
execute insertarempleados('80','ACUŅA BECERRA, RICARDO');
ex... |
--DEPARTMENTS--
INSERT INTO department(name)
VALUES ("Server");
INSERT INTO department(name)
VALUES ("Busser");
INSERT INTO department(name)
VALUES ("Hostess");
INSERT INTO department(name)
VALUES ("Bartender");
--ROLES--
INSERT INTO role (title, salary, department_id)
VALUES ("Head Wait", 10, 1);
INSERT INTO role... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.3
-- Dumped by pg_dump version 13.3
-- Started on 2021-08-08 16:54:59
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_catalo... |
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids... |
-- SCHEMA
CREATE TABLE timezones
(
id serial PRIMARY KEY,
created timestamptz DEFAULT now() NOT NULL,
modified timestamptz DEFAULT now() NOT NULL,
name text NOT NULL,
timeoffset smallint NOT NULL,
identifier text NOT NULL
);
-- SEED
INSERT INTO timezones
(id, name, timeoffset, identifier)
V... |
CREATE TABLE Students (
StudentName VARCHAR(255),
Address VARCHAR(255),
City VARCHAR(255),
PostalCode VARCHAR(255),
Country VARCHAR(255));
Values ('Jane Doe', '57 Union St', 'Glasgow', 'G13RB', 'Scotland');
|
/*
Navicat Premium Data Transfer
Source Server : qiao
Source Server Type : MySQL
Source Server Version : 50715
Source Host : localhost:3306
Source Schema : ecook
Target Server Type : MySQL
Target Server Version : 50715
File Encoding : 65001
Date: 13/02/2020 09:53:16
... |
select * from cost_element where cost_element in ('1031','1006'); -- AKA OBJECT_CODE
select * from budget_category where budget_category_code in (17,22);
select * from valid_ce_rate_types |
-- Document each column name
-- Make sure you are using names consistently
-- Think about maybe making Tables capitalized not all caps, SQL KEYWORDS all caps and columns lower case
-- Add some more test data (maybe all at end of file?)
-- Use consistent indenting
DROP TABLE IF EXISTS TUTOR_SCHEDULE;
DROP TABLE ... |
INSERT INTO lieferanten (firma, strasse, plz, ort)
VALUES ('Gärtnerbedarf Müller', 'Dorfstraße 8', '12345', 'Dorfen'),
('Grünes Allerlei', 'Stadtstraße 9', '54321', 'Stadt'),
('Grüner Finger', 'Am Waldrand', '22333', 'Wald');
|
; masking tables
giGainMask ftgen 0, 0, 8, -2, 0, 0, 1, 0.2, 0.5, 0.8, 0.1, 0.3, 0.5, 0.6 ; gain mask table
giChnMask ftgen 0, 0, 8, -2, 0, 0, 0, 1, 2, 3, 2.5, 1.5, 0.5, 3 ; channel mask table
giChnMaskOrig ftgen 0, 0, 8, -2, 0, 0, 0, 1, 2, 3, 2.5, 1.5, 0.5, 3 ; a manually typed copy of giChnMask
giWavAm... |
INSERT INTO consumer(firstname, lastname, email)
VALUES("agustin", "enriquez", "email@gmail.com");
|
-- -----------------------------------------------------
-- Table `amount_detail`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `amount_detail`;
CREATE TABLE `amount_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`order_id` varchar(64) DEFAULT NULL COMMENT '订单id'... |
-- COMMON MODULE COMMON SCHEMA SCRIPT
CREATE TABLE "CARGO"
(
"OID" bigserial NOT NULL,
"VALOR" character varying(255) NOT NULL,
CONSTRAINT "CARGO_PK" PRIMARY KEY ("OID")
) WITHOUT OIDS;
ALTER TABLE "CARGO" OWNER TO moladmin;
GRANT ALL ON TABLE "CARGO" TO GROUP "MOLEQULE_ADMINISTRATOR";
CREATE TABLE "ContactoEm... |
CREATE USER 'admin02'@'localhost' identified BY 'admin02';
GRANT ALL PRIVILEGES ON *.* TO 'admin02'@'localhost' WITH GRANT OPTION;
DROP USER 'root'@'localhost'; |
/*
Navicat MySQL Data Transfer
Source Server : chenqifu
Source Server Version : 50508
Source Host : localhost:3306
Source Database : bai_lian_shop_city
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2018-12-16 19:48:12
*/
SET FOREIGN_KEY_CHECK... |
-- First we need to add the FileType property as it does not exist in the table currently
-- We will add it as ordinal 2 becuase it has to come from the File table and it was requested that anything from the
-- File table comes at the beginning with Filename coming first.
INSERT INTO "FileProperty"
("Name", "Descri... |
insert into todo(id, username, description, target_date, is_done)
values(10001, 'Peter', 'Learn React', sysdate(), false);
insert into todo(id, username, description, target_date, is_done)
values(10002, 'Peter', 'Full Stack Developer', sysdate(), false);
insert into todo(id, username, description, target_date, is_don... |
CREATE PROCEDURE usp_EmptyCart
AS
BEGIN
TRUNCATE TABLE Cart
END
|
select sesion.sid,
sesion.username,
sqlarea.optimizer_mode,
sqlarea.hash_value,
sqlarea.address,
sqlarea.cpu_time,
sqlarea.elapsed_time,
sqlarea.sql_text,
sqlarea.sql_fulltext,
bind.name,
bind.value_string
from v$sqlarea sqlarea, v$session sesion, ... |
CREATE TABLE game_states (
player_id VARCHAR(20) PRIMARY KEY NOT NULL,
state JSONB,
FOREIGN KEY (player_id) REFERENCES users(id) ON DELETE CASCADE
);
--;;
CREATE TABLE game_statistics (
player_id VARCHAR(20) PRIMARY KEY NOT NULL,
statistics JSONB,
FOREIGN KEY (player_id) REFERENCES users(id) ON DELETE CASCAD... |
create database servico_de_rh;
use servico_de_rh;
create table tb_funcionarios (
id bigint auto_increment,
nome varchar(255) not null,
salario float not null,
idade int not null,
funcao varchar(255) not null,
valetransporte char not null,
primary key (id)
);
select * from tb_funcionarios;
insert into tb_funcio... |
CREATE directory XMLSTORE AS 'C:\Users\luc\Documents\GitHub\luc-PLSQL\XML\Splitted_Data';
grant read, write on DIRECTORY XMLSTORE to Test; |
SELECT name FROM db_saburadi.distrib
WHERE id_distrib IN (42, 62, 63, 64, 65, 66, 67, 68, 69, 71, 88, 89, 90) OR name LIKE '%y%y%Y%Y%'
LIMIT 2, 5
;
/*another way: ORDER BY -> OFFSET -> FETCH*/
|
select *
into #tempa
from smsdss.c_guarantor_demos_v
where (
GuarantorFirst like '%cancer%'
or
GuarantorFirst like '%csp%'
or
GuarantorLast like '%csp%'
or
GuarantorFirst like '%women%'
or
GuarantorLast like '%partnership%'
or
GuarantorLast like '%women%'
or
GuarantorFirst like '%breas%'
... |
/**
* SQL for get shisetsu event list
* @author TuyenVHA
* @version $Id: ShisetsuTopService_getByshisetsuEvent_Sel_01.sql 29220 2014-09-30 02:45:12Z p__toen $
*/
SELECT
BSE.EVENT_NO
,BSE.EVENT_NAME
,BSE.EVENT_PREIOD
,BSE.EVENT_LIMIT_DATE
,BSE.EVENT_CONTENTS
FROM
BY_SHISETSU_EVENT BSE
WHERE
B... |
\timing
/** Create the room */
INSERT INTO room (name) VALUES ('CHIPUG Virtual');
/** Look at initial calendar on May 30, 2018 */
SELECT *
FROM calendar
WHERE calendar_date = '2021-10-28'
ORDER BY lower(calendar_range);
/** Liberty only allows bookings from 8am - 1pm, and 4pm to 10pm on Mon - Fri */
INSERT INTO avai... |
-- !Ups
create table if not exists users (
user_id varchar(255) primary key unique not null,
user_name varchar(255) not null unique,
hashed_password varchar(255) not null,
mail_address varchar(255) not null unique,
created_on timestamp not null
);
create table if not exists roles (
role_id var... |
CREATE TABLE etl_job_step_log
(job_step_log_id integer not null
,job_log_id integer
,job_step_cd varchar(256)
,job_cd varchar(256) NOT NULL
,job_run_no integer
,run_status varchar(1)
,run_start_dt timestamp NOT NULL
,run_end_dt timestamp
,run_duration varchar(16)
,job_step_output varchar(1000)
,job_step_error_me... |
-- ==========================================================================================
-- Entity Name: ERP.Usp_Upd_Receta_borrador
-- Author: Omar Rodriguez
-- Create date: 12/7/2018 2:50:47 p. m.
-- Description: Lista receta en borradores del sistema
-- ============================================... |
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 31, 2015 at 10:24 AM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
-- No default
IF COL_LENGTH(N'[SchemaName].[TableName]', N'NewColumnName') IS NULL
BEGIN
PRINT N'Adding [SchemaName].[TableName].[NewColumnName]'
ALTER TABLE [SchemaName].[TableName] ADD [NewColumnName] [NewColumnType] NOT NULL;
END
-- With default
IF COL_LENGTH(N'[SchemaName].[TableName]', N'NewColumnName') I... |
-- =============================================
-- Author: OMAR RODRIGUEZ
-- Create date: 17-08-2018
-- Description: LISTADO PARA REPORTE DETALLADO DE RECETAS
-- PARAMETRO @IdEmpresa= NULL IMPRIME TODOS LOS REGISTROS
-- =============================================
CREATE PROCEDURE [ERP].[Us... |
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.5.22 : Database - resturant
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHEC... |
use burger_db;
insert into burger (burger_name) values ("Hangover Burger");
insert into burger (burger_name) values ("Double Hangover Burger");
insert into burger (burger_name) values ("Everything, but the Kitchen Sink Burger"); |
-- Lisää DROP TABLE lauseet tähän tiedostoon
DROP TABLE IF EXISTS Drink CASCADE;
DROP TABLE IF EXISTS Drinker CASCADE;
DROP TABLE IF EXISTS Ingredient CASCADE;
DROP TABLE IF EXISTS Favourite CASCADE;
DROP TABLE IF EXISTS Recipes CASCADE;
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 11-02-2020 a las 14:46:00
-- Versión del servidor: 10.4.8-MariaDB
-- Versión de PHP: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
DROP TABLE Job cascade;
DROP TABLE State cascade;
DROP TABLE JobParameter cascade;
DROP TABLE JobQueue cascade;
DROP TABLE Server cascade;
DROP TABLE List cascade;
DROP TABLE Set cascade;
DROP TABLE Counter cascade;
DROP TABLE Hash cascade;
DROP TABLE Schema cascade;
drop table lock;
|
CREATE TABLE W_ROLL_CALLS (
ID SERIAL PRIMARY KEY,
CHAT_ID BIGINT NOT NULL,
STATUS VARCHAR(100) NOT NULL,
TITLE TEXT NOT NULL,
QUIET BOOLEAN NOT NULL DEFAULT FALSE,
CREATED_AT TIMESTAMP NOT NULL,
UPDATED_AT TIMESTAMP NOT NULL
);
CREATE INDEX IDX_W_ROLL_CALLS_CHAT_ID ON W_ROLL_CALLS(CHAT_ID)
|
SELECT URL FROM RANKING, REQUEST
WHERE REQUEST_ID=REQUEST.ID
AND REQUEST.DOMAIN_ID=1
AND RANKING>
SELECT
Want to see all those URLs which are higher than AH ones for those keyphrases which have rankings of 10 and less for a certain month
1. SELECT DISTINCT(KEYPHRASE.ID) FROM KEYPHRASE, DOMAIN_RANKING DR WHERE MON... |
DROP TABLE relation;
DROP TABLE upload;
DROP TABLE content;
DROP TABLE region;
DROP TABLE property;
DROP TABLE category;
DROP TABLE page;
DROP TABLE post;
DROP TABLE permalink;
DROP TABLE posttemplate;
DROP TABLE pagetemplate;
DROP TABLE sysparam;
DROP TABLE sysaccess;
DROP TABLE sysgroup;
DROP TABLE sys... |
use stu_manage
insert into class_info(class_id,monitor,dept_id,stud_amount) values
('CS001','Zhao','01',30),
('CS002','Qian','01',60),
('CS003','Sun','01',58),
('ECE001','Li','02',56),
('ECE002','Zhou','02',30),
('SE001','Wu','03',50);
select*from class_info; |
INSERT INTO `books` (`ISBN`, `BookTitle`, `Author`, `Edition`, `Year`, `Category`, `Reserved`) VALUES
('093-403992', 'Computers in Business', 'Alicia Oneill', 3, 1997, '003', 'N'),
('23472-8729', 'Exploring Pery', 'Stephanie Birchi', 4, 2005, '005', 'N'),
('237-4823', 'Business Strategy', 'Joe Peppard', 2, 2002, '002',... |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 28, 2018 at 06:52 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... |
-- GENERATE TEMP TABLES FOR SCORES IMPUTATION
drop table if exists il_bg_avgs;
create temp table il_bg_avgs as
select
substring(vb_reg_census_id, 1, 12) as bg_id
, avg(ts_tsmart_general_turnout_score) as ts_tsmart_general_turnout_score
, avg(ts_tsmart_primary_turnout_score) as ts_tsmart_primary_turnout_score
, avg(ts... |
SELECT FirstName , LastName
FROM Employees
WHERE ManagerID IS NULL |
create table usaeq(
eq_time timestamp,
eq_latitude int(10) unsigned,
eq_longitude int(10) unsigned,
eq_depth decimal(6,6),
eq_mag decimal(6,6),
eq_magType varchar(20),
eq_nst int,
eq_gap decimal(6,6),
eq_dmin decimal(6,6),
eq_rms decimal(6,6),
eq_net varchar(20),
eq_id varchar(20),
eq_updated timestamp,
... |
CREATE PROC DeleteBrand
@ID int
AS
BEGIN
DELETE FROM Brands
WHERE ID = @ID
END; |
update users
set is_active=1
where id in (select user_id from
(select count(book_id) as books, user_id from users_books group by user_id) as tmp
where books>=1) |
SELECT COUNT(id) AS unique_products, producer
FROM products
GROUP BY producer
ORDER BY unique_products DESC, producer; |
PARAMETERS [@RetencionID] Text (8);
DELETE *
FROM TB_Retencion
WHERE RetencionID=[@RetencionID];
|
INSERT INTO PRODUCT VALUES(1,'Ordinateur portable', 350, 120);
INSERT INTO PRODUCT VALUES(2,'Aspirateur robot', 500, 200);
INSERT INTO PRODUCT VALUES(3,'Table de Ping Pong', 750, 400); |
create table users (
id int8 PRIMARY KEY AUTO_INCREMENT,
reg_time timestamp not null,
name varchar(255) not null,
email varchar(255) not null,
password varchar(255) not null,
photo varchar(255),
code varchar(255),
is_moderator boolean not null
) |
DROP TABLE IF EXISTS `Clients`;
CREATE TABLE `Clients` (
`client_number` varchar(4) DEFAULT NULL,
`name` varchar(9) DEFAULT NULL,
`address` varchar(21) DEFAULT NULL,
`locality` varchar(9) DEFAULT NULL,
`category` varchar(2) DEFAULT NULL,
`account` mediumint(9) DEFAULT NULL,
`planet` varchar(8) DEFAULT NUL... |
drop table USER_REGISTRATION;
drop sequence USER_ID; |
\c alpha_dev;
drop table if exists brand_rank;
create table brand_rank (
brand_id integer,
rank smallint,
active boolean,
cdate timestamp,
mdate timestamp,
primary key (brand_id)
);
|
-- name: get-goods
-- retrieve a goods
SELECT * FROM goods
-- name: get-goods-by-name
-- retrieve a goods by name
SELECT * FROM goods g
WHERE g.name LIKE :name
-- name: get-receipts
-- retrieve a goods
SELECT
r.id,
r.timestamp,
r.summ,
s.name,
ifnull(ROUND(SUM(ROUND((ri.price * ri.quan) + 0.00005, 2)), 2), 0) as... |
CREATE TABLE `trovacap` (
`id_cap` int(5) NOT NULL DEFAULT '0',
`prov_cap` varchar(2) DEFAULT NULL,
`comu_cap` varchar(42) DEFAULT NULL,
`com2_cap` varchar(59) DEFAULT NULL,
`fraz_cap` varchar(38) DEFAULT NULL,
`fra2_cap` varchar(45) DEFAULT NULL,
`topo_cap` varchar(44) DEFAULT NULL,
`top2_cap` varchar(... |
--Leetcode 181. Employees Earning More Than Their Managers
select e1.name as employee
from employee as e1 join employee as e2
on e1.managerId = e2.id
where e1.salary > e2.salary |
-- CREATE DATABASE IF NOT EXISTS games;
CREATE TABLE boardgames (
game_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(50) NOT NULL,
designer VARCHAR(50),
publisher VARCHAR(50)
);
TRUNCATE TABLE boardgames (
insert into boardgames (title, designer, publisher) values ('The Grizzled', 'Fabien Riffaud, J... |
/*
This is the solution for Module 3 Coding Assignment.
The database is from https://ucde-rey.s3.amazonaws.com/DSV1015/ChinookDatabaseSchema.png
*/
--Q1: Using a subquery, find the names of all the tracks for the album "Californication".
Select t.Name
From Albums a
Inner Join Tracks t On a.AlbumId = t.AlbumId
Where a.... |
-- creating new userProfiles --
INSERT INTO profile (profileName, profileEmail, profileHash, profileSalt, profileJoinDate)
VALUES('abc', 'abc@mail.com', 'pwh', 'pws', NOW());
INSERT INTO profile (profileName, profileEmail, profileHash, profileSalt, ProfileJoinDate)
VALUES('def', 'def@mail.com', 'pwh', 'pws', NOW());
... |
PRAGMA synchronous = OFF;
PRAGMA journal_mode = MEMORY;
BEGIN TRANSACTION;
CREATE TABLE `AAAA` (
`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT
, `llll` varchar(10) NOT NULL
, `rrrr` timestamp NULL DEFAULT current_timestamp
, `ssss` timestamp NULL DEFAULT NULL
, `tttt` varchar(1) DEFAULT 'A'
, UNIQUE (`id`)
, ... |
CREATE PROCEDURE `check_in_room` (
IN patron_id varchar(50),
IN lib_id smallint(6),
IN room_no varchar(6),
OUT checkInStatus tinyint(1)
)
BEGIN
CALL cancel_reservations(CURDATE());
UPDATE Room_Reservations R
SET R.status = 'CheckedIn'
WHERE (R.patron_id = patron_id) AND (R.lib_id = lib_id) AND... |
CREATE TABLE public.event_type_table
(
id integer NOT NULL DEFAULT ,
event_type character varchar(500) NOT NULL,
created_by character varchar(100) NOT NULL,
created_on timestamp without time zone,
updated_on timestamp without time zone,
CONSTRAINT event_type_table_pkey PRIMARY KEY (id),
CONS... |
/* the following queries populate a table that has counts for people who joined a particular chapter as an additional to their primary chapter */
update civicrm_value_additional_chapters_summary_4 ad
left join
(SELECT "Clark" as chapter, (count(distinct cvt.entity_id)-3) cnt
FROM civicrm_value_trial_2 cvt, civicrm_me... |
--------------------------------------------------------
-- File created - Wednesday-January-22-2020
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table ERP_GL_TRANSACTION
--------------------------------------------------------
DROP TA... |
ALTER PROCEDURE [prod].[FillPopularProducts]
AS
BEGIN
-- Заполнение наиболее откладываемых
delete from [prod].[PopularProducts] where PopularType = 0
insert into [prod].[PopularProducts] ([ProductId],[PopularType],PopularRate)
SELECT ProductId, 0, count(*)
FROM [prod].[WishListItems]
group by [ProductId]
order by... |
-- WARNING!
-- This script will delete any endpoint_email_subscriptions record that would not contain a valid bundle/application couple.
ALTER TABLE endpoint_email_subscriptions
ADD COLUMN application_id uuid;
UPDATE endpoint_email_subscriptions s
SET application_id = (SELECT a.id FROM applications a, bundles... |
CREATE DATABASE bamazon;
CREATE TABLE products (
item_id INTEGER AUTO_INCREMENT NOT NULL,
product_name VARCHAR (100) NOT NULL,
department_name VARCHAR (100) NOT NULL,
price DECIMAL (13,2),
stock_quantity INTEGER
);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES
('Bar Soap', 'Hea... |
SELECT
--物件数
COUNT(*) AS SUPPLIES_COUT,
--A.物件種別
SUPPLIES_TYPE,
--物件種別名
SUPPLIES_TYPE_NAME
FROM(
SELECT
A.SUPPLIES_NO,
--A.物件種別
A.SUPPLIES_TYPE,
--物件種別名
H.CODE_NAME AS SUPPLIES_TYPE_NAME
FROM
-- 物件詳細情報 A
OBJ_SUPPLIES_INFO AS A WITH(READPAST)
LEFT OUTER JOIN
-- 車特有情報 B
OBJ_VEHICL... |
SELECT ANIMAL_ID FROM ANIMAL_INS WHERE NAME IS NULL;
SELECT ANIMAL_ID FROM ANIMAL_INS WHERE NAME IS NULL; |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Мар 18 2017 г., 13:07
-- Версия сервера: 10.1.13-MariaDB
-- Версия PHP: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
-- Universidad de San Carlos de Guatemala
-- Facultad de Ingenieria
-- Escuela de Ciencias y Sistemas
-- Laboratorio de sistemas de bases de datos 1
-- Gonzalo Antonio Garcia Solares - 201318652
-- Proyecto 1
-- *******************************************************
-- Test
-- DROP
DROP TABLE tipo;
DROP TABLE compa... |
/*
deereferensere arenaider for dialoger som hadde lika mange henvendelser
valgte å beholde arenaiden for site dialogen
hentent med spørringen:
with arenaId as (
SELECT ARENA_ID, max(DIALOG_ID) dialogId
FROM DIALOG
WHERE ARENA_ID IS NOT NULL
GROUP BY ARENA_ID, OPPFOLGINGSPERIODE_UUID
HAVING COU... |
ALTER TABLE players
add constraint PLAYER_NAME
CHECK(PLAYER_NAME ~* '^[^0-9]+$')
DROP TABLE games_details;
DROP TABLE players;
|
--1.修改表结构
--增加字段 alter table 表名 add 列名 类型
alter table students add birthday datetime;
--重命名字段 alter table 表名 change 原名 别名 类型及约束;
alter table students change birthday birth datetime;
--修改字段类型 alter table 表名 modify 列名 类型及约束;
alter table students modify birth date not null;
--删除字段 alter table 表名 drop 列名;
alter table stude... |
-- Lesson 15: Inserting Data
-- how to insert data into tables using the SQL INSERT statement
-- Understanding Data Insertion
-- Inserting Complete Rows
INSERT INTO Customers
VALUES('1000000006', 'Toy Land', '123 Any Street', 'New York', 'NY', '11111', 'USA', NULL, NULL);
#safer way to insert
INSERT INTO Customers(... |
DROP DATABASE IF EXISTS employee_tracker;
CREATE DATABASE employee_tracker;
USE employee_tracker;
CREATE TABLE department (
id INT AUTO_INCREMENT PRIMARY KEY,
-- to hold department name
name VARCHAR(30) NOT NULL
);
CREATE TABLE role (
id INT AUTO_INCREMENT PRIMARY KEY,
-- to hold role title
title VARCHAR... |
DROP TABLE IF EXISTS abono; SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE `abono` (
`idabono` int(11) NOT NULL AUTO_INCREMENT,
`abono` decimal(6,2) NOT NULL,
`idbanquete` int(11) NOT NULL,
PRIMARY KEY (`idabono`,`idbanquete`),
KEY `fk_abono_banquete1_idx` (`idbanquete`),
CONSTRAINT `fk_abono_banquete1` FOREIGN KE... |
ALTER TABLE SONGS
ADD COLUMN WIKI_CONTENT_NL text;
|
CREATE OR REPLACE VIEW "REDLINE"."PNMAC"."VW_REDLINEISSUESANDPROJECTS" AS
SELECT
ifnull(cvi1.value,cvp1.value) as itid
,pr1.id as project_id
,pr1.name as project_name
,pr1.description as project_description
,pr1.IDENTIFIER as project_... |
alter table juxta_source add content_type ENUM('TXT','XML','HTML','WIKI') not null
update juxta_source set content_type='XML' where content_id in (select id from text_content where type = 1)
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1
-- Létrehozás ideje: 2019. Sze 05. 14:16
-- Kiszolgáló verziója: 10.1.39-MariaDB
-- PHP verzió: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.