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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
eb755a92f4a284e37c9220ce5cc3a716cc1f43b6 | SQL | A116911/pa-test-automation | /RawVault/rawvault_mapping_table_create_script.sql | UTF-8 | 3,074 | 3.875 | 4 | [] | no_license | --Create Source_Target_Mapping_TEMP table:
CREATE TABLE [staging].[Source_Target_Mapping_TEMP]
(
[seqNo] [int] NULL,
[category] [varchar](20) NULL,
[sourceschemaname] [varchar](100) NULL,
[sourcetablename] [varchar](100) NULL,
[sourcefieldname] [varchar](100) NULL,
[targetschema] [varchar](100) NULL,
[targettabl... | true |
5cbca9272d8734cff74fb128cb834d246a4fef44 | SQL | jimalaros/PROYECTO2SQL | /SQL/insert.sql | UTF-8 | 882 | 3.578125 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS MINTIC;
USE MINTIC;
CREATE TABLE usuarios (
id int NOT NULL auto_increment,
Nombre VARCHAR(50) NOT NULL,
Apellido VARCHAR(50) NOT NULL,
Correo VARCHAR(100) NOT NULL,
Contraseña VARCHAR(50) NOT NULL,
Direccion VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE productos (... | true |
2c1a382b85bfe9f57e170b38a76bf7c747cea399 | SQL | AkshayHande57/Twitter-Data-Analysis-WordCloud-in-R | /Sql Query/Manipulation/Phase 1/Trading_Product.sql | UTF-8 | 12,310 | 3.796875 | 4 | [] | no_license | -- Working on Trading Product of customer.
select top 1000 * from MTH_TRNOVR_BRKG
select count(1) from MTH_TRNOVR_BRKG -- 3229652
select count(distinct(Cust_ID)) from MTH_TRNOVR_BRKG -- 653209
select * from MTH_TRNOVR_BRKG order by CUST_ID
-----------------------------------------------------------------------... | true |
38d31413a41c960b83df4083518c33dd7fbde0b5 | SQL | chcuneo/db-tp1 | /full_database_dump.sql | UTF-8 | 149,878 | 3.15625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.1
-- Dumped by pg_dump version 9.6.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min... | true |
55182b8319380a05e7960c975d8545256e1df8a2 | SQL | nthmost/TabTracker | /chromevents.sql | UTF-8 | 511 | 2.65625 | 3 | [] | no_license | create table event_types (
id integer auto_increment primary key not null,
name varchar(255) unique default ""
);
create table events (
id integer auto_increment primary key not null,
typeid integer not null,
tabid integer default null,
windowid integer default null,
timestamp datetime default 0,
... | true |
9fe06d9cead2d63b47950064f1152984460bbc0c | SQL | bujars/databases-csc336 | /assignment_4_queries__Bujar_Sefa_2.sql | UTF-8 | 1,270 | 4.21875 | 4 | [] | no_license | WITH temp AS (
SELECT
prices.*,
EXTRACT(year FROM date) AS year,
ROW_NUMBER() OVER (
PARTITION BY symbol, EXTRACT(year FROM date)
ORDER BY DATE DESC
) AS row_number
FROM prices
)
SELECT
temp.symbol,
temp.date,
temp.close,
temp.close / LAG(temp.close) OVER (PARTITION BY symbol) - 1 AS annual_re... | true |
6610cde940db310fca441fd608f5731d82e6b5b2 | SQL | Arjunvankani/Web_devlopment | /Chat/Database_File/solid.sql | UTF-8 | 8,161 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 23, 2021 at 02:56 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
43fc910a01e0c66f4b4dfd2655234f055ad0e7cd | SQL | Nghia19/CSDL_FFPT | /Lab/ps17048_LeTrungNghia_lab5/qlbhlab2.sql | UTF-8 | 4,234 | 3.0625 | 3 | [] | no_license | CREATE DATABASE quanlibanhang;
USE quanlibanhang;
CREATE TABLE `hoadon` (
`mahoadon` int(11) NOT NULL,
`ngaymuahang` datetime DEFAULT NULL,
`makhachhang` varchar(5) DEFAULT NULL,
`trangthai` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hoadon`
--
INSERT INTO... | true |
ed3032d5614c964965b78ae7cc50ed4ca93800e8 | SQL | sabnitkaur01/FavouriteThings | /includes/Favourite_things.sql | UTF-8 | 1,579 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Nov 15, 2020 at 06:12 PM
-- Server version: 5.7.30
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
fe361df788ab98f96013632d1a317f5c72bd2da5 | SQL | kadavris/ok-sklad | /ssEnt/ssServer/upd/1_4_9.sql | UTF-8 | 10,232 | 3.859375 | 4 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | !NOERR!CREATE PROCEDURE SP_GET_ALL_MAT_PRICES (
matid integer)
returns (
prices varchar(2048),
dis float
)
as
declare variable v_extra numeric(15,8)^
declare variable v_extratype integer^
declare variable v_ptypeid integer^
declare variable v_currid integer^
declare variable v_currname varchar(24... | true |
f375b47c9fee262ce5ce99d8fbe7bde988a3bfa1 | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/02484_substitute_udf_storage_args.sql | UTF-8 | 1,283 | 3.109375 | 3 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | -- Tags: no-parallel
DROP TABLE IF EXISTS 02484_substitute_udf;
DROP FUNCTION IF EXISTS 02484_plusone;
DROP FUNCTION IF EXISTS 02484_plustwo;
DROP FUNCTION IF EXISTS 02484_plusthree;
DROP FUNCTION IF EXISTS 02484_plusthreemonths;
DROP FUNCTION IF EXISTS 02484_plusthreedays;
CREATE FUNCTION 02484_plusone AS (a) -> a +... | true |
fe9a25351c5cc0756a35a094e1d33499f5d6cd42 | SQL | aumaza/boreal | /boreal.sql | UTF-8 | 11,918 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 26-04-2020 a las 16:59:47
-- Versión del servidor: 5.5.65-MariaDB
-- Versión de PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
43d3b67c3370bceb42a85264b1a8aa51fca543e0 | SQL | OutOfBandDevelopment/MasterDataTools | /src/MasterDataTools/MyDataTools.Db/Vehicles/Views/CostsPerCar.sql | UTF-8 | 941 | 3.34375 | 3 | [
"MIT"
] | permissive |
CREATE VIEW [Vehicles].[CostsPerCar]
AS --
SELECT
[CarID]
,CAST(ISNULL([FillUps],0) AS DECIMAL(12, 2)) AS [FillUps]
,CAST(ISNULL([InsurancePayments],0) AS DECIMAL(12, 2)) AS [InsurancePayments]
,CAST(ISNULL([Payments],0) AS DECIMAL(12, 2)) AS [Payments]
,CAST(ISNULL([OilChanges],0) AS DECIMAL(12, 2)) AS [... | true |
5b42cb5ce9aa8b4e0da8b3a30f3e57bd17c77892 | SQL | qichangjian/mybatis_GH01_2 | /src/com/qcj/sql/emp.sql | UTF-8 | 2,686 | 3.203125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Mysql
Source Server Type : MySQL
Source Server Version : 50721
Source Host : localhost:3306
Source Schema : bd1807
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : 65001
Date: 07/09/2018 20:57:04
... | true |
448788237d84e12fa7e21bbb58f56119f9aca2fa | SQL | vsoshyn/home-routines | /database/src/main/resources/mock/002-item.sql | UTF-8 | 1,252 | 2.796875 | 3 | [] | no_license | INSERT INTO ITEM (ID, NAME, DESCRIPTION, LIFECYCLE, MAINTENANCE_DATE) VALUES (1, 'Fridge', 'A device for keeping produts fresh', 160, trunc(sysdate));
INSERT INTO ITEM (ID, NAME, DESCRIPTION, LIFECYCLE, MAINTENANCE_DATE) VALUES (2, 'Conditioner', 'With it an air will be always clean', 200, trunc(sysdate));
INSERT INTO ... | true |
2d1655d6eace008edb48ba5de38eda600abe6987 | SQL | AlexanderAtanasov/SoftUni_MySQL | /MySQL - 05 - Table Relations/Exercise Tasks/Problem.04 - Self-Referencing.sql | UTF-8 | 401 | 3.265625 | 3 | [] | no_license | CREATE TABLE `teachers` (
`teacher_id` INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL,
`manager_id` INT
)
AUTO_INCREMENT = 101;
INSERT INTO `teachers` (`name`,`manager_id`)
VALUES
('John',null),
('Maya',106),
('Silvia',106),
('Ted',105),
('Mark',101),
('Greta',101);
ALTER TABLE `teachers`
ADD CONSTRAINT ... | true |
f22314fcf13e500eb36b8c6e29548cbba8505446 | SQL | coderrrZhou/TeamWork | /数据库/ourgame.sql | UTF-8 | 3,433 | 3.3125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80015
Source Host : localhost:3306
Source Schema : ourgame
Target Server Type : MySQL
Target Server Version : 80015
File Encoding : 65001
Date: 14/12/2019 22:2... | true |
5a89403df099c8f213f3013ac10b118e30b8cb39 | SQL | srinidhi-mc/kidsMansion | /build/classes/kidsMansion/School_Fees.sql | UTF-8 | 323 | 3.625 | 4 | [] | no_license | select s.NAME, pd.TERM, pd.TOTAL, pd.STATUS, pd.BOOK from students s
inner join payment_details pd on pd.STUDENT_ID = s.ID
and s.CLASS = 'NURSERY' and pd.TERM = 2 and s.ACTIVE =1 and s.YEAR = 15 order by s.NAME asc;
select NAME, ACTIVE from students where class = 'NURSERY' and Year = 15 and ACTIVE = 1 order by name a... | true |
a2affd31f248729c892fb10697eb91b37c116755 | SQL | LinNikMIPT/MIPT_DCAM_SQL_Course | /Lab_4/Lab_4.sql | WINDOWS-1251 | 2,771 | 3.796875 | 4 | [] | no_license | -- 89154539855 3%:
INSERT INTO shm.Discond_Card VALUES(11, 3, '2019-10-16', NULL)
UPDATE shm.Client SET Card_id = 11 WHERE Phone_number = '89154539855'
-- , ,
DELETE w
FROM shm.Employee w
INNER JOIN shm.Job e
ON e.Job_id = w.Job_id
WHERE e.Description = ''
UPDATE shm.Employee SET Job_i... | true |
c74133b4f6e5d9dc7e63928ffd9d7b8092885858 | SQL | ruandev/beauty | /scripts sql/02_db_create_indexes.sql | UTF-8 | 1,382 | 3.265625 | 3 | [] | no_license | --
-- Indexes for dumped tables
--
--
-- Indexes for table `AGENDAMENTO`
--
ALTER TABLE `AGENDAMENTO`
ADD PRIMARY KEY (`ID`),
ADD KEY `FK_CLIENTE_AGEND` (`ID_CLIENTE`),
ADD KEY `FK_FUNC_AGEND` (`ID_FUNC`);
--
-- Indexes for table `CAIXA`
--
ALTER TABLE `CAIXA`
ADD PRIMARY KEY (`ID`),
ADD KEY `FK_FUNC_ABRE_C... | true |
eafdf8f7e5e259c9509f141c18c11fee699121b7 | SQL | satirthaKreative/authorizeRestApi | /codexworld.sql | UTF-8 | 3,011 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 03, 2020 at 02:29 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
525dc91cfec1714141f87aad333fcf5283a2f516 | SQL | FresherBuiQuangThi/CODE_DEMO_EXERCISES | /ThemSuaXoaMotController/CSDL.sql | UTF-8 | 684 | 2.703125 | 3 | [] | no_license | use quanlysinhvien;
CREATE TABLE ThanhVien (
id VARCHAR(20),
Ho VARCHAR(255) NOT NULL,
Ten VARCHAR(255) NOT NULL,
TaiKhoan VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
insert into quanlysinhvien.thanhvien values
('1','Bui Quang','Thi','28 nhat tao'),
('2','Bui Quang','Thi','28 nhat tao'),
('3','Bui Quang','Thi','28 nhat... | true |
54c166704312c68b9b57a609dada968e21113277 | SQL | tuhonghanh/RAIWAY10 | /SQL/Assignment 6/Testing_System_Assignment_6.sql | UTF-8 | 16,561 | 3.546875 | 4 | [] | no_license | DROP DATABASE IF EXISTS Testing_system;
CREATE DATABASE Testing_system;
USE Testing_system;
DROP TABLE IF EXISTS department;
CREATE TABLE department (
department_id TINYINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
department_name NVARCHAR(50) NOT NULL UNIQUE KEY
);
INSERT INTO department(department_name )
VALUE... | true |
108c0e380b9a80ac6adb6732ad32dbccb741919c | SQL | prfagun1/Scripts | /Banco de dados/Oracle/Listar processos do servidor por programa, usuário e status, conexões, conexão usuários.sql | UTF-8 | 691 | 3.3125 | 3 | [] | no_license | SELECT sess.process, sess.status, sess.username, sess.schemaname, sql.sql_text
FROM v$session sess,
v$sql sql
WHERE sql.sql_id(+) = sess.sql_id;
SELECT SID, SERIAL#, STATUS, SERVER
FROM V$SESSION
where status <> 'ACTIVE'
;
SELECT MACHINE, count(PROGRAM)
FROM v$session sess,
v$sq... | true |
1b8a62f183e3040b93b7aa7333bc10a972d62e1a | SQL | determined-ai/determined | /master/static/migrations/20210513134524_updates-for-push-api.tx.up.sql | UTF-8 | 2,052 | 3.8125 | 4 | [
"Apache-2.0"
] | permissive | CREATE TYPE public.run_type AS ENUM (
'TRIAL'
);
CREATE TABLE public.runs (
id integer NOT NULL,
start_time timestamp without time zone NOT NULL DEFAULT now(),
end_time timestamp without time zone NULL,
run_type run_type NOT NULL,
run_type_fk integer NOT NULL,
CONSTRAINT trial_runs_id_trial... | true |
0d2ae4dfe21807e01dd1200d1819ec836869c702 | SQL | htruong181099/CSDL_Flask_Python_SQLSever | /.resources/Ass2_SQL file/SanPham/Trigger/xoa_san_pham.sql | UTF-8 | 851 | 2.65625 | 3 | [] | no_license | create trigger xoa_san_pham on SanPham
instead of delete
as
begin
delete from UaThich_KhachHang_SanPham where MaSanPham in (select MaSanPham from deleted)
delete from Chua_DonHang_SanPham where MaSanPham in (select MaSanPham from deleted)
delete from DanhGia_KhachHang_SanPham where MaSanPham in (select MaSanP... | true |
62fd1efb8428c79347e526625f766cd2212ec95c | SQL | elynur/proyek1_websitebeasiswa | /databases/db_proyek_new.sql | UTF-8 | 6,242 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 22, 2020 at 10:29 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
f9bb3c5b12eea6374ef16076d1c15698b74a5a9a | SQL | fatimaEllabbar/BootcampX | /3_queries_group-by/average_completion_time.sql | UTF-8 | 237 | 3.65625 | 4 | [] | no_license | SELECT name as student , avg(duration) as average_assignment_duration
FROM students
INNER JOIN assignment_submissions ON assignment_submissions.student_id= students.id
WHERE end_date is NULL
GROUP BY name
ORDER BY avg(duration) DESC ;
| true |
b437121c0361a7a655b510e50f17fb27a7a7e22a | SQL | Zanesu/ssm | /src/main/webapp/sql.sql | UTF-8 | 2,576 | 3.28125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 本地mysql数据库
Source Server Version : 50719
Source Host : localhost:3306
Source Database : soft_code
Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2018-08-23 15:46:55
*/
SET FOREIGN_K... | true |
f036777ca547669f63f612b89f82bc4e5fa09bf7 | SQL | sand-enqos/ReactAppWithAPI | /data/mydb.sql | UTF-8 | 1,755 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 26, 2019 at 07:56 AM
-- Server version: 5.7.20
-- PHP Version: 7.1.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
91955ec57fa6c368f13fbfddd94922a871bf7979 | SQL | darioyopoint/yopoint_2 | /DOCS/Model/DB_V2.sql | UTF-8 | 19,922 | 3.46875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Jun 23, 2014 at 12:44 PM
-- Server version: 5.5.34
-- PHP Version: 5.5.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `yopoint`
--
-- ----------------------------... | true |
9e231e87fd842b00de7bdfa9ce06d327c086175e | SQL | Lexar7/Sistema-de-Inventario | /Version Semifinal/Sistema de Inventario 2.0/Scripts pasados/Sistema_MySql.sql | UTF-8 | 890 | 3.078125 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS `Sistema`;
USE `Sistema` ;
CREATE TABLE IF NOT EXISTS `Sistema`.`Usuarios` (
`IdUsuario` INT NOT NULL auto_increment,
`Nombre` VARCHAR(45) NOT NULL,
`Apellido` VARCHAR(45) NOT NULL,
`Direccion` VARCHAR(45) NOT NULL,
`FechaNac` DATE NOT NULL,
`Telefono` INT(10) NOT NULL,
`Usua... | true |
8b92a9e82f8141ff580366eafec00bfb9ed25639 | SQL | tazeomaximo/rgr-teste | /BancoDeDados/CINEMA.sql | UTF-8 | 4,635 | 3.46875 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Apr 6 11:06:05 2021
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
70aee5c2a23a522b904b3a4f0b631791fb4de7bc | SQL | aruokoniemi/wwwsov_htyo | /misc/db_triggers.sql | UTF-8 | 441 | 3.15625 | 3 | [] | no_license | DELIMITER $$
CREATE TRIGGER ratinginit AFTER INSERT ON user
FOR EACH ROW
BEGIN
INSERT INTO ratinghistory (userid, rating, changedate)
VALUES (NEW.userid, NEW.rating, NOW());
END
$$
CREATE TRIGGER ratingupdate AFTER UPDATE ON user
FOR EACH ROW
BEGIN
IF NEW.rating <> OLD.rating THEN
INSERT INTO rating... | true |
c20be63cf9d9b432e9fee4b1402ed8fc33409877 | SQL | ShreyasHuilgol/IT-Training-Cnetre | /SQLQuery1.sql | UTF-8 | 1,259 | 3.703125 | 4 | [] | no_license | use classsql
create table StudentDetails
(
Studentname varchar(50),
rollno int primary key,
gender varchar(50),
age int,
course varchar(50),
address varchar(100)
)
create table CourseDetails
(
courseid int primary key,
course varchar(50),
duration int,
noofstd int,
cost int
)
create table BatchD... | true |
bbc531457ee6a9086b3a27a29a2d28985ccdc8d4 | SQL | pablog22/travel-assignment | /src/main/resources/schema.sql | UTF-8 | 773 | 3.765625 | 4 | [] | no_license | CREATE TABLE Location (
id integer NOT NULL,
code VARCHAR NOT NULL,
type VARCHAR NOT NULL,
longitude double precision,
latitude double precision,
parent_id integer,
CONSTRAINT pk_location PRIMARY KEY (id),
CONSTRAINT location_translation FOREIGN KEY (parent_id)
REFERENCES Locatio... | true |
c0ad6565b85ea5807a6e2b932d101156dea3dc15 | SQL | sergiy-naumovych/service | /db/sailor.sql | UTF-8 | 25,177 | 3.265625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Сен 01 2014 г., 08:26
-- Версия сервера: 5.5.20
-- Версия PHP: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... | true |
87b171c61d1d975271ac43e595476f91d42b2017 | SQL | LBS-sws/Hr | /hr/protected/data/2020-05-13(員工暫屬城市表).sql | UTF-8 | 1,048 | 3.140625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50620
Source Host : localhost:3306
Source Database : hrdev
Target Server Type : MYSQL
Target Server Version : 50620
File Encoding : 65001
Date: 2020-05-13 14:25:26
*/
SET FOREIGN_KEY_CHECKS=0;
-... | true |
9edad981f8119bbba514bb3324378e0170e144c2 | SQL | ilyesadamgabor/kolcsonzo | /Kolcsonzo.sql | UTF-8 | 2,921 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1:3306
-- Létrehozás ideje: 2019. Ápr 23. 05:07
-- Kiszolgáló verziója: 5.7.24
-- PHP verzió: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
eb6846926c80441ebf96fbe3b034ab39abe54f85 | SQL | BruceHad/scripts | /filter_reports/commitreports.sql | UTF-8 | 534 | 3.65625 | 4 | [] | no_license | -- This will list all locations still set to receive paper reports
select
loc.location_no
from dpdapp.list_numbers ln
inner join dpdapp.list_number_locations lnl
on (ln.list_number = lnl.ln_list_number)
inner join dpdapp.locations loc
on (loc.location_no = lnl.loc_location_no)
where 1=1
and ln.gdpa... | true |
9ed6e5b915ca12ead8932610d2d6ac90b1fd0001 | SQL | valdipietro/sabretooth | /sql/upgrade/1.0.0/role_has_operation.sql | UTF-8 | 4,589 | 2.578125 | 3 | [] | no_license | -- add the new queue view widget to admins and supervisors
INSERT IGNORE INTO role_has_operation
SET role_id = ( SELECT id FROM role WHERE name = "administrator" ),
operation_id = ( SELECT id FROM operation WHERE
type = "widget" AND subject = "queue" AND name = "view" );
INSERT IGNORE INTO role_has_operati... | true |
f0fb9a3fa2fe2fa04a7d6613a7bdfd39a628b09b | SQL | DanoLaug/Agencia-de-viajes | /ponchitodb_phpmyadmin.sql | UTF-8 | 11,564 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-05-2021 a las 06:55:45
-- Versión del servidor: 10.5.9-MariaDB
-- Versión de PHP: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
81c2f751213a8b0d99f2abddd860dc55cb3aab3e | SQL | xbackupx/peqXdb | /Dev_Updates/Rev1054-Bots.sql | UTF-8 | 1,383 | 3.65625 | 4 | [] | no_license | alter table bots
add column `LastZoneId` smallint(6) NOT NULL DEFAULT '0';
CREATE TABLE IF NOT EXISTS `botguildmembers` (
`char_id` int(11) NOT NULL default '0',
`guild_id` mediumint(8) unsigned NOT NULL default '0',
`rank` tinyint(3) unsigned NOT NULL default '0',
`tribute_enable` tinyint(3) unsigned NOT NULL... | true |
74cd4f825aaeb86d5e4bf8e5391beecdbd34e198 | SQL | tharindu45/Eurobe_bus_system | /europebus.sql | UTF-8 | 4,842 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 28, 2020 at 10:50 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... | true |
5566710d7cfd8087528b970b178257eb4e4c8555 | SQL | num5268/Biz_403_2021_04_DBMS | /도서대여프로젝트/도서대여프로젝트(2021-04-30-002).sql | UTF-8 | 3,899 | 4.5625 | 5 | [] | no_license | -- bookuser 접속
-- books Table과 author, company table은 Relation 관계가 있다
-- books의 bk_ccode와 company의 cp_code
-- books의 bk_acode와 company의 au_code
-- 연관관계에 있는 table을 EQ JOIN을 실행할때
-- 만약 author, company table에 없는 데이터가(코드)가
-- books에 있다면 EQ JOIN을 하면 데이터가 누락되어 버린다
-- 또한 LEFT JOIN을 하면 값이 (null)로 출력된다
-- JOIN 데이터가 누... | true |
d73e78a4723af4d64a96a7abbc49e7b9f1027a8e | SQL | september98/yxt | /database/yxtcmf/chatmsg.sql | UTF-8 | 522 | 2.828125 | 3 | [] | no_license | -- --------------------------------------------------------
--
-- 表的结构 `yxt_chatmsg`
--
CREATE TABLE IF NOT EXISTS `yxt_chatmsg` (
`id` int(8) unsigned NOT NULL AUTO_INCREMENT,
`content` text,
`time` int(15) DEFAULT NULL,
`sender` varchar(20) DEFAULT NULL,
`pic` varchar(225) DEFAULT NULL,
`timee` datetime... | true |
52d4ae6bba75c2ef76a01b30c6a3a7816051db2d | SQL | andri000me/iq | /query/query_mapel.sql | UTF-8 | 850 | 3.65625 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SELECT * FROM (
SELECT
mapel.id,
mapel.mapel,
mapel.kelas_id,
mapel.guru_id,
mapel.kelompokmapel_id,
mapel.parent,
mapel.parent_id,
kelompokmapel.kelompokmapel,
kelompokmapel.semester_id,
mapel.id AS order_1,
mapel.id AS order_2
FROM
mapel
INNER JOIN kelompokmapel ON mapel.kelompokmapel_id = kelompokmape... | true |
a7603e6730d898ce1a3c253fce494985b1be4d09 | SQL | danhoying/sql_and_databases | /4_SELECT_within_SELECT.sql | UTF-8 | 1,227 | 4.15625 | 4 | [] | no_license | # Question 1
SELECT name
FROM world
WHERE population >
(SELECT population
FROM world
WHERE name = 'Russia')
# Question 2
SELECT name
FROM world
WHERE continent = 'Europe' AND gdp/population >
(SELECT gdp/population
FROM world
WHERE name = 'United Kingdom');
# Question 3
SELECT name, continent
FROM w... | true |
7bb2de43a50a4173dd4506256c3aa4a158f00363 | SQL | ehb54/us3_sql_back | /us3_autoflow_procs.sql | UTF-8 | 15,191 | 3.953125 | 4 | [] | no_license | --
-- us3_autoflow_procs.sql
--
-- Script to set up the MySQL stored procedures for the US3 system
-- These are related to various tables pertaining to autoflow
-- Run as root
--
DELIMITER $$
--
-- Autoflow procedures
--
-- Returns the count of autoflow records in db
DROP FUNCTION IF EXISTS count_autoflow_records... | true |
4ed5e8ffaf451d5a1ecd648b500c0babc542bacd | SQL | huynhduc296/CO221G1_LeVanHuynhDuc_module3 | /Database_CaseStudy/insert_data_casestudy.sql | UTF-8 | 3,685 | 2.84375 | 3 | [] | no_license | insert into positions(position_name)
value
("trung cấp"),
("Cao đẳng"),
("Đại học "),
("sau đại học");
insert into Employee_level(employess_level_name)
value("Lễ tân"),
("phục vụ"),
("chuyên viên"),
("giám sát"),
("quản lý"),
("giá đốc");
insert into department (department_name)
v... | true |
9046a09214eff86634e5070c6dcb941499e93f72 | SQL | paulafelix/datainfo | /session2/results3e.sql | UTF-8 | 220 | 3.890625 | 4 | [] | no_license | SELECT p.name AS name, MIN(m.year) AS first_year
FROM Person p, Directs d, Genre g, Movie m
WHERE p.pid = d.pid AND d.mid = g.mid AND g.genre = "Action" AND g.mid = m.mid
GROUP BY p.pid
HAVING COUNT(p.name) >= 2; | true |
f340f26793f0febbd2de214271c58b9699a3a8fd | SQL | OpenDRR/model-factory | /scripts/psra_2.Create_table_updates.sql | UTF-8 | 12,191 | 3.125 | 3 | [
"MIT"
] | permissive | -- updates
/* psra_1.Create_table_chazard_ALL copy.sql */
-- add geometries field to enable PostGIS (WGS1984 SRID = 4326)
ALTER TABLE psra_{prov}.psra_{prov}_hmaps ADD COLUMN geom geometry(Point,4326);
UPDATE psra_{prov}.psra_{prov}_hmaps SET geom = st_setsrid(st_makepoint(lon,lat),4326);
-- create index
CREATE INDEX... | true |
8e94391afb4983095c8b0d45709ffe50c614230b | SQL | danilodesouzapereira/plataformasinap_exportaopendss | /Fontes/BD/Rede/BaseAccess/Consultas/SPSNP_rdSuporteUtilizado_p01.sql | UTF-8 | 771 | 2.8125 | 3 | [] | no_license | SELECT
Arranjo.intArranjoId AS ArranjoId,
Arranjo.strDescricao AS ArranjoDescricao
FROM
(
(
ARRANJO_00_01
INNER JOIN Arranjo ON
ARRANJO_00_01.intArranjoId = Arranjo.intArranjoId
)
INNER JOIN Suporte ON
ARRANJO_00_01.intSuporteId = Suporte.intSuporteId
... | true |
27f0e4b3a8a42df5f3cdbe00bad1301f99fdfb28 | SQL | JCelento/album-catalog | /infra/music.sql | UTF-8 | 12,333 | 3.5625 | 4 | [] | no_license | DROP DATABASE IF EXISTS music;
CREATE DATABASE music;
USE music;
CREATE TABLE artist (
artist_id SMALLINT(5) NOT NULL DEFAULT 0,
artist_name CHAR(128) DEFAULT NULL,
PRIMARY KEY (artist_id)
) engine=innoDB;
CREATE TABLE album (
artist_id SMALLINT(5) NOT NULL DEFAULT 0,
album_id SMALLINT(4) NOT NULL... | true |
26f1b877173e730440f72a2e3a40b3665495c333 | SQL | skoulouzis/lobcder | /lobcder-master/src/main/resources/init_stats.sql | UTF-8 | 1,205 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE tx_stats (
uid SERIAL PRIMARY KEY,
logdate TIMESTAMP,
tx_source VARCHAR(1024),
tx_destination VARCHAR(1024),
tx_speed DOUBLE,
tx_size DOUBLE,
tx_destination_country_code2 VARCHAR(1024),
tx_destination_country_name VARCHAR(1024)
) ENGINE=InnoDB;
-- LOAD DATA LOCAL INFILE 'tx.csv'
-- INTO TABLE... | true |
95f655a9ab04ab11ee945b0f91d2a77f3f45b54b | SQL | itsmerizky/Website-Rental-Kendaraan | /database.sql | UTF-8 | 21,997 | 2.890625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 05, 2018 at 11:47 PM
-- Server version: 10.0.35-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
ef79f22aaa18f09fdb0ba3c4965d0dc4bcef12c6 | SQL | RWTH-i5-IDSG/xsharing-services-integrator | /src/main/resources/db/migration/ixsi/V0_1_3__update.sql | UTF-8 | 1,066 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE ixsi.booking_create
(
event_timestamp timestamp without time zone,
provider_id character varying,
booking_target_id character varying,
user_id character varying,
booking_id character varying,
time_period ixsi.time_period,
from_place_id character varying,
to_place_id character varying,
CON... | true |
62f6376d26bb645ab6e3abd55108f4cdb2f3c85b | SQL | azzahfirda/Pemrograman-3 | /akademik/akademik.sql | UTF-8 | 2,498 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 30, 2015 at 09:48 AM
-- Server version: 5.5.32
-- PHP Version: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
6d0ab5c830df15ecfd9c2861031d15e16c0a5dcf | SQL | robarsegh/BetterBalancedGame | /sql/new_bbg_ottoman.sql | UTF-8 | 2,159 | 2.921875 | 3 | [
"MIT"
] | permissive |
-- Grand Bazaar buff
UPDATE Building_GreatPersonPoints SET PointsPerTurn=2 WHERE BuildingType='BUILDING_GRAND_BAZAAR';
UPDATE Building_YieldChanges SET YieldChange=6 WHERE BuildingType='BUILDING_GRAND_BAZAAR' AND YieldType='YIELD_GOLD';
-- Grand Bazaar same ability than bank
INSERT INTO BuildingModifiers(BuildingType... | true |
fa2e058029aa1a236349c2a6ff4a57e821cace6b | SQL | Fukada9905/pythagora | /sql/archives/queries/master/usp_999010_csv.sql | UTF-8 | 1,352 | 3.5625 | 4 | [] | no_license | DROP PROCEDURE IF EXISTS usp_999010_csv;
delimiter //
CREATE PROCEDURE usp_999010_csv(
IN p_user_group_id VARCHAR(10)
)
BEGIN
SELECT
US.user_id AS 'ユーザーID'
, US.user_password AS 'パスワード'
, US.user_name AS '名称'
, US.user_name_kana AS '名称(カナ)'
, US.user_group_id AS 'ユーザーグループID'
, UG.user_group_na... | true |
36ac4cdeb1b6e7ef3421279ecf252a3ca5213d39 | SQL | dmai261/mini-apps-1 | /challenge_3/schema.sql | UTF-8 | 719 | 2.953125 | 3 | [] | no_license | var Sequelize = require('sequelize')
//create database n stuff with sequelizer
const db = new Sequelize('users', 'student', 'student', {
dialect: 'mysql',
})
const Accounts = db.define('accounts', {
Name: Sequelize.STRING,
Email: Sequelize.STRING,
Password: Sequelize.STRING,
})
const Addresses = db.... | true |
dc9cea7f37cf7e2b27e5e5683a54c174c4584b66 | SQL | liante0904/KITRI_01_DB-oracle | /exam02.sql | UHC | 302 | 2.546875 | 3 | [] | no_license | DECLARE
--Į
VEMPNO NUMBER;
--۷
VEMPNO employees.employee_id%TYPE;
VNAME VARCHAR2(10);
BEGIN
VEMPNO := 100;
SELECT first_name INTO VNAME
FROM employees
WHERE employee_id = VEMPNO;
DBMS_OUTPUT.PUT_LINE (VEMPNO ||' ̸ '|| VNAME ||'Դϴ.');
END;
/
| true |
429d259ab81f4975be6c50de3484af9a7eeb179b | SQL | dr1314/Sparks-Intern | /sql/sparks_bank.sql | UTF-8 | 892 | 3.5 | 4 | [] | no_license | CREATE TABLE `transaction` (
`sno` int(3) NOT NULL,
`sender` text NOT NULL,
`receiver` text NOT NULL,
`balance` int(8) NOT NULL,
`datetime` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `users` (
`id` int(3) NOT NULL,
`name` text NOT NULL,
`email` ... | true |
b5970bed264b3b17e0bc15beaa29516b7021785b | SQL | lawlin00/BudgetTrackingSystem | /MoneyManager/database/moneymanager.sql | UTF-8 | 13,708 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 16, 2020 at 05:27 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
c8ce4dfc415812f7e7fda98b8ab0f7d1340027b5 | SQL | bitgittry/BaseCodeAnalysis | /trunk/dbv/stored_routines/CommonWalletColossusPlaceBet.sql | UTF-8 | 21,921 | 3.734375 | 4 | [] | no_license | DROP procedure IF EXISTS `CommonWalletColossusPlaceBet`;
DELIMITER $$
CREATE DEFINER=`bit8_admin`@`127.0.0.1` PROCEDURE `CommonWalletColossusPlaceBet`(sessionID BIGINT, clientStatID BIGINT, betAmount DECIMAL(18,5), betReal DECIMAL(18,5), betBonus DECIMAL(18,5),
betBonusWinLocked DECIMAL(18,5), gamePlayBetCounterID BI... | true |
7d1dea87a97f6cd0fb94fef353e985c7debfc643 | SQL | sdm-spring-tutorial-organization/sdm-spring-mybatis | /src/main/resources/db/migration/version/V1__manage_table.sql | UTF-8 | 286 | 2.953125 | 3 | [] | no_license |
-- SCHEMA
-- CREATE SCHEMA IF NOT EXISTS "PUBLIC";
-- USER
-- CREATE USER IF NOT EXISTS tester PASSWORD 'tester';
-- ALTER USER tester ADMIN TRUE;
-- GRANT ALL TO tester;
CREATE TABLE member (
code INT(11) unsigned NOT NULL,
name VARCHAR(32) NOT NULL,
score INT(11) NULL
); | true |
9260c05f1ca63658ea8507a9ad1a32eca9bc59da | SQL | tskehin/hadoop | /src/sql/task_queries.sql | UTF-8 | 620 | 3.71875 | 4 | [] | no_license | --total records
INSERT OVERWRITE DIRECTORY '/results/answerset_1'
SELECT COUNT(*)
FROM Posts;
--top posts by score
INSERT OVERWRITE DIRECTORY '/results/answerset_2'
SELECT Score, Title
FROM Posts
ORDER BY Score
DESC LIMIT 10;
--top users by score
INSERT OVERWRITE DIRECTORY '/results/answerset_3'
SELECT OwnerUserI... | true |
a848c6e6a6083c3dbd07cea22d6a0c0630f83140 | SQL | skwid138/to-do-app | /database.sql | UTF-8 | 352 | 2.90625 | 3 | [] | no_license | -- DB Name: to-do
-- Table Creation
CREATE TABLE tasks (
id SERIAL PRIMARY KEY,
name VARCHAR(30),
description VARCHAR(200), -- could also use TEXT
status BOOLEAN DEFAULT false,
due VARCHAR(10),
created DATE DEFAULT CURRENT_DATE, -- this may not work, I changed it using the gui
completed DATE -- this may not wor... | true |
7a4abb0266555b4bd62d127d3ef63aa075bd0962 | SQL | PNNL-Comp-Mass-Spec/DBSchema_PgSQL_DMS | /dms/t_analysis_job_processor_tools.sql | UTF-8 | 1,693 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | --
-- Name: t_analysis_job_processor_tools; Type: TABLE; Schema: public; Owner: d3l243
--
CREATE TABLE public.t_analysis_job_processor_tools (
tool_id integer NOT NULL,
processor_id integer NOT NULL,
entered timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
entered_by public.citext DEFAULT... | true |
0e1d2526cd57b0ab3c99d20795172d52697f1f14 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day09/select1830.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-08T18:30:00Z' AND timestamp<'2017-11-09T18:30:00Z' AND temperature>=49 AND temperature<=97
| true |
8e20e127cbb06aad9de5ac163e88482eee07f9fb | SQL | evan886/python | /django/old/project/ch07www/mysite_product.sql | UTF-8 | 1,987 | 3.15625 | 3 | [] | no_license | BEGIN TRANSACTION;
CREATE TABLE "mysite_product" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "price" integer unsigned NOT NULL, "pmodel_id" integer NOT NULL REFERENCES "mysite_pmodel" ("id"), "nickname" varchar(15) NOT NULL, "year" integer unsigned NOT NULL, "description" text NOT NULL);
INSERT INTO `mysite_produ... | true |
08f033dff2e33712aa2cbb3fbcd0db2f371429b3 | SQL | wlikel/Graduate | /graduation.sql | UTF-8 | 5,338 | 3.234375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Zero
Source Server Version : 50725
Source Host : localhost:3306
Source Database : graduation
Target Server Type : MYSQL
Target Server Version : 50725
File Encoding : 65001
Date: 2019-05-30 17:36:49
*/
SET FOREIGN_KEY_CH... | true |
23f01ea9a2329fd91584fd8f9771da32902d2457 | SQL | bellmit/pos | /PosWeb/db/tokoku.sql | UTF-8 | 23,673 | 3.171875 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.16 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 8.3.0.4749
-- -------------------------------------------------------... | true |
d17daceb26999d82e839108e903d99c77b20a7e7 | SQL | mamt01/Rocket_Elevators_Information_System | /queries/Question_1.sql | UTF-8 | 182 | 3.078125 | 3 | [] | no_license | SELECT extract(YEAR FROM date_of_creation) AS YEAR, extract(MONTH FROM date_of_creation) AS MONTH, COUNT(contact_id)
FROM factcontact
GROUP BY YEAR, MONTH
ORDER BY YEAR, MONTH | true |
b4ecc9a1d70ddad06db13a23d35b808119a9c9cf | SQL | jivemachine/database-exercises | /3.4_select_exercises.sql | UTF-8 | 566 | 3 | 3 | [] | no_license | SELECT * FROM albums;
SELECT NAME FROM albums
WHERE artist = "Pink Floyd";
SELECT release_date FROM albums
WHERE NAME = "Sgt. Pepper's Lonely Hearts Club Band";
SELECT genre FROM albums
WHERE NAME = "Nevermind";
SELECT NAME FROM albums
WHERE release_date BETWEEN 1990 AND 1999;
SELECT NAME FROM albums
WHERE sales... | true |
417b94efbc49b9b5014dca4442a81de59166ae8c | SQL | vmhgarcia2/PLSQL | /17072019/MediaProductoDosFechas.sql | UTF-8 | 287 | 2.546875 | 3 | [] | no_license | -- Muestre media producto entre dos fechas
CREATE OR REPLACE PROCEDURE Media(fecha1 varchar2, fecha2 varchar2) AS
BEGIN
CLG('Media: ' || TotalIngresos(fecha1,fecha2)/TotalProductos(fecha1,fecha2));
END;
/
BEGIN
--Media('07/06/19','22/06/19');
Media('&fecha1','&fecha2');
END; | true |
0637c2bfe47e1ff97492e6cf53af634adc380e56 | SQL | ZVlad1980/doo | /bk/sql/_service_scheme.sql | UTF-8 | 1,451 | 2.8125 | 3 | [] | no_license | begin
merge into xxdoo_db_schemes_t s
using (select -1 id,
1 version,
'xxdoo_bk' name,
'Base scheme API BOOK' full_name,
'xxdoo' owner
from dual
) u
on (s.id = ... | true |
1c75aa7c4ae445782fb5b9907b3fef203f64749b | SQL | Ttt749/chengji_javaweb | /db1.sql | UTF-8 | 996 | 2.578125 | 3 | [] | no_license |
CREATE TABLE tb_user(
user_id VARCHAR (100) PRIMARY KEY ,
user_name VARCHAR (100) NOT NULL UNIQUE ,
user_password VARCHAR (100) NOT NULL ,
user_role INTEGER
);
INSERT INTO `tb_user` (`user_id`,`user_name`,`user_password`,`user_role`) VALUES ('6512613','admin','admin',1);
INSERT INTO `tb_user` (`user_id`,`use... | true |
0f31b819386bddbbc07796c735336742d8d8b5af | SQL | AleksandrKucepalov/diplom | /BlogAPI/src/main/resources/db/migration/V4__update_vote.sql | UTF-8 | 1,687 | 2.640625 | 3 | [] | no_license | truncate table blog.post_votes;
INSERT INTO blog.post_votes (id,post_id,time,user_id,value)
VALUES
(1,1, now()-INTERVAL rand()*50 DAY, 1, -1),
(2,1, now()-INTERVAL rand()*50 DAY, 3, -1),
(3,1, now()-INTERVAL rand()*50 DAY, 2, 1),
(4,2, now()-INTERVAL rand()*50 DAY, 1, 1),
(6,2, now()-INTERVAL rand()... | true |
3a47012029c4ca29d879d3e5945a1de76c291a4d | SQL | aqueza2/intro-sql-assessment | /apartmentlab/migration.sql | UTF-8 | 1,950 | 3.34375 | 3 | [
"MIT"
] | permissive | DROP DATABASE IF EXISTS apartmentlab;
CREATE DATABASE apartmentlab;
USE apartmentlab;
DROP TABLE IF EXISTS owners CASCADE;
DROP TABLE IF EXISTS properties ;
CREATE TABLE owners(id SERIAL PRIMARY KEY, name TEXT, age INTEGER);
CREATE TABLE properties (id SERIAL PRIMARY KEY, name TEXT, num_units INTEGER, owner_id IN... | true |
3527a222cf3c025d8b7d5256a63aae27b5863c40 | SQL | groya52/sqlserver | /Indexes/Statistics/CREATE STATISTICS.sql | WINDOWS-1251 | 2,123 | 2.9375 | 3 | [] | no_license | /*
CREATE STATISTICS statistics_name ON { table_or_indexed_view_name } ( column [ ,...n ] )
[ WHERE <filter_predicate> ]
[ WITH
[ [ FULLSCAN
[ [ , ] PERSIST_SAMPLE_PERCENT = { ON | OFF } ]
| SAMPLE number { PERCENT | ROWS }
... | true |
c5b33bb5da4cebbbec2b31bb0ff3731bd3d8176f | SQL | Zoe327/SQL-Learning | /IMDB data/q7.sql | UTF-8 | 455 | 4.0625 | 4 | [] | no_license | /*IMDB top 250 moves along with weighted rating*/
WITH
ar(C) AS (SELECT SUM(rating*votes)/SUM(votes) FROM ratings JOIN titles ON titles.title_id == ratings.title_id AND titles.type == 'movie'),
mv(m) AS (SELECT 25000.0)
SELECT primary_title,(votes/ (votes + m))*rating + (m / (votes+m))*C AS weighted_rating
FROM ra... | true |
646526b104d6e12548e64053469bd1760e593a35 | SQL | GerdyRiban/legendary-palm-tree | /garrick/create.sql | UTF-8 | 256 | 3.0625 | 3 | [
"MIT"
] | permissive | USE store;
DROP TABLE IF EXISTS roles;
CREATE TABLE roles (
id int(11) auto_increment PRIMARY KEY,
role varchar(22),
employee_id int(11) REFERENCES employees(id),
location_id int(11) REFERENCES locations(id),
blacklisted int(2)
); | true |
d79ed22566abd1c2bbc9e225314776c41ecd0353 | SQL | sunupupup/Leetcode | /sql/SQL2 查找入职员工时间排名倒数第三的员工所有信息/test.sql | UTF-8 | 902 | 4.40625 | 4 | [] | no_license |
/*SQL2 查找入职员工时间排名倒数第三的员工所有信息*/
/*
思路1: 按照最晚日期倒叙排,利用limit取第三行数据即可
不足:倒三入职的员工可能不止一个
*/
SELECT *
from employees
order by hire_date desc
limit 2,1;
/*
思路2: 找到倒三的日期,用 = 号进行筛选
*/
SELECT *
from employees
where hire_date = (
select hire_date
FROM employees
group by hire_date
order by hire_date DESC
li... | true |
17d9d49dfed81b4616a66a12151d8ed1fc0ad4e9 | SQL | saltamiu/quiz | /Functions.sql | UTF-8 | 433 | 3.03125 | 3 | [] | no_license | delimiter @
drop function if exists nameInUse@
create function nameInUse (username varchar(100))
returns int
begin
return (select ID from users where users.username=username) is not null;
end
# set id = (select ID from users where username=usernamek);
# declare result boolean default false;
# declare id int defaul... | true |
47a11c24a3612386f6f78e94cf9cabf098c22dad | SQL | tedchain/tedchain-technology | /tools/Tedchain.SqlServer.Schema/Stored Procedures/GetAllRecords.sql | UTF-8 | 356 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | CREATE PROCEDURE [Tedchain].[GetAllRecords]
@instance INT,
@recordType TINYINT,
@recordName VARCHAR(512)
AS
SET NOCOUNT ON;
SELECT Records.[Key], Records.[Value], Records.[Version]
FROM [Tedchain].[Records]
WHERE Records.[Instance] = @instance AND Records.[Type] = @recordType AND Recor... | true |
c213effe6f9b4e244eb6538a750e6dc5d9ba5692 | SQL | sketchdude/exhibition | /sql/exhibition.sql | UTF-8 | 11,382 | 3.1875 | 3 | [] | no_license | -- eXhibition - A PHP/MySQL Art Publishing System
-- copyright (c) 2008 sketchdude
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; either version 2
-- of the License, or (at your optio... | true |
68a9a194513be3ca12475f00667f3c4ebfa61ed3 | SQL | imavishek/StairSupplies | /db/changes/2016/2016-07-08 - PO receive history.sql | UTF-8 | 1,321 | 3.46875 | 3 | [] | no_license | CREATE TABLE `TblPurchaseOrderReceive` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`PurchaseOrderID` INT(11) NULL DEFAULT NULL,
`ReceivedOn` DATE NULL DEFAULT NULL,
`RecordCreated` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_TblPurchaseOrderReceive_TblPurchaseOrder` (`PurchaseOrderID`),
CONSTRAINT `FK_... | true |
5248c5d77db156e10da241accf911d05778007c7 | SQL | Ashiqur-Rahman-Tanzil/Office-Management-System | /databases/notice_board.sql | UTF-8 | 1,499 | 2.578125 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 13.2
-- Dumped by pg_dump version 13.2
-- Started on 2021-05-04 23:10:19
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalo... | true |
af8956e267af1a874b186a17c350d0245d5733d4 | SQL | umamaheswararaop/meetup | /database/participant_db.sql | UTF-8 | 3,273 | 3.546875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 20, 2021 at 10:21 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
8942b92c37eaf92fb7075247e2c020aef3f754b0 | SQL | 4d4m43/SQL | /3.sql | UTF-8 | 597 | 3.46875 | 3 | [] | no_license | /* 3a. You want to keep a description of each actor. You don't think you will be performing queries on a description, so create a column in the table `actor` named `description` and use the data type `BLOB` (Make sure to research the type `BLOB`, as the difference between it and `VARCHAR` are significant).
* 3b. Very ... | true |
312d6e7957ff4421dc5712bb7701b5a76605ab16 | SQL | bridgecrew-perf7/RigDig-Snowflake-Deployment | /VIEWS/R__RIGDIG_ACTIVITY_LATEST.sql | UTF-8 | 1,369 | 3.125 | 3 | [] | no_license | CREATE or replace VIEW ITD_SCHEMACHANGE_DEMO.RIGDIG_ACTIVITY_LATEST
comment = '@file: Views-RigDig.sql
@author: John Pabst Jr.
@email: A-John.Pabst@paccar.com
@project: Customer 360
@repo: https://github.com/PACCAR-Digital/data-solutions
@description:
Update Oct 2021 - create latest view using the new materialized... | true |
296af33c2bdd4456123ef31043d0e0d492466bfb | SQL | Emreburak1/SQL-Reference | /10. select.sql | UTF-8 | 323 | 3.640625 | 4 | [] | no_license | SELECT name
FROM student;
SELECT student.name, student.major
FROM student
ORDER BY name DESC;
SELECT *
FROM student
ORDER BY major DESC, student_id ASC;
SELECT *
FROM student
ORDER BY student_id DESC
LIMIT 2;
SELECT *
FROM student
WHERE student_id <> 3;
SELECT *
FROM student
WHERE name IN ("Claire", "Kate", "Mike... | true |
67f80d414b3aad4416f21fa5cc8e3fd6b16f9c72 | SQL | Mkelly0717/PSO_PROD | /U_8D_SOURCING_OLD.sql | UTF-8 | 1,850 | 2.796875 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Procedure U_8D_SOURCING_OLD
--------------------------------------------------------
set define off;
CREATE OR REPLACE PROCEDURE "SCPOMGR"."U_8D_SOURCING_OLD" as
--about 12 minutes, (line 35 almost all)
begin
delete optimizersourcingexception
... | true |
e4cee8638f08cd538b7c3348f86553fdc8f07414 | SQL | TheChunkyPumpkinhead/Waves-search-api | /migrations/001.do.create.tables.sql | UTF-8 | 1,542 | 4.125 | 4 | [] | no_license | DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS locations;
DROP TABLE IF EXISTS ratings;
DROP TABLE IF EXISTS comments;
DROP TABLE IF EXISTS user_locations;
CREATE TABLE users (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
email VARCHAR (255) UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE... | true |
c589543466897630219d8c5755e27bbbade5ed0a | SQL | IVSEZ/mysqlbis | /Analysis/casa_analysis.sql | UTF-8 | 588 | 3.4375 | 3 | [] | no_license | select a.*,b.username from
rcbill.rcb_casa a
left join
rcbill.rcb_users b
on a.userid=b.id
-- only the residential customers
-- (select * from rcbill.rcb_casa where CLID in (select id from rcbill.rcb_tclients where CLClass=13)) tx
where
(a.hard not in (100, 101, 102) or a.hard is null)
-- and date(PAYDA... | true |
b56956ba95425b5db229f7b7f83e519f2001c16e | SQL | allmight02/MY-SQL | /-- Connexion server mysql.sql | UTF-8 | 7,709 | 4.1875 | 4 | [] | no_license | -- Connexion server mysql
mysql -u root -p
-- Affichages de toutes les bdd
SHOW DATABASES;
-- Création d'une bdd
CREATE DATABASE NOM_DE_LA_BDD;
-- Séléction d'une bdd
USE NOM_DE_LA_BDD;
-- Création d'une table dans une bdd
-- Type de donnée(INT, VARCHAR, TEXT, DECIMAL, etc)
CREATE TABLE nom_de_la_bdd (
nom... | true |
ef7c9d3dde145cc862ef450c344bf4c5265d46e6 | SQL | sandhose/recipes-api | /schema/base.sql | UTF-8 | 5,748 | 3.78125 | 4 | [] | no_license | CREATE SCHEMA internal;
CREATE SCHEMA api;
CREATE EXTENSION pgcrypto SCHEMA internal;
-- REVOKE ALL PRIVILEGES ON DATABASE recipes2 FROM admin;
-- REVOKE ALL PRIVILEGES ON DATABASE recipes2 FROM authenticated;
-- REVOKE ALL PRIVILEGES ON DATABASE recipes2 FROM anonymous;
-- DROP ROLE admin;
-- DROP ROLE authenticate... | true |
d495a9aea4e3228f255dea3e838d4c6ed3135644 | SQL | pugmarx/ccproject | /TASK1/part2-hadoop/cqls/G2_Q1_setup.cql | UTF-8 | 321 | 2.53125 | 3 | [] | no_license | CREATE KEYSPACE IF NOT EXISTS airline WITH replication = {
'class' : 'SimpleStrategy',
'replication_factor' : 2
};
USE airline;
CREATE TABLE IF NOT EXISTS airport_carrier
( airport text,
carrier text,
depdelay double,
PRIMARY KEY (airport, depdelay, carrier)
);
EXIT;... | true |
4404d871502ddebc402b40ff10f60a0c662d24d7 | SQL | j7ng/CLFY_SA | /SA/Procedures/VALIDATE_CDMA_DATA_SERVICE_PRC.sql | UTF-8 | 1,068 | 3.21875 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE sa."VALIDATE_CDMA_DATA_SERVICE_PRC"
( IP_ZIPCODE IN VARCHAR2
, OP_RESULT OUT NUMBER
) AS
cursor cdma_cur is
SELECT b.carrier_id
FROM npanxx2carrierzones b, (
SELECT DISTINCT a.ZONE,
a.st,
a.sim_profile,
a.sim_profile_2,
a.CARRIER_NAME,
... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.