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
3f35413b6345fb50c28800742268c35b63e9e1ce
SQL
Sankarb475/CassandraLearning
/differentKeysInCassandra.cql
UTF-8
4,764
4.75
5
[]
no_license
/* Cassandra has many types of key: primary key, partition key, composite key clustering key */ -- Partition Key: Is the part of a record (one or more columns) that is used to create its hash that is then used to select the node(s) that will store it. so partition key is the key which creates the hash value based on which the row gets stored. /* The primary key is a general concept to indicate one or more columns used to retrieve data from a Table. They alltogether represents each row of the column uniquely. In cassandra if you are trying to insert duplicates using "INSERT INTO" command, it will overwrite the existing value */ CREATE TABLE dummy.duplicate_rows ( age int PRIMARY KEY, name text ); INSERT INTO duplicate_rows (age, name) VALUES (23,'Sankar'); INSERT INTO duplicate_rows (age, name) VALUES (23,'Samrat'); cqlsh:dummy> SELECT * FROM duplicate_rows; age | name -----+-------- 23 | Samrat --so "Sankar" has been overwritten by "Samrat" /* But the primary key can also be COMPOSITE (aka COMPOUND), generated from more than one column. */ CREATE TABLE employee( ID int, Employer text, Salary int, country text, PRIMARY KEY(ID,country) ); INSERT INTO employee (id, country) VALUES (1,'India'); --This will have the country and salary column as "null". "ID" and "country" fields has to be entered being part of PK. /* In a situation of COMPOSITE primary key, the "first part" of the key is called PARTITION KEY (in this example key_part_one is the partition key) and the second part of the key is the CLUSTERING KEY (in this example key_part_two) */ --if you see the definition of the table, you will get an idea about the structure cqlsh:dummy> desc table employee CREATE TABLE dummy.employee ( id int, country text, employer text, salary int, PRIMARY KEY (id, country) ) WITH CLUSTERING ORDER BY (country ASC); INSERT INTO employee (id, country, employer , salary ) VALUES ( 2,'US','Kagel',100000); --so in this case "id" and "country" together will be defining each row uniquely INSERT INTO employee (id, country, employer , salary ) VALUES ( 2,'US','Infy',100000); --this row will overwrite the last line of INSERT /* The Partition Key is responsible for data distribution across your nodes. On your partition key, partitioning algorithm will work. The Clustering Key is responsible for data sorting within the partition. Also range queries ( < , >) should be performed on clustering keys, it wouldnt work on Partition key. */ --also we can have both partition and clustering key made by more columns, here's how:: CREATE TABLE adultData( Age int, Employer text, Salary int, education text, educationYear int, maritalStatus text, jobdesignation text, familyStatus text, colour text, gender text, Points1 int, Points2 int, Points3 int, country text, salaryType text, PRIMARY KEY ((Age,Employer,Salary,education,educationYear),Points1,Points2,Points3,salaryType,gender,jobdesignation,maritalStatus,country,colour) ); cqlsh:dummy> DESC TABLE adultdata; CREATE TABLE dummy.adultdata ( age int, employer text, salary int, education text, educationyear int, points1 int, points2 int, points3 int, salarytype text, gender text, jobdesignation text, maritalstatus text, country text, colour text, familystatus text, PRIMARY KEY ((age, employer, salary, education, educationyear), points1, points2, points3, salarytype, gender, jobdesignation, maritalstatus, country, colour) ) WITH CLUSTERING ORDER BY (points1 ASC, points2 ASC, points3 ASC, salarytype ASC, gender ASC, jobdesignation ASC, maritalstatus ASC, country ASC, colour ASC) --you can see the clustering key has started with Points1 /* A primary key uniquely identifies a row. A composite key is a key formed from multiple columns. A partition key is the primary lookup to find a set of rows, i.e. a partition. A clustering key is the part of the primary key that isn't the partition key (and defines the ordering within a partition). Examples: PRIMARY KEY (a): The partition key is a. PRIMARY KEY (a, b): The partition key is a, the clustering key is b. PRIMARY KEY ((a, b)): The composite partition key is (a, b). PRIMARY KEY (a, b, c): The partition key is a, the composite clustering key is (b, c). PRIMARY KEY ((a, b), c): The composite partition key is (a, b), the clustering key is c. PRIMARY KEY ((a, b), c, d): The composite partition key is (a, b), the composite clustering key is (c, d). */ --we can use ordering on the clustering keys while defining the table:: CREATE TABLE timeseries ( event_type text, insertion_time timestamp, event blob, PRIMARY KEY (event_type, insertion_time) ) WITH CLUSTERING ORDER BY (insertion_time DESC);
true
9800a144be5c135a209321a206b019df17c86009
SQL
anujpal82/Training-Feb-2021
/Modules/SQL/Day1/paresh gohil/Assignment.sql
UTF-8
874
3.796875
4
[]
no_license
USE Practices; CREATE TABLE Emps ( EmployeeID INT PRIMARY KEY IDENTITY, FirstName varchar(20) NOT NULL, LastName varchar(20) NOT NULL, Email varchar(30) NOT NULL, PhoneNumber bigint NOT NULL, JoinDate date NOT NULL, JobID INT NOT NULL, Salary bigint NOT NULL, ) CREATE TABLE Inventories ( LaunchDate date NOT NULL, Make varchar(20) NOT NULL, Modal varchar(20) NOT NULL, CarID varchar(10) NOT NULL, Mileage FLOAT NOT NULL, Price bigint NOt NULL, SoldPrice bigint NOT NULL, Profit bigint NOT NULL, DateSold date NOT NULL, SalesmanID varchar(10) NOT NULL, PRIMARY KEY (SalesmanID,CarID,DateSold) ) CREATE TABLE Sales ( CarID varchar(10) NOT NULL, SalesmanID varchar(10) NOT NULL, SalesmanCommission INT NOT NULL, DateSold date NOT NULL, CONSTRAINT fkCarID FOREIGN KEY (SalesmanID,CarID,DateSold) REFERENCES Inventories(SalesmanID,CarID,DateSold), )
true
14e15028019f58376c102e260d26498e69b509cf
SQL
aryaab/Mascotas
/pets_2018-09-05.sql
UTF-8
7,241
3.359375
3
[]
no_license
# ************************************************************ # Sequel Pro SQL dump # Versión 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.7.21) # Base de datos: pets # Tiempo de Generación: 2018-09-05 05:17:10 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!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' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; # Volcado de tabla migrations # ------------------------------------------------------------ DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; LOCK TABLES `migrations` WRITE; /*!40000 ALTER TABLE `migrations` DISABLE KEYS */; INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2014_10_12_000000_create_users_table',1), (12,'2018_09_05_011516_create_pets_table',1), (13,'2018_09_05_011532_create_photos_table',1), (14,'2018_09_05_031913_create_votes_table',1); /*!40000 ALTER TABLE `migrations` ENABLE KEYS */; UNLOCK TABLES; # Volcado de tabla pets # ------------------------------------------------------------ DROP TABLE IF EXISTS `pets`; CREATE TABLE `pets` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` int(10) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `pets_user_id_foreign` (`user_id`), CONSTRAINT `pets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; LOCK TABLES `pets` WRITE; /*!40000 ALTER TABLE `pets` DISABLE KEYS */; INSERT INTO `pets` (`id`, `name`, `user_id`, `created_at`, `updated_at`) VALUES (1,'Allen',1,'2018-09-05 04:19:17','2018-09-05 04:19:17'), (2,'Aniii',2,'2018-09-05 04:20:39','2018-09-05 04:20:39'), (3,'A',3,'2018-09-05 04:24:35','2018-09-05 04:24:35'), (4,'Allen Schezar',4,'2018-09-05 04:27:40','2018-09-05 04:27:40'), (5,'Padme',5,'2018-09-05 04:29:32','2018-09-05 04:29:32'); /*!40000 ALTER TABLE `pets` ENABLE KEYS */; UNLOCK TABLES; # Volcado de tabla photos # ------------------------------------------------------------ DROP TABLE IF EXISTS `photos`; CREATE TABLE `photos` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `pet_id` int(10) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `photos_pet_id_foreign` (`pet_id`), CONSTRAINT `photos_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `pets` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; LOCK TABLES `photos` WRITE; /*!40000 ALTER TABLE `photos` DISABLE KEYS */; INSERT INTO `photos` (`id`, `image`, `pet_id`, `created_at`, `updated_at`) VALUES (1,'1536121157-gatito-nd.jpg',1,'2018-09-05 04:19:17','2018-09-05 04:19:17'), (2,'1536121239-gatito-nd.jpg',2,'2018-09-05 04:20:39','2018-09-05 04:20:39'), (3,'1536121475-gatito-nd.jpg',3,'2018-09-05 04:24:35','2018-09-05 04:24:35'), (4,'1536121660-gatito-nd.jpg',4,'2018-09-05 04:27:40','2018-09-05 04:27:40'), (5,'1536121692-gatito-nd.jpg',4,'2018-09-05 04:28:12','2018-09-05 04:28:12'), (6,'1536121726-gatito-nd.jpg',4,'2018-09-05 04:28:46','2018-09-05 04:28:46'), (7,'1536121772-gatito-nd.jpg',5,'2018-09-05 04:29:32','2018-09-05 04:29:32'), (8,'1536121803-gatito-nd.jpg',5,'2018-09-05 04:30:03','2018-09-05 04:30:03'); /*!40000 ALTER TABLE `photos` ENABLE KEYS */; UNLOCK TABLES; # Volcado de tabla users # ------------------------------------------------------------ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', `nickname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_nickname_unique` (`nickname`), UNIQUE KEY `users_email_unique` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` (`id`, `name`, `nickname`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1,'','Nii',NULL,'',NULL,'2018-09-05 04:19:17','2018-09-05 04:19:17'), (2,'','Anakin',NULL,'',NULL,'2018-09-05 04:20:39','2018-09-05 04:20:39'), (3,'','N',NULL,'',NULL,'2018-09-05 04:24:35','2018-09-05 04:24:35'), (4,'','Adara',NULL,'',NULL,'2018-09-05 04:27:40','2018-09-05 04:27:40'), (5,'','Arya',NULL,'',NULL,'2018-09-05 04:29:32','2018-09-05 04:29:32'), (11,'Anya','','a@bs.cl','$2y$10$ITQY6L28xj443vY5waJFxOT/o5wjxJWW6d8uAYc04wfIAaEGxb56O','lsECuZF2A3OqNNUbUiKnntBKEbZ1ormdFNc8WL0KYtnOcggtGGAAZSHRtIZp','2018-09-05 05:04:57','2018-09-05 05:04:57'); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; # Volcado de tabla votes # ------------------------------------------------------------ DROP TABLE IF EXISTS `votes`; CREATE TABLE `votes` ( `user_id` int(10) unsigned NOT NULL, `pet_id` int(10) unsigned NOT NULL, `vote` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, KEY `votes_user_id_foreign` (`user_id`), KEY `votes_pet_id_foreign` (`pet_id`), CONSTRAINT `votes_pet_id_foreign` FOREIGN KEY (`pet_id`) REFERENCES `pets` (`id`) ON DELETE CASCADE, CONSTRAINT `votes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; LOCK TABLES `votes` WRITE; /*!40000 ALTER TABLE `votes` DISABLE KEYS */; INSERT INTO `votes` (`user_id`, `pet_id`, `vote`, `created_at`, `updated_at`) VALUES (5,1,2,'2018-09-05 04:43:27','2018-09-05 04:43:27'), (5,3,2,'2018-09-05 04:43:34','2018-09-05 04:43:34'), (5,5,2,'2018-09-05 04:54:51','2018-09-05 04:54:51'), (5,5,2,'2018-09-05 04:54:57','2018-09-05 04:54:57'), (5,1,2,'2018-09-05 04:54:59','2018-09-05 04:54:59'), (5,5,2,'2018-09-05 04:58:48','2018-09-05 04:58:48'); /*!40000 ALTER TABLE `votes` ENABLE KEYS */; UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
5dedd0a8bcea74e1c7ce8ae2333e1760e8542336
SQL
abigail3306/Study-Buddy
/queries/top10math.sql
UTF-8
673
3.953125
4
[]
no_license
-- Selects the top 10 School in Loudoun County for 4th grade Math scores. -- Where you are not disadvantaged, disabled, and speak English -- -- Schema: div_name, sch_name, avg_sol_scale_score -- Order: avg_sol_scale_score select d.div_name, s.sch_name, t.avg_sol_scale_score from test_score as t join school as s on t.sch_num = s.sch_num AND t.div_num = s.div_num join division as d on s.div_num = d.div_num where d.div_name = 'Loudoun County ' and t.test_level = '4' and t.subject = 'MATH' and t.gender is null and t.federal_race_code is null and t.disadvantaged_flag = 'N' and t.disability_flag = 'N' and t.lep_flag = 'N' order by t.avg_sol_scale_score desc limit 10
true
8eb7a3303b3810bfe6573209d25ef19faecfb82b
SQL
brendan2131/ETL-Project
/ETL.sql
UTF-8
634
3.796875
4
[]
no_license
CREATE DATABASE top_songs_db; USE top_songs_db; CREATE TABLE spotify ( spotify_position INT PRIMARY KEY, song_name VARCHAR(200) NOT NULL, artists VARCHAR(200) NOT NULL, duration_ms DOUBLE (20,1) ); CREATE TABLE billboard ( id INT PRIMARY KEY, peak_position INT, song_name VARCHAR(200) NOT NULL, artists VARCHAR(200) NOT NULL, number_of_weeks INT, average_chart_position FLOAT (20,18) ); SELECT spotify.spotify_position, spotify.song_name, spotify.artists, spotify.duration_ms, billboard.peak_position, billboard.number_of_weeks FROM spotify INNER JOIN billboard ON spotify.song_name=billboard.song_name ;
true
ac6db2796ee4d0db5bc1e9f73053685182f228f6
SQL
markmeehan99/AirlineDataBase
/int7.sql
UTF-8
413
3.5
4
[]
no_license
--quantidade de passageiros em cada faixa etaria .mode columns .headers on .nullvalue NULL select idade/10*10 as idadeMinima, idade/10*10+9 as idadeMaxima, sum(idadeNum) from ( select strftime('%Y', 'now')-strftime('%Y',Pessoa.dataNascimento) as idade, count(*) as idadeNum from Pessoa, Passageiro where Pessoa.idPessoa = Passageiro.idPessoa group by idade ) group by idadeMinima ;
true
6a8653fe6c282838627b91bf04e37ad32034b2ea
SQL
jeffreyt/shuInventory
/report_user_specific.sql
UTF-8
199
3.265625
3
[]
no_license
SELECT user.user_name, user_tel, user_location, hardware_make, hardware_model FROM user LEFT JOIN hardware ON user.user_name=hardware.user_name WHERE user.user_name='on-hand' ORDER BY user.user_name;
true
14284362b75eac48bfb7fa7440e51bc1bda4ccfd
SQL
jorgitodf/mfw
/bd/querys.sql
UTF-8
1,395
3.75
4
[]
no_license
SELECT Replace (Replace (Replace (Format(SUM(ei.valor), 2), '.', '|'), ',', '.'), '|', ',') AS total FROM expenditure_installments ei JOIN expenses_card ec ON (ec.id = ei.fk_expenses_card) WHERE ec.descricao LIKE '%Clash Royale%'; SELECT * FROM framework.expenses_card; DELETE FROM framework.expenses_card; ALTER TABLE framework.expenses_card AUTO_INCREMENT = 1; ALTER TABLE expenses_card AUTO_INCREMENT = 1; INSERT INTO framework.expenses_card (descricao, data_compra, fk_credit_cards, created_at, updated_at) SELECT DISTINCT despesa AS descricao, data_compra AS data_compra, fk_id_cartao_credito AS fk_credit_cards, '2018-10-18 18:45:45' AS created_at, '2018-10-18 18:45:45' AS updated_at FROM financeiro.tb_despesa_cartao WHERE fk_id_cartao_credito = 1 AND data_compra > '2016-01-01' ORDER BY despesa , parcela ASC; SELECT despesa AS descricao, data_compra AS data_compra, valor_compra AS valor, parcela AS numero_parcela, data_pagamento AS data_pagamento, NOW() AS created_at, NOW() AS updated_at FROM financeiro.tb_despesa_cartao WHERE fk_id_cartao_credito = 2 AND data_compra > '2016-01-01' ORDER BY despesa, parcela ASC; SELECT parcela AS numero_parcela FROM financeiro.tb_despesa_cartao WHERE fk_id_cartao_credito = 1 AND data_compra > '2016-01-01' ORDER BY despesa, parcela ASC;
true
48332809cd367c0aa1f278567030000dba5f1faf
SQL
vladimirpetukhov/Soft_Uni_Studies
/C#_Data_Base_MS_SQL/Database Basics – MS SQL – май 2018/Subqueries and JOINs/Subqueries and JOINs/04. Employee Departments.sql
UTF-8
173
3.53125
4
[ "MIT" ]
permissive
SELECT TOP 5 e.EmployeeID,e.FirstName,e.Salary,d.Name FROM Employees AS e JOIN Departments AS d ON d.DepartmentID=e.DepartmentID WHERE e.Salary>15000 ORDER BY e.DepartmentID
true
34ea08f1b934a60f7dce601700ac6d131e6c8677
SQL
kids-cademy/atlas.studio
/db/patches/0.5.7/02.sql
UTF-8
245
2.96875
3
[ "Apache-2.0" ]
permissive
-- Infer meta_id foreign key. UPDATE `atlas`.`atlasobject` o JOIN `atlas`.`taxon` t ON o.id=t.atlasobject_id JOIN `atlas`.`atlascollection_taxonomymeta` m ON o.collection_id=m.atlascollection_id SET t.`meta_id`=m.`id` WHERE t.name=m.name;
true
7bb7de9cba5e44b14c98ca428ac4cb9af33cb858
SQL
aminebousselmi/BD50
/src/public/700_Create_pqb_db/730_create_pqi_db_librairie_commande.sql
UTF-8
628
2.671875
3
[]
no_license
-------------------------------------------------------- -- PACKAGE DB_COMMANDE -------------------------------------------------------- CREATE OR REPLACE PACKAGE DB_COMMANDE AS TYPE sqlcur IS REF CURSOR; FUNCTION clientHasCommande( p_cln_id CLIENT.CLN_ID%TYPE ) RETURN NUMBER; FUNCTION addCommande( p_client COMMANDE.CLN_ID%TYPE ,p_desc COMMANDE.CMD_DESC%TYPE ,p_prix COMMANDE.CMD_PRIX_TTC%TYPE ,p_mode COMMANDE.FCT_MODE%TYPE ) RETURN NUMBER; FUNCTION allCommandesClient( p_client COMMANDE.CLN_ID%TYPE ) RETURN sqlcur; PROCEDURE payerCommande(cmd_num COMMANDE.CMD_NUM%TYPE); END DB_COMMANDE; /
true
27e51ebaa7f160df810ce394a1a6a5ef218a819c
SQL
DaeguIT-MinSuKim/Omori
/Scripts/Script-3.sql
UTF-8
1,015
2.71875
3
[]
no_license
-- testname, testquestion, testexample -- image LOAD DATA LOCAL INFILE "D:\\workspace\\workspace_spring\\Omori_Ver2\\DataFiles\\image.txt" INTO TABLE image character set utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'; select * from image; -- selected_answer LOAD DATA LOCAL INFILE "D:\\workspace\\workspace_spring\\Omori_Ver2\\DataFiles\\selectedAnswer5.txt" INTO TABLE selected_answer character set utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' set sa_date = now(); -- now_grade LOAD DATA LOCAL INFILE "D:\\workspace\\workspace_spring\\Omori_Ver2\\DataFiles\\nowgrade5.txt" INTO TABLE nowgrade character set utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' set ng_date = now(); -- grade LOAD DATA LOCAL INFILE "D:\\workspace\\workspace_spring\\Omori_Ver2\\DataFiles\\grade5.txt" INTO TABLE grade character set utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'; delete from grade; alter table grade auto_increment = 1; select * from grade;
true
72fb707fe542875fe1df7883aa3565203f5cd3da
SQL
betagouv/metiers-numeriques
/prisma/migrations/20220224075937_create_archived_jobs/migration.sql
UTF-8
823
3.890625
4
[ "MIT" ]
permissive
-- CreateTable CREATE TABLE "ArchivedJob" ( "id" TEXT NOT NULL, "title" TEXT NOT NULL, "missionDescription" TEXT NOT NULL, "profileDescription" TEXT, "recruiterName" TEXT NOT NULL, "region" TEXT NOT NULL, "slug" TEXT NOT NULL, "source" "JobSource" NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "expiredAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL, "professionId" TEXT NOT NULL, CONSTRAINT "ArchivedJob_pkey" PRIMARY KEY ("id") ); -- CreateIndex CREATE UNIQUE INDEX "ArchivedJob_slug_key" ON "ArchivedJob"("slug"); -- AddForeignKey ALTER TABLE "ArchivedJob" ADD CONSTRAINT "ArchivedJob_professionId_fkey" FOREIGN KEY ("professionId") REFERENCES "Profession"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
true
ea660bf61e550d9282b48db7f1e184239858313c
SQL
lifephongphanmem/csdlgia2018
/public/data/kkdkg/XD00987654321571881977&1.sql
UTF-8
8,083
2.546875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 29, 2019 at 08:44 AM -- Server version: 10.1.25-MariaDB -- PHP Version: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `csdlgia_vp` -- -- -------------------------------------------------------- -- -- Table structure for table `kkdkgct` -- CREATE TABLE `kkdkgct` ( `id` int(10) UNSIGNED NOT NULL, `maxa` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `mahuyen` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `mahs` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `tenhh` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `quycach` text COLLATE utf8_unicode_ci, `dvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `plhh` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `gialk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `giakk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `ghichu` text COLLATE utf8_unicode_ci, `trangthai` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkdonvisxkd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkqcpc` text COLLATE utf8_unicode_ci, `nksanluongdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nksanluongtt` double NOT NULL DEFAULT '0', `nksanluonggc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiamuackdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiamuacktt` double NOT NULL DEFAULT '0', `nkgiamuackgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuedvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuett` double NOT NULL DEFAULT '0', `nkthueghichu` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuettdbdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuettdbtt` double NOT NULL DEFAULT '0', `nkthuettdbgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuephikdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuephiktt` double NOT NULL DEFAULT '0', `nkthuephikgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nktienkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nktienktt` double NOT NULL DEFAULT '0', `nktienkgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphitcdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphitctt` double NOT NULL DEFAULT '0', `nkchiphitcgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphibhdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphibhtt` double NOT NULL DEFAULT '0', `nkchiphibhgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphiqldvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkchiphiqltt` double NOT NULL DEFAULT '0', `nkchiphiqlgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiathanh1spdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiathanh1sptt` double NOT NULL DEFAULT '0', `nkgiathanh1spgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkloinhuandkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkloinhuandktt` double NOT NULL DEFAULT '0', `nkloinhuandkgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuegtgtkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkthuegtgtktt` double NOT NULL DEFAULT '0', `nkthuegtgtkgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiabandkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgiabandktt` double NOT NULL DEFAULT '0', `nkgiabandkgc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nkgtgiamuack` text COLLATE utf8_unicode_ci, `nkgtthuenk` text COLLATE utf8_unicode_ci, `nkgtthuettdb` text COLLATE utf8_unicode_ci, `nkgtthuephik` text COLLATE utf8_unicode_ci, `nkgttienk` text COLLATE utf8_unicode_ci, `nkgtchiphitc` text COLLATE utf8_unicode_ci, `nkgtchiphibh` text COLLATE utf8_unicode_ci, `nkgtchiphiql` text COLLATE utf8_unicode_ci, `nkgtloinhuandk` text COLLATE utf8_unicode_ci, `nkgtthuegtgt` text COLLATE utf8_unicode_ci, `nkgtgiabandk` text COLLATE utf8_unicode_ci, `sxdonvisxkd` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sxqcpc` text COLLATE utf8_unicode_ci, `sxchiphinvldvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphinvlsl` double NOT NULL DEFAULT '1', `sxchiphinvldg` double NOT NULL DEFAULT '0', `sxchiphincdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphincsl` double NOT NULL DEFAULT '1', `sxchiphincdg` double NOT NULL DEFAULT '0', `sxchiphinvpxdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphinvpxsl` double NOT NULL DEFAULT '1', `sxchiphinvpxdg` double NOT NULL DEFAULT '0', `sxchiphivldvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphivlsl` double NOT NULL DEFAULT '0', `sxchiphivldg` double NOT NULL DEFAULT '0', `sxchiphidcsxdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphidcsxsl` double NOT NULL DEFAULT '1', `sxchiphidcsxdg` double NOT NULL DEFAULT '0', `sxchiphikhtscddvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphikhtscdsl` double NOT NULL DEFAULT '1', `sxchiphikhtscddg` double NOT NULL DEFAULT '0', `sxchiphidvmndvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphidvmnsl` double NOT NULL DEFAULT '1', `sxchiphidvmndg` double NOT NULL DEFAULT '0', `sxchiphitienkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphitienksl` double NOT NULL DEFAULT '1', `sxchiphitienkdg` double NOT NULL DEFAULT '0', `sxchiphibhdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphibhsl` double NOT NULL DEFAULT '1', `sxchiphibhdg` double NOT NULL DEFAULT '0', `sxchiphiqldndvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphiqldnsl` double NOT NULL DEFAULT '1', `sxchiphiqldndg` double NOT NULL DEFAULT '0', `sxchiphitcdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxchiphitcsl` double NOT NULL DEFAULT '1', `sxchiphitcdg` double NOT NULL DEFAULT '0', `sxloinhuandkdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxloinhuandksl` double NOT NULL DEFAULT '1', `sxloinhuandkdg` double NOT NULL DEFAULT '0', `sxgiabanctdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxgiabanctsl` double NOT NULL DEFAULT '1', `sxgiabanctdg` double NOT NULL DEFAULT '0', `sxthuettdbdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxthuettdbsl` double NOT NULL DEFAULT '1', `sxthuettdbdg` double NOT NULL DEFAULT '0', `sxthuegtgtdvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxthuegtgtsl` double NOT NULL DEFAULT '1', `sxthuegtgtdg` double NOT NULL DEFAULT '0', `sxgiabandvt` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `sxgiabansl` double NOT NULL DEFAULT '1', `sxgiabandg` double NOT NULL DEFAULT '0', `sxgtchiphisx` text COLLATE utf8_unicode_ci, `sxgtchiphibh` text COLLATE utf8_unicode_ci, `sxgtchiphiqldn` text COLLATE utf8_unicode_ci, `sxgtchiphitc` text COLLATE utf8_unicode_ci, `sxgtloinhuandk` text COLLATE utf8_unicode_ci, `sxgtthuettdb` text COLLATE utf8_unicode_ci, `sxgtthuegtgt` text COLLATE utf8_unicode_ci, `sxgtgiaban` text COLLATE utf8_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `kkdkgct` -- ALTER TABLE `kkdkgct` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `kkdkgct` -- ALTER TABLE `kkdkgct` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
c7a18810f062fdd366322de43d592e7b0ed9da5d
SQL
kacox1251/unit12-employeetracker
/db/seeds.sql
UTF-8
615
2.6875
3
[ "MIT" ]
permissive
INSERT INTO department (name) VALUES ("Sales"), ("Production"), ("Development"), ("Corporate"); INSERT INTO role (title, salary,department_id) VALUES ("Accounts", 57000.00, 1), ("Manager", 60000.00, 1), ("Coordinator", 48000.00, 2), ("Engineer", 60000.00, 3), ("CEO", 100000.00, 4); INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ("Selena", "Kyle", 1, 2), ("Bruce", "Wayne", 2, 3), ("Dick", "Greyson", 3, 1), ("Alfred", "Pennyworth", 2, 3), ("Barbara", "Gordon", 4, 3), ("Thomas", "Wayne", 5, 3); INSERT INTO manager (full_name) VALUES ("Bruce Wayne"), ("Alfred Pennyworth"), ("Thomas Wayne"), ("None");
true
4220f71d15772426c568e2b8225eeb9fdfe4c867
SQL
sdong49/biere-en-stock
/projet.sql
UTF-8
23,991
2.859375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : lun. 22 juin 2020 à 10:51 -- Version du serveur : 10.4.8-MariaDB -- Version de PHP : 7.3.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `projet` -- -- -------------------------------------------------------- -- -- Structure de la table `articles` -- CREATE TABLE `articles` ( `id` int(10) NOT NULL, `nom` varchar(50) NOT NULL, `description` text NOT NULL, `image` varchar(255) DEFAULT NULL, `degre` varchar(10) DEFAULT NULL, `categorie_id` int(10) NOT NULL, `brasseur_id` int(10) DEFAULT NULL, `contenance_id` int(10) DEFAULT NULL, `nuance_gout_intensite` varchar(225) DEFAULT NULL, `nuance_gout_amertume` varchar(255) DEFAULT NULL, `nuance_gout_douceur` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `articles` -- INSERT INTO `articles` (`id`, `nom`, `description`, `image`, `degre`, `categorie_id`, `brasseur_id`, `contenance_id`, `nuance_gout_intensite`, `nuance_gout_amertume`, `nuance_gout_douceur`) VALUES (1, 'Bouteille 01', 'Description de bouteille 01 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_01.jpg', '6.6', 1, 1, 2, 'app/public/svg/nuance_2.svg', 'app/public/svg/nuance_3.svg', 'app/public/svg/nuance_3.svg'), (2, 'Bouteille 02', 'Description de bouteille 02 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_02.jpg', '6.5', 1, 2, 2, NULL, NULL, NULL), (3, 'Bouteille 03', 'Description de bouteille 03 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_03.jpg', '5.7', 1, 2, 1, NULL, NULL, NULL), (4, 'Bouteille 04', 'Description de bouteille 04 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_04.jpg', '6.6', 1, 1, 2, NULL, NULL, NULL), (5, 'Bouteille 05', 'Description de bouteille 05,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_05.jpg', '6.5', 1, 1, 1, NULL, NULL, NULL), (6, 'Bouteille 06', 'Description de bouteille 06,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_06.jpg', '5.8', 1, 3, 2, NULL, NULL, NULL), (7, 'Fût 01', 'Description de fût 01,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_08.jpg', '6.5', 2, 2, 4, NULL, NULL, NULL), (8, 'Fût 02', 'Description de fût 02,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_09.jpg', '7.3', 2, 3, 4, NULL, NULL, NULL), (9, 'Fût 03', 'Description de fût 03,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_10.jpg', '5.8', 2, 1, 4, NULL, NULL, NULL), (10, 'Assortiment 01', 'Description d\'assortimant 01,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_12.jpg', NULL, 4, NULL, NULL, NULL, NULL, NULL), (11, 'Assortiment 02', 'Description d\'assortimant 02,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_13.jpg', NULL, 4, NULL, NULL, NULL, NULL, NULL), (12, 'Assortiment 03', 'Description d\'assortimant 03,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_14.jpg', NULL, 4, NULL, NULL, NULL, NULL, NULL), (13, 'Assortiment 04', 'Description d\'assortimant 04,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_15.jpg', NULL, 4, NULL, NULL, NULL, NULL, NULL), (14, 'Tireuse 01', 'Description de tireuse 01,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_17.jpg', NULL, 5, 4, NULL, NULL, NULL, NULL), (15, 'Tireuse 02', 'Description de tireuse 02,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_19.jpg', NULL, 5, 4, NULL, NULL, NULL, NULL), (16, 'Tireuse 03', 'Description de tireuse 03,Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'http://www.greta-bretagne-sud.fr/stagiaires/saiyin-dong/biere_en_stock/app/public/images/page_produit_18.jpg', NULL, 5, 4, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Structure de la table `brasseur` -- CREATE TABLE `brasseur` ( `id` int(225) NOT NULL, `nom` varchar(225) NOT NULL, `histoire` text DEFAULT NULL, `pays_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `brasseur` -- INSERT INTO `brasseur` (`id`, `nom`, `histoire`, `pays_id`) VALUES (1, 'Brasseur 01', 'Histoire de brasseur 01, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed ', 1), (2, 'Brasseur 02', 'Histoire de brasseur 02, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed ', 2), (3, 'Brasseur 03', 'Histoire de brasseur 03, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed ', 3), (4, 'Brasseur 04', 'Histoire de brasseur 04, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed ', 4), (5, 'Ignorer', NULL, 5); -- -------------------------------------------------------- -- -- Structure de la table `categorie` -- CREATE TABLE `categorie` ( `id` int(225) NOT NULL, `nom` varchar(225) NOT NULL, `description` text NOT NULL, `image` varchar(225) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `categorie` -- INSERT INTO `categorie` (`id`, `nom`, `description`, `image`) VALUES (1, 'Bouteille', 'Descrption de catégorie \"Bouteille\",Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'app/public/images/page_produit_00.jpg'), (2, 'Fût', 'Descrption de catégorie \"Fût\",Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'app/public/images/page_produit_07.jpg'), (4, 'Assortiment', 'Descrption de catégorie \"Assortiment\",Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed.', 'app/public/images/page_produit_11.jpg'), (5, 'Tireuse', 'Descrption de catégorie \"Tireuse\",Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sapien velit, aliquet eget commodo nec, auctor a sapien. Nam eu neque vulputate diam rhoncus faucibus. Curabitur quis varius libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat sem at mauris suscipit porta. Cras metus velit, elementum sed pellentesque a, pharetra eu eros. Etiam facilisis placerat euismod. Nam faucibus neque arcu, quis accumsan leo tincidunt varius. In vel diam enim. Sed id ultrices ligula. Maecenas at urna arcu. Sed', 'app/public/images/page_produit_16.jpg'); -- -------------------------------------------------------- -- -- Structure de la table `contenance` -- CREATE TABLE `contenance` ( `id` int(225) NOT NULL, `nom` varchar(225) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `contenance` -- INSERT INTO `contenance` (`id`, `nom`) VALUES (1, '33 cl'), (2, '25 cl'), (3, '75 cl'), (4, '5 L'), (5, 'Ignorer'); -- -------------------------------------------------------- -- -- Structure de la table `message` -- CREATE TABLE `message` ( `id` int(255) NOT NULL, `nom` varchar(255) NOT NULL, `prenom` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `adresse` varchar(255) NOT NULL, `message` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `message` -- INSERT INTO `message` (`id`, `nom`, `prenom`, `email`, `phone`, `adresse`, `message`) VALUES (1, 'Dupont', 'Jean', 'jean.dupont@gmail.com', '06 12 34 56 78', '1, rue saint jean 56000 vannes', 'Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.'), (2, 'Liu', 'Dehua', 'liudehua@live.com', '00852 520 520 520', '1 bd de la paix 56000 vannes', 'Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.'), (10, 'Roger', 'Marc', 'marc.roger@live.com', '07 56 24 48 79', '26 av de la marne vannes', 'Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.'), (11, 'Virel', 'Thomas', 'vt56000@live.com', '07 56 33 54 66', '59 av de la marne vannes', 'Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.'), (12, 'Conan', 'Joel', 'conan.joel60@live.com', '06 12 33 54 66', '55 av de la marne Noyon', 'Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.'); -- -------------------------------------------------------- -- -- Structure de la table `pays` -- CREATE TABLE `pays` ( `id` int(255) NOT NULL, `nom_pays` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `pays` -- INSERT INTO `pays` (`id`, `nom_pays`) VALUES (1, 'France'), (2, 'Italie'), (3, 'Angleterre'), (4, 'Allemagne'), (5, 'Ignorer'); -- -------------------------------------------------------- -- -- Structure de la table `user` -- CREATE TABLE `user` ( `id` int(225) NOT NULL, `email` varchar(225) NOT NULL, `password` varchar(225) NOT NULL, `address` varchar(225) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Déchargement des données de la table `user` -- INSERT INTO `user` (`id`, `email`, `password`, `address`) VALUES (1, 'test@test.com', 'test@test.com', ''); -- -- Index pour les tables déchargées -- -- -- Index pour la table `articles` -- ALTER TABLE `articles` ADD PRIMARY KEY (`id`), ADD KEY `fk_categorie` (`categorie_id`), ADD KEY `fk_brasseur` (`brasseur_id`), ADD KEY `fk_contenance` (`contenance_id`); -- -- Index pour la table `brasseur` -- ALTER TABLE `brasseur` ADD PRIMARY KEY (`id`), ADD KEY `fk_pays` (`pays_id`); -- -- Index pour la table `categorie` -- ALTER TABLE `categorie` ADD PRIMARY KEY (`id`); -- -- Index pour la table `contenance` -- ALTER TABLE `contenance` ADD PRIMARY KEY (`id`); -- -- Index pour la table `message` -- ALTER TABLE `message` ADD PRIMARY KEY (`id`); -- -- Index pour la table `pays` -- ALTER TABLE `pays` ADD PRIMARY KEY (`id`); -- -- Index pour la table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`); -- -- AUTO_INCREMENT pour les tables déchargées -- -- -- AUTO_INCREMENT pour la table `articles` -- ALTER TABLE `articles` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34; -- -- AUTO_INCREMENT pour la table `brasseur` -- ALTER TABLE `brasseur` MODIFY `id` int(225) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT pour la table `categorie` -- ALTER TABLE `categorie` MODIFY `id` int(225) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT pour la table `contenance` -- ALTER TABLE `contenance` MODIFY `id` int(225) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT pour la table `message` -- ALTER TABLE `message` MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT pour la table `pays` -- ALTER TABLE `pays` MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT pour la table `user` -- ALTER TABLE `user` MODIFY `id` int(225) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Contraintes pour les tables déchargées -- -- -- Contraintes pour la table `articles` -- ALTER TABLE `articles` ADD CONSTRAINT `fk_brasseur` FOREIGN KEY (`brasseur_id`) REFERENCES `brasseur` (`id`), ADD CONSTRAINT `fk_categorie` FOREIGN KEY (`categorie_id`) REFERENCES `categorie` (`id`), ADD CONSTRAINT `fk_contenance` FOREIGN KEY (`contenance_id`) REFERENCES `contenance` (`id`); -- -- Contraintes pour la table `brasseur` -- ALTER TABLE `brasseur` ADD CONSTRAINT `fk_pays` FOREIGN KEY (`pays_id`) REFERENCES `pays` (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
eb6e0ff53ddb8c9044225a83c98a85836510258e
SQL
viet-dc97/spring-jsp
/src/sql/java5.sql
UTF-8
2,941
3.84375
4
[]
no_license
CREATE TABLE `accounts` ( `username` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, `fullname` varchar(50) DEFAULT NULL, `email` varchar(50) DEFAULT NULL, `photo` varchar(100) DEFAULT NULL, `role` bit(1) DEFAULT NULL, `status` bit(1) DEFAULT NULL, `time` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(11) NOT NULL, `name` varchar(50) DEFAULT NULL, `status` bit(1) DEFAULT NULL, `time` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(11) NOT NULL, `username` varchar(30) NOT NULL, `andress` varchar(100) DEFAULT NULL, `time` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `order_detail` -- CREATE TABLE `order_detail` ( `id` int(11) NOT NULL, `order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `price` float DEFAULT NULL, `quantity` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `name` varchar(50) DEFAULT NULL, `image` varchar(100) DEFAULT NULL, `price` float DEFAULT NULL, `status` bit(1) DEFAULT NULL, `time` datetime DEFAULT NULL, `category_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `accounts` -- ALTER TABLE `accounts` ADD PRIMARY KEY (`username`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_detail` -- ALTER TABLE `order_detail` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD KEY `category_id` (`category_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `order_detail` -- ALTER TABLE `order_detail` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`); COMMIT;
true
a14ccd23ab6a0f6f082b6767294fd66884a95692
SQL
james-monahan/Python_SQL_practice
/Unique_Salaries_HARD.sql
UTF-8
529
4.28125
4
[]
no_license
/*Find the top three unique salaries for each department. Output the department name and the top 3 unique salaries by each department. Order your results alphabetically by department and then by highest salary to lowest.*/ WITH inner_q AS (select department, salary, DENSE_RANK() OVER(PARTITION BY department ORDER BY salary DESC) AS ranking from twitter_employee), outer_q AS (SELECT * FROM inner_q WHERE ranking IN (1,2,3)) SELECT department,salary FROM outer_q GROUP BY department,salary,ranking ORDER BY 1 ASC, 2 DESC
true
e8b2e06c786aa436f26bd0a3576f9273dba0ad2b
SQL
sebaek/jsp20210510
/WebContent/WEB-INF/sql/JOIN05.sql
UTF-8
637
4.0625
4
[]
no_license
USE test; SELECT * FROM Orders; -- 주문의 고객명 SELECT o.OrderID, c.CustomerName FROM Orders o JOIN Customers c ON o.CustomerID = c.CustomerID; -- 주문의 고객명, 직원명 SELECT o.OrderID, c.CustomerName, e.LastName, e.FirstName FROM Orders o JOIN Customers c ON o.CustomerID = c.CustomerID JOIN Employees e ON o.EmployeeID = e.EmployeeID ; -- 주문의 고객명, 직원명(lastName + firstName) SELECT o.OrderID, c.CustomerName, concat(e.LastName, ', ', e.FirstName) EmployeeName FROM Orders o JOIN Customers c ON o.CustomerID = c.CustomerID JOIN Employees e ON o.EmployeeID = e.EmployeeID ; -- desc Employees;
true
202359755f8bb430abecbb728918b922d5da44b9
SQL
SHUSHI-warlock/RFID-LMS
/sql/建表.sql
GB18030
1,983
3.890625
4
[]
no_license
/**/ /* ԱT_People Column(s) of " T_ Peop " Table Name Datatype Null Option Comment Is PK Is FK Name P_Id Varchar(20) NOT NULL Yes No ߿ P_Password Varchar(20) NOT NULL No No */ create table T_People ( P_Id Varchar(20) NOT NULL PRIMARY KEY, P_Name Varchar(20), P_Password Varchar(20) NOT NULL ) /* ͼT_Book Column(s) of " T_ Book " Table Name Datatype Null Option Comment Is PK Is FK Name B_Id Varchar(20) NOT NULL Yes No B_Class Varchar(20) NOT NULL No No B_Author Varchar(20) B_Name Varchar(20) NOT NULL B_CountAll Int ܿ B_CountNow Int ǰ */ /*޸Ϊ100 ALTER TABLE T_Book ALTER COLUMN B_Author Varchar(100) ALTER TABLE T_Book ALTER COLUMN B_Name Varchar(100) */ create table T_Book ( B_Id Varchar(20) NOT NULL PRIMARY KEY, B_Class Varchar(20), B_Author Varchar(100) NOT NULL , B_Name Varchar(100) NOT NULL, B_CountAll Int, B_CountNow Int, ) /* ǩ(T_Label) Column(s) of " T_ Label " Table Name Datatype Null Option Comment Is PK Is FK Name B_Id Varchar(20) NOT NULL Yes Yes ͼ L_Id Varchar(20) NOT NULL Yes No ǩ */ create table T_Label ( B_Id Varchar(20) NOT NULL , L_Id Varchar(20) NOT NULL, foreign key(B_Id) references T_Book(B_Id), PRIMARY KEY(B_Id,L_Id), ); /* ıT_Borrow Column(s) of " T_ Borrow " Table Name Datatype Null Option Comment Is PK Is FK Name P_Id Varchar(20) NOT NULL Yes Yes ߿ L_Id Varchar(20) NOT NULL Yes Yes ǩ BR_Start Time BR_Time int ʱ() BR_Isreturn Bool Ƿ黹 */ create table T_Borrow ( P_Id Varchar(20) NOT NULL, L_Id Varchar(20) NOT NULL, BR_Start DateTime NOT NULL, B_Id Varchar(20) NOT NULL , BR_Time int NOT NULL, /**/ BR_IsReturn int, foreign key(P_Id)references T_People(P_Id), foreign key(B_Id,L_Id)references T_Label(B_Id,L_Id), PRIMARY KEY( P_Id,L_Id,BR_Start), );
true
4492d0621c75c039e0f86cf0eaf28c6de6eb296e
SQL
mikirov/SQL-2019-2020
/2020-3-27/queries.sql
UTF-8
426
3.625
4
[]
no_license
use ex2; select st.name, g.name, g.grade from grades g inner join student st on st.id = g.student_id; select avg(g.grade) from grades g where g.student_id = 1 and g.name like "SUBD"; select avg(g.grade) as average_grade, st.name from student st inner join grades g on g.student_id = st.id group by st.id; select st.name, st.age, g.name, g.grade from student st inner join grade g on g.student_id = st.id where g.grade > 4;
true
d188966d1689f168e8f1b7500bc30d2fae9167f4
SQL
autorizadabr/atsadmin
/script/mov_estoqueTeste.sql
UTF-8
7,973
3.234375
3
[]
no_license
SET TERM ^ ; CREATE OR ALTER PROCEDURE MOV_ESTOQUETESTE (codproduto integer) RETURNS ( TesteValor char(1), -- Testa tab MOVIMENTODETALHE TesteEstoque char(1), -- Testa tab MOVIMENTODETALHE TestePrecoMedio char(1), -- Testa tab MOVIMENTODETALHE TesteEstoqueProd char(1), -- Testa tab PRODUTOS TestePrecoMedioProd char(1), -- Testa tab PRODUTOS debugar varchar(300), Estoque double PRECISION, PrecoMedio double PRECISION, VlrEstoque double PRECISION ) AS DECLARE VARIABLE EstoqueAtual double PRECISION; DECLARE VARIABLE PrecoMedioAtual double PRECISION; DECLARE VARIABLE VlrEstoqueAtual double PRECISION; DECLARE VARIABLE EstoqueNovo double PRECISION; DECLARE VARIABLE PrecoMedioNovo double PRECISION; DECLARE VARIABLE VlrEstoqueNovo double PRECISION; DECLARE VARIABLE EstoqueInserido double PRECISION; DECLARE VARIABLE PrecoMedioInserido double PRECISION; DECLARE VARIABLE VlrEstoqueInserido double PRECISION; DECLARE VARIABLE DINI Date; DECLARE VARIABLE DFIM Date; BEGIN -- Apago o teste se ja foi feito Delete from Compra where codCompra = 9111333; Delete from MOVIMENTODETALHE where codMovimento = 911122201; Delete from Movimento where codMovimento = 9111222; DIni = CURRENT_DATE - 60; DFim = CURRENT_DATE; /* Testa a trigger Mov_estoque se esta atualizando corretamente os dados do estoque */ -- Pego o estoque atual e preco medio antes deste movimento select first 1 md.PRECOCUSTO, md.QTDEESTOQUE from MOVIMENTO m , MOVIMENTODETALHE md where md.CODMOVIMENTO = m.CODMOVIMENTO and md.CODPRODUTO = :codProduto and m.DATAMOVIMENTO > :DIni order by m.DATAMOVIMENTO desc, m.CODMOVIMENTO desc into :PrecoMedioAtual, :EstoqueAtual; if (PrecoMedioAtual is null) then PrecoMedioAtual = 0; if (EstoqueAtual is null) then EstoqueAtual = 0; vlrEstoqueAtual = EstoqueAtual * PrecoMedioAtual; Estoque = EstoqueAtual; PrecoMedio = PrecoMEdioAtual; VlrEstoque = vlrEstoqueAtual; Debugar = 'Valores Antes da Inserir'; Suspend; -- Inserindo uma Entrada (Compra) INSERT INTO MOVIMENTO (CODMOVIMENTO, DATAMOVIMENTO, CODCLIENTE, CODNATUREZA, STATUS, CODUSUARIO, CODVENDEDOR, CODALMOXARIFADO, CODFORNECEDOR, DATA_SISTEMA) VALUES (9111222, :DFim, 0, 4, 0, 1, 1, 51, 0, :DFim); INSERT INTO MOVIMENTODETALHE (CODDETALHE, CODMOVIMENTO, CODPRODUTO, QUANTIDADE, PRECO, ICMS, UN, QTDE_ALT) VALUES (911122201, 9111222, :CodProduto, 100, 10, 0, 'kg', 0); INSERT INTO COMPRA (CODCOMPRA, CODMOVIMENTO, CODFORNECEDOR, DATACOMPRA, DATAVENCIMENTO, CODCOMPRADOR, STATUS, CODUSUARIO, DATASISTEMA, VALOR, NOTAFISCAL, SERIE, DESCONTO, CODCCUSTO, N_PARCELA, FORMAPAGAMENTO, ENTRADA) VALUES (9111333, 9111222, 0, :DFim, :DFim + 30, 1, 0, 1, :DFim, 1000, 9111333, '', 0, 51, 1, 1, 0); EstoqueNovo = EstoqueAtual + 100; VlrEstoqueNovo = VlrEstoqueAtual + 1000; PrecoMedioNovo = VlrEstoqueNovo / EstoqueNovo; Estoque = EstoqueNovo; PrecoMedio = PrecoMedioNovo; VlrEstoque = VlrEstoqueNovo; Debugar = 'Valores Inseridos Novos'; Suspend; -- Pega os valores atualizados do estoque MOVIMENTODETALHE select first 1 md.PRECOCUSTO, md.QTDEESTOQUE from MOVIMENTO m , MOVIMENTODETALHE md where md.CODMOVIMENTO = m.CODMOVIMENTO and md.CODPRODUTO = :codProduto and m.DATAMOVIMENTO = :DFim into :PrecoMedioInserido, :EstoqueInserido; if (PrecoMedioInserido is null) then PrecoMedioInserido = 0; if (EstoqueInserido is null) then EstoqueInserido = 0; vlrEstoqueInserido = EstoqueInserido * PrecoMedioInserido; Estoque = EstoqueInserido; PrecoMedio = PrecoMEdioInserido; VlrEstoque = vlrEstoqueInserido; Debugar = 'Valores Atualizado do Estoque'; Suspend; Estoque = 0; PrecoMedio = 0; VlrEstoque = 0; Debugar = ''; TestePrecoMedio = 'N'; if (PrecoMedioInserido = PrecoMedioNovo) then TestePrecoMedio = 'S'; TesteEstoque = 'N'; if (EstoqueInserido = EstoqueNovo) then TesteEstoque = 'S'; TesteValor = 'N'; --Debugar = 'vlrIns - ' || Cast(UDF_ROUNDDEC(vlrEstoqueInserido, 2) as varchar(10)) || ' vlrNovo - ' || Cast(UDF_ROUNDDEC(VlrEstoqueNovo,2) as varchar(10)); if (UDF_ROUNDDEC(vlrEstoqueInserido, 2) = UDF_ROUNDDEC(VlrEstoqueNovo,2)) then TesteValor = 'S'; -- Pega os valores atualizados do estoque PRODUTOS PrecoMedioInserido = 0; EstoqueInserido = 0; select p.PRECOMEDIO, p.ESTOQUEATUAL from PRODUTOS p where p.CODPRODUTO = :codProduto into :PrecoMedioInserido, :EstoqueInserido; if (PrecoMedioInserido is null) then PrecoMedioInserido = 0; if (EstoqueInserido is null) then EstoqueInserido = 0; vlrEstoqueInserido = EstoqueInserido * PrecoMedioInserido; TestePrecoMedioProd = 'N'; if (UDF_ROUNDDEC(PrecoMedioInserido,2) = UDF_ROUNDDEC(PrecoMedioNovo,2)) then TestePrecoMedioProd = 'S'; TesteEstoqueProd = 'N'; if (EstoqueInserido = EstoqueNovo) then TesteEstoqueProd = 'S'; debugar = 'Teste Inserindo'; suspend; TestePrecoMedioProd = ''; TesteEstoqueProd = ''; TesteValor = ''; TesteEstoque = ''; TestePrecoMedio = ''; -- ############# Teste Editando ########### UPDATE MOVIMENTODETALHE SET QUANTIDADE = 150 WHERE CODDETALHE = 911122201; EstoqueNovo = EstoqueNovo + 50; VlrEstoqueNovo = VlrEstoqueNovo + 500; PrecoMedioNovo = VlrEstoqueNovo / EstoqueNovo; -- Pega os valores atualizados do estoque MOVIMENTODETALHE select first 1 md.PRECOCUSTO, md.QTDEESTOQUE from MOVIMENTO m , MOVIMENTODETALHE md where md.CODMOVIMENTO = m.CODMOVIMENTO and md.CODPRODUTO = :codProduto and m.DATAMOVIMENTO = :DFim into :PrecoMedioInserido, :EstoqueInserido; if (PrecoMedioInserido is null) then PrecoMedioInserido = 0; if (EstoqueInserido is null) then EstoqueInserido = 0; vlrEstoqueInserido = EstoqueInserido * PrecoMedioInserido; Estoque = EstoqueInserido; PrecoMedio = PrecoMEdioInserido; VlrEstoque = vlrEstoqueInserido; Debugar = 'Valores Atualizado do Estoque'; Suspend; Estoque = 0; PrecoMedio = 0; VlrEstoque = 0; Debugar = ''; TestePrecoMedio = 'N'; if (PrecoMedioInserido = PrecoMedioNovo) then TestePrecoMedio = 'S'; TesteEstoque = 'N'; if (EstoqueInserido = EstoqueNovo) then TesteEstoque = 'S'; TesteValor = 'N'; --Debugar = 'vlrIns - ' || Cast(UDF_ROUNDDEC(vlrEstoqueInserido, 2) as varchar(10)) || ' vlrNovo - ' || Cast(UDF_ROUNDDEC(VlrEstoqueNovo,2) as varchar(10)); if (UDF_ROUNDDEC(vlrEstoqueInserido, 2) = UDF_ROUNDDEC(VlrEstoqueNovo,2)) then TesteValor = 'S'; -- Pega os valores atualizados do estoque PRODUTOS PrecoMedioInserido = 0; EstoqueInserido = 0; select p.PRECOMEDIO, p.ESTOQUEATUAL from PRODUTOS p where p.CODPRODUTO = :codProduto into :PrecoMedioInserido, :EstoqueInserido; if (PrecoMedioInserido is null) then PrecoMedioInserido = 0; if (EstoqueInserido is null) then EstoqueInserido = 0; vlrEstoqueInserido = EstoqueInserido * PrecoMedioInserido; TestePrecoMedioProd = 'N'; if (UDF_ROUNDDEC(PrecoMedioInserido,2) = UDF_ROUNDDEC(PrecoMedioNovo,2)) then TestePrecoMedioProd = 'S'; TesteEstoqueProd = 'N'; if (EstoqueInserido = EstoqueNovo) then TesteEstoqueProd = 'S'; debugar = 'Teste Alterando Quantidade'; suspend; END^ SET TERM ; ^
true
3dfa6e5abdc87cf176ca65eee6a9331bb4119aea
SQL
Laxmithoodi/DataGrip.PokemonSqlLab
/pokemon_sql/part3.sql
UTF-8
1,413
4.375
4
[]
no_license
//What is each pokemon's primary type? SELECT p.name, t.name as primary_typename, p.primary_type FROM pokemons p join types t ON p.primary_type = t.id; //What is Rufflet's secondary type? SELECT p.name, t.name as secondary_typename FROM pokemons p JOIN types t ON p.secondary_type = t.id WHERE p.name ="Rufflet"; //Ans- Rufflet Flying //What are the names of the pokemon that belong to the trainer with trainerID 303? SELECT pokemons.name, pokemon_trainer.trainerID FROM pokemons JOIN pokemon_trainer ON pokemons.id = pokemon_trainer.pokemon_id WHERE pokemon_trainer.trainerID = 303; //Ans - Wailord 303 // Vileplume 303 //How many pokemon have a secondary type Poison SELECT COUNT(p.secondary_type) FROM pokemons p JOIN types t ON p.secondary_type = t.id WHERE t.name= "Poison"; //Ans - 31 //What are all the primary types and how many pokemon have that type? SELECT t.name, COUNT(p.name) as primaryType_Count FROM types t JOIN pokemons p WHERE t.id = p.primary_type GROUP BY t.name; //How many pokemon at level 100 does each trainer with at least one level 100 pokemone have? (Hint: your query should not display a trainer SELECT COUNT(pokelevel) as pokelevel_Count,trainerID FROM pokemon_trainer WHERE pokelevel =100 GROUP BY trainerID; // How many pokemon only belong to one trainer and no other? SELECT COUNT(*) as Count, pokemon_id FROM pokemon_trainer GROUP BY pokemon_id HAVING COUNT(*) =1;
true
e2aff66214f41db01f43f3fd45157556d0c0c32c
SQL
vhalbert/modeshape
/sequencers/modeshape-sequencer-ddl/src/test/resources/ddl/dialect/oracle/oracle_test_statements_2.ddl
UTF-8
5,769
3.5
4
[ "Apache-2.0" ]
permissive
-- -- SAMPLE ORACLE STATEMENTS -- ALTER TABLE employees PCTFREE 30 PCTUSED 60; ALTER TABLE countries ADD (duty_pct NUMBER(2,2) CHECK (duty_pct < 10.5), visa_needed VARCHAR2(3)); ALTER TABLESPACE tbs_01 BEGIN BACKUP; ALTER TABLESPACE omf_ts1 ADD DATAFILE; ALTER TABLESPACE undots1 RETENTION NOGUARANTEE; ALTER TRIGGER update_job_history DISABLE; ALTER TYPE data_typ ADD MEMBER FUNCTION qtr(der_qtr DATE) RETURN CHAR CASCADE; ALTER TYPE cust_address_typ ADD ATTRIBUTE (phone phone_list_typ) CASCADE; ALTER TYPE phone_list_typ MODIFY ELEMENT TYPE VARCHAR(64) CASCADE; ALTER USER app_user1 GRANT CONNECT THROUGH sh WITH ROLE warehouse_user; -- 10 Statements ALTER USER app_user1 IDENTIFIED GLOBALLY AS 'CN=tom,O=oracle,C=US'; ALTER USER sidney IDENTIFIED BY second_2nd_pwd DEFAULT TABLESPACE example; ALTER VIEW customer_ro COMPILE; ANALYZE TABLE customers VALIDATE STRUCTURE ONLINE; ANALYZE TABLE employees VALIDATE STRUCTURE CASCADE; ANALYZE TABLE orders DELETE STATISTICS; ASSOCIATE STATISTICS WITH PACKAGES emp_mgmt DEFAULT SELECTIVITY 10; AUDIT SELECT ON hr.employees WHENEVER SUCCESSFUL; AUDIT INSERT, UPDATE ON oe.customers; AUDIT DELETE ANY TABLE; -- 20 Statements AUDIT ROLE WHENEVER SUCCESSFUL; COMMENT ON COLUMN employees.job_id IS 'abbreviated job title'; COMMIT WORK; COMMIT COMMENT 'In-doubt transaction Code 36, Call (415) 555-2637'; CREATE CLUSTER personnel (department NUMBER(4)) SIZE 512 STORAGE (initial 100K next 50K); CREATE CLUSTER address (postal_code NUMBER, country_id CHAR(2)) HASHKEYS 20 HASH IS MOD(postal_code + country_id, 101); CREATE CLUSTER cust_orders (customer_id NUMBER(6)) SIZE 512 SINGLE TABLE HASHKEYS 100; CREATE CONTEXT hr_context USING emp_mgmt; CREATE CONTROLFILE REUSE DATABASE "demo" NORESETLOGS NOARCHIVELOG MAXLOGFILES 32 MAXLOGMEMBERS 2 MAXDATAFILES 32 MAXINSTANCES 1 MAXLOGHISTORY 449 LOGFILE GROUP 1 '/path/oracle/dbs/t_log1.f' SIZE 500K, GROUP 2 '/path/oracle/dbs/t_log2.f' SIZE 500K # STANDBY LOGFILE DATAFILE '/path/oracle/dbs/t_db1.f', '/path/oracle/dbs/dbu19i.dbf', '/path/oracle/dbs/tbs_11.f', '/path/oracle/dbs/smundo.dbf', '/path/oracle/dbs/demo.dbf' CHARACTER SET WE8DEC ; CREATE DATABASE sample CONTROLFILE REUSE LOGFILE GROUP 1 ('diskx:log1.log', 'disky:log1.log') SIZE 50K, GROUP 2 ('diskx:log2.log', 'disky:log2.log') SIZE 50K MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10 MAXINSTANCES 2 ARCHIVELOG CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE 'disk1:df1.dbf' AUTOEXTEND ON, 'disk2:df2.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE temp_ts UNDO TABLESPACE undo_ts SET TIME_ZONE = '+02:00'; -- 30 Statements CREATE PUBLIC DATABASE LINK remote USING 'remote'; CREATE DATABASE LINK local CONNECT TO hr IDENTIFIED BY hr USING 'local'; CREATE DIMENSION customers_dim LEVEL customer IS (customers.cust_id) LEVEL city IS (customers.cust_city) LEVEL state IS (customers.cust_state_province) LEVEL country IS (countries.country_id) LEVEL subregion IS (countries.country_subregion) LEVEL region IS (countries.country_region) HIERARCHY geog_rollup ( customer CHILD OF city CHILD OF state CHILD OF country CHILD OF subregion CHILD OF region JOIN KEY (customers.country_id) REFERENCES country ) ATTRIBUTE customer DETERMINES (cust_first_name, cust_last_name, cust_gender, cust_marital_status, cust_year_of_birth, cust_income_level, cust_credit_limit) ATTRIBUTE country DETERMINES (countries.country_name) ; CREATE DIRECTORY admin AS 'oracle/admin'; CREATE OR REPLACE DIRECTORY bfile_dir AS '/private1/LOB/files'; CREATE DISKGROUP dgroup_01 EXTERNAL REDUNDANCY DISK '$ORACLE_HOME/disks/c*'; CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl; CREATE OR REPLACE FUNCTION text_length(a CLOB) RETURN NUMBER DETERMINISTIC IS BEGIN RETURN DBMS_LOB.GETLENGTH(a); END; / CREATE INDEXTYPE position_indextype FOR position_between(NUMBER, NUMBER, NUMBER) USING position_im; CREATE JAVA SOURCE NAMED "Hello" AS public class Hello { public static String hello() { return \"Hello World\"; } }; -- 40 Statements CREATE JAVA RESOURCE NAMED "appText" USING BFILE (bfile_dir, 'textBundle.dat'); CREATE LIBRARY ext_lib AS '/OR/lib/ext_lib.so'; / CREATE OR REPLACE LIBRARY ext_lib IS '/OR/newlib/ext_lib.so'; / CREATE LIBRARY app_lib as '${ORACLE_HOME}/lib/app_lib.so' AGENT 'sales.hq.acme.com'; / CREATE MATERIALIZED VIEW LOG ON employees WITH PRIMARY KEY INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW all_customers PCTFREE 5 PCTUSED 60 TABLESPACE example STORAGE (INITIAL 50K NEXT 50K) USING INDEX STORAGE (INITIAL 25K NEXT 25K) REFRESH START WITH ROUND(SYSDATE + 1) + 11/24 NEXT NEXT_DAY(TRUNC(SYSDATE), 'MONDAY') + 15/24 AS SELECT * FROM sh.customers@remote UNION SELECT * FROM sh.customers@local; CREATE MATERIALIZED VIEW LOG ON product_information WITH ROWID, SEQUENCE (list_price, min_price, category_id) INCLUDING NEW VALUES; CREATE OPERATOR eq_op BINDING (VARCHAR2, VARCHAR2) RETURN NUMBER USING eq_f; CREATE OUTLINE salaries FOR CATEGORY special ON SELECT last_name, salary FROM employees; CREATE OR REPLACE OUTLINE public_salaries FROM PRIVATE my_salaries; -- 50 Statements so far
true
2bfd3f1064130d5ace04f4a2f9da634c153c79cb
SQL
shahed95/Academic
/5th semester/MediCare/FILES/medicare.sql
UTF-8
19,272
3.359375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 08, 2018 at 04:42 PM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `medicare` -- DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `updateCost` (IN `oid` INT) MODIFIES SQL DATA DETERMINISTIC BEGIN DECLARE VAL INT; DECLARE CNT INT; DECLARE DNAME VARCHAR(30); SET VAL = 0; SET CNT = 0; SELECT amount INTO CNT FROM orderdetails WHERE order_id=oid; SELECT product_name INTO DNAME FROM orderdetails WHERE order_id=oid; SELECT price INTO VAL FROM drug_info WHERE product_name=DNAME; SET VAL = VAL*CNT; UPDATE orderdetails SET tot_cost=VAL WHERE order_id=oid; END$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `update_amount` (IN `sid` INT, IN `pname` VARCHAR(40), IN `AMNT` INT) NO SQL BEGIN DECLARE VAL INT; DECLARE IDD INT; SET VAL = 0; SET IDD = 0; SELECT amount INTO VAL FROM instore WHERE store_id=sid and product_name = pname; SELECT id INTO IDD FROM instore WHERE store_id=sid and product_name = pname; IF IDD =0 THEN INSERT INTO instore(store_id,product_name,amount) VALUES (sid,pname,0); END IF; SET VAL=VAL+AMNT; UPDATE instore SET amount=VAL WHERE store_id=sid and product_name = pname; END$$ -- -- Functions -- CREATE DEFINER=`root`@`localhost` FUNCTION `CalcPrice_with_Vat` (`pName` VARCHAR(50), `amount` INT) RETURNS INT(11) MODIFIES SQL DATA BEGIN DECLARE TOT INT; SET TOT=5; SELECT price INTO TOT FROM drag_info WHERE product_name = pName; SET TOT = TOT*amount; RETURN TOT; END$$ CREATE DEFINER=`root`@`localhost` FUNCTION `Func` (`numb` INT(10), `pName` VARCHAR(50)) RETURNS INT(10) NO SQL Begin DECLARE TOT INT; SET TOT = 10; SELECT price INTO TOT FROM drag_info WHERE product_name = pName; SET TOT = TOT*numb; RETURN TOT; END$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `drug_info` -- CREATE TABLE `drug_info` ( `product_name` varchar(40) NOT NULL, `generic_name` varchar(40) NOT NULL, `company` varchar(40) NOT NULL, `product_details` text NOT NULL, `Price` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `drug_info` -- INSERT INTO `drug_info` (`product_name`, `generic_name`, `company`, `product_details`, `Price`) VALUES ('Ace', 'Paracetamol', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nFever, headache, toothache, earache, bodyache, myalgia, dysmenorrhoea, neuralgia and sprains. Colic pain, back pain, chronic pain of cancer, inflammatory pain, and post-vaccination pain and fever of children. Rheumatism and osteoarthritic pain & stiffness of joints in fingers, hips, knees, wrists, elbows, feet, ankles and top & bottom of the spine.', 12), ('Ambrox', 'Ambroxol', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nProductive cough, Acute and chronic inflammatory disorders of upper and lower respiratory tracts associated with viscid mucus including acute and chronic bronchitis, laryngitis, Pharyngitis, sinusitis and rhinitis associated with viscid mucus, Asthmatic bronchitis, bronchial asthma with thick expectoration, Bronchiectasis, Chronic pneumonia', 0), ('brolox', 'lobro', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nProductive cough, Acute and chronic inflammatory disorders of upper and lower respiratory tracts associated with viscid mucus including acute and chronic bronchitis, laryngitis, Pharyngitis, sinusitis and rhinitis associated with viscid mucus, Asthmatic bronchitis, bronchial asthma with thick expectoration, Bronchiectasis, Chronic pneumonia', 0), ('Ceevit', 'Vitamin-C', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nScurvy, pregnancy, lactation, infection, trauma, burns, cold exposure, following surgery, fever, stress, peptic ulcer, cancer, methaemoglobinaemia haematuria, dental caries, pyorrhea, acne, infertility, atherosclerosis, fractures, leg ulcers, hay fever, vascular thrombosis prevention, levodopa toxicity, succinyl-choline toxicity,arsenic toxicity etc.\r\n\r\nDosage & Administration:\r\n1-2 tablets daily.', 20), ('Fexo', 'Fexofenadine HCl', 'Square Pharmaceuticals Ltd.', '\r\n\r\nIndication:\r\nSeasonal allergic rhinitis & Chronic idiopathic urticaria\r\n\r\nPreparation:\r\nFexoTM 60 : Each box contains 5 x 10 tablets in blister pack.\r\nFexoTM 120 : Each box contains 5 x 10 tablets in blister pack.\r\nFexoTM 180 : Each box contains 3 x 10 tablets in blister pack.\r\nFexoTM Susupension: Each bottle contains 50 ml suspension and calibrated dropper & measuring cup.\r\nRevision\r\n', 33), ('Napa', 'Paracetamol', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nProductive cough, Acute and chronic inflammatory disorders of upper and lower respiratory tracts associated with viscid mucus including acute and chronic bronchitis, laryngitis, Pharyngitis, sinusitis and rhinitis associated with viscid mucus, Asthmatic bronchitis, bronchial asthma with thick expectoration, Bronchiectasis, Chronic pneumonia', 0), ('ticothopy', 'tetrahexamin', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nProductive cough, Acute and chronic inflammatory disorders of upper and lower respiratory tracts associated with viscid mucus including acute and chronic bronchitis, laryngitis, Pharyngitis, sinusitis and rhinitis associated with viscid mucus, Asthmatic bronchitis, bronchial asthma with thick expectoration, Bronchiectasis, Chronic pneumonia', 0), ('tripoli', 'itripoli', 'Square Pharmaceuticals Ltd.', 'Indication:\r\nProductive cough, Acute and chronic inflammatory disorders of upper and lower respiratory tracts associated with viscid mucus including acute and chronic bronchitis, laryngitis, Pharyngitis, sinusitis and rhinitis associated with viscid mucus, Asthmatic bronchitis, bronchial asthma with thick expectoration, Bronchiectasis, Chronic pneumonia', 0), ('Zimax', 'Azithromycin', 'Square Ltd.', '\r\n\r\nIndication:\r\nBronchitis and pneumonia, sinusitis and pharyngitis/ tonsillitis, in otitis media, and in skin and soft tissue infections, sexually transmitted diseases.\r\n\r\nDosage & Administration:\r\nAdults: 500 mg once daily for 3 days. Children: 10 mg/kg body weight once daily for 3 days.\r\n', 45); -- -------------------------------------------------------- -- -- Table structure for table `hospital` -- CREATE TABLE `hospital` ( `hospital_id` int(11) NOT NULL, `hospital_name` varchar(255) NOT NULL, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `mobile` bigint(20) NOT NULL, `datetime` datetime NOT NULL, `status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='store the details of hospital data'; -- -------------------------------------------------------- -- -- Table structure for table `instore` -- CREATE TABLE `instore` ( `id` int(11) NOT NULL, `store_id` int(11) DEFAULT NULL, `product_name` varchar(40) DEFAULT NULL, `amount` decimal(11,0) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `instore` -- INSERT INTO `instore` (`id`, `store_id`, `product_name`, `amount`) VALUES (1, 3, 'Zimax', '9'), (7, 7, 'Ace', '1'), (8, 3, 'Ceevit', '4'), (9, 7, 'Ceevit', '2'), (10, 7, 'Fexo', '8'), (11, 10, 'Ace', '100'), (12, 10, 'Zimax', '19'), (13, 13, 'Ace', '12'), (14, 13, 'Ambrox', '20'), (15, 13, 'brolox', '33'), (16, 13, 'Ceevit', '5'), (17, 13, 'Fexo', '6'), (18, 13, 'ticothopy', '50'), (19, 13, 'tripoli', '10'), (20, 13, 'Zimax', '50'), (21, 14, 'Ace', '89'), (22, 14, 'Ambrox', '35'), (23, 14, 'Ceevit', '120'), (24, 14, 'Fexo', '196'), (25, 14, 'Zimax', '540'), (26, 7, 'brolox', '0'), (27, 7, 'Napa', '75'), (28, 7, 'ticothopy', '54'), (29, 7, 'Zimax', '44'), (30, 14, 'brolox', '100'), (31, 14, 'Napa', '100'), (32, 14, 'ticothopy', '100'), (33, 14, 'tripoli', '200'), (34, 15, 'Zimax', '20'); -- -- Triggers `instore` -- DELIMITER $$ CREATE TRIGGER `afterupdate` AFTER UPDATE ON `instore` FOR EACH ROW BEGIN INSERT INTO recent_update(store_id,product_name,prev_amount,new_amount,modify_date) VALUES (old.store_id,old.product_name,old.amount,new.amount,NOW()); END $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `orderdetails` -- CREATE TABLE `orderdetails` ( `order_id` int(11) NOT NULL, `product_name` varchar(40) NOT NULL, `store_id` int(11) NOT NULL, `amount` int(11) NOT NULL, `customer_name` varchar(40) NOT NULL, `customer_mobile` text NOT NULL, `customer_address` text NOT NULL, `order_date` date NOT NULL, `tot_cost` int(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orderdetails` -- INSERT INTO `orderdetails` (`order_id`, `product_name`, `store_id`, `amount`, `customer_name`, `customer_mobile`, `customer_address`, `order_date`, `tot_cost`) VALUES (1, 'Ace', 7, 2, 'shahed', '1234', '5566', '0000-00-00', 24), (2, 'Ace', 7, 1, 'shahed', '1234', '1445', '0000-00-00', 12), (25, 'Ace', 7, 3, 'shahed', '01922922', 'IUT', '0000-00-00', 36), (26, 'Ace', 7, 4, 'shahed', '018991212331', 'IUT', '0000-00-00', 48), (28, 'Ace', 7, 10, 'Rakib', '01681454784', 'IUT', '0000-00-00', 120), (29, 'Zimax', 13, 4, 'shahed', '01681454784', 'gtrrff ffg', '0000-00-00', 180), (30, 'Ace', 14, 5, 'Imam', '01812231231', 'IUT', '0000-00-00', 60), (31, 'Ceevit', 14, 5, 'Shahed Ahmed', '018991212331', 'IUT gate', '0000-00-00', 100), (32, 'Ace', 7, 55, 'Shahed Ahmed', '01922922', 'IUT', '0000-00-00', 660), (33, 'Ace', 14, 45, 'uchhas', '56789', 'IUT', '0000-00-00', 540), (34, 'Ace', 14, 5, 'Kazi Atikur Islam', '01817665433', 'IUT', '0000-00-00', 60), (35, 'Napa', 7, 20, 'shahed ahmed', '01681454784', 'IUT', '0000-00-00', 0), (36, 'Zimax', 14, 50, 'Shahed Ahmed', '01922922', 'IUT', '0000-00-00', 2250), (37, 'Zimax', 13, 10, 'Shahed Ahmed', '01681454784', 'IUT', '0000-00-00', 450), (38, 'Zimax', 7, 20, 'shaon', '12343212', 'iut', '0000-00-00', 900), (39, 'Zimax', 14, 500, 'tanvir', '01681454784', 'IUT N-528', '0000-00-00', 22500), (40, 'Zimax', 15, 15, 'gaab', '11223345', 'IUT N-528', '0000-00-00', 675), (41, 'Ace', 13, 10, 'shahed', '01681454784', 'IUT', '0000-00-00', 120), (42, 'Zimax', 13, 1, 'shahed', '018991212331', 'IUT', '0000-00-00', 45), (43, 'Ace', 13, 4, 'shahed', '018991212331', 'shahed@gmail.com', '0000-00-00', 48), (44, 'Ace', 7, 2, 'shahed', '018991212331', 'IUT', '0000-00-00', 24), (45, 'Ace', 13, 2, 'shahed', '018991212331', 'IUT gate', '0000-00-00', 24), (46, 'Ace', 14, 10, 'shahed', '018991212331', 'IUT gate', '0000-00-00', 120); -- -------------------------------------------------------- -- -- Table structure for table `recent_info` -- CREATE TABLE `recent_info` ( `recent_id` int(11) NOT NULL, `store_id` int(11) NOT NULL, `product_name` int(11) NOT NULL, `prev_amount` int(11) NOT NULL, `new_amount` int(11) NOT NULL, `Date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `recent_update` -- CREATE TABLE `recent_update` ( `id` int(11) NOT NULL, `store_id` int(11) NOT NULL, `product_name` varchar(50) NOT NULL, `prev_amount` int(11) NOT NULL, `new_amount` int(11) NOT NULL, `modify_date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `recent_update` -- INSERT INTO `recent_update` (`id`, `store_id`, `product_name`, `prev_amount`, `new_amount`, `modify_date`) VALUES (1, 10, 'Zimax', 196, 19, '2018-05-15'), (2, 7, 'Ace', 3, 125, '2018-05-15'), (3, 7, 'Ace', 125, 122, '2018-05-15'), (4, 13, 'Ace', 0, 10, '2018-05-15'), (5, 13, 'Ambrox', 0, 20, '2018-05-15'), (6, 13, 'brolox', 0, 33, '2018-05-15'), (7, 13, 'Ceevit', 0, 5, '2018-05-15'), (8, 13, 'Fexo', 0, 6, '2018-05-15'), (9, 13, 'ticothopy', 0, 50, '2018-05-15'), (10, 13, 'tripoli', 0, 10, '2018-05-15'), (11, 13, 'Zimax', 0, 50, '2018-05-15'), (12, 13, 'Ace', 10, 8, '2018-05-15'), (13, 14, 'Ace', 0, 120, '2018-05-15'), (14, 14, 'Ambrox', 0, 35, '2018-05-15'), (15, 14, 'Ceevit', 0, 120, '2018-05-15'), (16, 14, 'Fexo', 0, 200, '2018-05-15'), (17, 14, 'Zimax', 0, 200, '2018-05-15'), (18, 14, 'Fexo', 200, 196, '2018-05-15'), (19, 7, 'brolox', 0, 7, '2018-05-15'), (20, 7, 'Napa', 0, 50, '2018-05-15'), (21, 7, 'ticothopy', 0, 54, '2018-05-15'), (22, 7, 'Zimax', 0, 44, '2018-05-15'), (23, 14, 'brolox', 0, 100, '2018-05-15'), (24, 14, 'Napa', 0, 100, '2018-05-15'), (25, 14, 'ticothopy', 0, 100, '2018-05-15'), (26, 14, 'tripoli', 0, 200, '2018-05-15'), (27, 14, 'Zimax', 200, 540, '2018-05-15'), (28, 13, 'Ace', 8, 108, '2018-05-15'), (29, 14, 'Ace', 120, 127, '2018-05-15'), (30, 14, 'Ace', 127, 107, '2018-05-15'), (31, 7, 'Napa', 50, 60, '2018-05-15'), (32, 7, 'Ace', 122, 117, '2018-05-15'), (33, 7, 'Ace', 117, 234, '2018-05-15'), (34, 7, 'Ace', 234, 0, '2018-05-15'), (35, 7, 'Napa', 60, 65, '2018-05-15'), (36, 7, 'Ace', 0, 5, '2018-05-15'), (37, 7, 'brolox', 7, 1007, '2018-05-15'), (38, 7, 'brolox', 1007, 2014, '2018-05-15'), (39, 7, 'brolox', 2014, 0, '2018-05-15'), (40, 15, 'Zimax', 0, 20, '2018-05-15'), (41, 7, 'Napa', 65, 75, '2018-05-18'), (42, 13, 'Ace', 108, 216, '2018-07-15'), (43, 13, 'Ace', 216, 16, '2018-07-15'), (44, 13, 'Ace', 16, 12, '2018-10-08'), (45, 7, 'Ace', 5, 1, '2018-10-08'), (46, 14, 'Ace', 107, 99, '2018-10-08'), (47, 14, 'Ace', 99, 89, '2018-10-08'); -- -------------------------------------------------------- -- -- Table structure for table `request` -- CREATE TABLE `request` ( `request_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `hospital_id` int(11) NOT NULL, `blood_id` int(11) NOT NULL, `volume` int(11) NOT NULL COMMENT 'in ml', `datetime` datetime NOT NULL, `status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='request detail by user to the hospital'; -- -------------------------------------------------------- -- -- Table structure for table `stock` -- CREATE TABLE `stock` ( `stock_id` int(11) NOT NULL, `hospital_id` int(11) NOT NULL, `blood_id` int(11) NOT NULL, `volume` int(11) NOT NULL, `status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='blood stock available in the hospital'; -- -------------------------------------------------------- -- -- Table structure for table `store_info` -- CREATE TABLE `store_info` ( `store_id` int(11) NOT NULL, `store_name` varchar(40) NOT NULL, `owner_name` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(40) NOT NULL, `contact_no` varchar(20) NOT NULL, `street_address` varchar(40) NOT NULL, `area` varchar(40) NOT NULL, `division` varchar(40) NOT NULL, `store_detail` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `store_info` -- INSERT INTO `store_info` (`store_id`, `store_name`, `owner_name`, `password`, `email`, `contact_no`, `street_address`, `area`, `division`, `store_detail`) VALUES (3, 'bb store', 'alvy', '12345', 'alvy@gmail.com', '01733555333', 'gazipur college', 'College Gate', 'Gazipur', ''), (7, 'a1 store', 'shahed ahmed', 'shahed', 'shahed95@gmail.com', '01733651434', 'IUT', 'Boardbazar', 'Gazipur', ' a medicine shop near iut'), (8, 'abc draghouse', 'abc', 'abc', 'abc@gmail.com', '1234', '11/2 street road', 'College Gate', 'Gazipur', ' A store near gazipur college gate. 24 hour home delivery service. '), (10, 'Ali Pharmacy', 'Ali Masud', '12345', 'aliphar@outlook.com', '019876255621', '135/A,Elephant Road', 'Dhanmondi', 'Dhaka', ' 24 hour open'), (11, 'Abdul Pharma', 'Abdulah Al Kashif', '1234', 'abdul@gmail.com', '019986662627', '127/A,Gulshan Avenue', 'Gulshan', 'Dhaka', ' Reliable and Safe'), (13, 'Fair Price', 'fairul', 'fair', 'fair@gmail.com', '0173737373', 'IUT gate', 'Boardbazar', 'Gazipur', ' *24 hour delivery service'), (14, 'Care Pharmacy', 'Abdul Kamal', 'care', 'care@gmail.com', '01715996987', '112/A,Boro Shorok', 'Boardbazar', 'Gazipur', ' Shoshomoi Er Shongi'), (15, 'Tanvir Store', 'tanvir', '12345', 'tanvir@gmail.com', '111222', 'kunjogon', 'rampura', 'dhaka', ' '); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `user_id` int(11) NOT NULL, `blood_id` int(11) NOT NULL, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `mobile` bigint(20) NOT NULL, `datetime` datetime NOT NULL, `status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='all data of reciever'; -- -- Indexes for dumped tables -- -- -- Indexes for table `drug_info` -- ALTER TABLE `drug_info` ADD PRIMARY KEY (`product_name`); -- -- Indexes for table `hospital` -- ALTER TABLE `hospital` ADD PRIMARY KEY (`hospital_id`); -- -- Indexes for table `instore` -- ALTER TABLE `instore` ADD PRIMARY KEY (`id`), ADD KEY `store_id` (`store_id`), ADD KEY `product_name` (`product_name`); -- -- Indexes for table `orderdetails` -- ALTER TABLE `orderdetails` ADD PRIMARY KEY (`order_id`); -- -- Indexes for table `recent_update` -- ALTER TABLE `recent_update` ADD PRIMARY KEY (`id`); -- -- Indexes for table `request` -- ALTER TABLE `request` ADD PRIMARY KEY (`request_id`); -- -- Indexes for table `stock` -- ALTER TABLE `stock` ADD PRIMARY KEY (`stock_id`); -- -- Indexes for table `store_info` -- ALTER TABLE `store_info` ADD PRIMARY KEY (`store_id`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`user_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `hospital` -- ALTER TABLE `hospital` MODIFY `hospital_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `instore` -- ALTER TABLE `instore` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `orderdetails` -- ALTER TABLE `orderdetails` MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47; -- -- AUTO_INCREMENT for table `recent_update` -- ALTER TABLE `recent_update` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48; -- -- AUTO_INCREMENT for table `request` -- ALTER TABLE `request` MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `stock` -- ALTER TABLE `stock` MODIFY `stock_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `store_info` -- ALTER TABLE `store_info` MODIFY `store_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `instore` -- ALTER TABLE `instore` ADD CONSTRAINT `instore_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `store_info` (`store_id`), ADD CONSTRAINT `instore_ibfk_2` FOREIGN KEY (`product_name`) REFERENCES `drug_info` (`product_name`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
b3afc8db9d69a9c5be7a0d6b34a5cc61687c1388
SQL
inanimatestructure--/VideoSite
/VideoWebsite/SQL Code/populateUsersTable.sql
UTF-8
270
2.5625
3
[]
no_license
/* * Populate the users table with values. * Note that the INSERT must be list-directed since the primary key * is automatically populated by the DBMS. */ INSERT INTO users (userName, handle) VALUES ('pwebb', 'patc1313'), ('jhollis', 'jman320'), ('2ds1', '23fdsa');
true
fb8ca937f35434d7cb2354a408d177c989f370c9
SQL
hbwang518/llp
/sqlProgram/山地物种MDE_forWang.sql
UTF-8
1,758
3.140625
3
[]
no_license
---Altay select * into m_plantAltay from m_plant where id in ( select distinct(plant_Id) from plantcountyAltitudeValidResult a, m_grid where a.id=m_grid.id and m_grid.lastRegion=1 ) select * from m_plantAltay update m_plantAltay set lowAltitude = b.lowAltitude , highAltitude = b.highaltitude from m_plantAltay, nurbayaltitude b where m_plantAltay.id=b.plant_id and m_plantAltay.lowAltitude < -10000 select m_plantAltay.* from m_plantAltay, nurbayaltitude b where m_plantAltay.id=b.plant_id and m_plantAltay.lowAltitude < -10000 select * from m_plantAltay ---Tianshan select * into m_plantTianshan from m_plant where id in ( select distinct(plant_Id) from plantcountyAltitudeValidResult a, m_grid where a.id=m_grid.id and m_grid.lastRegion=3 ) select * from m_plantTianshan update m_plantTianshan set lowAltitude = b.lowAltitude , highAltitude = b.highaltitude from m_plantTianshan, nurbayaltitude b where m_plantTianshan.id=b.plant_id and m_plantTianshan.lowAltitude < -10000 select m_plantTianshan.* from m_plantTianshan, nurbayaltitude b where m_plantTianshan.id=b.plant_id and m_plantTianshan.lowAltitude < -10000 select * from m_plantTianshan ---Kunlunshan select * into m_plantKunlun from m_plant where id in ( select distinct(plant_Id) from plantcountyAltitudeValidResult a, m_grid where a.id=m_grid.id and m_grid.lastRegion=4 ) select * from m_plantKunlun update m_plantKunlun set lowAltitude = b.lowAltitude , highAltitude = b.highaltitude from m_plantKunlun, nurbayaltitude b where m_plantKunlun.id=b.plant_id and m_plantKunlun.lowAltitude < -10000 select m_plantKunlun.* from m_plantKunlun, nurbayaltitude b where m_plantKunlun.id=b.plant_id and m_plantKunlun.lowAltitude < -10000 select * from m_plantKunlun
true
056e86949d668af99fb22f9f4c94b1e65a4ce6f0
SQL
AndyRadulescu/pizza_backend
/pizza.sql
UTF-8
1,024
3.71875
4
[]
no_license
create table if not exists table_name ( uuid varchar(500) not null constraint table_name_pk primary key, name varchar(250) not null, description varchar(500), price double precision not null, user_uuid varchar(500), toppings varchar(1000) ); alter table table_name owner to postgres; create unique index if not exists table_name_uuid_uindex on table_name (uuid); create table if not exists souce ( id serial not null constraint souce_pk primary key, name varchar(255) not null, quantity integer not null, pizza_uuid varchar(500) ); alter table souce owner to postgres; create unique index if not exists souce_id_uindex on souce (id); create table if not exists "user" ( uuid integer not null constraint user_pk primary key, name varchar(255) not null, email varchar(500) not null, phone varchar(500) not null, password varchar(500) not null, token varchar(1000) not null ); alter table "user" owner to postgres; create unique index if not exists user_uuid_uindex on "user" (uuid);
true
44255c454fd1107cc1b5568be78c9ea8b13b0d96
SQL
quochuy201/MSBA_Projects
/CapstonProject/SQLscript/ViewMasterData.sql
UTF-8
893
2.8125
3
[]
no_license
CREATE VIEW MasterData as select ta.ParcelNumber, ta.CurrentUseCodeCurrentYear, ta.UseCode, ta.TaxableValueCurrentYear, ta.TaxYearCurrent, ta.TaxCodeAreaCurrentYear, ta.LandValueCurrentYear, ta.ImprovementValueCurrentYear, ta.TotalMarketValueCurrentYear, ta.TaxableValuePriorYear, ta.TaxYearPrior, ta.TaxCodeAreaPrior, ta.LandValuePriorYear, ta.ImprovementValuePriorYear, ta.TotalMarketValuePriorYear, aa.AppraisalAccountType, aa.LandGrossAcres, aa.LandNetAcres, aa.LandGrossSquareFeet, aa.LandNetSquareFeet, aa.LandDepth, aa.LandWidth, aa.AppraisalDate, aa.UtilityElectric, aa.UtilitySewer, aa.UtilityWater, aa.StreetType, aa.Latitude, aa.Longtitude from TaxAccount ta inner join AppraisalAccount aa on ta.ParcelNumber =aa.ParcelNumber
true
021dc6b0b30c9095c2d7bfe24569c1374714ffd7
SQL
albertbahia/wdi_june_2014
/w03/d02/james_liu/Homework03-02/db/pokemon_jointable_schema.sql
UTF-8
164
2.546875
3
[]
no_license
DROP TABLE IF EXISTS pokemons_trainers; CREATE TABLE pokemons_trainers ( pokemon_id INTEGER REFERENCES pokemons(id), trainer_id INTEGER REFERENCES trainers(id) );
true
2dec61b15cd1f0bce5546adef4854ceee1c51441
SQL
aarora3/student-registration-system
/PL SQL/PL SQL/package.sql
UTF-8
18,303
3.65625
4
[]
no_license
-- PACKAGE FOR STORED PROCEDURES create or replace package Proj2_student_reg_package is type data_cursor is ref cursor; -- DECLARATION OF ALL STORED PROCEDURES procedure show_students(student_ref_cursor OUT data_cursor ); procedure show_courses(courses_ref_cursor OUT data_cursor); procedure show_prerequisites(prerequisites_ref_cursor OUT data_cursor); procedure show_classes(classes_ref_cursor OUT data_cursor); procedure show_enrollments(enrollments_ref_cursor OUT data_cursor); procedure show_logs(logs_ref_cursor OUT data_cursor); procedure add_students(sidIn IN students.sid%type, fnameIn IN students.firstname%type, lnameIn IN students.lastname%type, statusIn IN students.status%type, gpaIn IN students.gpa%type, emailIn IN students.email%type, ret_message OUT varchar); procedure show_students_classes(sidIN IN students.sid%type,ret_message OUT varchar2 ,students_classes_cursor OUT data_cursor); procedure show_prereq(dept_codeIn in prerequisites.dept_code%type,course_noIn in prerequisites.course_no%type,results out varchar); procedure show_classes_student_details(classidIn IN classes.classid%type,ret_message OUT varchar2,classes_details_cursor OUT data_cursor ,student_details_cursor OUT data_cursor); procedure enroll_student_in_class(classidIn in classes.classid%type,sidIn in students.sid%type,results out varchar); procedure drop_student_from_class(classidIn in classes.classid%type,sidIn in students.sid%type,results out varchar); procedure delete_student(sidIn in students.sid%type,results out varchar); end Proj2_student_reg_package; / -- STORED PROCEDURES IMPLEMENTATION create or replace package body Proj2_student_reg_package as ----------------------------------- -- *** Q2 *** ----------------------------------- -- SHOW STUDENTS stored procedure procedure show_students(student_ref_cursor OUT data_cursor ) is begin open student_ref_cursor for select * from students; end show_students; -- SHOW COURSES stored procedure procedure show_courses(courses_ref_cursor OUT data_cursor) is begin open courses_ref_cursor for select * from courses; end show_courses; -- SHOW PREREQUISITES stored procedure procedure show_prerequisites(prerequisites_ref_cursor OUT data_cursor) is begin open prerequisites_ref_cursor for select * from prerequisites; end show_prerequisites; -- SHOW CLASSES stored procedure procedure show_classes(classes_ref_cursor OUT data_cursor) is begin open classes_ref_cursor for select * from classes; end show_classes; -- SHOW ENROLLMENTS stored procedure procedure show_enrollments(enrollments_ref_cursor OUT data_cursor) is begin open enrollments_ref_cursor for select * from enrollments; end show_enrollments; -- SHOW LOGS stored procedure procedure show_logs(logs_ref_cursor OUT data_cursor) is begin open logs_ref_cursor for select * from logs; end show_logs; ----------------------------------- -- *** Q3 *** ----------------------------------- -- add a student stored procedure procedure add_students(sidIn IN students.sid%type, fnameIn IN students.firstname%type, lnameIn IN students.lastname%type, statusIn IN students.status%type, gpaIn IN students.gpa%type, emailIn IN students.email%type, ret_message OUT varchar) is begin insert into students values(sidIn ,fnameIn,lnameIn,statusIn,gpaIn,emailIn); COMMIT; ret_message := 'success'; EXCEPTION WHEN OTHERS THEN ret_message := 'error'; end add_students; procedure show_students_classes(sidIn IN students.sid%type,ret_message OUT varchar2 ,students_classes_cursor OUT data_cursor) is sidCheck number(2); sidEnrolledCheck number(2); begin select count(sid) into sidCheck from students where sid = sidIn; select count(sid) into sidEnrolledCheck from enrollments where sid = sidIn; if sidCheck = 0 then -- check if student exists ret_message := 'The sid is invalid'; elsif sidEnrolledCheck = 0 then -- check if sudent has taken any course ret_message := 'The student has not taken any course'; else open students_classes_cursor for select s.sid,s.lastname,s.status,c.classid,c.dept_code||c.course_no as course,co.title,c.year,c.semester from students s,courses co,classes c,enrollments e where e.sid = s.sid and c.dept_code || c.course_no = co.dept_code || co.course_no and e.classid = c.classid and s.sid = sidIn; ret_message := 'success'; end if; end show_students_classes; ----------------------------------- -- *** Q5 *** ----------------------------------- -- show prerequisites stored procedure PROCEDURE show_prereq(dept_codeIn in prerequisites.dept_code%type,course_noIn in prerequisites.course_no%type,results out varchar) as dep_code varchar2(4); cr_no number(3); temp_res varchar(9000); cursor prereq_cursor is (select pre_dept_code, pre_course_no from prerequisites where dept_code = dept_codeIn and course_no = course_noIn); prereq_rec prereq_cursor%rowtype; cursor course_cursor is (select * from courses where dept_code = dept_codeIn and course_no = course_noIn); course_rec course_cursor%rowtype; BEGIN open course_cursor; fetch course_cursor into course_rec; if (course_cursor%notfound) then -- check if course exists results := 'Entered course not found.'; else open prereq_cursor; fetch prereq_cursor into prereq_rec; while prereq_cursor%found loop dep_code := prereq_rec.pre_dept_code; cr_no := prereq_rec.pre_course_no; if (prereq_rec.pre_dept_code IS NOT NULL) then IF (results IS not NULL) THEN results := results || chr(10) || dep_code || cr_no; end if; IF (results IS NULL) THEN results := dep_code || cr_no; end if; show_prereq(dep_code, cr_no, temp_res); -- recursive call to stored procedure IF (temp_res IS not NULL) THEN results := results || chr(10) || temp_res; end if; else return; end if; fetch prereq_cursor into prereq_rec; end loop; end if; END; ----------------------------------- -- *** Q6 *** ----------------------------------- -- show class details and enrolled students procedure show_classes_student_details(classidIn IN classes.classid%type,ret_message OUT varchar2,classes_details_cursor OUT data_cursor,student_details_cursor OUT data_cursor) is classid_check number(2); class_students_check number(2); begin select count(classid) into classid_check from classes where classid = classidIn; select count(sid) into class_students_check from enrollments where classid = classidIn; if classid_check = 0 then -- check if course exists ret_message := 'The classid is invalid'; elsif class_students_check = 0 then -- check if student enrolled in class ret_message := 'No student is enrolled in the class'; else open classes_details_cursor for select c.classid,co.title,c.semester,c.year from classes c,courses co where c.dept_code || c.course_no = co.dept_code || co.course_no and c.classid = classidIn; open student_details_cursor for select s.sid,s.lastname from students s,enrollments e where e.classid = classidIn and s.sid = e.sid; ret_message := 'success'; end if; end show_classes_student_details; ----------------------------------- -- *** Q7 *** ----------------------------------- -- enroll student in a class procedure procedure enroll_student_in_class(classidIn in classes.classid%type,sidIn in students.sid%type, results out varchar) is cursor stu_cursor is select * from students where sid = sidIn; stu_rec stu_cursor%rowtype; cursor classes_cursor is select * from classes where classid = classidIn; classes_rec classes_cursor%rowtype; cursor getEnrolledStu_cursor is select sid, firstname from students where sid in (select sid from enrollments where classid = classidIn); getEnrolledStu_rec getEnrolledStu_cursor%rowtype; cursor getTitle_cursor is select title from courses t1, classes t2 where t1.dept_code = t2.dept_code and t1.course_no = t2.course_no and classid = classidIn; getTitle_rec getTitle_cursor%rowtype; cursor Course_cursor is select (dept_code || course_no) as course from classes where classid = classidIn; Course_rec Course_cursor%rowtype; cursor coursesTaken_cursor is select (dept_code || course_no) as course from classes where classid in (select classid from enrollments where sid = sidIn and classid in (select classid from classes where (semester, year) in (select semester, year from classes where classid = classidIn))); coursesTaken_rec coursesTaken_cursor%rowtype; cursor enrollCount_cursor is select count(*) as count from enrollments where sid = sidIn and classid in (select classid from classes where (semester, year) in (select semester, year from classes where classid = classidIn)); enrollCount_rec enrollCount_cursor%rowtype; cursor prereq_cursor is (select (pre_dept_code || pre_course_no) as course from prerequisites where (dept_code, course_no) in (select dept_code, course_no from classes where classid = classidIn)); prereq_rec prereq_cursor%rowtype; cursor completecourses_cursor is select (dept_code || course_no) as course from classes where classid in (select classid from enrollments where sid = sidIn and lgrade in ('A','B','C','D')); completecourses_rec completecourses_cursor%rowtype; prereq_flag boolean; begin prereq_flag := false; --flag to check if any prereq courses not completed open stu_cursor; fetch stu_cursor into stu_rec; if (stu_cursor%notfound) then results := 'This sid is invalid'; else open classes_cursor; fetch classes_cursor into classes_rec; if (classes_cursor%notfound) then results := 'This classid is invalid'; else if(classes_rec.class_size >= classes_rec.limit) then results := 'Class is closed'; else open Course_cursor; fetch Course_cursor into Course_rec; open coursesTaken_cursor; fetch coursesTaken_cursor into coursesTaken_rec; --check if the student has already enrolled into the course with given classid in its same year and semester while coursesTaken_cursor%found loop if (Course_rec.course = coursesTaken_rec.course) then results := 'The student is already in the class.'; return; end if; fetch coursesTaken_cursor into coursesTaken_rec; end loop; open enrollCount_cursor; fetch enrollCount_cursor into enrollCount_rec; if (enrollCount_cursor%found) then if (enrollCount_rec.count = 4) then results := 'Students cannot be enrolled in more than four classes in the same semester'; return; end if; open prereq_cursor; fetch prereq_cursor into prereq_rec; open completecourses_cursor; while prereq_cursor%found loop fetch completecourses_cursor into completecourses_rec; while completecourses_cursor%found loop if (completecourses_rec.course = prereq_rec.course) then prereq_flag := true; end if; fetch completecourses_cursor into completecourses_rec; end loop; if(not prereq_flag) then results := 'Prerequisite courses have not been completed'; return; end if; prereq_flag := false; fetch prereq_cursor into prereq_rec; end loop; if(enrollCount_rec.count < 3) then INSERT INTO enrollments VALUES (sidIn, classidIn, null); results := 'Student enrollment successful. '; end if; if(enrollCount_rec.count = 3) then results := results || 'You are overloaded.'; INSERT INTO enrollments VALUES (sidIn, classidIn, null); end if; end if; end if; end if; end if; end;​ ----------------------------------- -- *** Q8 *** ----------------------------------- -- drop student from a class stored procedure procedure drop_student_from_class(classidIn in classes.classid%type, sidIn in students.sid%type, results out varchar) is cursor stu_cursor is select * from students where sid = sidIn; stu_rec stu_cursor%rowtype; cursor classes_cursor is select * from classes where classid = classidIn; classes_rec classes_cursor%rowtype; cursor enrollments_cursor is select * from enrollments where sid = sidIn and classid = classidIn; enrollments_rec enrollments_cursor%rowtype; cursor enrollCount_cursor is select count(*) as count from enrollments where sid = sidIn; enrollCount_rec enrollCount_cursor%rowtype; cursor classSize_cursor is select class_size from classes where classid = classidIn; classSize_rec classSize_cursor%rowtype; cursor dependentCourses_cursor is (select (dept_code || course_no) as course from prerequisites where (pre_dept_code || pre_course_no) in (select (dept_code || course_no) from classes where classid = classidIn)); dependentCourses_rec dependentCourses_cursor%rowtype; cursor coursesTaken_cursor is select (dept_code || course_no) as course from classes where classid in (select classid from enrollments where sid = sidIn); coursesTaken_rec coursesTaken_cursor%rowtype; begin open stu_cursor; fetch stu_cursor into stu_rec; if (stu_cursor%notfound) then results := 'The sid is invalid.'; else open classes_cursor; fetch classes_cursor into classes_rec; if (classes_cursor%notfound) then results := 'This classid is invalid.'; else open enrollments_cursor; fetch enrollments_cursor into enrollments_rec; if (enrollments_cursor%notfound) then results := 'The student is not enrolled in the class.'; else open dependentCourses_cursor; fetch dependentCourses_cursor into dependentCourses_rec; while dependentCourses_cursor%found loop open coursesTaken_cursor; fetch coursesTaken_cursor into coursesTaken_rec; while coursesTaken_cursor%found loop if (coursesTaken_rec.course = dependentCourses_rec.course) then results := 'The drop is not permitted because another class uses it as a prerequisite.'; return; end if; fetch coursesTaken_cursor into coursesTaken_rec; end loop; fetch dependentCourses_cursor into dependentCourses_rec; end loop; delete from enrollments where sid = sidIn and classid = classidIn; results := 'Course dropped successfully. '; open enrollCount_cursor; fetch enrollCount_cursor into enrollCount_rec; if (enrollCount_cursor%found) then if(enrollCount_rec.count = 0) then results := results || 'The student is not enrolled in any classes. '; end if; end if; open classSize_cursor; fetch classSize_cursor into classSize_rec; if (classSize_cursor%found) then if(classSize_rec.class_size = 0) then results := results || 'The class now has no students.'; end if; end if; end if; end if; end if; end; ----------------------------------- -- *** Q9 *** ----------------------------------- -- delete a student stored procedure procedure delete_student(sidIn in students.sid%type,results out varchar) is cursor stu_cursor is select * from students where sid = sidIn; stu_rec stu_cursor%rowtype; begin open stu_cursor; fetch stu_cursor into stu_rec; if (stu_cursor%notfound) then results := 'Student not found.'; else delete from students where sid = sidIn; results := 'Student deleted.'; end if; end; end Proj2_student_reg_package;
true
914f92d60bc2faf0deeedd06264aa9a84590f780
SQL
marizole/segparcial
/bd_blog.sql
UTF-8
3,766
3.046875
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : PARCIALDOS Source Server Type : MySQL Source Server Version : 100138 Source Host : localhost:3306 Source Schema : bd_blog Target Server Type : MySQL Target Server Version : 100138 File Encoding : 65001 Date: 06/11/2020 04:40:00 */ CREATE DATABASE bd_blog; USE bd_blog; SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for permisos -- ---------------------------- DROP TABLE IF EXISTS `permisos`; CREATE TABLE `permisos` ( `id` int NOT NULL AUTO_INCREMENT, `id_usuario` int NULL DEFAULT NULL, `id_rol` int NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, INDEX `id_usuario`(`id_usuario`) USING BTREE, INDEX `id_rol`(`id_rol`) USING BTREE, CONSTRAINT `permisos_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `permisos_ibfk_2` FOREIGN KEY (`id_rol`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of permisos -- ---------------------------- -- ---------------------------- -- Table structure for roles -- ---------------------------- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `id` int NOT NULL AUTO_INCREMENT, `descripcion` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of roles -- ---------------------------- INSERT INTO `roles` VALUES (1, 'Secretaria'); INSERT INTO `roles` VALUES (2, 'Gerente'); INSERT INTO `roles` VALUES (3, 'Portero'); -- ---------------------------- -- Table structure for usuarios -- ---------------------------- DROP TABLE IF EXISTS `usuarios`; CREATE TABLE `usuarios` ( `id` int NOT NULL AUTO_INCREMENT, `usuario` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `correo` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `clave` varbinary(255) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Records of usuarios -- ---------------------------- INSERT INTO `usuarios` VALUES (1, 'admin', 'adonaijerusalain@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (2, 'zole', 'zole@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (3, 'marizol', 'marizol@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (4, 'Raul', 'Raul@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (5, 'Marcos', 'marco@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (6, 'Pedro', 'pedro@hotmail.com', 0x6466646332306362616234383263386431353966343264333235306431663763); INSERT INTO `usuarios` VALUES (7, 'zole', 'zole@hotmail.com', 0x6531306164633339343962613539616262653536653035376632306638383365); INSERT INTO `usuarios` VALUES (8, 'Jose', 'jose@gmail.com', 0x6466646332306362616234383263386431353966343264333235306431663763); INSERT INTO `usuarios` VALUES (9, 'Pablo', 'pablo@gmail.com', 0x6466646332306362616234383263386431353966343264333235306431663763); INSERT INTO `usuarios` VALUES (10, 'Lucy', 'lucy@gmail.com', 0x6466646332306362616234383263386431353966343264333235306431663763); SET FOREIGN_KEY_CHECKS = 1;
true
dc502798e85882ad35f7bcda406d8ee11e253a1e
SQL
thiagorodi/exercicios_sala
/cadastro.sql
UTF-8
1,345
3.203125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.4.2 -- http://www.phpmyadmin.net -- -- Máquina: localhost -- Data de Criação: 09-Ago-2019 às 00:54 -- Versão do servidor: 5.6.13 -- versão do PHP: 5.4.17 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de Dados: `cadastro` -- CREATE DATABASE IF NOT EXISTS `cadastro` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `cadastro`; -- -------------------------------------------------------- -- -- Estrutura da tabela `dados` -- CREATE TABLE IF NOT EXISTS `dados` ( `nome` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `cpf` int(11) NOT NULL, `sexo` varchar(50) NOT NULL, `data_nascimento` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `dados` -- INSERT INTO `dados` (`nome`, `email`, `cpf`, `sexo`, `data_nascimento`) VALUES ('Thiago', 'thiago@gmail.com', 1234546, 'M', '2019-08-10'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d581d1c0dad6336630394e42d0dbe3ed775b279b
SQL
gsteinhoff/LEAF-copy
/LEAF_Request_Portal/utils/db_upgrade/Update_RMC_DB_4429-4482.sql
UTF-8
664
2.828125
3
[ "LicenseRef-scancode-public-domain" ]
permissive
START TRANSACTION; INSERT INTO `dependencies` (`dependencyID`, `description`) VALUES ('-2', 'Requestor Followup'); CREATE TABLE IF NOT EXISTS `data_extended` ( `recordID` smallint unsigned NOT NULL, `indicatorID` smallint NOT NULL, `data` text NOT NULL, `timestamp` int unsigned NOT NULL, `userID` varchar(50) NOT NULL ) ENGINE='InnoDB'; ALTER TABLE `data_extended` ADD INDEX `recordID_indicatorID` (`recordID`, `indicatorID`); DROP TABLE `service_data`; DROP TABLE `service_data_history`; DROP TABLE `pair_category_serviceiid`; DROP TABLE `service_indicatorid`; UPDATE `settings` SET `data` = '4482' WHERE `settings`.`setting` = 'dbversion'; COMMIT;
true
8d55c0e451808755817be938bf1cabf874db9e29
SQL
aidnurs/competitive-programming
/leetcode/database/181.employees-earning-more-than-their-managers.sql
UTF-8
151
3.0625
3
[]
no_license
# Write your MySQL query statement below select a.Name as Employee from Employee as a, Employee as b where a.ManagerId=b.Id and a.Salary > b.Salary ;
true
0a1f20f49796769f120cacdafd53c2e884ce1fce
SQL
wade0564/repo
/notes/sql/recovery miss asup_queue.sql
UTF-8
1,494
3.140625
3
[]
no_license
---recover PARSE_SUCCESS asup_queue message INSERT INTO asup.asup_queue(file_name,file_source,file_type,sn,model_str,ddos_ver,parse_status) SELECT substring(filename,12), CASE WHEN EXTERNAL = 1 THEN 'customer' ELSE 'internal' END AS file_source, 'autosupport', sn, model_str, ddos_ver, 'PARSE_SUCCESS' FROM asup.geninfo LEFT JOIN asup.asup ON asup.geninfo.asupid=asup.asup.asupid WHERE TYPE = 'Autosupport' AND filename ~ '2014/05/\\d{2}/\\d{4}-\\d{2}-\\d{2}_.*' AND asup.asup.asupid NOT IN (SELECT asupid FROM asup.asup_queue WHERE file_name LIKE '%2014-05-%' AND asupid IS NOT NULL); ---recover PARSE_FAILED asup_queue message INSERT INTO asup.asup_queue(file_name,file_source,file_type,sn,model_str,ddos_ver,parse_status) SELECT substring(filename,12), CASE WHEN EXTERNAL = 1 THEN 'customer' ELSE 'internal' END AS file_source, 'autosupport', sn, model_str, ddos_ver, 'PARSE_FAILED' FROM asup.asup LEFT JOIN asup.geninfo ON asup.geninfo.asupid=asup.asup.asupid WHERE TYPE = 'Autosupport' AND filename ~ '2014/05/\\d{2}/\\d{4}-\\d{2}-\\d{2}_.*' AND asup.geninfo.asupid IS NULL AND asup.asup.asupid NOT IN (SELECT asupid FROM asup.asup_queue WHERE file_name LIKE '%2014-05-%' AND asupid IS NOT NULL);
true
8f6973ade38f586f7539d287af3c36a5d2fafcb2
SQL
SZFelixHuang/pms-database
/script/mysql/jetspeed/create/security_domain.sql
UTF-8
511
3.125
3
[]
no_license
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- TABLE STRUCTURE FOR SECURITY_DOMAIN -- ---------------------------- CREATE TABLE IF NOT EXISTS `SECURITY_DOMAIN` ( `DOMAIN_ID` DECIMAL(65,30) NOT NULL, `DOMAIN_NAME` VARCHAR(254) DEFAULT NULL, `REMOTE` DECIMAL(3,0) DEFAULT NULL, `ENABLED` DECIMAL(3,0) DEFAULT NULL, `OWNER_DOMAIN_ID` DECIMAL(65,30) DEFAULT NULL, PRIMARY KEY (`DOMAIN_ID`), UNIQUE KEY `UIX_DOMAIN_NAME` (`DOMAIN_NAME`) USING BTREE ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
true
9fdf955b70695900beb748c243130910e4c5cb18
SQL
mleczey/todo
/src/main/resources/db/migration/V00001__create_todo.sql.sql
UTF-8
1,346
3.859375
4
[]
no_license
USE todo; CREATE TABLE TASK ( ID INT AUTO_INCREMENT, VERSION INT NOT NULL, UUID BINARY(16) NOT NULL, CREATED_AT TIMESTAMP NOT NULL, MODIFIED_AT TIMESTAMP NOT NULL, TITLE VARCHAR(256) NOT NULL, DESCRIPTION VARCHAR(1024) DEFAULT NULL, FINISHED_AT TIMESTAMP DEFAULT NULL, ARCHIVED_AT TIMESTAMP DEFAULT NULL, CONSTRAINT PK_TASK PRIMARY KEY(ID), CONSTRAINT UQ_TASK_UUID UNIQUE(UUID) ) ENGINE=INNODB AUTO_INCREMENT=100 CHARACTER SET utf32 COLLATE utf32_general_ci; CREATE TABLE TAG ( ID INT AUTO_INCREMENT, VERSION INT NOT NULL, UUID BINARY(16) NOT NULL, CREATED_AT TIMESTAMP NOT NULL, `NAME` VARCHAR(256) NOT NULL, DESCRIPTION VARCHAR(1024) DEFAULT NULL, CONSTRAINT PK_TAG PRIMARY KEY(ID), CONSTRAINT UQ_TAG_UUID UNIQUE(UUID), CONSTRAINT UQ_TAG_NAME UNIQUE(`NAME`) ) ENGINE=INNODB AUTO_INCREMENT=100 CHARACTER SET utf32 COLLATE utf32_general_ci; CREATE TABLE TASK_TAG ( TASK_ID INT NOT NULL, TAG_ID INT NOT NULL -- CONSTRAINT FK_TASK_TAG_TASK FOREIGN KEY (TASK_ID) REFERENCES TASK(ID), -- CONSTRAINT FK_TASK_TAG_TAG FOREIGN KEY (TAG_ID) REFERENCES TAG(ID) ) ENGINE=INNODB CHARACTER SET utf32 COLLATE utf32_general_ci;
true
11c179f187bc4550b1fa8d238d5ee83e268a9c30
SQL
tusharwr/SRDT
/NEW/DAY 3.sql
UTF-8
6,792
3.328125
3
[]
no_license
SELECT * FROM (SELECT DISTINCT A.CAMPUS_ID, B.NAME_DISPLAY, C.ACAD_PROG "COURSE", SUBSTR(D.ACAD_PROG,4,2) "BRANCH", E.NAME "FATHER/MOTHER" , ( SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND LINE_AMT>'0' AND LINE_ACTION != 'REF') AS "TOTAL FEE PAYABLE", ( SELECT SUM(G.ITEM_AMT) FROM PS_ITEM_SF_VW G WHERE G.EMPLID=A.EMPLID AND G.ACCOUNT_TERM LIKE '%' AND G.ITEM_AMT>0 AND G.ACCOUNT_NBR='TUITION001') AS "COURSE FEE APPLIED", ( SELECT SUM(applied_amt) FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ACCOUNT_NBR='TUITION001') AS "COURSE FEES PAID", (SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_NBR='HOSTEL001' AND ACCOUNT_TERM LIKE '%' AND LINE_ACTION != 'REF' AND LINE_AMT>0) AS "HOSTEL FEE PAID", NVL((SELECT ITEM_AMT FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ITEM_AMT>0 AND ACCOUNT_NBR='BUS001'),0) AS "BUS FEE PAID", (SELECT (SELECT SUM(applied_amt) FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ACCOUNT_NBR='TUITION001') + NVL((SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID= AND ACCOUNT_NBR='HOSTEL001' AND ACCOUNT_TERM LIKE '%' AND LINE_ACTION != 'REF' AND LINE_AMT>0),0) + NVL((SELECT ITEM_AMT FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ITEM_AMT>0 AND ACCOUNT_NBR='BUS001'),0) FROM DUAL) AS "TOTAL FEE PAID", ( SELECT (SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND LINE_AMT>'0' AND LINE_ACTION != 'REF') - ( (SELECT SUM(applied_amt) FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ACCOUNT_NBR='TUITION001') + NVL((SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_NBR='HOSTEL001' AND ACCOUNT_TERM LIKE '%' AND LINE_ACTION != 'REF' AND LINE_AMT>0),0) + NVL((SELECT ITEM_AMT FROM PS_ITEM_SF_VW WHERE EMPLID=A.EMPLID AND ACCOUNT_TERM LIKE '%' AND ITEM_AMT>0 AND ACCOUNT_NBR='BUS001'),0) ) FROM DUAL)AS "TOTAL BALANCE", (SELECT CASE WHEN (SELECT SUM(G.ITEM_AMT) "TOTAL FEE PAYABLE" FROM PS_ITEM_SF_VW G WHERE EMPLID='00000000001' AND G.ACCOUNT_TERM LIKE '%' AND G.ITEM_AMT>0) - (SELECT SUM(J.ACCOUNT_BALANCE) FROM PS_ACCOUNT_VW J WHERE J.EMPLID=A.EMPLID AND J.ACCOUNT_TERM LIKE '%')<=0 THEN 'FULL'ELSE 'NOT FULL' END AS PAYMENT FROM DUAL) AS PAYMENT, F.ABSENCE_DATE "DUE DATE" FROM PS_stdnt_srch A, PS_HCR_PERSON_NM_I B, PS_ACAD_PROG C, PS_ACAD_PROG D, PS_RELATIONSHIPS E, PS_SRMU_SNTFER_TBL F, PS_ITEM_SF_VW G, -- PS_ITEM_SF_VW H, PS_CSH_OFF_RCPT_VW I --PS_ACCOUNT_VW J WHERE A.EMPLID=B.EMPLID AND A.EMPLID =C.EMPLID AND A.EMPLID =D.EMPLID AND A.EMPLID =E.EMPLID AND A.EMPLID =F.EMPLID AND A.EMPLID =G.EMPLID -- AND A.EMPLID =H.EMPLID AND A.EMPLID =I.EMPLID --AND A.EMPLID='' ) WHERE ROWNUM<=800 ORDER BY ROWNUM; --BALANCE SELECT (SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID='00000000001' AND ACCOUNT_TERM LIKE '13%' AND LINE_AMT>'0' AND LINE_ACTION != 'REF') - ( (SELECT SUM(applied_amt) FROM PS_ITEM_SF_VW WHERE EMPLID='00000000001' AND ACCOUNT_TERM LIKE '13%' AND ACCOUNT_NBR='TUITION001') + NVL((SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID='00000000001' AND ACCOUNT_NBR='HOSTEL001' AND ACCOUNT_TERM LIKE '13%' AND LINE_ACTION != 'REF' AND LINE_AMT>0),0) + NVL((SELECT ITEM_AMT FROM PS_ITEM_SF_VW WHERE EMPLID='00000000001' AND ACCOUNT_TERM LIKE '13%' AND ITEM_AMT>0 AND ACCOUNT_NBR='BUS001'),0) ) AS BALANCE FROM DUAL; --SELECT * FROM PS_ITEM_SF_VW; --SELECT * FROM PS_CSH_OFF_RCPT_VW; --SELECT SUM(A.ITEM_AMT) FROM PS_ITEM_SF_VW A,PS_CSH_OFF_RCPT_VW B WHERE A.EMPLID='00000000157'AND a.item_amt>'0' GROUP BY A.EMPLID; --SELECT SUM(B.total_amount_sf) FROM PS_ITEM_SF_VW A,PS_CSH_OFF_RCPT_VW B WHERE A.EMPLID='00000000157'AND a.item_amt>'0' GROUP BY A.EMPLID; SELECT CASE WHEN ( (SELECT SUM(H.ITEM_AMT) FROM PS_ITEM_SF_VW H, PS_CSH_OFF_RCPT_VW I WHERE H.EMPLID='00000000157' AND H.item_amt>'0' GROUP BY H.EMPLID ) - (SELECT SUM(I.total_amount_sf) FROM PS_ITEM_SF_VW H, PS_CSH_OFF_RCPT_VW I WHERE H.EMPLID='00000000157' AND H.item_amt>'0' GROUP BY H.EMPLID )<='0') THEN 'FULL' END AS PAYMENT FROM DUAL; SELECT TOTAL_AMOUNT FROM PS_ANTC_AID_TOT; --WHERE ((A.ITEM_AMT-B.TOTAL_AMOUNT_SF)<=0) --SELECT * FROM PS_ACAD_PLAN; --SELECT * FROM PS_SCC_PERS_PHN_H ; --SELECT * FROM PS_RELATIONSHIPS; SELECT CASE WHEN (SELECT SUM(H.ITEM_AMT) FROM PS_ITEM_SF_VW H, PS_CSH_OFF_RCPT_VW I WHERE H.EMPLID='00000000001' AND H.item_amt>'0' GROUP BY H.EMPLID) - (SELECT SUM(I.total_amount_sf) FROM PS_ITEM_SF_VW H, PS_CSH_OFF_RCPT_VW I WHERE H.EMPLID='00000000001' AND H.item_amt>'0' GROUP BY H.EMPLID)<=0 THEN '0' ELSE 'ABCD' END AS BALANCE FROM DUAL; --BALANCE SELECT SUM(ACCOUNT_BALANCE) FROM PS_ACCOUNT_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%'; SELECT * FROM PS_ACCOUNT_VW WHERE EMPLID=00000000174 AND ACCOUNT_TERM LIKE '12%'; --cOURSE FEE -- SELECT SUM(ITEM_AMT) FROM PS_ITEM_SF_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%' AND ITEM_AMT>0 AND ACCOUNT_NBR='TUITION001'; --TOTAL FEES(HOSTEL+TUTION) SELECT SUM(LINE_AMT) FROM PS_ITEM_LINE_VW WHERE EMPLID=0000000001 AND ACCOUNT_TERM LIKE '13%' AND LINE_AMT>'0' AND LINE_ACTION != 'REF'; SELECT * FROM PS_ITEM_LINE_VW WHERE EMPLID=0000000001 AND ACCOUNT_TERM LIKE '13%' AND LINE_AMT>'0'; SELECT LINE_AMT, descr FROM PS_ITEM_LINE_VW WHERE EMPLID=0000000001 AND ACCOUNT_TERM LIKE '13%'; -- SELECT EMPLID,SUM(ITEM_AMT) "TOTAL FEE PAYABLE" FROM PS_ITEM_SF_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%' AND ITEM_AMT>0 GROUP BY EMPLID; SELECT ITEM_AMT FROM PS_ITEM_SF_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%' AND ITEM_AMT>0 AND ACCOUNT_NBR='BUS001' ; --COURSE FEES PAID SELECT SUM(applied_amt) FROM PS_ITEM_SF_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%' AND ACCOUNT_NBR='TUITION001'; SELECT * FROM PS_ITEM_SF_VW WHERE EMPLID=00000000001 AND ACCOUNT_TERM LIKE '13%';
true
16f507e6769740820bdd70b6835525809fd51e56
SQL
PrasanthReddy-Chittapu6683/Python_DataScience_MachineLearning
/PrepCourse/BasicsOfSql/mypractivefiles/query1.sql
UTF-8
650
3.234375
3
[]
no_license
select * from companydb.employee; select fname as "First Name", lname as "Last Name" from companydb.employee; select * from companydb.employee where Sex='M' and salary>=30000; select * from companydb.employee where Sex='F' or salary>=30000; select * from companydb.dependent where essn=333445555; select essn, hours from companydb.works_on where hours between 25 and 30; select dname,year(mgr_start_date) from companydb.department; select * from companydb.employee where fname like 'j%'; select essn, hours from companydb.works_on where hours between 25 and 35; select * from companydb.dept_locations where dlocation in ('Houston','Stafford');
true
22a27738f6994be0b561c28c5c3bb4f7d7b1cc5b
SQL
NHSRC/facilities-assessment-server
/src/main/resources/db/migration/V22__AddFacilityAssessmentSeriesName.sql
UTF-8
143
2.53125
3
[]
no_license
ALTER TABLE facility_assessment ADD COLUMN series_name VARCHAR(50) NULL; ALTER TABLE facility_assessment ADD UNIQUE (series_name, facility_id);
true
d66870635076955f7fa2a98a7bc3580bf798c1c7
SQL
roshankshaw/Online-Hotel-Reservation-System
/sql/hotel (1).sql
UTF-8
5,154
3.25
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Apr 30, 2019 at 07:08 PM -- Server version: 5.7.19 -- PHP Version: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `hotel` -- -- -------------------------------------------------------- -- -- Table structure for table `hotel` -- DROP TABLE IF EXISTS `hotel`; CREATE TABLE IF NOT EXISTS `hotel` ( `hotel_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(10) NOT NULL, `hotel_name` varchar(255) DEFAULT NULL, `location` text, `description` text, `meals` int(1) DEFAULT NULL, `s_pool` int(1) DEFAULT NULL, PRIMARY KEY (`hotel_id`), KEY `fk_user_id` (`user_id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dumping data for table `hotel` -- INSERT INTO `hotel` (`hotel_id`, `user_id`, `hotel_name`, `location`, `description`, `meals`, `s_pool`) VALUES (1, 11, 'Radhika Regency', 'Rourkela', 'Super Deluxe Hotel', 1, 1), (2, 12, 'Central Park', 'Rourkela', 'good one', 1, 1), (3, 15, 'MV residency', 'Rourkela', 'fkjfjfjfjhj', 1, 1), (4, 16, 'Wander Lust', 'Pune', 'Free hotel', 0, 1); -- -------------------------------------------------------- -- -- Table structure for table `rooms` -- DROP TABLE IF EXISTS `rooms`; CREATE TABLE IF NOT EXISTS `rooms` ( `hotel_id` int(10) UNSIGNED NOT NULL, `room_type` int(1) UNSIGNED NOT NULL, `luxury` int(1) UNSIGNED NOT NULL, `extra_beds` int(1) UNSIGNED DEFAULT NULL, `availability` int(10) UNSIGNED DEFAULT NULL, `base_cost` int(10) UNSIGNED DEFAULT NULL, PRIMARY KEY (`hotel_id`,`room_type`,`luxury`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `rooms` -- INSERT INTO `rooms` (`hotel_id`, `room_type`, `luxury`, `extra_beds`, `availability`, `base_cost`) VALUES (2, 0, 0, 1, 9, 1234), (3, 1, 0, 1, 0, 700), (3, 0, 0, 0, 0, 15); -- -------------------------------------------------------- -- -- Table structure for table `tbooking` -- DROP TABLE IF EXISTS `tbooking`; CREATE TABLE IF NOT EXISTS `tbooking` ( `booking_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` int(10) UNSIGNED DEFAULT NULL, `hotel_id` int(10) UNSIGNED DEFAULT NULL, `booking_name` varchar(100) NOT NULL, `room_type` int(1) UNSIGNED DEFAULT NULL, `luxury` int(1) UNSIGNED DEFAULT NULL, `booking_date` date NOT NULL, `check_in_date` date NOT NULL DEFAULT '2019-04-29', `day_no` int(10) UNSIGNED DEFAULT NULL, `no_of_rooms` int(11) NOT NULL, `cost` int(10) UNSIGNED DEFAULT NULL, PRIMARY KEY (`booking_id`), KEY `fk_user_id` (`user_id`), KEY `fk_hotel_id` (`hotel_id`), KEY `fk_room_type` (`room_type`), KEY `fk_luxury` (`luxury`) ) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbooking` -- INSERT INTO `tbooking` (`booking_id`, `user_id`, `hotel_id`, `booking_name`, `room_type`, `luxury`, `booking_date`, `check_in_date`, `day_no`, `no_of_rooms`, `cost`) VALUES (30, 13, 2, 'Roshan Shaw', 0, 0, '2019-04-30', '2008-05-13', 2, 3, 7404); -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `DOB` date DEFAULT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) DEFAULT NULL, `aadhar_no` varchar(20) DEFAULT NULL, `role` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`), UNIQUE KEY `email` (`email`) ) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `DOB`, `email`, `password`, `aadhar_no`, `role`) VALUES (12, 'Roshan', 'Kumar Shaw', '1998-08-13', 'roshankushaw1@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '987654321', 1), (11, 'Jimmy', 'Anderson', '1998-08-13', '117cs0268@nitrkl.ac.in', 'e10adc3949ba59abbe56e057f20f883e', '11223346', 1), (9, 'Jimmy', 'Anderson', '1998-08-13', '117cs0266@nitrkl.ac.in', 'e10adc3949ba59abbe56e057f20f883e', '11223344', 1), (10, 'Jimmy', 'Anderson', '1998-08-13', '117cs0267@nitrkl.ac.in', 'e10adc3949ba59abbe56e057f20f883e', '11223345', 1), (13, 'Roshan', 'Shaw', '1998-08-13', 'roshankushaw2@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '12233445566', 0), (14, 'Sandeep', 'Shiraskar', '1998-05-10', 'sandepshiraskar@gmail.com', 'cbbe2af7db7f398dfdaec3eaa687e8ca', '14701223', 0), (15, 'Sandeep', 'Shiraskar', '1998-05-10', 'sandeepsh98@gmail.com', 'cbbe2af7db7f398dfdaec3eaa687e8ca', '192846981', 1), (16, 'Sandeep', 'Shiraskar', '1998-05-10', 'sandeepshiraskar@gmail.com', '45ad013466040d704a86b174664ce807', '904710371837', 1); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
eff6ddf352c9e1d950a4dd1b12514830817c5109
SQL
WhitneyOnTheWeb/SQL_Playground
/Marvel/Data/Scripts/MarvelQuery.sql
UTF-8
2,990
3.796875
4
[]
no_license
USE MarvelCharApps --X-Men comics SELECT AppID , c.CharName , n.ComicName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE n.ComicName LIKE '%xm%' --X-Men Comics ORDER BY ComicName; --Spiderman Comics SELECT AppID , c.CharName , n.ComicName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE n.ComicName LIKE '%sm%' --Spiderman Comics ORDER BY ComicName; --Appearances of the Invisible Woman SELECT AppID , c.CharName , n.ComicName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE c.CharName LIKE 'INVISIBLE WOMAN' --Appearances of the Invisible Woman ORDER BY ComicName; --Appearances of the Scarlet Witch SELECT AppID , c.CharName , n.ComicName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE c.CharName LIKE 'SCARLET WITCH' --Appearances of the Scarlet Witch ORDER BY ComicName; -------------------------------------------------------------------- -------------------------------------------------------------------- -- Experimental Practice for Updating Names to Full Length -- -- Updates to full column name are not yet complete -- -- Consider column for pubdate in the future -- -------------------------------------------------------------------- -------------------------------------------------------------------- USE MarvelCharApps BEGIN TRANSACTION --Script used to do manual DB updates of comic long names UPDATE ComicNames SET ComicName = REPLACE(ComicName, 'COC', 'MARVEL SUPER HERO CONTEST OF CHAMPIONS') WHERE ComicName LIKE 'COC %' --Script used to do manual DB updates of character names UPDATE MarvelCharacters SET CharName = 'VOLSTAGG [ASGARDIAN]' WHERE CharName = 'VOLSTAGG' --ROLLBACK TRANSACTION --COMMIT TRANSACTION begin transaction UPDATE ComicNames SET ComicName = REPLACE(ComicName, 'COC', 'MARVEL SUPER HERO CONTEST OF CHAMPIONS') WHERE ComicName LIKE 'COC %' begin transaction -- there is only one transaction - this only increments the @@trancount counter delete from MarvelCharacters WHERE CharName = 'VOLSTAGG [ASGARDIAN]' select @@Trancount --2 rollback select @@Trancount --0 --before SELECT c.CharName , n.ComicName , n.ComicShortName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE n.ComicName LIKE 'warlock%' ORDER BY ComicName; --after SELECT c.CharName , n.ComicName , n.ComicShortName FROM CharComicApps AS a JOIN MarvelCharacters AS c ON a.CharID = c.CharID JOIN ComicNames AS n ON a.ComicID = n.ComicID WHERE n.ComicName LIKE '%Marvel%' ORDER BY ComicName; SELECT * FROM ComicNames Order by ComicID
true
95258ce7d86242c064331540f42b04292d1876b9
SQL
pointgamma173/sayn
/sayn/start_project/sayn_project_base/sql/tracks_per_album_ordered.sql
UTF-8
551
3.265625
3
[ "Apache-2.0", "MIT" ]
permissive
/* In this sql query, you can see the usage of parameters. This is based on Jinja templating. Parameters are passed from the profile used at run time (profiles are defined in the settings) After a query is compiled, they will appear in the compile folder */ SELECT tpa.* FROM {{schema_models}}.{{table_prefix}}tracks_per_album tpa --here we prepend the table name with {{table_prefix}} which enables to separate when testing. If ran from prod, there is no prefix. If a test user has prefix specified, then the prefix will be added. ORDER BY 2 DESC
true
f90a71dc67288a276563406c77b1b29da6dc22d4
SQL
krish9449/handykrew
/handykrew/hkdb/src/main/resource/seeds/9_technition_service_categories.sql
UTF-8
479
2.5625
3
[]
no_license
/* -- Query: SELECT * FROM handykrew.technician_service_categories LIMIT 0, 1000 -- Date: 2018-09-05 12:42 */ INSERT INTO technician_service_categories(technician_account_no,category_no) VALUES(4,1); INSERT INTO technician_service_categories(technician_account_no,category_no) VALUES(6,1); INSERT INTO technician_service_categories(technician_account_no,category_no) VALUES(4,2); INSERT INTO technician_service_categories(technician_account_no,category_no) VALUES(6,2);
true
c1d1c19b9e7f1de808a00a1eb9fae6192d2a2fda
SQL
jinlongsj/jinlong-system
/jinlong-system-dbsql/src/main/V0.1/table/001_create_dic_jinlong_system_file_type.sql
UTF-8
403
3.1875
3
[ "Apache-2.0" ]
permissive
-- 表1 :文件类型字典表 (dic_jinlong_system_file_type) DROP TABLE IF exists dic_jinlong_system_file_type; CREATE TABLE dic_jinlong_system_file_type ( value INT(11) AUTO_INCREMENT COMMENT '文件类别ID', name VARCHAR(20) NOT NULL COMMENT '父类文件类别ID', PRIMARY KEY (value) -- 设置主键:文件类别ID ) ENGINE= MYISAM CHARACTER SET utf8;
true
cd76c6d5a156d85a443914a309fb6fdf1634bdd9
SQL
radtek/Database-3
/oracle/admin/scripts/cursores.sql
UTF-8
1,900
4.375
4
[]
no_license
/*Para ver la cantidad de cursores abiertos de cada usuario*/ SELECT s.*, n.name FROM v$sesstat s, v$statname n WHERE s.statistic# = n.statistic# and name = 'opened cursors current' and sid = &sid ; /*Ver los cursores abiertos de todos los usuarios con el texto sql*/ SELECT /*+ RULE */ a.VALUE cantidad_cursores_cache, a.username usuario, a.SID, c.hash_value, c.sql_text FROM (SELECT a.VALUE, s.username, s.SID, s.serial# FROM v$sesstat a, v$statname b, v$session s WHERE a.statistic# = b.statistic# AND s.SID = a.SID AND b.NAME = 'opened cursors current' ORDER BY VALUE DESC) a JOIN (SELECT o.SID, o.sql_text, o.address, o.hash_value, s.schemaname esquema, s.sql_hash_value FROM v$open_cursor o, v$session s WHERE o.saddr = s.saddr AND o.SID = s.SID ORDER BY o.SID, s.schemaname, o.hash_value) b ON b.SID = a.SID JOIN (SELECT sql_text, hash_value FROM v$sqltext_with_newlines ORDER BY hash_value, piece) c ON c.hash_value = b.hash_value AND a.username IS NOT NULL /*Ver los cursores abiertos de todos los usuarios con la cab del texto sql*/ SELECT a.VALUE cantidad_cursores_cache, a.username usuario, a.SID, b.sql_text FROM (SELECT a.VALUE, s.username, s.SID, s.serial# FROM v$sesstat a, v$statname b, v$session s WHERE a.statistic# = b.statistic# AND s.SID = a.SID AND b.NAME = 'opened cursors current' ORDER BY VALUE DESC) a JOIN (SELECT o.SID, o.sql_text, o.address, o.hash_value, s.schemaname esquema, s.sql_hash_value FROM v$open_cursor o, v$session s WHERE o.saddr = s.saddr AND o.SID = s.SID) b ON a.SID = b.SID AND a.username IS NOT NULL
true
b3d1ee4a474c213d1435188edf931209a71d325b
SQL
MrD0079/portal
/sql/merch_report_4sv_by_spec_new4.sql
UTF-8
3,017
3.4375
3
[]
no_license
/* Formatted on 02.02.2014 22:40:11 (QP5 v5.227.12220.39724) */ SELECT SUM (msb.weight) msb_weight, SUM (msr.r_remain) msr_remain, SUM (msr.r_oos) msr_oos, SUM (msr.r_gos) msr_gos, SUM (msr.r_fcount) msr_fcount, SUM (msr.r_price) msr_price, COUNT (*) c, decode(count(*),0,0,SUM (msr.r_oos)/ COUNT (*) * 100) perc_oos FROM (SELECT r_id, r_spec_id, r_dt, r_remain, r_oos, r_gos, r_fcount, r_price, r_text FROM ms_rep_hbr, ( SELECT h_id, r_dt dt FROM ms_rep_hbr WHERE r_dt = TO_DATE (:ed, 'dd.mm.yyyy') GROUP BY h_id, r_dt) h1 WHERE ms_rep_hbr.b_head_id = h1.h_id AND ms_rep_hbr.r_dt = h1.dt) msr, MS_REP_HBR_DT msh, merch_spec_body msb, merch_report mr, ms_rep_routes1 /*, (SELECT DISTINCT data, dm FROM calendar) c*/ WHERE msh.kod_tp = ms_rep_routes1.rb_kodtp AND msh.ag_id = ms_rep_routes1.rb_ag_id AND msh.id_net = ms_rep_routes1.n_id_net AND msb.head_id = msh.id AND msr.r_spec_id = msb.id AND ms_rep_routes1.rb_id = mr.rb_id AND mr.dt = TO_DATE (:ed, 'dd.mm.yyyy') AND msh.data = TO_DATE (:ed, 'dd.mm.yyyy') /*AND mr.dt = c.data*/ AND mr.dt = ms_rep_routes1.rb_data AND DECODE (:svms_list, 0, 0, ms_rep_routes1.rh_tn) = DECODE (:svms_list, 0, 0, :svms_list) AND DECODE (:agent, 0, 0, ms_rep_routes1.rb_ag_id) = DECODE (:agent, 0, 0, :agent) AND DECODE (:nets, 0, 0, ms_rep_routes1.n_id_net) = DECODE (:nets, 0, 0, :nets) AND DECODE (:oblast, '0', '0', ms_rep_routes1.cpp1_tz_oblast) = DECODE (:oblast, '0', '0', :oblast) AND DECODE (:city, '0', '0', ms_rep_routes1.cpp1_city) = DECODE (:city, '0', '0', :city) AND DECODE (:select_route_numb, 0, 0, ms_rep_routes1.rh_id) = DECODE (:select_route_numb, 0, 0, :select_route_numb) AND DECODE (:select_route_fio_otv, 0, 0, ms_rep_routes1.rh_id) = DECODE (:select_route_fio_otv, 0, 0, :select_route_fio_otv) AND (ms_rep_routes1.rh_tn IN (SELECT slave FROM full WHERE master = :tn UNION SELECT chief FROM spr_users_ms WHERE login = :login AND (SELECT is_smr FROM user_list WHERE login = :login) = 1) OR (SELECT is_ma FROM user_list WHERE tn = :tn) = 1 OR (SELECT is_admin FROM user_list WHERE tn = :tn) = 1)
true
905af1768a45a2f2fc3dd341ae14c948bc97081d
SQL
Dummy420/Darwin_client
/darwin.sql
UTF-8
3,813
3.359375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : lun. 23 mars 2020 à 15:13 -- Version du serveur : 5.7.26 -- Version de PHP : 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `darwin` -- -- -------------------------------------------------------- -- -- Structure de la table `abonne` -- DROP TABLE IF EXISTS `abonne`; CREATE TABLE IF NOT EXISTS `abonne` ( `CODE_USER` int(11) NOT NULL, `CODE_USER_1` int(11) NOT NULL, `DATE_ABONNE` datetime DEFAULT NULL, PRIMARY KEY (`CODE_USER`,`CODE_USER_1`), KEY `I_FK_ABONNE_USER` (`CODE_USER`), KEY `I_FK_ABONNE_USER1` (`CODE_USER_1`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `conversation` -- DROP TABLE IF EXISTS `conversation`; CREATE TABLE IF NOT EXISTS `conversation` ( `CODE_CONV` int(11) NOT NULL, `NOM` char(32) DEFAULT NULL, `DATE_CREATION` char(32) NOT NULL, PRIMARY KEY (`CODE_CONV`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `message` -- DROP TABLE IF EXISTS `message`; CREATE TABLE IF NOT EXISTS `message` ( `CODE_MESSAGE` int(11) NOT NULL, `CODE_USER` int(11) NOT NULL, `TYPE` char(32) DEFAULT NULL, `CONTENU` char(32) NOT NULL, `DATE_MESSAGE` datetime NOT NULL, PRIMARY KEY (`CODE_MESSAGE`), KEY `I_FK_MESSAGE_USER` (`CODE_USER`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `participe` -- DROP TABLE IF EXISTS `participe`; CREATE TABLE IF NOT EXISTS `participe` ( `CODE_USER` int(11) NOT NULL, `CODE_CONV` int(11) NOT NULL, PRIMARY KEY (`CODE_USER`,`CODE_CONV`), KEY `I_FK_PARTICIPE_USER` (`CODE_USER`), KEY `I_FK_PARTICIPE_CONVERSATION` (`CODE_CONV`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `post` -- DROP TABLE IF EXISTS `post`; CREATE TABLE IF NOT EXISTS `post` ( `CODE_USER` int(11) NOT NULL, `CODE_POST` int(11) NOT NULL, `TITRE` char(32) DEFAULT NULL, `CONTENU` char(32) DEFAULT NULL, `DATE_POSTE` datetime NOT NULL, PRIMARY KEY (`CODE_USER`,`CODE_POST`), KEY `I_FK_POST_USER` (`CODE_USER`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `reçois` -- DROP TABLE IF EXISTS `reçois`; CREATE TABLE IF NOT EXISTS `reçois` ( `CODE_MESSAGE` int(11) NOT NULL, `CODE_USER` int(11) NOT NULL, PRIMARY KEY (`CODE_MESSAGE`,`CODE_USER`), KEY `I_FK_REÇOIS_MESSAGE` (`CODE_MESSAGE`), KEY `I_FK_REÇOIS_USER` (`CODE_USER`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `user` -- DROP TABLE IF EXISTS `user`; CREATE TABLE IF NOT EXISTS `user` ( `CODE_USER` int(11) NOT NULL, `PSEUDO` char(32) NOT NULL, `MAIL` char(32) NOT NULL, `MOTPASSE` char(32) NOT NULL, `BIO` char(32) DEFAULT NULL, `PHOTO` char(32) DEFAULT NULL, `COULEUR` char(32) DEFAULT NULL, `DATE_CREATION` datetime NOT NULL, PRIMARY KEY (`CODE_USER`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
548be31219f0d0e8fb53383f9e1d33f48e601e76
SQL
anein/Database-Management-Essentials
/week 2/Assignment/location.sql
UTF-8
261
3.28125
3
[]
no_license
DROP TABLE Location; CREATE TABLE Location ( locNo CHAR(8) NOT NULL, facNo CHAR(8) NOT NULL, locName VARCHAR(30) NOT NULL, CONSTRAINT LocationPK PRIMARY KEY (locNo), CONSTRAINT FacilityFK FOREIGN KEY (facNo) REFERENCES Facility (facNo) );
true
6329f4ac8bf2cee9ba44e9e41a8b6fc16962db48
SQL
manolf/CFLMS-MYSQL-DAY02-Manu
/queries.sql
UTF-8
1,052
3.84375
4
[]
no_license
--ALL ROUTES select * from route; --ALL busstops from ROUTE 100 select * from route inner join routedetail on routedetail.CODE = route.CODE where route.CODE = 100; --All busstop from Route with detailed info Stops and Adresses select route.code, station.name, routedetail.ORDER_NR, address.STREET, address.ZIP_CODE, address.CITY from route inner join routedetail on routedetail.CODE = route.CODE inner join station on station.STOP_ID = routedetail.STOP_ID inner join address on address.ADDRESS_ID = station.ADDRESS_ID where route.CODE = 100; -- for names of the bus drivers select * from driver inner join bus on driver.DRIVER_ID = bus.DRIVER_ID; --for all routes with busses and driver name select * from route inner join bus on route.BUS_ID = bus.BUS_ID inner join driver on driver.DRIVER_ID = bus.DRIVER_ID --more specific data select route.source, route.DESTINATION, driver.FIRST_NAME, driver.LAST_NAME, bus.LICENSE_NR, bus.MODEL from route inner join bus on route.BUS_ID = bus.BUS_ID inner join driver on driver.DRIVER_ID = bus.DRIVER_ID
true
8c9ed38f0ac569dd21ec62efebbb694f85dc67d1
SQL
ButeanuCosmin/Chat-Application
/chat_project.sql
UTF-8
2,858
3.015625
3
[]
no_license
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 10.1.37-MariaDB - mariadb.org binary distribution -- Server OS: Win32 -- HeidiSQL Version: 9.5.0.5196 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!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' */; -- Dumping database structure for chat CREATE DATABASE IF NOT EXISTS `chat` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `chat`; -- Dumping structure for table chat.detalii CREATE TABLE IF NOT EXISTS `detalii` ( `id_detalii` int(11) NOT NULL AUTO_INCREMENT, `id_utilizator` int(11) NOT NULL, `activitate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `scrie` enum('yes','no') NOT NULL, PRIMARY KEY (`id_detalii`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Dumping data for table chat.detalii: ~0 rows (approximately) /*!40000 ALTER TABLE `detalii` DISABLE KEYS */; /*!40000 ALTER TABLE `detalii` ENABLE KEYS */; -- Dumping structure for table chat.login CREATE TABLE IF NOT EXISTS `login` ( `id_utilizator` int(11) NOT NULL AUTO_INCREMENT, `nume` varchar(50) NOT NULL, `parola` varchar(255) NOT NULL, PRIMARY KEY (`id_utilizator`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; -- Dumping data for table chat.login: ~5 rows (approximately) /*!40000 ALTER TABLE `login` DISABLE KEYS */; INSERT INTO `login` (`id_utilizator`, `nume`, `parola`) VALUES (2, 'buteanucosmin', 'cosmin'), (3, 'btn', '$2y$10$nwOb2SELqGSKtoUQNGu2lOOaMi9zUsCqMPyzQ7LHIFb'), (4, 'buteanucosmin1', '$2y$10$vRd0G/5Ot67FwGFVH4GOEOR5LQPFVujz.9/91nG6FPr'), (5, 'abc1', '$2y$10$oQEpDjSVfPhN0Vs0QYIBpeNBXY7QGYji1hAFVaXr22c'), (6, 'buteanu', 'cosmin'), (8, 'cosminescu', 'cosmin'); /*!40000 ALTER TABLE `login` ENABLE KEYS */; -- Dumping structure for table chat.mesaje CREATE TABLE IF NOT EXISTS `mesaje` ( `id_mesaje` int(11) NOT NULL AUTO_INCREMENT, `initiator` int(11) NOT NULL, `receptor` int(11) NOT NULL, `mesaje` text NOT NULL, `timp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` int(1) NOT NULL, PRIMARY KEY (`id_mesaje`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Dumping data for table chat.mesaje: ~0 rows (approximately) /*!40000 ALTER TABLE `mesaje` DISABLE KEYS */; /*!40000 ALTER TABLE `mesaje` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
6540fc0ffcf2ca55cd794f54f4a6bb544dc5a706
SQL
PearInJurassic/InfectStatisticWeb
/sql/infectstaticdb 2.0.sql
UTF-8
48,808
2.515625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : HW Source Server Version : 50728 Source Host : localhost:3306 Source Database : infectstaticdb Target Server Type : MYSQL Target Server Version : 50728 File Encoding : 65001 Date: 2020-03-13 19:30:46 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `details` -- ---------------------------- DROP TABLE IF EXISTS `details`; CREATE TABLE `details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `update_time` date DEFAULT NULL, `province` varchar(50) DEFAULT NULL, `city` varchar(50) DEFAULT NULL, `confirm` int(11) DEFAULT NULL, `confirm_add` int(11) DEFAULT NULL, `heal` int(11) DEFAULT NULL, `dead` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=434 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of details -- ---------------------------- INSERT INTO `details` VALUES ('1', '2020-03-13', '湖北', '武汉', '49991', '5', '35197', '2436'); INSERT INTO `details` VALUES ('2', '2020-03-13', '湖北', '孝感', '3518', '0', '3204', '126'); INSERT INTO `details` VALUES ('3', '2020-03-13', '湖北', '黄冈', '2907', '0', '2720', '125'); INSERT INTO `details` VALUES ('4', '2020-03-13', '湖北', '荆州', '1580', '0', '1464', '49'); INSERT INTO `details` VALUES ('5', '2020-03-13', '湖北', '鄂州', '1394', '0', '1184', '55'); INSERT INTO `details` VALUES ('6', '2020-03-13', '湖北', '随州', '1307', '0', '1181', '45'); INSERT INTO `details` VALUES ('7', '2020-03-13', '湖北', '襄阳', '1175', '0', '1112', '38'); INSERT INTO `details` VALUES ('8', '2020-03-13', '湖北', '黄石', '1015', '0', '938', '38'); INSERT INTO `details` VALUES ('9', '2020-03-13', '湖北', '宜昌', '931', '0', '847', '36'); INSERT INTO `details` VALUES ('10', '2020-03-13', '湖北', '荆门', '928', '0', '839', '39'); INSERT INTO `details` VALUES ('11', '2020-03-13', '湖北', '咸宁', '836', '0', '816', '14'); INSERT INTO `details` VALUES ('12', '2020-03-13', '湖北', '十堰', '672', '0', '626', '8'); INSERT INTO `details` VALUES ('13', '2020-03-13', '湖北', '仙桃', '575', '0', '520', '22'); INSERT INTO `details` VALUES ('14', '2020-03-13', '湖北', '天门', '496', '0', '476', '15'); INSERT INTO `details` VALUES ('15', '2020-03-13', '湖北', '恩施州', '252', '0', '236', '7'); INSERT INTO `details` VALUES ('16', '2020-03-13', '湖北', '潜江', '198', '0', '182', '9'); INSERT INTO `details` VALUES ('17', '2020-03-13', '湖北', '神农架', '11', '0', '11', '0'); INSERT INTO `details` VALUES ('18', '2020-03-13', '广东', '深圳', '420', '0', '395', '3'); INSERT INTO `details` VALUES ('19', '2020-03-13', '广东', '广州', '347', '0', '330', '1'); INSERT INTO `details` VALUES ('20', '2020-03-13', '广东', '东莞', '100', '0', '96', '1'); INSERT INTO `details` VALUES ('21', '2020-03-13', '广东', '珠海', '98', '0', '97', '1'); INSERT INTO `details` VALUES ('22', '2020-03-13', '广东', '佛山', '84', '0', '78', '0'); INSERT INTO `details` VALUES ('23', '2020-03-13', '广东', '中山', '68', '0', '64', '0'); INSERT INTO `details` VALUES ('24', '2020-03-13', '广东', '惠州', '62', '0', '62', '0'); INSERT INTO `details` VALUES ('25', '2020-03-13', '广东', '汕头', '25', '0', '24', '0'); INSERT INTO `details` VALUES ('26', '2020-03-13', '广东', '江门', '23', '0', '23', '0'); INSERT INTO `details` VALUES ('27', '2020-03-13', '广东', '湛江', '22', '0', '22', '0'); INSERT INTO `details` VALUES ('28', '2020-03-13', '广东', '肇庆', '19', '0', '18', '1'); INSERT INTO `details` VALUES ('29', '2020-03-13', '广东', '梅州', '16', '0', '16', '0'); INSERT INTO `details` VALUES ('30', '2020-03-13', '广东', '茂名', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('31', '2020-03-13', '广东', '阳江', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('32', '2020-03-13', '广东', '清远', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('33', '2020-03-13', '广东', '韶关', '10', '0', '9', '1'); INSERT INTO `details` VALUES ('34', '2020-03-13', '广东', '揭阳', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('35', '2020-03-13', '广东', '汕尾', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('36', '2020-03-13', '广东', '潮州', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('37', '2020-03-13', '广东', '河源', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('38', '2020-03-13', '广东', '地区待确认', '0', '0', '0', '0'); INSERT INTO `details` VALUES ('39', '2020-03-13', '河南', '信阳', '274', '0', '271', '2'); INSERT INTO `details` VALUES ('40', '2020-03-13', '河南', '郑州', '158', '0', '152', '5'); INSERT INTO `details` VALUES ('41', '2020-03-13', '河南', '南阳', '156', '0', '152', '3'); INSERT INTO `details` VALUES ('42', '2020-03-13', '河南', '驻马店', '139', '0', '139', '0'); INSERT INTO `details` VALUES ('43', '2020-03-13', '河南', '商丘', '91', '0', '88', '3'); INSERT INTO `details` VALUES ('44', '2020-03-13', '河南', '周口', '76', '0', '74', '1'); INSERT INTO `details` VALUES ('45', '2020-03-13', '河南', '平顶山', '58', '0', '57', '1'); INSERT INTO `details` VALUES ('46', '2020-03-13', '河南', '新乡', '57', '0', '54', '3'); INSERT INTO `details` VALUES ('47', '2020-03-13', '河南', '安阳', '53', '0', '53', '0'); INSERT INTO `details` VALUES ('48', '2020-03-13', '河南', '许昌', '39', '0', '38', '1'); INSERT INTO `details` VALUES ('49', '2020-03-13', '河南', '漯河', '35', '0', '35', '0'); INSERT INTO `details` VALUES ('50', '2020-03-13', '河南', '焦作', '32', '0', '31', '1'); INSERT INTO `details` VALUES ('51', '2020-03-13', '河南', '洛阳', '31', '0', '30', '1'); INSERT INTO `details` VALUES ('52', '2020-03-13', '河南', '开封', '26', '0', '26', '0'); INSERT INTO `details` VALUES ('53', '2020-03-13', '河南', '鹤壁', '19', '0', '19', '0'); INSERT INTO `details` VALUES ('54', '2020-03-13', '河南', '濮阳', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('55', '2020-03-13', '河南', '三门峡', '7', '0', '6', '1'); INSERT INTO `details` VALUES ('56', '2020-03-13', '河南', '济源示范区', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('57', '2020-03-13', '河南', '地区待确认', '0', '0', '2', '0'); INSERT INTO `details` VALUES ('58', '2020-03-13', '浙江', '温州', '504', '0', '501', '1'); INSERT INTO `details` VALUES ('59', '2020-03-13', '浙江', '杭州', '169', '0', '167', '0'); INSERT INTO `details` VALUES ('60', '2020-03-13', '浙江', '宁波', '157', '0', '157', '0'); INSERT INTO `details` VALUES ('61', '2020-03-13', '浙江', '台州', '146', '0', '146', '0'); INSERT INTO `details` VALUES ('62', '2020-03-13', '浙江', '金华', '55', '0', '55', '0'); INSERT INTO `details` VALUES ('63', '2020-03-13', '浙江', '嘉兴', '45', '0', '43', '0'); INSERT INTO `details` VALUES ('64', '2020-03-13', '浙江', '绍兴', '42', '0', '41', '0'); INSERT INTO `details` VALUES ('65', '2020-03-13', '浙江', '省十里丰监狱', '36', '0', '36', '0'); INSERT INTO `details` VALUES ('66', '2020-03-13', '浙江', '丽水', '25', '0', '17', '0'); INSERT INTO `details` VALUES ('67', '2020-03-13', '浙江', '衢州', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('68', '2020-03-13', '浙江', '湖州', '12', '0', '10', '0'); INSERT INTO `details` VALUES ('69', '2020-03-13', '浙江', '舟山', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('70', '2020-03-13', '浙江', '划归外省', '0', '0', '12', '0'); INSERT INTO `details` VALUES ('71', '2020-03-13', '湖南', '长沙', '242', '0', '236', '2'); INSERT INTO `details` VALUES ('72', '2020-03-13', '湖南', '岳阳', '156', '0', '153', '1'); INSERT INTO `details` VALUES ('73', '2020-03-13', '湖南', '邵阳', '102', '0', '100', '1'); INSERT INTO `details` VALUES ('74', '2020-03-13', '湖南', '常德', '82', '0', '82', '0'); INSERT INTO `details` VALUES ('75', '2020-03-13', '湖南', '株洲', '80', '0', '78', '0'); INSERT INTO `details` VALUES ('76', '2020-03-13', '湖南', '娄底', '76', '0', '75', '0'); INSERT INTO `details` VALUES ('77', '2020-03-13', '湖南', '益阳', '60', '0', '60', '0'); INSERT INTO `details` VALUES ('78', '2020-03-13', '湖南', '衡阳', '48', '0', '48', '0'); INSERT INTO `details` VALUES ('79', '2020-03-13', '湖南', '永州', '44', '0', '44', '0'); INSERT INTO `details` VALUES ('80', '2020-03-13', '湖南', '怀化', '40', '0', '40', '0'); INSERT INTO `details` VALUES ('81', '2020-03-13', '湖南', '郴州', '39', '0', '39', '0'); INSERT INTO `details` VALUES ('82', '2020-03-13', '湖南', '湘潭', '36', '0', '36', '0'); INSERT INTO `details` VALUES ('83', '2020-03-13', '湖南', '湘西自治州', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('84', '2020-03-13', '湖南', '张家界', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('85', '2020-03-13', '安徽', '合肥', '174', '0', '173', '1'); INSERT INTO `details` VALUES ('86', '2020-03-13', '安徽', '蚌埠', '160', '0', '155', '5'); INSERT INTO `details` VALUES ('87', '2020-03-13', '安徽', '阜阳', '155', '0', '155', '0'); INSERT INTO `details` VALUES ('88', '2020-03-13', '安徽', '亳州', '108', '0', '108', '0'); INSERT INTO `details` VALUES ('89', '2020-03-13', '安徽', '安庆', '83', '0', '83', '0'); INSERT INTO `details` VALUES ('90', '2020-03-13', '安徽', '六安', '69', '0', '69', '0'); INSERT INTO `details` VALUES ('91', '2020-03-13', '安徽', '宿州', '41', '0', '41', '0'); INSERT INTO `details` VALUES ('92', '2020-03-13', '安徽', '马鞍山', '38', '0', '38', '0'); INSERT INTO `details` VALUES ('93', '2020-03-13', '安徽', '芜湖', '34', '0', '34', '0'); INSERT INTO `details` VALUES ('94', '2020-03-13', '安徽', '铜陵', '29', '0', '29', '0'); INSERT INTO `details` VALUES ('95', '2020-03-13', '安徽', '淮南', '27', '0', '27', '0'); INSERT INTO `details` VALUES ('96', '2020-03-13', '安徽', '淮北', '27', '0', '27', '0'); INSERT INTO `details` VALUES ('97', '2020-03-13', '安徽', '池州', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('98', '2020-03-13', '安徽', '滁州', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('99', '2020-03-13', '安徽', '黄山', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('100', '2020-03-13', '安徽', '宣城', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('101', '2020-03-13', '江西', '南昌', '230', '0', '230', '0'); INSERT INTO `details` VALUES ('102', '2020-03-13', '江西', '新余', '130', '0', '130', '0'); INSERT INTO `details` VALUES ('103', '2020-03-13', '江西', '上饶', '123', '0', '123', '0'); INSERT INTO `details` VALUES ('104', '2020-03-13', '江西', '九江', '118', '0', '118', '0'); INSERT INTO `details` VALUES ('105', '2020-03-13', '江西', '宜春', '106', '0', '106', '0'); INSERT INTO `details` VALUES ('106', '2020-03-13', '江西', '赣州', '76', '0', '75', '1'); INSERT INTO `details` VALUES ('107', '2020-03-13', '江西', '抚州', '72', '0', '72', '0'); INSERT INTO `details` VALUES ('108', '2020-03-13', '江西', '萍乡', '33', '0', '33', '0'); INSERT INTO `details` VALUES ('109', '2020-03-13', '江西', '吉安', '22', '0', '22', '0'); INSERT INTO `details` VALUES ('110', '2020-03-13', '江西', '鹰潭', '18', '0', '18', '0'); INSERT INTO `details` VALUES ('111', '2020-03-13', '江西', '景德镇', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('112', '2020-03-13', '江西', '赣江新区', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('113', '2020-03-13', '山东', '济宁', '260', '0', '253', '0'); INSERT INTO `details` VALUES ('114', '2020-03-13', '山东', '青岛', '61', '0', '59', '1'); INSERT INTO `details` VALUES ('115', '2020-03-13', '山东', '临沂', '49', '0', '48', '0'); INSERT INTO `details` VALUES ('116', '2020-03-13', '山东', '济南', '47', '0', '46', '0'); INSERT INTO `details` VALUES ('117', '2020-03-13', '山东', '烟台', '47', '0', '47', '0'); INSERT INTO `details` VALUES ('118', '2020-03-13', '山东', '潍坊', '44', '0', '44', '0'); INSERT INTO `details` VALUES ('119', '2020-03-13', '山东', '威海', '38', '0', '37', '1'); INSERT INTO `details` VALUES ('120', '2020-03-13', '山东', '聊城', '38', '0', '38', '0'); INSERT INTO `details` VALUES ('121', '2020-03-13', '山东', '德州', '37', '0', '33', '2'); INSERT INTO `details` VALUES ('122', '2020-03-13', '山东', '泰安', '35', '0', '33', '2'); INSERT INTO `details` VALUES ('123', '2020-03-13', '山东', '淄博', '30', '0', '28', '1'); INSERT INTO `details` VALUES ('124', '2020-03-13', '山东', '枣庄', '24', '0', '24', '0'); INSERT INTO `details` VALUES ('125', '2020-03-13', '山东', '菏泽', '18', '0', '18', '0'); INSERT INTO `details` VALUES ('126', '2020-03-13', '山东', '日照', '16', '0', '16', '0'); INSERT INTO `details` VALUES ('127', '2020-03-13', '山东', '滨州', '15', '0', '15', '0'); INSERT INTO `details` VALUES ('128', '2020-03-13', '山东', '境外输入', '1', '0', '0', '0'); INSERT INTO `details` VALUES ('129', '2020-03-13', '江苏', '南京', '93', '0', '93', '0'); INSERT INTO `details` VALUES ('130', '2020-03-13', '江苏', '苏州', '87', '0', '87', '0'); INSERT INTO `details` VALUES ('131', '2020-03-13', '江苏', '徐州', '79', '0', '79', '0'); INSERT INTO `details` VALUES ('132', '2020-03-13', '江苏', '淮安', '66', '0', '66', '0'); INSERT INTO `details` VALUES ('133', '2020-03-13', '江苏', '无锡', '55', '0', '54', '0'); INSERT INTO `details` VALUES ('134', '2020-03-13', '江苏', '常州', '51', '0', '51', '0'); INSERT INTO `details` VALUES ('135', '2020-03-13', '江苏', '连云港', '48', '0', '48', '0'); INSERT INTO `details` VALUES ('136', '2020-03-13', '江苏', '南通', '40', '0', '40', '0'); INSERT INTO `details` VALUES ('137', '2020-03-13', '江苏', '泰州', '37', '0', '37', '0'); INSERT INTO `details` VALUES ('138', '2020-03-13', '江苏', '盐城', '27', '0', '27', '0'); INSERT INTO `details` VALUES ('139', '2020-03-13', '江苏', '扬州', '23', '0', '23', '0'); INSERT INTO `details` VALUES ('140', '2020-03-13', '江苏', '宿迁', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('141', '2020-03-13', '江苏', '镇江', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('142', '2020-03-13', '重庆', '万州区', '118', '0', '114', '4'); INSERT INTO `details` VALUES ('143', '2020-03-13', '重庆', '江北区', '28', '0', '28', '0'); INSERT INTO `details` VALUES ('144', '2020-03-13', '重庆', '云阳县', '25', '0', '25', '0'); INSERT INTO `details` VALUES ('145', '2020-03-13', '重庆', '綦江区', '23', '0', '22', '0'); INSERT INTO `details` VALUES ('146', '2020-03-13', '重庆', '合川区', '23', '0', '23', '0'); INSERT INTO `details` VALUES ('147', '2020-03-13', '重庆', '长寿区', '22', '0', '19', '0'); INSERT INTO `details` VALUES ('148', '2020-03-13', '重庆', '奉节县', '22', '0', '22', '0'); INSERT INTO `details` VALUES ('149', '2020-03-13', '重庆', '九龙坡区', '21', '0', '20', '1'); INSERT INTO `details` VALUES ('150', '2020-03-13', '重庆', '开州区', '21', '0', '20', '1'); INSERT INTO `details` VALUES ('151', '2020-03-13', '重庆', '忠县', '21', '0', '21', '0'); INSERT INTO `details` VALUES ('152', '2020-03-13', '重庆', '渝中区', '20', '0', '20', '0'); INSERT INTO `details` VALUES ('153', '2020-03-13', '重庆', '垫江县', '20', '0', '20', '0'); INSERT INTO `details` VALUES ('154', '2020-03-13', '重庆', '潼南区', '18', '0', '18', '0'); INSERT INTO `details` VALUES ('155', '2020-03-13', '重庆', '两江新区', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('156', '2020-03-13', '重庆', '渝北区', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('157', '2020-03-13', '重庆', '南岸区', '15', '0', '15', '0'); INSERT INTO `details` VALUES ('158', '2020-03-13', '重庆', '石柱县', '15', '0', '15', '0'); INSERT INTO `details` VALUES ('159', '2020-03-13', '重庆', '大足区', '14', '0', '13', '0'); INSERT INTO `details` VALUES ('160', '2020-03-13', '重庆', '巫溪县', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('161', '2020-03-13', '重庆', '铜梁区', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('162', '2020-03-13', '重庆', '丰都县', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('163', '2020-03-13', '重庆', '巫山县', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('164', '2020-03-13', '重庆', '荣昌区', '9', '0', '8', '0'); INSERT INTO `details` VALUES ('165', '2020-03-13', '重庆', '沙坪坝区', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('166', '2020-03-13', '重庆', '璧山区', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('167', '2020-03-13', '重庆', '大渡口区', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('168', '2020-03-13', '重庆', '巴南区', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('169', '2020-03-13', '重庆', '永川区', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('170', '2020-03-13', '重庆', '涪陵区', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('171', '2020-03-13', '重庆', '梁平区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('172', '2020-03-13', '重庆', '高新区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('173', '2020-03-13', '重庆', '江津区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('174', '2020-03-13', '重庆', '城口县', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('175', '2020-03-13', '重庆', '彭水县', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('176', '2020-03-13', '重庆', '黔江区', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('177', '2020-03-13', '重庆', '武隆区', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('178', '2020-03-13', '重庆', '酉阳县', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('179', '2020-03-13', '重庆', '万盛经开区', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('180', '2020-03-13', '重庆', '秀山县', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('181', '2020-03-13', '四川', '成都', '144', '0', '115', '3'); INSERT INTO `details` VALUES ('182', '2020-03-13', '四川', '甘孜', '78', '0', '76', '0'); INSERT INTO `details` VALUES ('183', '2020-03-13', '四川', '达州', '42', '0', '41', '0'); INSERT INTO `details` VALUES ('184', '2020-03-13', '四川', '南充', '39', '0', '39', '0'); INSERT INTO `details` VALUES ('185', '2020-03-13', '四川', '广安', '30', '0', '29', '0'); INSERT INTO `details` VALUES ('186', '2020-03-13', '四川', '泸州', '24', '0', '24', '0'); INSERT INTO `details` VALUES ('187', '2020-03-13', '四川', '巴中', '24', '0', '21', '0'); INSERT INTO `details` VALUES ('188', '2020-03-13', '四川', '绵阳', '22', '0', '20', '0'); INSERT INTO `details` VALUES ('189', '2020-03-13', '四川', '内江', '22', '0', '22', '0'); INSERT INTO `details` VALUES ('190', '2020-03-13', '四川', '德阳', '18', '0', '18', '0'); INSERT INTO `details` VALUES ('191', '2020-03-13', '四川', '遂宁', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('192', '2020-03-13', '四川', '攀枝花', '16', '0', '16', '0'); INSERT INTO `details` VALUES ('193', '2020-03-13', '四川', '凉山', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('194', '2020-03-13', '四川', '宜宾', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('195', '2020-03-13', '四川', '自贡', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('196', '2020-03-13', '四川', '眉山', '8', '0', '7', '0'); INSERT INTO `details` VALUES ('197', '2020-03-13', '四川', '雅安', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('198', '2020-03-13', '四川', '广元', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('199', '2020-03-13', '四川', '资阳', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('200', '2020-03-13', '四川', '乐山', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('201', '2020-03-13', '四川', '阿坝', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('202', '2020-03-13', '黑龙江', '哈尔滨', '198', '0', '186', '4'); INSERT INTO `details` VALUES ('203', '2020-03-13', '黑龙江', '双鸭山', '52', '0', '47', '3'); INSERT INTO `details` VALUES ('204', '2020-03-13', '黑龙江', '绥化', '47', '0', '41', '4'); INSERT INTO `details` VALUES ('205', '2020-03-13', '黑龙江', '鸡西', '46', '0', '45', '0'); INSERT INTO `details` VALUES ('206', '2020-03-13', '黑龙江', '齐齐哈尔', '43', '0', '40', '1'); INSERT INTO `details` VALUES ('207', '2020-03-13', '黑龙江', '大庆', '26', '0', '23', '1'); INSERT INTO `details` VALUES ('208', '2020-03-13', '黑龙江', '七台河', '17', '0', '16', '0'); INSERT INTO `details` VALUES ('209', '2020-03-13', '黑龙江', '佳木斯', '15', '0', '15', '0'); INSERT INTO `details` VALUES ('210', '2020-03-13', '黑龙江', '牡丹江', '15', '0', '13', '0'); INSERT INTO `details` VALUES ('211', '2020-03-13', '黑龙江', '黑河', '14', '0', '13', '0'); INSERT INTO `details` VALUES ('212', '2020-03-13', '黑龙江', '鹤岗', '5', '0', '4', '0'); INSERT INTO `details` VALUES ('213', '2020-03-13', '黑龙江', '大兴安岭', '3', '0', '2', '0'); INSERT INTO `details` VALUES ('214', '2020-03-13', '黑龙江', '伊春', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('215', '2020-03-13', '北京', '朝阳', '72', '0', '0', '0'); INSERT INTO `details` VALUES ('216', '2020-03-13', '北京', '海淀', '63', '0', '0', '0'); INSERT INTO `details` VALUES ('217', '2020-03-13', '北京', '西城', '53', '0', '0', '0'); INSERT INTO `details` VALUES ('218', '2020-03-13', '北京', '丰台', '43', '0', '0', '0'); INSERT INTO `details` VALUES ('219', '2020-03-13', '北京', '大兴', '39', '0', '0', '0'); INSERT INTO `details` VALUES ('220', '2020-03-13', '北京', '昌平', '29', '0', '0', '0'); INSERT INTO `details` VALUES ('221', '2020-03-13', '北京', '外地来京', '25', '0', '0', '0'); INSERT INTO `details` VALUES ('222', '2020-03-13', '北京', '境外输入', '21', '1', '0', '0'); INSERT INTO `details` VALUES ('223', '2020-03-13', '北京', '通州', '19', '0', '0', '0'); INSERT INTO `details` VALUES ('224', '2020-03-13', '北京', '房山', '16', '0', '0', '0'); INSERT INTO `details` VALUES ('225', '2020-03-13', '北京', '石景山', '14', '0', '0', '0'); INSERT INTO `details` VALUES ('226', '2020-03-13', '北京', '东城', '14', '0', '0', '0'); INSERT INTO `details` VALUES ('227', '2020-03-13', '北京', '顺义', '10', '0', '0', '0'); INSERT INTO `details` VALUES ('228', '2020-03-13', '北京', '密云', '7', '0', '0', '0'); INSERT INTO `details` VALUES ('229', '2020-03-13', '北京', '怀柔', '7', '0', '0', '0'); INSERT INTO `details` VALUES ('230', '2020-03-13', '北京', '门头沟', '3', '0', '0', '0'); INSERT INTO `details` VALUES ('231', '2020-03-13', '北京', '延庆', '1', '0', '0', '0'); INSERT INTO `details` VALUES ('232', '2020-03-13', '北京', '地区待确认', '0', '0', '342', '8'); INSERT INTO `details` VALUES ('233', '2020-03-13', '上海', '外地来沪', '111', '0', '104', '0'); INSERT INTO `details` VALUES ('234', '2020-03-13', '上海', '浦东', '61', '0', '58', '0'); INSERT INTO `details` VALUES ('235', '2020-03-13', '上海', '宝山', '21', '0', '19', '0'); INSERT INTO `details` VALUES ('236', '2020-03-13', '上海', '闵行', '19', '0', '19', '0'); INSERT INTO `details` VALUES ('237', '2020-03-13', '上海', '徐汇', '18', '0', '17', '0'); INSERT INTO `details` VALUES ('238', '2020-03-13', '上海', '静安', '16', '0', '15', '0'); INSERT INTO `details` VALUES ('239', '2020-03-13', '上海', '松江', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('240', '2020-03-13', '上海', '长宁', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('241', '2020-03-13', '上海', '普陀', '11', '0', '11', '0'); INSERT INTO `details` VALUES ('242', '2020-03-13', '上海', '奉贤', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('243', '2020-03-13', '上海', '嘉定', '9', '0', '7', '0'); INSERT INTO `details` VALUES ('244', '2020-03-13', '上海', '杨浦', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('245', '2020-03-13', '上海', '境外输入', '8', '2', '0', '0'); INSERT INTO `details` VALUES ('246', '2020-03-13', '上海', '虹口', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('247', '2020-03-13', '上海', '黄浦', '6', '0', '5', '0'); INSERT INTO `details` VALUES ('248', '2020-03-13', '上海', '青浦', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('249', '2020-03-13', '上海', '金山', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('250', '2020-03-13', '上海', '崇明', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('251', '2020-03-13', '上海', '地区待确认', '0', '0', '3', '3'); INSERT INTO `details` VALUES ('252', '2020-03-13', '河北', '唐山', '58', '0', '55', '1'); INSERT INTO `details` VALUES ('253', '2020-03-13', '河北', '沧州', '48', '0', '45', '3'); INSERT INTO `details` VALUES ('254', '2020-03-13', '河北', '张家口', '41', '0', '41', '0'); INSERT INTO `details` VALUES ('255', '2020-03-13', '河北', '邯郸', '32', '0', '32', '0'); INSERT INTO `details` VALUES ('256', '2020-03-13', '河北', '保定', '32', '0', '32', '0'); INSERT INTO `details` VALUES ('257', '2020-03-13', '河北', '廊坊', '30', '0', '30', '0'); INSERT INTO `details` VALUES ('258', '2020-03-13', '河北', '石家庄', '29', '0', '29', '0'); INSERT INTO `details` VALUES ('259', '2020-03-13', '河北', '邢台', '23', '0', '22', '1'); INSERT INTO `details` VALUES ('260', '2020-03-13', '河北', '秦皇岛', '10', '0', '9', '1'); INSERT INTO `details` VALUES ('261', '2020-03-13', '河北', '衡水', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('262', '2020-03-13', '河北', '承德', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('263', '2020-03-13', '福建', '福州', '72', '0', '71', '1'); INSERT INTO `details` VALUES ('264', '2020-03-13', '福建', '莆田', '56', '0', '56', '0'); INSERT INTO `details` VALUES ('265', '2020-03-13', '福建', '泉州', '47', '0', '47', '0'); INSERT INTO `details` VALUES ('266', '2020-03-13', '福建', '厦门', '35', '0', '35', '0'); INSERT INTO `details` VALUES ('267', '2020-03-13', '福建', '宁德', '26', '0', '26', '0'); INSERT INTO `details` VALUES ('268', '2020-03-13', '福建', '南平', '20', '0', '20', '0'); INSERT INTO `details` VALUES ('269', '2020-03-13', '福建', '漳州', '20', '0', '20', '0'); INSERT INTO `details` VALUES ('270', '2020-03-13', '福建', '三明', '14', '0', '14', '0'); INSERT INTO `details` VALUES ('271', '2020-03-13', '福建', '龙岩', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('272', '2020-03-13', '福建', '地区待确认', '0', '0', '0', '0'); INSERT INTO `details` VALUES ('273', '2020-03-13', '广西', '南宁', '55', '0', '54', '0'); INSERT INTO `details` VALUES ('274', '2020-03-13', '广西', '北海', '44', '0', '41', '1'); INSERT INTO `details` VALUES ('275', '2020-03-13', '广西', '桂林', '32', '0', '32', '0'); INSERT INTO `details` VALUES ('276', '2020-03-13', '广西', '河池', '28', '0', '27', '1'); INSERT INTO `details` VALUES ('277', '2020-03-13', '广西', '柳州', '24', '0', '23', '0'); INSERT INTO `details` VALUES ('278', '2020-03-13', '广西', '防城港', '19', '0', '17', '0'); INSERT INTO `details` VALUES ('279', '2020-03-13', '广西', '来宾', '11', '0', '10', '0'); INSERT INTO `details` VALUES ('280', '2020-03-13', '广西', '玉林', '11', '0', '11', '0'); INSERT INTO `details` VALUES ('281', '2020-03-13', '广西', '钦州', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('282', '2020-03-13', '广西', '贵港', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('283', '2020-03-13', '广西', '梧州', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('284', '2020-03-13', '广西', '贺州', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('285', '2020-03-13', '广西', '百色', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('286', '2020-03-13', '陕西', '西安', '120', '0', '110', '2'); INSERT INTO `details` VALUES ('287', '2020-03-13', '陕西', '汉中', '26', '0', '25', '0'); INSERT INTO `details` VALUES ('288', '2020-03-13', '陕西', '安康', '26', '0', '26', '0'); INSERT INTO `details` VALUES ('289', '2020-03-13', '陕西', '咸阳', '17', '0', '16', '0'); INSERT INTO `details` VALUES ('290', '2020-03-13', '陕西', '渭南', '15', '0', '14', '0'); INSERT INTO `details` VALUES ('291', '2020-03-13', '陕西', '宝鸡', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('292', '2020-03-13', '陕西', '延安', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('293', '2020-03-13', '陕西', '铜川', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('294', '2020-03-13', '陕西', '商洛', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('295', '2020-03-13', '陕西', '榆林', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('296', '2020-03-13', '陕西', '韩城', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('297', '2020-03-13', '陕西', '杨凌', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('298', '2020-03-13', '陕西', '地区待确认', '0', '0', '0', '0'); INSERT INTO `details` VALUES ('299', '2020-03-13', '云南', '昆明', '53', '0', '53', '0'); INSERT INTO `details` VALUES ('300', '2020-03-13', '云南', '昭通市', '25', '0', '25', '0'); INSERT INTO `details` VALUES ('301', '2020-03-13', '云南', '西双版纳州', '15', '0', '14', '1'); INSERT INTO `details` VALUES ('302', '2020-03-13', '云南', '玉溪', '14', '0', '13', '1'); INSERT INTO `details` VALUES ('303', '2020-03-13', '云南', '大理', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('304', '2020-03-13', '云南', '曲靖', '13', '0', '12', '0'); INSERT INTO `details` VALUES ('305', '2020-03-13', '云南', '红河', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('306', '2020-03-13', '云南', '保山市', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('307', '2020-03-13', '云南', '丽江市', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('308', '2020-03-13', '云南', '德宏州', '5', '0', '4', '0'); INSERT INTO `details` VALUES ('309', '2020-03-13', '云南', '普洱', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('310', '2020-03-13', '云南', '楚雄州', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('311', '2020-03-13', '云南', '文山州', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('312', '2020-03-13', '云南', '临沧', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('313', '2020-03-13', '海南', '三亚', '54', '0', '53', '1'); INSERT INTO `details` VALUES ('314', '2020-03-13', '海南', '海口', '39', '0', '38', '0'); INSERT INTO `details` VALUES ('315', '2020-03-13', '海南', '儋州', '15', '0', '13', '1'); INSERT INTO `details` VALUES ('316', '2020-03-13', '海南', '万宁', '13', '0', '13', '0'); INSERT INTO `details` VALUES ('317', '2020-03-13', '海南', '澄迈县', '9', '0', '8', '1'); INSERT INTO `details` VALUES ('318', '2020-03-13', '海南', '昌江县', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('319', '2020-03-13', '海南', '琼海', '6', '0', '5', '1'); INSERT INTO `details` VALUES ('320', '2020-03-13', '海南', '临高县', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('321', '2020-03-13', '海南', '陵水县', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('322', '2020-03-13', '海南', '保亭', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('323', '2020-03-13', '海南', '东方', '3', '0', '2', '1'); INSERT INTO `details` VALUES ('324', '2020-03-13', '海南', '定安县', '3', '0', '2', '1'); INSERT INTO `details` VALUES ('325', '2020-03-13', '海南', '文昌', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('326', '2020-03-13', '海南', '乐东', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('327', '2020-03-13', '海南', '琼中县', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('328', '2020-03-13', '贵州', '贵阳', '36', '0', '33', '1'); INSERT INTO `details` VALUES ('329', '2020-03-13', '贵州', '遵义', '32', '0', '31', '0'); INSERT INTO `details` VALUES ('330', '2020-03-13', '贵州', '毕节', '23', '0', '23', '0'); INSERT INTO `details` VALUES ('331', '2020-03-13', '贵州', '黔南州', '17', '0', '17', '0'); INSERT INTO `details` VALUES ('332', '2020-03-13', '贵州', '黔东南州', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('333', '2020-03-13', '贵州', '六盘水', '10', '0', '8', '1'); INSERT INTO `details` VALUES ('334', '2020-03-13', '贵州', '铜仁', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('335', '2020-03-13', '贵州', '安顺', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('336', '2020-03-13', '贵州', '黔西南州', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('337', '2020-03-13', '天津', '宝坻区', '60', '0', '57', '2'); INSERT INTO `details` VALUES ('338', '2020-03-13', '天津', '河东区', '15', '0', '14', '1'); INSERT INTO `details` VALUES ('339', '2020-03-13', '天津', '河北区', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('340', '2020-03-13', '天津', '外地来津', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('341', '2020-03-13', '天津', '北辰区', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('342', '2020-03-13', '天津', '南开区', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('343', '2020-03-13', '天津', '和平区', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('344', '2020-03-13', '天津', '宁河区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('345', '2020-03-13', '天津', '东丽区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('346', '2020-03-13', '天津', '河西区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('347', '2020-03-13', '天津', '西青区', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('348', '2020-03-13', '天津', '滨海新区', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('349', '2020-03-13', '天津', '津南区', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('350', '2020-03-13', '天津', '武清区', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('351', '2020-03-13', '天津', '红桥区', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('352', '2020-03-13', '香港', '地区待确认', '134', '5', '75', '4'); INSERT INTO `details` VALUES ('353', '2020-03-13', '山西', '晋中', '37', '0', '36', '0'); INSERT INTO `details` VALUES ('354', '2020-03-13', '山西', '太原', '20', '0', '20', '0'); INSERT INTO `details` VALUES ('355', '2020-03-13', '山西', '运城', '19', '0', '19', '0'); INSERT INTO `details` VALUES ('356', '2020-03-13', '山西', '大同', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('357', '2020-03-13', '山西', '晋城', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('358', '2020-03-13', '山西', '长治', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('359', '2020-03-13', '山西', '朔州', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('360', '2020-03-13', '山西', '忻州', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('361', '2020-03-13', '山西', '吕梁', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('362', '2020-03-13', '山西', '阳泉', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('363', '2020-03-13', '山西', '临汾', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('364', '2020-03-13', '甘肃', '境外输入', '36', '0', '0', '0'); INSERT INTO `details` VALUES ('365', '2020-03-13', '甘肃', '兰州', '36', '0', '34', '2'); INSERT INTO `details` VALUES ('366', '2020-03-13', '甘肃', '天水', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('367', '2020-03-13', '甘肃', '定西', '9', '0', '8', '0'); INSERT INTO `details` VALUES ('368', '2020-03-13', '甘肃', '平凉', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('369', '2020-03-13', '甘肃', '甘南州', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('370', '2020-03-13', '甘肃', '白银', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('371', '2020-03-13', '甘肃', '陇南', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('372', '2020-03-13', '甘肃', '庆阳', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('373', '2020-03-13', '甘肃', '临夏', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('374', '2020-03-13', '甘肃', '张掖', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('375', '2020-03-13', '甘肃', '金昌', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('376', '2020-03-13', '甘肃', '地区待确认', '0', '0', '0', '0'); INSERT INTO `details` VALUES ('377', '2020-03-13', '辽宁', '沈阳', '28', '0', '26', '0'); INSERT INTO `details` VALUES ('378', '2020-03-13', '辽宁', '大连', '19', '0', '16', '0'); INSERT INTO `details` VALUES ('379', '2020-03-13', '辽宁', '锦州', '12', '0', '12', '0'); INSERT INTO `details` VALUES ('380', '2020-03-13', '辽宁', '葫芦岛', '12', '0', '9', '1'); INSERT INTO `details` VALUES ('381', '2020-03-13', '辽宁', '盘锦', '11', '0', '11', '0'); INSERT INTO `details` VALUES ('382', '2020-03-13', '辽宁', '丹东', '11', '0', '7', '0'); INSERT INTO `details` VALUES ('383', '2020-03-13', '辽宁', '阜新', '8', '0', '8', '0'); INSERT INTO `details` VALUES ('384', '2020-03-13', '辽宁', '铁岭', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('385', '2020-03-13', '辽宁', '朝阳市', '6', '0', '5', '0'); INSERT INTO `details` VALUES ('386', '2020-03-13', '辽宁', '鞍山', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('387', '2020-03-13', '辽宁', '本溪', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('388', '2020-03-13', '辽宁', '辽阳', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('389', '2020-03-13', '辽宁', '营口', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('390', '2020-03-13', '吉林', '长春', '45', '0', '45', '0'); INSERT INTO `details` VALUES ('391', '2020-03-13', '吉林', '四平', '15', '0', '14', '1'); INSERT INTO `details` VALUES ('392', '2020-03-13', '吉林', '辽源', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('393', '2020-03-13', '吉林', '通化', '6', '0', '5', '0'); INSERT INTO `details` VALUES ('394', '2020-03-13', '吉林', '公主岭', '6', '0', '6', '0'); INSERT INTO `details` VALUES ('395', '2020-03-13', '吉林', '延边', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('396', '2020-03-13', '吉林', '吉林', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('397', '2020-03-13', '吉林', '松原', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('398', '2020-03-13', '吉林', '白城', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('399', '2020-03-13', '吉林', '梅河口市', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('400', '2020-03-13', '新疆', '乌鲁木齐', '23', '0', '23', '0'); INSERT INTO `details` VALUES ('401', '2020-03-13', '新疆', '伊犁州', '18', '0', '18', '0'); INSERT INTO `details` VALUES ('402', '2020-03-13', '新疆', '兵团第四师', '10', '0', '9', '1'); INSERT INTO `details` VALUES ('403', '2020-03-13', '新疆', '昌吉州', '4', '0', '4', '0'); INSERT INTO `details` VALUES ('404', '2020-03-13', '新疆', '第八师石河子', '4', '0', '3', '1'); INSERT INTO `details` VALUES ('405', '2020-03-13', '新疆', '兵团第九师', '4', '0', '3', '1'); INSERT INTO `details` VALUES ('406', '2020-03-13', '新疆', '吐鲁番', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('407', '2020-03-13', '新疆', '兵团第十二师', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('408', '2020-03-13', '新疆', '巴州', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('409', '2020-03-13', '新疆', '六师五家渠', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('410', '2020-03-13', '新疆', '第七师', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('411', '2020-03-13', '新疆', '阿克苏', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('412', '2020-03-13', '宁夏', '银川', '36', '0', '34', '0'); INSERT INTO `details` VALUES ('413', '2020-03-13', '宁夏', '吴忠', '28', '0', '28', '0'); INSERT INTO `details` VALUES ('414', '2020-03-13', '宁夏', '固原', '5', '0', '5', '0'); INSERT INTO `details` VALUES ('415', '2020-03-13', '宁夏', '中卫', '4', '0', '3', '0'); INSERT INTO `details` VALUES ('416', '2020-03-13', '宁夏', '石嘴山', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('417', '2020-03-13', '宁夏', '宁东管委会', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('418', '2020-03-13', '内蒙古', '鄂尔多斯', '11', '0', '11', '0'); INSERT INTO `details` VALUES ('419', '2020-03-13', '内蒙古', '包头', '11', '0', '9', '0'); INSERT INTO `details` VALUES ('420', '2020-03-13', '内蒙古', '赤峰', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('421', '2020-03-13', '内蒙古', '锡林郭勒', '9', '0', '9', '0'); INSERT INTO `details` VALUES ('422', '2020-03-13', '内蒙古', '巴彦淖尔', '8', '0', '7', '1'); INSERT INTO `details` VALUES ('423', '2020-03-13', '内蒙古', '通辽', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('424', '2020-03-13', '内蒙古', '呼和浩特', '7', '0', '6', '0'); INSERT INTO `details` VALUES ('425', '2020-03-13', '内蒙古', '呼伦贝尔', '7', '0', '7', '0'); INSERT INTO `details` VALUES ('426', '2020-03-13', '内蒙古', '乌兰察布', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('427', '2020-03-13', '内蒙古', '乌海', '2', '0', '2', '0'); INSERT INTO `details` VALUES ('428', '2020-03-13', '内蒙古', '兴安盟', '1', '0', '1', '0'); INSERT INTO `details` VALUES ('429', '2020-03-13', '台湾', '地区待确认', '50', '2', '20', '1'); INSERT INTO `details` VALUES ('430', '2020-03-13', '青海', '西宁', '15', '0', '15', '0'); INSERT INTO `details` VALUES ('431', '2020-03-13', '青海', '海北州', '3', '0', '3', '0'); INSERT INTO `details` VALUES ('432', '2020-03-13', '澳门', '地区待确认', '10', '0', '10', '0'); INSERT INTO `details` VALUES ('433', '2020-03-13', '西藏', '拉萨', '1', '0', '1', '0'); -- ---------------------------- -- Table structure for `history` -- ---------------------------- DROP TABLE IF EXISTS `history`; CREATE TABLE `history` ( `ds` date NOT NULL, `confirm` int(11) DEFAULT NULL, `confirm_add` int(11) DEFAULT NULL, `suspect` int(11) DEFAULT NULL, `suspect_add` int(11) DEFAULT NULL, `heal` int(11) DEFAULT NULL, `heal_add` int(11) DEFAULT NULL, `dead` int(11) DEFAULT NULL, `dead_add` int(11) DEFAULT NULL, PRIMARY KEY (`ds`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of history -- ---------------------------- INSERT INTO `history` VALUES ('2020-01-13', '41', null, '0', null, '0', null, '1', null); INSERT INTO `history` VALUES ('2020-01-14', '41', null, '0', null, '0', null, '1', null); INSERT INTO `history` VALUES ('2020-01-15', '41', null, '0', null, '5', null, '2', null); INSERT INTO `history` VALUES ('2020-01-16', '45', null, '0', null, '8', null, '2', null); INSERT INTO `history` VALUES ('2020-01-17', '62', null, '0', null, '12', null, '2', null); INSERT INTO `history` VALUES ('2020-01-18', '198', null, '0', null, '17', null, '3', null); INSERT INTO `history` VALUES ('2020-01-19', '275', null, '0', null, '18', null, '4', null); INSERT INTO `history` VALUES ('2020-01-20', '291', '77', '54', '27', '25', '0', '6', '0'); INSERT INTO `history` VALUES ('2020-01-21', '440', '149', '37', '53', '25', '0', '9', '3'); INSERT INTO `history` VALUES ('2020-01-22', '574', '131', '393', '257', '25', '0', '17', '8'); INSERT INTO `history` VALUES ('2020-01-23', '835', '259', '1072', '680', '34', '6', '25', '8'); INSERT INTO `history` VALUES ('2020-01-24', '1297', '444', '1965', '1118', '38', '3', '41', '16'); INSERT INTO `history` VALUES ('2020-01-25', '1985', '688', '2684', '1309', '49', '11', '56', '15'); INSERT INTO `history` VALUES ('2020-01-26', '2761', '769', '5794', '3806', '51', '2', '80', '24'); INSERT INTO `history` VALUES ('2020-01-27', '4535', '1771', '6973', '2077', '60', '9', '106', '26'); INSERT INTO `history` VALUES ('2020-01-28', '5997', '1459', '9239', '3248', '103', '43', '132', '26'); INSERT INTO `history` VALUES ('2020-01-29', '7736', '1737', '12167', '4148', '124', '21', '170', '38'); INSERT INTO `history` VALUES ('2020-01-30', '9720', '1982', '15238', '4812', '171', '47', '213', '43'); INSERT INTO `history` VALUES ('2020-01-31', '11821', '2102', '17988', '5019', '243', '72', '259', '46'); INSERT INTO `history` VALUES ('2020-02-01', '14411', '2590', '19544', '4562', '328', '85', '304', '45'); INSERT INTO `history` VALUES ('2020-02-02', '17238', '2829', '21558', '5173', '475', '147', '361', '57'); INSERT INTO `history` VALUES ('2020-02-03', '20471', '3235', '23214', '5072', '632', '157', '425', '64'); INSERT INTO `history` VALUES ('2020-02-04', '24363', '3893', '23260', '3971', '892', '262', '491', '65'); INSERT INTO `history` VALUES ('2020-02-05', '28060', '3697', '24702', '5328', '1153', '261', '564', '73'); INSERT INTO `history` VALUES ('2020-02-06', '31211', '3143', '26359', '4833', '1542', '387', '637', '73'); INSERT INTO `history` VALUES ('2020-02-07', '34598', '3401', '27657', '4214', '2052', '510', '723', '86'); INSERT INTO `history` VALUES ('2020-02-08', '37251', '2656', '28942', '3916', '2651', '600', '812', '89'); INSERT INTO `history` VALUES ('2020-02-09', '40235', '3062', '23589', '4008', '3283', '632', '909', '97'); INSERT INTO `history` VALUES ('2020-02-10', '42708', '2484', '21675', '3536', '3998', '716', '1017', '108'); INSERT INTO `history` VALUES ('2020-02-11', '44730', '2022', '16067', '3342', '4742', '744', '1114', '97'); INSERT INTO `history` VALUES ('2020-02-12', '59882', '15153', '13435', '2807', '5915', '1173', '1368', '254'); INSERT INTO `history` VALUES ('2020-02-13', '63932', '5093', '10109', '2450', '6728', '1083', '1381', '121'); INSERT INTO `history` VALUES ('2020-02-14', '66576', '2644', '8969', '2277', '8101', '1373', '1524', '143'); INSERT INTO `history` VALUES ('2020-02-15', '68584', '2009', '8228', '1918', '9425', '1324', '1666', '142'); INSERT INTO `history` VALUES ('2020-02-16', '70635', '2051', '7264', '1563', '10853', '1425', '1772', '105'); INSERT INTO `history` VALUES ('2020-02-17', '72528', '1891', '6242', '1432', '12561', '1701', '1870', '98'); INSERT INTO `history` VALUES ('2020-02-18', '74279', '1751', '5248', '1185', '14387', '1826', '2006', '136'); INSERT INTO `history` VALUES ('2020-02-19', '75002', '820', '4922', '1277', '16157', '1781', '2121', '115'); INSERT INTO `history` VALUES ('2020-02-20', '75993', '892', '5206', '1614', '18266', '2109', '2239', '118'); INSERT INTO `history` VALUES ('2020-02-21', '76392', '399', '5365', '1361', '20673', '2394', '2348', '109'); INSERT INTO `history` VALUES ('2020-02-22', '77041', '649', '4148', '882', '22907', '2235', '2445', '97'); INSERT INTO `history` VALUES ('2020-02-23', '77262', '416', '3434', '620', '24757', '1850', '2595', '150'); INSERT INTO `history` VALUES ('2020-02-24', '77779', '517', '2824', '530', '27353', '2596', '2666', '71'); INSERT INTO `history` VALUES ('2020-02-25', '78190', '411', '2491', '439', '29775', '2422', '2718', '52'); INSERT INTO `history` VALUES ('2020-02-26', '78630', '440', '2358', '508', '32531', '2756', '2747', '29'); INSERT INTO `history` VALUES ('2020-02-27', '78959', '329', '2308', '452', '36157', '3626', '2791', '44'); INSERT INTO `history` VALUES ('2020-02-28', '79389', '430', '1418', '248', '39049', '2892', '2838', '47'); INSERT INTO `history` VALUES ('2020-02-29', '79968', '579', '851', '132', '41675', '2626', '2873', '35'); INSERT INTO `history` VALUES ('2020-03-01', '80174', '206', '715', '141', '44518', '2843', '2915', '42'); INSERT INTO `history` VALUES ('2020-03-02', '80302', '128', '587', '129', '47260', '2742', '2946', '31'); INSERT INTO `history` VALUES ('2020-03-03', '80422', '120', '520', '143', '49914', '2654', '2984', '38'); INSERT INTO `history` VALUES ('2020-03-04', '80565', '143', '522', '143', '52109', '2195', '3015', '31'); INSERT INTO `history` VALUES ('2020-03-05', '80710', '145', '482', '102', '53793', '1684', '3045', '30'); INSERT INTO `history` VALUES ('2020-03-06', '80813', '103', '502', '99', '55477', '1684', '3073', '28'); INSERT INTO `history` VALUES ('2020-03-07', '80859', '46', '458', '84', '57143', '1666', '3100', '27'); INSERT INTO `history` VALUES ('2020-03-08', '80904', '45', '421', '60', '58684', '1541', '3123', '23'); INSERT INTO `history` VALUES ('2020-03-09', '80924', '20', '349', '36', '59982', '1298', '3140', '17'); INSERT INTO `history` VALUES ('2020-03-10', '80955', '31', '285', '31', '61567', '1585', '3162', '22'); INSERT INTO `history` VALUES ('2020-03-11', '80980', '25', '253', '33', '62887', '1320', '3173', '11'); INSERT INTO `history` VALUES ('2020-03-12', '81003', '11', '147', '33', '64216', '1329', '3180', '7');
true
a94cea77810b50390f739e95f11fad69cb81dbef
SQL
Complex-Cormorant/questions-and-answers
/Postgres/postgres-q-and-a.sql
UTF-8
803
3.1875
3
[]
no_license
CREATE TABLE questions( question_id SERIAL NOT NULL PRIMARY KEY, product_id INT NOT NULL, question_body VARCHAR(1000) NOT NULL, question_date BIGINT NOT NULL, asker_name VARCHAR(60) NOT NULL, email VARCHAR(60) NOT NULL, reported BOOLEAN DEFAULT false, question_helpfulness SMALLINT DEFAULT 0 ); CREATE TABLE answers( answer_id SERIAL NOT NULL PRIMARY KEY, question_id INT NOT NULL REFERENCES questions (question_id), answer_body VARCHAR(1000) NOT NULL, answer_date BIGINT NOT NULL, answerer_name VARCHAR(60) NOT NULL, email VARCHAR(60) NOT NULL, reported BOOLEAN DEFAULT false, helpfulness SMALLINT DEFAULT 0 ); CREATE TABLE photos( photo_id SERIAL NOT NULL PRIMARY KEY, answer_id INT NOT NULL REFERENCES answers (answer_id), photo_url VARCHAR(2083) NOT NULL );
true
1d2f36cdc54180fbb51db051022ef1b58a28e3f2
SQL
quepasapedro/portfolio
/sql/onboarding_outcome_variance/onboarding_metric_alert_code.sql
UTF-8
3,212
3.71875
4
[]
no_license
SELECT applied_hour, Enrolled_variance_sqrt, Rejected_variance_sqrt, IDV_variance_sqrt, Auto_variance_sqrt, CASE WHEN (Enrolled_variance_sqrt >= 1.2 AND Rejected_variance_sqrt >= 1.2) OR (Enrolled_variance_sqrt >= 1.2 AND IDV_variance_sqrt >= 1.2) OR (Enrolled_variance_sqrt >= 1.2 AND IDV_variance_sqrt >= 1.2) OR (Enrolled_variance_sqrt >= 1.2 AND Auto_variance_sqrt >= 1.2) OR (Rejected_variance_sqrt >= 1.2 AND IDV_variance_sqrt >= 1.2) OR (Rejected_variance_sqrt >= 1.2 AND Auto_variance_sqrt >= 1.2) OR (IDV_variance_sqrt >= 1.2 AND Auto_variance_sqrt >= 1.2) THEN 'Multiple Onboarding metrics' WHEN Enrolled_variance_sqrt >= 1.2 THEN 'Enrolled Rate' WHEN Rejected_variance_sqrt >= 1.2 THEN 'Rejection Rate' WHEN IDV_variance_sqrt >= 1.2 THEN 'IDV Rate' WHEN Auto_variance_sqrt >= 1.2 THEN 'Auto IDV Rate' ELSE NULL END as alert_value FROM ( SELECT applied_hour, 100*ROUND(SQRT(VARIANCE("Enrolled Rate 24hr Average") OVER(ORDER BY applied_hour ASC ROWS 1 PRECEDING)),3) as Enrolled_variance_sqrt, 100*ROUND(SQRT(VARIANCE("IDV 24hr Average") OVER(ORDER BY applied_hour ASC ROWS 1 PRECEDING)),3) as IDV_variance_sqrt, 100*ROUND(SQRT(VARIANCE("Auto IDV 24hr Average") OVER(ORDER BY applied_hour ASC ROWS 1 PRECEDING)),3) as Auto_variance_sqrt, 100*ROUND(SQRT(VARIANCE("Rejected 24hr Average") OVER(ORDER BY applied_hour ASC ROWS 1 PRECEDING)),3) as Rejected_variance_sqrt FROM ( SELECT *, SUM(auto_enrolled::float) OVER(ORDER BY applied_hour ASC ROWS 23 PRECEDING)/SUM(applicants) OVER(ORDER BY applied_hour ROWS 23 PRECEDING) as "Enrolled Rate 24hr Average", SUM(hit_idv::float) OVER(ORDER BY applied_hour ASC ROWS 23 PRECEDING)/SUM(applicants) OVER(ORDER BY applied_hour ROWS 23 PRECEDING) as "IDV 24hr Average", SUM(hit_auto_idv::float) OVER(ORDER BY applied_hour ASC ROWS 23 PRECEDING)/SUM(applicants) OVER(ORDER BY applied_hour ROWS 23 PRECEDING) as "Auto IDV 24hr Average", SUM(auto_rejected::float) OVER(ORDER BY applied_hour ASC ROWS 23 PRECEDING)/SUM(applicants) OVER(ORDER BY applied_hour ROWS 23 PRECEDING) as "Rejected 24hr Average" FROM ( SELECT date_trunc('hour', convert_timezone('america/los_angeles', audited_at)) as applied_hour, COUNT(DISTINCT CASE WHEN sippy_status = 'ACTIVE' THEN customer_reference END) as auto_enrolled, COUNT(DISTINCT CASE WHEN sippy_status = 'IDV' THEN customer_reference END) as hit_idv, COUNT(DISTINCT CASE WHEN sippy_status = 'AUTO_IDV' THEN customer_reference END) as hit_auto_idv, COUNT(DISTINCT CASE WHEN sippy_status = 'REJECTED' THEN customer_reference END) as auto_rejected, COUNT(DISTINCT customer_reference) as applicants FROM ( SELECT customer_reference, audited_at, sippy_status, RANK() OVER(PARTITION BY customer_reference ORDER BY audited_at ASC) as n FROM analytics.cip_audit_sippy_safe) WHERE audited_at > '2019-10-31' -- Note: Adjust this cutoff as needed. AND audited_at < date_trunc('hour', getdate()) AND n = 1 GROUP BY 1)) ORDER BY 1 DESC) LIMIT 100 ;
true
295331255e0143d21c3e206385692f4c96ced1ad
SQL
Woodu/sg_f
/fox_sv/socialsv/sql/fox_udb/update/create_user_tournament_card_data_1487.sql
UTF-8
18,410
3.078125
3
[]
no_license
CREATE TABLE fox_udb0.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb1.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb2.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb3.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb4.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb5.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb6.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb7.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb8.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) ); CREATE TABLE fox_udb9.user_tournament_card_data ( tournament_card_id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id INTEGER NOT NULL, -- ユーザーID card_id BIGINT NOT NULL DEFAULT 0, -- カードID card_type INTEGER NOT NULL DEFAULT 0, -- カードタイプ base_id INTEGER NOT NULL DEFAULT 0, -- ベースID (カードタイプによって何のベースデータかが変わる) level INTEGER NOT NULL DEFAULT 1, -- レベル skill_lv TINYINT NOT NULL DEFAULT 1, -- スキルレベル exp INTEGER NOT NULL DEFAULT 0, -- 経験値 slot1_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティID slot2_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティID slot3_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティID slot4_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティID slot5_ability_id INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティID slot1_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット1に設定されているアビリティレベル slot2_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット2に設定されているアビリティレベル slot3_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット3に設定されているアビリティレベル slot4_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット4に設定されているアビリティレベル slot5_ability_lv INTEGER NOT NULL DEFAULT 0, -- スロット5に設定されているアビリティレベル update_ts TIMESTAMP NULL DEFAULT NULL, -- 更新 create_ts TIMESTAMP NULL DEFAULT NULL, -- 生成日時 INDEX (user_id, card_id) );
true
070da9677d2bb7a3f7bb05ed853c0dccad22967a
SQL
microsoft/AzureSynapseScriptsAndAccelerators
/Assessment/Scripts/Snowflake/22. Query History.sql
UTF-8
194
2.625
3
[ "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
-- Query for: 22. Query History select * from table(information_schema.query_history( end_time_range_start=>dateadd(d,-6,current_timestamp), end_time_range_end=>current_timestamp));
true
dbdfbbaf5224aaa72dc61f825704e9072d8644ab
SQL
Akash-Macha/ServiceTicketResolutionSystem_SpringBoot
/Database Each Table Scripts/strs_hiber_department.sql
UTF-8
2,097
3.0625
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64) -- -- Host: localhost Database: strs_hiber -- ------------------------------------------------------ -- Server version 8.0.16 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; SET NAMES utf8 ; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!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' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `department` -- DROP TABLE IF EXISTS `department`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `department` ( `code` varchar(15) DEFAULT NULL, `id` int(11) NOT NULL, `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_biw7tevwc07g3iutlbmkes0cm` (`name`), UNIQUE KEY `UK_17kbfc5vur9ube8cks6abbm23` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `department` -- LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; INSERT INTO `department` VALUES ('ICT',7,'ICT'),('FCT_MGT',8,'Facility Management'),('TR_HSPTL',9,'Travel and Hospitality'); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-07-19 17:40:11
true
5b3d7cb3ac3014678e8ee568dfc77a2b9bbe5975
SQL
Igamegum/Utils
/Database/dump.sql
GB18030
3,782
3.5
4
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64) -- -- Host: localhost Database: face_2_3_0 -- ------------------------------------------------------ -- Server version 5.7.17-0ubuntu0.16.04.1 -- -- Table structure for table `face` -- DROP TABLE IF EXISTS `face`; CREATE TABLE `face` ( `userId` varchar(255) NOT NULL COMMENT 'ƽ̨ıʾijuserĹؼֶ(Ȳܳ255)', `faceId` varchar(255) NOT NULL COMMENT 'ϵͳΨһʾface(ڲѯͼƬ洢Ӧ)', `imgId` varchar(255) DEFAULT NULL COMMENT 'faceӦimageid(ڴͼƬݿѯ)', `faceFeature` mediumblob COMMENT 'ȡfeature', `addedFaceSet` text COMMENT 'faceѾfaceset', `personId` varchar(255) DEFAULT NULL COMMENT 'faceӦpersonId', `tag` varchar(255) DEFAULT NULL COMMENT 'ûӵıʾû鿴ʾ', `param` text COMMENT 'ദΪչʱ(ƻʹjson沿)', `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'faceʱ(ʱҪɴ߸)', `updateTime` timestamp NULL DEFAULT NULL COMMENT 'ʱ䣬ϵͳԶ', `isDelete` int(11) DEFAULT '0' COMMENT 'ĬֵΪ0ʾûбɾ1ʾѾ߼ɾ', `landmark` text, `transform_matrix` text, `lastFreeTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `version` varchar(128) DEFAULT '0.0.3.C.20171217', PRIMARY KEY (`faceId`(50)), KEY `index_personId` (`personId`,`userId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `faceset` -- DROP TABLE IF EXISTS `faceset`; CREATE TABLE `faceset` ( `userId` varchar(255) NOT NULL COMMENT 'Ӧôߵıʾ', `facesetId` varchar(255) NOT NULL COMMENT 'faceSetΨһid', `facesetName` varchar(255) NOT NULL DEFAULT '' COMMENT 'facesetnameijappΨһ', `faceidSet` mediumtext, `facefeatureSet` mediumblob COMMENT 'faceidӦfeaturefeatureĶȡ', `tag` varchar(255) DEFAULT NULL COMMENT 'ûԶtag(Ϊ)', `user_param` text COMMENT 'ûԶIJ(ûԱpersonӦеfaceIdϢ)', `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'ʱ', `updateTime` timestamp NULL DEFAULT NULL COMMENT 'µʱ', `isDelete` int(11) DEFAULT '0' COMMENT '߼ɾıʾ,0ʾ߼ݿ⣬1ʾ߼ɾ', PRIMARY KEY (`facesetId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `facesettime` -- DROP TABLE IF EXISTS `facesettime`; CREATE TABLE `facesettime` ( `facesetId` varchar(255) NOT NULL, `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`facesetId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `url` -- DROP TABLE IF EXISTS `url`; CREATE TABLE `url` ( `userId` varchar(255) DEFAULT NULL, `id` varchar(255) NOT NULL COMMENT 'maybe faceid or imgid', `imgurl` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Table structure for table `userid` -- DROP TABLE IF EXISTS `userid`; CREATE TABLE `userid` ( `userId` varchar(255) NOT NULL COMMENT 'ϵͳûΨһʾ', `createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'ûʱ', `updateTime` timestamp NULL DEFAULT NULL COMMENT 'µʱ', `isDelete` int(11) DEFAULT '0' COMMENT '0ʾ߼,1ʾ߼ɾ' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Dump completed on 2018-02-08 10:49:29
true
b58f13ccd1cfc44dcd803ca4ae023bde4cbf753f
SQL
haardikgupta17/Data-Warehousing-for-Business-Intelligence
/Database Management Essentials/Week 3/Week 3 Lesson 5 Examples.sql
UTF-8
600
3.046875
3
[]
no_license
-- Example 1: INSERT INTO Student (StdNo, StdFirstName, StdLastName, StdCity, StdState, StdZip, StdClass, StdMajor, StdGPA) VALUES ('99-99-9999', 'JOE', 'STUDENT', 'SEATAC', 'WA', '98042-1121', 'FR', 'IS', 0.0); SELECT * FROM Student WHERE StdNo = '99-99-9999'; -- Example 2 SET sql_safe_updates = 0; UPDATE Student SET StdMajor = 'ACCT', StdClass = 'SO' WHERE StdFirstName = 'JOE' AND StdLastName = 'STUDENT'; SELECT * FROM Student WHERE StdNo = '99-99-9999'; -- Example 3 DELETE FROM Student WHERE StdFirstName = 'JOE' AND StdLastName = 'STUDENT'; SELECT * FROM Student;
true
3727b70e95139bcab1599a0a3088132cc2692b0d
SQL
desdevol/ezdine
/ezdine.sql
UTF-8
13,169
3.125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 29, 2018 at 08:22 PM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `ezdine` -- -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE `employee` ( `ID` int(4) NOT NULL, `name` varchar(70) NOT NULL, `email` varchar(100) NOT NULL, `ic` varchar(12) NOT NULL, `hpno` varchar(12) NOT NULL, `telno` varchar(10) NOT NULL, `gender` varchar(10) NOT NULL, `race` varchar(10) NOT NULL, `position` varchar(50) NOT NULL, `address` text NOT NULL, `username` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`ID`, `name`, `email`, `ic`, `hpno`, `telno`, `gender`, `race`, `position`, `address`, `username`) VALUES (6, 'John Doe', 'ezdine@gmail.com', '990101016969', '0123456789', '073336969', 'Male', 'Chinese', 'Chef', '69, Jalan Teh Ais\r\n', 'stf0006'), (7, 'Jane Doe', 'ezdine@gmail.com', '870605016969', '012-3456789', '0733336969', 'Female', 'Others', 'Waitress', '123, Kopi Ais, Taman Kacang', 'stf0007'), (9, 'Bobby Ray', 'testing@gmail.com', '870605016969', '012-3456789', '07-3336666', 'Male', 'Chinese', 'Chef', 'Malaysia', 'stf0009'); -- -------------------------------------------------------- -- -- Table structure for table `emp_position` -- CREATE TABLE `emp_position` ( `ID` int(3) NOT NULL, `position` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `emp_position` -- INSERT INTO `emp_position` (`ID`, `position`) VALUES (1, 'Chef'), (2, 'Waiter'), (3, 'Waitress'), (12, 'Cleaner'); -- -------------------------------------------------------- -- -- Table structure for table `inventory` -- CREATE TABLE `inventory` ( `invID` int(10) NOT NULL, `supplierid` int(10) NOT NULL, `itemname` varchar(50) NOT NULL, `measurement` varchar(50) NOT NULL, `price` double NOT NULL, `suppliername` varchar(50) NOT NULL, `quantity` double NOT NULL, `totalprice` double NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `inventory` -- INSERT INTO `inventory` (`invID`, `supplierid`, `itemname`, `measurement`, `price`, `suppliername`, `quantity`, `totalprice`) VALUES (1, 1, 'Vanilla Milk', '250ml', 6, 'Justin Trading', 10, 60); -- -------------------------------------------------------- -- -- Table structure for table `menu` -- CREATE TABLE `menu` ( `foodid` int(20) NOT NULL, `foodname` text NOT NULL, `price` double(11,2) NOT NULL, `foodtype` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `menu` -- INSERT INTO `menu` (`foodid`, `foodname`, `price`, `foodtype`) VALUES (1, 'Eggplant', 1.70, 'Food'), (2, 'Burger', 16.99, 'Food'), (3, 'cola', 1.50, 'Beverage'), (4, 'chicken chop', 25.50, 'Food'), (5, 'Seven Up', 2.00, 'Beverage'), (6, 'Nasi Lemak', 4.50, 'Food'), (7, 'Green Tea', 2.20, 'Beverage'), (8, 'Fried Chicken', 3.50, 'Food'), (9, 'Maggi Soup', 4.50, 'Food'), (10, 'Wa Tan Ho', 6.00, 'Food'), (11, 'Tea Ice', 2.30, 'Beverage'), (12, 'Fried Mee', 4.60, 'Food'), (13, 'Coffee Ice', 2.50, 'Beverage'), (14, 'Sky Juice', 0.50, 'Beverage'), (15, 'Ice Lemon Tea', 2.40, 'Beverage'), (16, 'Spicy Chicken', 4.00, 'Food'), (17, 'Meat Ball Soup', 5.00, 'Food'), (18, 'Popcorn', 3.30, 'Food'), (19, 'Chicken Rice', 5.00, 'Food'), (20, 'Duck Rice', 6.00, 'Food'); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `orderID` int(11) NOT NULL, `tableID` int(11) NOT NULL, `date` varchar(30) NOT NULL, `time` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `payhistory` -- CREATE TABLE `payhistory` ( `payID` int(255) NOT NULL, `tableID` int(10) NOT NULL, `tableNum` int(10) NOT NULL, `date` varchar(255) NOT NULL, `time` varchar(255) NOT NULL, `total` double(50,2) NOT NULL, `payAmt` double(50,2) NOT NULL, `payChange` double(50,2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payhistory` -- INSERT INTO `payhistory` (`payID`, `tableID`, `tableNum`, `date`, `time`, `total`, `payAmt`, `payChange`) VALUES (1, 1, 11, '2018/11/27', '08:02:24', 16.99, 17.00, 0.01), (2, 1, 11, '2018/11/28', '15:39:41', 19.49, 20.00, 0.51), (3, 1, 11, '2018/11/28', '15:50:00', 5.90, 6.00, 0.10), (4, 2, 12, '2018/11/28', '16:08:36', 8.30, 10.00, 1.70), (5, 3, 12, '2018/11/28', '16:11:59', 9.10, 10.00, 0.90), (6, 3, 12, '2018/11/28', '16:22:54', 6.70, 8.00, 1.30), (7, 1, 11, '2018/11/30', '02:57:42', 12.90, 15.00, 2.10), (8, 1, 11, '2018/11/30', '03:09:25', 24.50, 25.00, 0.50), (9, 2, 12, '2018/11/30', '03:10:35', 31.00, 31.00, 0.00), (10, 3, 13, '2018/11/30', '03:11:09', 14.70, 20.00, 5.30), (11, 3, 13, '2018/11/30', '03:16:59', 108.00, 120.00, 12.00), (12, 1, 11, '2018/11/30', '03:21:07', 19.49, 20.00, 0.51); -- -------------------------------------------------------- -- -- Table structure for table `payment` -- CREATE TABLE `payment` ( `id` int(255) NOT NULL, `payID` int(255) NOT NULL, `foodid` int(255) NOT NULL, `foodname` varchar(255) NOT NULL, `price` double(50,2) NOT NULL, `quantity` int(100) NOT NULL, `date` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payment` -- INSERT INTO `payment` (`id`, `payID`, `foodid`, `foodname`, `price`, `quantity`, `date`) VALUES (1, 1, 2, 'Burger', 16.99, 1, '2018/11/27'), (2, 2, 2, 'Burger', 16.99, 1, '2018/11/28'), (3, 2, 13, 'Coffee Ice', 2.50, 1, '2018/11/28'), (4, 3, 8, 'Fried Chicken', 3.50, 1, '2018/11/28'), (5, 3, 15, 'Ice Lemon Tea', 2.40, 1, '2018/11/28'), (6, 4, 10, 'Wa Tan Ho', 6.00, 1, '2018/11/28'), (7, 4, 11, 'Tea Ice', 2.30, 1, '2018/11/28'), (8, 5, 12, 'Fried Mee', 4.60, 1, '2018/11/28'), (9, 5, 9, 'Maggi Soup', 4.50, 1, '2018/11/28'), (10, 6, 1, 'Eggplant', 1.70, 1, '2018/11/28'), (11, 6, 17, 'Meat Ball Soup', 5.00, 1, '2018/11/28'), (12, 7, 8, 'Fried Chicken', 3.50, 1, '2018/11/30'), (13, 7, 15, 'Ice Lemon Tea', 2.40, 1, '2018/11/30'), (14, 7, 6, 'Nasi Lemak', 4.50, 1, '2018/11/30'), (15, 7, 14, 'Sky Juice', 2.50, 5, '2018/11/30'), (16, 8, 12, 'Fried Mee', 4.60, 1, '2018/11/30'), (17, 8, 8, 'Fried Chicken', 17.50, 5, '2018/11/30'), (18, 8, 15, 'Ice Lemon Tea', 2.40, 1, '2018/11/30'), (19, 9, 1, 'Eggplant', 6.80, 4, '2018/11/30'), (20, 9, 7, 'Green Tea', 2.20, 1, '2018/11/30'), (21, 9, 17, 'Meat Ball Soup', 20.00, 4, '2018/11/30'), (22, 9, 5, 'Seven Up', 2.00, 1, '2018/11/30'), (23, 10, 1, 'Eggplant', 1.70, 1, '2018/11/30'), (24, 10, 14, 'Sky Juice', 1.00, 2, '2018/11/30'), (25, 10, 10, 'Wa Tan Ho', 12.00, 2, '2018/11/30'), (26, 11, 4, 'chicken chop', 102.00, 4, '2018/11/30'), (27, 11, 3, 'cola', 6.00, 4, '2018/11/30'), (28, 12, 2, 'Burger', 16.99, 1, '2018/11/30'), (29, 12, 13, 'Coffee Ice', 2.50, 1, '2018/11/30'); -- -------------------------------------------------------- -- -- Table structure for table `supplier` -- CREATE TABLE `supplier` ( `supplierid` int(10) NOT NULL, `itemname` varchar(50) NOT NULL, `measurement` varchar(20) NOT NULL, `price` double NOT NULL, `suppliername` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `supplier` -- INSERT INTO `supplier` (`supplierid`, `itemname`, `measurement`, `price`, `suppliername`) VALUES (1, 'Vanilla Milk', '250ml', 6, 'Justin Trading'); -- -------------------------------------------------------- -- -- Table structure for table `table1_order` -- CREATE TABLE `table1_order` ( `id` int(30) NOT NULL, `foodid` int(30) NOT NULL, `foodname` varchar(100) NOT NULL, `price` double(20,2) NOT NULL, `quantity` int(10) NOT NULL, `date` varchar(50) NOT NULL, `time` varchar(50) NOT NULL, `status` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `table2_order` -- CREATE TABLE `table2_order` ( `id` int(30) NOT NULL, `foodid` int(30) NOT NULL, `foodname` varchar(100) NOT NULL, `price` double(20,2) NOT NULL, `quantity` int(10) NOT NULL, `date` varchar(50) NOT NULL, `time` varchar(50) NOT NULL, `status` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `table3_order` -- CREATE TABLE `table3_order` ( `id` int(30) NOT NULL, `foodid` int(30) NOT NULL, `foodname` varchar(100) NOT NULL, `price` double(20,2) NOT NULL, `quantity` int(10) NOT NULL, `date` varchar(50) NOT NULL, `time` varchar(50) NOT NULL, `status` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `tablemng` -- CREATE TABLE `tablemng` ( `tableID` int(5) NOT NULL, `tableNum` int(5) NOT NULL, `status` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tablemng` -- INSERT INTO `tablemng` (`tableID`, `tableNum`, `status`) VALUES (1, 11, 0), (2, 12, 0), (3, 13, 0); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `username` varchar(20) NOT NULL, `password` varchar(255) NOT NULL, `type` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`username`, `password`, `type`) VALUES ('ezdine', '$2y$10$.1t1KVK40hklbuEa1AHcfe6kiz5fnNP7gBXxJ/ou6LMm7ZxJCNlBO', 'admin'), ('stf0006', '$2y$10$KL7qoWuXMTIwNXC86VlroOmWmUdQaFManDQ9CW2MjN9UMJPoHhvCK', 'chef'), ('stf0007', '$2y$10$SvWHryb453wl94XsnlG.Nu7HGRv/TbpeImcmfyF38S7KZ2.RCf0bi', 'employee'), ('stf0009', '$2y$10$Zvf0dkvSN9YMDsBi9ifNUeonFLLdzcJh96UeqY1jfmm.Vjdutqc82', 'chef'); -- -- Indexes for dumped tables -- -- -- Indexes for table `employee` -- ALTER TABLE `employee` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `emp_position` -- ALTER TABLE `emp_position` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `inventory` -- ALTER TABLE `inventory` ADD PRIMARY KEY (`invID`); -- -- Indexes for table `menu` -- ALTER TABLE `menu` ADD PRIMARY KEY (`foodid`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`orderID`); -- -- Indexes for table `payhistory` -- ALTER TABLE `payhistory` ADD PRIMARY KEY (`payID`); -- -- Indexes for table `payment` -- ALTER TABLE `payment` ADD PRIMARY KEY (`id`); -- -- Indexes for table `supplier` -- ALTER TABLE `supplier` ADD PRIMARY KEY (`supplierid`); -- -- Indexes for table `table1_order` -- ALTER TABLE `table1_order` ADD PRIMARY KEY (`id`); -- -- Indexes for table `table2_order` -- ALTER TABLE `table2_order` ADD PRIMARY KEY (`id`); -- -- Indexes for table `table3_order` -- ALTER TABLE `table3_order` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tablemng` -- ALTER TABLE `tablemng` ADD PRIMARY KEY (`tableID`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`username`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `employee` -- ALTER TABLE `employee` MODIFY `ID` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `emp_position` -- ALTER TABLE `emp_position` MODIFY `ID` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `inventory` -- ALTER TABLE `inventory` MODIFY `invID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `orderID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; -- -- AUTO_INCREMENT for table `payhistory` -- ALTER TABLE `payhistory` MODIFY `payID` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `payment` -- ALTER TABLE `payment` MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30; -- -- AUTO_INCREMENT for table `supplier` -- ALTER TABLE `supplier` MODIFY `supplierid` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `table1_order` -- ALTER TABLE `table1_order` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55; -- -- AUTO_INCREMENT for table `table2_order` -- ALTER TABLE `table2_order` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `table3_order` -- ALTER TABLE `table3_order` MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
3853d3586d66d76903409ce87e6261af48026343
SQL
silentbalanceyh/vertx-zero
/vertx-pin/zero-tpl/src/main/resources/plugin/sql/tpl/TPL_TICKET.sql
UTF-8
2,244
3.765625
4
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
-- liquibase formatted sql -- changeset Lang:tpl-ticket-1 -- 模板表:TPL_TICKET DROP TABLE IF EXISTS TPL_TICKET; CREATE TABLE IF NOT EXISTS TPL_TICKET ( `KEY` VARCHAR(36) NOT NULL COMMENT '「key」- 增量记录ID', `CODE` VARCHAR(50) NOT NULL COMMENT '「code」- 编码', `NAME` VARCHAR(50) DEFAULT NULL COMMENT '「name」- 名称', `DESCRIPTION` VARCHAR(255) DEFAULT NULL COMMENT '「description」- 描述', `TYPE` VARCHAR(36) DEFAULT NULL COMMENT '「type」- 分类', `STATUS` VARCHAR(36) DEFAULT NULL COMMENT '「status」- 状态', `SYSTEM` BIT(1) DEFAULT NULL COMMENT '「system」- 是否属于系统模板', -- Model `MODEL_ID` VARCHAR(255) DEFAULT NULL COMMENT '「modelId」- 关联的模型identifier,用于描述', `MODEL_KEY` VARCHAR(36) DEFAULT NULL COMMENT '「modelKey」- 关联的模型记录ID,用于描述哪一个Model中的记录', `MODEL_CATEGORY` VARCHAR(36) DEFAULT NULL COMMENT '「modelCategory」- 模型分类', -- Record of Data `RECORD_JSON` LONGTEXT COMMENT '「recordJson」- 上一次的记录内容(Json格式)', `RECORD_COMPONENT` VARCHAR(255) COMMENT '「recordComponent」- 处理记录的组件', -- Ui Config `UI_CONFIG` LONGTEXT COMMENT '「uiConfig」- UI的配置(Json格式)', `UI_COMPONENT` VARCHAR(255) COMMENT '「uiComponent」- 处理UI的组件', -- 特殊字段 `SIGMA` VARCHAR(32) COMMENT '「sigma」- 统一标识', `LANGUAGE` VARCHAR(10) COMMENT '「language」- 使用的语言', `ACTIVE` BIT COMMENT '「active」- 是否启用', `METADATA` TEXT COMMENT '「metadata」- 附加配置数据', -- Auditor字段 `CREATED_AT` DATETIME COMMENT '「createdAt」- 创建时间', `CREATED_BY` VARCHAR(36) COMMENT '「createdBy」- 创建人', `UPDATED_AT` DATETIME COMMENT '「updatedAt」- 更新时间', `UPDATED_BY` VARCHAR(36) COMMENT '「updatedBy」- 更新人', PRIMARY KEY (`KEY`) ); -- changeset Lang:tpl-ticket-2 ALTER TABLE TPL_TICKET ADD UNIQUE (`CODE`, `SIGMA`);
true
28d860ccbab6780fb22682cd050845ea10b3dc29
SQL
mgmilton/learn_sql_hard_way
/code_ex1_ex14/code.sql
UTF-8
1,344
3.765625
4
[]
no_license
DROP TABLE IF EXISTS person; DROP TABLE IF EXISTS pet; DROP TABLE IF EXISTS person_pet; CREATE TABLE person ( id INTEGER PRIMARY KEY, first_name TEXT, last_name TEXT, age INTEGER ); CREATE TABLE pet ( id INTEGER PRIMARY KEY, name TEXT, breed TEXT, age INTEGER, dead INTEGER ); CREATE TABLE person_pet ( person_id INTEGER, pet_id INTEGER ); INSERT INTO person (id, first_name, last_name, age) VALUES (0, 'Zed', 'Shaw', 37); INSERT INTO pet (id, name, breed, age, dead) VALUES (0, 'Fluffy', 'Unicorn', 1000, 0); INSERT INTO pet VALUES (1, 'Gigantor', 'Robot', 1, 1); INSERT INTO person VALUES (1, 'Matt', 'Milton', 27); INSERT INTO person VALUES (2, 'Kurt', 'Godel', 33); INSERT INTO pet VALUES (2, 'Roscoe', 'Australian Shepperd', 4, 0); INSERT INTO pet VALUES (3, 'Bertrand', 'Philosopher', 97, 0); INSERT INTO person_pet (person_id, pet_id) VALUES (0, 0); INSERT INTO person_pet VALUES (0, 1); INSERT INTO person_pet VALUES (1, 2); INSERT INTO person_pet VALUES (2, 3); /* make sure there's dead pets */ SELECT name, age FROM pet WHERE dead = 1; /* delete the dead robot pet */ DELETE FROM pet WHERE dead = 1; /*make sure the robot is gone */ SELECT * FROM pet; /* let's ressurect the robot */ INSERT INTO pet VALUES (1, 'Gigantor', 'Robot', 1, 0); /* the robot LIVES! */ SELECT * FROM pet;
true
7de5dd7c65ee1cc92e8566a68296e1d9085d013a
SQL
harsh-a1/amr_analytics
/amr_sample_organism_count.sql
UTF-8
2,335
4.03125
4
[]
no_license
 select de_aggid as deid, organism.sourceid, organism.startdate, organism.enddate, p.periodid, categoryoptioncomboid, count(organism.value) as value from ( select psi.programstageinstanceid, to_char(executiondate, 'yyyy-mm-01')::date as startdate, (date_trunc('month',executiondate)+interval '1 month' - interval '1 day')::date as enddate, psi.organisationunitid as sourceid, de.dataelementid as de_organismid, tedv.value, deAgg.dataelementid as de_aggid, max(deAgg.name) as de_aggname from programstageinstance psi inner join trackedentitydatavalue tedv on tedv.programstageinstanceid = psi.programstageinstanceid inner join dataelement de on tedv.dataelementid = de.dataelementid inner join dataelement deAgg on tedv.value = deAgg.code where de.code = 'organism' and tedv.value != '' group by psi.programstageinstanceid,de.dataelementid, de.code,psi.organisationunitid,tedv.value,deAgg.dataelementid,executiondate )organism inner join ( select psi.programstageinstanceid, psi.organisationunitid as sourceid, de.dataelementid as de_organismid, tedv.value, deco.categoryoptionid as decoid, deco.uid as decouid, max(deco.name) as deconame, coc.categoryoptioncomboid from programstageinstance psi inner join trackedentitydatavalue tedv on tedv.programstageinstanceid = psi.programstageinstanceid inner join dataelement de on tedv.dataelementid = de.dataelementid inner join dataelementcategoryoption deco on deco.code = tedv.value inner join categoryoptioncombos_categoryoptions coc_co on coc_co.categoryoptionid = deco.categoryoptionid inner join categorycombos_optioncombos cc_coc on cc_coc.categoryoptioncomboid = coc_co.categoryoptioncomboid inner join categoryoptioncombo coc on coc.categoryoptioncomboid = cc_coc.categoryoptioncomboid where de.uid = 'mp5MeJ2dFQz' and tedv.value != '' and cc_coc.categorycomboid = 102161 group by psi.programstageinstanceid,de.dataelementid,de.code, psi.organisationunitid,tedv.value,deco.categoryoptionid, coc.categoryoptioncomboid,coc.uid,deco.uid )sample on organism.programstageinstanceid = sample.programstageinstanceid left join period p on p.startdate = organism.startdate and p.enddate = organism.enddate group by de_aggid,organism.sourceid,organism.startdate,organism.enddate,categoryoptioncomboid,p.periodid order by deid
true
0ae44017fd399df4c3b8056f9715479f4a7b2c7e
SQL
delasalle-sio-olivon/PortailFull
/script/portail.sql
UTF-8
13,122
2.890625
3
[ "MIT" ]
permissive
-- -- Base de données : portail -- -- -------------------------------------------------------- -- -- Structure de la table categories -- CREATE TABLE categories ( id serial NOT NULL, unix varchar(255) NOT NULL, titre varchar(255) NOT NULL, resume varchar(255) NOT NULL, detail varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ; -- -- Contenu de la table categories -- INSERT INTO categories (id, unix, titre, resume, detail, created_at, updated_at) VALUES (2, 'firstoffirst', 'Racine du portail', 'Cette catégorie est le conteneur parent, le portail n''affiche que ses enfants.', '', '2016-10-27 11:00:51', '2016-11-17 08:59:05'), (84, 'qualite_et_securite_du_code_source', 'Qualité et Sécurité du code source', 'Qualité et Sécurité du code source', 'Qualité et Sécurité du code source', '2016-11-18 12:54:40', '2016-11-18 12:54:40'), (82, 'IPDD', 'Installation, Packaging, Diffusion et Distribution', 'Installation, Packaging, Diffusion et Distribution', 'Installation, Packaging, Diffusion et Distribution', '2016-11-18 12:52:51', '2016-11-18 12:52:51'), (79, 'ide', 'IDE', 'ide', 'ide', '2016-11-18 12:50:30', '2016-11-18 12:50:30'), (80, 'gestion_des_anomalies', 'Gestion des anomalies', 'Gestion des anomalies', 'Gestion des anomalies', '2016-11-18 12:51:10', '2016-11-18 12:51:10'), (81, 'gestion_du_code_source', 'Gestion du code source', 'Gestion du code source', 'Gestion du code source', '2016-11-18 12:51:40', '2016-11-18 12:51:40'), (85, 'test_integration', 'Test et Intégration', 'Test et Intégration', 'Test et Intégration', '2016-11-18 13:12:16', '2016-11-21 10:05:12'), (83, 'analyse_modelisation_patrimoine', 'Outils d''analyse, de Modélisation et de gestion de Patrimoine', 'Outils d''analyse, de Modélisation et de gestion de Patrimoine', 'Outils d''analyse, de Modélisation\net de gestion de Patrimoine', '2016-11-18 12:53:43', '2016-11-21 08:51:24'), (65, 'catalogue_des_composants', 'Catalogue des composants', 'Catalogue des composants', 'Catalogue des composants', '2016-11-18 12:10:19', '2016-11-18 13:12:56'), (86, 'outil_collaboratif', 'Outil Collaboratif', 'Outil Collaboratif', 'Outil Collaboratif', '2016-11-18 13:13:36', '2016-11-18 13:13:36'), (87, 'bd_relationnelles', 'BD Relationnelles', 'BD Relationnelles', 'BD Relationnelles', '2016-11-18 13:16:05', '2016-11-18 13:16:05'), (88, 'bd_non_relationnelles', 'Gestionnaire de données non relationnelles', 'Gestionnaire de données non relationnelles', 'Gestionnaire de données\nnon relationnelles', '2016-11-18 13:18:10', '2016-11-18 13:18:10'), (89, 'portail_decisionnel', 'Portail décisionnel', 'Portail décisionnel', 'Portail décisionnel', '2016-11-18 13:22:38', '2016-11-18 13:22:38'), (90, 'moteur_de_recherche', 'Moteur de recherche', 'Moteur de recherche', 'Moteur de recherche', '2016-11-18 13:33:11', '2016-11-18 13:33:11'), (91, 'authentification', 'Authentification', 'Authentification', 'Authentification', '2016-11-18 13:34:20', '2016-11-18 13:34:20'); -- -------------------------------------------------------- -- -- Structure de la table 'categories_parents' -- CREATE TABLE categories_parents ( idParent serial NOT NULL, idEnfant int4 NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ; -- -- Contenu de la table 'categories_parents' -- INSERT INTO categories_parents (idParent, idEnfant, created_at, updated_at) VALUES (65, 81, NULL, NULL), (65, 83, NULL, NULL), (65, 80, NULL, NULL), (65, 79, NULL, NULL), (65, 82, NULL, NULL), (65, 84, NULL, NULL), (2, 65, NULL, NULL), (65, 85, NULL, NULL), (65, 86, NULL, NULL), (65, 87, NULL, NULL), (65, 88, NULL, NULL), (65, 89, NULL, NULL), (65, 90, NULL, NULL), (65, 91, NULL, NULL); -- -------------------------------------------------------- -- -- Structure de la table 'informations' -- CREATE TABLE informations ( id serial NOT NULL, unix varchar(255) NOT NULL, titre varchar(255) NOT NULL, resume varchar(255) NOT NULL, detail varchar(255) NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ; -- -- Contenu de la table informations -- INSERT INTO informations (id, unix, titre, resume, detail, created_at, updated_at) VALUES (41, 'maven', 'Maven', 'Outil de gestion des dépendances entre les différents composants d''un projet et cycle de vie', 'Outil de gestion des dépendances entre les différents composants d''un projet et cycle de vie', '2016-11-18 13:43:14', '2016-11-18 13:43:14'), (40, 'nexus', 'Nexus', 'Dépôt d''artefacts', 'Dépôt d''artefacts', '2016-11-18 13:43:14', '2016-11-18 13:43:14'), (39, 'git', 'GIT', 'Outil de gestion des configurations (serveur)', 'Outil de gestion des configurations (serveur)', '2016-11-18 13:41:30', '2016-11-25 12:22:19'), (37, 'mantis_bt', 'Mantis BT', 'Outil de remontée de bug', 'Outil de remontée de bug', '2016-11-18 13:39:52', '2016-11-18 13:39:52'), (38, 'svn', 'SVN', 'Outil de gestion des configurations (serveur)', 'Outil de gestion des configurations (serveur)', '2016-11-18 13:41:30', '2016-11-25 12:22:19'), (36, 'eclipse', 'Eclipse', 'Environnement de développement', 'Environnement de développement', '2016-11-18 13:39:11', '2016-11-18 13:39:11'), (35, 'acceleo', 'Acceleo', 'Outil et/ou plugin de génération de tout ou partie du code', 'Outil et/ou plugin de génération de tout ou partie du code', '2016-11-18 13:38:05', '2016-11-18 13:38:05'), (42, 'pencil', 'Pencil', 'Outil de maquettage IHM', 'Outil de maquettage IHM', '2016-11-18 13:44:19', '2016-11-18 13:44:19'), (43, 'sonar_qube', 'SonarQube', 'Tableau de bord d''indicateurs de qualité', 'Tableau de bord d''indicateurs de qualité', '2016-11-18 13:46:00', '2016-11-18 13:46:00'), (44, 'findbugs', 'FINDBUGS', 'Outil de détection de mauvaises pratiques ', 'Outil de détection de mauvaises pratiques ', '2016-11-18 13:47:35', '2016-11-18 13:47:35'), (45, 'checkstyle', 'CHECKSTYLE', 'Outil de détection de mauvaises pratiques', 'Outil de détection de mauvaises pratiques', '2016-11-18 13:50:42', '2016-11-18 13:50:42'), (46, 'pmd', 'PMD', 'Outil de détection de mauvaises pratiques', 'Outil de détection de mauvaises pratiques', '2016-11-18 13:51:49', '2016-11-18 13:51:49'), (61, 'jenkins', 'JENKINS', 'Outil d''aide à la livraison (dépôt, intégration continue, ...)', 'Outil d''aide à la livraison (dépôt, intégration continue, ...)', '2016-11-18 15:01:37', '2016-11-18 15:01:37'), (48, 'cobertura', 'Cobertura', 'Couverture de code', 'Couverture de code', '2016-11-18 13:54:56', '2016-11-18 13:54:56'), (49, 'junit', 'Junit', 'Outil de gestion des tests unitaires', 'Outil de gestion des tests unitaires', '2016-11-18 13:55:30', '2016-11-18 13:55:30'), (50, 'fitnesse', 'Fitnesse', 'Outil d''injection afin de tester les couches basses', 'Outil d''injection afin de tester les couches basses', '2016-11-18 13:56:06', '2016-11-18 13:56:06'), (58, 'jacoco', 'Jacoco', 'Couverture de code', 'Couverture de code', '2016-11-18 14:58:46', '2016-11-18 14:58:46'), (59, 'jmeter', 'JMeter', 'Robots de test / Injecteurs', 'Robots de test / Injecteurs', '2016-11-18 14:59:36', '2016-11-18 14:59:36'), (60, 'soap_ui', 'SOAP UI', 'Outil d''aide aux tests techniques (web service)', 'Outil d''aide aux tests techniques (web service)', '2016-11-18 15:01:08', '2016-11-18 15:01:08'), (62, 'selenium', 'Selenium', 'Automatisation des tests Web', 'Automatisation des tests Web', '2016-11-18 15:02:11', '2016-11-18 15:02:11'), (63, 'testlink', 'TestLink', 'Gestion des campagnes de tests', 'Gestion des campagnes de tests', '2016-11-18 15:02:40', '2016-11-18 15:02:40'), (64, 'squash_tm', 'Squash TM', 'Gestion des campagnes de tests', 'Gestion des campagnes de tests', '2016-11-18 15:03:21', '2016-11-18 15:03:21'), (65, 'jailer', 'Jailer', 'Génération / Gestion des jeux de données', 'Génération / Gestion des jeux de données', '2016-11-18 15:03:57', '2016-11-18 15:03:57'), (66, 'h2', 'H2', 'Base de données', 'Base de données', '2016-11-18 15:04:42', '2016-11-18 15:04:42'), (67, 'talend', 'Talend OpenStudio (for data integration)', 'Reprise de données', 'Reprise de données', '2016-11-18 15:06:42', '2016-11-21 09:01:57'), (68, 'javamelody', 'JavaMelody', 'Outil de monitoring', 'Outil de monitoring', '2016-11-18 15:06:42', '2016-11-18 15:06:42'), (69, 'redmine', 'Redmine', 'Portail de gestion de projet', 'Portail de gestion de projet ', '2016-11-18 15:07:37', '2016-11-18 15:07:37'), (70, 'fusionforge', 'FusionForge', 'Forge de développement', 'Forge de développement', '2016-11-18 15:08:27', '2016-11-18 15:08:27'), (71, 'mediawiki', 'Mediawiki', 'Outil pour améliorer la collaboration entre les différentes parties prenantes', 'Outil pour améliorer la collaboration entre les différentes parties prenantes', '2016-11-18 15:08:51', '2016-11-18 15:08:51'), (72, 'phpbb', 'PhpBB', 'Forum', 'Forum', '2016-11-18 15:09:36', '2016-11-18 15:09:36'), (73, 'postgresql', 'PostgreSQL', 'Base de données transactionnelle', 'Base de données transactionnelle', '2016-11-18 15:11:17', '2016-11-18 15:11:17'), (74, 'db2', 'DB2', 'Base de données transactionnelle', 'Base de données transactionnelle', '2016-11-18 15:12:46', '2016-11-18 15:12:46'), (75, 'maria_db', 'Maria DB', 'Base transactionnelle cluster ', 'Base transactionnelle cluster ', '2016-11-18 15:14:05', '2016-11-18 15:14:05'), (76, 'postgis', 'PostGIS', 'Base de données Géomatique', 'Base de données Géomatique', '2016-11-18 15:15:04', '2016-11-18 15:15:04'), (77, 'mongodb', 'MongoDB', 'Base de données NoSQL', 'Base de données NoSQL', '2016-11-18 15:15:47', '2016-11-18 15:15:47'), (78, 'casandra', 'Casandra', 'Base de données NoSQL', 'Base de données NoSQL', '2016-11-18 15:16:17', '2016-11-18 15:16:17'), (79, 'pentaho', 'Pentaho', 'Portail décisionnel', 'Portail décisionnel', '2016-11-18 15:17:07', '2016-11-18 15:17:07'), (80, 'elasticsearch', 'ElasticSearch', 'Indexation et recherche plein texte', 'Indexation et recherche plein texte', '2016-11-18 15:17:53', '2016-11-18 15:17:53'), (81, 'apache_solr', 'Apache SolR', 'Indexation et recherche plein texte', 'Indexation et recherche plein texte', '2016-11-18 15:18:40', '2016-11-18 15:18:40'), (82, 'openldap', 'OpenLdap', 'Annuaire', 'Annuaire', '2016-11-18 15:19:12', '2016-11-18 15:19:12'), (83, 'lemonldap', 'LemonLdap', 'SSO', 'SSO', '2016-11-18 15:19:48', '2016-11-18 15:19:48'); -- -------------------------------------------------------- -- -- Structure de la table 'informations_parents' -- CREATE TABLE informations_parents ( idParent int4 NOT NULL, idEnfant int4 NOT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL ) ; -- -- Contenu de la table informations_parents -- INSERT INTO informations_parents (idParent, idEnfant, created_at, updated_at) VALUES (85, 61, NULL, NULL), (81, 39, NULL, NULL), (82, 41, NULL, NULL), (82, 40, NULL, NULL), (79, 35, NULL, NULL), (80, 37, NULL, NULL), (79, 36, NULL, NULL), (81, 38, NULL, NULL), (83, 42, NULL, NULL), (84, 43, NULL, NULL), (84, 44, NULL, NULL), (84, 45, NULL, NULL), (84, 46, NULL, NULL), (84, 48, NULL, NULL), (85, 49, NULL, NULL), (85, 50, NULL, NULL), (85, 58, NULL, NULL), (85, 59, NULL, NULL), (85, 60, NULL, NULL), (85, 62, NULL, NULL), (85, 63, NULL, NULL), (85, 64, NULL, NULL), (85, 65, NULL, NULL), (85, 66, NULL, NULL), (85, 67, NULL, NULL), (85, 68, NULL, NULL), (86, 69, NULL, NULL), (86, 70, NULL, NULL), (86, 71, NULL, NULL), (86, 72, NULL, NULL), (87, 73, NULL, NULL), (87, 74, NULL, NULL), (87, 75, NULL, NULL), (87, 76, NULL, NULL), (88, 77, NULL, NULL), (88, 78, NULL, NULL), (89, 79, NULL, NULL), (90, 80, NULL, NULL), (90, 81, NULL, NULL), (91, 82, NULL, NULL), (91, 83, NULL, NULL); -- -------------------------------------------------------- -- -- Structure de la table migrations -- CREATE TABLE migrations ( migration varchar(255) NOT NULL, batch int4 NOT NULL ) ; -- -- Contenu de la table migrations -- INSERT INTO migrations (migration, batch) VALUES ('2016_10_27_083901_create_categories_table', 1), ('2016_10_27_084123_create_informations_table', 2), ('2016_10_27_095453_create_categories_parents_table', 3), ('2016_10_27_100105_create_informations_parents_table', 4); -- -- Index pour les tables exportées -- -- -- Index pour la table 'categories' -- ALTER TABLE categories ADD PRIMARY KEY (id), ADD UNIQUE (unix); -- -- Index pour la table categories_parents -- ALTER TABLE categories_parents ADD PRIMARY KEY (idParent,idEnfant); ADD CONSTRAINT fk_cats_enfant FOREIGN KEY (idEnfant) REFERENCES categories (id), ADD CONSTRAINT fk_cats_parent FOREIGN KEY (idParent) REFERENCES categories (id); -- -- Index pour la table informations -- ALTER TABLE informations ADD PRIMARY KEY (id), ADD UNIQUE (unix); -- -- Index pour la table informations_parents -- ALTER TABLE informations_parents ADD PRIMARY KEY (idParent,idEnfant), ADD CONSTRAINT fk_info_enfant FOREIGN KEY (idEnfant) REFERENCES informations (id), ADD CONSTRAINT fk_info_parent FOREIGN KEY (idParent) REFERENCES categories (id);
true
75447f9315b20c0a980edb21bc017849b0860fe7
SQL
schraj/ActionApp
/Database/MySql/TestData.sql
UTF-8
2,006
3.25
3
[]
no_license
delete from `actionapp`.`issue` where ID <= 3; delete from `actionapp`.`actionitem` where ID=1; INSERT INTO `actionapp`.`channel` ( `ChannelName`, `ChannelDescription`) VALUES ('test channel', 'test c desc'); INSERT INTO `actionapp`.`issue` ( `Channel_ID`, `IssueName`, `IssueDescription`) VALUES (1,'Appointment of Scott Pruitt to head the EPA', 'Scott Pruitt was the Attorney General of Oklahoma and had an abysmal record. He wanted to destroy the EPA and he worked for the interests of the oil companies. The Sierra Cliub said that putting him in charge of the EPA is like "putting an arsonist in charge of the fire department"'), (1,'Appointment of Jeff Sessions to head the DOJ', 'Jeff Sessions has a long history of working against civil rights from his time as AG of Alabama to his time in the Senate. He was denied a seat on XXX in the 80s due to racist statements. Coretta Scott King stated that "Jeff Sessions is unfit for any office."'); INSERT INTO `actionapp`.`actionitem` ( `Issue_ID`, `ActionItemName`, `ActionItemStartDate`, `ActionItemEndDate`, `ActionItemType`, `ActionItemDescription`) VALUES (38,'Call Your Federal Officials about Scott Pruitt', '2017-3-1', '2017-4-1', 1, 'Call your officials about this'), (38,'Thank Senator Cantwell for her opposition to Scott Pruitt', '2017-3-1', '2017-4-1', 1, 'test d'), (39,'Call Your Federal Officials about Jeff Sessions', '2017-3-1', '2017-4-1', 1, 'test d'); INSERT INTO `actionapp`.`resource` ( `ResourceName`, `ResourceDescription`, `Url`) VALUES ( 'test resource', 'test r desc', 'url test' ); INSERT INTO `actionapp`.`resource_official` ( `Resource_ID`, `Official_ID`) VALUES ( '1', '2' ); INSERT INTO `actionapp`.`actionitem_official` ( `ActionItem_ID`, `Official_ID`) VALUES ('2','2'), ('2','217'), ('4','2'), ('4','217'), ('3','2'); INSERT INTO `actionapp`.`appuser` (`FirstName`, `LastName`, `Email`, `Address1`, `Address2`, `ZipCode`, `City`, `State`, `Gender`, `Points` ) VALUES ('Jeremy','Schrader', 'schraj@gmail.com', '8125 Ellison Loop NW', '','98502', 'Olympia', 'WA', 1, 0);
true
993798c7c6f9e607a7ac8613e5373c361ab74f3f
SQL
SocialGouv/emjpm
/packages/hasura/migrations/default/1620203322354_replace_tgrm_search_functions_by_unaccented/up.sql
UTF-8
5,073
3.125
3
[ "Apache-2.0" ]
permissive
CREATE OR REPLACE FUNCTION public.search_lb_users(search text) RETURNS SETOF lb_users LANGUAGE sql STABLE AS $function$ SELECT * FROM lb_users WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', siret, nom, prenom, code_postal, ville, adresse1, adresse2, email)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', siret, nom, prenom, code_postal, ville, adresse1, adresse2, email))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_etablissements(search text) RETURNS SETOF etablissements LANGUAGE sql STABLE AS $function$ SELECT * FROM etablissements WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', nofinesset, rslongue, complrs, compldistrib, voie, ligneacheminement)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', nofinesset, rslongue, complrs, compldistrib, voie, ligneacheminement))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_etablissements(search text) RETURNS SETOF etablissements LANGUAGE sql STABLE AS $function$ SELECT * FROM etablissements WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', nofinesset, rslongue, complrs, compldistrib, voie, ligneacheminement)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', nofinesset, rslongue, complrs, compldistrib, voie, ligneacheminement))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_mandataires(search text) RETURNS SETOF mandataires LANGUAGE sql STABLE AS $function$ SELECT * FROM mandataires WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', adresse, code_postal, ville, telephone, telephone_portable, competences, siret)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', adresse, code_postal, ville, telephone, telephone_portable, competences, siret))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_mesures(search text) RETURNS SETOF mesures LANGUAGE sql STABLE AS $function$ SELECT * FROM mesures WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', code_postal, ville, annee_naissance, numero_dossier, numero_rg)) ORDER BY CASE WHEN(search = numero_rg) THEN 0 ELSE 1 END DESC, CASE WHEN(search LIKE numero_rg) THEN 0 ELSE 1 END DESC, similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', code_postal, ville, annee_naissance, numero_dossier, numero_rg))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_services(search text) RETURNS SETOF services LANGUAGE sql STABLE AS $function$ SELECT * FROM services WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', etablissement, siret, code_postal, ville, adresse, nom, prenom, email, id)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', etablissement, siret, code_postal, ville, adresse, nom, prenom, email, id))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_tis(search text) RETURNS SETOF tis LANGUAGE sql STABLE AS $function$ SELECT * FROM tis WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', etablissement, siret, code_postal, ville, adresse, email, departement_code)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', etablissement, siret, code_postal, ville, adresse, email, departement_code))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_users(search text) RETURNS SETOF users LANGUAGE sql STABLE AS $function$ SELECT * FROM users WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', nom, prenom, email, id)) ORDER BY CASE WHEN(search <> id::text) THEN 1 ELSE 2 END, similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', nom, prenom, email, id))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_view_lb(search text) RETURNS SETOF view_lb LANGUAGE sql STABLE AS $function$ SELECT * FROM view_lb WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', siret, nom, code_postal, ville, adress, email)) ORDER BY similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', siret, nom, code_postal, ville, adress, email))) DESC $function$; CREATE OR REPLACE FUNCTION public.search_view_mesure_gestionnaire_tis(search text) RETURNS SETOF view_mesure_gestionnaire_tis LANGUAGE sql STABLE AS $function$ SELECT * FROM view_mesure_gestionnaire_tis WHERE search IS NULL OR f_unaccent(search) <% f_unaccent(CONCAT_WS(' ', nom, siret, code_postal, ville, adresse, telephones, email)) ORDER BY CASE WHEN(f_unaccent(search) = f_unaccent(nom)) THEN 0 ELSE 1 END DESC, CASE WHEN(f_unaccent(search) ILIKE f_unaccent(nom)) THEN 0 ELSE 1 END DESC, similarity(f_unaccent(search), f_unaccent(nom)) DESC, similarity(f_unaccent(search), f_unaccent(CONCAT_WS(' ', nom, siret, code_postal, ville, adresse, telephones, email))) DESC $function$;
true
cbcada6d764543369860c6857dd76b13327bc699
SQL
vardanaivazian/cma
/src/main/resources/schema.sql
UTF-8
3,357
3.34375
3
[]
no_license
/* SQLyog Community v13.1.1 (64 bit) MySQL - 5.7.25-log : Database - cma-db ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!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' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`cma-db` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */; USE `cma-db`; /*Table structure for table `orders` */ DROP TABLE IF EXISTS `orders`; CREATE TABLE `orders` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `table_id` int(11) DEFAULT NULL, `status` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `created_date` datetime NOT NULL, PRIMARY KEY (`id`), KEY `table_id` (`table_id`), CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `product_in_orders` */ DROP TABLE IF EXISTS `product_in_orders`; CREATE TABLE `product_in_orders` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `amount` int(4) NOT NULL DEFAULT '1', `order_id` bigint(20) DEFAULT NULL, `product_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `products` */ DROP TABLE IF EXISTS `products`; CREATE TABLE `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `roles` */ DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `tables` */ DROP TABLE IF EXISTS `tables`; CREATE TABLE `tables` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), CONSTRAINT `tables_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `user_roles` */ DROP TABLE IF EXISTS `user_roles`; CREATE TABLE `user_roles` ( `user_id` bigint(20) NOT NULL, `role_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `users` */ DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
true
4e5e1c21825cd00b3e7554b3df8758111004098b
SQL
YauheniD/GodelDataMasteryPart1
/Tasks/Vadzim/Task3_1/query06.sql
UTF-8
292
3.640625
4
[]
no_license
--Query 6 SELECT TOP(10) ssod.SalesOrderID, MAX(ssod.LineTotal) AS TotalPrice FROM Sales.SalesOrderDetail AS ssod JOIN Sales.SalesOrderHeader AS ssoh ON (ssod.SalesOrderID = ssoh.SalesOrderID) WHERE YEAR(ssoh.OrderDate) = 2011 GROUP BY ssod.SalesOrderID ORDER BY TotalPrice DESC ;
true
324f2b6f8b3297598aae9501c467a382e5b9582c
SQL
paulhoffman98/SQL
/HW4.sql
UTF-8
5,206
4.75
5
[]
no_license
use glassesshipping; /*1) From orders table, list orderid, shopid, productid, and price paid for each order. Please consider the list price of products for orders with no price paid.*/ SELECT OrderID, ShopID, ProductID, PricePaid, ListPrice FROM orders JOIN products using(ProductID) WHERE PricePaid is Null; /*2) Find the shops with more than 3 not-local orders (orders where zipcode is not equal to store location).*/ SELECT ShopName, count(OrderID) FROM shops JOIN orders using(ShopID) WHERE Location != ZipCode GROUP BY ShopName HAVING count(OrderID) >= 3 Order BY ShopName; /*3) Find the booth shops that have received more than 4 orders. List the shop name, number of orders, and the average price paid of orders.*/ SELECT ShopName, count(OrderID), avg(PricePaid) From Shops Join Orders using(ShopID) where Format = "Booth" Group By ShopName Having count(OrderID) > 4; /*4) There are a few records in the shops table where we do not have the employee number. To fill them up, we would like to use the average of employee number for each shop format. For example, to fill the null employee numbers in booths, we use the average of employee number of all booths. Please list the average employee number, and total nulls in employee number column for each store type. Hint: You may use ROUND() function to round the average result.*/ SELECT Format, ROUND(avg(EmployeeNum)), count(EmployeeNum) from shops GROUP by Format; /*5) List the store format, total number of orders, and average annual revenue per store except department stores.*/ SELECT Format, count(OrderId), avg(AnnualRevenue) from Shops Join orders using(ShopID) WHERE format != "Department Store" Group By Format; /*6) Find the number of unique product types that have been purchased from each store. Please consider only booth and standalone stores.*/ SELECT ShopName, count(distinct(ProductID)) From products Left Join orders using(ProductID) RIGHT JOIN shops using(ShopID) WHERE Format = "Booth" or "Stand Alone" GROUP BY ShopName; /*7) Find the average price paid for each product that has been purchased from stores with less than (not including) 3 orders. List the product id, product name, average price paid, and list price of product. Note: Consider the price paid as 0 for not available price paid entries.*/ SELECT ProductID, ProductName, ListPrice, avg(PricePaid) From Products Left Join Orders using(ProductId) Right Join (SELECT ShopID from shops Join orders using(ShopID) Group By ShopID Having count(orderId) < 3) as Shop Using(ShopID) Group By ProductID; /*8) Among the products with more than average quantity (if quantity is not available, consider it as 50), find those that have been purchased from stores in location 93000. List the product name, and location of the store.*/ SELECT ProductName, Location FROM Products LEFT JOIN orders using(ProductID) Right JOIN shops using(ShopID) Where Quantity > (SELECT avg(if(Quantity is Null, 50, Quantity)) From products) AND Location = "93000"; /*9) Find the products that have been ordered more than the average number of orders of all products. List the product name, product id, and number of times it has been ordered.*/ SELECT ProductName, ProductID, count(OrderID) FROM Products LEFT JOIN orders using(ProductID) Group By ProductID, ProductName Having count(OrderID) > (SELECT avg(counter) from (SELECT count(OrderID) as counter FROM orders GROUP by ProductID) as countOrder); /*10) Find the products that are priced for more than the average price list of all products. How many stores are carrying them?*/ SELECT ProductName, count(ShopID) FROM Products Left JOIN Orders using(ProductID) Right Join Shops using(ShopID) WHERE ListPrice > (SELECT avg(ListPrice) FROM products) GROUP BY ProductID; /*11) Find the number of unique products that has been purchased from shops with more than average annual revenue. Please assume the annual revenue with null values as $500,000. List the shopid, shopname, and number of unique products that has been purchased.*/ SELECT shopID, ShopName, count(DISTINCT(ProductID)) FROM shops LEFT JOIN orders using(ShopID) RIGHT JOIN products using(ProductID) WHERE AnnualRevenue > (SELECT avg(AnnualRevenue) FROM shops) GROUP BY shopID, ShopName; /*12) Find the products that customers have been paying at least $100 for them. How many unique stores are carrying each? List the product name, product id, minimum price paid, and number of unique stores carrying them.*/ SELECT ProductName, ProductID, Min(PricePaid), count(ShopID) FROM Products LEFT JOIN Orders using(ProductID) RIGHT JOIN Shops using(ShopID) GROUP BY ProductName, ProductID HAVING Min(PricePaid) >= 100; /*13) List the average list price, average price paid, and number of orders per introduced year of products. If a product is not ordered, report the average price paid as 0.*/ SELECT Year(Introduced), avg(ListPrice), avg(IF(PricePaid is NULL, 0, PricePaid)) , count(OrderID) FROM orders Join products using(ProductID) GROUP BY Year(Introduced); /*14) How much time did you spend on this homework?*/ /* 2 hours and half*/
true
1b110d6de96386df9b6b35d91ee924d76dfb88f0
SQL
tsebal/JavaRushTasks
/3.JavaMultithreading/src/com/javarush/task/sql/task03/task0350/query.sql
UTF-8
486
3.78125
4
[]
no_license
-- Write your code here: WITH tempTable(averageGrossed) AS (SELECT AVG(grossed) FROM films), tempTable2(averageYearReleased) AS (SELECT AVG(year_released) FROM films) SELECT title , genre , year_released , grossed FROM films , tempTable , tempTable2 WHERE films.grossed > tempTable.averageGrossed AND films.year_released > tempTable2.averageYearReleased GROUP BY films.year_released
true
a8599da0cc3f6cda99915420ad9699a951caa569
SQL
JaysonRice/nss-mastering-sql-queries
/carnival_reports_BK2.sql
UTF-8
2,734
4.625
5
[]
no_license
-- Creating Carnival Reports -- Team Project: Carnival Database -- Who are the top 5 employees for generating sales income? SELECT CONCAT(e.first_name, ' ', e.last_name) as employee_name, SUM (s.price) AS total_income FROM sales s JOIN employees e ON s.employee_id = e.employee_id GROUP BY e.employee_id ORDER BY total_income DESC LIMIT 5; -- Who are the top 5 dealership for generating sales income? SELECT business_name, SUM (s.price) AS total_income FROM sales s JOIN dealerships d ON s.dealership_id = d.dealership_id GROUP BY d.dealership_id ORDER BY total_income DESC LIMIT 5; -- Which vehicle model generated the most sales income? SELECT mo.name as vehicle_model, SUM (s.price) as total_sales FROM sales s JOIN dealerships d ON s.dealership_id = d.dealership_id JOIN vehicles v ON s.vehicle_id = v.vehicle_id JOIN vehicletypes vt ON v.vehicle_type_id = vt.vehicle_type_id JOIN vehiclemodels mo ON vt.model_id = mo.vehicle_model_id GROUP BY vehicle_model ORDER BY total_sales DESC LIMIT 1; -- Which employees generate the most income per dealership? SELECT CONCAT(e.first_name, ' ', e.last_name) as employee_name, d.business_name, sum (s.price) as total_income FROM employees e JOIN dealershipemployees de ON de.employee_id = e.employee_id JOIN dealerships d ON de.dealership_id = d.dealership_id JOIN sales s ON s.employee_id = e.employee_id GROUP BY employee_name, d.business_name ORDER BY total_income DESC; -- In our Vehicle inventory, show the count of each Model that is in stock. SELECT mo.name, COUNT(v.vehicle_id) as models FROM vehicles v JOIN vehicletypes vt ON v.vehicle_type_id = vt.vehicle_type_id JOIN vehiclemodels mo ON vt.model_id = mo.vehicle_model_id GROUP BY mo.vehicle_model_id ORDER BY COUNT(v.vehicle_id) DESC; -- In our Vehicle inventory, show the count of each Make that is in stock. SELECT ma.name, COUNT(v.vehicle_id) as makes FROM vehicles v JOIN vehicletypes vt ON v.vehicle_type_id = vt.vehicle_type_id JOIN vehiclemakes ma ON vt.model_id = ma.vehicle_make_id GROUP BY ma.vehicle_make_id ORDER BY COUNT(v.vehicle_id) DESC; -- In our Vehicle inventory, show the count of each BodyType that is in stock. SELECT bt.name, COUNT(v.vehicle_id) as body_types FROM vehicles v JOIN vehicletypes vt ON v.vehicle_type_id = vt.vehicle_type_id JOIN vehiclebodytypes bt ON vt.body_type_id = bt.vehicle_body_type_id GROUP BY bt.vehicle_body_type_id ORDER BY COUNT(v.vehicle_id) DESC; -- Which US state's customers have the highest average purchase price for a vehicle? SELECT c.state, ROUND (AVG (s.price), 2) as average_purchase_price FROM sales s JOIN customers c on s.customer_id = c.customer_id GROUP BY c.state ORDER BY average_purchase_price DESC;
true
231959c54648e9970e4f3c40113ba2c377a3c63d
SQL
stepheku/cclqueries
/scheduling/order_catalog_synonym_to_scheduling.sql
UTF-8
1,298
3.65625
4
[ "MIT" ]
permissive
/* order_catalog_synonym_to_scheduling.sql ~~~~~~~~~~~~~~~~~~~~ Grabs order catalog synonyms that are linked to a scheduling appointment type */ select primary = oc.primary_mnemonic , synonym = ocs.mnemonic , synonym_oef = oef1.oe_format_name , s.synonym_id , appt_type = uar_get_code_display(s.appt_type_cd) , appt_oef = oef2.oe_format_name from sch_appt_ord s , sch_appt_type sat , order_catalog_synonym ocs , order_catalog oc , order_entry_format oef1 , order_entry_format oef2 plan s where s.active_ind = 1 and s.end_effective_dt_tm > sysdate and s.version_dt_tm > sysdate join sat where sat.appt_type_cd = s.appt_type_cd and sat.active_ind = 1 join ocs where ocs.synonym_id = s.synonym_id and ocs.active_ind = 1 join oc where oc.catalog_cd = ocs.catalog_cd and oc.active_ind = 1 and oc.schedule_ind = 1 join oef1 where oef1.oe_format_id = outerjoin(ocs.oe_format_id) and oef1.action_type_cd = outerjoin(value(uar_get_code_by("MEANING", 6003, "ORDER"))) join oef2 where oef2.oe_format_id = outerjoin(sat.oe_format_id) and oef2.action_type_cd = outerjoin(value(uar_get_code_by("MEANING", 14232, "APPOINTMENT"))) order by oc.primary_mnemonic , ocs.mnemonic_key_cap with format(date, "mm/dd/yyyy hh:mm:ss"), uar_code(d)
true
7cc483d4628eb70ecd353cbd861b7fbe88ea8e43
SQL
rita-choi/cafeinme
/src/main/webapp/resources/mysql/cafe_list.sql
UTF-8
983
3.71875
4
[]
no_license
-- 데이터 베이스 생성 (utf8) CREATE DATABASE cafedb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; -- 카페 목록 생성 CREATE TABLE cafe_list ( cno INT NOT NULL AUTO_INCREMENT, cafename VARCHAR(200) NOT NULL, content VARCHAR(1000) NOT NULL, location VARCHAR(200) NOT NULL, writer VARCHAR(50) NOT NULL, regdate TIMESTAMP DEFAULT now(), updatedate TIMESTAMP DEFAULT now(), viewcnt INT DEFAULT 0, mymenu INT DEFAULT 0 NOT NULL, PRIMARY KEY (cno) ) DEFAULT CHARSET=utf8; -- 리뷰 수, 리뷰 평점 컬럼 추가 ALTER TABLE cafe_list ADD COLUMN reviewcnt int DEFAULT 0; ALTER TABLE cafe_list ADD COLUMN scorecnt int DEFAULT 0; ALTER TABLE cafe_list ADD COLUMN attachcnt int DEFAULT 0; -- 대표이미지 파일명 추가 ALTER TABLE cafe_list ADD COLUMN cimage VARCHAR(100) NOT NULL DEFAULT '/default-cafe-image.jpg'; -- 리뷰 평점 순 대로 select *, scorecnt / reviewcnt AS highscore from cafe_list order by highscore desc;
true
4fc451966512337c67dcdcb7913e9370eadaa972
SQL
radiantnode/tv-listings-updater
/schema.sql
UTF-8
680
3.03125
3
[ "MIT" ]
permissive
CREATE TABLE `entries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Title` varchar(255) DEFAULT NULL, `EpisodeTitle` varchar(255) DEFAULT NULL, `Description` TEXT DEFAULT NULL, `AiringTime` datetime DEFAULT NULL, `Duration` int(11) DEFAULT NULL, `ChannelNumber` int(11) DEFAULT NULL, `ChannelCallsign` varchar(12) DEFAULT NULL, PRIMARY KEY (`id`), KEY `index_entries_on_title` (`Title`), KEY `index_entries_on_episode_title` (`EpisodeTitle`), KEY `index_entries_airing_time` (`AiringTime`), KEY `index_entries_channel_number` (`ChannelNumber`), KEY `index_entries_channel_callsign` (`ChannelCallsign`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
true
a1e652fae5146662b11ebd5aae8238062930d40e
SQL
carlos-sierra/cscripts
/metadata_ddl.sql
UTF-8
3,778
3.25
3
[]
no_license
DEF 1 = 'C##IOD'; PRO dbc_dbcps_pdb_metadata. persistent DECLARE l_exists NUMBER; l_sql_statement VARCHAR2(32767) := q'[ CREATE TABLE &&1..dbc_dbcps_pdb_metadata ( -- /* key: id and pdb_name */ id NUMBER NOT NULL -- should be enough for uniqueness but sea has two pdbs DBCPS_METADATA and DBCPS_METADATA_PROD, thus collisions on id alone are possible , pdb_name VARCHAR2(128) NOT NULL -- data elements , compartment_id VARCHAR2(128) NOT NULL , tenancy_id VARCHAR2(128) , phonebook_entry VARCHAR2(256) , location VARCHAR2(64) NOT NULL -- phx|phx-ad-1|phx-ad-2|phx-ad-3 , locale VARCHAR2(4) NOT NULL -- RGN|AD1|AD2|AD3 , state VARCHAR2(64) NOT NULL -- READY|FAILED|PROVISIONING , type VARCHAR2(128) NOT NULL -- KIEV|GENERAL|CASPER|WORKFLOW|TELEMETRY|CANARY_INTERNAL , parent_cdb_name VARCHAR2(128) -- iod01, iod02, ... kiev02, ... kiev02a1, ... oradb-casp01rg, ... oradb-iod01 , created TIMESTAMP(6) NOT NULL , last_modified TIMESTAMP(6) NOT NULL , replicated TIMESTAMP(6) NOT NULL ) TABLESPACE IOD ]'; l_sql_statement2 VARCHAR2(32767) := q'[ CREATE UNIQUE INDEX &&1..dbc_dbcps_pdb_metadata_pk ON &&1..dbc_dbcps_pdb_metadata (id, pdb_name) TABLESPACE IOD ]'; l_sql_statement3 VARCHAR2(32767) := q'[ ALTER TABLE &&1..dbc_dbcps_pdb_metadata ADD PRIMARY KEY (id, pdb_name) USING INDEX &&1..dbc_dbcps_pdb_metadata_pk ]'; BEGIN SELECT COUNT(*) INTO l_exists FROM dba_tables WHERE owner = UPPER(TRIM('&&1.')) AND table_name = UPPER('dbc_dbcps_pdb_metadata'); IF l_exists = 0 THEN EXECUTE IMMEDIATE l_sql_statement; END IF; SELECT COUNT(*) INTO l_exists FROM dba_indexes WHERE owner = UPPER(TRIM('&&1.')) AND index_name = UPPER('dbc_dbcps_pdb_metadata_pk'); IF l_exists = 0 THEN EXECUTE IMMEDIATE l_sql_statement2; EXECUTE IMMEDIATE l_sql_statement3; END IF; END; / /* ------------------------------------------------------------------------------------ */ PRO dbc_parameter. persistent DECLARE l_exists NUMBER; l_data_length NUMBER; l_sql_statement VARCHAR2(32767) := q'[ CREATE TABLE &&1..dbc_parameter ( -- /* key: region */ parameter VARCHAR2(30) NOT NULL , type VARCHAR2(30) NOT NULL -- data elements , value VARCHAR2(256) NOT NULL , description VARCHAR2(512) ) TABLESPACE IOD ]'; l_sql_statement2 VARCHAR2(32767) := q'[ CREATE UNIQUE INDEX &&1..dbc_parameter_pk ON &&1..dbc_parameter (parameter, type) TABLESPACE IOD ]'; l_sql_statement3 VARCHAR2(32767) := q'[ ALTER TABLE &&1..dbc_parameter ADD PRIMARY KEY (parameter, type) USING INDEX &&1..dbc_parameter_pk ]'; l_sql_statement4 VARCHAR2(32767) := q'[ ALTER TABLE &&1..dbc_parameter MODIFY (value VARCHAR2(256)) ]'; BEGIN SELECT COUNT(*) INTO l_exists FROM dba_tables WHERE owner = UPPER(TRIM('&&1.')) AND table_name = UPPER('dbc_parameter'); IF l_exists = 0 THEN EXECUTE IMMEDIATE l_sql_statement; END IF; SELECT COUNT(*) INTO l_exists FROM dba_indexes WHERE owner = UPPER(TRIM('&&1.')) AND index_name = UPPER('dbc_parameter_pk'); IF l_exists = 0 THEN EXECUTE IMMEDIATE l_sql_statement2; EXECUTE IMMEDIATE l_sql_statement3; END IF; SELECT data_length INTO l_data_length FROM dba_tab_columns WHERE owner = UPPER(TRIM('&&1.')) AND table_name = UPPER('dbc_parameter') AND column_name = UPPER('value'); IF l_data_length < 256 THEN EXECUTE IMMEDIATE l_sql_statement4; END IF; END; /
true
1b763073e4fb625884f165c44a961c0d531fd9b3
SQL
ethanholda/FriendsShelter
/TABLES.sql
UTF-8
1,000
3.015625
3
[]
no_license
CREATE TABLE `users` ( `user_id` int(10) NOT NULL auto_increment, `email` varchar(60) NOT NULL default '', `password` varchar(8) NOT NULL default '', `first_name` varchar(50) default NULL, `last_name` varchar(50) default NULL, `street_address` varchar(60) default NULL, `city` varchar(30) default NULL, `state` char(2) default NULL, `zipcode` varchar(5) default NULL, `phone_home` varchar(20) default NULL, `phone_work` varchar(20) default NULL, `phone_mobile` varchar(20) default NULL, `is_active` tinyint(1) default '1', `is_emergency_contact` tinyint(1) default '1', `preferred_contact_method` enum('home','work','mobile','email') default NULL, PRIMARY KEY (`user_id`) ) ENGINE=MyISAM AUTO_INCREMENT=482 DEFAULT CHARSET=utf8; CREATE TABLE `volunteer_calendar` ( `calendar_date` date NOT NULL default '0000-00-00', `user_id` int(10) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; insert into users (email,password) values ('setup', 'change!m');
true
8a9ecab91ad34a1c897d68031b5602c0d8b2bc1d
SQL
DamiSxM/CDI
/MOD2/SEQ2/SEA1/A1/MOD2_SEQ2_SEA1_A1_1.2h.sql
UTF-8
461
3.75
4
[]
no_license
--Quels sont les noms des pilotes qui habitent dans la ville de localisation d'un Airbus ? ME & MP select distinct Nom, Ville, Localisation from Pilote join vol on Pilote.Pil# = vol.Pilote join avion on vol.Avion = avion.Av# where avion.Localisation = Pilote.Ville and Marque = 'AIRBUS' select distinct Nom, Ville from Pilote where Pil# in (select Pilote from vol where Avion in (select Av# from avion where Marque = 'AIRBUS' and Localisation = Pilote.Ville))
true
7e20585ab992e56901af2f21142081b1d193ae23
SQL
MeGaDeTH91/SoftUni
/Java/02.DB/01.MySQL/07.BuiltInFuncs/Ex/05.FindTownByTownName.sql
UTF-8
76
2.75
3
[]
no_license
SELECT `name` FROM `towns` WHERE LENGTH(`name`) IN(5,6) ORDER BY `name` ASC;
true
b6ba5e2f8969c45334c7b9451ada336d4e5e4b70
SQL
tuankietdut/C0421G1_TranXuanTuanKiet_Module3
/4_cac_ham_csdl/bai_tap/bai_tap_lesson4.sql
UTF-8
477
3.59375
4
[]
no_license
use quan_li_sinh_vien; select * from `subject` where credit = (select max(credit) from `subject`); select `subject`.subject_name, mark.mark as so_diem_cao_nhat from mark inner join `subject` on mark.subject_id = `subject`.subject_id where mark = (select max(mark) from mark); select s.student_name,s.address, s.phone, avg(m.mark) as diem_trung_binh from student s join mark m on s.student_id = m.student_id group by s.student_id order by mark desc; select * from mark;
true
29db15193665f15a3970b95d1ecb82d0bc9bb1a4
SQL
shsuk/jojesus
/WebContent/WEB-INF/sql/system/wf/working_job.sql
UTF-8
722
3.40625
3
[]
no_license
SELECT wf_job_id FROM workflow_job_tbl WHERE job_status in ('WAT','RET') and next_run_dt <= now() LIMIT 0, 1; UPDATE workflow_job_tbl SET job_status = 'RUN', run_ip = @{run_ip}, last_run_dt = now() WHERE wf_job_id = @{this.wf_job_id}; SELECT t1.wf_job_id, t1.wf_id, current_wf_proc_id, date_format(last_run_dt, '%Y-%m-%d %H:%i:%s') last_run_dt, t1.reg_dt, job_status, src_id, t1.retry_cnt, next_run_dt, wf_proc_id, wf_proc_name, wf_proc_path, run_memo, order_no, use_yn, job_type, t2.retry_cnt max_retry_cnt, waite_time FROM workflow_job_tbl t1 INNER JOIN workflow_process_tbl t2 ON t1.current_wf_proc_id = t2.wf_proc_id WHERE wf_job_id = @{this.wf_job_id};
true
fa2504827c39809b4864426a6d74c2947e7786ac
SQL
relativelimited/argent-cloudkit
/argent/argent-cloudkit.sql
UTF-8
6,238
3.375
3
[]
no_license
-- Argent CloudKit Database Structure -- version 1.2.0 -- http://www.argentcloudkit.com/ -- CREATE TABLE IF NOT EXISTS `ua_accounts` ( `meta_guid` varchar(32) NOT NULL, `object_id` varchar(40) NOT NULL, `account_status` set('NEW','ACTIVE','SUSPENDED','DELETED') NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL, PRIMARY KEY (`meta_guid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_accounts_head` ( `meta_guid` varchar(32) ,`object_id` varchar(40) ,`account_status` set('NEW','ACTIVE','SUSPENDED','DELETED') ,`meta_timestamp` datetime ,`meta_user` varchar(40) ,`meta_ip` varchar(25) ); CREATE TABLE IF NOT EXISTS `ua_custom_fields` ( `meta_guid` varchar(32) NOT NULL, `object_id` varchar(40) NOT NULL, `field_name` varchar(255) NOT NULL, `field_data` longtext NOT NULL, `ua_parent_object` varchar(40) NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL, PRIMARY KEY (`meta_guid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_custom_fields_head` ( `meta_guid` varchar(32) ,`object_id` varchar(40) ,`field_name` varchar(255) ,`field_data` longtext ,`ua_parent_object` varchar(40) ,`meta_timestamp` datetime ,`meta_user` varchar(40) ,`meta_ip` varchar(25) ); CREATE TABLE IF NOT EXISTS `ua_object_register` ( `object_id` varchar(40) NOT NULL, `ua_parent_object` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_object_types` ( `type_identifier` varchar(3) NOT NULL, `type_name` varchar(20) NOT NULL, `table` varchar(255) NOT NULL, PRIMARY KEY (`type_identifier`), UNIQUE KEY `object_identifier` (`type_identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_permissions` ( `meta_guid` varchar(32) NOT NULL, `object_id` varchar(40) NOT NULL, `user_id` varchar(40) NOT NULL, `cascade` tinyint(4) NOT NULL, `master` varchar(32) NOT NULL, `create` tinyint(4) NOT NULL, `read` tinyint(4) NOT NULL, `update` tinyint(4) NOT NULL, `delete` tinyint(4) NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `ua_relationships` ( `meta_guid` varchar(32) NOT NULL, `primary_object_id` varchar(40) NOT NULL, `secondary_object_id` varchar(40) NOT NULL, `relationship` varchar(255) NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_rights` ( `meta_guid` varchar(32) NOT NULL, `object_id` varchar(40) NOT NULL, `right` int(11) NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_session_register` ( `session_id` varchar(255) NOT NULL, `user_id` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_sessions` ( `session_id` varchar(255) NOT NULL DEFAULT '', `session_name` varchar(25) NOT NULL, `timeout` int(11) NOT NULL, `last_activity` bigint(20) NOT NULL, `started` bigint(20) NOT NULL, `remote_address` varchar(50) NOT NULL, `secure` tinyint(4) NOT NULL, `domain` varchar(255) NOT NULL, `path` varchar(255) NOT NULL, `useragent` varchar(255) NOT NULL, `data` text NOT NULL, PRIMARY KEY (`session_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_users` ( `meta_guid` varchar(32) NOT NULL, `object_id` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `secret` text NOT NULL, `display_name` varchar(255) NOT NULL, `ua_parent_object` varchar(40) NOT NULL, `meta_timestamp` datetime NOT NULL, `meta_user` varchar(40) NOT NULL, `meta_ip` varchar(25) NOT NULL, PRIMARY KEY (`meta_guid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ua_users_head` ( `meta_guid` varchar(32) ,`object_id` varchar(40) ,`email` varchar(255) ,`secret` text ,`display_name` varchar(255) ,`ua_parent_object` varchar(40) ,`meta_timestamp` datetime ,`meta_user` varchar(40) ,`meta_ip` varchar(25) );DROP TABLE IF EXISTS `ua_accounts_head`; CREATE VIEW `ua_accounts_head` AS select `ua_accounts`.`meta_guid` AS `meta_guid`,`ua_accounts`.`object_id` AS `object_id`,`ua_accounts`.`account_status` AS `account_status`,`ua_accounts`.`meta_timestamp` AS `meta_timestamp`,`ua_accounts`.`meta_user` AS `meta_user`,`ua_accounts`.`meta_ip` AS `meta_ip` from `ua_accounts` where `ua_accounts`.`meta_guid` in (select max(`ua_accounts`.`meta_guid`) AS `max(meta_guid)` from `ua_accounts` group by `ua_accounts`.`object_id`); DROP TABLE IF EXISTS `ua_custom_fields_head`; CREATE VIEW `ua_custom_fields_head` AS select `ua_custom_fields`.`meta_guid` AS `meta_guid`,`ua_custom_fields`.`object_id` AS `object_id`,`ua_custom_fields`.`field_name` AS `field_name`,`ua_custom_fields`.`field_data` AS `field_data`,`ua_custom_fields`.`ua_parent_object` AS `ua_parent_object`,`ua_custom_fields`.`meta_timestamp` AS `meta_timestamp`,`ua_custom_fields`.`meta_user` AS `meta_user`,`ua_custom_fields`.`meta_ip` AS `meta_ip` from `ua_custom_fields` where `ua_custom_fields`.`meta_guid` in (select max(`ua_custom_fields`.`meta_guid`) AS `max(meta_guid)` from `ua_custom_fields` group by `ua_custom_fields`.`object_id`); DROP TABLE IF EXISTS `ua_users_head`; CREATE VIEW `ua_users_head` AS select `ua_users`.`meta_guid` AS `meta_guid`,`ua_users`.`object_id` AS `object_id`,`ua_users`.`email` AS `email`,`ua_users`.`secret` AS `secret`,`ua_users`.`display_name` AS `display_name`,`ua_users`.`ua_parent_object` AS `ua_parent_object`,`ua_users`.`meta_timestamp` AS `meta_timestamp`,`ua_users`.`meta_user` AS `meta_user`,`ua_users`.`meta_ip` AS `meta_ip` from `ua_users` where `ua_users`.`meta_guid` in (select max(`ua_users`.`meta_guid`) AS `max(meta_guid)` from `ua_users` group by `ua_users`.`object_id`);
true
e03860697faf14bf4555322027145fa69a4ef830
SQL
HTTPArchive/almanac.httparchive.org
/sql/2019/cdn/17_03.sql
UTF-8
627
3.21875
3
[ "Apache-2.0" ]
permissive
#standardSQL # 07_03: Percentiles of TTFB for CDN SELECT client, cdn, COUNT(0) AS requests, APPROX_QUANTILES(ttfb, 1000)[OFFSET(100)] AS p10, APPROX_QUANTILES(ttfb, 1000)[OFFSET(250)] AS p25, APPROX_QUANTILES(ttfb, 1000)[OFFSET(500)] AS p50, APPROX_QUANTILES(ttfb, 1000)[OFFSET(750)] AS p75, APPROX_QUANTILES(ttfb, 1000)[OFFSET(900)] AS p90 FROM ( SELECT client, CAST(JSON_EXTRACT(payload, '$._ttfb_ms') AS INT64) AS ttfb, _cdn_provider AS cdn FROM `httparchive.almanac.requests` WHERE date = '2019-07-01' AND _cdn_provider != '') GROUP BY client, cdn ORDER BY requests DESC
true
372e33e9830114379e494859a5ba54faf7f309af
SQL
vishnuasabe/attbysanket
/database/attsystem.sql
UTF-8
5,938
3
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jul 07, 2018 at 03:23 AM -- Server version: 5.6.21 -- PHP Version: 5.5.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `attsystem` -- -- -------------------------------------------------------- -- -- Table structure for table `admininfo` -- CREATE TABLE IF NOT EXISTS `admininfo` ( `username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `fname` varchar(30) NOT NULL, `phone` varchar(30) NOT NULL, `type` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admininfo` -- INSERT INTO `admininfo` (`username`, `password`, `email`, `fname`, `phone`, `type`) VALUES ('admin', 'admin', 'admin@admin.com', 'Admin', '12344', 'admin'), ('student', 'admin', 'student@student.com', 'Student', '+8809121', 'student'), ('teacher', 'admin', 'teacher@teacher.com', 'Teacher', '+8809121', 'teacher'); -- -------------------------------------------------------- -- -- Table structure for table `attendance` -- CREATE TABLE IF NOT EXISTS `attendance` ( `stat_id` int(20) NOT NULL, `course` varchar(20) NOT NULL, `st_status` varchar(20) NOT NULL, `stat_date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `attendance` -- INSERT INTO `attendance` (`stat_id`, `course`, `st_status`, `stat_date`) VALUES (1121, 'swe', 'Absent', '2018-06-25'), (1122, 'swe', 'Present', '2018-06-25'), (1125, 'swe', 'Absent', '2018-06-25'), (1126, 'swe', 'Present', '2018-06-25'), (3433, 'networking', 'Present', '2018-06-25'), (1121, 'swe', 'Present', '2018-07-06'), (1122, 'swe', 'Present', '2018-07-06'), (1125, 'swe', 'Present', '2018-07-06'), (1126, 'swe', 'Absent', '2018-07-06'), (1121, 'networking', 'Present', '2018-07-07'), (1122, 'networking', 'Present', '2018-07-07'), (1125, 'networking', 'Present', '2018-07-07'), (1126, 'networking', 'Present', '2018-07-07'), (1121, 'networking', 'Present', '2018-07-07'), (1122, 'networking', 'Present', '2018-07-07'), (1125, 'networking', 'Present', '2018-07-07'), (1126, 'networking', 'Present', '2018-07-07'), (1121, 'swe', 'Present', '2018-07-07'), (1122, 'swe', 'Present', '2018-07-07'), (1125, 'swe', 'Present', '2018-07-07'), (1126, 'swe', 'Present', '2018-07-07'), (1121, 'swe', 'Present', '2018-07-07'), (1122, 'swe', 'Present', '2018-07-07'), (1125, 'swe', 'Present', '2018-07-07'), (1126, 'swe', 'Present', '2018-07-07'), (1121, 'networking', 'Present', '2018-07-07'), (1122, 'networking', 'Present', '2018-07-07'), (1125, 'networking', 'Present', '2018-07-07'), (1126, 'networking', 'Present', '2018-07-07'), (3433, 'networking', 'Present', '2018-07-07'), (3433, 'swe', 'Absent', '2018-07-07'), (3433, 'networking', 'Absent', '2018-07-07'); -- -------------------------------------------------------- -- -- Stand-in structure for view `reports` -- CREATE TABLE IF NOT EXISTS `reports` ( `st_id` int(20) ,`st_name` varchar(255) ,`st_dept` varchar(255) ,`st_batch` varchar(255) ,`stat_date` date ,`st_status` varchar(20) ,`course` varchar(20) ); -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE IF NOT EXISTS `students` ( `st_id` int(20) NOT NULL, `st_name` varchar(255) NOT NULL, `st_dept` varchar(255) NOT NULL, `st_batch` varchar(255) NOT NULL, `st_sem` varchar(255) NOT NULL, `st_email` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `students` -- INSERT INTO `students` (`st_id`, `st_name`, `st_dept`, `st_batch`, `st_sem`, `st_email`) VALUES (1121, 'Humaun Kabir', 'CSE', '38', 'Spring 15', 'hk@gmail.com'), (1122, 'Sarmin Sultana', 'CSE', '38', 'Fall-15', 'sarmin@gmail.com'), (1125, 'Liton Sarker', 'CSE', '38', 'Spring 153', 'liton.com@gmail.com'), (1126, 'Faisal Jahid', 'CSE', '38', 'Spring 15', 'jahid@gmail.com'), (3433, 'Rayham Mahmud Uddin', 'CSE', '37', 'Spring 16', 'rms@gmail.com'); -- -------------------------------------------------------- -- -- Table structure for table `teachers` -- CREATE TABLE IF NOT EXISTS `teachers` ( `tc_id` int(20) NOT NULL, `tc_name` varchar(255) NOT NULL, `tc_dept` varchar(255) NOT NULL, `tc_email` varchar(255) NOT NULL, `tc_course` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `teachers` -- INSERT INTO `teachers` (`tc_id`, `tc_name`, `tc_dept`, `tc_email`, `tc_course`) VALUES (1122, 'Ataullah Bhuiyan', 'CSE', 'asamad@gmail.com', 'Computer Network'), (1810, 'Ataus Samad Biplod', 'CSE', 'asamad@gmail.com', 'Software Engineering'), (1812, 'Sharmin Akter', 'CSE', 'sharmin@city.com', 'Digital System Design'); -- -------------------------------------------------------- -- -- Structure for view `reports` -- DROP TABLE IF EXISTS `reports`; CREATE ALGORITHM=UNDEFINED DEFINER=`PoQcdBCVmz`@`remotemysql.com` SQL SECURITY DEFINER VIEW `reports` AS select `students`.`st_id` AS `st_id`,`students`.`st_name` AS `st_name`,`students`.`st_dept` AS `st_dept`,`students`.`st_batch` AS `st_batch`,`attendance`.`stat_date` AS `stat_date`,`attendance`.`st_status` AS `st_status`,`attendance`.`course` AS `course` from (`attendance` join `students`) where (`students`.`st_id` = `attendance`.`stat_id`); -- -- Indexes for dumped tables -- -- -- Indexes for table `admininfo` -- ALTER TABLE `admininfo` ADD UNIQUE KEY `username` (`username`,`email`); -- -- Indexes for table `students` -- ALTER TABLE `students` ADD PRIMARY KEY (`st_id`); -- -- Indexes for table `teachers` -- ALTER TABLE `teachers` ADD PRIMARY KEY (`tc_id`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
3848d8cc6cb402c19c34868bf2afe2a165f53283
SQL
MariyamB/Big-Data-Management
/Hive/Hive_HW/Hive_Assignment_Script_File.sql
UTF-8
3,266
4.625
5
[]
no_license
-- Name: Mariyam Rajeev George -- Hive Assignment /*Write a set of Hive scripts that load these files into a staging external table called, Teller. Create a managed partitioned table, called PtTeller that partitions the rows in the table Teller dynamically based on the teller’s name.*/ drop table Teller; drop table ptTeller; --Creating Teller Table Create external table teller(Name string,Bills array<int>) Row format delimited Fields terminated by ',' Collection items terminated by ' ' Lines terminated by '\n' Stored as textfile LOCATION '/user/training/hive/Teller'; --Loading Data into Teller Table load data inpath '/user/training/hive/bankdata' into table Teller; --Displaying Teller Table contents Select * from Teller; --Creating ptTeller Table Create table ptTeller(Bills array<int>) Partitioned by(Name String) Row format delimited Fields terminated by ',' LOCATION'/user/training/hive/ptTeller'; --Setting dynamic partition constraints set hive.exec.dynamic.partition.mode=nonstrict; set hive.exec.dynamic.partition=true; --Inserting Data into ptTeller Table INSERT OVERWRITE TABLE ptTeller PARTITION(Name)SELECT Bills,Name FROM Teller; --Displaying Teller Table contents Select * from ptTeller; --PART A --Working with table Teller, write a set of Hive scripts that print the answers the following --questions: --Q1: The total amount of money and total number of bills collected by all tellers. SELECT distinct c.sum,c.count FROM (Select name, name1 FROM Teller LATERAL VIEW explode(bills) subs as name1)a JOIN (SELECT SUM(b.name1) sum,count(b.name1) count FROM (Select name, name1 FROM Teller LATERAL VIEW explode(bills) subs as name1)b)c; --Q2:The teller name and the total amount of money collected and the number of bills and the --average money for each teller (as done in the MR job). select name, sum(name1) as sum,avg(name1) as avg,count(name1) as count from (Select name, name1 FROM Teller LATERAL VIEW explode(bills) subs as name1)a group by name; --Q3: Print the teller name and the number of bills for those tellers that have collected the same --number of bills. select a.name,a.count1 from (select c.name,count(name3) as count1 FROM Teller c LATERAL VIEW explode(c.bills)subs as name3 group by c.name)a join (select d.name,count(name3) as count1 FROM Teller d LATERAL VIEW explode(d.bills)subs as name3 group by d.name)b on a.count1=b.count1 where a.name!=b.name; /*PART B Working with the PtTeller table, write a set of scripts that print the answers to the following questions: */ --Q1: The number of partitions in this table. select count(distinct Name) from ptTeller; --Q2: The teller name and the total amount of money collected and the number of bills and --the average money for each teller (as done in the MR job). select name, sum(name1) as sum,avg(name1) as avg,count(name1) as count from (Select name, name1 FROM ptTeller LATERAL VIEW explode(bills) subs as name1)a group by name; --Q3: The teller or the tellers’ names that have collected the maximum amount of money. select name, sum(name1) as sum from (Select name, name1 FROM ptTeller LATERAL VIEW explode(bills) subs as name1)a group by name sort by sum desc limit 1;
true
95d33a796d20d749fd053f66d27e85f9a0bd31f8
SQL
sxgan-code/MyMusicBoot
/Sql/Daniel.sql
UTF-8
2,329
3.203125
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : MySQL Source Server Type : MySQL Source Server Version : 80026 Source Host : localhost:3306 Source Schema : daniel Target Server Type : MySQL Target Server Version : 80026 File Encoding : 65001 Date: 24/08/2021 10:19:43 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for code_library -- ---------------------------- DROP TABLE IF EXISTS `code_library`; CREATE TABLE `code_library` ( `codeno` int(0) NOT NULL, `codename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `codevalue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`codeno`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of code_library -- ---------------------------- INSERT INTO `code_library` VALUES (0, '0', '未知'); INSERT INTO `code_library` VALUES (1, '1', '男'); INSERT INTO `code_library` VALUES (2, '2', '女'); -- ---------------------------- -- Table structure for student_info -- ---------------------------- DROP TABLE IF EXISTS `student_info`; CREATE TABLE `student_info` ( `stuId` int(0) NOT NULL, `stuName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `stuAge` int(0) NULL DEFAULT NULL, `stuSex` int(0) NULL DEFAULT NULL, PRIMARY KEY (`stuId`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of student_info -- ---------------------------- INSERT INTO `student_info` VALUES (10001, '张三', 22, 1); INSERT INTO `student_info` VALUES (10002, '李四', 22, 1); INSERT INTO `student_info` VALUES (10003, '林夕', 22, 2); INSERT INTO `student_info` VALUES (10004, '王五', 22, 1); INSERT INTO `student_info` VALUES (10005, '梦星', 22, 2); INSERT INTO `student_info` VALUES (10006, '林云梦', 22, 2); INSERT INTO `student_info` VALUES (10007, '张宇', 22, 1); INSERT INTO `student_info` VALUES (10008, '赵琳', 22, 2); INSERT INTO `student_info` VALUES (10009, '陈三龙', 22, 1); INSERT INTO `student_info` VALUES (10010, '王旭清', 22, 1); SET FOREIGN_KEY_CHECKS = 1;
true
9007f338e81aae32c1d6919d2ee62d67c56fac4e
SQL
huyanh0720/Education-Project
/src/snowflake/REST API.sql
UTF-8
685
2.671875
3
[]
no_license
------------------------------------- --CREATE SNOWPIPE ENDPOINT"PIPELINE_GROUP02" --show stages in database "PIPELINE_GROUP02" --show file formats in database "PIPELINE_GROUP02" alter user HANK0720 set rsa_public_key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxP20oUpVwtPYPuGnsyou ySuD685+YMOUEQI583TSom5f4GBikCRGmrrF6oFMQjj74iYNULxGe2pYCnDOzPnF VAZSt5uq+Mg70yopks+GSzVIkaXSYJIk0A2zC3VrTF6iS3ze8pwsF2sfludgI0um kwcY+iTgnkNj000rm3LswMoN3Y/7/aUniDmB3OYHdUZkSi4/pIlrwhgBgxU1qwA/ uEYNJ27RB0J7VrIGVDuxjY/NDtkrEepuQqtv/o7zhtr4SnLC4EBGg9QhkehHRcJN 0rAkPzWFok9Q3JAGpG0JTuD3LBV08X5+CLGXQlSwiA+0/tqekuvRZZ9i/YpIAtJZ mQIDAQAB' drop stage "EDUCATIONDATA"."STAGGINGDWH".SNOWFLAKE_PUSH; drop pipe "EDUCATIONDATA"."STAGGINGDWH".mypipe; CREATE STAGE "EDUCATIONDATA"."STAGGINGDWH".SNOWFLAKE_PUSH; create pipe "EDUCATIONDATA"."STAGGINGDWH".mypipe if not exists as copy into "EDUCATIONDATA"."STAGGINGDWH"."FACTTRANSACTION" from @"EDUCATIONDATA"."STAGGINGDWH"."SNOWFLAKE_PUSH" file_format = CSV; LIST @SNOWFLAKE_PUSH select SYSTEM$PIPE_STATUS('"EDUCATIONDATA"."STAGGINGDWH".mypipe')
true
4e4f19572b6b28f63e3aced633424535eca6b4a0
SQL
Maltasga/pi4-while-true
/Database/01 - Scripts/View SelectUsuarioCompleto.sql
UTF-8
409
3.375
3
[ "MIT" ]
permissive
CREATE VIEW SELECT_USUARIO_COMPLETO ( ID, NOME, EMAIL, LOGIN, SENHA, ATIVO, DT_CADASTRO, ID_PERFIL, NM_PERFIL ) AS ( SELECT U.ID, U.NOME, U.EMAIL, U.LOGIN, U.SENHA, U.ATIVO, U.DT_CADASTRO, P.ID AS 'ID_PERFIL', P.NOME AS 'NM_PERFIL' FROM Usuario U JOIN Perfil P on P.ID = U.ID_PERFIL );
true
464e91f93c3d85ce2354050df44f9383295868e6
SQL
wdb3ar/image-host
/image_host.sql
UTF-8
2,676
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 29, 2018 at 04:41 PM -- 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_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `image_host` -- -- -------------------------------------------------------- -- -- Table structure for table `image` -- CREATE TABLE `image` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) NOT NULL, `path` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `image_tag` -- CREATE TABLE `image_tag` ( `id` int(10) UNSIGNED NOT NULL, `image_id` int(10) UNSIGNED NOT NULL, `tag_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `tag` -- CREATE TABLE `tag` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for dumped tables -- -- -- Indexes for table `image` -- ALTER TABLE `image` ADD PRIMARY KEY (`id`); -- -- Indexes for table `image_tag` -- ALTER TABLE `image_tag` ADD PRIMARY KEY (`id`), ADD KEY `image_id` (`image_id`), ADD KEY `tag_id` (`tag_id`); -- -- Indexes for table `tag` -- ALTER TABLE `tag` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `image` -- ALTER TABLE `image` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `image_tag` -- ALTER TABLE `image_tag` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `tag` -- ALTER TABLE `tag` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `image_tag` -- ALTER TABLE `image_tag` ADD CONSTRAINT `image_tag_ibfk_1` FOREIGN KEY (`image_id`) REFERENCES `image` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `image_tag_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d35b9e54d9382cbf57bdb0bdf8e5da14d3a933ad
SQL
mrv90/Sports-Mission-Control-System
/doc/WednesdaySql.sql
UTF-8
3,786
3.265625
3
[]
no_license
---- delete from pmamor where thozor = '[Empty Value]' --select count(*) from pmamor --select * from pmamor ------------------------------------------------------------------ ---- همه مامورها؛ چه داخل تیم و چه داخل باشگاه، بدون قسمت --select distinct daraje as N'درجه' , names as N'نام‌و‌نشان', nameyegan as N'یگان', reshte as N'رشته', thozor as N'تاریخ‌حضور', tpayan as N'تاریخ‌پایان' --from pmamor --where (daraje is not null and names is not null and nameyegan is not null and thozor is not null and tpayan is not null) ----group by reshte, thozor --order by thozor, reshte asc ------------------------------------------------------------------ ---- کل مامورهای ۹۵ و ۹۶ به تفکیک رشته --select distinct count(*) ----select distinct daraje as N'درجه' , names as N'نام‌و‌نشان', nameyegan as N'یگان', reshte as N'رشته', thozor as N'تاریخ‌حضور', tpayan as N'تاریخ‌پایان' --from pmamor --where (daraje is not null and names is not null and nameyegan is not null and thozor is not null and tpayan is not null) and -- (left(thozor, 2) = N'95' or left(thozor, 2) = N'96' or left(thozor, 4) = N'1395' or left(thozor, 2) = N'1396') ----group by reshte --order by thozor, reshte asc ------------------------------------------------------------------ --select distinct reshte --from pmamor --where (reshte is not null) and (left(thozor, 2) = N'95' or left(thozor, 2) = N'96' or left(thozor, 4) = N'1395' or left(thozor, 2) = N'1396') ---------------------------------------------------------------- --select distinct * --from pmamor --where -- (reshte is not null) and -- (left(thozor, 2) = N'96' or left(thozor, 4) = N'1396') and -- (reshte not in (N'سوارکاري', N'کشتي فرنگي', N'جهت يابي', N'سه گانه', N'هندبال', N'بدمينتون', N'بسکتبال', N'پنجگانه', N'کاراته', N'باستاني', N'جودو', N'کشتي آزاد', N'اسکيت', N'فوتبال', -- N'دفاع شخصي', N'شنا', N'شيرجه', N'واليبال', N'وزنه برداري', N'دو صحرانوردي', N'تکواندو', N'تنيس روي ميز', N'واترپلو', N'فوتبال نزاجا', N'پاورليفتينگ', N'فوتسال', -- N'آمادگي جسماني', N'تيراندازي', N'دووميداني', N'تنيس ارضي', N'کيک بوکسينگ', N'بوکس')) ---------------------------------------------------------------- --select distinct * --from pmamor --where -- (reshte is not null) and -- (left(thozor, 2) = N'95' or left(thozor, 4) = N'1395') and -- (reshte = N'دوچرخه سواري') ---------------------------------------------------------------- --select daraje as N'درجه' , names as N'نام‌و‌نشان', nameyegan as N'یگان', reshte as N'رشته', thozor as N'تاریخ‌حضور', tpayan as N'تاریخ‌پایان' --from pmamor --where -- (reshte is not null) --and (left(thozor, 2) = N'97' or left(thozor, 4) = N'1397') ----and (reshte = N'آمادگي جسماني') --order by reshte asc ---------------------------------------------------------------- --select distinct count(*) --from pmamor --where -- (reshte is not null) --and (left(thozor, 2) = N'97' or left(thozor, 4) = N'1397') --and (reshte = N'کيک بوکسينگ') --select * from pmamor order by pkey desc ---------------------------------------------------------------- select distinct vaziat as N'وضعیت', daraje as N'درجه', names as N'نام‌و‌نشان', nameyegan as N'یگان', reshte as N'رشته', thozor as N'تاریخ‌حضور'--, tpayan from pmamor where tpayan is null or LEN(tpayan) = 0 order by thozor asc
true
ba094715a62e9a0d9a9044c728e63af837fe5398
SQL
kanchw/test
/modules/distribution/resources/migration/mssql.sql
UTF-8
1,057
2.703125
3
[ "LicenseRef-scancode-unknown", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "EPL-1.0", "Classpath-exception-2.0", "GPL-2.0-only", "BSD-3-Clause", "MPL-1.0", "MPL-2.0", "EPL-2.0", "LGPL-2.0-only", "CDDL-1.0", "MIT" ]
permissive
ALTER TABLE AM_SUBSCRIBER ALTER COLUMN USER_ID VARCHAR(255); ALTER TABLE AM_APPLICATION ADD GROUP_ID VARCHAR(100); ALTER TABLE AM_API ADD CONTEXT_TEMPLATE VARCHAR(256); ALTER TABLE AM_APPLICATION_KEY_MAPPING ADD CREATE_MODE VARCHAR(30) DEFAULT 'CREATED'; ALTER TABLE AM_APPLICATION_REGISTRATION ADD TOKEN_SCOPE VARCHAR(256) DEFAULT 'default'; ALTER TABLE AM_APPLICATION_REGISTRATION ADD INPUTS VARCHAR(256); ALTER TABLE AM_API_LC_EVENT ALTER COLUMN USER_ID VARCHAR(255) NOT NULL; UPDATE AM_API SET CONTEXT_TEMPLATE = CONTEXT WHERE CONTEXT_TEMPLATE IS NULL; ALTER TABLE AM_API ADD CREATED_BY VARCHAR(100), CREATED_TIME DATETIME, UPDATED_BY VARCHAR(100), UPDATED_TIME DATETIME; ALTER TABLE AM_SUBSCRIBER ADD CREATED_BY VARCHAR(100), CREATED_TIME DATETIME, UPDATED_BY VARCHAR(100), UPDATED_TIME DATETIME; ALTER TABLE AM_SUBSCRIPTION ADD CREATED_BY VARCHAR(100), CREATED_TIME DATETIME, UPDATED_BY VARCHAR(100), UPDATED_TIME DATETIME; ALTER TABLE AM_APPLICATION ADD CREATED_BY VARCHAR(100), CREATED_TIME DATETIME, UPDATED_BY VARCHAR(100), UPDATED_TIME DATETIME;
true
f33aed2d970dcf8e6a8a812839b67e0e4108d0ab
SQL
andreanhk/intest
/SQL DB Lama/saptest.sql
UTF-8
80,050
2.90625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 03, 2018 at 10:30 AM -- Server version: 10.1.30-MariaDB -- PHP Version: 5.6.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `saptest` -- -- -------------------------------------------------------- -- -- Table structure for table `login_data` -- CREATE TABLE `login_data` ( `loginuid` int(11) NOT NULL, `loginuname` varchar(255) DEFAULT NULL, `loginpwd` varchar(255) DEFAULT NULL, `loginright` int(11) DEFAULT NULL, `date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `login_data` -- INSERT INTO `login_data` (`loginuid`, `loginuname`, `loginpwd`, `loginright`, `date`) VALUES (1, 'admin', 'admin', 1, NULL); -- -------------------------------------------------------- -- -- Table structure for table `m_ba` -- CREATE TABLE `m_ba` ( `id` int(11) NOT NULL, `idba` int(4) NOT NULL, `nameba` varchar(255) NOT NULL, `date_live` date DEFAULT NULL, `p_fico` varchar(255) DEFAULT NULL, `p_mm` varchar(255) DEFAULT NULL, `p_pm` varchar(255) DEFAULT NULL, `p_pp` varchar(255) DEFAULT NULL, `p_sd` varchar(255) DEFAULT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL, `tlba` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `m_ba` -- INSERT INTO `m_ba` (`id`, `idba`, `nameba`, `date_live`, `p_fico`, `p_mm`, `p_pm`, `p_pp`, `p_sd`, `chg_by`, `chg_date`, `tlba`) VALUES (1, 1000, 'Samator', NULL, 'SAPFICO', 'SAPMM', 'SAPPM', 'SAPPP', 'SAPSD', 'Admin', '2018-05-20 17:29:33', NULL), (2, 2000, 'Aneka Gas Industri', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (3, 3000, 'Samator Gas Industri', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (4, 3016, 'SGI Rantau Prapat', '2018-04-01', 'Putra', 'Purwandi', 'Zamroni', 'Abta', 'Alex', 'Admin', '2018-05-26 00:06:59', NULL), (5, 3916, 'SGI Depo Sibolga', '2018-04-01', 'Yohanes', 'Nino', 'Zamroni', 'Rita', 'Suyanto', 'Admin', '2018-05-26 00:07:39', NULL), (6, 2072, 'AGI Manado', '2018-04-01', 'Aris', 'Thomas', 'Achmad', 'Fitri', 'Rendra', 'Admin', '2018-06-03 15:07:54', 'MM'), (7, 2073, 'AGI Ternate', '2018-04-01', 'Aris', 'Thomas', 'Achmad', 'Fitri', 'Rendra', 'Admin', '2018-06-03 15:09:11', 'MM'), (8, 2065, 'AGI Luwuk', '2018-06-01', 'Aris', 'Thomas', 'Zamroni', 'Fitri', 'Suyanto', 'Admin', '2018-06-03 14:58:56', 'SD'); -- -------------------------------------------------------- -- -- Table structure for table `m_check` -- CREATE TABLE `m_check` ( `c_id` int(11) NOT NULL, `ctype` varchar(255) DEFAULT NULL, `ctypedesc` varchar(255) NOT NULL, `ctcode` varchar(255) NOT NULL, `ctable` varchar(255) NOT NULL, `cstat` varchar(255) NOT NULL, `cmodul` varchar(255) DEFAULT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `m_check` -- INSERT INTO `m_check` (`c_id`, `ctype`, `ctypedesc`, `ctcode`, `ctable`, `cstat`, `cmodul`, `chg_by`, `chg_date`) VALUES (1, 'Enterprise Structure', 'Define BA', 'SPRO', 'V_TGSB', 'Create', 'FICO', 'SAPFICO', '2018-05-16 22:54:06'), (2, 'Enterprise Structure', 'Assign Business Area to Consolidation Business Area', 'SPRO', 'V_GSB_A', 'Check', 'FICO', NULL, NULL), (6, 'Financial Accounting (Bank Accounting)', 'Set Up Cash Journal', 'FBCJC0', '', 'Create', 'FICO', NULL, NULL), (7, 'Financial Accounting (Bank Accounting)', 'Define House Banks', 'F112', '', 'Create', 'FICO', NULL, NULL), (8, 'Financial Accounting (Bank Accounting)', 'Create, Change, Delete Business Transactions', 'FBCJC2', '', 'Create', 'FICO', NULL, NULL), (9, 'Financial Accounting (Bank Accounting)', 'Validation in Accounting Documents (workbench req.)', 'OB28', '', 'Create', 'FICO', NULL, NULL), (10, 'Financial Accounting (Asset Accounting)', 'Specify Transfer Date/Last Closed Fiscal Year', 'SPRO', 'V_T093C_08', 'Create', 'FICO', NULL, NULL), (11, 'Financial Accounting (Asset Accounting)', 'Specify Last Period Posted in Prv.System (Transf.During FY)', 'OAYC', '', 'Create', 'FICO', NULL, NULL), (12, 'Financial Supply Chain Mgmt (Cash & Liquidity)', 'Define Cash Management Account Name', 'SPRO', 'V_T035D', 'Create', 'FICO', NULL, NULL), (13, 'Financial Supply Chain Mgmt (Cash & Liquidity)', 'Maintain Structure', 'SPRO', 'V_T038', 'Create', 'FICO', NULL, NULL), (14, 'Controlling (Cost Center Acct)', 'Create Plan Distribution', 'KSV7', '', 'File Checklist PP', 'FICO', NULL, NULL), (15, 'Controlling (Cost Center Acct)', 'Create Plan Assessment', 'KSU7', '', 'File Checklist PP', 'FICO', NULL, NULL), (16, 'Controlling (Cost Center Acct)', 'Edit Automatic Account Assignment', 'OKB9', '', 'Create', 'FICO', NULL, NULL), (17, 'Controlling (Cost Center Acct)', 'Create Actual Distribution', 'KSV1', '', 'File Checklist PP', 'FICO', NULL, NULL), (18, 'Controlling (Cost Center Acct)', 'Create Actual Assessment', 'KSU1', '', 'File Checklist PP', 'FICO', NULL, NULL), (19, 'Product Cost Controlling (Prd Cost Planning)', 'Define Overhead Groups', 'OKZ2', '', 'Create', 'FICO', NULL, NULL), (20, 'Product Cost Controlling', 'Check Special Procurement Types ', 'SPRO', 'V460A', 'Check Only', 'FICO', NULL, NULL), (21, 'Product Cost Controlling (Cost Obj Controlling)', 'Define Cost-Accounting-Relevant Default Values for Order Types and Plants', 'SPRO', 'V_T399X_PC', 'Create', 'FICO', NULL, NULL), (22, 'Product Cost Controlling (Simulatenous Costing)', 'Activate Generation of Cost Log in Repetitive Manufacturing', 'SPRO', 'V_T437D_F', 'Create', 'FICO', NULL, NULL), (23, 'Product Cost Controlling', 'Define Default Variance Keys for Plants', 'OKVW', '', 'Create', 'FICO', NULL, NULL), (24, 'Product Cost Controlling', 'Define Goods Received Valuation for Order Delivery', 'SPRO', 'V_TCO10', 'Create', 'FICO', NULL, NULL), (25, 'Product Cost Controlling (Actual Costing/Ml)', 'Configure Dynamic Price Changes', 'SPRO', 'V_T001K_PR', 'Check Only', 'FICO', NULL, NULL), (26, 'Profitability Analysis (Ent. Controlling)', 'Define Order Type-Dependent Parameters', 'COR4', '', 'Check Only (PP)', 'FICO', NULL, NULL), (27, 'Profitability Analysis (Ent. Controlling)', 'Order Type - Dependent Parameters', 'OPL8', '', 'Check Only (PP)', 'FICO', NULL, NULL), (28, 'Profitability Analysis (Ent. Controlling)', 'Valuation Variant for Order Costing', 'OPK9', '', 'Check Only (PP)', 'FICO', NULL, NULL), (29, 'Profitability Analysis (Ent. Controlling)', 'General Version Define', 'OKEV', '', 'Check Only', 'FICO', NULL, NULL), (30, 'Maintain Table View', 'Mapping cost center untuk transaksi input Profit Segment', 'SM30', 'ZMAPCOSTCENTER', 'Create', 'FICO', NULL, NULL), (31, 'Maintain Table View', 'Mapping GL Account Cash Clrg/Bank utk UJB', 'SM30', 'ZREG_UJB_MAPV', 'Create', 'FICO', NULL, NULL), (32, 'Maintain Table View', 'Daftar no sertifikat UJB yg berlaku', 'SM30', 'ZUJB_NUMRANGE', 'Create', 'FICO', NULL, NULL), (33, 'Enterprise Structure (Logistic General)', 'Plant', 'OX10', '', 'Create', 'MM', NULL, NULL), (34, 'Enterprise Structure (Logistic General)', 'Plant Parameters', 'SM30', 'V_159L', 'Create', 'MM', NULL, NULL), (35, 'Enterprise Structure (Logistic General)', 'Assign plant ke company code', 'OX18', '', 'Create', 'MM', NULL, NULL), (36, 'Enterprise Structure (Logistic General)', 'Assign BA ke plant dan divisi', 'OMJ7', '', 'Create', 'MM', NULL, NULL), (37, 'Enterprise Structure (Logistic General)', 'Create & Assign Porg ke Plant', 'OX08 ; OX17', '', 'Create', 'MM', NULL, NULL), (38, 'Enterprise Structure (Logistic General)', 'Create Purchasing group', 'OME4', '', 'Create', 'MM', NULL, NULL), (39, 'Enterprise Structure (Logistic General)', 'Storage Location', 'OX09', '', 'Create', 'MM', NULL, NULL), (40, 'Enterprise Structure (Logistic General)', 'Create/Check TOP (Term Of Payment)', 'OME2', '', 'Check Only', 'MM', NULL, NULL), (41, 'Enterprise Structure (Logistic General)', 'Assign standard purchasing organization to plant ', 'SM30', 'V_001W_E', 'Create', 'MM', NULL, NULL), (42, 'Enterprise Structure (Logistic General)', 'Define Stock Determinationgroup', 'OSPX', '', 'Create', 'MM', NULL, NULL), (43, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Production Order', 'OPJ2', '', 'Create', 'MM', NULL, NULL), (44, 'Enterprise Structure (Logistic General)', 'Define Control Data for Pull List', 'SPRO', '', 'Create', 'MM', NULL, NULL), (45, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Pull list', 'SM30', 'V_T435W_BF', 'Check Only', 'MM', NULL, NULL), (46, 'Enterprise Structure (Logistic General)', 'Define Storage Location MRP per Plant', 'SM30', 'V_T001L_D', 'Create', 'MM', NULL, NULL), (47, 'Enterprise Structure (Logistic General)', 'Account deteremnination for valuation areas', 'OMWD', '', 'Check Only', 'MM', NULL, NULL), (48, 'Setting field selection material type', 'Create/Check Unit of Measure', 'CUNI', '', 'Check Only', 'MM', NULL, NULL), (49, 'Setting field selection material type', 'Create material group', 'OMSF', '', 'Check Only', 'MM', NULL, NULL), (50, 'Setting field selection material type', 'Configure Split valuation', 'OMWC', '', 'Create', 'MM', NULL, NULL), (51, 'Setting field selection material type', 'Define Attributes of Material Types', 'T134M', '', 'Create', 'MM', NULL, NULL), (52, 'Modify/Define MRP Type', 'Create type PURCHASE REQUISITION (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, NULL), (53, 'Modify/Define MRP Type', 'Create type PURCHASE ORDER (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, NULL), (54, 'Modify/Define MRP Type', 'Create & Check Schema Prosedure', 'V_TMKE', '', 'Check Only', 'MM', NULL, NULL), (55, 'Modify/Define MRP Type', 'Create/Define condition type PO', 'V_T685A', '', 'Check Only', 'MM', NULL, NULL), (56, 'Modify/Define MRP Type', 'Carry Out Overall Maint of MRP Groups', 'ZPRD, ZRAW, ZSPR, ZSUP', 'OMD1', 'Create', 'MM', NULL, NULL), (57, 'Modify/Define MRP Type', 'Define MRP Group for Each Material Type', 'V_TMW00', '', 'Create', 'MM', NULL, NULL), (58, 'Modify/Define MRP Type', 'Define MRP Controllers', 'PIC ZPRD, PIC ZRAW, PIC ZSPR, PIC ZSUP', 'V_T024D', 'Create', 'MM', NULL, NULL), (59, 'Modify/Define MRP Type', 'Define Special Procurement Types', 'V460A', '', 'Create', 'MM', NULL, NULL), (60, 'Modify/Define MRP Type', 'Carry Out Overall Maintenance of Plant Parameter', 'V438M', '', 'Create', 'MM', NULL, NULL), (61, 'Modify/Define MRP Type', 'Define Document Life', 'V_159R', '', 'Create', 'MM', NULL, NULL), (62, 'Maintain account assigment category', 'Purchase Requisition, Release Procedure, Procedure with Classification, Set Up Procedure with Classification', 'SPRO', 'V_T16FS', 'Create', 'MM', NULL, NULL), (63, 'Maintain account assigment category', 'Create release strategy PURCHASE REQUISITION', 'T16FK', '', 'Create', 'MM', NULL, NULL), (64, 'Maintain account assigment category', 'Create release CODE PURCHASE ORDER', 'VV_T16FC_2', '', 'Create', 'MM', NULL, NULL), (65, 'Maintain account assigment category', 'Create release strategy PURCHASE ORDER', 'V_T16FS', '', 'Create', 'MM', NULL, NULL), (66, 'Maintain account assigment category', 'Create/check movement type', 'OMJJ', '', 'Check Only', 'MM', NULL, NULL), (67, 'Maintain account assigment category', 'Configure automatic posting', 'OBYC', '', 'Check Only', 'MM', NULL, NULL), (68, 'Maintain account assigment category', 'Create reason for movement', 'V_157L', '', 'Check Only', 'MM', NULL, NULL), (69, 'Maintain account assigment category', 'Defaul value of doc type', 'V_T160', '', 'Check Only', 'MM', NULL, NULL), (70, 'Maintain account assigment category', 'Set tolerance limits', 'V_169G', '', 'Check Only', 'MM', NULL, NULL), (71, 'Maintain account assigment category', 'Define permissible partner role per accout group', '', '', '', 'MM', NULL, NULL), (72, 'Maintain account assigment category', 'Set Check for duplicate invoice', '', '', '', 'MM', NULL, NULL), (73, 'Maintain account assigment category', 'Maintai default value per tax code', 'V_169V_ST', '', 'Check Only', 'MM', NULL, NULL), (74, 'Maintain account assigment category', 'Allow freezing of book inventory balance in stor loc', '', '', '', 'MM', NULL, NULL), (75, 'Maintain account assigment category', 'Define text type for header text', '', '', '', 'MM', NULL, NULL), (76, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PR', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, NULL), (77, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PR Interbranch & STO', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, NULL), (78, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, NULL), (79, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PO Interbranch & STO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, NULL), (80, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Nopol Kend Botolan u/ TTBK, Packing', 'SM30', 'ZNKEND', '-', 'MM', NULL, NULL), (81, 'Maintain MM02', 'Field Material Original Terkait KKF3', 'MM02', '', '-', 'MM', NULL, NULL), (82, 'Maintain MM02', 'Trading field', 'MM02', '', '-', 'MM', NULL, NULL), (83, 'Enterprise Structure (Logistic General)', 'Plant', 'OX10', '', 'Create', 'MM', NULL, NULL), (84, 'Enterprise Structure (Logistic General)', 'Plant Parameters', 'SM30', 'V_159L', 'Create', 'MM', NULL, NULL), (85, 'Enterprise Structure (Logistic General)', 'Assign plant ke company code', 'OX18', '', 'Create', 'MM', NULL, NULL), (86, 'Enterprise Structure (Logistic General)', 'Assign BA ke plant dan divisi', 'OMJ7', '', 'Create', 'MM', NULL, NULL), (87, 'Enterprise Structure (Logistic General)', 'Create & Assign Porg ke Plant', 'OX08 ; OX17', '', 'Create', 'MM', NULL, NULL), (88, 'Enterprise Structure (Logistic General)', 'Create Purchasing group', 'OME4', '', 'Create', 'MM', NULL, NULL), (89, 'Enterprise Structure (Logistic General)', 'Storage Location', 'OX09', '', 'Create', 'MM', NULL, NULL), (90, 'Enterprise Structure (Logistic General)', 'Create/Check TOP (Term Of Payment)', 'OME2', '', 'Check Only', 'MM', NULL, NULL), (91, 'Enterprise Structure (Logistic General)', 'Assign standard purchasing organization to plant ', 'SM30', 'V_001W_E', 'Create', 'MM', NULL, NULL), (92, 'Enterprise Structure (Logistic General)', 'Define Stock Determinationgroup', 'OSPX', '', 'Create', 'MM', NULL, NULL), (93, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Production Order', 'OPJ2', '', 'Create', 'MM', NULL, NULL), (94, 'Enterprise Structure (Logistic General)', 'Define Control Data for Pull List', 'SPRO', '', 'Create', 'MM', NULL, NULL), (95, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Pull list', 'SM30', 'V_T435W_BF', 'Check Only', 'MM', NULL, NULL), (96, 'Enterprise Structure (Logistic General)', 'Define Storage Location MRP per Plant', 'SM30', 'V_T001L_D', 'Create', 'MM', NULL, NULL), (97, 'Enterprise Structure (Logistic General)', 'Account deteremnination for valuation areas', 'OMWD', '', 'Check Only', 'MM', NULL, NULL), (98, 'Setting field selection material type', 'Create/Check Unit of Measure', 'CUNI', '', 'Check Only', 'MM', NULL, NULL), (99, 'Setting field selection material type', 'Create material group', 'OMSF', '', 'Check Only', 'MM', NULL, NULL), (100, 'Setting field selection material type', 'Configure Split valuation', 'OMWC', '', 'Create', 'MM', NULL, NULL), (101, 'Setting field selection material type', 'Define Attributes of Material Types', 'T134M', '', 'Create', 'MM', NULL, NULL), (102, 'Modify/Define MRP Type', 'Create type PURCHASE REQUISITION (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, NULL), (103, 'Modify/Define MRP Type', 'Create type PURCHASE ORDER (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, NULL), (104, 'Modify/Define MRP Type', 'Create & Check Schema Prosedure', 'V_TMKE', '', 'Check Only', 'MM', NULL, NULL), (105, 'Modify/Define MRP Type', 'Create/Define condition type PO', 'V_T685A', '', 'Check Only', 'MM', NULL, NULL), (106, 'Modify/Define MRP Type', 'Carry Out Overall Maint of MRP Groups', 'ZPRD, ZRAW, ZSPR, ZSUP', 'OMD1', 'Create', 'MM', NULL, NULL), (107, 'Modify/Define MRP Type', 'Define MRP Group for Each Material Type', 'V_TMW00', '', 'Create', 'MM', NULL, NULL), (108, 'Modify/Define MRP Type', 'Define MRP Controllers', 'PIC ZPRD, PIC ZRAW, PIC ZSPR, PIC ZSUP', 'V_T024D', 'Create', 'MM', NULL, NULL), (109, 'Modify/Define MRP Type', 'Define Special Procurement Types', 'V460A', '', 'Create', 'MM', NULL, NULL), (110, 'Modify/Define MRP Type', 'Carry Out Overall Maintenance of Plant Parameter', 'V438M', '', 'Create', 'MM', NULL, NULL), (111, 'Modify/Define MRP Type', 'Define Document Life', 'V_159R', '', 'Create', 'MM', NULL, NULL), (112, 'Maintain account assigment category', 'Purchase Requisition, Release Procedure, Procedure with Classification, Set Up Procedure with Classification', 'SPRO', 'V_T16FS', 'Create', 'MM', NULL, NULL), (113, 'Maintain account assigment category', 'Create release strategy PURCHASE REQUISITION', 'T16FK', '', 'Create', 'MM', NULL, NULL), (114, 'Maintain account assigment category', 'Create release CODE PURCHASE ORDER', 'VV_T16FC_2', '', 'Create', 'MM', NULL, NULL), (115, 'Maintain account assigment category', 'Create release strategy PURCHASE ORDER', 'V_T16FS', '', 'Create', 'MM', NULL, NULL), (116, 'Maintain account assigment category', 'Create/check movement type', 'OMJJ', '', 'Check Only', 'MM', NULL, NULL), (117, 'Maintain account assigment category', 'Configure automatic posting', 'OBYC', '', 'Check Only', 'MM', NULL, NULL), (118, 'Maintain account assigment category', 'Create reason for movement', 'V_157L', '', 'Check Only', 'MM', NULL, NULL), (119, 'Maintain account assigment category', 'Defaul value of doc type', 'V_T160', '', 'Check Only', 'MM', NULL, NULL), (120, 'Maintain account assigment category', 'Set tolerance limits', 'V_169G', '', 'Check Only', 'MM', NULL, NULL), (121, 'Maintain account assigment category', 'Define permissible partner role per accout group', '', '', '', 'MM', NULL, NULL), (122, 'Maintain account assigment category', 'Set Check for duplicate invoice', '', '', '', 'MM', NULL, NULL), (123, 'Maintain account assigment category', 'Maintai default value per tax code', 'V_169V_ST', '', 'Check Only', 'MM', NULL, NULL), (124, 'Maintain account assigment category', 'Allow freezing of book inventory balance in stor loc', '', '', '', 'MM', NULL, NULL), (125, 'Maintain account assigment category', 'Define text type for header text', '', '', '', 'MM', NULL, NULL), (126, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PR', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, NULL), (127, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PR Interbranch & STO', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, NULL), (128, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, NULL), (129, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Kombinasi PO Interbranch & STO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, NULL), (130, 'Maintain tabel/field program Tcode SM30 CLIENT 400', 'Nopol Kend Botolan u/ TTBK, Packing', 'SM30', 'ZNKEND', '-', 'MM', NULL, NULL), (131, 'Maintain MM02', 'Field with qty Structure terkait KKF3', 'MM02', '', '-', 'MM', NULL, NULL), (132, 'Maintain MM02', 'Field Material Original Terkait KKF3', 'MM02', '', '-', 'MM', NULL, NULL), (133, 'Maintain MM02', 'Trading field', 'MM02', '', '-', 'MM', NULL, NULL), (134, 'Maintain MM02', 'Field Volume botol MP, MC, MS', 'MM02', '', '-', 'MM', NULL, NULL), (135, 'MARA-XCHPF', 'Batch management botol BMC', 'MM02 / MM17', '', '-', 'MM', NULL, NULL), (136, 'MARA-XCHPF', 'Revenue Stream (copy plant lain)', 'MM02 / MM17', '', '-', 'MM', NULL, NULL), (137, 'Maintain Release PR/PO', 'Assign Objects to Classes ? Class Type : 032 FRG_EKKO [223]', 'CL20N', '', 'Create', 'MM', NULL, NULL), (138, 'Maintain Release PR/PO', 'Assign Objects to Classes ? FRG_EBAN', 'CL20N', '', 'Create', 'MM', NULL, NULL), (139, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? FRG_EKKO', 'CL24N', '', 'Create', 'MM', NULL, NULL), (140, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? FRG_EBAN', 'CL24N', '', 'Create', 'MM', NULL, NULL), (141, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? INTERBranch', 'CL24N', '', 'Create', 'MM', NULL, NULL), (142, 'Variant Report', 'ZMMSQVI_RMD untuk interbranch', 'ZMMSQVI_RMD', '', 'Create', 'MM', NULL, NULL), (143, 'Master Data PM', 'Maintain Maintenance Planning Plant', 'SPRO', '', 'Define', 'PM', NULL, NULL), (144, 'Master Data PM', 'Assign Maintenance Planning Plant to Maintenance Plant', 'SPRO', '', 'Assign', 'PM', NULL, NULL), (145, 'Master Data PM', 'Planner Groups', 'SPRO', '', 'Define', 'PM', NULL, NULL), (146, 'Master Data PM', 'Maintenance Planner Groups', 'SPRO', '', 'Check or Define', 'PM', NULL, NULL), (147, 'Master Data PM', 'Employees Responsible for Work Centers', 'SPRO', '', 'Define', 'PM', NULL, NULL), (148, 'Notifikasi', 'Planner Groups', 'SPRO', '', 'Check ', 'PM', NULL, NULL), (149, 'Maintenance Order', 'Assign Order Types to Maintenance Plants', 'OIOD', '', 'Create', 'PM', NULL, NULL), (150, 'Maintenance Order', 'Default Order Types for Maintenance Items', 'SPRO', '', 'Assign', 'PM', NULL, NULL), (151, 'Maintenance Order', 'Maintain Default Values for Control Keys for Order Types', 'OIO6', '', 'Assign \"PM01\"', 'PM', NULL, NULL), (152, 'Maintenance Order', 'Assign Costing parameters and Result Analysis Keys', 'OIOF', '', 'Assign \"PM01\"', 'PM', NULL, NULL), (153, 'Maintenance Order', 'Change Docs, Collective Purc.Req.Indicator, Operation No.Interval', 'SPRO', '', 'Assign', 'PM', NULL, NULL), (154, 'Maintenance Order', 'Documentation for Goods Movement for the Order', 'SPRO', '', 'Tick', 'PM', NULL, NULL), (155, 'Maintenance Order', 'Inspection Control', 'OIOI', '', 'Define', 'PM', NULL, NULL), (156, 'Maintenance Order', 'Default Values for Component Item Categories', 'SPRO', '', 'Define', 'PM', NULL, NULL), (157, 'Maintenance Order', 'Activate Default Value for Current Date as Basic date', 'SPRO', '', 'Tick', 'PM', NULL, NULL), (158, 'Maintenance Order', 'Default Values for Units for Operation', 'OIO9', '', 'Define', 'PM', NULL, NULL), (159, 'Maintenance Order', 'Set Scheduling Paramaters', 'OPU7', '', 'Define', 'PM', NULL, NULL), (160, 'Maintenance Order', 'Control Parameters for Completion Confirmations', 'SPRO', '', 'Define', 'PM', NULL, NULL), (161, 'General ', 'Define Shift Sequence', 'OP4A', '', '', 'PP', NULL, NULL), (162, 'General ', 'Define Order Types', 'OPJH', '', '', 'PP', NULL, NULL), (163, 'MRP, Prd.Order', 'Define scheduling parameters for Production orders ', 'OPU3 ( 2*/ 1*/ 3* ) RWK,SER', '', 'Create', 'PP', NULL, NULL), (164, 'MRP, Prd.Order', 'Define scheduling parameters for planned orders ', 'OPU5', '', 'Create', 'PP', NULL, NULL), (165, 'MRP, Prd.Order', 'Production Scheduling Profiles', 'OPKP ( 00001, 00002 )', '', 'Create', 'PP', NULL, NULL), (166, 'MRP, Prd.Order', 'Production Scheduler', 'OPJ9', '', 'Create', 'PP', NULL, NULL), (167, 'MRP, Prd.Order', 'Define MRP Controllers', 'OMD0 ( mrp..... )', '', 'Create', 'PP', NULL, NULL), (168, 'MRP, Prd.Order', 'Carryout Overall Maintenance of MRP Group', 'OPPZ ( Z* .... )', '', 'Create', 'PP', NULL, NULL), (169, 'MRP, Prd.Order', 'Define Scope of Total Planning', 'OM0E ( nama plant )', '', 'Create', 'PP', NULL, NULL), (170, 'MRP, Prd.Order', 'Define MRP Creation Indicator', 'SPRO', '', 'Create', 'PP', 'Admin', '2018-05-28 21:33:30'), (171, 'MRP, Prd.Order', 'Define Order Type-Dependent Parameter', 'OPL8 ( 2*/1*/3* )', '', 'Create', 'PP', NULL, NULL), (172, 'MRP, Prd.Order', 'Tambahan centang PP01, Implementation', '', '', 'Check', 'PP', NULL, NULL), (173, 'MRP, Prd.Order', 'Define Confirmation Parameter', 'OPK4 (2*/1*/3* )', '', 'Create', 'PP', NULL, NULL), (174, 'MRP, Prd.Order', 'Define Default Value', 'OPJG', '', 'Create', 'PP', NULL, NULL), (175, 'MRP, Prd.Order', 'Maintain Checking Control', 'OPJK', '', 'Create', 'PP', NULL, NULL), (176, 'MRP, Prd.Order', 'Activate MRP dan Set up Planning File', 'OMDU', '', 'Check', 'PP', NULL, NULL), (177, 'MRP, Prd.Order', 'Define Order Type for Conversion to Production/Process Order', 'OPPE', '', 'Create', 'PP', NULL, NULL), (178, 'MRP, Prd.Order', 'Define MRP group for each Material group', 'OPPR', '', 'Create', 'PP', NULL, NULL), (179, 'MRP, Prd.Order', 'Define Planning Horizon', 'OMDX', '', 'Create', 'PP', NULL, NULL), (180, 'MRP, Prd.Order', 'Define parameter for determining basic dates', 'SPRO', '', 'Check', 'PP', 'Admin', '2018-05-28 21:33:40'), (181, 'MRP, Prd.Order', 'Define available check for component', 'OPPJ', '', 'Create', 'PP', NULL, NULL), (182, 'MRP, Prd.Order', 'Maintain carry out maintenance all', 'OPPQ', '', 'alll maint', 'PP', NULL, NULL), (183, 'MRP, Prd.Order', 'Set Up Production Scheduler Group', 'OPCH', '', 'Create', 'PP', NULL, NULL), (184, 'MRP, Prd.Order', 'Define Production Scheduling for Process Orders ', 'CORY', '', 'Create', 'PP', NULL, NULL), (185, 'MRP, Prd.Order', 'Determinine Person Responsible - work Center', 'SPRO Production - Basic Data - Work Center - General Data - Determine Person Responsible', '', 'Create', 'PP', 'Admin', '2018-05-26 11:22:07'), (186, 'MRP, Prd.Order', 'valuation variants order costing', 'OPK9', '', 'Create', 'PP', NULL, NULL), (187, 'MRP, Prd.Order', 'Order type - dependent parameters', 'COR4', '', 'Create', 'PP', NULL, NULL), (188, 'Maintain tabel/field program ', 'Sloc Kode Material', 'SM30', 'ZBOTOL_SLOC', 'Check Only', 'PP', NULL, NULL), (189, 'Maintain tabel/field program ', 'Kode + isi Botol', 'SM30', 'ZCAP_BOTOL', 'Check Only', 'PP', NULL, NULL), (190, 'Maintain tabel/field program ', 'LIVE PP', 'SM30', 'ZLIVE_PP', 'centang', 'PP', NULL, NULL), (191, 'Maintain tabel/field program ', 'LIVE PP + BATCH', 'SM30', 'ZLIVE_BATCH', 'centang', 'PP', NULL, NULL), (192, 'Maintain tabel/field program', 'Kapasitas Produksi', 'ZPPENH016', 'Kapasitas Design, Kapasitas Commisioning', 'Create', 'PP', NULL, NULL), (193, 'Maintain tabel/field program', 'Mode ASP', 'ZPPENH016', 'Mode ASP 1/ 2', 'Create', 'PP', NULL, NULL), (194, 'Maintain tabel/field program', 'Bahan Baku Mixed Gas', 'ZPPENH016', 'Kode material Mixed Gas Bahan baku yang dipakai Mixed Gas', 'Create', 'PP', NULL, NULL), (195, 'Maintain tabel/field program', 'Map Plant dan sloc mixed Gas', 'ZPPENH016', 'Sloc mixed Gas', 'Create', 'PP', NULL, NULL), (196, 'Maintain tabel/field program', 'Mapping SlocPipeline', 'ZPPENH016', 'Produksi Pipeline yang ada', 'Create', 'PP', NULL, NULL), (197, 'Maintain tabel/field program', 'Mapping Sloc tangki', 'ZPPENH016', 'Sloc tangki yang dipakai produksi', 'Create', 'PP', NULL, NULL), (198, 'Maintain tabel/field program', 'Mapping Sloc transfer', 'ZPPENH016', 'Mapping mobil distribusi yang dipakai per kode material', 'Create', 'PP', NULL, NULL), (199, 'Maintain tabel/field program', 'Mapping report PP', 'ZPPENH016', 'Mapping report PP yg dikirim lewat email', 'Via Email', 'PP', NULL, NULL), (200, 'Enterprise Structure (Financial Accounting)', 'Define company', 'OX15', '', 'Check Only', 'SD', NULL, NULL), (201, 'Enterprise Structure (Financial Accounting)', 'Define Credit Control Area', 'OB45', '', 'Check Only', 'SD', NULL, NULL), (202, 'Enterprise Structure (Financial Accounting)', 'Define Business Area', 'OX03', '', 'Check Only', 'SD', NULL, NULL), (203, 'Enterprise Structure (Logistics-Plant)', 'Define Plant', 'OX10', '', 'Check Only', 'SD', NULL, NULL), (204, 'Enterprise Structure (Logistics-Division)', 'Define Division', 'OVXD', 'V_TSPA', 'Check Only', 'SD', NULL, NULL), (205, 'Enterprise Structure (Sales & Distribution)', 'Define, copy, delete, check sales organization', 'OVX5', 'V_TVKO', 'Create', 'SD', NULL, NULL), (206, 'Enterprise Structure (Sales & Distribution)', 'Define, copy, delete, check distribution channel', 'OVXI', 'V_TVTW', 'Check Only', 'SD', NULL, NULL), (207, 'Enterprise Structure (Sales & Distribution)', 'Maintain sales office', 'OVX1', 'V_TVBUR', 'Create', 'SD', NULL, NULL), (208, 'Enterprise Structure (Logistics Execution)', 'Define, copy, delete, check shipping point', 'OVXD', 'V_TVST', 'Create', 'SD', NULL, NULL), (209, 'Enterprise Structure (Logistics General)', 'Assign Business Area to Plant/Valuation Area and Division', 'OMJ7', '', 'Create', 'SD', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `m_modul` -- CREATE TABLE `m_modul` ( `id` int(11) NOT NULL, `idmodul` varchar(255) NOT NULL, `namemodul` varchar(255) NOT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `m_modul` -- INSERT INTO `m_modul` (`id`, `idmodul`, `namemodul`, `chg_by`, `chg_date`) VALUES (1, 'ABAP', 'ABAP', 'Admin', '2018-06-03 00:46:07'), (2, 'BASIS', 'Basis', 'Admin', '2018-06-03 00:46:12'), (3, 'FICO', 'Financial Controlling', NULL, NULL), (4, 'MM', 'Materials Management', NULL, NULL), (5, 'PM', 'Plant Maintenance', NULL, NULL), (6, 'PP', 'Production Planning', NULL, NULL), (7, 'SD', 'Sales & Distribution', NULL, NULL), (8, 'HR', 'Human Resource', NULL, NULL), (10, 'TEST', 'Test Modul', 'Admin', '2018-05-13 16:53:07'); -- -------------------------------------------------------- -- -- Table structure for table `m_uat_scn` -- CREATE TABLE `m_uat_scn` ( `uat_id` int(11) NOT NULL, `uat_scn` varchar(255) NOT NULL, `uat_desc` varchar(255) NOT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `m_uat_scn` -- INSERT INTO `m_uat_scn` (`uat_id`, `uat_scn`, `uat_desc`, `chg_by`, `chg_date`) VALUES (1, 'Penjualan Botolan Reguler (MTS)', 'Penjualan gas dalam botol hasil produksi & sparepart ke Customer & IB Sales Order, Terima Botol Kosong, Produksi, Distribusi, Billing, Pelunasan A/R', NULL, NULL), (2, 'Pembelian Bahan Baku', 'Pembelian Bahan Baku', NULL, NULL), (3, 'Pembelian Barang Dagangan Gas', 'Pembelian Bahan Baku', NULL, NULL), (4, 'Penjualan Botolan IB MTS (INTERBRANCH)', 'Penjualan gas dalam botol hasil produksi & sparepart ke Customer & IB Sales Order, Terima Botol Kosong, Produksi, Distribusi, Billing, Pelunasan A/R', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `m_uat_step` -- CREATE TABLE `m_uat_step` ( `id_step` int(11) NOT NULL, `uat_scn` varchar(255) DEFAULT NULL, `no_step` int(11) NOT NULL, `bp_step` varchar(255) NOT NULL, `tcode_step` varchar(255) NOT NULL, `user_step` varchar(255) NOT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `m_uat_step` -- INSERT INTO `m_uat_step` (`id_step`, `uat_scn`, `no_step`, `bp_step`, `tcode_step`, `user_step`, `chg_by`, `chg_date`) VALUES (1, 'Penjualan Botolan Reguler (MTS)', 1, 'Buat Sales Order', 'VA01', 'Sales Counter', NULL, NULL), (2, 'Penjualan Botolan Reguler (MTS)', 2, 'Release SO (Credit Management)', 'ZSDENH006', 'Management', NULL, NULL), (3, 'Penjualan Botolan Reguler (MTS)', 3, 'Cetak SO', 'VA03', 'Sales Counter', NULL, NULL), (4, 'Penjualan Botolan Reguler (MTS)', 4, 'Perintah Packing oleh Sales Counter', 'ZSDENH039', 'Sales Counter', NULL, NULL), (5, 'Penjualan Botolan Reguler (MTS)', 5, 'Create TTBK & GR ke Sloc Empty Pack', 'ZMMENH025', 'Adm.Panggung', NULL, NULL), (6, 'Penjualan Botolan Reguler (MTS)', 6, 'Konfirmasi SO & Buat Inquiry Jika Ada Pekerjaan Tambahan (Khusus MR)', 'ZSDENH040', 'Panggung', NULL, NULL), (7, 'Penjualan Botolan Reguler (MTS)', 7, 'Report', 'ZSDRPT047', 'Panggung', NULL, NULL), (8, 'Penjualan Botolan Reguler (MTS)', 8, 'Konversi Inquiry ke SO setelah konfirm ke relasi (Khusus MR)', 'ZSDENH043', 'Sales Counter', NULL, NULL), (9, 'Penjualan Botolan Reguler (MTS)', 9, 'Report', 'ZSDRPT047', 'Sales Counter', NULL, NULL), (10, 'Penjualan Botolan Reguler (MTS)', 10, 'Prosedur Running MRP & Create PRO MTS', 'ZSDENH043', 'PPIC', NULL, NULL), (11, 'Penjualan Botolan Reguler (MTS)', 11, 'Input Hasil Produksi', 'ZPPENH001', 'Produksi', NULL, NULL), (12, 'Penjualan Botolan Reguler (MTS)', 12, 'Transfer Packing dari Sloc Full Pack ke Sloc Distribusi', 'ZSDENH040', 'Adm.Panggung', NULL, NULL), (13, 'Penjualan Botolan Reguler (MTS)', 13, 'Cetak Packing List (Dilampirkan di SO)', 'ZSDENH040', 'Adm.Panggung', NULL, NULL), (14, 'Penjualan Botolan Reguler (MTS)', 14, 'Posting (GI) Surat Jalan', 'VL01N', 'Distribusi/Logistik', NULL, NULL), (15, 'Penjualan Botolan Reguler (MTS)', 15, 'Posting (GI) Surat Jalan', 'VL02N', 'Distribusi/Logistik', NULL, NULL), (16, 'Penjualan Botolan Reguler (MTS)', 16, 'Cetak Surat Jalan', 'VL03N', 'Distribusi/Logistik', NULL, NULL), (17, 'Penjualan Botolan Reguler (MTS)', 17, 'Create Invoice', 'VF01', 'Adm.Penjualan', NULL, NULL), (18, 'Penjualan Botolan Reguler (MTS)', 18, 'Cetak Invoice', 'VF03', 'Adm.Penjualan', NULL, NULL), (19, 'Penjualan Botolan Reguler (MTS)', 19, 'Cetak Faktur Pajak', 'ZFIRPT038', 'Adm.Penjualan', NULL, NULL), (20, 'Penjualan Botolan Reguler (MTS)', 20, 'Terima Plns dari Customer via Bank BCA Test Transfer', 'F-21', 'GL Bank', NULL, NULL), (21, 'Penjualan Botolan Reguler (MTS)', 21, 'Account Clear AR', 'F-32', 'Adm.Piutang', NULL, NULL), (22, 'Pembelian Bahan Baku', 1, 'Bon Permintaan Manual', 'MANUAL', 'Marketing', NULL, NULL), (23, 'Pembelian Bahan Baku', 2, 'Create PR', 'ME51N', 'Gudang', NULL, NULL), (24, 'Pembelian Bahan Baku', 3, 'Release PR (diwakilkan oleh Akuntansi)', 'ME55', 'Kepala Filling', NULL, NULL), (25, 'Pembelian Bahan Baku', 4, 'Create PO', 'ME21N', 'Pembelian', NULL, NULL), (26, 'Pembelian Bahan Baku', 5, 'Release PO (Hubungi tim untuk release PO)', 'ME28', 'Manager/GM/Direktur', NULL, NULL), (27, 'Pembelian Bahan Baku', 6, 'Cetak PO - 1', 'ME22N', 'Pembelian', NULL, NULL), (28, 'Pembelian Bahan Baku', 7, 'Cetak PO - 2', 'ZMMRPT001', 'Pembelian', NULL, NULL), (29, 'Pembelian Bahan Baku', 8, 'LPB Bahan Baku Liquid', 'MIGO', 'Gudang', NULL, NULL), (30, 'Pembelian Bahan Baku', 9, 'Losses Pembelian', 'ZMMENH012', 'Gudang', NULL, NULL), (31, 'Pembelian Bahan Baku', 10, 'Transfer SLOC LIQUID', 'ZMMENH012', 'Gudang', NULL, NULL), (32, 'Pembelian Bahan Baku', 11, 'Print LPB', 'ZMMRPT001', 'Gudang', NULL, NULL), (33, 'Pembelian Bahan Baku', 12, 'Pengakuan Hutang', 'MIRO', 'Akuntansi', NULL, NULL), (34, 'Pembelian Bahan Baku', 13, 'Pelunasan Hutang via Cash', 'FBCJ', 'Kasir', NULL, NULL), (35, 'Pembelian Bahan Baku', 14, 'Pelunasan Hutang via Bank', 'F-42', 'Kasir', NULL, NULL), (36, 'Pembelian Bahan Baku', 15, 'Clear Hutang', 'F-44', 'Akuntansi', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `userno` int(4) NOT NULL, `userid` varchar(255) NOT NULL, `userpwd` varchar(255) NOT NULL, `userlname` varchar(255) NOT NULL, `usermodul` varchar(255) DEFAULT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`userno`, `userid`, `userpwd`, `userlname`, `usermodul`, `chg_by`, `chg_date`) VALUES (1, 'Admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', 'ABAP', NULL, NULL), (2, 'Andrean', '0969f3b18795cb6cba11a76a807b5702', 'Andrean HK', 'BASIS', 'Admin', '2018-05-16 22:51:18'), (10, 'Sony', 'd239371fa97f976721de3f6d04dac38d', 'Sony', 'ABAP', NULL, NULL), (11, 'Ferry', '1944557e5d7c92c80e71c752687ccd53', 'Ferry', 'ABAP', NULL, NULL), (12, 'Faris', 'e36b7dbb6a0d2785a2bc9e08abb28857', 'Faris', 'ABAP', NULL, NULL), (13, 'Johan', '4a2f14c39084e6aa681d940d62852a67', 'Johan', 'ABAP', NULL, NULL), (14, 'Tjandra', 'f7f0e971ba52e4c7998fe8c332c4400c', 'Tjandra', 'BASIS', NULL, NULL), (16, 'Nurnia', '032961f455a35d43cb30e38be21c8886', 'Nurnia', 'FICO', NULL, NULL), (17, 'Yohanes', '3e6bac435ca83d5bf08b2ea9d1605c40', 'Yohanes', 'FICO', NULL, NULL), (18, 'Putra', '89c124640bac613a07396ae9445069c4', 'Putra', 'FICO', NULL, NULL), (19, 'Aris', '0710b4a5e9dfaf1f01d538d41cb66744', 'Aris', 'FICO', 'Aris', '2018-06-02 02:53:45'), (20, 'Purwandi', 'db262090fe0628ad0c8286bdeb18160e', 'Purwandi', 'MM', NULL, NULL), (21, 'Nino', 'cdb7c28a5c9d02ac0aa9c42f68bb06d1', 'Nino', 'MM', NULL, NULL), (22, 'Thomas', 'fe712a1ff3e1626715a33f16a799bbe8', 'Thomas', 'MM', 'Thomas', '2018-06-02 02:44:50'), (23, 'Zamroni', '0c03841cd1a3ffa00b31f4af9567bf1f', 'Zamroni', 'PM', NULL, NULL), (24, 'Achmad', '489e590f395450e2b539aca47c261dd9', 'Achmad', 'PM', 'Admin', '2018-06-01 23:23:11'), (25, 'Rita', 'd0a29d3812f01152fa82238b28eaff92', 'Rita', 'PP', NULL, NULL), (26, 'Fitri', 'cc64d9da75a1414a49ea891f29f46e38', 'Fitri', 'PP', NULL, NULL), (28, 'Rendra', '79e8b8bbb68ea8ac7720e107a7b92b86', 'Rendra', 'SD', NULL, NULL), (29, 'Suyanto', '9dbc978b222972f94ab3f2c47e4b1516', 'Suyanto', 'SD', NULL, NULL), (30, 'Alex', '6f876c56df96a8db87b81a67f38ed083', 'Alex', 'SD', NULL, NULL), (31, 'Wasti', 'cf0935412950af3783abb44860d90bfa', 'Wasti', 'SD', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `v_check` -- CREATE TABLE `v_check` ( `id` int(11) NOT NULL, `ctype` varchar(45) NOT NULL, `ctypedesc` varchar(255) NOT NULL, `ctcode` varchar(45) NOT NULL, `ctable` varchar(45) DEFAULT NULL, `cstat` varchar(45) NOT NULL, `cmodul` varchar(45) NOT NULL, `vcheck` varchar(45) DEFAULT NULL, `vcba` int(11) NOT NULL, `vctransreqs` varchar(45) DEFAULT NULL, `vcdate` date DEFAULT NULL, `vcpic` varchar(45) DEFAULT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `v_check` -- INSERT INTO `v_check` (`id`, `ctype`, `ctypedesc`, `ctcode`, `ctable`, `cstat`, `cmodul`, `vcheck`, `vcba`, `vctransreqs`, `vcdate`, `vcpic`, `chg_by`, `chg_date`) VALUES (15, 'Enterprise Structure', 'Define BA', 'SPRO', 'V_TGSB', 'Create', 'FICO', 'OK', 1000, 'SMDK900000', '2018-04-24', 'Andrean', NULL, NULL), (16, 'Enterprise Structure', 'Assign Business Area to Consolidation Business Area', 'SPRO', 'V_GSB_A', 'Check', 'FICO', '', 1000, '', '0000-00-00', '', NULL, NULL), (17, 'Financial Accounting (Bank Accounting)', 'Set Up Cash Journal', 'FBCJC0', '', 'Create', 'FICO', NULL, 1000, NULL, NULL, NULL, NULL, NULL), (18, 'Financial Accounting (Bank Accounting)', 'Define House Banks', 'F112', '', 'Create', 'FICO', NULL, 1000, NULL, NULL, NULL, NULL, NULL), (19, 'Enterprise Structure', 'Define BA', 'SPRO', 'V_TGSB', 'Create', 'FICO', 'OK', 2065, 'isi', '2018-06-02', 'Andrean', 'Admin', '2018-06-02 23:12:15'), (20, 'Enterprise Structure', 'Assign Business Area to Consolidation Business Area', 'SPRO', 'V_GSB_A', 'Check', 'FICO', 'OK', 2065, 'nomor', '2018-06-06', 'Aris', 'Aris', '2018-06-02 23:32:17'), (21, 'Financial Accounting (Bank Accounting)', 'Set Up Cash Journal', 'FBCJC0', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (22, 'Financial Accounting (Bank Accounting)', 'Define House Banks', 'F112', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (23, 'Financial Accounting (Bank Accounting)', 'Create, Change, Delete Business Transactions', 'FBCJC2', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (24, 'Financial Accounting (Bank Accounting)', 'Validation in Accounting Documents (workbench req.)', 'OB28', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (25, 'Financial Accounting (Asset Accounting)', 'Specify Transfer Date/Last Closed Fiscal Year', 'SPRO', 'V_T093C_08', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (26, 'Financial Accounting (Asset Accounting)', 'Specify Last Period Posted in Prv.System (Transf.During FY)', 'OAYC', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (27, 'Financial Supply Chain Mgmt (Cash & Liquidity', 'Define Cash Management Account Name', 'SPRO', 'V_T035D', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (28, 'Financial Supply Chain Mgmt (Cash & Liquidity', 'Maintain Structure', 'SPRO', 'V_T038', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (29, 'Controlling (Cost Center Acct)', 'Create Plan Distribution', 'KSV7', '', 'File Checklist PP', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (30, 'Controlling (Cost Center Acct)', 'Create Plan Assessment', 'KSU7', '', 'File Checklist PP', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (31, 'Controlling (Cost Center Acct)', 'Edit Automatic Account Assignment', 'OKB9', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (32, 'Controlling (Cost Center Acct)', 'Create Actual Distribution', 'KSV1', '', 'File Checklist PP', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (33, 'Controlling (Cost Center Acct)', 'Create Actual Assessment', 'KSU1', '', 'File Checklist PP', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (34, 'Product Cost Controlling (Prd Cost Planning)', 'Define Overhead Groups', 'OKZ2', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (35, 'Product Cost Controlling', 'Check Special Procurement Types ', 'SPRO', 'V460A', 'Check Only', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (36, 'Product Cost Controlling (Cost Obj Controllin', 'Define Cost-Accounting-Relevant Default Values for Order Types and Plants', 'SPRO', 'V_T399X_PC', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (37, 'Product Cost Controlling (Simulatenous Costin', 'Activate Generation of Cost Log in Repetitive Manufacturing', 'SPRO', 'V_T437D_F', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (38, 'Product Cost Controlling', 'Define Default Variance Keys for Plants', 'OKVW', '', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (39, 'Product Cost Controlling', 'Define Goods Received Valuation for Order Delivery', 'SPRO', 'V_TCO10', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (40, 'Product Cost Controlling (Actual Costing/Ml)', 'Configure Dynamic Price Changes', 'SPRO', 'V_T001K_PR', 'Check Only', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (41, 'Profitability Analysis (Ent. Controlling)', 'Define Order Type-Dependent Parameters', 'COR4', '', 'Check Only (PP)', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (42, 'Profitability Analysis (Ent. Controlling)', 'Order Type - Dependent Parameters', 'OPL8', '', 'Check Only (PP)', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (43, 'Profitability Analysis (Ent. Controlling)', 'Valuation Variant for Order Costing', 'OPK9', '', 'Check Only (PP)', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (44, 'Profitability Analysis (Ent. Controlling)', 'General Version Define', 'OKEV', '', 'Check Only', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (45, 'Maintain Table View', 'Mapping cost center untuk transaksi input Profit Segment', 'SM30', 'ZMAPCOSTCENTER', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (46, 'Maintain Table View', 'Mapping GL Account Cash Clrg/Bank utk UJB', 'SM30', 'ZREG_UJB_MAPV', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (47, 'Maintain Table View', 'Daftar no sertifikat UJB yg berlaku', 'SM30', 'ZUJB_NUMRANGE', 'Create', 'FICO', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (48, 'Enterprise Structure (Logistic General)', 'Plant', 'OX10', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (49, 'Enterprise Structure (Logistic General)', 'Plant Parameters', 'SM30', 'V_159L', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (50, 'Enterprise Structure (Logistic General)', 'Assign plant ke company code', 'OX18', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (51, 'Enterprise Structure (Logistic General)', 'Assign BA ke plant dan divisi', 'OMJ7', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (52, 'Enterprise Structure (Logistic General)', 'Create & Assign Porg ke Plant', 'OX08 ; OX17', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (53, 'Enterprise Structure (Logistic General)', 'Create Purchasing group', 'OME4', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (54, 'Enterprise Structure (Logistic General)', 'Storage Location', 'OX09', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (55, 'Enterprise Structure (Logistic General)', 'Create/Check TOP (Term Of Payment)', 'OME2', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (56, 'Enterprise Structure (Logistic General)', 'Assign standard purchasing organization to plant ', 'SM30', 'V_001W_E', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (57, 'Enterprise Structure (Logistic General)', 'Define Stock Determinationgroup', 'OSPX', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (58, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Production Order', 'OPJ2', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (59, 'Enterprise Structure (Logistic General)', 'Define Control Data for Pull List', 'SPRO', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (60, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Pull list', 'SM30', 'V_T435W_BF', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (61, 'Enterprise Structure (Logistic General)', 'Define Storage Location MRP per Plant', 'SM30', 'V_T001L_D', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (62, 'Enterprise Structure (Logistic General)', 'Account deteremnination for valuation areas', 'OMWD', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (63, 'Setting field selection material type', 'Create/Check Unit of Measure', 'CUNI', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (64, 'Setting field selection material type', 'Create material group', 'OMSF', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (65, 'Setting field selection material type', 'Configure Split valuation', 'OMWC', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (66, 'Setting field selection material type', 'Define Attributes of Material Types', 'T134M', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (67, 'Modify/Define MRP Type', 'Create type PURCHASE REQUISITION (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (68, 'Modify/Define MRP Type', 'Create type PURCHASE ORDER (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (69, 'Modify/Define MRP Type', 'Create & Check Schema Prosedure', 'V_TMKE', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (70, 'Modify/Define MRP Type', 'Create/Define condition type PO', 'V_T685A', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (71, 'Modify/Define MRP Type', 'Carry Out Overall Maint of MRP Groups', 'ZPRD, ZRAW, ZSPR, ZSUP', 'OMD1', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (72, 'Modify/Define MRP Type', 'Define MRP Group for Each Material Type', 'V_TMW00', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (73, 'Modify/Define MRP Type', 'Define MRP Controllers', 'PIC ZPRD, PIC ZRAW, PIC ZSPR, PIC ZSUP', 'V_T024D', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (74, 'Modify/Define MRP Type', 'Define Special Procurement Types', 'V460A', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (75, 'Modify/Define MRP Type', 'Carry Out Overall Maintenance of Plant Parameter', 'V438M', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (76, 'Modify/Define MRP Type', 'Define Document Life', 'V_159R', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (77, 'Maintain account assigment category', 'Purchase Requisition, Release Procedure, Procedure with Classification, Set Up Procedure with Classification', 'SPRO', 'V_T16FS', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (78, 'Maintain account assigment category', 'Create release strategy PURCHASE REQUISITION', 'T16FK', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (79, 'Maintain account assigment category', 'Create release CODE PURCHASE ORDER', 'VV_T16FC_2', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (80, 'Maintain account assigment category', 'Create release strategy PURCHASE ORDER', 'V_T16FS', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (81, 'Maintain account assigment category', 'Create/check movement type', 'OMJJ', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (82, 'Maintain account assigment category', 'Configure automatic posting', 'OBYC', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (83, 'Maintain account assigment category', 'Create reason for movement', 'V_157L', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (84, 'Maintain account assigment category', 'Defaul value of doc type', 'V_T160', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (85, 'Maintain account assigment category', 'Set tolerance limits', 'V_169G', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (86, 'Maintain account assigment category', 'Define permissible partner role per accout group', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (87, 'Maintain account assigment category', 'Set Check for duplicate invoice', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (88, 'Maintain account assigment category', 'Maintai default value per tax code', 'V_169V_ST', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (89, 'Maintain account assigment category', 'Allow freezing of book inventory balance in stor loc', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (90, 'Maintain account assigment category', 'Define text type for header text', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (91, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PR', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (92, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PR Interbranch & STO', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (93, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (94, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PO Interbranch & STO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (95, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Nopol Kend Botolan u/ TTBK, Packing', 'SM30', 'ZNKEND', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (96, 'Maintain MM02', 'Field Material Original Terkait KKF3', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (97, 'Maintain MM02', 'Trading field', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (98, 'Enterprise Structure (Logistic General)', 'Plant', 'OX10', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (99, 'Enterprise Structure (Logistic General)', 'Plant Parameters', 'SM30', 'V_159L', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (100, 'Enterprise Structure (Logistic General)', 'Assign plant ke company code', 'OX18', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (101, 'Enterprise Structure (Logistic General)', 'Assign BA ke plant dan divisi', 'OMJ7', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (102, 'Enterprise Structure (Logistic General)', 'Create & Assign Porg ke Plant', 'OX08 ; OX17', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (103, 'Enterprise Structure (Logistic General)', 'Create Purchasing group', 'OME4', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (104, 'Enterprise Structure (Logistic General)', 'Storage Location', 'OX09', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (105, 'Enterprise Structure (Logistic General)', 'Create/Check TOP (Term Of Payment)', 'OME2', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (106, 'Enterprise Structure (Logistic General)', 'Assign standard purchasing organization to plant ', 'SM30', 'V_001W_E', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (107, 'Enterprise Structure (Logistic General)', 'Define Stock Determinationgroup', 'OSPX', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (108, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Production Order', 'OPJ2', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (109, 'Enterprise Structure (Logistic General)', 'Define Control Data for Pull List', 'SPRO', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (110, 'Enterprise Structure (Logistic General)', 'Assign Stock Determination Rule in Pull list', 'SM30', 'V_T435W_BF', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (111, 'Enterprise Structure (Logistic General)', 'Define Storage Location MRP per Plant', 'SM30', 'V_T001L_D', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (112, 'Enterprise Structure (Logistic General)', 'Account deteremnination for valuation areas', 'OMWD', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (113, 'Setting field selection material type', 'Create/Check Unit of Measure', 'CUNI', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (114, 'Setting field selection material type', 'Create material group', 'OMSF', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (115, 'Setting field selection material type', 'Configure Split valuation', 'OMWC', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (116, 'Setting field selection material type', 'Define Attributes of Material Types', 'T134M', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (117, 'Modify/Define MRP Type', 'Create type PURCHASE REQUISITION (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (118, 'Modify/Define MRP Type', 'Create type PURCHASE ORDER (Number, Link)', 'V_162', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (119, 'Modify/Define MRP Type', 'Create & Check Schema Prosedure', 'V_TMKE', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (120, 'Modify/Define MRP Type', 'Create/Define condition type PO', 'V_T685A', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (121, 'Modify/Define MRP Type', 'Carry Out Overall Maint of MRP Groups', 'ZPRD, ZRAW, ZSPR, ZSUP', 'OMD1', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (122, 'Modify/Define MRP Type', 'Define MRP Group for Each Material Type', 'V_TMW00', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (123, 'Modify/Define MRP Type', 'Define MRP Controllers', 'PIC ZPRD, PIC ZRAW, PIC ZSPR, PIC ZSUP', 'V_T024D', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (124, 'Modify/Define MRP Type', 'Define Special Procurement Types', 'V460A', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (125, 'Modify/Define MRP Type', 'Carry Out Overall Maintenance of Plant Parameter', 'V438M', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (126, 'Modify/Define MRP Type', 'Define Document Life', 'V_159R', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (127, 'Maintain account assigment category', 'Purchase Requisition, Release Procedure, Procedure with Classification, Set Up Procedure with Classification', 'SPRO', 'V_T16FS', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (128, 'Maintain account assigment category', 'Create release strategy PURCHASE REQUISITION', 'T16FK', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (129, 'Maintain account assigment category', 'Create release CODE PURCHASE ORDER', 'VV_T16FC_2', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (130, 'Maintain account assigment category', 'Create release strategy PURCHASE ORDER', 'V_T16FS', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (131, 'Maintain account assigment category', 'Create/check movement type', 'OMJJ', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (132, 'Maintain account assigment category', 'Configure automatic posting', 'OBYC', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (133, 'Maintain account assigment category', 'Create reason for movement', 'V_157L', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (134, 'Maintain account assigment category', 'Defaul value of doc type', 'V_T160', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (135, 'Maintain account assigment category', 'Set tolerance limits', 'V_169G', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (136, 'Maintain account assigment category', 'Define permissible partner role per accout group', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (137, 'Maintain account assigment category', 'Set Check for duplicate invoice', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (138, 'Maintain account assigment category', 'Maintai default value per tax code', 'V_169V_ST', '', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (139, 'Maintain account assigment category', 'Allow freezing of book inventory balance in stor loc', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (140, 'Maintain account assigment category', 'Define text type for header text', '', '', '', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (141, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PR', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (142, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PR Interbranch & STO', 'SM30', 'ZPRRELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (143, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (144, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Kombinasi PO Interbranch & STO', 'SM30', 'ZPORELEASE', 'Check Only', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (145, 'Maintain tabel/field program Tcode SM30 CLIEN', 'Nopol Kend Botolan u/ TTBK, Packing', 'SM30', 'ZNKEND', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (146, 'Maintain MM02', 'Field with qty Structure terkait KKF3', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (147, 'Maintain MM02', 'Field Material Original Terkait KKF3', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (148, 'Maintain MM02', 'Trading field', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (149, 'Maintain MM02', 'Field Volume botol MP, MC, MS', 'MM02', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (150, 'MARA-XCHPF', 'Batch management botol BMC', 'MM02 / MM17', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (151, 'MARA-XCHPF', 'Revenue Stream (copy plant lain)', 'MM02 / MM17', '', '-', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (152, 'Maintain Release PR/PO', 'Assign Objects to Classes ? Class Type : 032 FRG_EKKO [223]', 'CL20N', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (153, 'Maintain Release PR/PO', 'Assign Objects to Classes ? FRG_EBAN', 'CL20N', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (154, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? FRG_EKKO', 'CL24N', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (155, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? FRG_EBAN', 'CL24N', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (156, 'Maintain Release PR/PO', 'Assign Objects/Classes to Class ? INTERBranch', 'CL24N', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (157, 'Variant Report', 'ZMMSQVI_RMD untuk interbranch', 'ZMMSQVI_RMD', '', 'Create', 'MM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (158, 'Master Data PM', 'Maintain Maintenance Planning Plant', 'SPRO', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (159, 'Master Data PM', 'Assign Maintenance Planning Plant to Maintenance Plant', 'SPRO', '', 'Assign', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (160, 'Master Data PM', 'Planner Groups', 'SPRO', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (161, 'Master Data PM', 'Maintenance Planner Groups', 'SPRO', '', 'Check or Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (162, 'Master Data PM', 'Employees Responsible for Work Centers', 'SPRO', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (163, 'Notifikasi', 'Planner Groups', 'SPRO', '', 'Check ', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (164, 'Maintenance Order', 'Assign Order Types to Maintenance Plants', 'OIOD', '', 'Create', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (165, 'Maintenance Order', 'Default Order Types for Maintenance Items', 'SPRO', '', 'Assign', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (166, 'Maintenance Order', 'Maintain Default Values for Control Keys for Order Types', 'OIO6', '', 'Assign \"PM01\"', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (167, 'Maintenance Order', 'Assign Costing parameters and Result Analysis Keys', 'OIOF', '', 'Assign \"PM01\"', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (168, 'Maintenance Order', 'Change Docs, Collective Purc.Req.Indicator, Operation No.Interval', 'SPRO', '', 'Assign', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (169, 'Maintenance Order', 'Documentation for Goods Movement for the Order', 'SPRO', '', 'Tick', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (170, 'Maintenance Order', 'Inspection Control', 'OIOI', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (171, 'Maintenance Order', 'Default Values for Component Item Categories', 'SPRO', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (172, 'Maintenance Order', 'Activate Default Value for Current Date as Basic date', 'SPRO', '', 'Tick', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (173, 'Maintenance Order', 'Default Values for Units for Operation', 'OIO9', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (174, 'Maintenance Order', 'Set Scheduling Paramaters', 'OPU7', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (175, 'Maintenance Order', 'Control Parameters for Completion Confirmations', 'SPRO', '', 'Define', 'PM', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (176, 'General ', 'Define Shift Sequence', 'OP4A', '', '', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (177, 'General ', 'Define Order Types', 'OPJH', '', '', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (178, 'MRP, Prd.Order', 'Define scheduling parameters for Production orders ', 'OPU3 ( 2*/ 1*/ 3* ) RWK,SER', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (179, 'MRP, Prd.Order', 'Define scheduling parameters for planned orders ', 'OPU5', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (180, 'MRP, Prd.Order', 'Production Scheduling Profiles', 'OPKP ( 00001, 00002 )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (181, 'MRP, Prd.Order', 'Production Scheduler', 'OPJ9', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (182, 'MRP, Prd.Order', 'Define MRP Controllers', 'OMD0 ( mrp..... )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (183, 'MRP, Prd.Order', 'Carryout Overall Maintenance of MRP Group', 'OPPZ ( Z* .... )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (184, 'MRP, Prd.Order', 'Define Scope of Total Planning', 'OM0E ( nama plant )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (185, 'MRP, Prd.Order', 'Define MRP Creation Indicator', 'SPRO Production - MRP - Planning - Define Cre', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (186, 'MRP, Prd.Order', 'Define Order Type-Dependent Parameter', 'OPL8 ( 2*/1*/3* )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (187, 'MRP, Prd.Order', 'Tambahan centang PP01, Implementation', '', '', 'Check', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (188, 'MRP, Prd.Order', 'Define Confirmation Parameter', 'OPK4 (2*/1*/3* )', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (189, 'MRP, Prd.Order', 'Define Default Value', 'OPJG', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (190, 'MRP, Prd.Order', 'Maintain Checking Control', 'OPJK', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (191, 'MRP, Prd.Order', 'Activate MRP dan Set up Planning File', 'OMDU', '', 'Check', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (192, 'MRP, Prd.Order', 'Define Order Type for Conversion to Production/Process Order', 'OPPE', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (193, 'MRP, Prd.Order', 'Define MRP group for each Material group', 'OPPR', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (194, 'MRP, Prd.Order', 'Define Planning Horizon', 'OMDX', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (195, 'MRP, Prd.Order', 'Define parameter for determining basic dates', 'SPRO-Production-MRP-Schedulling & Capacity Pa', '', 'Check', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (196, 'MRP, Prd.Order', 'Define available check for component', 'OPPJ', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (197, 'MRP, Prd.Order', 'Maintain carry out maintenance all', 'OPPQ', '', 'alll maint', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (198, 'MRP, Prd.Order', 'Set Up Production Scheduler Group', 'OPCH', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (199, 'MRP, Prd.Order', 'Define Production Scheduling for Process Orders ', 'CORY', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (200, 'MRP, Prd.Order', 'Determinine Person Responsible - work Center', 'SPRO Production - Basic Data - Work Center - ', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (201, 'MRP, Prd.Order', 'valuation variants order costing', 'OPK9', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (202, 'MRP, Prd.Order', 'Order type - dependent parameters', 'COR4', '', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (203, 'Maintain tabel/field program ', 'Sloc Kode Material', 'SM30', 'ZBOTOL_SLOC', 'Check Only', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (204, 'Maintain tabel/field program ', 'Kode + isi Botol', 'SM30', 'ZCAP_BOTOL', 'Check Only', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (205, 'Maintain tabel/field program ', 'LIVE PP', 'SM30', 'ZLIVE_PP', 'centang', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (206, 'Maintain tabel/field program ', 'LIVE PP + BATCH', 'SM30', 'ZLIVE_BATCH', 'centang', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (207, 'Maintain tabel/field program', 'Kapasitas Produksi', 'ZPPENH016', 'Kapasitas Design, Kapasitas Commisioning', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (208, 'Maintain tabel/field program', 'Mode ASP', 'ZPPENH016', 'Mode ASP 1/ 2', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (209, 'Maintain tabel/field program', 'Bahan Baku Mixed Gas', 'ZPPENH016', 'Kode material Mixed Gas Bahan baku yang dipak', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (210, 'Maintain tabel/field program', 'Map Plant dan sloc mixed Gas', 'ZPPENH016', 'Sloc mixed Gas', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (211, 'Maintain tabel/field program', 'Mapping SlocPipeline', 'ZPPENH016', 'Produksi Pipeline yang ada', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (212, 'Maintain tabel/field program', 'Mapping Sloc tangki', 'ZPPENH016', 'Sloc tangki yang dipakai produksi', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (213, 'Maintain tabel/field program', 'Mapping Sloc transfer', 'ZPPENH016', 'Mapping mobil distribusi yang dipakai per kod', 'Create', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (214, 'Maintain tabel/field program', 'Mapping report PP', 'ZPPENH016', 'Mapping report PP yg dikirim lewat email', 'Via Email', 'PP', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (215, 'Enterprise Structure (Financial Accounting)', 'Define company', 'OX15', '', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (216, 'Enterprise Structure (Financial Accounting)', 'Define Credit Control Area', 'OB45', '', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (217, 'Enterprise Structure (Financial Accounting)', 'Define Business Area', 'OX03', '', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (218, 'Enterprise Structure (Logistics-Plant)', 'Define Plant', 'OX10', '', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (219, 'Enterprise Structure (Logistics-Division)', 'Define Division', 'OVXD', 'V_TSPA', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (220, 'Enterprise Structure (Sales & Distribution)', 'Define, copy, delete, check sales organization', 'OVX5', 'V_TVKO', 'Create', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (221, 'Enterprise Structure (Sales & Distribution)', 'Define, copy, delete, check distribution channel', 'OVXI', 'V_TVTW', 'Check Only', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (222, 'Enterprise Structure (Sales & Distribution)', 'Maintain sales office', 'OVX1', 'V_TVBUR', 'Create', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (223, 'Enterprise Structure (Logistics Execution)', 'Define, copy, delete, check shipping point', 'OVXD', 'V_TVST', 'Create', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL), (224, 'Enterprise Structure (Logistics General)', 'Assign Business Area to Plant/Valuation Area and Division', 'OMJ7', '', 'Create', 'SD', NULL, 2065, NULL, NULL, NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `v_uat` -- CREATE TABLE `v_uat` ( `id` int(11) NOT NULL, `uat_scn` varchar(255) NOT NULL, `no_step` int(11) NOT NULL, `bp_step` varchar(255) NOT NULL, `tcode_step` varchar(45) NOT NULL, `user_step` varchar(45) NOT NULL, `vuba` varchar(45) NOT NULL, `vuinput` varchar(45) DEFAULT NULL, `vuoutput` varchar(45) DEFAULT NULL, `vupic` varchar(45) DEFAULT NULL, `vudate` date DEFAULT NULL, `chg_by` varchar(255) DEFAULT NULL, `chg_date` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `v_uat` -- INSERT INTO `v_uat` (`id`, `uat_scn`, `no_step`, `bp_step`, `tcode_step`, `user_step`, `vuba`, `vuinput`, `vuoutput`, `vupic`, `vudate`, `chg_by`, `chg_date`) VALUES (1, 'Penjualan Botolan Reguler (MTS)', 1, 'Buat Sales Order', 'VA01', 'Sales Counter', '1000', 'Sample input', 'Sample output', 'SAPFICO', '2018-05-16', 'Admin', '2018-05-16 23:37:09'), (2, 'Penjualan Botolan Reguler (MTS)', 2, 'Release SO (Credit Management)', 'ZSDENH006', 'Management', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (3, 'Penjualan Botolan Reguler (MTS)', 3, 'Cetak SO', 'VA03', 'Sales Counter', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (4, 'Penjualan Botolan Reguler (MTS)', 4, 'Perintah Packing oleh Sales Counter', 'ZSDENH039', 'Sales Counter', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (5, 'Penjualan Botolan Reguler (MTS)', 5, 'Create TTBK & GR ke Sloc Empty Pack', 'ZMMENH025', 'Adm.Panggung', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (6, 'Penjualan Botolan Reguler (MTS)', 6, 'Konfirmasi SO & Buat Inquiry Jika Ada Pekerjaan Tambahan (Khusus MR)', 'ZSDENH040', 'Panggung', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (7, 'Penjualan Botolan Reguler (MTS)', 7, 'Report', 'ZSDRPT047', 'Panggung', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (8, 'Penjualan Botolan Reguler (MTS)', 8, 'Konversi Inquiry ke SO setelah konfirm ke relasi (Khusus MR)', 'ZSDENH043', 'Sales Counter', '1000', 'in', 'out', 'Thomas', '2018-06-02', 'Thomas', '2018-06-02 03:13:11'), (9, 'Penjualan Botolan Reguler (MTS)', 9, 'Report', 'ZSDRPT047', 'Sales Counter', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (10, 'Penjualan Botolan Reguler (MTS)', 10, 'Prosedur Running MRP & Create PRO MTS', 'ZSDENH043', 'PPIC', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (11, 'Penjualan Botolan Reguler (MTS)', 11, 'Input Hasil Produksi', 'ZPPENH001', 'Produksi', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (12, 'Penjualan Botolan Reguler (MTS)', 12, 'Transfer Packing dari Sloc Full Pack ke Sloc Distribusi', 'ZSDENH040', 'Adm.Panggung', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (13, 'Penjualan Botolan Reguler (MTS)', 13, 'Cetak Packing List (Dilampirkan di SO)', 'ZSDENH040', 'Adm.Panggung', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (14, 'Penjualan Botolan Reguler (MTS)', 14, 'Posting (GI) Surat Jalan', 'VL01N', 'Distribusi/Logistik', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (15, 'Penjualan Botolan Reguler (MTS)', 15, 'Posting (GI) Surat Jalan', 'VL02N', 'Distribusi/Logistik', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (16, 'Penjualan Botolan Reguler (MTS)', 16, 'Cetak Surat Jalan', 'VL03N', 'Distribusi/Logistik', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (17, 'Penjualan Botolan Reguler (MTS)', 17, 'Create Invoice', 'VF01', 'Adm.Penjualan', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (18, 'Penjualan Botolan Reguler (MTS)', 18, 'Cetak Invoice', 'VF03', 'Adm.Penjualan', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (19, 'Penjualan Botolan Reguler (MTS)', 19, 'Cetak Faktur Pajak', 'ZFIRPT038', 'Adm.Penjualan', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (20, 'Penjualan Botolan Reguler (MTS)', 20, 'Terima Plns dari Customer via Bank BCA Test Transfer', 'F-21', 'GL Bank', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (21, 'Penjualan Botolan Reguler (MTS)', 21, 'Account Clear AR', 'F-32', 'Adm.Piutang', '1000', NULL, NULL, NULL, NULL, NULL, NULL), (22, 'Penjualan Botolan Reguler (MTS)', 1, 'Buat Sales Order', 'VA01', 'Sales Counter', '2065', 'input', 'out', 'Admin', '2018-06-02', 'Aris', '2018-06-02 23:49:39'), (23, 'Penjualan Botolan Reguler (MTS)', 2, 'Release SO (Credit Management)', 'ZSDENH006', 'Management', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (24, 'Penjualan Botolan Reguler (MTS)', 3, 'Cetak SO', 'VA03', 'Sales Counter', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (25, 'Penjualan Botolan Reguler (MTS)', 4, 'Perintah Packing oleh Sales Counter', 'ZSDENH039', 'Sales Counter', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (26, 'Penjualan Botolan Reguler (MTS)', 5, 'Create TTBK & GR ke Sloc Empty Pack', 'ZMMENH025', 'Adm.Panggung', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (27, 'Penjualan Botolan Reguler (MTS)', 6, 'Konfirmasi SO & Buat Inquiry Jika Ada Pekerjaan Tambahan (Khusus MR)', 'ZSDENH040', 'Panggung', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (28, 'Penjualan Botolan Reguler (MTS)', 7, 'Report', 'ZSDRPT047', 'Panggung', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (29, 'Penjualan Botolan Reguler (MTS)', 8, 'Konversi Inquiry ke SO setelah konfirm ke relasi (Khusus MR)', 'ZSDENH043', 'Sales Counter', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (30, 'Penjualan Botolan Reguler (MTS)', 9, 'Report', 'ZSDRPT047', 'Sales Counter', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (31, 'Penjualan Botolan Reguler (MTS)', 10, 'Prosedur Running MRP & Create PRO MTS', 'ZSDENH043', 'PPIC', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (32, 'Penjualan Botolan Reguler (MTS)', 11, 'Input Hasil Produksi', 'ZPPENH001', 'Produksi', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (33, 'Penjualan Botolan Reguler (MTS)', 12, 'Transfer Packing dari Sloc Full Pack ke Sloc Distribusi', 'ZSDENH040', 'Adm.Panggung', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (34, 'Penjualan Botolan Reguler (MTS)', 13, 'Cetak Packing List (Dilampirkan di SO)', 'ZSDENH040', 'Adm.Panggung', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (35, 'Penjualan Botolan Reguler (MTS)', 14, 'Posting (GI) Surat Jalan', 'VL01N', 'Distribusi/Logistik', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (36, 'Penjualan Botolan Reguler (MTS)', 15, 'Posting (GI) Surat Jalan', 'VL02N', 'Distribusi/Logistik', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (37, 'Penjualan Botolan Reguler (MTS)', 16, 'Cetak Surat Jalan', 'VL03N', 'Distribusi/Logistik', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (38, 'Penjualan Botolan Reguler (MTS)', 17, 'Create Invoice', 'VF01', 'Adm.Penjualan', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (39, 'Penjualan Botolan Reguler (MTS)', 18, 'Cetak Invoice', 'VF03', 'Adm.Penjualan', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (40, 'Penjualan Botolan Reguler (MTS)', 19, 'Cetak Faktur Pajak', 'ZFIRPT038', 'Adm.Penjualan', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (41, 'Penjualan Botolan Reguler (MTS)', 20, 'Terima Plns dari Customer via Bank BCA Test Transfer', 'F-21', 'GL Bank', '2065', NULL, NULL, NULL, NULL, NULL, NULL), (42, 'Penjualan Botolan Reguler (MTS)', 21, 'Account Clear AR', 'F-32', 'Adm.Piutang', '2065', NULL, NULL, NULL, NULL, NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `login_data` -- ALTER TABLE `login_data` ADD PRIMARY KEY (`loginuid`); -- -- Indexes for table `m_ba` -- ALTER TABLE `m_ba` ADD PRIMARY KEY (`id`); -- -- Indexes for table `m_check` -- ALTER TABLE `m_check` ADD PRIMARY KEY (`c_id`); -- -- Indexes for table `m_modul` -- ALTER TABLE `m_modul` ADD PRIMARY KEY (`id`); -- -- Indexes for table `m_uat_scn` -- ALTER TABLE `m_uat_scn` ADD PRIMARY KEY (`uat_id`); -- -- Indexes for table `m_uat_step` -- ALTER TABLE `m_uat_step` ADD PRIMARY KEY (`id_step`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`userno`), ADD UNIQUE KEY `userid_UNIQUE` (`userid`); -- -- Indexes for table `v_check` -- ALTER TABLE `v_check` ADD PRIMARY KEY (`id`); -- -- Indexes for table `v_uat` -- ALTER TABLE `v_uat` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `login_data` -- ALTER TABLE `login_data` MODIFY `loginuid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `m_ba` -- ALTER TABLE `m_ba` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `m_check` -- ALTER TABLE `m_check` MODIFY `c_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=210; -- -- AUTO_INCREMENT for table `m_modul` -- ALTER TABLE `m_modul` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `m_uat_scn` -- ALTER TABLE `m_uat_scn` MODIFY `uat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `userno` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32; -- -- AUTO_INCREMENT for table `v_check` -- ALTER TABLE `v_check` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=225; -- -- AUTO_INCREMENT for table `v_uat` -- ALTER TABLE `v_uat` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=146; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
e7d5b18ed57ee7dd89059deb6ba490a7bd8f1725
SQL
lungua/deseuri
/src/java/sql/triggerCantRezultataInsert.sql
UTF-8
696
2.96875
3
[]
no_license
DELIMITER || drop trigger cantRezultataInsert || CREATE TRIGGER cantRezultataInsert AFTER INSERT ON cantrezultata FOR EACH ROW BEGIN DECLARE wcant double; declare widMiscLuna integer; set wcant=0.0; set widMiscLuna=0; set wcant= new.cantitate; set widMiscLuna = new.MiscariLuna_idMiscariLuna; update miscariluna set CantReciclate= CantReciclate+wcant where idMiscariLuna=widMiscLuna; update miscariluna set stocSfirsit= stocInceput+CantRezultata+miscGenerare -miscEliminare-miscValorificare-miscStocare-ComponenteComercializate-CantReciclate-CantValorificate-CantEliminate where idMiscariLuna=widMiscLuna; END; || DELIMITER ;
true
647e8bfd9b2298ba2d47804e938f60b447a78159
SQL
EaglesReign/test1-CMP341
/query7.sql
UTF-8
138
2.515625
3
[]
no_license
//Increase the salaries of all employees making less than $40000 by 10%. update employee set salary = salary * 1.1 where salary < 40000;
true
65f35f6e9a88b3f3392ed38c9561abbb98deef65
SQL
JYunZhang/QuizDatebase
/q2.sql
UTF-8
877
4.21875
4
[]
no_license
-- For all questions in the database, report the question ID, question text, -- and the number of hints associated with it. For True-False questions, report -- NULL as the number of hints (since True-False questions cannot have -- hints). drop table if exists q2 cascade; create table q2( qid VARCHAR(20), questiontext VARCHAR(50), hintsCount INT DEFAULT 0 ); DROP VIEW IF EXISTS question_hint CASCADE; -- Count the hint number for each question. CREATE VIEW question_hint as select QuestionOpt.qid as qid, count(QuestionOpt.hint) as hintNum FROM Question Left join QuestionOpt on Question.qid = QuestionOpt.qid GROUP BY QuestionOpt.qid; INSERT INTO q2 (SELECT Question.qid as qid, Question.questiontext::VARCHAR(50), question_hint.hintNum FROM Question LEFT JOIN question_hint on Question.qid = question_hint.qid); UPDATE q2 SET hintsCount = 0 WHERE hintsCount is NULL;
true
c9321286cc7907b08d8e237d62f7523ab6f5a0e4
SQL
ahristoff/Database-Advanced
/1_DB_APPS_INTRODUCTION/Exercises/4/bin/Debug/netcoreapp1.1/MinionsData.sql
UTF-8
167
3.703125
4
[]
no_license
SELECT m.Name as Mname, m.Age as age, t.Name as Tname FROM Minions AS m join Towns as t on t.Id = m.TownId where m.Name = @mname and m.Age =@age and t.Name = @tname
true
477248274c12f7f2260a98dfbe8fc3e25ffa5f2b
SQL
nikiqta/MS-SQL
/Queries/EX-QUERIES JOINS.sql
UTF-8
7,729
4.53125
5
[ "MIT" ]
permissive
USE SoftUni -- 1. Employee Address SELECT TOP (5) e.EmployeeID, e.JobTitle, e.AddressID, a.AddressText FROM Employees AS e JOIN Addresses AS a ON e.AddressID = a.AddressID ORDER BY e.AddressID -- 2. Addresses with Towns SELECT TOP (50) e.FirstName, e.LastName , t.[Name] AS Town, a.AddressText FROM Employees AS e JOIN Addresses AS a ON a.AddressID = e.AddressID JOIN Towns AS t ON t.TownID = a.TownID ORDER BY e.FirstName, e.LastName -- 3. Sales Employee SELECT e.EmployeeID, e.FirstName, e.LastName, d.[Name] FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID AND d.[Name] = 'Sales' ORDER BY e.EmployeeID -- 4. Employee Departments SELECT TOP (5) e.EmployeeID, e.FirstName, Salary, d.[Name] AS DepartmentName FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID AND e.Salary > 15000 ORDER BY e.DepartmentID ASC -- 5. Employees Without Project SELECT TOP (3) EmployeeID, FirstName FROM Employees WHERE EmployeeID NOT IN ( SELECT DISTINCT EmployeeID FROM EmployeesProjects ) ORDER BY EmployeeID ASC SELECT * FROM INFORMATION_SCHEMA.TABLES -- 6. Employees Hired After SELECT e.FirstName, e.LastName, e.HireDate, d.[Name] AS DeptName FROM Employees AS e JOIN Departments AS d ON d.DepartmentID = e.DepartmentID AND d.[Name] IN ('Sales', 'Finance') AND e.HireDate > '01-01-1999' ORDER BY e.HireDate ASC -- 7. Employees with Project SELECT TOP (5) e.EmployeeID, e.FirstName, p.[Name] AS ProjectName FROM Employees AS e JOIN EmployeesProjects AS ep ON ep.EmployeeID = e.EmployeeID JOIN Projects AS p ON p.ProjectID = ep.ProjectID WHERE p.StartDate > '2002-08-13' AND p.EndDate IS NULL ORDER BY e.EmployeeID ASC -- 8. Employee 24 SELECT e.EmployeeID, e.FirstName, CASE WHEN YEAR(p.StartDate) >= 2005 THEN 'NULL' ELSE p.[Name] END AS ProjectName FROM Employees AS e JOIN EmployeesProjects AS ep ON ep.EmployeeID = e.EmployeeID AND ep.EmployeeID = 24 JOIN Projects AS p ON p.ProjectID = ep.ProjectID ORDER BY e.EmployeeID ASC -- 9. Employee Manager SELECT e.EmployeeID, e.FirstName, e.ManagerID, e2.FirstName AS ManagerName FROM Employees AS e JOIN Employees AS e2 ON e2.EmployeeID = e.ManagerID WHERE e.ManagerID IN (3,7) ORDER BY EmployeeID ASC -- 10. Employee Summary SELECT TOP (50) e.EmployeeID, e.FirstName + ' ' + e.LastName AS EmployeeName, e2.FirstName + ' ' + e2.LastName AS ManagerName, d.[Name] AS DepartmentName FROM Employees AS e JOIN Employees AS e2 ON e2.EmployeeID = e.ManagerID JOIN Departments AS d ON d.DepartmentID = e.DepartmentID ORDER BY e.EmployeeID ASC -- 11. Min Average Salary SELECT MIN (AverageSalary) AS MinAverageSalary FROM ( SELECT DepartmentID, AVG (Salary) AS AverageSalary FROM Employees GROUP BY DepartmentID) AS AverageSalariesByDepartment -- 12. Highest Peaks in Bulgaria USE [Geography] SELECT * FROM INFORMATION_SCHEMA.TABLES SELECT * FROM MountainsCountries SELECT TOP 1 * FROM Peaks SELECT TOP 1 * FROM Countries SELECT mc.CountryCode, m.MountainRange, p.PeakName, p.Elevation FROM Peaks AS p JOIN Mountains AS m ON m.Id = p.MountainId JOIN MountainsCountries AS mc ON mc.MountainId = p.MountainId AND mc.CountryCode = 'BG' AND p.Elevation > 2835 ORDER BY p.Elevation DESC -- 13. Count Mountain Ranges SELECT mc.CountryCode, COUNT ( m.MountainRange ) AS MountainRanges FROM Mountains AS m JOIN MountainsCountries AS mc ON mc.MountainId = m.Id AND mc.CountryCode IN ('BG', 'RU', 'US') GROUP BY (mc.CountryCode) -- 14. Countries with Rivers SELECT TOP (5) c.CountryName, r.RiverName FROM Countries AS c JOIN Continents AS cc ON cc.ContinentCode = c.ContinentCode FULL OUTER JOIN CountriesRivers AS cr ON cr.CountryCode = c.CountryCode FULL OUTER JOIN Rivers AS r ON r.Id = cr.RiverId WHERE cc.ContinentCode = 'AF' ORDER BY c.CountryName ASC -- 15. Continents and Currencies * SELECT ContinentCode, CurrencyCode, CurrencyUsage FROM ( SELECT ContinentCode, CurrencyCode, CurrencyUsage, DENSE_RANK () OVER ( PARTITION BY ContinentCode ORDER BY CurrencyUsage DESC ) AS [Rank] FROM ( SELECT ContinentCode, CurrencyCode, COUNT (CurrencyCode) AS CurrencyUsage FROM Countries GROUP BY CurrencyCode, ContinentCode) AS e ) AS RankCurrencies WHERE [Rank] = 1 AND CurrencyUsage > 1 ORDER BY ContinentCode -- 16. Countries without any Mountains SELECT COUNT (CountryCode) CountryCode FROM Countries WHERE CountryCode NOT IN ( SELECT CountryCode FROM MountainsCountries ) ------------------------------------------------------------------ SELECT COUNT(c.CountryCode) AS CountryCode FROM Countries AS c JOIN Continents AS cc ON cc.ContinentCode = c.ContinentCode FULL OUTER JOIN MountainsCountries AS mc ON mc.CountryCode = c.CountryCode LEFT OUTER JOIN Mountains AS m ON m.Id = mc.MountainId WHERE m.MountainRange IS NULL -- 17. Highest Peak and Longest River by Country SELECT TOP (5) c.CountryName, MAX (p.Elevation) HighestPeakElevation, MAX (r.Length) LongestRiverElevation FROM Countries c LEFT OUTER JOIN CountriesRivers cr ON cr.CountryCode = c.CountryCode LEFT OUTER JOIN Rivers r ON r.Id = cr.RiverId LEFT OUTER JOIN MountainsCountries mc ON mc.CountryCode = c.CountryCode LEFT OUTER JOIN Peaks p ON p.MountainId = mc.MountainId GROUP BY c.CountryName ORDER BY HighestPeakElevation DESC, LongestRiverElevation DESC -- 18. Highest Peak Name and Elevation by Country* SELECT CountryName Country, CASE WHEN PeakName IS NULL THEN '(no highest peak)' ELSE PeakName END [Highest Peak Name], CASE WHEN HighestPeakElevation IS NULL THEN '0' ELSE HighestPeakElevation END [Highest Peak Elevation], CASE WHEN MountainRange IS NULL THEN '(no mountain)' ELSE MountainRange END Mountain FROM ( SELECT c.CountryName, p.PeakName, p.Elevation HighestPeakElevation, m.MountainRange, DENSE_RANK () OVER ( PARTITION BY c.CountryName ORDER BY p.Elevation DESC ) [Rank] FROM Countries c LEFT OUTER JOIN MountainsCountries mc ON mc.CountryCode = c.CountryCode LEFT OUTER JOIN Mountains m ON m.Id = mc.MountainId LEFT OUTER JOIN Peaks p ON p.MountainId = mc.MountainId ) t WHERE [Rank] = 1 ORDER BY Country, [Highest Peak Name]
true
2ad27728d5ee491ddc5161b28884e962f4f0157b
SQL
RedmondC/Information-Management-Final
/DatabaseQueries.sql
UTF-8
535
3.171875
3
[]
no_license
USE info_project; SELECT * FROM professor_public; SELECT * FROM college_population; SELECT * FROM student_public; SELECT * FROM Student; SELECT * FROM Is_contained_in; SELECT * FROM Module_List; SET @ExampleStudent := 10000000; SELECT s.*,c.Module_List_Id,m.Module_Id,m.Module_Name FROM Module_List l LEFT JOIN Is_contained_in c ON l.Module_List_Id = c.Module_List_Id LEFT JOIN Module m ON c.Module_Id = m.Module_Id RIGHT JOIN student_public s ON s.Student_Id = l.Student_Id WHERE l.Student_Id = @ExampleStudent;
true
586df5706cef53b1f22fb69708b9f9d8c853e5e7
SQL
Alexidis/BasicMySQL
/database/temp_db_console.sql
UTF-8
7,217
3.765625
4
[]
no_license
DROP TABLE IF EXISTS catalogs; CREATE TABLE catalogs ( id SERIAL PRIMARY KEY, name VARCHAR(255) COMMENT 'Название раздела', UNIQUE unique_name(name(10)) ) COMMENT = 'Разделы интернет-магазина'; INSERT INTO catalogs VALUES (NULL, 'Процессоры'), (NULL, 'Материнские платы'), (NULL, 'Видеокарты'), (NULL, 'Жесткие диски'), (NULL, 'Оперативная память'); DROP TABLE IF EXISTS rubrics; CREATE TABLE rubrics ( id SERIAL PRIMARY KEY, name VARCHAR(255) COMMENT 'Название раздела' ) COMMENT = 'Разделы интернет-магазина'; INSERT INTO rubrics VALUES (NULL, 'Видеокарты'), (NULL, 'Память'); DROP TABLE IF EXISTS users; CREATE TABLE users ( id SERIAL PRIMARY KEY, name VARCHAR(255) COMMENT 'Имя покупателя', birthday_at DATE COMMENT 'Дата рождения', created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) COMMENT = 'Покупатели'; INSERT INTO users (name, birthday_at) VALUES ('Геннадий', '1990-10-05'), ('Наталья', '1984-11-12'), ('Александр', '1985-05-20'), ('Сергей', '1988-02-14'), ('Иван', '1998-01-12'), ('Мария', '1992-08-29'); DROP TABLE IF EXISTS products; CREATE TABLE products ( id SERIAL PRIMARY KEY, name VARCHAR(255) COMMENT 'Название', description TEXT COMMENT 'Описание', price DECIMAL (11,2) COMMENT 'Цена', catalog_id INT UNSIGNED, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY index_of_catalog_id (catalog_id) ) COMMENT = 'Товарные позиции'; INSERT INTO products (name, description, price, catalog_id) VALUES ('Intel Core i3-8100', 'Процессор для настольных персональных компьютеров, основанных на платформе Intel.', 7890.00, 1), ('Intel Core i5-7400', 'Процессор для настольных персональных компьютеров, основанных на платформе Intel.', 12700.00, 1), ('AMD FX-8320E', 'Процессор для настольных персональных компьютеров, основанных на платформе AMD.', 4780.00, 1), ('AMD FX-8320', 'Процессор для настольных персональных компьютеров, основанных на платформе AMD.', 7120.00, 1), ('ASUS ROG MAXIMUS X HERO', 'Материнская плата ASUS ROG MAXIMUS X HERO, Z370, Socket 1151-V2, DDR4, ATX', 19310.00, 2), ('Gigabyte H310M S2H', 'Материнская плата Gigabyte H310M S2H, H310, Socket 1151-V2, DDR4, mATX', 4790.00, 2), ('MSI B250M GAMING PRO', 'Материнская плата MSI B250M GAMING PRO, B250, Socket 1151, DDR4, mATX', 5060.00, 2); DROP TABLE IF EXISTS orders; CREATE TABLE orders ( id SERIAL PRIMARY KEY, user_id INT UNSIGNED, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY index_of_user_id(user_id) ) COMMENT = 'Заказы'; DROP TABLE IF EXISTS orders_products; CREATE TABLE orders_products ( id SERIAL PRIMARY KEY, order_id INT UNSIGNED, product_id INT UNSIGNED, total INT UNSIGNED DEFAULT 1 COMMENT 'Количество заказанных товарных позиций', created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) COMMENT = 'Состав заказа'; DROP TABLE IF EXISTS discounts; CREATE TABLE discounts ( id SERIAL PRIMARY KEY, user_id INT UNSIGNED, product_id INT UNSIGNED, discount FLOAT UNSIGNED COMMENT 'Величина скидки от 0.0 до 1.0', started_at DATETIME, finished_at DATETIME, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY index_of_user_id(user_id), KEY index_of_product_id(product_id) ) COMMENT = 'Скидки'; DROP TABLE IF EXISTS storehouses; CREATE TABLE storehouses ( id SERIAL PRIMARY KEY, name VARCHAR(255) COMMENT 'Название', created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) COMMENT = 'Склады'; DROP TABLE IF EXISTS storehouses_products; CREATE TABLE storehouses_products ( id SERIAL PRIMARY KEY, storehouse_id INT UNSIGNED, product_id INT UNSIGNED, value INT UNSIGNED COMMENT 'Запас товарной позиции на складе', created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) COMMENT = 'Запасы на складе'; # 1. Составьте список пользователей users, которые осуществили хотя бы один заказ orders в интернет магазине. select u.* from users u join orders o on u.id = o.user_id; # 2, Выведите список товаров products и разделов catalogs, который соответствует товару. select p.*, c.name from products p left join catalogs c on c.id = p.catalog_id; # 3. (по желанию) Пусть имеется таблица рейсов flights (id, from, to) и таблица городов cities (label, name). # Поля from, to и label содержат английские названия городов, поле name — русское. # Выведите список рейсов flights с русскими названиями городов. with flights as ( select column_0 as id, column_1 as `from`, column_2 as `to` from ( values ROW (1, 'MSK', 'NYK'), ROW (2, 'NYK', 'MSK'), ROW (3, 'SPB', 'MSK'), ROW (4, 'NYK', 'SPB'), ROW (5, 'NVS', 'MSK'), ROW (6, 'NYK', 'NVS'), ROW (7, 'NVS', 'SPB'), ROW (8, 'SPB', 'NVS') ) as f ), cities as ( select column_0 as label, column_1 as name from ( values ROW ('MSK', 'Москва'), ROW ('NYK', 'Нью-йорк'), ROW ('SPB', 'Санк-Питербург'), ROW ('NVS', 'Новосибирск') ) as c ) select f.id, c.name as rus_name_from, c2.name as rus_name_to, f.`from` as eng_name_from, f.`to` as eng_name_to from flights f left join cities c on c.label = f.`from` left join cities c2 on c2.label = f.`to` DROP TABLE storehouses_products; DROP TABLE storehouses; DROP TABLE discounts; DROP TABLE orders_products; DROP TABLE orders; DROP TABLE products; DROP TABLE users; DROP TABLE rubrics; DROP TABLE catalogs;
true
22d81949a482459afb2b9de2c9e9986faf73a317
SQL
chrisjxn/vehicle-collection
/db/get_user_collection.sql
UTF-8
213
3.046875
3
[]
no_license
SELECT vehicles.id, first_name as owner_first, last_name as owner_last, type, color, description, photo_url FROM vehicles LEFT JOIN users ON users.id = vehicles.user_id WHERE users.id = $1;
true