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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34b119186be277d29bbb315075b81572dda189b5 | SQL | igorbragaia/algorithms | /interviewbit/Sql-Programming/Actors-And-Their-Movies.sql | UTF-8 | 622 | 4.28125 | 4 | [] | no_license | select distinct(movies.movie_title) as movie_title
from movies
join movies_cast on movies.movie_id = movies_cast.movie_id
join actors on movies_cast.actor_id = actors.actor_id
where
actors.actor_id in
(
select distinct(actors.actor_id)
from mov... | true |
76272bbc332b7a0735d0bac691931fbf2fdf35b0 | SQL | jbredow/sql-queries | /pcca reporting/archive/master_customer.sql | UTF-8 | 329 | 2.765625 | 3 | [] | no_license | --selects all customers in a branch associated with a master customer
SELECT cd.account_name,
cd.account_number_nk,
cd.customer_type,
cd.email_address,
cd.job_yn,
cd.main_customer_nk,
cd.mstr_cust_name,
cd.mstr_custno,
cd.price_column,
cd.salesman_code
FROM dw_fei.customer_dimension cd
WHERE cd.mstr_custno = '... | true |
3bbb8e9d8228ee3938c41bb500122531188dd1db | SQL | igalpr/evaluacion-efsi | /base de datos/base.sql | UTF-8 | 1,188 | 3.1875 | 3 | [] | no_license | /*
SQLyog Ultimate v11.11 (32 bit)
MySQL - 5.7.21 : Database - evaluacion-efsi
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@... | true |
f3d4aaa83d9b908f916e9877bb9ce791421b5f7e | SQL | suleymanisabalayev/sdf2 | /sulu/suleyman.sql | UTF-8 | 793 | 2.671875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 12, 2019 at 04:03 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `crood`
--
-- --------------------------------------------------------
-- ... | true |
0dd4cb21581583c81d4ed5d80fcc37a3d0058fe8 | SQL | gonzalomcardoso/LaboratorioTPInicial | /agenda/sql/scriptAgenda.sql | UTF-8 | 796 | 2.75 | 3 | [] | no_license | CREATE DATABASE `agenda`;
USE agenda;
CREATE TABLE `personas`
(
`idPersona` int(11) NOT NULL AUTO_INCREMENT,
`Nombre` varchar(45) NOT NULL,
`Telefono` varchar(20) NOT NULL,
`Calle` varchar(45) NOT NULL,
`Altura` varchar(20) NOT NULL,
`Piso` varchar(20) NOT NULL,
`Localidad` varchar(20) NOT NULL,
`Mail` ... | true |
aacdbbb72c54fa176686984fb89ec046b4b1607a | SQL | joker17/analysis_sql | /data.sql | UTF-8 | 531 | 2.9375 | 3 | [] | no_license | create or replace view vo4_bondpayment as
select
d.market_no market_no,
c.inter_code inter_code,
nvl(b.vc_report_code, ' ') report_code,
a.l_pay_date installment_pay_date,
nvl(a.en_pay_ratio, 0) installment_pay_rate,
nvl(a.en_pay_amount, 0) installment_pay_balance,
a.l_end_date expire_pay_date
from tbondpayratio... | true |
bc3a57d3c91e5587f4df752439ad1b32c8b5dd38 | SQL | LuGeorgiev/SoftUniDBBasicMSSQL | /ExamPrep030118RentACar/RentACar/SQL Server Scripts1/DDL.sql | UTF-8 | 1,721 | 3.84375 | 4 | [
"MIT"
] | permissive | CREATE DATABASE RentACAr
USE RentACar
CREATE TABLE Clients(
Id INT PRIMARY KEY IDENTITY,
FirstName NVARCHAR(30) NOT NULL,
LastName NVARCHAR(30) NOT NULL,
Gender CHAR(1),
BirthDate DATE,
CreditCard NVARCHAR(30) NOT NULL,
CardValidity DATE,
Email NVARCHAR(50) NOT NULL,
CONSTRAINT CHK_Gender_Client CHECK(Gender='M' OR G... | true |
0bea9340c6c5d79b40261c36bc5ce3023809d917 | SQL | nhan0987/convert-db-portlet | /docroot/WEB-INF/sql/tables.sql | UTF-8 | 946 | 2.84375 | 3 | [] | no_license | create table expandotable (
tableId LONG not null primary key,
companyId LONG,
classNameId LONG,
name VARCHAR(75) null
);
create table opencps_domain_target (
domainConfigId LONG not null primary key,
targetDomain VARCHAR(75) null,
userName VARCHAR(75) null,
password_ VARCHAR(75) null
);
create table opencps_... | true |
1edb865d23dea697f9a0c1188dc4a3411e2c49d3 | SQL | ndn1991/etuoi | /admin/admin-extension/conf/role_permission.sql | UTF-8 | 225 | 2.6875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS role_permission (
role_id binary(16) NOT NULL,
permission_id binary(16) NOT NULL,
created_time BIGINT(16) NOT NULL,
PRIMARY KEY (role_id,permission_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
2dae71b82bae4bd90763edcc31b962687b336a99 | SQL | cczzrs/pac | /init_db.sql | UTF-8 | 6,293 | 3.4375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 0-0.cc
Source Server Version : 50624
Source Host : 0-0.cc:3306
Source Database : pac
Target Server Type : MYSQL
Target Server Version : 50624
File Encoding : 65001
Date: 2018-09-29 17:21:21
*/
USE pac;
SET FOREIGN_KEY_CHECKS=0;
-- -... | true |
2b7d8dbf83971d6d7329265b565ed4f028878991 | SQL | Bhupenderkumar07/Cemp | /cemp.sql | UTF-8 | 17,042 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 19, 2020 at 09:50 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... | true |
9be805e799a15eda11688297fb35ed9fa59ae9e4 | SQL | ankitmishra88/PU131_Hackminers | /globalfactors/globaltable.sql | UTF-8 | 1,599 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 30, 2020 at 10:33 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
b0b7238f35b4361c0ece7fbfbfa9fa42aa7f86d0 | SQL | liwen666/ETL | /dw-etl-onebank/src/ddl/dm/md_cm_bp_city.sql | UTF-8 | 37,024 | 2.71875 | 3 | [] | no_license |
-- ----------------------------
-- Table structure for md_cm_bp_city
-- ----------------------------
DROP TABLE IF EXISTS "md_cm_bp_city";
CREATE TABLE "md_cm_bp_city" (
"id" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
"name" varchar(60) COLLATE "pg_catalog"."default",
"desc_" varchar(600) COLLATE "pg_c... | true |
6f01743ce80a5ea13b1c28a946b5b45034e1df26 | SQL | mado2461990/shoppingCartExamplePhP | /shopping.sql | UTF-8 | 3,800 | 3.109375 | 3 | [] | no_license | --
-- Database: `shopping`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for ta... | true |
0e804476dd376c81dbe854a9748ae9fb25397488 | SQL | rweglowski/migration-vammy | /sql/initial/menu_allregen.sql | UTF-8 | 568 | 2.84375 | 3 | [] | no_license | CREATE TABLE `menu_allregen` (
`IdAllergen` int NOT NULL AUTO_INCREMENT,
`IdClient` int NOT NULL DEFAULT '-1',
`IdPlace` int NOT NULL DEFAULT '-1',
`AllergenName` varchar(64) CHARACTER SET utf8 COLLATE utf8_polish_ci DEFAULT NULL,
`Created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`Modified` timestamp NULL... | true |
32ef3b1c43d7a93cf971bc35196362552bc63609 | SQL | rodrigocastillo1/Juego-UNO | /Juego-UNO/Juego UNO/src/login/player.sql | UTF-8 | 1,629 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 20-04-2017 a las 07:55:14
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... | true |
da8e2b0e0c191f4699c7689f7ce3a5baac5a42cc | SQL | deepakchaurasia-rally/POC | /BE/play-scala-seed/conf/evolutions/default/1.sql | UTF-8 | 1,375 | 2.578125 | 3 | [] | no_license | #--- !Ups
CREATE TABLE doctor(
first_name VARCHAR,
last_name VARCHAR,
specialist VARCHAR,
address VARCHAR,
designation VARCHAR,
phone_no bigint
);
INSERT INTO doctor (first_name, last_name, specialist, address, designation, phone_no) VALUES ('Deepak', 'Chaurasia', 'ENT', 'Noida', 'MD', 8130440808);
INSERT... | true |
24881618c1cdabaddb75267fad8802d30031bf8d | SQL | Tinkerforge/doc | /de/source/Software/API_Bindings_uC_HAL_Common.inc | UTF-8 | 4,741 | 3.3125 | 3 | [] | no_license | .. cpp:function:: void tf_hal_set_timeout(TF_HAL *hal, uint32_t timeout_us)
Setzt den Timeout in Mikrosekunden für Getter und Setter für die das Response-Expected-Flag
gesetzt ist.
Der Standard-Timeout ist 2500000 (2,5 Sekunden).
.. cpp:function:: uint32_t tf_hal_get_timeout(TF_HAL *hal)
Gibt den Timeout zurück... | true |
6d2aa26911ca583ce59711876d914faff3c8e117 | SQL | GermanMoltoni/clasesProg3 | /parcial_clase13/farmacia.sql | UTF-8 | 4,303 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-06-2017 a las 02:18:13
-- Versión del servidor: 10.1.19-MariaDB
-- Versión de PHP: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... | true |
691c7c0239e67555565acf0552d9a2ddfc41fd2e | SQL | Juwendays/TA-kelompok-02705-dan-02713 | /adminlte.sql | UTF-8 | 2,567 | 3.21875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 18 Bulan Mei 2020 pada 13.45
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... | true |
47122105229c2096c8d75afbd5e10b6660d7dda6 | SQL | sunnycd/propensity-modelling-demo | /processing-pipeline/f050_create_brand_features.sql | UTF-8 | 4,537 | 4.1875 | 4 | [] | no_license | -- generation of brand-related behavioural features
-- overwrite "features" table
SELECT
*
EXCEPT(id_b, brand_b, id_c, brand_c, id_d, brand_d, id_e, brand_e)
FROM
`PROJECT.DATASET.features` a
LEFT JOIN
-- 1M
(
SELECT
id AS id_b,
brand AS brand_b,
COUNT(DISTINCT(transaction_id)) AS total_tran... | true |
b86dc7c14fa6ecb30d922d64c09999509006fd64 | SQL | CoderJu/SpringSecurityannotation | /src/main/resources/sql/sql.sql | UTF-8 | 1,219 | 3.546875 | 4 | [] | no_license | CREATE TABLE `profile` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`password` ... | true |
072a9716332185eebfa77aa7e734665dec68ecb4 | SQL | albertomattos/SQL_gerais | /Cobertura de convenios.sql | UTF-8 | 1,870 | 3.375 | 3 | [] | no_license | select a.*, a.rowid from faccgcad a where a.tipo_prd = 'PRO' and a.cod_con = '051'
select a.cod_con, a.tipo_prd, a.tab_urg, a.rowid from faccgcad a where a.tipo_prd in ('DES','MED','FNU','GMD','TAX','FIO','KIT') order by 3
select a.cod_con, A.COD_PLA, a.tipo_prd, a.tab_urg, a.rowid from faccgcad a where tipo_prd = 'KI... | true |
6300df469323c5a48fcbfe43a629cd6fac8e3541 | SQL | andrehgustavo/performance-mongodb-postgres | /script_sql.sql | UTF-8 | 5,059 | 3.953125 | 4 | [] | no_license | CREATE TABLE app_list (
appid INTEGER,
name VARCHAR(150),
PRIMARY KEY (appid)
);
COPY app_list(appid, name)
FROM '/home/data/app_list.csv'
DELIMITER ','
CSV HEADER;
-- Dataset 2
CREATE TABLE steamspy (
appid INTEGER,
name VARCHAR(150),
developer VARCHAR(300),
publisher VARCHAR(150),
score_rank INTEGER... | true |
ac4df88863afcb31efd90d79b123e7b4a658f734 | SQL | Diieoy/simplex | /DatabaseForTest/Post/Script.PostDeployment.sql | UTF-8 | 1,750 | 3.25 | 3 | [] | no_license | --- Venue
insert into dbo.Venue
values ('Arena' ,'First venue', 'Amazing streat 12/4', '22-44-11')
--- Layout
insert into dbo.Layout
values ('Layout 1', 1, 'First layout'),
('Layout 2', 1, 'Second layout'),
('Layout 3', 1, 'Third layout')
--- Area
insert into dbo.Area
values (1, 'First area of first layout', 2, 3),
... | true |
473309b38c69c7dd8b5429018b11c98a68386f89 | SQL | Duddha/SQL | /[ОЭ] Количество работников и членов их семей, проживающих в Южном.sql | WINDOWS-1251 | 1,969 | 3.28125 | 3 | [] | no_license | -- ( )
-- !!!
select distinct fio, data_r from (
select distinct a.id_tab, rbf.fam_u||' '||rbf.f_name_u||' '||rbf.s_name_u fio, osn.data_r
from qwerty.sp_ka_adres a, qwerty.sp_rb_fio rbf, qwerty.sp_ka_osn osn
where a.id_tab in (select id_tab from qwerty.sp_ka_work)
and a.id_sity = 176
and fl = 2
... | true |
75be037de54f65404fe6c559e9cfca08d4ea5a55 | SQL | JuanJoseGomezR/holbertonschool-higher_level_programming | /0x0D-SQL_introduction/13-change_class.sql | UTF-8 | 174 | 2.59375 | 3 | [] | no_license | -- script that removes all records with a score <= 5 in the table
-- second_table of the database hbtn_0c_0 in your MySQL server.
DELETE FROM
second_table
WHERE
score <= 5
| true |
ed1fdb8e1e29de50ee94034641b502356f01b202 | SQL | MavonCmc/PatentsView-DB | /reporting_database_generator/03_06_Foreign_Priority.sql | UTF-8 | 1,260 | 3.6875 | 4 | [] | no_license |
# BEGIN foreignpriority
#################################################################################################################################
drop table if exists `{{params.reporting_database}}`.`foreignpriority`;
create table `{{params.reporting_database}}`.`foreignpriority`
(
`patent_id` varchar(20... | true |
6449924f99346e65a3e8b4497bc306808f4cb8ed | SQL | Diodio/Project-Teranga | /sql/15042016.sql | UTF-8 | 506 | 2.78125 | 3 | [] | no_license | CREATE TABLE devise (id INT AUTO_INCREMENT NOT NULL, devise VARCHAR(10) NOT NULL, montant NUMERIC(10, 2) NOT NULL, createdDate DATETIME DEFAULT NULL, updatedDate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_43EDA4DF43EDA4DF (devise), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTE... | true |
0e79a1c0f042745dccb11a80876972140b3e6225 | SQL | chihaso/rakurakuERD | /004_hospital_reception.sql | UTF-8 | 1,451 | 3.953125 | 4 | [] | no_license | CREATE TABLE patients (
patient_id INTEGER NOT NULL,
patient_name VARCHAR(100),
id INTEGER,
birthday DATE,
PRIMARY KEY (patient_id)
);
CREATE TABLE receptions (
reception_id INTEGER NOT NULL,
patient_id INTEGER NOT NULL,
reception_timestamp TIMESTAMPTZ,
terminal_number INTEGER,
accounting_number IN... | true |
1bde432d36090ce47d16ba38eed4cb1a499dbcf6 | SQL | Rishi0406/sql-challenge | /EmployeeSQL/queries.sql | UTF-8 | 2,648 | 4.75 | 5 | [] | no_license | select * from departments;
select * from dept_emp;
select * from dept_manager;
select * from employees;
select * from salaries;
select * from titles;
-- 1. List the following details of each employee: employee number, last name, first name, sex, and salary.
select e.emp_no as employee_number, e.last_name, e.first_na... | true |
ec576d8c97137d4702bf6246bb2626f1a3f9a93a | SQL | 21Vipin/userManagementApp | /target/classes/static/db/db_strucrure.sql | UTF-8 | 783 | 3.703125 | 4 | [] | no_license | //DROP TABLE IF EXISTS role;
//
//CREATE TABLE role (
// role_id int(11) NOT NULL AUTO_INCREMENT,
// role varchar(255) DEFAULT "ADMIN",
// PRIMARY KEY (role_id)
//);
//
//
//
//DROP TABLE IF EXISTS user;
//
//
//CREATE TABLE user (
// user_id int(11) NOT NULL AUTO_INCREMENT,
// active int(11) DEFAULT NULL,
// ema... | true |
32de1c0cdaa5f1f317298c94ed4cc27612ff52a8 | SQL | ibrahima-bah/discussion | /discussion.sql | UTF-8 | 2,530 | 3.28125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 05, 2020 at 08:59 AM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
1bf8e16ea5b83f498edec6cd7ef9124cf5e4b285 | SQL | slam4ik/slam | /SQL/kabylin.sql | UTF-8 | 7,967 | 3.625 | 4 | [] | no_license | create database KABYLIN character set 'utf8mb4';
use KABYLIN;
create table USERS (
id int auto_increment primary key,
login varchar(20) not null unique key,
`password` varchar(20) not null
);
create table `PROFILES` (
id int auto_increment primary key,
first_name varchar(20) not null,
last_... | true |
993ddb80f3a2887ae0a5775ad56f04197f62b392 | SQL | Lsdla/exercice-create-database-Asterix | /Rendu-sqlix/data.sql | UTF-8 | 3,681 | 3.0625 | 3 | [] | no_license | -- on respectant l'ordre des créations des tables on fait les inserts:
-- Insertion de Données :
INSERT INTO province (nom_province, nom_gouverneur)
VALUES ("Armorique","Garovirus"),
("Averne","Nenpeuplus"),
("Aquitaine","Yenapus");
INSERT INTO categorie (code_cat, nom_categ, nb_points)
VALUES ("BCN", "Bouclie... | true |
058296dde8d838b6266a86f8783db3ae6d32e08c | SQL | SlabkoKonstantin/Blogs_SQL | /Stend06/01_data_structure.sql | UTF-8 | 622 | 3.171875 | 3 | [] | no_license | --drop table t_users;
create table t_users as
select a1.*
from all_users a1
cross join
all_users a2
cross join
all_users a3;
-- drop table t_objects
create table t_objects as
select ao.*
from all_objects ao
cross join
all_users a2;
-- drop index inx_objects_owner;
create index in... | true |
382cc00f8dd4298f256602b2fdff84286e682b83 | SQL | algebrateam/phpdev2017 | /zilicic/view_top_studenti.sql | UTF-8 | 423 | 3.828125 | 4 | [
"MIT"
] | permissive | USE fakultet;
CREATE VIEW v_top_studenti_2003 AS
SELECT ispit.mbrStud,
count(*)broj_izlazaka,
avg(ispit.ocjena) as prosjek,
(0.8*avg(ispit.ocjena)+count(*)*0.2) as RANK,
year(ispit.datIspit) as godina
FROM ispit
WHERE ispit.ocjena>1
AND YEAR(ispit.datIspit)=2003
GROUP BY mbrstud
ORDER BY RANK DESC
LIMIT 5
; /* samo oni... | true |
cc5b163271a89c17542853b5a319833a453ea18b | SQL | maxplne/OnionCrawler | /src/main/resources/database.sql | UTF-8 | 1,553 | 3.5 | 4 | [] | no_license | --
-- Database: `onionCrawler`
--
-- --------------------------------------------------------
--
-- Table structure for table `bannedDomains`
--
CREATE TABLE IF NOT EXISTS `bannedDomains` (
`hostMd5Sum` varchar(32) NOT NULL,
`added` datetime NOT NULL,
`comment` text COLLATE utf8_bin NOT NULL,
UNIQUE KEY `hos... | true |
8c6e95097d39c70db009a9205534601f1fe29887 | SQL | Adam-Thometz/SQL-Joins-exercise | /queries.sql | UTF-8 | 1,098 | 4.71875 | 5 | [] | no_license | -- Join the two tables so that every column and record appears, regardless of if there is not an owner_id.
SELECT * FROM owners o
FULL OUTER JOIN vehicles v
ON o.id = v.owner_id;
-- Count the number of cars for each owner. Display the owners first_name, last_name and count of vehicles. The first_name should b... | true |
02da9289d767378a3b70b974f214a79b64d017f5 | SQL | juanvaleriomayta/CAME_LOCAL | /CAME_LOCAL_GIT/CAME/Tables/AREA.sql | UTF-8 | 351 | 2.984375 | 3 | [] | no_license | CREATE TABLE came.area (
codare NUMBER NOT NULL,
nomare VARCHAR2(50 BYTE) NOT NULL,
abrare VARCHAR2(20 BYTE) NOT NULL,
CONSTRAINT area_pk PRIMARY KEY (codare)
);
COMMENT ON COLUMN came.area.codare IS 'Código autogenerado';
COMMENT ON COLUMN came.area.nomare IS 'Nombre del área';
COMMENT ON COLUMN came.area.abra... | true |
5689dead098f41d2731128ddfea53297bca27b7e | SQL | g-grace/itc240-fl15-retro | /cookies-11122015.sql | UTF-8 | 1,234 | 2.78125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.10.4
-- http://www.phpmyadmin.net
--
-- Host: mysql.itc240grace.com
-- Generation Time: Nov 16, 2015 at 03:03 PM
-- Server version: 5.6.25
-- PHP Version: 5.6.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET ... | true |
717320c26038f1ad2ef05a96faf71df35bcc24f1 | SQL | ophelien/Crazy_Charlie_Day | /sql.sql | UTF-8 | 3,096 | 3.109375 | 3 | [] | no_license |
/*!40101 SET NAMES utf8 */;
CREATE TABLE IF NOT EXISTS `logement` (
`idLogement` int(11) NOT NULL AUTO_INCREMENT,
`places` int(11) NOT NULL,
PRIMARY KEY (`idLogement`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;
CREATE TABLE IF NOT EXISTS `user` (
`email` varchar(128) CHARACTER SET utf8 COLLA... | true |
8561cc4d75af3bdfa0aff9a9078e38b140fb99e7 | SQL | Ariannatopbjerg/Pewlett-Hackard-Analysis | /Queries.sql | UTF-8 | 768 | 4.5 | 4 | [] | no_license | -- Employees for potential retirement/retired
select em.emp_no,
em.first_name,
em.last_name,
ti.title,
ti.from_date,
ti.to_date
--into deliverable_1
from employees as em
left join titles as ti
on em.emp_no = ti.emp_no
where (em.birth_date between '1952-01-01' and '1955-12-31')
order by em.emp_no;
-- Use Dict... | true |
43a32b4c228da5ee61a234dcff6e60ac42498e0d | SQL | c-bharadwaj/MySQL-BI-Analytics-Practice-and-Projects | /Analysis Practice Scripts/49. ASSIGNMENT Analyzing Conversion Funnel Tests.sql | UTF-8 | 1,792 | 4.375 | 4 | [] | no_license | -- 1. See whether /billing-2 is doing any better than /billing
-- 2. What % of sessions on those pages end up placing an order - (all traffic)
-- 3. Date request received - '2012-11-10'
-- first, find the starting point to frame the analysis:
SELECT
MIN(website_pageviews.website_pageview_id) AS first_pv_id
FROM webs... | true |
daa0b90c1c53d3d99b8c4dfa46325a628fd8b1f7 | SQL | cybergoatpsyops/dbs201 | /Chap7/Chap7.sql | UTF-8 | 1,787 | 3.25 | 3 | [] | no_license | -- CHAPTER 7 pg 254
/*
Please look at word document sent with sql script for descriptions
*/
-- Every department will have their own role that will be assigned
-- to all employees in that department
-- Criminal Records role creation
CREATE ROLE criminal_records;
GRANT SELECT, INSERT, UPDATE
ON crim... | true |
3660121ab912a9269278f0fb8d8ffeb87df0d12d | SQL | srepuh/WTDvorana | /wt_novosti.sql | UTF-8 | 3,106 | 3.140625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: wt
-- ------------------------------------------------------
-- Server version 5.7.12-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40... | true |
5abc2975d3497a523e02d92201b40a108bbe0789 | SQL | SimmonsCS28/soccer-project | /sql/procedures/forms/BY_TEAM_STATS.sql | UTF-8 | 4,342 | 4.0625 | 4 | [] | no_license | DROP PROCEDURE IF EXISTS findClubByStats;
DELIMITER $$
CREATE PROCEDURE findClubByStats(goalsChoice INT(1), discChoice INT(1), xpChoice INT(1))
BEGIN
DROP TABLE IF EXISTS ClubCount;
CREATE TEMPORARY TABLE ClubCount(
club VARCHAR(30)
);
#No preferences selected
IF goalsChoice = 0 AND disc... | true |
3a0a22c40643f5e4dac7b353ee8d234b24fb1658 | SQL | akurhanovich/LogisticSystem | /LogisticSystemAPI/src/main/resources/hsqldb.sql | UTF-8 | 5,315 | 3.59375 | 4 | [] | no_license | DROP TABLE IF EXISTS Purchase;
DROP TABLE IF EXISTS Buy;
DROP TABLE IF EXISTS Supply;
DROP TABLE IF EXISTS m2m_goods_address;
DROP TABLE IF EXISTS Goods;
DROP TABLE IF EXISTS Supplier;
DROP TABLE IF EXISTS Address;
DROP TABLE IF EXISTS User;
DROP TABLE IF EXISTS Role;
CREATE TABLE Role (
idRole IDENTITY,
NameRol... | true |
607ae2ae2a25fb14321184e54e78cdce43ddac6c | SQL | Lucas-Wong99/LightBnb | /1_queries/5_all_reservations.sql | UTF-8 | 331 | 3.609375 | 4 | [] | no_license | SELECT reservations.*, properties.*, AVG(rating) AS average_rating
FROM reservations
JOIN property_reviews ON reservations.id = reservation_id
JOIN properties ON reservations.property_id = properties.id
WHERE end_date < now()::date
AND reservations.guest_id = 1
GROUP BY reservations.id, properties.id
ORDER BY start_dat... | true |
5b2f8e09f5ed59dac3c1b2572cecfe3ff263d232 | SQL | jew2222/jspST | /lec12/WebContent/w11Script.sql | UHC | 519 | 3 | 3 | [] | no_license | --<ScriptOptions statementTerminator=";"/>
create database lecdb;
--drop database lecdb;
--drop table ȸ;
create table ȸ(
ȸ varchar (20) NOT NULL,
ȸ_ varchar(20) NULL,
ǥ varchar(20) NULL,
о varchar(20) NULL,
int NULL,
int NULL,
äԸ int NULL,
primary key (ȸ)
);
--insert into 'ȸ','ȸ','ǥ' value... | true |
2f13257bd08eaf182bb0e84b19a7a5bdb31ad380 | SQL | radtek/Scripts | /ash_wait_user.sql | UTF-8 | 387 | 3.46875 | 3 | [] | no_license | select sesion.sid,
sesion.username,
sum(active_session_history.wait_time +
active_session_history.time_waited) ttl_wait_time
from v$active_session_history active_session_history,
v$session sesion
where active_session_history.sample_time between sysdate - 60/2880 and sysdate
and active_session_history.session... | true |
4d1a6f898a4a2bdeeb8f1b5d7375f29ea34d3871 | SQL | sanchez-Isaac/Node-final | /sql/db.sql | UTF-8 | 2,199 | 3.46875 | 3 | [] | no_license | CREATE TABLE customers (
customer_id SERIAL NOT NULL,
first_name VARCHAR(250),
last_name VARCHAR(250),
credentials_id int NOT NULL,
rentals_id int,
address_id int NOT NULL,
PRIMARY KEY ("customer_id")
);
CREATE INDEX "FK" ON "customers" ("credentials_id", "rentals_id",
"address_id");
CREATE TABLE credentials (
credenti... | true |
1fc50ecbaf963afa3317b7ab7f066a1fa8af30ae | SQL | Broadstrokes/cs150A | /A06_sajjad.sql | UTF-8 | 3,414 | 4.3125 | 4 | [] | no_license | /* */
/*
oe_orderHeaders
cust_customers
customer_id, customer_name_last customer_name_first order_date, order_id
*/
/*
TASK 01
Create the view you will use in the rest of the assignment. Use the fewest table as possible in the view. Use the view name: oeOrdersPriorYear
*/
select
C.customer... | true |
f451e0e41d4bbdbbbe8d0a7cc659d9585c06453e | SQL | ptchankue/cmsMagmaProject | /src/main/resources/data.sql | UTF-8 | 2,967 | 3.515625 | 4 | [] | no_license | INSERT INTO PERSON(name,message) SELECT 'Pat','Hey this is Pat' WHERE NOT EXISTS (SELECT name FROM PERSON WHERE name='Pat');
INSERT INTO PERSON(name,message) SELECT 'Joe','Hey this is Joe' WHERE NOT EXISTS (SELECT name FROM PERSON WHERE name='Joe');
--Default User
INSERT INTO PERSON(name,firstname,lastname,aboutme,emai... | true |
723703b9e227b06eca3dd7e40fcb2bd5ddf0f20c | SQL | freshp/typo3_schedulertask_add-multiple-language | /ext_tables.sql | UTF-8 | 2,927 | 3.03125 | 3 | [] | no_license | #
# Table structure for table 'tx_typo3schedulertaskaddmultiplelanguage_domain_model_location'
#
CREATE TABLE tx_typo3schedulertaskaddmultiplelanguage_domain_model_location (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
api_id varchar(255) DEFAULT '' NOT NULL,
address varchar(255) DEFAU... | true |
6328158063540e4c285d89ce79e5f61ac8e8b0ac | SQL | andrewroko763/Database-Management | /Lab6.sql | UTF-8 | 2,408 | 4.5 | 4 | [] | no_license | --Andrew Rokoszak
--Lab 6- Interesting and Painful Queries
--1-display name and city of customers who live in any city that make the most different products
select customers.name, products.city
from customers, products
where customers.city = products.city
AND products.city in (select city
from products
group b... | true |
2968e0bf0d3d1aecf02dc5a07f791eba9f68bbf3 | SQL | yangboz/bearded-shame | /assets/翻译部统计报表/报表脚本/procedure.sql | GB18030 | 18,707 | 3.703125 | 4 | [
"MIT"
] | permissive | CREATE OR REPLACE PROCEDURE get_branch_summary(v_beginDate in Date, v_endDate in Date) as
begin
DECLARE type curtyp is ref cursor;
writeProjectCur curtyp;
interpretProjectCur curtyp;
companyIncomeCur curtyp;
companyExpenditureCur curtyp;
companyTotalIncomeCur curtyp;
companyTotalExpenditur... | true |
359538fc8d70c9d3c963d8e84bbddc8f7a972bb4 | SQL | XianFeng-GitHubPortfolio/SQLZoo | /3b. SELECT from NOBEL quiz.sql | UTF-8 | 1,888 | 4.40625 | 4 | [] | no_license | -- 1. Pick the code which shows the name of winner's names beginning with C and ending in n.
SELECT winner
FROM nobel
WHERE winner LIKE 'C%' AND winner LIKE '%n';
-- 2. Select the code that shows how many Chemistry awards were given between 1950 and 1960.
SELECT COUNT(subject) FROM nobel
WHERE subject = 'Chemistry... | true |
68e20283024dfef79c455b5efc7ee63909b369bf | SQL | javix64/1DAWBBDD | /Recuperacion1Trimestre/Ejercicio1.sql | UTF-8 | 1,074 | 3.25 | 3 | [] | no_license | drop database if exists ejercicio1;
CREATE database ejercicio1;
use ejercicio1;
create table autor(
cod_autor int primary key,
nombre varchar (50)
);
create table libro(
cod_libro int primary key,
cod_autor int,
titulo varchar (50),
año date,
foreign key(cod_autor) references autor(cod_autor)
);
create ta... | true |
0abae4fb297c7adfeae3f1693f757cc55bad4112 | SQL | sahilde3p/Timesheet | /SQL Scripts/migration_script.sql | UTF-8 | 3,039 | 3.6875 | 4 | [] | no_license | -- ----------------------------------------------------------------------------
-- MySQL Workbench Migration
-- Migrated Schemata: timesheet
-- Source Schemata: timesheet
-- Created: Wed Jan 30 17:01:14 2019
-- Workbench Version: 8.0.13
-- ----------------------------------------------------------------------------
SE... | true |
e1feb2e362f74a0c5aa2b8f5d0b97a795b1a53ec | SQL | aakash113/Jewellery-shopping-system | /abhushan.sql/abhushan.sql | UTF-8 | 4,702 | 2.984375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 17, 2019 at 11:45 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
6d51512114dfa373e67381a461a04565b3a87ae6 | SQL | hharnack/CalgaryHacks2020 | /LevelUp/build/web/WEB-INF/classes/databases/levelup.sql | UTF-8 | 1,491 | 3.8125 | 4 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: 806547
* Created: Feb 16, 2020
*/
DROP DATABASE if exists levelup;
CREATE DATABASE levelup;
USE levelup;
CREATE T... | true |
5a57ba5ddb4531222d3337872ab508c180af4b9f | SQL | joaquinipar/TP_GDD | /Migracion GDD.sql | UTF-8 | 14,092 | 3.359375 | 3 | [] | no_license |
/* create */ CREATE procedure migrar_datos
as
begin
/*
* HACER TRUNCATE DE TODAS LAS TABLAS, ASI SI TIRO EL PROCEDURE OTRA VEZ SE BORRA TODO
*
RECORDATORIO: AGREGAR COMPRA_ID A COMPRA ACCESORIO (DER)
RECORDATORIO: PASAR TABLA TEMPORAL A VISTA
RECORDATORIO: AGREGAR TRIGGER PARA VERIFICA... | true |
362deef34a20944aa3d6a08ed121209297bc073c | SQL | zhenligod/flink-demo | /flink-hudi-test/src/main/resources/test.sql | UTF-8 | 1,805 | 3.671875 | 4 | [
"MIT"
] | permissive | --sql.path file:///E:/github/flink-demo/flink-hudi-test/src/main/resources/test.sql
SET table.exec.mini-batch.enabled=true;
SET table.exec.mini-batch.allow-latency=5 s;
SET table.exec.mini-batch.size=5000;
SET table.exec.resource.default-parallelism=1;
SET table.local-time-zone=Asia/Shanghai;
-- SET table.exec.source.i... | true |
e63270e28803f5742cbf960d00b1dc7081f818ed | SQL | coderGhast/PistesAndLifts-SQLDatabase | /SQL/insert_sample.sql | UTF-8 | 5,771 | 3.671875 | 4 | [] | no_license | /*
CS27020 Pistes and Lifts Assignment
PostgreSQL commands for inserting sample data into the database.
Author: James Euesden (jee22@aber.ac.uk)
Date: 20/2/14
*/
-- For Sample Testing purposes, DELETE all current data
DELETE FROM connections CASCADE;
DELETE FROM piste CASCADE;
DELETE FROM lift CASCADE;
ALTER SEQUE... | true |
d48e2a2d773f56460315a300e166dfbcbae304cd | SQL | pmjobsearch00/TransactionBanking | /src/main/resources/DataBase/schema.sql | UTF-8 | 562 | 3.828125 | 4 | [] | no_license |
DROP TABLE IF EXISTS ACCOUNTS;
DROP TABLE IF EXISTS TRANSACTIONS;
CREATE TABLE ACCOUNTS (
ID BIGSERIAL NOT NULL AUTO_INCREMENT CONSTRAINT PK_ACCOUNTS PRIMARY KEY,
BALANCE NUMBER (14,4) NOT NULL CHECK (BALANCE >= 0),
CURRENCY CHAR (3) NOT NULL,
CREATED_AT DATE
);
CREATE TABLE TRANSACTIONS (
ID BIGSERIAL NOT NUL... | true |
4b26e56b36e41cfda0b68f138f4d7d45800b27c5 | SQL | sebasberra/shu_bases | /scripts/personas/personas/migra_personas_turnos_canada_gomez.sql | ISO-8859-1 | 13,122 | 3.421875 | 3 | [] | no_license | /* inserta en "origen_info" */
INSERT IGNORE INTO origen_info(id_origen_info, origen_info) VALUES (15,"HOSP SAN JOSE - CAADA DE GOMEZ");
/* inserta en "sistemas_propietarios" */
INSERT IGNORE INTO sistemas_propietarios
(id_sistema_propietario, nom_corto, nom_largo, observacion)
VALUES
(8,
'HOSP SAN JO... | true |
0cd1c13d8b73df4adad32dfcafe8a650851b685a | SQL | webster91/db-2021-06 | /homework4/index.sql | UTF-8 | 3,187 | 3.671875 | 4 | [] | no_license | --- создание ролей
create role administrator login createdb password 'administrator';
create role support login password 'support';
-- создание табличных пространств
CREATE TABLESPACE ts_type OWNER administrator LOCATION 'E:/db/1';
CREATE TABLESPACE ts_entity OWNER administrator LOCATION 'E:/db/2';
--- создание базы
... | true |
45b2dcd398b5323327c3c1d88ec355fe2e62783a | SQL | kgidion1/ucmp_site | /ucmp2017.sql | UTF-8 | 14,736 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jul 26, 2017 at 03:18 AM
-- Server version: 5.6.35-cll-lve
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... | true |
5579ebbc25c9f85c4cb99f1defd2d9a1bfcc348b | SQL | chubozeko/CHAP | /src/app/login/chap_ums/DBSQL/chapdatabase.sql | UTF-8 | 4,751 | 3.15625 | 3 | [] | no_license |
CREATE DATABASE IF NOT EXISTS `chap_logindb` DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci;
USE `chap_logindb`;
DROP TABLE IF EXISTS `admintb`;
CREATE TABLE IF NOT EXISTS `admintb` (
`id` int(5) NOT NULL,
`adname` varchar(20) COLLATE utf8_turkish_ci NOT NULL,
`adsurname` varchar(20) COLLATE utf8_turkish... | true |
11f27e80aaac29580b864883e82323e40d53e8d0 | SQL | andydavistx/bamazon | /schema.sql | UTF-8 | 242 | 3.0625 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazon_db;
CREATE DATABASE bamazon_db;
use bamazon_db;
CREATE TABLE Products (
id INTEGER AUTO_INCREMENT NOT NULL,
description VARCHAR(30) NOT NULL,
price DECIMAL(10,2),
name VARCHAR(30),
PRIMARY KEY(id)
); | true |
67c132b514a009a27f05d9b88cde07e11e672c63 | SQL | eddelbuettel/data-examples | /sql/joinExample3.sql | UTF-8 | 239 | 2.875 | 3 | [] | no_license | -- !preview conn=DBI::dbConnect(RSQLite::SQLite(), "tutorial.sqlite")
SELECT basket_name, fruit_name
FROM fruits f
FULL OUTER JOIN baskets b ON b.basket_id = f.basket_id;
-- right and full outer join not currently supported in SQLite :-/
| true |
a72d32088060e0063557861d4992b353f05526d7 | SQL | phjrdla/scripts | /CheckMouvementsFinanciers.sql | UTF-8 | 1,298 | 4.03125 | 4 | [
"LicenseRef-scancode-public-domain"
] | permissive | SET FEEDBACK OFF
SET SERVEROUTPUT ON
DECLARE
cnt NUMBER(9,0);
v_code NUMBER;
v_errm VARCHAR2(64);
BEGIN
SELECT
COUNT(DISTINCT s.oid)
INTO cnt
FROM
movement m
INNER JOIN accounting_transaction at
ON m.accounting_transaction_oid = at.oid... | true |
6c8f74a1439dbabdd7cc2f390a603802d532ebbc | SQL | postgres/postgres | /contrib/pageinspect/pageinspect--1.11--1.12.sql | UTF-8 | 1,165 | 3.03125 | 3 | [
"PostgreSQL"
] | permissive | /* contrib/pageinspect/pageinspect--1.11--1.12.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.12'" to load this file. \quit
--
-- bt_multi_page_stats()
--
CREATE FUNCTION bt_multi_page_stats(IN relname text, IN blkno int8, IN blk_co... | true |
a1f98b540c55d4fb82ef7ee9d6802eef37057447 | SQL | jonathan-vallet/craftanat | /sql/component.sql | UTF-8 | 1,102 | 2.8125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50523
Source Host : localhost:3306
Source Database : osteo
Target Server Type : MYSQL
Target Server Version : 50523
File Encoding : 65001
Date: 2014-05-08 18:54:16
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
264d9222d5e0326013580d8705042adb77a3535f | SQL | edumeirelesp/sgdb-practice | /sgdb/definicao.sql | UTF-8 | 4,174 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | /*
Arquivo: definicao.sql
*/
-- Inicio Criação das Tabelas --
mysql> create table comclien(
n_numeclien int not null auto_increment,
c_codiclien varchar(10),
c_nomeclien varchar(50),
c_razaclien varchar(50),
d_dataclien date,
c_cnpjclien varchar(15),
c_foneclien varchar(15),
c_cidaclien varc... | true |
b8eb7c14a47530110ee3a5529c1e205df2496a9f | SQL | Jean-Roc/sia_sql | /admin/maintenance/index_mesure_usage.sql | UTF-8 | 3,367 | 4.15625 | 4 | [] | no_license | CREATE SCHEMA maintenance
AUTHORIZATION postgres;
GRANT ALL ON SCHEMA maintenance TO postgres;
GRANT ALL ON SCHEMA maintenance TO "www-data";
GRANT ALL ON SCHEMA maintenance TO jrmorreale;
GRANT USAGE ON SCHEMA maintenance TO admin_sia_minimun;
ALTER DEFAULT PRIVILEGES IN SCHEMA maintenance
GRANT INSERT, SELEC... | true |
667d39d0d97bdfc708a678d62ea2bc1529d5f9ae | SQL | supertrip86/DATABASE-California_Traffic_Collision | /MySQL/MySQL Optimized Queries/B2.sql | UTF-8 | 933 | 4.0625 | 4 | [] | no_license | /*
2. IMPROVED VERSION - Create a table to show the number of collisions, deaths and injuries with
their respected percentages for everyday in the week.
*/
SELECT * FROM countby_day_month;
SELECT
MONTHNAME(collision_date) AS Month_Name,
DAYNAME(collision_date) AS Weekday,
COUNT(*) AS Collisions_Cou... | true |
2f55fca1481a05f9a2a9d2967c5c806d5c793fde | SQL | kingnobro/zoo-database | /sql/create_table/create_zone.mysql | UTF-8 | 319 | 2.515625 | 3 | [] | no_license | drop table if exists `zone`;
create table `zone`
(
`zone_id` int NOT NULL AUTO_INCREMENT,
`geo_position` varchar(255) NOT NULL,
`zoneName` varchar(255) not null,
primary key (`zone_id`)
) engine = InnoDB
AUTO_INCREMENT = 28
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; | true |
4ee9627aecc5a98b3e8e6926bdce0224ecfd38f0 | SQL | anjali7604/delta | /deltanew.sql | UTF-8 | 2,073 | 2.90625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 16, 2015 at 11:04 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
55c46822db270ce75d6d83f3f09db55345d1525c | SQL | j40903272/DBMS2019 | /hw2/hw2_example/example.sql | UTF-8 | 700 | 3.640625 | 4 | [] | no_license | /* create and use database */
CREATE DATABASE MovieDB;
USE MovieDB;
/* info */
CREATE TABLE self (
StuID varchar(10) NOT NULL,
Department varchar(10) NOT NULL,
SchoolYear int DEFAULT 1,
Name varchar(10) NOT NULL,
PRIMARY KEY (StuID)
);
INSERT INTO self
VALUES ('r07000000', '電機所', 1, '大中天');
SELEC... | true |
34013d51f78b4061b8c5f78d0015713863efd8c1 | SQL | pje3294/JSP_final_Project-Community- | /JSP_Final_AddOn_Community/boardProject.sql | UHC | 28,914 | 3.78125 | 4 | [] | no_license | DROP TABLE users cascade constraint;
DROP TABLE board cascade constraint;
DROP TABLE boardreply cascade constraint;
DROP TABLE test cascade constraint;
DROP TABLE testreply cascade constraint;
SELECT * FROM users;
SELECT * FROM board;
SELECT * FROM boardreply;
SELECT * FROM test;
SELECT * FROM testreply;
... | true |
304be05d465e50dd6e6a496925716a182b7c2fc5 | SQL | PivoGuedes/testeDevOps | /testeDevOps/Dados/Stored Procedures/proc_EnriqueceCadastro_Simulador.sql | UTF-8 | 2,989 | 3.859375 | 4 | [] | no_license | CREATE PROCEDURE [Dados].[proc_EnriqueceCadastro_Simulador]
AS
/***************************************** INSERE CPFCNPJ DAS SIMULAÇÕES DE AUTO *************************************************************/
INSERT INTO Dados.ContatoPessoa (CPFCNPJ)
SELECT DISTINCT SA.CPFCNPJ
FROM Dados.SimuladorAuto AS SA
OUTER ... | true |
a150fb51592381d25118a4ffd238b065d43215e9 | SQL | waffle-iron/mueveme-wasby | /db/mueveme.sql | UTF-8 | 1,673 | 3.6875 | 4 | [
"BSD-3-Clause"
] | permissive | ------------------------------
-- Archivo de base de datos --
------------------------------
DROP TABLE IF EXISTS usuarios CASCADE;
CREATE TABLE usuarios
(
id bigserial PRIMARY KEY
,nombre varchar(255) NOT NULL UNIQUE
,password varchar(255) NOT NULL
,email varchar(255) NOT NULL
,created_at timestamp(... | true |
bb591c8e43205d0236a809656c74a4acb53bf480 | SQL | tjakopec/KulenDayz2014 | /PHP_KulenDayz2014/skripta.sql | UTF-8 | 1,659 | 3.765625 | 4 | [] | no_license | DROP DATABASE IF EXISTS kulendayz2014;
CREATE DATABASE kulendayz2014 CHARACTER SET UTF8;
USE kulendayz2014;
CREATE TABLE IF NOT EXISTS kulendayz2014_interes (
sifra INT NOT NULL AUTO_INCREMENT, naziv VARCHAR(45) NOT NULL,
PRIMARY KEY (sifra))ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS kulendayz2014_skola (
s... | true |
3de90ed1835aecd926c3399dda76c1a7ef8cea65 | SQL | timitaiwo/SQL-practice | /Assignment_2.sql | UTF-8 | 584 | 4.15625 | 4 | [] | no_license | /* 1. Write a query that lists the schools in alphabetical order along
with teachers ordered by last name A–Z */
SELECT school, last_name, first_name
FROM teachers
ORDER BY school, last_name;
/* 2. Write a query that finds the one teacher whose first name starts with the
letter S and who earns more than $40,000 */
S... | true |
59559fca7ebe2d5e2940d0f0d1fe6f603bb28b8d | SQL | ecofunds/ecofunds | /misc/alter_bad_pks.sql | UTF-8 | 621 | 2.8125 | 3 | [] | no_license | ALTER TABLE `ecofunds`.`ecofunds_entity_locations` ADD COLUMN `id` BIGINT(20) NOT NULL AUTO_INCREMENT AFTER `entity_id`
, ADD UNIQUE KEY (`id`) ;
ALTER TABLE `ecofunds`.`ecofunds_entity_attachments` ADD COLUMN `id` BIGINT(20) NOT NULL AUTO_INCREMENT AFTER `entity_id`
, ADD UNIQUE KEY (`id`) ;
ALTER TABLE `ecofund... | true |
2aac5cb899e53577c9982a669d715ad186d68b3f | SQL | Vascomfortuna/Oficina-online | /views_v2.sql | UTF-8 | 665 | 3.453125 | 3 | [] | no_license | create or replace view SOMALITROS as
SELECT v.IDVEICULO, sum(a.LITROS) litros
from BD_VEICULOS v full JOIN BD_ABASTECIMENTOS a on v.IDVEICULO = a.VEICULOS_IDVEICULO
group by v.IDVEICULO with READ ONLY ;
create or replace view VEICULOSPORCLIENTES AS
select v.MARCA,v.MODELO,v.MATRICULA,v.CLIENTES_IDCLIENTE,s.litros
fro... | true |
88c3389e6f13f2c0b41d2b8437c58240ff6b6438 | SQL | CrazzyPanda/moviestore | /movierec.sql | UTF-8 | 46,277 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 19, 2019 at 12:44 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 |
2fcaf48ffe93a45e1240ac2a7dc8820ee33f8f7b | SQL | leebrian/ebola | /sql/query-cases-that-are-contact.sql | UTF-8 | 1,250 | 4.03125 | 4 | [
"LicenseRef-scancode-philippe-de-muyter",
"LicenseRef-scancode-us-govt-public-domain",
"Apache-2.0"
] | permissive | /*
epi curve from sitrep recreated
epi week #1 for 2014 starts on 12/30/2013, but use 12/28/2013 because of sql not liking Monday start of week
epi week #1 for 2015 starts on 12/29/2014, but use 12/28/2014 because of sql not liking Monday start of week
*/
select (datediff(week, '12/28/2013',dateadd(dd,-1,dateonset))) a... | true |
faedb3a4a054edc0f0b9d80a4813200c2cfa8a10 | SQL | JamesEntrustDatacard/IdentityGuardSqlSchema | /postgresql_v110_to_v120_upgrade.sql | UTF-8 | 478 | 2.875 | 3 | [] | no_license | --
-- Copyright 2004-2017 Entrust. All rights reserved.
--
-- This file defines the database schema used to upgrade Entrust IdentityGuard
-- from 11.0 to 12.0
CREATE TABLE anonymous_challenges
(
anon_challenge_data bytea,
create_date timestamp without time zone NOT NULL,
sernum numeric(12) NO... | true |
5a7fe2427778e2654d478079b640b1b325642b61 | SQL | YurySS/oracle_dbd_plsql_basic | /2. blocks/2. anonym_blocks_examples.sql | UTF-8 | 1,079 | 3.234375 | 3 | [] | no_license | /*
Курс: PL/SQL.Basic
Автор: Кивилев Д.С. (https://t.me/oracle_dbd, https://oracle-dbd.ru, https://www.youtube.com/c/OracleDBD)
Лекция 2. Блоки
Описание скрипта: примеры анонимных блоков с разными частями
*/
---- Пример 1. Анонимный блок с обязательным исполняемым разделом
begin
dbms_output.put_line ('H... | true |
d6e14a5a84f90e7196fff9f3ba8c6c30008f2134 | SQL | hashncrash/IS211_Assignment10 | /music.sql | UTF-8 | 585 | 2.921875 | 3 | [] | no_license | DROP TABLE IF EXISTS Artist;
DROP TABLE IF EXISTS Albums;
DROP TABLE IF EXISTS Songs;
CREATE TABLE Artist
(
artist_id int PRIMARY KEY,
artist varchar NOT NULL
);
CREATE TABLE Albums
(
album_id int PRIMARY KEY,
artist_id int NOT NULL REFERENCES Artist(artist_id)
album_title varchar NOT NULL
... | true |
2faf2fd9f37f6ae093520b5cc64f562fc5f1c3be | SQL | CasabacaBI/DWH_COMERCIAL | /TRAFICO/CRG_DIM_CONTACTO.sql | UTF-8 | 10,550 | 3.5 | 4 | [] | no_license | CREATE PROCEDURE `CRG_DIM_CONTACTO`(VAR_SCHEMA varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL) RETURNS void AS
/***********************************************************************************************************************
* Descripcion: Cargar Datos DIM_CONTACTO
* Version: 1.0.0
* Fecha... | true |
eb026454b4b911ae9c5f7e4f51daa61ad4fed8da | SQL | MrD0079/portal | /sql/svms_list.sql | UTF-8 | 1,021 | 2.84375 | 3 | [] | no_license | /* Formatted on 05/12/2014 12:32:22 (QP5 v5.227.12220.39724) */
SELECT tn, fio
FROM user_list
WHERE pos_id = 69
AND dpt_id = :dpt_id
AND ADD_MONTHS (TRUNC (NVL (datauvol, SYSDATE), 'mm'), +1) >=
TRUNC (SYSDATE, 'mm')
AND ( tn IN (SELECT slave
... | true |
21c565dfe892cebad4c4016e8caf87e7abcdc89c | SQL | am2woods/vitcal | /database/vitamins_food table.sql | UTF-8 | 2,939 | 3.078125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `vitamins` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `vitamins`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: localhost Database: vitamins
-- ------------------------------------------------------
-- Server version 5.6.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
e1cb60c6a5e1dad2dea5d0ca36653dc9dcc02894 | SQL | noorahmadll/WADProjectCookEatSleep | /FinalDesign/dbStructure/cookeatsleep.sql | UTF-8 | 4,916 | 2.796875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 30, 2019 at 06:45 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
ff9b8feb0e138e2379cb65c7ad17807c32c6da35 | SQL | annamcooper/projects | /Exp/add ratings to social pressure mail.sql | UTF-8 | 1,818 | 3.046875 | 3 | [] | no_license | select
v.*
,case when general16 is not null then 'Y' else null end as general16
,case when general14 is not null then 'Y' else null end as general14
,case when general12 is not null then 'Y' else null end as general12
,case when general16 is null and general14 is null and general12 is null then '0'
when ((ge... | true |
45a0253966aec7a251c67f16b650019993fb1045 | SQL | Brytvenko/login-registr-mysql-jwt-listUser-test | /baza.sql | UTF-8 | 1,226 | 2.75 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Tue Oct 6 14:26:20 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... | true |
dfb5ab655790f9585b5eb979cf6f74f07662e19e | SQL | itsuki-n22/sql_puzzle | /puzzles/4.sql | UTF-8 | 1,767 | 4.34375 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS sql_puzzle;
use sql_puzzle;
DROP TABLE IF EXISTS Badges;
CREATE TABLE Badges
(badge_nbr INTEGER NOT NULL PRIMARY KEY,
emp_id INTEGER NOT NULL,
issued_date DATE NOT NULL,
badge_status CHAR(1) NOT NULL
CHECK (badge_status IN ('A', 'I'))
);
INSERT INTO Badges VALUES(100, 1, '2007-01-... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.