text stringlengths 6 9.38M |
|---|
-- #ForeignKey#
SELECT
CON.Connector_ID, CON.Start_Object_ID, START_OBJ.Name, OPE_SRC.Name
, CON.End_Object_ID, END_OBJ.Name, OPE_DST.Name, PARAM_SRC.Name
, PARAM_DST.Name
FROM
(T_OPERATIONPARAMS AS PARAM_SRC
INNER JOIN ((((T_CONNECTOR AS CON
INNER JOIN T_OBJECT AS START_OBJ ON CON.Start_Ob... |
-- dbms_stat_funcs
select lpad(to_char(min(salary),'9,999.99'),25) "min", lpad(to_char(max(salary),'999,999,999.99'),25) "max",
lpad(to_char(avg(salary),'9,999.99'),25) "avg", lpad(to_char(variance(salary),'999,999,999.99'),25) "var",
lpad(to_char(stddev(salary),'9,999.99'),25) "stddev" from employees;
/
-- 2,1... |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------... |
-- SERVER PROPERTIES
SELECT
SERVERPROPERTY('MachineName') as Host,
SERVERPROPERTY('InstanceName') as Instance,
SERVERPROPERTY('Edition') as Edition, /*shows 32 bit or 64 bit*/
SERVERPROPERTY('ProductLevel') as ProductLevel, /* RTM or SP1 etc*/
Case SERVERPROPERTY('IsC... |
CREATE TABLE servers (
id integer primary key,
serverNameJP text,
serverNameUS text,
dataCenter text,
region text,
created_at,
updated_at
);
insert into servers values(1,"Ramuh","Ramuh"," "," "," "," ");
|
create trigger trg_before_upd_vent before update on ventas
for each row
execute procedure f_validar_vent()
;
\q
|
--
DROP TABLE SYSFUNCTIONS;
--
CREATE TABLE SYSFUNCTIONS
(
SYSFUNCTION_NAME varchar(24) PRIMARY KEY,
SYSFUNCTION_CODE NUMERIC UNIQUE,
GENERIC_FUNC_TYPE varchar(24),
DESCRIPTION18 varchar(128) NOT NULL UNIQUE
);
|
--保存从网站获得的原始的未经转换的数据。暂时不使用此表
create table sto_realtime_original (
code varchar(10),
str1 varchar(15),str2 varchar(15),str3 varchar(15),str4 varchar(15),str5 varchar(15),
str6 varchar(15),str7 varchar(15),str8 varchar(15),str9 varchar(15),str10 varchar(15),
str11 varchar(15),str12 varchar(15),str13 varchar(15),str14 var... |
-- Checklist 22
SELECT * FROM TABLE(SELECT E.especializacao FROM tb_especializada E); |
DELIMITER //
Create Trigger upd_login
BEFORE UPDATE ON users FOR EACH ROW
BEGIN
IF NEW.userLogin = OLD.userLogin THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'same name';
ELSEIF NEW.userLogin in (select userLogin from users) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'same name in databa... |
--
-- Table structure for table `invoice`
--
DROP TABLE IF EXISTS `invoice`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice` (
`id` int NOT NULL AUTO_INCREMENT,
`transaction_id` int NOT NULL,
`subject` varchar(100) NOT NULL,
... |
-- Copyright 2015 Silicon Valley Data Science.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable la... |
/* Create Comments, Sequences and Triggers for Autonumber Columns */
COMMENT ON COLUMN "ADM_TUSUA"."USUA_USUA" IS 'id de tabla usuarios'
;
COMMENT ON COLUMN "ADM_TUSUA"."USUA_NOMB" IS 'nombre de acceso al sistema'
;
COMMENT ON COLUMN "ADM_TUSUA"."USUA_PASS" IS 'Contraseña de acceso al sistema'
;
COMMENT ON COLUM... |
-- phpMyAdmin SQL Dump
-- version 4.1.9
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Mar 22, 2014 at 03:25 AM
-- Server version: 5.5.34
-- PHP Version: 5.5.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
insert into SESSIONS (id,value , timeStamp, sourceName ) values
(6, '176', '2015-11-07 10:29:34.177', 'Loop11');
insert into BOUNCES ('id','value' , 'timeStamp', 'sourceName' ) values
(6, '25', '2015-11-08 10:29:34.177', 'LATTE');
|
/*
DataBase Name: DB
USERNAME=root
PASSWORD=root
*/
create database db;
use db;
create table student
(
Roll_no int auto_increment,
first_name varchar(50),
last_name varchar(50),
email varchar(50),
gender varchar(6),
date_of_birth varchar(50),
address varchar(50),
contact_no varchar(15),
CONSTRAINT S... |
-- -----------------------------------------------------------------------------------
-- File Name : https://oracle-base.com/dba/monitoring/user_roles.sql
-- Author : Tim Hall
-- Description : Displays a list of all roles and privileges granted to the specified user.
-- Requirements : Access to the DBA v... |
SELECT * FROM products
WHERE category = $1
ORDER BY name; |
/* Friend Event table */
/*
CREATE TABLE FriendEvent
(
EventID int,
FriendID int,
FOREIGN KEY (EventID) REFERENCES Event(EventID),
FOREIGN KEY (FriendID) REFERENCES Friends(FriendID)
);
*/
INSERT INTO FriendEvent
VALUES (1, 1);
INSERT INTO FriendEvent
VALUES (1, 2);
INSERT INTO FriendEvent
VALU... |
-- Copyright 2019 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in ... |
declare
v_pos Integer;
v_posNext Integer;
v_posDelimiter Integer;
v_inputStr nclob;
v_strPortion nvarchar2(255);
v_strOrder nvarchar2(255);
v_strField nvarchar2(255);
v_counter Integer;
v_strFields nclob;
v_strOrders nclob;
begin
v_inputStr := :inputStr;
v_pos := -1;
v_posNext := -1;
v_counter := 0;
v_strFields := ... |
drop database university;
CREATE DATABASE IF NOT EXISTS university;
USE university;
CREATE TABLE IF NOT EXISTS faculty
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
) DEFAULT CHARACTER SET utf8mb4
COLLATE `utf8mb4_unicode_ci`
ENGINE = InnoDB
;
INSERT INT... |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 22, 2013 at 01:38 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
-- Join view Employee/Job showing salary
-- Sorting by salary and last name
Select Concat(Lastname,', ', Firstname) as 'Name', Description, Format(Salary, 'C') as 'Salary'
From Employee
Join Job
on JobId = Job.Id
--Where Not ((Description = 'VP') or (Salary > 100000))
order by job.salary desc;
|
delete from HtmlLabelIndex where id=28286
/
delete from HtmlLabelInfo where indexid=28286
/
INSERT INTO HtmlLabelIndex values(28286,'签到/退明细')
/
INSERT INTO HtmlLabelInfo VALUES(28286,'签到/退明细',7)
/
INSERT INTO HtmlLabelInfo VALUES(28286,'sign in/out detail',8)
/
INSERT INTO HtmlLabelInfo VALUES(28286,'簽到/退明細',9)
/... |
--@Autor: Flores Fuentes Kevin y Torres Verástegui José Antonio
--@Fecha de creación: 16/06/2020
--@descripción: Creacion de tabla(s) externa(s)
prompt conectando como sys
connect sys/system as sysdba
--creando un objeto de tipo directory
prompt creando directorio tmp_dir
create or replace directory tmp_dir as '/tmp/... |
CREATE TABLE users (
username VARCHAR(25) PRIMARY KEY,
password TEXT NOT NULL,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL
);
CREATE TABLE monsters (
slug VARCHAR(50) PRIMARY KEY,
cr VARCHAR(5) NOT NULL,
size VARCHAR(10) NOT NULL,
typ... |
delete from HtmlLabelIndex where id=19309
/
delete from HtmlLabelInfo where indexid=19309
/
INSERT INTO HtmlLabelIndex values(19309,'收(发)文单位')
/
INSERT INTO HtmlLabelInfo VALUES(19309,'收(发)文单位',7)
/
INSERT INTO HtmlLabelInfo VALUES(19309,'Receive Unit',8)
/ |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.10
-- Dumped by pg_dump version 9.5.10
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off... |
set lines 155
set verify off
set pagesize 999
col username format a13
col outline_category for a16
col prog format a22
col sql_text format a55 wrap
col sid format 999
col child_number format 99999 heading CHILD
col ocategory format a10
col outline_name format a12
col avg_etime format 9,999,999.99
col etime format 9,999... |
CREATE TABLE admin(
id int(11) NOT NULL auto_increment,
username varchar(255) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY id (id)
); |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
--
-- Name: gizmo_type_groups_id_seq; Type: SE... |
-- MySQL Script generated by MySQL Workbench
-- Fri Jun 12 20:55:21 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_M... |
/*Problema: 2614 - Locações de Setembro:*/
select customers.name, rentals.rentals_date from customers inner join
rentals on rentals.id_customers = customers.id where
DATE_PART('MONTH', rentals.rentals_date) = '09';
/*Problema 2616 - Nenhuma Locação:*/
Select customers.id,customers.name
from customers where cus... |
-- Change all values in format {size}M to {size}
UPDATE googleplaystore
SET size = substr(size, 1, length(size) - 1)
WHERE size LIKE '%M' |
CREATE DATABASE gozatu_1;
-- \c gozatu_1
CREATE TABLE restaurants(
restaurant_id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(30) NOT NULL,
city VARCHAR(30) NOT NULL,
cuisine VARCHAR(30),
description VARCHAR(200),
price INT,
visit_date DATE,
rating INT NOT NULL,
favorite BOOLEAN NOT NULL
); |
--
-- CRM_ORDER_DIR (Directory)
--
CREATE OR REPLACE DIRECTORY
CRM_ORDER_DIR AS
'/data02/crm_dump_dir/his_orderinfo/process_dir';
|
create table "APP".UTILIZADOR
(
ID_UTILIZADOR INTEGER not null primary key generated always as identity (start with 1, increment by 1),
NOME VARCHAR(50) not null,
EMAIL VARCHAR(50) not null unique,
PASSWORD VARCHAR(50) not null
);
create table "APP".MOBILIARIOCLINICO
(
ID_PRODUTO INTEGER not null primary key gene... |
DROP TABLE IF EXISTS characters CASCADE;
CREATE TABLE characters (
id SERIAL PRIMARY KEY,
account_id INTEGER NOT NULL,
world_id SMALLINT NOT NULL DEFAULT 0,
name TEXT UNIQUE NOT NULL,
gender SMALLINT NOT NULL DEFAULT 0,
skin SMALLINT NOT NULL DEFAULT 0,
face ... |
-- ----------------------------
-- Table structure for co_company
-- ----------------------------
# DROP TABLE IF EXISTS `co_company`;
CREATE TABLE `co_company`
(
`id` bigint NOT NULL COMMENT 'ID',
`name` varchar(255) NOT NULL COMMENT '公司名称',
`manager_id` ... |
DROP PROCEDURE CPI.GIPIS002_POPULATE_TABLES;
CREATE OR REPLACE PROCEDURE CPI.gipis002_populate_tables (
p_par_id IN gipi_wopen_policy.par_id%TYPE,
p_line_cd IN gipi_wopen_policy.line_cd%TYPE,
p_op_subline_cd IN gipi_wopen_policy.op_subline_cd%TYPE,
p_op_iss_cd IN gipi_wopen... |
select
uc.UserId
,IsFraud
,IsFraudDateChanged
,u.username
,case
when exists
(
select 1 from Debtors d
inner join Credits c on c.Id = d.CreditId
where c.UserId = uc.UserId
and d.Status != 3
)
then 1
else 0
end as isDebtor
fro... |
use [Lab_3]
insert into tbl_Book(Title, Author, Publisher, BookNumber) values ('Head First C#', 'Andrew Stellman', 'O''Reilly Media', 5);
insert into tbl_Book(Title, Author, Publisher, BookNumber) values ('Fahrenheit 451', 'Ray Bradbury', 'Simon & Schuster', 3);
insert into tbl_Book(Title, Author, Publisher, BookNumber... |
use MyCompany_Database
Delete from YearComplexBudget
Delete from QuarterComplexBudget
Delete from MonthComplexBudget
Delete from BudgetProject
Delete from ComplexlBudget
Delete from BudgetCategory
Delete from TargetBudget
Delete from BudgetItem |
DROP TABLE IF EXISTS test1.`USER`;
CREATE TABLE test1.`USER`(
ID CHAR(36) PRIMARY KEY COMMENT '主键',
USERNAME VARCHAR(50) NOT NULL COMMENT '用户名',
PASSWORD VARCHAR(100) NOT NULL COMMENT '密码',
GENDER TINYINT(1) NOT NULL DEFAULT 0 COMMENT '性别:0保密 1女 2男',
AGE INT COMMENT '年龄'
);
DROP TABLE IF EXISTS test2.`USER... |
-- FUNKCJA który resetuje haslo
CREATE OR REPLACE FUNCTION reset_password(v_generated_code IN INTEGER, v_login IN VARCHAR2, v_new_password IN VARCHAR2)
RETURN BOOLEAN
IS
result BOOLEAN;
count_result INTEGER;
BEGIN
SELECT COUNT (*)
INTO count_result
FROM accounts a INNER JOIN mail_rst_pass
ON a.id_account = mrp.id_accou... |
select
c.id
,c.Timezone
,rt.Timezone as RealTimezone -- update c set c.Timezone = rt.Timezone
from client.Client c
inner join client.Address a1 on a1.ClientId = c.Id
and a1.AddressType = 1
left join client.Address a2 on a2.ClientId = c.Id
and a2.AddressType = 2
and c.RegAddressIsFact = 0
inner j... |
DROP PROCEDURE IF EXISTS update_node_rating;
DELIMITER ;;
CREATE DEFINER=web@localhost PROCEDURE update_node_rating(IN $nid INT, IN $uid INT, IN $rating INT, IN $time INT)
COMMENT 'update user as a given user'
BEGIN
REPLACE INTO yp_ratings (nid,uid,rating,time) VALUES ( $nid, $uid, $rating, $time);
END ;;
DE... |
CREATE TABLE `person` (
`PersonID` INT(4) NOT NULL AUTO_INCREMENT,
`FirstName` VARCHAR(50) NOT NULL,
`LastName` VARCHAR(50) NOT NULL,
`EmailAddress` VARCHAR(60) NOT NULL,
PRIMARY KEY (`PersonID`)
);
CREATE TABLE `subscription` (
`SubscriptionID` INT(4) NOT NULL AUTO_INCREMENT,
`PersonID` INT(4) NOT NULL,
#`Ema... |
create database hibernate;
use hibernate;
create table Employee(
id int(11) unsigned primary key not null auto_increment,
nome varchar(20) default null,
role varchar(20) default null,
insert_time datetime default null
)ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; |
/* TODO implementation migrations */
CREATE TABLE `builds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`charname` varchar(255) DEFAULT NULL,
`class` varchar(255) DEFAULT NULL,
`mastery1` varchar(255) DEFAULT NULL,
`mastery2` varchar(255) DEFAULT NULL,
`damagetype` varchar(255) DEFAULT NULL,
`activeskills` varchar(... |
USE hutoma;
UPDATE `hutoma`.`entity` SET `hidden`=1 WHERE `name`='sys.person'; |
/* Drop Tables */
DROP TABLE PROGRESS CASCADE CONSTRAINTS;
DROP TABLE COURSE_VIDEO CASCADE CONSTRAINTS;
DROP TABLE ENROLMENT CASCADE CONSTRAINTS;
DROP TABLE POSTSCRIPTION CASCADE CONSTRAINTS;
DROP TABLE QNA CASCADE CONSTRAINTS;
DROP TABLE COURSE CASCADE CONSTRAINTS;
DROP TABLE DEPT CASCADE CONSTRAINTS;
DROP... |
--Tabelas principais
create table funcionario(
id_funcionario serial not null,
nome varchar(100),
cpf varchar(11),
data_nascimento date,
usuario varchar(100),
senha varchar(100),
permissão varchar(1),
primary key(id_funcionario)
);
create table operacao(
id_operacao serial not null,
descricao varchar(100),... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 11, 2017 at 01:57 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 */... |
--
-- import genealiases from a TAIR10 gene_aliases file
--
DELETE FROM genealiases;
COPY genealiases (locusname,symbol,fullname) FROM '/home/sam/genomes/TAIR10/gene_aliases_20140331.txt' WITH CSV HEADER DELIMITER AS ' ';
|
DATABASE CREATE `contact_test`
USE `contact_test`
CREATE TABLE `contact_info_saved` (
`id` int(6) NOT NULL,
`contact_name` text NOT NULL,
`contact_email` text NOT NULL,
`contact_phone` text,
`contact_message` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
ALTER TABLE `contact_info_saved`
ADD PRIMAR... |
ALTER TABLE vedtak ADD COLUMN saksbehandler_ident VARCHAR DEFAULT NULL;
ALTER TABLE vedtak ADD COLUMN beslutter_ident VARCHAR DEFAULT NULL; |
-- **************************************************************
-- Respuestas a Sakila - Consultas (Queries)
-- **************************************************************
-- Base de Datos Usada
USE sakila;
-- **************************************************************
-- **************************************... |
/*Books need 6*/
INSERT INTO books (id, title, year) VALUES
(1, "Hurdy Putter", 1993),
(2, "Hurdy Putter", 1993),
(3, "Hurdy Putter", 1993),
(4, "Hurdy Putter", 1993),
(5, "Hurdy Putter", 1993),
(6, "Hurdy Putter", 1993);
/*joins needs 16*/
INSERT INTO character_books (id, book_id, character_id) VALUES
(1, 2, 2),
(2,... |
INSERT INTO cars (brand, year, color) VALUES
('Audi', 1992, 'Red'),
('Fiat', 2001, 'Red'),
('Mercedes', 1991, 'Brown'),
('Fiat', 1962, 'Black'),
('Renault', 1997, 'Brown'),
('Renault', 1967, 'Maroon'),
('Renault', 1986, 'Yellow'),
('BMW', 1970, 'Maroon'),
('Fiat', 1990, 'Silver'),
('Renault', 1972, ... |
DELETE FROM carts
WHERE product_id = $1 AND user_id = $2; |
--@Autor: Flores Fuentes Kevin y Torres Verastegui Jose Antonio
--@Fecha creación: 18/06/2020
--@Descripción: Compound trigger para asignación de placas
set serveroutput on
create or replace trigger tr_revisa_placa
for insert or update of placa_id on vehiculo
compound trigger
before each row is
v_placa_inactiv... |
CREATE TABLE "user"
(
"id" SERIAL PRIMARY KEY,
"username" VARCHAR (80) UNIQUE NOT NULL,
"password" VARCHAR (1000) NOT NULL
);
CREATE TABLE "groups"
(
"id" SERIAL PRIMARY KEY,
"group_name" VARCHAR NOT NULL,
"passcode" VARCHAR NOT NULL,
"family_passcode" VARCHAR
);
CREATE TABLE "family"
(
... |
SELECT
n.id,
n.isInitial,
n.nodeTypeId as id,
n.decisionTreeId as id,
dt.version,
dt.description,
dt.isCurrent
FROM
Node n
INNER JOIN DecisionTree dt ON
dt.id = n.decisionTreeId
WHERE
n.id = @id |
SELECT count(order_id) AS order_count,
sum(tax_amount) AS tax_total,
avg(tax_amount) AS tax_average
FROM orders; |
select count(*) as validation_errors
from `mlab-recreate`.`dbt_pipeline_deposit`.`my_second_dbt_model`
where id is null
|
SET VERIFY OFF
ACCEPT pTablespace PROMPT "Type TABLESPACE_NAME: "
SELECT DBMS_METADATA.GET_DDL('TABLESPACE','&pTablespace')
FROM DUAL
/
SET VERIFY ON |
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS post;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE post (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
created T... |
-- create schema Assignment;
-- use Assignment;
/*The Stock price data provided is from 1-Jan-2015 to 31-July-2018 for six stocks:
Eicher Motors, Hero, Bajaj Auto, TVS Motors, Infosys and TCS.
A new schema called 'Assignment' is created.
The CSV files are imported in MySQL, naming the tables as the name of the stock... |
CREATE TABLE NAVIGATION_MENU(
ID INT NOT NULL,
PARENT_ID VARCHAR(255),
NAME VARCHAR (255) NOT NULL,
LOCAL_NAME VARCHAR(255) NOT NULL,
LINK VARCHAR(512) NOT NULL,
PRIMARY KEY (ID)
);
INSERT INTO NAVIGATION_MENU VALUES ("0001","","Main","Главная", "http://www.google.ru");
INSERT INTO NAVIGATI... |
-- 1. What query would you run to get all the customers inside city_id = 312? Your query
-- should return customer first name, last name, email, and address.
select customer.first_name, customer.last_name, customer.email, address.address
from customer
join address
on customer.address_id = address.address_id
join city
... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 24, 2021 at 08:21 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
delete from HtmlLabelIndex where id=18083
/
delete from HtmlLabelInfo where indexid=18083
/
INSERT INTO HtmlLabelIndex values(18083,'´Î')
/
INSERT INTO HtmlLabelInfo VALUES(18083,'´Î',7)
/
INSERT INTO HtmlLabelInfo VALUES(18083,'ONCE',8)
/
INSERT INTO HtmlLabelInfo VALUES(18083,'´Î',9)
/
|
create procedure [sp_MSins_ProductionProductModelProductDescriptionCulture]
@c1 int,
@c2 int,
@c3 nchar(6),
@c4 datetime
as
begin
insert into [Production].[ProductModelProductDescriptionCulture] (
[ProductModelID],
[ProductDescriptionID],
[CultureID],
[ModifiedDate]
) values (
@c1,
@c2,... |
-- Remove the conflict between FEATURE_LAKE == FEATURE_ICE and FEATURE_RIVER == FEATURE_JUNGLE
UPDATE FakeFeatures SET ID=ID+200;
ALTER TABLE Buildings
ADD AddsFreshWater INTEGER DEFAULT 0;
ALTER TABLE Buildings
ADD PurchaseOnly INTEGER DEFAULT 0;
ALTER TABLE Building_ThemingBonuses
ADD ConsecutiveEras I... |
\qecho Description of the statements used in the following queries:
\d Users
\d PartOf
\d Wall
\d Follows
\d Post
\qecho
/*
1)select users who are male and are part of at least 1 conversation
*/
\qecho
\qecho Output of first statement
\qecho
SELECT Users.email from Users where Users.gender ='m' intersect
SELECT emai... |
drop table if exists user;
create table user (
user_id integer primary key autoincrement,
username text not null,
email text not null,
pw_hash text not null
);
drop table if exists message;
create table message (
message_id integer primary key autoincrement,
author_id integer not null,
text text not null... |
-- Check full name with spaces in it
CREATE TABLE checkFName(
fullName TEXT(64) NOT NULL,
CONSTRAINT checkFNameSpace CHECK(fullName REGEXP '^[a-zA-Z ]*$' )
);
INSERT INTO `testDB`.`checkFName`
(`fullName`)
VALUES
('Vasant Govind M L'); |
SELECT Z.Name, Z.Population, Z.CountryCode
FROM world.city Z
WHERE Z.CountryCode IN (SELECT V.Code
FROM world.city X, world.country V
WHERE V.Code=X.CountryCode
GROUP BY V.Code
HAVING COUNT(*) < 3) and Z.Population = (SELECT MAX(N.Population)
FROM world.country B, world.city N
WHERE B.Code=N.CountryCode and Z.CountryCo... |
--mysql -b -N -u root -pmypass mysql < /scripts/create_users.sql
FLUSH PRIVILEGES;
ALTER USER 'analytics'@'localhost' IDENTIFIED BY 'mypass';
ALTER USER 'analytics'@'%' IDENTIFIED BY 'mypass';
CREATE USER 'analytics'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO 'analytics'@'localhost';
CREATE ... |
SELECT *
FROM
(SELECT value->>'layout' AS layout,
value->>'name' AS name,
value->'names' AS names,
value->>'manaCost' AS mana_cost,
value->>'cmc' AS cmc,
value->'colors' AS colors,
value->>'type' AS type,
value->'supertypes' AS supertypes,
value->'types' AS types,
value->'subtypes' AS subtypes,
value->>'text'... |
#Updated on March 23th, 2017
#Author: Haoran Ma
#Description: Input some values for test + Test Case
USE HRbase;
# Insert Values in 'User' table
# Permission number: 0->Admin, 1->Employee, 2->User
INSERT INTO Users
(EMail, Password, Permission)
VALUES
('haoranma@gmail.com','12345','1'),
('bowentian@gmail.com','1234... |
DROP DATABASE jpadb;
CREATE DATABASE jpadb; |
INSERT INTO addresses(location, destination)
VALUE ("2503 Fleming Drive, South Carolina", "1210 Bolt Drive, South Carolina");
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 11, 2020 at 10:27 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... |
CREATE SCHEMA `internetshop` DEFAULT CHARACTER SET utf8 ;
CREATE TABLE `internetshop`.`items` (
`item_id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(225) NOT NULL,
`price` DECIMAL(4,2) NOT NULL,
PRIMARY KEY (`item_id`));
CREATE TABLE `users` (
`user_id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NUL... |
drop table ITEMS
create table ITEMS (
ID INT PRIMARY KEY,
TEXT VARCHAR(50) NOT NULL,
TYPE VARCHAR(50),
COLOR VARCHAR(50),
CREATE_DATE DATE NOT NULL
); |
drop database if exists i_notes;
create database i_notes;
use i_notes;
create table note_type(
id int primary key auto_increment,
`name` varchar(100),
`description` varchar(200)
);
create table note(
id int primary key auto_increment,
title varchar(100),
content varchar(500),
type_id int
);
alter table note add ... |
SELECT * FROM USERS
ORDER BY INSERT_DATETIME %s;
|
CREATE TABLE [ROUTES] (
[ID] INTEGER PRIMARY KEY AUTOINCREMENT,
[ORIGIN] TEXT NOT NULL,
[DESTINATION] TEXT NOT NULL,
[TRAVEL_TIME] INTEGER NOT NULL CHECK(TRAVEL_TIME>0),
UNIQUE(ORIGIN,DESTINATION)
);
|
delete from tbl_field_perms
where field_id = %1 and group_id = %2
|
CREATE TABLE [ADM].[C_EMPLEADO_IDIOMA] (
[ID_EMPLEADO_IDIOMA] INT IDENTITY (1, 1) NOT NULL,
[ID_EMPLEADO] INT NULL,
[ID_CANDIDATO] INT NULL,
[ID_IDIOMA] INT NOT NULL,
[PR_LECTURA] DECIMAL (5, 2) ... |
CREATE TABLE customer (
id int GENERATED BY DEFAULT AS IDENTITY,
firstName varchar(50) not null,
secondName varchar(50) not null,
address1 varchar(100) not null,
address2 varchar(100) null,
address3 varchar(100) null,
creditLimit NUMERIC(9,2),
PRIMARY KEY (id)
);
INSERT INTO customer (FIRSTNAME, secondname, add... |
INSERT INTO packt_serverless_analytics.nyc_taxi_partitioned_parquet
SELECT
vendorid,
tpep_pickup_datetime,
tpep_dropoff_datetime,
passenger_count,
trip_distance,
ratecodeid,
store_and_fwd_flag,
pulocationid,
dolocationid,
payment_type,
fare_amount,
extra,
... |
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FKEC5C9E843FE2728C]') AND parent_object_id = OBJECT_ID('Blog_Articles'))
alter table Blog_Articles drop constraint FKEC5C9E843FE2728C
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FKEC5C9E844D59DE92]') AND parent_objec... |
DROP PROCEDURE CPI.COPY_POL_WREMINDER_2;
CREATE OR REPLACE PROCEDURE CPI.copy_pol_wreminder_2(
p_old_pol_id gipi_reminder.policy_id%TYPE,
p_new_par_id gipi_reminder.par_id%TYPE,
p_user gipi_reminder.user_id%TYPE
)
IS
v_row NUMBER;
item_exist VARCHAR2 (1) := 'N';
note_id ... |
create database students;
use students;
create table student(
id int primary key auto_increment,
`name` varchar(10),
age int,
course char(4),
price int
);
insert into student(`name`,age,course,price)
values('hoang',21,'CNTT',400000),
('viet',19,'dtvt',320000),
('thanh',18,'ktdn',400000),
('nhan',19,'CK',450000),
('hu... |
create database olist;
use olist;
######## customer table
create table customers
(customer_id VARCHAR(200),
customer_zip_code_prefix bigint,
customer_city VARCHAR(100),
customer_state VARCHAR(50),
constraint cust_pk primary key(customer_id)
);
select * from customers;
####### orders table
create table orders
(order_id ... |
SELECT * FROM KNOWLEDGE_USERS
WHERE
USER_ID = ?
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.