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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10511c9def3ba54690b1f50ad5ccb4882942b1cd | SQL | drzazga888/s-r-a-c-z | /sql/op_sum_by_user.sql | UTF-8 | 158 | 3.4375 | 3 | [] | no_license | select
op.user_id,
sum(op.part * tr.cost) as kasa
from
operation op
join transaction tr on op.transaction_id = tr.id
group by
op.user_id
; | true |
a0864cd8dcf3c830ced44ba4add940e647cb3fdc | SQL | gobu-github/TP_INTEGRADOR_CRUD | /script_bbdd/bbdd_crud_v3.sql | UTF-8 | 1,267 | 3.5 | 4 | [] | no_license | -- DROP DATABASE IF EXISTS crud_v3;
-- Creacion de la base de datos (crud_bbdd)
CREATE DATABASE crud_v3;
USE crud_v3;
-- Creacion de la tabla usuarios (crud_bbdd)
CREATE TABLE usu_usuarios (
usu_id int(10) unsigned NOT NULL AUTO_INCREMENT,
usu_usuario varchar(45) NOT NULL,
usu_clave varchar(255) NOT NU... | true |
c50520b0a13ca5dd4a979f25e74c1552b81e26c8 | SQL | MBTemple/TimeCapsule-public | /TimeCapsule/sql/markers.sql | UTF-8 | 2,521 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | -- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: cis-linux2.temple.edu Database: SP20_4398_tug60038
-- ------------------------------------------------------
-- Server version 5.5.62-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET... | true |
8be7a33bb1f2e793540e5021f279a5684315e200 | SQL | Santhoshg9793/Spring-Boot-Microservices | /employee-service/src/main/resources/data.sql | UTF-8 | 435 | 3.203125 | 3 | [] | no_license | DROP TABLE EMPLOYEE;
DROP SEQUENCE EMPLOYEE_SEQ;
CREATE TABLE EMPLOYEE(EMP_ID int NOT NULL PRIMARY KEY,FIRST_NAME varchar(50),LAST_NAME varchar(50),DOJ DATE);
CREATE SEQUENCE EMPLOYEE_SEQ Start with 1 increment by 1;
DELETE FROM EMPLOYEE;
INSERT INTO EMPLOYEE (EMP_ID,FIRST_NAME,LAST_NAME,DOJ) VALUES
(1,'Santhosh'... | true |
441d878e62fd4795e32b8a4617ce95e47899b5af | SQL | liyijun123/multi-table-query-2019-5-21-3-10-2-585 | /select.sql | UTF-8 | 1,808 | 4.6875 | 5 | [] | no_license | # 1.查询同时存在1课程和2课程的情况
SELECT *
FROM student a, student_course b
WHERE a.id = B.STUDENTID AND B.COURSEID IN ('1', '2');
# 2.查询同时存在1课程和2课程的情况
SELECT *
FROM student a, student_course b
WHERE a.id = B.STUDENTID AND B.COURSEID IN ('1', '2');
# 3.查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩
SELECT a.id, a.name ,CAST(AVG(b.score) ... | true |
32e96aef70fa0fd0ed360ce9626fc17cb46043ae | SQL | kincoom1/kincoom_ | /src/main/resources/schema.sql | UTF-8 | 544 | 3.28125 | 3 | [] | no_license | create table send_request
(id bigint not null auto_increment,
create_date datetime,
person bigint,
room varchar(255),
send_user bigint,
token varchar(3) not null,
total_money bigint,
primary key (id),
index(token));
create table send_detail
(id bigint not null auto_increment,
receive_date datetime,
receive_money bigin... | true |
a4e2b40c8d1babcf750aae3a20e2f0e7767de0af | SQL | CUBRID/cubrid-testcases | /sql/_23_apricot_qa/_03_i18n/tr_TR/_10_cast_op/cases/003.sql | UTF-8 | 2,266 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | --+ holdcas on;
set names utf8;
set system parameters 'intl_number_lang = tr_TR';
set system parameters 'intl_date_lang = tr_TR';
create class func_03(
datetimetest DATETIME,
datetest date,
timetest time,
timestamptest timestamp
);
insert into func_03 values (DATETIME '2011-05-01 PAZAR 10:11:1... | true |
199ba05fcdf360ab3ed5839b1814c53333f5269e | SQL | Paz1506/VotingSystem | /src/main/resources/database/populate.sql | UTF-8 | 1,493 | 3.484375 | 3 | [] | no_license | DELETE FROM dish;
DELETE FROM menu;
DELETE FROM role;
DELETE FROM vote;
DELETE FROM users;
DELETE FROM restaurant;
ALTER SEQUENCE GLOBAL_SEQUENCE
RESTART WITH 10000;
INSERT INTO restaurant (id, name) VALUES
(1, 'Restaurant_1'),
(2, 'Restaurant_2'),
(3, 'Restaurant_3'),
(4, 'Restaurant_4'); --For test findAllR... | true |
881c6119b02357e368cae4a1c21897ed27607898 | SQL | brookjy/storage | /svacation.sql | UTF-8 | 18,797 | 3.0625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 10, 2018 at 04:20 AM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
f6cdc301fda9586a56814b04f3b050be489f790c | SQL | ansartnl/ALPHA | /db_updates/2012.04.09/14 restriction_ac.sql | UTF-8 | 2,528 | 3.484375 | 3 | [] | no_license | CREATE OR REPLACE
TRIGGER RESTRICTION_AC
AFTER INSERT OR UPDATE OR DELETE ON RESTRICTION FOR EACH ROW
DECLARE
ac_flag NUMBER;
cursorfir zone_pkg.zone_rec_type;
curfir cursorfir%ROWTYPE;
BEGIN
ac_flag := sys_context('CLIENTCONTEXT', 'ARINC_CHANGES_FLAG');
IF ac_flag = 777 THEN
--DELETE
IF DELETING THE... | true |
795908b208f35f5f3103407f9b250693ba991396 | SQL | leahgean/MarketingAutomationTool | /DBScripts/93_CREATE_TABLE_ContactSearchFields.sql | UTF-8 | 382 | 2.65625 | 3 | [] | no_license | CREATE TABLE ContactSearchFields
(
ID INT IDENTITY,
SEARCHID INT NOT NULL REFERENCES ContactSearch(ID),
ACCOUNTID UNIQUEIDENTIFIER NOT NULL,
CREATEDBY UNIQUEIDENTIFIER NOT NULL,
CREATEDDATE DATETIME NOT NULL DEFAULT(GETDATE()),
SEARCHKEY NVARCHAR(250) NOT NULL,
SEARCHOPERATOR NVARCHAR(20) NOT NULL,
SEARCHVALUE NVARCHAR... | true |
f91f7891107be89e69b32d56aae972db1bb0b982 | SQL | 1jgrant/nc-news-backend | /db/query.sql | UTF-8 | 264 | 3.46875 | 3 | [] | no_license | \c nc_news_test
SELECT articles.*, COUNT(comment_id) AS comment_count, COUNT(articles.article_id) AS total_count FROM articles
LEFT JOIN comments ON articles.article_id = comments.article_id
WHERE articles.author = 'rogersop'
GROUP BY articles.article_id
LIMIT 5; | true |
b13ad008886726746d1af7dab3e7c92ddca06ba3 | SQL | masters-info-nantes/DataLeReacteur | /extract/views.sql | UTF-8 | 1,661 | 3.875 | 4 | [] | no_license | -- VIEW opendata_image
-- DROP VIEW IF EXISTS opendata_image;
--
-- CREATE VIEW opendata_image AS
-- SELECT id, name, (CASE WHEN (caption = '') THEN alt ELSE caption END) as comment
-- FROM txp_image;
-- VIEW opendata_venues
-- DROP VIEW IF EXISTS opendata_venues;
--
-- CREATE VIEW opendata_venues AS
-- SELECT ID,... | true |
5ba6a7fae656d08ee6849cdfd68a9d7ed0f6441b | SQL | bgatev/TelerikAcademy | /Databases/Lection 5/Task12.sql | UTF-8 | 195 | 3.296875 | 3 | [] | no_license | select Employees.FirstName, Employees.LastName, isnull(empl.FirstName + empl.LastName, '(no manager)') as Manager
from Employees left join Employees empl on Employees.ManagerID = empl.EmployeeID
| true |
75683aa1b817786929ef067eb4e6eb4cc1d8ecbb | SQL | wkorando/restful-people | /create.sql | UTF-8 | 354 | 2.53125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Persons (
id IDENTITY PRIMARY KEY auto_increment,
firstName varchar(200),
lastName varchar(200)
);
INSERT INTO Persons (firstName, lastName) values ('Billy', 'Korando');
INSERT INTO Persons (firstName, lastName) values ('Johnny', 'Appleseed');
INSERT INTO Persons (firstName, last... | true |
8156db521c44fcb2e0084e1dea23a9ce0ffe2ddf | SQL | jasarsoft/fit-src | /bp2/vjezbe_pdf/bp2_vj07pdf_zadatak08.sql | UTF-8 | 406 | 3.15625 | 3 | [
"MIT"
] | permissive | /*
Vjezbe 7 Zadatak 8
Izmijeniti rezultate testiranja svim kandidatima koji su polagali odabrani test (oznaka testa kao filter).
Svim kandidatima broj osvojenih bodova uvecati za 5.
*/
USE Edin
UPDATE RezultatiTesta
SET OsvojeniBodovi = OsvojeniBodovi + 5
WHERE TestID = (select T.TestID from Testovi AS T where ... | true |
e0475148d6dfdfb0891df502ab808e2dfe8c43a5 | SQL | Tanginatushar/corrected-crud01 | /empployskill/employskills.sql | UTF-8 | 1,962 | 2.765625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 27, 2014 at 06:47 AM
-- Server version: 5.5.40-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... | true |
79542aa4ac76f3985190071c4faa072195860a6a | SQL | sivanookala1979/getbike | /conf/evolutions/default/29.sql | UTF-8 | 487 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive |
# --- !Ups
create table non_geo_fencing_location (
id bigint not null,
mobile_number varchar(255),
latitude double,
longitude double,
address_area varchar(255),
requ... | true |
3979658f0e97d334ab70bf0f70091b72d789b700 | SQL | anurag31594/SQL | /Trips and Users.sql | UTF-8 | 3,633 | 4.5 | 4 | [] | no_license | --The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’).
+----+-----------+-----------+---------+--------------------+----------+
|... | true |
bf759fb0a87f92a34843b1984f5d4bde4c4b5b4d | SQL | Holo-Development/SQL_Aplicado | /Comercial2AScriptV2.sql | UTF-8 | 6,837 | 3.84375 | 4 | [] | no_license | CREATE TABLE CATEGORIA_CLIENTE(
idCategoriaCliente int not null identity(1,1) primary key,
nombreCategoria varchar(50) not null
);
CREATE TABLE ENCARGADO_COMPRA(
idEncargado int not null identity(1,1) primary key,
runEncargado varchar(15) not null,
nombreEncargado varchar(50) not null,
correo varchar(50) not ... | true |
8617f8b68bae2a5cff8bfb55cab25fe4a2aefd1a | SQL | Kevlyn1205/EduTech | /Clientes.sql | UTF-8 | 207 | 2.625 | 3 | [] | no_license | Create database Clientes
use Clientes
create table Clientes(
Codigo int identity(1001,1) primary key,
Nombre varchar(35) not null,
Telefono varchar(9),
Email varchar(25)
);
select * from Clientes | true |
e94953edcaf73bedd5ad1a3db173442b77c853b3 | SQL | JavaGCP210907/p0-bgarber0343 | /SQLScripts/inventory_tracker_script.sql | UTF-8 | 1,966 | 3.296875 | 3 | [] | no_license | CREATE TABLE departments (
department_id serial PRIMARY KEY,
department_name TEXT,
department_sales decimal(15,2)
);
CREATE TABLE products (
product_id serial PRIMARY KEY,
product_name TEXT,
product_description TEXT,
price decimal(15, 2),
stock int,
department_id int REFERENCES departments (department_id)
);... | true |
aad74d9a24d8aaeaf6abaeacf0288e0d5fc65fe6 | SQL | crihit/DB_TEAM2 | /phase3-input.sql | UTF-8 | 68,580 | 2.859375 | 3 | [] | no_license | create table category (
major varchar(30) not null,
sub varchar(30) not null,
catid int not null,
primary key (catid));
create table provider (
Pid int not null,
Pname varchar(20) not null,
Plocation varchar(20) not null,
primary key (Pid));
create table item (
Iexp date,
Iprice int not null,
Iname varcha... | true |
ba1efbba1ad6deeaa4c1f13eedff84e600ad65a8 | SQL | jonasmartins-dev/processos | /processos.sql | UTF-8 | 2,608 | 3.859375 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS `processos`;
USE `processos`;
CREATE TABLE IF NOT EXISTS `advogados` (
`id_advogado` int(100) NOT NULL AUTO_INCREMENT,
`nome` varchar(200) DEFAULT NULL,
`oab` varchar(100) DEFAULT NULL,
`cpf` varchar(100) DEFAULT NULL,
`email` varchar(200) DEFAULT NULL,
`senha` varcha... | true |
b04ce69d0de21928621564904cf9992462cc23d4 | SQL | srshin/java | /JavaProject/src/com/encore/day15/day3.sql | UTF-8 | 1,946 | 4.8125 | 5 | [] | no_license | -- subquery
--neena가 근무하는 부서의 이름?
select department_id, first_name
from EMPLOYEES
where first_name = 'Neena';
select department_name
from departments d
where department_id = (
select department_id
from EMPLOYEES
where first_name = 'Neena'
);
select first_name, department_name
from departments d join employe... | true |
5a3b31462cafcbeeb672622a79edf872bfb36293 | SQL | Ceglee/wharyo | /wharyo/sql/db-model.sql | UTF-8 | 185 | 2.5625 | 3 | [] | no_license | CREATE TYPE layer_type AS ENUM ('DATABASE', 'SHAPEFILE')
CREATE TABLE layer_config (
id INTEGER PRIMARY KEY,
layer_name VARCHAR(255) NOT NULL UNIQUE,
layer_type layer_type NOT NULL
) | true |
a4d0096fa87606c502d596ff866bf89a0ff3387c | SQL | coderdude1/totp_experiment | /Common/src/main/resources/sql/common/V1__CreateUserTable.sql | UTF-8 | 306 | 2.75 | 3 | [] | no_license | CREATE TABLE users (
id serial primary key,
first_name varchar(40),
last_name varchar(50),
email varchar(512)
);
ALTER TABLE users ALTER COLUMN first_name SET NOT NULL;
ALTER TABLE users ALTER COLUMN last_name SET NOT NULL;
ALTER TABLE users ALTER COLUMN email SET NOT NULL; | true |
d21bed0e1f2b25b12361c555cf63f5d244ec44a7 | SQL | vanessahuhn/SQL-queries | /exercice_restaurants/bd_restaurants_corrigee/create_table_restaurant.sql | UTF-8 | 966 | 3.578125 | 4 | [] | no_license | -- Dans la base de données bd_restaurants
USE bd_restaurants;
-- créer une table RESTAURANT qui contient
CREATE TABLE RESTAURANT (
-- le champ idRestaurant qui aura des valeurs de type int, ne pourra pas être NULL et s'auto-incrémente
idRestaurant INT NOT NULL AUTO_INCREMENT,
-- le champ nomRestaurant qui aura de... | true |
17236f6daf4947b35b2dd4defdc81ce40313ec92 | SQL | hurd-x0/hotel-reservation | /data/cassandra/003_load_data.cql | UTF-8 | 528 | 2.515625 | 3 | [] | no_license | -- hotel
INSERT INTO hotel (hotel_name, hotel_address)
VALUES ('NH Hotels', 'NH Address');
INSERT INTO hotel (hotel_name, hotel_address)
VALUES ('AC Hotels', 'AC Address');
-- room_by_hotel
INSERT INTO room_by_hotel (hotel_name, room_number, room_description)
VALUES ('NH Hotels', 'NH-R1', 'Standard');
INSERT INTO room... | true |
a55584053c65c5b31e2ef6479e087a3ec4a64977 | SQL | CADSV/ProyectoCAVBases1 | /scriptsDB/view/B_View.sql | UTF-8 | 1,700 | 4.09375 | 4 | [] | no_license | -- REPORTE B: ¿Cuál es el usuario que ha visto más episodios de series originales?
-- Imprimir la información del usuario, de dónde es y la cantidad de episodios vistos.
-- SEGUNDA ENTREGA (LISTO)
CREATE VIEW reporte_B AS
SELECT U.IdUser, U.Username, U.NameUser, U.LastNameUser, U.UserIsSuscribed, Ci.CityName, Co.... | true |
36fb11470053b73cc1fdf21bf872aa9d94c47dfb | SQL | BasileBr/discord_vertefeuille_bot | /src/build.sql | UTF-8 | 2,927 | 3.359375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Jobs (
CreatedBy text NOT NULL,
UpdatedBy text NOT NULL,
GuildId bigint NOT NULL,
Job text NOT NULL,
"Name" varchar(100) NOT NULL,
Id SERIAL,
PRIMARY KEY("Name", Job));
CREATE TABL... | true |
201f740330b3cb8eb8c12b2ac7ae16b2267826e0 | SQL | StudiesAndMe/backend-exercise | /src/main/resources/db/migration/V1__tasks.sql | UTF-8 | 498 | 2.703125 | 3 | [] | no_license | CREATE TABLE tasks
(
id VARCHAR(36) NOT NULL PRIMARY KEY,
description TEXT NOT NULL,
createdAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO tasks (id, description) VALUES
... | true |
33000efe958e8efdb9d142077f9e1f3bf855ca28 | SQL | phantoan/liferay7 | /nabook-model/nabook-model-service/bin/META-INF/sql/indexes.sql | UTF-8 | 2,153 | 3.0625 | 3 | [] | no_license | create unique index IX_4CA39AF5 on nab_Address (userId, primary_);
create index IX_FB65AADE on nab_Address (uuid_[$COLUMN_LENGTH:75$], companyId);
create unique index IX_B57750E0 on nab_Address (uuid_[$COLUMN_LENGTH:75$], groupId);
create unique index IX_232133E9 on nab_Book (ISBN[$COLUMN_LENGTH:75$]);
create index IX... | true |
6a7093294f0cf3c3f7bccfd0c6f832c2f52bf8b7 | SQL | cckmit/xinfu | /ccms/WebContent/WEB-INF/action/ccms/module/campaign/objob/webflow/node/edit/query.sql | UTF-8 | 1,080 | 2.78125 | 3 | [] | no_license | SELECT
f.tuid
, f.job_id
, f.node_name
, f.node_type
, f.success_quota
, f.paper_id
, f.wait_time
, f.ob_type
, f.is_auto_assign
, f.remark
, f.grab_flag
, f.grab_skip_flag
, f.grab_flag_scope
, te.term_name as paper_name
, f.sms_template_id
, st.template_name as sms_template_name
, f.mms_template_id
... | true |
1cc09e785aa23981af2f02c26e9bc2184a32bf79 | SQL | tsmarkov/MySQL-Basics | /07. Database Programmability/Exercise/Resources-Databases/queries/03. Town Names Starting With.sql | UTF-8 | 250 | 3.203125 | 3 | [] | no_license | DELIMITER $$
CREATE PROCEDURE usp_get_towns_starting_with(name_start VARCHAR(10))
BEGIN
SELECT t.name AS town_name
FROM towns AS t
WHERE t.name LIKE concat(name_start, '%')
ORDER BY town_name;
END
$$
CALL usp_get_towns_starting_with('b'); | true |
c44677378c82d03472082be75d22e468e0235891 | SQL | gsraskar/tajawal | /workflows/spend_consolidation/spend_consolidation_channelwise.sql | UTF-8 | 84,301 | 3.15625 | 3 | [] | no_license | set hive.mv.files.thread=0;
-- Step 1 : Extract required fields from adjust
DROP TABLE IF EXISTS ${hiveDB}.fact_spend_data_channelwise_inter;
CREATE TABLE IF NOT EXISTS ${hiveDB}.fact_spend_data_channelwise_inter as
select
`date` as dim_date_id,
ds.channel_group,
ds.channel,
apps.group_name,
adj.product,
adj.pos,
'app... | true |
1df0492e6781cf3112a7f677052ec6f32376c292 | SQL | deboprasad-mukh/create-view | /view.sql | UTF-8 | 311 | 3 | 3 | [] | no_license | create view amazon_sales as /*In this example we will create a View named amazon_sales from the table amazon_customers*/
select email,order_id_ /*Add columns you want to see in this view*/
from amazon_customers
where order_year=2019; /*condition*/
select*from amazon_sales; /*check o/p */
| true |
d2af777e077cfa7d5a7278ee61771313561eab1f | SQL | kuzerbaydaulet/Spring-mvc-jasper-integration | /spring-mvc-jasper/db.sql | UTF-8 | 489 | 2.609375 | 3 | [] | no_license | create table emp_master (
emp_code varchar(10),
EmpName varchar(100),
Salary decimal,
Doj date);
-- insert some rows into the table.
insert into emp_master values ("5000","Kumar",4500000,"2004-01-01");
insert into emp_master values ("5001", "Jacob", 4000000, "2002-01-01");
INSERT INTO emp_master VALUES ("5500",... | true |
ff573b22b88039fa4d65b9b00461e9ca5342577a | SQL | luckyagusta/tiketCodingTest | /CodingTest/src/main/java/com/LuckyAndreas/CodingTest/JavaIntermediate/SqlScript/Products.sql | UTF-8 | 426 | 3.171875 | 3 | [] | no_license | -- Table: public."Products"
-- DROP TABLE public."Products";
CREATE TABLE public."Products"
(
"ProductID" numeric NOT NULL,
"ProductName" character varying(50) COLLATE pg_catalog."default",
"UnitPrice" numeric,
"InStock" "char",
CONSTRAINT "Products_pkey" PRIMARY KEY ("ProductID")
)
WI... | true |
51fb0bc17f61322b60d2836ca5a847553051c193 | SQL | guilhermehifi2016/bdr | /dump.sql | UTF-8 | 3,543 | 3.28125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 5.5.27 - MySQL Community Server (GPL)
-- OS do Servidor: Win32
-- HeidiSQL Versão: 8.3.0.4694
-- --------------------------------------------------------
/*... | true |
e13eec3b86b2811057d87c00c70b203c46b20aae | SQL | yankailong/sy_ykl | /database/gm_tool_1.0.18.sql | UTF-8 | 34,305 | 2.78125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 本地
Source Server Version : 50547
Source Host : localhost:3306
Source Database : cishop
Target Server Type : MYSQL
Target Server Version : 50547
File Encoding : 65001
Date: 2018-06-02 18:01:03
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... | true |
4d52b87e906778114a6846e06905a4921d4134a2 | SQL | StefanMonovski/MSSQL | /02.DatabasesIntroduction-Exercise/15.HotelDatabase.sql | UTF-8 | 4,619 | 3.65625 | 4 | [] | no_license | CREATE DATABASE Hotel;
CREATE TABLE Employees (
Id INT IDENTITY NOT NULL,
CONSTRAINT PK_EmployeeId PRIMARY KEY (Id),
FirstName VARCHAR(MAX) NOT NULL,
LastName VARCHAR(MAX) NOT NULL,
Title VARCHAR(MAX) NOT NULL,
Notes VARCHAR(MAX),
);
CREATE TABLE Customers (
AccountNumber INT NOT NULL,... | true |
b7c25d47d3f86fc63bf50b2ce10f8989b7125cf1 | SQL | ministryofjustice/offender-risk-profiler | /src/main/resources/db/migration/common/V1_2__prison_supported.sql | UTF-8 | 487 | 3.15625 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | CREATE TABLE PRISON_SUPPORTED
(
PRISON_ID VARCHAR(6) PRIMARY KEY,
START_DATE_TIME TIMESTAMP NOT NULL
);
COMMENT ON TABLE PRISON_SUPPORTED IS 'Records the prisons which have started using risk profiler';
COMMENT ON COLUMN PRISON_SUPPORTED.PRISON_ID IS 'Prison ID (NOMIS column is Agency ID)';
COMMENT ON C... | true |
2d954a8b4805f8362a29f95620b3a72834e65711 | SQL | brunopurper/target-trust | /1605849/aula07/views.sql | UTF-8 | 526 | 3.375 | 3 | [] | no_license | USE EMPRESA;
CREATE VIEW FOLHA_PAGAMENTO AS
SELECT NOME, SALARIO
FROM FUNCIONARIOS
ORDER BY NOME;
SELECT * FROM FOLHA_PAGAMENTO ORDER BY SALARIO DESC;
# DROP VIEW FOLHA_PAGAMENTO;
CREATE VIEW CRUZAMENTO AS
SELECT F.NOME, T.NUMERO, D.SIGLA
FROM FUNCIONARIOS AS F
INNER JOIN TELEFONES AS T
ON F.ID_F... | true |
1b3b74386e28edc23821008fbfd647813718aa1b | SQL | A00820449/StayHome | /public/sql-queries/arturo2.sql | UTF-8 | 231 | 3.390625 | 3 | [
"MIT"
] | permissive | /*Desplegar actor, con el número de títulos en los que aparece de forma descendente*/
SELECT Name, COUNT(CatalogNo) FROM Actor_Video
LEFT JOIN Actor
ON Actor_Video.ActorID = Actor.ActorID
GROUP BY Name
ORDER BY COUNT(CatalogNo); | true |
cfc7aee48a1d9ae5949c5e1f036fa3ca2c223688 | SQL | buitoan89/codegym_Buivantoan | /Module_02_db/casestude.sql | UTF-8 | 13,213 | 3.59375 | 4 | [] | no_license | drop database if exists furama_resort_tuan_c10g;
create database furama_resort_tuan_c10g;
use furama_resort_tuan_c10g;
CREATE TABLE ViTri(
IDViTri int,
TenViTri NVARCHAR(45) UNIQUE,
PRIMARY KEY(IDViTri)
);
CREATE TABLE TrinhDo(
IDTrinhDo int Primary key,
TrinhDo NVARCHAR(45) UNIQUE
);
CREATE TABLE Bophan(... | true |
e0bebabedfc11f9623ace088fc0f82d2a0231189 | SQL | GautierCo/iTongue | /client/src/data/data.sql | UTF-8 | 2,707 | 3.171875 | 3 | [] | no_license |
/* */
truncate "record" RESTART IDENTITY CASCADE;
/* UPDATE "user" SET "is_admin" = true WHERE id = 5; */
/* Add User */
INSERT INTO "user" ("email", "password", "firstname", "lastname", "slug", "bio", "avatar_url", "is_admin")
VALUES ('zou8@zou.zou', 'zouzou', 'zou', 'zou', 'zou-zou8', 'bio', 'https://ra... | true |
41e7493bce0160d1d2c093b94804144d1649c879 | SQL | QiYuanGit/market | /src/main/resources/sql/market2018-02-06.sql | UTF-8 | 199,812 | 2.984375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 120.78.87.169
Source Server Version : 50718
Source Host : rm-uf69w5es12e5rv2svo.mysql.rds.aliyuncs.com:3306
Source Database : market
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2018-02-06 21:04:... | true |
e9cfd2b3df4378d2d5dfb686ab3c38aa82d04b99 | SQL | zeroest/KITRI_ORACLEDB | /ORACLE_DB 정리/CURSOR.sql | UTF-8 | 4,426 | 4.09375 | 4 | [] | no_license |
http://www.gurubee.net/lecture/1064
cursor 사용 : 반복문
1> 오라클 sql 작업 결과 저장 영역 입니다.
2> 프로그래머에 의해 선언되며 이름이 있는 cursor 정의 가능
3> 조회 결과 메모리 저장 영역 접근 참조 포인터
1. 선언 declare ( is 부분)
cursor 커서이름
is
select first_name from employees
where employee_id >= 300;
-----------------
2. 사용 --(begin 부분)
open cursor이름;
loop
fetch cursor... | true |
2a500fbf89759c60eadf6ae2914c5a9236f4e533 | SQL | agilsmeer/crud-anggota | /database/koperasi.sql | UTF-8 | 1,968 | 3.21875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 22 Agu 2019 pada 18.29
-- Versi Server: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... | true |
9a077d950fb53203b773e48bb4711d427a40a863 | SQL | abruce225/DBS_CW1 | /07.sql | UTF-8 | 303 | 3.390625 | 3 | [] | no_license | SELECT course
FROM (SELECT course, Count(type)
FROM (SELECT DISTINCT course,
type
FROM (programmes
JOIN degrees
ON degree = code)) aggTab
GROUP BY course) finTab
WHERE count = 2;
| true |
8e3b7dae397f16b78cc749e4503471f5af66cda7 | SQL | carlosHernandez3101/Proyecto-Web-Tienda-Generica | /src/main/webapp/BD_Usuarios2.0.sql | UTF-8 | 2,829 | 3.65625 | 4 | [] | no_license | create database bd_tienda_generica;
use bd_tienda_generica;
create table usuarios (
usu_numero_cedula numeric(15,0) not null,
usu_nombre_completo varchar(150) not null,
usu_correo_electronico varchar(50) not null,
p... | true |
d63813af2f41582e5654e99b45cf241076d45a95 | SQL | appu22/SQL-Projects | /amazon tables/amazon.product_details.sql | UTF-8 | 1,984 | 3.859375 | 4 | [] | no_license | create table AMAZON.Product_Details(
P_ID int ,
P_NAME VARCHAR(15),
P_PRICE double ,
primary key (P_ID)
);
SELECT * FROM AMAZON.Product_Details;
USE AMAZON;
DESC AMAZON.product_details;
insert INTO amazon.product_details (P_ID , P_NAME,P_PRICE) VALUES (1,'MOBILE',15000.0);
insert INTO amazon.product_details (P_ID , P_N... | true |
ca56075e2d2beb69b0b6e0e5e6ad72b22d9751ad | SQL | DenBlacky808/SQL | /dz_11_course_proj_3.sql | UTF-8 | 7,352 | 4.09375 | 4 | [] | no_license | -- 1. Создайте таблицу logs типа Archive. Пусть при каждом создании записи в таблицах users,
-- catalogs и products в таблицу logs помещается время и дата создания записи, название таблицы,
-- идентификатор первичного ключа и содержимое поля name.
DROP TABLE IF EXISTS logs;
CREATE TABLE logs (
created_at DATETIME N... | true |
743c01e5c8732981eb8787dde5a3ca6d9e82c450 | SQL | halflite/modern-servlet-example | /api/db/migration/V2_0_2__create_admin.sql | UTF-8 | 583 | 3.5625 | 4 | [
"MIT"
] | permissive | CREATE TABLE `admin` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`account_id` bigint(20) NOT NULL COMMENT 'アカウントid',
`division` varchar(16) NOT NULL COMMENT '役割',
`modified` timestamp NOT NULL COMMENT '更新日時',
`created` timestamp NOT NULL COMMENT '登録日時',
PRIMARY KEY (`id`),
KEY `division` (`div... | true |
6b6b258394e646f38bdc2c0e65c221e074a49821 | SQL | RostislavStoyanov/FMICourses | /databases/databases_project/dataLoad.sql | UTF-8 | 2,709 | 3.1875 | 3 | [] | no_license | set schema 'fn45244';
/* Populate Departments*/
INSERT INTO Department(DepNo,Name,Address)
VALUES (1,'A','Address A'),
(2,'B','Address B'),
(3,'C','Address C');
/* Populate Publisher */
INSERT INTO Publisher(Name,Address)
VALUES ('Pearson','Pearson Address');
/* Populate Person
Random generated strings of lengt... | true |
ff8450c55db98cf78fe6e0e4a509f0d74db2c7f1 | SQL | MarvinJimenez13/SacaLasRetas | /TABLAS/usuarios.sql | UTF-8 | 2,402 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-12-2017 a las 07:06:37
-- Versión del servidor: 10.1.28-MariaDB
-- Versión de PHP: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... | true |
3c08991ea29ba5a11d5d76f84c4bcd63698c5532 | SQL | development2gom/green-tenderos | /tenderos.sql | UTF-8 | 24,596 | 3.0625 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-08-2018 a las 15:51:48
-- Versión del servidor: 10.1.9-MariaDB
-- Versión de PHP: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... | true |
70db0a53872b5b6e0ac793d7d7169fd6fca05634 | SQL | layeh/CWSF-Statistics | /sql/03-regions.sql | UTF-8 | 8,192 | 2.59375 | 3 | [] | no_license | BEGIN TRANSACTION;
INSERT INTO regions(id, name) VALUES(1, "Other");
INSERT INTO regions(id, name) VALUES(2, "Annapolis Valley");
INSERT INTO regions(id, name) VALUES(3, "Central Newfoundland");
INSERT INTO regions(id, name) VALUES(4, "Chignecto Central West");
INSERT INTO regions(id, name) VALUES(5, "Chignecto East")... | true |
c9a2fb4fccfed4f844da6e02977f543e0fb8a493 | SQL | Savareen/time-management | /src/main/resources/db/migration/V1__create_users.sql | UTF-8 | 238 | 2.609375 | 3 | [] | no_license | create table users (
id BIGINT NOT NULL PRIMARY KEY,
email VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(250) NOT NULL,
role VARCHAR(50) NOT NULL,
user_type VARCHAR(50) NOT NULL
);
CREATE SEQUENCE user_sequence as BIGINT INCREMENT 1; | true |
9330d2989df94d8c28c9b34edfb4de276bc1ac18 | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01318_map_add_map_subtract.sql | UTF-8 | 3,615 | 3.265625 | 3 | [
"BSL-1.0",
"Apache-2.0"
] | permissive | drop table if exists map_test;
create table map_test engine=TinyLog() as (select ([1, number], [toInt32(2),2]) as map from numbers(1, 10));
-- mapAdd
select mapAdd([1], [1]); -- { serverError 43 }
select mapAdd(([1], [1])); -- { serverError 42 }
select mapAdd(([1], [1]), map) from map_test; -- { serverError 43 }
selec... | true |
599874ce00bf6000cba5bfb0684be715c8e5fab0 | SQL | erda-project/erda | /pkg/database/sqlparser/testdata/320-1.sql | UTF-8 | 1,778 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | -- 3.20 模型变更
-- SLA 相关模型
-- SLA 表
CREATE TABLE IF NOT EXISTS dice_api_slas
(
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY COMMENT 'primary key',
created_at DATETIME COMMENT 'create time',
updated_at DATETIME COMMENT 'update time',
creator_id VARCHAR(191) COMMENT 'creator id',
updater_id V... | true |
dee37552040c151c3c78eb8967e7c780d5527307 | SQL | yingchauhuang/rsit | /db/Merge_Event.sql | UTF-8 | 2,272 | 3.609375 | 4 | [] | no_license | Update XQ.TW003 Set Market='T1',STK_CD=trim(SYMBOL);
Update XQ.TW003
set Market=(select Market from XQ.TW001 WHERE XQ.TW003.STK_CD=XQ.TW001.STK_CD )
where XQ.TW003.STK_CD in (select STK_CD from XQ.TW001 where STK_CD is not null);
whenever sqlerror exit 100
MERGE INTO SYSTEX.FSK984 D
USING (SELECT STK_CD,to_CHAR(tD... | true |
c68805be2c38b53ce03bd097a517fabcaba5f9d5 | SQL | JaimieMurdock/lastfm | /sql/migration/03-annotations.sql | UTF-8 | 853 | 3.65625 | 4 | [] | 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';
DELETE `lastfm_annotations`
FROM `lastfm_annotations`
LEFT OUTER JOIN `lastfm_extended_user_info`
ON `lastfm_extended_user_info`.`use... | true |
9c40e32652ab0b0fa3996cd48d1da04a485c6680 | SQL | denysantos/projetos_ds | /assets/sql/classificados_mvc_20181019_DDL.sql | UTF-8 | 1,716 | 3.25 | 3 | [] | no_license | /*
* DB Script Tool
* MySQL - 2018-10-19 22:52:24
*
*/
CREATE DATABASE IF NOT EXISTS `classificados_mvc`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE `classificados_mvc`;
/*
* usuarios
* 2018-10-19 00:15:40
*/
DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE IF NOT EXISTS `usuarios... | true |
c299173928b30ec65928bcb94beb42605b3a8000 | SQL | CCI-MOC/reporting | /docker-images/init-db/src/db/hardware_inventory/constraints/service_fk.sql | UTF-8 | 190 | 2.984375 | 3 | [] | no_license |
ALTER TABLE hardware_inventory ADD CONSTRAINT service_hardware_inventory_fk
FOREIGN KEY (service_id)
REFERENCES service (service_id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE;
| true |
b5ddd51ce8f25095b9163b167404d993af3ee757 | SQL | anticmarija/webshop | /webshop.sql | UTF-8 | 13,453 | 2.828125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 30, 2017 at 11:13 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 |
00af6bc5251e047b7d39dd35fd8c43c89b9b3570 | SQL | noaoh/RegisterAPIDataDefinition | /Transaction.sql | UTF-8 | 433 | 3.1875 | 3 | [] | no_license | CREATE TABLE transaction (
id uuid NOT NULL DEFAULT gen_random_uuid(),
quantity int NOT NULL DEFAULT(1),
totalcost float(25) NOT NULL DEFAULT(0.00),
createdon timestamp without time zone NOT NULL DEFAULT now(),
product uuid,
employee uuid,
CONSTRAINT transaction_pkey PRIMARY KEY (id, product),
FOREIGN K... | true |
b534887b7b781f7c2f9f0550de39f72de53c2f0b | SQL | hongzihan/newtest | /sql.sql | UTF-8 | 9,945 | 3.421875 | 3 | [] | no_license | -- ----------------------------
-- Table structure for tb_user
-- ----------------------------
DROP TABLE IF EXISTS `tb_item`;
CREATE TABLE `tb_item` (
`id` bigint(25) NOT NULL AUTO_INCREMENT,
`keyname` varchar(255) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`count` int(11) DEFAULT NULL,
PRIMARY KEY ... | true |
88c7315c82f6163517e022ff53a8015818e8e72d | SQL | Migu3lR/Web-Anapoima-Natura | /booking/app/config/updates/update_2015_03_30_00_00_00.sql | UTF-8 | 414 | 2.828125 | 3 | [] | no_license |
START TRANSACTION;
ALTER TABLE `bookings` CHANGE `status` `status` ENUM( 'confirmed', 'cancelled', 'pending', 'not_confirmed' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'pending';
ALTER TABLE `bookings` DROP `currency` ;
ALTER TABLE `bookings_rooms` ADD `price` DECIMAL( 9, 2 ) UNSIGNED NU... | true |
5f06c5e8e1c51c82f476176832cfba29db73106b | SQL | seosooseong/oraclesource | /system1104.sql | UHC | 1,268 | 3.671875 | 4 | [] | no_license | -- scott (scott) ȣ(tiger) ϱ
alter user scott identified by tiger account unlock;
-- hr (hr) ȣ(12345) ϱ
alter user hr identified by 12345 account unlock;
--ο (ο Ű ) TEST / 12345
CREATE USER TEST IDENTIFIED BY 12345;
--1. "Ѻο!" ( ο)
grant create session to test;
--2. ۾ ִ ο
GRANT CONNECT, RESOURCE TO... | true |
7de82c02274ce1d42b2bdba4d5014e3f894fe41f | SQL | surprise777/DBMS2019 | /p1/q4.sql | UTF-8 | 1,370 | 3.875 | 4 | [] | no_license | SET search_path TO parlgov;
/* Get cabinet_sequence */
CREATE TABLE cabinet_sequence AS
SELECT country_id, id, start_date, end_date FROM
(SELECT START_PART.country_id, START_PART.id, START_PART.start_date, END_PART.start_date AS end_date FROM
(SELECT country_id, id, start_date, previous_cabinet_id FROM cabinet) AS EN... | true |
4dd6eb26adfcef5d79694d7f09aebf744b4bf7de | SQL | 18089396a47/Server | /src/main/db/chat.sql | UTF-8 | 3,128 | 3.125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: chat
-- ------------------------------------------------------
-- Server version 5.6.24-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... | true |
85e6289a5625fec0fd64d79f0cd7be98ffd07321 | SQL | Marto86/MSSQL-EntityFramework | /MSSQL/HACKERRANK/Binary Tree Nodes.sql | UTF-8 | 246 | 4.125 | 4 | [] | no_license | SELECT CAST(N AS NVARCHAR(10)) + ' ' +
CASE
WHEN P IS NULL THEN 'Root'
WHEN N IN (SELECT DISTINCT P
FROM BST) THEN 'Inner'
ELSE 'Leaf'
END
FROM BST AS b
ORDER BY N | true |
21fc52f7f7419de684c28f5017b984a3508f3412 | SQL | nhabbash/search-form-devops | /db/script/init.sql | UTF-8 | 6,504 | 3.5 | 4 | [] | no_license | CREATE TABLE IF NOT EXISTS articles (
id int,
title text NOT NULL,
author text NULL,
description text NULL,
PRIMARY KEY(id)
);
INSERT INTO articles VALUES
(1, 'Example', 'Federico Bottoni', 'Example of a scientific article.'),
(2, 'Testing ', 'Nassim Habbash', 'Another example of a scientific article.'... | true |
ae56a34386e3dcb677f903ddd6d18aab1460c584 | SQL | econne01/econey-investing | /src/app/schema.sql | UTF-8 | 697 | 2.953125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS stocks (
date date not null,
ticker text not null,
volume real not null,
price real not null
);
CREATE TABLE IF NOT EXISTS results_year (
ticker text not null,
year smallint not null,
revenue real null,
interest real null,
net_income real null
);
CREATE UNIQUE INDEX IF NOT ... | true |
04536ff0e5ce8d19d0d7d1295ca67d2934669254 | SQL | yerkeboolan/DB_2018Spring | /Labs/Lab[6].sql | UTF-8 | 1,614 | 4.25 | 4 | [] | no_license | create table locations (
location_id serial primary key,
street_address varchar(25),
postal_code varchar(12),
city varchar(30),
state_province varchar(12)
);
create table departments (
department_id serial primary key,
department_name varchar(50) unique,
budget integer,
location_id integer references location... | true |
7837ef66c8808ba2a5b1e45616d1192a4a985af0 | SQL | A-DiRusso/DigitalCrafts-Developer-in-Res | /todo-app-2019/schema.sql | UTF-8 | 264 | 3.125 | 3 | [] | no_license | create table users (
id serial PRIMARY key,
displayname VARCHAR(100),
username VARCHAR(100)
);
create table tasks (
id serial PRIMARY key,
priority integer,
task VARCHAR(100),
status boolean DEFAULT false,
user_id integer REFERENCES users(id)
);
| true |
1385d76dcc5a01826f0dc6752d9e11112bbc2455 | SQL | vijitdesilva/sql-challenge | /EmployeeSQL/Query.sql | UTF-8 | 3,016 | 4.625 | 5 | [] | no_license | --List the following details of each employee: employee number, last name, first name, sex, and salary.
SELECT employees.emp_no AS "employee number",
employees.last_name AS "last name",
employees.first_name AS "first name",
employees.sex, salaries.salary
FROM employees
JOIN salaries
ON(employees.emp_no= salaries.emp... | true |
64f402810aa3dc41d8e7e5e381a4682b57ae2afb | SQL | Cheep2Workshop/Proj_web | /cmd/sql/7_orderalter.up.sql | UTF-8 | 190 | 2.734375 | 3 | [] | no_license | ALTER TABLE `order_details`
ADD COLUMN `order_id` BIGINT,
ADD FOREIGN KEY(`order_id`) REFERENCES `orders`(`id`);
ALTER TABLE `orders`
ADD FOREIGN KEY (`user_id`) REFERENCES `users`(`id`);
| true |
1da17c534d4edc7253ae440ddf3c274a47613b03 | SQL | mohamedhaouali/scratch | /hireo.sql | UTF-8 | 20,273 | 2.765625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mar. 12 nov. 2019 à 12:39
-- Version du serveur : 10.1.37-MariaDB
-- Version de PHP : 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... | true |
1416de690c086425e35dfc81084d1c77207c542d | SQL | nitrajka/paymentsAPI | /queries.sql | UTF-8 | 301 | 3.09375 | 3 | [
"MIT"
] | permissive | -- name: GetPayment :one
SELECT * FROM payments
WHERE id = $1;
-- name: GetPayments :many
SELECT * FROM payments;
-- name: CreatePayment :one
INSERT INTO payments (amount, description, sender, datetime)
VALUES ($1, $2, $3, $4) RETURNING *;
-- name: GetBalance :one
SELECT sum(amount) FROM payments; | true |
0269ce2745610e632df6dcbe281c6adb95662cab | SQL | henuliyanying/partySys | /party.sql | UTF-8 | 152,370 | 2.859375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : mysql 5.7
Source Server Version : 50731
Source Host : localhost:3306
Source Database : party
Target Server Type : MYSQL
Target Server Version : 50731
File Encoding : 65001
Date: 2021-03-30 10:51:43
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... | true |
ed4ce757bcce8f87e773381eed6df0d6211887a0 | SQL | pronull/springbootdemo | /myspringboot/dao/src/main/resources/sql/v1.0.1.sql | UTF-8 | 1,501 | 3.015625 | 3 | [] | no_license | use myDB;
CREATE TABLE `user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`name` varchar(12) DEFAULT '' COMMENT '名称',
`age` int(3) unsigned DEFAULT 0 COMMENT '年龄',
`height` decimal(3,2) unsigned DEFAULT 0.00 COMMENT '身高',
`weight` decimal(3,2) DEFAULT 0.00 COMMENT '重量',
`telephone` v... | true |
3cc10912b26eceb4d7ef3167b1049c4bc999cbda | SQL | NickolaiWinther/FancyClothes | /fancyclothes.sql | UTF-8 | 5,556 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Vært: 127.0.0.1
-- Genereringstid: 28. 06 2019 kl. 09:25:48
-- Serverversion: 10.1.40-MariaDB
-- PHP-version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... | true |
43051dbdfc154e9f8cf6fca4f3af98e4bbe2801e | SQL | hippobyte/ClarityPPM | /Departments/bucio_group_mapping.sql | UTF-8 | 807 | 3.25 | 3 | [] | no_license | SELECT D.DEPARTCODE, D.DESCRIPTION, G.GROUP_NAME BUCIO_GROUP, L3.NAME DEPARTMENT_NAME
FROM DEPARTMENTS D,
ODF_CA_DEPARTMENT DD,
OBS_UNITS_V O,
(SELECT * FROM CMN_SEC_GROUPS_V WHERE LANGUAGE_CODE = 'en') G,
(SELECT UNIT_ID, UNIQUE_NAME, NAME
FROM WARM01.OBS_UNITS_V
WHERE ... | true |
1e24c737b96940a0cdf41df69ba339451b377aaa | SQL | XianFeng-GitHubPortfolio/SQLZoo | /7b. JOIN quiz 2.sql | UTF-8 | 2,068 | 4.53125 | 5 | [] | no_license | -- 1. Select the statement which lists the unfortunate directors of the movies which have caused financial loses (gross < budget).
SELECT
name
FROM
actor INNER JOIN movie ON actor.id = director
WHERE
gross < budget;
-- 2. Select the correct example of JOINing three tables.
SELECT
*
FROM
actor... | true |
e03586fb95fea553681a76684100dd0d651b9cea | SQL | BancoDatosNaturaleza/Listas_IEPNB | /Sentencias_SQL/Sentencias_LC/LC_IFN_ImportanciaDanio.sql | UTF-8 | 553 | 2.515625 | 3 | [] | no_license | CREATE TABLE "LC_IFN_IMPORTANCIADANIO"
( "ID_IMPORTDANIO" NUMBER(1) NOT NULL,
"NB_IMPORTDANIO" VARCHAR2(20) NULL,
CONSTRAINT "PK_LC_IFN_IMPORTANCIADANIO" PRIMARY KEY ("ID_IMPORTDANIO")
)
;
/*Insert "LC_IFN_IMPORTANCIADANIO"*/
Insert into LC_IFN_IMPORTANCIADANIO
(ID_IMPORTDANIO,NB_IMPORTDANIO)
va... | true |
62e0fc5bf20f9f3f88ff6e38f28bb9386470880e | SQL | mslisa/MIDS-W205 | /exercise_1/transforming/hospitals.sql | UTF-8 | 402 | 3 | 3 | [] | no_license | DROP TABLE IF EXISTS hospitals;
CREATE TABLE hospitals
ROW FORMAT DELIMITED
STORED AS TEXTFILE
AS
SELECT
ProviderID providerID
,HospitalName hospitalName
,Address address
,City city
,State state
,ZIPCode zip
,CountyName county
,PhoneNumber phone
,HospitalType hospitalType
,HospitalOwnership ho... | true |
cb9567d271dcfc433dbc87c838873dd616e010f8 | SQL | yunhy97/SQL-Study | /JSP관련 SQL 1_1.sql | UHC | 1,761 | 4.15625 | 4 | [] | no_license | --ֱ
--åȣ 5° å ȸϱ
select num, book_no, book_title,book_writer, book_price
from (select row_number() over(order by book_no desc) num , book_no, book_title,book_writer, book_price
from sample_books)
where num <=5 ;
select book_no, book_title,book_writer, book_price
from (select book_no, book_title,book_wri... | true |
83a8c6e7a5e6d05570d0194cd160433cfeed5c02 | SQL | ProfDema/uam | /pam/examples/anon_data/group_0085/a2.sql | UTF-8 | 3,956 | 4.125 | 4 | [] | no_license | -- Add below your SQL statements.
-- You can create intermediate views (as needed). Remember to drop these views after you have populated the result tables.
-- You can use the "\i a2.sql" command in psql to execute the SQL commands in this file.
SET search_path TO A2;
-- Query 1 statements
CREATE VIEW mytable AS
SE... | true |
29dda1ad5c0635f7d887e398b5afcd03719dce93 | SQL | BourdonAlexis/Depot-Git | /Eval sql/Exercice 2 - 4 - Liste des clients Français ayant plus de 10 commandes.sql | UTF-8 | 247 | 3.96875 | 4 | [] | no_license | SELECT CompanyName AS 'Client', COUNT(orders.CustomerID) AS 'Nombres de commandes'
FROM customers
JOIN orders
ON customers.CustomerID = orders.CustomerID
WHERE customers.Country = 'France'
GROUP BY CompanyName
HAVING COUNT(orders.CustomerID) > 10; | true |
4df9da7d75e7e92fb679e44a768afd49fcdaa9fb | SQL | Git-PedroNeri/syslog-api | /src/main/resources/db/migration/V003__create-table-entrega.sql | UTF-8 | 529 | 2.96875 | 3 | [] | no_license | create table if not exists entrega (
id bigint auto_increment,
cliente_id bigint not null,
taxa decimal (10,2) not null,
status varchar(20) not null,
dt_pedido datetime not null,
dt_finalizacao datetime,
destinatario_nome varchar(60) not null,
destinatario_logradouro varchar(255) not null,
destinatario_numero varchar(3... | true |
7f7835324a8e377597d2ecbb4cdeca5bce4a5bf6 | SQL | nixsala/Motor-Ride-SSD- | /WebContent/MySQLdatabase/motorbike_bike.sql | UTF-8 | 3,255 | 2.984375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `motorbike` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `motorbike`;
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: motorbike
-- ---------------------------------------------------... | true |
7dba5363514818b3d7b8a3f5ca4e5697b5c05111 | SQL | Aman100/Distribution-Management-System | /src/main/java/com/dms/script.sql | UTF-8 | 3,627 | 3.3125 | 3 | [] | no_license | CREATE TABLE retailer_sales_report
(
c_id INT,
r_id INT,
FOREIGN KEY(r_id) references retailer(r_id),
FOREIGN KEY(c_id) references customer(c_id),
simcards_sold INT,
recharge_coupons_sold INT,
e_topups_sold INT
);
CREATE TABLE sim_cards
(
sim_id INT PRIMARY KEY AUTO_INCREMENT,
sim_name varchar(25) UNIQUE... | true |
5867a3292cbf6a9441cb015a045f615cf1d0c16b | SQL | Naveen-8451/5303-Database-NaveenSheela | /sql_query.sql | UTF-8 | 4,419 | 3.6875 | 4 | [] | no_license |
### Title : Sql Flight Assignment
### Naveen Kumar Sheela
### Question 1
Print a passenger list for flight 3 on 4-1
SQL:
```
select name from passengers join pass_ticketed
on passengers.passid=pass_ticketed.passid where pass_ticketed.fltno=3
and pass_ticketed.date='4-1'
```
### Answer:
```
SELECT name
FROM pi... | true |
9ad61baea73598751ae0cfde8e91b1f16feac00e | SQL | IrohTwelve/SQLqueries | /SQLQuery17(done).sql | UTF-8 | 217 | 4.1875 | 4 | [] | no_license | SELECT ContactName, COUNT(OrderID) AS OrdersFromFrance
FROM Orders INNER JOIN Customers
ON Orders.CustomerID = Customers.CustomerID
WHERE Customers.Country LIKE 'France'
GROUP BY ContactName
HAVING COUNT(OrderID) > 1 | true |
aabbf0b4d5d193ab3357263342d19739d68bd4f0 | SQL | ujjwalsinghdev/database_sql | /2_CRUD.sql | UTF-8 | 1,120 | 3.859375 | 4 | [] | no_license | CREATE database cats;
USE cats;
create table cats
(
cat_id INT NOT NULL auto_increment,
name VARCHAR(100),
breed VARCHAR(100),
age INT,
PRIMARY KEY (cat_id)
);
DESC cats;
INSERT INTO cats(name,breed,age)
VALUES ('Ringo','Tabby',4),
('Cindy','Maine Coon',10),
('Dumbledore','Maine Coon',11),
('Egg','Persian',4),
('Mi... | true |
9615e6e7bc13f650226dbd58bf3150fbbd5f7f89 | SQL | radtek/abs3 | /sql/mmfo/bars/ForeignKey/tamozhdoc.sql | UTF-8 | 2,140 | 3.078125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/Bars/ForeignKey/TAMOZHDOC.sql =========*** Run **
PROMPT =====================================================================================
PROMPT *** Create constrain... | true |
444f31fae84f8b92df5e71360b00fd85d1dd1687 | SQL | mrsprut/ASPNET-AKL-CONTENT-TOTE | /AKL-CONTENT-TOTE/init.sql | UTF-8 | 1,444 | 2.671875 | 3 | [] | no_license | USE [Fake_SAP]
CREATE TABLE [AKL_CONTENT_TOTE] (
[id] INT IDENTITY PRIMARY KEY NOT NULL,
[vlenr] CHAR(20) NOT NULL,
[aufnr] CHAR(12) NOT NULL,
[matnr] CHAR(18) NOT NULL,
[charg] CHAR(10) NOT NULL,
[menge_aufnr] DECIMAL(16, 3) NULL,
[menge_source] DECIMAL(16, 3) NULL,
[menge_target] DECIM... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.