text
stringlengths
6
9.38M
CREATE TABLE counts ( name VARCHAR(45) NOT NULL, count INTEGER UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (name) ) CHARACTER SET utf8; INSERT INTO counts VALUES ('accounts', 0), ('profiles', 0), ('experiences', 0);
CREATE TABLE `Users` ( `RowID` varchar(32) NOT NULL, `RowCreationDateUTC` int(11) NOT NULL, `ID` int(11) NOT NULL, `UserName` varchar(1024) NOT NULL, `UserPassword` varchar(1024) NOT NULL, `UserNicename` varchar(1024) NOT NULL, `UserEmail` varchar(1024) NOT NULL, `UserUrl` varchar(1024) NOT NULL, `Us...
drop table REMBOURSEMENT; drop table CONTRAT; drop table PRODUIT; drop table CLIENT; drop table RISQUE; drop table NUMSECU; create table RISQUE( nRisque int not null AUTO_INCREMENT primary key, niveau int not null ); create table NUMSECU( nNumSecu int not null AUTO_INCREMENT primary key, sexe int n...
----- Random ab2018.tb_uye_hareketleri INSERT INTO ab2018.tb_uye_hareketleri (tarih, islem_tipi, uye_id, kitap_id, personel_id,kutuphane_id)  Select  CURRENT_DATE - (floor(random()*(10000-1+1))::TEXT ||' DAYS')::INTERVAL,  floor(random()*(2-1+1))+1,  floor(random()*(32-1+1))+1,  floor(random()*(66-1+1))+3, floor(random...
use pmDB; SET foreign_key_checks = 0; -- DELETE ALL TABLES SET @tables = NULL; SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables FROM information_schema.tables WHERE table_schema = 'pmDB'; -- specify DB name here. SET @tables = CONCAT('DROP TABLE ', @tables); PREPARE stmt FROM @tables; EXECUTE stmt;...
--#include ..\..\..\Objects\Check_SelectLists_Specifications.sql --#include ..\..\..\Objects\Check_District_Specifications.sql --#include ..\..\..\Objects\Check_School_Specifications.sql --#include ..\..\..\Objects\Check_Student_Specifications.sql --#include ..\..\..\Objects\Check_IEP_Specifications.sql --#include ..\....
select * from homes join houser_users on (homes.user_id = houser_users.user_id) where user_id=$1;
/* movies from 2004 SELECT id FROM movies WHERE year = 2004; */ /* list of all stars from movies in 2004, no duplicate person_id's SElECT distinct(person_id) FROM stars WHERE movie_id IN (SELECT id FROM movies WHERE year = 2004); */ /* now we need to convert to name and order by birth year*/ ...
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 11-12-2014 a las 23:30:42 -- Versión del servidor: 5.6.20 -- Versión de PHP: 5.5.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR...
/* ################################################################################ Migration script to add the curator 'Level 3 Curator' author: Cinzia Malangone date: 18th Nov 2016 version: 2.2.0.012 Note: The db EventType has already the info about this curation entry. Refactoring Event Type Enam task ##...
--// Added content Page Title -- Migration SQL that makes the change goes here. alter table Story add column contentPageTitle varchar(255) null; update Story set contentType = 'Story'; --//@UNDO -- SQL to undo the change goes here. alter table Story drop column contentPageTitle;
--The feature of RDBMS is to relate one or more tables. This is called as referenceing. In ERP Scenario, an employee is associated with a dept. The Employee table and the Dept table are related to one another. --Every table's data will have a column that has unique data on which U do queries generally. That column i...
INSERT INTO categorias VALUES ('LIVRE', 'branco');
CREATE USER trivia WITH PASSWORD 'pass'; CREATE DATABASE trivia; GRANT ALL PRIVILEGES ON DATABASE trivia TO trivia; \connect trivia trivia create table if not exists categories ( id serial not null constraint categories_pkey primary key, type text not null ); create table if not exists questions ( ...
-- Table: timetracker.project -- DROP TABLE timetracker.project; CREATE TABLE timetracker_backend.project ( pid SERIAL PRIMARY KEY, projectname VARCHAR(40), projectOwner VARCHAR(40) );
ALTER TABLE COMM_MEMBER_EXPERTISE MODIFY RESEARCH_AREA_CODE VARCHAR2(8) NULL / ALTER TABLE COMM_MEMBER_EXPERTISE ADD IACUC_RESEARCH_AREA_CODE VARCHAR2(8) NULL /
SELECT * FROM pokemon WHERE id = :id
drop table if exists ratings; create table ratings ( userid integer not null, movieid integer not null, rating integer, timestamp integer, constraint ratings_pk primary key (userid, movieid) ); drop table if exists movies; create table movies ( movieid integer not null, title varchar, genres varchar, co...
select ename, DECODE(deptno, '20', 'zwei dep.' , '30', 'drei dep.' , deptno) "New Department" from emp; select DECODE (job, 'MANAGER', 'MANAGERMENT', 'PRESIDENT', 'MANAGERMENT', 'STAFF' ) "...
SET foreign_key_checks = 0; drop table if exists kapal_bobot; drop table if exists subkriteria; drop table if exists kriteria; drop table if exists kapal; SET foreign_key_checks = 1; create table kapal ( id integer auto_increment primary key, nama varchar(255) not null, callsign varchar(255) not null, gt integ...
INSERT INTO country VALUES (1, 'CZ', 'Czech Republic'); INSERT INTO country VALUES (2, 'PL', 'Poland'); INSERT INTO city VALUES (1, 'Liberec', 1); INSERT INTO city VALUES (2, 'Prague', 1); INSERT INTO city VALUES (3, 'Warsaw', 2); INSERT INTO city VALUES (4, 'Poznań', 2);
-- -- PostgreSQL database dump -- -- Dumped from database version 12.6 -- Dumped by pg_dump version 12.6 -- Started on 2021-04-27 17:33:09 -- -- TOC entry 2853 (class 0 OID 25314) -- Dependencies: 204 -- Data for Name: manf_supp_contract; Type: TABLE DATA; Schema: public; Owner: postgres -- INSERT INTO public.manf...
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.7.16-0ubuntu0.16.04.1) # Datenbank: skytracker # Erstellt am: 2016-12-17 12:49:46 +0000 # ******************************...
/* ################################################################################ Migration script to insert a new type of note author: Cinzia Malangone date: 4th Jan 2018 version: 2.2.0.039 ################################################################################ */ -----------------------------------...
/* Formatted on 17/06/2014 18:02:48 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_APP_QDC_CDR_EXT_BIL ( RECORD_CHAR ) AS SELECT 'DATA_RIF' || TO_CHAR (LAST_DAY (TO_DATE (id_dper, 'YYYYMM')), 'YYYYMMDD') FROM T_MCRE0_APP_QDC_CDR_BILANCIO GROUP BY id_dper UN...
-- create the tables create table product_category ( id integer generated by default as identity, name varchar(255) not null, description varchar(255), primary key (id) ); create table supplier ( id integer generated by default as identity, name varchar(255) not null unique, primary key (id) ); create table c...
SET SERVEROUTPUT ON; BEGIN dbms_output.put_line('No. ИД сеанса Пользователь'); dbms_output.put_line('--- ----------- ------------'); for row in (SELECT rownum, t1.sid, t1.USERNAME from v$session t1, v$transaction t2 where t1.saddr = t2.ses_addr) loop dbms_output.put_line(RP...
INSERT INTO projects(title, due, position, completed) VALUES ( 'Skrá í vefforritun 2', null, 1, true ); INSERT INTO projects(title, due, position, completed) VALUES ( 'Sækja verkefni 4 á github', null, 2, false ); INSERT INTO projects(title, due, position, completed) VALUES ( 'Klár...
SELECT p.name, COUNT(a.pid) FROM person p, acts a, movie m WHERE p.pid = a.pid AND m.mid = a.mid AND a.pid IN (SELECT a2.pid FROM acts a2, movie m2 WHERE a2.mid = m2.mid AND m2.rating >= 9) GROUP BY p.name,a.pid HAVING COUNT(a.pid) >= 4;
create table A( numero int not null, id in primary key, textoso varchar(20) );
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50720 Source Host : localhost Source Database : short_url Target Server Type : MySQL Target Server Version : 50720 File Encoding : utf-8 Date: 03/24/2020 17:35...
-- Creamos la base de datos CREATE DATABASE DBproyectodaw DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci; USE DBproyectodaw; -- Creamos las tablas CREATE TABLE DBproyectodaw.usuario ( idUsuario VARCHAR( 10 ) NOT NULL PRIMARY KEY , descUsuario VARCHAR( 25 ) UNIQUE NOT NULL , password VARCHAR( 70 ) NOT NULL , perfi...
DELIMITER // DROP PROCEDURE IF EXISTS SP_CHANGE_PRESENCE; CREATE PROCEDURE SP_CHANGE_PRESENCE(isin INT) BEGIN DECLARE currentState INT; SELECT p.isin INTO currentState FROM presence p ORDER BY p.time desc LIMIT 1; IF currentState = isin THEN IF currentState = 0 THEN SIGNAL SQLSTATE '80000' SET MESSAGE...
-- ----------------------------------------------------- -- Table `dbo`.`CharacterAbilities` -- ----------------------------------------------------- DROP TABLE IF EXISTS `dbo`.`CharacterAbilities` ; CREATE TABLE IF NOT EXISTS `dbo`.`CharacterAbilities` ( `abilityId` INT(11) NOT NULL , `characterId` INT(11) NOT ...
USE DietaJa_test; -- TRIGGERS -- Triggers para criar LOG após INSERT do Usuário; DROP TRIGGER IF EXISTS Tgr_TabelaUsuario_Insert; DELIMITER $$ CREATE TRIGGER Tgr_TabelaUsuario_Insert AFTER INSERT ON Usuario FOR EACH ROW BEGIN INSERT INTO Log (LogContent, LogDate, LogType) VALUES(JSON_OBJECT( "ID_Usuario", NEW...
DROP TABLE IF EXISTS journal_procent; CREATE TABLE journal_procent( id INTEGER (10) NOT NULL, num VARCHAR(20) NOT NULL, date1 DATE NOT NULL, date2 DATE NOT NULL, sum_procent DOUBLE NOT NULL, PRIMARY KEY (id) );
-- phpMyAdmin SQL Dump -- version 5.1.1 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : dim. 03 oct. 2021 à 03:36 -- Version du serveur : 10.4.21-MariaDB -- Version de PHP : 8.0.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SE...
CREATE GLOBAL TEMPORARY TABLE VND.ELO_CARTEIRA_SAP_AGEND_TMP ( SESSION_ID NUMBER(9) NOT NULL , CD_ELO_CARTEIRA_SAP NUMBER(9) NOT NULL, NU_CARTEIRA_VERSION VARCHAR2(14 BYTE) NOT NULL, CD_CENTRO_EXPEDIDOR CHAR(4 BYTE), DS_CENTRO_EXPEDIDOR VARCHAR2(31...
-- 商品排序权重 CREATE TABLE `beiker_goods_sort_weights` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID', `goodsid` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品ID', `newscore` DECIMAL(30,10) NOT NULL DEFAULT '0.0000000000' COMMENT '新品得分', `salesscore` DECIMAL(30,10) NOT NULL DEFAULT '0.0000000000' COM...
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Dec 15, 2019 at 03:33 PM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
CREATE TABLE IF NOT EXISTS `vacunas` ( `id` INT PRIMARY KEY, `nombre` VARCHAR(40) NOT NULL, `dosis_pfizer` INT NOT NULL, `dosis_moderna` INT NOT NULL, `personas` INT NOT NULL ) ENGINE = InnoDB; INSERT INTO `vacunas` (`id`,`nombre`, `dosis_pfizer`, `dosis_moderna`, `personas`) VALUES ('1','Andalucia', '244...
CREATE DATABASE backscratcher WITH ENCODING = 'UTF8';
-- Daou market DDL -- ----------------------------------------------------- -- Table `user` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `user` ( `user_id` int NOT NULL AUTO_INCREMENT, `emp_num` int DEFAULT NULL, `name` varchar(10) DEFAULT NULL, `password` char(64) DEFAULT...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : sam. 03 juil. 2021 à 19:48 -- Version du serveur : 5.7.31 -- Version de PHP : 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_...
-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ -- Server version 5.5.5-10.1.30-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_...
INSERT INTO users (name, email, framework) VALUES ('imdad', 'imdad@gmail.com', 'Spring MVC, GWT'); INSERT INTO users (name, email, framework) VALUES ('nagarjun', 'nagarjun@yahoo.com', 'Spring MVC, PLAY'); INSERT INTO users (name, email, framework) VALUES ('manjunath', 'manjunath@gmail.com', 'Spring MVC, JSF 2');
--liquibase formatted sql --changeset ggorosito:sale_implementation splitStatements:false -- IMPLEMENTACION DE TABLAS "Sale" & "SaleLine" -- Tablas que contiene este changeset (en orden): --- Create table de sale --- Create table de saleline ------------------------------------------------ --------------...
DELETE Src.Products WHERE ProductKey = 3 SELECT * FROM Src.Products SELECT * FROM Src.ProductsHistory
/* Copyright 2021 Snowplow Analytics Ltd. All rights reserved. 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 a...
insert into avatars (avatar_base_type_id, level, skin, hair, picture_url, night_background_url, day_background_url, status, text_id, created_by, created_date) values (2, 1, 2, 1, 's2h1.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (2, 2, 2, 1, 's2h1.png', 'night1.png', 'day1.png', 'ACTIVE', 1,...
CREATE TABLE IF NOT EXISTS `[#DB_PREFIX#]pages` ( `id` int(10) NOT NULL AUTO_INCREMENT, `url_token` varchar(32) NOT NULL, `title` varchar(255) DEFAULT NULL, `keywords` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `contents` text, `enabled` tinyint(1) NOT NULL DEFAULT '0', ...
select count(1) from compra where producto_id = :producto_id
update product set pr_jsonb = jsonb_set(pr_jsonb,'{pr_code}', to_jsonb('P' || '-' || lpad((pr_jsonb#>>'{cl_id}'),4,'0') || '-' || lpad(pr_id::text,7,'0') || '-' || (pr_jsonb#>>'{pr_process}') || '-' || (pr_jsonb#>>'{pr_type}')), true) where pr_id = $1
ALTER TABLE media_content DROP column inbox;
insert into user_tbl (id , name, age) values (1, 'maryon cute', 69); insert into user_tbl (id , name, age) values (2, 'angelica', 30); insert into thread_setting_tbl(id , number_of_threads) values (1 , 100);
INSERT INTO resume_file ( filename ) VALUES ( "resume.pdf" );
CREATE TABLE IF NOT EXISTS users ( userId SERIAL PRIMARY KEY, username varchar(100) UNIQUE, email varchar(100) UNIQUE, telf varchar(100), city varchar(100), country varchar(100), code varchar(100), password varchar(100), role VARCHAR(30), direccion VARCHAR(200), numImg NUMERIC, urlIm...
--実支払情報 WITH TMPTABLE AS ( SELECT TOP 1 --支払情報 .契約番号 TA.CONTRACT_NO, --支払情報 .支払小分類 TA.PAY_TYPE_DETAIL, MAX(TA.REAL_PAY_DATE) AS REAL_PAY_DATE, SUM(TA.PAY_AMOUNT) AS PAY_AMOUNT FROM PAY_INFO TA --支払情報 WHERE --支払情報 .契約番号=パラメータ.契約番号 TA.CONTRACT_NO = /*contractNo*/ --支払情報 .支払小分類=印紙税...
SELECT count(name) AS nb_susc, ROUND(AVG(price), -1) AS av_susc, SUM(duration_sub) AS ft FROM db_saburadi.subscription ;
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 23, 2016 at 02:25 PM -- Server version: 5.7.16-0ubuntu0.16.04.1 -- PHP Version: 7.0.8-0ubuntu0.16.04.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CH...
.headers on .nullvalue '-null-' .mode csv -- -- 01 SELECT Site.name, Site.lat, Site.long, Person.personal, Person.family, Survey.quant, Survey.reading, Visited.dated FROM Site JOIN Visited JOIN Survey JOIN Person ON Site.name = Visited.site AND Visited.id = Survey.taken AND Survey.person = Person....
-- Write a SQL statement to find the total purchase amount of all orders. SELECT SUM(Amount) FROM Orders; -- Write a SQL statement to find the average purchase amount of all orders. SELECT ROUND(AVG(Amount)) FROM Orders; -- Write a SQL statement to find the number of salesmen currently listing for all of their custom...
-- В каких аэропортах есть рейсы, -- которые обслуживаются самолетами с максимальной дальностью перелетов? select aircraft_code from aircrafts_data order by "range" desc limit 2; select flight_id, departure_airport, f.aircraft_code from aircrafts_data as acd join flights as f using (aircraft_code) where ai...
drop table if exists entries; create table entries ( id integer primary key autoincrement, title text not null, text text not null ); --# Test_Case 表 DROP TABLE if EXISTS "test_case"; CREATE TABLE "test_case" ( "tc_id" INTEGER primary key autoincrement, "tc_name" varchar(128), "tc_path" varchar(128), "tc_su...
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tbl_sip` ( `ID` INT(11) NOT NULL AUTO_INCREMENT, `LABEL` VARCHAR(50) DEFAULT NULL, `NUMBER` VARCHAR(20) DEFAULT NULL, `PASSWORD` VARCHAR(20) DEFAULT NULL, `INSERT_STAFF` INT(11) NOT...
create table REPORT_GROUP ( ID varchar2(32) not null, CREATE_TS timestamp, CREATED_BY varchar2(50 char), VERSION integer default 1 not null, UPDATE_TS timestamp, UPDATED_BY varchar2(50 char), DELETE_TS timestamp, DELETED_BY varchar2(50 char), TITLE varchar2(255 char) not null, C...
-- Database name: pet_hotel CREATE TABLE "owner" ( "id" SERIAL PRIMARY KEY, "name" VARCHAR(25) NOT NULL ); CREATE TABLE "pet" ( "id" SERIAL PRIMARY KEY, "name" VARCHAR(25) NOT NULL, "owner_id" INT REFERENCES "owner", "breed" VARCHAR(20) NOT NULL, "color" VARCHAR(20) NOT NULL, "checked_in"...
DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `uspSubjectDetailsGetforCourses`(IN in_Filter int) BEGIN Select SubjectCode,SubjectName from tblSubjectDetails where CourseID=in_Filter and isactive=1; END$$ DELIMITER ;
SELECT e.FirstName, e.MiddleName, e.LastName, e.HireDate, e.Salary, a.AddressText, t.Name FROM Employees e INNER JOIN Addresses a ON e.AddressID = a.AddressID INNER JOIN Towns t ON a.TownID = t.TownID
create sequence BURI_TEST_MANY_SEQ start with 1 increment by 1;
DROP TABLE IF EXISTS developer; CREATE TABLE if not exists `developer` ( `name` varchar(128) NOT NULL COMMENT '姓名', `username` varchar(128) NOT NULL COMMENT '用户名', `email` varchar(128) NOT NULL COMMENT '邮箱', `mobile` varchar(128) NOT NULL COMMENT '手机号', `receivers` text NOT NUL...
-- Script to update DescriptionClosed and TitleClosed default and data values UPDATE public."FileMetadata" SET "Value" = 'false' WHERE "PropertyName" = 'DescriptionClosed' and "Value" = 'False'; UPDATE public."FileMetadata" SET "Value" = 'true' WHERE "PropertyName" = 'DescriptionClosed' and "Value" = 'True'; UPDAT...
/* use information_schema; set @FormGroupName = 'MainFormGroup1' ; set @SchemaName = 'InvoiceSettlement' ; select concat('<mat-form-field fxFlex="50%" fxFlex.lt-sm="100" formGroupName="' ,@FormGroupName, '">', '<input matInput placeholder="', a.column_name, '" formControlName="', a.COLUMN_NAME, '"> ', '</mat-form-f...
insert into customer values ('GA123456', 'Bob Smith', '111 E. 11 St., Vancouver', '6043121234'); insert into customer values ('GC222222', 'Candace Walters', '222 E. 22 St., Burnaby', '6049875432'); insert into customer values ('BA112345', 'Kara Rops', '333 W. 33 Ave., Richmond', '7781234444'); insert into customer valu...
SELECT DISTINCT A.VentaID, A.ClienteID, A.TipoComprobanteID, A.Serie, A.Numero, B.SituacionVentaID FROM TB_Venta AS A LEFT JOIN K_Cobranza AS B ON A.VentaID=B.VentaID WHERE A.TipoVentaID NOT IN ("03", "02")
-- 이름을 입력받아 '이재찬'이면 '반장'을 출력하고 -- set serveroutput on set verify off accept name prompt '이름을 입력하세요: ' declare name varchar2(30) := '&name'; begin if name = '이재찬' then dbms_output.put('반장'); else dbms_output.put('평민'); end if; dbms_output.put_line('('||name||') 님 안녕하세요.'); end; /
--Problem 26.Write a SQL query to display the minimal employee salary -- by department and job title along with the name of some of the employees -- that take it. SELECT d.Name,e.JobTitle,e.FirstName,MIN(e.Salary) AS [Min Salary] from Employees e JOIN Departments d ON e.DepartmentID = d.DepartmentID GROUP BY e....
CREATE TABLE IF NOT EXISTS public.place_categories ( category_id int8 NOT NULL PRIMARY KEY, category_image_url varchar(255) NULL, category_name varchar(255) NULL, category_secondary_image_url varchar(255) NULL ); CREATE TABLE IF NOT EXISTS public.point_of_interest ( place_id int8 NOT NULL PRIMARY KEy, category_i...
-- Create schema for PrivateSchool read DB CREATE SCHEMA IF NOT EXISTS `PrivateSchool`; -- Create tables for main entities CREATE TABLE IF NOT EXISTS `PrivateSchool`.`courses` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` VARCHAR(50) NOT NULL, `stream` VARCHAR(50) NOT NULL, `type` VARCHAR(...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 28, 2018 at 07:02 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.6.23 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
// The problem with a graph hierarchy is that a class can be a sub-class of two // other classes. This makes the hierarchy a graph rather than a tree. For // hierarchy visualizations this is a problem as they rely on the tree // structure. MERGE (root:graphHierarchyTest {name:'root'}) MERGE (a:graphHierarchyTest {name...
select * from users where gmail_user = $1;
spool CodeUpgrade.log set termout on; --close the result of the command set serveroutput on; -- print the dbms_output value -------------------temporary script begin-------------------------------- /*drop triggers :check if the triggers exists ,then drop */ var execscript varchar2(128); declare v_cnt number; be...
# Write your MySQL query statement below # Get book IDs and copies that sold in the last year with sales as (select book_id, sum(quantity) as copies from Orders O where DATEDIFF('2019-06-23', dispatch_date) < 365 group by book_id) # Output results select B.book_id, name from Books B left join sales on sales.book_id=B...
create table "tech_stack"."dbt"."station_metadata__dbt_tmp" as ( SELECT ID, FWY, DIR, District, County, City, State_PM, Abs_PM, Latitude, Longitude, Length, Type, Lanes, Name FROM analytics.I80Stations );
update bonuses set max_redemption_amount = amount * 10 where promotion_id = 2 and type = 'BONUS_MONEY';
USE printing; delimiter // DROP TRIGGER IF EXISTS file_bef_del // CREATE TRIGGER file_bef_del BEFORE DELETE ON project_file FOR EACH ROW BEGIN DELETE FROM project WHERE file_id = OLD.file_ID; END // delimiter ; DELETE FROM project_file WHERE file_id = 1; delimiter // DROP TRIGGER ...
/*Databases gatakka*/ / * - a way to keep data in a structured system - relational databases - mysql, mssql, oracale db... - the SQL language communicates with the database - phpmyadmin - root + password in linux - never delete the information_schema and phpmyadmin databases - permissions / * Create new database...
create database if not exists airline_ontime; use airline_ontime; drop table if exists flights_raw; drop table if exists airports_raw; drop table if exists airlines_raw; drop table if exists planes_raw; create external table flights_raw ( Year int, Month int, DayofMonth int, DayOfWeek int, DepTime int, C...
PARAMETERS [@ClienteID] Text (255), [@FechaInicioID] Text (255), [@FechaFinID] Text (255) , [@TipoVentaID] Text (255), [@TipoComprobanteID] Text (255), [@LoteID] Text (255), [@Serie] Text (255) , [@Numero] Text (255) , [@VariedadID]...
-- MySQL dump 10.13 Distrib 5.5.23, for Win32 (x86) -- -- Host: localhost Database: estimates -- ------------------------------------------------------ -- Server version 5.5.23 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!4...
 CREATE PROC [ERP].[Usp_Sel_Cliente_Pagination] @Flag BIT, @IdEmpresa int, @Page INT, @RowsPerPage INT, @SortDir VARCHAR(20), @SortType VARCHAR(30), @RowCount INT OUT AS BEGIN WITH Cliente AS ( SELECT ROW_NUMBER() OVER (ORDER BY --ASC CASE WHEN (@SortType = 'ID' AND @SortDir = 'ASC') THEN C.ID END A...
CREATE PROC SelectAllImages AS BEGIN SELECT * FROM Images END;
CREATE DATABASE IF NOT EXISTS ##dbname.openunderwriter## character set utf8; GRANT ALL ON ##dbname.openunderwriter##.* TO '##dbusername##'@'localhost' IDENTIFIED BY '##dbpassword##' WITH GRANT OPTION; GRANT ALL ON ##dbname.openunderwriter##.* TO '##dbusername##'@'localhost.localdomain' IDENTIFIED BY '##dbpassword##' WI...
---compare product sales by month select date_format(order_date, '%b-%y') as order_date, sum(if(product='Pen', sale, null) as Pen, sum(if(product='Paper',sale,null) as Paper from sales group by year(order_date), month(order_date), date_format(order_date,'%b-%y'); --- using width_bucket function to cr...
SELECT EMPLOYEENUMBER N , LASTNAME , REPORTSTO , JOBTITLE FROM employees;
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 16, 2017 at 08:50 AM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.5.37 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
#进阶1:基础查询 /* 语法: select 查询列表 from 表名; 特点: 1、查询列表可以是:表中的字段、常量值、表达式、函数 2、查询的结果是一个虚拟的表格 */ #1、查询表中的单个字段 SELECT last_name FROM employees; #2、查询表中的多个字段 SELECT last_name,salary,email FROM employees; #3.查询表中所有的字段,F12可以将代码对齐 #第一种方式 SELECT `employee_id`, `first_name`, `last_name`, `email`, `phone_number`, `job...
INSERT INTO reviews(reviewer, review_title, stars, date_reviewed, energy_efficiency_rating, quality_rating, value_rating, review_body, helpful, not_helpful) VALUES ('Zoeysmom', 'Love this refrigerator. Its very large and fits everything that we need.', 5, '02-DEC-2019', 4, 4, 3, "Love this refrigerator. It 's very l...
/* Navicat MySQL Data Transfer Source Server : KCSJ Source Server Version : 50516 Source Host : localhost:3306 Source Database : spring_kcsj Target Server Type : MYSQL Target Server Version : 50516 File Encoding : 65001 Date: 2017-05-22 08:27:35 */ SET FOREIGN_KEY_C...