text
stringlengths
6
9.38M
/* 1. invisible index (disable index) */ show full tables; show index from barang; -- cara membuat visible / invisible index alter table barang alter index barcode_barang_idx invisible / visible;
USE BD_CLIENTS; -- ############################### -- # INSERT INTO CLIENTS -- ############################### INSERT INTO CLIENTS VALUES(null,"client1@gmail.com","Prenom1","Nom1","azert",null,null,null); INSERT INTO CLIENTS VALUES(null,"client2@gmail.com","Prenom2","Nom2","yuiop",null,null,null); INSERT INTO CLIENTS...
DROP DATABASE IF EXISTS seqburgers_db; CREATE database seqburgers_db; USE seqburgers_db; CREATE TABLE burgers ( id INT NOT NULL AUTO_INCREMENT, burger_name VARCHAR(100) NOT NULL, devoured BOOLEAN DEFAULT false, PRIMARY KEY (id) ); SELECT * FROM burgers;
--Warby Parker Capstone --Section 1.1 SELECT * FROM survey LIMIT 10; --Section 1.2 SELECT question, COUNT (question) FROM survey GROUP BY question; --Section 1.4 SELECT * FROM quiz LIMIT 5; SELECT * FROM home_try_on LIMIT 5; SELECT * FROM purchase LIMIT 5; --Section 1....
CREATE SCHEMA IF NOT EXISTS ###APP_NAME###db /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */; USE ###APP_NAME###db; DROP USER IF EXISTS '###APP_NAME###dbadmin'; CREATE USER IF NOT EXISTS '###APP_NAME###dbadmin'@'%' IDENTIFIED BY '###DB_PASSWD###'; GRANT ALL ON ###APP_NAME###db.* TO '###APP_NAME###d...
with a as( select buyer_id, product_name from sales left join product on sales.product_id = product.product_id ) select distinct buyer_id from a where product_name = 'S8' and buyer_id not in ( select distinct buyer_id from a where product_name = 'iPhone')
(SELECT upper(acct) as account, round(sum(original),2) as principle, round(sum(outstanding),2) as outstanding, round(rate * 100,2) || '%' as rate FROM loans WHERE outstanding > 0 GROUP BY 1,4 )UNION( SELECT 'TOTAL' as account, round(sum(original),2) as principle, round(sum(outstanding),2) as outstanding, roun...
SELECT songs.id as song_id, artists.id as artist_id, songs.title, artists.name FROM songs INNER JOIN artists ON songs.artist_id = artists.id WHERE LOWER(artists.name) LIKE LOWER('%BON%') OR LOWER(songs.title) LIKE LOWER('%BON%')
delete from HtmlLabelIndex where id=27502 / delete from HtmlLabelInfo where indexid=27502 / INSERT INTO HtmlLabelIndex values(27502,'元素上下方插入图片') / INSERT INTO HtmlLabelInfo VALUES(27502,'元素上下方插入图片',7) / INSERT INTO HtmlLabelInfo VALUES(27502,'Element into the picture below',8) / INSERT INTO HtmlLabelInfo VALUES(27...
delete from tbl_reminders where group_id in (select group_id from tbl_groups where project_id = %1)
--select * from Patient --USE Final_Project; --select MAX(Patientblanace) AS [Max Amount Owed] --FROM Patient --select SUM(Patientblanace) AS [Total Amount Owed] --FROM Patient --CREATE VIEW DoctorTest AS --SELECT DoctorRatePerYear, DoctorID, Doctorskill, Doctorpatienthistory --FROM Doctor --WHERE Doct...
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: -- Версия на сървъра: 5.5.39 -- PHP Version: 5.4.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_C...
CREATE TABLE managers( index_number INT IDENTITY(1,1) NOT NULL ,lear_profile_index_number INT NOT NULL)
SELECT A.TZ_SCORE_INS_ID FROM PS_TZ_MP_PW_KS_TBL A, PS_TZ_AQ_YHXX_TBL D WHERE D.OPRID = A.TZ_PWEI_OPRID AND A.TZ_DELETE_ZT <> 'Y' AND A.TZ_PSHEN_ZT <> 'C' AND A.TZ_APPLY_PC_ID =? AND A.TZ_APP_INS_ID =? AND A.TZ_CLASS_ID =? AND D.TZ_DLZH_ID =?
DELETE FROM `wp_attribute` WHERE `model_name`='custom_menu'; DELETE FROM `wp_model` WHERE `name`='custom_menu' ORDER BY id DESC LIMIT 1; DROP TABLE IF EXISTS `wp_custom_menu`;
alter table EXTERNAL_TRANSACTION add column FAILURE_REASON varchar(255)#
/** * Extracts column information for tables in a SQL Server DAtabase. The script also looks for a number * of custom properties. These can be set for additional metadata. If not found, the column returns null. * These properties are; * MS_Description: Standard custom property for Table and Column label. * OE_Desc...
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you ma...
CREATE TABLE IF NOT EXISTS `echo_apps` ( `id` varchar(255) NOT NULL, `key` varchar(255) NOT NULL, `secret` varchar(255) NOT NULL, `max_connections` integer(10) NOT NULL, `enable_stats` tinyint(1) NOT NULL, `enable_client_messages` tinyint(1) NOT NULL, `max_backend_events_per_min` integer(10)...
create table student( vipid integer(12), stuname char(10) not null, sex enum('±£ÃÜ','Å®','ÄÐ') not null default '±£ÃÜ', college char(50) not null, grade integer(4) not null, stuid integer(12) primary key, tele integer(11), qq integer(12), note char(100) );
select db_name(vfs.database_id) as database_name, mf.name as logical_file_name, pr.io_type, sum(pr.io_pending_ms_ticks) as sum_io_pending_ms_ticks, count(*) as [count] from sys.dm_io_pending_io_requests pr left join sys.dm_io_virtual_file_stats(null, null) vfs on vfs.file_handle = pr.io_handle ...
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 05, 2014 at 02:49 AM -- Server version: 5.5.37-0ubuntu0.14.04.1 -- PHP Version: 5.5.9-1ubuntu4.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CL...
-- improve performance of mailstats queries -- -- UNIQUE_PLAYERS_YESTERDAY was taking ~4000 secs this runs in ~20 secs -- -- create or replace view UNIQUE_PLAYERS_YESTERDAY as -- select distinct a.player_id, p.partner_id -- from rpt_account_activity a join strataprod.PLAYER p on a.player_id = p.player_id -- where audi...
/*==============================================================*/ /* DBMS name: MySQL 5.0 */ /* Created on: 26/02/2021 22:03:36 */ /*==============================================================*/ /*================================================...
SELECT TABNAME,CNT FROM ( SELECT 'ACCOUNT_ORACLE' AS TABNAME, COUNT(*) AS CNT FROM ACCOUNT_ORACLE UNION SELECT 'ACCOUNT' AS TABNAME, COUNT(*) AS CNT FROM ACCOUNT UNION SELECT 'ACCOUNT_STATUS_TYPE' AS TABNAME, COUNT(*) AS CNT FROM ACCOUNT_STATUS_TYPE UNION SELECT 'ACCOUNT_TYPE' AS TABNAME, COUNT(*) AS CNT FROM ACCOUNT_T...
CREATE TABLE `DADOS2` ( `DADO_ID_PK` INTEGER PRIMARY KEY AUTO_INCREMENT, `DADO_NOME` VARCHAR(100) DEFAULT NULL, `DADO_CPF` VARCHAR(11) UNIQUE NOT NULL, `DADO_DTNASC` DATE DEFAULT NULL, `DADO_LOGRADOURO` VARCHAR(100) DEFAULT NULL, `DADO_COMPLEMENTO` VARCHAR(100) DEFAULT NULL, `DADO_NUM_CASA` VARCHAR(10) DE...
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 03, 2019 at 07:21 PM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.1.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
-- MySQL Script generated by MySQL Workbench -- Mon Jun 4 21:35:21 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='TR...
INSERT INTO ArtDefine_UnitInfos (Type, DamageStates, Formation) SELECT ('ART_DEF_UNIT_3_HAWAIIAN_KOA'), DamageStates, Formation FROM ArtDefine_UnitInfos WHERE Type = 'ART_DEF_UNIT_U_AZTEC_JAGUAR'; INSERT INTO ArtDefine_UnitInfoMemberInfos (UnitInfoType, UnitMemberInfoType, NumMembers) SELECT ('ART_DEF...
CREATE SCHEMA "rotten"; set search_path to rotten; create table controllers ( id serial primary key, controller text not null ); create unique index controllers_unique on controllers (controller); create table actions ( id serial primary key, action text not null ); create unique index actions_uniqu...
CREATE TABLE legacy_user_data ( user_uuid UUID PRIMARY KEY, first_name VARCHAR, email VARCHAR );
<?php /** * @file GetSetting.sql * gets a setting from %Setting table * @author Till Uhlig * @param int \$setid an %Setting identifier * @result * - S, the Setting data */ ?> select concat('<?php echo Setting::getCourseFromSettingId($setid); ?>','_',S.SET_id) as SET_id, S.SET_name, S.SET_state, ...
create table if not exists country_calling_code ( country varchar(64) not null unique, code varchar(7) not null, primary key (country) );
drop database if exists DinResSys; /*==============================================================*/ /* Database: DinResSys */ /*==============================================================*/ create database DinResSys; use DinResSys; /*=============================...
SELECT r_state, COUNT(*) FROM orders, customer, region, distributors WHERE o_customerid = c_customerid AND c_Regionkey = r_Regionkey AND r_Regionkey = d_RegionKey AND d_name = 'Toy Tokyo' GROUP BY c_customerid;
-- Adminer 4.7.1 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; CREATE TABLE `tb_file_upload` ( `id_file_upload` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) NOT NULL, `nama_file` varchar(255) NOT NULL, PRIMARY KEY (`id_file_uploa...
GRANT SELECT ON STG_LOBBY_USER TO GROUP READ_ONLY; GRANT ALL ON STG_LOBBY_USER TO GROUP READ_WRITE; GRANT ALL ON STG_LOBBY_USER TO GROUP SCHEMA_MANAGER; GRANT SELECT ON STG_PLAYER_DEFINITION TO GROUP READ_ONLY; GRANT ALL ON STG_PLAYER_DEFINITION TO GROUP READ_WRITE; GRANT ALL ON STG_PLAYER_DEFINITION TO GROUP SCHEMA_M...
alter table ACT_HI_TASKINST add SCOPE_ID_ NVARCHAR2(255); alter table ACT_HI_TASKINST add SUB_SCOPE_ID_ NVARCHAR2(255); alter table ACT_HI_TASKINST add SCOPE_TYPE_ NVARCHAR2(255); alter table ACT_HI_TASKINST add SCOPE_DEFINITION_ID_ NVARCHAR2(255); create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOP...
use olist; /* Your manager now want to have these KPIs as SQL stored procedures, so that they can run them anytime from the server. You should write procedures that output the following: 1. A list of cities and their revenue, sorted by revenue, only showing cities that belong to states with a revenue above a certa...
INSERT INTO `timetracker_downgrade_migration_temp`.`projects` ( `name`, `created`, `modified`, `status`, `uuid` ) (SELECT * FROM ( SELECT `tmp`.`name`, `tmp`.`created_at` `created`, `tmp`.`updated_at` `modified`, IF (`tmp`.`is_active`='1', 'active', 'hidden') `statu...
create database collegedb use collegedb create table tbl_College(clg_id int primary key, clg_name varchar(50) not null, clg_address varchar(50) not null, clg_phone_number integer unique); select * from tbl_College; insert into tbl_College values(1,'Jain Colleg...
DROP TABLE IF EXISTS `taobao_seller_cat`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `taobao_seller_cat`( `cid` bigint(20) unsigned NOT NULL, `parent_cid` bigint(20) unsigned NOT NULL, `name` varchar(128) NOT NULL, `sort_order` int(11) unsigned, `cat_type` varchar(16), `pic_url` v...
create procedure [sp_MSins_ProductionProduct] @c1 int, @c2 nvarchar(50), @c3 nvarchar(25), @c4 bit, @c5 bit, @c6 nvarchar(15), @c7 smallint, @c8 smallint, @c9 money, @c10 money, @c11 nvarchar(5), @c12 nchar(3), @c13 nchar(3), @c14 decimal(8,2), @c15 int, ...
/***************************************** * Create Jesse Final Project *****************************************/ USE jk488; CREATE TABLE activities ( activityID INT(11) NOT NULL AUTO_INCREMENT, activityName VARCHAR(255) NOT NULL, activityStart DATE NOT NULL, activityDue DATE ...
drop table if exists #c ; drop table if exists #c2 ; select c.id ,c.AdminProcessingFlag ,c.Substatus as ClientSubstatus ,isnull(th.HasTariff, 0) as HasTariff ,isnull(p.HasCredit, 0) as HasCredit into #c from client.Client c outer apply ( select top 1 1 as HasTariff from client.vw_TariffHis...
create schema authorization; grant all privileges on authorization.* to 'feeder_authorization'@'%' identified by "testpwd"; create schema application; grant all privileges on application.* to 'feeder_application'@'%' identified by "testpwd"; create schema statistics; grant all privileges on statistics.* to 'feeder_st...
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Anamakine: 127.0.0.1:3308 -- Üretim Zamanı: 02 Ara 2020, 11:39:23 -- Sunucu sürümü: 8.0.18 -- PHP Sürümü: 7.3.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
drop table if exists account_summary_daily; create table account_summary_daily ( customer_id varchar(50), account_id varchar(50) , trans_start_date varchar(50) , trans_end_date varchar(50), day_num varchar(50) , in_wire_transfers_trans_count integer(50) , in_wire_transf...
--select * --from PortfolioProject1..deaths --order by 3,4 --select * --from PortfolioProject1.dbo.vaccine --order by 3,4 --Likelihood of dying if you contract covid in INDIA select location,date,total_cases,total_deaths ,(total_deaths/total_cases)*100 as deathpercentage from PortfolioProject1.dbo.dea...
-- You have below structure describing activity of clients on company's website: -- client_activity -- -------------------------- -- `id` bigint(20) NOT NULL AUTO_INCREMENT -- `uri` varchar(4000) NOT NULL -- `duration_ms` int(11) NOT NULL DEFAULT '0' -- `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP -- Sample ...
CREATE OR ALTER PROCEDURE SP_DESTETE( FECHA DATE, ANIMAL INTEGER, OBSERVACION VARCHAR(255) CHARACTER SET NONE, ESTABLECIMIENTO INTEGER, RESPONSABLE INTEGER, LOG_USUARIO INTEGER, LOG_FECHA_MODIFICADO DATE, PESO DOUBLE PRECISION, TIPO INTEGER, ID_GRUPO INTEGER, DISPARADOR INTEGER, POTR...
DROP TABLE IF EXISTS department; CREATE TABLE department ( department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(255) NOT NULL UNIQUE, PRIMARY KEY (department_id) );
/* Navicat MySQL Data Transfer Source Server : Database Source Server Version : 50041 Source Host : localhost:3306 Source Database : smsimobiledb Target Server Type : MYSQL Target Server Version : 50041 File Encoding : 65001 Date: 2015-07-10 14:46:39 */ SET FOREIGN_KEY_CHECKS=0; ...
SELECT * FROM scientificname {% if demo %} WHERE "scientificName" IN ( 'Elachista', -- no match to GBIF Backbone will be found 'Triturus alpestris', -- synonym of Ichthyosaura alpestris 'Fallopia japonica', -- exotic and synonym of Reynoutria japonica 'Trentepholia' -- accepted genus ...
--Criando Usuario create tablespace mappitdat datafile 'C:\oraclexe\app\oracle\oradata\XE\mappitdat01.dbf' size 100m autoextend on next 100m maxsize 2048m; create user mappit identified by mappit default tablespace mappitdat; grant connect, resource, create view to mappit; -- Query select id_local, distancia from ( ...
CREATE TABLE calificacionesPendientes ( id int AUTO_INCREMENT, idUsuarioAutor int, idUsuarioCalificado int, PRIMARY KEY (id) ); INSERT INTO calificacionesPendientes (idUsuarioAutor, idUsuarioCalificado) VALUES (1, 2); INSERT INTO calificacionesPendientes (idUsuarioAutor, idUsuarioCalificado) VALUES (1, 3); IN...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jun 12, 2021 at 06:10 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
DO $do$ DECLARE arr integer[] := array[2014,2013,2012,2011,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999,1998,1997,1996,1995,1994,1993,1992,1991]; i integer; BEGIN FOREACH i IN ARRAY arr LOOP SET work_mem='2GB'; RAISE NOTICE 'Dropping view for year: %', i; EXECUTE 'drop materialize...
-- (Hint: starts with 493) -- -- First, create a MySql database or use an existing database (make sure to use a UTF8 character set) -- and then create a table in the database called "Ages": CREATE TABLE Ages ( name VARCHAR(128), age INTEGER ) -- Then make sure the table is empty by deleting any rows that you pre...
select s.state_name from tbl_states s, tbl_role_trans rt where rt.state_id_from = %1 and rt.state_id_to = s.state_id and rt.role = %2
--사업장 코드 전환건에 대한 내역 --DELETE FROM z_temp_table SELECT * FROM z_temp_table INSERT INTO z_temp_table (a1,a2,a3) VALUES ('ONS1307230002','안승학','ONS0000022') select * from z_temp_table --임시 temp 테이블에 메일로 온 자료를 우선 담는다. -- 주문번호를 자른다 select substring(a1,0,CHARINDEX('-',a1)) from z_temp_table update z_temp_ta...
/* Navicat MySQL Data Transfer Source Server : hyj Source Server Version : 50522 Source Host : localhost:3306 Source Database : center Target Server Type : MYSQL Target Server Version : 50522 File Encoding : 65001 Date: 2014-01-03 11:07:48 */ SET FOREIGN_KEY_CHECKS=0; -- --------...
ALTER TABLE `np_grab_advertise` MODIFY COLUMN `grab_advertise_img` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片' AFTER `grab_advertise_id`;
REM objinit.sql REM Version 1.0, last updated 8/8/97 REM This block demonstrates how to initialize objects, as described in REM Chapter 11 of _Oracle8 PL/SQL Programming_ by Scott Urman. DECLARE -- Creates the object instance, with the attributes set. v_Student StudentObj := StudentObj(10020, 'Chuck', ...
create or replace function dep_nbremp2 (dep_id in departments.department_id%type) return NUMBER is nbr_emp NUMBER; begin select count(e.employee_id) into nbr_emp from employees e join departments on e.department_id = departments.department_id where departments.department_id = dep_id; return nbr_emp; end; variable c...
/*********************************************************************************** || QUERY INFORMATION || || Department: Data Warehouse || Programmer: Luis Fuentes || Date: 07/24/2019 || Category: Table || || Description: Change view V_MSTR_CLP_SERVICE_DESK || || Parameters: ...
/* Create Comments, Sequences and Triggers for Autonumber Columns */ COMMENT ON TABLE "ADM_TACCE" IS 'TABLA DE LOS TIPOS DE ACCESO DE LOS REGISTROS DE CALIDAD DE CONTROL DOCUMENTAL' ; COMMENT ON COLUMN "ADM_TACCE"."ACCE_ACCE" IS 'iD DE LA TABLA TIPOS DE ACCESO' ; COMMENT ON COLUMN "ADM_TACCE"."ACCE_NOMB" IS 'NOM...
SELECT * FROM employees; SELECT * FROM departments; SELECT * FROM jobs; /* 직원들이 소속되어 있는 부서를 검색 */ SELECT e.employee_id , e.first_name , e.last_name , e.department_id , d.department_name FROM employees e, departments d WHERE e.department_id = d.department_id ORDER BY e.employee_id; /*...
SELECT * FROM "config".dbo.Account WHERE AID = '%s'
SELECT * FROM coins;
-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 23, 2012 at 09:17 PM -- Server version: 5.5.16 -- PHP Version: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!...
-- -- PostgreSQL database dump -- SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; SET escape_string_warning = off; SET search_path = public, pg_catalog; -- -- Name: income_streams_id_seq; Type: SEQUE...
-- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64) -- -- Host: localhost Database: mymeeting -- ------------------------------------------------------ -- Server version 8.0.18 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /...
CREATE TABLE TB_BASE_DEPT ( ID bigint IDENTITY(1,1) NOT NULL, DEPT_CODE varchar(4) NOT NULL, DEPT_NAME varchar(100) NOT NULL, DEPT_TYPE bigint NOT NULL, ST_ID bigint NOT NULL, ENABLE varchar(1) NULL, PRIMARY KEY(id) ); CREATE TABLE TB_BASE_GROUP ( ID bigint IDENTITY...
update Plugins set LastUseTimestamp = @LastUseTimestamp, LastUsePluginVersion = @LastUsePluginVersion, LastUseAppVersion = @LastUseAppVersion, ExecuteCount = ExecuteCount + 1, UpdatedTimestamp = @UpdatedTimestamp, UpdatedAccount = @UpdatedAccount, UpdatedProgramName = @U...
/* User */ GRANT ALL ON SCHEMA qwat_raepa TO qwat_user; GRANT ALL ON ALL TABLES IN SCHEMA qwat_raepa TO qwat_user; ALTER DEFAULT PRIVILEGES IN SCHEMA qwat_raepa GRANT ALL ON TABLES TO qwat_user; /* Viewer */ GRANT ALL ON SCHEMA qwat_raepa TO qwat_viewer; GRANT ALL ON ALL TABLES IN SCHEMA qwat_raepa TO qwat_viewer; AL...
-- criando banco de dados CREATE DATABASE db_farmacia_do_bem; -- informando qual banco de dados vou usar USE db_farmacia_do_bem; -- criando tabela CREATE TABLE tb_categoria ( id_categoria BIGINT (5) auto_increment, tipo VARCHAR (100), ativo BOOLEAN, PRIMARY KEY (id_categoria) ); -- populando tabela INSERT INTO tb_...
-- MS SQL SERVER SELECT DISTINCT CITY FROM STATION WHERE UPPER(TRIM(SUBSTRING(CITY, LEN(CITY), 1))) IN ('A','E','I','O','U') AND UPPER(SUBSTRING(TRIM(CITY), 1, 1)) IN ('A','E','I','O','U');
DROP TABLE IF EXISTS cities; CREATE TABLE cities( id SERIAL PRIMARY KEY, city_name VARCHAR(255), formatted_query VARCHAR(255), latitude NUMERIC(10, 7), longitude NUMERIC(10, 7) ); -- INSERT INTO cities(city_name) VALUES ('Amman');
SET SERVEROUTPUT ON /* Uso de Array Asociativos (INDEX BY TABLE) SCHEMA usado: HR */ /* Ejemplo 1: Se usan dos index by table para demostrar que el tipo de dato que se puede ocupar puede ser simple o complejo como lo es un record. */ DECLARE TYPE departamentos IS TABLE OF departments....
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 17, 2017 at 10:55 AM -- Server version: 5.7.14 -- PHP Version: 5.6.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */...
select attachment_id, attachment_name, attachment_size, event_id, is_removed from tbl_attachments where event_id = %1
-- Incident Image SELECT dropifexists('VIEW', 'incidentimage','API'); CREATE VIEW api.incidentimage AS SELECT incdt_number AS incident_number, image_name AS image_name FROM incdt(), imageass, image WHERE ((incdt_id=imageass_source_id) AND (imageass_source='INCDT') AND (imageass_image_id=imag...
SELECT 'Create views'; -- Creates a view CREATE OR REPLACE VIEW vw_cition AS SELECT tp.first_name as officer_first_name, tp.last_name as officer_last_name, tp2.first_name as driver_first_name, tp2.last_name as driver_last_name, tv.fee_amount, tc.cition_status FROM tbl_cition tc JOIN tbl_lov_viol...
DELETE [grajauser].[Usuarios] WHERE [id] = @id
SELECT * FROM pending_emp_basic_details; SELECT * FROM pending_emp_education_details; SELECT * FROM pending_emp_family_details; SELECT * FROM pending_emp_last5yrstay_details; SELECT * FROM pending_emp_pay_details; SELECT * FROM pending_emp_prev_exp_details; SELECT * FROM pending_faculty_details; SELECT * FROM pending_u...
-- Database: mysql -- RENAME: ID -> id -- RENAME: Account -> account -- RENAME: CodeName -> code -- RENAME: Name -> name -- RENAME: IsActive -> enabled CREATE TABLE `{table}` ( `id` integer unsigned NOT NULL AUTO_INCREMENT, `account` integer unsigned DEFAULT NULL, `code` varchar(32) DEFAULT NULL, `name` varchar(64)...
CREATE TABLE customerthread ( id CHAVE NOT NULL, id_shop CHAVE NOT NULL, id_lang CHAVE NOT NULL, id_contact CHAVE NOT NULL, id_customer CHAVE, id_order CHAVE, id_product CHAVE, status CHARACTER VARYING...
drop view if exists view_rt_municipalities_per_district; create or replace view view_rt_municipalities_per_district (district_id, district, municipality_count) as select rt_district.id, rt_district.name, count(rt_municipality.id) from rt_municipality inner join rt_dis...
USE labwork_1; CREATE TABLE TEACHERS ( PrivateNumber VARCHAR(30), Firstname VARCHAR(30), Post VARCHAR(30), Department VARCHAR(30), Specialty VARCHAR(30), HomePhone INTEGER, PRIMARY KEY(PrivateNumber) ); INSERT INTO TEACHERS (privateNumber, firstname, post, department, specialty, homePhone) V...
/* Warnings: - You are about to drop the column `content_type` on the `Attachment` table. All the data in the column will be lost. - You are about to drop the column `ext` on the `Attachment` table. All the data in the column will be lost. - You are about to drop the column `path` on the `Attachment` table. Al...
create table effective_component_info( technology varchar2 (16) not null, program varchar2 (32) not null, component varchar2 (128) not null, constraint eff_comp_pk PRIMARY KEY (technology, program, component) ); insert into effective_component_info (technology, program, component) values ('TEST', 'PRO...
create table user_inheritance_single ( dtype VARCHAR(31) NOT NULL, id SERIAL PRIMARY KEY, name VARCHAR(124), position VARCHAR(124), company VARCHAR(124) );
select account_id, username, fullname, email, description, is_admin, is_disabled, locks_count, lock_time from tbl_accounts where is_ldapuser = 0 order by %1
describe prueba1; describe prueba2; commit; exit;
SELECT Name, TaxRate FROM Sales.SalesTaxRate WHERE (TaxRate > 7) AND (TaxRate < 10);
SELECT COUNT(*) FROM PASSWORD_RESETS WHERE DELETE_FLAG = 0;
use rgt; # Hold different types of events. CREATE TABLE IF NOT EXISTS `rgt_event` ( `event_id` INT (6) AUTO_INCREMENT, `event_uid` SMALLINT NOT NULL, `event_name` VARCHAR (256) NOT NULL, `timestamp` TIMESTAMP , PRIMARY KEY ( `event_id` ), UNIQUE KE...
CREATE TABLE `uk_quick_type` ( `ID` varchar(32) NOT NULL, `NAME` varchar(50) DEFAULT NULL, `CODE` varchar(50) DEFAULT NULL, `CREATETIME` datetime DEFAULT NULL, `CREATER` varchar(32) DEFAULT NULL, `UPDATETIME` datetime DEFAULT NULL, `ORGI` varchar(32) DEFAULT NULL, `USERNAME` varchar(50) DEFAULT ...
-- ============================================= -- Proyecto: Sistema SIGEIN 5.0 -- Copyright (c) - Acrux - 2015 -- Author: Juan Castillo -- CREATE date: 13/01/2016 -- Description: Obtiene las pruebas que corresponden al puesto -- ============================================= CREATE PROCEDURE [IDP].[SPE_OBTIENE_PRUEB...