Skip to content

Tag: select

How to wirte an select with forigin keys and such

I am about to setup a sql db, not decided yet for mysql, mariadb or postgresql. But before that I have set up my sql script to create the tables I need. First I need help with a sanity check, can you without me see what I am setting up here? Second, the thing I am struggeling with now is


I have to tables. The first table (customers) shows data about the customers (id, firstname, lastname). The second table shows data about the orders (timestamp and customer id). So, i wanted to see the last order by a customer in my table “customers” and did a SUBSELECT and it worked. But, there are some customers who never ordered something and

What do you call the . syntax in SQL?

In many databases, when writing a SELECT query, you can provide the database name along with the table name in order to resolve any ambiguity the database might encounter in case there are multiple databases with the same table names. For example, let’s say the user currently logged into SQL Server has SELECT privileges on databases DB1 and DB2, and