text stringlengths 6 9.38M |
|---|
CREATE TABLE contacts (
user_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(25) NOT NULL);
INSERT INTO contacts VALUES (NULL, 'Петр');
INSERT INTO contacts VALUES (NULL, 'Женя');
INSERT INTO contacts VALUES (NULL, 'Коля');
INSERT INTO contacts VALUES (NULL, 'Игорь');
SELECT name FROM contacts;
# внешний ... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 09, 2021 at 06:52 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
SELECT *
FROM students
WHERE students.student_id IN (
SELECT student_id
FROM exam_results
WHERE exam_results.grade >= 4
AND exam_results.class_id IN (
SELECT class_id
FROM class_catalogue
WHERE class_name = 'algebra'
)
); |
START TRANSACTION;
UPDATE schema_version SET
version = '20130519'
;
CREATE TABLE IF NOT EXISTS workbench_user_info (
user_id INT NOT NULL
,login_count INT NOT NULL DEFAULT 0
,PRIMARY KEY (user_id)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
REPLACE INTO workbench_user_info (user_id, login_coun... |
DROP VIEW IF EXISTS acs2010_5yr.vw_msa_county;
CREATE VIEW acs2010_5yr.vw_msa_county AS
select stusab, name AS cbsa_name, state || county AS fips, cbsa,
CASE WHEN name like '%Metro Area%' THEN 'metro'
WHEN NAME LIKE '%Micro Area%' THEN 'micro'
ELSE NULL
END AS metro_micro
from acs2010_5yr.geoheader where sumleve... |
INSERT INTO `tipolicencia` VALUES (1,"B1", "Comun");
INSERT INTO `tipolicencia` VALUES (2,"B2", "Professional");
INSERT INTO `tipolicencia` VALUES (3,"C1", "Motos");
INSERT INTO `tipolicencia` VALUES (4,"H1","Transporte");
INSERT INTO `tipolicencia` VALUES (5,"H2","Transporte con acoplado");
INSERT INTO `tipoinforme` ... |
insert into User values(0,'kasrrrraa','09350000000','kasrakhalafi@gmail.com','12345','kasra','khalafi',5526,55464,now(),now());
insert into User values(1,'kasrakk','09120000001','kasrakhalafi@yahoo.com','12346','kasra','khalafi',5527,48544,now(),now());
insert into User values(2,'m.n4seri','09120000000','m.n4seri@gm... |
DROP DATABASE IF EXISTS wall;
CREATE DATABASE IF NOT EXISTS wall DEFAULT CHARACTER set utf8mb4 COLLATE utf8mb4_unicode_ci; |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2017 at 03:07 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
#***** COMANDOS PARA MARIADB **************
#********** Consultar usuarios **************
#SELECT User FROM mysql.user;
#********** Eliminar usuario ****************
#DROP USER 'userpoo'@'%';
#********** Crear usuario *******************
#CREATE USER 'userpoo'@'%' IDENTIFIED BY '123Admin';
#********* crear todos los... |
CREATE TABLE unidade (
id serial NOT NULL,
nome varchar(100) NOT NULL,
endereco varchar(150) NOT NULL,
primary key (id)
);
create table TB_CLIENTE (
id serial NOT NULL,
nro_cpf VARCHAR(14) not null,
txt_nome varchar(255),
primary key (id));
--create table TB_ATENDIMENTO (
-- id serial NOT NU... |
SELECT SUM(EV_VOLUMES_TEST.VALUE), OEM_GROUP
FROM EV_VOLUMES_TEST
GROUP BY OEM_GROUP
ORDER BY SUM(EV_VOLUMES_TEST.VALUE) DESC; |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas wygenerowania: 08 Kwi 2016, 11:25
-- Wersja serwera: 5.5.47-0ubuntu0.14.04.1
-- Wersja PHP: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE ROLE admin superuser;
CREATE USER roman;
GRANT admin TO roman;
ALTER ROLE roman WITH LOGIN;
|
/**************************************************
TRIGGERS
**************************************************/
-- store any modifications to patrons table
drop trigger if exists trigger_patrons_after_update;
delimiter //
create trigger trigger_patrons_after_update
after update on `patrons` for each row
begin
dec... |
# sql_field_string = book
# sql_field_string = protagonist
# sql_field_string = author
# sql_field_string = category
# sql_field_string = category_id
# sql_field_string = isbn
# sql_attr_uint = lang_id
# sql_attr_bool = is_deleted
#
# sql_attr_multi = author_id
# sql_attr_multi = list_id
# sql_attr_multi = publis... |
-- Predictor 1
CREATE TABLE chemical_interactions_v2.predictor_1_all_unused_pairs_3 AS
SELECT cid_1, cid_2, ensp_1, ensp_2
FROM chemical_interactions_v2.predictor_1_all a
WHERE
NOT EXISTS (SELECT 1 FROM chemical_interactions_v2.predictor_1 b WHERE b.cid_1=a.cid_1 AND b.cid_2=a.cid_2) AND
NOT EXISTS (SELECT 1 FROM chem... |
CREATE TABLE users (
username VARCHAR(45) NOT NULL ,
password VARCHAR(60) NOT NULL ,
enabled TINYINT NOT NULL DEFAULT 1 ,
PRIMARY KEY (username));
CREATE TABLE user_roles (
user_role_id int(11) NOT NULL AUTO_INCREMENT,
username varchar(45) NOT NULL,
role varchar(45) NOT NULL,
PRIMARY KEY (user_role_id... |
/*============================G===== RELATIONSHIP DRILLS
-- concat the max salaries of the first two employees
-- get current manager name of Sales department (use subqueries)
-- get all senior engineers in customer service department
-- get all first and last names of current Sales department employees
-- get the name... |
ALTER TABLE ONLY course_events
DROP COLUMN scene_id,
DROP COLUMN school_id;
--;;
DROP TABLE school_stats;
--;;
|
create view rpt_vf_bd_index_view as
with yoy as(
-- index YOY old
select date,
brand,
type,
cast(bdindex as float) / (select bdindex from dbo.rpt_vf_bd_index as a1 where (date=dateadd(year,-1,a.date)) and (a.brand=brand) and (a.isnew=isnew) and (a.type=type) and (bdindex>0)) - 1 as a,... |
/*
查询数据
select 字段列表/* from 表名 where 字段名 = 值;
*/
select * from my_teacher;
select name from my_teacher;
select * from my_teacher where age>31;
/*
删除操作
delete from 表名 [where 条件]
如果没有where,数据将被清空
*/
delete from my_teacher where age>0;
/*
修改操作
update 表名 set 字段名 = 新值 [where 条件]
如果没有where,数... |
INSERT INTO department (name)
VALUES (
'Human Resources'
),
(
'Finance'
);
INSERT INTO role (title, salary, department_id)
VALUES (
'Cashier', 75000, 2
),
(
'Human Resources Coordinator', 100000, 1
),
(
'Accountant', 80000, 2
);
INSERT INTO em... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 05-02-2020 a las 04:52:29
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
CREATE TABLE [ERP].[Transformacion] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[IdEmpresa] INT NULL,
[IdTransformacionEstado] INT NULL,
[IdAlmacenOrigen] INT NULL,
[IdAlmacenDestino] INT NULL,
[I... |
CREATE TABLE map_feature (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
description VARCHAR(512) NOT NULL,
google_place_id VARCHAR(512) NOT NULL,
create_timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
modify_timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UP... |
SELECT productid
FROM product
WHERE (data->>'category'=$1) and (data->>'is_active'='true'); |
USE Bank
GO
IF NOT EXISTS(SELECT * FROM sysobjects where id = object_id(N'dbo.pr_CreateAccounts') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
EXEC ('CREATE PROCEDURE dbo.pr_CreateAccounts AS SET NOCOUNT ON;')
GO
ALTER PROCEDURE dbo.pr_CreateAccounts
@Accounts dbo.tp_AccountTable READONLY
AS
CREATE TABLE #tm... |
ALTER TABLE `dates` ADD `username` varchar(31) NOT NULL DEFAULT '' AFTER `reoccurrence`;
ALTER TABLE `dates` DROP PRIMARY KEY;
ALTER TABLE `dates` ADD PRIMARY KEY(`reoccurrence`,`username`,`date`);
ALTER TABLE `dates` ADD CONSTRAINT fk_dates_reoccurrence FOREIGN KEY (`reoccurrence`,`username`) REFERENCES reoccurrences(... |
-- Your SQL goes here
CREATE TABLE abstract_personality_schema (
user_id BIGSERIAL REFERENCES users(id) PRIMARY KEY,
binary_encoding TEXT,
last_systematic_update TIMESTAMP,
last_micro_update TIMESTAMP
); |
CREATE TABLE [ERP].[Almacen] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[IdEmpresa] INT NULL,
[Nombre] VARCHAR (50) NULL,
[IdEstablecimiento] INT NULL,
[FechaRegistro] DATETIME NULL,
[FechaEliminado] DATETIME NULL,
... |
CREATE TABLE translations (
original VARCHAR,
lang VARCHAR,
translated VARCHAR
);
CREATE TABLE users (
username VARCHAR,
password VARCHAR,
authorities VARCHAR
);
|
CREATE DEFINER=`root`@`localhost` FUNCTION `AsignarLocker`() RETURNS int(11)
BEGIN
declare id int;
select id_locker from locker where libre = 1 limit 1 into id;
RETURN id;
END |
CREATE TEMPORARY TABLE CU4800_1 AS
WITH C0_CU4800_1 AS (
SELECT * FROM tb_sensor_unified WHERE maxrotorspeed IS NOT NULL
)
SELECT dFrom, dTo
FROM (
SELECT datetime as dFrom,
LEAD(datetime, 1) OVER (ORDER BY datetime) AS dTo,
maxrotorspeed AS currRs,
LEAD(maxrotorspeed, 1) OVER (ORDER BY datetime) AS nextRs
FROM C0_C... |
insert into workout_items(user_id, workout_id, type, type_value, distance, time) values
(${user_id}, ${workout_id}, ${type}, ${type_value}, ${distance}, ${time}) returning *;
-- create table workout_items(
-- id serial primary key,
-- user_id int references users (id),
-- workout_id int references worko... |
-- 02/07/2014
DROP TABLE IF EXISTS `shipping_details`;
CREATE TABLE `shipping_details` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL,
`customer_id` INT(11) NOT NULL,
`date_time` datetime NOT NULL,
`distance` varchar(4) COLLATE utf8_general_ci DEFAULT NULL,
`total` INT(10) NOT N... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 29 Bulan Mei 2020 pada 08.25
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
CREATE TABLE m_node
(
gid integer,
id varchar(10),
statnnm varchar(50),
linenum varchar(2),
transfer varchar(2),
stationid varchar(10)
);
CREATE TABLE m_network
(
gid integer,
id varchar(15),
source integer,
target integer,
cost float,
linenum varchar(2)
);
CREATE... |
create sequence ORDER_TITLE_SEQ start with 1 increment by 1;
|
prompt .. Dropping type debug
drop type debug;
prompt .. Dropping type debug_lines
drop type debug_lines;
prompt .. Dropping type debug_line
drop type debug_line;
prompt .. Dropping type debug_records
drop type debug_records;
prompt .. Dropping type debug_record
drop type debug_record;
prompt .. Dropping package d... |
--
-- pgwebapi.types
--
--------------------------------------------------------------------------------
CREATE TYPE pgwebapi.request_method AS ENUM (
'GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'
);
--------------------------------------------------------------------------------
|
#------------------------------------------------------------
# Script MySQL.
#------------------------------------------------------------
#------------------------------------------------------------
# Table: songs
#------------------------------------------------------------
CREATE TABLE songs(
id ... |
DROP TABLE IF EXISTS `XXX_papoo_google_sitemap`; ##b_dump## |
DROP TABLE IF EXISTS bookings;
CREATE TABLE bookings (
id IDENTITY PRIMARY KEY,
trail_id INT NOT NULL,
date_when DATE NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
CREATE TABLE admins (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
botid INT NOT NULL,
name VARCHAR(15) NOT NULL,
server VARCHAR(100) NOT NULL
);
CREATE TABLE bans (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
botid INT NOT NULL,
server VARCHAR(100) NOT NULL,
name VARCHAR(15) NOT NULL,
ip VARCHAR(15) NOT NULL,... |
create PROC [ERP].[Usp_Upd_Empresa_Borrador]
@IdEntidad INT,
@Nombre VARCHAR(250),
@NumeroDocumento CHAR(11)
AS
BEGIN
UPDATE ERP.Entidad SET Nombre = @Nombre WHERE ID = @IdEntidad
UPDATE ERP.EntidadTipoDocumento SET NumeroDocumento = @NumeroDocumento WHERE IdEntidad = @IdEntidad AND IdTipoDocumento = 2
END... |
USE Diablo
-- Problem 25
SELECT Name FROM Characters ORDER BY Name |
-- 08/07/2018 - Costs/debts table
ALTER TABLE `costs` ADD `date_time` datetime NOT NULL AFTER `type_id`;
ALTER TABLE `costs` ADD `branch_id` int(11) NOT NULL DEFAULT '1' AFTER `description`;
INSERT INTO `cost_types` (`id`, `name`, `description`, `is_public`, `created_dtm`, `modified_dtm`) VALUES
(1, 'Chi phí trái cây'... |
DROP DATABASE IF EXISTS employeeTracker;
CREATE DATABASE employeeTracker;
USE employeeTracker;
CREATE TABLE department(
department_id INT NOT NULL AUTO_INCREMENT,
department VARCHAR(30),
PRIMARY KEY (department_id)
);
CREATE TABLE role(
role_id INT NOT NULL AUTO_INCREMENT,
role_type VARCHAR(30),
salary DECIMA... |
-- Table: em_users
-- DROP TABLE em_users;
CREATE TABLE em_users
(
username character varying(255) NOT NULL,
passwd character varying(255) NOT NULL,
role character varying(64) NOT NULL,
dbusername character varying(64),
dbpasswd character varying(64),
CONSTRAINT pk_users_name PRIMARY KEY (username )
)
WI... |
create table customer
(
dlicense varchar(20) not null PRIMARY KEY,
name varchar(20) not null,
address varchar(40) not null,
phone varchar(20) not null unique
);
create table vehicleType
(
vtname varchar(20) not null PRIMARY KEY,
feature varchar(20) not null,
wrate float not... |
begin
HARMONY.doit('alter table harmony.tuser drop column is_central');
end;
|
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS forums;
DROP TABLE IF EXISTS threads;
CREATE TABLE IF NOT EXISTS users(
Id INTEGER PRIMARY KEY ASC,
username TEXT,
password TEXT
);
CREATE TABLE IF NOT EXISTS forums(
Id INTEGER PRIMARY KEY ASC,
forum_name TEXT,
forum_creator TEXT,
FOREIGN KEY (forum_creato... |
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `uspFacultyDetailsGet`()
BEGIN
Select FacultyCode,FacultyFirstName,FacultyLastName,Qualification,Designation from tblfacultydetails;
END$$
DELIMITER ;
|
INSERT INTO customer (
customer_id,
car_id,
first_name,
last_name,
address,
billing,
email,
phone
) VALUES(
1,
1,
'Michael',
'Jordan',
'23 The Goat Cir',
'23 The Goat Cir',
'thegoat@jumpman23.com',
'(232)232-3232'
);
INSERT INTO customer (
customer_id,
car_id,
first_nam... |
CREATE TABLE TeamPortal_email (
id int AUTO_INCREMENT PRIMARY KEY,
sender_email VARCHAR(64) NOT NULL,
sender_naam VARCHAR(64) NOT NULL,
receiver_email VARCHAR(64) NOT NULL,
receiver_naam VARCHAR(64) NOT NULL,
titel VARCHAR(128) NOT NULL,
body TEXT NOT NULL,
signature varchar(40) NOT NULL,
queue_date T... |
rem PL/SQL Developer Test Script
set feedback off
set autoprint off
rem Execute PL/SQL Block
-- Created on 21.03.2014 by ADMIN
declare
-- Local variables here
iAccntID integer;
sAccntStr varchar2(255);
StartDT Date;
EndDT Date;
iRes integer;
begin
-- Test statements here
iAccntID := ... |
-- SQLite
SELECT * FROM USRLOG WHERE USR_ID = 'BOM5ITV' AND LOG_ID > 227;
|
INSERT INTO burgers(burger_name) VALUES ('Juicy lucy');
INSERT INTO burgers (burger_name) VALUES ('Man Burger');
INSERT INTO burgers (burger_name) VALUES ('Boss Burger'); |
/*
Warnings:
- The migration will add a unique constraint covering the columns `[titulo]` on the table `Libro`. If there are existing duplicate values, the migration will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "Libro.titulo_unique" ON "Libro"("titulo");
|
DROP DATABASE IF EXISTS simconf;
CREATE DATABASE simconf
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci;
USE simconf;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE
IF EXISTS user;
CREATE TABLE user
(
id BIGINT(20) PRIMARY KEY AUTO_INCREME... |
CREATE DATABASE api_criptos;
USE api_criptos;
CREATE TABLE users (
`id` int(11) not null auto_increment,
`name` varchar(25) not null,
`last_name` varchar(25) not null,
`username` varchar(25) not null unique,
`pass` varchar(200) not null,
`prefer_currency` varchar(3) default 'usd',
`prefer_top` int(2) def... |
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY NOT NULL,
first_name TEXT NOT NULL,
second_name TEXT NOT NULL,
age INTEGER NOT NULL
);
INSERT INTO users (first_name, second_name, age) values ('Дмитрий', 'Кушнер', 21);
INSERT INTO us... |
DROP TABLE IF EXISTS refresh_tokens; |
# Query to select only the id, account_id, and occurred_at columns for all orders in the orders table
SELECT id,account_id,occurred_at
FROM orders;
# Query that limits the response to only the first 15 rows and includes the occurred_at, account_id, and channel fields in the web_events table.
SELECT occurred_at,acc... |
SELECT
P.NUMERO_PROJETO
, P.NUMERO_DEPARTAMENTO
, F.ULTIMO_NOME
, F.ENDERECO
, F.DATA_NASCIMENTO
FROM TB_PROJETO P
INNER JOIN TB_DEPARTAMENTO D ON D.NUMERO_DEPARTAMENTO = P.NUMERO_DEPARTAMENTO
INNER JOIN TB_FUNCIONARIO F ON F.CPF = D.CPF_GERENTE
WHERE P.LOCAL_PROJETO = 'Mauá'
|
INSERT INTO `cryptoExchange`.`crypto`
(`name`,
`amount`,
`created_at`,
`wallet`,
`purchase_market_value`)
VALUES ('BTCEUR', 10, '2008-11-11 13:23:44', 'Cold wallet', 1.0001),
('BTCEUR', 2, '2008-11-11 13:25:44', 'Cold wallet', 1.0001); |
CREATE TABLE students_by_list (
id SERIAL,
name STRING,
email STRING,
country STRING,
expected_graduation_date DATE,
PRIMARY KEY (country, id))
PARTITION BY LIST (country)
(PARTITION north_america VALUES IN ('CA','US'),
PARTITION australia VALUES IN ('AU','NZ'),
PARTITIO... |
SELECT a.user_pyr1_cat,
SUM(b.chg_qty) as 'Cases',
SUM(b.tot_chg_amt) as 'Tot_Chgs'
FROm smsdss.bmh_plm_ptacct_v as a inner join smsdss.BMH_PLM_PtAcct_Svc_V_Hold as b
ON a.Pt_Key=b.Pt_Key and a.Bl_Unit_Key=b.bl_unit_key
WHERE b.svc_date BETWEEN '01/01/15' and '12/31/15'
AND a.pt_type IN ('K')
AND b.svc_cd ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 01, 2021 at 11:42 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1:3307
-- Generation Time: Aug 20, 2016 at 01:30 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... |
-- t_alert_time_limit
DROP TABLE IF EXISTS t_alert_time_limit;
CREATE TABLE t_alert_time_limit
(
id bigint NOT NULL AUTO_INCREMENT,
dev_id char(36) NOT NULL COMMENT '设备 id',
arrive_time int NOT NULL COMMENT '指定到达时间,以秒为单位',
add_time timestamp NOT NULL default CURRENT_TIMESTAMP,
update_time timestamp NOT NULL ... |
-- ****************************************************
-- ** REQUIRES
-- ** - FHIR/Language
-- ** - NHSDD/Religion
-- ** - NHSDD/Speciality
-- ** - NHSDD/Inpatient
-- ** - NHSDD/Ethnicity
-- ****************************************************
-- Ensure core code scheme exists
INSERT IGNORE INTO concept (do... |
// * Write pseudo-SQL statements to create database tables to store the products of a basic webshop.
// Each product has a name, a price, a creation date and may belong to several categories.
// Categories have a name and a flag to indicate whether the category is private or public.
// * Write a SQL query to find the l... |
DELIMITER $$
USE `cci_gh_go_dev`$$
DROP PROCEDURE IF EXISTS `SPPartnerQSParticipantsStats`$$
CREATE DEFINER=`phanipothula`@`%` PROCEDURE `SPPartnerQSParticipantsStats`()
BEGIN
DECLARE f_partnerGoId INTEGER DEFAULT 0;
DECLARE goid INT;
DECLARE partnergoid CURSOR FOR
SELECT DISTINCT `partnerGoId`
FROM `Partner`;
DECLA... |
alter table store
add FOREIGN KEY (`station_id`)
REFERENCES `db_vphan`.`Station` (`station_id`);
Alter table item
add FOREIGN KEY (`department_id`)
REFERENCES `db_vphan`.`Department` (`department_id`);
alter table inventory
add FOREIGN KEY (`store_id`)
REFERENCES `db_vphan`.`Store` (`store_id`);
alter table inventor... |
CREATE SCHEMA TopTrump;
CREATE TABLE Game
(GamesNo INT NOT NULL,
HumanWin INT NOT NULL,
AIWin INT NOT NULL,
NoDraws INT NOT NUll,
GameLength INT NOT NULL,
Primary Key(GamesNo, HumanWin, AIW... |
---------------------------------------------------------------------
-- CONCATENATION
---------------------------------------------------------------------
SELECT empid, country, region, city,
CONCAT(country, ', ', region, ', ', city) AS location
FROM HR.Employees;
SELECT empid, country, region, city,
CONCAT(c... |
CREATE TABLE IF NOT EXISTS `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_code` varchar(60) NOT NULL,
`product_name` varchar(60) NOT NULL,
`product_desc` tinytext NOT NULL,
`product_img_name` varchar(60) NOT NULL,
`price` decimal(10,2) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `product_code... |
SET CLIENT_ENCODING TO 'utf8';
DROP TABLE Written_by CASCADE;
DROP TABLE Tags CASCADE;
DROP TABLE Webpage CASCADE;
DROP TABLE Article CASCADE;
DROP TABLE Typ CASCADE;
DROP TABLE Domain CASCADE;
DROP TABLE Author CASCADE;
DROP TABLE Keyword CASCADE;
CREATE TABLE Keyword (
keyword_id serial,
keyword varc... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 22-Out-2020 às 02:32
-- Versão do servidor: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
CREATE TABLE [Maestro].[TipoEstadoTrabajador] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Nombre] VARCHAR (100) NULL,
CONSTRAINT [PK_TipoEstadoTrabajador] PRIMARY KEY CLUSTERED ([Id] ASC)
);
|
; WITH cte AS
(
SELECT YEAR(OrderDate) AS OrderYear
, ISNULL(SalesPersonID, 0) as SalesPersonID
, SUM(SubTotal) AS YearlySubtotal
FROM Sales.SalesOrderHeader
GROUP BY YEAR(OrderDate), ISNULL(SalesPersonID, 0)
)
SELECT * FROM cte
ORDER BY SalesPersonID, OrderYear |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 28-Fev-2018 às 21:05
-- Versão do servidor: 10.1.30-MariaDB
-- PHP Version: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: assignment1
-- ------------------------------------------------------
-- Server version 5.7.18-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
/*
Project Option: Coyote Residence Office
TEAM: King James & The Knights of the Data Table
Data Load Method 2: Insert Using Substitution Variables
Done By: Enrique Carbajal Jr.
*/
/*
CREATE TABLE Next_of_Kin (
NOK_Name VARCHAR2(100) /*PK*
CONSTRAINT NOK_PK PRIMARY KEY,
NOK_Phone_Number VARCHAR2(10)
CONSTRAINT NOK_... |
-- +micrate Up
CREATE TABLE items (
id BIGSERIAL PRIMARY KEY,
name VARCHAR,
price INT,
currency VARCHAR,
category_id BIGINT,
created_at TIMESTAMP,
updated_at TIMESTAMP
);
CREATE INDEX item_category_id_idx ON items (category_id);
-- +micrate Down
DROP TABLE IF EXISTS items;
|
select
brn.code,
sme.id,
concat(sme.loreal_former_id, sme.matrix_former_id, sme.kerastase_former_id, sme.redken_former_id) as id_v2,
sme.seminar_id,
concat(smr.loreal_former_id, smr.matrix_former_id, smr.kerastase_former_id, smr.redken_former_id) as seminar_id_v2,
smr."name",
sme.studio_id,
concat(trc.lorea... |
List of relations
Schema | Name | Type | Owner
--------+---------------------------+-------+----------
public | acad_object_groups | table | z5239391
public | academic_standing | table | z5239391
public | affiliations | table | z5239391
public |... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 02, 2021 at 11:31 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
/*
* Function: is_account_enabled()
*
* Determines whether instrumentation of an account is enabled.
*
* Parameters
* in_host .....: The hostname of the account to check.
* in_user .....: The username of the account to check.
*
* Returns
* An enum whether the account is enabled or not.
*
* mysql> ... |
INSERT INTO burgers (burger_name) VALUES ('Pug');
INSERT INTO burgers (burger_name) VALUES ('Cheddar and Onion');
INSERT INTO burgers (name, devoured) VALUES ('Bacon', true);
INSERT INTO burgers (name, devoured) VALUES ('Minetta', true); |
/* drop University Database tables */
drop table prereq;
drop table time_slot;
drop table advisor;
drop table takes;
drop table student;
drop table teaches;
drop table section;
drop table instructor;
drop table course;
drop table department;
drop table classroom;
/* drop this project's tables */... |
CREATE TABLE utilisateurs
(id int NOT NULL PRIMARY KEY auto_increment,
nom varchar(30) NOT NULL,
prenom varchar(30) NOT NULL,
pays varchar(30) NOT NULL,
codepostal varchar(5) NOT NULL,
ville varchar(30) NOT NULL,
adresse varchar(50) NOT NULL,
mail varchar(70) NOT NULL,
telephone varchar(10) NOT NULL,
portable... |
-- Initial database scheme for Pushapi
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `pushdb`;
CREATE DATABASE `pushdb` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `pushdb`;
DROP TABLE IF EXISTS `apps`;
CREATE TABLE `apps` (
`... |
timing start fix_maps;
DECLARE
v_hospital_id NUMBER := ##;
v_acct_pool_id NUMBER := ##;
v_mrn_pool_id NUMBER := ##;
v_ucrn_pool_id NUMBER := ###;
v_feed_id NUMBER := ##;
PROCEDURE fix_maps AS
-- PB records:
TYPE r_ec_rec IS RECORD (id NUMBER, table_oid NUMBER, hospital_id NUMBER, ba... |
SELECT
a.*,
GROUP_CONCAT(c2.titre SEPARATOR '|||') AS categtitre,
GROUP_CONCAT(c2.slug SEPARATOR '|||') AS categslug,
u.thename,u.thelogin
FROM
categ c
INNER JOIN categ_has_article cha ON
cha.categ_idcateg = c.idcateg
INNER JOIN article a ON
a.idarticle = cha.article_idarticle
INNER JOIN cat... |
-- 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 may... |
drop TABLE IF EXISTS users CASCADE;
drop TABLE IF EXISTS sessions;
drop TABLE IF EXISTS threads CASCADE;
drop TABLE IF EXISTS posts;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
screen_name VARCHAR(256) NOT NULL UNIQUE,
password VARCHAR(256) NOT NULL
);
CREATE TABLE sessions (
id SERIAL PRI... |
# Host: 127.0.0.1 (Version: 5.0.87-community-nt)
# Date: 2016-03-07 17:26:47
# Generator: MySQL-Front 5.3 (Build 4.13)
/*!40101 SET NAMES utf8 */;
#
# Source for table "admin"
#
CREATE TABLE `admin` (
`Id` int(11) NOT NULL auto_increment,
`username` varchar(255) default NULL,
`password` varchar(255) default... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.