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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a67d698cd35a1e1bdc318dae5d5a8013466478c8 | SQL | phamnuhuyentrang/Website_vet_clinic | /www/database/create_table.sql | UTF-8 | 3,662 | 3.625 | 4 | [] | no_license | DROP TABLE IF EXISTS Traitement_Medicament;
DROP TABLE IF EXISTS Traitement;
DROP TABLE IF EXISTS Rendez_vous;
DROP TABLE IF EXISTS Med_correspond_Ani;
DROP TABLE IF EXISTS Medicament_Effet;
DROP TABLE IF EXISTS Medicament;
DROP TABLE IF EXISTS Effets_secondaires;
DROP TABLE IF EXISTS Animal;
DROP TABLE IF EXIS... | true |
7cb6a4c5d110effb6da75673c415c56806485bd9 | SQL | dodoas/lodo | /db/changes/134_add_more_columns_to_kommune_table.sql | UTF-8 | 1,752 | 3.859375 | 4 | [
"MIT"
] | permissive | -- Add more columns to kommune table and change Sone column to string since it can be for example 1a
ALTER TABLE kommune
ADD County varchar(255) DEFAULT '',
ADD BankAccountNumber varchar(255) DEFAULT '',
ADD OrgNumber varchar(20) DEFAULT '',
ADD OrgName varchar(255) DEFAULT '',
ADD OrganisationForm varchar(255) DEFAULT... | true |
11daa9bd5268a2cd8d7f8d650d4443a0c338d969 | SQL | ahnaf22/web_ecommerceWebsite | /database/bkdb.sql | UTF-8 | 14,781 | 2.6875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 27, 2017 at 02:04 PM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
246bdb6020c263e289df6b73b614f7afa9d22347 | SQL | ycandau/bootcampx | /4_queries/6_cohort_with_longest_assist.sql | UTF-8 | 270 | 3.671875 | 4 | [] | no_license | SELECT
cohorts.name as name,
avg(completed_at - started_at) as average_assistance_time
FROM
assistance_requests
JOIN students ON student_id = students.id
JOIN cohorts ON cohort_id = cohorts.id
GROUP BY cohorts.id
ORDER BY average_assistance_time DESC
LIMIT 1; | true |
0ad0af72b21fe0f5442451acd672271bb3e78b91 | SQL | JulianFink01/seminarverwaltung | /Datenbanken dumbs/Datenbank.sql | UTF-8 | 10,192 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Erstellungszeit: 17. Feb 2020 um 07:27
-- Server-Version: 8.0.13-4
-- PHP-Version: 7.2.24-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 ... | true |
85fbdaa5be5b47aa34d31ad8dcbc4a5c8fe00996 | SQL | petermusembi69/-school-examination-web-system-project- | /exam.sql | UTF-8 | 9,159 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 19, 2019 at 06:04 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
382a8ca7a814eacf84156e6f71408a1b2e1f92e3 | SQL | indirection/uptime-kuma | /db/patch6.sql | UTF-8 | 1,349 | 3.515625 | 4 | [
"MIT"
] | permissive | -- You should not modify if this have pushed to Github, unless it does serious wrong with the db.
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
create table monitor_dg_tmp (
id INTEGER not null primary key autoincrement,
name VARCHAR(150),
active BOOLEAN default 1 not null,
user_id INTEGER references user on upda... | true |
d4939bf5a8aa36a94b042eeba465fbb1e35fef97 | SQL | momen-eldesoqy/HR-System | /ref/db.sql | UTF-8 | 1,166 | 3.453125 | 3 | [] | no_license | CREATE DATABASE HR DEFAULT CHARACTER SET UTF8 DEFAULT COLLATE UTF8_GENERAL_CI;
USE HR;
CREATE TABLE Department (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(150) UNIQUE,
dept_desc VARCHAR(100)
);
CREATE TABLE Project(
project_id INT PRIMARY KEY,
project_name VARCHAR (150),
project_desc VARCHAR(100),
d... | true |
6e3d7e24bcec0de1ec5160e67f652fcdea1bc49c | SQL | NSCF/SpecifySQL | /UpdateSpecimenCountsPerCataloger.sql | UTF-8 | 140 | 2.59375 | 3 | [] | no_license | update collectionobject co
join agent a on co.CatalogerID = a.AgentID
set co.CountAmt = 1
where a.lastname = "Clegg" and co.CountAmt is null | true |
170c95c1fc9059c5a9b07737f248bfe567fb0900 | SQL | GS03-06-KIMINORI-ISAKA/kadai | /7/sql/student_info.sql | UTF-8 | 4,124 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2016 年 1 月 14 日 23:42
-- サーバのバージョン: 10.1.9-MariaDB
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... | true |
e567c5382b676134f86bf8bf5b2d0a2d00e703e9 | SQL | Bigguy98/OracleScript | /procedure.sql | UTF-8 | 586 | 3.609375 | 4 | [] | no_license | -- list all books name have the rating >= in_rating
CREATE OR REPLACE PROCEDURE RATING_LIST(in_rating IN NUMBER) AS
matching_title varchar(50);
TYPE myCursor IS REF CURSOR;
the_cursor myCursor;
BEGIN
OPEN the_cursor
FOR 'SELECT title FROM book WHERE rating >= :in_rating'
USING in_rating;... | true |
b22f4b1ebc05c5c533266aac8256b9d20d1f7306 | SQL | kaoliiny/Piscine_PHP | /Day05/ex20/ex20.sql | UTF-8 | 469 | 3.8125 | 4 | [] | no_license | SELECT db_azavrazh.film.id_genre,
db_azavrazh.genre.name AS `name_genre`,
db_azavrazh.film.id_distrib,
db_azavrazh.distrib.name AS `name_distrib`,
`title` AS `title_film`
FROM db_azavrazh.film
LEFT JOIN db_azavrazh.genre
ON db_azavrazh.genre.id_genre = db_azavrazh.film.id_genre
LEFT JOIN... | true |
dae76b38cafe8b4183808571fd77a2da833e7b25 | SQL | neurotech/edumate-extensions | /sql/staff/staff-information-sheet_01_qualifications.sql | UTF-8 | 629 | 3.734375 | 4 | [] | no_license | WITH QUALS_RAW AS
(
SELECT
QUALIFICATION,
QUALIFICATION_TYPE.QUALIFICATION_TYPE,
institute.institute AS "QUALIFICATION_INSTITUTE",
TO_CHAR(QYEAR) AS "QYEAR"
FROM QUALIFICATION
LEFT JOIN CONTACT ON CONTACT.CONTACT_ID = QUALIFICATION.CONTACT_ID
LEFT JOIN STAFF ON QUALIFICATION.CONTACT_ID = S... | true |
bfde64a16aa1d1bf7d880fb2b5a5aff40667bf3a | SQL | Zenithar/gene | /example/twitter/db/account/006-account-types.sql | UTF-8 | 1,201 | 2.546875 | 3 | [
"MIT"
] | permissive |
-- ----------------------------
-- Types structure for account.account.email_status_constant
-- ----------------------------
DROP TYPE IF EXISTS "account"."account_email_status_constant_enum" CASCADE;
CREATE TYPE "account"."account_email_status_constant_enum" AS ENUM (
'verified',
'notVerified'
);
ALTER TYPE "acc... | true |
3efcb0c9efe028e53d42c2c10b539a9828378a16 | SQL | schweibuz/SQL | /src/com/company/sql/superheros.sql | UTF-8 | 2,678 | 3.015625 | 3 | [] | no_license | # CocoaMySQL dump
# Version 0.7b5
# http://cocoamysql.sourceforge.net
#
# Host: localhost (MySQL 5.0.37)
# Database: ch9
# Generation Time: 2007-09-10 08:55:40 -0400
# ************************************************************
# Dump of table super_heroes
# -----------------------------------------------------------... | true |
dfd71cb07386f4bc3528ded9b4abdbe4994765f5 | SQL | 8htmlcss8/Netorial | /netorial.sql | UTF-8 | 4,215 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 12. Sep 2013 um 20:40
-- Server Version: 5.5.29
-- PHP-Version: 5.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
2f791902261f8e5d4f822f34e767bb8750f339d9 | SQL | damiangaw/bazy-danych | /agencja_koncertowa/select_db.sql | UTF-8 | 921 | 3.859375 | 4 | [] | no_license | # wyświetlenie artystów i informacji o ich zespołach
select imie, nazwisko, instrument, data_zalozenia, nazwa, rodzaj_muzyki from artysta, zespol
where artysta.nazwa_zesp = zespol.nazwa;
# wyświetlenie artystów solo i w zespołach grających w danej sali
select imie, nazwisko, nazwa_zesp, sala from artysta inner join ... | true |
d1824595234552f2cb18205ba5452940f1e15471 | SQL | Last-Mile-Health/LMD-Databases | /lastmile_report/view/view_position_qao_chss.sql | UTF-8 | 823 | 3.3125 | 3 | [] | no_license | use lastmile_report;
drop view if exists lastmile_report.view_position_qao_chss;
create view lastmile_report.view_position_qao_chss as
select
a.county,
if( a.qao_position_id is null, 'Unicef', a.qao_position_id ) as `QAO ID`,
if( a.qao is null, 'Unassigned', a.qao ) as QAO,
... | true |
6f4389db1a3257f3fe574c620d6af97711276ef9 | SQL | pwinter303/sqt | /MySQLForWorkbench.sql | UTF-8 | 553 | 2.71875 | 3 | [] | no_license | drop table if exists userStocks;
drop table if exists users_stocks_xref;
drop table if exists stock_triggers;
drop table if exists trigger_statuses;
drop table if exists watch_types;
drop table if exists users;
drop table if exists stocks;
truncate table migrations;
SELECT * FROM stockquotetracker.trigger_statuses;... | true |
30d64708a28a14a68a8844ff0ef4ce4c7add00d3 | SQL | amandamerrifield/FitnessBlog | /database/tables.sql | UTF-8 | 1,843 | 3.96875 | 4 | [] | no_license | DROP TABLE IF EXISTS comments;
DROP TABLE IF EXISTS posts;
DROP TABLE IF EXISTS bodyPart;
DROP TABLE IF EXISTS difficulty;
DROP TABLE IF EXISTS users;
CREATE TABLE bodyPart
(
id tinyint PRIMARY KEY AUTO_INCREMENT,
part varchar(20) NOT NULL
);
CREATE TABLE difficulty
(
id tinyint PRIMARY KEY AUTO_INCR... | true |
cd1e3bf1d22fa6e183c2c22498ee1a682f695ab3 | SQL | dalilaZ/Online-Examination | /register.sql | UTF-8 | 10,372 | 3.359375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 30 Ara 2017, 16:12:11
-- Sunucu sürümü: 10.1.26-MariaDB
-- PHP Sürümü: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
37d2bb2ed2e189b8ec7b62c87a19eac2ba772e8f | SQL | cucker0/mysql | /sql/window_function.sql | UTF-8 | 2,254 | 3.421875 | 3 | [] | no_license | -- 准备数据
CREATE DATABASE window_func;
USE window_func;
CREATE TABLE sales (
`year` YEAR,
country VARCHAR(32),
product VARCHAR(32) NOT NULL,
profit INT COMMENT '利润'
);
INSERT INTO sales (`year`, country, product, profit) VALUES
('2000', 'Finland', 'Computer', 1500),
('2000', 'Finland', 'Phone', 100),
(... | true |
fb760d68dbf668662dd3e1439923834e5dfe85d0 | SQL | Loz-tech/test_task | /task_2.sql | UTF-8 | 98 | 2.640625 | 3 | [] | no_license | SELECT login, password, name, status
FROM users
JOIN objects
WHERE users.object_id = objects.id; | true |
f03df3f0276a30d597e1b96353f074e7fcc95c73 | SQL | theheroproject/oracle | /sql/SESSION_EVENT.sql | SHIFT_JIS | 682 | 2.609375 | 3 | [] | no_license | -- *********************************************************************
-- * V$SESSION_EVENT
-- * ZbVɂCxg̑ҋ@
-- *********************************************************************
select
sysdate || ',' ||
SID || ',' ||
EVENT || ',' ||
TOTAL_WAITS ||... | true |
caa904a94689c6a174a74459853b4e32012e4b7f | SQL | GamerBishop/projetENT_GL | /sql/ordresINSERT.sql | UTF-8 | 8,197 | 3.015625 | 3 | [] | no_license | --En premier, on créé les types
--Ordres Insert des EtatEquipement
INSERT INTO etatequipement(
id, libelle)
VALUES (0, 'Libre');
INSERT INTO etatequipement(
id, libelle)
VALUES (1, 'Utilisé');
INSERT INTO etatequipement(
id, libelle)
VALUES (2, 'En maintenance');
INSE... | true |
3df0abcf174152c8e6111440117ea27ce01f0842 | SQL | AltaExile/EAD | /SQL Schema Dump/assignment_comments.sql | UTF-8 | 2,411 | 3.09375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `assignment` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `assignment`;
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: assignment
-- ------------------------------------------------------
-- Server version 5.7.12-log
/*!40101 SET @OLD_CHARACTER_S... | true |
7ada0f419cf8d744378a3bfac76a40739f1bfb06 | SQL | bdmlai/analytics_engineering_marts | /models/Redshift/fds_cp/aggregate_intermediate/intm_dp_wkly_pivot.sql | UTF-8 | 6,428 | 2.921875 | 3 | [] | no_license | {{
config({
'schema': 'dt_prod_support',
"materialized": 'table',"tags": 'rpt_cp_weekly_consolidated_kpi'
})
}}
select * from
(
select 'Weekly' as granularity, platform, type, 'Hours Watched' as Metric, week, cal_year, cal_mth_num, cal_year_week_num_mon,
cal_year_mon_week_begin_date, cal_year_mon_week_end_d... | true |
ec512d33b430b4d8017142eaca02e8b65ec7f8f3 | SQL | ThomasMoras/ComProjUp | /script/projetPhp.sql | UTF-8 | 8,586 | 3.28125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : ven. 13 juil. 2018 à 07:50
-- Version du serveur : 5.7.19
-- Version de PHP : 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... | true |
7b3c3ceed6344d95310bd143f98897567dd23813 | SQL | BrenPatF/oracle_plsql_utils | /app/install_col_group.sql | UTF-8 | 4,007 | 3.484375 | 3 | [
"MIT"
] | permissive | DEFINE LIB=&1
/***************************************************************************************************
Name: install_col_group.sql Author: Brendan Furey Date: 17-Mar-2019
Installation script for the Col_Group example in the app schema in the oracle_plsql_utils module.
Thi... | true |
5bb03fdad9cfbf766573cec0aadb431956b01782 | SQL | BischevRamil/job4j | /Junior/SQL/schemaSQL/ddl.sql | UTF-8 | 1,133 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | create table rules (
id serial primary key,
rule varchar(50) not null
);
create table roles (
id serial primary key,
role varchar(50) not null
);
create table role_rules (
id serial primary key,
role_id integer references roles(id) not null,
rule_id integer references rules(id) not... | true |
d796ab6080373100730a30d11bd5e5736890c1f1 | SQL | gongzhijian/springsecuritytestdemo | /security-demo-first/src/main/resources/sql/sys_permission_role.sql | UTF-8 | 1,007 | 2.859375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50022
Source Host : localhost:3306
Source Database : alpha
Target Server Type : MYSQL
Target Server Version : 50022
File Encoding : 65001
Date: 2019-09-09 20:58:25
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
68f6c03460cc05758f4ad1e9a138cb8e40896458 | SQL | bikle/rluck | /svm4hp60min/svm2/aud_build_scorem.sql | UTF-8 | 450 | 2.703125 | 3 | [] | no_license | --
-- aud_build_scorem.sql
--
-- Builds a sql script to run a bunch of sql-scoring scripts.
SELECT '@aud_score1day.sql ',ydate FROM aud_ms14
WHERE 'aud'||ydate NOT IN (SELECT prdate FROM fxscores)
AND ydate > (SELECT MIN(ydate)+35 FROM aud_ms14)
ORDER BY ydate
/
SELECT '@aud_score1day_gattn.sql ',ydate FROM aud_ms14... | true |
c14470e6327502f0412ad1fc883754d1807e53fe | SQL | zfuming/golangpay | /sql/payment_pay_type_wxpay.sql | UTF-8 | 1,658 | 3.046875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : db
Source Server Type : MySQL
Source Server Version : 50718
Source Host : 10.254.254.254
Source Database : payment
Target Server Type : MySQL
Target Server Version : 50718
File Encoding : utf-8
Date: 05/25/2017 11:06:44 ... | true |
ff65bd30cbaac0937dd8a1034243255ee7633bb4 | SQL | cecpoool/WeeklyTaskDB | /Script.PostDeployment1.sql | UTF-8 | 898 | 3 | 3 | [] | no_license | IF '$(LoadTestData)' = 'true'
BEGIN
DELETE FROM BOOK;
DELETE FROM LOAN;
DELETE FROM STUDENT;
INSERT INTO Book(ISBN, Title, Year_Published, Author_ID, Author_First_Name, Author_Last_Name, Author_TFN) VALUES
('978-3-16-148410-0', 'Relationships with Databases, the ins and outs', 1970,32567,'Edgar','Codd', 150111222)... | true |
f8936319e6259edc06e45ea9b7aa898fa0e4e0ef | SQL | meto26/MetoSports | /DATABASE/users.sql | UTF-8 | 1,602 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 02 Haz 2021, 09:36:34
-- Sunucu sürümü: 10.4.17-MariaDB
-- PHP Sürümü: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... | true |
6ececdbd799642e63209ed470359552b0ee8a70a | SQL | hr2710/MySQL-Assignment | /problem3.sql | UTF-8 | 2,711 | 3.859375 | 4 | [] | no_license | /*
Problem 3
Create a transaction which does the following things:
Create a new customer
New customer places an order for a motorcyle
And finally does the payment.
*/
start transaction;
/*Selecting the new customer*/
select
@customerNumberNew:=max(customerNumber)+1
from
customers;
/*
+------------------------... | true |
de0fe75889eed1acabd5297dc3fff77a35037f52 | SQL | apereo-tesuto/tesuto | /tesuto-admin-services/tesuto-admin-core/src/flyway/resources/db.migration/V2.52__remote_proctor_role.sql | UTF-8 | 963 | 2.75 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"EPL-1.0"
] | permissive | insert into security_group
(security_group_id, created_on_date, last_updated_date, description, group_name)
select 10, current_timestamp, current_timestamp, 'Role for creating passcodes', 'REMOTE_PROCTOR'
where not exists (select 1 from security_group where security_group_id=10);
insert into security_group_security_pe... | true |
6420416dbed94ec6e1bd5129cc9847f2b156c2e8 | SQL | victorsmits/Data-Base | /Trigger/AfterDelete_LAF_Trigger.sql | UTF-8 | 572 | 3 | 3 | [] | no_license | CREATE DEFINER = CURRENT_USER TRIGGER `Tree`.`LienArbresFournisseurs_AFTER_DELETE` AFTER DELETE ON `LienArbresFournisseurs` FOR EACH ROW
BEGIN
DECLARE NomFour varchar(45);
DECLARE NomA varchar(45);
SELECT
Nom
INTO NomFour FROM
Fournisseurs
WHERE
Fournisseurs.PK_Fournisseur = old.FK_Fournisseurs;
S... | true |
2e62f13727d3dd81c28c8475cc92b3244ac939ff | SQL | rahul1796/neo-job | /DB/table-schema-changes/sumit_28_Jan_2020.sql | UTF-8 | 582 | 3.609375 | 4 | [] | no_license | CREATE VIEW users.vw_address_book_contact_list (
company_id,
company_name,
hr_name,
designation,
hr_phone,
hr_email,
industry_name,
source)
AS
SELECT c.id AS company_id,
c.company_name,
c.hr_name,
'HR'::text AS designation,
c.hr_phone,
c.hr_email,
i.name AS indust... | true |
6249607d7d10e599f6337f5a659d1329c27ab152 | SQL | safizaidi98/SQL-Queries-Practice | /Partition By.sql | UTF-8 | 661 | 3.703125 | 4 | [] | no_license |
use [AdventureWorks2014]
select
*
from Sales.SalesOrderHeader
select
ROW_NUMBER() over( partition by SalesPersonID Order by OrderDate asc) as RowNum,
SalesPersonID,
OrderDate
from Sales.SalesOrderHeader
where
SalesPersonID is not Null
and DATEPART(Month, OrderDate) = 5
----------------------------------... | true |
9b9a25a8f5f5a69a9ba7a0403f345564d3e2666d | SQL | DanielsonSilva/sebraematchup | /database/usuarios.sql | UTF-8 | 950 | 2.765625 | 3 | [
"MIT"
] | permissive | CREATE TABLE `usuarios` (
`id_usuario` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nm_login` varchar(50) NOT NULL,
`pw_senha` varchar(256) NOT NULL,
`nm_email` varchar(100) NOT NULL,
`nm_nome` varchar(100) DEFAULT NULL,
`nu_celular` varchar(100) DEFAULT NULL,
`nu_outrocontato` varchar(100) DEFAULT NULL,
... | true |
06ec9e97c6fc9b1034c9832313cac7865273d9d1 | SQL | un-knower/kylin-tpch | /queries/tpch_query02.sql | UTF-8 | 1,001 | 3.765625 | 4 | [
"Apache-2.0"
] | permissive | -- Get min ps_supplycost from v_partsupp. And query some details filter by p_size/p_type/r_name.
with q2_min_ps_supplycost as (
select
p_partkey as min_p_partkey,
min(ps_supplycost) as min_ps_supplycost
from
v_partsupp
inner join part on p_partkey = ps_partkey
inner join supplier on s_suppkey = ps_suppkey... | true |
29656d2be4953a430e9c732df7060ab13bc0a5ed | SQL | Code-7-Classroom/weeklychallenges2020-mai-sam | /mySQL Week 1 Challenges/Hard.sql | UTF-8 | 2,544 | 3.578125 | 4 | [] | no_license | CREATE DATABASE samMovies;
USE samMovies;
CREATE TABLE favMovies(
title VARCHAR (255),
releasedate VARCHAR (255),
rating varchar (255),
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY
);
INSERT INTO favMovies (title, releaseDate, rating)
VALUES ('Toy Story', 'November 22, 1995', 'PG'),
('Spider-Man: Into the Spiderverse'... | true |
fb0656bc021ccdaeb845ef3d3fe97ccaf35d1c0f | SQL | TonyKartony/BI-Lab-2017 | /_1. Introduction to DWH/Tasks/Hanna_Hul/report/Bonus/pivot.sql | UTF-8 | 821 | 4.03125 | 4 | [] | no_license | create view SALES_VIEW as
select PROD_NAME PRODUCT,
COUNTRY_NAME COUNTRY,
CHANNEL_ID CHANNEL,
SUBSTR(CALENDAR_QUARTER_DESC, 6,2) QUARTER,
SUM(AMOUNT_SOLD) AMOUNT_SOLD,
SUM(QUANTITY_SOLD) QUANTITY_SOLD
from sh.SALES, sh.TIMES, sh.CUSTOMERS, sh.COUNTRIES, sh.PRODUCTS
where sh.SALES.... | true |
e13649204a3bbc2e900c303b53529bc402618ea9 | SQL | candan9/sqltutorial | /odev1.sql | UTF-8 | 366 | 3.046875 | 3 | [] | no_license | select title,description from film --Soru1
select * from film where film.length between 60 and 75 --Soru2
select * from film where rental_rate=0.99 AND (replacement_cost=12.99 OR replacement_cost=28.99) --Soru3
select last_name from customer where first_name='Mary' --Cevap Smith
select * from film where film.length<... | true |
087fcf8dc7f8ea6d923b153cb5643d239a09ba57 | SQL | SeppiaBrilla/Progetto_Base_di_Dati | /Database/Query/28.sql | UTF-8 | 165 | 3.1875 | 3 | [] | no_license | SELECT S.Nome AS Store
FROM Videogiochi_e_software.Compagnia AS C INNER JOIN Videogiochi_e_software.Store_PC AS S ON C.Nome = S.Compagnia
WHERE C.Nome = "Microsoft"; | true |
b99e6c1ca43f874899fb52b55325a28d13a8ff45 | SQL | leileiyuan/smart | /chapter2/doc/customer.sql | UTF-8 | 823 | 2.703125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50173
Source Host : localhost:3306
Source Database : smart
Target Server Type : MYSQL
Target Server Version : 50173
File Encoding : 65001
Date: 2017-08-26 10:47:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
59dc4af7e56a219c9bd1a0e892d888a3049994db | SQL | kkvn/2301project | /db.sql | UTF-8 | 3,015 | 3.9375 | 4 | [] | no_license | -- script to create "Video Rental Store" database
-- todo items for kristan:
-- add employee name attribute to employee entity in er diagram
-- remove employeeID attribute from invoice entity
-- what is the sales entity for? aren't all the sales recorded in the invoice entity?
-- questions: some names you used are re... | true |
8998872fb1d09c470114d97477d2880b90c9915b | SQL | eze92/TPLP4 | /db/dbTurismo.sql | UTF-8 | 2,528 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 19-02-2020 a las 21:26:32
-- Versión del servidor: 8.0.18
-- Versión de PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... | true |
0b706720649c4a5df8d122beec57d3e307245715 | SQL | daviddn/SQL_Notes | /SQLQueeringHW8.sql | UTF-8 | 254 | 3.671875 | 4 | [] | no_license | USE Northwind
SELECT ShipCity AS 'Ship City',
OrderDate AS 'Order Date',
ShippedDate AS 'Shipped Date',
CASE WHEN DATEDIFF(d, OrderDate, ShippedDate)<10
THEN 'On Time'
ELSE 'Overdue'
END AS 'Number of Overdue Orders'
FROM Orders
WHERE ShipCity = 'Paris'
| true |
8f1f0afb691e4f0d6c8bb06b4e8453db3987fe5e | SQL | verdegustavo/DPI | /data/traffic_view.sql | UTF-8 | 191 | 3.34375 | 3 | [] | no_license | select b.*, a.country_code,
a.country_name,
a.region_name,
a.city_name
from ip2location_db5 a, tb_enlaces b
where Dot2LongIP(b.ip_destino) between a.ip_from and a.ip_to;
| true |
42b8bdc0c1e3062e8372a3c7f996f6cc96af2873 | SQL | RANJITHA888/ranjitha-sqlassignment | /ASSIGNMENT -1.sql | UTF-8 | 1,145 | 3.21875 | 3 | [] | no_license | SELECT * FROM assignment.account;
desc assignment.account;
insert into account values(10,"ranjitha","rajajinagar",1000);
insert into account values(11,"ruchitha","hebbal",2000);
insert into account values(12,"neha","yelahanka",3000);
insert into account values(14,"pooja","jaynagar",4000);
ALTER TABLE assignment.accou... | true |
fb2a07a8cd15dc9643570360eb2d55249226efb4 | SQL | Mdidu/signette | /src/test/resources/test-data.sql | UTF-8 | 2,068 | 3.265625 | 3 | [] | no_license | INSERT INTO public.address(
address_id, address_city, address_country, address_number, address_street)
VALUES (1, 'Le Quesnoy', 'France', 8, 'Rue du Java'),
(2, 'Paris', 'France', 12, 'Rue du Java');
INSERT INTO public.center(
center_id, center_comment, center_mail, center_name, center_phone, center_pic... | true |
015c7d0784c533ab15762c071f7c085f7f6a5abe | SQL | DannyLillard/NashvilleHousing | /NashvilleHousing/Database/load.sql | UTF-8 | 674 | 2.796875 | 3 | [] | no_license | /* Author: Danny Lillard
* Date: 6/8/2021
* Desc: Command to populate database for nashville housing data.
*/
LOAD DATA LOCAL INFILE 'D:\\Documents\\Programming\\DAProjects\\NashvilleHousing\\Database\\nashville_housing.csv'
INTO TABLE nashville_housing
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TE... | true |
ba4e81ff05ff31f23acbd69e5d26dbbe58166d7a | SQL | croblesm/UMG-Migraciones-Flyway | /Demo_02/SQLScripts/--V2__LoadData.sql | UTF-8 | 2,511 | 3.203125 | 3 | [] | no_license | ---------------------------------------------------------------------------------
-- DEMO 2 --
-- V2: Load regions and countries data
---------------------------------------------------------------------------------
-- Load data into regions table
INSERT INTO regions (region_name) VALUES ('Europe');
INSERT INTO regio... | true |
b4e9f19ce21bac7a97e9b4af3f671299ee02dde4 | SQL | gr-alexandre/controle-tarefa | /src/main/resources/db/migration/V1__mariadb.sql | UTF-8 | 643 | 2.8125 | 3 | [] | no_license | CREATE TABLE usuario (
id int(11) NOT NULL AUTO_INCREMENT,
nome varchar(255) NOT NULL,
email varchar(50) NOT NULL,
password varchar(255) NOT NULL,
perfil_usuario varchar(255) NOT NULL,
fl_ativo tinyint(4) NOT NULL,
data_inclusao datetime DEFAULT NOW(),
PRIMARY KEY (id)
)
ENGINE = INNODB DEFAULT CHARSET=... | true |
d5e57206c1904099666518938f5042d27036fc23 | SQL | mblydenburgh/burger | /schema.sql | UTF-8 | 392 | 3 | 3 | [] | no_license | DROP DATABASE IF EXISTS burger_db;
CREATE DATABASE burger_db;
USE burger_db;
CREATE TABLE burgers (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
burger VARCHAR(255),
eaten BOOLEAN
);
INSERT INTO burgers (burger,eaten)
VALUES ("BBQ Burger",false), ("Bacon Cheese Burger",false), ("Southwestern Burger",fal... | true |
59e487f1dd9bdc47186efaf0a2c27a5deb0d9c9d | SQL | yunusyigci/SinemaBiletSatis | /sinema.sql | UTF-8 | 8,634 | 3.453125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 31 Mar 2018, 16:18:58
-- Sunucu sürümü: 5.6.17
-- PHP Sürümü: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... | true |
854d83934f0301ba7f1f68ab0bca02c52dceda1a | SQL | trinklehall/Major-Life-2 | /db/majorlife.sql | UTF-8 | 3,079 | 3.484375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 19, 2012 at 11:20 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... | true |
3ebefcf916f80e3baafee8a81bceeb2d88fd4249 | SQL | iamcal/iTunesServer | /schema.sql | UTF-8 | 1,828 | 3.671875 | 4 | [] | no_license | -- --------------------------------------------------------
--
-- Table structure for table `playlists`
--
CREATE TABLE IF NOT EXISTS `playlists` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`date_create` int(10) unsigned NOT NULL,
PRIMARY KEY ... | true |
7b8f7ac1554da714717e350eafd4b5247d4b0fbd | SQL | ocollins/TennisUniverse | /src/dba/createAll.sql | UTF-8 | 6,210 | 3.5625 | 4 | [] | no_license | DROP TABLE IF EXISTS TENNIS_UNIVERSE.ADMIN_ACTION;
DROP TABLE IF EXISTS TENNIS_UNIVERSE.PERSON_SERVICE;
DROP TABLE IF EXISTS TENNIS_UNIVERSE.PERSON;
DROP TABLE IF EXISTS TENNIS_UNIVERSE.SERVICE;
DROP TABLE IF EXISTS TENNIS_UNIVERSE.USER;
DROP TABLE IF EXISTS TENNIS_UNIVERSE.USER_ROLE;
CREATE TABLE TENNIS_UNIVERSE.ADMI... | true |
38acc95ce5be72609f4ffdbcdb971d5ef902338b | SQL | khaibin97/time-sink | /Project2/q4.sql | UTF-8 | 577 | 3.796875 | 4 | [] | no_license | DROP VIEW IF EXISTS q4 CASCADE;
DROP VIEW IF EXISTS typesum;
CREATE VIEW q4 AS SELECT stores.store, type, weekdate,weeklysales FROM hw2.stores, hw2.sales WHERE stores.store = sales.store;
CREATE VIEW typesum AS SELECT type, sum(weeklySales) FROM q4 GROUP BY type ORDER BY type;
CREATE VIEW bymonth AS SELECT extract(mo... | true |
c60f6a3b5039b03edcefd8984f0ccece6184d2b6 | SQL | nzetun/SalesSystemProject | /project/salesQueries.sql | UTF-8 | 6,147 | 4.28125 | 4 | [] | no_license | #File to test our database, salesDB
#Authors: jbargen and nzetocha
#1. A query to retrieve the main attributes of each person (their code, and last/first name).
select personId, personCode, lastName, firstName from Person;
#2. A query to retrieve the major fields for every person including their address (excluding em... | true |
ce5717a7ccfd97de74bb4fc095e524bbdfdc8878 | SQL | youkefan18/is_jsonb_valid | /sql/multipleOf.sql | UTF-8 | 672 | 2.921875 | 3 | [
"MIT"
] | permissive | -- by int
-- int by int
SELECT is_jsonb_valid('{"multipleOf":2}', '10');
-- int by int fail
SELECT is_jsonb_valid('{"multipleOf":2}', '7');
-- ignores non-numbers
SELECT is_jsonb_valid('{"multipleOf":2}', '"foo"');
-- by number
-- zero is multiple of anything
SELECT is_jsonb_valid('{"multipleOf":1.5}', '0');
-- 4.5 is ... | true |
fbe6166ee7a0ae49ef7f95041538f2ebe8130dcb | SQL | DiopB/groupe3 | /conf/evolutions/default/1.sql | UTF-8 | 1,938 | 3.4375 | 3 | [] | no_license | # --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table abonnement (
id bigint not null,
username_ajout varchar(255),
date_ajout timestamp,
Proprio_username varchar(255),
... | true |
c95ab72fd995f49c97a45278ab00be1a77ca206a | SQL | hobbylist/hobbylist-project | /sql/hobbylistdb-schema.sql | UTF-8 | 1,628 | 3.859375 | 4 | [] | no_license | drop database if exists hobbylistdb;
create database hobbylistdb;
use hobbylistdb;
create table users (
username varchar(20) not null primary key,
userpass char(32) not null,
name varchar(70) not null,
email varchar(255) not null
);
create table user_roles (
username varchar(20) not null,
... | true |
78865c8c1b5ecd246af7b344a48cf39b88a12a46 | SQL | JoeEmp/AirMemo | /AirMemo_table_ddl.sql | UTF-8 | 1,263 | 2.921875 | 3 | [] | no_license | CREATE TABLE Msg (
id INTEGER PRIMARY KEY,
username VARCHAR (320) DEFAULT visitor,
message VARCHAR (20) NOT NULL,
detail VARCHAR (500),
color VARCHAR (10) DEFAULT c4ffff,
clouds_key VARCHAR (50),
is_del INTEGER DEFAULT 0,
del_time VARCHAR (40) D... | true |
a5014b7e3ab7d48e2b7a028ca3907d20a47bf749 | SQL | kesiyaraj/Shipping-Port | /Create_Tables.sql | UTF-8 | 929 | 3.015625 | 3 | [] | no_license | insert into SHARES values (3,3);
insert into SHARES values (5,5);
insert into SHARES values (7,7);
insert into SHARES values (9,9);
CREATE TABLE TRADE
(
Id_1 INT NOT NULL,
TRADEId_2 INT NOT NULL,
PRIMARY KEY (Id_1, TRADEId_2),
FOREIGN KEY (Id_1) REFERENCES COUNTRY(Id),
FOREIGN KEY (TRADEId... | true |
437fc887e0935553d420bdf1182d7b8f2d6efa1d | SQL | chrislimqc/NTU_CompSci | /CZ2007/tutorial_7/tutorial_7_q1.sql | UTF-8 | 180 | 2.765625 | 3 | [] | no_license | -- method 1
SELECT Sname
FROM STUDENT
WHERE GPA <= ALL (SELECT GPA FROM STUDENT);
-- method 2
SELECT Sname
FROM STUDENT
WHERE GPA IN (SELECT MIN(GPA) FROM STUDENT); | true |
b1bb4b55ab9aa2757a56f4c751903db34bb9352e | SQL | MarianoNavarrete/Backend-Movie | /DataBase/scriptTables.sql | UTF-8 | 1,265 | 3.640625 | 4 | [] | no_license | create table actor
(
id_actor int not null auto_increment,
name char(120),
age int,
image char(255),
primary key (id_actor)
);
/*==============================================================*/
/* Table: MOVIE ... | true |
f04251251aab0a5a49c7eac483fd320b6522c64f | SQL | hhsu15/vaccination_project | /vaccination.sql | UTF-8 | 942 | 3.671875 | 4 | [] | no_license | -- create a table called "countries"
CREATE TABLE IF NOT EXISTS countries (
country TEXT NOT NULL PRIMARY KEY,
iso_code TEXT,
vaccines TEXT,
source_name TEXT,
source_website TEXT
);
-- create a table called "vaccination_data"
CREATE TABLE IF NOT EXISTS vaccination_data (
id INTEGER PRIMARY KEY... | true |
d175620c2fdef142037dd4f8b42fe0bf83c96fa3 | SQL | igstan/sql-utils | /group-by-age-interval.sql | UTF-8 | 447 | 3.546875 | 4 | [
"BSD-2-Clause"
] | permissive | -- Strongly inspired from here:
-- http://www.experts-exchange.com/Database/Miscellaneous/Q_24608444.html
SELECT
COUNT(*) AS total,
CASE
WHEN age >= 35 THEN 35
WHEN age >= 30 THEN 30
WHEN age >= 25 THEN 25
WHEN age >= 20 THEN 20
ELSE 0
END as age_interval
FROM (
S... | true |
637dfe6813fec165a76bd2bd72c3f6ba0764faaa | SQL | andrewhamili/CEUPreventiveMaintenanceSystem | /ceumiadprevmaintenance.sql | UTF-8 | 4,932 | 2.765625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win32 (x86)
--
-- Host: localhost Database: ceumiadprevmaintenance
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... | true |
f42e97058b7914bcc21799d335ed38783f7356a2 | SQL | bellmit/origin | /family_order/sql/TF_F_USER_DISCNT/SEL_DISCNT_BY_USERID_NOPHONE.sql | UTF-8 | 214 | 3.09375 | 3 | [] | no_license | select t.*
from TF_F_USER_DISCNT T, TD_S_COMMPARA T1
where T.DISCNT_CODE = TO_NUMBER(T1.PARA_CODE1)
AND T1.PARAM_ATTR = '532'
and t1.param_code='681'
AND T.USER_ID = :USER_ID
and sysdate < t.end_date | true |
eb823f31dcdfef0149c580016321ae131bbed759 | SQL | jithinvijayan007/erp_orig | /V2.5.sql | UTF-8 | 430 | 2.71875 | 3 | [] | no_license | DROP TABLE JOURNAL;
CREATE TABLE journal(
pk_bint_id BIGSERIAL PRIMARY KEY,
vchr_jv_num VARCHAR(100),
fk_branch_id BIGINT REFERENCES BRANCH(pk_bint_id),
dat_journal DATE,
int_debit_type INTEGER,-- CUST
fk_debit_id INTEGER ,
int_credit_type INTEGER,
fk_credit_id INTEGER,
dbl_amount DOUBLE PRECISION,
vchr_remarks varchar... | true |
851061f7f935517cf17cb2e3426808c438f61286 | SQL | vidapogosoft/SQLAdmin-Tunning092021 | /Tunning/Index.sql | UTF-8 | 1,254 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive |
---Planes de mantenimiento
select FechaEmision,* from musicallyapp..Factura where NumeroIdentificacion = '0104300850'
select NumeroIdentificacion from musicallyapp..Factura where NumeroIdentificacion = '0104300850'
select NumeroIdentificacion,FechaEmision from musicallyapp..Factura where NumeroIdentificacion = '01... | true |
9840496cb04a65daf7caa9b68c69f29c3b562fdd | SQL | ajbayquen/assignment-1 | /SQL Project.sql | UTF-8 | 5,205 | 3.9375 | 4 | [] | no_license | -- Problem 1
DROP DATABASE `buildingenergy`;
CREATE DATABASE `buildingenergy`;
-- Problem 2
drop table if exists `buildingenergy`.`energy_categories`;
drop table if exists `buildingenergy`.`energy_types`;
CREATE TABLE `buildingenergy`.`energy_categories` (
`Cat_ID` INT NOT NULL,
`Energy_Cat_Desc` VARCHAR(60) N... | true |
0f4240d1136487535b8d760bd78dd0ca4a921db1 | SQL | ischihuo/web | /server/mysql.sql | UTF-8 | 27,836 | 2.984375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : xmtest
Source Server Version : 50610
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50610
File Encoding : 65001
Date: 2018-07-12 17:10:18
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... | true |
77115e1b539c9cba84598efebf78ae65dfb4e751 | SQL | karvozavr/sql_hw | /SQL/5.sql | UTF-8 | 97 | 2.9375 | 3 | [] | no_license | SELECT Country.GovernmentForm, SUM(Country.SurfaceArea) FROM Country
GROUP BY GovernmentForm; | true |
a6c5aa4418c68cd356a6535ca8685656ceabe33c | SQL | ZhiYu2018/taskeye | /taskeye.sql | UTF-8 | 3,381 | 3.578125 | 4 | [] | no_license | CREATE TABLE `timer_lock`(
`app_id` varchar(32) NOT NULL DEFAULT '' COMMENT '接入方ID',
`lock_owner` varchar(64) NOT NULL DEFAULT '' COMMENT '锁的拥有者',
`lock_name` varchar(64) NOT NULL DEFAULT '' COMMENT '锁的名称',
`lock_status` int NOT NULL DEFAULT 0 COMMENT '1 释放, 2 锁',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTA... | true |
966077ab53a505be8f2cfcc0011477dcb35a299f | SQL | HKJL/hkjl-bot | /install.sql | UTF-8 | 1,135 | 3.5 | 4 | [] | no_license | CREATE TABLE `youtubelinks` (
`url` varchar(100) NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `karma` (
`name` varchar(255) NOT NULL,
`karma` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `storage` (
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL
) ENGINE=I... | true |
54a18fbe0f04f030011a8738a7176d9b911ed17e | SQL | asachanxxx/InfoCRM | /Docs/SQL/Service.sql | UTF-8 | 206 | 3.234375 | 3 | [] | no_license | select ROW_NUMBER() over (order by AgreementId desc ) rown , Value
into temp
from SeviceAgreement
update sag set sag.AgreementId = t.rown
from SeviceAgreement sag
inner join temp t on sag.Value = t.Value | true |
6744845059309124f705929c649cf8be0902e9d1 | SQL | ashma798/dip_tour | /db/DT131119.sql | UTF-8 | 178,719 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- Adminer 4.7.0 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `dip_tour` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `dip_tour`;
DROP TABLE IF EXISTS `airport`;
CREATE TABLE `airport` (
`airport_id` int(11) NOT NULL AUTO_... | true |
767b8bf43f0c785dbb3f260160735209b0512485 | SQL | theGreatDale/astigboyDale | /ITE208_De Guzman,Paragas/db_uberdipose.sql | UTF-8 | 7,645 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 11, 2019 at 08:45 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
fd2cd0a4f43a24de82dd0ef7a15ba9407f6a12d6 | SQL | tiy-dallas-june-2017/database_school_api_starter | /db/datascript.sql | UTF-8 | 106,320 | 3.25 | 3 | [] | no_license |
DROP TABLE IF EXISTS student;
DROP TABLE IF EXISTS teacher;
DROP TABLE IF EXISTS subject;
DROP TABLE IF EXISTS assignment;
DROP TABLE IF EXISTS subject_student;
CREATE TABLE teacher (
teacher_id serial PRIMARY KEY,
first_name varchar(50),
last_name varchar(50)
);
CREATE TABLE student (
student_id se... | true |
6f4d88930a27856e1eee9a1a46f05ac1c0813e19 | SQL | frutiemax/Community-Patch-DLL | /Community Balance Patch/Balance Changes/Leaders/Vanilla/VanillaLeaderChanges.sql | UTF-8 | 33,388 | 3.203125 | 3 | [] | no_license | -- America -- MOMA
DELETE FROM Units
WHERE Type = 'UNIT_AMERICAN_B17' AND EXISTS (SELECT * FROM COMMUNITY WHERE Type='COMMUNITY_CORE_BALANCE_LEADERS' AND Value= 1 );
DELETE FROM Civilization_UnitClassOverrides
WHERE UnitType = 'UNIT_AMERICAN_B17' AND EXISTS (SELECT * FROM COMMUNITY WHERE Type='COMMUNITY_CORE_BALANCE_L... | true |
766652c901f117da815755d82f884bab68cc3e89 | SQL | VladimirKlimovProg/Databases | /Лабораторная работа №4/4.50.sql | UTF-8 | 513 | 3.390625 | 3 | [] | no_license | CREATE VIEW SUPPLY
(CATERER.NAME, MATERIAL, MESSURE, SUPPLY_DATE, PRICE, VOLUME, SUMM)
AS
SELECT CATERER.NAME, MATERIAL.NAME, MESSURE.NAME,
SUPPLY.SUPPLY_DATE, INPRICE.PRICE,
SUPPLY.VOLUME, SUPPLY.VOLUME * INPRICE.PRICE
FROM SUPPLY JOIN CATERER
ON SUPPLY.ID_CATERER = CATERER.ID_CATERER
J... | true |
e5a1984f52374142806010334168758a8c45e3f5 | SQL | KHBM/WebsocketTest | /src/main/resources/schema_.sql | UTF-8 | 6,545 | 3.53125 | 4 | [] | no_license | -- used in tests that use HSQL
create table oauth_client_details (
client_id VARCHAR(256) PRIMARY KEY,
resource_ids VARCHAR(256),
client_secret VARCHAR(256),
scope VARCHAR(256),
authorized_grant_types VARCHAR(256),
web_server_redirect_uri VARCHAR(256),
authorities VARCHAR(256),
access_token_validity INT... | true |
2453093478212628662870b74f46b1f75ab1e884 | SQL | darcyknox/cosc344 | /lab07/salary_change.sql | UTF-8 | 468 | 3.375 | 3 | [] | no_license | CREATE OR REPLACE TRIGGER salary_change
AFTER INSERT OR DELETE OR UPDATE OF salary
ON e1
FOR EACH ROW
BEGIN
IF INSERTING THEN -- insert
UPDATE d1
SET tot_sal = tot_sal + :NEW.salary
WHERE dnumber = :NEW.dno;
ELSIF DELETING THEN -- delete
UPDATE d1
SET tot_sal = tot_sal - :OLD.salary
WHERE dn... | true |
f9f445701c3d61d05ce0c5b1ead49e723dc2a991 | SQL | febwave/pybig | /Dump20151215.sql | UTF-8 | 5,071 | 3.046875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 192.168.237.144 Database: mystore
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0.14.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... | true |
e8162fad0431799e8b6f36243d696458337c7525 | SQL | hhy107107/spring-demo | /test.sql | UTF-8 | 10,793 | 3.828125 | 4 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50625
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50625
File Encoding : 65001
Date: 2018-01-02 14:57:30
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... | true |
0d5d01f3555fa8323d77866f2216bd50c521ecd7 | SQL | serge-st/pineapple | /startup-queries.sql | UTF-8 | 541 | 2.890625 | 3 | [] | no_license | CREATE DATABASE `pineapple_db`;
CREATE TABLE `pineapple_db`.`emails` (
`id` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(60) NOT NULL,
`created_date` TIMESTAMP NOT NULL,
`is_subscribed` BIT DEFAULT 1,
`provider` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id`)
);
alter table `pineapple_db`.`emails` AU... | true |
596c0d7c7a42312a6e9d3e8cab2ee0a3c402e323 | SQL | pharlanne/monday29 | /pets_owner_database/script.sql | UTF-8 | 802 | 3.15625 | 3 | [] | no_license | -- CREATE TABLE owner(
-- id SERIAL8 PRIMARY KEY,
-- name VARCHAR(255),
-- age INT2,
-- sex CHAR(1)
-- );
-- INSERT INTO owner(name, age, sex) VALUES('kat', 18,'F');
-- INSERT INTO owner(name, age, sex) VALUES('sam', 24,'F');
-- INSERT INTO owner (name,age) VALUES ('valerie',22);
-- INSERT INTO owner (name,age) VALUES ... | true |
13beab8d6179b4cdaf2500729ca792f212fff49b | SQL | jeandieb/Cookbook | /documents/project-queries.sql | UTF-8 | 3,552 | 4.625 | 5 | [] | no_license | -- Print the first and last name of chefs in the database and the cuisines that they experts in.
SELECT FIRSTNAME AS chef_first_name, LASTNAME AS chef_last_name, C.NAME AS cuisine_name
FROM CUISINES C INNER JOIN CHEF_CUISINE CC ON C.ID = CC.CUISINES_ID
INNER JOIN USERS U ON CC.CHEFS_ID = U... | true |
dbc2eb6be5614a0418abb18ee1eb43a19dad8cde | SQL | js102210/techElevator_example_code | /module-2/04_INSERT_UPDATE_and_DELETE/exercise-student/constraints-and-transactions-exercises.sql | UTF-8 | 5,140 | 3.84375 | 4 | [] | no_license | -- Write queries to return the following:
-- The following changes are applied to the "dvdstore" database.**
-- 1. Add actors, Hampton Avenue, and Lisa Byway to the actor table.
INSERT INTO actor (first_name, last_name)
VALUES ('HAMPTON','AVENUE'),('LISA','BYWAY');
SELECT *
FROM actor
WHERE first_name IN ('HAMPTON','... | true |
c570a34645f25123209aeb1d97ae05dbc33f891d | SQL | unicornette/SQLServer | /Teaching Examples (For SQL Server Classes)/cteaggregate.sql | UTF-8 | 1,220 | 3.9375 | 4 | [] | no_license | /*
CTEs for aggregation
*/
CREATE TABLE ##Sales(
Person VARCHAR(25),
Sales INT
)
INSERT INTO ##Sales
VALUES ('John',100)
, ('John',100)
, ('John',250)
, ('Jane',300)
, ('Jane',50)
, ('John',400)
, ('Bob',200)
, ('Belize',150)
, ('Bob',20)
, ('Belize',40)
, ('Belize',20)
, ('Bob',100)
, ('John',250)
... | true |
f74f61c754370ca18b66e930e9a088f67a0db657 | SQL | deyanTG/social-app | /social-uni/src/main/resources/db/create.sql | UTF-8 | 2,283 | 4.15625 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS = 0;
drop table if exists users;
drop table if exists persistent_logins;
drop table if exists verification_token;
drop table if exists password_reset_token;
drop table if exists UserConnection;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE IF NOT EXISTS users (
id bigint(20) NOT NULL AUTO_INCREMENT... | true |
61f948a9e11cb059394329cec1b863974eb8469d | SQL | impks27/java-stuffs | /httpd-tomcat/docs/tomcat-db-sec.sql | UTF-8 | 652 | 3.03125 | 3 | [] | no_license | create table users (
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
);
create table user_roles (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key (user_name, role_name)
);
insert into users(user_name,user_pass) values ("pavan","welcome1");
insert into users(user_n... | true |
3c4a6d74f197c62d6310204698dac44a417bb489 | SQL | codefornola/nolabase | /config/migrations/000004_create_assessor_data.up.sql | UTF-8 | 2,682 | 3.453125 | 3 | [
"MIT"
] | permissive | CREATE SCHEMA assessor;
COMMENT ON SCHEMA assessor IS 'Tax assessor data scraped from the Orleans Parish tax assessor website: https://www.qpublic.net/la/orleans/';
CREATE TABLE assessor.properties (
id SERIAL PRIMARY KEY,
assessor_id character varying(50),
owner_name text,
land_area_sq_ft integer,
... | true |
92b1f7eeaf1b47b12e56e638b76eb7397a5c48d7 | SQL | opengauss-mirror/openGauss-server | /src/test/regress/sql/shipping_directly.sql | UTF-8 | 5,086 | 3.328125 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
... | permissive | set current_schema='shipping_schema';
--convert
--convert_to
--convert_from
--age(timestamptz)
--age(timestamp)
--overlaps(timestamptz,interval,timestamptz,interval)
--overlaps(timestamptz, timestamptz,timestamptz,interval)
--overlaps(timestamptz,interval,timestamptz, timestamptz)
--to_char(float4,text)
--to_char(float... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.