This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ---------------------------- | |
-- Table structure for member | |
-- ---------------------------- | |
DROP TABLE IF EXISTS "public"."member"; | |
CREATE TABLE "public"."member" ( | |
"id" int4 NOT NULL, | |
"no_urut" int4, | |
"parent_id" int4, | |
"name" varchar(255) COLLATE "pg_catalog"."default" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tab-content" id="curl" style="display: block;"> | |
<div class="tab-content-button"> | |
<button id="copy-curl" style="font-size: 12px"> | |
<svg aria-hidden="true" class="svg-inline--fa fa-copy fa-w-14" data-fa-i2svg="" data-icon="copy" data-prefix="fas" focusable="false" role="img" viewbox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"> | |
<path d="M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z" fill="currentColor"></path> | |
</svg> | |
</button> | |
</div> | |
<div class="tab-content-code"> | |
<pre class="highlight highlight-curl prettyprint">curl --location --request GET 'https://partner.api.bri.co.id/sandbox/v2/inquiry/888801000003301' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- master table | |
create table transactions ( | |
id serial primary key, | |
code varchar(60) not null unique, | |
date integer not null, | |
value decimal(15,2) default 0, | |
remarks text | |
); | |
-- details table without generated column |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- master table | |
create table transactions ( | |
id serial primary key, | |
code varchar(60) not null unique, | |
date integer not null, | |
value decimal(15,2) default 0, | |
remarks text | |
); | |
-- details table without generated column |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size (MB)" | |
FROM information_schema.tables | |
GROUP BY table_schema; | |
SELECT table_name | |
, round(((table_rows) / 1024 / 1024), 2) as "Row Count (mil)" | |
, round(((data_length) / 1024 / 1024), 2) as "Data Size (MB)" | |
, round(((index_length) / 1024 / 1024), 2) as "Index Size (MB)" | |
, round(((data_length + index_length) / 1024 / 1024), 2) as "Table Size (MB)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nurs-MacBook-Pro:~ nurhidayat$ /Applications/XAMPP/bin/mysql -u root -p | |
Enter password: | |
Welcome to the MariaDB monitor. Commands end with ; or \g. | |
Your MariaDB connection id is 307 | |
Server version: 10.1.38-MariaDB Source distribution | |
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. | |
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_var_dump($prefix, $data) { | |
echo $prefix . ": "; | |
array_walk($data, function($val,$key) { | |
echo json_encode($val) . ' '; | |
}); | |
echo "\n"; | |
} | |
function validate_pairs($data, $sum) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- students table | |
create table murid ( | |
id int auto_increment primary key, | |
nisn varchar(20) not null, | |
nama varchar(100) not null | |
); | |
-- kesalahan table | |
create table kesalahan ( | |
id int auto_increment primary key, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- --------------------------------------- | |
-- Generate Data | |
-- --------------------------------------- | |
CREATE table trans_history AS | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:00:00' AS history UNION ALL | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:10:00' AS history UNION ALL | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:20:00' AS history UNION ALL | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:30:00' AS history UNION ALL | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:40:00' AS history UNION ALL | |
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:50:00' AS history UNION ALL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DBCC FREEPROCCACHE; | |
-- ----------------------- | |
-- Find Long Running Query | |
-- Execute the query inside target database | |
-- ----------------------- | |
SELECT st.text | |
, qp.query_plan | |
, qs.* | |
FROM ( |
NewerOlder