text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-09-2015 a las 22:58:38
-- Versión del servidor: 5.6.24
-- Versión de PHP: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
DROP TABLE IF EXISTS server;
CREATE TABLE server (
id INTEGER PRIMARY KEY,
name VARCHAR UNIQUE,
notes VARCHAR
);
DROP TABLE IF EXISTS ip;
CREATE TABLE ip (
id INTEGER PRIMARY KEY,
ip INTEGER UNIQUE,
notes VARCHAR... |
-- 表的数据: xt_times --
INSERT INTO `xt_times` VALUES ('371','1520697599','1262275200','0','0','0','0');-- <fen> --
|
-- // people
-- Migration SQL that makes the change goes here.
CREATE TABLE people
(
people_id SERIAL PRIMARY KEY,
name CHARACTER VARYING(255) NOT NULL,
event_url CHARACTER VARYING(255) NOT NULL
);
-- //@UNDO
-- SQL to undo the change goes here.
DROP TABLE people;
|
UPDATE backend_areauser
SET user_id_id = backend_user.id, area_id_id = backend_area.id
FROM backend_user, backend_area
WHERE backend_areauser.user_id_migration = backend_user.id_migration
AND backend_areauser.area_id_migration = backend_area.id_migration;
ALTER TABLE backend_areauser DROP column user_id_migration, ... |
# --- !Ups
PRAGMA foreign_keys = ON;
CREATE TABLE "color" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" VARCHAR(20) NOT NULL,
"value" VARCHAR(27) NOT NULL
);
-- kategorie towarow
CREATE TABLE "category" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" VARCHAR(220) NOT NULL,
"description" V... |
■問題
社員テーブル(employee)から「山田奈美」さんの情報を取り出してみましょう。
すべての列を取り出すものとします。
■実行文
# 全列を取得
SELECT
*
# 社員テーブルから取得
FROM
employee
# 名前が「山田奈美」さんに当てはまる場合のみ取得
WHERE
l_name = '山田'
AND
f_name = '奈美'
;
■返却値
mysql> # 全列を取得
mysql> SELECT
-> *
-> # 社員テーブルから取得
-> FROM
-> employee
-> # 名前が「山田奈美」さんに当てはまる場合のみ取得
-> WH... |
CREATE TABLE `product_video` (
`product_video_id` int(10) unsigned NOT NULL auto_increment,
`product_id` int(10) unsigned not null,
`asin` varchar(10) NOT NULL,
`title` text not null,
`description` text DEFAULT NULL,
`duration_milliseconds` int(10) default null,
`views` int(10) unsigned NOT NULL DEFAULT '... |
--Criação Tabela Estado
create table estado (
codigo SERIAL PRIMARY KEY,
nome VARCHAR(50),
sigla VARCHAR(2)
)
|
INSERT INTO recipes (recipeName, ingredients, instructions, categoryType)
VALUES
("Spaghetti", "1 box Spaghetti, 1 15 ounce can Tomato Sauce, Parmesan", "Cook spaghetti according to package directions.
Spoon sauce over drained spaghetti noodles and sprinkle with parmesan cheese.", "Italian"),
("Peanut Butter and Je... |
SELECT
ROW_NUMBER() over (order by cust.forename + ' ' + cust.surname) as [uniqueRowId]
, ROW_NUMBER() over (partition by cust.surname order by cust.surname) as [123]
, rank() over (order by cust.forename) as [custSurnameIdRank]
, dense_rank() over (order by cust.forename) as [custSurnameIdDenseRank]
, cust.foren... |
select mocktable.`日期`
, mocktable.dau
, mocktable.`提交单`
, mocktable.`支付单`
, mocktable.`u2o`
, mocktable.`提交2有效`
from
( select users.d as `日期`
, users.uv as `DAU`
, submit.ois as `提交单`
, pay.ois as `支付单`
, concat(cast(100*((pay.ois)/users.uv) as decimal(5,2)),'%') as `U2O`
, concat(cast(100*((pa... |
CREATE Procedure mERP_sp_List_OLClass_Export(@CLASSTYPE nVarchar(25))
As
Begin
If @CLASSTYPE = 'CHANNEL'
Select Distinct Channel_Type_Desc From tbl_mERP_OLClass_Export
Where Channel_Type_Active = 1
Else if @CLASSTYPE = 'OUTLET'
Select Distinct Outlet_Type_Desc,Channel_Type_Desc
From tbl_mERP_OLClass_... |
select
ID as payment_id,
"orderID" as order_id,
"paymentMethod" as payment_method,
amount,
created as created_at
from {{ source('stripe', 'payment') }} |
--修改日期:20121126
--修改人: 李程
--修改原因:vp6804奥克斯AD域单点登录,增加用户映射表。OUTER_USER_CODE这里写用户的WINDOWS登录名,即短名;USER_CODE:bt_user里面的user_code
---------增加两个系统参数
declare
i integer;
begin
select count(*) into i from user_tables where table_name = 'OUTER_USER_RELATIONSHIP';
if i = 0 then
execute immediate 'CREATE TABLE OUTER_USER_... |
@GeoNet/db/Tables/debugging_Table_Def.sql
@GeoNet/db/Tables/customer_types_Table_Def.sql
@GeoNet/db/Tables/user_groups_Table_Def.sql
@GeoNet/db/Tables/security_levels_Table_Def.sql
@GeoNet/db/Tables/Speeds_Table_Def.sql
@GeoNet/db/Tables/cities_Table_Def.sql
@GeoNet/db/Tables/receive_channels_Table_Def.sql
@GeoNet/db/T... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 13, 2021 at 11:52 AM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
CREATE SCHEMA IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS students;
CREATE TABLE students(id BIGINT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(100),surname VARCHAR(100),course_name VARCHAR(100));
INSERT INTO students(name, surname, course_name) VALUES ('Andrei','Zaharenko','Java SE course');
INSERT INTO s... |
set linesi 1000 trimspool on
col name format a60
select file#, bytes/1024/1024 size_mb , name from v$tempfile
/
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 05, 2019 at 05:55 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- Emp no, last name, first name, sex, salary
select info.emp_no, info.last_name, info.first_name, info.sex, s.salary
from employees_info as info
inner join salaries as s on
info.emp_no = s.emp_no;
-- First, last, hire date for employees hired in 1986
select first_name, last_name, hire_date
from employees_info
whe... |
-- ---
-- Database 'QA'
-- ---
DROP DATABASE IF EXISTS QA;
CREATE DATABASE QA;
USE QA;
-- ---
-- Table 'questions'
--
-- ---
DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
questionId INT AUTO_INCREMENT,
product_id INT,
question_body TEXT,
question_date DATETIME DEFAULT CURRENT_TIMESTAMP,
asker_n... |
if OBJECT_ID('formaPagoTemp') is not null
drop table formaPagoTemp;
create table formaPagoTemp(
id_formaPago varchar(30) primary key, --identity ,
id_venta varchar(25),
metodoPago varchar(30), -- es: efectivo, tarjeta
detalle varchar(30), -- nombre de la compaņia de la tarjeta
monto money,
numer... |
--Criação Tabela Permissao
create table permissao (
codigo SERIAL PRIMARY KEY,
nome VARCHAR(50)
)
|
create procedure Sp_Get_ItemInformation(@Product_Code NVarchar(30))
as
SELECT ItemCategories.Price_Option,Items.Productname,items.Track_batches,
ItemCategories.Track_Inventory FROM ItemCategories,Items
where Items.CategoryID = ItemCategories.CategoryID and
Items.Product_Code = @Product_Code
|
--***********ATIVIDADE 6***********
-- criacao do banco
CREATE DATABASE EscolaVirtual;
-- CRIACAO DAS TABELAS
CREATE TABLE curso
(
IdCurso INT PRIMARY KEY IDENTITY NOT NULL,
NomeCurso VARCHAR(100),
Duracao DATETIME NOT NULL,
Ativo BINARY
);
CREATE TABLE aluno (
idAluno INT PRIMARY KEY IDENTITY NOT NULL,
Nome V... |
DROP TABLE `dict_info`;
CREATE TABLE `dict_info` (
`id` VARCHAR (50) NOT NULL COMMENT 'id',
`pid` VARCHAR (50) DEFAULT '0' COMMENT ' 父ID ',
`type` VARCHAR (50) NOT NULL COMMENT '类别',
`code` VARCHAR (50) NOT NULL COMMENT ' 编码 ',
`value` VARCHAR (200) NOT NULL COMMENT ' 数据名称/值 ',
`sort_no` INT (11) UNSIGNED DEFAULT... |
select
sub.company,
sub.events
from (
select aa.company_name as company,
count(e.id) as events
from
gha_events e,
gha_actors_affiliations aa
where
e.actor_id = aa.actor_id
and e.type in (
'PullRequestReviewCommentEvent', 'PushEvent', 'PullRequestEvent',
'IssuesEvent', 'IssueCom... |
--link: https://leetcode.com/problems/second-highest-salary/description/
SELECT (
SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1, 1
) SecondHighestSalary;
|
-- between 07:00 and 23:59 repeat every 15 minutes on the 15 minute mark
@@test_calendar_string 'FREQ=DAILY;BYHOUR=7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23;BYMINUTE=00,15,30,45' 50
-- between 07:00 and 23:59 repeat every 15 minutes on the 15 minute mark and 0 second mark
@@test_calendar_string 'FREQ=DAILY;BY... |
--------------------------------------------------------
-- File created - Tuesday-May-09-2017
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table DIM_CATEGORIA
--------------------------------------------------------
CREATE TABLE "E... |
-- --------------------------------------------------------
-- Host: 172.16.23.8
-- Versi server: 5.5.44-MariaDB-log - MariaDB Server
-- OS Server: Linux
-- HeidiSQL Versi: 9.4.0.5125
-- --------------------------------------------------------
/*... |
CREATE TABLE IF NOT EXISTS Invoice(
InvoiceID INT PRIMARY KEY,
ClientID VARCHAR(4),
Entry DATETIME NOT NULL,
TotalAmount DECIMAL(10,2) DEFAULT 0,
Locked BOOLEAN DEFAULT FALSE,
FOREIGN KEY (ClientID) REFERENCES Client(ClientID)
); |
UPDATE "movie" SET movie_file = ?, name = ?, movie_year = ?, description = ? WHERE movie_id = ?; |
insert into player values(0, 'Kevin', 'Durant', 'SF', 10, 28, 'Warriors', 22, 1);
insert into player values(1, 'James', 'Harden', 'PG', 8, 26, 'Rockets', 23, 2);
insert into player values(2, 'G.', 'Antetokounmpo', 'SF', 6, 24, 'Bucks', 18, 3);
insert into player values(3, 'Stephen', 'Curry', 'PG', 7, 26, 'Warriors', 19... |
DROP TABLE exercise_by_identifier;
|
INSERT INTO `loja`.`fornecedores` (`nome`, `contato`) VALUES ('beltrano', '124@asd.com');
|
#Data Base Management system
# customer Personal information
create database BMS_DB1;
create table customer_personal_info
(customer_id varchar(5),
customer_name varchar(30),
Date_of_Barth date,
Guardian_Name varchar(30),
Ccontact_no bigint(10),
mail_id varchar(30),
Gender char(1),
Marital_status varchar(10),
Ident... |
CREATE procedure sp_print_PurchaseReturnAbsMUOM (@AdjustmentID int)
as
Select "Document No" = VoucherPrefix.Prefix + cast(DocumentID as nvarchar),
"Date" = AdjustmentDate,
"VendorID" = AdjustmentReturnAbstract.VendorID,
"Vendor" = Vendors.Vendor_Name,
"Address" = Vendors.Address,
"Value" = Value,
"T... |
-- The average sum of finished orders
SELECT AVG(total) AS average_of_finished_orders FROM orders WHERE order_status_order_status_id=4;
-- The max sum of order for the third quarter
SELECT MAX(total) AS max_sum FROM orders WHERE created_at BETWEEN '2020-07-01' AND '2020-09-30' AND order_status_order_status_id=4; |
DROP TABLE foo;
-- error 42P01: no such table: FOO
CREATE TABLE foo (x FLOAT);
DROP TABLE foo;
DROP TABLE foo;
-- msg: CREATE TABLE 1
-- msg: DROP TABLE 1
-- error 42P01: no such table: FOO
|
# __
# .--------.--.--.-----.-----.| |
# | | | |__ --| _ || |
# |__|__|__|___ |_____|__ ||__|
# |_____| |__|
#
# MySQL DML Exercises 12/20 - The INNER JOIN
# Write a query to select all rentals (complete with customer name and film title) made on 2005-05-24,... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 30, 2016 at 04:54 AM
-- Server version: 5.6.26
-- PHP Version: 7.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Czas generowania: 26 Maj 2021, 21:27
-- Wersja serwera: 10.3.16-MariaDB
-- Wersja PHP: 7.3.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
ALTER TABLE GPYT_T038_FUENTE ADD A038IDUNIDAD NUMBER(7);
ALTER TABLE GPYT_T013_AVANCE_PROYECTO ADD A013OPTAPAGORESULTADOS CHAR(2 BYTE); |
-- MySQL dump 10.13 Distrib 5.6.23, for Win32 (x86)
--
-- Host: localhost Database: himakan
-- ------------------------------------------------------
-- Server version 5.6.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
CREATE TABLE book (
`bookId` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`author` VARCHAR(255) NOT NULL,
`citation` TEXT NOT NULL
) ENGINE InnoDB;
CREATE TABLE `paragraph` (
`paraNum` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
`bookId` INT UNSIGNED NOT NULL,
`pageN... |
CREATE TABLE `category` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) character set latin1 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `nickname` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) character set latin1 NOT NULL,
`... |
-- MySQL dump 10.16 Distrib 10.1.33-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: tv_apps
-- ------------------------------------------------------
-- Server version 10.1.33-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_S... |
create table person(
person_id serial primary key,
name varchar(20),
age integer,
height integer,
city varchar(20),
favorite_color varchar(20)
);
insert into person (name, age, height, city, favorite_color)
values ('ashe', 20, 170, 'Phoenix', 'blue');
insert into person (name, age, height, city, ... |
SELECT
count(c.`id`) AS size
FROM `publishs` c
WHERE c.`client` = ?; |
USE football;
CREATE TABLE `commune` (
`n_id` bigint(11) NOT NULL AUTO_INCREMENT,
`s_code` varchar(10) NOT NULL COMMENT 'ma phuong xa',
`s_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'ten phuong xa',
`n_county_district_id` bigint(11) NOT NULL COMMENT 'id cua ban ghi quan huyen',
`s_level` varc... |
-- https://www.urionlinejudge.com.br/judge/en/problems/view/2603
select name, street from customers where city = 'Porto Alegre' |
ODS层之用户行为数据
建表语句
----------------------------------------------------
drop table if exists ods_start_log;
CREATE EXTERNAL TABLE ods_start_log (`line` string)
PARTITIONED BY (`dt` string)
STORED AS
INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveI... |
-- MySQL dump 10.13 Distrib 5.7.34, for Linux (x86_64)
--
-- Host: localhost Database: food_oms_db
-- ------------------------------------------------------
-- Server version 5.7.34-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... |
INSERT INTO ticTacToe.wait_Lobby VALUES (
'3',
'3');
|
--select st_punkt2d from danegeograficzne limit 5;
--select ST_Distance(p1, p2) as dist
--from (select
-- ST_GeographyFromWKB(select dane1.punkt2d from danegeograficzne as dane1 where dane1.id = 1) as p1,
-- ST_GeographyFromWKB(select dane2.punkt2d from danegeograficzne as dane2 where dane2.id = 2) as p2,... |
INSERT INTO burgers (burger_name) VALUES ('Dirty Burger');
INSERT INTO burgers (burger_name) VALUES ('Krabby Patty');
INSERT INTO burgers (burger_name) VALUES ('Good Burger');
INSERT INTO burgers (burger_name) VALUES ('Mediocre Burger'); |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 13/09/2016 às 15:40:44
-- Versão do Servidor: 10.0.20-MariaDB
-- Versão do PHP: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
-- MySQL dump 10.13 Distrib 8.0.21, for macos10.15 (x86_64)
--
-- Host: 127.0.0.1 Database: newsroom
-- ------------------------------------------------------
-- Server version 8.0.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: 20-Maio-2019 às 19:47
-- Versão do servidor: 5.7.24
-- versão do PHP: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 28, 2019 at 02:27 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
--修改日期:2013-01-09
--修改人:黄学安
--修改内容:增加预计利息
-- Add/modify columns
alter table CMS_PROVIDE_LOAN_INFO add antic_interest NUMBER(15,2);
-- Add comments to the columns
comment on column CMS_PROVIDE_LOAN_INFO.antic_interest
is '预计利息';
|
prompt start ./plsql/generated/plankton/ROZKLADY_JAZDY.sql
prompt Create trigger rozklady_jazdy_fer
create or replace trigger rozklady_jazdy_fer
before insert on rozklady_jazdy
for each row
declare
begin
insert into object_id( inst_id, id, schema_name, table_name, seq_name ) values( 0, :new.id, 'PLANKTON' ,'ROZKLADY_... |
CREATE DATABASE PaymentSysDb DEFAULT CHARACTER SET utf8;
USE PaymentSysDb;
CREATE TABLE create_order_id(
id int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
create_time varchar(20)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE orders(
order_id varchar(20) NOT NUL... |
CREATE TABLE KOMPETANSE
(
ID BIGINT PRIMARY KEY,
FK_BEHANDLING_ID BIGINT REFERENCES BEHANDLING (ID) NOT NULL,
FOM TIMESTAMP(3),
TOM TIMESTAMP(3),
VERSJON BIGINT DEFAULT 0 NOT NULL,
OPPRETTET_AV VARCHAR DEFAULT 'VL' ... |
/*
Navicat Premium Data Transfer
Source Server : root
Source Server Type : MySQL
Source Server Version : 80013
Source Host : 192.168.26.20:3306
Source Schema : wtf
Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001
Date: 15/04/2019 23:42:4... |
type: STRING,
status: STRING,
escrowAddress: STRING,
networkFee: FLOAT,
paymentMethodType: STRING,
purchaseViewToken: STRING,
assetExchangeRateEur: FLOAT,
createdAt: TIMESTAMP,
receiverAddress: STRING,
fiatCurrency: STRING,
actions: STRING,
endTime: TIMESTAMP,
assetExchangeRate: FLOAT,
fiatExchangeRateEur: FLOAT,
final... |
ALTER TABLE `boyo_userAppServer`
ADD COLUMN `platformId` int(11) NULL AFTER `vipEndTime`;
ALTER TABLE `boyo_bill`
ADD COLUMN `thirdPartPlatform` varchar(30) default ''; |
# What is the minimum payment received?
SELECT MIN(amount) FROM payments |
set serveroutput on size 32000
set serveroutput on size 32000 |
#DROP TABLE IF EXISTS `sia_flw`;
CREATE TABLE `sia_flw` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`flw_code` char(12) NOT NULL COMMENT '',
`flw_date` char(8) NOT NULL COMMENT '',
`flw_time` char(4) NULL COMMENT '',
`unflw_date` char(8) NULL COMMENT '',
`from` varchar(10) NULL COMMENT '',
`from_uid` varchar... |
# Asian Population
SELECT SUM(C.POPULATION)
FROM COUNTRY CO, CITY C
WHERE CONTINENT = 'Asia' AND C.COUNTRYCODE = CO.CODE
# African Cities
SELECT CITY.NAME
FROM CITY, COUNTRY
WHERE COUNTRY.CONTINENT = 'Africa' AND CITY.CountryCode = COUNTRY.Code;
# Average Population of Each Continent
SELECT CONTINENT, CEILING(AVG(... |
-- begin CURRENCY_CURRENCY_RATE
alter table CURRENCY_CURRENCY_RATE add constraint FK_CURRENCY_CURRENCY_RATE_BASE_CURRENCY foreign key (BASE_CURRENCY_ID) references CURRENCY_CURRENCY(ID)^
alter table CURRENCY_CURRENCY_RATE add constraint FK_CURRENCY_CURRENCY_RATE_SOURCE_CURRENCY foreign key (SOURCE_CURRENCY_ID) referenc... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3308
-- Generation Time: Jun 12, 2020 at 09:48 AM
-- Server version: 8.0.18
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- Drop sequences
DROP SEQUENCE IF EXISTS seq_crs CASCADE
;
DROP SEQUENCE IF EXISTS seq_Format CASCADE
;
DROP SEQUENCE IF EXISTS seq_GeographicIdentifier CASCADE
;
DROP SEQUENCE IF EXISTS seq_LocalizedString CASCADE
;
DROP SEQUENCE IF EXISTS seq_MDKeywords CASCADE
;
DROP SEQUENCE IF EXISTS seq_metadata CASCADE
;
DROP ... |
-- phpMyAdmin SQL Dump
-- version 3.5.8.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 23, 2013 at 08:59 AM
-- Server version: 5.5.31
-- PHP Version: 5.3.27
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
ALTER TABLE ${ohdsiSchema}.sec_permission ADD COLUMN for_role_id INTEGER;
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, for_role_id)
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'),
REPLACE('vocabulary:%s:concept:*:ancestorAndDescendant:get', '%s', REPLACE(REPLACE(value, 'source:', ''), ':access', '')... |
DROP TABLE user IF EXISTS ;
CREATE TABLE user (
id INTEGER IDENTITY PRIMARY KEY,
name VARCHAR(50),
password VARCHAR(20),
age INTEGER
);
CREATE INDEX user_name ON user (name);
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2021 at 04:10 PM
-- Server version: 10.4.8-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 @OLD... |
CREATE TABLE tb_usuario(
id_usuario SERIAL PRIMARY KEY,
nome VARCHAR(50),
sobrenome VARCHAR(50)
);
CREATE TABLE tb_endereco(
id_endereco SERIAL PRIMARY KEY,
logradouro VARCHAR(100),
complemento VARCHAR(30),
bairro VARCHAR(30),
numero VARCHAR(10),
cep VARCHAR(25)
);
CREATE T... |
CREATE TABLE dbo.ForecastingTreeGroups
(
Id int NOT NULL IDENTITY (1, 1),
TreeRef int NOT NULL,
GroupRef int NOT NULL
) ON [PRIMARY]
|
/*
Navicat MySQL Data Transfer
Source Server : ShiChiYa
Source Server Version : 80012
Source Host : localhost:3306
Source Database : shichiya_test
Target Server Type : MYSQL
Target Server Version : 80012
File Encoding : 65001
Date: 2020-04-02 10:41:37
*/
SET FOREIGN_KEY_CHECKS=0;
... |
create or replace package github_issues
as
/** Interface to github issues API
* @author Morten Egan
* @project OracleGit
* @version 0.1.0
*/
/** Create an issue
* @author Morten Egan
* @param git_account The owner of the repository
* @param repos_name The name of the repository
* @param title The title of ... |
CREATE TABLE house (
`id_serial` INT,
`surface` DECIMAL(20,10),
`type` TEXT,
`garden` BOOLEAN,
`garage` BOOLEAN,
`ghosts` TEXT,
`address` INT,
PRIMARY KEY (`id_serial`)
);
CREATE TABLE town (
`id` INT,
`name` TEXT,
`surface` INT,
`city_hall` INT,
PRIMARY KEY (`id`)
... |
--DATABASE used SQLite--
--Creating the Table--
CREATE TABLE Salaries(
CheckNum INTEGER PRIMARY KEY,
Amount DECIMAL(8,2) NOT NULL
);
--Inserting Into the Table--
INSERT INTO Salaries(CheckNum, Amount)
VALUES (1111,4532),(1212,12000),(1234,12000),(3344,6000),(4324,7500),(4555,6000.12),(9999,12000), (4747,6000),(4748,6... |
WITH order_payments AS (
SELECT order_id, SUM(payment_value) payment
FROM ecommerce_by_olist.olist_order_payments_dataset
GROUP BY order_id
)
, orders AS (
SELECT o.order_id, o.customer_id, o.order_status, o.order_delivered_customer_date,
EXTRACT(YEAR FROM order_delivered_customer_date) order_deliver... |
select v.version, count(*) as count
from "muPiece" as p
join "muVersion" as v on p.version_id = v.id
group by v.version
order by count desc
limit 12
;
|
create table `view_recor`(
`id` BIGINT(20) NOT NULL auto_increment,
`board_id` BIGINT(20) not null,
`user_id` BIGINT(20) not null,
`viewd_at` timestamp default now(),
primary key (id),
foreign key (board_id) references board (id),
foreign key (user_id) references users (id)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf... |
--Create table
create table vacancy (
id integer primary key,
name varchar(255),
text text,
link text
);
|
DROP TABLE IF EXISTS Agent;
CREATE TABLE IF NOT EXISTS Agent (
CodeAgent int(11) NOT NULL,
NomAgent varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
AdresseAgent varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
TelAgent varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
FaxAgent varchar(45) COLLATE utf8_... |
-- CreateEnum
CREATE TYPE "CUBE_TYPE" AS ENUM ('BLACK', 'RED', 'ADDITIONAL');
-- CreateTable
CREATE TABLE "cube_probability" (
"cube_probability_id" SERIAL NOT NULL,
"cube_id" INTEGER NOT NULL,
PRIMARY KEY ("cube_probability_id")
);
-- CreateTable
CREATE TABLE "cube" (
"cube_id" SERIAL NOT NULL,
... |
DELIMITER //
CREATE PROCEDURE `#__k2_extra_fields_geodist`(IN `itemId` INT, IN `latIn` DOUBLE, IN `lngIn` DOUBLE, IN `fieldId` INT, IN `dist` INT, IN `lim` INT)
BEGIN
DECLARE mylng DOUBLE;
DECLARE mylat DOUBLE;
DECLARE lng1 FLOAT;
DECLARE lng2 FLOAT;
DECLARE lat1 FLOAT;
... |
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 06, 2020 at 11:43 AM
-- Server version: 5.6.41-84.1
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
--List the following details of each employee: employee number, last name, first name, sex, and salary.
SELECT * FROM "Employees";
SELECT * FROM "Salaries";
SELECT Employees.first_name, Employees.last_name, Employees.sex, Salaries.salary
FROM "Employees"
INNER JOIN "Salaries" ON Employees.emp_no = Salaries.emp_no;
-... |
INSERT INTO core_crm_available_service(
id,myid,mykatastima,title, aliasname)
VALUES (0,0,(SELECT mykatastimadefault
FROM aab2badmin_basesettings),'Χωρίς Πακέτο', 'nocategory');
|
-- wrong
SELECT
emp_no, AVG(salary)
FROM
salaries
WHERE
salary > 120000
GROUP BY emp_no;
-- right
SELECT
emp_no, AVG(salary)
FROM
salaries
GROUP BY emp_no
HAVING avg(salary) > 120000; |
-- Update image urls in table: 'home_settings'
UPDATE forge.home_settings target
INNER JOIN forge.home_settings source ON target.id = source.id
SET target.image = REPLACE(source.image, 'http://new.gatku.com/', 'https://gatku.com/'),
target.mobile_image = REPLACE(source.mobile_image, 'http://new.gatku.com/', 'https... |
/**
创建学生信息表
*/
create table stuIfo (
userId char(8) not null,
pwd varchar(20) default null,
stuName varchar(30) default null,
phone char(11) default null,
major varchar(30) default null ,
classroom int(4) default null ,
serial int(2) default null ,
entranceTime date default null,
prim... |
-- Drop table
-- DROP TABLE public.games;
CREATE TABLE public.games (
id serial NOT NULL,
"date" timestamp NOT NULL,
white serial NOT NULL,
black serial NOT NULL,
moves text NOT NULL,
winner int4 NOT NULL,
"event" varchar(100) NULL,
CONSTRAINT games_pkey PRIMARY KEY (id),
CONSTRAINT games_black_player_fkey F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.