text stringlengths 6 9.38M |
|---|
-- 문제 1.
-- 현재 급여가 많은 직원부터 직원의 사번, 이름, 그리고 연봉을 출력 하시오.
select employees.emp_no as 사번, concat(last_name, ' ', first_name) as 이름, salary as 연봉
from employees
inner join salaries on employees.emp_no=salaries.emp_no
where substr(salaries.to_date,1,4)='9999'
order by salary desc;
-- 문제2.
-- 전체 사원의 사번, 이름, 현재 직책을 이름... |
CREATE TABLE "users" (
"id" BIGSERIAL PRIMARY KEY,
"fb_id" TEXT NOT NULL,
"created_at" TIMESTAMP DEFAULT NOW(),
"updated_at" TIMESTAMP DEFAULT NOW()
);
|
delete from HtmlLabelIndex where id=127
/
delete from HtmlLabelInfo where indexid=127
/
INSERT INTO HtmlLabelIndex values(127,'人')
/
INSERT INTO HtmlLabelInfo VALUES(127,'Person',8)
/
INSERT INTO HtmlLabelInfo VALUES(127,'人',7)
/
delete from HtmlLabelIndex where id=20979
/
delete from HtmlLabelInfo where indexi... |
CREATE DATABASE Olist_Store;
USE Olist_Store;
CREATE TABLE DATE
(
Date_id VARCHAR(10) PRIMARY KEY,
Date_Format_YYYYMMDD VARCHAR(10) NOT NULL,
Day_of_Month INT NOT NULL,
Month INT NOT NULL,
Year INT NOT NULL,... |
insert into houses
(name,address,city,state,zip,img,mortgage,rent)
values
($1, $2, $3, $4, $5, $6, $7, $8);
SELECT * FROM houses |
CREATE DATABASE IF NOT EXISTS sales;
USE sales;
CREATE TABLE `big_base_pin_ratio_for_free_size`(
`product_skn` bigint,
`storage_num` int,
`sales_num` int,
`base_pin_ratio` double,
`date_id` int)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFOR... |
DECLARE
varsql varchar2(4000);
BEGIN
-- a comment is OK
dbms_output.put_line('dummy');
-- also ok an empty line
END; --do not close with forward slash, that is SQL plus syntax. space is ok
|
into insert authors(author_name) values ('Vanessa Moulton'), ('Eirini Flouri'),('Heather Joshi'), ('Alice Sullivan');
insert into research_papers(paper_name,corresponding_author,year) values ("Individual-level predictors of young children's aspirations",'Vanessa Moulton',2016);
insert into paper_author(author_id,paper_... |
-- create student table
CREATE TABLE STUDENT (
Enrollment_Number varchar(15) PRIMARY KEY,
Name varchar(50) NOT NULL,
Branch varchar(50) NOT NULL,
Batch int NOT NULL,
Date_of_Birth date NOT NULL
);
-- create student details table
CREATE TABLE STUDENT_DETAILS (
Enrollment_Number varchar(15) PRIMARY KEY,
... |
update users_info
set
city = $2,
about = $3,
twitter = $4,
instagram = $5
where user_id = $1 |
CREATE VIEW CMDV_T_RCP_DPC_CD AS
SELECT
SEQ1_NO
, SEQ2_NO
, VLD_FLG
, REC_IDENT_INFO
, OPRTN_YMD
, PRAC_IDENT
, ORDER_NO
, ACT_DETL_NO
, RCPT_COMP_SYS_REC
, USE_AMNT
, QNT_DAT
, UNIT_CD
, TIMES
, SPCFC_DEV_NAME
, PRAC_YM
, INPUT_YM
FROM
TNDS_T_RCP_DPC_CD
W... |
-- MISC_SYS: System definitions used by both java and C programs
--
-- Delete all the current values:
DELETE from MISC_SYS;
-- Then add everything that follows:
--
-- MISC_SYS_NAME varchar(48) PRIMARY KEY,
-- Unqiue name used by programs
--
-- MISC_SYS_VAL varchar(32) NOT NULL UNIQUE,
-- String with the ascii val... |
-- Created by Vertabelo (http://vertabelo.com)
-- Script type: create
-- Scope: [tables, references, sequences, views, procedures]
-- Generated at Tue Oct 21 06:41:51 UTC 2014
-- sequences
-- Sequence: seq_object_id
CREATE SEQUENCE seq_object_id
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
ST... |
-- Ross Nelson CSC352 Assignment 1
-- January 13th 2020
-- 1.
SELECT ENAME, SAL, HIREDATE
FROM EMP
WHERE (COMM <= 0 OR COMM IS NULL)
AND SAL < 2000;
-- 2.
SELECT EMP.ENAME, EMP.SAL, DEPT.DNAME
FROM EMP
INNER JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO
WHERE (COMM <= 0 OR COMM is null)
AND SAL < 2000;
-- 3.... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 18, 2021 at 02:11 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE TABLE IF NOT EXISTS instancetype
(
username VARCHAR(30) NOT NULL,
cluster VARCHAR(30) NOT NULL,
instancetype VARCHAR(20),
cpus INT(12),
memory INT(12),
disk INT(12),
ephemeral INT(12),
PRIMARY KEY (username, cluster)
); |
--------------------------------------------------------------------------------
-- Creazione ed apertura del database
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS ProgettoRistoranti;
CREATE DATABASE ProgettoRistoranti;
USE ProgettoRistoranti;
--------------... |
CREATE VIEW CMDV_T_TOKKEN_BASE AS
SELECT
SEQ1_NO
, SEQ2_NO
, VLD_FLG
, IDENT_CD
, ID1
, ID1N
, ID2
, AGE
, TESTEE_POST_NO
, TESTEE_SEX_CD
, TESTEE_BIRTH_YM
, CNSLT_TCKT_FACE_CLS
, CNSLT_TCKT_RFRNC_NO
, MEE_PRG_CLS
, MEE_YMD
, MEE_INST_NO
, INSURER_NO
, RPT_DIV
... |
CREATE TABLE `answer_queue` (
`answer_queue_id` int(10) unsigned auto_increment,
`question_id` int(10) unsigned not null,
`name` varchar(255) default null,
`message` text,
`created_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_user_id` int(10) unsigned default null,
`create... |
--Nicholas Fong COEN 280 HW 2: Find actors with a Matt Damon number of 2
--Matt Damon is P17
--Finds the movies Matt Damon is in, then the actors in those movies, then the movies those actors are in, then the actors in those movies. Then it removes people with a Damon number of 0 or 1 by repeating the query and removin... |
--STEP WISE APPROACH:
CREATE VIEW RobberId as (
SELECT DISTINCT a.RobberId, b.Security
FROM Accomplices a NATURAL JOIN Bank b
ORDER BY b.Security);
CREATE VIEW SkillsId as (
SELECT h.RobberId, r.Security
FROM HasSkills h NATURAL JOIN RobberId r);
CREATE VIEW Descriptions as (
SELECT s.Security, skill.Description
FR... |
/*
List all customers who spent 25% os less than the average amount spent on all invoices. For each customer, display
their name and the amount spent to 6 decimal places. Order the result by the amount spent from high to low.
*/
SELECT
customer.customer_name AS customer_name
, ROUND(SUM(invoice.total_pri... |
DROP SEQUENCE CPI.CATASTROPHIC_CD_S;
CREATE SEQUENCE CPI.CATASTROPHIC_CD_S
START WITH 1
MAXVALUE 999999999999
MINVALUE 1
NOCYCLE
NOCACHE
NOORDER;
|
usernames
John
Peter
james
percy
mercy
|
upsert into simbox_parameters
(parameter_name,parameter_value)
VALUES
('ENABLE_SUSPICOUS_COHORT_DETECTION',1);
|
-- Script for creating the Axon required tables and any associated indexes.
-- Resources used to create this script:
-- - https://gist.github.com/zambrovski/18b8c154a20454d78e9faa453025d162 (outdated but still useful)
-- - https://github.com/JohT/showcase-quarkus-eventsourcing/blob/master/showcase-quarkus-eventsourcing... |
CREATE SEQUENCE subjectseq
START WITH 10
INCREMENT BY 1
NO CYCLE; |
/*
ShohinテーブルのレコードをコピーしたものをShohinSaekiテーブルに挿入する。
ShohinSaekiテーブルにsaekiは販売単価から仕入単価を引いたものを挿入する
*/
INSERT INTO ShohinSaeki (shohin_id, shohin_mei, hanbai_tanka, shiire_tanka, saeki) SELECT shohin_id, shohin_mei, hanbai_tanka, shiire_tanka, hanbai_tanka - shiire_tanka FROM Shohin;
/*
レコードのコピー
INSERT INTO コピー先の... |
-- SELECT *
-- FROM customers
-- WHERE last_name SIMILAR TO '(B|b)____y'
-- SELECT *
-- FROM customers
-- WHERE address SIMILAR TO '%(Trail|Avenue)%'
-- SELECT *
-- FROM customers
-- WHERE address LIKE '%Trail%' OR
-- address LIKE '%Avenue%'
SELECT *
FROM customers
WHERE phone NOT LIKE '%9' |
create table if not exists "vault_kv_store" (
parent_path text collate "C" not null,
path text collate "C",
key text collate "C",
value bytea,
constraint pkey primary key (path, key)
);
create index if not exists parent_path_idx on vault_kv_store(parent_path);
alter table "vault_kv_store"... |
--Date Time conversion: https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver15
select ti.TaskID,
ti.TaskInstanceID,
ti.InitUserID as UserID,
u.FullName as Initiated,
t.TaskName,d.Filename,
d.DocumentID,
CONVERT(varchar, DATEADD(mi, datediff(mi, ... |
CREATE TABLE IF NOT EXISTS `Endereco` (
`id` INT NOT NULL AUTO_INCREMENT,
`logradouro` VARCHAR(45) NULL,
`bairro` VARCHAR(45) NULL,
`cep` BIGINT(45) NULL,
`numero` INT NULL,
`complemento` VARCHAR(45) NULL,
`id_cidade` INT(11) NOT NULL,
`id_cliente` INT(11) NOT NULL,
... |
BANCO DE DADOS - CARROS
HISTÓRICO DE TENTATIVAS:
CREATE DATABASE carros;
USE carros;
CREATE TABLE marca (
codigo INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(30) NOT NULL,
pais VARCHAR(30) NOT NULL
);
INSERT INTO marca (nome, pais) VALUES ('Volkswagen', 'Alemanha'), ('Ford', 'EUA'), ('Fiat', 'Italia'),... |
/*
SQLyog v10.2
MySQL - 5.5.36-log : Database - testmopaas
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 27, 2019 at 11:04 AM
-- Server version: 10.2.23-MariaDB
-- PHP Version: 7.2.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Databa... |
--Hands on Practice 2-4
--low rated customer
DECLARE
lv_cus_num NUMBER (3) := 100;
BEGIN
case
WHEN lv_cus_num <= 100 THEN DBMS_OUTPUT.PUT_LINE('Low Rated Customer Info');
WHEN lv_cus_num > 100 AND lv_cus_num < 200 THEN DBMS_OUTPUT.PUT_LINE('Mid Rated Customer Info');
ELSE DBMS_OUTPUT.PUT_LINE('High R... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 22, 2020 at 06:16 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
/*
Modèle de script de post-déploiement
--------------------------------------------------------------------------------------
Ce fichier contient des instructions SQL qui seront ajoutées au script de compilation.
Utilisez la syntaxe SQLCMD pour inclure un fichier dans le script de post-déploiement.
Exe... |
create or replace PACKAGE BODY PK_TE_IMPL AS
/**
* Supporting functions that help to implement PK_TE functionality (mostly dealing with recursive calls to handle loop structures).
* Moved to separate package to expose in PK_TE specification only those types and functions that are to be called by end user.
* @headcom... |
CREATE TABLE IF NOT EXISTS db_smarthome.tUserAccount
(
vAccount VARCHAR(255) PRIMARY KEY UNIQUE NOT NULL,
vPassword VARCHAR(255) NOT NULL,
vOwner VARCHAR(255) DEFAULT'',
tiRoleId TINYINT NOT NULL DEFAULT 2,
tiStatus TINYINT NOT NULL DEFAULT 1,
dtCreateTime DATETIME,
INDEX (vAccount(50))
); |
DROP TABLE IF EXISTS games;
DROP TABLE IF EXISTS history;
DROP TABLE IF EXISTS players;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS collection;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE games (
id INTEGER UNIQUE NOT NULL,
name TEXT... |
drop table related;
create table related
(
relatedid int NOT NULL AUTO_INCREMENT,
individualid varchar(255) not null,
relationid char(2) not null,
relativeid varchar(255) not null,
datecreated datetime not null,
proxyid varchar(255) not null,
datelastmodified datetime null,
primary key (relatedid)
);
create table rel... |
CREATE TABLE tipo_resolucion (
id SERIAL NOT NULL PRIMARY KEY,
nombre VARCHAR(100) NOT NULL,
requerido BOOLEAN,
acreditable BOOLEAN
); |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE events (
event_id serial PRIMARY KEY,
host_id serial REFERENCES hosts ON DELETE CASCADE,
title varchar(240) NOT NULL,
description var... |
delete from HtmlLabelIndex where id=21644
/
delete from HtmlLabelInfo where indexid=21644
/
INSERT INTO HtmlLabelIndex values(21644,'签章节点')
/
INSERT INTO HtmlLabelInfo VALUES(21644,'签章节点',7)
/
INSERT INTO HtmlLabelInfo VALUES(21644,'Signature nodes',8)
/
delete from HtmlLabelIndex where id=21650
/
delete from Htm... |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2017 年 03 月 02 日 18:02
-- 服务器版本: 5.5.40
-- PHP 版本: 5.4.33
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
INSERT IGNORE INTO config (name, value)
VALUES ('register-token', 'ad-ad-moo')
--;;
INSERT IGNORE INTO config (name, value)
VALUES ('register-active', '1')
--;;
|
INSERT INTO TAGS
(
TAG_ID
, TAG_NAME
, INSERT_USER
, INSERT_DATETIME
, UPDATE_USER
, UPDATE_DATETIME
, DELETE_FLAG
) VALUES (
DEFAULT
, ?
, ?
, ?
, ?
, ?
, ?
);
|
CREATE TABLE installation (
id BIGINT IDENTITY,
creation_date TIMESTAMP NOT NULL,
update_date TIMESTAMP,
version VARCHAR (255) NOT NULL
);
CREATE TABLE user (
id BIGINT IDENTITY,
creation_date TIMESTAMP NOT NULL,
update_date TIMESTAMP,
name VARCHAR (255) NOT NULL,
email VARCHAR_IGNORECASE (255) NOT NUL... |
create table customer(
customerId integer IDENTITY primary key,
firstName varchar(50) not null,
lastName varchar(50) not null,
primaryPhoneNumber varchar(10) not null,
secondaryPhoneNumber varchar(10),
email varchar(128),
addressLine1 varchar(128) not null,
city varchar(128) not null,
state varchar(2) not nul... |
delete from HtmlLabelIndex where id=24008
/
delete from HtmlLabelInfo where indexid=24008
/
INSERT INTO HtmlLabelIndex values(24008,'流程附件是否转为正文附件')
/
delete from HtmlLabelIndex where id=24009
/
delete from HtmlLabelInfo where indexid=24009
/
INSERT INTO HtmlLabelIndex values(24009,'如勾选,则当流程正文状态变为“正常”或“归档”时,将流程附件转为... |
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS library.books;
DROP SCHEMA IF EXISTS library; |
create index on corporate_owners(numberofcontacts desc);
create index on contacts(registrationcontacttype);
create index on contacts(registrationid);
create index on contacts(registrationid) WHERE registrationcontacttype = 'CorporateOwner';
create index on registrations(registrationid);
create index on registrations... |
INSERT INTO employees (first_name, last_name, role_id, manager_id)
VALUES ("Jeff", "Howell", 2, null) , ("Quinton", "Fults", 1, 1), ("Calum", "Ragan", 1, 1); |
-- ----------------------------
-- 创建旅游景点表:“tourism_spot” 2015-02-02
-- ----------------------------
drop table if exists `tourism_spot`;
create table `tourism_spot` (
`id` bigint(20) not null,
primary key (`id`)
) engine=innodb default charset=utf8;
-- ----------------------------
-- 创建旅游景点详细信息表:“tourist_spot_in... |
SELECT Products.PROD_ID AS ID,(SUM(QUANTITY)) AS total
FROM Products , Orderlines
WHERE Products.prod_id=Orderlines.prod_id
GROUP BY (Products.prod_id)
order by total desc limit 2;
|
SELECT COUNT(o_customerid)
FROM orders
WHERE (
SELECT o_customerid
FROM orders
WHERE o_orderdate LIKE '2019-01-03'
GROUP BY o_customerid
); |
prompt Creating AWR snapshot
exec dbms_workload_repository.create_snapshot();
|
alter table `cos_order_item` add column `flowId` varchar(100) default NULL;
ALTER TABLE `cos_order_item` MODIFY COLUMN `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
update cos_order_item f set flowId=(select flowId from cos_order where id=f.orderId);
alter table `cos_score` change `sourceValue` `sour... |
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50711
Source Host : localhost:3306
Source Schema : tenancy_sys_db
Target Server Type : MySQL
Target Server Version : 50711
File Encoding : 65001
Date: 23/05/2019 13... |
drop table ACT_GE_BYTEARRAY;
drop table ACT_GE_PROPERTY; |
------------------------------------------------------------------------
-- Get the number of injection data items for each open analysis
------------------------------------------------------------------------
Select Wa.Workid as AnalysisId, Wa.Name as AnalysisName, wa.createddttm,
Extractvalue (Workcontext, '/analyt... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50520
Source Host : localhost:3306
Source Database : mangobbs
Target Server Type : MYSQL
Target Server Version : 50520
File Encoding : 65001
Date: 2013-04-19 19:14:04
*/
SET FOREIGN_KEY_CHECKS=0;... |
ALTER TABLE `HMS_Room` ADD COLUMN `Level` INT NOT NULL DEFAULT '1'; |
CREATE TABLE `entries` (
id int unsigned auto_increment,
date timestamp default current_timestamp,
lexer varchar(50) default 'Text only',
host varchar(255) default '',
entry text,
primary key(id),
index(date),
index(lexer),
fulltext(entry)
) ENGINE=MyISAM;
|
CREATE TABLE `ALERT_DICTIONARY_DATA` (
`COD_ALERT_DICT_DATA` INTEGER(11) NOT NULL AUTO_INCREMENT,
`COD_ALERT_DICTIONARY` INTEGER(11) NOT NULL,
`NAME_VARIABLE` VARCHAR(30) COLLATE latin1_swedish_ci DEFAULT NULL COMMENT 'NOMBRE DE LA VARIABLE',
`VALUE_VARIABLE` VARCHAR(30) COLLATE latin1_swedish_ci DEFAULT NULL C... |
/*Que2:List the customer number, customer name, event number, date held,
facility number, facility name, and estimated audience cost per person (EstCost / EstAudience)
for events held on 2013, in which the estimated cost per person is less than $0.2
*/
SELECT
EVENTNO, DATEHELD, CUSTOMER.CUSTNO, CUSTNAME, FAC... |
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 14, 2014 at 04:05 PM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 23, 2019 at 04:05 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT
ATC.TABLE_NAME,ATC.COLUMN_NAME,ATC.DATA_TYPE
--ATC.*
FROM ALL_TAB_COLS ATC
INNER JOIN ALL_TABLES ATB ON ATC.TABLE_NAME=ATB.TABLE_NAME
WHERE
ATC.OWNER='ISKUR'
ORDER BY
ATC.TABLE_NAME, ATC.COLUMN_ID; |
CREATE DATABASE greenlight;
CREATE ROLE greenlight WITH LOGIN PASSWORD 'pa55word';
CREATE EXTENSION IF NOT EXISTS citext;
|
delete from HtmlLabelIndex where id=27609
/
delete from HtmlLabelInfo where indexid=27609
/
INSERT INTO HtmlLabelIndex values(27609,'培训活动开始日期必须小于或等于')
/
delete from HtmlLabelIndex where id=27610
/
delete from HtmlLabelInfo where indexid=27610
/
INSERT INTO HtmlLabelIndex values(27610,'和培训活动结束日期必须大于或等于')
/
INSERT ... |
UPDATE Users SET
PasswordHash = @PasswordHash
WHERE
ID = @ID |
drop table tcustomer;
drop table torder;
create table tcustomer (id bigint, customerid varchar(255));
create table torder (id bigint, ordernumber varchar(255), fk_customer bigint);
insert into tcustomer(id, customerid) values(1, 'CUSTOMER1');
insert into tcustomer(id, customerid) values(2, 'CUSTOMER2');
insert into t... |
CREATE TABLE Product(
maker VARCHAR(30),
model INT,
ptype VARCHAR(30)
);
CREATE TABLE PC (
model VARCHAR(30),
speed DECIMAL(10, 2),
ram INT,
hd_size INT,
price DECIMAL(10, 2)
);
CREATE TABLE Laptop(
model VARCHAR(30),
speed DECIMAL(10,2),
ram INT,
hd_size INT,
screen_size DECIMAL(10,1... |
--
-- 转存表中的数据 `qs_config`
--
INSERT INTO `qs_config` (`id`, `name`, `value`, `note`, `type`) VALUES
(NULL, 'uc_open', '0', '开启UC整合', 'Ucenter');
--
-- 转存表中的数据 `qs_menu`
--
INSERT INTO `qs_menu` (`id`, `name`, `pid`, `spid`, `log_cn`, `module_name`, `controller_name`, `action_name`, `menu_type`, `is_parent`, `data`, ... |
-- 180. 连续出现的数字
-- 编写一个 SQL 查询,查找所有至少连续出现三次的数字。
-- +----+-----+
-- | Id | Num |
-- +----+-----+
-- | 1 | 1 |
-- | 2 | 1 |
-- | 3 | 1 |
-- | 4 | 2 |
-- | 5 | 1 |
-- | 6 | 2 |
-- | 7 | 2 |
-- +----+-----+
-- 例如,给定上面的 Logs 表, 1 是唯一连续出现至少三次的数字。
-- +-----------------+
-- | ConsecutiveNums |
-- +------... |
SELECT * FROM SYSTEM_CONFIGS
WHERE
SYSTEM_NAME = ?
;
|
create schema report;
create schema helper;
INSERT INTO secure.role (id, comment, name) VALUES (2, 'Normal user', 'ROLE_USER');
-- create or replace view helper.round_goals as
-- (select subQuery.*,
-- player.employee_id,
-- player.goal_count as goal_count,
-- player.player_role
-- ... |
ALTER TABLE app_user ADD COLUMN
enabled BOOLEAN DEFAULT FALSE;
UPDATE app_user
SET enabled = TRUE;
|
create temp function xpath(path string, xml_string string) returns string
language js
options (library=["gs://<bucket>/sax.js","gs://<bucket>/dom.js","gs://<bucket>/dom-parser.js","gs://<bucket>/xpath.js"])
as """
var doc = new DOMParser().parseFromString(xml_string,'text/xml');
var childNodes = xpath.select(pa... |
delete from yttplinks;
delete from yttpTargetOS;
delete from yttpTestingType;
delete from yttpPassedVersions;
delete from yttpFailedVersions;
delete from yttpBlockedVersions;
delete from yttpCoveredComponents;
delete from yttpBrowserAndVersions;
delete from yttpissuedetails;
delete from links;
delete from TaskAss... |
DROP PROCEDURE CPI.LATEST_LOC_RISK;
CREATE OR REPLACE PROCEDURE CPI.latest_loc_risk (p_line_cd IN gipi_polbasic.line_cd%TYPE,
p_subline_cd IN gipi_polbasic.line_cd%TYPE,
p_iss_cd IN gipi_polbasic.iss_cd%TYPE,
p_issue_yy ... |
insert into hpNewsTabInfo (eid,tabid,tabTitle,sqlWhere) select id,1,title,strsqlwhere from hpelement where ebaseid ='1'
/
alter table extendHpWebCustom add leftmenuid varchar2(200)
/
alter table extendHpWebCustom add leftmenustyleid varchar2(200)
/
|
#------------------------------------------------------------
# Script MySQL.
#------------------------------------------------------------
#------------------------------------------------------------
# Table: usager
#------------------------------------------------------------
CREATE TABLE usager(
i... |
-- 강의
DROP TABLE IF EXISTS `MY_SCHEMA`.`LECT` RESTRICT;
-- 학생
DROP TABLE IF EXISTS `MY_SCHEMA`.`STUD` RESTRICT;
-- 강사
DROP TABLE IF EXISTS `MY_SCHEMA`.`TCHER` RESTRICT;
-- 매니저
DROP TABLE IF EXISTS `MY_SCHEMA`.`MGR` RESTRICT;
-- 과목
DROP TABLE IF EXISTS `MY_SCHEMA`.`SUBJ` RESTRICT;
-- 교실
DROP TABLE IF EXISTS `MY_SCH... |
# Host: 179.188.16.206 (Version 5.6.35-81.0-log)
# Date: 2018-11-22 20:48:58
# Generator: MySQL-Front 6.0 (Build 1.194)
#
# Structure for table "produtos"
#
DROP TABLE IF EXISTS `produtos`;
CREATE TABLE `produtos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nomeProd` text,
`estoque` int(11) DEFAULT NULL,
`ta... |
select [Event].[CityName] from [Event] GROUP BY [Event].[CityName] |
DROP TABLE IF EXISTS students, grades;
CREATE TABLE students (
id serial PRIMARY KEY,
name varchar(100)
);
CREATE TABLE grades (
id serial PRIMARY KEY,
student_id integer,
FOREIGN KEY (student_id) REFERENCES students(id),
grade varchar(2)
); |
ALTER TABLE `users`
ADD COLUMN `validation_code` VARCHAR(6) NULL DEFAULT NULL AFTER `badLogins`;
ALTER TABLE `users`
ADD COLUMN `validated` TINYINT NULL DEFAULT NULL AFTER `validation_code`;
|
drop table if exists rol;
create table rol
(
idRol int auto_increment,
descripcion varchar(50),
estado varchar(10) ,
fechaCreacion DateTime,
fechaModificacion DateTime,
usuarioCreacion varchar(20),
usuarioModificacion varchar(20),
primary key (idRol)
);
drop table if exists usuario;
create table usuario ... |
CREATE TYPE orditem AS (
orderitem_id integer,
orderitem_orderhead_type text,
orderitem_orderhead_id integer,
orderitem_linenumber integer,
orderitem_status text,
orderitem_itemsite_id integer,
orderitem_scheddate date,
orderitem_qty_ordered numeric,
orderitem_qty_shipped numeric,
orderitem_qty_rece... |
use LPI
ALTER TABLE LEAD add PrimaryPhone VARCHAR(15) not null default '';
|
-- 01 创建临时表空间
create temporary tablespace lyx_temp
tempfile 'D:\oracle\oradata\orcl\lyx_temp.dbf' size 100m autoextend on next 50m maxsize 200m;
--drop tablespace lyx_temp including contents and datafiles;
-- 02 创建表空间
create tablespace lyx
datafile 'D:\oracle\oradata\orcl\lyx.dbf' size 200m autoextend on next... |
prompt --application/pages/page_00008
begin
-- Manifest
-- PAGE: 00008
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.03.31'
,p_release=>'20.1.0.00.13'
,p_default_workspace_id=>20
,p_default_application_id=>8950
,p_default_id_offset=>33309244842782322
,p_default_owner=>'ORACLE'
);
w... |
select tabname,cnt from
(
select 'dq_result_summary' as tabname, count(*) as cnt from framework.dq_result_summary
union
select 'dq_result_detail' as tabname, count(*) as cnt from framework.dq_result_detail
union
select 'equity_orders' as tabname, count(*) as cnt from framework.equity_orders
union
select 'equity_executi... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 29, 2019 at 05:31 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
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 Company (
Company_ID serial not NULL UNIQUE,
Company_Name varchar(70) not NULL UNIQUE,
Date_Created date not NULL DEFAULT current_date,
Successful_Hires int not NULL DEFAULT 0,
Num_Jobs int not NULL DEFAULT 0,
Num_Employers int not NULL DEFAULT 0,
Active_State bool... |
CREATE USER stas@'127.0.0.1' IDENTIFIED BY 'PA$$w0rd';
CREATE DATABASE db_stas;
GRANT ALL PRIVILEGES ON db_stas.* to stas@'127.0.0.1';
FLUSH PRIVILEGES; |
drop table if exists `student`;
CREATE TABLE student
(
`username` VARCHAR(128) NOT NULL comment '用户名',
`grade` VARCHAR(32) NOT NULL comment '年级',
`nickname` VARCHAR(128) NULL comment '昵称',
`password` VARCHAR(128) NOT NULL comment '密码',
`major` varchar(32) null comment '专业名称',
`school` varchar(32) null comme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.