text
stringlengths
6
9.38M
CREATE KEYSPACE cdsdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true; CREATE TABLE cdsdb.job_status ( job_name text PRIMARY KEY, expiration_time timestamp, last_processed_time timestamp ) WITH bloom_filter_fp_chance = 0.01 AND caching = {'keys':'ALL', ...
# Database Experiment 3 # 数据修改、删除 # Date: 2018-05-25 # Author: TripleZ <me@triplez.cn> # 3-1 # 把 1 号课程的非空成绩提高 10%。 update SC set Grade = Grade * 1.1 where Grade is not null and Cno='1'; # 3-2 # 在 SC 表中删除课程名为数据结构的成绩的元组。 delete from SC where Cno in ( select Cno from C where Cname='数据结构' ); # 3-3 # 在 S 和...
use `employees`; -- 2 use distinct to find unique titles -- After running the query below , we notice that there are 443308 distinct titlies in the titles table SELECT DISTINCT COUNT(title) FROM titles; -- 3 a query to to find a list of all unique last names of all employees that start and end with 'E' usi...
CREATE TABLE `DiningReservation` ( `ReservationID` bigint(20) NOT NULL AUTO_INCREMENT, `CustomerID` bigint(20) NOT NULL, `DiningType` varchar(45) NOT NULL, `ArrivalDate` date NOT NULL, `ArrivalTime` varchar(45) NOT NULL, `NoOfPeople` int(11) NOT NULL, `Status` varchar(20) NOT NULL, `CreatedDate` datetim...
CREATE OR REPLACE VIEW CAT_BRAND AS SELECT TRIM(SUBSTR(DESCR_VR_MARCA, INSTR(DESCR_VR_MARCA,' - ')+3)) id, TRIM(SUBSTR(DESCR_VR_MARCA, INSTR(DESCR_VR_MARCA,' - ')+3)) descript, null link FROM NA_MATARO.CAT2_T_VALV_REGU_MARCA UNION SELE...
CREATE TABLE seedb_e2e_test ( dim1_3 VARCHAR(40), dim2_3 VARCHAR(40), dim3_4 VARCHAR(40), dim4_4 VARCHAR(40), measure1 INTEGER, measure2 INTEGER, measure3 INTEGER, measure4 INTEGER ); INSERT INTO seedb_e2e_test VALUES ('abc', 'abc', 'abc', 'pqr', 100, 5000, 300, 2500), ('abc', 'def', 'abc', 'stu', 700, 2000, 1...
DELETE FROM address; DELETE FROM persons; DELETE FROM phones; INSERT INTO address_book.address (address) VALUES ('Moscow'); INSERT INTO address_book.address (address) VALUES ('Saint-Peterburg'); INSERT INTO address_book.address (address) VALUES ('Orel'); INSERT INTO address_book.persons (fio, address_id) VALUES ('Iva...
create table maquina ( codigo int, marca varchar(200), antiguedad varchar(100) ); insert into maquina (codigo,marca,antiguedad) values (1,'Excavadora','123'), (2,'Volqueta','124'), (3,'Pavimentadora','125'), (4,'Retroexcavadora','126'), (5,'Pavimentadora','127');
-- Exercice 1 SELECT `languages`.`name` AS `languages_name`, `frameworks`.`name` AS `frameworks_name` FROM `languages` LEFT JOIN `frameworks` ON `frameworks`.languagesId = `languages`.id; -- Exercice 2 SELECT `languages`.`name` AS `languages_name`, `frameworks`.`name` AS `frameworks_name` FROM `languages` INNER JOIN `...
CREATE DATABASE `blog` /*!40100 DEFAULT CHARACTER SET utf8 */; CREATE TABLE `usuarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(30) NOT NULL, `email` varchar(30) NOT NULL, `senha` varchar(30) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; CREATE TABLE `po...
SELECT jobs.applyUntil, jobs.city, jobs.composer, jobs.contactAddress, jobs.creationDate, jobs.description, jobs.duration, jobs.email, jobs.endDate, jobs.hotel, jobs.jobid, jobs.label, jobs.latitude, jobs.location, jobs.longtitude, jobs.payment, jobs.stars, jobs.startDate, jobs.users_id, img.path AS img_...
SELECT * FROM TB_Motivos;
SELECT FirstName, LastName FROM Person.Person WHERE FirstName = 'Mark' SELECT TOP 100 * FROM Production.Product WHERE ListPrice != 0.00 SELECT * FROM HumanResources.vEmployee WHERE LastName < 'D' SELECT * FROM Person.StateProvince WHERE CountryRegionCode = 'CA' SELECT FirstName AS 'Customer First Name', LastN...
-- MySQL Script generated by MySQL Workbench -- Mon Apr 2 11:56: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='TR...
UPDATE tasks SET progress = $2 WHERE taskid = $1;
-- import.sql is executed by Hibernate when the app starts, to populate some sample data -- Add Pete and Marius insert into Member (id, name, email, phone_number) values (1, 'Pete', 'pmuir@redhat.com', '012345678912') insert into Member (id, name, email, phone_number) values (2, 'Marius', 'mariusb@redhat.com', '012345...
INSERT INTO participants VALUES('name', '21', TRUE); SELECT * FROM participants;
CREATE PROCEDURE `display_selected_publication` ( IN pub_id varchar(50) ) BEGIN SET @category = ( SELECT P.category FROM Publications P WHERE P.pub_id = pub_id ); IF @category = 'Book' THEN SELECT B.ISBN, P.title, B.edition, PA.author_name, P.pub_year, B.publisher, IF(P.e_copy = 1, 'Yes...
SET SQL_SAFE_UPDATES = 0; -- Match the cost for each order item UPDATE Sale INNER JOIN ProductCost ON Sale.Product_ProductID = ProductCost.Product_ProductID SET Sale.Cost = ProductCost.UnitCost WHERE Sale.Date >= ProductCost.ValidFromDate AND Sale.Date < ProductCost.ValidUntilDate; -- Calculate the margin UPDATE ...
/* Formatted on 21-Oct-21 4:19:51 AM (QP5 v5.287) */ SET SERVEROUTPUT ON; DECLARE i NUMBER := 1; BEGIN LOOP EXIT WHEN i > 100; DBMS_OUTPUT.PUT_LINE (i); i := i + 1; END LOOP; END; /
exec dbo.UpdateAuctionDate '912810CK2', '1980-08-07', 29.25 exec dbo.UpdateAuctionDate '912810CK2', '1979-11-01', 30 exec dbo.UpdateAuctionDate '912810CL0', '1980-01-03', 15.08 exec dbo.UpdateAuctionDate '912810CM8', '1980-02-07', 30 exec dbo.UpdateAuctionDate '912810CN6', '1980-04-02', 15.08 exec dbo.UpdateAuctionDate...
CREATE TABLE email ( id integer, poid text, fromdomain text, subject text, body_msg text, emaildate datetime, psvendorid text ); CREATE TABLE email_manual_disposition ( id integer, disposition smallint NOT NULL ); CREATE TABLE email_model_disposition ( id integer, disposit...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1:3306 -- Tiempo de generación: 05-08-2021 a las 23:11:08 -- Versión del servidor: 5.7.31 -- Versión de PHP: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHA...
CREATE PROC UpdateBrand @ID int, @Name nvarchar(20) AS BEGIN UPDATE Brands SET Name = @Name WHERE ID = @ID; SELECT * FROM Brands WHERE ID = @ID; END;
-- -- Updating one record to kaisha kihon -- Batch ID: BTSH05 -- @author: KinhNT -- @version: $Id: KaishaShisetsuUpdateService_updateKaishaKihon_Upd_01.sql 10053 2014-07-01 10:49:56Z p_guen_kin $ -- UPDATE BY_KAISHA_KIHON KK SET KK.KAISHA_NAME = /*kaishaName*/'大東建託' , KK.KAISHA_NAME_KANA ...
USE test; CREATE TABLE users( id SMALLINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, username VARCHAR(20) NOT NULL, password VARCHAR(32) NOT NULL, age TINYINT UNSIGNED NOT NULL DEFAULT 0, sex BOOLEAN NOT NULL DEFAULT 0 );
INSERT INTO DEPARTMENT VALUES(1, '영업', 8); INSERT INTO DEPARTMENT VALUES(2, '기획', 10); INSERT INTO DEPARTMENT VALUES(3, '개발', 9); INSERT INTO DEPARTMENT VALUES(4, '총무', 7); INSERT INTO TITLE VALUES(1, '사장'); INSERT INTO TITLE VALUES(2, '부장'); INSERT INTO TITLE VALUES(3, '과장'); INSERT INTO TITLE VALUES(4, '대리'); INSERT ...
CREATE TABLE User ( id BIGINT PRIMARY KEY AUTO_INCREMENT, bannerID VARCHAR(20) NOT NULL, password VARCHAR(76) NOT NULL ); CREATE TABLE UserContactInfo ( id BIGINT PRIMARY KEY AUTO_INCREMENT, userID BIGINT NOT NULL, firstName VARCHAR(100) NULL, lastName VARCHAR(100) NULL, email VARCHAR(320) NO...
declare begin end; / declare begin end; /
select distinct s1.id, s1.visit_date, s1.people from stadium s1, stadium s2, stadium s3 where s1.people >= 100 and s2.people >= 100 and s3.people >= 100 and ((s1.id+1 = s2.id and s1.id+2 = s3.id) or (s1.id-1 = s2.id and s1.id+1 = s3.id) or (s1.id-1 = s2.id and s1.id-2 = s3.id)) order by s1.id ...
-- Lab | SQL Advanced queries -- In this lab, you will be using the Sakila database of movie rentals. -- Instructions -- 1. List each pair of actors that have worked together. select concat(aa.first_name, ' ', aa.last_name) As Actor1, concat(ac.first_name, ' ', ac.last_name) as Actor2 from actor as aa inner join fil...
CREATE TABLE [icb].[TechnologyStack] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (500) NOT NULL, [DisplayName] NVARCHAR (500) NOT NULL, [IsActive] BIT CONSTRAINT [DF_TechnologyStack_IsActive] DEFAULT ((1)) NOT NULL, [CreatedBy] NVARCHAR (50) NOT ...
/* Select all data for customers who live in 'Cockeysville'. */ select * from customers where city='Cockeysville' /
-------------------------------------------------------- -- File created - Selasa-Mei-09-2017 -------------------------------------------------------- -------------------------------------------------------- -- DDL for Table MST_CUSTOMER -------------------------------------------------------- CREATE TABLE "MST...
INSERT INTO characters (user_id, class_id, character_name, level, experience, gold, retired, items, checkmarks, perks) VALUES ($1, $2, $3, 1, 0, 30, false, '{ "Head":"", "Body":"", "One Hand":"", "Two Hands": "", "Legs":"", "Small Item":"" }', $4, $5)
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 27, 2021 at 04:55 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
/* * 01 - Compare a film's replacement cost against the average replacement cost for the films within a rating. * Indicate with a boolean if the replacement cost is greater than the average. * * Expected headers: * title |rating|replacement_cost|avg_cost |is_overpriced| * ------|------|----------------|---------...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Gegenereerd op: 21 mrt 2016 om 14:17 -- Serverversie: 10.1.10-MariaDB -- PHP-versie: 7.0.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; ...
create table BURI_STATE ( STATE_ID bigint not null, PATH_ID bigint, DATA_ID bigint, BRANCH_ID bigint, USER_ID_VAL varchar(20), PARTICIPANT_NAME varchar(200), PARTICIPANT_TYPE varchar(200), USER_ID_NUM bigint, BT_ID bigint, INSERT_DATE timestamp not null, AUTO_RUN_T...
create table User ( id_user varchar(50) not null primary key, password varchar(50) not null, isAdmin tinyint(1) not null, name varchar(50) not null, first_name varchar(50) not null );
CREATE TABLE lists ( id serial PRIMARY KEY, name varchar UNIQUE NOT NULL ); CREATE TABLE todos ( id serial PRIMARY KEY, list_id int NOT NULL REFERENCES lists (id), name varchar NOT NULL, completed boolean NOT NULL DEFAULT false );
/*retrieve table*/ SELECT * FROM User; SELECT * FROM Service; SELECT * FROM SearchRecord; SELECT * FROM Address; SELECT * FROM CheckBoxMessage; SELECT * FROM ShoppingCart; SELECT * FROM Favourites; SELECT * FROM Purchased; SELECT * FROM Discount; SELECT * FROM Comment;
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 `cuitcc` DEFAULT CHARACTER SET utf8 ; USE `cuitcc` ; -- -------------------------------...
# Write your MySQL query statement below # Report the sum of all total investment values in 2016 tiv_2016, for all policyholders who: have the same tiv_2015 value as one or more other policyholders, and are not located in the same city like any other policyholder (i.e., the (lat, lon) attribute pairs must be unique). #...
insert into biz_mu_role(usr_no,rol_id,mu_type,mu_id) values (1,'ROLE_ADMIN','NO',0); commit;
sudo docker run -p 8080:8080 --name webgoat --rm -it -v ~/webgoat-data:/home/webgoat/.webgoat-8.0-8088465 webgoat/webgoat-8.0:latest http://34.70.4.78:8080/WebGoat/login -- SQL Injection (intro) 1. select department from employees where last_name = 'Franco'; 2. update employees set department = 'Sales' where userid = ...
-- DROP TABLES -- Phenotyping related DROP TABLE IF EXISTS observation; DROP TABLE IF EXISTS observation_variable; DROP TABLE IF EXISTS method; DROP TABLE IF EXISTS scale; DROP TABLE IF EXISTS trait; DROP TABLE IF EXISTS ontology; DROP TABLE IF EXISTS treatment; DROP TABLE IF EXISTS observation_unit_xref; DROP TABLE I...
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #@ #@ #@ #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ pre 2020-11-16 create or replace view vw_timelog as select t.log_date, t.log_hours, p.name as project_name, p.number as project_number , p.tech_radar_num, p.active as project_active, p.ae_lea...
-- Returns first 100 rows from tutorial.dunder_mifflin_paper_sales SELECT * FROM tutorial.dunder_mifflin_paper_sales LIMIT 100; SELECT order_id, account_id, account_name, account_manager, days_to_close, shipping_address, shipping_city, shipping_state, shipping_zip, shipping_latitude, shipping_l...
DROP DATABASE IF EXISTS SUPERHEROUPDATE_DB; CREATE DATABASE SUPERHEROUPDATE_DB; USE SUPERHEROUPDATE_DB; CREATE TABLE HEROES( id INT NOT NULL AUTO_INCREMENT, Hero_Name VARCHAR(40) NOT NULL, Secret_ID VARCHAR(40) NOT NULL, Super_Power VARCHAR(30) NOT NULL, PRIMARY KEY (id) ); INSERT INTO HEROES(He...
create table stockPrincipal( id int not null auto_increment, nameMed varchar(60) not null, proveedor varchar(50) not null, lote varchar(10) not null, fechaVencimiento date not null, cantidad int not null, unidad varchar(10) not null, equivalencia float not null, primary key(id) ); insert ...
ALTER TABLE etl.EtlIncomingMails ADD InsertedDate datetime NOT NULL CONSTRAINT DF_EtlIncomingMails_InsertedDate DEFAULT getdate()
create schema if not exists pp; set schema 'pp';
ALTER TABLE workouts DROP COLUMN date;
use t_User; CREATE TABLE IF NOT EXISTS tuser( tid int(10) auto_increment primary key, tname VARCHAR(20), tage int(10) );
CREATE PROCEDURE test_procedure() BEGIN END
-- DML Data Manipulation language 데이터 조작 언어 -- insert, delete, select(90%), update Data --SELECT -- 데이터베이스에 들어있는 데이터를 조회하거나 검색하기 위한 명령어 /* SELECT (값, 문자, COLUMN, 함수, SUB QUERY) FROM (TABLE명, SUB QUERY) */ -- 가상의 테이블에 1의 값을 내보내라 SELECT 1 FROM DUAL; -- 현재 계정의 테이블을 모두 명세해보고 싶다 SELECT * ...
CREATE VIEW `visa_alla_kunder_med_bud` AS select * from gruppinlamning_relationmodel.bud inner join gruppinlamning_relationmodel.aktiv_auktion on gruppinlamning_relationmodel.bud.aktiv_auktion_id_auktionsnummer = gruppinlamning_relationmodel.aktiv_auktion.id_auktionsnummer ;
SELECT DISTINCT title FROM titles; SELECT DISTINCT title FROM titles ORDER BY title ASC; SELECT last_name FROM employees WHERE last_name LIKE ('e%') AND last_name LIKE ('%e') GROUP BY last_name; SELECT last_name, first_name FROM employees WHERE last_name LIKE ('e%') AND last_name LIKE ('%e') GROUP BY last_name, firs...
-- -- Copyright (C) 2005 WEG -- -- This file is part of dotFOLIO. -- -- dotFOLIO is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at your -- option) any late...
# Write your MySQL query statement below SELECT customer_number FROM Orders GROUP BY customer_number ORDER BY COUNT(*) DESC LIMIT 1
select hackers.hacker_id, hackers.name from submissions inner join hackers on hackers.hacker_id=submissions.hacker_id inner join challenges on submissions.challenge_id=challenges.challenge_id inner join difficulty on challenges.difficulty_level=difficulty.difficulty_level and submissions.score = difficulty.score group ...
CREATE PROC [ERP].[Usp_Ins_TipoCambio_Automatico] @IdTipoCambioDiario INT OUT, @Fecha DATETIME, @VentaSunat DECIMAL(14, 5), @CompraSunat DECIMAL(14, 5), @VentaSBS DECIMAL(14, 5), @CompraSBS DECIMAL(14, 5), @VentaComercial DECIMAL(14, 5), @CompraComercial DEC...
/*************************************************************************** * Copyright (C) 2010 by H-Store Project * * Brown University * * Massachusetts Institute of Technology * * Yale Uni...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 19 Des 2020 pada 17.09 -- Versi server: 10.4.14-MariaDB -- Versi PHP: 7.4.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH...
create tablespace BLAWDATA datafile '/u01/app/oracle/oradata/XE/blawdata.dbf' size 100M autoextend on maxsize 200M extent management local uniform size 64K; QUIT;
/* Тесты */ -- ----------------------------------------------------------------------------- SELECT poma.test('types'); -- BOT SELECT * FROM rpc_testing.test_types( a_tbool := 1::bool , a_tchar := 'a'::char , a_tdate := '1997-12-17'::date , a_tfloat4 := 12.34::float4 , a_tfloat8 := 1234.5678::floa...
create or replace view v_vct as select v.vct_em_addr, v.vct_field, chr(v.id_crt) id_crt, v.num_crt, v.val, v.lib_crt, v.lib_crt_court, v.user_create_vct, v.date_create_vct, v.user_modify_vct, v.date_modify_vct from vct v;
CREATE PROCEDURE registrera_produkt (artnr int, produktnamn varchar(45), kategori varchar(45), leverantorID int) BEGIN insert into leverantor values (artnr, produktnamn, kategori, leverantorID); END
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Client : localhost:3306 -- Généré le : Mer 06 Février 2019 à 10:59 -- Version du serveur : 5.7.25-0ubuntu0.18.04.2 -- Version de PHP : 7.2.10-0ubuntu0.18.04.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!4010...
--// Remove Image Requirement for Story -- Migration SQL that makes the change goes here. alter table Story modify imageId varchar(36) null; --//@UNDO -- SQL to undo the change goes here. alter table Story modify imageId varchar(36) not null;
/*a review oif the data for explanations, analyses and possible treends to discuss*/ select * from covid_by_day where date ='2020-07-27' select sum(value), avg(value) from covid_by_day --2729.2815356489945155 select count(*) as average, start_time into accidents_by_day from accident_df group by start_time select...
# --- !Ups insert into user(email, role, name, password) values ('admin@irishflights.com', 'admin', 'Alice', 'admin'); insert into destination(id, destination) values ('1', 'America'); insert into destination(id, destination) values ('2', 'Australia'); insert into destination(id, destination) values ('3', 'China'); i...
SELECT DISTINCT u.user_id, u.first_name, u.last_name, u.street_address, u.state, u.city, u.zip, u.email, u.phone, u.avatar, u.title, u.longitude, u.latitude, u.about_message, u.proximity FROM users u JOIN caregiver_availability ca ON ca.user_id = u.user_id WHERE (begin_time < $1 AND end_time > $1) AND (u.proximity = $2...
USE eleicoes; INSERT INTO CANDIDATO (cpf, nomeUrna, sexo, nomeCandidato, dtNascimento) VALUES ('7857136204', 'PAULINHO', 'MASCULINO', 'PAULO CESAR FERREIRA DE ARAUJO', '1957-04-08'); INSERT INTO CANDIDATO (cpf, nomeUrna, sexo, nomeCandidato, dtNascimento) VALUES ('17357152987', 'TIAO BOCALOM', 'MASCULINO', 'SEBASTIAO...
INSERT INTO `usuario` (`idusuario`, `usnombre`, `uspass`, `usmail`, `usdeshabilitado`) VALUES (1, 'admin', '81dc9bdb52d04dc20036dbd8313ed055', 'ariel.villalobos96@gmail.com', NULL), (2, 'ariel', '81dc9bdb52d04dc20036dbd8313ed055', 'ariel@gmail.com', NULL), (3, 'wachi', '8f14aa806d987309218eaf28ba304c3f', 'wachu@gmail.c...
 CREATE FUNCTION [CoreFacade].[GetPolicyDocuments] ( @PolicyId int ) RETURNS TABLE AS RETURN ( SELECT Documents.* FROM CoreModel.PolicyDocuments INNER JOIN CoreFacade.Documents ON PolicyDocuments.DocumentId = Documents.DocumentId WHERE PolicyId = @PolicyId )
insert into kombined.getting_to_know_question(id, question) values(1, 'getting to know question 1'); insert into kombined.getting_to_know_question(id, question) values(2, 'getting to know question 2');
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Aug 11, 2014 at 10:36 AM -- Server version: 5.5.32 -- PHP Version: 5.4.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */...
DROP TABLE IF EXISTS `Race`; --Create Race TABLE CREATE TABLE `Race`(`ID` INT NOT NULL AUTO_INCREMENT, `Name` VARCHAR(255) NOT NULL UNIQUE, `Language` VARCHAR(255), PRIMARY KEY(`ID`) )ENGINE=INNODB;
; WITH cte AS ( SELECT YEAR(OrderDate) AS OrderYear , SUM(SubTotal) AS YearlySubtotal FROM Sales.SalesOrderHeader GROUP BY YEAR(OrderDate) ) SELECT * , (SELECT SUM(YearlySubtotal) FROM cte) AS WholeSubtotal FROM cte ORDER BY OrderYear ; WITH cte AS ( SELECT YEAR(OrderDate) AS OrderYear , SUM(SubTotal) AS Yearly...
SELECT 'projects: PN-->SID' AS FD, CASE WHEN COUNT(*)=0 THEN 'Gildir' ELSE 'Gildir ekki' END AS VALIDITY FROM( SELECT PN FROM projects GROUP BY PN HAVING COUNT(DISTINCT SID) > 1 ) X;
DELETE FROM users WHERE userid = $1;
-- MySQL Script generated by MySQL Workbench -- mié 26 feb 2020 20:24:21 CET -- 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...
DROP TABLE IF EXISTS `releases`; CREATE TABLE IF NOT EXISTS `releases` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `url` text NOT NULL, `cracker` text NOT NULL, `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) );
CREATE TABLE Roles ( RoleID int NOT NULL AUTO_INCREMENT PRIMARY KEY, RoleName varchar(255) ); CREATE TABLE Users ( UserID int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(255) NOT NULL, LastName varchar(255) NOT NULL, Password varchar(255) NOT NULL, PhoneNumber varchar(1...
SET OPERATORS ============= SET OPERATOR ARE USED TO RETERIVE DATA FROM SINGLE OR MULTIPLE TABLES. SET OPERATORS ARE ALSO CALLED AS VIRTICALE JOINS. These set Operators are: ======================== 1:Union =>it returns value unique time+sorting ...
INSERT INTO employee_experience (items_per_hour, title) VALUES (2, 'Junior'), (3, 'Expert'); INSERT INTO item_type (title, material_price) VALUES ('Seat', 150.00), ('Backrest', 25.00), ('Steering wheel', 60), ('Doorhandle', 19.00), ('Other', 50.00); INSERT INTO color (name) VALUES ('Black'), ('White'), ('Red'), ('Gre...
-- Exercise 2: Create a DB named "vtapp", create a db user named 'vtapp_user' and give him permissions to access vtappDB CREATE DATABASE vtapp; CREATE USER 'vtapp_user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON vtapp.* TO 'vtapp_user'@'localhost';
UPDATE tbl_audit_question_reference SET fk_id = _source.id_key FROM tbl_audit_question _source WHERE fk_id_old = _source.id_old
SuperBasicLevel { RenderComponent { Mesh = Levels/SuperBasic/nanosuit/nanosuit.obj; } }
-- -- AVALIAR SEGMENTOS DE ROLLBACK E UNDO EM USO -- SELECT r.segment_name, r.tablespace_name, s.SID, s.serial#, s.username, s.machine, t.status, t.cr_get, /*consistent gets*/ t.phy_io, /*physical io*/ t.used_ublk, /*Undo blocks used*/ t.noundo, /*Is a noundo transaction*/ SUBSTR (s.program...
INSERT into cats(name) values ('Laptops') , ('PCs') , ('Mobiles'); insert into products(`name` , `desc` , price , pieces_no , img , cat_id ) values ('lenovo idepad' , 'this is dummy description for product' , 15000 , 10 , '1.jpg' , 1), ('dell laptop' , 'this is dummy description for product' , 10000 , 10 , '2.jpg' , 1...
#设置客户端连接服务器端编码 SET NAMES UTF8; #丢弃数据库,如果存在 DROP DATABASE IF EXISTS tedu; #创建数据库,设置编码 CREATE DATABASE tedu CHARSET=UTF8; #进入创建好的数据库 USE tedu; #创建保存部门数据的表 CREATE TABLE dept( did SMALLINT PRIMARY KEY, dname VARCHAR(8), empCount SMALLINT ); #插入部门数据 INSERT INTO dept VALUES (10,'研发部',3), (30,'市场部',2), (20,'运营部',2); #创建...
--liquibase formatted sql -- see: http://www.liquibase.org/ --changeset contact@contactopensource.com:13 --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'postal_contacts' CREATE TABLE postal_contacts ( id uuid not n...
INSERT INTO favorites (productid, customerid) VALUES ($1, $2);
SELECT * FROM SHY_PARTICLE_EFFECT WHERE id = ?;
select CT.TABLE_NAME, decode(tb.duration,'SYS$SESSION','TEMP_SESSION','SYS$TRANSACTION','TEMP_TRANSACTION','NORMAL'), CT.COLUMN_NAME, CT.DATA_TYPE, DECODE(CT.DATA_TYPE ,'NUMBER',CT.DATA_PRECISION ,'NVARCHAR2',CT.char_col_decl_length ,'VARCHAR2',CT.CHAR_LENGTH ,'CHAR',CT.CHAR_LENGTH ,CT.DATA_LE...
/** * SQL for check shisetsu insurance from FR_SHISETSU_WITHOUT_INS_SRV * @author QuocHN * @version $Id: ShisetsuCareMedicalService_getShisetsuInsurance_Sel_01.sql 23336 2014-08-27 01:52:30Z p_hoan_kuokku $ */ SELECT FSWIS.SERVICE_CONTENTS, FSWIS.WITHOUT_INSURANCE_SERVICE_KBN, FSWIS.COST_MAX, FSWIS.COS...
INSERT INTO ${domain} (id, content, deleted, creation_timestamp, last_update_timestamp) VALUES (21, 'Active ${domain} 1', 0, '2018-01-01 00:01:00', '2018-01-01 00:00:00'), (22, 'Active ${domain} 2', 0, '2018-01-01 00:02:00', '2018-01-01 00:00:00'), (23, 'Active ${domain} 3', 0, '2018-01-01 00:03:00', '2018-01-01...