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 name | |
| FROM employees | |
| WHERE id NOT IN --filter karyawan berdasarkan manager id dari karyawan | |
| (SELECT managerId from employees WHERE managerId IS NOT NULL)--Subquery untuk mencari karyawan yang memiliki manager |
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 count(*) 'Number Of Students' //Count data result | |
| FROM students | |
| WHERE firstname = 'John' //Filter by name |
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 | |
| class Pipeline | |
| { | |
| public static function make_pipeline(...$funcs) | |
| { | |
| return function($arg) use ($funcs) | |
| { | |
| foreach($funcs as $function) { | |
| //Cek apakah nilai null atau tidak | |
| if(!isset($value)) |
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 | |
| class Palindrome | |
| { | |
| public static function isPalindrome($word) | |
| { | |
| $length = strlen($word); //mendapatkan panjang karakter | |
| $mid = floor($length/2); //mendapatkan nilai tengah | |
| for($i=0;$i<$mid;$i++){ | |
| //bandingkan karakter sebelah kanan dengan sebelah kiri | |
| if(strtolower($word[$i]) != strtolower($word[(int)$length-($i+1)])){ |