text
stringlengths
6
9.38M
-- +migrate Up -- SQL in section 'Up' is executed when this migration is applied create or replace view view_projects as select p.id, p.pkey, p.name, p.datecreated, p.begins, p.ends, (l.name || ' '::text) || l.lastname AS projectlead, p.issuecount, p.notresolvedcount, coalesce(1::...
# --- Sample dataset # --- !Ups delete from item_on_sale; insert into category (id,name) values ( 1,'PR' ); insert into category (id,name) values ( 2,'Finance' ); insert into category (id,name) values ( 3,'IT' ); insert into category (id,name) values ( 4,'Accounting' ); insert into category (id,name) values ( 5,'...
-- -- Test to create a simpel DM that can run with GeoGig -- To be used for presentation -- -- Copied Table: ga.g_hauptltg_abschnitt DROP TABLE IF EXISTS ga_test.g_hauptltg_abschnitt; CREATE TABLE ga_test.g_hauptltg_abschnitt ( g_katasterblattnummer_g_katasterblattnummer_katasterblattnummer character varying(30),...
CREATE OR REPLACE PROCEDURE plch_show_customers(p_string varchar2) AS TYPE rc is ref cursor; l_cur rc; TYPE array IS TABLE OF plch_customers.custname%TYPE INDEX BY BINARY_INTEGER; l_data array; BEGIN OPEN l_cur FOR p_string; LOOP FETCH l_cur BULK COLLECT into l_da...
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table customer ( id bigint not null, name varchar(255), duetime timestamp, jointime timesta...
--修改人:陈春燕 --修改日期:2012-09-08 --修改内容: 新增菜单 --修改原因:需求-AKS-JD03-04[票据上拨下划] insert into BT_SYS_RES (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, RE...
do $$ declare r record; t record; query text; params text; type text; begin for r in (select proname, proargtypes from pg_proc p, pg_namespace n where n.nspname = current_schema() and p.pronamespace = n.oid and p.oid not in (select tgfoid from pg...
-- MySQL dump 9.11 -- -- Host: localhost Database: shellshark -- ------------------------------------------------------ -- Server version 4.0.25 -- -- Table structure for table `invoices` -- CREATE TABLE invoices ( seq int(20) NOT NULL auto_increment, ts varchar(14) NOT NULL default '', descr varchar(64) NOT...
SELECT point FROM "user" WHERE username = ?;
INSERT INTO `ssaif_prod_abril`.`dbsancionesfallos` (`idsancionfallo`, `refsancionesjugadores`, `cantidadfechas`, `fechadesde`, `fechahasta`, `amarillas`, `fechascumplidas`, `pendientescumplimientos`, `pendientesfallo`, `generadaporacumulacion`, `observaciones`) SELECT `sancionesfallos`.`sancionfalloid`, `sanciones...
insert into repository (url, name, namespace) values('url1', 'name1', 'namespace1'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id1', 'url1', '1.0.0', '18'); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_...
START TRANSACTION; SET FOREIGN_KEY_CHECKS=0; ALTER TABLE `condominio` CHANGE `cep` `cep` VARCHAR(9) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; SET FOREIGN_KEY_CHECKS=1; COMMIT;
EXEC sp_rename 'dbo.Users.FullName', 'Username', 'COLUMN';
-- Database: books -- DROP DATABASE books; CREATE DATABASE books WITH OWNER = adm_books ENCODING = 'UTF8' LC_COLLATE = 'French_France.1252' LC_CTYPE = 'French_France.1252' TABLESPACE = pg_default CONNECTION LIMIT = -1; GRANT TEMPORARY, CONNECT ON DATABASE books TO PUBLIC; GRANT ALL ON D...
define date_format='yyyy-mm-dd hh24:mi:ss'
CREATE TABLE IF NOT EXISTS user( id BIGINT NOT NULL auto_increment PRIMARY KEY, name VARCHAR (200) NOT NULL ); CREATE TABLE IF NOT EXISTS user_playlist( user_playlist_id BIGINT NOT NULL auto_increment PRIMARY KEY, user_id BIGINT NOT NULL REFERENCES user(id), playlist_id BIGINT NOT NULL REFERENCES p...
create or replace package body github_issues as procedure create_issue ( git_account varchar2 , repos_name varchar2 , title varchar2 , body clob default null , assignee varchar2 default null , milestone number default null , labels varchar2 default null ) as begin ...
/* Covid Analysis Data Exploration project Source: https://ourworldindata.org/coronavirus Last Updated data: 2021-06-06 (June 6th, 2021) --> Skills used: Aggregate Functions, General Exploration, Wildcards, Joins, CTE's, Temp Tables, Views, Converting Data Types */ select * from PortfolioProject..cov...
CREATE OR REPLACE PROCEDURE DI(ll_wo_Nbr NUMBER, ip_rmk VARCHAR2 DEFAULT NULL) IS ---by wxh lv_so_nbr VARCHAR2(20); BEGIN SELECT so_nbr INTO lv_so_nbr FROM wo WHERE wo_nbr = ll_wo_Nbr; UPDATE spjk_table t2 SET t2.sts = 'F', t2.backfill_flag = 'Y', t2.remarks = t2.remark...
DROP TRIGGER ref_estadio; DROP TRIGGER estadio_delete; DROP TRIGGER ref_equipo; DROP TRIGGER equipo_delete; DROP TRIGGER u_estadio; DROP TRIGGER u_equipo;
CREATE TABLE `category` ( `category_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `parent_id` int(10) unsigned DEFAULT NULL, `path` varchar(255) NOT NULL, `level` int(10) unsigned NOT NULL, `name` varchar(255) NOT NULL, `url_key` varchar(255) NOT NULL, `description` text, `position` int(10) unsigned DEF...
-- BORRAMOS LA BASE DE DATOS SI EXISTE DROP DATABASE "desafio2-marco-contreras-911"; -- CREAMOS LA BASE DE DATOS desafio2-nombre-apellido-digitos CREATE DATABASE "desafio2-marco-contreras-911"; -- NOS CONECTAMOS A LA DB \c desafio2-marco-contreras-911; -- TABLA CREATE TABLE IF NOT EXISTS INSCRITOS( cantida...
select FirstName + ' ' + LastName as FullName, InvoiceId, InvoiceDate, BillingCountry from Customer as c join Invoice as i on c.CustomerId = i.CustomerId where c.Country = 'Brazil';
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Sep 19, 2020 at 04:13 PM -- Server version: 5.7.26 -- PHP Version: 7.2.18 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CH...
use 310brandon; set foreign_key_checks = 0; drop table student cascade; drop table building cascade; drop table apartment cascade; set foreign_key_checks = 1; create table student ( id int(10), fname varchar(32) not null, lname varchar(32) not null, bid char(2), floor int(2), aptid char(1), p...
alter table stream_definitions add column description varchar(255); alter table stream_definitions add column original_definition text; alter table task_definitions add column description varchar(255); CREATE TABLE task_execution_metadata ( id int8 NOT NULL, task_execution_id int8 NOT NULL, task_execution_mani...
SELECT FirstName + ' ' + LastName AS Available FROM Mechanics m LEFT JOIN Jobs j ON m.MechanicId = j.MechanicId WHERE Status IS NULL OR m.MechanicId NOT IN (SELECT m.MechanicId FROM Mechanics m LEFT JOIN Jobs j ON m.MechanicId = j.MechanicId WHERE Status !='Finished' GROUP BY m.MechanicId) GROUP BY m.Mec...
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50621 Source Host : localhost:3306 Source Database : i_friend Target Server Type : MYSQL Target Server Version : 50621 File Encoding : 65001 Date: 2016-07-11 16:49:05 */ SET FOREIGN_KEY_CHECKS=0; -- ...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3307 -- Generation Time: Aug 27, 2018 at 06:03 AM -- Server version: 10.1.30-MariaDB -- PHP Version: 5.6.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SE...
-- phpMyAdmin SQL Dump -- version 4.8.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 31, 2018 at 07:18 AM -- Server version: 10.1.32-MariaDB -- PHP Version: 7.2.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @O...
 CREATE PROCEDURE Dictionaries.ReadEditableDictionaries @bitEditabilty BIT AS BEGIN SELECT Name, DictionaryId FROM Dictionaries.Dictionaries WHERE IsEditable = @bitEditabilty AND IsDeleted = 0 END
use TelerikAcademy; select FirstName, LastName from Employees where FirstName like 'SA%';
--修改人:胡双 --修改日期:2012-12-26 --修改内容:修改RETURN_MSG列的长度 ALTER TABLE BIS_ACC_HIS_DTL MODIFY RETURN_MSG VARCHAR2(500); ALTER TABLE BIS_ACC_HIS_DTL_MERGEN MODIFY RETURN_MSG VARCHAR2(500); ALTER TABLE BIS_ACC_HIS_DTL_SPLIT MODIFY RETURN_MSG VARCHAR2(500); ALTER TABLE AB_OPERATION MODIFY RETURN_MSG VARCHAR2(500);
SELECT vend_id FROM Products; SELECT DISTINCT vend_id FROM Products; SELECT DISTINCT vend_id, prod_price FROM Products; SELECT vend_id, prod_price FROM Products;
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.7.23-log - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL Version: 9.5.0.5293 -- --------------------------------------------------------...
-- --------------------------------------------------------- -- Team Project for DB1 course, MovinOn Inc DataBase -- Developed by ZOE Group -- March 2021 -- --------------------------------------------------------- USE movinon_zoe; -- --------------------------------------------------------- -- Query: 8_JobPositions --...
call Selecionar_tudo();
-- 8. Contabilize a quantidade de cidades do estado de SP. SELECT COUNT(estado) 'Quantidade de Cidades de Sao Paulo' FROM cidades WHERE estado = 'SP';
select year(O0."DocDate") "Year", month(O0."DocDate") "Month", dayofmonth(O0."DocDate") "Day", weekday(O0."DocDate") "WeekDay", O1."Price" from HACKATHON6.OPOR O0 inner join HACKATHON6.POR1 O1 on O0."DocEntry" = O1."DocEntry" where O0."DocDate" >= '20130101' order by O0."DocEntry";
/****** Object: StoredProcedure [dbo].[prc_CWI_GetCompanyConfigAddress] Script Date: 6/28/2013 7:06:55 PM ******/ IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'prc_CWI_GetCompanyConfigAddress') DROP PROCEDURE [dbo].[prc_CWI_GetCompanyConfigAddress] GO /****** Object: StoredProcedure [dbo].[p...
-- -------------------------------------------------------------------------------- -- Name: Daniel Shepherd -- Class: SQL #1 -- Abstract: Homework 1 -- -------------------------------------------------------------------------------- -- -------------------------------------------------------------------------------- -...
/* Изменение процедуры изменения должника */ ALTER PROCEDURE /*PREFIX*/U_DEBTOR @DEBTOR_ID VARCHAR(32), @DEBTOR_TYPE INTEGER, @SURNAME VARCHAR(100), @NAME VARCHAR(100), @PATRONYMIC VARCHAR(100), @PASSPORT VARCHAR(250), @SEX INTEGER, @DATE_BIRTH DATETIME, @PLACE_BIRTH VARCHAR(250), @ADDRESS_RESIDEN...
SELECT trackid, name, albumid, mediatypeid, genreid, composer, milliseconds, bytes, unitprice FROM tracks;
SELECT category_name,SUM(item_price) AS total_price FROM item JOIN item_category ON item.category_id = item_category.category_id GROUP BY category_name ORDER BY total_price DESC;
create table user_info ( id int auto_increment primary key, type int not null comment '用户类型', email varchar(200) not null comment '邮箱', password varchar(200) null comment '密码', createTime datetime null, status int null comment '用户账号状态', isDelete int null, updateTime datetime null, updateUserId int...
drop database if exists flag_team_B; create database flag_team_B; use flag_team_B; create table utilisateurs ( id_user int (3) not null auto_increment, login varchar (20), password varchar(20), Primary Key (id_user)); insert into utilisateurs (login,password) values ('user','@dm1n1str4tor');
CREATE PROCEDURE InsertAddress (IN userIdIN int(11), addressCityIdIN int(11), IN addressStreetIN varchar(100), IN addressHouseNumberIN varchar(20), IN addressFlatNumberIN int(11)) BEGIN INSERT INTO address(userId, addressCityId, addressStreet, addressHouseNumber, addressFlatNumber) VALUES(userIdIN, addressCityIdIN, ad...
CREATE TABLE stacoun AS ( SELECT stations.station_id, stations.state, counties.county AS county_name, counties.sfips AS state_fips, counties.cfips AS county_fips, stations.name FROM stations JOIN counties ON (ST_Contains(counties.geom, stations.geom) AND stations.state = counties...
database test@ol_s_111214_125432 CREATE TABLE Persons_pipe_datetime_1 ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255), PersonID2 int, LastName2 varchar(255), FirstName2 varchar(255), Address2 varchar(255), City2 DATETIME YEAR TO SECOND); CONNECT to 'test5@ol_s_1...
ALTER TABLE `c_configuration` ADD COLUMN `is_trap_door` boolean NOT NULL DEFAULT '0' AFTER `enabled`; insert into c_configuration(name, value, enabled, is_trap_door, description) values('rounding-mode', '6', '1', '1', '0 - UP, 1 - DOWN, 2- CEILING, 3- FLOOR, 4- HALF_UP, 5- HALF_DOWN, 6 - HALF_EVEN');
--- URI Online Judge SQL --- Copyright URI Online Judge --- www.urionlinejudge.com.br --- Problem 2622 SELECT customers.name FROM customers JOIN legal_person ON legal_person.id_customers = customers.id WHERE customers.id IN (SELECT legal_person.id_customers FROM legal_person);
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 29 Mar 2020 pada 15.13 -- Versi server: 10.1.38-MariaDB -- Versi PHP: 7.3.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARA...
INSERT INTO USERS (ID, ACTIVE, PASSWORD, ROLES, USER_NAME)VALUES(1, TRUE, 'pswd', 'USER', 'user')
BEGIN TRANSACTION; CREATE TABLE "User" ( `ID` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT, `Surname` TEXT, `Gender` TEXT, `Birth_date` TEXT, `Email` TEXT, `Login` TEXT, `Password` TEXT, `User_type` TEXT ); INSERT INTO `User` (ID,Name,Surname,Gender,Birth_date,Email,Login,Password,User_type) VALUES (1,'Jerzy...
Create Procedure Sp_Close_STOSchemes(@DocSerial Int) as --SaleType = 1 is for STO Update SchemeSale Set Pending = 0 Where SaleType = 1 And InvoiceID = @DocSerial
CREATE TABLE IF NOT EXISTS `spell_override` ( `overrideSpell` int(10) unsigned NOT NULL default '0', `affSpell` int(10) NOT NULL default '0', `aura` int(10) NOT NULL default '0', `comment` longtext NOT NULL default '', PRIMARY KEY (`overrideSpell`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; INSERT I...
START TRANSACTION; DROP TABLE IF EXISTS location; DROP TABLE IF EXISTS product; DROP TABLE IF EXISTS user; CREATE TABLE user ( id INTEGER PRIMARY KEY AUTO_INCREMENT, username varchar(255) UNIQUE NOT NULL, password varchar(255) NOT NULL ); CREATE TABLE product ( id INTEGER PRIMARY KEY AUTO_INCREMENT, descri...
# patch_46_47_b.sql # # title: new align columns # # description: # Add external_db_id and hcoverage columns to dna_align_feature and protein_align_feature ALTER TABLE dna_align_feature ADD COLUMN external_db_id SMALLINT UNSIGNED; ALTER TABLE dna_align_feature ADD COLUMN hcoverage DOUBLE; ALTER TABLE dna_align_featur...
/* Table: Sales +---------------+---------+ | Column Name | Type | +---------------+---------+ | sale_date | date | | fruit | enum | | sold_num | int | +---------------+---------+ (sale_date,fruit) is the primary key for this table. This table c...
-- scheme 확인 use webdb; desc book; desc author; -- 1.insert author insert into author values(null, '스테파니메이어'); select no, name from author; -- 2.insert book insert into book values(null,'이클립스', 1, '대여가능'); select *from book; -- select book select b.no, b.title,b.status, a.name from book b, author a where b.author_n...
{call readStreamBackwardsWithData(?, ?, ?, ?, ?, ?) }
SELECT DISTINCT MasterPatient_ID, ATCLevel5Name, ATCLevel3Name FROM DimProductMaster d JOIN FactScript f ON f.MasterProductId = d.MasterProductID JOIN DimMAIU m ON m.MAIU_ID = f.MAIUID WHERE ATCLevel1Name ILIKE '%NERVOUS SYSTEM%' AND ATCLevel2Name ILIKE '%PSYCHO%' AND MasterPatient_ID...
SELECT ARCHIVO.NUMERO_CONSTANCIA AS id_release, OID as id, CASE ARCHIVO.OID_CLASE_ARCHIVO WHEN 3 THEN 'clarifications' WHEN 6 THEN 'hearingNotice' WHEN 9 THEN 'winningBid' WHEN 10 THEN 'evaluationReports' WHEN 11 THEN 'Contract notice' WHEN 13 THEN 'contractSigned' WHEN 17 THEN 'completionCertificate' ...
/* SQLyog Ultimate v11.52 (64 bit) MySQL - 5.5.38-0ubuntu0.14.04.1 : Database - at ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIG...
select asceding.rnk , i1.i_product_name best_performing , i2.i_product_name worst_performing from ( select * from ( select item_sk , rank() over (order by rank_col asc) rnk from ( select ss_item_sk item_sk , avg(ss_net_profit) rank_col ...
/* Создание таблицы типов фирм */ CREATE TABLE /*PREFIX*/FIRM_TYPES ( FIRM_TYPE_ID VARCHAR2(32) NOT NULL, NAME VARCHAR2(100) NOT NULL, DESCRIPTION VARCHAR2(250), PRIORITY INTEGER NOT NULL, PRIMARY KEY (FIRM_TYPE_ID) ) -- /* Создание просмотра таблицы типов фирм */ CREATE OR REPLACE VIEW /*PREFIX*/S_FIRM_T...
Create Procedure dbo.[FSU_sp_VersionUpdation]( @InstallationID int, @fldKeyName nvarchar(200), @VersionNO nvarchar(20), @Applicable int = 2, @FileType int ) As if(Exists(Select * from COMVersion where ComponentName = @fldKeyName)) begin update COMVersion set Version = @VersionNO, ModifiedDate = getDa...
drop database if exists case_db; create database case_db; use case_db; create table viTri( idViTri int primary key, tenViTri varchar(45) ); create table trinhDo( idTrinhDo int primary key, trinhDo varchar(45) ); create table boPhan( idBoPhan int primary key, tenBoPhan varchar(45) ); create table loai...
CREATE Procedure sp_IsInvoiceClaimed(@InvoiceID as int) As -- Itembased Percentage and ItemBased Amount are Saved as Seperate item -- with Pending = 1 -- So Claimed will be 1 whenever Pending Qty becomes Zero and it means that -- Fully Claimed -- Partially claim can only be for Same Free Item or Diff Free Item -- Whic...
CREATE DATABASE IF NOT EXISTS `siimn` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `siimn`; -- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86) -- -- Host: fliaguerrero.no-ip.info Database: siimn -- ------------------------------------------------------ -- Server version 5.6.23-log /*!40101 SET @OLD_CHARACTER_SET_...
/* customer - id - username - password - email - account_status (APPROVED, SUSPENDED, DISABLED) - role - name - picture - sex - address - city - phone - bio - registration_date - disable_start_date - disable_end_date - disable_reason customer_product - id - customer_id - product_id - start_period_id - end_period_id c...
DROP TABLE IF EXISTS widget_matrix CASCADE; -- CASCADE will drop all references to this table CREATE TABLE widget_matrix ( creation timestamp WITH TIME ZONE NOT NULL DEFAULT now(), com_id bigint NOT NULL DEFAULT 0 REFERENCES system_communities (id) ON DELETE CAS...
drop table if exists `user`; create table `user`( `uid` int primary key auto_increment, `email` varchar(100) unique not null, `nickname` varchar(20) unique not null, `password` char(64) not null )charset=utf8; drop table if exists `challenge`; create table `challenge`( `cid` int primary key auto_i...
select count(gender), gender from employees where ( first_name = 'Irena' or first_name = 'Vidya' or first_name = 'Maya') group by gender; or first_name = 'Maya'); select concat(first_name, last_name) from employees where last_name like "e%e"; select datediff(now(), hire_date) from employees where hire_date like "1990...
db2diag.log 虽然很重要,但是对于dba基本不可读,需要发送ibm技术分析 ./sqllib/db2dump/DIAG0000/db2diag.log db2 list application show detail 主要关注是否有异常连接和当前连数 db2 get snapshot for bufferpools on netagent global db2pd -alldbp -db netagent -buf 备注:snapshot 适合更详细但 buf 监控开关开启的情况;db2pd 适合没有开启 buf 监控 查看执行时间最长 db2 get snapshot for DYNA...
cytoscancontroll CREATE TABLE `cytoscancontroll` ( `probesetid` varchar(10) DEFAULT NULL, `callcodefather` varchar(6) DEFAULT NULL, `confidencefather` double DEFAULT NULL, `sinalafather` double DEFAULT NULL, `sinalbfather` double DEFAULT NULL, `callbasefather` varchar(6) DEFAULT NULL, `callcodemae` varch...
CREATE TABLE test ( id SERIAL PRIMARY KEY, round_number INTEGER NOT NULL );
INSERT INTO student VALUE (1, 'Alibek', 19, 'Almaty', '87058097484'); INSERT INTO student VALUE (2, 'Max', 21, 'Astana', '88888888888'); INSERT INTO user VALUE ('root', 'root'); INSERT INTO user_students VALUE ('root', 1); INSERT INTO user_students VALUE ('root', 2);
ALTER TABLE cart_items ADD COLUMN order_id integer, ALTER COLUMN order_id SET DEFAULT 0; CREATE INDEX idx_cart_items_order_id ON cart_items USING btree (order_id);
CREATE TABLE IF NOT EXISTS MODULES (NAME VARCHAR(255)); DELETE FROM MODULES; INSERT INTO MODULES (NAME) VALUES ('Docker'); INSERT INTO MODULES (NAME) VALUES ('Fundamentos da Arquitetura de Software'); INSERT INTO MODULES (NAME) VALUES ('Comunicação'); INSERT INTO MODULES (NAME) VALUES ('RabbitMQ');
// DROP TABLE IF EXISTS Employee; CREATE TABLE Employee(ID INT PRIMARY KEY,NAME VARCHAR(255), DOB VARCHAR(255),QUALIFICATION VARCHAR(255),SALARY DOUBLE, ADDRESS VARCHAR(255)); INSERT INTO Employee VALUES(1, 'poonra','20-07-1988','MTECH',12000.00,'hyderabad'); SELECT * FROM Employee ;
DROP TABLE IF EXISTS page_pages CASCADE; -- CASCADE will drop all references to this table CREATE TABLE page_pages ( content text NOT NULL, disable_cm boolean, disable_sublayouts boolean, disable_layouts boolean, page_code varchar(32), parent_id ...
-- 表的数据: xt_cptype -- INSERT INTO `xt_cptype` VALUES ('1','产品1','0','0','0','0');-- <fen> -- INSERT INTO `xt_cptype` VALUES ('2','产品2','0','0','0','0');-- <fen> -- INSERT INTO `xt_cptype` VALUES ('3','产品3','0','0','0','0');-- <fen> --
-------------------------------------------------------- -- DDL for Table TEC_CE_CDC_TPS_BH -------------------------------------------------------- CREATE TABLE TEC_CE_CDC_TPS_BH ( FECHA DATE, PAIS CHAR(3 CHAR), MAX_TPS NUMBER, MAX_CAP_HW NUMBER, MAX_CAP_SW NUMBER, UTIL_HW NUMBER(10,2), UTIL_SW NUM...
select count(*) from users; select count(*) from users where birthplace = '大分県'; select sum(price) from lineitems; select max(age) from users where birthplace = '大分県'; select count(*),max(age),min(age) from users where birthplace = '大分県' and gender_id = 0; select count(*) as 総数, max(age) as 最高齢, min(age) as...
Create Procedure sp_get_SchemeApplyON(@SchemeID Integer) As Begin Select Isnull(ApplyON,0) From Schemes Where SchemeID=@SchemeID End
insert into categorie(categorie) values ('Sport'); insert into categorie(categorie) values ('Luxury'); insert into categorie(categorie) values ('Coupe'); insert into categorie(categorie) values ('Sedan'); insert into categorie(categorie) values ('Hatchback'); insert into firma values (null,'Fiat'); insert into firma v...
/**************** 뷰 : 하나 또는 둘 이상의 테이블로부터 데이터의 부분집합을 테이블인 것처럼 사용하는 객체(가상테이블) CREATE [OR REPLACE] VIEW 뷰명칭 [(컬럼별칭1, 컬럼별칭2, 컬럼별칭3...컬럼별칭N)] AS SELECT 문장 [옵션]; -- 읽기전용 옵션 : WITH READ ONLY (INSERT, DELETE, UPDATE 불가능한 상태가 됨) -- 뷰 삭제 : DROP VIEW 뷰이름 * 참고 EX) -- FORCE : 테이블이 없어도 뷰를 강제로 생성 테이블이 아직 안 만들어져있어도 미리 만들어놓기 위해서 FORCE...
-- +goose Up -- SQL in section 'Up' is executed when this migration is applied CREATE TABLE observation_positions ( `id` int(11) UNSIGNED NOT NULL COMMENT '管理用', `field_id` int(11) UNSIGNED NOT NULL COMMENT '圃場管理のID', `plant_id` int(11) UNSIGNED DEFAULT NULL COMMENT '植物種別リストのID', `name` varchar(255) NOT NULL ...
CREATE TABLE IF NOT EXISTS `invoiceStatus` ( `id` tinyint(4) unsigned NOT NULL, `description` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `invoiceStatus` -- INSERT INTO `invoiceStatus` (`id`, `description`) VALUES (0, 'Quote'), (1, 'Pending Approv...
CREATE TABLE CodeableConcept ( id uniqueidentifier NOT NULL PRIMARY KEY, [text] nvarchar(255) ); CREATE TABLE Coding ( id uniqueidentifier NOT NULL PRIMARY KEY, codeableConceptId_CodeableConcept uniqueidentifier NOT NULL FOREIGN KEY REFERENCES CodeableConcept(id), [version] nvarchar(255), [system] nva...
-- phpMyAdmin SQL Dump -- version 3.4.8 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 11, 2013 at 03:08 AM -- Server version: 5.5.28 -- PHP Version: 5.3.17 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*...
INSERT INTO ESPECES ( ID_espece, cate_espece ) VALUES ( 1, 'Plantes' ); INSERT INTO ESPECES ( ID_espece, cate_espece ) VALUES ( 2, 'Amphibiens et reptiles' ); INSERT INTO ESPECES ( ID_espece, cate_espece ) VALUES ( 3, 'Invertébrés' ); INSERT INTO ESPECES ( ID_espece, cate_espece ) VALUES ...
CREATE TABLE match_request ( id BIGSERIAL PRIMARY KEY, uuid VARCHAR(255) NOT NULL, requester_id VARCHAR(255) NOT NULL, CONSTRAINT unique_uuid UNIQUE (uuid) );
CREATE TABLE usuario ( idUser varchar(10) primary key, senha varchar(16) not null, tipo varchar(10) not null, nome varchar(50) not null ); CREATE TABLE ranking ( idUser varchar(10) primary key, posicao int not null, pontos int default 0 not null, vitorias int default 0 not null, duelos int default 0 n...
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Nov 09, 2020 at 10:09 AM -- Server version: 5.7.24 -- PHP Version: 7.2.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR...
--ZAD1 select nazwa from produkty where id_kategoria = (select id_kategoria from produkty where nazwa = 'Piórnik duży') group by nazwa ---- --ZAD2 select nazwa from produkty prd where exists (select * from kategorie where nadkategoria IS NOT null AND id_kategoria = prd.id_kategoria) ---- --ZAD3a select ktg.nazwa from k...
DROP TABLE IF EXISTS comment; DROP TABLE IF EXISTS post; DROP TABLE IF EXISTS user; CREATE TABLE IF NOT EXISTS user ( id bigint(20) NOT NULL, created datetime NOT NULL, last_modified datetime DEFAULT NULL, email varchar(255) NOT NULL, name varchar(100) NOT NULL, password_hash varchar(255) NOT NULL, spa...
CREATE TABLE `users` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `username` VARCHAR(50) NOT NULL, `email` VARCHAR(150) NOT NULL, `password` VARCHAR(255) NOT NULL, `name` VARCHAR(255) NOT NULL, `enabled` BOOLEAN DEFAULT TRUE NOT NULL, `account_expired` BOOLEAN DEFAULT FALSE NOT NULL, `account_locked` BOOLEAN...
use PracticeJoin; select * from t_blog; select * from t_type; ## 笛卡尔积:cross join SELECT * FROM t_blog CROSS JOIN t_type; ## 内连接 SELECT * FROM t_blog INNER JOIN t_type; SELECT * FROM t_blog INNER JOIN t_type on t_blog.typeId = t_type.id; select * from t_blog,t_type where t_type.id=t_blog.typeId; select * from...