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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2b49449e094bd7481ff96a5b0e7cee259439bd21 | SQL | mkhoin/analyticstool | /part1/sql/week2_평일/SQL for PostgreSQL-2.sql | UTF-8 | 8,162 | 3.921875 | 4 | [] | no_license | -- ==================================================
-- SELECT
-- ==================================================
select all order_date from "order" order by 1;
select order_date from "order" order by 1;
select distinct order_date from "order" order by 1;
select * from "order";
select distinct order_date as ord_dt... | true |
be3327728fa30c95e03c65e3f915f3027c7924ff | SQL | suarezluis/DB_ClassRepo | /Labs/LuisFernandoSuarezHarasic_Lab7/LuisFernandoSuarezHarasic_Lab07.txt | UTF-8 | 4,984 | 4.53125 | 5 | [] | no_license | -- 1
-- (Traditional)
SELECT b.title,
p.contact,
p.phone
FROM books b,
publisher p
WHERE p.pubid = b.pubid;
-- (With JOIN)
SELECT b.title,
p.contact,
p.phone
FROM books b
join publisher p USING(pubid);
-- 2
-- (Traditional)
SELECT c.firstname,
c.las... | true |
9562598bea32bb540c077e24a0f60c18b4188ced | SQL | mohitnagarkotibca/Concepts | /SQl/day4.sql | UTF-8 | 2,818 | 4.0625 | 4 | [] | no_license | select * from indian_food;
-- Ingredients with longest and shortest names
(
select name,length(name) from indian_food order by length(name) asc limit 1
)
union(
select name,length(name) from indian_food order by length(name) desc limit 1
);
SELECT Surname
FROM Contacts
WHERE Surname LIKE 'Mc%';
/*
Match exp... | true |
b63872505ce31bd7f78700f7453b27932c7aa9fa | SQL | Valadim/217447-yeticave-10 | /queries.sql | UTF-8 | 2,568 | 3.78125 | 4 | [] | no_license | -- Вставка пользователей
INSERT INTO `users` (`email`, `name`, `password`)
VALUES ('tirol@ya.ru', 'Элеанора Тирл', '123456789'),
('lanister@mail.ru', 'Тайвин Ланистер', '123456789');
-- Вставка категорий
INSERT INTO `categories` (`name`, `code`)
VALUES ('Доски и лыжи', 'boards'),
('Крепления', 'attachment'),
('Ботинк... | true |
3e3a470db712c00d0e60baf445984e740a1cfea5 | SQL | venicecode/OfficeLeaderboard | /server/db/init_ol.sql | UTF-8 | 1,617 | 3.828125 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS "companies" (
"_id" serial NOT NULL,
"name" varchar(50) NOT NULL UNIQUE,
"imgurl" varchar(255),
CONSTRAINT "companies_pk" PRIMARY KEY ("_id")
) WITH (
OIDS=FALSE
);
CREATE TABLE IF NOT EXISTS "offices" (
"_id" serial NOT NULL,
"name" varchar(50) NOT NULL,
"companyid" integer NOT NUL... | true |
9002842e481adfcfb44cd1d07595e29b9120d7ca | SQL | Blackmorse/control-systems-scala | /conf/evolutions/default/4.sql | UTF-8 | 392 | 2.828125 | 3 | [] | no_license | # --- !Ups
create table `document_parameters` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`document_id` INT NOT NULL,
`parameter_id` INT NOT NULL,
`parameter_value` text,
CONSTRAINT PRIMARY KEY(`id`),
FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`),
FOREIGN KEY (`parameter_id`) REFERENC... | true |
9de12e11786c681ac249949a485aefe5d76947e3 | SQL | dconstancio/IBG2015 | /db/180515.sql/mydb_pergunta.sql | UTF-8 | 2,824 | 3.078125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.23, for Win32 (x86)
--
-- Host: localhost Database: mydb
-- ------------------------------------------------------
-- Server version 5.6.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 ... | true |
3bceea1c44a96c4b5c18f9717bf481d6a94b32bb | SQL | unhcr/PSR-Database | /SQL/LoadASR/LoadIDPStatistics.sql | UTF-8 | 9,739 | 3.40625 | 3 | [] | no_license | set serveroutput on size 1000000
declare
nSTG_ID P_BASE.tnSTG_ID;
nSTC_ID P_BASE.tnSTC_ID;
--
iCount1 pls_integer := 0;
iCount2 pls_integer := 0;
begin
P_UTILITY.START_MODULE('LoadIDPStatistics');
--
for rSTC in
(select STATSYEAR, START_DATE_YEAR, END_DATE_YEAR, START_DATE, END_DATE,
DST_CODE, DST... | true |
d73af8ad37c2cb78e0a19bd53406f5a748a68805 | SQL | rhelk/Tarkvaratehnika | /src/main/resources/schema.sql | UTF-8 | 1,346 | 4.03125 | 4 | [] | no_license | create sequence users_sequence start with 1;
create sequence property_sequence start with 1;
create sequence rent_sequence start with 1;
create table users (
user_id BIGINT NOT NULL PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
e... | true |
9720fad8396b8b6c766cccec1bbd7f247a73f249 | SQL | Zahidsqldba07/codefights-2 | /databases/timeRiverRevisited/importantEvents.mysql | UTF-8 | 1,318 | 4.5 | 4 | [] | no_license | /*
You're very busy and have a lot of important events coming up. In order to ensure that you don't forget any of these events, you have
decided to organize them.
The information about your events is stored in the table events, which has the structure:
id: unique event id;
name: the event name;
event_date: the e... | true |
0be4c0e1daba7b706d322cf2d4689b353f45df77 | SQL | jhonda15/deportech | /base_de_datos/deportes.sql | UTF-8 | 6,085 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 17-11-2019 a las 21:48:03
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
8a4c659ad4e76c6ef396b1115d1456b981cc9819 | SQL | debanjanroy96/Ecommerce-website | /ecommerce_website_admin.sql | UTF-8 | 1,802 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 01, 2021 at 09:05 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 |
a81754113b5393adc4648c04de20cd73274c917d | SQL | vladflore/spring-transactions-demo | /src/main/resources/schema-oracle.sql | UTF-8 | 260 | 2.9375 | 3 | [] | no_license | CREATE TABLE quantity
(
id NUMBER NOT NULL,
quantity_value NUMBER,
CONSTRAINT quantities_pk PRIMARY KEY (id) ENABLE
);
CREATE TABLE stock
(
id NUMBER NOT NULL,
stock_value NUMBER,
CONSTRAINT stock_pk PRIMARY KEY (id) ENABLE
); | true |
c2bffd0a63cf54924bfd60242a3328c10d7c25f4 | SQL | nuwan-github/student-management-system-springMVC | /studentManagentBackEnd/database.Queries.sql | UTF-8 | 656 | 3.390625 | 3 | [] | no_license | CREATE TABLE student(
id IDENTITY,
name VARCHAR(50),
address VARCHAR(255),
email VARCHAR(50),
phoneNumber VARCHAR(15),
CONSTRAINT pk_category_id PRIMARY KEY (id)
);
CREATE TABLE teacher(
id IDENTITY,
code VARCHAR(50),
name VARCHAR(50),
email VARCHAR(50),
education VARCHAR(50),
exprience_years INT,
depa... | true |
beef8d9e651dadf0a919dafb44ef0e2431452541 | SQL | REPTILEHAUS/reptilehaus-C-Sharp-MySQL-Insert | /database.sql | UTF-8 | 275 | 2.640625 | 3 | [] | no_license | CREATE DATABASE `mysql_csharp` default collate=utf8_general_ci;
use `mysql_csharp`;
CREATE TABLE `users`(
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(50),
`address` VARCHAR(100),
`loggedat` TIMESTAMP
)ENGINE=MyISAM default collate=utf8_general_ci; | true |
97f3dec6b4bb61052682999771d951e7b79adc41 | SQL | ninateng/blog-examples | /user-gen-vids/api/db/migrations/20210623024537_update_table_name/migration.sql | UTF-8 | 470 | 3.0625 | 3 | [
"MIT"
] | permissive | /*
Warnings:
- You are about to drop the `Properties` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "Properties";
-- CreateTable
CREATE TABLE "Property" (
"id" SERIAL NOT NULL,
"width" INTEGER NOT NULL,
"height" INTEGER NOT NULL,
"videoDuratio... | true |
b3994a49f70fd71cd814425fced6b7c561f9496e | SQL | x-insane/2017-php-blog | /sql/blog.sql | UTF-8 | 8,951 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2017-03-19 12:42:07
-- 服务器版本: 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 */;
/*!40101 SET... | true |
ec590cf92b23f27662f2c6c0b691bf92c6493349 | SQL | delphi1977/NewDicomPACS | /Database/oracle/constraints/asu.tvvodpath_by_id.sql | UTF-8 | 210 | 2.875 | 3 | [] | no_license | ALTER TABLE ASU.TVVODPATH
DROP CONSTRAINT TVVODPATH_BY_ID
/
--
-- Non Foreign Key Constraints for Table TVVODPATH
--
ALTER TABLE ASU.TVVODPATH ADD (
CONSTRAINT TVVODPATH_BY_ID
PRIMARY KEY
(FK_ID))
/
| true |
52c8cad43cb71726527c348a747090121ccaded0 | SQL | TYPO3-svn-archive/nc_cu3er | /ext_tables.sql | UTF-8 | 2,888 | 2.703125 | 3 | [] | no_license | #
# Table structure for table 'tx_nccu3er_slides'
#
CREATE TABLE tx_nccu3er_slides (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3v... | true |
1f676ab0b05a9825e61cbaec883a12fd9e7dbabe | SQL | CoopNich/SQL_Mastery | /book_2/UpdateDelete.sql | UTF-8 | 972 | 4.03125 | 4 | [] | no_license | -- Rheta Raymen an employee of Carnival has asked to be transferred to a different dealership location.
-- She is currently at dealership 751.
-- She would like to work at dealership 20.
-- Update her record to reflect her transfer.
SELECT d.business_name dealership,
de.dealership_employee_id,
CONCAT(e.fir... | true |
b4903647a0f9ada243664d6e27d4b7428683c919 | SQL | IMaratD/jdbc-PetLife | /src/main/resources/data.sql | UTF-8 | 1,620 | 2.859375 | 3 | [] | no_license | INSERT INTO classOfAnimals (id, class)
VALUES (1, 'Invertebrates'),
(2, 'Fish'),
(3, 'Amphibians'),
(4, 'Reptiles'),
(5, 'Birds'),
(6, 'Mammals');
INSERT INTO typeOfAnimals (id, class_id, type, squad)
VALUES (1, 6, 'Dogs', 'Carnivores'),
(2, 6, 'Cats', 'Carnivores');
INSERT I... | true |
3a82857cc79341fd1d4ebd3878b1a0ab72b49496 | SQL | VynnykVV/TestProject | /Hybris Internship Test Task/data/db.sql | UTF-8 | 2,155 | 4.40625 | 4 | [] | no_license | DROP TABLE IF EXISTS products CASCADE;
DROP TABLE IF EXISTS orders CASCADE;
DROP TABLE IF EXISTS order_items CASCADE;
CREATE TABLE IF NOT EXISTS products (
id INT NOT NULL GENERATED BY DEFAULT AS IDENTITY(START WITH 1, INCREMENT BY 1),
name VARCHAR(45) not NULL,
price INT not NULL,
status VARCHAR(45)... | true |
aef9a420ba86f0adf5df1fd4b72a580329b7fce0 | SQL | Azzaiel/LibrarySystem | /library db dump/library_system_categories.sql | UTF-8 | 2,686 | 3.015625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `library_system` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `library_system`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: library_system
-- ------------------------------------------------------
-- Server version 5.6.12-log
/*!40101 SET @OLD... | true |
7e8c5b707dff0aff21e8b98c8b9018c71422ed5b | SQL | Deploy-Software/Project | /server/migrations/20210113203452_projects.sql | UTF-8 | 215 | 2.703125 | 3 | [
"MIT"
] | permissive | CREATE TABLE projects (
id serial PRIMARY KEY,
organization_id integer NOT NULL REFERENCES organizations (id),
name varchar(255) NOT NULL,
date timestamp with time zone NOT NULL DEFAULT now()
);
| true |
f8fc45f09a8db12504b023efc77fc60b199a6736 | SQL | ylrodriguez/USITP-JavaEE | /db_stpi.sql | UTF-8 | 14,148 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2016 at 07:00 PM
-- Server version: 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_CLI... | true |
46cc59def53b1976d71b1af25f91455c3a1c8946 | SQL | pache13/3ra-Entrega-Proyecto-TO-DO-LIST | /basenotas (1).sql | UTF-8 | 1,791 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 12-01-2018 a las 19:51:55
-- Versión del servidor: 5.5.24-log
-- Versión de PHP: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... | true |
5a55abeda7010dba733f8c80d28cca3af49ccf21 | SQL | maximuus/basesdatos2 | /Disparadores.sql | UTF-8 | 1,601 | 3.421875 | 3 | [] | no_license | CREATE TABLE REGISTRO(ID_REG INT,
NOMBRE VARCHAR2(40),
EMAIL VARCHAR2(40),
EDAD INT,
CONSTRAINT PK_ID_REG PRIMARY KEY (ID_REG));
CREATE TABLE REGISTRO_MAYORES(ID_REGMAYOR INT,
NOM... | true |
0abe446f6e9be60ae699eef86f6fe7724af65751 | SQL | johnnyeven/xgame-server-java | /data/pulse_db.sql | UTF-8 | 8,512 | 3.3125 | 3 | [] | no_license | 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='TRADITIONAL,ALLOW_INVALID_DATES';
DROP SCHEMA IF EXISTS `pulse_db_game` ;
CREATE SCHEMA IF NOT EXISTS `pulse_db_game` DEFAULT CHARACTER SET utf8 ... | true |
2155743513458dc3efe360aa5d710ea94efa984d | SQL | yukiyamamoto710/home-finder | /schema.sql | UTF-8 | 1,060 | 3.5625 | 4 | [] | no_license | DROP DATABASE IF EXISTS homes;
CREATE DATABASE homes;
USE homes;
CREATE TABLE homes (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
url VARCHAR(255),
price INT,
beds DECIMAL,
baths DECIMAL,
square_feet INT,
lot_size INTEGER,
year_built INT,
$_square_feet INT,
HOA INT,
sale_type VARCHAR(255),
... | true |
130e7f09ec68ba141f302b6c6d6350dd0ef708ab | SQL | eelkjaer/ChadChat | /src/main/resources/migrate/1.sql | UTF-8 | 797 | 2.921875 | 3 | [] | no_license | DROP TABLE IF EXISTS Channels;
CREATE TABLE Channels (
id int AUTO_INCREMENT,
channelName VARCHAR(255) NOT NULL,
timestamp TIMESTAMP NOT NULL default(NOW()),
PRIMARY KEY (id)
);
INSERT INTO Channels (channelName) VALUES ("Janus");
DROP TABLE IF EXISTS User;
CREATE TABLE User (
id int AUTO_INCREMEN... | true |
dda8864f0a1c0b09c5a51e701621b24987275c66 | SQL | GarrettYaworski/GY-Mowers | /db/get_daily_sales_after_eight.sql | UTF-8 | 251 | 3.71875 | 4 | [] | no_license | SELECT
to_char(o.order_date, 'Mon dd, yyyy'),
SUM(p.price)
FROM orders o
INNER JOIN products p
ON p.product_id = o.product_id
WHERE
o.order_date >= current_date - INTERVAL ''$1'DAY'
GROUP BY
o.order_date
ORDER BY order_date DESC; | true |
1f5c62c591d74ae9180851e1168187a625d7bca9 | SQL | mannyrobin/datafuel_saas_node | /database scripts/UserLicence_Rate_Id_fkey.sql | UTF-8 | 223 | 3.265625 | 3 | [] | no_license | ALTER TABLE public."UserLicense"
ADD COLUMN "Rate_Id" bigint;
ALTER TABLE public."UserLicense"
ADD CONSTRAINT "UserLicence_Rate_Id_fkey" FOREIGN KEY ("Rate_Id")
REFERENCES public."Rates" ("Id") MATCH SIMPLE; | true |
f19638a103a5cfc553df948d74c09a1db631e569 | SQL | BiserVStoev/Database-Fundamentals--SQL | /05. TableRelations/11. EmployeesWithoutProjects.sql | UTF-8 | 352 | 3.984375 | 4 | [] | no_license | SELECT TOP 3 e.EmployeeID, e.FirstName
FROM Employees AS e
WHERE e.EmployeeID NOT IN (SELECT ep.EmployeeID FROM EmployeesProjects as ep)
ORDER BY e.EmployeeID
/** OTHER WAY
SELECT TOP 3 e.EmployeeID, e.FirstName FROM Employees as e
LEFT JOIN EmployeesProjects as ep
ON e.EmployeeID = ep.EmployeeID
WHERE ep.ProjectID I... | true |
88f154a5ee2a92cf58885f922cc90b7f15a43bca | SQL | JunWei96/CS5322_Project_VPD | /tests/jobs_sg_hr_xerxes.sql | UTF-8 | 1,689 | 3.890625 | 4 | [] | no_license | -- This test file is for the user XERXES with password of XERXES.
-- XERXES is a HR stationed in Singapore.
CONNECT XERXES/XERXES;
SET ROLE NON_SYSTEM, HR;
-- Expected: Should be able to update/delete/insert jobs.
DECLARE
counter INT;
BEGIN
UPDATE SYSTEM.jobs SET
max_salary = 6000
WHERE id = 1... | true |
0b4bb5558d2a572e3902cdc5e64143d694383d7f | SQL | panfengzjz/MySQL-starting | /查询/查询联系41-43.sql | UTF-8 | 2,480 | 4.3125 | 4 | [] | no_license | -- 41. 查询和"李军"同性别且同班的同学的 student_name
select student_sex, class_no from student WHERE student_name='李军';
select student_name from student WHERE
student_sex=(select student_sex from student WHERE student_name='李军')
AND class_no=(select class_no from student WHERE student_name='李军');
mysql> select student_name from stu... | true |
b3bf702a0177f475ea151699d3c372913fc9c139 | SQL | jmgold/SQL-Queries | /Misc Queries/Cataloging/large print format errors.sql | UTF-8 | 1,106 | 4.0625 | 4 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
Jeremy Goldstein
Minuteman Library Network
Identifies items without a mattype of large print that could be identified as large print within Aspen Discover
*/
SELECT
DISTINCT rm.record_type_code||rm.record_num||'a' AS bib_number,
b.material_code,
b.best_title,
b.best_author
FROM
sierra_view.bib_record_property b
J... | true |
b61d18aa6848c93b0e538cb17015e05ce7b4e547 | SQL | jonathanvx/mysql_perf_audit | /mysql_perf_schema/ddl_dml_per_schema.sql | UTF-8 | 367 | 3.53125 | 4 | [] | no_license | SELECT schema_name, IF(SUBSTRING_INDEX(digest_text, ' ', 1) IN ('CREATE', 'DROP', 'ALTER', 'GRANT', 'REVOKE'), 'DDL', 'DML') AS statement_type, COUNT(*) AS count
FROM performance_schema.events_statements_summary_by_digest
INNER JOIN information_schema.SCHEMATA using(schema_name)
GROUP BY statement_type, schema_na... | true |
16eca1d9f99e08917c1b169c16af3e815718a039 | SQL | zealotnt/piflab-store-api-go | /db/migrations/20161019144819_drop_products.sql | UTF-8 | 554 | 3.296875 | 3 | [] | no_license |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
DROP TABLE products;
DROP TYPE product_status;
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
CREATE TYPE product_status AS ENUM ('available', 'out_of_stock');
CREATE TABLE products (
id SERIAL PRIMARY... | true |
e067b64610d3032025ae00dd306498ae9270e817 | SQL | Esprit644/week-4-gym-project | /gym/db/gym.sql | UTF-8 | 490 | 3.28125 | 3 | [] | no_license | DROP TABLE bookings;
DROP TABLE members;
DROP TABLE sessions;
CREATE TABLE members(
id SERIAL8 PRIMARY KEY,
first_name VARCHAR(255),
last_name VARCHAR(255),
phone_number INT4,
email VARCHAR(255)
);
CREATE TABLE sessions(
id SERIAL8 PRIMARY KEY,
session_name VARCHAR(255),
cost INT2,
session_time TIME(1),
capacity INT2... | true |
22984de3a6b4faaec7e997ab2557e9d051e8fe19 | SQL | 3qian10jie/Java-Enterprise-IT-Architect-s-Dream | /015MyBatis/demo/mybatis-basic-setting/src/main/resources/init.sql | UTF-8 | 2,373 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | CREATE TABLE `USER_INFO` (
`USER_ID` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '用户编号',
`USERNAME` varchar(126) NOT NULL COMMENT '用户名',
`PASSWORD` varchar(126) NOT NULL COMMENT '密码',
`AGE` tinyint(3) UNSIGNED NULL DEFAULT NULL COMMENT '年龄',
`STATUS` tinyint(3) UNSIGNED NOT NULL COMMENT '用户状态,1:正常;0:禁用',... | true |
f30983ec03167775f51527a3e45312b5cb156e61 | SQL | josias07/MICOL_VIDRERIA_LP2_2015 | /src/java/Base_Datos/vidreria.sql | UTF-8 | 22,192 | 2.84375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win32 (x86)
--
-- Host: localhost Database: vidreria
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... | true |
d55884fc7c74f94bdd17dcaf751654139a80109b | SQL | LXavier74/PRojetPOO | /SQL/ScriptCreerBase.sql | UTF-8 | 4,241 | 3.375 | 3 | [] | no_license | drop database IF EXISTS bddprojetfilerouge;
CREATE DATABASE IF NOT EXISTS bddProjetFileRouge;
USE bddProjetFileRouge;
CREATE TABLE `employe` (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`nom` varchar(100) NOT NULL,
`prenom` varchar(100) NOT NULL,
`mdp` varchar(100) NOT NULL,
`nomCompte` varchar(1... | true |
9cc3cbbbe2ec1a30d4f96cf84b763140abcac6cd | SQL | glorspace/StoryExplorer | /StoryExplorer.Database/Reference Data/Script.PostDeployment1.sql | UTF-8 | 749 | 2.578125 | 3 | [] | no_license | /*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
... | true |
132a1fbee02ec14f51aea668eb193db29044f851 | SQL | panjiwa10028/zhaoyp0416 | /myweb/src/main/resources/sql/initData.sql | UTF-8 | 14,135 | 2.65625 | 3 | [] | no_license | insert into company(id, info, service, training, job, contact, update_time, user_id)
values(1, ' ', ' ', ' ', ' ',' ', now(), 1);
insert into groups (id, name, parent_id, description, sort, update_time, user_id)
values(-1, 'root',-1,'---', '0', now(), 1);
insert into users(id, name, group_id, login_name, pass... | true |
f36fd023419fd71022f4db1f04236221641a9d09 | SQL | ptruta/NPST-student-internship-platform | /students-internship-platform/test/src/test/resources/drop-create.sql | UTF-8 | 2,094 | 3.390625 | 3 | [] | no_license | DELETE FROM application;
DELETE FROM internshipAnnouncement;
DELETE FROM account;
DELETE FROM person;
DELETE FROM role;
-- ROLE
INSERT INTO role (id, role) VALUES (1, 'STUDENT');
INSERT INTO role (id, role) VALUES (2, 'COMPANY');
INSERT INTO role (id, role) VALUES (3, 'ADMIN');
-- PERSON
INSERT INTO person (id, a... | true |
e2655481780099fe291e680dc8eb59c3d70f3d09 | SQL | Zephyrsz/flink-job-compose | /flinksql/src/main/resources/examples/kafkatoredis.sql | UTF-8 | 913 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | -- aaa is aaa
SET aaa = 123;
SET bbb = 345;
CREATE TABLE kafkaprotobuf (
i32 int,
enums string
) with (
'connector' = 'kafka', -- 指定连接类型是kafka
--'version' = 'universal', -- 与我们之前Docker安装的kafka版本要一致
'topic' = 'protobuftest2', -- 之前创建的topic
--'update-mode' = 'append',
'scan.startup.mode' = ... | true |
9a646ab1b8388756f796c10f63f0c1ffd4246dc6 | SQL | misterpoloy/quiniela-mundialista-2018 | /Quiniela2018.sql | UTF-8 | 21,265 | 3.15625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 30-05-2018 a las 08:25:28
-- Versión del servidor: 10.1.28-MariaDB
-- Versión de PHP: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
1a0088f2d21c953f8b0b57f4fb9628175d8895e4 | SQL | pmirand6/soliris | /base_datos/soliris/FU_NEW_VENTA.sql | UTF-8 | 3,162 | 3.515625 | 4 | [] | no_license | -- --------------------------------------------------------
-- Host: localhost
-- Versión del servidor: 5.7.24 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 10.2.0.5599
-- --------------------------------------------------------
/... | true |
d991244c548d39b1df6b454261ff6f62511ca77e | SQL | kzsobolewski/Workers-Time-Registation-System | /procedure.sql | UTF-8 | 1,915 | 3.8125 | 4 | [] | no_license | -- Procedura wyliczajaca ilosc przpracowanych godzin
DELIMITER //
CREATE PROCEDURE Liczenie_godzin(IN prac_id int, IN od_kiedy date, IN ilosc_dni int, OUT godziny int) -- Procedura wyliczajaca ilosc przepracowanych godzin dla konkretnego pracownika
BEGIN
SET @stanowisko_id = (SELECT stanowisko_id FROM Pracownicy ... | true |
71f940c4873a48e91dcdf09ecd214ebb5f7a1f7c | SQL | google-code/azole-yii-trackstar | /temp/20130225_comment.sql | UTF-8 | 732 | 3.4375 | 3 | [] | no_license | CREATE TABLE tbl_comment
(
`id` integer not null primary key AUTO_INCREMENT,
`content` TEXT Not null,
`issue_id` integer,
`create_time` DateTime,
`create_user_id` integer,
`update_time` datetime,
`update_user_id` integer
);
ALTER TABLE `tbl_comment` ADD CONSTRAINT `FK_comment_issue` ... | true |
f4da856b85aa5bc9a3574d12426037d8221e1918 | SQL | mickaelquint/php-base | /12-mysql/actor.sql | UTF-8 | 1,714 | 4.21875 | 4 | [] | no_license | -- On va ajouter quelques acteurs
-- Al Pacino (25 04 1940)
-- Marlon Brando (3 04 1924)
-- Robert de Niro (17 08 1943)
-- Bruce Willis (19 03 1955)
-- Ray Liotta (18 12 1954)
-- Wesley Snipes (31 07 1962)
-- Sylvester Stalone (6 07 1946)
-- Edward Norton (18 08 1969)
-- Kevin Spacey (26 07 1959)
-- Val Kilmer (31 12 1... | true |
298c0c626dbe6c5b710592f80fae9a826af08964 | SQL | abrikos/time4 | /db/schema.sql | UTF-8 | 79,111 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE master (id INTEGER PRIMARY KEY, name VARCHAR);
INSERT INTO "master" VALUES(1,'Динара');
INSERT INTO "master" VALUES(2,'Оля');
INSERT INTO "master" VALUES(3,'Макс');
INSERT INTO "master" VALUES(4,'Айзат');
INSERT INTO "master" VALUES(5,'Наташа');
INSERT INTO "mast... | true |
085a29a88dbf8ca15b4f844df12b4e070297b219 | SQL | QinganZhao/LXXtCode | /Hackerrank/Type of Triangle.sql | UTF-8 | 256 | 3.125 | 3 | [
"MIT"
] | permissive | SELECT
(CASE WHEN A = B AND B = C THEN 'Equilateral'
WHEN (A = B AND A + B > C) OR (B = C AND B + C > A) OR (A = C AND A + C > B) THEN 'Isosceles'
WHEN A + B > C AND A + C > B AND B + C > A THEN 'Scalene'
ELSE 'Not A Triangle' END) Types
FROM TRIANGLES
| true |
f77166a0b3d6fc4dc584cc7cbc2b95a880460862 | SQL | peterbillings/ARCAprojectdev | /SQL/CREATEcharacterinventorytable.sql | UTF-8 | 492 | 3.15625 | 3 | [] | no_license | CREATE TABLE CharacterInventory
(
CharacterName varchar(50)
CONSTRAINT CharacterInventory_fk1
FOREIGN KEY (CharacterName)
REFERENCES CharacterDetails(CharacterName)
NOT NULL,
ItemName varchar(50)
CONSTRAINT CharacterInventory_fk2
FOREIGN KEY (ItemName)
REFERENCES Items(ItemName)
NOT NULL,
... | true |
6f460f26b8924e651b200d10af73946bbc36c276 | SQL | NikkiVee/react_express_assignment | /backend/db/seed.sql | UTF-8 | 530 | 3.328125 | 3 | [] | no_license | DROP DATABASE IF EXISTS jonie;
CREATE DATABASE jonie;
\c jonie;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR NOT NULL UNIQUE,
email VARCHAR NOT NULL,
phone VARCHAR NOT NULL UNIQUE
);
CREATE TABLE photos (
id SERIAL PRIMARY KEY,
url VARCHAR NOT NULL,
user_id INT NOT NULL REFERENCES users... | true |
2f1ed1f387bbdb467ba57afe7f795ec13d856326 | SQL | jlassi1/holbertonschool-higher_level_programming | /0x0D-SQL_introduction/15-groups.sql | UTF-8 | 145 | 2.828125 | 3 | [] | no_license | -- lists the nSELECT score, count(score) as number
SELECT score, count(score) as number
FROM second_table
group by score
ORDER BY number DESC;
| true |
9ff558007329ed487b059cf9902c3b2fe43b52d0 | SQL | miths1108/PiGen | /codd-data-gen/resources/cdgclient/postgres/sqlqueries_new/q104.sql | UTF-8 | 169 | 2.65625 | 3 | [] | no_license | -- start query 76 in stream 0 using template query74.tpl
select *
from store_sales
,date_dim
where ss_sold_date_sk = d_date_sk
and d_year in (1998,1998+1)
; | true |
943fe81a12965cb85e7456fe130c6d2ca3390492 | SQL | kaloyansen/back-end | /script.sql | UTF-8 | 1,141 | 3.515625 | 4 | [] | no_license | START TRANSACTION;
-- ============================================================
-- Suppression et création de la base de données
-- ============================================================
DROP DATABASE IF EXISTS tickets;
CREATE DATABASE tickets;
USE tickets;
-- =============================================... | true |
911ddc5442afc580bac347df5f9210d976a73b3d | SQL | TF2-Engineer/cs313-php | /assign04-07/dnd.sql | UTF-8 | 1,516 | 3.328125 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS dnd;
DROP TABLE IF EXISTS dnd.characters CASCADE;
DROP TABLE IF EXISTS dnd.inventory CASCADE;
CREATE TABLE dnd.characters(
charid SERIAL PRIMARY KEY,
name text,
race text,
class text,
subclass text,
gender char(1),
hp numeric,
str numeric,
dex numeric,
con numeric,
wis nume... | true |
66fea0acd815f93929be9a6d306306ae1ceaed74 | SQL | hakula139/IDBS-Spring20-Fudan | /assignments/ass1/submission/18307130024/7.sql | UTF-8 | 112 | 2.875 | 3 | [
"MIT"
] | permissive | select distinct book_id
from record
where unix_timestamp(time) > unix_timestamp('2016-10-31')
order by book_id
; | true |
2c7ebb7db0b53e46f5ce98853a805ce1f0feba5c | SQL | johneparker/af-edfi-shared | /SQL Queries/Test Score Summary/InitialSQL.sql | UTF-8 | 633 | 3.53125 | 4 | [
"Apache-2.0"
] | permissive | select distinct testsubjectgroup as illuminatetestsubjectgroup
into temp subj
from illuminate.assessment
;
select
a.testyear+1 as join_endyear
, sas.studentnumber
, a.testsubjectgroup
, j.illuminatetestsubjectgroup
, sas.adjustedperformancelevel
into temp apl
from stateassessments.studentassessmentscore sas... | true |
cce57474ada382546e3368d4992ff1216fbdc5e6 | SQL | jeffer0211/bss_frist_homework | /.gitignore/BSS_NEW_TABLE_PERSONA.sql | UTF-8 | 1,130 | 3.234375 | 3 | [] | no_license | CREATE TABLE PERSONA
(
IDPERSONA INTEGER NOT NULL DEFAULT NEXTVAL('PERSONA'::REGCLASS),
NOMBRE VARCHAR(30),
APELLIDO VARCHAR(30),
CEDULA TEXT,
TELEFONO TEXT,
CONSTRAINT PERSONA_PKEY PRIMARY KEY (IDPERSONA)
)
**************************************************************
INSERT INTO public.persona(
id... | true |
79bdb9b21131015b87c2f92da01adb8e5f57751f | SQL | rajeshpalkar/SQLServer | /GuitarShopDatabase/p1secC7.sql | UTF-8 | 217 | 3.40625 | 3 | [] | no_license | select distinct p1.DiscountPercent,p1.ProductName
from Products p1
where p1.DiscountPercent
NOT IN ( select p2.DiscountPercent
from Products p2
where p1.ProductName <> p2.ProductName )
order by ProductName
| true |
131276ba6617d9798bb322d0e3f36f06d18b1125 | SQL | zkffhtm6523/OracleDB | /Oracle DB/CRUD/select.sql | UHC | 1,760 | 3.90625 | 4 | [] | no_license | select * from t_student
where i_student in ( --ȣ , in Ѵ.
select i_student --÷ 2 ȴ.
from t_student
where i_student <= 4);
--null ã in null .
/**/
select * from t_student
where i_student = ( --ȣ
select i_student --÷ 2 ȴ.
from t_student
where i_student = 4);
select i_student, nm, age as student_age
... | true |
e46f64bc4e5092c868b4057d56bb9346b347b26d | SQL | Billex87/BootCampX | /2_queries_joins/Student's Total Assignment Duration.sql | UTF-8 | 434 | 3.90625 | 4 | [] | no_license | /*Get the total amount of time that a student has spent on all assignments.
This should work for any student but use 'Ibrahim Schimmel' for now.
Select only the total amount of time as a single column.
Expected Result:
total_duration
----------------
6888
(1 row)*/
SELECT sum(assignment_submissions.durat... | true |
467dd86c5f8346dc3411487026216a88169ecd8b | SQL | d-stew/introduction_to_sql_homework | /all_the_commands.sql | UTF-8 | 820 | 3.40625 | 3 | [] | no_license | CREATE TABLE urls (id serial, original_url varchar NOT NULL, count integer DEFAULT 0, CONSTRAINT id_pk PRIMARY KEY (id));
INSERT INTO urls (original_url, count) VALUES ('www.facebook.com/users/daniel.stewart', 12);
INSERT INTO urls (original_url, count) VALUES ('www.amazon.com/orders', 9);
INSERT INTO urls (original_u... | true |
2f33c1aedd3a7f3415c83e46f0c889fa9161952a | SQL | BrunnoHCInacio/API | /sql/03.sql | UTF-8 | 7,639 | 3.34375 | 3 | [] | no_license | 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='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `controleanimal` DEFAULT CHARACTER SET utf8 ;
USE `controleanimal` ;
-- ---------------... | true |
4e1712bc81c77c3b84d445937df45c56153094d9 | SQL | soupria/biscuit | /sql/utSQL/source/create_user_grants.sql | UTF-8 | 5,697 | 3.078125 | 3 | [
"Apache-2.0",
"GPL-2.0-only"
] | permissive | /*
utPLSQL - Version 3
Copyright 2016 - 2018 utPLSQL Project
Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | true |
5fa589f7d3f4192781760055e89df77508fe1f87 | SQL | evanjohnso/EpicodusAPI | /src/main/resources/db/create.sql | UTF-8 | 793 | 3.59375 | 4 | [
"MIT"
] | permissive | SET MODE PostgreSQL;
CREATE TABLE IF NOT EXISTS students (
id int PRIMARY KEY auto_increment,
trackId int,
gender VARCHAR,
age int,
enrolled BOOLEAN
);
CREATE TABLE IF NOT EXISTS graduates (
id int PRIMARY KEY auto_increment,
studentId int, --foreign KEY
gender VARCHAR,
age int,
emplo... | true |
20f94065aa40568de99b0013bcfb546149fbbba5 | SQL | NewbieFreak/Library-Booking-System | /create database.sql | UTF-8 | 14,143 | 3.375 | 3 | [] | no_license | drop table Books;
drop table Bookings;
drop table Students;
/**
* Author: Matthew Van der Bijl - xq9x3wv31
* Created: 20 Feb 2017
*/
CREATE TABLE Books (
id INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY
(START WITH 1, INCREMENT BY 1), /* PK */
title ... | true |
768e1ff407a63eac7ada6591edaba631c72b604b | SQL | siilats/dbt-tap-adwords | /models/transform/adwords_keyword_stats_per_month.sql | UTF-8 | 1,458 | 3.65625 | 4 | [
"MIT"
] | permissive | with report as (
select *
from {{ref('adwords_keywords_report')}}
)
select
-- The Account, Campaign, Ad Group, Ad this report is for
account_id,
account_name,
campaign_id,
campaign_name,
ad_group_id,
ad_group_name,
keyword_id,
keyword,
keyword_status,
top_of_page_cpc,
first_pag... | true |
40580aa659d25a6b8940fc7813b3ac975ad342a3 | SQL | csp567/laravel_base_app | /laravel/database/laravel_base_app.sql | UTF-8 | 9,231 | 3 | 3 | [
"MIT"
] | permissive | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.19 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.3.0.4984
-- --------------------------------------------------------
/*... | true |
ffe61cea5e3bb6c82010ba8806500c5a9aa78007 | SQL | MiloszBoghe/School-Y1- | /Big Data/VOORBEELDEXAMEN BIG DATA/Big Data LEREN/H2/Oefening2.4.2.sql | UTF-8 | 483 | 3.109375 | 3 | [] | no_license | CREATE OR REPLACE FUNCTION schrikkeljaar(p_jaar NUMBER)
RETURN VARCHAR2
AS
v_jaar NUMBER(4) := p_jaar;
BEGIN
-- true if the year is a multiple
-- of 4 and not multiple of 100.
-- OR year is multiple of 400.
-- Extract(YEAR FROM SYSDATE)
IF MOD(v_jaar, 4) = 0 AND MOD(v_jaar, 100) != 0 OR MOD(v_jaar, 400) = 0... | true |
0cbbf2f2dc7c3783cacbde796c67542432261389 | SQL | wildflower/SCMTurboCharge | /d_n_champion.sql | UTF-8 | 665 | 2.921875 | 3 | [] | no_license | SELECT
champion_registry.icp, champion_eiep1.reportmonth, champion_eiep1.fixedvariable, champion_eiep1.units, champion_eiep1.status, champion_eiep1.retailer,
metercontact, champion_eiep1.pricecode, champion_eiep1.pricerate, champion_eiep1.charge addressuserref, addressnumber,
addres... | true |
43a18689682fb1d8bc064e7bfadcfb3088569d9e | SQL | marcosanchezdenis/evaluacion_profesores | /application/configs/data/sql/init_data.sql | UTF-8 | 2,031 | 3.140625 | 3 | [] | no_license | /* ******************************
TABLA: persona
****************************** */
INSERT INTO persona (persona_id,nombre,apellido,email,es_docente) VALUES (1,'Victor','Cajes','victor.cajes@uca.edu.py','N');
ALTER SEQUENCE persona_persona_id_seq RESTART WITH 2;
/* ******************************
TABLA: rol
****... | true |
80a74058ea5a9f16e6e0b72d71af0a6aacd65837 | SQL | LoreenaLiu/Jianghu_data_edit | /19_11_redpoints.sql | UTF-8 | 5,810 | 3.875 | 4 | [] | no_license |
-- 1 : set a flag for new hobbies notifications only
-- when the users who are followed by the fans post new hobbies
-- step 1 list all followers id by selecting user_id
select * from follow;
select follower_user_id, user_id from follow where deleted = 0 and follower_user_id = 149;
-- alter table user add n... | true |
745e4dd2f89cd5d6e846154ac709abf190e33df1 | SQL | prfortuna/pi2016 | /DB/baseproj_15-09.sql | UTF-8 | 9,209 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 16-Set-2016 às 02:33
-- Versão do servidor: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... | true |
c5b162e10c36821d9a05dba10d281ead2a09dae6 | SQL | personallanxiangzhiyun/shuijian | /newadmin20151119/newadmin.sql | UTF-8 | 14,694 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2015 年 11 月 19 日 07:46
-- 服务器版本: 5.5.20
-- PHP 版本: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... | true |
a639740b1abc12c303866b87c0245c90aace639a | SQL | edwhelan/snitch-app | /schema.sql | UTF-8 | 781 | 3.8125 | 4 | [] | no_license | -- USERS TABLE
-- a user has a name, email address, phone-number, and password.
create table users (
id serial primary key,
displayname varchar (100) not null unique,
emailaddress varchar (150) not null unique,
phonenumber varchar (10) not null unique,
password varchar(400) not null
);
--PICTURES TABLE
-- a ... | true |
de011419357c64ae6d2f8f55418cdc16093dadf7 | SQL | correnm/DataStax | /AuthenticationAndAuthorization/AuthenticatedRoleDefinitions.cql | UTF-8 | 972 | 3.203125 | 3 | [] | no_license | //
// "User" Definitions: https://docs.datastax.com/en/cql/3.3/cql/cql_using/useSecureRoles.html
//
// The following roles are presumed in the system
// sys_admin: role management
// admin: schema management
// developer: data management
// These commands can be run in cqlsh or DevCenter
CREATE ROLE g2s... | true |
46ff82682761d643a4fc8a36f98a267397b0996b | SQL | Lioo19/ramverk1project | /sql/ddl/posttag_sqlite.sql | UTF-8 | 501 | 3.640625 | 4 | [] | no_license | --
-- Creating a Posttags table.
-- sqlite3 data/db.sqlite < sql/ddl/posttag_sqlite.sql
-- FIFTH
--
-- Table Posttags
--
DROP TABLE IF EXISTS Posttags;
CREATE TABLE Posttags (
"id" INTEGER PRIMARY KEY NOT NULL, -- is this really neccessary? And if so, c/should it be auto?
"postid" INTEGER NOT NULL, -- maps t... | true |
ef0c6add4bfdc2a0afe2c79ea843f16d69b99417 | SQL | edirand/ConduiteDeProjetDemo | /src/bdd/createBDD.sql | UTF-8 | 1,095 | 3.359375 | 3 | [] | no_license | Drop database if exists CNRSBDD;
Create database CNRSBDD;
use CNRSBDD;
CREATE TABLE IF NOT EXISTS Laboratoires
(id int unsigned not null auto_increment primary key,
nom varchar(250)
);
#Obligé d'utiliser un varchar ici pour avoir des dates cohérentes avec le cahier des charges
CREATE TABLE IF NOT EXISTS Dates
(id i... | true |
3d902381db3af2cbb6a00556c76b3b837e035aed | SQL | yakiris/20200213_Database | /07_dz/03.sql | UTF-8 | 1,304 | 4.40625 | 4 | [] | no_license | # 3. Пусть имеется таблица рейсов flights (id, from, to) и таблица городов cities (label, name).
#Поля from, to и label содержат английские названия городов, поле name — русское. Выведите список рейсов flights с русскими названиями городов.
USE les03;
CREATE TABLE cities (
lable VARCHAR(255) NOT NULL,
name VARCHAR(2... | true |
ae008880ef48fbd90948f5a55b9b225743dfcbff | SQL | HRR47-SDC-Burke/moreplacestostay-service | /database/schema.sql | UTF-8 | 357 | 3.03125 | 3 | [] | no_license | CREATE DATABASE places;
USE places;
CREATE TABLE place (
id INTEGER NOT NULL AUTO_INCREMENT,
name text NOT NULL,
price INTEGER NOT NULL,
imageurl text NOT NULL,
PRIMARY KEY (id)
);
/* Execute this file from the command line by typing:
* mysql -u root < database/schema.sql
* to crea... | true |
805f202c66ccbf93e913f0152d7069ceec7d74fd | SQL | jkstill/oracle-script-lib | /sql/sesswaitu72.sql | UTF-8 | 1,010 | 3.359375 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive |
-- sesswaitu.sql
-- show current waits for a username
-- may call as '@sesswaitu USERNAME'
-- eg. @sesswaitu '%'
-- eg. @sesswaitu '%TMR%'
-- eg. @sesswaitu 'USSP'
-- if username not passed, it will ask for it
set line 110 feed on pause off echo off
set trimspool on
set verify off
clear col
clear break
col cuserna... | true |
0838a8394feb2fe33c9c8aa3ec94363da2cef63d | SQL | patricklac/contacts-full-old | /topology-amt/contacts-schema.sql | UTF-8 | 476 | 3.296875 | 3 | [] | no_license | DROP database IF EXISTS contacts;
CREATE database contacts;
create user 'adm'@'localhost' identified by 'adm';
grant all privileges on contacts.* TO 'adm'@'localhost';
USE contacts;
CREATE TABLE contacts (
id int NOT NULL AUTO_INCREMENT,
nom varchar(15) NOT NULL,
telephone int NOT NULL,
PRIMARY KEY (id)
)ENG... | true |
911509496e71034ea414e86cc69214f6d7fd7b2e | SQL | sqlfluff/sqlfluff | /test/fixtures/dialects/snowflake/create_view.sql | UTF-8 | 1,440 | 3.859375 | 4 | [
"MIT"
] | permissive |
create view another_view comment = 'a great description' as select col_1, col_2 from other_table;
CREATE VIEW basic_view AS SELECT col1, col2 FROM src_table;
CREATE TEMPORARY VIEW view_with_comments
COMMENT = 'my comment' AS SELECT col1, col2 FROM src_table;
CREATE OR REPLACE VIEW view_with_replace_and_comment
COMM... | true |
7044d1cacfe91b0438d9aff9452b7c7babdc38df | SQL | CarolinaBer/Sesion7_BEDU | /Sesion7_Local_BEDU.sql | UTF-8 | 1,080 | 3.671875 | 4 | [] | no_license | -- Sesión 7
CREATE DATABASE CarolinaBer_BEDU;
-- DROP DATABASE name; para borrar la BD
-- Es mejor tener esta consulta como seguro
CREATE DATABASE IF NOT EXISTS CarolinaBer_BEDU;
-- DROP DATABASE IF EXISTS name;
USE CarolinaBer_BEDU;
CREATE TABLE IF NOT EXISTS users(
id INT PRIMARY KEY,
genero CHAR(1),
edad INT,
ocup... | true |
fd95bbef8f1b6d297e5f361f5344f9bede474e5e | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day10/select0104.sql | UTF-8 | 403 | 3.5625 | 4 | [] | no_license |
SELECT obs.sensor_id, avg(counts)
FROM (SELECT sensor_id, date_trunc('day', timestamp), count(*) as counts
FROM WiFiAPObservation WHERE timestamp>'2017-11-09T01:04:00Z' AND timestamp<'2017-11-10T01:04:00Z' AND SENSOR_ID = ANY(array['thermometer6','3145_clwa_5019','wemo_05','3142_clwa_2065','3144_clwa_4209'])
... | true |
843353b99bf1efe892f0da6a06aca2aba4dfa578 | SQL | IEEE-TEICM-SB/QuizManagerAndBuilder | /quizdatabase.sql | UTF-8 | 3,898 | 3.171875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Φιλοξενητής: 127.0.0.1
-- Χρόνος δημιουργίας: 23 Σεπ 2017 στις 20:36:21
-- Έκδοση διακομιστή: 10.1.25-MariaDB
-- Έκδοση PHP: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... | true |
b5e6686bba2cfc952d7fe0cb71abfcb6142f7e01 | SQL | prodoteam/computer | /Program/test/application/testDB.sql | UTF-8 | 6,977 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.5
-- http://www.phpmyadmin.net
--
-- Vert: sql11.freemysqlhosting.net
-- Generert den: 04. Apr, 2017 14:39 PM
-- Tjenerversjon: 5.5.53-0ubuntu0.14.04.1
-- PHP-Versjon: 5.3.28
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... | true |
e53f53376399b5b9b70df8b48105483aa23286b4 | SQL | ku3nsting/dbfinal | /finalFIXEDDB.sql | UTF-8 | 3,051 | 3.390625 | 3 | [] | no_license | /*Clear out the needed table names*/
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `Starches`;
DROP TABLE IF EXISTS `Proteins`;
DROP TABLE IF EXISTS `Recipes`;
DROP TABLE IF EXISTS `Cuisines`;
DROP TABLE IF EXISTS `Meal_Types`;
DROP TABLE IF EXISTS `Recipe_Meals`;
SET foreign_key_checks = 1;
/*Make new ... | true |
220f8e50dce89e4a84c2ebd4ed3d18f4b028dfc0 | SQL | inuro/PokemonGo_Data | /sample_query3.sql | UTF-8 | 7,138 | 3.5625 | 4 | [] | no_license | /*
target specified ranking
*/
select
Q2.rank
, ROUND((Q2.true_dps - T2.AVRG) / T2.STDRD * 10 + 50, 1) as T
, Q2.id
, Q2.name
, Q2.fastmove
, Q2.chargemove
, Q2.at
, Q2.df
, Q2.st
, Q2.MP_FAST
, Q2.MP_CHARGE
, Q2.true_dps
, Q2.legacy
, Q2.target
from(
select
row_number() OVER (ORDER BY Q1.true_dps desc) AS ra... | true |
0874e31cef57e6da3113b15419aaff0efa39b4f6 | SQL | FabianGoe/assessment | /App/Config/Schema/schema.sql | UTF-8 | 1,114 | 2.875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 15, 2017 at 04:22 PM
-- Server version: 5.7.16-0ubuntu0.16.04.1
-- PHP Version: 7.1.0-2+deb.sury.org~xenial+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `assessme... | true |
54cfa612416fc4259b59a9cbfbba1e0695beec65 | SQL | pavel-voinov/oracle-dba-workspace | /scripts/sysdba/check_refresh_mviews.sql | UTF-8 | 1,320 | 3.59375 | 4 | [
"MIT"
] | permissive | /*
*/
set serveroutput on size unlimited echo off verify off timing off linesize 180
define schema=&1
variable c REFCURSOR;
declare
l_mv_capabilities_table ExplainMVArrayType;
begin
for t in (SELECT '"' || owner || '"."' || mview_name || '"' as mview_name
FROM dba_mviews
WHERE owner = upp... | true |
5b01b3c4bb90799db5a0e04721c91f7ed27b1ed9 | SQL | magrai/URBAN-MV-VIE_UniBw_Study2_DB | /v_q_pasa_t1_vs_t2_avg.sql | UTF-8 | 1,606 | 3.140625 | 3 | [] | no_license | DROP VIEW IF EXISTS v_q_pasa_t1_vs_t2_avg CASCADE;
CREATE VIEW v_q_pasa_t1_vs_t2_avg AS
SELECT
"public".v_q_pasa_t1_vs_t2.cond,
avg("public".v_q_pasa_t1_vs_t2.pasa_threat_t1) as pasa_threat_t1_avg,
avg("public".v_q_pasa_t1_vs_t2.pasa_threat_t2) as pasa_threat_t2_avg,
avg("public".v_q_pasa_t1_vs_t2.pasa_threat_t1) - av... | true |
e5cdd7106bdd7f63636d84067095c0605b4e5471 | SQL | A00944299/Personal-Portfolio | /Database Assignments/Asn01/Assignment01_QinC.sql | UTF-8 | 4,494 | 3.5625 | 4 | [] | no_license | -- COMP 2714
-- SET 2A
-- Assignment Asn01
-- Qin, Chris A00944299
-- email: cqin8@my.bcit.ca
SET ECHO OFF
SET TAB OFF
SPOOL C:\Users\chris\Desktop\Assignment01_QinC.txt
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD';
SELECT SYSDATE
FROM DUAL;
-- Question 1
DROP TABLE OldBooking;
DROP TAB... | true |
556247428964b3180c3a2c20515abd972ab70a53 | SQL | jrdrenth/EmployeeTracker | /db/companySchema.sql | UTF-8 | 1,059 | 4 | 4 | [
"MIT"
] | permissive | drop database if exists company;
create database company;
use company;
create table department(
id int auto_increment not null,
constraint pk_department primary key (id),
name varchar(30) unique not null
);
create table role(
id int auto_increment not null,
constraint pk_role primary key (id),
title varc... | true |
53f076d6d04170d14cdda08a2c00667e143dfe1d | SQL | CSharpSyntraWest/LESSEN_DATABANK | /LES 5/Oplossingen-Oefeningen-Deel4-plantv-joins.sql | UTF-8 | 2,354 | 3.921875 | 4 | [] | no_license | --Oefening Deel 4
--1. Maak een overzicht van de bestellingen met het bestelnummer, de naam van
--de leverancier, de leverdatum en het bestelde bedrag.
--(resultaat : 15 rijen)
select bestelnr,lev_naam,L_datum,bedrag
from bestel inner join leveran on
bestel.Lev_Code = leveran.lev_code;
--2. Welke planten hebben ... | true |
c34db15e45792841b44cf79d0bd330d2742f9a1d | SQL | goodsoul1914/DBA | /Scripts/Algemeen/Backup-Restore/Last Backup Date.sql | UTF-8 | 365 | 3.59375 | 4 | [] | no_license | SELECT T1.name AS DatabaseName,
COALESCE(CONVERT(VARCHAR(12), MAX(T2.backup_finish_date), 101), 'Not Yet Taken') AS LastBackUpTaken,
COALESCE(CONVERT(VARCHAR(12), MAX(T2.user_name), 101), 'NA') AS UserName
FROM sys.sysdatabases AS T1
LEFT OUTER JOIN msdb.dbo.backupset AS T2
ON T2.database_name... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.