text stringlengths 6 9.38M |
|---|
-- MySQL Script generated by MySQL Workbench
-- 09/10/16 14:30:22
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 26 Feb 2020 pada 06.31
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
INSERT INTO lineorder_sorted_by_part SELECT * FROM lineorder |
-- --------------------------------------------------------
-- Host: 192.168.10.10
-- Server version: 5.6.27-0ubuntu0.14.04.1 - (Ubuntu)
-- Server OS: debian-linux-gnu
-- HeidiSQL Version: 9.3.0.4984
-- ------------------------------------------------... |
-- Task 14
-- Lists all generes of the show Dexter
SELECT tv_genres.name FROM tv_genres
INNER JOIN tv_show_genres ON tv_genres.id = tv_show_genres.genre_id
RIGHT JOIN tv_shows ON tv_shows.id = tv_show_genres.show_id WHERE tv_shows.title = 'Dexter'
ORDER BY tv_genres.name ASC;
|
SELECT action_type,
date_executed,
record_json->'id' as wfe_id,
record_json->'meta_data'->'debtor_dbid' as debtor_dbid
FROM gxweb.gxweb_table_log
WHERE table_name = 'gxweb.workflow_event' and (record_json->>'id'::text)::int = ANY(ARRAY[80095, 227520, 227550])
and date_executed BETWEEN '2018-10-... |
delimiter //
DROP PROCEDURE IF EXISTS PeakOfOneCity //
CREATE PROCEDURE PeakOfOneCity(IN cityname varchar(200))
BEGIN
SELECT DISTINCT Time, Pm2_5 FROM Pollution, City,
(SELECT City_name, MAX(Pm2_5) AS Max FROM Pollution AS P1 GROUP BY City_name) AS Temp1
WHERE Pollution.City_name = C... |
alter table #prefix#products add column shipping int not null default 0;
alter table #prefix#products_taxes add column charge_on_shipping int not null default 0;
create table #prefix#products_order (
id serial not null primary key,
user_id int not null,
payment_id int not null,
ts datetime not null,
status char(3... |
create or replace view killview as
select m_id as Match_ID,pid as Player_ID,k as Kills,d as Deaths,a as Assists,(nvl((k / NULLIF( d, 0 )),k)) as KDA
from Kills@site_link;
select * from killview;
commit;
|
-- "Server=(localdb)\\mssqllocaldb;Database=Quon;Trusted_Connection=True;MultipleActiveResultSets=true"
-- "Data Source=sql.freeasphost.net\MSSQL2016;Initial Catalog=planning214_SampleDB;Persist Security Info=True;User ID=planning214_SampleDB;Password=DBSamplePW"
-- "workstation id=Quon214.mssql.somee.com;packet size=... |
#2016-1-26
#add new table which called tbsystemproperties
CREATE TABLE tbsystemproperties(
id INT(11) PRIMARY KEY AUTO_INCREMENT,
proKey VARCHAR(500),
proValue VARCHAR(500),
createTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
modifyTime TIMESTAMP
);
#insert need data
INSERT INTO tbsystemproperties (proKey,proValue)
... |
delete from tbl_list_values
where field_id = %1
|
-- Creates a real estate market "stability index" based on the
-- 2010 Walker & Winston paper from LISC:
-- http://www.foreclosure-response.org/assets/maps&data/Walker_and_Winston_2010.pdf
drop view tract_stability_raw_values cascade;
drop view tract_stability_means_stddevs cascade;
drop table tract_stability cascade;
... |
INSERT INTO Foo(id, name) VALUES (1, 'Foo 1');
INSERT INTO Foo(id, name) VALUES (2, 'Foo 2');
INSERT INTO Foo(id, name) VALUES (3, 'Foo 3');
INSERT INTO Product (name, price, stock_count, img_url)
VALUES('Ball', 20, 2, 'ball.svg');
INSERT INTO Product (name, price, stock_count, img_url)
VALUES('Bat', 50, 30, 'bat.sv... |
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: api_dev
-- ------------------------------------------------------
-- Server version 10.1.26-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_R... |
drop table IF EXISTS Produto;
drop table IF EXISTS ProdutoFalso;
CREATE TABLE "ProdutoFalso" (
"CodigoGtin" INTEGER NOT NULL,
"DataEmissao" text NOT NULL,
"CodigoTipoPagamento" INTEGER NOT NULL,
"CodigoProduto" INTEGER,
"CodigoNcm" INTEGER,
"CodigoUnidade" text,
"DescricaoProduto" TEXT,
"ValorUnitario" INTEG... |
INSERT INTO memories (sending_user_id, receiving_user_id, memory_title, memory_text, memory_date, img_url, submission_date, is_opened)
VALUES ($1, $2, $3, $4, $5, $6, $7, false)
RETURNING *;
SELECT * FROM users
WHERE id = $2; |
CREATE TABLE IF NOT EXISTS `Logs` (
`id` bigint NOT NULL primary key,
`application` varchar(32) NOT NULL,
`event_id` int NOT NULL default 0,
`level` int NOT NULL default 0,
`host` varchar(3... |
SELECT *
FROM [Case]
ORDER BY CaseID
SELECT *
FROM [Employee]
ORDER BY EmployeeID
BEGIN TRANSACTION
UPDATE c
SET c.FirstName = e.FirstName, c.LastName = e.LastName
FROM [Case] AS c
INNER JOIN [Employee] AS e ON c.EmployeeID = e.EmployeeID
SELECT *
FROM [Case]
ORDER BY CaseID
ROLLBACK TRANSACTION
|
CREATE TABLE `chatlog` (
`channel` TEXT NOT NULL,
`nick` TEXT NOT NULL,
`message` TEXT NOT NULL,
`timestamp` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
CREATE SCHEMA `tracker_db` ;
USE tracker_db;
CREATE TABLE `tracker_db`.`price_information` (
`id` INT NOT NULL AUTO_INCREMENT,
`product_name` VARCHAR(1000) NOT NULL,
`date_retrieved` DATETIME NOT NULL,
`total_price` FLOAT,
`product_price` FLOAT,
`shipping_price` FLOAT,
PRIMARY KEY (`id`));
CREATE TABL... |
drop table if exists ACT_RU_EVENT_SUBSCR cascade constraints;
drop index if exists ACT_IDX_EVENT_SUBSCR_CONFIG_;
drop index if exists ACT_IDX_EVENT_SUBSCR_SCOPEREF_; |
delete from tbl_state_assignees
where state_id in (select state_id from tbl_states where template_id = %1)
|
drop table if exists ACT_GE_BYTEARRAY cascade;
drop table if exists ACT_GE_PROPERTY cascade;
|
-- MySQL dump 10.13 Distrib 5.6.10, for Win32 (x86)
--
-- Host: localhost Database: ehome
-- ------------------------------------------------------
-- Server version 5.6.10
-- Dump command
-- ------------------------------------------------------
-- mysqldump -uroot -p --opt --order-by-primary --complet... |
CREATE TABLE log (
id CHAVE NOT NULL,
severity INTEGER NOT NULL,
error_code INTEGER,
message TEXT NOT NULL,
object_type CHARACTER VARYING(32),
object_id CHAVE,
id_employee CHAVE,
date_add TIMESTAMP WITH TIME ZONE NOT NULL,
d... |
SELECT c.first_name as 'first Name',last_name,m.title, CONVERT (m.description using UTF8)
from (criminal as c
join media2criminal as m2c on c.id = m2c.criminal_id)
join media as m on m.id = m2c.media_id
where c.last_name like '%undy%' |
create table product_types(
id BIGINT not null primary key,
name varchar(100)
);
create table makers(
id BIGINT not null primary key,
name varchar(100)
);
create table products(
id BIGINT ... |
alter table "public"."users" drop constraint "users_fileObjectId_fkey"
|
--Checklist 53 e 59
DECLARE
s CHAR(1) := 'F';
medicas medico.nomemedico%type;
CURSOR medico_F is
SELECT nomemedico FROM medico
WHERE sexo = s;
BEGIN
OPEN medico_F;
LOOP
FETCH medico_F INTO medicas;
EXIT WHEN medico_F%notfound;
dbms_output.put_line(medicas);
END LOOP;
CLOSE medico_F;
END;
/ |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50505
Source Host : localhost:3306
Source Database : zjds
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2018-11-29 18:03:58
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
SELECT * FROM get1(); |
create table persons (
id int(10) unsigned null default NULL,
FirstName varchar(50) null default null,
LastName varchar(50) null default null,
Address varchar(50) null default null,
Gender varchar(50) null default null
)Engine =InnoDB; |
# --- !Ups
alter table cas_services
add service_requires_full_info boolean default false not null;
# --- !Downs
alter table cas_services
drop column service_requires_full_info;
|
-- 1. List the following details of each employee:
-- employee number, last name, first name, sex, and salary.
select e.emp_no, e.last_name, e.first_name, e.sex, s.salary
from employees as e
left join salaries as s on
e.emp_no = s.emp_no;
-- 2. List first name, last name, and hire date for employees who were hired i... |
update MAINMENUINFO set LINKADDRESS='/docs/report/DocRpSum.jsp?optional=t1.doccreaterid' WHERE LINKADDRESS = '/docs/report/DocRpCreaterSum.jsp'
/
update MAINMENUINFO set LINKADDRESS='/docs/report/DocRpSum.jsp?optional=t1.crmid' WHERE LINKADDRESS = '/docs/report/DocRpCrmSum.jsp'
/
update MAINMENUINFO set LINKADDR... |
select w1.Id Id
from Weather w1 join Weather w2 on datediff(w1.Date, w2.Date) = 1
where w1.Temperature > w2.Temperature;
|
select
creditcardguid as card_guid,
(ExpirationDateYear || '-' || ExpirationDateMonth || '-01')::date as expiration_date ,
customerno as customer_code,
paymenttype as card_type,
cardholdername as card_holder,
last4unencryptedcreditcardnos as last_4,
emailaddress as email_address,
datecreated + (nullif(t... |
-- /= = = = = = = = = = = = = = = = = = = = = =
-- for the test of over relation, referrer over
-- = = = = = = = = = =/
CREATE TABLE WHITE_PURCHASE_REFERRER(
PURCHASE_REFERRER_ID BIGINT AUTO_INCREMENT NOT NULL,
PURCHASE_REFERRER_NAME VARCHAR(200) NOT NULL,
PRIMARY KEY (PURCHASE_REFERRER_ID)
);
A... |
-- WEB-4244 - clean up of old auth tables for control-centre
DROP TABLE IF EXISTS ROLE_PEOPLE#
DROP TABLE IF EXISTS PARTNER_USERS#
DROP TABLE IF EXISTS ROLE#
DROP TABLE IF EXISTS USER#
|
CREATE TABLE IF NOT EXISTS `nyss_inbox_messages` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`message_id` int(10) NOT NULL,
`imap_id` int(10) NOT NULL,
`sender_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`sender_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`subject` varchar(255) COLLATE utf8_u... |
-- 你我金融信息回流日志表
CREATE TABLE mgt_xjl_flowback_log
(
id int not null auto_increment,
user_id int not null comment '用户id',
device_id varchar(100) not null comment '设备id',
status varchar(10) comment '回流状态 0表示回流提交失败,1表示成功,后续有状态码可添加',
type varchar(20) comment '业务类型 对应你我金融业务码',
creation_date Timestamp not n... |
drop database
if exists phonebookapp;
create database phonebookapp;
use phonebookapp;
create table contact(
contact_id int not null primary key auto_increment,
firstname varchar(200) not null,
lastname varchar(200) not null,
birthdate date not null,
street varchar(200),
number int,
city varchar(200),
country varchar... |
CREATE TABLE `companies` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`account` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`salt` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
... |
SELECT Hotel.HotelID,Hotel.OverallRating,Review.Cleanliness FROM Hotel
INNER JOIN Review on Hotel.HotelID = Review.HotelID
WHERE Review.Cleanliness != -1
GROUP BY Review.HotelID
HAVING Hotel.OverallRating > 3 and avg(Review.Cleanliness) >= 4.5; |
-- Q2
-- Find all itineraries
-- Seattle WA -> 1 stop -> Boston MA
-- on July 15th same day
-- total flight time < 7*60
-- return name, actual_time
-- f1_flight_num, f1_origin_city, f1_dest_city, f1_actual_time,
-- f2_flight_num, f2_origin_city, f2_dest_city, f2_actual_time
select c.name as name,
f1.flight_nu... |
SET SEARCH_PATH TO parlgov;
DROP TABLE IF EXISTS q4 CASCADE;
-- You must not change this table definition.
CREATE TABLE q4 (
country VARCHAR(50),
num_elections INT,
num_repeat_party INT,
num_repeat_pm INT
);
-- You may find it convenient to do this for each of the views
-- that define your in... |
SELECT COUNT(*) FROM NOTIFICATION_STATUS
WHERE DELETE_FLAG = 0;
|
-- Roles = pápeis ou funções, Users = usuários, e Groups = contas, ou seja perfis de atuação em um banco de dados, que possuem permissões em comum ou específicas;
-- É possível que roles, pertençam a outras roles;
-- Quando falamos de Roles, Users e Groups, estamos nos referindo ao mesmo conceito;
-- Users, e Groups, s... |
create trigger trg_before_ins_upd_pers before insert or update on personas
for each row
execute procedure f_validar_dv_pers()
;
\q
|
CREATE TABLE caregiving.users
(
id bigserial NOT NULL,
name character varying(100),
login character varying(50),
password character varying(255),
type character varying(50),
CONSTRAINT users_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE caregiving.users
OWNER TO postgres;
CREATE INDEX user... |
CREATE TABLE IF NOT EXISTS t_user (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30),
age int,
create_time TIMESTAMP
);
insert into t_user(name,age,create_time)values('Tom',20,now()),('Zhang',21,now()),('Li',22,now()); |
/* write a SQL query to list the names of all people who starred in Toy Story */
SELECT name
FROM people
WHERE id in (
SELECT stars.person_id
FROM movies
JOIN stars on stars.movie_id = movies.id
WHERE movies.title LIKE 'Toy Story'); |
insert into user_info(user_email, user_name, user_hash, active)
values($1, $2, $3, true) |
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(100),
password VARCHAR(100),
email VARCHAR(200)
);
|
/*IMPORTAÇÃO WIDL.PROD08*/
INSERT INTO widl.PROD08
select convert(varchar,procod) as procod,'1' as seq,'0'as for1,'0' as for2,'0' as for3,
'S' as ativa,'N' atv2,'13/06/2016','ELOIR',
'Ø'+' '+convert(varchar,materialBrt)+' - '+convert(varchar,procodMat) as descricao,
'0' as for4,'' as for5, '1753-01-01 00:00:00.000' as ... |
Delete HtmlLabelIndex where id=20858
/
Delete HtmlLabelInfo where indexid=20858
/
INSERT INTO HtmlLabelIndex values(20858,'标题中不能包括特殊字符''%''')
/
INSERT INTO HtmlLabelInfo VALUES(20858,'标题中不能包括特殊字符''%''',7)
/
INSERT INTO HtmlLabelInfo VALUES(20858,'Title can not contain ''%''',8)
/ |
-- ----------------------------
-- Table structure for temp_history_congestion
-- ----------------------------
DROP TABLE IF EXISTS `congestion_history`;
CREATE TABLE `congestion_history`
(
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`type` int(2) DEFAULT NULL COMMENT '拥堵类型 ... |
CREATE TABLE IF NOT EXISTS
SC_AudioApp.Song_Artist
(
refArtist INTEGER,
refSong INTEGER,
CONSTRAINT pk_ArtistSong PRIMARY KEY (refSong, refArtist),
CONSTRAINT fk_artist FOREIGN KEY (refArtist) REFERENCES SC_AudioApp.Artist (id),
CONSTRAINT fk_song FOREIGN KEY (refSong) REFERENCES SC_Au... |
DROP PROCEDURE CPI.POPULATE_BATCH_REVALL2;
CREATE OR REPLACE PROCEDURE CPI.populate_batch_revall2(v_date DATE ) AS
/*Created by: Joey
Date created: 040105
Description: extract records into gicl_batch_takeup_revall for the specified dates
*/
TYPE claim_id_tab IS TABLE OF gicl_clm_res_his... |
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: localhost Database: hospitalmanagement
-- ------------------------------------------------------
-- Server version 5.6.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
delete HtmlLabelIndex where id=20585
/
delete HtmlLabelInfo where indexid=20585
/
INSERT INTO HtmlLabelIndex values(20585,'左菜单')
/
INSERT INTO HtmlLabelInfo VALUES(20585,'左菜单',7)
/
INSERT INTO HtmlLabelInfo VALUES(20585,'Left Menu',8)
/
delete HtmlLabelIndex where id=16208
/
delete HtmlLabelInfo where indexid=162... |
-- ----------------------------
-- Records of frame_module
-- ----------------------------
INSERT INTO frame_module VALUES ('93694808-9738-4c27-970b-7573eb0756b4', 'SYSTEM', 'System', null, null, 'SYSTEM');
-- ----------------------------
-- Records of frame_menu
-- ----------------------------
INSERT INTO frame_menu... |
drop table member;
create table member(
name varchar2(20),
phon varchar2(20),
id varchar2(20),
pw varchar2(20));
insert into MEMBER(name, phon, id, pw ) values('송승룡','01000000','as','as');
select * from member;
drop table member cascade constraints;
create table sencing(
NH3 varchar2(20),
NOx varchar2(20),
alcoho... |
alter table extendHpWeb1 add logo varchar2(100)
/ |
-- questionbank
DROP SCHEMA IF EXISTS questionbank;
-- questionbank
CREATE SCHEMA questionbank;
-- 회원
CREATE TABLE questionbank.customer (
customer_code CHAR(4) NOT NULL COMMENT '회원코드', -- 회원코드
customer_name VARCHAR(20) NOT NULL COMMENT '이름', -- 이름
id VARCHAR(20) NOT NULL COMMENT '아이디', --... |
drop table if exists class;
create table class(
class_id int not null auto_increment,
class_name varchar(30),
primary key (class_id)
);
drop table if exists staff;
create table staff(
staff_id int not null auto_increment,
first_name varchar(14),
last_name varchar(15),
primary key (staff_id)
); |
SELECT
*
FROM
User
INTO OUTFILE 'C:/xampp/htdocs/TrioFlabby/sql/user.csv'
FIELDS ENCLOSED BY '"'
TERMINATED BY ','
ESCAPED BY '"'
LINES TERMINATED BY '\r\n';
SELECT
*
FROM
PreferredLocation
INTO OUTFILE 'C:/xampp/htdocs/TrioFlabby/sql/preferredlocation.csv'
FIELDS ENCLOSED BY '"'
TERMINATED BY... |
select distinct b.tags
from blended_metadatas b
where source_standard = 'FGDC'; |
create table membership(
id varchar2(20) primary key,
pw varchar2(100),
addr varchar2(300)
);
insert into membership values('aaa','aaa','산골짜기');
insert into membership values('bbb','bbb','별동별');
commit;
alter table membership add
session_id varchar2(100) default 'nan' not null;
alter table membership add limit_time... |
REM instead.sql
REM Version 1.0, last updated 5/1/97
REM This script illustrates the use of an instead-of trigger, which is
REM valid in Oracle8 and higher. This is discussed in
REM Chapter 9 of _Oracle8 PL/SQL Programming_ by Scott Urman.
CREATE VIEW room_summary AS
SELECT building, sum(number_seats) total... |
/*add and update values in this database*/
UPDATE Person
SET age=27
WHERE first_name='Jon';
UPDATE Person
SET age=18
WHERE first_name='Walter Junior' AND last_name='White';
DELETE FROM EyesColor
where exists
(SELECT *
FROM Person
WHERE Person.id = EyesColor.person_id
AND first_name='Walter');
DELETE FROM Person
WHERE f... |
SELECT State, avg(avg_Score) AS Avg_Hospital_Score_State_Level
FROM Avg_Hospital_Score
GROUP BY State
ORDER BY Avg_Hospital_Score_State_Level DESC
LIMIT 10; |
0 table_definition None
0 CREATE <type 'str'>
1 TABLE <type 'str'>
2 if_not_exists IF NOT EXISTS
0 IF <type 'str'>
1 NOT <type 'str'>
2 EXISTS <type 'str'>
3 table_name test_${conf}_gogo
0 test_${conf}_gogo <type 'str'>
4 ( <type 'str'>
5 table_col_list [('abc', 'BIGINT', None), ... |
DELIMITER //
CREATE OR REPLACE PROCEDURE Questao_06() CONTAINS SQL
BEGIN
SELECT f.nome, d.sigla
FROM funcionario f, departamento d
WHERE f.depto = d.codigo ;
END //
DELIMITER ;
CALL Questao_06(); |
CREATE DATABASE test_partition;
CREATE TABLE test_partition.sales ( cust_id INT NOT NULL, name VARCHAR(40),
store_id VARCHAR(20) NOT NULL, bill_no INT NOT NULL,
bill_date DATE PRIMARY KEY NOT NULL, amount DECIMAL(8,2) NOT NULL)
PARTITION BY RANGE (year(bill_date))(
PARTITION p0 VALUES LESS THAN (2016),
... |
REM colsel.sql
REM Version 1.0, last updated 8/8/97
REM This script demonstrates the behavior of column objects in queries, as
REM described in Chapter 11 of _Oracle8 PL/SQL Programming_ by Scott Urman.
SET SERVEROUTPUT on
DECLARE
v_Student StudentObj;
v_Address AddressObj;
CURSOR c_Students IS
S... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50621
Source Host : localhost:3306
Source Database : shiro
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2015-11-05 18:23:49
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
DELETE FROM music WHERE id =$1 |
-- phpMyAdmin SQL Dump
-- version 5.0.4deb2+deb11u1
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : ven. 22 juil. 2022 à 18:18
-- Version du serveur : 10.5.15-MariaDB-0+deb11u1
-- Version de PHP : 7.4.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/... |
CREATE TABLE IF NOT EXISTS orders
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
user_id INTEGER REFERENCES users (id) NOT NULL,
product_id INTEGER REFERENCES products (id) NOT NULL,
order_start TIMESTAMPTZ NOT NULL,
order_end TIMESTAMPTZ ... |
-- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 04, 2017 at 04:48 PM
-- Server version: 5.7.11
-- PHP Version: 5.6.16
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.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 01-Nov-2017 às 14:25
-- Versão do servidor: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
#Pupil
#INSERT INTO pupil (name, surname, className) VALUES (?, ?, ?);
#SELECT pupilId,name,surname,className FROM pupil WHERE surname = ?;
#SELECT pupilId,name,surname,className FROM pupil WHERE className = ?;
#SELECT pupilId,name,surname,className FROM pupil;
#DELETE FROM pupil WHERE className = ?;
#Class
#insert | ... |
CREATE TABLE songs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
artist TEXT,
artist_id INTEGER,
album TEXT,
album_id INTEGER,
year INTEGER,
length INTEGER,
url TEXT
);
INSERT INTO songs (title, artist, album, year, length) VALUES ('Come Together', 'The Beatles', 'Abbey Road', 1969, 259);
INSER... |
create table cp_device_correlation_type
(
id varchar(64) not null comment '主键'
primary key,
device_id varchar(64) not null comment '设备编号(主键)',
device_type_id varchar(64) not null comment '设备类型编号(主键)'
)
comment '设备-设备类型关联表';
|
drop table users;
drop table router;
create table router (id serial not null, mac varchar(50), ssid varchar(50), ubicacion varchar(50), primary key (id));
create table users (id serial not null, name varchar(20), email varchar(30), password varchar(50), fk_router integer, primary key (id), foreign key (fk_router) refe... |
/* Copyright (c) 2018 ABI Cube */
/* Shabnam Watson */
/* [Queries] is a view that reads from XEevent files saved in a certain directory.
You have to change this directory to a local directory on your machine for this
view to work.
*/
USE Performance_Monitoring
Select * from [Queries] Order BY [Query S... |
DECLARE
CURSOR c1 (columname VARCHAR2)
IS
SELECT COUNT (column_name) ctr
FROM all_tab_cols
WHERE owner LIKE 'CPI'
AND table_name = 'GIAC_COMM_INCOME_EXT'
AND column_name = columname;
BEGIN
FOR x IN c1 ('PARAM_FROM_DATE')
LOOP
IF x.ctr = 0
THEN
EXE... |
#1、查询01课程比02课程成绩高的学生的信息及课程分数
SELECT st.*,sc1.s_score AS '语文',sc2.s_score AS '数学'
FROM student st
LEFT JOIN score sc1 ON st.s_id = sc1.s_id AND sc1.c_id = 01
LEFT JOIN score sc2 ON st.s_id = sc2.s_id AND sc2.c_id = 02
WHERE sc1.s_score > sc2.s_score
# 2、查询01课程比02课程成绩低的学生信息及课程分数
SELECT st.* ,sc1.s_score AS '语文',... |
-- 2021.06.10
-- function: 1.단일행 함수, 2.집합(다수행)함수
-- 단일행 함수: '1개'의 '행'이 포함하는 특정 컬럼의 값 하나를 연산하고 반환
-- 다수행 함수: '여러 행'의 특정 컬럼값들을 대상으로 연산하고 반환
--***** 변환함수 아주 중요 꼭 기억
-- 숫자 함수
select abs(10), abs(-7) -- 절댓값
from dual;
select floor(15.7) -- 소수점 이하 절삭
from dual;
select ROUND(15.193, -1), ROUND(15.193, 2) -- 오른쪽 숫자는 해당 소수... |
select
/*%expand*/*
from
employees
where
employee_id = /* employeeId */1
|
/*
Navicat MySQL Data Transfer
Source Server : 1761
Source Server Type : MySQL
Source Server Version : 80017
Source Host : localhost:3306
Source Schema : book_management
Target Server Type : MySQL
Target Server Version : 80017
File Encoding : 65001
Date: 15/07/2021 1... |
DROP DATABASE IF EXISTS furama;
create database furama;
use furama;
create table vi_tri(
id_vi_tri int PRIMARY KEY,
ten_vi_tri varchar(45)
);
create table trinh_do(
id_trinh_do int PRIMARY KEY,
trinh_do varchar(45)
);
create table bo_phan(
id_bo_phan int PRIMARY KEY,
ten_bo_phan varchar(45)
);
create table nhan_... |
-- (c) DAT, All Rights Reserved
-- Author: Peter Ogilvie
-- Date : 12/2/2014
-- Copies data (minues a few coloums) from the TimeSeries.db to the Analytic.db
-- I'm finding the orginal concept of using ticker rowid as a foriegn key to
-- expensive for the number of rows that we're looking at here.
-- This insert is cal... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50505
Source Host : localhost:3306
Source Database : elearning_web
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2019-05-13 18:53:51
*/
SET FOREIGN_KEY_CHEC... |
ALTER table STG_PLAYER_ACTIVITY_HOURLY
add column last_played_ts timestamp;
ALTER table PLAYER_ACTIVITY_HOURLY
add column last_played_ts timestamp;
|
SELECT *
FROM (SELECT col_id AS id,
col_name AS NAME,
col_code AS code,
'Team' AS TYPE,
col_description AS description,
NULL AS skills,
NULL AS teams,
NULL AS businessroles,
NULL AS email
... |
alter table "public"."assets" rename column "datetime_created" to "datetimeCreated";
|
INSERT INTO users (username, email, verified, token, password) VALUES(?, ?, ?, ?, ?); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.