Meet Gor
meetgor.bsky.social
Meet Gor
@meetgor.bsky.social
Software developer | Living in the terminal, travelling to databases and the web with CLIs and APIs
Blog: https://meetgor.com
Newsletter: https://techstructively.substack.com/
Pinned
Hi, I am Meet 👋

If you are interested in software development then let's connect

I usually work with the backend side of things, I really love to play with databases, APIs and CLIs.

Expect content around python🐍 and golang🐭

I use Neovim BTW
It feels good to develop something useful with AI, i don't know how it works, but I know what I want to make.
Pretty good. It takes some iterations, some conscious reading and knowing the actual problems to solve.

Maybe AI coding is a skill, it gets better over time
October 9, 2025 at 6:23 PM
Many to Many Relation

We saw the basic example of www.meetgor.com/sqlog/sqlite... Relation in the second last post from this, there we just focused on the concept of the relation and not so much on the structure of the junction table.

Let's take a look at the schema again:
SQLite SQL: Many to Many Relations | Meet Gor
www.meetgor.com
September 20, 2025 at 11:51 AM
Techstructive Weekly edition 60

Learning more SQL, some go and python.
Trying to replace doomscroll with reading article and books

www.meetgor.com/newsletter/t...
Techstructive Weekly #60 | Meet Gor
www.meetgor.com
September 20, 2025 at 10:50 AM
One to One Relations

I might missed this basic relationship model as I haven't really found it quite commonly used, but its still used in very specific examples.

That one relationship is one-to-one. As the name suggests, it maps one row to exactly one row.
September 19, 2025 at 4:04 PM
Many to Many Relations

We have seen www.meetgor.com/sqlog/sqlite... relationship and also the www.meetgor.com/sqlog/sqlite... relationship.

Let's extend it with many-to-many relationship. Here one row can refer to many other rows, but that other row can also be referred by multiple rows.
SQLite SQL: One to Many Relation with Foreign Key | Meet Gor
www.meetgor.com
September 18, 2025 at 6:11 PM
Self Join Relations

In the last post, we had defined a one-to-many relation between the users table and the posts table.

Now, let's create a single table where we can define a one-to-many relationship.
September 18, 2025 at 6:01 PM
If I could remove something from the history of the internet I would remove AI (chatgpt and all llms)

I know it is a profound piece of technology but it will hurt humans in the longer run, brain rot, artless life.
September 17, 2025 at 8:48 AM
One to Many Relation with Foreign Key

Back to the question that we raised in the www.meetgor.com/sqlog/sqlite... post, "What would happen if there are more than one row in the primary table that references the same id in the foreign table?"
SQLite SQL: Foreign KEY table constraint | Meet Gor
www.meetgor.com
September 16, 2025 at 4:31 PM
One to Many Relation with Foreign Key

Back to the question that we raised in the www.meetgor.com/sqlog/sqlite... post, "What would happen if there are more than one row in the primary table that references the same id in the foreign table?"
SQLite SQL: Foreign KEY table constraint | Meet Gor
www.meetgor.com
September 16, 2025 at 4:30 PM
SQLite added generated columns in 3.31 (around Jan 2020)

Postgres added generated columns with virtual and as default in v18 (to be released September 2025)

There is still a lot to learn in SQL and adoption is still going on, even in the most used databases
September 16, 2025 at 5:11 AM
Foreign KEY Table constraint

Foreign Keys are the fundamentals of any relational databases, as they are the ones that make the connection or the relations among the tables in our database system.
September 15, 2025 at 6:06 PM
The PRIMARY KEY constraint is not actually a column constraint, it is a table constraint. In the previous section we learnt about how to handle single column-level PRIMARY KEY. In this section we'll understand how to use PRIMARY KEY as table constraint,
September 14, 2025 at 10:52 AM
The PRIMARY KEY column constraint

The PRIMARY KEY constraint is not actually a column constraint, it is a table constraint. But in this section, we'll only learn about how to handle single column-level PRIMARY KEY.
September 13, 2025 at 2:30 PM
The CHECK column constraint

sqlite.org/lang_createt...
This is a column constraint that allows us to define certain conditions that we want to evaluate before inserting the column for the row and populate it accordingly. In this post, we will check, what and when used.
CREATE TABLE
create-table-stmt: hide
sqlite.org
September 12, 2025 at 4:30 PM
We saw certain limitations of the DEFAULT column constraint clause, that it can't generate dynamic values based on other columns or some other dynamic population. For overcomming those kind of constraints, there is one more specific constraint, the GENERATED sqlite.org/gencol.html column constraint.
Generated Columns
sqlite.org
September 11, 2025 at 6:25 PM
DEFAULT Constraint

The DEFAULT constraint in SQLite is used to specify a default value for a column, if not provided, then the column will be populated with the NULL value as the default value.

According to the docs:
September 10, 2025 at 5:23 PM
Unique Constraint

The UNIQUE constraint ensures that a column in a table contains no duplicate values. Like, if you add an UNIQUE constraint to a column, then no two rows can have the exact/same value for that column.

The documentation is more nuanced.
September 9, 2025 at 5:24 PM
The NOT NULL constraint is a column-level constraint that will prevent the insertion/updation of a NULL value in that column record.

What is NULL?

In SQLite, specifically, a NULL is a value indicating that a value is not known or just not there.
September 8, 2025 at 4:06 PM
Create Table with column constraints

We have seen the table creation with column types, we now need to look into the constraints or limitations that we can add to those columns, in order to make the data-model more robust and add some basic validations before doing any updation
September 7, 2025 at 3:03 PM
If you want to store values in a column with a specific type, you need to specify one of the following types in order to store that value in relatively type specific data.
September 6, 2025 at 12:55 PM
What if you only wanted one column. If you create specify a column name in create table, then there will be actually 2 columns created, one that you specified and the other which is hidden as rowid, unless you mentioned rowid as the column.
September 5, 2025 at 4:02 PM
We have explored enough sqlite dot commands, now I want to explore the actual nuts and bolts of SQL in SQLite, what better place then to create tables.

The CREATE TABLE as the name suggest will create a table in a sqlite database. What is a table?
> set of relations
September 4, 2025 at 4:27 PM
The .headers command is crucial as might effect the way the result set is displayed. The first row would be set to the name of the columns in the output of the relevant commands like .output, .once, or even your simple standard out queries if it is set on
.headers on
.header on
September 3, 2025 at 4:33 PM
If you wanted to use a specific separator for columns and rows while displaying the result set / table, you can use the .separator dot command which can take 2 arguments, first as the separator for the column and the second for the row.
September 2, 2025 at 3:37 PM
The SQLite shell is a great way to test out and run bunch of queries, but the output might be squished or cluttered. You might need to view the output in a specific way, and the creators of SQLite were already hearing your screams.
September 1, 2025 at 4:29 PM