text
stringlengths
6
9.38M
SELECT birth FROM PEOPLE WHERE name is 'Emma Stone';
CREATE TABLE tarjay_reviews ( id INT, created_at VARCHAR(16), author VARCHAR(256), stars INT, body VARCHAR, would_recommend BOOLEAN, title VARCHAR(256), comfort INT, style INT, value INT, sizing INT, helpful_votes INT, product_id INT, PRIMARY KEY (product_id, id) ); COPY tarjay_reviews( i...
DROP TABLE customer IF EXISTS; CREATE TABLE customer ( id BIGINT IDENTITY PRIMARY KEY, name VARCHAR(255), email VARCHAR(255) ); CREATE TABLE stock ( id INT IDENTITY PRIMARY KEY, symbol VARCHAR(10) UNIQUE, price DECIMAL(10,2) ); CREATE TABLE customer_stocks ( id BIGINT IDENTITY PRIMARY...
\set ON_ERROR_STOP true CREATE TYPE lift_data_template AS ENUM( 'weight/reps', 'height/reps', 'timeInSeconds', 'weight/timeInSeconds' ); CREATE TABLE lifts( id serial PRIMARY KEY, name varchar(256), workout integer NOT NULL, data_template lift_data_template NOT NULL, sets integer[]...
select trim(rat.nm_rat) as ramo_atividade, gem.nm_gem as grupo_empresarial, emp.nm_emp as empresa, crt.cd_crt as cartao, cun.nr_cpf_cnpj_cun as cpf, to_char(crt.dt_inc_usr, 'dd/MM/yyyy') as data_inclusao_cartao, to_char(crt.dt_pri_dps_crt, 'dd/MM/yyyy') as data_primeiro_deposi...
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; DROP TABLE `roles_privileges`; DROP TABLE `privileges`; DROP TABLE `userPasswordResetToken`; DROP TABLE `userVerificationToken`; DROP TABLE `user_roles`; DROP TABLE `roles`; CREATE TABLE IF NOT EXISTS `privileges` ( `id` bigint(20) NOT NUL...
DROP TABLE IF EXISTS trail; CREATE TABLE trail ( id SERIAL PRIMARY KEY, name VARCHAR(255), summary VARCHAR(255), trail_id INT, difficulty VARCHAR(255), stars DECIMAL(3,1), img_small VARCHAR(255), latitude DECIMAL (12,7), longitude DECIMAL (12,7), length DECIMAL(4,1), conditionstatus TEXT, cond...
select promotions , total , cast(promotions as decimal(15,4))/cast(total as decimal(15,4))*100 from ( select sum(ss_ext_sales_price) promotions from store_sales , store , promotion , date_dim , customer , customer_address , item where ss_sold_dat...
ALTER TABLE `boyo_advertisement` ADD COLUMN `title` VARCHAR(50) NOT NULL ; CREATE TABLE IF NOT EXISTS `boyo_userCOOInfo` ( `userId` int(11) NOT NULL, `level` int(11) NOT NULL, `chargeGold` int(11) NOT NULL, `lastLoginTime` int(11) NOT NULL, `ext` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, P...
# modifications to be applied to pre-57 databases to bring them to rel-57 state ## ---------------------renaming group_id into node_id in genomic_align_group table: # ALTER TABLE genomic_align_group DROP KEY genomic_align_id; ALTER TABLE genomic_align_group DROP COLUMN type; ALTER TABLE genomic_align_group CHANGE gro...
CREATE Procedure sp_Get_Beat_Customer @CustomerID nvarchar(30) as SELECT Beat.Description FROM Customer INNER JOIN Beat_Salesman ON Customer.CustomerID = Beat_Salesman.CustomerID INNER JOIN Beat ON Beat.BeatID = Beat_Salesman.BeatID Where Customer.CustomerID = @CustomerID
create SCHEMA ALIENGAMESCHEMA; drop TABLE ALIENGAMESCHEMA.RECORDS; create TABLE ALIENGAMESCHEMA.RECORDS(name VARCHAR(20), winTime INTEGER); insert into ALIENGAMESCHEMA.RECORDS values ('Abraham', 100000); select * from ALIENGAMESCHEMA.RECORDS;
-- ============================================= -- Author: Satish Kayada -- Create date: 01/02/2018 -- Description: Display Header on Tab of Inward outward Page only -- ============================================= Create PROC [Stock].[usp_Appointment_Stock_Inward_To_Outward_Header_Text] AS BEGIN Select Coun...
CREATE TABLE `code_attribute` ( `CODE_ATTRIBUTE_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `MARK` varchar(255) NOT NULL COMMENT '一组信息的唯一标识,默认是表名', `COLUMN_NAME` varchar(255) NOT NULL COMMENT '表字段名', `ATTRIBUTE_NAME` varchar(255) DEFAULT NULL COMMENT 'java 属性名', `DESCRIPTION` varchar(500) NOT NULL COMME...
--<서브 쿼리를 이용한 테이블 생성과 컬럼 수정> --; 테이블을 생성하는 작업은 요구 분석 -> 모델링 작업을 거치는 -- 아주 섬세하고 복잡한 과정을 통해 이루어진다. -- 테이블 생성의 기본 이론은 데이터는 변하지만 데이터의 구조는 -- 안정적이어야 한다는 기본적인 토대 위에서 만들어진다. -- 그러므로 테이블의 생성은 모델링시 초기에 모두 만들어지고 -- 이후 서비스 운영중에는 테이블을 만들지 않는 것을 원칙으로 한다 -- 만일 운영중에 테이블이 생성되거나 특히 운영중에 테이블의 -- 구조가 변경된다는 것은 사실상 요구분석과 모델링에 문제가 -- 있었다...
create table Users( username varchar(20) not null, password varchar(20), primary key(username) on cascade delete ) create table Emails( address varchar(30) not null, subscribed bool, primary key(address) on cascade delete ) create table has( address varchar(30) not null, username varchar(20) not null, primar...
DELETE * FROM employee;
SELECT title FROM Movies a left join Rating b on a.mID = b.mID WHERE stars is null
-- 计算各个部门的员工个数,表头显示为:部门、员工个数 SELECT department 部门, COUNT(id) 员工个数 FROM employee GROUP BY department;
ALTER TABLE `users` ADD `verified` tinyint(1) NOT NULL DEFAULT '0';
-- phpMyAdmin SQL Dump -- version 4.1.4 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Feb 14, 2016 at 05:47 AM -- Server version: 5.6.15-log -- PHP Version: 5.4.24 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ...
insert into burger(burger_name,devoured)values("classic cheeseburger",true); insert into burger(burger_name,devoured)values("hamburger",true); insert into burger(burger_name,devoured)values("bacon and bleu cheese burger",false); insert into burger(burger_name,devoured)values("vegi burger",true);
/*insert into tb_member values (2,'test2','1234','Tom''s company','tom@nate.com',sysdate); select*from tb_member;*/ delete from tb_member where id=3; insert into tb_member values (3, 'test3', '1234', '''machine''','tom@nate.com',sysdate); -- 디비 자체내에서 각가의 레코드를 식별하기 위한 필드가 하나 추가된다 -- rowid select rowid, id, userid, ...
--张少举 --新增 --付款模版匹配 DECLARE column_exist NUMBER; BEGIN SELECT COUNT(*) INTO column_exist FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'NIS_BILLHEAD' AND COLUMN_NAME = 'TEMPLATE_ID_1'; IF column_exist = 0 THEN EXECUTE IMMEDIATE 'alter table NIS_BILLHEAD add TEMPLATE_ID_1 NUMBER(10)'; END IF; ...
CREATE TABLE usuarios( id SERIAL PRIMARY KEY NOT NULL, login int NOT NULL , senha VARCHAR (32) NOT NULL, nome VARCHAR (50) NOT NULL ); CREATE TABLE clientes ( id SERIAL PRIMARY KEY NOT NULL, matricula VARCHAR(20) NOT NULL, nome VARCHAR(50) NOT NULL, tipo VARCHAR(10) ); CREATE TABLE equipamentos ( id SERIAL PRIMARY ...
/* SQL Datei Datenbank für wsm */ -- Löscht die Datenbank falls Sie schon existiert -- DROP DATABASE IF EXISTS wsm; -- Erstellt eine neua datenbank -- create database wsm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; -- script soll mit der wsm datenbank arbeiten -- use wsm; -- Erstellt die Ta...
# ************************************************************ # Sequel Pro SQL dump # Version 4096 # # http://www.sequelpro.com/ # http://code.google.com/p/sequel-pro/ # # Host: localhost (MySQL 5.6.13) # Database: SQLHardWay # Generation Time: 2014-03-29 18:19:43 +0000 # **********************************************...
/* 结算中心-已退税,未退税 */ delimiter $ drop procedure if exists Proc_Settlements_SumTaxReceived $ create procedure Proc_Settlements_SumTaxReceived(sInvoiceNO varchar(255)) begin declare fTaxReceived decimal(18,2); set fTaxReceived=(Select Sum(ifnull(ExportRebatesValue,0)) as ExportRebatesValue From ExportRebatesDetai...
create or replace package github_issues_milestones as /** Interface to github issues milestones API * @author Morten Egan * @project OracleGit * @version 0.1.0 */ /** List milestones for a repository * @author Morten Egan * @param git_account The account that owns the repository * @param repos_name The name...
UPDATE SectionType SET Name = 'Bulletin Zone', Code = 'BULLETIN_ZONE' WHERE ID = 11
select * from pt999 where menuid like '2501%' for update select * from jxjdjhb where lx = 1 and lb = 2 and de011 = 2014 and hzbz = '0' select * from jxjdjhb where lx = 1 and lb = 2 and de011 = 2014 and hzbz = '1' select * from jxjdjhb_mx where lx = 1 and lb = 2 and hzbs = 'Y' for update select * from jxjdjhb_mx whe...
CREATE INDEX idx_ratings_movie_id ON ratings(movie_id);
CREATE TABLE [display].[resource_plan] ( [sys_id_display_value] NVARCHAR(MAX) NULL, [end_date_display_value] NVARCHAR(MAX) NULL, [short_description_display_value] NVARCHAR(4000) NULL, [plan_type_display_value] NVARCHAR(MAX) NULL, [role_display_value] NVARCHAR(MAX) NULL, [notes_display_value] NVARCHAR(4000...
CREATE OR REPLACE VIEW History_Min_Time_View AS SELECT MAX(timeentered) as timeentered, tid_id as tid_id, interface_id as interface_id FROM pm_history WHERE timeentered <= SYSDATE -1 GROUP BY tid_id, interface_id UNION SELECT MIN(timeentered) as timeentered, tid_id as tid_id, interface_id as interfac...
-- TITLE1: Apply Rules -- TITLE2: Viewing Rules that Specify a Destination Queue on Apply -- DESC: You can specify a destination queue for a rule using the SET_ENQUEUE_DESTINATION procedure in the DBMS_APPLY_ADM package. If an apply process has such a rule in its positive rule set, and a message satisfies the rule, the...
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- 主機: localhost -- 產生時間: 2020 年 03 月 01 日 15:26 -- 伺服器版本: 5.5.64-MariaDB -- PHP 版本: 7.3.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA...
--SELECT prod_id, prod_name --FROM Products --WHERE prod_name LIKE 'F%y' --SELECT prod_id, prod_name --FROM Products --WHERE prod_name LIKE '_ inch teddy bear'; --SELECT prod_id, prod_name --FROM Products --Where prod_name LIKE '%Bean bag%'; --SELECT prod_id, prod_name --FROM Products --WHERE prod_name COLLATE ...
DROP TABLE APPEALS; DROP TABLE CRIME_OFFICERS; DROP TABLE CRIME_CHARGES; ALTER TABLE CRIMINALS ADD CONSTRAINT criminals_criminalID_pk PRIMARY KEY(criminal_id); ALTER TABLE CRIMINALS ADD CONSTRAINT criminals_vstatus_ck CHECK(v_status IN ('Y','N')); ALTER TABLE CRIMINALS ADD CONSTRAINT crimin...
create or replace trigger Q2_2 before insert or update of noCage on LesAnimaux for each row Declare fct varchar(20); begin select fonction into fct from LesCages where nocage = :new.nocage; if fct != :new.fonction_cage then raise_application_error(-20001, 'cage incompatible'); end if; end;
CREATE DATABASE IF NOT EXISTS `psgris` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `psgris`; -- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64) -- -- Host: localhost Database: psgris -- ------------------------------------------------------ -- Server version 5.7.29-0ubuntu0.18.04.1 /*!40101 SET @OLD_CHARACTER...
/* Navicat MySQL Data Transfer Source Server : Tanyaconnect Source Server Version : 50716 Source Host : localhost:3306 Source Database : javaee Target Server Type : MYSQL Target Server Version : 50716 File Encoding : 65001 Date: 2019-06-09 17:54:23 */ SET FOREIGN_KEY_CHECKS=0; --...
INSERT INTO guestbook_entry (ID,EMAIL,CONTENT, LAST_UPDATE) VALUES (1000, 'example@example.org', 'Inserted via ebean.ddl.seedSql property', GETDATE());
--Create procedure 5: pro_enroll select * from enrolled; create or replace procedure pro_enroll(sname_in IN varchar, cname IN varchar) as student_num number; begin select s.snum into student_num from student s where s.sname = sname_in; insert into ENROLLED values (student_num, cname); end pro_enroll; / --run proce...
CREATE PROCEDURE sp_get_InvoiceDetailReceived_only (@INVOICENO INT) AS SELECT Items.Product_Code, Items.ProductName, NULL, Batch_Number, InvoiceDetailReceived.Quantity, InvoiceDetailReceived.SalePrice, InvoiceDetailReceived.TaxCode, InvoiceDetailReceived.DiscountPercentage,...
create table if not exists categories ( id integer not null constraint categories_pkey primary key, description varchar(255), name varchar(255) not null, position integer not null, slug varchar(255) not null constraint uk_category_slug unique, topi...
USE peer_pressure_db; INSERT INTO users (username, firstname, lastname, email, image_url) VALUES ("PastorOfMuppets", "Keith", "Allmon", "adcatcher73@gmail.com", "https://scontent-sjc3-1.xx.fbcdn.net/v/t1.0-9/20708206_10203703099854122_2463177902792792532_n.jpg?_nc_cat=0&oh=0cd3fb9b72df9bc579cb683a903e0db7&oe=5B507F97"...
DROP TABLE IF EXISTS highest_education; CREATE TABLE highest_education (value SMALLINT PRIMARY KEY, property VARCHAR (30) NOT NULL); INSERT INTO highest_education (value, property) VALUES (0, 'Prefer Not To Say'); INSERT INTO highest_education (value, property) VALUES (1, 'High School'); INSERT INTO highest_educati...
CREATE TABLE IF NOT EXISTS categories( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255), content TEXT, slug VARCHAR(255), parent INTEGER DEFAULT null ); CREATE TABLE IF NOT EXISTS products( id INTEGER PRIMARY KEY AUTOINCREMENT, content TEXT, slug VARCHAR(25...
CREATE DATABASE restaurantorderingsystem_db; USE restaurantorderingsystem_db; DROP TABLE IF EXISTS `item`; CREATE TABLE `item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, `description` varchar(200) NOT NULL, `price` double NOT NULL, `availability` tinyint(1) NOT NULL, PRIMARY KEY (...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 31, 2018 at 05:36 AM -- Server version: 10.1.26-MariaDB -- PHP Version: 7.1.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
ALTER TABLE ContactUs ADD AppointmentDateTime datetime
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE TABLE IF NOT EXISTS pod_monthly_metrics ( id uuid PRIMARY KEY DEFAULT (uuid_generate_v4()), pod_name TEXT NOT NULL, pod_version TEXT NOT NULL, downloads integer, apps integer, tests integer, extensions integer, watch integer, tries integer, r...
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_ClientPortal_UnExpireUser]') AND type in (N'P')) DROP PROCEDURE [dbo].[prc_ClientPortal_UnExpireUser] GO CREATE PROC prc_ClientPortal_UnExpireUser @UserID int ...
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : ven. 02 juil. 2021 à 15:30 -- Version du serveur : 10.4.17-MariaDB -- Version de PHP : 8.0.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_S...
CREATE TABLE users ( id int(11) NOT NULL, prenom VARCHAR(30) NOT NULL, nom VARCHAR(30) NOT NULL, login VARCHAR(30) NOT NULL, mdp VARCHAR(30) NOT NULL, bday DATE NOT NULL, mw VARCHAR(1) NOT NULL ); ALTER TABLE users ADD PRIMARY KEY (id); ALTER TABLE users MODIFY id int(11) NOT NULL ...
use TelerikAcademy; select count(*) as [Total Sales Department Employees] from (select * from Employees e where e.DepartmentID = (select d.DepartmentID from Departments d where d.Name = 'Sales')) x;
INSERT INTO xh_basecount.product_stw_daycount SELECT sta1.userid, sta1.username, sta1.schoolid, sta1.schoolname, sta1.classname, sta1.classid, sta1.bookname, sta1.bookid, sta4.hp, sta4.credit, sta6.newintegral, sta2.sumhomework, sta2.sumselfwork, sta2.numtopic, sta2.sumright, sta2.sumright/sta2.numtopic AS rightlv, st...
USE employees SELECT mgr.emp_no, YEAR(mgr.from_date) AS fd FROM titles AS mgr, titles AS other WHERE mgr.emp_no = other.emp_no AND mgr.title = 'Manager' AND mgr.title <> other.title AND YEAR(mgr.from_date) = YEAR(other.from_date); SELECT emp_no, YEAR(from_date) AS fd FROM titles WHERE title = 'Manager' AND (emp_no, Y...
CREATE TABLE `transfer` ( `id` bigint(20) NOT NULL, `transfer_amount` decimal(19,2) DEFAULT NULL, `transferred_id` bigint(20) DEFAULT NULL, `transferrer_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK_TRANSFER_ACCOUNT_TRANSFERRED_ID` (`transferred_id`), KEY `FK_TRANSFER_ACCOUNT_TRANSFERRER_ID` (`...
DROP TABLE paystubs CASCADE CONSTRAINTS; --DROP TABLE pays CASCADE CONSTRAINTS; --DROP TABLE id_pw CASCADE CONSTRAINTS; DROP TABLE members CASCADE CONSTRAINTS; DROP TABLE departments CASCADE CONSTRAINTS; CREATE TABLE departments( dept_no NUMBER(10) NULL PRIMARY KEY, dept_name ...
insert into course (id, title, description) values (1, 'Angular Fundamentals', 'This is a course'); insert into course (id, title, description) values (2, 'Angular Fundamentals', 'This is a course'); insert into course (id, title, description) values (3, 'Angular Fundamentals', 'This is a course'); insert into custome...
/* ** https://leetcode.com/problems/article-views-i/ */ -- method 1 SELECT DISTINCT v.author_id AS id FROM Views v WHERE v.author_id = v.viewer_id ORDER BY id;
create table account( id number(5), password VARCHAR2(20), name VARCHAR2(20), balance number(8,2)); alter table account add primary key(id); desc account; insert into account values(1,'First Member','Joginder Singh',8500.50); select * from account; commit;
drop database hibernate; create database hibernate; use hibernate; create table news_inf ( news_id int primary key auto_increment, title varchar(255), content varchar(255) ); insert into news_inf values(null , '疯狂Java联盟' , '疯狂Java联盟成立了,网址是www.crazyit.org'); insert into news_inf values(null , '天...
--修改日期:20121219 --修改人:费滔 --需求编号:兴业账户信息查询 --修改内容:兴业账户信息查询,新增字段,用来接受接口扫回的数据 alter table BIS_ACC_HIS_BAL add CONTROL_MONEY NUMBER(15,2); alter table BIS_ACC_HIS_BAL add FREEZE_MONEY NUMBER(15,2); comment on column BIS_ACC_HIS_BAL.CONTROL_MONEY is '控制额度'; comment on column BIS_ACC_HIS_BAL.FREEZE_MONEY is '冻结额度'; commit;
CREATE USER tcr; ALTER USER tcr CREATEDB; CREATE DATABASE tcr; ALTER DATABASE tcr OWNER TO tcr; GRANT ALL PRIVILEGES ON DATABASE tcr TO tcr; CREATE USER tcr_test; ALTER USER tcr_test CREATEDB; CREATE DATABASE tcr_test; ALTER DATABASE tcr_test OWNER TO tcr_test; GRANT ALL PRIVILEGES ON DATABASE tcr_test TO tcr_test;
USE p2_population; -- EXTRACT: PERCENTAGES OF GENDER DISTRIBUTION IN BARCELONA PER YEAR -- Gender distribution per year SELECT year, gender, sum(immigrants) as total_immigrants_per_gender FROM gender GROUP BY gender, year; -- Immigrants per year SELECT year, sum(immigrants) as total_immigrants FROM gender GROUP BY ye...
USE db_alakatos; SELECT count(*) AS 'films' FROM historique_membre WHERE (DATE(date) > DATE('2006-10-30') AND DATE(date) < DATE('2007-07-27')) OR DATE(date) LIKE "%-12-24";
Create Function fn_ListInvNo_ITC(@DocType as nVarchar(50)) Returns @Invoice Table(InvoiceID Int) As Begin if @DocType = N'All DocType' or @DocType ='%' Set @DocType ='%' Insert Into @Invoice Select InvoiceID From InvoiceAbstract Where DocSerialType like @DocType And IsNull(Status,0) & 192 =0...
/* 产品推荐 */ delimiter $ drop trigger if exists Tgr_RecommendationAddress_AftereInsert $ create trigger Tgr_RecommendationAddress_AftereInsert after insert on RecommendationAddress for each row begin call Proc_Customers_LastRecommend(new.CustomerShortName);-- 客户资料-最近推荐 end$ /*恢复结束符为;*/ delimiter ;
--MARCO PO RECORDS IN DESC ORDER WITH FREIGHT/COST INFORMATION BY ITEM # SELECT CONVERT(varchar, PH.ord_dt, 101) AS OrdDate, LTRIM(LEFT(PH.ord_no,6)) AS PO#, PL.line_no, CASE WHEN LTRIM(AP.vend_no) = '8859' THEN 'AIFEI' WHEN LTRIM(AP.vend_no) = '8830' THEN 'PAFIC' ELSE AP.vend_name END AS vend_name, ...
/*Challenge 1*/ SELECT A.[PurchaseOrderID] ,A.[PurchaseOrderDetailID] ,A.[OrderQty] ,A.[UnitPrice] ,A.[LineTotal] ,B.[OrderDate] ,[OrderSizeCategory] = CASE WHEN A.[OrderQty] > 500 THEN 'Large' WHEN A.[OrderQty] > 50 THEN 'Medium' ELSE 'Small' END ,[ProductN...
 DROP TABLE IF EXISTS player; CREATE TABLE player ( playerId int(11) NOT NULL, fName varchar(45) NOT NULL, lastName varchar(45) NOT NULL, position varchar(2) NOT NULL, team varchar(45) NOT NULL, PRIMARY KEY (playerId) ) DROP TABLE IF EXISTS stats; CREATE TABLE stats ( pointsScored int(11) NOT NU...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 07, 2019 at 10:52 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.0.32 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
CREATE TABLE StudentCourse ( IdStudent INT NOT NULL, IdCourse INT NOT NULL, PRIMARY KEY (IdStudent, IdCourse), FOREIGN KEY (IdStudent) REFERENCES Student, FOREIGN KEY (IdCourse) REFERENCES Course )
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: 04-Out-2018 às 01:50 -- Versão do servidor: 5.7.21 -- PHP Version: 7.0.29 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CH...
-- phpMyAdmin SQL Dump -- version 4.3.8 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 26, 2016 at 05:37 PM -- Server version: 5.6.24 -- PHP Version: 5.6.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
-- phpMyAdmin SQL Dump -- version 4.2.12deb2+deb8u1build0.15.04.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 10, 2017 at 06:38 PM -- Server version: 5.6.28-0ubuntu0.15.04.1 -- PHP Version: 5.6.4-4ubuntu6.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET ...
-- ********************************************** -- IT2351 Assignment 6 Part 1 - Abimael Rivera -- Creating a procedure named productCount() that displays if the amount of products we have is greater than or less than 20 -- ********************************************** DROP PROCEDURE IF EXISTS productCount; DELIMITE...
/* Monitor\Search view name 1. receipts receipts 'Receipts' 2. pullSignals pullsignals 'Pull Signals' 3. pullLines pulllines 'Pull Lines' 4. dispatches dispatches 'Dispatches' 5. events events 'Events' 6. sa ...
# Oefening 10: # Toon de naam & populatie van de Nederlandse steden. # Toon ook de naam & populatie van de Belgische steden. SELECT city.name, city.population FROM city INNER JOIN country ON city.countrycode=country.code WHERE country.name="Netherlands" UNION SELECT city.name, city.population FROM city INNER JOIN coun...
Recursion and Common Table Expression (CTE)
-- We first looked at duplicates of the cgm data (the implanted device -- that provides readings every 5 minutes, but has to be regularly -- uploaded to Diasend). Duplicates can appear for reasons that are -- not clear. -- This script is idempotent. -- In this script, we look at duplicates in the mgm data (finger sti...
BEGIN TRANSACTION; CREATE TABLE `comments` ( `id` INTEGER, `sub_id` INTEGER, `comment` TEXT, PRIMARY KEY(`id`) ); INSERT INTO `comments` VALUES (27,51,'eJTZryxk,c'); INSERT INTO `comments` VALUES (28,52,'eJTZryxk,c'); INSERT INTO `comments` VALUES (29,53,'eJTZryxk,c'); INSERT INTO `comments` VA...
CREATE DATABASE if not exists power_rangers; USE power_rangers; CREATE TABLE if not exists customers ( cust_id INT, fname STRING, lname STRING, email STRING, phone MAP<STRING, STRING>, order_ids ARRAY<INT>, order_value STRUCT<min:INT,max:INT,avg:INT,total:INT> ) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' C...
# SALES # SELECT # x.Month # , x.Sales # , y.Fees 'Vendor Fees' # , ROUND(y.Fees / x.Sales * 100, 2) 'COGS %' # FROM # ( # SELECT # MONTHNAME(t.dts) 'Month' # , SUM(t.amount) 'Sales' # FROM orders o # JOIN client_transactions t ON t.orderid = o.id # WHERE o.companyid = 1 # ...
CREATE DATABASE IF NOT EXISTS `test` DEFAULT CHARACTER SET utf8; -- DROP TABLE IF EXISTS `job`; CREATE TABLE IF NOT EXISTS `job` ( `JOB_NAME` VARCHAR(100) DEFAULT '' COMMENT '任务名', `JOB_GROUP` VARCHAR(30) DEFAULT 'DEFAULT' COMMENT '任务组', `JOB_CLASS_NAME` VARCHAR(200) DEFAULT '' COMMENT '任务实现类', `TRIGGER_TYPE` ...
-- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- -------------------------------------------------------------------------------- use TutorSegundoGrado; DROP PROCEDURE IF EXISTS Obt...
ALTER TABLE ? NOCHECK CONSTRAINT ALL ALTER TABLE ? DISABLE TRIGGER ALL DELETE FROM ? ALTER TABLE ? CHECK CONSTRAINT ALL ALTER TABLE ? ENABLE TRIGGER ALL SELECT * FROM ?
DROP TABLE IF EXISTS cash_sessions;
/** * Creates table matching Illuminate section ids with subjects and travel groups. * When syncing gradebooks, teachers see the Illuminate section id, but not the * local section id which contains the travel group name. This query pulls this * information and presents it in a format teachers can easily use. */ ...
CREATE DEFINER=`root`@`localhost` PROCEDURE `sendinvite`(IN typedEmailID VARCHAR(50),IN adEmailID VARCHAR(50)) BEGIN insert userssendinvite select typedEmailID,adEmailID; insert userconnectionrespond select adEmailID,typedEmailID; Call showallconnections(typedEmailID...
-- Rename resource_description.parameters to stop confusion with job/analysis/pipeline parameters: ALTER TABLE resource_description CHANGE COLUMN parameters submission_cmd_args VARCHAR(255) NOT NULL DEFAULT ''; -- Add resource-specific worker_cmd_args : ALTER TABLE resource_description ADD COLUMN worker_cmd_a...
INSERT INTO gam_departments VALUES(1,'IT hardware'); INSERT INTO gam_departments VALUES(2,'Finance'); INSERT INTO gam_departments VALUES(3,'Human Resources'); INSERT INTO gam_departments VALUES(4,'IT software'); INSERT INTO gam_departments VALUES(5,'Security'); INSERT INTO gam_employees VALUES(1,'IONESCU','Alin'...
CREATE USER jflanegan IDENTIFIED BY password; //2. login denied without create session GRANT CREATE SESSION, CREATE ANY TABLE, ALTER ANY TABLE TO jflanegan; CREATE ROLE CUSTOMERREP; GRANT INSERT, DELETE ON STUDENT.ORDERS TO CUSTOMERREP; GRANT INSERT, DELETE ON STUDENT.ORDERITEMS TO CUSTOMERREP; GRAN...
/* VERSION Formatted */ SELECT A.*, C.DES SERVICE_NAME, D.STRING04 HARDGOOD_TYPE FROM ( SELECT CA.ACTION_TYPE_ENTRY , CA.CAXACT, CA.CACHKNUM, CA.CACHKDATE, CA.CACHKAMT_PAY, TTD.DESCRIPTION, BA.BILLING_ACCOUNT_CODE, CA.ORDER_ID_ENTRY, CAREFERENCE4, CAREFERENCE5, CASE ...
-- phpMyAdmin SQL Dump -- version 4.4.15.9 -- https://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: May 31, 2018 at 09:29 PM -- Server version: 5.6.37 -- PHP Version: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ...
CREATE TABLE dbo.Products ( ProductID int PRIMARY KEY NOT NULL, ProductName varchar(25) NOT NULL, Price money NULL, ProdDesc text NULL );
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS `quantox`; CREATE DATABASE quantox; USE quantox; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT,...
USE dmab0914_2sem_7; CREATE TABLE Zipcode_City ( zipcode int NOT NULL, city varchar(15) NOT NULL, PRIMARY KEY(zipcode, city) )