text stringlengths 6 9.38M |
|---|
/*QUESTION 1*/
DROP PROCEDURE IF EXISTS GET_LIST_ACCOUNT_OF_DEPARTMENT;
DELIMITER //
CREATE PROCEDURE GET_LIST_ACCOUNT_OF_DEPARTMENT (IN IN_DEPARTMENTNAME CHAR (50))
BEGIN
SELECT *
FROM(
SELECT
NV.ACCOUNTID AS ACCID,
NV.EMAIL AS EMAIL,
NV.USERNAME AS USERNAME,
NV.FULLNAME AS FULLNAME,
NV.POSITIONI... |
delete from HtmlLabelIndex where id=20558
/
delete from HtmlLabelInfo where indexId=20558
/
INSERT INTO HtmlLabelIndex values(20558,'当前操作者')
/
INSERT INTO HtmlLabelInfo VALUES(20558,'当前操作者',7)
/
INSERT INTO HtmlLabelInfo VALUES(20558,'Current Operator',8)
/
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 19 déc. 2018 à 07:58
-- Version du serveur : 5.7.23
-- Version de PHP : 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
-- [schema-name] is DbMysql02
CREATE SCHEMA IF NOT EXISTS DbMysql02;
USE DbMysql02;
DROP TABLE IF EXISTS best_scores;
DROP TABLE IF EXISTS hints;
DROP TABLE IF EXISTS answers;
DROP TABLE IF EXISTS entities_definitions;
DROP TABLE IF EXISTS entities;
DROP TABLE IF EXISTS yago_literal_fact;
DROP TABLE IF EXISTS yago_fac... |
/* 1. How many pizzas were ordered? */
select count(pizza_id) as total_orders from customer_orders;
/* 2. How many unique customer orders were made? */
select count(distinct order_id) as unique_orders from customer_orders;
/* 3. How many successful orders were delivered by each runner? */
select ru... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: apoteka
-- ------------------------------------------------------
-- Server version 5.7.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
CREATE TABLE `brands` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`translit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`downcase_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT N... |
--SCOTT DB 과제
--SCOTT_DB를 가지고 있는 계정으로 접속
--1. 계정이 가지고 있는 테이블을 모두 검색하는 구문을 작성하시오.
select * from tab;
--2. EMP테이블의 컬럼을 출력하는 구문을 작성하시오.
desc emp;
--3. EMP테이블에서 ENAME, SAL, 연봉, 월 수령액(보너스 SALARY의
--5%), 월 실수령액(세금 3%, 보너스는 세금에서 제외)을 출력하는 구문
--을 작성하시오.
select ename, sal, 12*sal AS 연봉,
FLOOR(1.05*sal) AS 월수령액,
FLOOR(... |
-- Multi-Table Query Practice
-- Display the ProductName and CategoryName for all products in the database. Shows 77 records.
SELECT productname, c.CategoryName
FROM product
JOIN category as c
ON product.CategoryId = c.id;
-- Display the order Id and shipper CompanyName for all orders placed before August 9 201... |
INSERT INTO USUARIO VALUES ('19383853-7','Pedro','asdf@gmail.com','$2y$10$Mi/sJSyq43Vn6JGdQdaCXek6Gb7vBH.D50001ovxdzZ0jrYj3.DXu');
INSERT INTO USUARIO VALUES ('19383231-1','Sanz','Sanz@gmail.com','$2y$10$Mi/sJSyq43Vn6JGdQdaCXek6Gb7vBH.D50001ovxdzZ0jrYj3.DXu');
INSERT INTO USUARIO VALUES ('21383853-7','Dir','Dir@gma... |
select
customerno as customer_code,
ardivisionno as division_code,
customername as name,
nullif(customertype,'') as group_code,
agingcategory1 as overdue_balance_30_day,
agingcategory2 as overdue_balance_60_day,
agingcategory3 as overdue_balance_90_day,
agingcategory4 as overdue_balance_120_day,
avgdaysoverdue as ave... |
INSERT INTO country (country_id, country_code, continent_code) VALUES
('urn:iso:std:3166:-2:AF','AF','AS'),
('urn:iso:std:3166:-2:AX','AX','EU'),
('urn:iso:std:3166:-2:AL','AL','EU'),
('urn:iso:std:3166:-2:DZ','DZ','AF'),
('urn:iso:std:3166:-2:AS','AS','OC'),
('urn:iso:std:3166:-2:AD','AD','EU'),
('urn:iso:std:3166:-2:... |
CREATE TABLE PageViewObject
(
[id] INT IDENTITY(1,1),
[name] VARCHAR(200) NOT NULL,
[order] INT NOT NULL DEFAULT 0
) |
CREATE DATABASE IF NOT EXISTS practiceapp;
USE practiceapp;
DROP TABLE IF EXISTS Book;
CREATE TABLE Book (
BookId INT NOT NULL AUTO_INCREMENT,
FirstName VARCHAR(75),
LastName VARCHAR(75),
Email VARCHAR(100),
Title VARCHAR(100),
DueDate Date,
PRIMARY KEY(BookId)
);
INSERT INTO Book
(FirstName, L... |
CREATE DATABASE IF NOT EXISTS analy;
USE analy;
|
insert into note(text) values ('sampleNote1');
insert into note(text) values ('sampleNote2'); |
CREATE TABLE mytable(
col1 CHAR(10),
col2 NVARCHAR2(10),
col3 NUMBER,
col4 NUMBER(5),
col5 NUMBER(5, 2)
);
/* 테이블 삭제 */
DROP TABLE mytable;
/* 현재 접속 계정에서 사용할 수 있는 Table 목록 검색 */
SELECT * FROM TAB;
/* 지정한 테이블의 컬럼 정보 출력 */
DESC myta... |
CREATE TABLE hc_05 (
first_name VARCHAR(32),
last_name VARCHAR(32),
address VARCHAR(32),
zip VARCHAR(16),
state CHAR(2),
country VARCHAR(64),
phone VARCHAR(32),
salary INT,
fk TINYINT,
INDEX(first_name, last_name),
INDEX(address, zip, state, country),
INDEX(salary),
INDEX(fk));
|
/*
Navicat MySQL Data Transfer
Source Server : aaaa
Source Server Version : 80012
Source Host : localhost:3306
Source Database : game
Target Server Type : MYSQL
Target Server Version : 80012
File Encoding : 65001
Date: 2018-09-05 14:09:27
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... |
DROP PROCEDURE CPI.GET_RECORDS_FOR_SERVICE;
CREATE OR REPLACE PROCEDURE CPI.Get_Records_For_Service (
p_par_id IN GIPI_PARLIST.par_id%TYPE,
p_iss_cd_ri IN OUT VARCHAR2,
p_wpolgenin OUT Gipis031_Ref_Cursor_Pkg.rc_gipi_wpolgenin,
p_wendttext OUT Gipis031_Ref_Cursor_Pkg.rc_gipi_wendttext,
p_wopen_policy OUT Gip... |
drop database if exists exam;
create database exam;
use exam;
create table User (
id int not null primary key auto_increment,
twitter varchar(6),
name varchar(256),
dexcription longtext
);
create table Category (
id int not null primary key auto_increment,
name varchar(256),
created_by varchar(256),
User_id i... |
--Create tables
CREATE TABLE dbo.[Type]
(
TypeId int not null identity primary key,
TypeDescription nvarchar(100) not null,
ChangeDate datetime not null default getdate()
);
CREATE TABLE dbo.[Status]
(
StatusId int not null identity primary key,
StatusDescription nvarchar(100) not null,
ChangeDate datetime not ... |
ALTER TABLE scene
DROP COLUMN layer_name,
DROP COLUMN created,
ADD COLUMN granule_path VARCHAR NOT NULL,
ADD COLUMN footprint GEOMETRY(POLYGON, 3857) NOT NULL;
|
--Новый пользователь
CREATE USER test PASSWORD '12345';
GRANT SELECT, INSERT, UPDATE, DELETE ON subject TO test;
REVOKE UPDATE ON subject FROM test;
GRANT SELECT (teacher_id,first_name,last_name,review),
UPDATE (review)
ON teacher TO test;
GRANT SELECT ON pair TO test;
GRANT SELECT ON mgtu_professo... |
delete from HtmlLabelIndex where id=27384
/
delete from HtmlLabelInfo where indexid=27384
/
INSERT INTO HtmlLabelIndex values(27384,'员工生日提醒设置')
/
INSERT INTO HtmlLabelInfo VALUES(27384,'员工生日提醒设置',7)
/
INSERT INTO HtmlLabelInfo VALUES(27384,'Employees birthday reminded Settings',8)
/
INSERT INTO HtmlLabelInfo VALUE... |
use classicmodels;
select customers.customerNumber, customerName, phone, paymentDate, amount,city from customers
inner join payments
on customers.customerNumber = payments.customerNumber
where city = 'Las Vegas'; |
CREATE SCHEMA `usterapp` ;
USE usterapp;
DROP TABLE IF EXISTS `Vehicles`;
CREATE TABLE `Vehicles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`brand` varchar(50) NOT NULL,
`model` varchar(50) NOT NULL,
`plate` varchar(10) NOT NULL,
`licenseRequired` enum('A', 'B', 'C', 'D', 'E') NOT NULL,
PRIMARY... |
insert into staff ( staff_name ) values ('Pizzicotta');
insert into staff ( staff_name ) values ('Granbiscottina');
insert into staff ( staff_name ) values ('Crocchette');
-- fill AUTHOR with some data
|
create table user
(
id int auto_increment
primary key,
name varchar(20) null,
age int null,
email varchar(50) null
);
INSERT INTO deadlock.user (id, name, age, email) VALUES (1, '1', 1, '1');
INSERT INTO deadlock.user (id, name, age, email) VALUES (2, '2', 2, '2'); |
DROP TABLE IF EXISTS TeamStatsAgg5Game;
CREATE TABLE TeamStatsAgg5Game
SELECT
a.TeamID,
a.Date,
a.TeamAssists AS TeamAssists1Game,
a.TeamBlocks AS TeamBlocks1Game,
a.TeamDefensiveRebounds AS TeamDefensiveRebounds1Game,
a.TeamOffensiveRebounds AS TeamOffensiveRebounds1Game,
a.TeamRebounds AS TeamRebounds1Game,
a.TeamSh... |
USE student;
CREATE TABLE SessionTravail(
Login VARCHAR(20) NOT NULL,
Pc VARCHAR(10) NOT NULL,
Debut DATE NOT NULL,
Fin DATE,
CONSTRAINT Login_Pc_Fk PRIMARY KEY(Login, Pc, Debut),
CONSTRAINT Login_Fk FOREIGN KEY (Login) REFERENCES Utilisateur(UserName),
CONSTRAINT Pc_Fk FOREIGN KEY (Pc) REF... |
DROP PROCEDURE CPI.RECAP;
CREATE OR REPLACE PROCEDURE CPI.Recap (p_fm_date DATE,
p_to_date DATE)
AS
-- EXEC recap(TO_DATE('1/1/2001','mm/dd/yyyy'),TO_DATE('12/31/2001','mm/dd/yyyy'));
-- EXEC recap(TO_DATE('1/1/2002','mm/dd/yyyy'),TO_DATE('1/31/2002','mm/dd/yyyy'));
TYPE tab_... |
declare
v_result NUMBER;
v_code nvarchar2(255);
begin
v_code := :Code;
begin
select Col_id into v_result
from TBL_DICT_PARTICIPANTTYPE
where UPPER(col_code) = UPPER(v_code);
exception
when NO_DATA_FOUND then
return -1;
when TOO_MANY_ROWS then
return -1;
end;
... |
-- Tweet schema
-- !Ups
CREATE TABLE tweet (
id BIGINT(20) NOT NULL AUTO_INCREMENT,
content VARCHAR(120) NOT NULL,
posted_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
updated_at DATETIME(3) NOT NULL DEFAUL... |
INSERT INTO LICENSE (id, nr, name, termdays, price, description) VALUES
('acf49189-e872-48b0-949e-63d455f4fd86', 1, 'Norunu ezeras', 2, 1.6, '2 dienu leidimas zvejoti Norunu ez.'),
('7a580a64-a414-40dc-8861-52aa79ff2259', 2, 'Ilgio ezeras', 2, 3.6, '2 dienu leidimas zvejoti Ilgio ez.'),
('7a580a64-a414-40dc-8861-52aa79... |
REM error.sql
REM Version 1.0, last updated 5/6/97
REM This script illustrates the behavior of procedure parameters if an
REM unhandled exception is raised, as described in Chapter 7
REM of _Oracle8 PL/SQL Programming_ by Scott Urman.
PROMPT Creating RaiseError...
CREATE OR REPLACE PROCEDURE RaiseError (
/* ... |
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS studentsemesterenrollment;
DROP TABLE IF EXISTS studyplan;
DROP TABLE IF EXISTS studentcourseevaluation;
DROP TABLE IF EXISTS studentcourseenrollment;
DROP TABLE IF EXISTS student;
DROP TABLE IF EXISTS semester;
DROP TABLE IF EXISTS school;
DRO... |
prompt --application/shared_components/navigation/tabs/parent
begin
-- Manifest
-- TOP LEVEL TABS: 102
-- 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... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 20-03-2019 a las 21:51:04
-- Versión del servidor: 5.7.23
-- Versión de PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
CREATE VIEW public.todo AS
SELECT
*
FROM
zoru.todo; |
-- 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_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -... |
-- Add new person
insert into person (name,email) values ('micmine', 'micmine4@gmail.com');
select id from person where name = 'micmine';
-- Set personinformation ip
insert into personinformation (id, ip) values (1, '178.197.224.186');
-- Change user Password
insert into personcredentials (id, password) values (1, '... |
SET SERVEROUTPUT ON;
/**
##### REQ 2: LISTADO DE EMPLEADOS ######################################################################################
**/
CREATE OR REPLACE PROCEDURE listado_empleados IS
--Cursor que almacenan los monitores
CURSOR c_monitores IS
SELECT emple.n_empleado, em... |
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: c3s
-- ------------------------------------------------------
-- Server version 5.5.49
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... |
DECLARE
a_FormIds NUMBER_ARRAY;
v_id TBL_MDM_FORM.COL_ID%TYPE;
v_IdS NCLOB;
v_errorCode NUMBER;
v_errorMessage NVARCHAR2(255);
BEGIN
v_errorCode := 0;
v_errorMessage := '';
:affectedRows := 0;
v_id := NVL(:ID, 0);
v_IdS := :IDS;
---Input params ch... |
DROP TABLE IF EXISTS PORTFOLIO_EXPECTED_SUM;
CREATE TABLE PORTFOLIO_EXPECTED_SUM
(
EXPECTED_SUM DECIMAL(10,2),
REPORTING_DATE VARCHAR(50),
VERSION INTEGER
);
|
/* SELECCIONAR */
select * from "Role";
select * from "User";
select * from "Cart";
select * from "PostsOnCart";
select * from "Beer";
select * from "GenericType";
select * from "SpecificType";
select * from "Transaction";
select * from "Post";
select * from "Countable";
/* TIRAR ABAJO DATABASE CON IDS TAMBIEN, DESPU... |
SELECT name , gdp/population FROM world WHERE population >= 200000000 |
CREATE TABLE `leavetype` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(45),
`title` varchar(100),
`description` varchar(100),
`status` enum('A','I','D') DEFAULT NULL,
`createdBy` int(11) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`modifiedBy` int(11) DEFAULT NULL,
`modifiedDate` datet... |
-- phpMyAdmin SQL Dump
-- version 4.2.6deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 24, 2015 at 06:41 PM
-- Server version: 5.5.41-0ubuntu0.14.10.1
-- PHP Version: 5.5.12-2ubuntu4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
-- Copyright (c) 2020, Oracle and/or its affiliates.
-- Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
-- Coypright (c) 2020, Transaction Processing Performance Council
-- TPC-H Query 18 - Large Volume Customer
SELECT /*+ JOIN_SUFFIX(l, o, c) set_var(use_seconda... |
UPDATE apartments
SET published = TRUE
WHERE data_source <> 'INTERNAL'; |
/*
* Script to create all tables for the ehotel application database,
* for the CSI 2132 final project of the Winter term 2021.
*
* Section: A07
* Group: 27
*/
CREATE TABLE hotel_brand (
brand_id SERIAL PRIMARY KEY,
address_ID INT NOT NULL,
number_of_hotels INT NOT NULL,
location VARCHAR(50),
... |
--1
SELECT name
FROM world
WHERE name LIKE 'U%'
--2
SELECT population
FROM world
WHERE name = 'United Kingdom'
--3
--B
--4
--D
--5
SELECT name, population
FROM world
WHERE continent IN ('Europe', 'Asia')
--6
SELECT name FROM world
WHERE name IN ('Cuba', 'Togo')
--7
--C
|
SELECT * FROM `kullanicilar`
SELECT * FROM `customers`
UPDATE customers SET customerName='ali',contactName='Kerim' WHERE customerID=1
SELECT * FROM `customers`
DELETE FROM customers WHERE customerID=2
SELECT * FROM `customers`
SELECT * FROM `kullanicilar`
DELETE From kullanicilar WHERE id=1
SELECT * FROM `kullanicilar`... |
CREATE TABLE PEDIDOS (
items integer,
cajas_grandes integer,
cajas_pequenas integer,
cantidad_cajas integer
)
CREATE OR REPLACE FUNCTION CALCULAR_CAJAS_NECESARIAS(numero_items integer, cantidad_cajas_grandes_disponibles integer, cantidad_cajas_pequenas_disponibles) RETURN INTEGER IS
cantidad_cajas integer := 0;
... |
select
c.complaint_id,
c.message,
c.address,
c.category,
c.creation_time
from core.complaint c |
USE Instacart;
INSERT INTO DEPARTMENT (Department_ID, Department_Name) VALUES (1,'frozen');
INSERT INTO DEPARTMENT (Department_ID, Department_Name) VALUES (2,'other');
INSERT INTO DEPARTMENT (Department_ID, Department_Name) VALUES (3,'bakery');
INSERT INTO DEPARTMENT (Department_ID, Department_Name) VALUES (4,'produce'... |
SELECT * FROM posts
JOIN users
ON posts.author_id = users.id
WHERE users.id = ${users.id} |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2018 at 05:45 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE SEQUENCE SEQ_WORKSCOPE_AUDIT_ID;
CREATE TABLE WORKSCOPE_AUDIT
(
ID BIGINT DEFAULT nextval('SEQ_WORKSCOPE_AUDIT_ID') PRIMARY KEY NOT NULL,
WORKSCOPE_ID BIGINT NOT NULL,
WORKSCOPE_VERSION BIGINT NOT NULL,
USER_ACTION VARCHAR(255),
MODIFIED_BY VARCHAR(255),
MODIFIED_DATE TIMESTAMP
);
ALTER TABLE WOR... |
SELECT * FROM edges WHERE source = ? |
-- ============================================================================
-- SP_AtualizaRefTranBB_WEB
-- ============================================================================
CREATE PROCEDURE SP_AtualizaRefTranBB_WEB
@sigla VARCHAR(20)
AS
UPDATE ParametrosSiscafweb
SET BBRefTran = BBRefTran + 1
WH... |
with double_entry_book as (
select to_address as address, value as value
from `bigquery-public-data.crypto_ethereum.traces`
where to_address is not null
and status = 1
and (call_type not in ('delegatecall', 'callcode', 'staticcall') or call_type is null)
union all
select from_address as ad... |
-- Which are the top 3 demanding services on board?
SELECT amenities_name, amenities_price,
COUNT(luxury_cruise.id_amenities) AS number_of_services,
amenities_price * COUNT(luxury_cruise.id_amenities) AS services_revenue
FROM luxury_cruise
INNER JOIN cruise_amenities
ON luxury_cruise.id_amenities = cruise_ameniti... |
/*
Navicat PostgreSQL Data Transfer
Source Server : localhost
Source Server Type : PostgreSQL
Source Server Version : 100003
Source Host : localhost:5432
Source Catalog : sellerpro
Source Schema : public
Target Server Type : PostgreSQL
Target Server Version : 100003
Fi... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 26-03-2019 a las 12:33:01
-- Versión del servidor: 10.3.13-MariaDB
-- Versión de PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... |
DECLARE
v_taskid INTEGER;
v_tasktitle NVARCHAR2(255);
v_tasktypeid INTEGER;
v_tasktypecode NVARCHAR2(255);
v_tasktypename NVARCHAR2(255);
v_tasktypeprocessorcode NVARCHAR2(255);
v_stateconfigid INTEGER;
v_errorcode ... |
INSERT INTO users
(username, password, firstname, lastname, api, system)
VALUES
('rorystandley@gmail.com', '$2y$10$Q/DXjGk5dLoknBSIdmQ6pemgEKnitf4cONtl7E11anA1LFfyvEpK2', 'Rory', 'Standley', 1, 1) |
insert into producto (codigoProducto, descripcionProducto,unidadesDisponibles,unidadesComprometidas)
values (:codigoProducto, :descripcionProducto, :unidadesDisponibles, :unidadesComprometidas) |
/*
THIS CODE WAS OUR OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING ANY
SOURCES OUTSIDE OF THOSE APPROVED BY THE INSTRUCTOR.
Bhargav Annigeri, Simon Marty
*/
SET search_path to artistdb;
SELECT DISTINCT Artist.name as artist_name, Album.title as album_name
FROM Album JOIN Artist on Album.artist_id = Artist.artist_id
W... |
CREATE TABLE CAR_READINGS(
ID INTEGER PRIMARY KEY NOT NULL,
EVENTTIME TEXT NOT NULL,
DEVICEDATA BLOB NOT NULL
);
CREATE TABLE LAST_PROCESSED(
TABLE_NAME TEXT NOT NULL,
LAST_PROCESSED_ID INTEGER NOT NULL
);
CREATE TABLE PROCESSED_READINGS(
ID INTEGER PRIMA... |
/*
Name: Basira Shirzad
Date: 01-21-2021
*/
/* Creating table student and storing Student_data.csv data*/
DROP TABLE IF EXISTS student;
CREATE TABLE student
(
id SERIAL PRIMARY KEY,
first_name CHARACTER VARYING,
last_name CHARACTER VARYING,
email CHARACTER VARYING,
gender CHARACTER VARYING,
wo... |
DROP PROCEDURE IF EXISTS get_pm_list_sent;
DELIMITER ;;
CREATE DEFINER=web@localhost PROCEDURE get_pm_list_sent(IN $uid INT, IN $limit INT, IN $offset INT)
COMMENT 'get recent private messages in sent box for a given user'
BEGIN
SELECT g.msg_id, m.body, g.to_uid AS uid,
(SELECT username FROM users WH... |
CREATE DATABASE smog;
USE smog;
CREATE TABLE user
(
age int NOT NULL,
class int NOT NULL,
id int PRIMARY KEY AUTO_INCREMENT
);
|
-- Script that creates the database hbtn_0d_2 and the user user_0d_2.
CREATE DATABASE IF NOT EXISTS hbtn_0d_2;
CREATE USER IF NOT EXISTS user_0d_2@localhost
IDENTIFIED BY 'user_0d_2_pwd';
-- the new user only have select privilege.
GRANT SELECT ON hbtn_0d_2.* TO user_0d_2@localhost;
|
USE my_guitar_shop;
SELECT category_name, count(product_id) AS product_count, max(list_price) AS most_expensive_product
FROM products AS p
JOIN categories AS c ON p.category_id = c.category_id
GROUP BY category_name; |
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE anime(ID integer primary key autoincrement, name text not null, NumEpisodes integer, rating real);
CREATE TABLE genres(ID integer primary key autoincrement, genre text not null);
CREATE TABLE anime_genre(animeID integer, genreID integer);
DELETE FROM sqlite_... |
alter table ACT_HI_IDENTITYLINK add CREATE_TIME_ datetime;
|
/* Query 2 */
SELECT Text, Sender_ID
FROM Message
WHERE Message_ID IN (SELECT Message_ID
FROM Group_Message
WHERE Group_ID = 'rohban')
ORDER BY Send_Time; |
INSERT INTO HtmlLabelIndex values(17129,'客户联系人')
/
INSERT INTO HtmlLabelInfo VALUES(17129,'客户联系人',7)
/
INSERT INTO HtmlLabelInfo VALUES(17129,'crm linkman',8)
/ |
/* this sql sentence is modify dongping for TD1329
* date 2003.11.3
* this file is contain sql and oracle sentence
**/
/*需要在oracle数据库中执行的脚本*/
CREATE OR REPLACE PROCEDURE SysFavourite_Insert (
resourceid1 integer,
Adddate1 char,
Addtime1 char,
Pagename1 varchar2,
URL1 varchar... |
SELECT r.BankName, r.City
FROM Bank b NATURAL JOIN Robberies r
WHERE b.NoAccounts > 1;
|
CREATE TABLE `tblcomment` (
`id` int(10) NOT NULL,
`name` varchar(25) NOT NULL,
`subject` varchar(25) NOT NULL,
`email` varchar(25) NOT NULL,
`comment` varchar(1500) NOT NULL,
`rate` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
INSERT INTO `tblc... |
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE PART';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END;
/
CREATE TABLE PART (
P_PARTKEY NUMBER NOT NULL,
P_NAME VARCHAR(55),
P_MFGR CHAR(25),
P_BRAND CHAR(10),
P_TYPE VARCHAR(25),
P_SIZE INTEGER,
P_CONTAINER CHAR(10... |
UPDATE USERS SET NAME = replace(NAME, 'CORP\','') |
# LeetCode 184: Department Highest Salary
SELECT D.Name AS Department, E.Name AS Employee, E.Salary AS Salary
FROM Department D, Employee E
WHERE D.Id = E.DepartmentId
AND (D.Id, E.Salary) IN (
SELECT DepartmentId, MAX(Salary)
FROM Employee
GROUP BY DepartmentId
); |
create table nc_machines (
mach_id integer not null primary key auto_increment,
network_parent_id integer default 0,
name varchar(255),
ip varchar(255),
unique (name)
) TYPE=INNODB;
create table nc_agents (
agent_id integer not null primary key auto_increment,
mach_id integer not null,
last_check_in in... |
create table store_withdrawals
(
id int auto_increment comment '商家提现申请表'
primary key,
store_id int default 0 null comment '商家id',
create_time int default 0 null comment '申请日期',
refuse_time int default... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 21 Bulan Mei 2018 pada 15.12
-- Versi server: 10.1.30-MariaDB
-- Versi PHP: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- Create tables section -------------------------------------------------
-- Table RHY_PERSONAS
CREATE TABLE `RHY_PERSONAS`
(
`PER_CODIGO` Varchar(30) NOT NULL,
`PER_NOMBRE` Varchar(30) NOT NULL,
`PER_P_APELLIDO` Varchar(30) NOT NULL,
`PER_S_APELLIDO` Varchar(20) NOT NULL,
`PER_F_NACIMIENTO` Date,
`PER_... |
# Write a SQL query that finds out managers with at least 5 direct report
USE practice;
## Make table
Create table If Not Exists Employee (Id int, Name varchar(255), Department varchar(255), ManagerId int);
Truncate table Employee;
insert into Employee (Id, Name, Department, ManagerId) values ('101', 'John', 'A', NUL... |
IF OBJECT_ID('@storeData', 'U') IS NOT NULL DROP TABLE @storeData;
SELECT CONCEPT_ID AS CONDITION_CONCEPT_ID
INTO @storeData
FROM (
select distinct c1.CONCEPT_ID, c1.CONCEPT_NAME
FROM @cemEvidence cu
JOIN @vocabulary.CONCEPT c1
on cu.concept_id_2 = c1.concept_id
WHERE c1.DOMAIN_ID = 'Condition'
and SOU... |
-- Buildings
------------------------------
INSERT INTO Buildings
(Type, BuildingClass, Happiness, Defense, ExtraCityHitPoints, CityWall, Cost, GoldMaintenance, PrereqTech, ArtDefineTag, XBuiltTriggersIdeologyChoice, SpecialistType, SpecialistCount, MinAreaSize, ConquestProb, HurryCostModifier, Help, Description... |
create database if not exists smu;
use smu;
drop table if exists Comment;
drop table if exists Post;
drop table if exists Users;
create table if not exists Users(
user_id int(11) not null auto_increment,
Username varchar(25) not null,
Email varchar(25) not null,
Password char(10) not null,
primary key(user_id)
);
c... |
DROP TABLE IF EXISTS product;
DROP TABLE IF EXISTS category;
CREATE TABLE category
(
category_id INT NOT NULL AUTO_INCREMENT,
category_name VARCHAR(255) NOT NULL UNIQUE,
parent_id INT,
PRIMARY KEY (category_id),
FOREIGN KEY (parent_id) REFERENCES category (category_id)
);
CREATE TAB... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50553
Source Host : localhost:3306
Source Database : onecode
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2017-08-25 10:31:53
*/
SET FOREIGN_KEY_CHECKS=0;
... |
CREATE TABLE `clicks_with_struct_array`(
`type` string,
`id` string,
`referenced_event_id` string,
`happened` timestamp,
`processed` timestamp,
`tracking_id` string,
`processing_score` int,
`source_attributes` struct<id:string, origin:string, data:struct<remote_address:string, url:string, headers:map<st... |
/***********************************************************************************
|| QUERY INFORMATION
||
|| Department: Data Warehouse
|| Programmer: Luis Fuentes
|| Date: 07/28/2018
|| Category: Table creation
||
|| Description: Creates table T_DIM_CLIENT_EMPLOYEE_STG
||
|| ... |
DELETE FROM `wp_attribute` WHERE `model_name`='comment';
DELETE FROM `wp_model` WHERE `name`='comment' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_comment`;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.