This file contains 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
PS C:\Users\hiday> mysql -u root | |
Welcome to the MariaDB monitor. Commands end with ; or \g. | |
Your MariaDB connection id is 26 | |
Server version: 10.5.7-MariaDB-log mariadb.org binary 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. | |
MariaDB [(none)]> use test |
This file contains 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 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 ( |
This file contains 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
mysql> use test | |
Database changed | |
mysql> ---------------------------------------- | |
mysql> -- create table penjualan | |
mysql> ---------------------------------------- | |
mysql> create table penjualan ( | |
-> id int auto_increment primary key, | |
-> no_faktur varchar(50) not null | |
-> ) |
This file contains 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 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
-- ------------------------------- | |
-- MySQL Only | |
-- ------------------------------- | |
with grade_calculation as ( | |
select '00001' student_code, 'N001' course_code, 90 grade union all | |
select '00001' student_code, 'N002' course_code, 95 grade union all | |
select '00001' student_code, 'N003' course_code, 80 grade union all | |
select '00001' student_code, 'N004' course_code, 75 grade union all | |
select '00002' student_code, 'N001' course_code, 70 grade union all | |
select '00002' student_code, 'N002' course_code, 80 grade union all |
This file contains 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 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 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 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
D:\xampp\mysql\bin>mysql.exe -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 7 | |
Server version: 5.5.16 MySQL Community Server (GPL) | |
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. | |
Oracle is a registered trademark of Oracle Corporation and/or its | |
affiliates. Other names may be trademarks of their respective | |
owners. |