Import SQL dump into PostgreSQL database
psql databasename < data_base_dump That’s the command you are looking for. Beware: databasename must be created before importing. Have a look at the PostgreSQL Docs Chapter 23. Backup and Restore.
psql databasename < data_base_dump That’s the command you are looking for. Beware: databasename must be created before importing. Have a look at the PostgreSQL Docs Chapter 23. Backup and Restore.
There is a lot of confusion around this, I will try to make it as simple as possible. The primary key is a general concept to indicate one or more columns used to retrieve data from a Table. The primary key may be SIMPLE and even declared inline: create table stackoverflow_simple ( key text PRIMARY … Read more
Horizontal scaling means that you scale by adding more machines into your pool of resources whereas Vertical scaling means that you scale by adding more power (CPU, RAM) to an existing machine. An easy way to remember this is to think of a machine on a server rack, we add more machines across the horizontal … Read more
An identifying relationship is when the existence of a row in a child table depends on a row in a parent table. This may be confusing because it’s common practice these days to create a pseudokey for a child table, but not make the foreign key to the parent part of the child’s primary key. … Read more
I recommend checking out Microsoft’s SQL Server sample databases: https://github.com/Microsoft/sql-server-samples/releases/tag/adventureworks The AdventureWorks sample uses a very clear and consistent naming convention that uses schema names for the organization of database objects. Singular names for tables Singular names for columns Schema name for tables prefix (E.g.: SchemeName.TableName) Pascal casing (a.k.a. upper camel case)
Let’s say you have a collection of Car objects (database rows), and each Car has a collection of Wheel objects (also rows). In other words, Car → Wheel is a 1-to-many relationship. Now, let’s say you need to iterate through all the cars, and for each one, print out a list of the wheels. The … Read more