text stringlengths 6 9.38M |
|---|
CREATE DATABASE lab5;
CREATE TABLE Customer(customer_id SERIAL PRIMARY KEY , first_name varchar(50), last_name varchar(50), email varchar(50), active_bool bool, create_date date , last_update timestamp, active int);
CREATE TABLE payment(payment_id SERIAL, customer_id Serial references Customer, rental integer, amoun... |
BANCO DE DADOS - CARROS
LETRA C:
UPDATE modelo SET cor = 'cinza' WHERE codigo = 4; |
INSERT INTO user (id, email, username, password)
VALUES (
"123",
"test@test.com",
"test",
"bc0e33f96c2238d8fcec4a8bc47b494a3dbbdd5b90bc1f89a8a36551725edbbd"); -- pwd:test, salt: dev
INSERT INTO code (codeVal)
VALUES ("123-456-78");
|
update ACT_ID_PROPERTY set VALUE_ = '6.5.0.4' where NAME_ = 'schema.version';
|
/* Create Foreign Key Constraints */
ALTER TABLE "ADM_TELAB"
ADD CONSTRAINT "FK_ADM_TELAB_ADM_TUSUA"
FOREIGN KEY ("ELAB_USUA") REFERENCES "ADM_TUSUA" ("USUA_USUA")
;
|
create database prueba
drop database prueba |
-- doc
-- doc
SELECT tv_shows.title, tv_genres.name FROM tv_shows
LEFT JOIN tv_show_genres ON tv_show_genres.show_id = tv_shows.id
LEFT JOIN tv_genres ON tv_show_genres.genre_id = tv_genres.id
ORDER BY tv_shows.title, tv_genres.name;
|
-- 지번주소를 저장하는 테이블을 생성.
-- 우편번호, 시도, 구분, 동, 번지, seq로 이루어져있다.
create table zipcode(
zipcode char(7),
sido char(6),
gugun varchar2(25),--한글 8자,공백 1자
dong varchar2(300),
bunji varchar2(25),
seq number(5)
);
truncate table zipcode;
-- count(*) : 집계함수
select count(*) from ZIPCODE;-- 여기에 ; 안찍혀있어서 오류났음.
... |
-- Query that give how many inactive recorde are there for an employee
create table emp_status
(
eno int not null,
first_name varchar(10) not null,
last_name varchar(10) not null,
act_i varchar (5) not null
);
insert into emp_status
(eno, first_name, last_name, act_i)
values(1, 'Rajesh','verma','N'),
(1,... |
--para inserir os dados na tabela a estrutura é a seguinte
--é estritamente importante que todos os dados que forem
--inseridos sejam os mesmos que estão referenciados nos
--parenteses na linha do insert
INSERT INTO tbl_autores(ID_Autor,Nome_Autor,Sobrenome_Autor)
VALUES (1,'Daniel','Barret'),
(2,'Gerald','Ca... |
@inc/input_vars_init
prompt Show only first 30 found:
col if_all new_val _if_all noprint;
select case when '&2 &3 &4 &5' like '%all%' then '--'
else ' '
end if_all
from dual;
col sql_id format a13;
col sql_text_trunc format a100 word;
col to_purge format a30;
SELECT/*+NOTM... |
# --------------------------------------------------------
# Script de création de la base de données
# BdSiteWeb et de ses tables
# Fait par : Michel Payette
# Le : 2019-03-08
# --------------------------------------------------------
## Création de la base de données avec vérification
## de sa non-exi... |
SELECT clientID, client_name
FROM CLIENTS C
JOIN CARDS CA
ON C.card_category_id = CA.card_id
WHERE CA.card_type = "Blue";
SELECT clientID, client_name
FROM CLIENTS C
JOIN CARDS CA
ON C.card_category_id = CA.card_id
WHERE CA.card_type = "Silver";
SELECT clientID, c... |
--Workshop03
SELECT * FROM tab WHERE tname like 'TB#_%' ESCAPE '#';
SELECT * FROM TB_CLASS;
SELECT * FROM TB_CLASS_PROFESSOR;
SELECT * FROM TB_DEPARTMENT;
SELECT * FROM TB_GRADE;
SELECT * FROM TB_PROFESSOR;
SELECT * FROM TB_STUDENT;
--1
SELECT student_name, student_address FROM tb_student
ORDER BY student_name;
--2
S... |
DROP PROCEDURE CPI.UPDATE_DISCOUNT_AT_PERIL;
CREATE OR REPLACE PROCEDURE CPI.update_discount_at_peril(
p_par_id GIPI_WITEM.par_id%TYPE,
p_item_no GIPI_WITEM.item_no%TYPE,
p_nbt_orig_item_no GIPI_WITEM.item_no%TYPE,
p_peril_cd GIPI_WPERIL_DISCOUNT.peril_cd%TYPE,
... |
-- Subselect, subquery
-- Unterabfragen
--SELECT Spalte - Subselect wie Spalte verwenden
--FROM Tabelle - Subselect wie Tabelle verwenden (als Datenquelle)
--WHERE Bedingung - Subselect als Bedingung
USE Northwind
-- Subselect wie eine Spalte verwenden (darf dann nur eine Spalte haben)
SELECT 'Text'
... |
delete from T_USER_ROLE;
delete from T_ROLE;
delete from T_USER;
insert into T_ROLE values(1, 'ROLE_USER', '一般ロール');
insert into T_ROLE values(2, 'ROLE_ADMIN', '管理ロール');
insert into T_USER values(1, 'user', '$2a$10$nodSZsM7Lyi34l3/YEg61uTVDRIgH.DkM/WF4AM0BKTCGINBOnFOm', '一般 太郎', '開発部');
insert into T_USER values(2, '... |
CREATE OR ALTER PROCEDURE SPGERATITULOMENSAL (
diapgto integer,
emissao date,
vencimento date,
geroumes varchar(10),
id integer)
as
declare variable codsocio integer;
declare variable valor double precision;
declare variable grupo char(1);
declare variable dta date;
declare variable dias integer;
de... |
USE tv2pdeplazyhg5ny;
INSERT INTO members (user_Fname, user_Lname, user_email, user_password, user_image, cardio, strength, yoga, morning, midday, night, female, male, no_pref)
VALUES ("Chris", "Lawler", "chris.b.lawler@gmail.com", "password", "image", "true", "true", "false", "true", "true", "true", "false", "false"... |
select user_id, SUM(payment_sum) as user_payment
from payments
group by user_id
order by user_payment DESC
LIMIT 3 |
/*
SQLyog Community v8.71
MySQL - 5.5.29 : Database - sgiweb_db
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOR... |
CREATE DATABASE IF NOT EXISTS todo;
CREATE TABLE IF NOT EXISTS todo.tasks(
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(100),
body VARCHAR(1000),
created_at TIMESTAMP NOT NULL default current_timestamp,
updated_at TIMESTAMP NOT NULL default current_timestamp on update current_timestamp
); |
prompt --application/pages/page_10020
begin
-- Manifest
-- PAGE: 10020
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.03.31'
,p_release=>'20.1.0.00.13'
,p_default_workspace_id=>20
,p_default_application_id=>8950
,p_default_id_offset=>33309244842782322
,p_default_owner=>'ORACLE'
);
w... |
DELETE FROM SEMESTER_SEMESTERITEM;
DELETE FROM SEMESTER;
DELETE FROM SEMESTERITEM;
DELETE FROM TEACHER;
DELETE FROM ROOM;
DELETE FROM SUBJECT; |
-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64)
--
-- Host: localhost Database: payrollsystem
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
SET TERM ^ ;
CREATE OR ALTER PROCEDURE REP_SUPLEMENTACION(
DESDE DATE,
HASTA DATE,
ESTABLECIMIENTO INTEGER,
RODEO_POTRERO VARCHAR(1) CHARACTER SET NONE)
RETURNS(
FECHA_INI DATE,
RACION VARCHAR(50) CHARACTER SET NONE,
POTRERO VARCHAR(50) CHARACTER SET NONE,
CANT_RACION DECIMAL(18, 2),
CAN... |
insert into Player values (1, 'M. SELS', 23, 1, 42, 75, 73, 71, 3, 'right', 'GK', 1);
insert into Player values (2, 'R. GERSH', 27, 55, 50, 70, 78, 68, 1, 'right', 'DEF', 1);
insert into Player values (3, 'M. OUSSAALAH', 33, 11, 59, 70, 67, 60, 2, 'right', 'DEF', 1);
insert into Player values (4, 'B. DEJAEGERE', 24, 19... |
/*1) Crie um banco com seu nome. Ex: db_rubem;*/
create database bruno_DB;
use bruno_DB;
/*2) Crie pelo menos 3 tabelas com no mínimo dois relacionamentos;*/
create table Clientes (
id_cliente int(5) primary key auto_increment,
nome varchar(40),
idade int(3),
email varchar(40)
);
create table Animais (
id_Animais int... |
-- 秒杀数据库
CREATE DATABASE seckill;
-- 使用数据库
USE seckill;
-- 创建秒杀表
CREATE TABLE seckill
(
`seckill_id` bigint not null auto_increment COMMENT '秒杀商品id',
`name` varchar(120) not null comment '秒杀商品名称',
`number` int not null comment '秒杀商品数量',
`start_time` timestamp not null comment '秒杀开始时间',
`end_time` timestamp not null com... |
--
-- The Archetype is configured with "hibernate.hbm2ddl.auto" value="create-drop" in "persistence.xml".
--
-- This will cause hibernate to populate the database when the application is started by processing the files that
-- were configured in the hibernate.hbm2ddl.import_files property.
--
-- This file is responsibl... |
use socialvoyce;
drop table if exists initialUser;
create table initialUser (strng LONGTEXT);
LOAD DATA infile '/opt/database-migration/sourcefiles/votingUser.txt'
INTO TABLE initialUser LINES TERMINATED BY '\n';
drop table if exists scrubUser;
create table scrubUser as
select distinct
ltrim(rtrim(replace(r... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 04-Mar-2020 às 16:22
-- Versão do servidor: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
# Creating Schema
CREATE SCHEMA `myshop` ;
ALTER SCHEMA `myshop` DEFAULT COLLATE utf8_unicode_ci ;
use `myshop`;
# Creating Tables
CREATE TABLE `myshop`.`user` (
`id_user` INT(11) NOT NULL AUTO_INCREMENT,
`user_name` VARCHAR(50) NOT NULL,
`user_login` VARCHAR(50) NOT NULL,
`user_password` VARCHAR(50) NOT NU... |
-- 已更新到企业正式
ALTER TABLE `ims_superdesk_shop_member`
ADD COLUMN `core_organization` int(11) NULL DEFAULT 0 COMMENT '项目id' AFTER `core_enterprise`;
-- 不用执行.填充shop_member中的新增字段core_organization的补丁,作为转程序补丁的依据
-- update ims_superdesk_shop_member as m LEFT JOIN ims_superdesk_core_virtualarchitecture as enterprise on ent... |
insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port)
values(1001,'USD', 'INR', 65,0);
insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port)
values(1002,'EUR', 'INR', 75,0);
insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port)
val... |
INSERT INTO tblCliente VALUES
( 1, 'Carlos', 'Kassab', 'André', 1, 'uag', GETDATE(), GETDATE()),
( 2, 'Yosu', 'Tanamachi', 'Sanchez', 2, 'uag',GETDATE(), GETDATE()),
(3, 'Luis', 'Cuevas', 'Garcia', 3, 'uag', GETDATE(), GETDATE() )
INSERT INTO tblCuenta VALUES
( 1, 2, 1, 2, GETDATE(), 'Ahorros'),
( 2... |
CREATE TABLE `autorzy` (
`idautora` INT NOT NULL AUTO_INCREMENT,
`imie` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL,
`nazwisko` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL,
`data_ur` DATE NOT NULL,
`miejsce_ur` VARCHAR(100) NOT NULL,
PRIMARY KEY (`idautora`)
); |
select * from a01_not_nullExp;
select * from a02_nullExp;
-- 묵시적 null 값 입력. 제약조건이 있기에 에러발생..
insert into a01_not_nullExp(job) values('프로그래머1');
-- 명시적 null 값 입력..
-- 테이블명(컬럼명시X) ==> 전체 컬럼에 대한 입력을 처리하겠다
-- values(전체컬럼에 들어갈 데이터를 명시)
insert into a02_nullExp values(null, '홍길동','프로그래머3');
select * from a02_nullExp;
insert i... |
-- The queries here is only a sample. You may alter some lines to merge them into the controller folder.
-- Made by Nilo Cantil II Jatico
-- One Table
-- 1. List the names of clients, age and marital status based on age.
SELECT client_name, age, marital_status
FROM CLIENTS
WHERE age < 30;
-- 2. Li... |
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'secretsauce';
CREATE DATABASE IF NOT EXISTS sfaacts;
CREATE DATABASE IF NOT EXISTS sfausers;
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.38-0ubuntu0.14.04.1)
# Database: homestead
# Generation Time: 2014-12-04 04:10:06 +0000
# ******************************... |
USE tienda;
SHOW TABLES;
SELECT * FROM empleado;
SELECT nombre FROM empleado;
SELECT nombre, apellido_paterno FROM empleado;
SELECT * FROM empleado WHERE apellido_paterno = 'Risom';
SELECT * FROM empleado WHERE id_empleado = 10;
SELECT * FROM empleado WHERE id_puesto > 100;
SELECT * FROM empleado WHERE id_puesto >= 100... |
# Scripted By: Leonardo Camargo
# Started in: 15/07/2017
-- DROP DATABASE PeriodicTable IF EXISTS;
DROP DATABASE IF EXISTS PeriodicTable;
CREATE DATABASE PeriodicTable;
USE PeriodicTable;
CREATE TABLE Atoms(
Atomic_Number int(4) NOT NULL PRIMARY KEY AUTO_INCREMENT,
Atom varchar(20) NOT NULL,
Atomic_Simbol varchar(... |
ALTER TABLE "public"."fileobjects" ALTER COLUMN "sha256" DROP NOT NULL;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 13-10-2020 a las 23:30:03
-- Versión del servidor: 10.4.6-MariaDB
-- Versión de PHP: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
CREATE TABLE state(
abbreviation VARCHAR(2) PRIMARY KEY,
name VARCHAR(20) NOT NULL
);
|
CREATE DATABASE IF NOT EXISTS ? |
SELECT MyNumber from dbo.Numbers
ORDER BY MyNumber DESC |
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 10.4.11-MariaDB : Database - db_upload
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN... |
DROP TABLE incomes;
|
/*
* Copyright 2020 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
--Q1(a) list mean pay, total pay and staff count in each department
SELECT Department_Cd, AVG(Pay) AS 'Mean Pay', SUM(Pay) AS 'Total Pay', COUNT(Staff_No) AS 'Number of Staff' FROM Staff_Relation
WHERE Type_of_Employment = 'FT'
GROUP BY Department_Cd
ORDER BY 4 asc
--Q1(b) include only the departments with more ... |
-- Base:
CREATE DATABASE loteria;
USE loteria;
/*Tabela na criação da aposta*/
CREATE TABLE apostas (
bet_id longint auto_increment,
player_id int not null,
coin numeric(4) not null,
bet_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
arr_bets varchar(100) NOT NULL,
primary key (bet_id)
FOREIGN KEY (player_id) REFERENCES u... |
SELECT * FROM POINT_KNOWLEDGE_HISTORIES
ORDER BY INSERT_DATETIME %s
LIMIT ? OFFSET ?;
|
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.22-community-nt
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLL... |
BEGIN
FOR i IN (SELECT * FROM student) LOOP
dbms_output.put_line(i.id || ' ' || i.name);
END LOOP;
END; |
--Checklist 57 recuperando dandos do tipo registro e mostrando o crm e nome dos medicos masculinos
DECLARE
CURSOR cur_med (homi CHAR) IS
SELECT nomemedico, crm
FROM medico
WHERE sexo = homi;
reg_med cur_med%ROWTYPE;
BEGIN
OPEN cur_med ('M');
LOOP
FETCH cur_med INTO reg_med;
... |
delete from HtmlLabelIndex where id=27203
/
delete from HtmlLabelInfo where indexid=27203
/
INSERT INTO HtmlLabelIndex values(27203,'补录')
/
INSERT INTO HtmlLabelInfo VALUES(27203,'补录',7)
/
INSERT INTO HtmlLabelInfo VALUES(27203,'repair',8)
/
INSERT INTO HtmlLabelInfo VALUES(27203,'補錄',9)
/
delete from HtmlLabel... |
CREATE DATABASE IF NOT EXISTS `etes_db`;
USE `etes_db`;
-- Users
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fullname` varchar(80) DEFAULT NULL,
`email` varchar(35) DEFAULT NULL,
`username` varchar(25) DEFAULT NULL,
`password` varchar(80) DEFAULT NULL,
... |
--mysql.exe
show databases;
use hospital10; -- kuria db naudot;
show tables; --parodo visas DB Lenteles;
SELECT * FROM user; -- issirinkimo statementas. * yra stulpeliu pasirinkimai
SELECT * user, password, password_expired FROM user; -- from nurodo lenta
CREATE USER 'tautvydas10'@'localhost' IDENTIFIED BY 'tratata... |
CREATE TABLE chart_criteria(
chart_criteria_id INT IDENTITY(1,1) NOT NULL
,chart_id INT NOT NULL
,property_id INT NOT NULL
,attribute_id INT NULL
,attribute_value VARCHAR(200) NULL
,is_active VARCHAR(1) NOT NULL
,created_by INT NOT NULL
,created_date DATETIMEOFFSET NOT NULL
,updated_by INT NULL
,updated_date ... |
-- partition key : must be in query where clause
-- local key :
-- Primary key – defines data location and is composed of the partition key and the local key.
-- - Partition key – defines where data is placed on the cluster, i.e which node the data will be written to
-- - Local key – defines where data is written ... |
select
i.itemcode as sku,
i.itemcodedesc as name,
pl.productlinedesc as product_line,
i.standardunitprice as unit_price,
i.producttype as product_type,
i.standardunitofmeasure as unit_of_measure,
case shipweight
when '' THEN null
else shipweight::decimal(16,10)
end as weight,
i.taxclass as tax_class,
i.primaryvendo... |
# Host: localhost (Version 5.5.53)
# Date: 2018-03-28 08:36:12
# Generator: MySQL-Front 5.4 (Build 4.153) - http://www.mysqlfront.de/
/*!40101 SET NAMES utf8 */;
#
# Structure for table "dou_admin_log"
#
DROP TABLE IF EXISTS `dou_admin_log`;
CREATE TABLE `dou_admin_log` (
`id` int(10) unsigned NOT NULL AUTO_INC... |
/*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 50463
Source Host : 121.89.192.99:3306
Source Schema : checkserver
Target Server Type : MySQL
Target Server Version : 50463
File Encoding : 65950
Date: 06/30/202... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50626
Source Host : 127.0.0.1:3306
Source Database : spare_time_education
Target Server Type : MYSQL
Target Server Version : 50626
File Encoding : 65001
Date: 2016-04-29 07:20:39
*/
SET... |
CREATE TYPE [Controller].[TableListType] AS TABLE (
[FQTableName] [sysname] NULL);
|
create database reactjang;
create user reactjanguser with password 'mypassword';
grant all privileges on database reactjang to reactjanguser; |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: login
-- ------------------------------------------------------
-- Server version 5.7.18-log
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREM... |
CREATE or REPLACE PROCEDURE CRM_CustomerInfo_Insert
(name_1 varchar2,
language_1 integer,
engname_1 varchar2,
address1_1 varchar2,
address2_1 varchar2,
address3_1 varchar2,
zipcode_1 varchar2,
city_1 integer,
country_1 integer,
province_1 integer,
county_1 varchar2,
phone_1 varchar2,
fa... |
drop index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK;
drop index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK;
drop index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK;
drop index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK;
drop table if exists ACT_HI_IDENTITYLINK; |
select index_name, blevel, table_name from user_indexes;
--creer table commune à partir du schema utilisateur p00000009432:
create TABLE commune as select * from P00000009432.commune;
alter table COMMUNE add CONSTRAINT com_pk primary key(CODEINSEE);
--=> creer un index qui s'appelle compk(b+tree)
--mise a jour des... |
-- behavioural attributes: predator/prey, fight/flight response, grouping, factions
create table behaviour
(
rid integer not null,
mid integer null,
carnivorous boolean not null,
herbivorous boolean not null,
detrivorous boolean not null,
territorial boolean not null,
fight integer not nul... |
use fitness;
INSERT INTO fitness_user(email, password, role, first_name, second_name, discount)
VALUES
('admin@mail.ru', md5('admin'), 'admin', NULL, NULL, 52),
('client@mail.ru', md5('client'), 'client', 'Ivan', 'Ivanov', 10),
('client2@mail.ru', md5('client2'), 'client', 'Alexandr', 'Tuhev', 0),
('client3@mail.ru', m... |
INSERT INTO `@target_database@`.`users`(
`id`,
`name`,
`email`,
`password`,
`created_at`,
`updated_at`,
`last_visit`,
`is_admin`,
`remember_token`,
`email_verified_at`,
`is_active`,
`user_type_id`,
`first_name`,
`last_name`,
`company_name`,
`login`,
`a... |
-- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: bbd
-- ------------------------------------------------------
-- Server version 5.5.35-0+wheezy1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... |
select * from blob where user_id=(select user_id from users where username='joshbee'); |
CREATE TABLE IF NOT EXISTS meals(
id SERIAL PRIMARY KEY,
userId INTEGER references caloriecounter_users(id) ON DELETE CASCADE NOT NULL,
dateofmeal DATE NOT NULL,
alldaycalories INTEGER,
breakfast_food TEXT,
breakfast_calories INTEGER,
lunch_food TEXT,
lunch_calories INTEGER,
dinner_f... |
CREATE TABLE IF NOT EXISTS article (
id BIGINT NOT NULL AUTO_INCREMENT,
title VARCHAR(255) NOT NULL,
description VARCHAR(1000),
publication_date DATE NOT NULL,
extraction_link VARCHAR(2000) NOT NULL,
main_image_link VARCHAR(2000) NOT NULL,
source_link VARCHAR(2000) NOT NULL,
CONSTRAINT pk_article_id PR... |
CREATE DATABASE alpha_bustr;
\c alpha_bustr
CREATE TABLE account (id SERIAL PRIMARY KEY, name VARCHAR(255), email VARCHAR(255), password_hash VARCHAR(255), age INTEGER);
CREATE TABLE animal (id SERIAL PRIMARY KEY, animal_photo TEXT, safe_photo BOOLEAN);
CREATE TABLE bustr_strip (id SERIAL PRIMARY KEY, user_id INTEGER ... |
CREATE TABLE Sculpture(
ID INT NOT NULL AUTO_INCREMENT,
ArtObjectID INT NOT NULL REFERENCES ArtObject(ID),
Material VARCHAR(30) NOT NULL,
Height INT NOT NULL,
Weight INT NOT NULL,
Style VARCHAR(30) NOT NULL,
PRIMARY KEY(ID)
); |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!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 */;
/*!40101 SET NAMES utf8 */;
ALTER TABLE `account_data` ADD `toll_count`... |
drop table if exists test_2553;
create table test_2553 as
(select * from
(select "EMAIL_ADDRESS" email_address,
case when "Guide" = 'CC' then 'Conscious Cleanse'
when "Guide" = 'LTM' then 'How to Meditate'
when "Guide" = 'BY' then 'The Balanced You'
end guide_title,
... |
/*
Query returns the previous month's cost and credits by specified label key
This query uses a label key of 'service' as an example
*/
SELECT
invoice.month AS invoice_month,
labels.value AS service,
labels.key AS key,
SUM(cost) AS costs,
ROUND(SUM(credits.amount), 2) AS credits
FROM
`bqutil.billing.billing... |
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`;
CREATE SCHEMA IF NOT EXISTS `freeradiusgui` DEFAULT CHARACTER SET utf8;
USE `freeradiusgui` ;
-- ------------------... |
INSERT INTO heroku_ed9ba720ab53a67.task(id,concluded_at,created_at,is_concluded,remove_at,status, title,type,updated_at) VALUES
(1,'2004-01-22','2004-01-22',FALSE,'2004-01-22','In Progress','Revisão Merges','Frontend','2004-01-22');
INSERT INTO heroku_ed9ba720ab53a67.task(id,concluded_at,created_at,is_concluded,... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 22-Out-2019 às 02:32
-- Versão do servidor: 10.1.38-MariaDB
-- versão do PHP: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
drop procedure if exists calc_agg_transaction_log_by_date_gvt_acc#
drop procedure if exists calc_agg_transaction_log_by_date_gvt_acc_nb#
drop procedure if exists init_agg_transaction_log_by_date_gvt_acc#
create procedure calc_agg_transaction_log_by_date_gvt_acc(in transaction_id_from bigint, in transaction_id_to bigin... |
--1. Write a query that retrieves the columns ProductID, Name, Color and ListPrice from the Production.Product table, with no filter.
SELECT
ProductID,
Name,
Color,
ListPrice
FROM
Production.Product
--2. Write a query that retrieves the columns ProductID, Name, Color and ListPrice from the Production.P... |
\c roam
INSERT INTO
users (first_name, last_name, email,city, password, join_date)
VALUES
('Jared', 'Grippe', 'jared@lg.org', 'San Francisco', '$2a$10$a.jueGqV.x/QCl/rIvRxq.B0G2wYLXPv7c3gzG0UdXq3Q/3sY9Me6', CURRENT_TIMESTAMP),
('Tanner', 'Welsh','Tanner@lg.org', 'Berkeley','$2a$10$a.jueGqV.x/QCl/rIvRxq.B0G2wYLXP... |
-- https://en.wikibooks.org/wiki/SQL_Exercises/Pieces_and_providers
-- 5.1 Select the name of all the pieces.
select Name from pieces;
-- 5.2 Select all the providers' data.
select * from providers;
-- 5.3 Obtain the average price of each piece (show only the piece code and the average price).
select Piece, avg(Pr... |
SELECT cohorts.name, count(students.*) as student_count
FROM cohorts JOIN students ON cohorts.id = students.cohort_id
GROUP BY cohorts.name
HAVING count(students.*) > 17
ORDER BY count(students.*) |
SELECT prénom,nom,naissance FROM etudiants WHERE sexe='femme' |
SELECT
o.ID as id,
o.GroupType as groupType,
m.StringValue as username,
m.ID as groupName,
m.AttributeName as memberType
FROM
dbMetakatalog.dbo.tblMultiValue m, dbMetakatalog.dbo.tblObjects o
WHERE
o.ID = m.ID
AND
o.GroupType in ('Faggruppe')
AND
m.AttributeName in ('Owner', 'Member')
AND
m.StringVa... |
CREATE TABLE `cities` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(255) COLLATE utf8_lithuanian_ci DEFAULT NULL,
`name` varchar(255) COLLATE utf8_lithuanian_ci DEFAULT NULL,
`status` int(1) DEFAULT NULL,
`district_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARS... |
INSERT INTO Car VALUES(1, 'Silver', 'Volvo', 'S80', 1999);
INSERT INTO Car VALUES(2, 'Red', 'Honda', 'Accord', 1997); |
DROP TABLE IF EXISTS refresh_token;
DROP SEQUENCE IF EXISTS token_seq;
CREATE SEQUENCE token_seq START WITH 1;
CREATE TABLE refresh_token (
id BIGINT NOT NULL PRIMARY KEY DEFAULT nextval('token_seq'),
subject VARCHAR(156) NOT NULL,
token VARCHAR(256) NOT NULL,
expiryDate TIMESTAMP NOT NULL
); |
SELECT * FROM privileges;
UPDATE privileges SET is_administrator = 1 WHERE user_id = 1 and community_id = 1;
SELECT * FROM privileges;
UPDATE privileges SET is_administrator = 1 WHERE user_id = 1 and community_id = 1; |
rem
rem $Header: cat712.sql,v 1.6 1992/11/25 14:58:59 RKOOI Stab $
rem
Rem Copyright (c) 1991 by Oracle Corporation
Rem NAME
Rem m711712.sql - Migrate 7.0.11 to 7.0.12
Rem DESCRIPTION
Rem This SQL script makes some schema modifications to migrate
Rem a 7.0.11 database to a 7.0.12 datab... |
-- Project Name : noname
-- Date/Time : 2021/09/10 10:43:07
-- Author : ssaku
-- RDBMS Type : PostgreSQL
-- Application : A5:SQL Mk-2
/*
<< 注意!! >>
BackupToTempTable, RestoreFromTempTable疑似命令が付加されています。
これにより、drop table, create table 後もデータが残ります。
この機能は一時的に $$TableName のような一時テーブルを作成します。
こ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.