text
stringlengths
6
9.38M
-- -- 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...
ALTER TABLE Users ADD EmployeeID integer constraint fk foreign key references Employee(ID)
DROP USER 'sqlfdemo'@'localhost'; CREATE USER 'sqlfdemo'@'localhost' IDENTIFIED BY 'sqlfdemo'; GRANT ALL PRIVILEGES ON *.* TO 'sqlfdemo'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;
create or replace procedure show_firstN (dep_id in departments.department_id%type, n in number) is cursor empls is select first_name, last_name from employees e,departments d where e.department_id = d.department_id and e.department_id = dep_id; nbr_sup EXCEPTION; total number; f...
SELECT * FROM SURVEY_ITEM_ANSWERS WHERE ANSWER_ID = ? AND ITEM_NO = ? AND KNOWLEDGE_ID = ? AND DELETE_FLAG = 0;
alter table SystemTemplate add logoBottom varchar(100) /
/* indexcode: i_so_32_b_dorg */ create index i_so_32_b_dorg on so_saleinvoice_b (dbilldate asc, csaleorgid asc) ; /* indexcode: i_so_32_b_fk */ create index i_so_32_b_fk on so_saleinvoice_b (csaleinvoiceid asc) ; /* indexcode: i_so_32_b_date */ create index i_so_32_b_date on so_saleinvoice_b (dbilldate asc, pk_org...
/*update all values in original table with values in table temp*/ update ot set ot.user_id = t.user_id, ot.username = t.usenrname from customers as ot inner join temp as t on ot.user_id = t.user_id ;
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 28 Mar 2020 pada 15.34 -- Versi server: 10.1.38-MariaDB -- Versi PHP: 5.6.40 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
-- phpMyAdmin SQL Dump -- version 4.4.14 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 22-02-2016 a las 04:22:18 -- Versión del servidor: 5.6.26 -- Versión de PHP: 5.6.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA...
--Q1. How many rows are in the data_analyst_jobs table? --A1: 1793 rows /* SELECT COUNT (*) FROM data_analyst_jobs; */ --Q2. Write a query to look at just the first 10 rows. What company is associated with the job posting on the 10th row? --A2: Exxonmobil /* SELECT * FROM data_analyst_jobs LIMIT (10); */ --Q3. H...
DELETE FROM DRA WHERE ID = 12345 AND CD = 'M' AND RIN = 1234 and SQ = 2
truncate table note_category; insert into note_category (name) values ('general'), ('jackets'), ('blazers'), ('shirts'), ('pullovers'), ('tshirts'), ('jeans'), ('trousers'), ('shorts'), ('shoes'), ('accessories');
-- 3.1 Create tables -- You will create tables for the source databases (Smith Video and Smith Books). -- When your solution is still a work in progress, it is a good idea to drop -- all objects that you have created from the database every time you run the -- script, so you start fresh. -- If using local psql serv...
SELECT player_id, event_date, SUM(games_played) OVER(PARTITION BY player_id ORDER BY event_date) AS games_played_so_far FROM Activity;
-- CREO SI NO EXISTE BASE DE DATOS CREATE DATABASE IF NOT EXISTS SQL_proyectoFinal; -- SELECCIONO BASE DE DATOS A USAR USE SQL_proyectoFinal; -- CREO SI NO EXISTE LA TABLA CUENTAS CREATE TABLE IF NOT exists CUENTAS(numeroCuenta INT AUTO_INCREMENT, tipo VARCHAR(2) NOT NULL, moneda VARCHAR(4) NOT NULL, saldo FLOAT NOT...
CREATE TYPE text_tt AS TABLE( text VARCHAR(0) NULL)
--criacao das tabelas normalizadas da RFB no oracle CREATE TABLE RFB_ATIVIDADE_ECONOMICA ( URI VARCHAR2(7 CHAR) , CNAE VARCHAR2(7 CHAR) ) LOGGING TABLESPACE ts_norm_demais_tb INITRANS 1 STORAGE ( INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS UNLIMITED BUFFER_POOL DEFAULT ) NOPARALLEL; C...
PROMPT PROMPT Enable audit cleanup PROMPT PROMPT BEGIN PROMPT SYS.DBMS_AUDIT_MGMT.INIT_CLEANUP( PROMPT AUDIT_TRAIL_TYPE => SYS.DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL, PROMPT DEFAULT_CLEANUP_INTERVAL => 24 ); PROMPT END; PROMPT PROMPT Configure archive ts PROMPT PROMPT BEGIN PROMPT SYS.DBMS_AUDI...
SELECT InvoiceId, COUNT(InvoiceLineId) 'No. of line items' FROM InvoiceLine GROUP BY InvoiceId
SELECT * FROM PRODUCTS WHERE STOCK < REORDERLEVEL SELECT CompanyName,COUNTRY FROM Suppliers WHERE COUNTRY == "Norway" OR COUNTRY == "Sweden" OR COUNTRY = "Denmark" OR COUNTRY == "Finland" SELECT ProductName FROM PRODUCTS WHERE ProductName LIKE "Women%" OR ProductName LIKE "%Gloves" DELETE FROM Suppliers WHERE Supp...
SELECT [Id] , [title] , [description] , [startDate] , [startTime] , [endDate] , [endTime] FROM [grajauser].[events] WHERE [userId] = @userId ORDER BY [startDate], [startTime];
DROP USER IF EXISTS 'liquibase_dev'; CREATE USER 'liquibase_dev'@'%' IDENTIFIED BY 'liquibase_dev'; CREATE DATABASE IF NOT EXISTS liquibase_dev; USE liquibase_dev; CREATE TABLE IF NOT EXISTS users ( Id INT PRIMARY KEY AUTO_INCREMENT, Authors VARCHAR (255) ); INSERT INTO users VALUES (1,'user1'); INSERT INTO...
CREATE TABLE user ( id INT(11) AUTO_INCREMENT, object_id CHAR(32), status INT(1), create_at DATETIME, update_at DATETIME, name VARCHAR(3), email VARCHAR(32), mobile_phone_number CHAR(11), id_number CHAR...
ALTER TABLE `ims_business_dongyuantangguoyiguang_department` ADD `createtime` INT(11) NOT NULL DEFAULT '0' AFTER `department_name`, ADD `updatetime` INT(11) NOT NULL DEFAULT '0' AFTER `createtime`, ADD `uniacid` INT(11) NOT NULL DEFAULT '0' AFTER `updatetime`; -- phpMyAdmin SQL Dump -- version 4.4.15.4 -- http://www.ph...
insert into professor (matricula, nome, snome, datanasc, sexo, salario) value ('121031','José Maria','Campos', '1982-03-10', 'M',7000.00); insert into departamento (nome, sigla, codigo, coordenador) values ('Tec. Telemática', 'DTT','121',121031); update professor set depto = '121' where matricula like '121031'; inse...
-- SQL file for Intelligent Car Lambda analisation -- # in hbase shell -- disable 'carinbox' -- drop 'carinbox' -- create 'carinbox', ['general'] -- disable 'carsalarm' -- drop 'carsalarm' -- create 'carsalarm', ['car', 'driver'] -- disable 'cars' -- drop 'cars' -- create 'cars', ['car', 'driver'] drop table m...
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 05, 2020 at 05:46 PM -- Server version: 10.4.6-MariaDB -- PHP Version: 7.3.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
-- 更新企业资质 update member_credentials mc set mc.credentials_code=99 where mc.credentials_code =6; -- 更换原船东资质为新的船东船代等 insert into member_credentials(member_id,credentials_code,audit) select member_id,4,mc.audit FROM member_credentials mc where mc.credentials_code =5; insert into member_credentials(member_id,credentials_c...
INSERT INTO users VALUES (NULL, 'mike', 'yong', 'mkyong@gmail.com', 'mkyong', 'secret'); INSERT INTO users VALUES (NULL, 'alex', 'pizulli', 'alex@yahoo.com', 'alex', 'secret'); INSERT INTO users VALUES (NULL, 'joel', 'tex', 'joel@gmail.com', 'joel', 'secret'); INSERT INTO users VALUES (NULL, 'cris', 'tex', 'joel@gmail...
CREATE OR REPLACE PROCEDURE UPDATE_LEADERS_SCORE ( IN in_School_ID INTEGER, IN in_Leader_Score INTEGER ) BEGIN UPDATE CHICAGO_PUBLIC_SCHOOLS SET Leaders_Score = in_Leader_Score WHERE School_ID = in_School_ID; IF in_Leader_Score > 0 AND in_Leader_Score < 20 THEN UPDATE CHICAGO_PUBLI...
SELECT PATIENTS.FIRST_NAME, PATIENTS.LAST_NAME, DATEDIFF(DAY, PATIENT_RECORDS.SUBMISSION_DATE, PATIENT_RECORDS.DISCHARGE_DATE) AS Duration FROM PATIENTS JOIN PATIENT_RECORDS ON PATIENTS.ID = PATIENT_RECORDS.PATIENT_ID ORDER BY Duration;
CREATE TABLE "aluno" ( id integer not null, curso integer not null, CONSTRAINT id_aluno_pk primary key (id), CONSTRAINT id_aluno_usuario_fk FOREIGN KEY (id) REFERENCES public."Usuario" (id), CONSTRAINT curso_fk FOREIGN KEY (curso) REFERENCES public.curso (id) );
/* Name: Revising the Select Query I Problem: https://www.hackerrank.com/challenges/revising-the-select-query/problem Score: 10 Language: MySQL */ SELECT * FROM CITY WHERE COUNTRYCODE = "USA" AND POPULATION > 100000;
CREATE DATABASE interview_base ENCODING 'UTF8' TEMPLATE template0; -- ups CREATE TABLE interview ( id BIGSERIAL NOT NULL, name VARCHAR(400), CONSTRAINT pk_interview PRIMARY KEY (id) ); CREATE TABLE question ( id BIGSERIAL NOT NULL, interview_id BIGINT NOT NULL, title VARCHAR(4000), ...
CREATE DATABASE db_employee; USE db_employee; SHOW TABLES; CREATE TABLE tb_employee (employeeId integer AUTO_INCREMENT, employeeName varchar(10) , employeeAddress varchar(20), dateOfJoining date, experience integer, dateOfBirth date, PRIMARY KEY(employeeId)); insert into tb_employe...
SELECT C_NATION, P_CATEGORY, sum(LO_ORDTOTALPRICE) FROM customer JOIN (SELECT * FROM lineorder_partition_by_year WHERE D_YEAR = 1997) AS lineorder_year ON LO_CUSTKEY = C_CUSTKEY JOIN part ON LO_PARTKEY = P_PARTKEY JOIN supplier ON LO_SUPPKEY = S_SUPPKEY GROUP BY C_NATION, P_CATEGORY;
use alfox; insert into donneesHisto (Mode, Datation, Vitesse, Regime, Consommation, VitesseMax, RegimeMax, ConsoMax, NbDefauts, Defaut1, Defaut2, Defaut3, Defaut4, LatitudeGPS, LongitudeGPS, DistanceParcourue, VehiculeID) values ('STANDARD', '2018/01/03 17:42:37', 50, 1800, 62, 136, 3600, 250, 0, 0...
/*TD:1420,Oracle存在分给管理主目录权限,却无权创建子目录的问题.修改者:DP-董平*/ CREATE OR REPLACE PROCEDURE Doc_DirAcl_CheckPermissionEx1 ( dirid_1 integer, dirtype_1 integer, userid_1 integer, usertype_1 integer, seclevel_1 integer, operationcode_1 integer, haspermission_1 in out integer ) AS count_1 integer; result integer;...
CREATE DATABASE IF NOT EXISTS employee3; USE employee3; CREATE TABLE IF NOT EXISTS department(id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(30)); CREATE TABLE IF NOT EXISTS employee(id INT PRIMARY KEY AUTO_INCREMENT,name VARCHAR(30),department_id INT, gender ENUM('M','F'),hire_date DATE,birth_date DATE, FOREIGN KEY(d...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1 -- Время создания: Май 28 2018 г., 20:59 -- Версия сервера: 10.1.29-MariaDB -- Версия PHP: 7.2.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
PROMPT executing ADMINCONS_2772_UPDATE_CARBON_DATA.sql by Renuha update ids_t_report_column set column_display='OLD CARBON-DIRECT+FIRST TIER INDIRECT (TONNES CO2E)' where column_id=166 and report_id=2137; update ids_t_report_column set column_display='CARBON-DIRECT+FIRST TIER INDIRECT (TONNES CO2E) CHANGE' where colu...
select a.TZ_ATTACHSYSFILENA from PS_TZ_ART_PIC_T a, PS_TZ_ART_TPJ_T b where a.TZ_ART_ID=? and a.TZ_ATTACHSYSFILENA=b.TZ_ATTACHSYSFILENA
-- with i as ( -- select d.response_id, jsonb_array_elements(d.identity::jsonb) ident -- from identities d -- where d.identity is not null -- ), m as -- ( -- select response_id, existences->'lineage' as has_lineage, -- j.* as tokens -- from metadata_completeness, json_array_elements(wordcounts->'lineage') j --...
CREATE TABLE IF NOT EXISTS guests ( id_guest SERIAL PRIMARY KEY, guest_name TEXT, message TEXT, visit_date TEXT );
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Nov 25, 2018 at 05:00 PM -- Server version: 5.7.21 -- PHP Version: 5.6.35 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CH...
CREATE TABLE ACT_BOOK( SEQ NUMBER(8), ID VARCHAR2(30), -- 외래키 IO_KIND VARCHAR2(1), -- 수입/지출 구분 AMOUNT NUMBER(9), -- 금액 CONTENT VARCHAR2(200), -- 내용 WDATE DATE -- 입력일 SYSDATE ); SELECT * FROM ACT_BOOK; -- SEQUENCE CREATE SEQUENCE SEQ INCREMENT BY 1 START WITH 1 -- 외래키(ID) ALTER TABLE ACT_BOOK ADD FOREIGN K...
create index idx_object_5 on dbo.object (part, location, status, std_quantity)
-- 用户表 DROP TABLE TT_USERS; CREATE TABLE TT_USERS ( USER_ID VARCHAR(32) NOT NULL, USER_ACCOUNT VARCHAR(30) NOT NULL, USER_NAME VARCHAR(40) NOT NULL, USER_PASSWORD VARCHAR(100) NOT NULL, ENABLED INTEGER NOT NULL, IS_SYS INTEGER NOT NULL, USER_DESC VARCH...
INSERT INTO AuthSession SET userId = '<%= userId %>', token = '<%= token %>', expirationDate = <%= expirationDate %>
select subject_name, flaky_type, test_name, count(*) as number from flaky_test_info group by subject_name, flaky_type, test_name;
-- Your SQL goes here ALTER TABLE users ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT now();
-- MySQL Script generated by MySQL Workbench -- Sun Dec 13 17:15:36 2020 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON...
SELECT * FROM projects WHERE id=$1;
--Selecting film_id, title, genre, rating SELECT not_rented.film_id, not_rented.title, genre.name, genre.rating FROM ( --here we are selecting all films id that are not rented (i.e all copies are not taken from inventary) SELECT * FROM film WHERE film_id NOT IN( SELECT film_id FROM rental RIGHT JOIN invento...
ALTER TABLE "public"."users" ALTER COLUMN "fileObjectId" TYPE integer; COMMENT ON COLUMN "public"."users"."fileObjectId" IS E'null' alter table "public"."users" rename column "avatarId" to "fileObjectId";
-- El archivo tiene que llamarse import.sql INSERT INTO cuentas(persona, saldo)VALUES ('Victor',1000); INSERT INTO cuentas(persona, saldo)VALUES ('Grace',2000); INSERT INTO bancos(nombre, total_transferencias)VALUES ('Banco de credito',0);
CREATE TABLE messages ( id SERIAL PRIMARY KEY NOT NULL, room int not NULL REFERENCES rooms(id), userName VARCHAR(80) NOT NULL, content VARCHAR(4000) NOT NULL ); INSERT INTO messages (userName, content, room) VALUES ('John', 'I love this new game', 1); INSERT INTO messages (userName, content, room) VALUES ('...
CREATE TABLE employees ( emp_no integer PRIMARY KEY, birth_date date NOT NULL, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, gender char(1) NOT NULL, hire_date date NOT NULL ) CREATE TABLE departments ( dept_no varchar(5) PRIMARY KEY, dept_name varchar(50) NOT NULL ) CREAT...
SELECT TOP 1 (SELECT DepositAmount FROM WizzardDeposits WHERE Id = (SELECT MIN(Id) FROM WizzardDeposits)) - (SELECT DepositAmount FROM WizzardDeposits WHERE Id = (SELECT MAX(Id) FROM WizzardDeposits)) AS SumDifference FROM WizzardDeposits
# --- Created by Slick DDL # To stop Slick DDL generation, remove this comment and start using Evolutions # --- !Ups create table "DEBIANBINARYPACKAGES" ("repoid" INTEGER NOT NULL,"fileid" VARCHAR NOT NULL,"controlfile" VARCHAR NOT NULL); create table "DEBIANREPOSITORIES" ("repoid" INTEGER GENERATED BY DEFAULT AS IDE...
create table if not exists HISTORY( WALLET_ID INTEGER NOT NULL, ALBUM_ID INTEGER NOT NULL, DATE TXT DEFAULT UNKNOWN, FOREIGN KEY(WALLET_ID) REFERENCES WALLET(ID), FOREIGN KEY(ALBUM_ID) REFERENCES ALBUMS(ID) );
CREATE SCHEMA IF NOT EXISTS job4j; CREATE TABLE IF NOT EXISTS job4j.post( id serial PRIMARY KEY, name VARCHAR(200), text TEXT, link VARCHAR(200) UNIQUE, created timestamp );
with sales_rollup as (select distinct title, quarter, year, qyear, sum(amount) over (partition by title, qyear) as quarterly_sales, sum(amount) over (partition by qyear) as total_quarterly_sales, sum(amount) over (partition by title, qyear) / sum(amount) over (partition by qyear) * 100 as percent_of_tota...
CREATE TABLE shopping_cart( id SERIAL PRIMARY KEY, product VARCHAR(40), price real, quantity SMALLINT ); INSERT INTO shopping_cart (product, price, quantity) VALUES ('bananas', 0.49, 3), ('celery', 1.33, 2), ('apples', 1.39, 3), ('bread', 1.25, 2);
CREATE TABLE winter ( winter_id INT PRIMARY KEY, year INT, city VARCHAR, sport VARCHAR, discipline VARCHAR, athlete VARCHAR, country VARCHAR, gender VARCHAR, event VARCHAR, medal VARCHAR ); CREATE TABLE summer ( summer_id INT PRIMARY KEY, year INT, city VARCHAR, sport VARCHAR, discipline VARCHAR, athle...
/* Please give me the film name, id, and release year films with IDs under 100 */ SELECT id, name, release FROM film WHERE id < 100; /* Please tell me what our most expensive film rental rate is */ SELECT * FROM film ORDER BY rental_rate DESC LIMIT 1; /* Please tell me what the average rental_rate is */ SELECT AVG(re...
SELECT cohorts.name AS cohort_name, count(students.*) AS student_count FROM cohorts JOIN students ON cohorts.id=cohort_id GROUP BY cohorts.name HAVING count(students.*)>=18 ORDER BY student_count;
drop table product; create table product ( PRODUCTID VARCHAR2(5 CHAR) , PRODUCTNAME VARCHAR2(100 CHAR) , PARENTPRODUCT VARCHAR2(16 CHAR) , SEGMENTATION VARCHAR2(50 CHAR) , DORMANCY VARCHAR2(5 CHAR) , MININTERESTRATE NUMBER , MAXINTERESTRATE NUMBER , DEBITLIMIT NUMBER(24,6) , CREDITLIMIT NUMBER(24,6) ) ORGANIZATION E...
CREATE TABLE tb_missoes_caca_diario ( id BIGINT UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT, tripulacao_id INT UNSIGNED ZEROFILL NOT NULL, missao_caca_id INT UNSIGNED NOT NULL, CONSTRAINT tb_missoes_caca_diario_tb_usuarios_id_fk FOREIGN KEY (tripulacao_id) REFERENCES tb_usuari...
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Máy chủ: 127.0.0.1 -- Thời gian đã tạo: Th10 17, 2019 lúc 04:12 CH -- Phiên bản máy phục vụ: 10.1.21-MariaDB -- Phiên bản PHP: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT...
/* SQLEditor (SQLite)*/ CREATE TABLE activity_type ( id TEXT NOT NULL PRIMARY KEY UNIQUE, name TEXT, description TEXT ); CREATE TABLE login ( /*Primary Key for the user*/ id SERIAL PRIMARY KEY AUTOINCREMENT, login TEXT UNIQUE, fullname TEXT, password TEXT NOT NULL, salt TEXT, tzname TEXT, old_login TEXT, inactive B...
/* -- store procedures -- 1. delimeter */ -- delimeter adalah pembatas seperti titik koma pada code delimiter $$ create procedure contoh_sp() begin select * from simcars; end $$ delimiter ;
-- saved to favorites SELECT consultant_id || ',' || object_id || ',' || 1 FROM consultant_favorites WHERE created_at > '7/1/2015' AND consultant_id IS NOT NULL AND object_type = 'Job' GROUP BY consultant_id, object_id
DROP TABLE `mc_t_cloud_option`; CREATE TABLE `mc_t_cloud_option` ( `OWNER_ID` varchar(128) NOT NULL, `CLOUD_ID` varchar(36) NOT NULL, `OPTION_ID` varchar(36) NOT NULL, `OPTION_NAME` varchar(128) not null, `OPTION_VALUE` varchar(255) not null default '', `DESCRIPTION` text, `CREATE_USER_ID` varchar(128) N...
create table secao ( id integer not null, descricao varchar(255), primary key (id) ); create table tipo_produto ( id integer not null, descricao varchar(255), volume_total_permitido double, primary key (id) ); CREATE SEQUENCE HIBERNATE_SEQU...
select waiters.id as waiter_id, waiters.first_name as first_name, waiters.last_name as last_name, waiters.personal_id as personal_id, coalesce(payment_table.total_sum,0) as total_payments, coalesce(tip_table.tip,0) as total_tips, coalesce(tip_table...
-- -------------------------------------------------------- -- -- Table structure for table `p_type` -- DROP TABLE IF EXISTS `p_type`; CREATE TABLE IF NOT EXISTS `p_type` ( `type` varchar(15) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `p_type` -- INSERT ...
DROP database if exists ontology; CREATE database ontology; use ontology; CREATE TABLE `diseases` ( `disease_id` varchar(255) PRIMARY KEY, `disease_name` varchar(255), `description` varchar(255), `records_count` int, `has_symptom_count` int, `has_treatment_count` int ); CREATE TABLE `treatment` ( `treat...
CREATE TABLE [AsData_PL].[RP_Appeal] ( [Id] [uniqueidentifier] NOT NULL, [ApplicationId] [uniqueidentifier] NOT NULL, [Status] [nvarchar](30) NOT NULL, [AppealSubmittedDate] [datetime2](7) NULL, [AppealDeterminedDate] [datetime2](7) NULL, [UserId] [nvarchar...
DROP TABLE agreements;
-- Check table size SELECT nspname || '.' || relname AS "relation", pg_size_pretty(pg_table_size(C.oid)) AS "size" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) WHERE nspname NOT IN ('pg_catalog', 'information_schema') ORDER...
delete mainmenuinfo where id=428 / delete mainmenuconfig where infoid=428 /
create table ext_base_line_team( group_no integer primary key identity, group_name varchar(20), description varchar(100), dept_no integer );
SELECT Z.Name, COUNT(X.IsOfficial) AS Number_Of_Spoken_Languages FROM world.country Z, world.countrylanguage X WHERE Z.Code=X.CountryCode and Z.Code IN (SELECT V.CountryCode FROM world.city V WHERE V.Name='Victoria') GROUP BY Z.Name ORDER BY Number_Of_Spoken_Languages DESC;
select * from TB_CLASS; select * from TB_CLASS_PROFESSOR; select * from TB_DEPARTMENT; select * from TB_GRADE; select * from TB_PROFESSOR; select * from TB_STUDENT; --16 select G.class_no, C.class_name, ROUND(AVG(point),8) from tb_grade G JOIN tb_class C ON G.class_no = C.class_no JOIN tb_department D ON C.dep...
-- list tests SELECT * FROM accidit.testtrace ORDER BY id; -- which methods were invoked SELECT * FROM accidit.vinvocationtrace ORDER BY testId, callStep; -- which objects are used in a test SELECT o.* FROM vObjectTrace o JOIN TestTrace t ON t.id = o.testId -- WHERE t.name LIKE "%test_re%" ORDER BY testId, o.id; -...
prompt 'Un depot de 6000 E est fait sur le compte de Joe'; update CLI set solde=solde+6000 where NomCli ='Joe'; prompt 'Nouveau Solde de Joe'; select solde from CLI where NomCli ='Joe';
create database fresh default character set utf8 collate utf8_bin; -- collate:校对 use fresh; -- 会员信息表 drop table if exists memberInfo; create table if not exists memberInfo( mno int primary key auto_increment, -- 会员编号 nickname varchar(100) not null unique, -- 会员名,昵称 pwd varchar(200) not null, -- 密码 tel...
-- Script for gathering code examples from stackoverflow -- query can be run on https://data.stackexchange.com ;WITH recordslist AS (SELECT 'http://stackoverflow.com/users/' + Cast(p.owneruserid AS VARCHAR(10)) AS OwnerLink, 'http://stackoverflow.com/questions/' + Cast(p.id AS VARCHAR(10)) AS...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 30-11-2017 a las 14:03:29 -- Versión del servidor: 10.1.26-MariaDB -- Versión de PHP: 7.1.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; ...
-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64) -- -- Host: localhost Database: jpaexample -- ------------------------------------------------------ -- Server version 8.0.17 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; ...
ALTER TABLE `hardware_optimization_settings` ADD COLUMN pageCoverageMonochrome DOUBLE NULL, ADD COLUMN pageCoverageColor DOUBLE NULL;
-- phpMyAdmin SQL Dump -- version 4.3.11 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 21-08-2015 a las 00:24:30 -- Versión del servidor: 5.5.25a -- Versión de PHP: 5.6.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA...
-- -- PostgreSQL database dump -- -- Dumped from database version 12.0 -- Dumped by pg_dump version 12.0 -- Started on 2020-02-12 23:54:04 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalo...
/* CREATE TABLE BOARD( BOARD_NUM INT, BOARD_NAME VARCHAR(20) NOT NULL, BOARD_PASS VARCHAR(15) NOT NULL, BOARD_MARKET VARCHAR(50) NOT NULL, BOARD_SUBJECT VARCHAR(50) NOT NULL, BOARD_PRICE INT DEFAULT 0, BOARD_WALLETID VARCHAR(200) NOT NULL, BOARD_CONTENT VARCHAR(2000) NOT NULL, BOARD_FILE VARCHAR(50) NOT NULL, ...
SELECT mpm.id, mpm.fromNodeId as id, mpm.toNodeId as id, mpm.medicalAppointmentId as id FROM MedicalAppointmentMovement mpm WHERE mpm.fromNodeId = @fromNodeId AND mpm.medicalAppointmentId = @medicalAppointmentId
CREATE TABLE ies_cursos_archivos ( ies_curso_id INTEGER NULL PRIMARY KEY REFERENCES ies_cursos(id), titulacion_id INTEGER NOT NULL REFERENCES titulaciones(id), id_archivo INTEGER NOT NULL );
-- Scott DIBIsceglio -- Lab 5 -- Number 1 show the cities of agents booking an order whos pid is c006 select city FROM agents INNER JOIN orders on agents.aid = orders.aid WHERE cid = 'c006' -- Number 2 show pids of products ordered through any agent who makes at least one order for a customer in Kyoto, sorted pid...
CREATE SCHEMA IF NOT EXISTS pgtools; SET search_path = pgtools, public; CREATE OR REPLACE VIEW relation_size AS ( SELECT c.relkind, n.nspname AS schema_name, c.relname as relation_name, CASE WHEN c.relkind = 'i' THEN 'index' WHEN c.relkind = 'r' THEN 'ordinary table' WHEN c.relkind ...