text stringlengths 6 9.38M |
|---|
/*
3.编写sql语句实现向新闻表中插入数据
(ID,新闻标题,作者,新闻内容,发布时间,点击次数)
*/
insert into `news` (title,author,content,times)
values(1,'重大新闻','中原一点红','我就是内容',25000);
insert into `news` (id,title,author,content,times)
values(2,'重大新闻2','中点红','我就最大的人',5000); |
-- MySQL dump 10.13 Distrib 8.0.23, for Win64 (x86_64)
--
-- Host: localhost Database: youcredit
-- ------------------------------------------------------
-- Server version 8.0.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 22, 2017 at 06:05 PM
-- Server version: 5.5.54-0ubuntu0.14.04.1
-- PHP Version: 5.6.30-7+deb.sury.org~trusty+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2018-02-06 12:41:09
-- 服务器版本: 5.7.21
-- PHP Version: 7.0.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
insert into list_name (name) values ('Shopping');
insert into list_name (name) values ('Tasks');
insert into list_name (name) values ('Chores');
insert into item (item_action, item_name) values ('Apples','Buy');
insert into item (item_action, item_name) values ('Peaches', 'Buy');
insert into item (item_action, item_nam... |
CREATE TABLE TEST.USERS (
ID INT NOT NULL AUTO_INCREMENT,
USER_NAME VARCHAR(255) NOT NULL,
USER_AGE INT(11) NOT NULL,
isAdmin TINYINT(1),
createdDate TIMESTAMP,
PRIMARY KEY (ID));
|
create database if not exists social_network;
use social_network;
create table if not exists user(
user_id int auto_increment primary key,
user_name varchar(30) not null,
user_surname varchar(50) not null,
user_age tinyint unsigned
);
create table if not exists account(
account_id int primary key,
login varchar(20) ... |
/*
Navicat MySQL Data Transfer
Source Server : myDB
Source Server Version : 50719
Source Host : localhost:3306
Source Database : incognito
Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2018-03-26 11:35:58
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
create database MovieDB
create table Movie
(
MID int primary key identity(1,1),
MovieImage varchar(200),--用来 但是只在SQL里面 WinForm未使用
MovieName Nvarchar(200),--影片名
MainPerformer Nvarchar(100),--主演
MovieTypeId varchar(20),--类型
Area nvarchar(10),--地区
TimeLength varchar(20),--时长
OnTime date,--上映时间
... |
DROP TABLE IF EXISTS votes;
DROP TABLE IF EXISTS menu;
DROP TABLE IF EXISTS restaurants;
DROP TABLE IF EXISTS users;
DROP SEQUENCE IF EXISTS global_seq;
CREATE SEQUENCE global_seq START 100000;
CREATE TABLE users
(
id INTEGER PRIMARY KEY DEFAULT nextval('global_seq'),
name VARCHAR NOT NULL,
... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 10 oct. 2018 à 02:10
-- Version du serveur : 5.7.19
-- Version de PHP : 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
--
-- Database: `osp_social`
--
-- --------------------------------------------------------
--
-- Table structure for table `company`
--
CREATE TABLE IF NOT EXISTS `company` (
`id` int(10) unsigned NOT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`status` enum('active','inactive','cancel') COLLA... |
/* https://www.hackerrank.com/challenges/draw-the-triangle-2/problem
Let us walk through the intution behind the solution...as we need to print the pattern ,we gotta use a loop
but wait ! do we have loops in sql? yeah ! we do have loops in sql but not "for" loop
we have only while loop ,and how do we solve this then... |
CREATE Procedure sp_get_schemeIDItems
(@ItemCode as nvarchar (30),
@Serverdate as DATETIME,
@QUANTItY as Decimal(18,6),
@AMTTYPE as INT,
@PERTYPE as INT,
@CustomerId as... |
-- awr-top-10-daily.sql
-- list top 10 events per day from AWR
-- event count is multiplied by 10 due to 10 second snapshot
@clears
set linesize 200 trimspool on
set pagesize 100
break on workday skip 1
with data as (
select trunc(sample_time) workday, event, count(*) * 10 event_count
from dba_hist_active_sess_hi... |
CREATE PROCEDURE expressionsVerification()
BEGIN
SELECT *
FROM expressions
WHERE (operation='+' AND c=a+b)
OR(operation='-' AND c=a-b)
OR(operation='/' AND c=a/b)
OR(operation='*' AND c=a*b);
END
|
SELECT henkilo.henkilo_id, henkilo.sukunimi, henkilo.etunimi, mittaus.mittaus_id, mittaus.pituus, mittaus.paino
FROM henkilo, mittaus
WHERE henkilo.henkilo_id = mittaus.mittaus_id |
-- MySQL dump 10.16 Distrib 10.1.37-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: vc_anticheat
-- ------------------------------------------------------
-- Server version 10.1.37-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... |
CREATE TABLE if not exists dws.dws_report_revenue_history (
create_date TIMESTAMP,
company_name STRING,
product_type STRING COMMENT '产品类型',
product_name STRING,
product_name_c STRING,
is_overtime STRING COMMENT '是否超期',
fk_amount double COMMENT '当日放款金额',
m_fk_amount double COMMENT '当月放款金额',
net_charge_... |
-- MySQL dump 10.16 Distrib 10.1.48-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: books
-- ------------------------------------------------------
-- Server version 10.1.48-MariaDB-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... |
create table if not exists task(
taskId binary(20) not null,
taskDueDate datetime,
taskDescription varchar(256),
taskPriority varchar(64) not null,
taskStartDate datetime,
taskStatus varchar(64) not null,
taskTitle varchar(225) not null,
unique(taskId),
INDEX(taskTitle),
primary key(taskId)
)
SELECT tw... |
CREATE TABLE User(
user_ID INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(50),
PRIMARY KEY (user_ID)
);
CREATE TABLE Workout(
date_completed TIMESTAMP,
user_ID INTEGER NOT NULL,
type VARCHAR(50), /*textual description of workout eg squats*/
duration INTEGER (3), /*store minutes, convert to HH:MM... |
# Users schema
# --- !Ups
CREATE TABLE users (
id bigserial,
email varchar(255) NOT NULL,
password varchar(255) NOT NULL,
primary key(id)
);
create TABLE accounts (
id bigserial,
user_id bigint NOT NULL,
user_name varchar(255) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY ... |
Create Procedure Sp_Recd_WDGSTINCount
As
Begin
select Count(*) NoOfWDGSTIN From Recd_WDStateCode Where Isnull(Status,0) = 1
Update Recd_WDStateCode Set Status = 32 Where Isnull(Status,0) = 1
End
|
-- MySQL dump 10.13 Distrib 8.0.28, for Win64 (x86_64)
--
-- Host: 192.168.219.103 Database: shxdb
-- ------------------------------------------------------
-- Server version 8.0.28
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... |
CREATE TABLE `reward_points_converted` (
`rew_convert_id` int(10) NOT NULL AUTO_INCREMENT,
`rew_convert_ord_detail_fk` int(10) NOT NULL DEFAULT '10',
`rew_convert_discount_fk` varchar(50) NOT NULL DEFAULT '',
`rew_convert_points` int(10) NOT NULL DEFAULT '10',
`rew_convert_date` datetime NOT NULL DEFAULT '000... |
CREATE VIEW [V_Sub_Channel_Type]
([SubChannel_Type_ID],[SubChannel_Type_Name],[Active])
AS
SELECT SubChannelID, Description, Active
FROM SubChannel
|
CREATE TABLE sdbase.arjis_crimetype (
crimetype_id int4 NOT NULL DEFAULT nextval('sdbase.arjis_crimetype_crimetype_id_seq'::regclass),
description varchar(150) NULL,
modified_date date NOT NULL DEFAULT 'now'::text::date,
CONSTRAINT arjis_crimetype_pkey PRIMARY KEY (crimetype_id)
)
WITH (
OIDS=FALSE
) ;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Май 30 2020 г., 21:54
-- Версия сервера: 5.7.25
-- Версия PHP: 7.2.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
drop table if exists vm;
create table vm (
pkID integer primary key autoincrement
,product text
,is_primary text
,name text
,ip_address text
,ip_mask text
,ip_gateway_address text
,primary_dns text
,secondary_dns text
,domain text
,region text
,time_zone text
,fkID_ucs integer
,fkID_created_... |
ALTER TABLE tb_user_extra ADD pay_use_count int(11) not Null DEFAULT 0 COMMENT '付费功能使用次数(针对vip客户,除去免费的6次外,其它的加总)';
-- 创建bom总表
CREATE TABLE IF NOT EXISTS `tb_user_bom` (
`id` int(11) NOT NULL AUTO_INCREMENT comment 'BOM id',
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '用户id',
`bom_name` varchar(256) not null DEFAULT... |
-- DLS20161111
INSERT INTO core_plugin_param_value(
fkplugin, paramname, paramvalue)
VALUES
((select id from core_plugin where pluginname='deleterecordv100_inner_home_crm_delete_record'),
'mclasses+delpacketrec','corecrmavailablepacket'),
((select id from core_plugin where plug... |
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `to_do`;
CREATE TABLE `to_do` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'task id',
`description` varchar(500) NOT NULL COMMENT 'task description',
P... |
BEGIN TRANSACTION;
ALTER TABLE profile
ADD COLUMN IF NOT EXISTS migrating_licenseplate VARCHAR(32);
END TRANSACTION;
|
/*
Navicat MySQL Data Transfer
Source Server : baidu
Source Server Version : 50554
Source Host : 180.76.165.224:3306
Source Database : edaixitest
Target Server Type : MYSQL
Target Server Version : 50554
File Encoding : 65001
Date: 2017-05-28 14:45:19
*/
SET FOREIGN_KEY_CHECKS=0;
... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 16, 2019 at 03:41 PM
-- Server version: 5.7.19
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
create or replace TRIGGER MODIFIER_FOURNIR
INSTEAD OF UPDATE ON VIEW_FOURNIR
REFERENCING OLD AS A NEW AS N
FOR EACH ROW
BEGIN
if to_char(:n.histodate, 'DD/MM/YY') = to_char(sysdate, 'DD/MM/YY') then
modification_fournir(:n.prodnum, :n.histodate, :n.proprix, :n.seuil);
end if;
END; |
/****** Object: StoredProcedure [dbo].[prc_CWI_GetDashboardBudgetDivisionDetails] Script Date: 6/27/2013 6:26:49 PM ******/
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'prc_CWI_GetDashboardBudgetDivisionDetails')
DROP PROCEDURE [dbo].[prc_CWI_GetDashboardBudgetDivisionDetails]
GO
/****** Obj... |
/**
@header patch_63_64_b.sql - cell_type.efo_id
@desc Add Experimental Factor Ontology ID field to cell_type
*/
ALTER table cell_type ADD efo_id varchar(20) default NULL;
ALTER table cell_type ADD UNIQUE KEY `efo_idx`(`efo_id`);
# Is actually only 11 chars long
# patch identifier
INSERT INTO meta (species_id, m... |
/*
CREATE SEQUENCE s START WITH 100 INCREMENT BY 10;
SELECT NEXTVAL('s');
SELECT NEXTVAL('s');
SELECT NEXTVAL('s');
*/
/*
CREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;
SELECT NEXTVAL('s2');
SELECT NEXTVAL('s2');
SELECT NEXTVAL('s2');
*/
/*
CREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10 MINVALUE -100 MAXVALUE... |
/*
Select returns detailed concurent program information from concurrent request id
*/
accept Enter_request_id prompt 'Please enter request_id : ';
SELECT cr.request_id,
re.responsibility_key AS RESPONSIBILITY,
us.user_name,
us.description,
us.email_address ,
cp.concurrent_program_name AS Concurrent_... |
/*
SQLyog Community v13.1.5 (64 bit)
MySQL - 10.4.8-MariaDB : Database - kulturnoumetnickodrustvo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 ... |
#DATABASE FOR GUAM TRAVELOR'S INFORMATION SYSTEM
#Timothy Olchondra
CREATE Database Database_Project;
USE Database_Project;
CREATE TABLE Population (
NameOfArea Char(30) NOT NULL, #Guam will be the name
NumOfPeople Int NOT NULL,
CONSTRAINT Population_PK PRIMA... |
CREATE TABLE usuario(
idusuario INT NOT NULL AUTO_INCREMENT,
NombreCompleto VARCHAR(100) NOT NULL,
UserName VARCHAR(30) NOT NULL,
Contraseña VARCHAR(250) NOT NULL,
Telefono VARCHAR(25) NOT NULL,
Imagen VARCHAR(45) NOT NULL,
idUserRol INT NOT NULL,
PRIMARY KEY (`idusuario`),
FOREIGN KEY fk_rol_id(idU... |
-- TITLE1: Apply Precommit Handlers
-- TITLE2: Displaying the Precommit Handler for Each Apply Process
-- DESC:
COLUMN APPLY_NAME HEADING 'Apply Process Name' FORMAT A15
COLUMN PRECOMMIT_HANDLER HEADING 'Precommit Handler' FORMAT A30
COLUMN APPLY_CAPTURED HEADING 'Applies Captured|Messages?' FORMAT A20
SELECT APPLY_... |
CREATE TABLE ventas(
codpro CONSTRAINT codpro_clave_externa_proveedor REFERENCES proveedor(codpro),
codpie CONSTRAINT codpir_clave_externa_pieza REFERENCES pieza(codpie),
codpj CONSTRAINT codpj_clave_externa_proyecto REFERENCES proyecto(codpj),
cantidad NUMBER(4),
CONSTRAINT clave_primaria PRIMARY KEY (codpro, cod... |
select fecha_incorporacion
from platzi.alumnos
order by fecha_incorporacion desc
limit 1;
select carrera_id, MAX(fecha_incorporacion) as fecha_reciente
from platzi.alumnos
group by carrera_id
order by fecha_reciente
|
-- ash-all-events-5-pct.sql
-- Jared Still 2021
-- jkstill@gmail.com
-- pct_of_db_time column refers to the % of time
-- each event consumed for the duration of the sql execution
col event format a40
set linesize 200 trimspool on
set pagesize 200
col pct_of_db_time format 999.99
with raw_data as (
select inst_id... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 30-11-2020 a las 13:42:42
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS questions;
DROP TABLE IF EXISTS questions_follows;
DROP TABLE IF EXISTS replies;
DROP TABLE IF EXISTS likes;
CREATE TABLE users (
id INTEGER PRIMARY KEY,
fname VARCHAR(50),
lname VARCHAR(50)
);
CREATE TABLE questions (
id INTEGER PRIMARY KEY,
title TEXT,
... |
create database BancoDeDados;
use BancoDeDados;
create table usuarios
(
usuarioId int primary key identity,
usuarioNome varchar(50) not null,
usuarioEmail varchar(50) not null,
usuarioSenha varchar(50) not null
);
select * from usuarios; |
CREATE SCHEMA if NOT EXISTS bfp;
create table bfp.fingerprint
(
id serial8 NOT NULL PRIMARY KEY,
user_id varchar(255) NOT NULL,
user_id_human text NOT NULL,
metrics jsonb NOT NULL DEFAULT '{}',
created_at timestamp NOT NULL DEFAULT (NOW() at time zon... |
CREATE TRIGGER log_fine_details
AFTER INSERT ON finance_fine
FOR EACH ROW
BEGIN
INSERT INTO ledger_finelog(member_id, reason, amount_fined, date_fined)
VALUES(NEW.member_id, NEW.reason, NEW.amount_fined, NEW.date_fined);
END
CREATE TRIGGER log_savings_details
AFTER INSERT ON finance_saving
FOR EACH ROW
BEGIN
INSERT... |
create table trip_guides
(
ASSOCIATION_ID int NOT NULL AUTO_INCREMENT,
TRIP_ID int,
GUIDE_NUM char( 4 ),
PRIMARY KEY(ASSOCIATION_ID)
);
ALTER TABLE trip_guides AUTO_INCREMENT=1;
insert into trip_guides( TRIP_ID, GUIDE_NUM ) values( 1, 'GZ01' );
insert into trip_guides( TRIP_ID, GUIDE_NUM ) values( 1, 'RH01' );
in... |
select prod.*, branch.*
from
(
select lookupid
, sum(regexp_replace(impressionscores[' iv1'], '}$', '')) as iv1
, sum(regexp_replace(impressionscores[' sus'], '}$', '')) as sus
, sum(regexp_replace(impressionscores[' hasus'], '}$', '')) as hasus
, sum(regexp_r... |
col value format 999999
col end_interval_time forma a25
set pagesize 60
-- change value below to '--' for regular report, '' for CSV
def CSVOUT=''
col u_which_format noprint new_value u_which_format
col u_which_clears noprint new_value u_which_clears
select decode('&CSVOUT','--','rpt_format','csv_format') u_which_f... |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- История миграций
create table migration_history (
id serial not null,
date_applied timestamp not null default current_timestamp,
version varchar(12) not null,
notes text null default null,
constraint migration_h... |
prompt PL/SQL Developer import file
prompt Created on 2011年12月5日 by tangzb
set feedback off
set define off
prompt Deleting JSCS005...
delete from JSCS005;
prompt Loading JSCS005...
insert into JSCS005 (de194, de193, jsde907, jsde901, de022, jsde381, jsde017, jsde001, jsde325)
values ('040105', '江南农村商业银行九龙支行', null, nul... |
# Write your MySQL query statement below
SELECT DISTINCT(p1.email) Email
FROM Person p1,
Person p2
WHERE p1.id <> p2.id
AND p1.email = p2.email;
|
CREATE procedure sp_ser_loadchecklistitems(@CheckListItemID Int)
as
Select CheckListItems.CheckListItemID,CheckListItemName
from CheckListItems Where CheckListItems.CheckListItemID = @CheckListItemID
|
SELECT n.patient_id, n.note_id, n.age_at_note_date_in_days as age, n.note_year, t.terms
FROM stride6.notes n
JOIN
(SELECT nid, group_concat(distinct tid separator " ") as terms
FROM stride6.term_mentions
WHERE negated = 0 and familyHistory = 0
GROUP BY nid) as t
ON n.note_id = t.nid;
|
CREATE TABLE `browse_node` (
`browse_node_id` BIGINT(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`browse_node_id`),
UNIQUE `name_browse_node_id` (`name`, `browse_node_id`)
) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
/* Remove the ldap uri field */
alter table BaseAuthenticationConfiguration change BASE_DOMAIN_NAME BASE_DN varchar(1024); |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 24-05-2013 a las 06:17:09
-- Versión del servidor: 5.5.24-log
-- Versión de PHP: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
ALTER TABLE sakila.actor DROP COLUMN middle_name; |
--By Line Total
SELECT OH.inv_no, CONVERT(varchar, CAST(rtrim(inv_dt) AS datetime), 101) AS [Inv Dt.], OH.bill_to_name AS [Customer], item_no AS [Item], item_desc_1, item_desc_2, qty_ordered AS [Lbs], unit_price AS [Cost Per LB], (unit_price * qty_ordered) AS [Line Total]
FROM OEHDRHST_SQL OH INNER JOIN OELINHST_SQL ... |
CREATE PROCEDURE sp_Save_Setup
(@COMPANYID NVARCHAR (50),
@COMPANYNAME NVARCHAR (255),
@BILLINGADDRESS NVARCHAR (255),
@SHIPPINGADDRESS NVARCHAR (255),
@TELEPHONE NVARCHAR (50),
@FISCALYEAR INT,
... |
-- May 18, 2009 12:51:57 PM COT
-- Add missing sequences
INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,53298,TO_DATE('2009-05-18 12... |
-- 1.
SELECT
id,
name,
unit_price,
MAX(unit_price)
OVER(
ORDER BY id
) AS current_max_price
FROM
items
;
-- 2.
SELECT
created_at,
name,
unit_price,
SUM(unit_price)
OVER(
ORDER BY COALESCE(
created_at,
CAST('0001-01-01' AS DATE)
)
) AS current_sum
FROM... |
alter table model alter column model_definition TYPE VARCHAR(16384);
insert into model(id,private,name,publisher,type,version,model_definition) VALUES (
'urn:bamm:com.catenaX:0.0.1:Material',FALSE,'Material','Catena-X Consortium','BAMM','0.0.1',
'@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix bamm: ... |
DELETE FROM wanted_items WHERE true;
INSERT INTO wanted_items(id, deal_id, item_category_id)
VALUES (1, 1, 1),
(2, 2, 4),
(3, 3, 3); |
INSERT INTO Customers (
cust_id,
cust_contact,
cust_email,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip
)
VALUES (
1000000006,
NULL,
NULL,
'Toy Land',
'123 Any Street',
'New York',
'NY',
'11111'
);
-- this statement demonstrates the coluumns can be specified in any order
-- however specifie... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE clusters (
cluster_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
creator_ip text NOT NULL,
creator_user_agent text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE instances (
instance_id uuid PRIMARY KEY DEFAULT uuid_generate... |
UPDATE users u
LEFT JOIN bookings b ON u.id = b.user_id
SET u.is_deleted = 1
WHERE b.ticket_id IS NULL;
|
Create database if not exists webcounter;
Create table if not exists webcounter(
id int(11) auto_increment primary key,
access_page varchar(255) not null unique,
access_counter int(11)
);
|
CREATE DATABASE IF NOT EXISTS store;
CREATE TABLE IF NOT EXISTS products(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL UNIQUE,
price float,
PRIMARY KEY(id)
);
|
DROP SCHEMA IF EXISTS TRAINEECHEFDB;
CREATE DATABASE TRAINEECHEFDB;
USE TRAINEECHEFDB;
-- Create Chef table
CREATE TABLE CHEF
(
CHEF_ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
F_NAME VARCHAR(20) NOT NULL,
SURNAME VARCHAR(50) NOT NULL
);
-- Create the Food type table that will co... |
/* check first 10 rows */
SELECT * FROM store_sales
LIMIT 10;
/* check how many rows */
SELECT COUNT(*)
FROM store_sales;
/* how many rows in each month */
SELECT month_of_year, COUNT(*) AS total
FROM store_sales
GROUP BY month_of_year
ORDER BY month_of_year ASC;
/* maximum number of employees during any shift of th... |
/*
Navicat MySQL Data Transfer
Source Server : SQL
Source Server Version : 50051
Source Host : localhost:3306
Source Database : mnms
Target Server Type : MYSQL
Target Server Version : 50051
File Encoding : 65001
Date: 2019-05-08 15:41:39
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------... |
drop sequence food_seq;
drop table userInfo;
drop table registerInfo;
drop table restaurant;
drop table food;
create sequence ad_seq increment by 1 start with 1
--create sequence food_seq;
--drop sequence food_seq
--create sequence food_seq increment by 1 start with 1
create table userInfo(
shop_id varchar2(32) prima... |
/*
Depression Screening and Follow-Up for Adolescents and Adults (DSF)
*/
library depression_screening_and_followup version '1.0.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.1' called FHIRHelpers
/*
Measure Description
The percentage of members 12 years of age and older who were screened for
clin... |
SELECT Employee.FirstName, Employee.LastName, Invoice.*
FROM Employee INNER JOIN Invoice
WHERE Employee.Title="Sales Support Agent"
-- connected by Customer.SupportRepId |
CREATE TABLE Customer (
CustomerId INTEGER NOT NULL,
Name VARCHAR(60) NOT NULL,
Address VARCHAR(80) NOT NULL,
PaymentCategory VARCHAR(20),
AreaCode VARCHAR(20) NOT NULL,
Phone VARCHAR(20),
Email VARCHAR(60),
CONSTRAINT pk_customer PRIMARY KEY (CustomerId)
);
|
----------------------------------------------------
-- @param index
-- @param name
update mptta set lid=lid+2 where lid > ?-1;
update mptta set rid=rid+2 where rid > ?-1;
insert into mptta (lid,rid,name)values(?,?+1,?);
|
CREATE DATABASE moveis_dos_sonhos;
USE moveis_dos_sonhos;
CREATE TABLE usr_roles(
rol_id INT NOT NULL AUTO_INCREMENT,
rol_nome VARCHAR(20) NOT NULL,
CONSTRAINT pk_rol PRIMARY KEY (rol_id)
);
CREATE TABLE users (
usr_id INT NOT NULL AUTO_INCREMENT,
usr_email VARCHAR(40) NOT NULL,
usr_nome VARCHAR(40) NOT NULL,
us... |
create Procedure sp_updateGVNO (@CreditID int)
AS
BEGIN
Update CreditNote set GiftVoucherNo=DocumentReference where CreditID =@CreditID
END
|
update debra_posts set products_import_completed=false where id in (select post_id from debra_sponsorshipinfo where sidebar=true);
delete from debra_brandinpost where post_id in (select post_id from debra_sponsorshipinfo where sidebar=true);
|
create table connections (
userId int not null,
connectionId varchar(255) not null,
dateEstablished datetime default now(),
hubName varchar(255) not null,
primary key (userId, connectionId),
foreign key (userId) references konta (id)
); |
CREATE TABLE categoria (
codigo BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET = utf-8;
INSERT INTO categoria (nome) values ('Lazer');
INSERT INTO categoria (nome) values ('Alimentação');
INSERT INTO categoria (nome) values ('Supermercado');
INSERT INTO categoria (n... |
SELECT * from country;
SELECT * from country where number > 15000000;
-- 求每个地区的总人口、平均人口
select sum(number), AVG(number), area from country GROUP BY area;
-- 筛选出平均人口大于15000000的地区
select sum(number), AVG(number), area from country GROUP BY area HAVING AVG(number) > 15000000;
-- 求每个地区的总人口、平均人口,将结果进行排序
select sum(numbe... |
INSERT INTO task (id, title, description)
VALUES (
default,
'sample title',
'sample description'
);
INSERT INTO task_list (id, title)
VALUES (
default,
'sample task list title'
);
INSERT INTO task_list_task (task_list_id, task_id)
VALUES (
1,
1
);
|
-- phpMyAdmin SQL Dump
-- version 4.1.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 19. Mrz 2014 um 22:20
-- Server Version: 5.5.33
-- PHP-Version: 5.3.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
use yiiadvanced;
drop table if exists auth_assignment;
drop table if exists auth_item_child;
drop table if exists auth_item;
drop table if exists auth_rule;
create table auth_rule
(
name varchar(64) not null,
data text,
created_at integer,
updated_at integer, primary key (name)
) engine InnoDB;
create table auth_ite... |
CREATE TABLE `users_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`group_id` bigint(20) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGIN... |
#设置客户端连接服务器编码
SET NAMES UTF8;
#丢弃数据库,如果存在
DROP DATABASE IF EXISTS news;
#创建数据库news,设置存储的编码
CREATE DATABASE news CHARSET=UTF8;
#进入该数据库
USE news;
CREATE TABLE `hotnews` (
`hotid` int(11) PRIMARY KEY AUTO_INCREMENT,
`picurl` varchar(200) NOT NULL
);
INSERT INTO `hotnews` VALUES
(1,"http://n.sinaimg.cn/pho... |
DELETE FROM auth.USER;
INSERT INTO auth.USER (user_id, username, password, enabled) VALUES
(default, 'denis.danov@dreamix.eu', '$2a$10$D4OLKI6yy68crm.3imC9X.P2xqKHs5TloWUcr6z5XdOqnTrAK84ri', true); |
create table user(userid int not null primary key AUTO_INCREMENT,email VARCHAR(255) not null,username VARCHAR(40) not null ,userpwd VARCHAR(40) not null,createtime date);
create table song (songid int not null primary key AUTO_INCREMENT,songname VARCHAR(255) not null,songsrc VARCHAR(40) not null ,player varchar(... |
INSERT INTO message(text) VALUES('Hello');
INSERT INTO message(text) VALUES('Foo');
INSERT INTO message(text) VALUES('Bar'); |
drop database if exists municipio_ps;
create database municipio_ps;
use municipio_ps;
create table if not exists persona(
personaID int not null AUTO_INCREMENT,
personaDNI char(8) not null unique,
personaNombres varchar(50) not null,
personaApellidos varchar(100) not null,
personaDireccion varcha... |
CREATE database bamazon;
USE bamazon;
CREATE TABLE products (
item_id INT NOT NULL,
product_name VARCHAR(100) NULL,
department_name VARCHAR(100) NULL,
price DECIMAL(10,4),
stock_quantity INT NOT NULL,
PRIMARY KEY (item_id)
);
INSERT INTO products (item_id, product_name, department_name, price, stock... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.