blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
0d3dd7449d06b46b84bf5c237009ca567c4fbc95 | SQL | bookool/MySpringBoot | /DataBase/MySQL/Table/0001_TB_user.sql | UTF-8 | 1,392 | 3.5 | 4 | [
"Apache-2.0"
] | permissive |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for user
-- 用户基础信息表
-- by Tommy
-- ----------------------------
-- DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL COMMENT '用户id',
`gmt_create` datetime(0) NOT NULL COMMENT '创建时间',
`gmt_modified` date... | true |
945d0c898a7f0aa21ff955cc8404a47d626bf8a1 | SQL | humberto-garza/BasesDatos_Proyecto | /getResultsDePaciente.sql | UTF-8 | 524 | 3.359375 | 3 | [] | no_license | CREATE PROCEDURE getResultsDePaciente(IN parIDPac INT)
BEGIN
SELECT
Result.IDLTRes,
CatRes.Nombre,
Result.esNormal AS Estatus,
CONCAT(Result.Valor, ' ', IFNULL(CatRes.Unidades,'')) AS Resultados,
CONCAT(CatRes.ValMin, ' - ', CatRes.ValMax) As 'Valores de Referencia',
CatRes.Explicacion AS Detalles
FROM... | true |
b63beff32ff9bb97ae704123c1667489074a6b37 | SQL | timothynegron/sql-queries | /sql-3-queries-hospital.sql | UTF-8 | 578 | 3.953125 | 4 | [] | no_license | --Select all patient records.
SELECT *
FROM patients;
--Select from Health Care personnel.
SELECT *
FROM hcp
WHERE salary > 60000 AND salary < 100000;
--See how many appointments each employee has
SELECT empl_id, COUNT(*)
FROM appointments
GROUP BY empl_id;
--See the total amount of cost for each patient that ... | true |
741c01e1beff042aab700a4cd78957d702e833b5 | SQL | evandromaster/mysql | /16 - REDS/Importar tabelas/Importar tbl_rat_efetivos 2017.sql | UTF-8 | 13,858 | 3 | 3 | [] | no_license | -- importa tabelas rat_efetivo mes de janeiro 2017
LOAD DATA LOCAL INFILE 'Y:\\ServidorMega\\MySql\\15 - RAT BOS\\rat_efetivos\\REDS_RAT_EFETIVOS_20170101_20170131.csv' -- Aqui vc especifica o local do arquivo
into table tbl_rat_efetivos -- Aqui você especifica o nome da tabela
fields terminated by '|'
LINE... | true |
2f6047c25dc096a1017c75becb1eed8b0b75c6d4 | SQL | piyo02/store | /database/fixlcore.sql | UTF-8 | 6,998 | 3.203125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 24, 2019 at 08:53 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 5.6.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
fbcf1ce1da9e018566975567f72589c29a71f079 | SQL | bibliophagist/GreenatomJavaPractise | /second.tasks/src/main/java/second/tasks/select/update/delete/23.sql | UTF-8 | 370 | 3.390625 | 3 | [] | no_license | SELECT const.athlete, sportsman.sportsman_name, const.show_result, result.result, const.in_city, result.city
FROM public.sportsman sportsman,
public.result result,
(WITH vals (athlete, show_result, in_city) AS ( VALUES ('Athlete ', 'showed the result of ', 'in the city of '))
SELECT *
FROM vals) as const
WHER... | true |
9b43a2624a8f42c3d949e81bbc98de066e3d8964 | SQL | gogbuehi/BMCD.com | /sql/session.sql | UTF-8 | 1,001 | 3.6875 | 4 | [] | no_license | CREATE TABLE `bmcd`.`session` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`key` VARCHAR( 32 ) NOT NULL ,
`user_id` INT NULL COMMENT 'Corresponds to a User',
`expiration` DATETIME NOT NULL ,
`dt` DATETIME NOT NULL COMMENT 'Date the session was started',
UNIQUE (
`key`
);
ALTER TABLE `session` ADD `ip` VARCHAR... | true |
f573bab2a70c5d4b4098b92168c880d7dfcc58e7 | SQL | radtek/abs3 | /sql/mmfo/bars/Procedure/k2p.sql | UTF-8 | 2,318 | 3.390625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Procedure/K2P.sql =========*** Run *** =====
PROMPT =====================================================================================
PROMPT *** Create procedure... | true |
073a0b02ed11f0d61cfc14e847c2fda5a35ecb35 | SQL | sergiofgonzalez/Spring-Data-Repo | /spring-data-samples/chapter-05-typesafe-jdbc-repositories/006-jdbc-springdata-querydsl-javaconfig/src/test/resources/test-data.sql | UTF-8 | 983 | 3.109375 | 3 | [] | no_license | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
INSERT INTO `Customer` (`id`, `first_name`, `last_name`, `email_address`) VALUES (1, 'John', 'Doe', 'john@doe.com');
INSERT INTO `Customer` (`id`, `first_name`, `... | true |
d209e92c0e7943b55c6021d486725d407c3d516d | SQL | veslo1/apmgr | /migrations/storage/159/unitActionIconsDown.sql | UTF-8 | 234 | 2.515625 | 3 | [] | no_license | /* Reverse 208 */
UPDATE `actions`
SET icon = NULL
WHERE name IN ('Createamenity','Viewallamenities','Viewallapartments','Createunitsingle','Createunitbulk');
/* Reverse 209 */
DELETE FROM messages WHERE identifier IN ('nameExists'); | true |
0117485b81fdde84fbfbc39e5a93af312334ceb8 | SQL | danimc/incidencias | /crm(1).sql | UTF-8 | 63,432 | 2.640625 | 3 | [
"Unlicense"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 02, 2017 at 06:40 PM
-- Server version: 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_CL... | true |
76f5d8ca06772c4b55ed51fbf3c019a0df285dc0 | SQL | umeshpathak1234/uiprojects2 | /views/sqlbackup.sql | UTF-8 | 1,632 | 3.328125 | 3 | [] | no_license | CREATE TABLE `persondb`.`contactinfo` (
`contactId` INT NOT NULL AUTO_INCREMENT,
`firstName` VARCHAR(45) NOT NULL,
`lastName` VARCHAR(45) NOT NULL,
`address` VARCHAR(45) NOT NULL,
`email` VARCHAR(45) NULL,
`phoneNumber` VARCHAR(45) NULL,
PRIMARY KEY (`contactId`),
UNIQUE INDEX `contactId_UNIQUE` (`conta... | true |
9e85bd0ca3e1380647d01438894c051556df33ba | SQL | ofvera/lablab | /PlanAccion/Querys/usuario.sql | UTF-8 | 157 | 2.875 | 3 | [] | no_license | select user.id as user_id, concat(user.firstname," ",user.lastname) as full_name, user.username as RUT
from lablab.user as user where user.deletedAt is null; | true |
ebc2f033e9def7519c5a6a3b4e2ebe0e405f70b8 | SQL | OpenBEL/rdf-misc | /create-librdf-db/ddl.sql | UTF-8 | 888 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | -- create text index for rdf literals
create index literals_text_index on literals(text);
-- create int index for object uri of rdf triples
create index triples_ou_index on triples(objectUri);
-- create int index for object literal of rdf triples
create index triples_ol_index on triples(objectLiteral);
-- crea... | true |
6d1d11ff634e0ee6d3ec461b0ca12fbca35279d9 | SQL | thomas-sdi/DOORDATAWEB | /application/database/update_20091123.sql | UTF-8 | 626 | 2.640625 | 3 | [] | no_license | update email set message="Welcome [==NAME==].
To log in and get started with Online DOORDATA, click on the following link. You will need your user name and password, which was assigned by your system administrator. All of this information is below for your reference.
Online DOORDATA: http://www.onlinedoordata.com... | true |
e2d0ee2005b1da317218d260dfc3b012ea39f684 | SQL | riazul701/mysqltutorial-org | /Basic/Subqueries/Derived_table/derived_table_example_2.sql | UTF-8 | 465 | 3.78125 | 4 | [] | no_license | SELECT
customerNumber,
ROUND(SUM(quantityOrdered * priceEach)) sales,
(CASE
WHEN SUM(quantityOrdered * priceEach) < 10000 THEN 'Silver'
WHEN SUM(quantityOrdered * priceEach) BETWEEN 10000 AND 100000 THEN 'Gold'
WHEN SUM(quantityOrdered * priceEach) > 100000 THEN 'Platinum'
END) ... | true |
a2ab9d1ed430f02a3068c133a201be6ad14b9671 | SQL | Hguedez/BDII | /QUERYS/Roles.sql | UTF-8 | 5,447 | 2.828125 | 3 | [] | no_license | alter session set"_ORACLE_SCRIPT" = true; -- Necesario para crear usuarios.
------------------USUARIOS-------------
Create user Gerente identified by "1111"
default tablespace "USERS"
temporary tablespace "TEMP";
Alter user Gerente Quota 15M on USERS;
Grant "CONNECT" to Gerente;
Create user Vieira ide... | true |
0dc838d43a65146fa075a7183c9e1418e50be6d6 | SQL | daavka1127/contact | /db_contacts 2019-12-23.sql | UTF-8 | 77,986 | 2.875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 23, 2019 at 04:07 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
7a92b86fe692f195be036089a5c0d7bdf6e1fe42 | SQL | net2action/scriptZone | /Linux/DB2/template/DxV8.5/extendJcrDb.sql | UTF-8 | 2,474 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #------------------------------------------------
# this script create DX Db via streaming command
# Author: AF - 2016-03-26
# Owner: Net2Action
#------------------------------------------------
PROGNAME=$(basename $0)
AUTHOR="A.Fontana"
VERSION="1.0.0"
OWNER=" by net2action - 2016"
function error_exit
{
e... | true |
aa13fd60491a2defd32aae9041f8923862d446f7 | SQL | cqframework/clinical_quality_language | /Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/ParserPerformance.cql | UTF-8 | 5,850 | 2.953125 | 3 | [
"Apache-2.0",
"CC-BY-4.0"
] | permissive | library testassociations version '0.0.000'
// Github Issue [#149](https://github.com/cqframework/clinical_quality_language/issues/149)
// On older versions of Antlr4, this library would never finish parsing
using QDM version '5.4'
codesystem "LOINC": 'urn:oid:2.16.840.1.113883.6.1'
codesystem "SNOMEDCT": 'urn:oid:2.... | true |
13a15b9a15bdca5d9fdebc9162d193f4b8bf4300 | SQL | Redvanisation/SQL-queries | /2_SELECT_Quizz.sql | UTF-8 | 851 | 4.09375 | 4 | [] | no_license | -- 1
SELECT winner FROM nobel
WHERE winner LIKE 'C%' AND winner LIKE '%n';
-- 2
SELECT COUNT(subject) FROM nobel
WHERE subject = 'Chemistry'
AND yr BETWEEN 1950 and 1960;
-- 3
SELECT COUNT(DISTINCT yr) FROM nobel
WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject = 'Medicine');
-- 4
SELECT subject, ... | true |
ad6c477038dd8cac7e146be819c8e1c46a787446 | SQL | puregame/AircraftDB | /backend/scripts/array_average.sql | UTF-8 | 288 | 2.875 | 3 | [] | no_license | -- Function: array_avg(integer[])
-- DROP FUNCTION array_avg(integer[]);
CREATE OR REPLACE FUNCTION array_avg(integer[])
RETURNS numeric AS
$BODY$
SELECT avg(v) FROM unnest($1) g(v)
$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION array_avg(integer[])
OWNER TO postgres;
| true |
1b90bc7d30780392373217276cbdf276001447b1 | SQL | mirror-neuron/OracleStudy | /20190409_01_hr(plsql).sql | UHC | 2,952 | 4 | 4 | [] | no_license | SELECT USER
FROM DUAL;
--==>> HR
-- %TYPE
-- 1. Ư ̺ ԵǾ ִ ÷ ڷ ϴ Ÿ
-- 2.
-- ̺.÷%TYPE [ :=ʱⰪ ];
-- BEGIN θ ϱ ȯ溯
SET SERVEROUTPUT ON;
--==>> ۾ ϷǾϴ.
--> DBMS_OUTPUT.PUT_LINE()
-- ȭ鿡 ϱ ȯ溯
-- HR.EMPLOYEES ̺ Ư
DECLARE
--VNAME VARCHAR2(20);
VNAME EMPLOYEES.FIRST_NAME%TYPE; ... | true |
be5f81591634e1ac88c7bb098288624843068823 | SQL | AXLEproject/axle-healthcare-benchmark | /queries/06_2.2.4_process_analysis_average_observation_values_per_organization.sql | UTF-8 | 3,438 | 3.59375 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL"
] | permissive | /*
* query : 2.2.4
* description: average observation values
* user : care group employees and quality employees
*
* Copyright (c) 2014, Portavita B.V.
*/
WITH patientMetaData AS (
SELECT ptnt._id AS ptnt_id
, ptnt.scoper AS orga_enti_id
, ptnt... | true |
d2705628149795602cde7be28f0702e38fd570cb | SQL | archibald2012/easymetrics-server | /scripts/sql/METRICS_REPORT_PROCESSING_TIME.sql | UTF-8 | 21,151 | 3.28125 | 3 | [] | no_license | delete from metrics_report where report_id > 18 and report_id <= 40;
insert into metrics_report (report_id, report_name, report_template, report_options, report_type, value_columns, execute_sql, series_value, report_category)
values(19, '每日CPU处理时间', 'spline-irregular-time', '
{
title:{
text: "通行证服务器 Daily Processin... | true |
24e4a27e4c8b2f4a0840fac4268eff6ab867c461 | SQL | bjarturfreyr/GRU_H1 | /SQL/gru_h1_database.sql | UTF-8 | 2,661 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 25, 2015 at 12:40 PM
-- Server version: 5.6.14-log
-- PHP Version: 5.4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... | true |
89b1121f0e7cb7edd75aa388f9a55baabbd3f28e | SQL | shivdeepmodi/Setup | /sqlpath/tbs.sql | UTF-8 | 1,975 | 3.65625 | 4 | [] | no_license | set verify off
define tablespace_name=&1
WITH
free_space AS ( SELECT f.tablespace_name , SUM(bytes) free_bytes FROM dba_free_space f where tablespace_name = upper('&tablespace_name')
group by f.TABLESPACE_NAME ) ,
ts_details AS ( SELECT t.tablespace_name , SUM( CASE WHEN autoextensible = 'YES' TH... | true |
29b7c2059c93a04345f2febca0d88316f3bcef56 | SQL | stuntt101/Database-Monitoring | /Mining_project/MySQL_db/mine_management_db.sql | UTF-8 | 12,291 | 3.546875 | 4 | [] | no_license | 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mine_management
-- ------------------------------... | true |
e707c3e2d967795bf5e0547daaf9dc5d79b85a88 | SQL | btison/angrytweet | /docker/mysql/sql/jbpm-test.org.jbpm.persistence.jpa.MySQL5InnoDBDialect.sql | UTF-8 | 21,763 | 3.015625 | 3 | [] | no_license |
create table if not exists Attachment (
id bigint not null auto_increment,
accesstype integer,
attachedat datetime,
attachmentcontentid bigint not null,
contenttype varchar(255),
name varchar(255),
attachment_size integer,
attachedby_id varchar(255),
... | true |
d795b0ddc2362402c022434c62da667047c0ff67 | SQL | oldgit-tracy/SQL | /569-Median Employee Salary.sql | UTF-8 | 3,369 | 4.21875 | 4 | [] | no_license | -- The Employee table holds all employees. The employee table has three columns: Employee Id, Company Name, and Salary.
--
-- +-----+------------+--------+
-- |Id | Company | Salary |
-- +-----+------------+--------+
-- |1 | A | 2341 |
-- |2 | A | 341 |
-- |3 | A | 15 |... | true |
2c3011f254c6ce9cabe9c854a3a9c85448caf388 | SQL | hxmn/WIM | /WIM/MViews_Obsolete/Install/R_WELL_CLASS.sql | UTF-8 | 2,661 | 2.78125 | 3 | [] | no_license |
DROP MATERIALIZED VIEW PPDM.R_WELL_CLASS;
CREATE MATERIALIZED VIEW PPDM.R_WELL_CLASS
TABLESPACE PPDMDATA
PCTUSED 40
PCTFREE 0
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 1M
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMIT... | true |
da9fd7349d733b708095cf7aa2fca0163ff96ad8 | SQL | faizkhairi/Rental-Management-System-Project | /Transactions/transaction7.sql | UTF-8 | 553 | 3.609375 | 4 | [] | no_license | /*
7)Show a lease agreement for a renter (name is entered as input).
*/
Create Or Replace Function get_lease_agreement(f_name IN Lease_Agreement.first_name%type, l_name IN Lease_Agreement.last_name%type)
Return Varchar
IS
leaseAgreement varchar(200);
Begin
Select LISTAGG(TO_CHAR(leaseId), ', ')
Within Group (O... | true |
2587a42422a31845a4f1c9b29a1c09206cbe1c0b | SQL | WeiyiDeng/Dataset_code | /create_artist_start_week.sql | UTF-8 | 188 | 2.71875 | 3 | [] | no_license | create table artist_start_week(NEW_AID integer, START_WEEK integer);
insert into artist_start_week
select NEW_AID, min(START_WEEK) as START_WEEK
from nm_fm_artist_temp
group by NEW_AID | true |
8e9a7ae8ada0f19cfafa4a81e24c517de7b91df7 | SQL | Homainc/ISPLabs | /ISPLabs/SQL/create_user_forum.sql | UTF-8 | 782 | 2.796875 | 3 | [] | no_license | -- Create User forum
CREATE USER forum IDENTIFIED BY 1234 DEFAULT TABLESPACE USERS
QUOTA UNLIMITED ON USERS
/
-- Grant section 1
GRANT CREATE SESSION TO forum
/
GRANT CREATE TABLE TO forum
/
GRANT CREATE PROCEDURE TO forum
/
GRANT CREATE TRIGGER TO forum
/
GRANT CREATE VIEW TO forum
/
GRANT CREATE SEQUENCE TO forum
/
... | true |
29d5c49ab1d1e21c68fd3fedc5ba2e390fdccdb7 | SQL | R3dLantern/EISSS17Vilents | /MS3/Implementation/Server/data/schema.sql | UTF-8 | 15,023 | 3.5 | 4 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server Version: 10.1.19-MariaDB - mariadb.org binary distribution
-- Server Betriebssystem: Win32
-- HeidiSQL Version: 9.4.0.5125
-- ------------------------------------------------... | true |
47397fa6a3251df219e2c53636d3e2cd17fbf061 | SQL | veena-excite/eh-data | /pas/backoffice/data/_hotel_sellable.sql | UTF-8 | 885 | 4.21875 | 4 | [] | no_license | SET search_path to data,public
;
--drop table if exists hotel_sellable ;
truncate hotel_sellable
;
insert into hotel_sellable
select h.id as hotel_id,
case when b.id is not null then true else false end as "sellable"
from "public".hotel h
left join (
SELECT distinct h."id"
FROM "public".hotel AS h
INNER ... | true |
3250cf2975cbf7efe0e11877abcafe0d25746ad7 | SQL | Eugene1992/java-developer-2018 | /bohdan/src/main/java/postgreSQL_pckg/creating.sql | UTF-8 | 921 | 3.265625 | 3 | [] | no_license | CREATE TABLE employee (
id SERIAL PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
age INT,
salary INT,
is_married BOOLEAN,
birthdate DATE,
position VARCHAR(50)
);
UPDATE employee SET position = 'Senior Architect' WHERE position = 'Architect senior';
INSERT INTO employee (first_name, last... | true |
2189dd13602e5b24cd712fe7acccb5c32df6ed95 | SQL | gcelanji/dt-cars | /src/main/resources/static/MySQL starter files/dt_cars.sql | UTF-8 | 1,732 | 3.4375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS dt_cars;
USE dt_cars;
DROP TABLE IF EXISTS cars;
CREATE TABLE cars(
id INT(8) NOT NULL AUTO_INCREMENT,
make VARCHAR(64) DEFAULT NULL,
model VARCHAR(64) DEFAULT NULL,
release_year INT(16),
mileage INT(16),
transmission VARCHAR(64),
engine_L FLOAT(4),
category VARCHA... | true |
ac02ca624bdba11b0eeeb16205ee97b00e5c91e9 | SQL | originbenntou/E-Kitchen | /mysql/init/create_user.sql | UTF-8 | 394 | 2.90625 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS account;
CREATE DATABASE account;
use account
DROP TABLE IF EXISTS user;
CREATE TABLE user (
id INT unsigned NOT NULL auto_increment,
email VARCHAR(255) NOT NULL,
password VARCHAR(1023) NOT NULL,
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at datetime NOT NULL DEF... | true |
4ce1326712085306db3c4d52f96c68c3df0cf4df | SQL | ice61/SpringBootSSM | /springbootssm.sql | UTF-8 | 1,085 | 3.140625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50536
Source Host : localhost:3306
Source Database : springbootssm
Target Server Type : MYSQL
Target Server Version : 50536
File Encoding : 65001
Date: 2019-07-10 21:37:45
*/
SET FOREIGN_KEY_CHECKS=0;
--... | true |
922480d8f23f9088011f6480733b423bc2225d85 | SQL | Royal6969/Ejercicios_Base_de_Datos_SQL_ORACLE_1_DAM | /Tema 3 - Diseño fisico de bases de datos/Ejercicios DLL - sql/Ejer3.sql | UTF-8 | 1,122 | 3.578125 | 4 | [] | no_license | CREATE TABLE empleados (
dni INT PRIMARY KEY,
nombre varchar2(20),
apellido1 varchar2(20),
direccion varchar2(40),
ciudad varchar2 (20),
municipio varchar2(20),
cod_postal number(5),
sexo varchar2(10)
);
CREATE TABLE estudios (
cod_estudios INT PRIMARY KEY,
titulo varchar2(20),
ciudad varchar2(20)
);
... | true |
374bfa3d6e2c42b0079f31af26194d57a695e6f9 | SQL | snguyenbui/indecisive.ninja | /db/schema/04_voter_response.sql | UTF-8 | 261 | 2.921875 | 3 | [] | no_license | DROP TABLE IF EXISTS voter_responses CASCADE;
CREATE TABLE voter_responses (
id SERIAL PRIMARY KEY NOT NULL,
voter_id INTEGER REFERENCES voters(id) ON DELETE CASCADE,
choice_id INTEGER REFERENCES choices(id) ON DELETE CASCADE,
score INTEGER NOT NULL
);
| true |
0fc59a60d1140c017dbf2a48b5525ffa59473aec | SQL | keerthivasan0108/SQL | /basic_sql_queries.sql | UTF-8 | 886 | 3.703125 | 4 | [] | no_license | cmd for open mysql in terminal
sudo mysql -u root -p
cmd for viewing database list
show databasebases;
cmd for create database
create database <database name>;
cmd for use database
use <database name>;
cmd for view tables in a database
show tables;
cmd for create tables in a database
create table <table name>
... | true |
41cee75b567666af8627170751bfebeb94628482 | SQL | frsknalexis/e-grocery | /notification/src/main/resources/db/changelog/changeset/init.sql | UTF-8 | 597 | 3.09375 | 3 | [] | no_license | CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE idempotency_key (
key uuid not null,
operation varchar(255),
created timestamptz,
CONSTRAINT idempotency_key_pk PRIMARY KEY (key, operation)
);
CREATE TABLE shedlock (
name VARCHAR(64) NOT NULL,
lock_until TIMESTAMP NOT NULL,
locked_... | true |
724a7dce9d69fccb47f3f64959a3334e7f1e26c0 | SQL | SuperCuteSnowJam/yqdl | /src/main/resources/sqlscript/initsql.sql | UTF-8 | 1,850 | 3.640625 | 4 | [] | no_license | drop database yqdl;
create database yqdl;
use yqdl;
create table `user`(
`id` int unsigned auto_increment comment '用户id',
`username` varchar(20) not null comment '用户名称',
`password` varchar(30) not null comment '用户密码',
`type` char not null comment '用户类型 A:管理员 B:普通用户',
primary key(id)
)engine=innodb d... | true |
6e491b62691cfbf234be8331484ba681f9965d11 | SQL | psajbh/GAMELOG | /gamelog_r1/documentation/data_generation/other_queries.sql | UTF-8 | 755 | 3.609375 | 4 | [] | no_license | -- sample queries
select GWRBI as name, count(*) as gwrbis from v_gamelog vg
where vg.season = 2018 and GWRBI IS NOT NULL
group by GWRBI order by gwrbis desc;
select * from (
select gamelog_code, daytime, location, tm_winner, tm_loser,
HP_UMP, WP, LP, S, GWRBI
from v_gamelog where tm_winner = 'WAS'
UNION ALL
sele... | true |
9c4ee2c894f2201b2d378d888574cb9d0e70c5bd | SQL | afyaehms/report-scripts | /scripts/MOH 711 Reproductive and Child Health/maternity_breech_deliveries_count.sql | UTF-8 | 162 | 2.6875 | 3 | [] | no_license | #Count of breech birth
SELECT COUNT(*) FROM
obs
WHERE concept_id = 100126134
AND value_coded = 1170
AND DATE(obs_datetime) BETWEEN '2016-09-01' AND '2016-09-30'
| true |
d1716a1d2d9066ac6e71c5fd98d281adec6d311e | SQL | hernan-alperin/urbix | /recoleta/check_sensor.sql | UTF-8 | 2,611 | 3.390625 | 3 | [] | no_license | select * from (
select value as "in PB-EM", measure_time
from bkn_measure
natural full join bkn_measure_data
where sensor_id = 2 and type_code = 1
) as ins_2
natural full join (
select value as "out PB-EM", measure_time
from bkn_measure
natural full join bkn_measure_data
where sensor_id = 2 a... | true |
8d41b649f41e5c71dfa0202cbd4944437ec38681 | SQL | shiinpo/backend | /migrations/000003_exercise.up.sql | UTF-8 | 238 | 3.015625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS exercise (
id serial PRIMARY KEY,
name varchar(80) UNIQUE NOT NULL,
category_id INTEGER REFERENCES category(id) ON DELETE CASCADE ON UPDATE CASCADE
); | true |
8c2f506b9d179d65283d5addeec80d7df59963d6 | SQL | sbw6788778/payroll | /payroll_data/src/main/resources/config/creat_table_sql/employee_login_message.sql | UTF-8 | 1,001 | 3.03125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localHost
Source Server Version : 50561
Source Host : localhost:3306
Source Database : payroll
Target Server Type : MYSQL
Target Server Version : 50561
File Encoding : 65001
Date: 2018-09-01 15:47:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
7fcabcfc63eaeeb45d689864810bb405a56afd4a | SQL | yantoumu/bugscan-1 | /bugscan.sql | UTF-8 | 421 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive | CREATE TABLE bug_user (
`id` int unsigned not null primary key auto_increment,
`username` varchar(60) not null default '',
`password` char(32) not null default '',
`email` varchar(60) not null default '',
`create_at` int not null default 0,
UNIQUE bug_users_username_password(`username`, `passwor... | true |
ac8fb1da386c5f74c032f5508b7e78bb3138c738 | SQL | sagarmangulkar/student-registration-system | /proj2_demo_tables_script16.sql | UTF-8 | 3,925 | 3.203125 | 3 | [] | no_license | DROP TRIGGER trigger_enroll;
DROP TRIGGER trigger_students;
delete from enrollments;
delete from grades;
delete from classes;
delete from prerequisites;
delete course_credit;
delete from courses;
delete from students;
delete from logs;
insert into students values ('B001', 'Anne', 'Broder', 'junior', 3.17,... | true |
5b56bfea93087b19bc0be95a26bb17391988261d | SQL | Fernandogza/OffMeta | /lolDB.sql | UTF-8 | 12,281 | 2.65625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 04, 2015 at 02:01 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
63c5518ee72dabcc28896237cadaa062cc219921 | SQL | JingyuSoft/amity | /amity-server/data/worlddb/organize.sql | UTF-8 | 927 | 3.421875 | 3 | [] | no_license | insert into country (id, code, name, latitude, longitude)
select id, iso, local_name, geo_lat, geo_lng from meta_location
where type = 'CO';
insert into region (id, code, name, latitude, longitude)
select id, iso, local_name, geo_lat, geo_lng from meta_location
where type = 'RE';
insert into city (id, code, name, lat... | true |
e2863f74a35a87edfa2d2b17aeff6bc41d59d179 | SQL | Oppo-sit/Study-Univ | /Web_DB_Programming/30 join_04.sql | UTF-8 | 1,862 | 4.28125 | 4 | [] | no_license | #Self Join
use sqlDB;
CREATE TABLE empTBL
(
empName char(3) Not Null Primary Key,
managerName char(3) ,
telNum char(8) Not Null
);
insert into emptbl VALUES('나사장', Null, '0000');
insert into emptbl VALUES('김재무', '나사장', '2222');
insert into emptbl VALUES('김부장', '김재무', '2222-1');
insert into emptb... | true |
34a338ea8a4aca19e787277d2becb51b1ffbd774 | SQL | zerodollar/mall-api | /mysql/mall.sql | UTF-8 | 2,659 | 3.40625 | 3 | [] | no_license | -- http://blog.csdn.net/mu_tou/article/details/3961977
create database mall DEFAULT CHARACTER SET utf8;
use mall;
drop table if EXISTS SYS_MENU_INF;
CREATE TABLE IF NOT EXISTS SYS_MENU_INF
(
CATEGORY VARCHAR(20) not null, -- 菜单分类,
ID VARCHAR(20) not null, -- id
NAME VARCHAR(200) not null, -- 名字
... | true |
078bec2969d10f3a779f2c1f7c3960166206b2b3 | SQL | EyVanVen/JDBC_And_Hibernate_Java | /Jdbc_And_Hibernate/src/main/java/homework1/SQL_code_hw1.sql | UTF-8 | 1,173 | 3.453125 | 3 | [] | no_license | DROP DATABASE IF EXISTS MyJoinsDB;
Create DATABASE MyJoinsDB;
USE MyJoinsDB;
DROP TABLE IF EXISTS NamesAndNumbers;
CREATE TABLE NamesAndNumbers(
NAME TEXT,
PHONES TEXT
);
DROP TABLE IF EXISTS PostAndSalary;
CREATE TABLE PostAndSalary(
NAME TEXT,
POST TEXT,
SALARY INT
);
DROP TABLE IF EXISTS fami... | true |
45dfe95ec52c2028ee7a8ee02af7f1a130e1fc82 | SQL | sariroti/kredivo | /sql/employees_routines.sql | UTF-8 | 11,635 | 3.578125 | 4 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: employees
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... | true |
e629472c75c176465ce61d2d2aff91615f8bfd01 | SQL | tototoshi/dbcache | /example-play/conf/db/migration/postgresql/V20160420074120__create_table.sql | UTF-8 | 276 | 2.96875 | 3 | [] | no_license | CREATE TABLE cache_entries (
cache_key varchar(191) PRIMARY KEY,
cache_value bytea NOT NULL,
expired_at timestamp,
created_at timestamp NOT NULL,
updated_at timestamp NOT NULL
);
create index on cache_entries(expired_at);
create index on cache_entries(created_at);
| true |
2f9d349eee85af4cc2381f4cef6c6b6e9dc473de | SQL | daniellezpalmer/SQL-todos | /todos.sql | UTF-8 | 932 | 3.671875 | 4 | [] | no_license | CREATE TABLE todos (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
details VARCHAR(1000) NULL,
priority INTEGER NOT NULL DEFAULT '1',
created_at TIMESTAMP NOT NULL,
completed_at TIMESTAMP NULL
);
INSERT INTO todos (title, details, priority, created_at) VALUES ('School', 'Finish daily project: Self-Ma... | true |
1205c3ae5208cbb7fb4f4055097387df91101de7 | SQL | KellyYj/phpnewDemo | /news (1).sql | UTF-8 | 2,890 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-07-23 06:30:59
-- 服务器版本: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... | true |
8e2ccfb593cd74505895672492776d54cb1785b6 | SQL | alphagov/verify-lms-poc | /data-gen/build-tables.sql | UTF-8 | 641 | 3.28125 | 3 | [] | no_license | # Create the LMS database
CREATE SCHEMA `LMS` ;
# Select that one to use
USE LMS;
# Create the local matching table
CREATE TABLE Matches ( ID BIGINT AUTO_INCREMENT, PiD varchar(80) NOT NULL, TimeS DATETIME, AccountID varchar(80), PRIMARY KEY (ID), key (PiD) );
# Makes the test database
CREATE TABLE OneHund... | true |
428811b8eeaa3ea50b73e119145598a612963ffd | SQL | danimaribeiro/odoo-erp | /integra/ms_redes_personalizacao/project_orcamento_meses.sql | UTF-8 | 742 | 3.703125 | 4 | [] | no_license | -- View: project_orcamento_meses
-- DROP VIEW project_orcamento_meses;
CREATE OR REPLACE VIEW project_orcamento_meses AS
SELECT DISTINCT po.id AS orcamento_id,
to_char(ipp.data_vencimento::timestamp with time zone, 'YYYY-MM'::text) AS mes
FROM project_orcamento po
JOIN project_orcamento_etapa poe ON po... | true |
16f7f09fbc8f5e443b53a76a2ff828aa67a73073 | SQL | Samin2o35/learning-web-technologies-spring-2020-2021-sec-g | /Cattle-Feed-Management-System/db/cattlefeedmanagementsystem.sql | UTF-8 | 12,932 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 25, 2021 at 06:32 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
acc2be85afb5118f743032495b89e31fd2c09f33 | SQL | taukeerrana/pdf-services | /php/matrimony-unused/sql-scripts/scratchpad.sql | UTF-8 | 1,002 | 2.828125 | 3 | [] | no_license | delete FROM tm_profile;
delete from tm_partnerpreference;
delete from tm_family;
delete FROM tm_profile where ProfileId='BGHND1';
delete from tm_partnerpreference where ProfileId='BGHND1';
delete from tm_family where ProfileId='BGHND1';
select * from tm_profile;
select * from tm_partnerpreference;
update... | true |
416beafc0a7ba4aae0277524e11669fcd662b7c2 | SQL | ReportsAdmin/MissLKSA | /models/Missl_KSA/Tables/fReturns.sql | UTF-8 | 747 | 3.0625 | 3 | [] | no_license | select OrderId ,cast(RefundStatus as string) RefundStatus, cast(ReturnReason as string) ReturnReason,
cast(ReturnRequestID as string) ReturnRequestID,cast(ReturnStatus as string) ReturnStatus, cast(userId as string) userId,
'MissL' Halo_Country
from(
select
ord.increment_id OrderId,
--ret_id.reaso... | true |
f2f63b534e990fc0921bc204fdc8b53c02dbc271 | SQL | Brandyli/LeetCode-Solutions | /MySQL & Database/Window Function/1204. Last Person to Fit in the Elevator.sql | UTF-8 | 2,199 | 4.40625 | 4 | [] | no_license | Key:sum() over()
Q:
The maximum weight the elevator can hold is 1000.
Write an SQL query to find the person_name of the last person who will fit in the elevator without exceeding the weight limit.
It is guaranteed that the person who is first in the queue can fit in the elevator.
A:
# 1) to find the person_name of t... | true |
d6b253ca8b5f5bf6756314c40158a6685fd4edbe | SQL | vanoneang/todolist | /file.sql | UTF-8 | 1,269 | 3.328125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50727
Source Host : localhost
Source Database : todo
Target Server Type : MySQL
Target Server Version : 50727
File Encoding : utf-8
Date: 11/13/2020 11:18:48 A... | true |
73ce8825246add2f2ffb4b8d9b4e654ab8a206b5 | SQL | jsn-ads/SQL | /php14.sql | UTF-8 | 1,611 | 3.171875 | 3 | [] | no_license | -- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 5.7.23 - MySQL Community Server (GPL)
-- OS do Servidor: Win64
-- HeidiSQL Versão: 9.5.0.5196
-- --------------------------------------------------------
/*... | true |
027170cc66db68986488676c989ab49a87abb38b | SQL | manudevelopia/prevengic-hex | /sql/prevengic-api/data.sql | UTF-8 | 744 | 2.671875 | 3 | [] | no_license | insert into lep.notes (lep_name, lep_description)
values ('note 1', 'description 1'),
('note 2', 'description 2'),
('note 3', 'description 3'),
('note 4', 'description 4');
insert into lep.chemical_profile (lep_vla_ec, lep_vla_ed)
values (1, 1),
(2, 2),
(3, 3),
(4, 4);
insert... | true |
966f3a542624adbf05ace45435132c5f8449cd1a | SQL | tasfe/hryetl | /日常sql开发/亚梅姐数据临时提取/支付和海融易用户.sql | UTF-8 | 841 | 3.484375 | 3 | [] | no_license | select
t0.member_id,
count(*)
FROM BIDATA.S_ZHUAN_MEMBER_AGENT t0
group by t0.MEMBER_ID
HAVING count(*)>1
ORDER BY count(*) desc
;
-----
select
count(*)
from member.tr_personal_member@kjtdb
;
select
count(*)
from member.tr_company_member@kjtdb
;
------------------
select
decode(t0.member_type,1,'个人',2,'公司',3,... | true |
032fff0ce2b1fcaed1694d21f67f9c0039b6d650 | SQL | pythonoras/Toontown-Private-Server-Webend | /conf/evolutions/default/20.sql | UTF-8 | 345 | 2.75 | 3 | [] | no_license | # --- !Ups
create table filler_queue_item (
id integer auto_increment not null,
user_id integer,
created datetime,
refreshed datetime,
constraint pk_filler_queue_item primary key (id))
;
# --- !Downs
SET FOREIGN_KEY_CHECKS=0;
drop table filler_queue_i... | true |
fc8702375a2bf059f5ba7b9d935a605424765ec7 | SQL | Eitraz/dashboard | /src/main/resources/db/migration/V1__economy.sql | UTF-8 | 331 | 3.046875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `balance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`account_id` varchar(128) NOT NULL,
`name` varchar(128) NOT NULL,
`balance` decimal(10,2) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX `account_id` (account_id)
) ENGINE=InnoDB DEFAULT CH... | true |
8d7d57e9a50cd9220095108cb562aa7ffc2c97ed | SQL | harinyadevi/Leave-Management-System | /lms.sql | UTF-8 | 16,135 | 3.21875 | 3 | [] | no_license | create table lms.login(login_id varchar(20) primary key,user_type varchar(20),password varchar(20));
create table lms.department(dept_code varchar(5) primary key,dept_name varchar(20),permitted_no_of_leaves bigint,no_of_employees bigint,no_of_working_days bigint);
create table lms.payroll(payroll_id varchar(5),mont... | true |
b51ebf5ccdc0cb62be3321b216f4a77c89c8361e | SQL | voyagelll/python | /database/note.sql | GB18030 | 14,305 | 4.1875 | 4 | [] | no_license | /* Windows */
-- MySQL
net start mysql
-- Windows
sc create mysql binPath= mysqld_bin_path()
/* ӷ */
mysql -h ַ -p ˿ -u û -p
SHOW PROCESSLIST -- ʾЩ߳
SHOW VARIABLES -- ʾϵͳϢ
/* ݿ */
SELECT DATABASES(); -- ʾǰݿ
SELECT now(); -- ʾǰʱ
SELECT USER(); -- ʾǰû
SELECT VERSION(); -- ʾǰ汾
-- ݿ
CRE... | true |
3bbf3fb90e2f7be6f5918f8d55a91e4675beeda4 | SQL | Bases16/motivation-balance | /sql_sources/DDL.sql | UTF-8 | 2,087 | 3.859375 | 4 | [] | no_license | DROP SEQUENCE IF EXISTS mot_bal_sequence;
DROP TABLE IF EXISTS estimation_pairs;
DROP TABLE IF EXISTS results;
DROP TABLE IF EXISTS factors;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS employees;
CREATE TABLE employees
(
id bigint NOT NULL,
manager_id bigint,
first_name varchar(50) NOT NULL,
las... | true |
b3db235bc6584431b9cfa91a5076859fe62b3f7d | SQL | b1506704/anhlefigureshop | /quanlydathang.sql | UTF-8 | 9,812 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 07, 2021 at 07:07 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
becdc80cb6c33c5818ce7c080fba96ea09928e11 | SQL | harydemo/zixapp | /sql/table/book_bsc_zyzj.sql | UTF-8 | 1,649 | 3.6875 | 4 | [] | no_license | --
drop table book_bsc_zyzj;
create table book_bsc_zyzj (
-- primary key
id bigint primary key not null,
-- dimension
yp_acct integer not null,
e_date date not null,
-- dimension (tp)
period date not null,
-- jz data
j bigint defa... | true |
3b4403cbe65d83a34dedc9d1bba526aff52a6433 | SQL | radtek/abs3 | /sql/mmfo/bars/Table/sw_msgfield.sql | WINDOWS-1251 | 5,230 | 3.171875 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/SW_MSGFIELD.sql =========*** Run *** =
PROMPT =====================================================================================
PROMPT *** ALTER_POLICY_INFO... | true |
c04cbb50206dc5d5dda3d0de99618204326641f8 | SQL | batuhan4644/Veri-Tabani | /VTS_G1_SQL/update.sql | UTF-8 | 1,880 | 3.75 | 4 | [] | no_license | ------Update 1 -----
------Sube adı 5 ila 10 karakter arasında olan subelerden en cok bilet kesen personelin ünvanını satış danışmanı yap
UPDATE Unvan
SET Unvan.GorevTuru = 'Satış danışmanı'
FROM Unvan U
INNER JOIN Personel P ON U.UnvanNo = P.UnvanNo
INNER JOIN Sube S ON S.SubeNo = P.SubeNo
WHERE LEN(s.SubeIsmi) BET... | true |
5dbe8d0cc314ccb9bc88c2441ca8965fbf989d24 | SQL | 18473989424/seckill | /seckill.sql | UTF-8 | 3,067 | 3.625 | 4 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : db
Source Server Type : MySQL
Source Server Version : 50720
Source Host : localhost:3306
Source Schema : seckill
Target Server Type : MySQL
Target Server Version : 50720
File Encoding : 65001
Date: 12/03/2... | true |
856c857d1f9f8299291ad24a8d4b4896df95c3b9 | SQL | Flying-sparrow007/MyExercise | /MySQL/数据库的备份和恢复.sql | UTF-8 | 1,547 | 3.09375 | 3 | [] | no_license | /*
数据库备份和恢复
为什么进行数据备份
1.数据库故障
2.突然断电
3.病毒入侵
4.错误操作导致数据丢失
使用mysqldump命令备份数据
mysqldump它就是一个常用的备份工具
1.将create和insert into语句保存到文本文件中
2.它属于dos命名
备份数据库中所有数据
语法:mysqldump u 数据库账号 -p数据库密码 -h ip地址 数据库名 > 备份位置及其备份的文件名称
例如:备份数据库store_ykt的所有数据备份在"D盘中的store.sql"
mysqldump -u root -p984264 -h localh... | true |
35fdd47ead88e959f5ea644441cc67644785d5f0 | SQL | fbscott/cs313-php | /web/prepare/prepare_05.sql | UTF-8 | 1,898 | 4.4375 | 4 | [] | no_license | # 05 Prepare : Basic Queries
# Source: https://content.byui.edu/file/14882098-ce1f-44ba-a196-a7aebcb3d5ce/1/week05/prepare-basic-query.html
# Create table(s)
CREATE TABLE note_user (
id SERIAL,
username VARCHAR(255),
password VARCHAR(255),
PRIMARY KEY (id)
);
CREATE TABLE note (
id SERIAL,
userId IN... | true |
2a53e2f802abd47f25cc22ec83d89de6aec46dad | SQL | hvenugopalan/CS564-SP | /functions.sql | UTF-8 | 2,518 | 3.875 | 4 | [] | no_license | DELIMITER $$
select roa('APPL',null)
-- drop function ROA
CREATE FUNCTION ROA(ticker_param VARCHAR(10), year YEAR(4)) RETURNS DOUBLE(16,2)
BEGIN
DECLARE roa DOUBLE(16,2);
SET roa = 0;
IF(year IS NULL) THEN
SELECT (S.net_income / S.total_assets) *100 INTO roa
FROM company S
WHERE ticker_param = S.ticker AND... | true |
0d9f07c6d2009b8074b8524b0a4271ca01585ddf | SQL | masv87/otusDb | /hm#12/views.sql | UTF-8 | 9,004 | 4.0625 | 4 | [] | no_license | -- Выборка суммарного времени по странам
create view sum_by_countries as select c1.country_name, c1.country_code,
(case when sum is null then 0
else sum end)
from countries c1
left join (
select
sum(elapsed_time) sum,
countries.countr... | true |
56cbf27cb2d81b49ff63fb31122d3afbf465b283 | SQL | makaveeli/php-prod-siswa | /db/prod_siswa.sql | UTF-8 | 7,137 | 3.015625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 19, 2020 at 04:39 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
12e1b186a2e310f5759d8935447f0194993d5044 | SQL | MaxFaust/group-giphy-saga-project | /database.sql | UTF-8 | 878 | 3.484375 | 3 | [] | no_license | CREATE DATABASE "giphy_search_favorites";
-- You'll need a table for storing each giphy image favorite
-- Each favorite image can be assigned 1 of the following categories as a Foreign Key
-- Category table
CREATE TABLE "category" (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR (100) NOT NULL
);
-- Default categor... | true |
430843bdfe86004067e092d84060ef5d1c21e3dd | SQL | gerryqi/TianChi_CaiNiao_Season2 | /sql/合并全国分仓数据.sql | UTF-8 | 1,284 | 2.734375 | 3 | [] | no_license | --odps sql
--********************************************************************--
--author:xing89qs
--create time:2016-05-19 23:00:50
--********************************************************************--
drop table if exists record_table;
create table record_table as
select * from (
select 'all' as store_... | true |
b61567e5b7776b63ce6474cd1a074c1c18204721 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day11/select0345.sql | UTF-8 | 178 | 2.59375 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-10T03:45:00Z' AND timestamp<'2017-11-11T03:45:00Z' AND temperature>=28 AND temperature<=32
| true |
b42c068d6b18517c2534c96c5fecae9cb023cb84 | SQL | Thepatterraining/kaka-service | /sqlquery/v6_2_08_create_sys_pay_user.sql | UTF-8 | 1,509 | 3.203125 | 3 | [] | no_license |
DROP TABLE IF EXISTS `sys_pay_user`;
CREATE TABLE `sys_pay_user` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`pay_no` varchar(255) NOT NULL DEFAULT '' COMMENT '单据号 前缀 SPU',
`pay_sysbankno` varchar(255) NOT NULL DEFAULT '' COMMENT '付款账号',
`pay_userid` bigint NOT NULL DEFAULT 0 COMMENT '用户id',
`pay_amou... | true |
aa9e095258725465c5ceca9525f3bcfdedc20f79 | SQL | ShradhaRavi/Sales_Analysis | /salesorderitems.sql | UTF-8 | 5,769 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2021 at 05:51 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
543b3b695ac3792ef5f26f2c1006e6ddddeacffa | SQL | leilei0220/boot-mp-atomikos | /sql/product.sql | UTF-8 | 3,349 | 3.09375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : leilei
Source Server Type : MySQL
Source Server Version : 50718
Source Host : localhost:3306
Source Schema : lianxi
Target Server Type : MySQL
Target Server Version : 50718
File Encoding : 65001
Date: 22/12/2019 22:57:... | true |
9a957972e5078e625e91a1a48030dfd8a2b7a82c | SQL | camvr/synergyIMS | /src/server/db/migrations/sqls/20171129180954-cascade-deletions-up.sql | UTF-8 | 1,160 | 3.15625 | 3 | [] | no_license | /* Add cascade deletion on company ID */
ALTER TABLE syn_user.users
ADD CONSTRAINT users_syn_user_companies_id_fk
FOREIGN KEY (company_id) REFERENCES syn_user.companies (id) ON DELETE CASCADE;
ALTER TABLE syn_user.permissions
ADD CONSTRAINT permissions_syn_user_companies_id_fk
FOREIGN KEY (company_id) REFERENCES syn_u... | true |
bd32f0c9a2ea2bb19331c48f704b976295a9e4b9 | SQL | kiranitor123/principle_sql | /join_operation/select_join_operation.sql | UTF-8 | 2,235 | 3.96875 | 4 | [] | no_license | SELECT id, title
FROM movie
WHERE yr=1962
SELECT yr
FROM movie
WHERE title = 'Citizen Kane';
SELECT id, title, yr
FROM movie
WHERE title LIKE '%Star Trek%'
ORDER BY yr;
SELECT id
FROM actor
WHERE name = 'Glenn Close';
SELECT id
FROM movie
WHERE title = 'Casablanca';
SELECT name
FROM actor
JOIN casting
ON actor.id ... | true |
9aabd66df3a847b052dc595e438651d8eebed58b | SQL | Matvyxa/MySQL-course-project | /movielook.sql | UTF-8 | 21,731 | 3.46875 | 3 | [] | no_license | DROP DATABASE IF EXISTS movielook;
CREATE DATABASE movielook;
USE movielook;
-- Основные таблицы
DROP TABLE IF EXISTS companies;
CREATE TABLE companies (
id SERIAL PRIMARY KEY,
company VARCHAR(200) UNIQUE NOT NULL
);
INSERT INTO companies VALUES
(null, '20th Century Fox'),
(null, 'Warner Bros. Pictures'),
(null, '... | true |
fb9e0d5091188f2c6a5c72170eeb6cad7312eef0 | SQL | gangsusu/slim4-spl-framework | /sql/tasks.sql | UTF-8 | 1,041 | 2.984375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 192.168.10.10
Source Server Version : 50727
Source Host : 192.168.10.10:3306
Source Database : laravel5
Target Server Type : MYSQL
Target Server Version : 50727
File Encoding : 65001
Date: 2019-09-26 18:25:42
*/
SET FOREIGN_KEY_CHECKS... | true |
22f0f8a56f107397ca8da3feefbcb480b9d192f1 | SQL | hanuz06/BootcampX | /4_queries/6_cohorts_with_longest_assistance.sql | UTF-8 | 288 | 3.875 | 4 | [] | no_license | SELECT
cohorts.name as name,
AVG(completed_at - started_at) as average_assistance_time
FROM
assistance_requests
JOIN students ON student_id = students.id
JOIN cohorts ON students.cohort_id = cohorts.id
GROUP BY
cohorts.name
ORDER BY
average_assistance_time DESC
LIMIT 1;
| true |
f7e11eca6cdcc71a45e608e2dbba1ef17f8dceff | SQL | yangho1231/treehut | /db/get_one.sql | UTF-8 | 96 | 2.53125 | 3 | [] | no_license | SELECT * FROM products p
INNER JOIN image i
ON p.product_id = i.img_id
WHERE p.product_id = $1;
| true |
8f9f3da999124f0c0caf4cea10cb35b51a15f2db | SQL | jacktao219/easy_guard | /script/v1.0.0.sql | UTF-8 | 4,814 | 3.65625 | 4 | [] | no_license | --
-- Table structure for table `guard_datasource_define`
--
CREATE TABLE `guard_datasource_define` (
`system` varchar(48) NOT NULL COMMENT '系统',
`username` varchar(48) NOT NULL COMMENT '用户名',
`pwd` varchar(64) DEFAULT NULL COMMENT '加密后的密码 ',
`driver_class` varchar(64) DEFAULT 'com.mysql.cj.jdbc.Driver' COMMEN... | true |
75da8d388ec60207433dff1f430df24e1c92efa4 | SQL | debezium/debezium | /debezium-connector-mysql/src/test/resources/ddl/transaction_metadata_test.sql | UTF-8 | 1,170 | 4.03125 | 4 | [
"MIT",
"Apache-2.0",
"Artistic-1.0-Perl",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"Zlib",
"LGPL-2.1-only",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-1.1",
"GPL-3.0-only",
"GPL-2.0-only",
"Artisti... | permissive | -- ----------------------------------------------------------------------------------------------------------------
-- DATABASE: transaction_metadata_test
-- ----------------------------------------------------------------------------------------------------------------
-- Create and populate our products using a sin... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.