Some Basic SQLs in Oracle

— Find Tables in a Schema

— for SH schema

SELECT owner, table_name
FROM all_tables
where OWNER = ‘SH’;

— for HR Schema

SELECT owner, table_name
FROM all_tables
where OWNER = ‘HR’;


— Create table based on another table

DROP TABLE MyCustomer;

— Create the structure but no data

create table MyCustomer AS

Select Cust_ID, Cust_First_Name, Cust_Last_Name   

FROM sh.Customers

where ROWNUM < 0;

SELECT *

FROM MyCustomer;


DROP TABLE MyCustomer;

— Create both structure and bring data

create table MyCustomer AS

Select Cust_ID, Cust_First_Name, Cust_Last_Name   

FROM sh.Customers;

SELECT *

FROM MyCustomer;

BRING DATA FROM ANOTHER TABLE

— REMOVE ALL DATA FROM TABLE MyCustomer

TRUNCATE TABLE MyCustomer;

SELECT *

FROM MyCustomer;

— BRING DATA FROM ANOTHER TABLE

INSERT INTO MyCustomer

SELECT Cust_ID, Cust_First_Name, Cust_Last_Name

FROM SH.CUSTOMERS

FETCH FIRST 10 ROWS ONLY;

— SHOW INSERTED DATA

SELECT *

FROM MyCustomer;

Oracle PL/SQL Concepts

Oracle PL/SQL Concepts

  • BLOCK
    • declare …. Begin…End.
  • Cursor
  • Trigger
  • Programming Clauses:
    • if..then…else, case when, loops (for, while)
  • Stored Procedure
  • Function
  • Advanced SQLs and Analytics Functions
    • GROUP BY ROLLUP(), GROUP BY CUBE()
    • RANK(), DENSE_RANK(), ROW_NUMBER()
    • PARTITION_BY, ORDER BY X NULLS Last, ORDER BY X NULLS FIRST, RANGE BETWEEN INTERVAL 30 DAY PRECEDING AND INTERVAL ‘30’ DAY Following
    • Hierarchical: Connect Prior
    • Windowing Functions: RANGE BETWEEN INTERVAL 30 DAY PRECEDING AND INTERVAL ‘30’ DAY Following
    • Grouping Sets

Misc. Short Notes on Visual Studio and C#

Download Visual Studio Community Edition:

https://visualstudio.microsoft.com/vs/community

Compare Different Versions of Visual Studio:

https://visualstudio.microsoft.com/vs/compare

IPO Diagram for Your Code (Application)

IPO Diagram visually shows/describes key inputs, Processes/Operations, and resulting outputs from those operations.

Ref: https://www.youtube.com/watch?v=a10a11oxjrA&pp=0gcJCdgAo7VqN5tD

For UML class diagram Concepts, please check:

https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-class-diagram-tutorial

An example from the URL above:

In Object Oriented Design:

Ref: https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-aggregation-vs-composition/

Associations are relationships between classes in a UML Class Diagram i.e. How these classes are associated (in real world). Two types: Aggregation and Composition.

Aggregation and Composition are subsets of association meaning they are specific cases of association. In both aggregation and composition object of one class “owns” object of another class. But there is a subtle difference:

  • Aggregation implies a relationship where the child can exist independently of the parent. Example: Class (parent) and Student (child). Delete the Class and the Students still exist.
  • Composition implies a relationship where the child cannot exist independent of the parent. Example: House (parent) and Room (child). Rooms don’t exist separate to a House.

Generalization is a mechanism for combining similar classes of objects into a single, more general class.”

Specialization is the reverse process of Generalization means creating new sub-classes from an existing class.”

For OOP Concepts: Polymorphism, Encapsulation, Data Abstraction and Inheritance in Object-Oriented Programming

Check: https://raygun.com/blog/oop-concepts-java/

https://www.nerd.vision/post/polymorphism-encapsulation-data-abstraction-and-inheritance-in-object-oriented-programming

https://www.geeksforgeeks.org/understanding-encapsulation-inheritance-polymorphism-abstraction-in-oops

Linux Certification (RedHat, Ubuntu, Generic)

Linux Certification (RedHat, Ubuntu, Generic)

For UBUNTU:

CUE.01 Linux Quick Certification (QC)

CUE.02 Desktop Quick Certification (QC)

CUE.03 Server Quick Certification (QC)

Ref: https://ubuntu.com/credentials

RedHat:

Red Hat Certified System Administrator

Red Hat Certified Engineer

Red Hat Certified Specialist in Containers

Red Hat Certified OpenShift Administrator

Ref: https://www.redhat.com/en/services/certifications

Linux Professional Institute LPIC-1

LPIC-1, LPIC-2, LPIC-3

Ref: https://www.lpi.org/our-certifications/lpic-1-overview/

CompTIA Linux+

https://www.comptia.org/certifications/linux

Linux Foundation Certified System Administrator (LFCS):

https://training.linuxfoundation.org/certification/linux-foundation-certified-sysadmin-lfcs

GIAC Certified UNIX Security Administrator (GCUX):

GIAC Certifications:

https://www.giac.org/certifications

PowerShell : Check the Block Size of a Drive

Command:

Get-CimInstance -ClassName Win32_Volume | Select-Object Name, FileSystem, Label, Size, BlockSize | Sort-Object Name | Format-Table -AutoSize

Sample Output:

Needed to format a 1TB Memory Card. 64 KB seemed to be a good Block Size for general use. Windows by default did not give an option to select a smaller block size. Powershell commands could be used or 3rd party software could be used.

Java Creational Design Patterns

5 types of creational design patterns:

  1. Factory Design Patterns: Purpose: Create Objects, Keep Object Creation Centralized
  2. Abstract Factory Design Patterns
  3. Singleton Design Pattern: Limit instantiation  of a clas to only one instance
  4. Prototype Design Patterns: Object creation based on Prototype Object Instance; Simpler Object Creation than Factory.
  5. Builder Design Patterns: Object Creation, Complex Object Creation, Keep Complex Object Creation separate from it’s representation.

For Factory: Simple Factory, Factory Method, Abstract Factory

Factory Method: Construction separated from implementation. Objects can be created without defining the exact class of object to be created.

Abstract Factory: One layer above Factory Method. Super Factory. Creates other Factories to create objects.

Builder Design Patterns: Helps to create complex objects. Uses construction methods/processes that can be used to create different representations of Objects. Step by step construction.

Ref: https://www.geeksforgeeks.org/creational-design-pattern/

Builder Pattern: Ref: Wikipedia

Factory Method Design Pattern: (Wikipedia)

Abstract Factory Design Pattern: (Wikipedia)

How to install phpMyAdmin on Linux (AlmaLinux )

How to install phpMyAdmin on Linux (AlmaLinux – CentOs commands will work)

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf –enablerepo=remi install phpMyAdmin

nano /etc/httpd/conf.d/phpMyAdmin.conf

sudo httpd -t

systemctl restart httpd

Accesss:

http://your-server-ip/phpMyAdmin

Ref: https://www.liquidweb.com/help-docs/how-to-install-phpmyadmin-on-linux-almalinux/

Commands from this URL worked. In my case, I only executed the above commands.

Investing in HALAL ETFs

What are your thoughts?

It looks like, if I am to invest in Halal ETFs, the best available options are: SPUS, and HLAL – For Equity Part. SPRE and SPSK can be for the fixed income part. However, the performance of SPRE and SPSK is not great – you may also lose money.

You will buy all the above ETFs from USA-based exchanges (Canadian or other country brokerages may have the feature to buy). It brings some challenges such as currency conversion (charges), and probably some % are withheld if from a different country (Canadians may or may not have exemptions depending).

WSHR (Wealthsimple Shariah World Equity Index ETF ) can be an option from Canada (no currency conversion). However, the performance is not good at all.

It looks like: SPUS and HLAL are the way to go (at least to start with). Then probably look into SPRE and SPSK.

Ref: https://amalinvest.com/halal-investing/halal-etfs-compared

https://blog.zoya.finance/best-halal-etfs/#top-15-best-halal-etfs-to-buy-in-2025

https://blog.zoya.finance/best-halal-etfs

https://amalinvest.com/halal-investing/the-problem-with-halal-etfs

How should I diversify my investments into different Halal ETFs?
byu/Ashariqbal_ inHalalInvestor

Upgrading Moodle to Newer Versions

[root@vps training]# history | tail -20
1031 git pull
1032 php admin/cli/upgrade.php
1033 php admin/cli/maintenance.php –disable
1034 git branch -a
1035 git branch –track MOODLE_500_STABLE origin/MOODLE_500_STABLE
1036 git checkout MOODLE_500_STABLE
1037 git commit
1038 git checkout MOODLE_500_STABLE
1039 php admin/cli/maintenance.php –enable
1040 remotes/origin/MOODLE_400_STABLE
1041 git commit MOODLE_400_STABLE
1042 git branch –track MOODLE_400_STABLE origin/MOODLE_400_STABLE
1043 history -10
1044 history | tail -10
1045 git checkout MOODLE_400_STABLE
1046 php admin/cli/maintenance.php –enable
1047 git pull
1048 php admin/cli/upgrade.php
1049 php admin/cli/maintenance.php –disable
1050 history | tail -20
[root@vps training]# history | tail -25
1027 git pull
1028 php admin/cli/cron.php
1029 vi config.php
1030 php admin/cli/maintenance.php –enable
1031 git pull
1032 php admin/cli/upgrade.php
1033 php admin/cli/maintenance.php –disable
1034 git branch -a
1035 git branch –track MOODLE_500_STABLE origin/MOODLE_500_STABLE
1036 git checkout MOODLE_500_STABLE
1037 git commit
1038 git checkout MOODLE_500_STABLE
1039 php admin/cli/maintenance.php –enable
1040 remotes/origin/MOODLE_400_STABLE
1041 git commit MOODLE_400_STABLE
1042 git branch –track MOODLE_400_STABLE origin/MOODLE_400_STABLE
1043 history -10
1044 history | tail -10
1045 git checkout MOODLE_400_STABLE
1046 php admin/cli/maintenance.php –enable
1047 git pull
1048 php admin/cli/upgrade.php
1049 php admin/cli/maintenance.php –disable
1050 history | tail -20
1051 history | tail -25

AI Algorithms – 5: Linear and Polynomial Regressions