text stringlengths 6 9.38M |
|---|
insert into eszktipus values
('mechanikus'),
('mélységmérős'),
('csőrös'),
('kétoldalas'),
('univerzális'),
('kengyeles'),
('-');
|
ALTER TABLE YKT_CUR.T_SUBSYSPARAMS
ADD (BCC_DRTP_IP VARCHAR2(20));
ALTER TABLE YKT_CUR.T_SUBSYSPARAMS
ADD (BCC_DRTP_PORT INTEGER);
ALTER TABLE YKT_CUR.T_SUBSYSPARAMS
ADD (BCC_MAIN_FUNC INTEGER);
ALTER TABLE YKT_CUR.T_SUBSYSPARAMS
ADD (BCC_DRTP_NO INTEGER);
ALTER TABLE YKT_CUR.T_SUBSYSPARAMS
... |
SELECT prod_name, prod_price
FROM Products
WHERE prod_price >= 3 AND prod_price <= 6
ORDER BY prod_price DESC; |
-- sample SQL statements for the action_history
CREATE TABLE action_history (
id int not null PRIMARY KEY,
ctrl_name text ,
data_url text ,
server_ack int,
nodeid int,
process_time int,
field_update int,
)
|
-- COPYRIGHT 2007 Eugene Koontz <ekoontz@hiro-tan.org>
-- This file is part of Psqlog : an
-- implementation of Prolog in PostgreSQL
--
-- Licenced under the GNU General Public License version 3.
--
--
SELECT unify_arg1 AS A, unify_arg2 AS B FROM
unify2( 'management' , 'A' , 'B' , NULL,NULL );
-- who's lex ... |
DELETE FROM customer;
INSERT INTO customer (id, name, note) VALUES (-1, 'customerNameTest1','customerNoteTest1');
INSERT INTO customer (id, name, note, enabled) VALUES (-2, 'customerNameTest2','customerNoteTest2',FALSE);
|
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2016/4/22 12:30:12 */
/*==============================================================*/
drop table if exists t_association;
drop table if... |
START TRANSACTION;
DROP DATABASE IF EXISTS `cooking`;
CREATE DATABASE IF NOT EXISTS `cooking`;
DROP TABLE IF EXISTS `cooking`.`recipe`;
CREATE TABLE IF NOT EXISTS `cooking`.`recipe` (
`idrecipe` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
`instructions` TINYBLOB NULL,
PRIMARY KEY (`idrecipe`));
INSE... |
/*
SQLyog Community v12.4.3 (64 bit)
MySQL - 5.1.33-community : Database - graph
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... |
/*--------------------------------
-- Stored Procedure - PodBill
-- Example:
-- CALL MUSTERAG.PodBill(1, 1, 'Test', 100);
--------------------------------*/
DROP PROCEDURE IF EXISTS MUSTERAG.PodBill;
DELIMITER $$
CREATE PROCEDURE MUSTERAG.PodBill (IN p_idAbrechnung INT, p_idPositionType INT, p_description VARCHAR(4000)... |
CREATE Procedure sp_get_docbatchinfo_FMCG (@Batch_Code Int)
As
Select Batch_Products.PKD, Batch_Products.Expiry,
(Select PurchasePrice From Batch_Products a Where a.Batch_Code = Batch_Products.BatchReference)
,N'',N'',N'',
Case IsNull(Batch_Products.BatchReference, 0)
When 0 Then
Batch_Products.GRNApplicableO... |
-- Script updates score of Bob to 10
UPDATE second_table
SET
score = 10
WHERE second_table.name="Bob";
|
Select * from employee;
Select * from employee where salary = (select max(salary) from employee);
Select * from employee where salary = (select max(salary) from employee where salary < ((select max(salary) from employee)));
Select * from employee where deptId in((Select deptId from employee group by deptId)) order b... |
CREATE TABLE "disney" (
"id" INT NOT NULL,
"rating" INT NOT NULL,
"country" TEXT NOT NULL,
"review" TEXT NOT NULL,
"park" TEXT NOT NULL,
"year" INT NOT NULL,
CONSTRAINT "pk_disney" PRIMARY KEY (
"id"
)
);
CREATE TABLE "happiness" (
"id" SERIAL NOT NULL,
"h... |
SELECT *
FROM survey_result; |
LOAD DATA LOCAL INFILE '/tmp/users-unique.csv' INTO TABLE tweeter_tweeter FIELDS TERMINATED BY ';'
OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (user_name, twitter_user_id)
|
CREATE TABLE users (
id SERIAL PRIMARY KEY,
first_name VARCHAR(128) NOT NULL,
middle_name VARCHAR(128),
last_name VARCHAR(128) NOT NULL,
username VARCHAR(128) NOT NULL,
email VARCHAR(128) NOT NULL
)
|
CREATE TABLE
IF NOT EXISTS 'users'(
'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
'username' TEXT NOT NULL, 'hash' TEXT NOT NULL
); |
CREATE VIEW piechart
AS
SELECT itemname,
( SUM(quantity) / (SELECT SUM(quantity)
FROM purchased) ) AS amountSold
FROM purchased,
inventory
WHERE purchased.itemid = inventory.itemid
GROUP BY purchased.itemid
ORDER BY amountsold DESC; |
CREATE TABLE projeto (
id SERIAL4 PRIMARY KEY,
nome VARCHAR(100),
resumo VARCHAR(255),
colaborador_id INT4,
dt_inicio DATE,
dt_fim DATE,
num_bolsas INT4,
num_voluntarios INT4,
tipo_projeto VARCHAR(50),
orgao_fomento_id INT4
);
ALTER TABLE projeto
ADD FOREIGN KEY (colaborador_id) REFERENCES colabo... |
BEGIN
FOR v_count IN REVERSE 1 .. 10
LOOP
DBMS_OUTPUT.put_line (v_count);
END LOOP;
END; |
-- hr 계정, group by, join, sub query 연습
-- 1. 직원 이름(first/last)과 부서이름 출력
select e.first_name || ' ' || e.last_name as NAME,
d.department_name
from employees e, departments d
where e.department_id = d.department_id
order by e.employee_id;
select e.first_name || ' ' || e.last_name as NAME,
d.depa... |
CREATE PROCEDURE sp_list_expiredItems(@VendorID nVarchar(50), @DATE datetime)
AS
SELECT Batch_Products.Product_Code, Items.ProductName, Batch_Products.Batch_Number,
Batch_Products.Expiry, Batch_Products.PurchasePrice, SUM(Batch_Products.Quantity - ISNULL(ClaimedAlready, 0)),
Max(Batch_Products.TaxSuffered)
FROM Batch... |
--1- Roaming CALL TO Domestic destination, we map :
-- SPNumber.Country_Code
-- OPNumber.City
-- OPnumber.State
SELECT DISTINCT
U.TARIFF_INFO_USED_SERVICE_PKEY USAGE_CATEGORY,
(SELECT DES FROM MPUSNTAB WHERE SNCODE = U.TARIFF_INFO_SNCODE) USAGE_SUB_CATEGORY,
U.TMO_USAGE_TYPE USAGE_ORIGIN,
U... |
-- First create user and password
CREATE USER db_user SUPERUSER;
ALTER USER db_user WITH PASSWORD 'password';
-- Now create database
CREATE DATABASE "db" WITH OWNER db_user;
GRANT ALL PRIVILEGES ON DATABASE "db" TO db_user;
|
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology; |
/**
* Database schema structure required by MetrolyricsModule.
*
* @author Anastaszor
* @link https://github.com/yii1-modules/yii1-music-metrolyrics
* @license 2016-X MIT
*/
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `metrolyrics_artist`;
DROP TABLE IF EXISTS `metrolyrics_genre`;
DROP TABLE IF EXISTS `met... |
--estornando tarifas de ted cobradas erradamente
select sc__buxo.estornar_tarifa_ted_que_deveriam_ser_abonadas();
--estornando as tarifas de saques cobradas erradamente
select sc__buxo.estornar_tarifa_saque_que_deveriam_ser_abonadas();
--estornando tmc cobradas com valor errado
select sc_srv.estornar_tarifa_servico_... |
-- ----------------------------
-- yyget获得表内容,
--
--
--
-- -----------------------------
DELIMITER $$
CREATE PROCEDURE `yyget`( in `tabName` varchar(50),
in `sqlFileds` varchar(512),
in `sqlWhere` varchar(512)
)
top:
BEGIN
declare `@databasenow` varchar(255);
declare f1,f2,f3 var... |
DROP TABLE IF EXISTS `#__twitter`; |
-- log in
-- psql -h localhost -p 8765 -U newuser;
CREATE USER has_many_user;
CREATE DATABASE has_many_blogs OWNER has_many_user;
\c has_many_blogs;
DROP TABLE IF EXISTS users CASCADE;
CREATE TABLE users(
id SERIAL PRIMARY KEY,
username VARCHAR(90) NOT NULL,
first_name VARCHAR(90) DEFAULT NULL,
last_name VAR... |
set names utf8;
set foreign_key_checks=0;
drop database if exists campin;
create database campin;
use campin;
create table items(
itemId int primary key auto_increment,
itemName varchar(100) not null,
itemCategory varchar(50) not null default 0,
stock int not null default 10,
sales int not null default ... |
CREATE TABLE user (
user_id BIGINT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(128) NOT NULL UNIQUE,
password VARCHAR(128) NOT NULL,
first_name VARCHAR(256) NOT NULL,
last_name VARCHAR(256) NOT NULL,
email VARCHAR(50) NOT NULL
);
CREATE TABLE auth_user_group (
auth_user_group_id BIGINT AUT... |
-- +goose Up
CREATE TABLE IF NOT EXISTS conversations (
id bigserial primary key,
user_id bigint not null,
text text not null,
date timestamp default now()
);
CREATE INDEX IF NOT EXISTS idx_user ON conversations USING hash (user_id);
-- +goose Down
DROP INDEX IF EXISTS idx_user;
DROP TABLE IF EXISTS co... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-11-2018 a las 06:13:34
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
CREATE Procedure spr_list_CustomerSalesSummaryDetail(@DocumentNumber nvarchar(250))
As
Select CustomerForumCode,"Forum Code" =CustomerForumCode ,"Customer ID "= Customer.CustomerID,
"Customer Name " = Customer.Company_Name,"No of Purchases " = NoPurchase,
"Accumulated Points " = CustomerSalesSummaryDetail.Accum... |
INSERT INTO EMPLOYEE (EMPLOYEE.ID, EMPLOYEE.NAME, EMPLOYEE.AGE, EMPLOYEE.VERSION)
VALUES
(/* employee.id */4, /* employee.name */'Kenny', /* employee.age */12, /* employee.version */3); |
Create Procedure mERP_sp_Update_CSQPSFreeItemInfo(@SchemeID Int, @CustomerID nVarchar(50), @Product_code nVarchar(50))
As
Begin
Update SchemeCustomerItems Set IsInvoiced = 1 Where SchemeID = @SchemeID And CustomerID = @CustomerID
Update SchemeCustomerItems Set FreeFlag = 1 Where SchemeID = @SchemeID And CustomerID ... |
-- 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
-- -... |
--Using SQL queries modify table Users.
--Add check constraint to ensure that the values in the Password field are at least 5 symbols long.
ALTER TABLE Users
ADD CONSTRAINT CH_PasswordIsAtLeast5Symbols CHECK (LEN([Password])>=5)
|
--EXPLAIN ANALYZE
SELECT
x.flag,
"dcord#",
"dditm#",
"febol#",
"fgent#",
"dilin#",
"diinv#",
"dhinv#",
dditst,
CASE ocri.dditst
WHEN 'C'::text THEN
CASE ocri.ddqtsi
WHEN 0 THEN 'CANCELED'::text
ELSE 'CLOSED'::text
END
ELSE
CASE
WHEN ocri.ddqtsi > 0::numeric... |
Create Procedure mERP_sp_Update_OCGErrorStatus(@REC_OCGID Int,@ErrorMsg nVarchar(510))
As
Begin
Insert Into tbl_mERP_RecdErrMessages( TransactionType, ErrMessage, KeyValue, ProcessDate)
Values('OCGDS', @ErrorMsg, 'Received OCG ID - ' + Cast(@REC_OCGID as nVarchar(10)) ,GetDate())
Update Recd_OCG Set Statu... |
-- mysqldump-php https://github.com/ifsnop/mysqldump-php
--
-- Host: localhost:3306 Database: ceneac5
-- ------------------------------------------------------
-- Server version 5.7.16
-- Date: Sun, 09 Apr 2017 15:32:38 +0000
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... |
-- select the customer_id from table Visits aliased as v. This will be the
-- first column in the result table.
-- The second column will be called count_no_trans.
-- Each row for this column will be the count of each visit_id from table v,
-- under certain conditions.
-- To get these conditions, we need to left join... |
CREATE OR REPLACE VIEW Facility_End_Points_View AS
SELECT
q.facility_id AS facility_id,
max(decode(q.trans_seq,
(SELECT MIN(trans_seq) FROM tid_facility_map WHERE facility_id = q.facility_id AND trans_seq >= 1),
q.tid_id,
NULL)) AS a_site_tid,
max(decode(q.trans_seq,
... |
CREATE TABLE `gd_goods` (
`goods_id` int NOT NULL AUTO_INCREMENT COMMENT '商品管理',
`goods_encode` varchar(50) NULL COMMENT '存货档案编码',
`goods_category` varchar(50) NULL COMMENT '分类',
`goods_model` varchar(50) NULL COMMENT '型号 ALFA D81',
`goods_brand` varchar(50) NULL COMMENT '品牌',
`goods_color` varchar(50) NULL COM... |
/*评审分汇总——空项分*/
CREATE OR REPLACE VIEW V_REVIEW_SUM_BLANK AS
SELECT R_SID,C_PROJECT,SUM(IFNULL(N_SCORE_REVIEW,0)) N
FROM SSM_REVIEW_CONTENT
WHERE C_PROJECT<>'总计' AND C_PROJECT<>'小计'
GROUP BY R_SID,C_PROJECT;
/*评审分汇总——企业实际得分*/
CREATE OR REPLACE VIEW V_REVIEW_SUM_REAL_E AS
SELECT R_SID,C_PROJECT,SUM(IFNULL(N_SCORE_REAL,... |
--Write a query in SQL to display the first name, last name, department number, and department name for each employee.
SELECT E1.FIRST_NAME,E1.LAST_NAME,E1.DEPARTMENT_ID,D1.DEPARTMENT_NAME
FROM EMPLOYEES E1 JOIN DEPARTMENTS D1 ON D1.DEPARTMENT_ID = E1.DEPARTMENT_ID;
--Write a query in SQL to display the first and la... |
call search_domain(10,'MASHA','','','','','','','','','','','','','','','');
call search_domain(10,'CHERISH','','','','','','','','','','','','','','','');
call search_domain(10,'HALEY','','','','','','','','','','','','','','','');
call search_domain(10,'LAURI','','','','','','','','','','','','','','','');
call s... |
CREATE DATABASE estoque;
use estoque;
CREATE TABLE categorias
(
id INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE produtos
(
id INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(150) NOT NULL,
preco DOUBLE(9,2) NOT NULL,
quantidade INT NOT NULL,
categoria_id INT NOT N... |
SELECT MAX(months * salary), COUNT(*)
FROM Employee
WHERE (months * salary) =
(
SELECT MAX(months * salary)
FROM Employee
)
/*
Caner Dabakoğlu
GitHub: https://github.com/cdabakoglu
*/
|
drop table if exists account;
drop table if exists user;
create table account (
account_id integer not null auto_increment,
account integer not null,
user_id integer,
primary key (account_id)
) engine=MyISAM;
create table user (
user_id integer not null auto_increment,
name varchar(45),
sure... |
@repeat{SELECT count(*) FROM Parameter where code ='6027'}
insert into Parameter (ID, TYPE, CODE, VALUE, ISVISIBLE, ISEDITABLE, REMARK, UPDATETIME, UPDATEBY, UNIT)
values (1259600, '10', '6027', '1', 1, 1, '驾驶员非本车驾驶员是否允许安检通过,1允许、0不允许,默认为1', sysdate, 1158013, '是否');
@repeat{SELECT count(*) FROM Parameter where code ='... |
// tag::import-citation[]
USING PERIODIC COMMIT 1000
LOAD CSV FROM "file:///training_set.txt" AS row FIELDTERMINATOR " "
WITH row WHERE row[2] = "1"
MERGE (n1:Paper {id: row[0]})
MERGE (n2:Paper {id: row[1]})
MERGE (n1)-[:CITE]-(n2);
// end::import-citation[]
// tag::import-no-citation[]
USING PERIODIC COMMIT 1000
LOA... |
CREATE database IF NOT EXISTS gym;
USE gym;
DROP TABLE if EXISTS sensorData;
CREATE TABLE sensorData (
sensorTimeStamp BIGINT,
count int,
gymName varchar(15),
primary key (sensorTimeStamp, gymName)
);
DROP TABLE if EXISTS averageInTable;
CREATE TABLE averageInTable (
dayOfWeek varchar(15),
... |
CREATE DATABASE yeticave
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE yeticave;
CREATE TABLE users
(
id INT AUTO_INCREMENT PRIMARY KEY,
registration_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
email VARCHAR(128) NOT NULL UNIQUE,
login VAR... |
--PROBLEM 04
--Delete all teachers, whose phone number contains ‘72’.
DELETE FROM StudentsTeachers
WHERE TeacherId IN (
SELECT
Id
FROM Teachers
WHERE Phone LIKE '%72%')
DELETE FROM Teachers
WHERE Phone LIKE '%72%'
|
update #__md_member
inner join #__users u on u.username = "Jon"
set insurance_group = "25-69", mod_date = current_timestamp(), mod_user_id = u.id
where #__md_member.insurance_group = "16-70";
update #__md_member
inner join #__users u on u.username = "Jon"
set insurance_group = "70-79", mod_date = current_timestamp()... |
-- Creando base de datos y seleccionandola para realizar consultas
CREATE DATABASE Proyecto_POO_BDD;
USE Proyecto_POO_BDD;
SET LANGUAGE us_english;
-- Tables section.
CREATE TABLE CITIZEN(
id int PRIMARY KEY,
dui varchar(10) NOT NULL,
full_name varchar(60) NOT NULL,
age int NOT NULL,
direction varchar(60) NOT NUL... |
--Add existing shared cause codes from 'UNLICENSED SW' alert type for New Alert Type: SOM4a: IBM SW Instances Reviewed(7=SWIBM)
delete from ALERT_TYPE_CAUSE
where ALERT_TYPE_ID = (select ID from ALERT_TYPE where CODE = 'SWIBM')
and ALERT_CAUSE_ID in (select ID from ALERT_CAUSE where NAME like '%5+6%');
insert into ALE... |
CREATE TABLE `erm_bia` (
`id` int(11) NOT NULL auto_increment,
`assets` varchar(255) default NULL,
`business` varchar(255) default NULL,
`rto` int(11) default NULL,
`rtpo` int(11) default NULL,
`priority_level_id` int(11) default NULL,
`resp_info_id` int(11) default NULL,
PRIMARY KEY (`id`),
KEY `FKA... |
--修改人:蒲勇军
--修改时间:2012-09-19
--添加相应字段
alter table FBS_CORP_ITEM add ITEM_PERCENT numeric(5,2);
alter table FBS_CORP_ITEM add RELATE_ITEMCODE VARCHAR(200);
alter table FBS_CORP_ITEM add CORRESPOND_ITEMCODE VARCHAR(200);
alter table FBS_CORP_ITEM add IS_MUST_ITEM VARCHAR(1);
|
select pf.id, re.geom as end_id, pf.start_ray_id, rs.geom, degrees(ST_Azimuth(re.geom, rs.geom)) as angle_facade, degrees(ST_Azimuth(rc.geom, p.latlng)) as angle_view, (degrees(ST_Azimuth(re.geom, rs.geom)) - degrees(ST_Azimuth(rc.geom, p.latlng))) as difference
from panos_facades pf
inner join rays_facades rs on rs.i... |
/* Создание процедуры получения статистики по дилеру */
CREATE OR ALTER PROCEDURE GET_DEALER_STATISTICS
(
TIRAGE_ID VARCHAR(32),
DEALER_ID VARCHAR(32)
)
RETURNS
(
ALL_COUNT INTEGER,
USED_COUNT INTEGER,
NOT_USED_COUNT INTEGER
)
AS
DECLARE VARIABLE TEMP_SUM NUMERIC(15,2);
BEGIN
SELECT COUNT(*)
FROM /*PR... |
CREATE procedure sp_acc_updateadvancecollection(@DocumentID Int,
@AdjustedAmount Decimal(18,6))
as
update Collections set Balance = Balance - @AdjustedAmount
where DocumentID = @DocumentID
|
CREATE TABLE users(
id SERIAL PRIMARY KEY,
username VARCHAR NOT NULL,
pass VARCHAR NOT NULL
);
CREATE TABLE books(
isbn BIGINT PRIMARY KEY,
title VARCHAR NOT NULL,
author VARCHAR NOT NULL,
year INT NOT NULL
);
ALTER TABLE books
ALTER COLUMN isbn TYPE VARCHAR;
ALTER TABLE b... |
# --- !Ups
ALTER TABLE "case" ADD COLUMN id serial;
ALTER TABLE charge RENAME case_id TO case_number;
ALTER TABLE testify_record ADD COLUMN case_id INTEGER;
ALTER TABLE charge ADD COLUMN case_id INTEGER;
UPDATE testify_record tr SET case_id=(SELECT id FROM "case" c WHERE tr.case_number = c.case_number);
UPDATE char... |
SELECT
DATE(DATE_SUB(closed_on, INTERVAL DAYOFMONTH(closed_on) - 1 DAY)) AS time,
COUNT(DISTINCT issue_id) as value,
"Late" as metric
FROM redmine_issues_summary WHERE closed_on is not null and $__timeFilter(closed_on) and
assignee_name in($a_name) and
assignee_groups in($a_groups) and
priority in($prior) and
... |
# 优惠劵表
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_coupon` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` char(30) NOT NULL DEFAULT '' COMMENT '名称',
`desc` char(60) NOT NULL DEFAULT '' COMMENT '描述',
`bg_color` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券颜色(0红色, 1紫色, 2黄色, 3蓝色, 4橙... |
CREATE TABLE names (
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
pronunciation_ids INT[]
);
|
CREATE database job_grabber;
\c job_grabber
CREATE schema jobs
create table sql_ru_jobs
(
id bigserial not null primary key,
url text not null,
title varchar(300) not null,
date date not null
)
CREATE TABLE post
(
id bigse... |
REM ------------------------------------------------------------------------
REM REQUIREMENTS:
REM SELECT on dba_ tabbles
REM ------------------------------------------------------------------------
REM PURPOSE:
REM drop all user's indexes
REM ---------------------------------------------------------------------... |
/*
https://www.hackerrank.com/challenges/placements/problem
You are given three tables: Students, Friends and Packages. Students contains two columns: ID and Name. Friends contains two columns: ID and Friend_ID (ID of the ONLY best friend). Packages contains two columns: ID and Salary (offered salary in $ thousands pe... |
create table LINEPACKRANDOM(
nr_random number,
nr_posicao number,
dt_mes_ano date,
st_acesso char(1)
)
/
create public synonym LINEPACKRANDOM for LINEPACKRANDOM
/
grant insert, select, update on LINEPACKRANDOM to linepack_role
/ |
SPOOL C:\Nur_Suhaira_5841549_A2\solution5Output;
/* ==============================================
Student Name: Nur Suhaira
Student Number: 5841549
Description: Assignment 2 Task 5
Date written: 9th May 2018
================================================
====================Qn 5(a)=====================*/
... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2021 at 07:29 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- Before running drop any existing views
DROP VIEW IF EXISTS q0;
DROP VIEW IF EXISTS q1i;
DROP VIEW IF EXISTS q1ii;
DROP VIEW IF EXISTS q1iii;
DROP VIEW IF EXISTS q1iv;
DROP VIEW IF EXISTS q2i;
DROP VIEW IF EXISTS q2ii;
DROP VIEW IF EXISTS q2iii;
DROP VIEW IF EXISTS q3i;
DROP VIEW IF EXISTS q3ii;
DROP VIEW IF EXISTS q... |
SET DATABASE TO Goliath;
CREATE UNIQUE INDEX ON UserTable (username) STORING (key);
CREATE UNIQUE INDEX ON UserTable (key) STORING (username);
CREATE INDEX ON Feed (userid) STORING (title, description, url, link, latest);
CREATE INDEX ON Article (userid, id, read)
STORING (title, summary, content, parsed, link, ... |
------------------------------------
--Author: Jeffrey Yu
--RevisedDate: 2016-11-25
------------------------------------
If object_id('tempdb..#FilingCIK') is not null Drop table #FilingCIK
select distinct fsc.FilingId,fsc.CIK
into #FilingCIK
from DocumentAcquisition..FilingSECContract as fsc
where fsc.Filin... |
-- MySQL Script generated by MySQL Workbench
-- Sat Apr 4 17:34:49 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_MODE='TR... |
USE SIAR
ALTER TABLE Bebida
drop column QuantidadeLitro
ALTER TABLE Bebida
add Tipo varchar(10) |
CREATE EXTENSION IF NOT EXISTS citext;
CREATE TABLE IF NOT EXISTS users
(
id SERIAL NOT NULL
CONSTRAINT users_pkey
PRIMARY KEY,
nickname CITEXT NOT NULL,
fullname TEXT NOT NULL,
about TEXT,
email CITEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS forum
(
id SERIAL NOT NULL
CONSTR... |
[getList]
SELECT DISTINCT xx.`appointmentgroupname`,xx.objid
FROM hrmis_appointmentcasual xx
WHERE NOW() BETWEEN xx.`effectivefrom` AND xx.`effectiveuntil`
AND xx.appointmentgroupname LIKE $P{searchtext}
[findDailyWageByTranch]
SELECT si.* FROM hrmis_tblemploymentplantilla p
INNER JOIN references_tbljobpositio... |
-- CREATE TABLE STATEMENTS
CREATE TABLE Bundeslaender (
kuerzel VARCHAR(2) PRIMARY KEY,
name VARCHAR(22)
);
CREATE TABLE Parteien (
id SMALLINT PRIMARY KEY,
kuerzel VARCHAR(20),
name VARCHAR(93),
farbe VARCHAR(31),
wahljahr SMALLINT
);
CREATE TABLE Wahlkreise (
id ... |
DROP TABLE IF EXISTS #TABLES
SELECT CONCAT(TABLE_SCHEMA,'.',TABLE_NAME) AS OBJECT_NAME,'base_file_date' as FIELD_NAME
INTO #TABLES FROM INFORMATION_SCHEMA.VIEWS ORDER BY TABLE_SCHEMA,TABLE_NAME
UPDATE #TABLES SET FIELD_NAME = 'date_import' WHERE OBJECT_NAME = 'service_bbgbo.v_credit_risk_dbrs_out'
UPDATE #TABLES SET... |
CREATE Procedure Get_Item_details_TaxInRate @Product_Code nvarchar(30), @Locality int = 1
As
Select
Product_Code,
ProductName,
Isnull(TaxInclusive,0) IsTI ,
(Case @Locality
When 2 then
Isnull(a.cst_Percentage,0)
Else
Isnull(a.Percenta... |
/*
Atividade 2
Crie um banco de dados para um e commerce, onde o sistema trabalhará com as informações dos produtos deste ecommerce.
Crie uma tabela produtos e utilizando a habilidade de abstração e determine 5 atributos relevantes dos produtos para se trabalhar com o serviço deste ecommerce.
Popule esta tabela com... |
DELETE FROM `t_pinlei_second` WHERE category2 in ('精选肉类','海鲜水产');
DELETE FROM `t_pinlei_third` WHERE `category3` in ('大豆油','烹饪油','牛肉','水产干货','淡水活鲜','水产专柜(其他)','叶菜','羊肉','冷冻肉类','水发类蔬菜(其他)','海水活鲜','猪肉','周转筐专用','米','月饼','品牌特色畜禽(其他)','西瓜类(其他)','瓜类','水产干货(其他)','香瓜类(其他)','农产专柜(其他)','禽肉'); |
/*
Name: Widg
Data source: 4
Created By: Admin
Last Update At: 2015-10-15T19:13:19.919214+00:00
*/
select page_url,
date_time,
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal, " month(TIMESTAMP(CONCAT(REPLACE(table_id,"_","-"),"-01"))) >= month(DATE('{{startdate}}')) and month(TIMEST... |
INSERT INTO User VALUES (101, 'Somnath', 'Das Adhikari', 'somnathdasadhikari', 'somnathdasadhikari@gmail.com', '$2a$10$S.IMF0b69tBTOvdTgyNIceu7eXQ9.6QzT4E8ajF.5eEwAoTT/Qrxa'); |
-- Using subqueries only, write a SQL statement that returns the names of those
-- students that are taking the courses Physics and US History.
select student_name from students where student_no in
(select distinct student_no from student_enrollment where course_no in
(select course_no from courses where course_title... |
SELECT ename, sal, comm, COALESCE(sal+comm, sal)
FROM employees
/
|
CREATE DEFINER=`root`@`localhost` PROCEDURE `Lister_elements_sinistre`(IN id_s INT)
BEGIN
Select * FROM elementsinistres WHERE idEvenement = id_s;
END |
-- 1------------------------------------
SELECT * FROM shop.users;
SELECT * FROM sample.users;
START TRANSACTION;
INSERT INTO sample.users SELECT * FROM shop.users WHERE id = 1;
DELETE FROM shop.users WHERE id = 1 LIMIT 1;
COMMIT;
-- 2--------------------------------------
CREATE OR REPLACE VIEW products_catalogs AS
S... |
CREATE DATABASE burger_db;
USE burger_db;
CREATE TABLE burgers (
id int NOT NULL AUTO_INCREMENT,
burger_name VARCHAR (100) NOT NULL,
devoured BOOLEAN DEFAULT false NOT NULL,
createdAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);
|
/*adaptat dupa cursul lui Jennifer Widom de Baze de date de la Stanford
definirea si utilizarea view-urilor
functioneaza in SQLite, MySQL, Postgres si Oracle
**************************************************************/
/**************************************************************
view simplu
sID s... |
-- SQL Lesson: Inserting Rows
-- Q1: The director for A Bug's Life is incorrect, it was actually directed by John Lasseter
UPDATE movies
SET director = "John Lasseter"
WHERE id = 2;
-- Q2: The year that Toy Story 2 was released is incorrect, it was actually released in 1999
UPDATE movies
SET year = 1999
WHERE id = 3... |
--#################################################################################################################################################
--USEFUL QUERY ON STK TABLES
select
tkr,
s.seq, --sma1.seq, sma2.seq,
--to_char(tkr_date, 'yyyy-mm-dd') ||chr(9)|| open ||chr(9)|| high ||chr(9)|| low ||chr(9)||close ||chr... |
CREATE TABLE `comments` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(11) unsigned DEFAULT '0',
`user_id` int(11) unsigned DEFAULT '0',
`comment` varchar(255) DEFAULT NULL,
`created_at` int(11) DEFAULT 0,
`updated_at` int(11) DEFAULT 0,
PRIMARY KEY (`id`),
KEY `comments_article_id` (... |
select min(10), 3 as `col1`
group by 2
having 6 > 5
order by 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.