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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
392e50994ed56a5df4016be713adb4da26562182 | SQL | ynsingh/repos | /brihaspati/trunk/brihCI/database/altertablesis-20181225.sql | UTF-8 | 2,481 | 3.25 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- --------------------------------------------------------
--
-- Table structure for table `staff_promotionals_details`
--
CREATE TABLE `staff_promotionals_details` (
`spd_id` int(11) NOT NULL,
`spd_empid` int(11) NOT NULL,
`spd_wtype` varchar(255) NOT NULL,
`spd_paycom` varchar(11) DEFAULT NULL,
`spd_agp` ... | true |
80f1cb5d750fdcedcda08cc4581d035eb81ff80c | SQL | AaronChantiles/Product-Revenue-Analysis | /Revenue Analysis.sql | UTF-8 | 2,523 | 4.0625 | 4 | [] | no_license | --What Product Category has the highest rev?
--Answer: Beverages - $99,464.50
SELECT Cat.CategoryName AS 'Category', ROUND(SUM(P.Price*OD.Quantity),2) AS 'Revenue'
FROM Categories AS 'Cat'
JOIN Products AS 'P' ON P.CategoryID = Cat.CategoryID
JOIN OrderDetails AS 'OD' ON OD.ProductID = P.ProductID
GROUP BY Ca... | true |
e2413f03516fee2e70f6f4877c7424c294d75c86 | SQL | wizardklaus/SQL-Query-Tests-Oracle | /Basic1.sql | UTF-8 | 3,152 | 4.1875 | 4 | [] | no_license | use wizardklaus;
CREATE TABLE patient (id CHAR(5) PRIMARY KEY, name CHAR(10), sex CHAR(1), phone CHAR(20),
CONSTRAINT sex CHECK(sex='f' or sex='m'), CONSTRAINT id_rk FOREIGN KEY(id) REFERENCES doctor(doc_id));
ALTER TABLE patient ADD job CHAR(20);
CREATE TABLE Instructor (id CHAR(5) NOT NULL, name CHAR(15) NOT NULL,... | true |
a28ed85c758182b3e9a229856f1ae6b364a2ef08 | SQL | hashgraph/hedera-mirror-node | /hedera-mirror-importer/src/main/resources/db/migration/v1/V1.33.0__drop_token_account_id.sql | UTF-8 | 1,053 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | -------------------
-- Drop token_account id, replacing id primary key with unique index on (created_timestamp)
-- Drop unused functions f_entity_create and encodeentityid
-- Add missing primary keys on file_data and live_hash
-------------------
alter table if exists token_account
drop constraint token_account_pke... | true |
83cdc3afb4d4219a775eeea60720928f2b4a581c | SQL | LeoHongyi/Leetcode-solutions | /src/Database/sql/leetcode-sql/Game Play Analysis III.sql | UTF-8 | 261 | 3.84375 | 4 | [] | no_license | select
a1.player_id,
a1.event_date,
sum(a2.games_played) as games_played_so_far
from
activity as a1
join
activity as a2 on a1.event_date >= a2.event_date
and a1.player_id = a2.player_id
group by a1.player_id, a1.event_date; | true |
1338d0a979a2c1767ff0065622f9a2e33ee9ec6b | SQL | deividhs/UniversityDatabase | /UniversityDatabase/Tables/DegreeRequirements.sql | UTF-8 | 742 | 3.328125 | 3 | [] | no_license | CREATE TABLE DegreeRequirements
(
RequirementId INT IDENTITY NOT NULL,
DegreeId INT NOT NULL,
StudyYear INT NOT NULL,
SemesterCode VARCHAR(2) NOT NULL,
DepartmentCode VARCHAR(2) NOT NULL,
CourseNumber VARCHAR(3) NOT NULL,
CONST... | true |
db0eef17760964f4d5f4d9489cb4a0fe5d013b99 | SQL | seallred/ibmSrDbXsr | /sqlXsr/auditLog.sql | UTF-8 | 770 | 3.125 | 3 | [] | no_license | -- Audit Log
select * from xsr.audit_log fetch first 1000 rows only;
select * from xsr.audit_log where app_id = 1 and action_id = 2 and obj_type_id = 6
and description like '%CNBNLMM%'
with ur;
select * from xsr.audit_obj_type;
-- action_id = 1 - for insert
-- action_id = 2 - for update
-- action_id = 3 - for delet... | true |
154a55c0b1d5f855a82cda610082aa819efd6e0e | SQL | devawa/StacksOnStacks | /Web_Dev/arivl (1).sql | UTF-8 | 6,122 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2018 at 01:17 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... | true |
dbadd21b651e4d1c2c15291284437c26d1b312a7 | SQL | CUBRID/cubrid-testcases | /sql/_04_operator_function/_08_click_counter/_001_incr/cases/1012.sql | UTF-8 | 615 | 3.359375 | 3 | [
"BSD-3-Clause"
] | permissive | -- create a class,insert data to this calss,select clause with incr function,select data from the class
create class xoo ( a int , b int, c int);
insert into xoo values(1, 1, 1);
insert into xoo values(2, 2, 2);
select incr(a), incr(b) from xoo where c = 1 order by 1;
select incr(a), incr(b) from xoo where c = 1 ord... | true |
d0baf0af9a7faf5f96763f738929609534a6c0b6 | SQL | MistarKomeng378/SSO | /New folder/pic.sql | UTF-8 | 40,278 | 2.671875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : kinerja
Source Server Version : 50505
Source Host : localhost:3306
Source Database : db_kinerja
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2019-04-15 11:45:39
*/
SET FOREIGN_KEY_CHECKS=0;
-- ... | true |
a6be363bfebb425093e843a507fda27d34d7b3a1 | SQL | yepitstrent/Survey | /data.sql | UTF-8 | 2,213 | 3.03125 | 3 | [] | no_license | USE betterhelp;
INSERT INTO survey (name, owner) VALUES ('BetterHelp', 'Trent');
INSERT INTO questions (sid, name, order_of, answ_type ) VALUES (1, 'What is your gender?', 1, 0 );
INSERT INTO questions (sid, name, order_of, answ_type ) VALUES (1, 'What is your relationship status?', 2, 0 );
INSERT INTO questions (sid... | true |
7783dac48d3404190a2b54f7c68a678329c37f9f | SQL | paultopia/labelmaker | /resources/sql/queries.sql | UTF-8 | 2,075 | 3.859375 | 4 | [] | no_license | -- :name create-user! :! :n
-- :doc creates a new user
INSERT INTO users (username, password, isadmin)
VALUES (:username, :password, :isadmin)
-- :name change-password :! n
-- :doc changes user's password
UPDATE users
SET (password = :password)
WHERE username = :username
-- :name get-user :? :1
-- :doc retrieve a use... | true |
d5db6ba5d56da1f7384dae83f9c46466ab58daf6 | SQL | B-JayU/SitDown | /table.sql | UTF-8 | 483 | 2.828125 | 3 | [] | no_license | DROP table Storage;
DROP table Member;
DROP table Table;
create table Storage(
Iname char(20) not null,
Iprice int not null default 0,
Iseller char(20),
Icontact char(20),
Iquant int default 0,
Iorder int default 0,
primary key(Iname)
);
create table Member(
Mnum int,
Mname char(20),
Mcontact char(20),
Mmi... | true |
0ca7836a223004379e8bea5fcf4876f93e234a18 | SQL | choiseongkuan/RecyGo | /recygo/ffivcco_keangpeng.sql | UTF-8 | 2,981 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- 主機: localhost:3306
-- 產生時間: 2021 年 05 月 26 日 13:12
-- 伺服器版本: 5.6.49-cll-lve
-- PHP 版本: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
b56f0bec416f67b69c62c4059afeff53e19e1400 | SQL | xiYan-02/MyCloudMusicApi | /src/main/resources/test/structure.sql | UTF-8 | 19,105 | 3.609375 | 4 | [] | no_license | -- 测试数据库表结构
-- 下面的sql前面有依赖关系
-- 我们这里使用的是h2数据库
-- 因为我们使用的内存数据库,测试更快
-- 语法和mysql有些一些区别
-- 当然也可以使用mysql
-- SET MODE=MySQL;
-- SET FOREIGN_KEY_CHECKS=0;
-- 用户表
CREATE TABLE `user`
(
`id` VARCHAR(32) NOT NULL COMMENT '主键',
`nickname` VARCHAR(30) NOT NULL COMMENT '昵称',
`avatar`... | true |
c197ae4d27b9f4c6c3abc00be4cb17d320c7be6b | SQL | Min65535/web | /conf/order.sql | UTF-8 | 541 | 3.1875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `demo_order` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '默认自增id',
`order_no` VARCHAR(255) NOT NULL UNIQUE KEY COMMENT '订单id',
`user_name` VARCHAR(255) COMMENT '用户名' ,
`amount` DECIMAL(20,5) COMMENT '金额',
`status` VARCHAR(20) COMMENT '状态',
`file_url` VARCHAR(255) COMMENT '文... | true |
81cdf50aec577f1a29f9d86ead21c8ac68e51530 | SQL | EdisionKyle/wxshare | /doc/jtee.sql | UTF-8 | 1,805 | 3.203125 | 3 | [] | no_license | /*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 5.7.12 : Database - jtee
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@... | true |
9b554e4be4fe281d1b2672aa6d21dea95562baac | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day16/select2319.sql | UTF-8 | 223 | 2.53125 | 3 | [] | no_license |
SELECT timeStamp, clientid
FROM WiFiAPObservation
WHERE timestamp>'2017-11-15T23:19:00Z' AND timestamp<'2017-11-16T23:19:00Z' AND SENSOR_ID=ANY(array['wemo_08','thermometer6','3145_clwa_5019','wemo_04','3141_clwb_1100'])
| true |
9ef6475d611fe6c5daf65f7e2419799d6d580c01 | SQL | alycia17/NoPain02 | /NoPain.sql | UTF-8 | 4,912 | 2.765625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.7
-- Dumped by pg_dump version 9.5.7
-- Started on 2018-12-11 10:57:42 BRST
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_mess... | true |
f4692054524361316c0fa247e588f35675efc291 | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_SCALAR_FUNCTION/GetTotalFreeIssues.sql | UTF-8 | 825 | 3.5625 | 4 | [] | no_license |
CREATE FUNCTION GetTotalFreeIssues(@ITEMCODE nvarchar(15), @FROMDATE datetime, @TODATE datetime)
RETURNS decimal(18,6)
AS
BEGIN
RETURN ISNULL((SELECT SUM(Quantity)
FROM InvoiceDetail, InvoiceAbstract
WHERE InvoiceAbstract.InvoiceID = InvoiceDetail.InvoiceID
AND (InvoiceAbstract.InvoiceType = 2)
AND (InvoiceAb... | true |
d7af8c6109332a1c52a71fe15ce2d0fbae0245a0 | SQL | gaoyayaya/yamaxunmine | /ymx.sql | UTF-8 | 23,893 | 3.515625 | 4 | [] | no_license | SET NAMES UTF8;
DROP DATABASE IF EXISTS ymx;
CREATE DATABASE ymx CHARSET=UTF8;
USE ymx;
/**表1-----------商品类别**/
CREATE TABLE ymx_family(
fid INT PRIMARY KEY AUTO_INCREMENT,
fname VARCHAR(32),
pic VARCHAR(32),
href VARCHAR(64),
title VARCHAR(64),
subtitle VARCHAR(64)
);
/**表2-----------6类商品中分别又有哪些型号**/
... | true |
4fea89128f2961f1f2a13d2f59b1b20a88270451 | SQL | University-Archive/DB-Lab-AUT | /2/2/Queries/3.sql | UTF-8 | 243 | 3.671875 | 4 | [] | no_license | WITH PrjDefPrjB AS (
SELECT Prj.duration, Prj.Emp_id
FROM PrjDef JOIN Prj
ON PrjDef.PrjDef_id = Prj.PrjDef_id
WHERE PrjDef.Prj_Name = 'B')
SELECT SUM(Emp.Salary * PrjDefPrjB.duration)
FROM Emp JOIN PrjDefPrjB
ON Emp.Emp_id = PrjDefPrjB.Emp_id; | true |
b910a2eb87e7f39b4008ff507a8c6c0b15f0977b | SQL | radtek/abs3 | /sql/mmfo/bars/View/v_clv_customer_risk.sql | UTF-8 | 1,631 | 3.203125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/View/V_CLV_CUSTOMER_RISK.sql =========*** Ru
PROMPT =====================================================================================
PROMPT *** Create view V_CL... | true |
df3eb865f7aa870218196a7db13a3519470bf3d2 | SQL | sesp13/Bases-De-Datos-2-2021-1 | /trabajo 3/project/sql/selects/ventas.sql | UTF-8 | 404 | 3.859375 | 4 | [] | no_license | -- Ventas por ciudad
SELECT * FROM empleado e, TABLE(e.ventas)
--Get total ventas ciudad
SELECT
SUM((v.miprod.precio_unitario) * v.nro_unidades) AS total
FROM empleado e, TABLE(e.ventas) v
WHERE e.miciu = (SELECT REF(c) FROM ciudad c WHERE cod = %s)
--Obtener total ventas de empleado
SELECT
SUM((v.miprod.precio_uni... | true |
f1025b8324795b6db5d0654c3a34468c8c0a0b6b | SQL | cckmit/xinfu | /ccms/WebContent/WEB-INF/action/project/fitness/basic/exreport/search/query-base.sql | UTF-8 | 731 | 3.640625 | 4 | [] | no_license | select
name,
mobile,
l.created,
(select name from cc_customer where code=
(select createdby from cc_share_log where l.sharecode=cc_share_log.code)) as name2,
(select mobile from cc_customer where code=
(select createdby from cc_share_log where l.sharecode=cc_share_log.code)) as mobile2,
(
select int... | true |
59101f23ebdcefb23c039df72a56db2a117dc71e | SQL | nabind/prism_test | /INORS/Database_Scripts/Operation_Schema/SCB_CODE_MIGRATION_SCRIPTS/TRANSACTIONAL_TASC/12_TASC_PROD_TO_TASC_GRANT.sql | UTF-8 | 2,663 | 2.640625 | 3 | [] | no_license | -- THis we need to login to TASC Production Copy Schema and give the grant to tasc Blank Schema--
--- (remember to change the name of the TASC blank schema in this script e.g. change tasc to TASC)
GRANT SELECT ON STG_PROCESS_STATUS TO tasc;
GRANT SELECT ON STG_DATA_LAYOUT_CONFIG TO tasc;
GRANT SELECT ON STG_ET... | true |
d0d676788fd501f5abcd95bb228a99d657cb628d | SQL | junhey/codeigniter-restapi | /ci.sql | UTF-8 | 980 | 2.84375 | 3 | [
"MIT"
] | permissive | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50539
Source Host : localhost:3306
Source Database : ci
Target Server Type : MYSQL
Target Server Version : 50539
File Encoding : 65001
Date: 2014-10-28 15:52:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
72a175f2d46fb247e8d98b602512e0349f21f56e | SQL | mmatuszk/smcat | /smcat.sql | UTF-8 | 11,463 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 17, 2017 at 09:51 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
8fc672b381f37b40b4033b86d1f4bd64044d5f2d | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/00376_shard_group_uniq_array_of_int_array.sql | UTF-8 | 761 | 3.15625 | 3 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | -- Tags: shard
DROP TABLE IF EXISTS group_uniq_arr_int;
CREATE TABLE group_uniq_arr_int ENGINE = Memory AS
SELECT g as id, if(c == 0, [v], if(c == 1, emptyArrayInt64(), [v, v])) as v FROM
(SELECT intDiv(number%1000000, 100) as v, intDiv(number%100, 10) as g, number%10 as c FROM system.numbers WHERE c < 3 LIMIT 1000... | true |
9eb01af8a7e0610299d5b56aa0a8e60c246a0fb8 | SQL | isaaxu79/PL-SQL- | /PRACT2/department.sql | UTF-8 | 3,438 | 3.828125 | 4 | [] | no_license | CREATE VIEW v_departments AS
SELECT
d.department_name,
e.first_name || ' ' || e.last_name as name_manager,
d.location_id,
d.department_id
FROM DEPARTMENTS d
INNER JOIN employees e ON e.employee_id = d.manager_id;
CREATE VIEW v_department_address AS SELECT
v_departments.department_name,
v_de... | true |
5f0a7fe03fa26c469045550c3c0c0ac99321e9b3 | SQL | Andacanaver/expense-tracker-backend | /migrations/001.do.create_users_table.sql | UTF-8 | 854 | 2.640625 | 3 | [] | no_license | CREATE TABLE users (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
full_name TEXT NOT NULL,
username TEXT NOT NULL UNIQUE,
email_address TEXT NOT NULL,
password TEXT NOT NULL,
date_created TIMESTAMP NOT NULL DEFAULT now()
);
INSERT INTO users (full_name, email_address, username, pass... | true |
56c3a11f1945a198dc98e886f7bd786eacae3178 | SQL | NitheshKrishnan/HEHM15 | /OneToOneMapping/one_to_one_mapping.sql | UTF-8 | 842 | 3.359375 | 3 | [] | no_license | delimiter $$
CREATE TABLE `trainer_personal` (
`personal_id` int(11) NOT NULL,
`mother_tongue` varchar(45) DEFAULT NULL,
`hometown` varchar(45) DEFAULT NULL,
`status` varchar(45) DEFAULT NULL,
PRIMARY KEY (`personal_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
delimiter $$
CREATE TABLE `trainer_professional... | true |
a1586e993b40d85d7b6ab14baa05aab1d021604e | SQL | renegaat/StockAI | /infrastructure/database/src/main/resources/oraclexe/liquibase/1_dropuserfunc.sql | UTF-8 | 364 | 2.921875 | 3 | [] | no_license | grant drop user to system
/
CREATE OR REPLACE PROCEDURE drop_user_if_exists (user_name VARCHAR2) AS
BEGIN
EXECUTE IMMEDIATE 'drop user ' || user_name || ' cascade';
EXCEPTION WHEN OTHERS
THEN
IF SQLCODE = -01918 THEN
NULL; -- ORA-01918 user does not exist
ELSE#
RAISE;
... | true |
04d0a5a8fa64b29c80661d64f14219f1aa635600 | SQL | markeHuang/demo | /src/main/resources/sql/01_全量脚本/mysql/00_公共脚本/00_CreateProcedure_MySql.sql | GB18030 | 925 | 3.5 | 4 | [] | no_license | DROP PROCEDURE IF EXISTS currval;
CREATE PROCEDURE currval (in seq_name VARCHAR(50))
COMMENT 'ȡָеǰȡֵ'
BEGIN
DECLARE VALUE decimal(10);
DECLARE tmpname varchar(50);
SET VALUE = 1;
SELECT CURRENT_VALUE,name INTO VALUE,tmpname
FROM FSPA_SEQ_M
... | true |
d448652769ebbd72e627f4b07862198cf21a75c8 | SQL | fandashtic/arc_chennai | /Sivabalan-SQL/SQL_STORED_PROCEDURE/Spr_List_Itemwise_SalesreturnReport_pidilite.sql | UTF-8 | 1,533 | 3.296875 | 3 | [] | no_license | CREATE Procedure Spr_List_Itemwise_SalesreturnReport_pidilite(@FromDate datetime,@ToDate datetime)
As
Select Items.ProductName,
"Item Name" = Items.ProductName,
"Damaged Qty"=
Sum(case When (Status & 32) <> 0 Then InvoiceDetail.Quantity Else 0 End),
"Damaged Qty Reporting UOM" = Sum((case When (Status & 32) <> 0 Then I... | true |
d21cfa0fcfc792d36a56d8382a5236357347eebc | SQL | zzzpp1/python | /sql/select.sql | UTF-8 | 2,689 | 4.90625 | 5 | [] | no_license | # 1.查询同时存在1课程和2课程的情况
select t1.id, t1.name
from (
select st.id, st.name, sc.courseId
from student as st
left join student_course as sc
on st.id =sc.studentId
where sc.studentId="1")t1
inner join(
select st.id,st.name,sc.courseId
from student as st
left join student_course as sc
on st.id =sc.studentId
where sc.stude... | true |
bd2dbfc6e17ddd18128f28ec2c71a39bed68d3e1 | SQL | ArctosDB/DDL | /tables/uam_tables/coll_object.sql | UTF-8 | 1,080 | 3.828125 | 4 | [] | no_license | CREATE TABLE COLL_OBJECT (
COLLECTION_OBJECT_ID NUMBER NOT NULL,
COLL_OBJECT_TYPE CHAR(2) NOT NULL,
ENTERED_PERSON_ID NUMBER NOT NULL,
COLL_OBJECT_ENTERED_DATE DATE NOT NULL,
LAST_EDITED_PERSON_ID NUMBER,
LAST_EDIT_DATE DATE,
COLL_OBJ_DISPOSITION VARCHAR2(20) NOT NULL,
LOT_COUNT NUMBER NOT NULL,
CONDI... | true |
f0f8a3ccabd2f4be76f7708b0514c14a278deebe | SQL | yash199/IMS-Barclays-Starter | /src/main/resources/sql-schema.sql | UTF-8 | 628 | 3.765625 | 4 | [] | no_license | create database if not exists ims;
use ims;
drop table if exists CUSTOMER;
create table CUSTOMER (
ID int auto_increment,
NAME varchar(100),
primary key (ID));
drop table if exists ITEM;
create table ITEM (
ID int auto_increment,
NAME varchar(100),
COST double,
primary key (ID));
drop tab... | true |
430cbd47c8bee17b19855ecb965838ac10e9e389 | SQL | IgorZhernovkov/java-ukol-senior | /src/main/resources/liquibase/db-schema.sql | UTF-8 | 1,152 | 3.4375 | 3 | [] | no_license | create sequence hibernate_sequence start with 1 increment by 1;
create table framework_version (
id bigint not null,
release_date date not null,
version varchar(100) not null,
primary key (id)
);
create table hype_level (
id bigint not null,
name varchar(50) not null,
score integer not null,
primary k... | true |
22a88091aa98ff219aa9270858b7ab4f5275990a | SQL | hw233/gsnkf_server_php | /module/world/worldgroupon/doc/t_world_groupon_inner_user.sql | UTF-8 | 837 | 2.90625 | 3 | [] | no_license | set names utf8;
create table if not exists t_world_groupon_inner_user
(
uid int unsigned not null comment "uid",
point int unsigned not null comment "团购积分",
coupon int unsigned not null comment "团购券",
optime int unsigned not null comment "参与活动时间--用来补发奖励,清积分,每日购买物品限制",
reward_time int unsigned not n... | true |
f767242dd441d61123859756d94c0dea38f3fd21 | SQL | by-ktif/wokark | /wokark_db.sql | UTF-8 | 819 | 3.171875 | 3 | [] | no_license | CREATE DATABASE `wokark` /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE TABLE `wokark`.`w_airport` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`city` varchar(25) NOT NULL,
`country` varchar(25) NOT NULL,
`code` varchar(5) DEFAULT NULL,
`alias` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAUL... | true |
1af392df7f93da4dc5808263d59dacc5a30715cc | SQL | jeuun/dbSql | /2019_11_15.sql | UHC | 7,389 | 4.40625 | 4 | [] | no_license | -- emp̺ empno÷ PRIMARY KEY
-- PRIMARY KEY = UNIQUE + NOT NULL
-- UNIQUE --> ش ÷ UNIQUE INDEX ڵ
-- index ϸ ڵ ϴ
ALTER TABLE emp ADD CONSTRAINT FK_EMP PRIMARY KEY (empno);
EXPLAIN PLAN FOR
SELECT *
FROM emp
WHERE empno = 7369;
SELECT *
FROM TABLE (dbms_xplan.display); -- ܿ, ؼ
-----------------------------------... | true |
8d001e51679f2f678112cc2898287b6c9cff2114 | SQL | fatah666/pw2020_193040174 | /praktikum/p7_pw_193040174/tubes_193040174.sql | UTF-8 | 2,742 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 07 Bulan Mei 2020 pada 17.07
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
e52dfc4b41c2196e8dd137be7c707c5bc62dda07 | SQL | Tembryo/dota-analysis | /web-server/postgres-db/add_stats.sql | UTF-8 | 177 | 2.578125 | 3 | [] | no_license | CREATE TABLE PlayerStats(match_id bigint, steam_identifier text, data json, PRIMARY KEY (match_id, steam_identifier));
CREATE TABLE MatchStats(id bigint PRIMARY KEY, data json); | true |
d93ff2aa8266c11f6c9dc39c65a57f4ac18feb06 | SQL | l2jfree/svn | /archive/CT2.3/l2jfree-datapack/sql/grandboss_spawnlist.sql | UTF-8 | 1,436 | 2.90625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `grandboss_spawnlist` (
`boss_id` INT NOT NULL DEFAULT 0,
`loc_x` INT NOT NULL DEFAULT 0,
`loc_y` INT NOT NULL DEFAULT 0,
`loc_z` INT NOT NULL DEFAULT 0,
`heading` INT NOT NULL DEFAULT 0,
`respawn_min_delay` INT(11) NOT NULL DEFAULT 86400,
`respawn_max_delay` INT(11) NOT ... | true |
cd5e4aaeb2c656a3cafbd4da7ec9a6c6ade63380 | SQL | z4444a/AIM | /misc/database/changesets/master/AIM-029.sql | UTF-8 | 251 | 3.21875 | 3 | [] | no_license | ALTER TABLE aim.parameters
ADD COLUMN "order" INTEGER NOT NULL DEFAULT 0;
UPDATE aim.parameters param
SET "order" = (
SELECT count(*)
FROM aim.parameters par
WHERE par.category_id = param.category_id AND par.parameter_id < param.parameter_id
); | true |
da408ff0c6764a5e819f069b71a215c0923bda5d | SQL | RockBackEnd20151122/J2EE_11_mybatis | /bin/tables.sql | UTF-8 | 592 | 3.109375 | 3 | [] | no_license |
#in MAC
brew install mysql
mysql.server start
mysql -u root -p
create database userTest;
use userTest;
CREATE TABLE `userMyBatis` (
`user_id` varchar(50) NOT NULL,
`user_name` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`status` varchar(50) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB... | true |
723f343e2a02f78225c5d0e496fcd3de417e30ba | SQL | uservipin/MY_SQL | /intoduction.sql | UTF-8 | 367 | 3.125 | 3 | [] | no_license | use classicmodels;
create table test (id int, name varchar(50),marks int);
select * from test;
insert into test values (
id= 12
name =vipin,
marks= 50
)
-- alter table means add | remove | Update data
-- data added
alter table test add phone_No varchar(50)
Describe test;
-- this query drop specific column
a... | true |
db2e029e52b330390b72e3c12de2df3709c3b4b9 | SQL | jacob-servidio/sql-challenge | /EmployeeSQL/data_analysis.sql | UTF-8 | 4,773 | 4.21875 | 4 | [] | no_license | -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- Link to schema: https://app.quickdatabasediagrams.com/#/d/XuTZwP
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
CREATE TABLE "employees" (
"emp_no" INT NOT NULL,
"emp_title" VARCHAR(5) NOT... | true |
616a44eeadb653426975ee2f9a8f976badaa33c2 | SQL | radtek/abs3 | /sql/mmfo/bars/Function/f_get_from_accountspv_dat2.sql | WINDOWS-1251 | 1,363 | 3.140625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/function/f_get_from_accountspv_dat2.sql ====
PROMPT =====================================================================================
CREATE OR REPLACE FUNCTION BA... | true |
9671941b23a08361e0eca322af5e6b373808bfe8 | SQL | trammell/test | /sql/groupwise-max/gmax-11.sql | UTF-8 | 865 | 3.828125 | 4 | [
"Artistic-2.0"
] | permissive | -- $Id$
-- $Source$
USE world;
-- added 2005-05-28 as no. 11, sent in by rudy@r937.com
SELECT c1.continent, c1.name, c1.population
FROM Country AS c1 JOIN Country AS c2
ON c1.continent = c2.continent
GROUP BY c1.continent, c1.name
HAVING c1.population = MAX(c2.population);
-- This query is similar to #8 in that... | true |
ca2aeb04057363fbb29783acd2ec3f6dcd3c69e0 | SQL | dynamesgn/secure-software-development-project | /dbexport.sql | UTF-8 | 2,865 | 3.015625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.12, for macos10.13 (x86_64)
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... | true |
fc46957ee738ceeffe66abcb2dfb3ec792c54454 | SQL | elderschmoeller/NBADatabaseAnalitics | /consultas/kituxi.sql | UTF-8 | 149 | 2.78125 | 3 | [] | no_license | #os piores times da temporada de 2015
SELECT
distinct TEAM , L , W , SEASON_ID
FROM
Ranking
where
L > 15 && W = 0 && SEASON_ID = 22015
limit 1;
| true |
18d107e5cab7a7d74ccc79a85377cc937c94d7d1 | SQL | alekhyabathula0801/UserManagement | /mysql/UserManagementDDL.sql | UTF-8 | 3,983 | 4.0625 | 4 | [] | no_license | -- create user management schema
CREATE SCHEMA `user_management` ;
-- create user details table
CREATE TABLE `user_management`.`user_details` (
`id` INT NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(20) NOT NULL,
`middle_name` VARCHAR(25) NULL,
`last_name` VARCHAR(25) NOT NULL,
`email` VARCHAR(50) NOT NULL,... | true |
277d31e4e37e4ee77a5b434806cb504bcae45628 | SQL | tadas559/Final-Coursework-TadasVinckas | /db_tables/gallery.sql | UTF-8 | 2,950 | 2.859375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 2018 m. Rgs 09 d. 18:51
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.0.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... | true |
29660b5a0b80a247da98bdaf472b5989da237c09 | SQL | hankintosh/USDA-SR22-importer | /sr22.sql | UTF-8 | 3,580 | 3.0625 | 3 | [] | no_license | DROP TABLE IF EXISTS DATSRCLN, DERIV_CD, FD_GROUP, FOOD_DES, FOOTNOTE, NUT_DATA, NUTR_DEF, WEIGHT, ABBREV, SRC_CD, DATA_SRC;
CREATE TABLE DATSRCLN
(
NDB_No INT,
Nutr_No INT,
DataSrc_ID VARCHAR(12)
);
CREATE TABLE DERIV_CD
(
Deriv_CD VARCHAR(8),
Deriv_Desc VARCHAR(240)
);
CREATE TABLE FD_GROUP
... | true |
809190e513ca65ca49c13cc4daea5e4468a79285 | SQL | CaribesTIC/hornero | /config/database.sql | UTF-8 | 6,324 | 3.390625 | 3 | [] | no_license | -- #### Seguridad de Datos de roles #### ---
-- Clase encargada de mantener todos los perfies del sistema ejemplo Root
create table seg_perfil (
id BIGINT IDENTITY (1, 1) NOT NULL,
detalle VARCHAR(50) NOT NULL,
CONSTRAINT pk_seg_perfil PRIMARY KEY(id)
);
-- Enc... | true |
500941c9f8e473b98e14a29e8e0f428d25173e78 | SQL | Syfaro/foxbot | /queries/subscription/search.sql | UTF-8 | 199 | 2.578125 | 3 | [
"MIT"
] | permissive | SELECT
account.telegram_id,
hash "hash!",
message_id,
photo_id
FROM
source_notification
JOIN account ON account.id = source_notification.account_id
WHERE
hash <@ ($1, 3);
| true |
0886c9d4bf1fc720c74ef0e7bd799838435f11cc | SQL | NeboLej/TradeCompanyProject | /TradeCompany_DataBase/TradeCompany_DataBase/Stored Procedures/GetFeedbackByOrderID.sql | UTF-8 | 214 | 2.875 | 3 | [] | no_license | CREATE PROCEDURE [TradeCompany_DataBase].[GetFeedbackByOrderID]
@OrderID int
as
select F.[Datetime], F.[Text], F.ClientID, F.OrderID
from [TradeCompany_DataBase].[Feedbacks] as F
where F.OrderID = @OrderID
| true |
fe4947f119c48bce033b91dd16d9801a319749b2 | SQL | krishbal128/CRUD | /task__backup.sql | UTF-8 | 2,304 | 2.90625 | 3 | [] | no_license | -- MariaDB dump 10.19 Distrib 10.4.19-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: task
-- ------------------------------------------------------
-- Server version 10.4.19-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
a3fe7b13723f25c27bd962ceb8a9d33737caf236 | SQL | ebrahimsalehi1/PL-SQL | /PureCodes-Learning/p106.sql | UTF-8 | 430 | 2.859375 | 3 | [] | no_license | -- Learning PL/SQL with Ebrahim Salehi
-- If you have questions, You will send an email to ebrahim.salehi.oshtorjani@gmail.com
declare
cursor cur is
select employee_id,first_name,salary
from employees;
emp_id number;
fname varchar2(100);
sal number;
begin
open cur;
loop
fetch cur int... | true |
ceecff14fd22761f8d5ef757a7c99a852ae3feae | SQL | carmajago/WebServiceInfinity | /WebServiceInfinity/Scripts/dbo.TriggerNebulosas.sql | UTF-8 | 218 | 3.15625 | 3 | [] | no_license | CREATE TRIGGER NombresNebulosa
ON Nebulosas
AFTER INSERT
AS
BEGIN
UPDATE Nebulosas SET nombre =(select nombre from Nombres where id=(select 1+ROUND(RAND()*(70-1),0))) where id = (select id from inserted)
END
| true |
b56651619919870003bbe7ce29cfac2f9c678438 | SQL | gurpreet19/ec198392_wht | /Database/06_CVX_template/01_RP_Packages/RPDP_FIN_PERIOD.sql | UTF-8 | 5,629 | 2.609375 | 3 | [] | no_license |
-- START PKG_GEN_PKGS.sf_get_functions at:05/07/2019 11.49.20 AM
CREATE or REPLACE PACKAGE RPDP_FIN_PERIOD
IS
FUNCTION GETCOMPANYIDBYAREACODE(
P_OBJECT_ID IN VARCHAR2,
P_DAYTIME IN DATE,
P_BOOKING_AREA_CODE IN VARCHAR2)
RETURN VARCHAR2;
FUNCTION CHKPERIODEXISTBYOBJECT(
... | true |
f2224eed7c8482f3620d9d36ffa8a8d69838556e | SQL | narahda/pern-stack | /server/app/database/database.sql | UTF-8 | 252 | 2.59375 | 3 | [] | no_license | CREATE DATABASE people;
CREATE TABLE users(
id uuid DEFAULT uuid_generate_v4() ,
username VARCHAR(255) NOT NULL ,
pwd VARCHAR(255) NOT NULL
);
CREATE TABLE links (
link_name VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL
); | true |
ed9659cdf6d100cbc65c29af7e4698593bbd7e68 | SQL | moutainhigh/muyclound-master | /sql/order/v1.0.0.sql | UTF-8 | 2,927 | 3.921875 | 4 | [] | no_license | -- ----------------------------
-- Table structure for my_order
-- ----------------------------
DROP TABLE IF EXISTS `my_order`;
CREATE TABLE `my_order` (
`id` bigint(20) NOT NULL DEFAULT '0' COMMENT '主键',
`order_code` varchar(20) DEFAULT '' COMMENT '订单编码',
`user_id` int(11) DEFAULT '0' COMMENT '用户编号',
`order_s... | true |
d5d170914ac8845e3e0e0e7ea3ea1466191b71cd | SQL | Ashish-9/File-Tracking-System | /DB/fts.sql | UTF-8 | 3,371 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 02, 2017 at 06:18 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
4e0d3970789829740ec4504227dae082ab4588b6 | SQL | osherz/DataBases.Market | /backend/querys/max_manu_cuntry.sql | UTF-8 | 267 | 3.9375 | 4 | [] | no_license | select C.id as id, C.country_name, count(C.id) as product_cnt
from product
join Manufacturer on product.manufacturld = Manufacturer.id
join country C on Manufacturer.countryid = C.id
group by C.id, C.country_name
order by product_cnt desc
limit 1
| true |
f960ffee9aef9d8bf195be0536db05cc8d3472cf | SQL | jocey10691/Homework1_SQL | /Homework3.sql | UTF-8 | 3,242 | 4.28125 | 4 | [] | no_license | #Homework #3
#There are six users, and four groups.
#Modesto and Ayine are in group “I.T.”
#Christopher and Cheong woo are in group “Sales”.
#There are four rooms: “101”, “102”, “Auditorium A”, and “Auditorium B”.
#Saulat is in group “Administration.”
#Group “Operations” currently doesn’t have any users assigned... | true |
b530ca9dbe142641c54c977fbb5de12179f2cc11 | SQL | anandeka/my-project | /DBScripts/ObjectsScripts/V_BI_RECENT_TRADES_BY_DER.sql | UTF-8 | 5,408 | 3.78125 | 4 | [] | no_license | CREATE OR REPLACE VIEW V_BI_RECENT_TRADES_BY_DER AS
select t2.corporate_id,
t2.product_id,
t2.product_name,
t2.instrument_id,
t2.contract_ref_no,
t2.trade_type,
to_date(t2.issue_date, 'dd-Mon-RRRR') issue_date,
t2.item_qty position_quantity,
t2.base_quant... | true |
81d4529bb3d78da167feb5fbc187de8241afc7af | SQL | TodoresteG/CSharp-DB | /MS SQL Server/Exam/Problem 6.Reports & Categories.sql | UTF-8 | 151 | 3.703125 | 4 | [] | no_license | SELECT r.[Description],
c.[Name] AS [CategoryName]
FROM Reports r
JOIN Categories c
ON r.CategoryId = c.Id
ORDER BY r.[Description] ASC, c.[Name] ASC | true |
cf8f061a8d746f0a220edcf829008b7e4aed976c | SQL | enzz5/TCC-E-Commerce | /tcc02/tcc01/(roda esse ) ecommerce.sql | UTF-8 | 2,947 | 3.546875 | 4 | [] | no_license | create database bd_ecommerce;
use bd_ecommerce;
create table tb_admin(
tb_admin_id integer not null auto_increment primary key ,
tb_admin_nome varchar(255) not null,
tb_admin_senha varchar(255) not null
);
create table tb_cliente(
tb_cliente_id integer not null auto_increment primary key,
tb_cliente_nome varchar(255... | true |
d353f2dd7708f20e2db228e60ba1476527f32da5 | SQL | soon14/project | /data/backup/1466475472/tables/sline_email_msg.sql | UTF-8 | 408 | 2.53125 | 3 | [] | no_license | -- 表的结构:sline_email_msg --
CREATE TABLE `sline_email_msg` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msgtype` char(30) DEFAULT NULL COMMENT '消息类型',
`msg` varchar(255) DEFAULT NULL COMMENT '消息',
`isopen` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否开启',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT ... | true |
471191e88561228b85f1bfee17105a1b9743df94 | SQL | dmitrybezro/projectNC | /database/objects.sql | UTF-8 | 288 | 2.859375 | 3 | [] | no_license | CREATE TABLE public.objects
(
obj_id integer NOT NULL,
par_id integer,
obj_name character varying(512) COLLATE pg_catalog."default",
obj_doc date,
CONSTRAINT objects_pkey PRIMARY KEY (obj_id)
)
TABLESPACE pg_default;
ALTER TABLE public.objects
OWNER to postgres; | true |
1bbc5dbf7cc0ecdac27937a6e14144885c6ead33 | SQL | RamonOga/job4j_design | /chapter_003/src/main/java/ru/job4j/postgresql/scripts/cars/query.sql | UTF-8 | 827 | 3.84375 | 4 | [] | no_license | -- 1. Вывести список всех машин и все привязанные к ним детали.
select c.name as car, b as Body, t as Transmission, e as Engine from car c
join body b on c.body_id = b.id
join transmission t on c.trans_id = t.id
join engine e on c.engine_id = e.id;
-- 2. Вывести отдельно детали, которые не используются в машине, кузо... | true |
3a805bb10abc4435a6541aaebfd31e6368334ea7 | SQL | jimmy6/jimmy6 | /j6template/j6/SQL/j6.oracle.sql | UTF-8 | 2,644 | 3.484375 | 3 | [] | no_license |
drop table APP_PREDEFINED_VALUE cascade constraints;
drop table APP_USER cascade constraints;
drop table APP_USER_IN_ROLE cascade constraints;
drop table APP_USER_ROLE cascade constraints;
create table APP_PREDEFINED_VALUE (
type varchar2(31) not null,
code varchar2... | true |
3bf34e514ce94c38126bbea757f31a80c58a99f2 | SQL | emerson-cs-santos/TSI-PI_2-2019 | /SQL/Script.sql | UTF-8 | 4,831 | 3.515625 | 4 | [] | no_license | -- BANCO DE DADOS
DROP DATABASE IF EXISTS SENAC_PI;
CREATE DATABASE IF NOT EXISTS SENAC_PI;
USE SENAC_PI;
-- Habilitar update no banco de dados
SET SQL_SAFE_UPDATES = 0;
-- TABELA DE USUARIOS
CREATE TABLE IF NOT EXISTS usuarios
(
codigo INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY
,nome VARCHAR(20) NOT NULL
... | true |
ba9c9802332a1d6642cfe4fefb938481f5ef62c6 | SQL | melissamonroe/sql-challenge | /EmployeeSQL/employee-schema.sql | UTF-8 | 1,589 | 4 | 4 | [] | no_license | select * from titles limit 100;
select * from salaries limit 100;
select * from dept_emp limit 100;
select * from dept_manager limit 100;
select * from departments limit 100;
select * from employees limit 100;
drop table IF EXISTS salaries;
drop table IF EXISTS titles;
drop table IF EXISTS dept_emp;
drop table IF EXIS... | true |
ef740bb5dd2ee278a94ecf8b903360a64463faed | SQL | AlexFridman/DM-DBMS | /1 term/LabWork6/LabWork6.sql | UTF-8 | 2,018 | 4.21875 | 4 | [] | no_license | -- 3.1
SELECT COUNT(*) FROM ORDERS;
-- 3.2
SELECT COUNT(*),
SUM(GOODS_ORDERS.PRICE * GOODS_ORDERS.AMOUNT)
FROM ORDERS
JOIN GOODS_ORDERS
ON ORDERS.ORDER_ID = GOODS_ORDERS.ORDER_ID
WHERE ORDERS.ORDER_ID = 5;
-- 3.3
SELECT NVL(SUM(ARRIVE_STOCKS.AMOUNT),0)
FROM SUPPLIERS
JOIN ARRIVE_STOCKS
ON SUPPLIERS.MANAGER_SUPPLIE... | true |
37262c412bbc2a9233f80522acebb8545ac85271 | SQL | Malab12/IBM_DBMS_Course | /Week6_Lab4.sql | UTF-8 | 972 | 3.734375 | 4 | [] | no_license | --Question 1
select f_name, l_name, start_date
from employees inner join job_history
on emp_id = empl_id
where dept_id = 5;
--Question 2
select f_name, l_name, start_date, job_title
from employees as e inner join job_history as jh
on e.emp_id = jh.empl_id
inner join jobs as j
on e.job_id = j.job_ident
where e.dep_id =... | true |
ee307abd7d6e7e1b67b1477fa2b689875c95a75e | SQL | widurinaf/Laravel-B-1B | /contactus.sql | UTF-8 | 1,682 | 2.8125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.8-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5599
-- -------------------------------------------... | true |
1dd0395615f7bf5649d624401aa95e66da3bec67 | SQL | efelton/property-website-project | /application/sql/property.sql | UTF-8 | 6,860 | 3.375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 20, 2013 at 01:04 AM
-- Server version: 5.6.11
-- PHP Version: 5.5.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
229889a5112653f6b5f140388e794128aa2d6aa8 | SQL | equanz/key-notify-server | /database/table_pos.sql | UTF-8 | 348 | 2.96875 | 3 | [
"MIT"
] | permissive | CREATE TYPE state AS ENUM('ON','OFF'); -- state(ENUM)型定義
CREATE TABLE key_info(
TIME TIMESTAMP WITH TIME ZONE NOT NULL, --アクション時刻
state state NOT NULL, --鍵の状態
key_info_id SERIAL NOT NULL PRIMARY KEY --ID
);
CREATE TABLE app_id(
id SERIAL NOT NULL PRIMARY KEY, -- ID
app_id VARCHAR(48) NOT NULL -- app_id
);
| true |
126c237f5fe3ec4ad7d6bff2e812157cfd4da556 | SQL | vicky499/PROJECT | /bank_package_specification.sql | UTF-8 | 2,828 | 3.328125 | 3 | [] | no_license | -----------------------------------------
-- PACKAGE SPECIFICATION FOR BANK_PACK
------------------------------------------
CREATE OR REPLACE PACKAGE CITI_BANK IS
-- PROCEDURE SPECIFICATION FOR ADD CUSTOMER
-------------------------------------------... | true |
7b58c05f75cedd32bb677e7dbfdb07f902df5391 | SQL | j7ng/CLFY_SA | /SA/Functions/ADFCRM_RET_B2B_INFO.sql | UTF-8 | 8,707 | 3.03125 | 3 | [] | no_license | CREATE OR REPLACE FUNCTION sa."ADFCRM_RET_B2B_INFO" (ip_site_objid varchar2, ip_x_cust_id varchar2, ip_web_addr_email varchar2, ip_esn varchar2)
return adfcrm_esn_structure is
esn_tab sa.adfcrm_esn_structure := sa.adfcrm_esn_structure();
-- ip_site_objid varchar2(30) := null;
-- ip_x_cust_id varchar2(30) := '113... | true |
2240af07dce097a4fc5bb960416c422965fff18f | SQL | vijaydairyf/TimelyFish | /SolomonApp/dbo/Stored Procedures/dbo.pCF102PigPurchase.sql | UTF-8 | 477 | 2.828125 | 3 | [] | no_license | --*************************************************************
-- Purpose:PV for Pig Purchase
-- Author: Charity Anderson
-- Date: 2/18/2005
-- Usage: Pig Purchase Agreement
-- Parms: @parm1 (PPID)
--
--*************************************************************
CREATE PROC dbo.pCF102PigPurchase
@parm1 as ... | true |
df37b29fb6a25a2dcc26d9ebdf212a63289d9172 | SQL | solomon585858/mysql | /topic6/task3_4_5_queries.sql | UTF-8 | 2,308 | 4.5625 | 5 | [] | no_license | --3.Определим кто больше поставил лайков (всего) - мужчины или женщины (для получения разбивки по всем полам достаточно будет убрать LIMIT 1 из запроса):
SELECT
(SELECT gender from profiles WHERE profiles.user_id = likes.user_id) AS gender,
COUNT(*) AS 'Number of likes'
FROM likes
GROUP BY gender
... | true |
355c3389a415fad4726f44e690b49f07394a4340 | SQL | mrbkiter/funbet | /funbet-backend/src/main/resources/db/migration/V0_0_9__add_table.sql | UTF-8 | 434 | 3.75 | 4 | [
"MIT"
] | permissive | DROP TABLE IF EXISTS tournament_other_fee;
CREATE TABLE IF NOT EXISTS tournament_other_fee
(
id serial PRIMARY KEY,
tournament_id INTEGER,
other_fee INTEGER NOT NULL,
note TEXT,
insert_timestamp TIMESTAMP WITH TIME ZONE DEFAULT now(),
CONSTRAINT ttournament_other_fee_tournament_id__fkey FOREIGN ... | true |
e3d9b7812adadf6fcf678ec5718dd90fa47c89cf | SQL | GuHenry/ExemploEntityFramework | /Estrutura.sql | UTF-8 | 523 | 3.09375 | 3 | [] | no_license | DROP TABLE IF EXISTS habilidades
DROP TABLE IF EXISTS animais;
CREATE TABLE animais(
id INT PRIMARY KEY IDENTITY(1,1),
nome VARCHAR(100),
extinto BIT
);
SELECT * FROM animais;
--ALTER TABLE animais ADD peso DECIMAL(4,2) DEFAULT 0.0
--UPDATE animais SET peso = 0;
--ALTER TABLE animais DROP CONSTRAINT DF__animais__p... | true |
178c17825317f2948fd745f115fae15c7360d601 | SQL | pdvmoto/pg_scripts | /spin.sql | UTF-8 | 1,122 | 3.234375 | 3 | [] | no_license |
/*
how fast can an empty loop spin ?
keep values in XLS, but 1-2-4-8-16 sec fairly consistent
later:
- select 1 record over an index, how many per sec ?
- delete 1 record over an index
- update 1 record over an index, how many per sec ?
also:
- how to measure/eliminate overhead of while-loop ? u... | true |
d4ab6598223cd57445c03145d3817296922962d0 | SQL | kmelv41/Retrosheet-MySQL | /scripts/new_lkup_id_tbls.sql | UTF-8 | 1,707 | 2.96875 | 3 | [] | no_license | CREATE TABLE `lkup_id_players` (
`ID` varchar(20) DEFAULT NULL,
`LAST` varchar(50) DEFAULT NULL,
`FIRST` varchar(50) DEFAULT NULL,
`DEBUT` date DEFAULT NULL
) ENGINE=INNODB DEFAULT CHARSET=latin1;
CREATE TABLE `lkup_id_managers` (
`ID` varchar(20) DEFAULT NULL,
`LAST` varchar(50) DEFAULT NULL,
`FIRST` va... | true |
371d7b4568f0f8729fee19995e32aa4eb4e2e7f4 | SQL | Orange-OpenSource/optisam-backend | /simulation-service/pkg/repository/v1/postgres/scripts/1_configure.sql | UTF-8 | 1,297 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | -- docker run --name optisam -p 5432:5432 -e POSTGRES_DB=optisam -e POSTGRES_USER=optisam -e POSTGRES_PASSWORD=optisam postgres
-- docker cp 1_configure.sql optisam:/
-- docker exec -it optisam psql -d optisam -U optisam -w -f 1_configure.sql
CREATE TABLE IF NOT EXISTS status (
id SERIAL PRIMARY KEY,
text VARCHA... | true |
1c4f1584a022d77af6d1c113a660afe75ced8bde | SQL | bkchu/dm12-simulation-2 | /db/delete_property.sql | UTF-8 | 272 | 2.96875 | 3 | [] | no_license | DELETE FROM property p
WHERE p.userid = $1 AND p.id = $2;
SELECT p.id, p.property_name, p.description, p.loan, p.mortgage, p.recommended_rent, p.desired_rent, p.address, p.city, p.state, p.zip, p.picture_url FROM property p
JOIN users u ON u.id = p.userid
WHERE u.id = $1; | true |
427a0a1007ce06046cb84f3b87cf67664f5e4856 | SQL | bcgov/gwells | /app/database/scripts/registries/post-deploy.sql | UTF-8 | 27,858 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | ALTER TABLE registries_activity_code ALTER COLUMN effective_date SET DEFAULT CURRENT_DATE;
ALTER TABLE registries_subactivity_code ALTER COLUMN effective_date SET DEFAULT CURRENT_DATE;
ALTER TABLE registries_well_class_code ALTER COLUMN effective_date SET DEFAULT CURRENT_DATE;
ALTER TABLE registries_well_qualification ... | true |
8d74feadf4d7db791ed7e492e8c23e757a0ce9e4 | SQL | jiushiwo2018/django_pro | /oss/website/db_update/1.14.1.sql | UTF-8 | 863 | 3.484375 | 3 | [] | no_license | use oss2_base_test;
-- Add column auto_task_id for IFWI projects
-- in which user can promote daily reports to Purple/Orange
ALTER TABLE `cycle`
ADD COLUMN `auto_task_id` INT(11) UNSIGNED NULL AFTER `cfg_set_id`,
ADD CONSTRAINT `cycle_auto_task_FK` FOREIGN KEY (`auto_task_id`) REFERENCES `auto_task` (`id`) ON UPD... | true |
76cf692339e4991a9eb4df258b4d857ae4140e77 | SQL | theDibo/fit2076-ass2 | /Documentation/table_creation_schema.sql | UTF-8 | 3,808 | 3.953125 | 4 | [] | no_license | /* Delete all existing tables and sequences */
DROP SEQUENCE buyer_seq;
DROP SEQUENCE feature_seq;
DROP SEQUENCE listing_seq;
DROP SEQUENCE picture_seq;
DROP SEQUENCE property_seq;
DROP SEQUENCE propertytype_seq;
DROP SEQUENCE seller_seq;
DROP TABLE Listing;
DROP TABLE Picture;
DROP TABLE PropertyFeature;
DROP TABLE F... | true |
e4594e9e202a7346f053cedfa057f2d34e5dca49 | SQL | acmyonghua/crm | /sql/crm.sql | UTF-8 | 2,815 | 3.625 | 4 | [] | no_license | DROP DATABASE IF EXISTS willi314_crm;
CREATE DATABASE willi314_crm;
USE willi314_crm;
CREATE TABLE cliente (
cliente_id INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
cliente_razao_social VARCHAR(255) NOT NULL,
cliente_nome_fantasia VARCHAR(255) NOT NULL,
cliente_telefone_fixo VARCHAR(20) NOT NU... | true |
0162e452aaa0cfba953a951961fea62fae5efa8b | SQL | MaximOkulin/EnergyTechAudit.PowerAccounting | /EnergyTechAudit.PowerAccounting.Database/Dictionaries/Dictionaries.ErrorType.sql | UTF-8 | 211 | 2.65625 | 3 | [] | no_license | CREATE TABLE [Dictionaries].[ErrorType]
(
[Id] INT NOT NULL IDENTITY(1,1),
[Code] NVARCHAR(64) NOT NULL,
[Description] NVARCHAR(128) NOT NULL,
CONSTRAINT [PK_Dictionaries_ErrorType] PRIMARY KEY ([Id])
)
| true |
dcb396ef9f3aac62778e341e337f04b76d8db62f | SQL | joao-bolsson/ferrovia | /ferrovia.sql | UTF-8 | 3,889 | 3.5 | 4 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
CREATE TABLE `engenh... | true |
6cd73b61144eddd9b300dd1eb0497bb9dc1c4694 | SQL | flexa-cz/_scripts | /geo_location_by_ip/db_structure.sql | UTF-8 | 2,683 | 3.953125 | 4 | [] | no_license | CREATE TABLE `geolocation_countries` (
`id` int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
`country` varchar(50) COLLATE 'utf8_czech_ci' NOT NULL,
`country_code` varchar(10) COLLATE 'utf8_czech_ci' NOT NULL
) COMMENT='staty a jejich zkratky' ENGINE='InnoDB' COLLATE 'utf8_czech_ci';
CREATE TABLE `geolocation_r... | true |
3adca4f9246616a6418681ad9b2eae3189a0dad9 | SQL | ranrandolphin/Database_stanford | /SQL _movie_rating_query_extra.sql | UTF-8 | 3,065 | 4.875 | 5 | [] | no_license | -- 1. Find the names of all reviewers who rated Gone with the Wind.
SELECT DISTINCT Reviewer.name
FROM Movie
JOIN Rating on Movie.mID = Rating.mID
JOIN Reviewer on Rating.rID = Reviewer.rID
WHERE Movie.title = "Gone with the Wind"
AND Rating.stars IS NOT NULL;
-- 2. For any rating where the reviewer is the same as t... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.