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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a7dadcd2c30cdbb69cd12b60e43870c0b9168c6d | SQL | Szandra01/AFP2_Genshin | /Backend/src/test/resources/genshop.sql | UTF-8 | 4,781 | 3.140625 | 3 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
USE genshop;
CREATE TABLE IF NOT EXISTS `buy` (
`id` int(11) NOT NULL,
`count` int(11) NOT NULL,
`date_time` date DEFAULT NULL,
`order_number` varchar(255) COLLATE utf8_hungarian_ci DEFAULT NULL,
`prices` int(11) N... | true |
e87b541c2f759a139d4e9c1df345eead398fa82c | SQL | CCWNC-DEVELOPER/aspnetdb_WebInterface | /SQL/JUNK4.SQL | UTF-8 | 3,167 | 4 | 4 | [] | no_license | --JUNK4.SQL
-- Left: All UserId linked to the particular Application
-- Left outer Join
-- Right: the existing set of UserID and RoleId linked to the particular Application
-- ON UserID
--||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---- Left: All UserId linked to the particular Application... | true |
654e628697c654572efb0fcbfee0703aa19d4ef8 | SQL | warisali2/cms | /sql/createTables.sql | UTF-8 | 5,229 | 3.953125 | 4 | [] | no_license | CREATE TABLE country
(
countryID INT AUTO_INCREMENT NOT NULL,
countryName VARCHAR(100) NOT NULL,
PRIMARY KEY(countryID),
UNIQUE (countryName)
);
CREATE TABLE city
(
cityID INT NOT NULL,
cityName VARCHAR(100) NOT NULL,
countryID INT NOT NULL,
PRIMARY KEY(cityID, countryID),
FOREIGN KEY(countryID) RE... | true |
ffcc1327307b7544f1a7ad06d6cfb22e8465f90c | SQL | gyod/l2jtw_pvp_server | /dp/dist/sql/game/teleport.sql | UTF-8 | 123,669 | 2.59375 | 3 | [] | no_license | SET NAMES utf8;
DROP TABLE IF EXISTS `teleport`;
CREATE TABLE `teleport` (
`Description` varchar(75) DEFAULT NULL,
`id` mediumint(7) unsigned NOT NULL DEFAULT '0',
`loc_x` mediumint(6) DEFAULT NULL,
`loc_y` mediumint(6) DEFAULT NULL,
`loc_z` mediumint(6) DEFAULT NULL,
`price` int(10) unsigned DEFAULT NULL,
... | true |
8d5a76687db9889608629f98d9275467529a253d | SQL | himanshu07Rai/dn | /prisma/migrations/20211014121334_first/migration.sql | UTF-8 | 651 | 4.0625 | 4 | [] | no_license | -- CreateTable
CREATE TABLE "User" (
"user_id" TEXT NOT NULL,
"user_name" TEXT NOT NULL,
"user_email" TEXT NOT NULL,
"user_password" TEXT NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("user_id")
);
-- CreateTable
CREATE TABLE "Todo" (
"todo_id" SERIAL NOT NULL,
"description" TEXT NOT NULL,... | true |
1348a92b72220d7e74d2e25f8a7156e62623794d | SQL | edson-github/postgresql-useful-scripts | /postgresql/dev_postgres_database/public/functions/useful_structure_queries.sql | UTF-8 | 9,507 | 4.25 | 4 | [
"MIT"
] | permissive | -----------------------------------------------
-- RELATED WITH SCHEMAS
-----------------------------------------------
-- To list schemas names
SELECT
n.nspname
FROM
pg_namespace n
ORDER BY
n.nspname ;
-----------------------------------------------
-- RELATED WITH SEQUENCES
------------------------------... | true |
abba2a05285c7cb674bd0cc1c1e72709d0fd2a6d | SQL | luzac3/timeKeeper | /sql/procedure/getEvntMstr.sql | UTF-8 | 1,348 | 3.484375 | 3 | [] | no_license | DROP PROCEDURE IF EXISTS getEvntMstr;
DELIMITER //
-- ********************************************************************************************
-- getEvntMstr イベントマスタを取得する
--
-- 【処理概要】
-- イベントマスタを取得する
--
--
-- 【呼び出し元画面】
-- リスト
--
-- 【引数】
-- _evnt_cd : イベントコード
--
--
-- 【戻り値】
-- exit_cd : e... | true |
9b75323c6259add60819258b61469ec8fbac66cc | SQL | blessedchitamba/church_admin_portal | /group_i_db.sql | UTF-8 | 13,162 | 3.390625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 15, 2020 at 01:47 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
12cb1ee2416fb5e887b289a9375a0fc74c82bf27 | SQL | MantapBetul/MenKeuWebpt2 | /db/manajemenkeuangan.sql | UTF-8 | 4,395 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 22, 2020 at 04:06 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c6c744dcabdeff886261d42d98a844c15b1fe318 | SQL | soug2914/plasma_donor-form.github.io | /plasma_donar.sql | UTF-8 | 2,107 | 2.984375 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.8-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.3.0.5771
-- -------------------------------------------... | true |
5952a9f34e03911ab776fb2774c674de66185bdf | SQL | Stanislav-vsv/Oracle | /Запросы/1 проверка.sql | WINDOWS-1251 | 2,870 | 3.4375 | 3 | [] | no_license | with
boy as (
select '' sistem, I1.VALUE_DAY,I1.GL2ACCOUNT_UK,I1.GL2ACCOUNTNCODE,I1.ACCOUNTCLAUSE_BAL_UK,A1.ACCOUNTCLAUSE_NUMBER, sum(I1.BALANCE_USD_AMT) sum_usd
from
DMFR.IFRSBALANCE_STAT i1
left join
DMFR.ACCOUNTCLAUSE_SDIM a1
on I1.ACCOUNTCLAUSE_BAL_UK = a1.uk
... | true |
213e6fb05ea163eee9ac19615db1edd8c0689727 | SQL | nevo-case/nevo-case.github.io | /baza.sql | UTF-8 | 13,869 | 3 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10.12
-- http://www.phpmyadmin.net
--
-- Хост: 10.0.0.168:3309
-- Время создания: Янв 06 2016 г., 12:50
-- Версия сервера: 5.5.44-37.3-log
-- Версия PHP: 5.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... | true |
1dd5aa3231af5fff9d23e2989fff689db3b57c89 | SQL | CSCfi/antero | /db_archive/sql_archive/143__dw_create_table_f_avop_live.sql | UTF-8 | 1,500 | 3.5 | 4 | [
"MIT"
] | permissive | IF NOT EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='dw' and TABLE_NAME='f_avop_live') BEGIN
CREATE TABLE dw.f_avop_live (
id int IDENTITY(1,1) NOT NULL,
loadtime datetime NOT NULL,
username varchar(30) NOT NULL,
source varchar(100) NOT NULL,
d_organisaatio_id int not null,
d_koulutu... | true |
6da5ed5e86d95eceae692bdc550230afe18ac0e4 | SQL | LongFeb/Day50 | /ssm_project/src/main/resources/project.sql | UTF-8 | 4,235 | 3.84375 | 4 | [] | no_license | #1.动态条件查询资质信息
#a.关联查询出所有资质信息
select * from qualification qu
LEFT JOIN
sys_user uu
on
qu.upload_user_id=uu.id #uu 上传用户
LEFT JOIN
sys_user cu # cu审核用户
ON
qu.check_user_id=cu.id
#b.根据条件关联查询
select * from qualification qu
LEFT JOIN
sys_user uu
on
qu.upload_user_id=uu.id #uu 上传用户
LEFT JOIN
sys_user cu ... | true |
9ef1fabd8461d3e70121543eba391cc89ddb1036 | SQL | ice-devel/mi2-2021-html-sql-algo-js | /2-sql/5-exercice.sql | UTF-8 | 1,366 | 4.1875 | 4 | [] | no_license | -- Ecrivez les requêtes SQL qui sélectionnent :
-- Les joueurs qui habitent Paris (75000), et qui ont plus de 75 points,
-- ainsi que les joueurs qui habitent Lille
-- et qui ont plus de 50 points
SELECT * FROM player
WHERE zipcode = '75000' AND points > 75
OR zipcode = '59000' AND points > 50;
-- Les joueurs qui hab... | true |
542f1b45bf4a2b032ed77527601354d9c9cb80e8 | SQL | RAA1989/votingsystem | /src/main/resources/db/initDB_hsql.sql | UTF-8 | 1,882 | 4 | 4 | [] | no_license | DROP TABLE user_roles IF EXISTS;
DROP TABLE meals IF EXISTS;
DROP TABLE menus IF EXISTS;
DROP TABLE votes IF EXISTS;
DROP TABLE restaurants IF EXISTS;
DROP TABLE users IF EXISTS;
DROP SEQUENCE global_seq IF EXISTS;
CREATE SEQUENCE GLOBAL_SEQ AS INTEGER START WITH 100000;
CREATE TABLE users
(
id INTEG... | true |
64705e862c89aa89ae019b4a9b5e9d1973b4fe09 | SQL | smwhr/ticketapi | /data/ticketing.sql | UTF-8 | 1,730 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 10, 2019 at 03:08 PM
-- Server version: 10.3.11-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
929eded8f5056f325ff1dd65108837b96a1650a7 | SQL | adamyong-zbf/EasyW | /easyw/schema.sql | UTF-8 | 464 | 3.078125 | 3 | [
"MIT"
] | permissive | drop table if exists images;
create table images (
id integer primary key autoincrement,
path text not null,
create_time date default current_timestamp,
modify_time date default current_timestamp
);
drop table if exists users;
create table users (
id integer primary key autoincrement,
username text not nul... | true |
174482086756de4674edc96c9e82335c7a54cc2f | SQL | geekymv/ccms | /sql/db.sql | UTF-8 | 5,684 | 3.71875 | 4 | [] | no_license | /*学分认证管理系统*/
create database ccms;
use ccms;
/*学院/单位*/
create table t_colleges(
id int primary key auto_increment,
account varchar(20) unique not null, /*登录账号唯一*/
name varchar(20) unique not null, /*学院名称唯一*/
pwd varchar(30), /*登录密码*/
phone varchar(20), /*电话号码*/
contact varchar(20), /*联系人姓名*/
addre... | true |
f73da5e3719202f56618b2c6b0d0a432ef044600 | SQL | mhavoic/eclub-RESTful-api | /SQL/eklub.sql | UTF-8 | 16,525 | 3.203125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 05, 2018 at 09:48 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 5.6.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
3712442f054360e00775a7f819f40ce9acac6378 | SQL | enriqueplace/surforce-gestionproyectos | /surforce-gestionproyectos/sql/gestionproyectos.sql | WINDOWS-1250 | 3,637 | 2.859375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Servidor: mysql.linux.com.uy
-- Tiempo de generacin: 21-02-2007 a las 09:36:17
-- Versin del servidor: 5.0.24
-- Versin de PHP: 4.4.4
--
-- Base de datos: `gestionproyectos`
--
-- --------------------------------------------------... | true |
c4d973223e849956ddd918cced0c95d1795ce7c3 | SQL | enxy0/labs-sql | /Задание 1-1 (Модификация данных)/9-13.sql | UTF-8 | 579 | 3.125 | 3 | [
"MIT"
] | permissive | UPDATE книги
SET издательство = (
SELECT ид_изд
FROM [Книги-ру].dbo.издательства
WHERE издательство = 'Abatis Publishers'
)
WHERE книги.издательство in (
SELECT книги.издательство
FROM [Книги-ру].dbo.издательства
INNER JOIN книги ON книги.издательство = и... | true |
48c00f48aeef3b50cf5773a7f50b7b44a17f202b | SQL | savadev/SQL-3 | /leet_176.sql | UTF-8 | 336 | 3.65625 | 4 | [] | no_license | # Runtime: 397 ms, faster than 5.02% of MySQL online submissions for Second Highest Salary.
# Memory Usage: 0B, less than 100.00% of MySQL online submissions for Second Highest
select max(Salary) as SecondHighestSalary
from (
select * from Employee
where Salary < (select max(Salary)
from E... | true |
233505479ab09577a1d85d12b9939e133b6cf1dc | SQL | tzuyi9513/Database-design-for-school-with-SQL | /Query6.sql | UTF-8 | 530 | 3.859375 | 4 | [] | no_license | /*
6. Do students in different majors have lots of differences in their GPA performance?
From this analysis, to the university’s surprise, the highest average is the undergraduate students in the Financial department.
Also, graduate students in the Financial department also rank 3 in average GPA.
*/
SELECT s.Degre... | true |
f9c4262e3835bfa537a6b959122f59472d72d950 | SQL | chrisstone07/react-mysql-login-demo | /my_tweet.sql | UTF-8 | 3,632 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-09-2018 a las 21:21:20
-- Versión del servidor: 5.7.14
-- Versión de PHP: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... | true |
bca5d4e37bcc584b0330eb4ca7b303c36c3e5977 | SQL | hillerlab/CESAR2.0 | /kent/src/hg/lib/wiggle.sql | UTF-8 | 1,277 | 3.34375 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | # wiggle.sql was originally generated by the autoSql program, which also
# generated wiggle.c and wiggle.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Wiggle track values to display as y-values (first 6 fields are bed6)
CREATE TABLE w... | true |
31193b12112dae6a1242d91749bc53c414f93512 | SQL | mgoldyadrian/Project_Data_Analysis_for_B2B_Retail_Analytics_Report | /customer-growth.sql | UTF-8 | 2,677 | 4.28125 | 4 | [] | no_license | # Is the number of customers growing?
SELECT quarter, COUNT(customerID) AS total_customers
FROM (SELECT customerID, createDate, '1' AS quarter
FROM customer WHERE createDate BETWEEN '2004-01-01' AND '2004-03-31'
UNION
SELECT customerID, createDate, '2' AS quarter
FROM customer WHERE createDate BETWEEN '2004-04-01' AND... | true |
bc679cf67604f2ab4cb0d8a603a0ad39723a06b8 | SQL | ChichiuLiang/ruoyiadmin | /sql/quartz.sql | UTF-8 | 8,633 | 3.65625 | 4 | [
"MIT"
] | permissive | -- ----------------------------
-- 1、存储每一个已配置的 jobDetail 的详细信息
-- ----------------------------
create table qrtz_job_details
(
sched_name varchar2 (120) not null,
job_name varchar2 (200) not null,
job_group varchar2 (200) not null,
description varchar2 (250) null,
job_class_name varchar2 (250) not n... | true |
64dc4ab4dd38f227d68ffd4cc96ff4c91320d43d | SQL | ZhangDi0717/TheManageSystemOfFactory | /goodgoods.sql | UTF-8 | 22,195 | 2.84375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : 192.168.1.2-MyAQL
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : goodgoods02
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 0... | true |
d0c6576e825b45a0f5f899dfb09a291a8562a47d | SQL | steevy007/ORACLE_SESSION_2-Project- | /EXO_PLSQL_PACKAGE1.sql | UTF-8 | 4,073 | 3.71875 | 4 | [] | no_license | --specification package
create package gestion_inscription1 is
procedure affich_inscription;
function lister_inscription return number;
PROCEDURE lister_inscr_id(id inscription.I_id%type);
procedure insert_inscr(id inscription.I_ID%type,idE inscription.E_id%type,typeI inscription.I_TYPE%type,dateI inscription.I_DATE... | true |
61fc8ff5f3856f506a22ab6cd982163bbf5b4b88 | SQL | tuxevil/FashionAde | /db/Scripts/.svn/text-base/db.01.00.0001.sql.svn-base | UTF-8 | 795 | 2.890625 | 3 | [] | no_license | update garments set Type = 2 where garmentid in (select garmentid from usergarment);
update categories set description = 'Tops' where description = 'Shirts';
ALTER TABLE garmentdetails
CHANGE PurchasedOn PurchasedOn DATE;
UPDATE eventtypes SET ShortName = 'Play' WHERE EventTypeId = 1;
UPDATE eventtypes SET ShortNa... | true |
6a590902860d6d2ee0aed37952eeebdbd0ca5b23 | SQL | allan3723/SQL-Graphviz-Parser | /riversea.sql | UTF-8 | 176 | 2.96875 | 3 | [] | no_license | SELECT distinct River.Name
FROM river_to_sea, River
WHERE river_to_sea.River = River.Name;
SELECT distinct Sea.Name
FROM river_to_sea, Sea
WHERE river_to_sea.River = Sea.Name; | true |
7aae4f207c6c92d80276b07c7451110ef2732615 | SQL | SlavaAtamanskiy/Contacts-management | /ddl/package.sql | UTF-8 | 12,219 | 3.53125 | 4 | [] | no_license | --------------------------------------------------------
-- DDL for Package CONTACTS_MANAGEMENT
--------------------------------------------------------
CREATE OR REPLACE PACKAGE "CONTACTS_MANAGEMENT" as
PROCEDURE insert_contacts (
p_table_name IN VARCHAR2,
p_sequence_val IN NUMBER);
PROCEDURE d... | true |
36c39e6a047ea6f822410b81fb6b7cf5587adbfe | SQL | kalregi/quest_for_biomarkers | /bin/database/etl_scipts/create_subsets_tinytests.sql | UTF-8 | 1,966 | 3.8125 | 4 | [] | no_license | a-- Adding a limited subset for testing purposes
--NAME (tiny test 1): TT1
COMMIT;
INSERT INTO subset_group (
base_name,
description
) VALUES (
'TT1',
'Small test set (1 set consists of 2 element)'
);
select * from subset_group;
COMMIT;
SELECT
*
FROM
subset_group;
DROP TABLE tmp_seq... | true |
672b5335eb7f16dd60b01295bec38f5c5cc496a3 | SQL | DenisKostyukov/database | /sql/fm_connection.session.sql | UTF-8 | 7,328 | 4 | 4 | [] | no_license | DROP TABLE IF EXISTS users CASCADE;
/*
Используя документацию добавьте поля birthday, isMale
*/
/* */
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
firstname VARCHAR(64) NOT NULL CHECK(firstname != ''),
lastname VARCHAR(64) NOT NULL CHECK(lastname != ''),
email VARCHAR(256) NOT NULL CHECK(email !=... | true |
2554e2b683c74a2b4ae90941ef65760ba4b1201f | SQL | samPram/UD_Nafi | /dbArpinting.sql | UTF-8 | 5,700 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 02 Des 2019 pada 01.36
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... | true |
5884fe61727a6b51657254d2470b0f44d79c7702 | SQL | pichapob/SData | /SData/bin/Debug/DB/sd_va_tranf.sql | UTF-8 | 906 | 2.765625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50531
Source Host : localhost:3306
Source Database : hosxp_pcu
Target Server Type : MYSQL
Target Server Version : 50531
File Encoding : 65001
Date: 2017-10-03 15:22:00
*/
SET FOREIGN_KEY_CHECKS=0;
--... | true |
6158475b5b0cc59213f6ac78a953c65b5f25561a | SQL | ivanVillagralatorre/base-de-datos | /varias_tablas.sql | UTF-8 | 1,007 | 3.578125 | 4 | [] | no_license | --ej varias tabla
--ej1
select emple.apellido,
emple.oficio,
emple.emp_no,
depart.dnombre,depart.loc
from emple,depart
where emple.dept_no=depart.dept_no;
--ej2
select e.emp_no ,
e.apellido,
e.oficio,
d.loc
from emple e,depart d
where e.dept_no=d.dept_no
and upper(d.LOC) in('BARCELONA','MAD... | true |
4323d44dbe8ed9eec272cf9792cecd30364c97d4 | SQL | splicemachine/htap-benchmark | /src/com/oltpbenchmark/benchmarks/chbenchmark/queries/query10.sql | UTF-8 | 544 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | SELECT c_id,
c_last,
sum(ol_amount) AS revenue,
c_city,
c_phone,
n_name
FROM customer,
oorder,
order_line,
nation
WHERE c_id = o_c_id
AND c_w_id = o_w_id
AND c_d_id = o_d_id
AND ol_w_id = o_w_id
AND ol_d_id = o_d_id
AND ol_o_id = o_id
AND o_entry_d >= '2007-... | true |
25515949aa98c3086f856a1e7f0a02b72b5e3ef7 | SQL | Roger0917/spring_data_jpa_studentManage | /src/main/resources/schema.sql | UTF-8 | 792 | 3.390625 | 3 | [] | no_license | /*
CREATE TABLE `student` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`sid` INT(10) NOT NULL,
`name` varchar(200) NOT NULL,
`photo` VARCHAR (200) DEFAULT NULL ,
`sex` INT NOT NULL,
`birthday` DATE DEFAULT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;*/
/*
CREATE TABLE `g... | true |
38c2dc426c45449f77eab1ea7b21f2f3832f097d | SQL | Abezzi/AvisosMecanicosSoft2 | /BASE DE DATO/soft2.sql | UTF-8 | 20,015 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 01, 2018 at 02:03 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
dbd4952ff32f69a5f1e299ee3948352373766c86 | SQL | allwaysoft/DIVERSOS_PROJETOS | /Oracle/Capitulo_Restore/03a_Recuperacao_incompleta_tabela_dropada_BD_tempo.sql | UTF-8 | 957 | 3.296875 | 3 | [] | no_license | -- veja a data/hora atual o resultado de um select na tabela soe.customers e apague-a em seguida:
SQL> sqlplus / as sysdba
SQL> select to_char(SYSDATE, 'dd/mm/yyyy hh24:mi:ss') FROM DUAL; -- anote essa data/hora
SQL> select count(1) from soe.order_items;
SQL> drop table soe.order_items;
SQL> select coun... | true |
784e8fa4bfac39d703d3ec722e2b5f35783bb148 | SQL | ivanfretes/bd2-fpuna-solucionario | /ejercitario-02/10.sql | UTF-8 | 416 | 3.5 | 4 | [] | no_license | /*
Ejercicio 10
Utilice la función LAST_DAY para determinar si este año es bisiesto o no. Con CASE y con DECODE, haga aparecer la expresión ‘bisiesto’ o ‘no bisiesto’ según corresponda. (En un año bisiesto el mes de febrero tiene 29 días)
*/
SELECT
CASE EXTRACT(DAY FROM LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE,'YEAR'),... | true |
7904644d4763acb2bba5a9344a4f64d6ddf991a6 | SQL | michael-a19/teamProject | /teamapi/database/templogin.sql | UTF-8 | 435 | 2.71875 | 3 | [] | no_license | BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "User" (
"user_ID" INTEGER NOT NULL UNIQUE,
"user_fName" TEXT NOT NULL,
"user_lName" TEXT NOT NULL,
"user_type" TEXT DEFAULT 'Student',
"user_password" TEXT NOT NULL,
"user_email" TEXT NOT NULL UNIQUE,
PRIMARY KEY("user_ID" AUTOINCREMENT)
);
INSERT INTO "User" VALUES... | true |
c513fa0d81e4d3326335638a5557a94511d0d500 | SQL | lycy/shopping | /DB/shopping.sql | UTF-8 | 13,963 | 2.875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50711
Source Host : localhost:3306
Source Database : shopping
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2016-05-28 10:37:55
*/
SET FOREIGN_KEY_CHE... | true |
6332ad06e14cef5d81311c480d550bf9f291949a | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_CONIB.sql | GB18030 | 4,401 | 3.375 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_CONIB
ṹ:λͬ
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_CONIB;
drop index AK_TB_CONIB;
drop table TB_CONIB;
create table TB_CONIB (
CONIB_ID INTEGER ... | true |
8225169c69c1a7c924d4ff889895540aacd46c70 | SQL | alauda-spring-cloud-demo/auth-server | /src/main/resources/db/migration/V1_2__CreateUserSchema.sql | UTF-8 | 1,886 | 4.15625 | 4 | [] | no_license | /**
UserInfo Schema
*/
create table `users`(
id bigint unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50) not null,
password VARCHAR(60) not null,
account_non_expired boolean not null DEFAULT true,
credentials_non_expired boolean not null DEFAULT true,
account_non_locked boolean not null DEFAULT ... | true |
c9ea88837c16e7a078dae4473f2e9a6e102744f0 | SQL | hloiseau/Fusion | /Fusion/src/ITI.PrimarySchool.DB/Scripts/20182304142000.0029.Install-vContact.sql | UTF-8 | 231 | 2.671875 | 3 | [] | no_license | create view iti.vContact
as
select
ContactId = c.ContactId,
FirstName = c.FirstName,
LastName = c.LastName,
Mail = c.Mail,
PhoneNumber = c.PhoneNumber
from iti.tContact c
where c.ContactId <> 0; | true |
481234e2fb67d68a5ae10dd946e5b9d41c3217bc | SQL | codyaspen/DatabaseManagement | /Lab_5.sql | UTF-8 | 1,294 | 3.875 | 4 | [] | no_license | --Cody Eichelberger
--Lab 5
--1.
SELECT DISTINCT Agents.city
FROM Agents
INNER JOIN Orders
ON Agents.aid = Orders.aid
INNER JOIN Customers
ON Orders.cid = Customers.cid
WHERE customers.name = 'Tiptop';
--2.
SELECT DISTINCT pid
FROM Orders
INNER JOIN Customers
ON Orders.cid = Customers.cid
WHERE city ='Kyoto'
--3.... | true |
b73850eb048ee0b384be85ce1cbc018f5923ebb3 | SQL | ReportsAdmin/LazurdeKSA | /models/Lazurde_KSA/Tables/Product_list.sql | UTF-8 | 827 | 3.671875 | 4 | [] | no_license |
select
distinct a.*,
b.category_id,
(case when b.category_id in (42) then 'Gold'
when b.category_id in (43) then 'Diamonds'
when b.category_id in (46) then 'MissL'
when b.category_id in (49) then 'Lazurde Instyle'
when b.category_id in (484) then 'Kenaz'
else 'Not Defined' end) as brand
f... | true |
b1e0036b996a128e5f8600cb4a4072837ee8008a | SQL | Les-Gros-Faisants/Where-to-meet | /technical_stuff/db.sql | UTF-8 | 4,394 | 3.4375 | 3 | [] | no_license | CREATE TABLE `users` (
`id_user` INT NOT NULL AUTO_INCREMENT,
`pseudo_user` VARCHAR(20),
`passwd_user` VARCHAR(100),
`mail_user` VARCHAR(40),
PRIMARY KEY (`id_user`)
);
CREATE TABLE `tags` (
`id_tag` INT NOT NULL AUTO_INCREMENT,
`id_aggressor` INT,
`id_victim` INT,
`tag_name` VARCHAR(30),
PRIMAR... | true |
61210e72716da93130351434b501d41c27c39d50 | SQL | UbiquitousBear/supabase | /examples/react-todo-list/db/collab_task_list_schema.sql | UTF-8 | 3,593 | 4.3125 | 4 | [
"Apache-2.0"
] | permissive | -- users table exists but not able to reference
-- USER PROFILES
CREATE TYPE public.user_status AS ENUM ('ONLINE', 'OFFLINE');
CREATE TABLE public.users (
id uuid NOT NULL PRIMARY KEY,
-- UUID from auth.users (Supabase)
username text,
list_id uuid NULL,
-- can be selected by user - current list and updated
... | true |
21c7ac985b56d99998d130f29b2a564e2399da9d | SQL | navikt/su-se-bakover | /database/src/main/resources/db/migration/V55__behandling_attestering_refactor.sql | UTF-8 | 493 | 3.15625 | 3 | [
"MIT"
] | permissive | with a as (select id, attestant from behandling),
b as (select json_build_object('attestant',
json_build_object( 'navIdent', a.attestant),
'type', 'Iverksatt'::text
)::text as value, a.id as id from a)
update behandling set attestant = b.value from b where behandling.id = b.id and behand... | true |
b43e11e00a41f9ec3b087097d028f7611da7e950 | SQL | sbDevelopments/coyote2 | /plugin/menu/install/schema.sql | UTF-8 | 3,687 | 3.703125 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `menu` (
`menu_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unikalne ID menu',
`menu_name` varchar(100) NOT NULL COMMENT 'Nazwa menu',
`menu_auth` varchar(20) NOT NULL COMMENT 'Dodatkowe uprawnienie potrzebne, aby wyświetli... | true |
0f2c69cd06bd6c88056dc0a8213edb650535e204 | SQL | ls424/PhotoShare | /schema.sql | UTF-8 | 3,109 | 4.03125 | 4 | [] | no_license | DROP DATABASE photoshare;
CREATE DATABASE photoshare;
USE photoshare;
-- DROP TABLE Pictures CASCADE;
-- DROP TABLE Users CASCADE;
CREATE TABLE Users (
user_id int4 NOT NULL AUTO_INCREMENT,
email varchar(255) UNIQUE NOT NULL,
password varchar(255) NOT NULL,
firstname varchar(255) NOT NULL,
lastname... | true |
a0128750bec5348dec2396302d4c5ed6390ded9b | SQL | BCantos17/caliber | /training/training-ddl.sql | UTF-8 | 13,028 | 3.046875 | 3 | [] | no_license | --------------------------------------------------------
-- File created - Thursday-January-19-2017
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table CALIBER_BATCH
--------------------------------------------------------
CREATE TAB... | true |
341074f6fe3c4e4722094d865ceb2e6deeda2bb2 | SQL | carletonclara/cs335-final | /src/main/resources/Address.sql | UTF-8 | 269 | 2.796875 | 3 | [] | no_license | CREATE TABLE Address (
`address_id` int(20) NOT NULL AUTO_INCREMENT,
`shipping_address` varchar(200) DEFAULT NULL,
`city` varchar(50) DEFAULT NULL,
`state` varchar(2) DEFAULT NULL,
`zip_code` varchar(5) DEFAULT NULL,
CONSTRAINT address_PK
PRIMARY KEY (address_id)
);
| true |
89c734b9f5ab0e3ba44348e0a75dace1cf81d77c | SQL | lthsieh/covid_alliance_code | /covid_alliance_population_cluster.sql | UTF-8 | 3,614 | 3.828125 | 4 | [] | no_license | -- This query will generate population-level spatio-temporal density informaiton.
-- Density is defined as #clusters per lat-long-time bin.
-- Each lat-long-time bin == (1/60) lat degrees -- (1/60) long degrees -- 15min
-- Author: Frank Hsieh 10/10/2020
create or replace table "SCRATCH"."ANALYTICS_DEV_SCRATCH"."POPULAT... | true |
3be52c8962305357ae0693edc2f21c89aba517d4 | SQL | nocettipaula/Generation | /Exercicio MySQL3/tb_Personagem.sql | UTF-8 | 223 | 2.546875 | 3 | [] | no_license | create table tb_personagem(
id int(3) auto_increment,
nome varchar(255),
pontosVida int(3),
danoAtaque int(3),
danoHabilidade int(3),
classeId int(3),
primary key (id),
foreign key (classeId) references tb_Classe (Id)
); | true |
a8f6ade13363b378d33cd782209e7481456d418a | SQL | SSSweater/BI-homework | /snow_2018-06-26.sql | UTF-8 | 1,006 | 3.046875 | 3 | [] | no_license | CREATE DATABASE snow;
CREATE TABLE `snow`.`book` (
`id` INT NOT NULL AUTO_INCREMENT,
`book_id` VARCHAR(45) NOT NULL,
`book_name` VARCHAR(45) NOT NULL,
`book_category` VARCHAR(45) NOT NULL,
`book_author` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE `snow`.`user` (
`id` INT NOT NULL AUTO_INCREM... | true |
b26cb815331907962276d4904cb209f366880eca | SQL | DennisEzell/Beginning_T-SQL | /Chapter 8/LagLead.sql | UTF-8 | 2,362 | 3.84375 | 4 | [] | no_license | --LAG and LEAD
--1
SELECT
SalesOrderID
,CONVERT(DATE, OrderDate) AS OrderDate
,CustomerID
,LAG(CONVERT(DATE, OrderDate)) OVER(PARTITION BY CustomerID ORDER BY SalesOrderID) AS PrevOrderDate
,LEAD(CONVERT(DATE, OrderDate)) OVER(PARTITION BY CustomerID ORDER BY SalesOrderID) AS FollowingOrderDate
FROM Sales.SalesO... | true |
8df4753479bec2fb327dc67d2bae4844fa382962 | SQL | unaidelao/codewars-solutions | /8kyu/EvenOrOddNumber.sql | UTF-8 | 324 | 3.171875 | 3 | [] | no_license | /*
* Even or Odd kata - SQL
*
* Create a function that takes an integer as an argument and returns "Even"
* for even numbers or "Odd" for odd numbers.
*
* @author Unai de la O
*/
SELECT number, CASE
WHEN number % 2 = 0 THEN "Even"
ELSE "Odd"
END AS is_even
FRO... | true |
0bc08462954ad9bfe28e71e79d2018538cc5f4ae | SQL | ultimania/investmentTools | /sql/getBlandInfo_selectBlandMs.sql | UTF-8 | 868 | 2.6875 | 3 | [] | no_license | SELECT
investment_t_bland_ms.bland_cd,
investment_t_bland_ms.bland_name,
investment_t_bland_ms.market_prod_cls,
investment_t_bland_ms.industry_cd_id,
investment_t_industry_ms.industry_name,
investment_t_bland_ms.sub_industry_cd,
T_SUB_INDUSTRY_MS.industry_name,
investment_t_bland_ms.scal... | true |
3eb89b398f407c59fe93a2828100966015d05920 | SQL | altamira/visualstudio | /Sistema de Informação Altamira/EGISADMIN.Database/dbo/Stored Procedures/sp_InsereUsuario_Empresa.sql | UTF-8 | 489 | 2.9375 | 3 | [] | no_license |
create procedure sp_InsereUsuario_Empresa
@cd_usuario int output,
@cd_empresa int output
AS
BEGIN
--inicia a transaçao
BEGIN TRANSACTION
INSERT INTO Usuario_Empresa( cd_usuario,cd_empresa)
VALUES (@cd_usuario,@cd_empresa)
Select
@cd_usuario = cd_usuario,
@cd_empresa = cd_empresa
From... | true |
ad3b7bf7b2df5d383e8e771b2c5e87c6550688f5 | SQL | RamanSB/HackerRank | /sql/src/the_blunder.sql | UTF-8 | 550 | 3.84375 | 4 | [] | no_license | -- CREATE TABLE employees (
-- ID INTEGER AUTO_INCREMENT,
-- Name VARCHAR(200),
-- Salary INTEGER,
-- PRIMARY KEY (ID)
-- );
-- INSERT INTO employees (Name, Salary)
-- VALUES
-- ('Kristeen', 1420),
-- ('Ashley', 2006),
-- ('Julia', 2210),
-- ('Maria', 3000);
-- Task
-- Find the average salary in the sala... | true |
531d022bed74f42f28077a3bf654ac9b66db0dff | SQL | wooiron/DataBaseSystem | /SQL/19.sql | UTF-8 | 199 | 3.53125 | 4 | [] | no_license | SELECT COUNT(DISTINCT P.TYPE)
FROM GYM AS G, TRAINER AS T,
CATCHEDPOKEMON AS CP, POKEMON AS P
WHERE
G.LEADER_ID = T.ID
AND T.ID = CP.OWNER_ID
AND CP.PID = P.ID
AND T.HOMETOWN = 'Sangnok City'; | true |
6c7533c21f9ac92fdd350ad47ff60b7d5f9856e3 | SQL | christinehoward/Udacity-Business-Analytics-Nanodegree | /SQL Queries/Basic SQL queries.sql | UTF-8 | 1,001 | 4.4375 | 4 | [] | no_license | SELECT *
FROM `marks`
WHERE studentid = 'V002';
SELECT a.studentid, a.name, b.total_marks
FROM student a, marks b
WHERE a.studentid = b.studentid
AND b.total_marks >
(SELECT total_marks
FROM marks
WHERE studentid = 'V002') t1;
-- Subquery syntax
(SELECT [DISTINCT] subquery_select_argument
FROM {table_name | vie... | true |
046acad844d77a6706fc8f8f6da1d7fa94df2bf4 | SQL | Gaya3-SQL/SQL_Exercise | /Create_#Temp_##Temp.sql | UTF-8 | 329 | 2.78125 | 3 | [] | no_license | /*Create Local Temp Table and Global Temp Table one each*/
Select ResellerKey,ResellerName,FirstOrderYear,AddressLine1
INTO #Temp1
from dbo.DimReseller
Select * from #Temp1
Select ProductKey,OrderDateKey,DueDateKey,SalesOrderLineNumber,UnitPrice
INTO ##Temp1
from dbo.FactInternetSales
Select * from ... | true |
57fff7f51fec7e0d98178ecbd29b8d73109214f6 | SQL | dimitryduarte/TIC_Completo | /scripts/tables/create_table_tbTipoEndereco.sql | UTF-8 | 604 | 3.265625 | 3 | [] | no_license | -- Table: public."tbTipoEndereco"
-- DROP TABLE public."tbTipoEndereco";
CREATE TABLE public."tbTipoEndereco"
(
id_tipo_endereco INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
str_descricao TEXT COLLATE pg_catalog."default" UNIQUE NOT NULL,
fg_status BOOLEAN NOT NULL DEFAULT 'true',
CONSTRAINT "pk... | true |
b526d1f6b39baadbb1f2ea401e02e313a2aa83f1 | SQL | SethDeSilva10/cse414 | /hw2/submission/hw2-q4.sql | UTF-8 | 471 | 3.359375 | 3 | [] | no_license |
-- question 4
select distinct C.name as name
from FLIGHTS as F, CARRIERS as C, MONTHS as M
where F.carrier_id = C.cid
and F.month_id = M.mid
group by M.month, F.day_of_month, C.name
having COUNT(*) > 1000;
/*
Result
name
American Airlines Inc.
Comair Inc.
Delta Air Lines Inc.
Envoy Air
ExpressJet Airlines Inc.
Expr... | true |
3e3fa63a3ce62629e414bc4aa2e9abe4860b129c | SQL | rickyreticent/siput | /siput.sql | UTF-8 | 14,902 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2017 at 10:34 AM
-- 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 |
0d188551c17ff3356c9c1b31c97e8db375ff40c6 | SQL | devendra-malviya/iips_registrationform | /sim_database .sql | UTF-8 | 6,628 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 13, 2014 at 05:47 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... | true |
ee85c299e952fac8e9e23d8f4edd2c48d455f355 | SQL | mcgaryp/cs313 | /SQLScripts/common_lookup.sql | UTF-8 | 5,007 | 2.671875 | 3 | [] | no_license | -- Create common Look up table
CREATE TABLE common_lookup (
common_lookup_id SERIAL NOT NULL PRIMARY KEY,
context VARCHAR(25) NOT NULL,
type VARCHAR(25) NOT NULL,
meaning VARCHAR(256) NOT NULL
);
-- TODO Insert admin into common look up table
INSERT INTO common_lookup... | true |
e0b7348aa6959c656f56593eab7de63af86537c9 | SQL | 1244791720/myblog | /sql/token.sql | UTF-8 | 1,203 | 2.984375 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 21/10/2019 11:43:20
... | true |
5e106de510c2faab9e4b598f5d7e515a5e8a35c8 | SQL | FlavioHualpa/MySQL | /test.05.25_books.sql | UTF-8 | 3,096 | 3.21875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: localhost Database: test.05.25
-- ------------------------------------------------------
-- Server version 8.0.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... | true |
459292933a79bc1174a79e41fa0d7e6f1433a7ee | SQL | migungel/Distribuidos | /init.sql | UTF-8 | 1,696 | 3.140625 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS SG;
USE SG;
DROP TABLE IF EXISTS s_customer;
CREATE TABLE s_customer
(id VARCHAR(3) NOT NULL,
nombre VARCHAR(20) NOT NULL,
telefono VARCHAR(20) NOT NULL,
direccion VARCHAR(20),
ciudad ... | true |
73ce99064e99bdb589f517d67aaf2d883f73355b | SQL | shivdeepmodi/Setup | /sqlpath/cre_schema_grant.sql | UTF-8 | 343 | 2.578125 | 3 | [] | no_license | set verify off heading off feedback off
accept schema_owner prompt 'Enter value for object owner : '
spool &&schema_owner._grants_&&_connect_identifier..sql
select 'grant '||privilege||' on '||owner||'.'||table_name||' to '||grantee||';'
from dba_tab_privs
where owner = '&schema_owner'
/
spool off
set heading on... | true |
f29ada9e2910eaca9270c95b6c2b85e53271b140 | SQL | bellmit/flexdb | /2.HOST/4.Function/fn_check_isnumber.SQL | UTF-8 | 437 | 2.71875 | 3 | [] | no_license | CREATE OR REPLACE FUNCTION fn_check_isnumber(p_str IN varchar2)
RETURN VARCHAR2 IS
p_num NUMBER;
v_char1 VARCHAR2(100);
v_char2 VARCHAR2(100);
BEGIN
select SUBSTR(p_str,0,INSTR(p_str,'/') - 1), SUBSTR(p_str,INSTR(p_str,'/')+1,LENGTH(p_str)) into v_char1, v_char2 from dual;
p_num := to_number(v_c... | true |
b0bd84959a034b67257c85be06bb2074814be8ff | SQL | Delamater/SQL | /SqlServer/Log File/ReadSQLLogFile.sql | UTF-8 | 314 | 2.9375 | 3 | [] | no_license | -- Query SQL Server's default log file
-- Do yourself a favor and put some filters on this query for your production server
SELECT top 1000 [Transaction Name], SUSER_SNAME([Transaction SID]) As UserName, [Begin Time], Operation, [Transaction ID], Description
FROM fn_dblog(null, null)
ORDER BY [Begin Time] DESC
| true |
19e76f785811d8acc5f95d0d06832e057018c98a | SQL | alamer/cheat-sheet | /oracle/sql/performance/bufferCacheContent.sql | UTF-8 | 1,471 | 4.0625 | 4 | [] | no_license | with t1 as ( select
o.owner owner,
o.object_name object_name,
o.subobject_name subobject_name,
o.object_type object_type,
count(distinct file# || block#) num_blocks
from
dba_objects o,
v$bh bh
where
o.data_object_id = bh.objd
and o.owner not... | true |
59e1c5a9750ed64196ffded824a0de4c366b4414 | SQL | aayushirathi/mySqlServerCodes | /19 Delete_Statement.sql | UTF-8 | 367 | 2.859375 | 3 | [] | no_license | Link- https://rextester.com/ZWMP43932
CREATE TABLE Students (
Name VARCHAR(40), RollNo INT,
Course VARCHAR(40))
INSERT INTO Students Values
('Aayushi',111,'ABC'),
('BCD',112,'CDE'),
('DEF',113,'EFG');
SELECT * FROM Students;
DELETE FROM Students WHERE Name = 'Aayushi';
SELECT * FROM Students;
... | true |
21ce8d5593a344351bbc62d6294bd6760ff691cb | SQL | santig19/DBT | /models/business/f_iconnect_campaign.sql | UTF-8 | 23,091 | 3.3125 | 3 | [] | no_license | {{ config(
post_hook="grant all privileges on {{ this }} to {{ var('snowflake_user_grant_privileges') }}")
}}
SELECT
TMP.campaign_id::varchar(20) as Campaign_Id,
TMP.Employee_Id::varchar(20) AS Employee_Id,
TMP.Product_Id::varchar(20) AS Product_Id,
TMP.Therapeutic_Area_Name::varchar(255) AS T... | true |
91d94cfd5c46dde6735d54672cbc287fd2f8eae8 | SQL | mariotun/Sistemas-de-Base-de-Datos-1 | /[BD1]Proyecto2_201602942/Enunciado2/[BD1]CargaDeDatos_E2.sql | UTF-8 | 8,539 | 3.203125 | 3 | [] | no_license |
-- ************************************************* CREACION DE LAS TABLAS TEMPORALES ***************************************************
CREATE DATABASE IF NOT EXISTS PY2_E2;
USE PY2_E2;
CREATE TABLE temporal1(
invento TEXT,
inventor TEXT,
profesional_asignado_al_invento TEXT,
el_profesional_es_j... | true |
06583db9702966c1bb60147681763fa02390eb37 | SQL | LingboTang/291-project | /assignment2/test7.sql | UTF-8 | 481 | 3.71875 | 4 | [] | no_license | (select p.sin, p.name, p.addr
from people p, ticket t
where t.vdate between TO_DATE ('2013/02/01', 'yyyy/mm/dd')
AND TO_DATE ('2014/2/01', 'yyyy/mm/dd')
and p.sin = t.violator_no
and t.vtype <> 'parking'
GROUP BY p.sin,p.name, p.addr
having 3 <= All(select count(*)
from people ... | true |
5ceef7d7f68d28287cd2c9674be4260a4240d6d2 | SQL | adax/cuba-example-application-components | /project-management-app/modules/core/db/init/hsql/20.create-db.sql | UTF-8 | 563 | 2.984375 | 3 | [] | no_license | -- begin PM_PROJECT
alter table PM_PROJECT add constraint FK_PM_PROJECT_CUSTOMER foreign key (CUSTOMER_ID) references PM_CUSTOMER(ID)^
create index IDX_PM_PROJECT_CUSTOMER on PM_PROJECT (CUSTOMER_ID)^
-- end PM_PROJECT
-- begin PM_PROJECT_APPOINTMENT_LINK
alter table PM_PROJECT_APPOINTMENT_LINK add constraint FK_PROAPP... | true |
ba8fa35d498944a460ab702769dc66c3b374d245 | SQL | souravrrp/AKG-SCIL-SQL | /Inventory/INVENTORY_ITEMS/ITEM TEMPLATES.sql | UTF-8 | 573 | 3.21875 | 3 | [] | no_license | /* Formatted on 7/13/2019 6:33:24 PM (QP5 v5.287) */
SELECT MSI.SEGMENT1, MIT.TEMPLATE_NAME, MITA.ATTRIBUTE_NAME
FROM APPS.MTL_ITEM_TEMPL_ATTRIBUTES MITA,
APPS.MTL_SYSTEM_ITEMS_B MSI,
APPS.MTL_ITEM_TEMPLATES MIT
WHERE MITA.ATTRIBUTE_VALUE IS NOT NULL
--AND mita.attribute_name = 'MTL_SYSTEM_I... | true |
ef2ff5a37faeae2b58ab2d825f9e19c8ee640754 | SQL | histefanov/SoftUni-DB | /Functions and Stored Procedures/EmployeesWithSalaryAboveNumber.sql | UTF-8 | 149 | 2.84375 | 3 | [] | no_license | CREATE PROC usp_GetEmployeesSalaryAboveNumber (@Threshold DECIMAL(18,4))
AS
SELECT FirstName, LastName
FROM Employees
WHERE Salary >= @Threshold | true |
4c1384c31bf7224a0c523fb03fa8ac81228bb1dd | SQL | CSCfi/antero | /db_archive/sql_archive/688__alter_view_v_virta_jtp_tilasto.sql | UTF-8 | 28,979 | 2.8125 | 3 | [
"MIT"
] | permissive |
ALTER VIEW [dw].[v_virta_jtp_tilasto] AS
SELECT
Tilastovuosi
,julkaisunTunnus
,[Koodit Sektori]
,[Sektori]
,[Sektor]
,[Sector]
,[Koodit Organisaatio]
,[Organisaatio]
,[OrganisationSV]
,[OrganisationEN]
,[Koodit Ammattikorkeakoulu]
,[Ammattikorkeakoulu]
,[Koodit Yliopisto]
,[Yliopisto]
,[Koodit Julkaisufoorumitaso]
,[... | true |
f3940f73ded8ce2c09c5c896ae4e5ed2d48df883 | SQL | richsaleh/dbt_starter | /_db_scripts/snowflake_database_init.sql | UTF-8 | 2,521 | 3.59375 | 4 | [] | no_license | -- (0) TURN OFF CASE SENSITIVITY
USE ROLE ACCOUNTADMIN;
ALTER ACCOUNT SET QUOTED_IDENTIFIERS_IGNORE_CASE = TRUE;
-- (1) CREATE DATABASES
USE ROLE SYSADMIN;
CREATE DATABASE "FIVETRAN";
CREATE DATABASE "DW";
CREATE DATABASE "DW_DEV";
-- (2) CREATE WAREHOUSES
CREATE WAREHOUSE "FIVETRAN_WH"
WITH WAREHOUSE_SIZE = 'SMALL'... | true |
be32dbc09e116abfa60e23b3d6673821289ea2bb | SQL | gkothe/m_16 | /scheme/crebas.sql | UTF-8 | 17,044 | 3.125 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 12/1/2017 4:21:26 PM */
/*==============================================================*/
drop table if exists AUTOCOMPLETE;
drop table if ... | true |
40181667bd44240459a4a51cc5d9d065e7436e7b | SQL | zhl17512074823/online-education | /warehouse/src/main/resources/sql/ads.sql | UTF-8 | 6,942 | 3.09375 | 3 | [] | no_license | -- ----------------------------
-- Table structure for ads_user_paper_detail
-- ----------------------------
DROP TABLE IF EXISTS `ads_user_paper_detail`;
CREATE TABLE `ads_user_paper_detail` (
`paperviewid` varchar(20) DEFAULT NULL,
`paperviewname` varchar(20) DEFAULT NULL,
`unpasscount` varchar(20) DEFAULT NULL... | true |
e09d3180efae9d7ee248ff841fa8405ee89186c7 | SQL | joaomcoelho/AuthJWT | /src/db/scripts.sql | UTF-8 | 218 | 2.890625 | 3 | [
"MIT"
] | permissive | CREATE TABLE Users(
userid SERIAL PRIMARY KEY,
email VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
creationdate TIMESTAMP NOT NULL,
alterdate TIMESTAMP NOT NULL,
CONSTRAINT email_unique UNIQUE(email)
)
| true |
d25051d1da969d2a9ab644dbaff0bbdf58ea80e5 | SQL | deadBlueShark/Shop-management | /shop_manager.sql | UTF-8 | 2,266 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 21, 2016 at 03:18 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
fc17510e286ee9c6b0097960c88a9c2c6d034202 | SQL | pradosh2008/cloudproject | /ProjectWork/gcp-project/ann/Style_Store_Cost.sql | UTF-8 | 1,768 | 4.1875 | 4 | [] | no_license | -- add the lead logic
create or replace table work.Style_Store_Cost as
WITH
unit_amt AS (
SELECT
chain_id,
store_id,
week_id,
style_id,
color_id,
unit_cogs_amt,
prev_week_cogs_amt,
prev_week_cogs_cnt
FROM (
SELECT
chain_id,
store_id,
week_id,
style_id,
... | true |
f59bacf32356d5b8a62199bed8369aa0276f5e85 | SQL | mandavkarswap/empire | /fs/sql/stock_schema.sql | UTF-8 | 1,853 | 3.765625 | 4 | [] | no_license | -- Stock Master Table
CREATE TABLE `sw_fs_stock_master` (
`id` MEDIUMINT(8) unsigned NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL UNIQUE,
`is_active` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '1 => Active, 0 => In-Active',
PRIMARY KEY (`id`)
);
-- Term Master Table
CREATE TABLE `sw_fs_stock_term_master` (
... | true |
42ef6311b1cd3deea4eab5c39c28fba28a0e53cf | SQL | sailikhithkotha/SQL_Queries | /queries/query_13.sql | UTF-8 | 1,448 | 4.3125 | 4 | [] | no_license | /* Assuming a title is a node and a promotion is an edge between nodes. e.g.
And promotion from Engineer to Senior Engineer means their is a path from Node ’Engineer’ to Node ’Senior Engineer’.
Find out pairs of node of source and destination (src, dst) which there is no such path in the database.
Sort the result ... | true |
6a11d6b0a8ddda9c45f8763f6d4b18f7d3492cd6 | SQL | yakiris/20200213_Database | /11_dz/09.02.sql | UTF-8 | 1,029 | 3.671875 | 4 | [] | no_license | -- 2. (по желанию) Создайте SQL-запрос, который помещает в таблицу users миллион записей.
DROP TABLE IF EXISTS temp;
CREATE TABLE temp (
id SERIAL PRIMARY KEY,
name VARCHAR(255) COMMENT 'Имя покупателя',
birthday_at DATE COMMENT 'Дата рождения',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATET... | true |
4de92236bc9b4381c7d44b52ba700a98b24a28c5 | SQL | tatstepprive/step | /notas/me/database/oracle/scripts/alterTablespace.sql | UTF-8 | 2,708 | 3.625 | 4 | [] | no_license | --RENAME
--rename tablespace
alter tablespace ts1 rename to ts2;
--rename datafile online (zero down time)
--alter database move datafile 'path' to 'newpath';
-- the new path should exist. First create directory /u01/app/oracle/oradata/ORCL/pdb1/data/
alter database move datafile '/u01/app/oracle/oradata/ORCL/pdb1/ts... | true |
c86cf95734d4c06cb83593e248dba1a78c6d21eb | SQL | SoulJ-K/Oracle | /DDL과제.sql | UHC | 3,591 | 4.5 | 4 | [] | no_license | --1. ̺
CREATE TABLE TB_CATEGORY(
NAME VARCHAR2(10),
USE_YN CHAR(1) DEFAULT 'Y'
);
--2. ̺
CREATE TABLE TB_CLASS_TYPE(
NO VARCHAR2(5) PRIMARY KEY,
NAME VARCHAR2(10)
);
--3. TB_CATEGORY NAME÷ PRIMARY KEY
ALTER TABLE TB_CATEGORY ADD PRIMARY KEY(NAME);
--4. TB_CLASS_TYPE NAME÷ NOT NULL
... | true |
1f6615a1fad46b6f44c9b4ca561ea83668983e35 | SQL | a-bemporad/Astrid-Alejandra | /semana18/servicosBackEnd/src/queries.sql | UTF-8 | 394 | 3.765625 | 4 | [] | no_license | CREATE TABLE Address(
user_id VARCHAR(255) NOT NULL PRIMARY KEY,
cep VARCHAR(8) NOT NULL,
street VARCHAR(255) NOT NULL,
neighborhood VARCHAR(255) NOT NULL,
city VARCHAR(255) NOT NULL,
state VARCHAR(255) NOT NULL,
FOREIGN KEY (user_id) REFERENCES User(id)
);
SELECT * FROM Address;
SELECT * FROM User;
SELECT u.email, u... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.