text stringlengths 6 9.38M |
|---|
insert into software (id, name, certified) values (1, 'MegaTravel Accommodation Service', false);
insert into software (id, name, certified) values (2, 'MegaTravel Reservation Service', false);
insert into software (id, name, certified) values (3, 'MegaTravel Agent', false);
insert into software (id, name, certified) v... |
-- MySQL dump 10.13 Distrib 8.0.19, for macos10.15 (x86_64)
--
-- Host: localhost Database: autoapp
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
SET SQLBLANKLINES ON
-- Dec 15, 2008 1:14:17 PM ECT
-- Implementing Subcontract in Manufacturing Management
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocompl... |
--
-- FILE
--
DELIMITER ;;
-- GETTERS
CREATE PROCEDURE get_all_files
()
BEGIN
SELECT *
FROM file
ORDER BY id DESC;
END;;
CREATE PROCEDURE get_all_files_small
()
BEGIN
SELECT id, name
FROM file
ORDER BY id DESC;
END;;
CREATE PROCEDURE get_all_file_ids
()
BEGIN
SELECT id
FROM file
... |
select distinct dependent_ns.nspname dependent_schema
, dependent_view.relname as dependent_view
from pg_depend
join pg_rewrite ON pg_depend.objid = pg_rewrite.oid
join pg_class as dependent_view ON pg_rewrite.ev_class = dependent_view.oid
join pg_class as source_table ON pg_depend.refobjid = source... |
SELECT cohorts.name as cohort, sum(completed_at - started_at) as total_assitance_time
FROM students JOIN cohorts ON cohorts.id = cohort_id
JOIN assistance_requests ON students.id = student_id
GROUP BY cohort
ORDER BY total_assitance_time |
CREATE TRIGGER up_password_check AFTER UPDATE ON "user"
BEGIN
SELECT CASE
WHEN(length(NEW.password) < 6)
THEN RAISE(ABORT, 'Password is too short.')
END;
END;
END;
|
INSERT INTO Employees (name, surname, role) VALUES ('Kazimierz', 'Drozda', 'Tester');
INSERT INTO Employees (name, surname, role) VALUES ('Zbyszek', 'Ptyś', 'Serwisant');
INSERT INTO Employees (name, surname, role) VALUES ('Radek', 'Op', 'Menadzer');
INSERT INTO Computers (model, Ram, Disc, Gpu, customer_note) VALUES ... |
CREATE TABLE WestZodiac (
`id` INTEGER,
`name` VARCHAR(50) UNIQUE,
`image` VARCHAR(200),
PRIMARY KEY(`id`)
);
INSERT INTO `WestZodiac` (id,name,image) VALUES (1,'capricorn','static/images/zodiac/w1_capricorn.jpg'),
(2,'aquarius','static/images/zodiac/w2_aquarius.jpg'),
(3,'pisces','static/images/zodiac/w3_pisces.... |
CREATE DATABASE test CHARACTER SET utf8 COLLATE utf8_general_ci;
USE test;
CREATE TABLE users(
`id` INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(150) NOT NULL,
`email` VARCHAR(150) NOT NULL,
`password` VARCHAR(150) NOT NULL
); |
-- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64)
--
-- Host: localhost Database: recrutement
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... |
DROP TABLE IF EXISTS stats;
CREATE TABLE stats(
id INTEGER PRIMARY KEY AUTOINCREMENT,
board_id INTEGER UNIQUE NOT NULL,
crawl_rate FLOAT NOT NULL,
response_success_count INTEGER NOT NULL,
response_error_count INTEGER NOT NULL,
request_redirect_count INTEGER NOT NULL,
page_load_timeout_count ... |
CREATE TABLE `patients` (
`cust_ID` int(11) NOT NULL,
`Name` varchar(255) NOT NULL,
`Open_date` date NOT NULL,
`Consult_dt` date NOT NULL,
`VAC_ID` char(5) NOT NULL,
`Dr_Name` varchar(45) DEFAULT NULL,
`State` char(5) DEFAULT NULL,
`Country` char(5) NOT NULL,
`DOB` date DEFAULT NULL,
`Active` char... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Хост: localhost:3306
-- Время создания: Апр 24 2020 г., 20:37
-- Версия сервера: 10.1.44-MariaDB-0ubuntu0.18.04.1
-- Версия PHP: 7.2.24-0ubuntu0.18.04.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
SET SESSION SEARCHUIFDBPATH = Rtdsura;
DATABASE Rtdsura;
CALL SYSUIF.REMOVE_FILE('R_cox_train', 1);
CALL SYSUIF.INSTALL_FILE('R_cox_train', 'R_cox_train.r', 'cz!C:\\Users\\rb255002\\Documents\\3. Clientes\\2019\\Colombia\\Suramericana\\ModeloCox\\R_cox_train.r ');
SELECT *
FROM SCRIPT (
ON (select
1,Asegurado_id... |
Select Distinct
sec.section_id,
h.house_name as house_name_full,
split_part(h.house_name, ' - ', 2) as house_name_short
From matviews.ss_cube cube
Inner Join public.students s ON cube.student_id = s.student_id
Inner Join public.sections sec ON cube.section_id = sec.section_id
Inner Join public.houses h on h.hou... |
create database IntCoreTaskDB;
create table users(
id int AUTO_INCREMENT primary key,
name varchar(100) not null,
email varchar(100) not null unique,
password varchar(255) not null
); |
create table sale (
id varchar(36) primary key,
create_date timestamp not null,
total decimal(18, 2) not null
);
create table sale_item (
id varchar(36) primary key,
product_code varchar (255) not null,
product_name varchar (255) not null,
quantity int not null,
price decimal (18,2) not null,
sub_tot... |
/* Is digest summary table representative?
* See https://dev.mysql.com/doc/refman/5.7/en/performance-schema-statement-digests.html ,
* https://dev.mysql.com/doc/refman/5.7/en/statement-summary-tables.html ,
* https://dev.mysql.com/doc/refman/5.7/en/performance-schema-system-variables.html#sysvar_performance_... |
-- ---------------------------------------------------------
-- Team Project for DB1 course, MovinOn Inc DataBase
-- Developed by ZOE Group
-- March 2021
-- ---------------------------------------------------------
USE movinon_zoe;
-- ---------------------------------------------------------
-- Query: 6_SalariedEmploye... |
CREATE SCHEMA IF NOT EXISTS `SYSTEM` DEFAULT CHARACTER SET utf8 ;
USE `SYSTEM` ;
DROP TABLE IF EXISTS `about` ;
CREATE TABLE IF NOT EXISTS `about` (
`ID` CHAR(21) NOT NULL,
`NAME` VARCHAR(128) NOT NULL,
`DESCRIPTION` VARCHAR(1024) NOT NULL,
`STATUS` TINYINT(1) NOT NULL,
`UPDATE_USER` CHAR(21) NOT NULL,
`CR... |
INSERT INTO competence (nom, desc1, desc2, desc3, desc4, categorie, etat)
VALUES ('HTML', 'Connaitre les balises HTML', '...', '...', '...', 'front', 3);
INSERT INTO competence (nom, desc1, desc2, desc3, desc4, categorie, etat)
VALUES ('CSS', 'Connaitre les différentes propriétées', '...', '...', '...', 'front', 2);... |
DROP TABLE IF EXISTS Rooms CASCADE;
CREATE TABLE Rooms (
room_id INTEGER PRIMARY KEY,
room_location TEXT UNIQUE NOT NULL,
room_seating_capacity INTEGER NOT NULL,
CHECK(room_seating_capacity >= 0)
); |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.6.17 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 9.3.0.5048
-- -------------------------------------------------------... |
SELECT * FROM rooms
WHERE (user1 = $1 AND user2 = $2)
OR (user1 = $2 AND user2 = $1); |
INSERT INTO `wallet`.`user` (`active`, `balance`, `email`, `firstname`, `lastname`, `password`)
VALUES (1, '1000', 'email1', 'fname1', 'lname1', 'pass1');
INSERT INTO `wallet`.`user` (`active`, `balance`, `email`, `firstname`, `lastname`, `password`)
VALUES (1, '2000', 'email2', 'fname2', 'lname2', 'pass2... |
CREATE TABLE IF NOT EXISTS links (
slug VARCHAR(55),
link VARCHAR(105),
visits INTEGER,
created_at TIMESTAMPTZ
) |
2018-10-17 11:00:10
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.520ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.080ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and... |
create dbgraph flights into 'flights.dex'
LOAD NODES './src/test/resources/data/a.txt'
COLUMNS id
INTO A
FIELDS TERMINATED '|'
mode rows
LOAD NODES './src/test/resources/data/b.txt'
COLUMNS id
INTO B
FIELDS TERMINATED '|'
mode rows
LOAD NODES './src/test/resources/data/Document.txt'
COLUMNS id, body
INTO Docum... |
-- Cкрипты характерных выборок
USE u_m_c;
-- Выборка Имени рабочего и его должности(скрипт характерных выборок, включающий группировку)
SELECT
w.firstname, w.lastname,
p.position
FROM
`worker` as w,
`profiles` as p
WHERE w.id = p.user_id
ORDER BY w.id;
-- скрипт выборки: сколько мужчин на каждой должности (c... |
CREATE DATABASE IF NOT EXISTS `travis` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `travis`; |
select
*
from dbtorneos t
inner
join tbtipotorneo tp
on t.reftipotorneo = tp.idtipotorneo
where t.Activo = 1 and tp.descripciontorneo like '%5%' |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 15, 2017 at 04:12 PM
-- Server version: 5.7.17
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: university
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ... |
USE `movieDB`;
#1.a)List all the actors who acted in at least one film in 2nd half of the 19th century and in at least one film in
#the 1st half of the 20th century
SELECT fName, lName
FROM Actor AS a, Movie AS m1, Movie AS m2, Cast AS c1, Cast AS c2
WHERE c1. mID = m1.id
AND c1.pID = a.id
AND m1.releaseyear BETWEEN ... |
insert into category (description) VALUEs ('American');
insert into category (description) values ('Japanse');
insert into unit_of_measure (description) values ('Cafe');
insert into unit_of_measure (description) values ('meal'); |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 13-11-2018 a las 06:11:24
-- Versión del servidor: 10.1.36-MariaDB
-- Versión de PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
use hab;
-- Provincias Spain como location
insert into location (id, name)
values
(2,'Albacete'),
(3,'Alicante/Alacant'),
(4,'Almería'),
(1,'Araba/Álava'),
(33,'Asturias'),
(5,'Ávila'),
(6,'Badajoz'),
(7,'Balears, Illes'),
(8,'Barcelona'),
(48,'Bizkaia'),
(9,'Burgos'),
(10,'Cáceres'),
(11,'Cádiz'),
(39,'... |
DROP DATABASE IF EXISTS langner;
CREATE DATABASE langner;
CREATE OR REPLACE USER 'langner_admin'@'localhost' IDENTIFIED BY 'qwerty123';
GRANT ALL PRIVILEGES ON langner.* TO langner_admin;
FLUSH PRIVILEGES;
USE langner;
# CREATE OR REPLACE TABLE Invoices (
# invoiceId int NOT NULL AUTO_INCREMENT PRIMARY... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50718
Source Host : localhost:3306
Source Database : shop
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2021-10-31 00:45:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
CREATE TABLE `events`(
`event_id` int(10) unsigned AUTO_INCREMENT,
`title` varchar(256) default null,
`event_date` timestamp default CURRENT_TIMESTAMP,
PRIMARY KEY(`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `person`(
`person_id` int(10) unsigned AUTO_INCREMENT,
`age` int default 0,
`f... |
Create Procedure sp_get_Count_Recd_Items
As
Select Distinct Count(ForumCode) From ItemsReceivedDetail
Where Flag & 32 = 0
|
--webhook
create table if not exists webhook(
idwh int not null primary key auto_increment,
url varchar(100),
entityname varchar(50),
eventtype varchar(50)
);
--advertisementsize
create table if not exists ad_size(
id_size int not null primary key auto_increment,
id_ad int not null,
url varchar(100),
size varchar(50)... |
create table cafes_bebidos(
id INTEGER PRIMARY KEY autoincrement,
data_hora datetime not null
) |
-- 18-ago-2009 18:11:44 ECT
-- Bug 2839967 - Cannot change IsInPayroll
UPDATE AD_Column SET DefaultValue='N', IsMandatory='Y',Updated=TO_DATE('2009-08-18 18:11:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56294
;
ALTER TABLE AD_User MODIFY IsInPayroll CHAR(1) DEFAULT 'N'
;
UPDATE AD_User SET ... |
select categories.name, sum(products.amount)
from products
join categories
on products.id_categories = categories.id
group by categories.name
|
SET NAMES UTF8;
DROP DATABASE IF EXISTS jd;
CREATE DATABASE jd CHARSET=UTF8;
USE jd;
CREATE TABLE product (
pid INT PRIMARY KEY AUTO_INCREMENT,
pname VARCHAR(32),
price FLOAT(10,2), #99999999.99
pic VARCHAR(64),
birthday BIGINT
);
INSERT INTO product VALUES(
NULL,'可口可乐', '3.50','img/1.jpg','12133242432343... |
-- Insert some data to brand table
insert into brand(brand_code, address, name) values('ADIDAS', 'GERMANY', 'ADIDAS');
-- insert some data to product catalogue table
insert into product_catalogue(catalogue_code, catalogue_name, catalogue_type) values('ADIDAS_01', 'Fashion', 0);
-- insert some data to product table
inse... |
/*
SQLyog Ultimate v10.00 Beta1
MySQL - 5.5.36
说明:删除不需要的数据和添加一个唯一索引
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
DELETE FROM sys_area WHERE NAME = '钓鱼岛';
ALTER TABLE `elearning`.`sys_area` ADD UNIQUE INDEX `UNIQUE` (`no`);
|
use employees;
-- Query for employee table
select * from employees;
|
CREATE TABLE `acta_entrega_equipo` (
`id_acta_entrega_equipo` int(11) NOT NULL AUTO_INCREMENT,
`id_acta_entrega` int(11) NOT NULL,
`nombre` varchar(45) NOT NULL,
`id_equipo` int(11) NOT NULL,
PRIMARY KEY (`id_acta_entrega_equipo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `acta_entrega` (
`id_ac... |
create database shop;
use shop;
set names utf8;
drop table if exists shop_goods;
create table shop_goods(
id mediumint unsigned not null auto_increment comment 'Id',
goods_name varchar(150) not null comment '商品名称',
market_price decimal(10,2) not null comment '市场价格',
shop_price decimal(10,2) not null comment '本店价格... |
-- MySQL Workbench Forward Engineering
DROP DATABASE `BDVeg`;
CREATE DATABASE `BDVeg` IF NOT EXISTS
USE DATABASE `BDVeg`
-- -----------------------------------------------------
-- Table `Usuario`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `Usuario` ;
CREATE TABLE IF NOT EXISTS `Us... |
CREATE Procedure sp_get_BillList
(@VENDORID NVARCHAR (15),
@FROMDATE DATETIME,
@TODATE DATETIME,
@ITEMCODE nvarchar(15))
AS
SELECT BillAbstract.BillID, BillDate, DocumentID, InvoiceReference
from BillAbstract, BillDetail
where BillAbstract.BillID = BillDetail.Bil... |
CREATE procedure sp_ser_CheckTaskIDExists(@JobCardID int,@TaskID nvarchar(255),@ProductCode nvarchar(15),
@Item_spec1 nvarchar(255))
As
select serialNo from JobCardTaskAllocation
where TaskID = @TaskID and JobCardID = @JobCardID
and isNull(TaskStatus,0) in (0,1,2)
... |
-- -----------------------------------------------------------------------------
-- table 'nutzungsplanung_ueberlagernd_linie' with thema 'Nutzungsplanung', subthema 'ch.SO.NutzungsplanungUeberlagernd' and geometry 'linie'
DELETE FROM ${dbSchema}.oerebwms_nutzungsplanung_ueberlagernd_linie;
INSERT INTO ${dbSchema}.oere... |
-- Disable referential integrity checks for altering the DB
SET REFERENTIAL_INTEGRITY FALSE;
-- Disable Log to get a bit more Speedup
SET LOG 0;
-- Disable UndoLog to get a bit more Speedup
SET UNDO_LOG 0;
CREATE TABLE IF NOT EXISTS "BatchRuns" (
"ProcessID" int(11) NOT NULL AUTO_INCREMENT,
"JobID" in... |
//Create keyspace
CREATE KEYSPACE IF NOT EXISTS ClickstreamKeySpace WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};
//Create table
CREATE TABLE ClickstreamKeySpace.UserStatus (userId text, lastSessionId text, cartAmount double, lastVisitTime timestamp,PRIMARY KEY (userId));
//Select from tabl... |
select TermName, DistrictName, StudentID, Grade, Discipline, TestType, TestRITScore,TestPercentile, ProjectedProficiencyLevel1,ProjectedProficiencyLevel2,SBACScore,
CASE when
RNotOnTrck9 is TRUE THEN SBACScore =
(select TermName, DistrictName, StudentID, Grade, Discipline, TestType, TestRITScore,TestPercentile, Pro... |
ALTER TABLE TicketTypes CHANGE baseCost cost DECIMAL(15,2) NOT NULL;
ALTER TABLE TicketTypes ADD availableFrom DATETIME NULL;
ALTER TABLE TicketTypes ADD availableUntil DATETIME NULL;
ALTER TABLE TicketTypes ADD parentTicketTypeId INT NULL;
ALTER TABLE TicketTypes
ADD CONSTRAINT TicketTypes_TicketTypes_id_fk
FOREIGN ... |
/*
Skills used: Joins, CTE's, Temp Tables, Windows Functions, Aggregate Functions, Creating Views, Converting Data Types
*/
Select *
From PortfolioProject..CovidDeaths
Where continent is not null
order by 3,4
Select location, SUM(cast(new_deaths as int)) as TotalDeathCount
From PortfolioProject..CovidDeath... |
/* Создание таблицы сессий */
CREATE TABLE /*PREFIX*/SESSIONS
(
SESSION_ID VARCHAR(32) NOT NULL,
ACCOUNT_ID VARCHAR(32) NOT NULL,
APPLICATION_ID VARCHAR(32) NOT NULL,
DATE_CREATE TIMESTAMP NOT NULL,
DATE_CHANGE TIMESTAMP NOT NULL,
PARAMS BLOB,
PRIMARY KEY (SESSION_ID),
FOREIGN KEY (ACCOUNT_ID) REFERENC... |
CREATE TABLE
SEC_ACTION
(
ID VARCHAR(32) NOT NULL,
NAME VARCHAR(255) NOT NULL,
CODE VARCHAR(64) NOT NULL,
DESCR VARCHAR(255),
PRIMARY KEY (ID)
);
CREATE TABLE
SEC_DUTY
(
ID VARCHAR(32) NOT NULL,
NAME VARCHAR(255),
ST... |
BEGIN TRANSACTION;
INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userfriends`;
COMMIT;
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 19, 2019 at 01:39 AM
-- Server version: 5.7.24
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 02-Abr-2017 às 16:12
-- Versão do servidor: 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 */... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Час створення: Сер 28 2016 р., 00:31
-- Версія сервера: 5.7.11
-- Версія PHP: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
SELECT name, population, area
FROM World
WHERE area>3000000 OR population>25000000; |
DROP TABLE Operateur CASCADE CONSTRAINT;
DROP TABLE Machine CASCADE CONSTRAINT;
DROP TABLE Piece CASCADE CONSTRAINT;
DROP TABLE Qualifie_sur CASCADE CONSTRAINT;
CREATE TABLE Operateur
(
numero CHARACTER(4) primary key,
nom CHARACTER(15),
age NUMERIC(2)
);
CREATE TABLE Machine
(
referenceM CHARACTER(3) primary key... |
CREATE OR REPLACE PACKAGE pkg_unit_testing
IS
PROCEDURE prc_add_department_test;
PROCEDURE prc_adjust_dep_test;
PROCEDURE prc_remove_department_test;
PROCEDURE prc_add_employee_test;
PROCEDURE prc_adjust_emp_test;
PROCEDURE prc_remove_employee_test;
END;
/ |
CREATE OR REPLACE TYPE plch_tool_names_t
IS TABLE OF VARCHAR2 (100)
/
DECLARE
TYPE plch_tool_names_t IS TABLE OF VARCHAR2 (100);
t_plch_tool plch_tool_names_t;
BEGIN
t_plch_tool := plch_tool_names_t('abc','def','ghi');
FOR i IN 1..t_plch_tool.COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(t_plch_tool(... |
INSERT INTO `job_grades` (`job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES
('brasseur', 0, 'employee', 'employer', 50, '{}', '{}'),
INSERT INTO `jobs` (`name`, `label`, `whitelisted`) VALUES
('brasseur', 'Brasseur', 0);
INSERT INTO `items` (`name`, `label`) VALUES
('orge', 'orge germ... |
create table NOTICE
(
ID BIGINT auto_increment,
NOTIFIER BIGINT not null,
RECEIVER BIGINT not null,
OUTERID BIGINT not null,
TYPE INT not null,
GMT_CREATE BIGINT not null,
STATUS INT default 0,
NOTIFIER_NAME VARCHAR(100),
OUTER_TITLE ... |
create table member_tx(
num number constraint member_tx_num_pk primary key,
id varchar2(20) constraint member_tx_id_nn not null,
password varchar2(20),
name varchar2(35),
address varchar2(100),
constraint member_tx_id_uq unique(id));
create sequence member_tx_seq
increment by 1
start with 1;
create table customer_... |
create database assignment6;
use assignment6;
Create table EMP ( EMPNO numeric(4) not null, ENAME varchar(30) not null, JOB varchar(10), MGR numeric(4),
HIREDATE date, SAL numeric(7,2), DEPTNO numeric(2) );
Insert into EMP (EMPNO ,ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO ) values(1000, 'Manish' , 'SALESMAN', 1003... |
CREATE TABLE random_points_gistindex_10000
(
id serial NOT NULL,
geom geometry,
CONSTRAINT random_points_gistindex_10000_pk PRIMARY KEY (id),
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text OR geom IS NULL),
CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 4326)
) WITH (OIDS=FALSE... |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 20, 2015 at 11:09 AM
-- Server version: 5.5.25
-- PHP Version: 5.3.13
-- --------------------------------------------------------
--
-- Table structure for table `test_config`
--
CREATE TABLE `test_conf... |
INSERT INTO BAND (name, region, pricePerHour, rate) VALUES('Eufory', 3, 200000.00, 7.4);
INSERT INTO band_styles (idBand, style) VALUES((SELECT id FROM BAND WHERE name = 'Eufory'), 3);
INSERT INTO band_styles (idBand, style) VALUES((SELECT id FROM BAND WHERE name = 'Eufory'), 2);
INSERT INTO band_styles (idBand, style)... |
use employees;
-- Выбрать среднюю зарплату по отделам.
select salaries.salary, departments.dept_no, avg(salary) from salaries
join dept_emp on salaries.emp_no = dept_emp.emp_no
join departments on dept_emp.dept_no = departments.dept_no
group by dept_no;
-- Выбрать максимальную зарплату у сотрудника.
select first... |
USE UNIVERSITY
/* Write the SQL query to determine which students were born after November 5, 1996 */
SELECT StudentFName, StudentLName
FROM tblSTUDENT
WHERE StudentBirth > '1996-11-05'
/* Write the SQL query to determine which buildings are on West Campus. */
SELECT BuildingName
FROM tblBUILDING B
JOIN tblLOCATIO... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2017-05-17 01:13:58
-- 服务器版本: 5.7.15
-- PHP Version: 7.0.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET... |
DROP DATABASE IF EXISTS UCSS;
CREATE DATABASE UCSS;
USE UCSS;
DROP TABLE IF EXISTS ADMIN;
CREATE TABLE ADMIN (
username VARCHAR(20) PRIMARY KEY NOT NULL,
password VARCHAR(50) NOT NULL
);
DROP TABLE IF EXISTS USER;
CREATE TABLE USER (
username VARCHAR(20) PRIMARY KEY NOT NULL,
password VARCHAR(50) NOT... |
DROP TABLE `users_stripe_token`; |
CREATE TABLE IF NOT EXISTS likes
(
like_id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL,
count BIGINT UNSIGNED DEFAULT 0,
created_data TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
entry_id BIGINT UNSIGNED NOT NULL,
account_id BIGINT UNSIGNED NOT... |
-- ユーザ
DROP TABLE APP_USER IF EXISTS;
CREATE TABLE IF NOT EXISTS APP_USER ( ID INT NOT NULL AUTO_INCREMENT, USER_NAME VARCHAR(20) NOT NULL , SEX VARCHAR(20) NOT NULL);
-- お気に入り
DROP TABLE FAVORITE IF EXISTS;
CREATE TABLE IF NOT EXISTS FAVORITE ( USER_ID INT NOT NULL, LUNCH_ID INT NOT NULL, FAVORITE_DATE DATE, PRIMAR... |
INSERT INTO receiptdrugs VALUES (1, 14, 1);
INSERT INTO receiptdrugs VALUES (1, 66, 1);
INSERT INTO receiptdrugs VALUES (1, 85, 1);
INSERT INTO receiptdrugs VALUES (2, 14, 1);
INSERT INTO receiptdrugs VALUES (2, 18, 1);
INSERT INTO receiptdrugs VALUES (2, 19, 1);
INSERT INTO receiptdrugs VALUES (2, 41, 1);
INSERT INTO ... |
Create table Nudges (
Id int,
Result int,
UserPreferedTransportationType int,
ActualTransportationType int,
SkyCoverage int,
Road int,
Temperature int,
Wind int,
Precipitation int
);
|
create database censusDB;
use censusDB;
create table demographics(
date varchar(255) NOT NULL,
time varchar(255) NOT NULL,
cardID varchar(255),
age varchar(255),
gender varchar(255),
income varchar(255),
education varchar(255),
postcode varchar(255),
duration varchar(255),
PRIMARY KEY (date, time)
);
create... |
create table tbl_movie_category(
category_id int unsigned auto_increment,
category_name varchar(100) not null,
category_desc varchar(250) default "Sin descripción",
primary key(category_id),
unique u_category(category_name)
);CREATE DATABASE `moviesdb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE ... |
insert into USER VALUES
(
100000,
'Brian',
'Fantana',
'arithmetic@gmail.com',
'8a17f7a49320d8b43862253d70da43c839cc164c517903007dc38f6ed163126b118e4e723fe7a14c5f50bfdcfafa51777a6d98122131b4ba01af0214487fbabf',
'10001',
'New York',
'NY',
'Hey I am en entrepreneur!',
null,
nul... |
--Write a SQL statement that changes the password to NULL for all users that have not been in the system since 10.03.2010.
UPDATE Users
SET Password = 'NULL'
WHERE [Login Time] < CONVERT(DATETIME, '2010-03-10') |
select table_name from all_all_tables where table_name like '%YS%';
select * from YS_AP_USER;
select * from YS_PATCHBOLT_IMG order by crt_date desc;
select * from YS_PATCHBOLT_IMG_Practise order by crt_date desc;
--drop table YS_PATCHBOLT_IMG_Practise;
select * from YS_AP_BANK_LEVEL;
select * from YS_AP_SALES_RISKLEVEL... |
-- using sub queries
-- in this case sub query "sub_q"
-- the sub query gets as atribute name as it is printed in the subprocess
-- like in this case titulo
SELECT tv_shows.title FROM tv_shows
LEFT JOIN
(SELECT tv_shows.title FROM tv_genres
JOIN tv_show_genres ON tv_show_genres.genre_id = tv_genres.id
JOIN tv_shows ON ... |
DROP DATABASE IF EXISTS cycletrak;
CREATE DATABASE cycletrak;
USE cycletrak;
CREATE TABLE stores(
-- states will be hard-coded in the front-end
id int primary key auto_increment,
location_name varchar(100) not null,
address1 varchar(150) not null,
address2 varchar(150),
city varchar(100) no... |
create table space_properties (space_id int8 not null, properties_id int8 not null);
alter table bug add column bug_id_alt varchar(32);
alter table bug add column cvss_score float4;
alter table bug add column cvss_vector varchar(100);
alter table bug add column cvss_version varchar(5);
alter table bug add column ma... |
insert into AspNetUserRoles values ('26d67c9b-d720-49c7-a57b-2af3419dc5db',1)
select * from AspNetUserRoles |
-- phpMyAdmin SQL Dump
-- version 4.7.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 15, 2018 at 05:47 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.0.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
SELECT * FROM `persons`
WHERE username = "chiroptical"
|
col begin_interval_time format a30
set linesize 200 trimspool on
set pagesize 60
select
s.begin_interval_time
--, d.instance_number
, sum(itl_waits_delta) itl_waits_delta
, sum(row_lock_waits_delta) row_lock_waits_delta
from dba_hist_seg_stat d
join dba_hist_snapshot s on s.snap_id = d.snap_id
and s.instance_n... |
CREATE OR REPLACE TYPE split_type IS TABLE OF VARCHAR2 (50);
create or replace function SPLITSTR
(
p_str in varchar2,
p_delimiter in varchar2
) return split_type is
j int := 0;
i int := 1;
len int := 0;
len1 int := 0;
str varchar2(4000);
my_split split_type... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.