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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
226ab43e5b5176ffa466b6579ef83bedfa1f27cc | SQL | ktbarr/TechElevator-Mod2 | /01_Introduction_to_Databases/student-lecture/postgres/lecture-queries.sql | UTF-8 | 2,900 | 4.40625 | 4 | [] | no_license | -- SELECT ... FROM
-- Selecting the names for all countries
SELECT * -- means all columns, will run full database
FROM country;
SELECT name
FROM country;
-- Selecting the name and population of all countries
SELECT name
, population
FROM country;
-- Selecting all columns from the city table
... | true |
b4de0b1534a1b67353723b51f109d0541b309f57 | SQL | beatrizodorcik/modulo-2 | /Banco de Dados/Ex 01-12/ex3-rh.sql | UTF-8 | 2,421 | 3.375 | 3 | [] | no_license | -- create database rh;
-- use rh;
-- create table funcionarios(
-- codigo int(3) auto_increment,
-- nome varchar(50) not null,
-- cargo varchar (20) not null,
-- email varchar (50) not null,
-- salario float not null,
-- primary key (codigo)
-- );
-- insert into funcionarios (codigo, nome, c... | true |
fa546ff5b8c4ed78a9ce8c9a05f594aa1a9cbbc6 | SQL | ife2015/LightBnB | /1_queries/property_listing_by_city.sql | UTF-8 | 356 | 3.71875 | 4 | [] | no_license | --avg(end_date - start_date ) as average_duration
SELECT properties.id, title, cost_per_night, avg(property_reviews.rating) as average_rating
FROM properties
JOIN property_reviews ON property_reviews.property_id = properties.id
WHERE city LIKE '%ancouv%'
GROUP BY properties.id
HAVING avg(property_reviews.rating) >= 4... | true |
56c567f1b446419ec54af1cdb7392418833f8bc6 | SQL | jearistiz/cs50x-intro-to-cs | /pset7/movies/11.sql | UTF-8 | 236 | 3.890625 | 4 | [] | no_license | SELECT movies.title FROM
movies JOIN ratings
ON movies.id = ratings.movie_id
WHERE id IN
(
SELECT movie_id FROM stars
WHERE person_id IN
(
SELECT id FROM people
WHERE name = "Chadwick Boseman"
)
)
ORDER BY ratings.rating DESC
LIMIT 5; | true |
18e1adc0db6b0d5390068a1ee6646b143bfab45d | SQL | honglou2001/web1 | /dbtest.sql | UTF-8 | 42,460 | 3.03125 | 3 | [] | no_license | -- --------------------------------------------------------
-- 主机: 120.24.176.185
-- 服务器版本: 5.6.10 - MySQL Community Server (GPL)
-- 服务器操作系统: linux-glibc2.5
-- HeidiSQL 版本: 8.3.0.4694
-- ----------------------------------------------... | true |
fe56dfee1ae69c0d996a1a9536c1536a6fb2695f | SQL | huahuajiujiu/i365day | /data/sql/feed_content.sql | UTF-8 | 653 | 3.109375 | 3 | [] | no_license | CREATE TABLE `feed_content` (
`feed_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'feed id',
`user_id` int(11) unsigned NOT NULL COMMENT 'feed发布者id',
`user_name` char(64) NOT NULL COMMENT 'feed发布者昵称',
`type` tinyint(2) unsigned NOT NULL COMMENT 'feed类型',
`content` text NOT NULL COMMENT 'feed内容',
`sta... | true |
6f30b05c57d6b8115f63aae09fa8431c5954ee45 | SQL | shawnlmx/Portfolio_Projects | /Covid Project.sql | UTF-8 | 4,778 | 4.21875 | 4 | [] | no_license | --Select *
--From [Portfolio Project].dbo.Covid_Deaths
--Select *
--From [Portfolio Project].dbo.Covid_Vaccinations
--Select data that we will be using
Select continent, Location, date, total_cases, new_cases, total_deaths, population
From [Portfolio Project].dbo.Covid_Deaths
Order by 2
--Looking at Tot... | true |
3e1ba7ff3f10b90cc309de5f9e07c4e20f6ac878 | SQL | AniAntonio/e-learning | /src/main/resources/db/sql/create-customers.sql | UTF-8 | 210 | 2.65625 | 3 | [] | no_license | DROP TABLE CUSTOMERS IF EXISTS;
CREATE TABLE CUSTOMERS (
CUSTOMER_ID VARCHAR(25) PRIMARY KEY,
NAME VARCHAR(50),
ADDRESS VARCHAR(250),
NUMBER_OF_ORDERS BIGINT,
VALID BOOLEAN
); | true |
0f05a183985abdc76df1a8566e965a5e8d14b2b0 | SQL | nortonlyr/SQL.LetsGetTogether | /answers/exercise3.sql | UTF-8 | 269 | 3.625 | 4 | [] | no_license | -- Choose the correct JOIN clause to select all
-- the records from the Students table plus all the matches in the Enrolments table.
-- (Add your query to the file exercise3.sql)
SELECT *
FROM Enrolments
FULL JOIN Students
ON Enrolments.StudentID=Students.StudentID; | true |
268844a4ed2a6d21b3b2b94e4c91ae4ed1f1d222 | SQL | johnjosephhorton/northwind_examples | /case_when_midrange.sql | UTF-8 | 266 | 3.53125 | 4 | [] | no_license | -- You try it: Make a table with a field showing whether a price is between $5 and $10, restricted to products with a price less than $15.
SELECT Price,
CASE WHEN Price > 5 AND Price < 10 THEN ‘t’
ELSE ‘f’ END AS midrange
FROM Products
WHERE Price < 15;
| true |
5ec571128828096abaa167349463da0771660123 | SQL | JordanPaoletti/WhatsThis | /sql/tables.sql | UTF-8 | 2,034 | 3.875 | 4 | [
"MIT"
] | permissive | CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(50) NOT NULL,
post_points INTEGER DEFAULT 0,
answer_points INTEGER DEFAULT 0,
admin BOOLEAN DEFAULT FALSE
);
CREATE TABLE classroom (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL
);
CREATE TABLE classroom_users (
class_id INTEGER NOT NUL... | true |
d282060fce7df8acc77ded1b86f19d84ab5e85d0 | SQL | sharonpete/sql-challenge | /data/build_tables.sql | UTF-8 | 2,844 | 3.796875 | 4 | [] | no_license | -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- Link to schema: https://app.quickdatabasediagrams.com/#/d/WeSRNv
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
CREATE TABLE "departments" (
"dept_no" varchar NOT NULL,
"dept_name" varchar N... | true |
6f655817696737eb49164b94e47357ebd081bba8 | SQL | adrielsaul/Database_Steam | /Pesquisas/query_jogosmaiscaros.sql | UTF-8 | 74 | 2.640625 | 3 | [] | no_license | SELECT name, price
from steam
group by appid
order by price DESC
limit 10; | true |
a3fe2bffb7882f0d3982119a30b8c794ef17ca6c | SQL | djrobstep/migra | /tests/FIXTURES/constraints/b.sql | UTF-8 | 562 | 3.953125 | 4 | [
"Unlicense"
] | permissive | create table b(bb int primary key);
create table t2(a int, bb int references b(bb) DEFERRABLE INITIALLY deferred);
create table t1(a int primary key, price numeric, constraint x check (price > 0));
create table c(cc int unique);
CREATE UNIQUE INDEX c_pkey ON public.c USING btree (cc);
alter table "public"."c" add ... | true |
b0d71fd772de6973f1b190dfb20d2c900edc6239 | SQL | vijayk0747/Learning-SQL | /SQL Practice/Procedures/Procedure1.sql | UTF-8 | 215 | 2.796875 | 3 | [] | no_license | CREATE PROCEDURE uspCountriesEurope AS
SELECT tc.CountryName
FROM tblCountry tc
GROUP BY tc.CountryName, tc.ContinentID
HAVING tc.ContinentID = 3
ORDER BY CountryName ASC
EXEC uspCountriesEurope | true |
a385e592527b69bf791f9652852b0d1c925386a3 | SQL | yourbeagle/tugasAkhir | /mahasiswa_sakti.sql | UTF-8 | 3,116 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 16, 2021 at 05:35 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
86679c657c5fda3df5976f165554bbdef1728da6 | SQL | virknigar/EatFresh | /eatfresh_database.sql | UTF-8 | 6,989 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2017 at 04:43 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
b5fe1aa4f49eb1f146e3908914ba2e17a1ce849a | SQL | median-man/Bamazon | /test/fixtures/seedTestDB.sql | UTF-8 | 344 | 2.734375 | 3 | [] | no_license | INSERT INTO departments(name, over_head_costs)
VALUES
('Accessories', 2000),
('Sports', 2400);
INSERT INTO products(product_name, department_name, price, stock_quantity, sales)
VALUES
('The Bobcat Mullet', 'Accessories', 9.99, 6, 0),
('The AB Hancer', 'Sports', 30.00, 5, 300.00);
SELECT * FROM products;
SEL... | true |
93930ba307494511172aac819686159230908e0d | SQL | PrathivRajan/Dependency-dropdown-using-php | /dependency.sql | UTF-8 | 5,885 | 2.71875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 03, 2020 at 05:41 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... | true |
96bd20ccbbaa4c5b9f0aa85c0036d08a01ad2603 | SQL | caarloshenrique/sql-exercises | /List_03/Exercise_06.sql | UTF-8 | 904 | 3.09375 | 3 | [
"MIT"
] | permissive | --exercicio 6
--select aninhado
SELECT DESCRICAO_CATEG
FROM CATEGORIA_LIVRO
WHERE ID_CATEG IN (SELECT CATEG_ID
FROM LIVRO
WHERE ID_LIVRO IN (SELECT LIVRO_ID
FROM AUTORIA
WHERE AUTOR_ID IN (SELECT ID_AUTOR
... | true |
409f34d2f03bd97f09e807dca664a5cc9c859ada | SQL | javs12/Oracle-scrips | /funcion.sql | UTF-8 | 256 | 2.953125 | 3 | [] | no_license | create or replace FUNCTION MONTOANIO
(
anio IN number
, t IN number
) RETURN NUMBER AS
m Integer;
BEGIN
select sum(decode (to_char(fecha,'yyyy'),anio ,monto,0)) into m from cabpres c where c.TIPCTE = t;
RETURN m;
END MONTOANIO; | true |
3bafc817cba09ebe8f4c689510c207efeae08f66 | SQL | Alfa512/AirPro-Diagnostics | /AirPro.Database/Diagnostic/Tables/Tools.sql | UTF-8 | 237 | 2.6875 | 3 | [] | no_license | CREATE TABLE [Diagnostic].[Tools] (
[DiagnosticToolId] INT IDENTITY (1, 1) NOT NULL,
[DiagnosticToolName] NVARCHAR (50) NULL,
CONSTRAINT [PK_Diagnostic.Tools] PRIMARY KEY CLUSTERED ([DiagnosticToolId] ASC)
);
| true |
e2b55f9c1f4ac8c3b0f685df97ca780773b199b0 | SQL | ogobrecht/sample-data-sets-for-oracle | /order_entry_human_resources/_refresh_data.sql | UTF-8 | 632 | 2.515625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | set define on serveroutput on trimspool on verify off feedback off linesize 240
whenever sqlerror exit sql.sqlcode rollback
timing start refresh_data
column date_time new_val date_time noprint
select to_char(sysdate,'yyyymmdd_hh24miss') as date_time from dual;
spool _logs/&date_time._refresh_data.log
prompt
prompt Ref... | true |
74759fa4eef812ac8dec4407de58d855b2c4e1fe | SQL | iCrouk/plsql | /06 2004.sql | ISO-8859-1 | 11,846 | 3.296875 | 3 | [] | no_license | prompt Borrado de tablas ****************************************************
drop table conductores_viajes cascade constraints;
drop table viajes cascade constraints;
drop table pedidos cascade constraints;
drop table tipos_mercancia cascade constraints;
drop table clientes cascade constraints;
drop table cond... | true |
6b1e1b1eda6850a11bdbb43666e0cacca306e11b | SQL | daveweir98/ca218 | /lab-6/q.6.5.sql | UTF-8 | 305 | 3.875 | 4 | [] | no_license | SELECT c.name, f.title, AVG(DATEDIFF(r.return_date, r.rental_date))
FROM rental r, film f, film_category fc, category c, inventory i
WHERE r.inventory_id = i.inventory_id
AND i.film_id = f.film_id
AND f.film_id = fc.film_id
AND fc.category_id = c.category_id
GROUP BY f.film_id
ORDER BY f.title
| true |
c51dd5d635997c2957862088436af878835d18e8 | SQL | confused1108/hackference_iIITg | /talent.sql | UTF-8 | 10,922 | 3.046875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 26, 2018 at 03:53 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... | true |
5e6f690b7d54f010d8a9239fad4eefa10c9cf339 | SQL | victor-ng/UnADM | /DBDD/unidad3/U3_EvidenciaAprendizaje_Informe.sql | UTF-8 | 4,998 | 3.859375 | 4 | [] | no_license | use ayudaparatodos;
/* -----------------------------------------------------------
A) Datos personales y sus beneficios
----------------------------------------------------------- */
SELECT A.id_beneficiario AS Id,
CONCAT(A.nombre, ' ', A.apellido_paterno, ' ', A.apellido_materno) AS Beneficiario,
A.Edad, A... | true |
d2b93b796948230be7d84248379a7ab6e9cb846c | SQL | tien-ho/centri-web-poc | /reader/conf/evolutions/dataship/1.sql | UTF-8 | 1,811 | 3.578125 | 4 | [] | no_license | # --- Creates individual_lookup and individual_data tables for the first time.
# --- !Ups
CREATE TABLE IF NOT EXISTS individual_data(
individual_id VARCHAR(255) UNIQUE NOT NULL,
consumer_id VARCHAR(255) NOT NULL,
schema_name VARCHAR(255) NOT NULL,
schema_version VARCHAR(255) NOT NULL,
created_at TIMESTAMP W... | true |
7bb61cdda95292135ed61c3140a983488c28384f | SQL | cdjflxk/ecshop_flxk | /xkshop/data/xkshop-2011-08-31.sql | UTF-8 | 1,681 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2011 年 08 月 31 日 09:26
-- 服务器版本: 5.5.9
-- PHP 版本: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... | true |
86c00f0308ead3eb2aab9cdd2f4a67764fd41506 | SQL | Raudbjorn/knapsack-optimizer-service | /conf/database/UPDATE_STATUS_TIME.sql | UTF-8 | 551 | 3.09375 | 3 | [] | no_license | CREATE TRIGGER IF NOT EXISTS UPDATE_STATUS_TIME
AFTER UPDATE OF STATUS
ON TASK
FOR EACH ROW
BEGIN
UPDATE TASK
SET SUBMITTED = strftime('%s', 'now')
WHERE lower(status) = 'submitted'
AND SUBMITTED IS NULL
AND ID = NEW.ID;
UPDATE TASK
SET STARTED = strftime('%s', 'now')
WHERE... | true |
6b4d49e0a10eda975535f38bfcc55a1dd64fa25f | SQL | WahyuSetiawan/rust_api | /migration/V3__create_employee.sql | UTF-8 | 204 | 2.578125 | 3 | [] | no_license | create table employee (
id int PRIMARY KEY AUTO_INCREMENT,
first_name varchar(25) not null,
last_name varchar(25) not null,
birth_date DATE,
hire_date DATE,
gander ENUM('M', 'F')
) | true |
664696d9009099e14ac218b0dff2b18f7ae9b305 | SQL | Khoanguyen0109/trainning-be | /prisma/migrations/20210318093101_init/migration.sql | UTF-8 | 995 | 3.828125 | 4 | [] | no_license | -- CreateTable
CREATE TABLE "Project" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Task" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"status" BOOLEAN NOT NULL,
"projectId" INTEGER NOT NULL,
PRIMARY KEY ("id"... | true |
2632175403f4567398cb1f632422d10022eaa6ef | SQL | marcusgram/7381792102112121 | /administration/storage/tablespaces/undo/UNDO_resolve.sql | UTF-8 | 4,136 | 4.125 | 4 | [] | no_license |
Calculate UNDO_RETENTION for given UNDO Tabespace
---------------------------------------------------
You can choose to allocate a specific size for the UNDO tablespace and then
set the UNDO_RETENTION parameter to an optimal value according to the UNDO size and the database activity.
If your disk space is li... | true |
0e392a6589b2ebb25374b719b01d663534c25c5a | SQL | radtek/abs3 | /sql/mmfo/bars/Trigger/ti_an_kl_k.sql | UTF-8 | 1,063 | 3.015625 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/Trigger/TI_AN_KL_K.sql =========*** Run ***
PROMPT =====================================================================================
PROMPT *** Create trigger T... | true |
e1033df4055185dd8a266ab293e10b22540f2334 | SQL | zhu00yu/connehealth | /src/main/resources/test_data/vaccine_schema.sql | UTF-8 | 542 | 3.140625 | 3 | [] | no_license | CREATE TABLE VACCINES (
VACCINE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL,
CODE NVARCHAR(500) NOT NULL,
FULL_NAME NVARCHAR(500) NOT NULL,
SHORT_NAME NVARCHAR(500) NOT NULL,
MNEMONICS1 NVARCHAR(500) NOT NULL,
MNEMONICS2 NVARCHAR(500) NOT NULL,
MNEMONICS3 NVARCHAR(500),
CREATE_ON TIMESTAMP... | true |
3ebd53d6eb80a62d6ca1cccc6e3e021589bab1bf | SQL | atomj7/ChoiceManager | /src/main/resources/db/migration/V1__Initial.sql | UTF-8 | 2,641 | 3.625 | 4 | [] | no_license | create sequence hibernate_sequence start 1 increment 1;
create table usr
(
id int8 not null,
is_activated boolean,
activation_code varchar(255),
active boolean not null,
email varchar(255),
gender varchar(255),
google_auth_id varchar(255),
... | true |
966120a9ee048ae900def9d8c48fa53ae3ed3396 | SQL | TanKode/a3-life-1 | /Meins/arma3life-3.1.4.sql | UTF-8 | 6,198 | 3.359375 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Procedure structure for `deleteDeadVehicles`
-- ----------------------------
DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
DELIMITER ;;
CREATE DEFINER=`Arma3Server`@`localhost` PROCEDURE `deleteDeadVehicles`()
BEGIN
DELETE FROM `vehicles` WHERE `alive` = 0... | true |
ba192b70bdf7ed2964bce6d110f41ca0dc32058b | SQL | Murodjon000/sql_zoo | /more_join.sql | UTF-8 | 2,717 | 4.59375 | 5 | [
"MIT"
] | permissive | -- List the films where the yr is 1962 [Show id, title]
SELECT id, title
FROM movie
WHERE yr=1962
-- Give year of 'Citizen Kane'.
SELECT yr
FROM movie
WHERE title='Citizen Kane'
-- List all of the Star Trek movies, include the id, title and yr (all of these movies include the words Star Trek in the title).
SELECT... | true |
04d3b6e8d1e3bb2e39a8bda6f03727821b211880 | SQL | charleslgn-old-school-project/DeskShop | /DeskShopServ/src/main/resources/sql/201901201900_initTable.sql | UTF-8 | 3,487 | 3.78125 | 4 | [
"Unlicense"
] | permissive | -- table person
CREATE TABLE PERSONNE (
id INTEGER(11) NOT NULL AUTO_INCREMENT,
nom VARCHAR(255) NOT NULL,
prenom VARCHAR(255),
mail VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1;
-- table shop
CREATE TABLE MAGASIN (
id ... | true |
d70dde13c962d4ff357b692a664904d6f1e70bfe | SQL | ElbaM24/AMATS2021-SIST31A-GRUPO-06 | /base de datos/pupuseria.sql | UTF-8 | 2,888 | 3.171875 | 3 | [] | no_license | /*CREATE DATABASE pupuseria;*/
/*USE pupuseria;*/
/*DROP DATABASE pupuseria;*/
/*PRIMER NIVEL*/
CREATE TABLE cargo ( /*REVISADA*/
id_cargo INT NOT NULL AUTO_INCREMENT,
cargo VARCHAR(50) NOT NULL,
PRIMARY KEY (id_cargo)
);
CREATE TABLE mesa ( /*REVISADA*/
id_mesa INT NOT NULL AUTO_INCREMENT,
detalle_mesa VARCHAR(50) ... | true |
5c64c99a4ffce81ce29fecf2be25f6b8f89c36f5 | SQL | theboocock/OtagoGalaxy | /src/ensembl/sql/patch_56_57_e.sql | UTF-8 | 959 | 3.53125 | 4 | [
"BSD-2-Clause"
] | permissive | # patch_56_57_e.sql
#
# Title: Add canonical translations
#
# Description:
# Add a reference to the translation table in the transcript table to
# let the API to know which translation (out of possibly several) is the
# canonical one.
#
# This patch adds a 'canonical_translation_id' field (with an index)
# to the 'tran... | true |
ee483f1fa6116b643b66f8a6a0f33f94212f1ec8 | SQL | princewaleed77/techStore | /db/seed.sql | UTF-8 | 1,210 | 2.6875 | 3 | [] | no_license |
-- ============================ categories data ========================
INSERT INTO cats (name)
VALUES
('Labtop'),
('PCs'),
('Mobiles')
;
-- ========================== products data =========================
INSERT INTO products(name , `desc`, price, img, pices_no, cats_id)
VALUES
('lenovo z51-70', '... | true |
5d3299e9f796f7e3fcb64fdf0a4eae645e02eea5 | SQL | dicrojasch/homeworks_data_science | /3.aprendiendo_mysql_mariadb/capitulo_08_update_delete/ch8_pg138-141_update-delete_update.sql | UTF-8 | 889 | 3.625 | 4 | [] | no_license | -- mysql --user='drojas' -p rookery < birdwatchers.sql
use birdwatchers;
UPDATE birdwatchers.humans
SET country_id = 'us';
SELECT human_id, name_first, name_last
FROM humans
WHERE name_first = 'Rusty'
AND name_last = 'Osborne';
UPDATE humans
SET name_last = 'Johnson'
WHERE human_id = 3;
SELECT human_id, name_firs... | true |
753195e1a67849872c122d32612a689119821319 | SQL | ronnieartzi92/DBProject | /db/scripts/mysql/queries/mike_query_6.sql | UTF-8 | 328 | 3.90625 | 4 | [] | no_license | SELECT *
FROM artists_tracks_youtubes
INNER JOIN(
SELECT MIN(track_id) AS track_id_inner
FROM artists_newest_track
WHERE date_published > DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
GROUP BY artist_id
) AS track_ids ON track_ids.track_id_inner = artists_tracks_youtubes.track_id
ORDER BY track_play_count DESC, date_publish... | true |
642160a6073ee7b8f32c601a3d473066c73a32c6 | SQL | Serahwakaba/School-System | /create.sql | UTF-8 | 633 | 3.03125 | 3 | [
"MIT"
] | permissive | --SET MODE PostgreSQL;
CREATE DATABASE students_system;
\c students_system;
CREATE TABLE users
(
id serial PRIMARY KEY,
name VARCHAR,
email VARCHAR,
username VARCHAR,
password VARCHAR
);
CREATE TABLE students
(
id serial PRIMARY KEY,
name VARCHAR,
phone VARCHAR,
roomnumber int,
floor int,
apartmentid int
);
CREATE ... | true |
78534fd84e0fb990a3c55bf3d29cb999f02a6875 | SQL | tuommii/rs-api | /scripts/create_database.sql | UTF-8 | 2,983 | 3.75 | 4 | [] | no_license | -- ==========================================================================
-- Examples:
-- psql -h 12.13.14.15 -p 5432 -U username
-- psql -h 12.13.14.15 -p 5432 -d DB_NAME -U DB_USER -a -f scripts/create_database.sql -W
-- ==========================================================================
BEGIN TRANSACTION... | true |
185669d9b115c8661c206b8f84e38506bfd1cf78 | SQL | WillZWL/project | /database/change script/simplyelectronics.net/20130128_record.sql | UTF-8 | 928 | 2.703125 | 3 | [] | no_license | INSERT INTO `staffaccesstb` (`accessLevel`, `accessLevelname`) VALUES ('17', 'Ext. CS Manager');
INSERT INTO `staffaccesstb` (`accessLevel`, `accessLevelname`) VALUES ('18', 'Ext. CS Member');
insert into softwarestaffaccesstb
select 17 as accesslevel, swsId, allowview, allowcreate, allowedit, allowdelete, create... | true |
a12a4640c3248ed8d4cf460bc22f5b6789d27dcd | SQL | vitormanoel1/senai_sprint1_bd | /exercicios/1.2-exercicio-locadora/Locadora_03_DQL(1).Sql.sql | UTF-8 | 701 | 3.5 | 4 | [] | no_license | SELECT * FROM Aluguel;
SELECT * FROM Marca;
-- LEFT JOIN
SELECT Aluguel.IdAluguel, Aluguel.DataAluguel, Aluguel.Preco, Marca.Nome AS Marca
FROM Aluguel
LEFT JOIN Marca
ON Aluguel.IdMarca = Marca.IdMarca ;
--RIGHT JOIN
SELECT Aluguel.IdAluguel, Aluguel.DataAluguel, Aluguel.Preco, Marca.Nome AS Marca
FROM Aluguel
RIGH... | true |
52b3dd2843dc306a57a908d6356f8d409ca423da | SQL | Bhavesh03/MovieMood | /List_Movies/WebContent/movies.sql | UTF-8 | 4,143 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 10, 2020 at 05:39 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... | true |
963cc327bc153d39919199b96630481d3a204daf | SQL | jeon-chanhee/DataScience | /Oracle/oracle_day3/gogekTableConst_전찬희.sql | UTF-8 | 246 | 2.765625 | 3 | [] | no_license | create table gogek (
gobun number(3),
goname varchar2(10),
gotel varchar2(20),
gojumin varchar2(14),
godam number(3),
constraint gogek_gobun_pk primary key (gobun),
constraint gogek_godam_fk foreign key (godam)
references sawon(sabun)
); | true |
190b285e68c012dc1b1f51eefb7031c52008cbaa | SQL | memoriza/Database_Exercises | /update_exercises.sql | UTF-8 | 586 | 3.5 | 4 | [] | no_license | USE codeup_test_db;
-- all albums in the table
SELECT sales FROM albums;
UPDATE albums
SET sales = sales * 10;
SELECT sales FROM albums;
-- all albums released before 1980
SELECT name FROM albums WHERE release_date < '1980-01-01';
UPDATE albums
SET release_date = DATE_SUB(release_date, INTERVAL 100 YEAR)
WHERE r... | true |
5a2eef83a57039dc4c8847b69a6bf94c50977a61 | SQL | oviemoses/POS-Barcode-Generator- | /main/db/rcm.sql | UTF-8 | 2,532 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 12, 2017 at 08:57 AM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... | true |
c5b6c4e2228a51a9984a0a13da649d2f83134c94 | SQL | 346800811/scoring | /WebContent/test.sql | UTF-8 | 5,492 | 3.71875 | 4 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `sc_marker`
-- ----------------------------
DROP TABLE IF EXISTS `sc_marker`;
CREATE TABLE `sc_marker` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`name` varchar(32) DEFAULT NULL COMMENT '指标名称',
`weight` int(3) D... | true |
2cc20880981cd55904ef0553c7620cf60f38c082 | SQL | deastland0423/lambda-user-service | /db/schema.sql | UTF-8 | 8,053 | 3.578125 | 4 | [] | no_license | -- --------------------------------------------------------
-- Host: campaign-test-3.cjojv7gsvzpz.us-east-1.rds.amazonaws.com
-- Server version: 8.0.20 - Source distribution
-- Server OS: Linux
-- HeidiSQL Version: 11.2.0.6213
-- ---------------------... | true |
f99dc6354b525e7ccc6836288cd039ecb68684ba | SQL | akdlzl12/javaproject | /school/src/kr/co/jhta/school/erd/school.sql | UTF-8 | 2,230 | 3.59375 | 4 | [] | no_license |
/* Drop Tables */
DROP TABLE SCHOOL_REGISTRATIONS CASCADE CONSTRAINTS;
DROP TABLE SCHOOL_COURSES CASCADE CONSTRAINTS;
DROP TABLE SCHOOL_STUDENTS CASCADE CONSTRAINTS;
DROP TABLE SCHOOL_PROFESSORS CASCADE CONSTRAINTS;
DROP TABLE SCHOOL_SUBJECTS CASCADE CONSTRAINTS;
DROP TABLE SCHOOL_DEPTS CASCADE CONSTRAINTS;
/* Cr... | true |
f81d1bcff0907161e7d0cd134c94b3d10ac1de66 | SQL | huiboz/school_intro-to-database | /hw3/hw3_test.sql | UTF-8 | 3,496 | 2.828125 | 3 | [] | no_license | /*
call insert_student("peters", "justin", "cs", 2016);
call insert_student("welch", "Alexander", "ee", 2017);
call insert_student("ross", "gordon", "cs", 2017);
call insert_student("howard", "piers", "math", 2015);
call insert_student("edmunds", "felicity", "cs", 2017);
call insert_student("kelly", "lucas", "cs", 2017... | true |
07327b0553b00d24c27ca5f90886904bcb1726f4 | SQL | sourav5399/codemymobile | /codemymobile.sql | UTF-8 | 3,438 | 3.125 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 8.0.21 - MySQL Community Server - GPL
-- Server OS: Win64
-- HeidiSQL Version: 11.0.0.5919
-- --------------------------------------------------------
/... | true |
f1af7c3529ad10111f1d962891c7d6108330ca21 | SQL | sabatex/Delphi | /bgludf/test_udf.sql | WINDOWS-1251 | 4,995 | 2.96875 | 3 | [
"MIT"
] | permissive | set sql dialect 3;
set names win1251;
/* ... */
connect to database 'c:\developer\progects\bagel 2.0\data\test.gdb'
user 'sysdba' password 'masterkey';
drop database;
commit;
/* */
create database 'c:\developer\progects\bagel 2.0\data\test.gdb'
user 'sysdba' password 'masterkey'
page_size 8192
d... | true |
214d28b7d8be64beaaae0ef86778e48d39d39fb7 | SQL | DF-Mephisto/Rest_Forum | /create.sql | UTF-8 | 5,737 | 3.34375 | 3 | [] | no_license | create sequence gen.hibernate_sequence start 1 increment 1;
create table if not exists gen.comment (id int8 not null,
placed_at timestamp not null,
text varchar(1000) not null,
parent_comment_id int8... | true |
62c4e8a9d8e9a555adb8052cede106ac90a720e7 | SQL | CaTmmao/edu-backend | /service/service-edu/src/main/resources/db/migration/V2__Create_chapter.sql | UTF-8 | 1,123 | 3.609375 | 4 | [] | no_license | create database if not exists edu
char set utf8mb4;
use edu;
drop table if exists `edu_chapter`;
create table `edu_chapter`
(
`id` char(19) not null comment '章节id',
`course_id` char(19) not null comment '课程id',
`title` varchar(50) not null comment '章节名称',
`sort` int(10) u... | true |
6b8562bc91f2b786b1deb00cace9c7e1b90ddf69 | SQL | mcmyffin/BAI-3_BWP2 | /doc/Mysql_Datenbank/online_shop.sql | UTF-8 | 12,179 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 15. Jun 2015 um 17:28
-- Server-Version: 5.5.43-0ubuntu0.14.04.1
-- PHP-Version: 5.5.9-1ubuntu4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... | true |
dc44a0b7627d3a0d05cd8be7d8538ed7138197e2 | SQL | librar127/PythonDS | /Leetcode/SQL/Medium/1549.sql | UTF-8 | 490 | 3.875 | 4 | [] | no_license | -- your MySQL query statement below
WITH nT AS
(
SELECT
B.product_name,
B.product_id,
A.order_id,
A.order_date,
DENSE_RANK() OVER (PARTITION BY product_name ORDER BY order_date DESC) rn
FROM
Orders A
JOIN
Products B
ON
A.product_id = B.pro... | true |
dbda96930b813ba2f21c7a67763bb6d80a62fbf2 | SQL | MrD0079/portal | /sql/zakaz_nal_report_nets.sql | UTF-8 | 346 | 2.796875 | 3 | [] | no_license | /* Formatted on 02/11/2015 17:11:53 (QP5 v5.252.13127.32867) */
SELECT DISTINCT n.id_net, n.net_name
FROM nets n, nets_plan_month m
WHERE m.mkk_ter IN (SELECT slave
FROM full
WHERE master = :tn)
AND n.id_net = m.id_net
AND m.plan_ty... | true |
a66a86b282e92a45fe389e60e1c33c77085e42e7 | SQL | Chestnut1999/Elo-Recommendation-23place | /sql/908_elo_dow_time_agg.sql | UTF-8 | 5,608 | 3.515625 | 4 | [] | no_license | -- feat_no 908
-- #========================================================================
-- # DOw_timezone aggregation
-- #========================================================================
# month agg
WITH
latest_year_agg as (
SELECT
card_id,
dow,
timezone,
count(1) as transac... | true |
f90f134988e8c7fe71f8fad26fd597d26883f246 | SQL | muthuarumugam/bookapplication | /sql/bookorders.sql | UTF-8 | 564 | 3.5 | 4 | [] | no_license | use bookapp;
create table bookorders(id int primary key auto_increment,
User_id int,
foreign key(User_id) references User(id),
book_id int,
foreign key(book_id) references book(id),
status varchar(20)not null default 'Ordered',qty int not null,
Order_date timestamp not null default current_timestamp);
insert into ... | true |
90872b67c796a9c9395766a2805848535b84ab48 | SQL | TAndronicus/persistence-pitfalls | /src/main/resources/db/migration/create-reviews.sql | UTF-8 | 644 | 3.40625 | 3 | [] | no_license | --liquibase formatted sql
--changeset admin:2
create table review
(
id bigint primary key
not null,
grade int,
review_comment character varying,
book_id bigint
not null
references book
);
insert into review (id, grade, review_comment, book_id)
values (... | true |
cd7aeec127071a0c4066f0c3ca4e592dca7a047c | SQL | JohnWall2016/Yhsb.Net | /src/Yhsb/Jb/Database/fullcover.sql | UTF-8 | 5,540 | 3.5 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS fullcover2020 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
-- 全覆盖已下发数据
CREATE TABLE IF NOT EXISTS `fullcover2020`.`fc_yxfsj`(
`dwmc` VARCHAR(100) NOT NULL, -- 单位名称
`xfpc` VARCHAR(20) NOT NULL, -- 下发批次("第一批", "第二批", ...)
`no` INT UNSIGNED, -- 序号
`idcard` VARCHAR(... | true |
8bcd31ed613c550ef0ff65c7d68d6efd726b5ef9 | SQL | anhstudios/swganh | /data/sql/galaxy/procedures/sp_ChatPersistRoom.sql | UTF-8 | 938 | 3.5 | 4 | [
"MIT"
] | permissive | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
DROP PROCEDURE IF EXISTS `sp_ChatTransferRoomOwner`;
DELIMITER /... | true |
e344146f8a1551c1756367cca1cdb337534ffc91 | SQL | derekzuk/fauxshop | /src/main/sql/fauxleather-schema.sql | UTF-8 | 5,317 | 3.265625 | 3 | [] | no_license | CREATE TABLE `account` (
`ACCOUNT_ID` int(11) NOT NULL AUTO_INCREMENT,
`USER_LOGIN` varchar(100) NOT NULL DEFAULT '',
`EMAIL` varchar(100) NOT NULL DEFAULT '',
`PASSWORD` varchar(100) NOT NULL DEFAULT '',
`FIRST_NAME` varchar(100) DEFAULT NULL,
`LAST_NAME` varchar(100) DEFAULT NULL,
`CITY` varchar(... | true |
4b7d17d3c014d7433ec0ebeaada05ffa8699d892 | SQL | caylemh/mySQL | /Exercises/Chap2/black_book_c2_pg109.sql | UTF-8 | 715 | 3.46875 | 3 | [] | no_license | CREATE TABLE `black_book` (
`date_name` varchar(20) default NULL,
`rating` varchar(20) default NULL
) ENGINE = MyISAM DEFAULT CHARSET = latin1;
INSERT INTO black_book
VALUES ('Alex','innovative'),
('James','boring'),
('Ian','fabulous'),
('Boris','ho hum'),
('Melvin','plebian'),
('Eric','pathetic'),
('Anthony','de... | true |
24213fe245e31e06a3417396e3c6d7168a927bf3 | SQL | s13008/s13008 | /141030-5.sql | UTF-8 | 170 | 2.9375 | 3 | [] | no_license | select deptno,empno,ename
from employees
where deptno = 10 or deptno =20
union
select deptno,empno,ename
from employees
where deptno = 20 or deptno = 30
order by empno
/
| true |
8a4d030a3b1691662a1b1a0b862287eced086978 | SQL | HorseSF/mysql | /課題/Q_13.sql | UTF-8 | 3,704 | 4.53125 | 5 | [] | no_license | -- 3个表 s(学生表),c(课程表),sc(学生选课表)
-- s(sno,sname)代表(学号,姓名)
-- c(cno,cname,cteacher)代表(课号,课名,教师)
-- sc(sno,cno,scgrade)代表(学号,课号,成绩)
/* DDL
CREATE TABLE SC
(
SNO VARCHAR(200),
CNO VARCHAR(200),
SCGRADE VARCHAR(200)
);
CREATE TABLE S
(
SNO VARCHAR(200 ),
SNAME VARCHAR(200)
);
CREATE TABLE C
(
CNO... | true |
1ef9f2a60a95561aed01c99acb5927f5f9416731 | SQL | pwd120/ower | /work/SQL/0110.sql | UTF-8 | 1,578 | 4.5625 | 5 | [] | no_license | SELECT FROM_UNIXTIME(gen_time),user_code,department_id FROM orderinfo_main WHERE order_code='SO2019010800003'
SELECT
DISTINCT (os.order_code),SUM(ds.total_price_with_tax),FROM_UNIXTIME(om.`gen_time`),dm.order_type,om.`user_code`,om.`customer_name`,om.`shop_name`,om.`department_id`,om.`department_name`,
om.`sale... | true |
a440b1d6c17b8f64128de017c6e8df9fcaba1edd | SQL | ICEI-PUC-Minas-PPLES-TI/plf-es-2021-1-ti2-0940100-seek-n-hire | /codigo/backend/SQL-CRICAO-BD/QueryCriaTabela.sql | UTF-8 | 1,383 | 3.1875 | 3 | [] | no_license | create table Usuario(
cpf int primary key,
nome varchar(100) NOT NULL,
login varchar(30) NOT NULL,
senha varchar(100) NOT NULL,
datNasc DATE NOT NULL
);
create TABLE Servico(
cpf int foreign key,
idServico INT PRIMARY KEY,
campoServico VARCHAR(45) NOT NULL,
areaServico VARCHAR(45) NOT NULL,
taxaServico FLOAT ... | true |
f299034c9e28783ae472878bd28ff05c8907e2c9 | SQL | MarcoAntonioBorges/Database-Application-Development | /1 Sem - Cap¡tulo 4 - Operacoes de Conjuntos(Solucao).sql | UTF-8 | 902 | 3.4375 | 3 | [] | no_license | --1
SELECT department_id
FROM departments
MINUS
SELECT department_id
FROM employees
WHERE job_id = 'ST_CLERK';
--2
SELECT country_id,country_name
FROM countries
MINUS
SELECT country_id,country_name
FROM countries
NATURAL JOIN locations
NATURAL JOIN departments;
--3
COLUMN dummy NOPRINT
SELEC... | true |
5fa825430595652054ed00988c3e0e9c87c36611 | SQL | bmarchete/jogo-guess | /bd.sql | UTF-8 | 259 | 2.65625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `bd` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `bd`;
CREATE TABLE `score` (
`id` int(11) NOT NULL,
`attempts` int(11) NOT NULL,
`player` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | true |
9deecb0749475bf8a549288b512e39219ac45389 | SQL | daniel-valdes/SQL_EmployeeDB | /queries.sql | UTF-8 | 2,618 | 4.6875 | 5 | [] | no_license | --List the following details of each employee: employee number, last name, first name, gender, and salary
SELECT employees.employee_no, employees.last_name, employees.first_name, employees.gender, salaries.salary
FROM employees INNER JOIN salaries ON
employees.employee_no=salaries.employee_no;
--List employees who w... | true |
b20236c72f509939c94afa475a29e7373a4af0ea | SQL | sunthx/simple-im | /src/server/src/main/resources/schema.sql | UTF-8 | 722 | 3.09375 | 3 | [] | no_license | CREATE TABLE t_user (
id VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
avatar VARCHAR(255),
PRIMARY KEY (id)
)
CREATE TABLE t_message(
id VARCHAR(255) NOT NULL,
create_time TIMESTAMP,
update_time TIMESTAMP,
content VARCHAR(255) ... | true |
4c8fe9d7d91818ded992d0bb003f2659d800729f | SQL | joaoamorim/portalNerdStoreServlet | /portalNSDenise/ddls/nerdstore.sql | UTF-8 | 2,895 | 2.703125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `nerdstore` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `nerdstore`;
-- MySQL dump 10.13 Distrib 5.7.12, for Win32 (AMD64)
--
-- Host: 192.168.1.101 Database: nerdstore
-- ------------------------------------------------------
-- Server version 5.7.16-0ubuntu0.16.04.1
/*!40... | true |
f3e8d8fd2e442ba22451e6379b26bed067685098 | SQL | theheroproject/oracle | /sql/SORT_SEGMENT.sql | SHIFT_JIS | 1,019 | 2.703125 | 3 | [] | no_license | -- *********************************************************************
-- * V$SORT_SEGMENT
-- * ̃CX^X̊e\[gEZOg̏
-- *********************************************************************
select
sysdate || ',' ||
-- INST_ID || ',' ||
TABLESPACE_NAME || ',' ||
SEGMENT_FILE || '... | true |
107e5896e60e206439359f7e57e7f6593331f7b3 | SQL | hiralhp/cse-414-databases | /hw3/hw2-q7.sql | UTF-8 | 128 | 2.765625 | 3 | [] | no_license | select distinct Fi.carrier_id
from FLIGHTS as F
where F.origin_city = ‘Seattle WA’
and F.dest_city = ‘San Francisco’; | true |
2049cf9f9f7812596deec2a42020608b2386bf07 | SQL | ajblocker/MySQL | /veryeasy.sql | UTF-8 | 655 | 3.734375 | 4 | [] | no_license | /*Very Easy:
-Create a database with your top three cars and include Make, model, year.
-Create a query to add in two more cars*/
/* deletes database if it already exists*/
DROP DATABASE IF EXISTS cars;
CREATE DATABASE cars;
USE cars;
CREATE TABLE cars
(
cars_id INT NOT NULL AUTO_INCREMENT,
make VARCHAR(20),
... | true |
e10ad4bbfbd3e82c3a1e0027b82473df1977f032 | SQL | flowstone/Base-Java | /day5036_ServletContext_Request/db.sql | UTF-8 | 570 | 3.21875 | 3 | [] | no_license | USE t_201709_test;
CREATE TABLE tb_user(
userid INT AUTO_INCREMENT COMMENT '用户id',
username VARCHAR(255) NOT NULL DEFAULT '' UNIQUE COMMENT '用户名',
userpass VARCHAR(255) NOT NULL DEFAULT '' COMMENT '密码',
useremail VARCHAR(255) COMMENT '邮箱',
nickname VARCHAR(255) UNIQUE COMMENT '呢称',
usersex VARCHAR(255) COMMENT '... | true |
344bb7adb8f446f8f2016c5f788e07a851678498 | SQL | CUBRID/cubrid-testcases | /sql/_24_aprium_qa/_01_i18n/issue_9467_clobtochar/cases/_01_others_01.sql | UTF-8 | 990 | 3.234375 | 3 | [
"BSD-3-Clause"
] | permissive | set names utf8;
drop table if exists t;
drop table if exists ll;
create table t(s string, c clob);
insert into t values('a','a');
select clob_to_char(c using iso88591) collate iso88591_en_cs from t where clob_to_char(c using iso88591) collate iso88591_en_ci like 'A';
select clob_to_char(c using iso88591) collate iso8... | true |
7b10b844975a65b92589890434c6925b18fee1b1 | SQL | grassrootza/grassroot-platform | /grassroot-webapp/src/main/resources/db/scripts/script_48.sql | UTF-8 | 267 | 2.796875 | 3 | [] | permissive | ALTER TABLE user_profile ADD COLUMN app_id varchar(50);
UPDATE user_profile SET app_id = 'auto_' || nextval('user_profile_id_seq');
ALTER TABLE user_profile ALTER COLUMN app_id SET NOT NULL;
ALTER TABLE ONLY user_profile ADD CONSTRAINT uk_user_app_id UNIQUE (app_id); | true |
088ef9470828cc403a38e82287c4de1131f7aa7e | SQL | SandoEdgar/Modulo_Pedidos | /3-Sistema-Programa/BD-General/dbferreteria-2.sql | UTF-8 | 20,574 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-12-2018 a las 07:12:05
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... | true |
6906657b93fe214b1f89cf43a1090598e888566b | SQL | SaiViswaSumanth/DBMS-PLSQL | /PLSQL1/display.sql | UTF-8 | 660 | 2.640625 | 3 | [] | no_license | begin
for rec in (select * from customer)
loop
dbms_output.put_line('name '||' '||rec.name||'ssn is '||' '||rec.ssn);
end loop;
end;
/
begin
for rec in (select * from branch)
loop
dbms_output.put_line('Code '||' '||rec.code||' '||'Name is '||' '||re... | true |
5865fd78c34d1ffaa47ca6ebf929d09677e06d9c | SQL | gouldju1/r2sql | /cosql/resources/database/flight_2/flight_2.sql | UTF-8 | 502 | 3.53125 | 4 | [] | no_license | CREATE TABLE 'airlines' (
uid INTEGER PRIMARY KEY,
Airline TEXT,
Abbreviation TEXT,
Country TEXT
);
CREATE TABLE 'airports' (
City TEXT,
AirportCode TEXT PRIMARY KEY,
AirportName TEXT,
Country TEXT,
CountryAbbrev TEXT
);
CREATE TABLE 'flights' (
Airline INTEGER,
FlightNo INTEGER,
SourceAirport TEXT... | true |
1048bf2aea8971ce254d29936615530fe08cc470 | SQL | ikura-salmon/eng-start | /postgresql/lesson01/initdb/003_create_ranks.sql | UTF-8 | 668 | 3.3125 | 3 | [] | no_license | CREATE TABLE ranks (
id SERIAL primary key,
name VARCHAR(255) NOT NULL,
salary INTEGER NOT NULL
);
COMMENT ON TABLE ranks IS '職位テーブル';
COMMENT ON COLUMN ranks.id IS '職位ID';
COMMENT ON COLUMN ranks.name IS '職位名';
COMMENT ON COLUMN ranks.salary IS '給与';
INSERT INTO ranks (id, name, salary) VALUES
(1, 'A', 3... | true |
61ea2cfd015ff507ce9a20c304d932014b0158e1 | SQL | alifanuraniputri/IF3110-Tubes-I | /tubesweb.sql | UTF-8 | 2,049 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Inang: 127.0.0.1
-- Waktu pembuatan: 24 Okt 2013 pada 07.09
-- Versi Server: 5.6.11
-- Versi PHP: 5.5.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... | true |
9f07c25bf576a6af6f7fa926b94ee03a42059eea | SQL | Freedom89/vs_dbt_hw | /dbt_hw/analysis/jinja.sql | UTF-8 | 1,260 | 3.5625 | 4 | [] | no_license | {# Set a variable #}
{%- set this_is_a_variable = 'some value' -%}
{%- set this_is_a_list = ['hello','there'] -%}
{%- set this_is_a_dict ={ 'key1' :'value1',
'key2' :'value2' } -%}
{%- set dict_of_arrays ={ 'key1': ['value11','value12'],
'key2' :['value21','value22'] } -%}
{{ this_is_a_variable }}
{{ this_is_a_list }}
... | true |
8f7df95aef3e799ee75e8203416ecd5087714ef6 | SQL | 17602937887/college-entrance-examination-volunteer-consultation | /src/main/resources/createTables.sql | UTF-8 | 2,966 | 3.921875 | 4 | [] | no_license | # 项目需要的库、表、等结构的sql语句
# 库名
create database if not exists college_entrance_examination_volunteer_consultation DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
# 选择该库
use college_entrance_examination_volunteer_consultation;
# 学校录取信息表
create table if not exists obtaining_score_data
(
`id` ... | true |
6d2933396e05b3d818f4e4a612b7915f65b059f9 | SQL | PierreTurnbull/heticmadu_api | /devops/dev/db/heticmadu.story-schema.sql | UTF-8 | 479 | 3.265625 | 3 | [] | no_license | /*!40101 SET NAMES binary*/;
/*!40014 SET FOREIGN_KEY_CHECKS=0*/;
CREATE TABLE `story` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`text` varchar(255) NOT NULL,
`themeId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_a137b691db85ac439f32f198f0a` (`themeId`),
CONSTRAINT `FK_... | true |
809ff72d8a44bf5c776279efeb6f7e0849f324db | SQL | tanyta78/MSSQL-DatabaseBasic | /DBBasicExercises/cast.sql | UTF-8 | 768 | 4.03125 | 4 | [] | no_license | --Problem 33. Population and Area by Continent
SELECT CC.ContinentName,
SUM(CAST(ISNULL(c.AreaInSqKm, 0) AS BIGINT)) AS CountriesArea,
SUM(CAST(ISNULL(c.[Population], 0) AS BIGINT)) AS CountriesPopulation
FROM Continents AS CC
JOIN Countries AS C ON C.ContinentCode = CC.ContinentCode
GROUP BY CC.Con... | true |
4c27162d3c73c251093c971393081c37955dffdd | SQL | ynotradio/site | /src/db/migrations/mrm_bands.sql | UTF-8 | 429 | 2.96875 | 3 | [] | no_license | --
-- Table structure for table `mrm_bands`
--
CREATE TABLE IF NOT EXISTS `mrm_bands` (
`id` int(2) NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
`url` varchar(128) NOT NULL,
`pic_url` varchar(128) NOT NULL,
`placement` int(2) NOT NULL,
`seed` int(2) NOT NULL,
`abbr` varchar(7) NOT NULL,
PRIMAR... | true |
d8809d8553e50a881388dbffb7a4f61c45d482b3 | SQL | Lydia-tech/employee-tracker | /db/schema.sql | UTF-8 | 891 | 3.71875 | 4 | [] | no_license | DROP DATABASE IF EXISTS company;
CREATE DATABASE company;
USE company;
DROP TABLE IF EXISTS employee;
DROP TABLE IF EXISTS department;
DROP TABLE IF EXISTS roles;
CREATE TABLE department(
id INTEGER(11) AUTO_INCREMENT NOT NULL,
name VARCHAR(30),
PRIMARY KEY (id)
);
CREATE TABLE roles(
id INTEGER(11... | true |
54b1fab915123164e8fe6b85ae888084a9dbc49e | SQL | radtek/Telecommunication | /SIM_TRADE/DataBase/FUNCTION/GET_BS_ZONE_NAME.sql | UTF-8 | 445 | 2.828125 | 3 | [] | no_license | CREATE OR REPLACE FUNCTION GET_BS_ZONE_NAME(
pBS_ZONE_ID IN INTEGER
) RETURN VARCHAR2 IS
--
--#Version=1
--
CURSOR C IS
SELECT ZONE_NAME
FROM BEELINE_BS_ZONES
WHERE BEELINE_BS_ZONE_ID=pBS_ZONE_ID;
--
vNAME BEELINE_BS_ZONES.ZONE_NAME%TYPE;
BEGIN
OPEN C;
FETCH C INTO vNAME;
CLOSE C;
RETURN vNAME;
END;
... | true |
fc71d1cf2dd4e74394b66fb96cdf284d1ead661b | SQL | Shanghai-Lunara/publisher | /pkg/dababase/database.sql | UTF-8 | 527 | 2.671875 | 3 | [] | no_license | CREATE DATABASE publisher
CHARACTER SET utf8
COLLATE utf8_general_ci;
CREATE TABLE records (
id BIGINT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
namespace VARCHAR(128) DEFAULT '' COMMENT 'namespace项目命名空间',
groupName VARCHAR(128) DEFAULT '' COMMENT '项目分支渠道名称',
runnerName VARCHAR(128) DEFAULT '' ... | true |
add0063d0c10f2c222581c7546272917f6d2b580 | SQL | loncard/PiiS-WebShop | /code/db/categories.sql | UTF-8 | 264 | 3.171875 | 3 | [] | no_license | CREATE TABLE `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO `categories`
(`id`, `name`)
VALUES
(1, 'CPU'),
(2, 'Case'),
(3, 'Mouse'),
(4, 'RAM'),
(5, 'Keayboard'),
(6, 'Hard drive') | true |
c36a7ccd85688d8c1bbb0d84724755b1239867ee | SQL | ricamartins/generation | /sql/inserts.sql | UTF-8 | 768 | 3.5 | 4 | [] | no_license | use test;
create table funcionarios (
id int not null auto_increment,
nome varchar(30) not null,
nascimento date,
sexo enum("M", "F"),
peso decimal(5,2),
altura decimal(3,2),
nacionalidade varchar(20) default "Brasil",
primary key (id)
) engine = InnoDB;
insert into funcionarios values
(d... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.