text
stringlengths
6
9.38M
/*正式上线数据*/ INSERT INTO MERCHANT_CATEGORY(ID,NAME) values(1,'ROOT'); insert into resources (id,path,description) values(1,'/manager/member/info/**','会员信息管理资源'); insert into resources (id,path,description) values(2,'/manager/member/consume/**','会员消费查询资源'); insert into resources (id,path,description) values(3,'/manage...
SELECT j25_cbsubs_subscriptions.user_id AS 'Member No', j25_users.name AS Name, j25_cbsubs_subscriptions.id as 'Subscription ID', j25_cbsubs_subscriptions.status AS 'Membership Status', DATE_FORMAT(j25_cbsubs_subscriptions.last_renewed_date, '%d-%m-%Y') AS 'Date Renewed', DATE_FORMAT(j25_cbsubs_subscriptions.expir...
with start_date as ( select '{{start_date}}' as string, '{{start_date}}'::date as date, '{{start_date}}'::timestamp as timestamp, date_trunc('month', '{{start_date}}'::date) as month_date ), dates as ( select (select month_date from start_date) + (interval '1' month * generate_series(0,month_count::int)...
-- 코드를 입력하세요 SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE (NAME LIKE '%EL%' or NAME LIKE '%el%' ) and ANIMAL_TYPE = 'Dog' order by NAME; # select name from animal_ins # where name # like '%el%' # or '%EL%' # and animal_type = 'dog'
/* FIT9132 2019 S1 Assignment 2 Q3 ANSWERS Student Name:tianxin hang Student ID:26792923 Comments to your marker: */ SET AUTOCOMMIT OFF; /* (i)*/ CREATE OR REPLACE TRIGGER change_item_code AFTER UPDATE OF item_code ON item FOR EACH ROW BEGIN IF updating THEN UPDATE item_treatment ...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Dec 07, 2017 at 05:06 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 5.6.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
-- Distributions SET SEARCH_PATH TO markus; DROP TABLE IF EXISTS q1; -- You must not change this table definition. CREATE TABLE q1 ( assignment_id integer, average_mark_percent real, num_80_100 integer, num_60_79 integer, num_50_59 integer, num_0_49 integer ); -- You may find it convenient t...
-- Use DATE_TRUNC to pull month level information about the first order ever placed in the orders table. SELECT DATE_TRUNC('month', MIN(occurred_at)) AS min_month FROM orders; -- Use the results of the previous query to find only the orders that took place in the same month and year as the first order, and then pull ...
SELECT c3.sel_profile_value.profile_value_name AS moment ,c3.sel_profile_value.profile_type_id AS typee ,ROUND(percent / percent_network, 2) AS indexx FROM ( SELECT profile_value ,volume ,((SUM(volume)) / (SUM(SUM(volume)) OVER())) AS percent ,...
-- This is the first comment. -- This is the 2nd comment. -- This is ignored. -- CMD TOP-COMMENT -- END -- OUTPUT -- This is the first comment. -- This is the 2nd comment. -- END
DROP TABLE Posts; DROP TABLE Users; CREATE TABLE Users ( username VARCHAR(12) NOT NULL UNIQUE, password VARCHAR(15) NOT NULL, joindate DATE DEFAULT CURRENT_DATE, id INT NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY ); CREATE TABLE Posts ( content VARCHAR(140) NOT NULL, authorid INT NOT NUL...
set hive.execution.engine=spark; drop table if exists dws.dws_fact_work_measure; create table if not exists dws.dws_fact_work_measure ( date_key string COMMENT '日期代理键', product_key string COMMENT '产品代理键', sub_company_name string comment '子公司', apply_no string COMMENT '订单编号', product_version string COMMENT '版本', ...
ALTER TABLE mhac.game_results ADD CONSTRAINT ux_game_period UNIQUE (game_id, period);
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 10.1.19-MariaDB - mariadb.org binary distribution -- Server OS: Win64 -- HeidiSQL Version: 9.3.0.4984 -- ------------------------------------------------...
SELECT * FROM emp_manager AS em ORDER BY em.emp_no; SELECT e1.* FROM emp_manager AS e1 JOIN emp_manager AS e2 ON e1.emp_no = e2.manager_no;
-- MySQL dump 10.13 Distrib 5.6.33, for debian-linux-gnu (x86_64) /*!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 */; /*!40103 SET @OLD_TIME_Z...
insert into role values(1,"ROLE_ADMIN"); insert into role values(2,"ROLE_CUSTOMER"); insert into role values(3,"ROLE_FACULTY"); insert into user values("admin",1,"admin"); insert into user_role values("admin",1); insert into admin values(1,"FairField","IOWA","1000 N 4th Street","52557", NULL,"admin@yogastudio.com","adm...
-- This file should undo anything in `up.sql` DROP TABLE IF EXISTS word_entry_tags; DROP TABLE IF EXISTS word_entry_notes;
create proc sp_put_PRHeader ( @VendorID nvarchar(15), @BillID int , @AdjustmentDate datetime, @DocumentID int, @ForumId nvarchar(50), @Value Decimal(18,6), @Balance Decimal(18,6), @Status int) as INSERT INTO AdjustmentReturnAbstract_Received ( VendorID, BillID, AdjustmentDate, DocumentID, ForumId, Value, Balance, S...
/*PROC LOGIN*/ DELIMITER ;; CREATE PROCEDURE IF NOT EXISTS usp_login( IN username varchar(20), IN password varchar(50) ) BEGIN SELECT cliente_id, cliente_tipo, cliente_username, cliente_nome, cliente_apelido, cliente_datanasc, cliente_morada, cliente_codigopostal, cliente_idpais, cliente_nif, cliente_tele, cliente_...
#TRIGGERS drop trigger if exists upd_rnccn_utrancell_h; delimiter // create trigger upd_rnccn_utrancell_h before insert on RNCCN_UTRANCELL_H for each row begin set NEW.CI = getCellId_Cell(NEW.UtranCell); set NEW.LAC = getLocationCode_Cell(NEW.UtranCell); set NEW.NodeBName = getNodeBfromCell(NEW.CI,NEW.LAC); end; //...
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 `vd_mall` DEFAULT CHARACTER SET utf8; USE `vd_mall`; -- -------------------...
-- Select all the employees who were born between January 1, 1952 and December 31, 1955 and their titles and title date ranges -- Order the results by emp_no SELECT Distinct titles.title,titles.emp_no,employees.first_name,employees.last_name,titles.from_date,titles.to_date FROM employees, titles WHERE birth_date betwee...
CREATE OR REPLACE VIEW V_DTYS13014 AS SELECT 0 hzbz, 2 rowes, NULL c1, NULL c2, de042 c3, pc, de042, '000' de084, (SELECT SUM(n6) FROM dtys13002 b WHERE a.de042 = b.de042 AND a.pc = b.pc GROUP BY de042, pc) n2, (SELECT SUM(n7) FR...
alter table weibos add COLUMN deleted INTEGER NOT NULL DEFAULT 0;
ALTER PROCEDURE SP_ALMACENAMIENTO_VALIDA_POSICION_EXIST @POSICION VARCHAR(100), @BOD_CODIGO VARCHAR(10), @EMP_CODIGO INT AS BEGIN -- CREADO POR <max.llaupi@espol.cl> -- VERSIÓN 21 - 04 - 2017 -- CONSULTAMOS SI EL POSICION INGRESADO TIENE PRODUCTOS ASOCIADOS A LA BODEGA Y EMPRESA ACTUAL ...
-- ex03_select.sql /* select 문 - DML, DQL - 사용 빈도가 가장 높다. - 목적: 데이터베이스로부터 원하는 데이터를 가져오는 명령어(읽기) select 컬럼리스트 from 테이블명 where 검색조건 - 자세한 내용: google 검색 > sql 11g select documentation a. select 컬럼리스트 b. from 테이블명 c. where 검색조건 문장을 구성하는 각 절들은 실행 순서가 이미 정해져 있다. 1. from 테이블명 2. where 검색조건 3. select 컬럼리스트 1. select 절...
UPDATE npc_template SET gfxID=9073,sex=0 WHERE id=40006;
create database ngan_hang; create table ngan_hang.customers( customer_number int (11) not null, fullname varchar(50) not null, address varchar (250) not null, email varchar (50), phone int (10), PRIMARY KEY (customer_number)); create table ngan_hang.accounts( account_number int (11) not null, account_type varchar(50) ...
-- user table, username must be unique create table if not exists `user_user` ( `id` int unsigned auto_increment, `username` varchar(255) not null, `password` varchar(255) not null, `created_at` timestamp default current_timestamp, `updated_at` timestamp default now() on update now(), primary ke...
-- -- Struktura tabulky `guessNumber` -- CREATE TABLE IF NOT EXISTS `guessNumber` ( `id` int(11) NOT NULL, `twitchUser_id` int(11) NOT NULL, `channel_id` int(11) NOT NULL, `points` int(11) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAM...
ALTER TABLE users ADD CONSTRAINT dups UNIQUE(email, username);
use ods; create table if not exists dwd.dwd_orders_repay_record ( apply_no STRING COMMENT '订单编号', category STRING COMMENT '类别', report_date timestamp COMMENT ' 汇总日期', product_name STRING COMMENT '产品名称', borrowing_amount double COMMENT ' 借款金额', platform_value_date timestamp COMMENT ' (平台)借款起息日', pl...
USE ims; CREATE TABLE `vendor` ( `VendorID` int(10) unsigned NOT NULL, `OrganizationID` int(10) unsigned DEFAULT NULL, `SPOCID` int(10) unsigned DEFAULT NULL, `VendorTypeID` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`VendorID`), KEY `OrganizationID_idx` (`OrganizationID`), KEY `SPOCID_FK_idx` (`SPOCI...
create table cars(id int,car_name varchar(20),car_type varchar(20),brand varchar(20)); insert into cars values (1,"i10","hatchback","Hyundai"); insert into cars values (2,"i20","hatchback","Hyundai"); insert into cars values (3,"XUV","SUV","Mahendra"); insert into cars values (4,"City","sedan","Honda"); insert into ca...
Drop Table userprofile; CREATE TABLE `userprofile` ( id int auto_increment, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `cartProducts` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, primary key(id) ...
Spool .\dbschemas.log; @db_users.sql Spool off; connect ofb/ofb spool .\ofb.log; @ofb.sql spool off; spool .\ofb_template_data.log; @ofb_template_data.sql spool off; exit
-- Create Database. CREATE DATABASE SocMulDB; USE SocMulDB; -- Create USER for Database. CREATE LOGIN SocMulUser WITH PASSWORD = 'socMul@2020'; -- Multiplication table. CREATE TABLE MULTIPLICATION ( MULTIPLICATION_ID INT NOT NULL, OPERAND_1 INT NOT NULL, OPERAND_2 INT NOT NULL, PRIMARY KE...
ALTER TABLE `logs_logbooks` DROP COLUMN `state`, DROP COLUMN `created`, DROP COLUMN `status_id`, DROP INDEX `logs_logbooks_status_id_fk`, DROP FOREIGN KEY `logs_logbooks_status_id_fk`;
/* Создание процедуры определения результата Заказ создан */ CREATE PROCEDURE /*PREFIX*/DR_CREATE_ORDER ( ORDER_ID VARCHAR(32), ACTION_ID VARCHAR(32), RESULT_ID VARCHAR(32) ) RETURNS ( DETECTED INTEGER ) AS DECLARE CNT INTEGER; BEGIN DETECTED=0; SELECT COUNT(*) FROM /*PREFIX*/ORDERS WHERE ORDE...
Insert into "AD_REF_LIST" ("AD_REF_LIST_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY", "UPDATED","UPDATEDBY","VALUE","NAME","DESCRIPTION","AD_REFERENCE_ID","VALIDFROM", "VALIDTO","ENTITYTYPE") values (50040,0,0,'Y',to_date('02.03.07','DD.MM.RR'),0,to_date('02.03.07','DD.MM.RR'), 0,'S','Run...
/* Create database. */ DROP DATABASE IF EXISTS pucaratest; CREATE DATABASE pucaratest; USE pucaratest; /* Grant all privileges to the root user. */ GRANT ALL ON pucaratest.* TO 'root'@'localhost'; /* Create 'category' table. */ DROP TABLE IF EXISTS category; CREATE TABLE category ( `id` SMALLINT NOT...
USE `arenafifadb`; DELIMITER $$ DROP PROCEDURE IF EXISTS `spGetAllTimesFasePreCopaOfCampeonato` $$ CREATE PROCEDURE `spGetAllTimesFasePreCopaOfCampeonato`(pIdCamp INTEGER) begin select P.*, T.NM_Time, T.DS_Tipo from TB_TIMES_FASE_PRECOPA P, TB_TIME T where P.ID_Time = T.ID_Time and P.ID_CAMPEONATO = p...
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50540 Source Host : localhost:3306 Source Database : onlinekefu Target Server Type : MYSQL Target Server Version : 50540 File Encoding : 65001 Date: 2016-03-12 17:27:42 */ SET FOREIGN_K...
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table ingredient ( id bigint not null, name varchar(255), frozen boolean, category va...
UPDATE links_general.ref_familyname , links_frequency.familyname_a SET links_general.ref_familyname.standard = links_frequency.familyname_a.name_b , links_general.ref_familyname.standard_code = 'o' , links_general.ref_familyname.standard_source = 'LS1' WHERE links_general.ref_familyname.original...
CREATE DATABASE `dingdangcat` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
-- ============================================= -- Author: <Shaik Mohammad Rafeeq> -- Create date: <11/25/2018> -- Description: <Get Generic error info> -- ============================================= CREATE PROCEDURE USP_CT_GetErrorInfo AS SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS E...
-- MySQL Script generated by MySQL Workbench -- Sat Aug 18 13:08:03 2018 -- 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='ON...
-- do NOT add blank lines -- do NOT add a slash or semi-colon terminator -- this script is called from inside a SQL statement -- -- as seen in dba_hist_active_sess_history -- this is only needed for 10g and lower -- 11g+ use the v$sqlcommand view -- Order is crucial, as the rownum will be the same as the stored opcode...
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50129 Source Host : localhost:3306 Source Database : phpsystem_db Target Server Type : MYSQL Target Server Version : 50129 File Encoding : 65001 Date: 2016-10-24 20:59 */ use course; SET FOREIGN_K...
{% macro deduplicate_data(column_names, order_by, relation) %} {% set dedup_query %} SELECT * EXCEPT(row_number) FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY {{ column_names }} order by {{ order_by }} desc ) row_number FROM {{ relation }} ) WHERE ...
-- dropSQLIndex.sql -- USE CS144; ALTER IGNORE TABLE Item DROP INDEX SellerIndex; ALTER IGNORE TABLE Item DROP INDEX BuyPriceIndex; ALTER IGNORE TABLE Item DROP INDEX EndTimeIndex; ALTER IGNORE TABLE Bid DROP INDEX BidderIndex;
/****** Object: StoredProcedure [dbo].[prc_CWI_GetJobMediaBuyAttributes] Script Date: 5/13/2014 10:15:27 PM ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_GetJobMediaBuyAttributes]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[prc_CWI_GetJobMediaBuyAttributes] GO /*...
-- phpMyAdmin SQL Dump -- version 3.5.2.2 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 11, 2014 at 08:16 PM -- Server version: 5.5.27 -- PHP Version: 5.4.7 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
--Bitmap Index Examples CREATE BITMAP INDEX typeid_i ON books (SYS_TYPEID(author)); --The following creates a bitmap index on the table oe.hash_products, which was created in "Hash Partitioning Example": CREATE BITMAP INDEX product_bm_ix ON hash_products(list_price) LOCAL(PARTITION ix_p1 TABLESPACE tbs_01, ...
create user bgr@'%' identified by 'alterbo159753'; grant all on hiscore.* to bgr@'%'; select * from record ; select * FROM record ORDER BY score desc , date DESC LIMIT 1 ; INSERT INTO RECORD VALUES( 'test' ,10 ,SYSDATE() ); select sysdate();
CREATE Procedure spr_Vendor_Rating_Items (@Vendor nvarchar(20), @FromDate Datetime, @ToDate Datetime) As Select Distinct GRNDetail.Product_Code, "Item Code" = GRNDetail.Product_Code, "Item Name" = Items.ProductName, "Quantity Supplied" = Isnull(sum(case Batch_Products.Free when 0 then IsNull(Batch_P...
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.6.26) # Database: SHOPPING_CART # Generation Time: 2017-02-22 12:42:34 +0000 # *****************************************...
create table chat( num int primary key auto_increment, id varchar(20), regdate datetime, content varchar(1000) )
ALTER TABLE beancounter_employee ALTER COLUMN "hourly_rate" TYPE numeric(6, 2);
/* * PostgreSQL DML for creating the role and database for Pluralsight's * course Apache Camel Introduction to Integration. This should be run * for initial setup or when the database needs to be re-loaded. */ -- Role: order -- Password: order CREATE ROLE orders LOGIN ENCRYPTED PASSWORD 'md55f038b5aa...
USE taxi; CREATE TABLE drivers ( id int IDENTITY(1,1) primary key, name varchar(100) not null, ); CREATE TABLE cars ( id int IDENTITY(1,1) primary key, number varchar(100) not null UNIQUE, ); CREATE TABLE cars_to_drivers ( id int IDENTITY(1,1) primary key, driver_id int REFERENCES drivers (id), cars_id int REF...
CREATE TABLE regiao( id SERIAL PRIMARY KEY, nome VARCHAR(50) NOT NULL, geom GEOMETRY NOT NULL )
# ************************************************************ # Sequel Ace SQL dump # Versión 3034 # # https://sequel-ace.com/ # https://github.com/Sequel-Ace/Sequel-Ace # # Equipo: localhost (MySQL 5.5.5-10.4.18-MariaDB) # Base de datos: tasca_m8 # Generation Time: 2021-06-17 15:22:59 +0000 # ************************...
INSERT into groups(id, title, description) VALUES (1, 'group1', 'testGroup1'); INSERT into groups(id, title, description) VALUES (2, 'group2', 'testGroup2'); INSERT into groups(id, title, description) VALUES (3, 'group3', 'testGroup3');
-- phpMyAdmin SQL Dump -- version 4.2.12deb2+deb8u1build0.15.04.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 17, 2015 at 02:58 PM -- Server version: 5.6.27-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 ...
.ifndef INCLUDED_CYFITTERGNU_INC .set INCLUDED_CYFITTERGNU_INC, 1 .include "cydevicegnu_trm.inc" /* BLE_bless_isr */ .set BLE_bless_isr__INTC_CLR_EN_REG, CYREG_CM0_ICER .set BLE_bless_isr__INTC_CLR_PD_REG, CYREG_CM0_ICPR .set BLE_bless_isr__INTC_MASK, 0x1000 .set BLE_bless_isr__INTC_NUMBER, 12 .set BLE_bless_isr__INTC...
/* Warnings: - Added the required column `pair_id` to the `User` table without a default value. This is not possible if the table is not empty. */ -- DropForeignKey ALTER TABLE "User" DROP CONSTRAINT "User_id_fkey"; -- AlterTable ALTER TABLE "User" ADD COLUMN "pair_id" INTEGER NOT NULL; -- AddForeignKey ALT...
--<ScriptOptions statementTerminator=";"/> CREATE TABLE kullanici ( ID INT NOT NULL, ADI VARCHAR(255), DURUM INT, SOYADI VARCHAR(255), PRIMARY KEY (ID) ) ENGINE=InnoDB;
-- List tables SHOW TABLES;
-- PL/SQL : 선언부(create...) / 실행부(Begin-End) -- 선언부 create or replace procedure InsertBook( mybookid in number,-- in 입력 매개변수라는 뜻 mybookname in varchar2, mypublisher in varchar2, myprice in number) as begin insert into book(bookid,bookname,publisher,price) values(mybookid,mybookname,mypublisher,myprice); end; / EXEC In...
-- Create a database and a table -- The table must be in the database created CREATE DATABASE IF NOT EXISTS hbtn_0d_usa; CREATE TABLE IF NOT EXISTS hbtn_0d_usa.states (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(256) NOT NULL);
REM ------------------------------------------------------------------------ REM REQUIREMENTS: REM REM ------------------------------------------------------------------------ REM PURPOSE: REM REM ------------------------------------------------------------------------ set linesize 96 set pages 100 set feed...
# ************************************************************ # Sequel Pro SQL dump # Version 4096 # # http://www.sequelpro.com/ # http://code.google.com/p/sequel-pro/ # # Host: 127.0.0.1 (MySQL 5.7.15) # Database: test # Generation Time: 2016-12-06 10:07:08 +0000 # ****************************************************...
DROP TABLE hospitals; CREATE EXTERNAL TABLE hospitals ( provider_id string, hospital_name string, address string, city string, state string, zip_code string, county_name string, phone_number string, hospital_type string, hospital_ownership string, emergency_service string, meet_EHRS string, h...
----------------------- --DML ----------------------- drop table dept01; create table dept01 as select * from dept where 1<0; desc dept01; -- 새로운 부서 정보를 입력: 행단위 입력 -- insert into 테이블 이름 (입력하고자 하는 컬럼들) values(데이터들) -- 입력 컬럼의 순서와 입력 데이터의 순서는 같아야한다. insert into dept01 (deptno, dname, loc) values (10, 'MANAGER', 'SEOUL...
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. -- -- You can write comments in this file by starting them with two dashes, like -- these lines here. -- Drop the database DROP DATABASE IF EXISTS tourna...
/******** Commonly Used Functions for Time Series ***********/ /* we will assume last digit of server_id is department id */ CREATE VIEW time_series.vw_utilization AS( SELECT *, server_id % 10 AS dept_id FROM time_series.utilization ); SELECT * FROM time_series.vw_utilization LIMIT 5; --------------------- LEAD(...
-- -- Update sql for MailWizz EMA from version 1.4.0 to 1.4.1 --
create table `group` ( id int(11) not null auto_increment, name varchar(255), primary key (id) ); create table group_role ( id int(11) not null auto_increment, group_id int(11), role_id int(11), role_type_id int(11), foreign key (group_id) references `group` (id) on delete cascade, foreign key (role_id) refer...
--- --- Copyright 2012 Johns Hopkins University --- --- 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 appli...
CREATE TABLE IF NOT EXISTS "Cliente" ( "codigoCliente" INTEGER NOT NULL, "dni" VARCHAR(9) NOT NULL, PRIMARY KEY("codigoCliente" AUTOINCREMENT), FOREIGN KEY("dni") REFERENCES "Persona"("dni") );
DROP TABLE IF EXISTS Sugar; DROP TABLE IF EXISTS Goals; DROP TABLE IF EXISTS Diary; DROP TABLE IF EXISTS Food; DROP TABLE IF EXISTS User; CREATE TABLE User ( userId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, userName VARCHAR(100) NOT NULL, name VARCHAR(100) NOT NULL, gender VARCHAR(1) NOT NULL...
SELECT count(assistance_requests) as total_assistances, name FROM students JOIN assistance_requests ON students.id = student_id WHERE students.name = 'Elliot Dickinson' GROUP BY students.name;
/* Navicat Premium Data Transfer Source Server : 本地 Source Server Type : MySQL Source Server Version : 80026 Source Host : localhost:3306 Source Schema : stu_info Target Server Type : MySQL Target Server Version : 80026 File Encoding : 65001 Date: 31/08/2021 10:16:10...
.mode column .headers on PRAGMA foreign_keys = ON; -- Querying data -- Every month the following reports need to be run: -- Find the top 5 offices with the most sales for that month. SELECT "1. Finding the top 5 offices with the most sales for that month (Feb.)"; SELECT "---------------------------------"; SELECT Off...
CREATE procedure sp_ser_bookstock_issue_fmcg(@PRODUCT_CODE nvarchar(15), @TRACK_BATCH int, @CAPTURE_PRICE int) AS IF @CAPTURE_PRICE = 1 BEGIN IF @TRACK_BATCH = 1 BEGIN Select Batch_Number 'batch', Expiry 'expiry', SUM(Quantity) 'qty', SalePrice 'price', PKD, Isnull(Free, 0) 'free', IsNull(Max...
/** * Pull 2015-2016 Words Read Data */ SELECT s.local_student_id, field_words_read_aug15 AS aug, field_words_read_sep15 AS sep, field_words_read_oct15 AS oct, field_words_read_nov15 AS nov, field_words_read_dec15 AS dec, field_words_read_jan16 AS jan, field_words_read_feb16 AS feb, field_words_read_mar16 AS mar,...
INSERT INTO "game" VALUES(0,"2018-2-21 13:40:36.877952", "2018-2-25 13:40:36.877952", 10, 10, 5); INSERT INTO "game" VALUES(1,"2018-2-22 12:40:36.877952", null, 10, 10, 5); INSERT INTO "game" VALUES(2,"2018-2-23 12:40:36.877952", null, 12, 12, 10); INSERT INTO "player" VALUES(0, "Fu1L_s41V0_n05CoP3_720", 0); INSERT IN...
SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; SET NAMES utf8mb4; CREATE DATABASE `testdb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; USE `testdb`; DROP TABLE IF EXISTS `drink`; CREATE TAB...
CREATE PROCEDURE [actual].[pDel_task] AS TRUNCATE TABLE [actual].[task]
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 25, 2019 at 06:59 PM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.3.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
/* Создание таблицы приложений */ CREATE TABLE /*PREFIX*/APPLICATIONS ( APPLICATION_ID VARCHAR2(32) NOT NULL, NAME VARCHAR2(100) NOT NULL, DESCRIPTION VARCHAR2(250), LOCKED INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY (APPLICATION_ID) ) -- /* Создание просмотра таблицы приложений */ CREATE VIEW /*PREFIX*/S_APP...
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `boyo_gamelist` -- ---------------------------- DROP TABLE IF EXISTS `boyo_gamelist`; CREATE TABLE `boyo_gamelist` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `name` varchar(20) NOT NULL COMMENT 'game_name', `logimg` varc...
Create Procedure Sp_IsLeafLevelCategory(@CategoryID Int) as Begin If Not Exists(Select * From ItemCategories where ParentID = @CategoryID) Select 1 else Select 0 End
drop database if exists dbdragon; create database dbdragon; use dbdragon; CREATE TABLE dragons ( dragon varchar(45), sexe char(1), longueur int(5), nb_ecaille int(10), feu boolean, comp_amoureux varchar(45) ); CREATE TABLE repas ( dragon varchar(45), produit varchar(45), quantite int(10) ); CREATE TABLE nourritures ...
/*Programs*/ INSERT INTO programs VALUES('Data','DAI'); INSERT INTO programs VALUES('IT','IT'); INSERT INTO programs VALUES('Sjöfart och logistik','SJL'); INSERT INTO programs VALUES('Tekniskfysik', 'TFY'); /*Students*/ INSERT INTO students VALUES(1,1,'Gabriel','Data'); INSERT INTO students VALUES(2,2,'Isak','Data'); I...
-- Find the sales in terms of total dollars for all orders in each year, ordered from greatest to least. Do you notice any trends in the yearly sales totals? SELECT DATE_PART('year', occurred_at) yyyy, SUM(total_amt_usd) FROM orders GROUP BY DATE_PART('year', occurred_at) ORDER BY yyyy; -- Which month did Parch & Po...
use Equipo2_final; -- pacientes INSERT INTO PACIENTE (idPaciente, FName, Lname, Sexo, Email, Fechanacimiento) VALUES(1, 'Priscila', 'Treviño', 'F', 'pris123@outlook.com', '1960-02-10' ); INSERT INTO PACIENTE (idPaciente, FName, Lname, Sexo, Email, Fechanacimiento) VALUES(2, 'Demetrio', 'Osuna', 'M', 'eldeme1999@gmail....