text stringlengths 6 9.38M |
|---|
create table "Purchases" (
id bigint,
package_id bigint,
user_id bigint,
type varchar(10),
device_id varchar(20),
token char(20),
primary key (id),
foreign key (package_id)
references "Packages" (id) match simple
on update no action
on delete no action,
foreig... |
ALTER TABLE app_user
DROP COLUMN IF EXISTS roles; |
-- Show full description using SHOW
-- Prints the full description of the table
SHOW CREATE TABLE first_table;
|
insert into USER (id,email) values (100,'john@example.com');
insert into USER (id,email) values (101,'eliza@example.com');
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 14, 2017 at 12:06 AM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
DROP PROCEDURE CPI.LINA;
CREATE OR REPLACE PROCEDURE CPI.lina
is
v_comm_vat gipi_invoice.ri_comm_vat%TYPE;
v_comm_vat1 gipi_invoice.ri_comm_vat%TYPE;
v_comm_vat2 gipi_invoice.ri_comm_vat%TYPE;
BEGIN
FOR a IN (SELECT iss_cd, prem_seq_no
FROM gipi_invoice
WHERE ri_comm_vat ... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 25-Jun-2014 às 02:34
-- Versão do servidor: 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 */;... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Database: `dice_db`
--
-- Table structure for table `routlette_data_tbl`
--
CREATE TABLE `routlette_data_tbl` (
`name` varchar(20) NOT NULL,
`winning_no` smallint(6) NOT NULL,
`winning_amt` int(11) NO... |
ALTER TABLE node_props ALTER COLUMN prop_value VARCHAR(4000); |
create database mydb1;
use mydb1;
create table number(
id int NOT NULL AUTO_INCREMENT,
num varchar(20),
PRIMARY KEY (ID)
);
|
## Use to run mysql db docker image, optional if you're not using a local mysqldb
# docker run --name mysqldb -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql
# Connect to mysql and run as root user
# Create Databases
CREATE DATABASE recipe_app_dev;
CREATE DATABASE recipe_app_prod;
# Create database service ac... |
use yenertuz;
drop procedure if exists temp1;
delimiter //
create procedure temp1()
begin
show tables;
end //
delimiter ;
call temp1;
drop procedure if exists temp1;
|
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 03, 2014 at 03:51 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
-- Send friend request
-- procedure definition
-- Referential Integrity Failure to be handled by Front-End
delimiter //
create procedure sendFriendRequest(
in requesterID int,
in requestedID int
)
begin
insert into friendRequest values(requesterID, requestedID);
end //
delimiter ;
-- call procedure
call sendFr... |
select
dateadd(month, datediff(month, 0, c.DateStarted), 0) as "Месяц"
, count(*) as "Новых клиентов"
, count(nc.HadNextCredit) as "Из них взяли займ повторно"
from dbo.Credits c
outer apply
(
select top 1 1 as HadNextCredit
from dbo.Credits c2
where c2.UserId = c.UserId
and c2.Status no... |
DROP PROCEDURE CPI.COPY_POL_WPOLGENIN;
CREATE OR REPLACE PROCEDURE CPI.copy_pol_wpolgenin(
p_par_id IN GIPI_PARLIST.par_id%TYPE,
p_policy_id IN GIPI_POLBASIC.policy_id%TYPE,
p_msg_alert OUT VARCHAR2
)
IS
v_first_info GIPI_WPOLGENIN.first_info%TYPE;
v_user_id ... |
CREATE TABLE IF NOT EXISTS date_
(
D_DATEKEY UInt32,
D_DATE String,
D_DAYOFWEEK LowCardinality(String),
D_MONTH LowCardinality(String),
D_YEAR UInt32,
D_YEARMONTHNUM UInt32,
D_YEARMONTH LowCardin... |
alter session set current_schema=sysadm;
UPDATE PSOPTIONS
SET GUID = ' '
/
delete from psuseremail
--where oprid not in ('PS')
/
update psoprdefn
set emailid = ' '
--where oprid not in ('PS')
/
update PS_ROLEXLATOPR
set emailid = ' '
--where oprid not in ('PS')
/
UPDATE PS_EMAIL_ADDRESSES E
SET E.PREF_EMAIL... |
DELETE from Ycart
where userid = $1 and product_id = $2;
SELECT * from Ycart c
JOIN Yitems i on
c.product_id = i.id
where c.userid = $1
order by c.product_id; |
ALTER TABLE ipsprodcat ADD COLUMN ipsprodcat_fixedamtdiscount NUMERIC(16,4) NOT NULL DEFAULT (0.00); |
-- TODO: DISTINCT
-- SELECT STU_FNAME AS FIRSTNAME ,EMAIL FROM STUDENTS;
-- SELECT DISTINCT STU_FNAME AS FIRSTNAME , EMAIL FROM STUDENTS;
-- TODO: ORDER BY
-- SELECT DISTINCT STU_FNAME,LOGIN_COUNT,COURSE_COUNT FROM STUDENTS;
-- SELECT DISTINCT STU_FNAME,LOGIN_COUNT,COURSE_COUNT FROM
-- STUDENTS ORDER BY COURSE_C... |
USE groove_db;
INSERT INTO Bookings (barber_id, booking_time) VALUES (1, "9:30-10:00 AM");
INSERT INTO Bookings (barber_id, booking_time) VALUES (1, "10:00-10:30 AM");
INSERT INTO Bookings (barber_id, booking_time) VALUES (1, "10:30-11:00 AM");
INSERT INTO Bookings (barber_id, booking_time) VALUES (1, "11:00-11:30 AM"... |
-- Create the DWM_RESIDUAL_PILE table
create table FIA.DWM_RESIDUAL_PILE(
CN varchar(34),
PLT_CN varchar(34),
INVYR numeric(4,0),
STATECD numeric(4,0),
COUNTYCD numeric(3,0),
PLOT numeric(5,0),
SUBP numeric(1,0),
PILE smallint,
MEASYEAR numeric(4,0),
CONDID numeric(1,0),
SHAPECD numeric(1,0),
AZIMUTH numeri... |
\copy (SELECT * FROM learndata) TO 'learndata-latest.csv' CSV HEADER
|
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Inang: 127.0.0.1
-- Waktu pembuatan: 19 Jan 2017 pada 17.49
-- Versi Server: 5.5.32
-- Versi PHP: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
-- sms
select
us.Id as userId
from dbo.vw_UserState us
inner join dbo.FrontendUsers fu on fu.Id = us.Id
outer apply
(
select top 1
cast(max(c.DatePaid) as date) as DatePaid
from dbo.Credits c
where c.UserId = us.Id
and c.Status = 2
) lc
where fu.ConsentReceived = 1
-- and us.Current... |
-- show all databases of your MySQL server
-- cat 0-list_databases.sql | mysql -hlocalhost -uroot -p
SHOW DATABASES;
|
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 27, 2020 at 09:27 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/*
DROP TABLE BOAT cascade constraints;
DROP TABLE SAILOR cascade constraints;
DROP TABLE RESERVES cascade constraints;
*/
CREATE TABLE BOAT (
BID NUMBER(2),
BNAME VARCHAR2(10),
COLOUR VARCHAR2(10),
CONSTRAINT pk_bid PRIMARY KEY (BID)
);
CREATE TABLE SAILOR(
SID NUMBER(2),
SNAME VARCHAR2(20),
AGE NUMBER(2),
RATING NU... |
CREATE TABLE EMPREGADO_PROJETO
(
EMPRO_ID BIGSERIAL NOT NULL,
EMP_NUMERO BIGINT NOT NULL,
PRO_NUMERO BIGINT NOT NULL,
EMPRO_INICIO TIMESTAMP NOT NULL,
EMPRO_TERMINO TIMESTAMP NOT NULL,
CONSTRAINT EMPRO_PKEY PRIMARY KEY (EMPRO_ID),
CONSTRAINT EMPRO_FKEY1 FOREIGN KEY (PRO_NUM... |
alter table notification_property modify column property_value text(65535);
|
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 08, 2021 at 02:58 PM
-- Server version: 10.2.40-MariaDB
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
alter table subscriptions
add column last_notification timestamp;
|
-- migrate:up
CREATE TABLE categorias (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
nombre VARCHAR(25) NOT NULL
);
-- migrate:down
DROP TABLE IF EXISTS categorias;
|
SELECT matchid, mdate, COUNT(matchid) as goals
FROM game ga
INNER JOIN goal go ON go.matchid = ga.id
WHERE (ga.team1 = 'POL' OR ga.team2 = 'POL')
GROUP BY go.matchid, ga.mdate |
/*criando o banco de dados*/
create database db_generation_game_online;
use db_generation_game_online;
/* criando a tabela classe*/
create table tb_classe (
id_classe int auto_increment,
nome_classe varchar (30) not null,
tipo_classe varchar (30) not null,
primary key (id_classe)
);
/* criando tabela personagem*/
c... |
/*Необходимо написать цикл от 1 до 23 (номер шага цикла обозначим i), который:
Обновляет данные в таблице test для каждого n = i, устанавливая n = n - 1;
Вставляет в таблицу test_log запись с n = i.
При этом должны выполняться следующие условия:
Каждые 5 шагов должна выполняться фиксация изменений в таблицах.
Из... |
use s2018300410;
drop table if exists user;
create table user(
uno char(15),
uacademy char(10),
utype char(10),
uname char(10),
password char(30),
primary key(uno)
);
drop table if exists groupinfo;
create table groupInfo(
gno char(15),
gname char(15),
gtype char(10),
primary k... |
/* 255-03013 */
alter table resection_item add newfaas_claimno varchar(25);
alter table resection_item add faas_claimno varchar(25);
/* 255-03015 */
CREATE TABLE `rptcertification_online` (
`objid` varchar(50) NOT NULL,
`state` varchar(25) NOT NULL,
`reftype` varchar(25) NOT NULL,
`refid` varchar(50) NOT NU... |
delete
from
KeyOptions
where
KeyOptions.KeyActionId = @KeyActionId
|
DROP TABLE TODO;
CREATE TABLE TODO (
id INT AUTO_INCREMENT PRIMARY KEY,
body VARCHAR(250) NOT NULL,
done TINYINT NOT NULL
);
|
-- With this you can audit DBA role with unified audit
-- *******************************************************
-- DBA or ANY
-- *******************************************************
-- drop
noaudit policy audit_dba_role;
drop audit policy audit_dba_role;
-- create
create audit policy audit_dba_role roles dba;
a... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : Dim 26 juil. 2020 à 20:34
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
--
-- Base de datos: `ahorcado`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla palabras
--
CREATE TABLE palabras (
IDP int(11) NOT NULL auto_increment,
Palabra varchar(25) NOT NULL,
Tilde int(1) default '0',
Tam int(11) default NULL,
... |
-- yêu cầu 2
SELECT
*
FROM
nhanvien
WHERE
(hoten LIKE 'H%' OR hoten LIKE 'T%'
OR hoten LIKE 'K%')
AND LENGTH(hoten) < 15;
-- yêu cầu 3
SELECT
*
FROM
khachhang
WHERE
diachi IN ('Da Nang' , 'Quang Tri')
AND (CURDATE() - ngaysinh > (18 * 30 * 365)
AND CURDATE() - ... |
CREATE table IF NOT EXISTS Skills (
UID uuid REFERENCES jobseeker(uid),
skill_id int REFERENCES Pre_Skills(id),
years int not NULL DEFAULT 0,
level int not NULL DEFAULT 0,
PRIMARY KEY (UID, skill_id)
-- Level (Intermediate or amateur) of the skill, or years of skills
-- Potentially questions... |
USE ordermgr;
CREATE TABLE `purchase_order` (
`PURCHASE_ORDER_ID` int(11) NOT NULL AUTO_INCREMENT,
`PURCHASE_ORDER_NUM` varchar(11) DEFAULT NULL,
`PURCHASE_ORDER_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`PO_DESC` varchar(200) DEFAULT NULL,
`DISCOUNT` decimal(6,0) DEFAULT NULL,
`AMOUNT` decimal(6... |
select first_name, last_name,sum(amount) Total_Purchase
from customer
join payment on customer.customer_id=payment.customer_id
order by last_name asc; |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 14, 2018 at 12:00 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... |
-- Q2. Refunds!
-- You must not change the next 2 lines or the table definition.
SET SEARCH_PATH TO air_travel, public;
DROP TABLE IF EXISTS q2 CASCADE;
CREATE TABLE q2 (
airline CHAR(2),
name VARCHAR(50),
year CHAR(4),
seat_class seat_class,
refund REAL
);
-- Do this for each of the views that d... |
CREATE TABLE orderhistory (
id CHAVE NOT NULL,
id_employee CHAVE NOT NULL,
id_order CHAVE NOT NULL,
id_order_state CHAVE NOT NULL,
date_add TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT pk_orderhistory PRI... |
CREATE TABLE IF NOT EXISTS Menu_display(
ID serial primary key,
Menu_name VARCHAR(450) NOT NULL,
Menu_link VARCHAR(450) NOT NULL,
fa_icon VARCHAR(450) NULL,
Parent_menu_ID INT NOT NULL,
Pages_ID INT NOT NULL,
date_modify timestamp NOT NULL,
date_create timestamp NOT NULL);
INSERT INTO Menu_di... |
SELECT
teachers.name AS teacher,
cohorts.name AS cohort,
COUNT(assistance_requests) AS total_assistances
FROM assistance_requests
JOIN teachers ON teachers.id = assistance_requests.teacher_id
JOIN students ON students.id = assistance_requests.student_id
JOIN cohorts ON cohorts.id = students.cohort_id
WHERE cohort... |
-- In your Quartz properties file, you'll need to set
-- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
-- By: Ron Cordell - roncordell
-- I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modif... |
DROP DATABASE `KataManga`;
CREATE DATABASE IF NOT EXISTS `KataManga` DEFAULT CHARACTER SET utf8mb4;
USE `KataManga`;
SET NAMES utf8;
SET character_set_client = utf8;
SET SESSION sql_mode = '';
--
-- Table structure for table `author`
--
DROP TABLE IF EXISTS `author`;
CREATE TABLE `author` (
`id` int(11) NOT NULL,
... |
alter table HrmResource
add dactylogram varchar(4000) null
/
alter table HrmResource
add assistantdactylogram varchar(4000) null
/
|
insert into tbl_templates
(project_id,
template_name,
template_prefix,
critical_age,
frozen_time,
description,
is_locked,
guest_access,
registered_perm,
author_perm,
responsible_perm)
values (%1, '%2', '%3', %4, %5, '%6', 1, %7, 0, 0, 0)
|
DROP PROCEDURE CPI.GIPIS002A_CHANGE_ASSD_NO;
CREATE OR REPLACE PROCEDURE CPI.GIPIS002A_CHANGE_ASSD_NO
(p_pack_par_id GIPI_PACK_WPOLBAS.pack_par_id%TYPE,
p_assd_no GIPI_PACK_WPOLBAS.assd_no%TYPE)
IS
/*
** Created by : Veronica V. Raymundo
** Date Created : March 11, 2011
** Reference By : (G... |
SELECT dropIfExists('view', 'saleshistory');
CREATE VIEW saleshistory AS
SELECT cohist.*,
CASE WHEN (cohist_invcnumber='-1') THEN 'Credit'
ELSE cohist_invcnumber
END AS invoicenumber,
cust_id, cust_number, cust_name, cust_curr_id, cust_custtype_id, custtype_code,
salesrep_number,... |
SELECT * into CTRALTAB
from openquery(DB2400, 'SELECT * FROM lscadea.CTRALTAB') |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 24-Maio-2017 às 01:34
-- Versão do servidor: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
create table students
(
id serial not null
constraint codecoolers_pk
primary key,
name text not null,
surname text not null,
email text not null,
class_id integer
constraint class_id
references "ShopTest".public.classes
on update cascade on delete ... |
-- сначала необходимо привести таблицы orders в порядок:
ALTER TABLE
orders
CHANGE COLUMN
user_id user_id BIGINT(20) UNSIGNED NOT NULL
ALTER TABLE orders
ADD CONSTRAINT fk_user_id
FOREIGN KEY (user_id)
REFERENCES users(id)
ON DELETE RESTRICT
ON UPDATE RESTRICT;
ALTER TABLE
orders
CHANGE COLUMN
catalog_id... |
INSERT INTO department (name)VALUES('HR'),('CEO') ;
INSERT INTO user (NAME,DEPARTMENT_ID)VALUES('JOHN',1),('KEN',2),('KATE',1); |
-- Get a count of SQL connections by IP address (Query 39) (Connection Counts by IP Address)
select
ec.client_net_address
, es.program_name
, es.host_name
, es.login_name
, db_name(es.database_id) dbname
, count(ec.session_id) [connection count]
from sys.dm_exec_sessions es with(noloc... |
-- 1. What query would you run to get all the countries that speak Slovene?
-- Your query should return the name of the country, language and language percentage.
-- Your query should arrange the result by language percentage in descending order. (1)
SELECT countries.name, languages.language, languages.percentage
FRO... |
exec XDB.DBMS_XDB.SETHTTPPORT('4321') |
-- Schema Creation
-- Create tables without foreign keys
-- Create Departments Table
CREATE TABLE departments (
dept_no VARCHAR not null,
dept_name VARCHAR not null,
PRIMARY KEY (dept_no)
);
-- Create Title Table
CREATE TABLE titles (
title_id VARCHAR not null,
title VARCHAR not null,
PRIMARY KEY (title_id)
);
... |
DROP PROCEDURE CPI.UPDATE_CO_INS;
CREATE OR REPLACE PROCEDURE CPI.UPDATE_CO_INS(
p_par_id IN GIPI_PARLIST.par_id%TYPE,
p_policy_id IN GIPI_POLBASIC.policy_id%TYPE
)
IS
BEGIN
/*
** Created by : Jerome Orio
** Date Created : March 30, 2010
** Reference By : (GIPIS... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Feb 19, 2020 at 01:18 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
INSERT INTO burgers (name) VALUES ('cheese burger');
INSERT INTO burgers (name, devour) VALUES ('ham burger', true);
|
use Weixing
CREATE TABLE Customer (Id int IDENTITY(1, 1) PRIMARY KEY not null, 名称 nvarchar(20),地址 nvarchar(50),类别 nvarchar(20))
CREATE TABLE Product (Id int IDENTITY(1, 1) PRIMARY KEY not null, 型号 nvarchar(20),属性 nvarchar(20),对应型号 nvarchar(20))
CREATE TABLE EnterBound (Id int IDENTITY(1, 1) PRIMARY KEY not null, 丝厂 ... |
SELECT * FROM KNOWLEDGES
ORDER BY INSERT_DATETIME %s
LIMIT ? OFFSET ?;
|
CREATE TABLE `miTabla` (
`id` int(10) unsigned NOT NULL auto_increment,
`correo` varchar(32) NOT NULL,
`nombre` varchar(32) NOT NULL,
`nivel` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
use roommateDB;
drop table questionaire_of_roommate;
drop table user_info;
drop table house;
drop table house_type;
drop table house_state;
drop table user;
drop table countries;
drop table cities; |
# --- !Ups
create table UserInfoTable
(
id INT Primary Key auto_increment,
email varchar(20),
fname varchar(10),
lname varchar(10)
);
# --- !Downs
drop table UserInfoTable; |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... |
DROP TABLE Perform;
DROP TABLE Plays;
DROP TABLE Lives;
DROP TABLE Telephone_Home;
DROP TABLE Places ;
DROP TABLE Songs_Appears;
DROP TABLE Album_Producer;
DROP TABLE Instruments;
DROP TABLE Musicians; |
declare
--input for each state we want to add
v_name varchar2(255);
v_code varchar2(255);
v_iconcode varchar2(255);
v_description nclob;
v_sourceState integer;
v_targetState integer;
v_stateconfig integer;
--possible flags
v_isNextDefault integer;
--calculated
... |
select team,rank,count(*) as n
from club.sims
group by team,rank
order by rank asc, n desc;
copy (
select team,rank,count(*) as n
from club.sims
group by team,rank
order by rank asc, n desc
) to '/tmp/results.csv' csv header;
|
/* This Program will insert invoice_extras from temp_invoice_extras table and delete from
temp tables */
-- 14/11/05 Paul Butler Set company_code according to value of property_num
-- 27/07/07 Paul Butler Set company_code according to value on Invoice table (previous method no longer works as we now have
-- ... |
create or replace view dau as WITH RECURSIVE cte AS
(
SELECT MIN(CAST(begin_dttm AS DATE)) AS dt FROM sessions
UNION ALL
SELECT dt + INTERVAL 1 DAY
FROM cte
WHERE dt + INTERVAL 1 DAY <= (SELECT MAX(CAST(begin_dttm AS DATE)) FROM sessions)
)
SELECT cte.dt, COUNT(distinct user_id) AS dau
FROM ct... |
DECLARE
v_workbasketid INTEGER;
v_privateworkbasketid INTEGER;
v_result NUMBER;
v_query VARCHAR2(2000);
v_cur SYS_REFCURSOR;
v_id INTEGER;
v_caseworkerid INTEGER;
v_numberofrecords INTEGER;
v_ratin... |
INSERT INTO
bears(name, age, gender, color, temperament, alive)
VALUES
("Jordan", 3, "male", "brown", "nice", "yes");
INSERT INTO
bears(name, age, gender, color, temperament, alive)
VALUES
("Mary", 4, "female", "yellow", "nice", "yes");
INSERT INTO
bears(name, age, gender, color, temperament,... |
delete
from
LauncherItemHistories
where
LauncherItemHistories.LauncherItemId = @LauncherItemId
and
LauncherItemHistories.Kind = @Kind
and
LauncherItemHistories.LastExecuteTimestamp = @LastExecuteTimestamp
|
CREATE SCHEMA myblog;
CREATE TABLE IF NOT EXISTS `myblog`.`articles` (
`id` INT NOT NULL AUTO_INCREMENT ,
`title` VARCHAR(45) NOT NULL COMMENT 'Заголовок статьи' ,
`text` TEXT NOT NULL COMMENT 'Текст статьи' ,
`date` TIMESTAMP NOT NULL DEFAULT now() COMMENT 'Дата добавления статьи.' ,
PRIMARY KEY (`id`) ,
... |
CREATE DATABASE IF NOT EXISTS `carlab` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `carlab`;
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1 Database: carlab
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
-- TODO FIX
-- drop database if exists imdb;
-- create database imdb with owner postgres;
drop table names;
drop table title_akas;
drop table title_basics;
drop table title_ratings;
drop table title_principals;
drop table title_episode;
drop table title_crew;
drop table my_ratings;
create table names
(
nconst text,
... |
create table "Users" (
id bigint not null, --not necessarily 8 digits
username varchar(20) not null,
first_name varchar(20),
last_name varchar(20),
email varchar(40) not null,
phone_number char(10) not null,
primary key(id)
);
create table "Developers" (
id bigint not null,
username... |
CREATE DATABASE IF NOT EXISTS `prestashop` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `prestashop`;
-- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (i686)
--
-- Host: localhost Database: prestashop
-- ------------------------------------------------------
-- Server version 5.5.29-0ubuntu0.12.04.1-log
/*... |
-- criando banco de dados
CREATE DATABASE db_ecommerce;
-- informando o banco de dados
USE db_ecommerce;
-- criando tabela
CREATE TABLE tb_produtos (
id BIGINT (8) AUTO_INCREMENT,
nome VARCHAR (100),
tipo VARCHAR (20),
marca VARCHAR (30),
preco BIGINT (10),
PRIMARY KEY (id)
);
-- populando tabela
INSERT INTO tb_pr... |
SELECT MAX(Population)
FROM city
WHERE countrycode = 'PRT' |
/*
Navicat Premium Data Transfer
Source Server : Mysql
Source Server Type : MySQL
Source Server Version : 50173
Source Host : localhost:3306
Source Schema : medicine
Target Server Type : MySQL
Target Server Version : 50173
File Encoding : 65001
Date: 11/06/2019 13:11... |
CREATE DATABASE IF NOT EXISTS burgers_db;
use burgers_db;
CREATE TABLE burgers(
id int NOT NULL AUTO_INCREMENT,
burger_name VARCHAR (233) NOT NULL,
eaten BOOL DEFAULT false,
PRIMARY KEY (id)
);
INSERT INTO burgers (burger_name, eaten) VALUES("Cheese Burger", FALSE);
INSERT INTO burgers (burger_name, eaten) VALUE... |
-- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: catalogocine
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... |
CREATE TABLE places (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
description TEXT,
image TEXT
);
INSERT INTO places (name) VALUES ('Noosa');
INSERT INTO places (name) VALUES ('The Hinterland');
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 27, 2020 at 09:23 AM
-- 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... |
---------------------------------------------------------------------------
-- First Notice Systems
-- 529 Main Street
-- Boston, MA 02129
-- (617) 886 2600
--
-- Proprietary Source Code -- Distribution restricted
--
-- Copyright (c) 2006 by First Notice Systems
------------------------------------------------... |
RETURN '@TOKEN_DOMAIN@'; |
CREATE DATABASE empresa;
USE empresa;
CREATE TABLE cargos(
id_cargo INT NOT NULL AUTO_INCREMENT,
descricao_cargo VARCHAR (50),
salario DECIMAL(9,2),
PRIMARY KEY (id_cargo)
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.