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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
56a5e0763ce020739da8b71f65705ea03e55054b | SQL | deawx/redbox-scan | /examples/assets/scan.sql | UTF-8 | 2,120 | 3.015625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Dec 22, 2015 at 09:33 PM
-- Server version: 5.5.42
-- PHP Version: 5.6.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... | true |
8f1a918629069287841f7d805b6b897b0943a5e1 | SQL | BLRussell-09/ChinookQueries | /ChinookQuery9.sql | UTF-8 | 264 | 3.625 | 4 | [] | no_license | -- total_sales_{year}.sql: What are the respective total sales for each of those years?
select Sum(i.Total) as Sold_in_2011, (Select SUM(i.Total) from Invoice as i where Year(i.InvoiceDate) = 2009) as Sold_In_2009
from Invoice as i
where Year(InvoiceDate) = 2011
| true |
aa37609645084c9bf73f47ab00014040a3b70db3 | SQL | iFeddy/unla-bd1 | /Procedimientos/sp_modelos_alta.sql | UTF-8 | 277 | 2.578125 | 3 | [] | no_license | CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_modelos_alta`(
in ModeloNombre VARCHAR(45),
out nResultado INT
)
BEGIN
set nResultado = -1;
INSERT INTO autos_modelos (nombre) VALUES (ModeloNombre);
IF( row_count() > 0 ) THEN
set nResultado = 0;
END IF;
END | true |
b939af57e5f9d3d7ff41f0661a735a4cfadd513a | SQL | bzzbzz7/HadoopLearn | /src/main/resources/hive/hiveQL.sql | UTF-8 | 3,150 | 3.875 | 4 | [
"Apache-2.0"
] | permissive | -- noinspection SqlNoDataSourceInspectionForFile
-- 1:创建内部表:
create table student(
id int,
name string,
age int)
comment 'this is student message table'
row format delimited fields terminated by '\t';
-- 从本地加载数据
load data local inpath './data/hive/student.txt' into table student;
-- 从HDFS加载数据
load data inpath './data... | true |
ce2ac6c7ebcd43b4616b35a49ac46935a99827e2 | SQL | ygortassiano/fideliza_source_manager | /fideliza_adroid/aba.sql | UTF-8 | 610 | 3.171875 | 3 | [] | no_license | tab 1 parametro 17 (CAMPANHA) TAB 2 CAMPANHA / DATA FATURAMENTO /ZONA TAB 3 DATA_NAVEG / CAMPANHA / ZONA / FLAG
SELECT RIID_,
CAMPANHA
FROM CL
JOIN TAB 3 B ON $A$.CUSTOMER_ID =$B$.CUSTOMER_ID
JOIN tab 2 ON tab 2.zona = tab 3 .zona
WHERE trunc(data_faturamento) = trunc(sysdate -2) EXISTS
(SELECT 1
FROM... | true |
9f81780aaaefae38578aeafaa57be4916e92c7b2 | SQL | Konradsh/database_msc2020 | /sql/zapytania/17.sql | UTF-8 | 149 | 3.234375 | 3 | [] | no_license | SELECT round(((SELECT count(id) FROM customer WHERE customer.pesel IS NOT null AND
customer.nip IS null)/count(id))*100,1) as procent from customer; | true |
6dc6e598716a7ab0375b11117b2b69c3eba91b1a | SQL | todayido/integration | /db/2016-11-02-combination.sql | UTF-8 | 3,905 | 3.5 | 4 | [] | no_license | /*
SQLyog v10.2
MySQL - 5.1.73-community : Database - combination
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@F... | true |
6bd036fe760cfd599afac05c26f6e77bb8902284 | SQL | housepower/ClickHouse | /tests/queries/0_stateless/01130_in_memory_parts_check.sql | UTF-8 | 519 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | -- Tags: no-s3-storage
-- Part of 00961_check_table test, but with in-memory parts
SET check_query_single_value_result = 0;
DROP TABLE IF EXISTS mt_table;
CREATE TABLE mt_table (d Date, key UInt64, data String) ENGINE = MergeTree() PARTITION BY toYYYYMM(d) ORDER BY key
SETTINGS min_rows_for_compact_part = 1000, m... | true |
433b91a770b84999585fad838bbbf2271a1ee040 | SQL | sravanthigujjari/bat-scripts | /Sql Script.sql | UTF-8 | 1,326 | 3.671875 | 4 | [] | no_license | select
Patient_FirstName,
Patient_LastName,
Patient_PhoneNumber,
Activation_Date,
trantype
from(
select
SubmittedFirstName as Patient_FirstName,
Submittedlastname as Patient_LastName,
SubmittedPatientPhone as Patient_PhoneNumber,
Processdate as Activation_Date,
trantype,
sum(net_activation_qty) as ne... | true |
8bf2ea1cdd0e342cc03e427dc0e11dacfb3ce2db | SQL | pixtelation/BookHive | /Customercart.sql | UTF-8 | 415 | 2.515625 | 3 | [] | no_license | create table Customercart
(
bookid int ,
bookcode varchar(100),
bookname varchar(100),
bookauthor varchar(100),
bookprice int,
)
select * from Customercart
alter table Customercart
alter column bookprice int;
select sum(bookprice)from Customercart
truncate table Customercart
insert into Cu... | true |
c603d63e89e78177d8eabf9b45cf06ba3b6f461d | SQL | juan-skill/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/13-count_shows_by_genre.sql | UTF-8 | 287 | 3.703125 | 4 | [] | no_license | -- lists all genres from hbtn_0d_tvshows and displays the number of shows linked to each
SELECT tv_genres.name AS genre, COUNT(*) AS number_shows FROM tv_genres
JOIN tv_show_genres
WHERE tv_show_genres.genre_id = tv_genres.id
GROUP BY tv_show_genres.genre_id
ORDER BY number_shows DESC;
| true |
5ea425bebfc3af542de37e39cd9e2c1c005ab0a3 | SQL | jitendrathakur/xxyyzz | /app/Config/Schema/jitendra.sql | UTF-8 | 3,953 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 09, 2013 at 12:07 AM
-- Server version: 5.5.24
-- PHP Version: 5.3.10-1ubuntu3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... | true |
b09ae9ccfc417c0a7a47c6852dd23c692dcc7619 | SQL | Ricardo071019/pap_24_06_21 | /pap (3).sql | UTF-8 | 15,099 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 24-Jun-2021 às 14:14
-- Versão do servidor: 10.4.17-MariaDB
-- versão do PHP: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
cfdfc9b882445acba8aaf3f433da8aab5deed140 | SQL | NikeSmitt/mysql_geekbrains_course | /dz7.sql | UTF-8 | 1,315 | 4.03125 | 4 | [] | no_license | /*
Составьте список пользователей users, которые осуществили хотя бы один заказ orders в интернет магазине
*/
SELECT id, name FROM users WHERE id IN (SELECT user_id FROM orders);
/*
Выведите список товаров products и разделов catalogs, который соответствует товару.
*/
/* Не совсем понял, что имелось в виду, поэтому... | true |
2d147198bb00e61f7bb6453d0ca6f7fef8f5a761 | SQL | claudialphonse78/trial | /server/validator-master/sql/tablesfreeuser.sql | UTF-8 | 2,781 | 3.5625 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS `freeuser` (
`fid` int(100) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`fusername` varchar(200) NOT NULL,
`email` varchar(200) NOT NULL,
`password` varchar(200) NOT NULL,
`date` varchar(100) NOT NULL,
PRIMARY KEY (`fid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREM... | true |
319e7830cc9cc43d3b9272afaa818e1b684b9fe2 | SQL | TechOffice/TechOffice-Database | /010-Oracle/010-SQL/DbObject/NOT_NULL_CONSTRAINTS.sql | UTF-8 | 402 | 3.09375 | 3 | [] | no_license | WITH
function long2varchar(i_constraint_name varchar2) return varchar2 as
l_search_condition LONG;
begin
select search_condition into l_search_condition
from user_constraints where constraint_name = i_constraint_name;
return substr(l_search_condition, 1, 3000);
END;
select * ... | true |
5130f095497c5d16395802c615c41b14b79b37b4 | SQL | CUBRID/cubrid-testcases | /sql/_23_apricot_qa/_01_sql_extension3/_03_pseudocolumn_in_default_clause/_04_alter/_01_alter_add/cases/alter_add_012.sql | UTF-8 | 1,643 | 4.03125 | 4 | [
"BSD-3-Clause"
] | permissive | --add columns with default value of SYSDATETIME
set system parameters 'add_column_update_hard_default=yes';
create table a12(id short primary key auto_increment);
insert into a12 values(null), (null), (null);
select if (count(*) = 3, 'ok', 'nok') from a12;
--add column with default value
alter table a12 add colum... | true |
1fd50e901121ab9f7d7dde7219b0ee2af462693c | SQL | jamil-said/code-samples | /SQL/SQL_challenges/secondHighestSalary.sql | UTF-8 | 1,181 | 3.953125 | 4 | [] | no_license | -- Tested on MySQL
/* secondHighestSalary
Write a SQL query to get the second highest salary from the Employee table.
+----+--------+
| Id | Salary |
+----+--------+
| 1 | 100 |
| 2 | 200 |
| 3 | 300 |
+----+--------+
For example, given the above Employee table, the query should return 200
as the secon... | true |
0fd4fd61af5ad0ff561a758f0fbcc9b1bc1d9a64 | SQL | DmitrijR13/billAuk | /Main/DATA/IFMX/SQL/config_saha_bi.sql | WINDOWS-1251 | 1,737 | 2.65625 | 3 | [] | no_license | database websahbi;
set encryption password "IfmxPwd2";
CREATE PROCEDURE tshu_drp() on exception return; end exception with resume
drop table config;
END PROCEDURE;
EXECUTE PROCEDURE tshu_drp(); DROP PROCEDURE tshu_drp;
CREATE PROCEDURE tshu_drp() on exception return; end exception with resume
create table... | true |
c946cbc99cba3d416f5c566da0f2eb498682d16d | SQL | allwaysoft/Oracle-1 | /Database performance tuning/Scripts/Capitulo3/06_Verificar_tempo_wait_versus_cpu.sql | UTF-8 | 808 | 3.40625 | 3 | [] | no_license | -- VER TEMPO TOTAL DE WAITs E DE CPU ULTIMOS EVENTOS. Aqui da para ver se BD gastou mais tempo com wait events ou cpu e da p/ ver detalhes de onde foi gasto o tempo
SELECT METRIC_NAME, VALUE, metric_unit
FROM V$SYSMETRIC
WHERE METRIC_NAME IN ('Database CPU Time Ratio','Database Wait Time Ratio')
AND INTS... | true |
2833e4850e374c85625a855c8d4c2bac1f446fa7 | SQL | jackylai87/messaging-api | /db/structure.sql | UTF-8 | 5,770 | 3.265625 | 3 | [] | no_license | 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_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row... | true |
1e8ea82fa16770d36c80e01bc987828dbcdcbe6f | SQL | smyers1243/multithread_2_2_update | /00_01_prep/Structure/005_KCLS_metabib_schema.sql | UTF-8 | 699 | 3 | 3 | [] | no_license | DROP INDEX IF EXISTS metabib.normalized_author_field_entry_gist_trgm;
DROP INDEX IF EXISTS metabib.normalized_remove_insignificants_author_field_entry_gist_trgm;
DROP TYPE IF EXISTS metabib.field_entry_template CASCADE;
CREATE TYPE metabib.field_entry_template AS (
field_class TEXT,
field ... | true |
5ca087eacaf695488f95f531fcabab17ae9ae3a5 | SQL | romie1/mjd | /oracle/m2/s06.sql | UTF-8 | 181 | 3.25 | 3 | [] | no_license | -- join on
alter session set current_schema = hr;
-- join-on, more flexible
select region_name, country_name
from regions r join countries c
on r.region_id = c.region_id;
| true |
d66f8321bb4ff19db63afc59ab56432a566fcecc | SQL | chronic-care/preventive-care-ig | /input/cql/LungCancerSummary.cql | UTF-8 | 5,515 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | library LungCancerSummary version '1.0.0'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers
include FHIRCommon version '4.0.1' called FC
include PatientSummary called PS
include LungCancerScreening called LCS
codesystem "SNOMED": 'http://snomed.info/sct'
code "Never Smoker": '26691900... | true |
e8aba53cfb3c406430f4b6a831a6a9af31647095 | SQL | William20160222/wang_jianghaonan_interactiveSVG | /data_info.sql | UTF-8 | 2,141 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Dec 06, 2019 at 04:51 AM
-- Server version: 5.7.26
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
3d5371513dbae71c407e96c0ddfbdd3e9644c492 | SQL | MUZakharov/TestDBRepo | /postgres/Views/information_schema.column_privileges.sql | UTF-8 | 3,974 | 3.53125 | 4 | [] | no_license | SET SCHEMA "information_schema";
CREATE VIEW column_privileges AS
SELECT (u_grantor.rolname)::sql_identifier AS grantor,
(grantee.rolname)::sql_identifier AS grantee,
(current_database())::sql_identifier AS table_catalog,
(nc.nspname)::sql_identifier AS table_schema,
(x.relname)::sql_identifier... | true |
be03de8624b6a65687635e9f24a2b0d13c5039bd | SQL | ivanceras/mockdata | /schema/exchange_rate.sql | UTF-8 | 695 | 3.125 | 3 | [] | no_license | CREATE TABLE exchange_rate
(
organization_id uuid,
active boolean NOT NULL DEFAULT true,
exchange_rate_id uuid NOT NULL DEFAULT uuid_generate_v4(), -- this will be referred when processing payments with different currencies
from_currency uuid,
exchange_rate double precision,
to_currency uuid,
created time... | true |
9581cabfdf7dfafebad572d3d7b180574b97ca86 | SQL | wx98/WeCharMark | /Service/WeCharMark_DataBase_SQL.sql | GB18030 | 731 | 3.359375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | create database WeCharMark_DataBase;
use WeCharMark_DataBase;
create table subjects
(
sID int identity(1,1) primary key,
sSubject varchar(128)
)
create table students
(
sNo varchar(32) primary key,
sName varchar(32),
sPass varchar(256)
)
create table marks
(
sNo varchar (32) not null foreign key references studen... | true |
e9609939ae43f5ce774de9e77a85cc3c2afc1dde | SQL | mariam-hanna/rails_project | /hotels_rails .sql | UTF-8 | 5,554 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.6deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 22, 2014 at 06:45 AM
-- Server version: 5.5.37-0ubuntu0.13.10.1
-- PHP Version: 5.5.3-1ubuntu2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... | true |
7de6fa1d12d01332c5aa0805b36a2c547970d281 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day11/select1717.sql | UTF-8 | 178 | 2.625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-10T17:17:00Z' AND timestamp<'2017-11-11T17:17:00Z' AND temperature>=46 AND temperature<=81
| true |
546d9e6452b031e0dd6123d83a71a7efe6ce93d8 | SQL | Rahul2200289/SQL-Databases | /Morgan Importing Database/SQLQuery6.sql | UTF-8 | 425 | 3.34375 | 3 | [] | no_license | CREATE TABLE SHIPMENT
(
ShipmentID int identity (100,1),
ShipperID INT,
PurchasingAgentID INT not NULL,
ShipperInvoiceNumber INT,
Origin VARCHAR (20),
Destination VARCHAR (20),
ScheduledDepartureDate DATE,
ActualDepartureDate DATE,
EstimatedArrivalDate DATE,
Constraint pk6 primary key(ShipmentID),
Con... | true |
a4f4b3d82d5b4adc6d7c7b9c5f2782f670dbb1e9 | SQL | etudiant99/pneus | /scripts/wp_inv_type.sql | UTF-8 | 1,559 | 3.015625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Sam 24 Mars 2018 à 20:36
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... | true |
cdedb8597933d7695229734006beff9f15987bdb | SQL | baoxingwang/sql-challenge | /EmployeeSQL/SQLcode.sql | UTF-8 | 3,520 | 4.5 | 4 | [] | no_license | --------------------------------------
--Build database
CREATE TABLE departments (
dept_no VARCHAR PRIMARY KEY,
dept_name VARCHAR
);
CREATE TABLE employees (
emp_no VARCHAR PRIMARY KEY,
birth_date VARCHAR,
first_name VARCHAR,
last_name VARCHAR,
gender VARCHAR,
hire_data VARCHAR
);
CREATE TABLE dept_emp (
e... | true |
8781d45916f417eeb739ce0a58f64a7e799d92ea | SQL | NicoCPH/Carport | /Database/carportdb_forespoergsel.sql | UTF-8 | 4,720 | 2.953125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: carportdb
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... | true |
df98097062d315d1d266162317249b62201e9eb3 | SQL | encolpius1965/gloss | /sql_proc/TmpPasswordApply.sql | UTF-8 | 607 | 2.875 | 3 | [] | no_license | CREATE DEFINER=`root`@`%` PROCEDURE `TmpPasswordApply`(
__password varchar(255), __email varchar(255), lMsg tinyint
)
BEGIN
SET @UserId = (SELECT USER_ID FROM USER WHERE EMAIL=__email);
SET @login = (SELECT LOGIN FROM USER WHERE EMAIL=__email);
if ( @UserId>0)
then
CALL UpdateUserInstall(@UserId, @login, __... | true |
f8c6feba80a2986c10c64c5d0a451830cc7aadff | SQL | Khalll/shifting | /shifting.sql | UTF-8 | 5,035 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 01, 2018 at 03:36 PM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
ebf02f33ddf3bc403e212417486d7317b35420c1 | SQL | marciioluucas/superfox | /superfox.sql | UTF-8 | 15,492 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 28-Nov-2016 às 23:03
-- Versão do servidor: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... | true |
c31800fc572098d3b6686dc0178e70f4e6b05ab5 | SQL | TySag/Few_Projects_In_HUST | /Car/Sql code/select.sql | UTF-8 | 1,078 | 3.75 | 4 | [] | no_license | use car;
SELECT * FROM car.staffs;
SELECT * FROM car.users;
select * from cars;
select * from carsinfo;
select * from Orders;
select (cars.Deposit - records.Cost) as returncost
from records, cars
where cars.cid = records.cid and records.date = (select max(date) from records);
select * from records;
select * from fix... | true |
1f27cc9d48758f2dca67b27a51487d8ee7e6c01a | SQL | d88w/sql_projects | /004_prod_zr_waterfall.sql | UTF-8 | 7,409 | 3.328125 | 3 | [] | no_license |
------------------------------------------------------------
------------------------------------------------------------
------------- Zoom Room Waterfall Table --------------------
------------------------------------------------------------
------------------------------------------------------------
delete from ... | true |
4e6222e0a48f03955104d4b86e0b6a631cedf05a | SQL | MarcoFidelVasquezRivera/sql-random-insert-generator | /data/DDL.sql | UTF-8 | 1,049 | 3.734375 | 4 | [] | no_license | CREATE TABLE Department
(
deptNo CHAR(4) PRIMARY KEY,
deptName VARCHAR(30)
);
CREATE TABLE Employee
(
empNo CHAR(4) PRIMARY KEY,
fName VARCHAR(20),
iName VARCHAR(20),
address VARCHAR(30),
DOB DATE,
sex CHAR(1),
positionn VARCHAR(30),
... | true |
387f4c574bca9d358c1bf1a6765918930651498e | SQL | patsjo/sportclub | /mysql/patches/sportclub_patch_1.1.sql | UTF-8 | 1,687 | 3.546875 | 4 | [] | no_license | ALTER TABLE activity
ADD INDEX IDX_ACTIVITY_ACTIVITYTYPE (activity_type_id),
ADD CONSTRAINT FK_ACTIVITY_ACTIVITYTYPE FOREIGN KEY (activity_type_id)
REFERENCES activity_type(activity_type_id);
ALTER TABLE files
ADD INDEX IDX_FILES_FOLDER (folder_id),
ADD CONSTRAINT FK_FILES_FOLDER FOREIGN KEY (folder_id)
REF... | true |
2c8e8fbd4859a9168bc2b31b9d8a739043fc632d | SQL | htmlacademy-nodejs/1343543-buy-and-sell-3 | /fill-db.sql | UTF-8 | 4,798 | 3.171875 | 3 | [] | no_license |
INSERT INTO users(email, password_hash, first_name, last_name, avatar) VALUES
('ivanov@example.com', '5f4dcc3b5aa765d61d8327deb882cf99', 'Иван', 'Иванов', 'avatar1.jpg'),
('petrov@example.com', '5f4dcc3b5aa765d61d8327deb882cf99', 'Пётр', 'Петров', 'avatar2.jpg');
INSERT INTO categories(name) VALUES
('Книги'),
('Разное... | true |
ec9fbbc06f8a693103779727800c22c0f357e192 | SQL | gistol/etpz | /website/var/system/db-change-log_1516696412-5a66f35c07fe3.sql | UTF-8 | 4,642 | 3.609375 | 4 | [] | no_license | UPDATE `classes` SET `id` = 3, `name` = 'Collection' WHERE (id = 3);
/*--NEXT--*/
CREATE TABLE IF NOT EXISTS `object_query_3` (
`oo_id` int(11) NOT NULL default '0',
`oo_classId` int(11) default '3',
`oo_className` varchar(255) default 'Collection',
PRIMARY KEY (`oo_id`)
) DEFAULT CHARSET=utf8... | true |
55961c18208aab955b643071c33040cb812e33f6 | SQL | doquockhanh/C0220H1-DoQuocKhanh | /Module2/CaseStudy/Furama Database/DB.sql | UTF-8 | 24,577 | 3.265625 | 3 | [] | no_license | CREATE DATABASE furama_resort;
USE furama_resort;
-- --------------------------------------------------------------------------
-- NHAN VIEN
CREATE TABLE vi_tri(
IDvi_tri int PRIMARY KEY AUTO_INCREMENT,
Ten_vi_tri VARCHAR(45)
);
CREATE TABLE trinh_do(
IDtrinh_do INT PRIMARY KEY AUTO_INCREMENT,
trinh_do VARCHAR(45... | true |
4eda3d244b9998a253ec03676a1c540e3ae35246 | SQL | kiransnath/sql_scripts | /Redshift_json_parsing.sql | UTF-8 | 8,559 | 3.203125 | 3 | [] | no_license | drop table if exists prod_b.seq_0_to_10;
CREATE TABLE prod_b.seq_0_to_10 AS (
SELECT 0 AS i UNION ALL
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7 UNION ALL
SELECT 8 UNION ALL
SELECT 9 UNION ALL
SELECT 10
);
drop table i... | true |
b6e046462c20e00f414aa9df9098cd9c3d8d26b0 | SQL | erickjhorman/Crub-Mysql-Node-js- | /Database.sql | UTF-8 | 902 | 3.40625 | 3 | [] | no_license | Create database transito;
use transito;
Create table propietario (
id_cedulapro int(10) not null auto_increment,
nombre varchar(15) not null,
apellido varchar(15) not null,
PRIMARY KEY (id_cedulapro)
);
create table vehiculo(
id_placa int(7) not null auto_increment,
cedulapro_id int(3) not n... | true |
af124998b906d79e5038b859a36705a094dbcdb2 | SQL | Procrat/eva | /migrations/2019-01-31-052443_create_time_segments/up.sql | UTF-8 | 736 | 3.6875 | 4 | [
"Apache-2.0"
] | permissive | CREATE TABLE time_segments (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name TEXT NOT NULL,
start INTEGER NOT NULL,
period INTEGER NOT NULL
);
CREATE TABLE time_segment_ranges (
segment_id INTEGER NOT NULL,
start INTEGER NOT NULL,
end INTEGER NOT NULL
);
-- Add a default time segment: daily from 9 t... | true |
4c72e73c4be7985073edebef2b030dded8efc049 | SQL | duncan0801/final-group-project-backend | /prisma/migrations/20210908162304_/migration.sql | UTF-8 | 277 | 2.8125 | 3 | [] | no_license | /*
Warnings:
- A unique constraint covering the columns `[date,time]` on the table `Appointment` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "Appointment.date_time_unique" ON "Appointment"("date", "time");
| true |
f436ac2d6a57b4477e4d7fd4f79963d5d6a1ed20 | SQL | qq605905613/SSMDEMO | /MchntAuditAssign00/MchntAuditAssign00/sql/tbl_args_reason_conf.ddl.sql | UTF-8 | 722 | 3.21875 | 3 | [] | no_license | SET CURRENT SCHEMA ARGS;
CREATE TABLE
ARGS.TBL_ARGS_REASON_CONF
(
MCHNT_TP CHARACTER(4) WITH DEFAULT NOT NULL,
SPEC_DISC_TP CHARACTER(2) WITH DEFAULT NOT NULL,
SPEC_DISC_LVL CHARACTER(1) WITH DEFAULT NOT NULL,
REASON_TP CHARACTER(4) WITH DEFAULT NOT NULL,
REC_ST CHARACTER(1) WITH DEFAU... | true |
627684cd0fed94be07e9fc2ca7d7ecec596df492 | SQL | dssg/rws_accident_prediction_public | /database/archive/create_panel.sql | UTF-8 | 1,209 | 3.84375 | 4 | [
"MIT"
] | permissive | -- this joins ongeval to hectopunten through the ongeval_hectopunten link
with panel_staging_0 as (
select o.datetime,date_trunc('hour', o.datetime) as datetime_rounded,h.weather_station,
o.ongekey, h.hectoyearkey, 1 as acccident, h.num_lanes_max
from rws_clean.ongevallen as o
left join rws_clean.ong_hect_link as l
on ... | true |
5b50e731e07a07bac188f66725d0a4210d8497dc | SQL | egor-rogov/postgres_air | /tables/booking_jsonb.sql | UTF-8 | 1,566 | 4.03125 | 4 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /* creates JSONB representation of simplified booking
* type passenger_record should be created PRIOR to this script run
* see types subdirectory
*/
CREATE TYPE booking_leg_record_2 AS
(booking_leg_id integer,
leg_num integer,
booking_id integer,
flight flight_record);
--create simplified booking type
CREATE TYPE... | true |
c4e8ce060e3d1886528999d75a503fbf4a8cf27c | SQL | reuxm/Fil_Rouge | /scripts/garagepoefrUpdated.sql | UTF-8 | 21,607 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : jeu. 23 jan. 2020 à 14:57
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!401... | true |
ec3bbc96ba93cfd76580987b1b3d505fafb56a16 | SQL | NikiYu812/hms | /sql/tb_sysuser.sql | UTF-8 | 997 | 2.71875 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50527
Source Host : localhost:3306
Source Database : housingdb
Target Server Type : MYSQL
Target Server Version : 50527
File Encoding : 65001
Date: 2017-12-06 09:28:13
*/
SET FOREIGN_KEY_CHECKS=0... | true |
a3e3282ef80134f810db82d2336cfb60a2009e00 | SQL | xkapotis/SQL-Project | /Queries 3-4-5/Query i.sql | ISO-8859-7 | 529 | 3.40625 | 3 | [] | no_license | select (m.Sname + ' ' + m.name ) [],
p.code [ ] ,
p.Title [ ],
CONVERT(varchar, p.Startdate, 103) [ ] ,
CONVERT(varchar, p.enddate, 103) [ ]
from Projects p
join Members m on p.Members_idMembers = m.idMembers
join Project_status ps on p.Project_status_idProject_status = ps.idProject_status
where m.Sname... | true |
5b983acb0578ca3a23c22f2591104e29f6317f32 | SQL | yfheroku/dockCoin | /src/app/Api/ReadMe/coin.sql | UTF-8 | 2,395 | 3.515625 | 4 | [] | no_license | #记录拉取记录的当前区块数/截止时间,供下次拉取使用
CREATE TABLE `symbol_recharge_block` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`block_num` int(15) DEFAULT '0',
`symbol` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
#记录对应币种生成的钱包地址
CREATE TABLE `user_address` (
... | true |
c1835961a0353e06f43a3644cc1c050de15e2443 | SQL | rajeshghourvani/assessor | /assessorportal/AMPSQL/AMP/Packages/ZZ_AMP_UTIL.sql | UTF-8 | 5,711 | 3.390625 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Package ZZ_AMP_UTIL
--------------------------------------------------------
CREATE OR REPLACE EDITIONABLE PACKAGE "AMP"."ZZ_AMP_UTIL" AS
/******************************************************************************
NAME: AMP_UTILS
PU... | true |
39230bce018b0cbd0afc43c82fd82c22627110e3 | SQL | jpschoen/SODA501_SP17 | /la_blocks_wgs84_spatialjoin.sql | UTF-8 | 2,043 | 3.34375 | 3 | [] | no_license | SELECT gid, statefp10, countyfp10, tractce10, blockce10, geoid10, name10,
mtfcc10, ur10, uace10, uatype, funcstat10, aland10, awater10,
intptlat10, intptlon10, geom
FROM la_blocks_wgs84;
COPY work_501 FROM 'F:\\6.gradcourse\\SoDA501\\work.csv' DELIMITER ',' CSV HEADER
alter table home_501 ADD COLU... | true |
a105c8a13a63fdbfdf322b7e60f7b62b0cf45589 | SQL | inest-us/db | /cms/GetArticleByID.sql | UTF-8 | 462 | 3.734375 | 4 | [
"MIT"
] | permissive | ALTER PROCEDURE GetArticleByID
(
@ArticleID int
)
AS
SET NOCOUNT ON
SELECT a.ArticleID, a.AddedDate, a.AddedBy, a.CategoryID, a.Title, a.Abstract,
a.Body, a.Country, a.State, a.City, a.ReleasedDate, a.ExpiredDate, a.Approved,
a.Listed, a.CommentsEnabled, a.OnlyForMembers, a.ViewCount, a.Votes, a.Tota... | true |
d6cfb0eda719840b5a70b09f97fecfd7ed45c598 | SQL | wsigma21/sql_exercises | /basic/question51.sql | UTF-8 | 327 | 2.96875 | 3 | [] | no_license | -- 全てのゴール情報を出力してください。
-- ただし、オウンゴール(player_idがNULLのデータ)はIFNULL関数を使用してplayer_idを「9999」と表示してください。
select
id,
pairing_id,
case when player_id is null then 9999 else player_id end as "player_id",
goal_time
from goals
; | true |
9ff8b7a8196fcbeb24f2f6a77a34bc86627d6e35 | SQL | AdamHood/RedshiftScripts | /AdminViews/v_get_users_in_group.sql | UTF-8 | 470 | 3.359375 | 3 | [] | no_license | /**********************************************************************************************
Purpose: View to get all users in a group
History:
2013-10-29 jjschmit Created
**********************************************************************************************/
CREATE OR REPLACE VIEW admin.v_get_users_in_group... | true |
2e39dc6612ed093c2b118f37a29c373d80f98ddc | SQL | 4xpl0r3r-misc-repo/zjctf_2019_wannengmima | /files/html/db.sql | UTF-8 | 285 | 2.65625 | 3 | [] | no_license | CREATE DATABASE ctf;
USE ctf;
CREATE TABLE `Users`(
`username` VARCHAR(100) NOT NULL,
`password` VARCHAR(100) NOT NULL,
`id` INT UNSIGNED AUTO_INCREMENT,
PRIMARY KEY ( `id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO Users(username,password) VALUES ('Admin','dmpJlsg2MbFiie8IIF2aSC9fish2UoFuQJHHE5qQcnA6iwIvb... | true |
21b51afc289c1e816943f50685d909244ae4539d | SQL | hjd7893git/fileTransfer | /src/main/sql/oracle/policy.sql | UTF-8 | 1,328 | 2.671875 | 3 | [] | no_license | DROP TABLE "policy";
CREATE TABLE "policy" (
"id" NUMBER(20) VISIBLE NOT NULL ,
"name" VARCHAR2(256 BYTE) VISIBLE NOT NULL ,
"nodeid" NUMBER(20) VISIBLE NOT NULL ,
"path" VARCHAR2(1024 BYTE) VISIBLE NOT NULL ,
"enc" NUMBER(1) VISIBLE NOT NULL ,
"compress" NUMBER(1) VISIBLE NOT NULL ,
"sign" NUMBER(1) VISI... | true |
bae4f8fb74f5f686682432b51827de81c632ad21 | SQL | eastar93/MySQL | /OurJspProject.sql | UTF-8 | 1,154 | 3.125 | 3 | [] | no_license | CREATE TABLE users(
uid varchar(20) primary key,
upw varchar(20) not null,
uname varchar(10) not null,
uemail varchar(45) not null,
subject varchar(50),
qcode integer DEFAULT 0,
point integer DEFAULT 0,
tier integer DEFAULT 0
);
INSERT into users VALUES('test', '1234', 'user', 'user@test.... | true |
847d25d6b29f4433e980d5e6841e189025f12d9c | SQL | FeiBaliou/private-school-management-system | /Database/DB_SchoolManagementSystem.sql | UTF-8 | 15,700 | 3.890625 | 4 | [] | no_license | CREATE DATABASE schoolmanagementsystem;
use schoolmanagementsystem;
CREATE TABLE IF NOT EXISTS `courses` (
`id` INT NOT NULL AUTO_INCREMENT,
`title` varchar(45) NOT NULL,
`stream` varchar(45) NOT NULL,
`type` varchar(45) NOT NULL,
`startdate` DATE,
`enddate` DATE,
PRIMARY KEY (`id`)
); -- ENGINE=Inno... | true |
405157288a2f1b1fead67d57da8b38d6afaab91c | SQL | tanzhiyihuijian/ssm-template | /src/main/resources/sql/tables.sql | UTF-8 | 456 | 2.8125 | 3 | [] | no_license |
DROP DATABASE IF EXISTS ssh_template;
CREATE DATABASE IF NOT EXISTS ssh_template;
USE ssh_template;
CREATE TABLE user (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(30),
password VARCHAR(20)
);
INSERT INTO user (name, password) VALUES ('小明', '123456789');
INSERT INTO user (name, password) VALUES ('小花', '13... | true |
a478bdc20bc1991135d3a31d0e46fb5e391cbe92 | SQL | emnbdx/EMToolBox | /EMToolBox/Mail/create.sql | UTF-8 | 11,222 | 3.546875 | 4 | [] | no_license | CREATE DATABASE EMMAIL;
USE EMMAIL;
CREATE TABLE PATTERN(
ID int identity(1,1),
NAME varchar(255) not null,
CONTENT varchar(255) not null,
HTML bit not null,
CONSTRAINT [PK_PATTERN] PRIMARY KEY CLUSTERED ([ID] ASC),
CONSTRAINT [IX_PATTERN] UNIQUE NONCLUSTERED ([NAME] ASC)
);
CREATE TABLE QUEUE(
ID int identit... | true |
26548db5a1f7baf8dfc667db80fe5fe8aa0e5ba4 | SQL | ToborTheGreat/Repository01 | /toolkit.clusters_audit.sql | UTF-8 | 1,583 | 2.875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = toolkit, pg_catalog;
DROP INDEX toolkit.clusters_audit_idx2;
DROP ... | true |
527fe860b86557424ec9086c156f78f2eaed5f66 | SQL | JoaoOliveiraFrade/sgqLoader | /SGQ_ALM_Projetos_Console/sql/ALM_CTs_Qte_Reteste.sql | UTF-8 | 1,132 | 3.890625 | 4 | [] | no_license | update alm_cts
set alm_cts.Qte_Reteste = Aux.Reteste
from
(select
Subprojeto,
Entrega,
CT,
count(*) as Reteste
from
(select
dt.Subprojeto,
dt.Entrega,
df.CT,
(select top 1
dt2.Status
from ALM_DEFEITOS_Tempos dt2 WITH (NOLOCK)
where
dt2.Subprojeto = dt.Subprojeto and
dt2... | true |
c3ee9799fa91562acccb96e238a8dede96dd7017 | SQL | utimur/ice_social_network_backend | /src/main/resources/db/migration/V3__post_table.sql | UTF-8 | 455 | 3.25 | 3 | [] | no_license | CREATE TABLE post (
id bigint not null auto_increment,
user_id bigint not null,
creator_id bigint not null,
img varchar(255),
name varchar(255),
surname varchar(255),
text varchar(255),
creation varchar(255),
likes bigint default 0,
comments bigint default 0,
reposts bigint d... | true |
0c7e2546aafd393ff3827c23fb73e66c47614ab4 | SQL | nguyenphong2288/Rocket_VTI | /SQL/Assignment 2/Assignment2.sql | UTF-8 | 1,168 | 3.625 | 4 | [] | no_license |
-- LECTURE: Creating a Database fresher
CREATE DATABASE IF NOT EXISTS fresher;
USE fresher;
CREATE TABLE Trainee
(
Trainee_ID INT AUTO_INCREMENT PRIMARY KEY,
Full_Name VARCHAR(50) NOT NULL,
Birth_Date DATE NOT NULL,
Gender ENUM('male' , 'female', 'unknown'),
ET_IQ ... | true |
77e1b9644ad4741a638778c0d2430ffa6ac23aaf | SQL | gwax/mtg-dataset | /pipelines/stg_mtg/cards.sql | UTF-8 | 339 | 3.453125 | 3 | [] | no_license | /**
* Select to construct all cards data.
**/
SELECT
COALESCE(rc.id, uuid()) AS id,
UPPER(sf.set) AS set_code,
sf.collector_number AS collector_number,
sf.name AS name,
sf.id AS scryfall_id
FROM
src_mtg.raw_recycle_cards AS rc
FULL OUTER JOIN src_mtg.raw_scryfall_cards AS sf
ON rc.s... | true |
a6f7a73b3eb8606fbf8d3039b59cbde388a8dc28 | SQL | szidoniaszappanyos/touristapp | /tourist-app-backend/src/main/resources/db/migration/V1.0.17__insert_attractions.sql | UTF-8 | 3,125 | 3.375 | 3 | [] | no_license |
INSERT INTO locations(
id, name, address, details)
VALUES (249,'Cetățuia' ,'', '46.773879 23.582829');
INSERT INTO attraction(
id, attraction_type_id, location_id, name, details, weekly_schedule_id, cost)
VALUES (249, 6, 249, 'Monument of the Heroes of the Nation','The Cross of Cetatuia, designed by Archbishop Vi... | true |
630cdc682dffb079d0db4b42e8861e066597f8b3 | SQL | klahnakoski/datazilla-alerts | /tests/resources/sql/normalized_to_cube.sql | UTF-8 | 3,936 | 3.71875 | 4 | [] | no_license | ################################################################################
## This Source Code Form is subject to the terms of the Mozilla Public
## License, v. 2.0. If a copy of the MPL was not distributed with this file,
## You can obtain one at http://mozilla.org/MPL/2.0/.
#####################################... | true |
57b28d3119809217fc901351408046a719098a95 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day17/select1732.sql | UTF-8 | 177 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-16T17:32:00Z' AND timestamp<'2017-11-17T17:32:00Z' AND temperature>=4 AND temperature<=30
| true |
ec53d667493f10e084e00c5279c15d3be5d13160 | SQL | lihansunbai/GraduateStudy | /webMap/php/MyQQ1215/initdb.sql | UTF-8 | 791 | 3.078125 | 3 | [] | no_license | drop table qq_user;
drop table qq_friend;
drop table qq_message;
create table qq_user(
id serial primary key,
username varchar(32) unique not null,
realname varchar(32),
password varchar(64),
regitertime timestamp default now()
);
insert into qq_user(username,password,realname)
values
('10000',md5('123456'),'la... | true |
da8e02d441f0fe0c51cbfa2afb6963d480b29d07 | SQL | MaelsVilen/repo_github | /mySQL/training_DB/lesson4_ex.sql | UTF-8 | 951 | 3.640625 | 4 | [] | no_license | -- ii. Написать скрипт, возвращающий список имен (только firstname)
-- пользователей без повторений в алфавитном порядке
USE vk;
SELECT DISTINCT firstname
FROM users
ORDER BY firstname;
-- iii. Написать скрипт, отмечающий несовершеннолетних пользователей как неактивных (поле is_active = false).
-- Предварительно до... | true |
913f89a949be128a2945343e47e10ef4c725383b | SQL | OOP-BPGC/2014-Group-14 | /Submissions-3/database/MessManagement.sql | UTF-8 | 4,989 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 14, 2014 at 09:22 PM
-- Server version: 5.5.40-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
9e066ac2734fc89d26446961b507f4a325f75f46 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day17/select1753.sql | UTF-8 | 191 | 2.75 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-16T17:53:00Z' AND timestamp<'2017-11-17T17:53:00Z' AND SENSOR_ID='8fe559e6_ab25_42d5_b055_73f63ad799b0'
| true |
4e0a51404d73761084dc8f8bcf26d1a0b381b6cb | SQL | seanmodd/hasura-superapp | /hasura/models/order_product/table.sql | UTF-8 | 851 | 3.859375 | 4 | [] | no_license | /* TABLE */
CREATE TABLE "order_product" (
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
created_at timestamptz DEFAULT now() NOT NULL,
updated_at timestamptz DEFAULT now() NOT NULL,
order_id int NOT NULL,
product_id int NOT NULL,
quantity int NOT NULL
);
COMMENT ON TABLE "order_product"... | true |
fe958f3946ce2537c25117650acfa32a3c296ce1 | SQL | Nigel-Gardner/project2 | /schema.sql | UTF-8 | 664 | 3.4375 | 3 | [] | no_license | DROP TABLE IF EXISTS users cascade;
DROP TABLE IF EXISTS resort cascade;
DROP TABLE IF EXISTS visited cascade;
CREATE TABLE users(
id SERIAL PRIMARY KEY,
email VARCHAR (50) NOT NULL,
password VARCHAR (250) NOT NULL,
firstName VARCHAR (50) NOT NULL,
lastName VARCHAR (50) NOT NULL,
aboutMe VARCHAR (4000) NOT... | true |
03ae8f81ff5c5d4034dc61bd6687d3b62cb62742 | SQL | EddyeBoy27/one-for-all | /desafios/desafio9.sql | UTF-8 | 975 | 4.0625 | 4 | [] | no_license | /* Desafio 9
Crie uma procedure chamada albuns_do_artista que recebe como parâmetro o valor da coluna
identificadora de um artista e em retorno deve exibir as seguintes quatro colunas: o código
identificador do artista, com o apelido "artista_id", o nome do artista, com o apelido "artista",
o valor identificador do álb... | true |
27d56489066980f860c4e67a06e3c90cfa4ab9e8 | SQL | sonepotam/newAthena | /MSFO/CreateScripts/ass_subject_subjgroup.sql | WINDOWS-1251 | 1,484 | 3.609375 | 4 | [] | no_license | create table ass_subject_subjgroup
(
DT VARCHAR2 ( 10) NOT NULL,
SUBJECTGROUP_CODE VARCHAR2(100) NOT NULL,
SUBJECT_CODE VARCHAR2(100),
REC_STATUS CHAR( 1) NOT NULL,
REC_UNLOAD NUMBER(1),
REC_PROCESS NUMBER(1),
ID_FILE NUMBER(10)
)
tablespace MSFO_DATA
/
comment on column ass_subject_subjgroup.DT is '... | true |
14f4ecc9b71c88aa91944b71c2a3c4166adddcad | SQL | mldbai/mldb | /drafts/rec/btr/query_users.sql | UTF-8 | 203 | 3.609375 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SELECT
u.uid, SUBSTRING_INDEX(u.email, '@', -1) as email,
ui.gender
FROM users as u
LEFT JOIN users_info as ui ON ui.uid = u.uid
WHERE ui.country = 'CA'
-- ORDER BY uid DESC
-- LIMIT 10000
| true |
06ed20f80e3538d66c8dcf26a2d647428c121634 | SQL | karrollinaaa/app_php | /baza/baza.sql | UTF-8 | 794 | 3.4375 | 3 | [] | no_license | DROP TABLE IF EXISTS menu;
CREATE TABLE menu (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tytul VARCHAR,
plik VARCHAR,
pozycja INTEGER
);
INSERT INTO menu VALUES (NULL, 'Strona główna', 'glowna.html', 1);
INSERT INTO menu VALUES (NULL, 'Wiadomości', 'wiadomosci.html', 2);
INSERT INTO menu VALUES (NULL, 'Zarejestruj', '... | true |
3bc4857846d30425a637d3b0675e3b7e3aec4bfe | SQL | tkdonut/shrapnel_cc_project1 | /db/shrapnel.sql | UTF-8 | 562 | 3.234375 | 3 | [] | no_license | DROP TABLE budgets;
DROP TABLE transactions;
DROP TABLE vendors;
DROP TABLE tags;
CREATE TABLE tags
(
id SERIAL8 PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE budgets
(
id SERIAL8 PRIMARY KEY,
tag_id INT8 references tags(id) ON DELETE CASCADE,
maxspend VARCHAR(255)
);
CREATE TABLE vendors
(
id SERIAL8 ... | true |
1d64e81116ba371d90200a9fba64d40ba2c2fcf7 | SQL | Aadward/Examples | /spring-boot-jdbc-demo/src/main/resources/sql/schema.sql | UTF-8 | 263 | 2.546875 | 3 | [] | no_license | DROP TABLE IF EXISTS `db_tags`;
CREATE TABLE IF NOT EXISTS `db_tags` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`tag_name` varchar(100) NOT NULL,
`versions` bigint(20) unsigned NOT NULL,
`create_time` datetime NOT NULL,
PRIMARY KEY (`id`),
);
| true |
714f8294c9028d4eb88698cc7c820f40407cd7ed | SQL | mugilpro/interview-prep | /src/main/resources/sql/Join.sql | UTF-8 | 1,341 | 3.296875 | 3 | [] | no_license | Students
ID NAME
1 Samantha
2 Julia
3 Britney
4 Kristeen
5 Dyana
6 Jenny
7 Christene
8 Meera
9 Priya
10 Priyanka
11 Paige
12 Jane
13 Belvet
14 Scarlet
15 Salma
16 ... | true |
9bf22dd9c41df37feddf67abfb9f93e3f914cdfc | SQL | BowenLiu92/Leetcode_SQL | /Q9.sql | UTF-8 | 253 | 3.40625 | 3 | [] | no_license | WITH cte AS
(SELECT customerid, date, action, row_number() OVER(PARTITION BY customerid ORDER BY Date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS ao
FROM "13".transaction t)
SELECT customerid, date, action
FROM cte
WHERE ao = 1
; | true |
f85ffe7ac58bd0ab62d67408a094782d668bcfeb | SQL | thangdinh1607/C1220G2_Dinh-Van-Thang_module3 | /b2/BT_determined_key.sql | UTF-8 | 1,197 | 3.9375 | 4 | [] | no_license | create database if not exists customer_manager;
use customer_manager;
create table customers(
customer_number int primary key,
fullname varchar (50) not null,
address varchar(50)not null,
email varchar(50),
phone int(9) unique
);
insert into customers(customer_number,fullname,address,email,phone)
value
(1,'thangdinh',... | true |
cc207136abb6e587d138bdb7da81a6cce80174cd | SQL | KalinD/Applied-Programming-Course | /06.База данни/Подготовка за изпита/query01/query01.sql | UTF-8 | 1,332 | 4.6875 | 5 | [] | no_license | #Problem 1
SELECT * FROM users ORDER BY id;
#Problem 2
SELECT * FROM repositories_contributors AS rc
WHERE rc.contributor_id = rc.repository_id
ORDER BY rc.contributor_id;
#Problem 3
SELECT i.id, CONCAT(u.username, ' : ', i.title) AS `issue_assignee` FROM issues AS i JOIN users AS u
ON i.assignee_id = u.id ORDER BY ... | true |
d041f59ba05afe871b87ee4d31363cd479914db9 | SQL | cityzen12/SQL-Basic | /SQLQuery1.sql | UTF-8 | 3,277 | 4.5625 | 5 | [] | no_license | --1
SELECT student.姓名,score.课程编号
FROM student,score
WHERE student.学号=score.学号;
--2
SELECT student.姓名,course.课程名称,score.成绩
FROM student,course,score
WHERE student.学号=score.学号 AND score.课程编号=course.课程编号;
--3
SELECT student.姓名,course.课程名称,score.成绩
FROM student,course LEFT OUTER JOIN score ON(score.课程编号=cours... | true |
64f18c132fd5a094b3fc5fff5a768a580f8ab1b2 | SQL | cocosip/WeChatFramework | /framework/src/WeChat.Framework.MySql/Scripts/WeChatFramework.sql | UTF-8 | 647 | 2.5625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `SdkTickets` (
`AppId` varchar(50) PRIMARY KEY NOT NULL COMMENT '应用AppId',
`Ticket` varchar(128) NOT NULL COMMENT 'Ticket',
`TicketType` varchar(30) NOT NULL COMMENT 'Ticket类型',
`ExpiredIn` int NOT NULL COMMENT '有效期',
`LastModifiedTime` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '最... | true |
fbd9b6a3b0a4142a5ef1199acbe273a297029586 | SQL | ichenkaihua/bootshiro | /usthe.sql | UTF-8 | 17,145 | 3.34375 | 3 | [
"MIT"
] | permissive | /*
Navicat Premium Data Transfer
Source Server : local-docker-mysql
Source Server Type : MySQL
Source Server Version : 50720
Source Host : localhost:12345
Source Schema : usthe
Target Server Type : MySQL
Target Server Version : 50720
File Encoding : 65001
Date: 12/04... | true |
a3dc2bada039ff3230e8d1d26f639e5d6bda4aa5 | SQL | thebhushanp/spring-sec | /src/main/resources/db/migration/V1.001.005__alter_game_table.sql | UTF-8 | 142 | 3.09375 | 3 | [] | no_license | alter table game
add column admin_id integer,
add constraint fk_admin
foreign key (admin_id)
references usr (id);
| true |
29471c345a2cbc56bd9af1e0ce171801707126c8 | SQL | RenanFragaio/Movement.org | /base/movement.sql | UTF-8 | 5,229 | 3.46875 | 3 | [] | no_license | /*drop database if exists id6802051_movement;*/
create database if not exists id6802051_movement;
use id6802051_movement;
drop table if exists usuario;
create table usuario
(
id_usuario int auto_increment,
nome varchar(80),
email varchar(80),
senha varchar(20),
data_nasc date,
bio varchar(255),
foto_perfil varchar(2... | true |
599a91055f3b3ce550bda6c61bc59c5776f70376 | SQL | warelab/gramene-ensembl | /maize/sql/clone_stats.sql | UTF-8 | 484 | 3.828125 | 4 | [
"MIT",
"Apache-2.0"
] | permissive | select count(*) from contig;
select clone.status, min(c.size), max(c.size), avg(c.size), count(*)
from clone
left join (select id, clone_id, end_coord-start_coord+1 as size from contig) c
on c.clone_id = clone.id
group by clone.status with rollup
select status, min(cnt), max(cnt), avg(cnt), sum(cnt)
... | true |
5a5443768bffd9128d9b56c77d0af7d839879c2f | SQL | Kaique-Henryque/ProjetoMVC2020 | /BD/BD.sql | UTF-8 | 703 | 2.703125 | 3 | [] | no_license | create database ProjetoMVCD26;
use ProjetoMVCD26;
create table dt_clienteD26(
id_cliente int(11) not null,
nome_cliente varchar(45) not null,
sobrenome_cliente varchar(45) not null,
email_cliente varchar(50) not null,
senha_cliente varchar(45) not null,
cpf_cliente varchar(11) not null,
nome_mae... | true |
eecd1e213ec3ea881564b1a26b0f7a7361cdb800 | SQL | gchq/stroom | /stroom-legacy/stroom-legacy-db-migration/src/main/resources/stroom/legacy/db/migration/V07_00_00_1905__processor_filter.sql | UTF-8 | 3,955 | 4.03125 | 4 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"CDDL-1.0",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"MPL-1.0",
"CC-BY-4.0",
"LicenseRef-scancode-public-domain",
"EPL-1.0"
] | permissive | -- ------------------------------------------------------------------------
-- Copyright 2020 Crown Copyright
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.o... | true |
08aee90c78c8a54545ac7ee27b2534a106f3bab7 | SQL | SarveshSingh101/Microsoft-SQL-Server-And-TSQL-Course-For-Beginners | /Part 8 - Practical SQL Scenarios/Problem 1.sql | UTF-8 | 231 | 2.90625 | 3 | [
"MIT"
] | permissive | SELECT DISTINCT JobTitle FROM HumanResources.Employee
WHERE Gender = 'M'
EXCEPT
SELECT DISTINCT JobTitle FROM HumanResources.Employee
WHERE Gender = 'F'
SELECT * FROM HumanResources.Employee WHERE JobTitle = 'Marketing Manager'
| true |
069df0593a745e234786995bd11cf5b997212d12 | SQL | FilipeMSoares/GameQualityAssessment | /data/desafio/raw_data/round_number_valid_filter.sql | UTF-8 | 725 | 3.859375 | 4 | [] | no_license |
select g.tournamentcode, g.seriescode, g.groupcode
from
game as g,
(select tournamentcode, seriescode, max(roundorder) as round_max
from gameround
group by tournamentcode, seriescode
) as rmax,
(select tournamentcode, seriescode, groupcode, max(roundorder) as r_order
from gameround
group by tourn... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.