Ben Chuanlong Du's Blog

It is never too late to learn.

Questions on SQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. 比如在 LEFT JOIN 中过滤条件写在 ON 和 WHERE 的区别。

  2. Table-value function 和 scalar-valued function 的区别.

  3. char、varchar、nvarchar之间的区别(包括 …

Data Types in Different Programming Languages

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Data Type C C++ Rust Java Python numpy pyarrow Spark SQL SQL
8 bit integer short (16-bit) int8_t i8 short (16-bit) int (arbitrary precision) int8 TinyInt …

Access Control in Spark SQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Grant Permission to Users

GRANT
    priv_type [, priv_type ] ...
    ON database_table_or_view_name
    TO principal_specification [, principal_specification] ...
    [WITH GRANT OPTION];

Examples:

GRANT SELECT ON table1 TO USER user1;
GRANT SELECT ON DATABASE db1 TO USER user1 …

SQL Translation Tools

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

The ORM library SQLAlchemy

can be leverage

SQL Translation Tools

JOOQ Parser

Use Column Alias in SQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Logically any SELECT is processed in following order:

    1. from
    2. where
    3. group by
    4. having
    5. olap functions
    6. qualify
    7. select
    8. sample
    9. order by

    Besides the proprietary QUALIFY/SAMPLE every DBMS will do it exactly …