text stringlengths 6 9.38M |
|---|
select jou.*, jli.*
from joujournal jou
join jjoujlijli joujli on joujli.UIDjou = jou.jouUID
join jlijournalline jli on jli.jliUID = joujli.journalLineUIDjli
where jouSubjectId = 'e49dd7d4-9e7d-4e57-994a-f66282e66270'
#and jouType in ('PREMIUM_ORIGINAL', 'PREMIUM_ADDITIONAL', 'PREMIUM_RETURN')
#and jli.jliType = 'PREMI... |
-- resmgr-resource-plans.sql
-- resource plans
@clears
@resmgr-columns
@resmgr-setup
col DB_MODE format a8
@legacy-exclude
--spool resource_plans.txt
prompt
prompt Legacy Plans
prompt
select plan, sub_plan, cpu_method, status from dba_rsrc_plans order by 1;
prompt
prompt CDB Plans
prompt
-- union all used to ... |
insert into dict_priority(id, description) values
(1, 'Niski'),
(2, 'Średni'),
(3, 'Wysoki');
insert into dict_status(id, description) values
(1, 'Nowy'),
(2, 'Realizowany'),
(3, 'Oczekujący'),
(4, 'Zamknięty');
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 25, 2019 at 10:26 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 08, 2015 at 12:34 AM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
DROP TABLE IF EXISTS messages;
CREATE TABLE messages(
message_id INTEGER PRIMARY KEY AUTOINCREMENT,
message_from INTEGER NOT NULL,
message_to INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
content TEXT NOT NULL
);
DROP TABLE IF EXISTS users;
CREATE TABLE users(
user_id INTEGER PRIMAR... |
create database ass3
create table takes(
ID int,
course_id varchar(20),
sec_id varchar(20),
semester int,
year int,
grade float,
primary key(ID,course_id,sec_id,semester,year)
)
create table student(
ID int,
name varchar(20),
dept_name varchar(20),
tot_cred varchar(9),
primary key(dept_name),
foreign key(ID) references... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Сен 20 2017 г., 08:08
-- Версия сервера: 5.5.53
-- Версия PHP: 7.0.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
SELECT titre
AS 'Titre', resum
AS 'Resum', annee_prod
FROM film
INNER JOIN genre ON film.id_genre = genre.id_genre
WHERE genre.nom = 'erotic'; |
-- This SQL is the transaction history report for a user.
SELECT ISNULL(t.TransactionNumber, '') as TransactionNumber,
ISNULL(t.RequestType, '') as RequestType,
ISNULL(t.LoanAuthor, '') as Author,
ISNULL(t.LoanTitle, '') as Title,
-- ISNULL(t.LoanPublisher, '') as Publisher,
-- ISNULL(t... |
CREATE TABLE `field_of_studies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`field_of_studies_name` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;
INSERT INTO `field_of_studies` VALUES (null, 'Advertising / Media');
INSERT INTO `field_of_studies` VALUES (... |
insert into ADVISOR (ID, NAME) VALUES ('0001','0001');
insert into ADVISOR (ID, NAME) VALUES ('0002','0002');
insert into ADVISOR (ID, NAME)VALUES ('0003','0003');
insert into ADVISOR (ID, NAME)VALUES ('test','test');
insert into MODEL (ID, ADVISOR_ID, CASH_HOLDING_PERCENTAGE, DESCRIPTION, DRIFT_PERCENTAGE, MODEL_TYPE... |
SELECT
b.`uri` AS uri,
b.`name` AS name,
b.`user` AS user,
b.`username` AS username,
b.`password` AS password
FROM `brokers` b
INNER JOIN `clients` c ON c.`broker` = b.`uri`
WHERE b.`user` = ?
AND c.`uuid` = ?
LIMIT 0,1; |
/*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.5.5-10.1.13-MariaDB : Database - jobs
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIG... |
# + 号的作用:
# 两个操作都为数值型,则做加法运算
SELECT 100 + 98; // 198
SELECT '123' + 90; // 213
SELECT 'jhon' + 90; // 90
# 拼接字符串
SELECT CONCAT(last_name, ',', first_name,',',IFNULL(commission_pct,0)) AS out_put FROM employees;
# 条件查询
SELECT * FROM employees WHERE salary>12000;
SELECT last_name, department_id FROM employees WHERE de... |
/****** Object: StoredProcedure [dbo].[prc_CWI_SetPortalAccess] Script Date: 9/10/2014 8:29:49 PM ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_SetPortalAccess]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[prc_CWI_SetPortalAccess]
GO
/****** Object: StoredProcedu... |
/*
Table:campaign
+-----+---------------+-------------+--------+------+------------+
|date | campaign_name | impressions | clicks | cost | conversion |
+-----+---------------+-------------+--------+------+------------+
Table:revenue
+-----+---------------+-------------+
|date | campaign_name | revenue |
+-----+-... |
# Write your MySQL query statement below
update salary
set sex = IF(sex = 'm', 'f', 'm')
# Success
# Details
# Runtime: 524 ms, faster than 15.71% of MySQL online submissions for Swap Salary.
# Memory Usage: 0B, less than 100.00% of MySQL online submissions for Swap Salary. |
create database admin_database;
use admin_database;
create table Admin (
UserName varchar(30) not null,
Passwrd varchar(30) not null,
PRIMARY KEY (UserName)
);
insert into Admin (UserName, Passwrd) values ('jack', '1234');
insert into Admin (UserName, Passwrd) values ('evan', 'abcd');
insert into Admin... |
select * from DBA_SCHEDULER_RUNNING_CHAINS;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mer. 02 sep. 2020 à 16:51
-- Version du serveur : 10.4.11-MariaDB
-- Version de PHP : 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
CREATE DATABASE IF NOT EXISTS wordpress;
|
-- Here we are creating a new user called 'web2data' and setting a password of 'nmit'.
GRANT SELECT, INSERT, UPDATE, DELETE
ON web2data.*
TO 'web2user'
IDENTIFIED BY 'nmit';
-- The following statement updates the MySQL cache to reflect any changes you have made. (More secure)
FLUSH PRIVILEGES; |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 22, 2019 at 06:16 PM
-- Server version: 5.7.26-0ubuntu0.16.04.1
-- PHP Version: 7.2.19-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
CREATE VIEW S_WA_SELL_APARTMENT_ROLLS
AS
SELECT R.ROLL_ID,
R.DATE_BEGIN,
R.DATE_END,
OP.NAME AS OPERATION_NAME,
V.NAME AS VIEW_NAME,
T.NAME AS TYPE_NAME,
AOP.*
FROM ROLLS R
JOIN OBJECTS O ON O.OBJECT_ID=R.OBJECT_ID
JOIN OPERATIONS OP ON OP.OPERATION_ID=R.OPERATION_ID
JOIN VIEWS V ON V.VIEW... |
delete
from bids
where item_id=9876543210;
delete
from items
where item_id=9876543210; |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: sql112.epizy.com
-- Creato il: Ott 25, 2020 alle 06:28
-- Versione del server: 5.6.48-88.0
-- Versione PHP: 7.2.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
Create View V_DS_TypeMaster_v8
as
select DS.SalesManID as DSID,DSTM.DSTypeID as DSTID,DSTM.DSTypeValue , DSTM.DSTypeCode as DS_type_code
from salesman DS ,DSType_Master DSTM,DSType_Details DSTD
where DSTM.active=1 and DSTM.DSTypeID=DSTD.DSTypeID and
DSTD.SalesManID=DS.SalesManID and
DS.Active = 1 and
DSTD.SalesManID ... |
SELECT COUNT(1) FROM USER WHERE LOGIN = ? |
alter table WHEREISMYMONEYLEBOVSKIY_LETTER_BASE drop column DEBITOR_ID__U19117 cascade ;
|
select * from telemedicine.studentinfo where age=20; |
DROP DATABASE IF EXISTS employee_TrackerDB;
-- ↓ Creates the "employee_TrackerDB" database --
CREATE database employee_TrackerDB;
-- ↓ Makes it so all of the following code will affect "employee_TrackerDB" --
USE employee_TrackerDB;
-- ↓ Creates the table "department" within animals_db --
CREATE TABLE department (
-... |
SELECT SKIP 30 LIMIT 11 * FROM PERSONS_PIPE_DATETIME_1; |
INSERT INTO office (department) VALUES
("Sales"),
("Finance"),
("Janitorial"),
("Engineering");
INSERT INTO role (title, salary, department_id) VALUES
("SalesPerson", 80000, 1),
("Accountant", 120000, 2),
("Janitor", 18000, 3),
("Engineer", 150000, 4);
INSERT INTO employee (first_name, last_name, role_id) VALUES
("... |
-- ex28_account.sql
/*
계정
- DCL
- 계정 생성, 수정, 삭제
- 리소스 접근 권한 제어
사용자 계정 생성하기
- 시스템 권한을 가지고 있는 계정만 가능하다.
- 관리자만 가능(system, 관리자 권한 부여받은 계정)
- 계정 생성 권한을 가지는 일반 계정
create user 계정명 identified by 암호;
- 암호 변경/ 잠금언락, 락
alter user 계정명 identified by 암호;
alter user 계정명 account unlock;
alter user 계정명 account lock;
- 계... |
/* Создание процедуры обработки результата водитель прибыл */
CREATE PROCEDURE /*PREFIX*/PR_ARRIVAL_DRIVER
(
ORDER_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32)
)
AS
DECLARE PHONE VARCHAR(100);
DECLARE DRIVER_ID VARCHAR(32);
DECLARE COST_RATE NUMERIC(15,2);
DECLARE COLOR VARCHAR(100);
DECLARE BRAND VARCHAR(100)... |
-- avg age:
DROP VIEW IF EXISTS avg_age CASCADE;
CREATE VIEW avg_age AS
SELECT round(AVG(age), 5) FROM students;
-- percent male:
DROP VIEW IF EXISTS percent_male CASCADE;
CREATE VIEW percent_male AS
SELECT cast((SELECT count(*) FROM students WHERE gender='m') as float) / (SELECT count(*) FROM students) as percent_ma... |
SET FOREIGN_KEY_CHECKS = 0;
CREATE OR replace SCHEMA vet_clinic;
USE vet_clinic;
CREATE TABLE `cash_flow` (
`cfid` INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
`date` DATETIME NOT NULL,
`amount` INT NOT NULL,
`type` VARCHAR(128) NOT NULL
);
CREATE TABLE `employees` (
`employeeID` INT UNIQUE PRIMARY KEY NOT NUL... |
insert into posting_location values (4, 1);
insert into posting_location values (4, 2);
insert into posting_location values (4, 3);
insert into posting_location values (4, 5);
insert into posting_location values (5, 1);
insert into posting_location values (5, 2);
insert into posting_location values (5, 3);
ins... |
.system echo "Inside script <create_suppliers.sql>"
.system echo "Dropping then creating Suppliers.sql"
DROP TABLE IF EXISTS Suppliers;
CREATE TABLE Suppliers(
supplier_id INTEGER PRIMARY KEY AUTOINCREMENT,
product_type INT,
company_name STRING,
phone INT,
postcode STRING
); |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-07-2019 a las 20:55:36
-- Versión del servidor: 10.3.16-MariaDB
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
insert into genres(id, name)
values (1, 'genre1'),
(2, 'genre2');
update books set genre_id=2 where id=1;
update books set genre_id=1 where id=2
|
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 13, 2020 at 08:56 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
Create Procedure sp_get_CustomFormat (@TransactionName nvarchar(255))
As
Select PrintID, PrintFileName, DefaultFileName From CustomPrinting
Where TransactionName = @TransactionName
|
# I am going to adopt the protocol that tables with names ending in a digit are processed versions
# and ones without are the original raw data
use janice;
# this table regularizes the timestamp as `date_time`, omitting the `date`
# and `epoch_time` fields.
CREATE TABLE `insulin_carb_2` (
`user` varchar(20) NOT NU... |
CREATE USER root PASSWORD 'root'
ALTER USER root ADMIN TRUE |
#Lab | SQL Queries 8
#1. Rank films by length (filter out the rows that have nulls or 0s in length column). In your output,
#only select the columns title, length, and the rank.
select title, length, rank() over(order by length) as Rank_length from sakila.film
where isnull(length)=0 and length>0;
#2. Rank films by... |
DROP TABLE IF EXISTS syn_trips;
CREATE TABLE syn_trips (
uid serial PRIMARY KEY,
o_uid integer,
d_uid integer,
dist real,
geom geometry(LINESTRING,4326)
);
COPY syn_trips (o_uid,d_uid,dist)
FROM '/home/nate/bike-map/demand/data/syn-trips.csv' CSV HEADER;
WITH sub AS (
SELECT
t.uid,
ST_Transform(ST_MakeL... |
# 26. Delete todos os dados em que a `unit_price` da tabela `order_details` seja maior que 10.0000.
DELETE FROM northwind.order_details WHERE unit_price > 10.0000;
|
/* Create DB */
CREATE DATABASE IF NOT EXISTS `company` DEFAULT CHARACTER SET utf8;
/*Use DB */
USE `company`;
/*Table structure for table `members` */
CREATE TABLE `members` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`first_name` varchar(60) DEFAULT NULL,
`last_name` varchar(60) DEFAULT NULL,
... |
/*
Find the number of users from New York (i.e., users whose location is the string "New York").
*/
SELECT COUNT(*)
FROM Seller, Location
WHERE Seller.locationID = Location.locationID
AND Location.location = "New York"; |
#select * from airport;
#select * from flight;
#select * from ticket;
#select * from user;
use Airline;
#User:
#p123
INSERT INTO USER(user_name, password, first_name, last_name, registration_date, role, blocked, deleted)
VALUES('pekip', '46bf36a7193438f81fccc9c4bcc8343e', 'Petar', 'Petrović', '2018-12-03', 'ADMIN... |
INSERT INTO `feature_callbacks` (`id`,`symbol`,`type`,`value`) VALUES (?,?,?,?); |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.9)
# Database: api
# Generation Time: 2018-04-21 17:14:41 +0000
# ****************************************************... |
CREATE TABLE rebus (
id uuid NOT NULL PRIMARY KEY,
nr int NOT NULL,
hint varchar NOT NULL,
answer varchar NOT NULL
);
CREATE TABLE teams (
id uuid NOT NULL PRIMARY KEY,
name varchar NOT NULL,
secret varchar NOT NULL
);
CREATE TABLE unlocks (
id uuid NOT NULL PRIMARY KEY,
... |
CREATE DATABASE IF NOT EXISTS template DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
use template;
DROP TABLE IF EXISTS t_template;
CREATE TABLE t_template(
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '编号',
name varchar(30) NOT NULL COMMENT '姓名',
password varchar(50) NOT NULL COMMENT '密码'
) ENGINE = InnoDB DEF... |
/*New TAble sub*/
with sub as(select (c.FirstName ||' '||c.LastName) customers, c.Country country, sum(i.total) amt_spent
from Invoice i
join Customer c
on c.CustomerId = i.CustomerId
group by customers
order by amt_spent desc)
select sub.country country, sub.customers customers, sub.amt_spent amt_spent
fro... |
---***1.- CREATE A QUERY THAT RETURNS THE LAST NAME OF THE EMPLOYEES THAT DOESN'T HAVE EMPLOYEES IN THEIR ASSIGNMENT LIST,
---(NO MANAGERS)
SELECT E.LAST_NAME
FROM EMPLOYEES E
WHERE E.EMPLOYEE_ID NOT IN(SELECT DISTINCT(MANAGER_ID)
FROM EMPLOYEES
WHER... |
INSERT INTO tb_provincia (id, descricao, pais) VALUES
(1, 'Buenos Aires', 'ARGENTINA'),
(2, 'Catamarca', 'ARGENTINA'),
(3, 'Chaco', 'ARGENTINA'),
(4, 'Chubut', 'ARGENTINA'),
(5, 'C�rdoba', 'ARGENTINA'),
(6, 'Corrientes', 'ARGENTINA'),
(7, 'Entre R�os', 'ARGENTINA'),
(8, 'Formosa', 'ARGENTINA'),
(9, 'J... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 16, 2018 at 12:49 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 01 Jul 2018 pada 21.41
-- Versi Server: 10.1.26-MariaDB
-- PHP Version: 7.0.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- DAY4 수업내용
-- JOIN : 두개의 테이블을 하나로 합쳐서 결과를 조회
/*
하나 이상의 테이블에서 데이터를 조회하기 위해 사용하고 결과는 하나의 RESULT SET으로 나온다.
관계형 데이터베이스에서 SQL을 이용해 테이블간 '관계'를 맺는 방법
관계형 데이터베이스는 최소한의 데이터를 테이블에 담고 있어(중복을 최소화해서)
원하는 정보를 테이블에서 조회하려면 한 개 이상의 테이블에서 데이터를 읽어와야 되는 경우가 많다.
이때, 무작정 데이터르 가져오는게 아닌 테이블간 연결고리로 관계를 맺어진 데이터를 추출... |
CREATE DATABASE oshiete_karen DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE user (
id MEDIUMINT unsigned NOT NULL AUTO_INCREMENT,
mid VARCHAR(36) NOT NULL,
name VARCHAR(36) NOT NULL, -- LINEの名前って何バイトまでだっけ
google_credentials_json TEXT,
PRIMARY KEY (`id`)
);
ALTER TABLE user
MODIFY COLUMN... |
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 26-06-2020 a las 15:29:35
-- Versión del servidor: 5.6.48-cll-lve
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
-- CreateTable
CREATE TABLE "Product" (
"id" SERIAL NOT NULL,
"code" TEXT NOT NULL,
"name" TEXT NOT NULL,
"cover" TEXT DEFAULT E'',
"unity" TEXT NOT NULL,
"isActive" BOOLEAN DEFAULT true,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
... |
DROP TABLE DOCUMENTS
--
CREATE TABLE /*PREFIX*/TASK_DOCUMENTS
(
TASK_DOCUMENT_ID VARCHAR(32) NOT NULL,
TASK_ID VARCHAR(32) NOT NULL,
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
DOCUMENT_TYPE INTEGER NOT NULL,
DATE_DOCUMENT DATETIME NOT NULL,
DOCUMENT IMAGE NOT NULL,
EXTENSION VARCHAR(100) ... |
*********安装*************
**需要gcc
make
cd src
**启动服务
./redis-server
**启动客户端
./redis-cli
set name zenglinxin
get name
数据库文件
./redis-3.2.1/src/dump.rdb
*********配置**********************
./redis-server -h
./redis-server /bak/rd/redis-3.2.1/myredis.conf
***在13.135的机器上起了redis-server,配置如下则报错如下
bind ... |
use SkillBeeDB;
select * from registration
create table adminLogin
(
AdminId int identity(1,1) not null,
AdminUserID varchar(20) not null,
Pass varchar(20) not null
);
select * from adminLogin;
insert into adminLogin values ('spark', 'andromida');
select * from feedBack;
select count(AdminI... |
insert into users(username, first_name, last_name, email, password, company, status_id)
values ( $1, $2, $3, $4, $5, $6, 1 )
returning *
; |
-- phpMyAdmin SQL Dump
-- version 4.6.5.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Feb 27, 2017 at 07:51 AM
-- Server version: 5.6.34
-- PHP Version: 7.1.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
/* Query to see an NPC's loot tables */
SELECT npc.name, lte.*, lde.chance, lde.multiplier, i.Name
FROM npc_types npc
INNER JOIN loottable_entries lte ON npc.loottable_id = lte.loottable_id
INNER JOIN lootdrop_entries lde ON lte.lootdrop_id = lde.lootdrop_id
INNER JOIN items i ON lde.item_id = i.id
WHERE npc.name LIKE ... |
#DROP TABLE IF EXISTS `stk_suspend`;
CREATE TABLE `stk_suspend` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ts_code` varchar(20) NOT NULL COMMENT 'TS代码',
`suspend_date` varchar(8) DEFAULT NULL COMMENT '停牌日期',
`resume_date` varchar(8) DEFAULT NULL COMMENT '复牌日期',
`ann_date` varchar(8) DEFAULT NULL COMMENT '公告日期'... |
-- 10.1
create schema beach;
-- 10.2
-- varchar should be replaced by text because there is no performance difference in Postgres.
create table beach.customers(
first_name varchar(100),
last_name varchar(100),
email varchar(100),
phone_number varchar(32),
date_created date
);
-- 10.3
-- varchar shou... |
INSERT INTO todo (id, username, description, target_date, done)
VALUES (100, 'lucas', 'Learn React', sysdate(), false);
INSERT INTO todo (id, username, description, target_date, done)
VALUES (101, 'lucas', 'Learn Redux', sysdate(), false);
INSERT INTO todo (id, username, description, target_date, done)
VALUES (102, '... |
drop table if exists t_todo;
create table t_todo(
todo_id varchar(36) primary key,
todo_title varchar(30),
finished boolean,
created_at timestamp
);
insert into t_todo values(random_uuid(),'title',false,current_timestamp);
commit; |
create database if not exists it_system;
use it_system;
create table if not exists team_lead
(id int primary key,
name varchar(30) not null,
surname varchar(40) not null,
age int
);
create table if not exists team
(id int primary key,
name varchar(30) not null,
size int not null,
class int,
team_lead_id int,
constrai... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 09, 2020 at 09:14 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
USE biblioteca;
CREATE TABLE IF NOT EXISTS `Usuario` (
`matricula` VARCHAR(8) NOT NULL,
`nomeUsuario` VARCHAR(45) NULL,
`curso` INT NULL,
`login` VARCHAR(15) NULL,
`senha` VARCHAR(15) NULL,
PRIMARY KEY (`matricula`),
INDEX `curso_idx` (`curso` ASC),
CONSTRAINT `curso`
FOREIGN KEY (`curso`)
REFE... |
create table analytics_view (
country text,
city text,
departure datetime,
middestination text,
arrival datetime,
carrier_one text,
carrier_two text,
price real,
ret_departure datetime,
ret_middestination text,
ret_arrival datetime,
ret_carrier_one text,
ret_carrier_two text,
ret_price real... |
-- 21.08.2009 13:12:04 EEST
-- Requisition Improvements
INSERT INTO AD_Column (AD_Column_ID,IsParent,AD_Client_ID,AD_Org_ID,IsAutocomplete,AD_Table_ID,Help,FieldLength,Created,CreatedBy,Updated,Version,IsActive,Description,ColumnName,IsKey,AD_Reference_ID,IsTranslated,IsMandatory,IsIdentifier,SeqNo,IsSelectionColumn,... |
CREATE TABLE review_votes(
record_type text,
business_id text not null,
user_id text not null,
stars real,
text text,
date date,
vote_type text,
count real
);
CREATE TABLE business_categories(
record_type text,
business_id text not null,
name text,
full_address text,
city text,
state text,
... |
-- Created by Vertabelo (http://vertabelo.com)
-- Last modification date: 2021-02-06 12:29:43.214
-- tables
-- Table: Computers
CREATE TABLE Computers (
id int NOT NULL IDENTITY,
model nvarchar(30) NOT NULL,
Ram int NOT NULL,
Disc int NOT NULL,
Gpu nvarchar(200) NULL,
customer_note nvarcha... |
alter table matunid add column m61_codigotribunal varchar(5) default null;
alter table pcorcamval add column pc23_bdi numeric;
alter table pcorcamval add column pc23_encargossociais numeric;
-- Atributo dinâmico Tipo de Orçamento da Licitação
insert into db_cadattdinamicoatributos values
(nextval('db_cadattdinami... |
DROP SCHEMA IF EXISTS lotterydb;
CREATE SCHEMA lotterydb CHARACTER SET utf8 COLLATE utf8_general_ci;
create table lotterydb.le_play
(
id char(36) not null
primary key,
post_time datetime default CURRENT_TIMESTAMP not null,
put_time datetime default CURRENT_TIMESTAMP not null,
name varchar(32) default '' not nul... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 25, 2020 at 05:52 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
DROP TABLE IF EXISTS EMPLOYEES;
CREATE TABLE EMPLOYEES
(
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(250) NOT NULL,
last_name VARCHAR(250) NOT NULL,
email VARCHAR(250) DEFAULT NULL,
salary DECIMAL(20, 2) DEFAULT NULL,
start_date DATE DEFAULT NULL
);
|
use bnb_hive_db;
insert overwrite table bnb_data_FactOrderInfo
partition(d = '${zdt.addDay(-1).format("yyyy-MM-dd")}')
select a.orderid as orderid
, a.orderdate as ordertime
, a.uid as uid
, null as vid
, a.clientid as clientid
, a.hotel as productid
, case when a.ui... |
DROP TABLE IF EXISTS `storage_products`;
CREATE TABLE `storage_products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`storage_id` int(11) DEFAULT NULL,
`product_id` int(11) DEFAULT NULL,
`number` int(11) DEFAULT 0,
`remark` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEF... |
/*
Navicat Premium Data Transfer
Source Server : mysql-8.0数据库
Source Server Type : MySQL
Source Server Version : 80017
Source Host : localhost:3306
Source Schema : scenicticket
Target Server Type : MySQL
Target Server Version : 80017
File Encoding : 65001
Date: 11/04... |
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2016 年 05 月 30 日 08:29
-- 服务器版本: 5.0.51
-- PHP 版本: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- 数据库: `blog`
--
-- --------------------------------------------------------
--
-- 表的结构 `blog_blog`
--
CREATE TA... |
CREATE OR REPLACE FUNCTION parsepair(org_str CLOB,
balance VARCHAR2 DEFAULT '=',
pairend VARCHAR2 DEFAULT ',') RETURN table_kv_pair AS
-- Author : wxh
-- Created : 2011-8-22 15:03:16
-- Purpose : 字符串序列化
colu table_kv_pair;
str CLOB; ... |
ORA-00054资源正忙的解决办法
select session_id from v$locked_object;
SESSION_ID
----------
142
SELECT sid, serial#, username, osuser FROM v$session where sid = 142;
SID SERIAL# USERNAME OSUSER
---------- ---------- ------------------------------ ------------------------------
142 38 SCOTT LILWEN
ALTER SYSTEM KILL SESSION '142,3... |
select distinct Users.Name from Users
inner join Groups_Users on Groups_Users.User_id = Users.id
inner join Groups on Groups.id = Groups_Users.Group_id;
select distinct Users.Name from Users
inner join Groups_Users on Groups_Users.User_id = Users.id
inner join Groups on Groups.id = Groups_Users.Group_id
inner join Eve... |
-- redo-rate.sql
-- show real time redo rates
-- Jared Still jkstill@gmail.com
-- 2020
--
col metric_unit format a30
col metric_name format a30
col value format 999,999,999,999
set linesize 200 trimspool on
set pagesize 100
select * from V$SYSMETRIC_HISTORY where metric_name = 'Redo Generated Per Sec' order... |
# Oefening 2:
# Toon de naam van alle landen
SELECT `Name` FROM `country` (239)
# Toon de naam, district en populatie van alle steden
SELECT `Name`,`District`,`Population` FROM `city` (4,079)
# Toon de naam en staatshoofd van alle landen
SELECT `Name`,`HeadOfState` FROM `country` (239)
# Toon de unieke districten van ... |
CREATE TABLE dbo.ForecastingTree
(
Id int NOT NULL IDENTITY (1, 1),
Name nvarchar(50) NOT NULL,
UserRef uniqueidentifier NOT NULL,
Created datetime NOT NULL,
Updated datetime NOT NULL,
IsDeleted bit NOT NULL
) ON [PRIMARY]
|
DROP TABLE IF EXISTS pages; |
-- upgrade --
CREATE TABLE IF NOT EXISTS "file" (
"id" SERIAL NOT NULL PRIMARY KEY,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
"path" VARCHAR(1000) NOT NULL
);
COMMENT ON COLUMN "file"."id" IS 'Identifier field';
COMMENT ON... |
# 1. 테이블 생성
CREATE TABLE `company` (
`id` int NOT NULL AUTO_INCREMENT primary key,
`name` varchar(32) NOT NULL,
`business` varchar(16) NOT NULL,
`scale` varchar(8) NOT NULL,
`headcount`int NOT NULL,
`createdAt`timestamp DEFAULT CURRENT_TIMESTAMP,
`updatedAt`timestamp DEFAULT CURRENT_TIMESTA... |
INSERT INTO tbl_currency(id, name, symbol, rank) VALUES(1, 'Bitcoin', 'BTC', 1)
INSERT INTO tbl_currency(id, name, symbol, rank) VALUES(2, 'Litecoin', 'LTK', 2)
INSERT INTO tbl_currency(id, name, symbol, rank) VALUES(3, 'Ethereum', 'ETH', 3)
INSERT INTO tbl_quotes(id, name, symbol, price, last_update, currency_id) VA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.