text stringlengths 6 9.38M |
|---|
drop table Vozila;
drop table Linije;
drop table Smjene;
drop table Vozaci;
drop view VozaciVozila;
drop view TramvajskeLinije;
drop view AutobuskeLinije;
drop view TrolejbuskeLinije;
drop view AutobuskeTrolejbuskeStanice;
drop view AutobuskeTramvajskeStanice;
drop view Tramvaj2;
drop view VozacLinije1I10;
drop view Li... |
ALTER TABLE PROTOCOL_CORRESPONDENCE ADD CREATE_TIMESTAMP DATE
/
ALTER TABLE PROTOCOL_CORRESPONDENCE ADD CREATE_USER VARCHAR2(60)
/
ALTER TABLE PROTOCOL_CORRESPONDENCE ADD FINAL_FLAG_TIMESTAMP DATE
/
|
/* 1. Insert the following new client to the clients table:
Tony, Stark, tony@starkent.com, Iam1ronM@n, "I am the real Ironman" */
INSERT INTO clients (clientFirstname, clientLastname, clientEmail,clientPassword, comments)
VALUES ('Tony', 'Stark', 'tony@starkent.com', 'Iam1ronM@n', "I am the real Ironman");
/* 2. M... |
/**
* SQL for getting favorite shisetsu information
* @author PhuongTT7
* @version $Id: SukHeaderFooterInfoService_getFavoriteShisetsuRecordNumber_Sel_01.sql 15711 2014-07-21 10:23:20Z p_guen_rippu $
*/
SELECT FCFS.SHISETSU_CD
FROM FR_CUSTOMER_FAVORITE_SHISETSU FCFS
WHERE FCFS.CUSTOMER_IDENTIFY_ID = /*customerIdent... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 16, 2019 at 03:48 PM
-- Server version: 5.7.20
-- PHP Version: 7.1.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Database: `rescue_de... |
DROP TABLE USER_ACCOUNT CASCADE CONSTRAINTS;
DROP TABLE USER_ROLE CASCADE CONSTRAINTS;
DROP TABLE OLYMPICS CASCADE CONSTRAINTS;
DROP TABLE SPORT CASCADE CONSTRAINTS;
DROP TABLE PARTICIPANT CASCADE CONSTRAINTS;
DROP TABLE COUNTRY CASCADE CONSTRAINTS;
DROP TABLE TEAM CASCADE CONSTRAINTS;
DROP TABLE TEAM_MEMBER CASCADE CO... |
use mysql;
select host, user from user ;
# create carbonuser privilege
set global time_zone ='+8:00';
create user carbonuser identified by 'Carbon@mysqlUser';
grant all on carbonuser.* to carbonuser@'%' identified by 'Carbon@mysqlUser' with grant option;
# create carbonface privilege
create user carbonface identified b... |
-- !Ups
create table if not exists game_credentials (
game_id varchar(255) not null unique references game_tables(game_id) on delete cascade,
game_secret varchar(255) not null
);
create table if not exists game_user_credentials (
user_id varchar(255) not null,
game_id varchar(255) not null references ... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 19, 2015 at 06:54 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
INSERT INTO public.students (id, coins, user_id) VALUES (1, 10, 1);
INSERT INTO public.students (id, coins, user_id) VALUES (2, 11, 2);
INSERT INTO public.students (id, coins, user_id) VALUES (3, 12, 3);
INSERT INTO public.students (id, coins, user_id) VALUES (4, 14, 4); |
rem Create the foodmart schema
rem
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to you under the Apache License, Vers... |
ALTER TABLE system_setting ADD COLUMN gui_preset text;
COMMENT ON COLUMN "system_setting"."gui_preset" IS 'Choose from configured gui from the array config.gui_preset';
|
create table ac_user (
id bigint auto_increment,
login_name varchar(64) not null unique,
name varchar(64) not null,
password varchar(255) not null,
salt varchar(64) not null,
roles varchar(255) not null,
registerdate timestamp not null default 0,
primary key (id)
) engine=InnoDB; |
use empresa;
select * from funcionario;
select * from departamento;
select * from projeto;
select * from trabalha_em;
/* Recupere o nome e o sobrenome dos funcionários que trabalham no departamento de pesquisa */
-- Junção
SELECT
pnome, func.nome
FROM
funcionario func,
departamento dep
WHERE
dnumero ... |
-- Создайте представление, которое выводит название name товарной позиции из таблицы products и соответствующее название каталога name из таблицы catalogs.
use shop;
create or replace view name_plus_catalog as (
select products.name as product_name, catalogs.name as catalog_name from products
join
catalogs
on
... |
+insert into user(user_email,user_password,user_name,user_balance,role_name)
+values('user1@com', '111','name1',100, 'admin');
+insert into user(user_email,user_password,user_name,user_balance,role_name)
+values('user2@com', '222','name2',200,'user');
+insert into user(user_email,user_password,user_name,user_bala... |
DROP DATABASE IF EXISTS dbAntiques;
CREATE DATABASE dbAntiques;
USE dbAntiques;
CREATE TABLE Category (
categoryID tinyint PRIMARY KEY NOT NULL,
cDesc varchar(25)
) ENGINE = InnoDB;
CREATE TABLE Product (
productID integer(5) PRIMARY KEY NOT NULL,
categoryID tinyint NOT NULL,
pName varchar(40),
pPrice... |
SELECT NationalIDNumber
FROM HumanResources.Employee
SELECT NationalIDNumber, JobTitle
FROM HumanResources.Employee
SELECT TOP 20 PERCENT
NationalIDNumber, JobTitle, BirthDate
FROM HumanResources.Employee
SELECT TOP 500 NationalIDNumber AS "SSN",
JobTitle AS "Job Title",
BirthDate
FROM HumanResources.Employee
... |
USE test;
DROP TABLE IF EXISTS part;
CREATE TABLE part(
id INT(11) NOT NULL AUTO_INCREMENT,
PartName varchar(255),
IsNecessary bit,
Amount int,
PRIMARY KEY (id))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
INSERT INTO part (PartName, IsNecessary, Amount)
VALUES ("материнская плата", 1, 3),
("звуковая карта", 0... |
CREATE TABLE IF NOT EXISTS comments
(
id BIGSERIAL NOT NULL,
text TEXT NOT NULL,
article_id BIGINT,
author_id BIGINT,
created TIMESTAMP,
updated TIMESTAMP,
PRIMARY KEY (id)
);
ALTER TABLE comments
DROP CONSTRAINT IF EXISTS author_id_foreign_key_from_users;
ALT... |
-- public.restaurante definition
-- Drop table
-- DROP TABLE public.restaurante;
CREATE TABLE public.restaurante (
id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
cnpj varchar(255) NULL,
dataatualizacao timestamp NULL,
datacriacao timestamp NULL,
nome varchar(255) NULL,
proprietario varchar(255) NULL,
loc... |
-- 添加秒杀商品表数据
INSERT INTO commodity (title, price, stock) VALUES('Apple/苹果 iPhone 6s Plus 国行原装苹果6sp 5.5寸全网通4G手机', 2600.00, 10);
INSERT INTO commodity (title, price, stock) VALUES('ins新款连帽毛领棉袄宽松棉衣女冬外套学生棉服', 200.00, 10);
INSERT INTO commodity (title, price, stock) VALUES('可爱超萌兔子毛绒玩具垂耳兔公仔布娃娃睡觉抱女孩玩偶大号女生 ', 160.00, 200);
|
-- This is Comment
CREATE DATABASE sample OWNER student ENCODING 'UTF8';
CREATE TABLE emp( code INTEGER PRIMARY KEY, name TEXT, age INTEGER, tel TEXT);
INSERT INTO emp VALUES (1,'鈴木',30,'03-1111-1111'),
(2,'佐藤',28,'043-2222-2222'),
(3,'田中',46,'05-3333-3333'),
... |
-- noinspection SqlNoDataSourceInspectionForFile
DROP TABLE IF EXISTS USR CASCADE;
DROP TABLE IF EXISTS ROLE_R CASCADE;
DROP TABLE IF EXISTS ASSIGNED_ROLE CASCADE;
DROP TABLE IF EXISTS PROBLEM CASCADE;
DROP TABLE IF EXISTS PROBLEM_STATUS CASCADE;
DROP TABLE IF EXISTS PROBLEM_MESSAGE CASCADE;
DROP TABLE IF EXISTS SUITA... |
CREATE TABLE customer (
id serial NOT NULL PRIMARY KEY,
first_name varchar(25) NOT NULL,
last_name varchar(25) NOT NULL,
email varchar(100) NOT NULL,
password varchar(30) NOT NULL,
level int(1) NOT_NULL
);
CREATE TABLE category (
id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(15) NOT NULL
);
CREATE TABL... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 10-08-2020 a las 04:10:32
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: lovely
-- ------------------------------------------------------
-- Server version 5.6.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
-- EpisodeOfCare
SELECT setval('episodeofcare_episode_id_seq', COALESCE((SELECT MAX(episode_id)+1 FROM episodeofcare), 1), false)
WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
SELECT setval('episodeofcareidentifier_episode_identifier_id_seq', COALESCE((SELECT MAX(episode_identifier_id)+1 FROM epis... |
CREATE TABLE airports
( faa text primary key,
name text not null,
tzone text not null
);
CREATE TABLE airlines(
carrier text primary key,
name text not null
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE carrier (
carrier text primary key,
name text not null
);
CREATE TABLE passengers (
flig... |
CREATE TABLE users (
id SERIAL PRIMARY KEY,
user_name VARCHAR(50) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
user_password VARCHAR(255) NOT NULL,
bmi NUMERIC DEFAULT 0
);
CREATE TABLE meals (
id SERIAL PRIMARY KEY,
user_id INT REFERENCES users(id) ON DELETE CASCADE,
created_date TIMESTAMP DEFAULT N... |
drop procedure if exists GetStudents;
delimiter $$;
create procedure GetStudents(
in intId int,
in strLrn varchar(100),
in strLastName varchar(100),
in strFirstName varchar(100),
in strMiddleName varchar(100),
in intGradeAndSectionId int,
in strCurrentSectionName varchar(100),
in intGra... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 04, 2021 at 10:46 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
SELECT SERVERNAME = CONVERT(NVARCHAR(128),SERVERPROPERTY('SERVERNAME'))
,LOCAL_NET_ADDRESS AS 'IPAddressOfSQLServer'
,CLIENT_NET_ADDRESS AS 'ClientIPAddress'
--, NETBIOS = CONVERT(NVARCHAR(128),SERVERPROPERTY('COMPUTERNAMEPHYSICALNETBIOS'))
--, [MAXDOP] = (SELECT VALUE_IN_USE FROM SYS.CONFIGURATIONS WHERE NAME='M... |
CREATE table noticias (
title VARCHAR ( 100 ) NOT NULL,
description VARCHAR ( 255 ) NOT NULL
);
|
SELECT * FROM `login` WHERE `id` = ?;
|
drop table if exists acooper.membertimeseries_population_deduped_online_07212017;
create table acooper.membertimeseries_population_deduped_online_07212017 as
select * from (
select
enterprise_id
, ent_first_name
, ent_last_name
, age
, race
, gender
, ... |
create table doctor (
doc_id int primary key,
doc_name varchar(128) not null,
doc_gender varchar(10) ,
doc_state varchar(128) ,
doc_city varchar(128) ,
doc_rating varchar(128) ,
doc_address1 varchar(128) ,
doc_address2 varchar(128) ,
doc_practice_name varchar(128) ,
doc_specialty_name varchar(128) ,
doc_s... |
select * from photo_post order by CREATION_DATE asc;
select * from photo_post where user_id=1;
select * from photo_post where (user_id=1) and (creation_date='2019-05-01');
select * from photo_post where (user_id=1) and (description like '%hello%');
select photo_post.user_id, name from photo_post
left join user
on pho... |
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Webmark database link
--
------------------------------------------------------------------------------
prompt Database link to example
-- Drop link i... |
INSERT INTO WORKER
(ID,FIRST_NAME,LAST_NAME,START_DATE,POSITION_ID)
VALUES
(1,'Homer', 'Simpson', TO_DATE('23.05.1996','dd.mm.yyyy'), 1)
/
INSERT INTO WORKER
(ID,FIRST_NAME,LAST_NAME,START_DATE,POSITION_ID)
VALUES
(2,'Ned', 'Flanders', TO_DATE('21.03.1999','dd.mm.yyyy'), 2)
/
INSERT INTO WORKER
(ID,FIRST_NAM... |
CREATE OR REPLACE VIEW verified_group AS
SELECT research_item as research_item,
g.id as "group"
FROM verify v
JOIN research_entity re on v.research_entity = re.id
JOIN "group" g on re.id = g.research_entity; |
use empresa;
CREATE VIEW visao1 AS SELECT 'Brasil' AS pais, 'MG' AS estado, 'Juiz de Fora' AS cidade;
select * from visao1;
-- Nem precisa criar uma view
select 'miria' as nome, 'rua a' as endereco, '123456' as cpf, 'juiz de fora' as cidade;
/* Recuperar os funcionários e o nome dos projetos em que eles trabalham *... |
USE Student;
/* Priority is how necessary the course is to the program with 1 being the highest, 2 being being less, and so forth. */
CREATE TABLE Program1(Semester int, CourseCode VARCHAR(10), Priority int);
INSERT INTO Program1 VALUES( 1, "SWS-110", 1);
INSERT INTO Program1 VALUES( 1, "BUS-110", 5);
INSERT INTO Pr... |
SELECT
'Ventas' AS clas,
IEAN AS EAN,
ICOD AS MODELO,
IDESCR AS DESCRIPCION,
FAM2.FAMDESCR AS DEPARTAMENTO,
AICANTF AS pzas,
AICOSTO AS COSTO,
AICOSTO * AICANTF AS COSTO_TOTAL,
AIPRECIO AS PRECIO,
AIPRECIO * 1.16 AS 'Precio con IVA',
AIPRECIO * 1.16 AS PRECIO_C_IVA,ROUND((AICANTF*AIPRECIO)+(IF(IPORCIVA=0,(AI... |
/*https://platform.stratascratch.com/coding-question?id=10003&python=*/
select * from lyft_drivers
where yearly_salary <= 30000
or yearly_salary >70000; |
--
-- テーブルの構造 `downloadlog`
--
--
CREATE TABLE `downloadlog` (
`downloadlog_id` int(11) unsigned NOT NULL DEFAULT '0',
`upload_id` int(11) unsigned NOT NULL DEFAULT '0',
`room_id` int(11) NOT NULL DEFAULT '0',
`module_id` int(11) NOT NULL DEFAULT '0',
`unique_id` v... |
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.20-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION ... |
-- phpMyAdmin SQL Dump
-- version 4.7.5
-- https://www.phpmyadmin.net/
--
-- Host: db
-- Generation Time: 26 Mai 2018 la 13:32
-- Versiune server: 5.6.38
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
INSERT INTO ESPECTACULO VALUES (961,'003 y medio','2','1979','1979-1980');
INSERT INTO ESPECTACULO VALUES (1612,'10 + 2','2','1994','1994-2004');
INSERT INTO ESPECTACULO VALUES (4617,'13 x 13','2','1987','1987-1988');
INSERT INTO ESPECTACULO VALUES (4627,'Stress de primavera','7','1989',NULL);
INSERT INTO ESPECTACULO V... |
set hive.cli.print.header=true;
SELECT
rank() over (ORDER BY agg.avg_rank ASC) as rank,
agg.state AS state,
agg.agg_score AS agg_score,
agg.avg_score AS avg_score,
agg.score_stddev AS score_stddev
FROM
(SELECT
r.state,
avg(r.rank) as avg_rank,
avg(r.m_avg) as avg_score,
sum(r.m_sum) as agg_s... |
CREATE TABLE payments
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_email VARCHAR(512),
amount FLOAT,
confirmed BOOLEAN,
timestamp TIME
);
|
-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 22, 2014 at 08:57 PM
-- Server version: 5.1.57
-- PHP Version: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `a4503372_users`
--
-- ------------------------------------------------------... |
-- These changes stand in the course of a revision of the ISO processing
-- workflow. They serve the integration of pool stock sample creation processes
-- and some unifications and generalizations (to make ISO processing
-- independent from experiment metadata types). To this end, we also introduce
-- some more polymo... |
insert into user values(10001,sysdate(),'user1')
insert into user values(10002,sysdate(),'user2')
insert into user values(10003,sysdate(),'user3')
insert into post(id,description,user_id) values(11000,'My First POst',10001)
insert into post(id,description,user_id) values(11001,'My Second POst',10001)
insert into post(... |
CREATE TABLE `acos` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`parent_id` int(10) DEFAULT NULL,
`model` varchar(255) DEFAULT NULL,
`foreign_key` int(10) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`lft` int(10) DEFAULT NULL,
`rght` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DE... |
drop table meeting cascade;
create table meeting (
id serial8 PRIMARY KEY,
name varchar(100),
type varchar(20),
created date
)
|
DROP TABLE IF EXISTS `beiker_newprize`;
CREATE TABLE `beiker_newprize` (
`newprize_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`newprize_name` varchar(130) NOT NULL COMMENT '抽奖奖品名称',
`newprize_starttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '抽奖开始时间',
`newprize_pagetitle` va... |
IF EXISTS(SELECT 1 FROM information_schema.tables
WHERE table_name = '
__EFMigrationsHistory' AND table_schema = DATABASE())
BEGIN
CREATE TABLE `__EFMigrationsHistory` (
`MigrationId` varchar(150) NOT NULL,
`ProductVersion` varchar(32) NOT NULL,
PRIMARY KEY (`MigrationId`)
);
END;
CREATE TABLE `Dev... |
INSERT INTO burgers
(burger_name, devoured)
VALUES
('Double-Bacon Cheeseburger', FALSE);
INSERT INTO burgers
(burger_name, devoured)
VALUES
('BBQ-Bacon Cheeseburger', FALSE);
INSERT INTO burgers
(burger_name, devoured)
VALUES
('Westernburger', TRUE);
|
UPDATE SECOND_HAND_VEHICLE_PRICE_MST
SET MAKER_CUSTOMER_CODE = /*newEntity.makerCustomerCode*/
,BRAND = /*newEntity.brand*/
,TYPE = /*newEntity.type*/
,YEAR_OF_MANUFACTURE = /*newEntity.yearOfManufacture*/
,SECOND_HAND_PRICE = /*newEntity.secondHandPrice*/
,MODIFY_USER = /*newEntity.mod... |
CREATE TABLE IF NOT EXISTS `sgs_test_table` (
`col0` int(11) NOT NULL,
`col1` varchar(255) DEFAULT NULL,
`col2` int(11) DEFAULT NULL,
`col3` float DEFAULT NULL,
`col4` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
SELECT DISTINCT CITY
FROM STATION
where not regexp_like (CITY, '(a|e|i|o|u)$'); |
-- Las 10 canciones más populares
SELECT tracks.TrackId,
Name,
composer,
count(playlist_track.PlaylistId)
FROM playlist_track
INNER JOIN tracks
ON tracks.TrackId = playlist_track.TrackId
GROUP BY tracks.TrackId
ORDER BY count(playlist_track.PlaylistId) DESC LIMIT 10
|
# Write your MySQL query statement below
# Find for each user whether the brand of the second item (by date) they sold is their favorite brand. If a user sold less than two items, report the answer for that user as no. It is guaranteed that no seller sold more than one item on a day.
## CTE: use rank() to find the orde... |
-- --------------------------------------------------------
--
-- 表的结构 `pub_notice`
--
CREATE TABLE IF NOT EXISTS `pub_notice` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`subject` varchar(100) NOT NULL COMMENT '主题',
`keywords` varchar(100) NOT NULL DEFAULT '' COMMENT 'seo的ke... |
CREATE TABLE `t_action_log` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`ip_address` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'ip 地址',
`browser` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '浏览器',
`remark` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '操作描述',
`action_type` TINYINT NOT NULL DEFAULT '0' COMMEN... |
insert into kombined.starting_player_question(id, question)
values(1, 'starting player question 1');
insert into kombined.starting_player_question(id, question)
values(2, 'starting player question 2'); |
declare external function LOAD_LUA_LIB
cstring(200)
returns integer by value
entry_point 'load_lua_lib' module_name 'lua_udf';
declare external function MD5
varchar(4096) character set UTF8 null
returns varchar(16) character set OCTETS free_it
entry_point 'md5' module_name 'lua_udf';
... |
/*
Name: Scott Alton
File: calls.sql
Description: Creates the calls table for tracking customer interactions that are logged by the agencies salespeople.
Date: November 18, 2020
Course: WEBD3201 - Web Development - Intermediate
*/
DROP SEQUENCE IF EXISTS call_id_seq
CASCADE;
CR... |
/*-------1.模块分组--------*/
/*
num: 序号
groupname: 模块组名称
groupICO: 模块组图标
remark: 备注
fname: 备用字段
*/
CREATE TABLE frm_modelgroup
(
num number,
groupName varchar(50) primary key not null,
groupICO varchar(200),
remark varchar(200)
) |
--Remove gatilho 2
PRAGMA foreign_keys = ON;
DROP TRIGGER CheckAge;
|
CREATE TABLE user (
name VARCHAR(20) NOT NULL,
PRIMARY KEY(name)
);
|
SELECT movies.title, ratings.rating
FROM movies
JOIN ratings
ON movies.id = ratings.movie_id
WHERE movies.year = 2010
AND ratings.rating IS NOT NULL
ORDER BY ratings.rating DESC, movies.title; |
/*
Script Name: Chapter 5 City Jail
Developer: Tu Tong
Date: October 13, 2017
Purpose: Adding constraints to existing tables
which are created in chapter 3
*/
/**********************************/
/* 1. Create and execute statements to perform
the following DML activities.
... |
DO $$
Declare TempDO UUID;
Declare TempDOVN integer;
Begin
TempDO := (select "DefaultOrganisationID" from "DefaultOrganisation" d where d."Name" = 'Temporary');
TempDOVN = 1;
perform public."fn_CreateOrganisationFromDefault"(27, TempDO, TempDOVN, 'Temporary Organisation', '');
END $$; |
CREATE TABLE books(
id INT NOT NULL UNIQUE PRIMARY KEY,
title VARCHAR NOT NULL,
author VARCHAR,
location VARCHAR NOT NULL,
notes VARCHAR,
genre VARCHAR,
series BOOL NOT NULL,
series_name VARCHAR,
series_position INT,
book_type INT NOT NULL,
book_level VARCHAR(1),
culture VARCHAR,
publication_year INT(4));
CREATE SEQUE... |
SELECT DATE_TRUNC('month',o.occurred_at) + INTERVAL '1400 DAY' as month,
oc.channel,
SUM(o.total_amt_usd)as total_amt_usd,
SUM(o.total_amt_usd) / sum(o.total) * 1000 as cac,
sum(o.gloss_qty) /sum(o.poster_amt_usd) as conversion_rate
FROM {{ @order_channel_new as oc ... |
--What 3 towns have the highest population of citizens that are 65 years and older?
SELECT * FROM town_health_records ORDER BY age_65_plus DESC LIMIT(3);
--What 3 towns have the highest population of citizens that are 19 years and younger?
SELECT * FROM town_health_records ORDER BY age_0_19 DESC LIMIT(3);
--What 5 to... |
DROP DATABASE IF EXISTS tyrodev;
CREATE DATABASE tyrodev;
\c tyrodev;
DROP TABLE IF EXISTS users, tickets, files, problems, problem, solutions, comments, tickets, solution;
CREATE TABLE users (
ID SERIAL PRIMARY KEY,
fullName VARCHAR,
username VARCHAR UNIQUE,
password_digest VARCHAR,
email VARCH... |
CREATE OR REPLACE VIEW SCH_ROUTINE AS
SELECT
ROU.ROUTINE_CATALOG AS CATALOG_NAME
, ROU.ROUTINE_SCHEMA AS SCHEMA_NAME
, ROU.ROUTINE_NAME
, ROU.ROUTINE_TYPE
, ROU.DATA_TYPE
, ROU.ROUTINE_BODY
, ROU.EXTERNAL_LANGUAGE
, ROU.SECURITY_TYPE
, ROU.TYPE... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-11-2018 a las 13:01:16
-- Versión del servidor: 10.1.34-MariaDB
-- Versión de PHP: 5.6.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
ALTER TABLE accounts ADD COLUMN activated_at TIMESTAMP WITHOUT TIME ZONE;
ALTER TABLE accounts ADD COLUMN last_dm_at TIMESTAMP WITHOUT TIME ZONE;
|
create table employee
(
emp_no numeric(3),
emp_name varchar2(10),
emp_address varchar2(30)
);
insert into employee values(111,'AAAA','a1');
insert into employee values(222,'bbbb','b2');
insert into employee values(333,'ccc','c3');
insert into employee values(444,'dddd','d4');
insert into employee values(55... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 20 يونيو 2021 الساعة 12:55
-- إصدار الخادم: 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... |
/*
SQLyog Community Edition- MySQL GUI v6.5 Beta1
MySQL - 5.0.27-community-nt-log : Database - flys
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!4... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 19, 2021 at 01:23 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... |
USE ProjetRJ;
DROP PROCEDURE IF EXISTS ps_creer_acceptation_ami;
DELIMITER #
CREATE PROCEDURE ps_creer_acceptation_ami (IN p_pseudonyme_demandeur VARCHAR(40), IN p_pseudonyme_repondant VARCHAR(40))
BEGIN
DECLARE l_id_repondant INT;
DECLARE l_id_demandeur INT;
SET @l_id_demandeur = (SELECT id_utilisateur... |
SELECT name, year FROM Movie
WHERE rating >= 8.7 AND rating < 9.0; |
create TABLE client(
client_id SERIAL PRIMARY KEY not NULL,
login VARCHAR(20) not NULL,
password VARCHAR (20) not NULL,
role VARCHAR(10) not NULL
);
create TABLE department (
id_dep SERIAL PRIMARY KEY not NULL,
name_dep VARCHAR(40) not NULL
)
create TABLE emp (
id_emp SERIAL PRIMARY KEY no... |
-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- 主机: 192.168.0.22:3306
-- 生成日期: 2016 年 03 月 16 日 10:39
-- 服务器版本: 5.5.28
-- PHP 版本: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CH... |
CREATE TABLE users
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
username VARCHAR(250) NOT NULL,
email VARCHAR(250) NOT NULL,
password VARCHAR(250) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE ads
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
user_id INT UNSIGNED NOT NULL,
title VARCHAR(250) NO... |
CREATE DATABASE [Service]
USE [Service]
CREATE TABLE Users(
Id INT PRIMARY KEY IDENTITY,
Username NVARCHAR(30) UNIQUE NOT NULL,
[Password] NVARCHAR(50) NOT NULL,
[Name] NVARCHAR(50),
Birthdate DATETIME,
Age INT CHECK(Age >= 14 AND Age <= 110),
Email NVARCHAR(50) NOT NULL
)
CREATE TABLE Departments(
Id INT PRIMARY KE... |
-- select count(*),now() from registro ;
-- select ip, count(ip),referrer from registro where length(user_agent)<20 or referrer not like '%eluniversal%' and logfile = 3 group by 3 order by 2 desc limit 100
-- delete from registro
select * from registro where ip = '190.202.82.98'
-- cod_retorno='404';
-- SELECT ip,c... |
CREATE TABLE `city` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(63) DEFAULT NULL,
`state` varchar(63) DEFAULT NULL,
`country` varchar(63) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAM... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 08, 2019 at 09:38 AM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: db_cinefsw
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
INSERT INTO productCategories VALUES (NULL, "category 1", 1, "some text11dfasdasd11as");
INSERT INTO productCategories VALUES (NULL, "category 2", 1, "some text22dfasdasd22as");
INSERT INTO productCategories VALUES (NULL, "category 3", 1, "some text33dfasdasd33as");
INSERT INTO productCategories VALUES (NULL, "category... |
update workout_items
set type_value = ${type_value}, distance = ${distance}, time = ${time}
where id = ${id} returning *;
|
--create database StatusCafe
use StatusCafe
create table StatusLog
(
CodigoCafeStatus int PRIMARY KEY identity,
Data datetime not null,
Pronto bit not null default 0,
Observacao varchar(255) null
)
select * from statuslog
|
-- Table: movies_distinctions
-- DROP TABLE movies_distinctions;
CREATE TABLE movies_distinctions
(
movies_id integer NOT NULL,
gotprized boolean NOT NULL,
name character varying(255) NOT NULL,
CONSTRAINT fkf1bda1e3b6daa239 FOREIGN KEY (movies_id)
REFERENCES movies (id) MATCH SIMPLE
ON UPDATE NO ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.