Sometimes I need to insert a field or an index or make some more critical modification and often ask everyone to leave the base before I execute the command.
This command on my machine even with the application executes normally, but when I r...
I'm having a hard time putting together a select with GROUP BY . What I want to do is this:
I have three tables:
bicos
idbico, idempresa, idbomba
abastecimentos
idabastec, idbico, idempresa, valora...
Good afternoon, today a small question has arisen. Somewhere in my code I have a query to do an update.
The function is as follows:
function updateUser(user_id, params) {
const query = 'UPDATE users
SET user_name...
Hello, I have a situation in a system where I need to find out which student enrollments are related to a tutor in a class.
The tables I have are:
matricula containing foreign key with student (mat_aln_id) and with class (mat_tur_...
Is there a way to force PostgreSQL to use a specific index?
I have two equal tables (different servers, of course), with the same indexes created in each one, however, on one server the index is used and the other is not.
I need to get the...
When running the command php -S localhost:8080 -t public The error above is triggered when I try to make a connection with postgres. Other applications can access normally when accessed by the url of the local server. All extensions and m...
I have a class diagram and would like to know how to build the database. Here's the scenario:
With the classes below I have a Demand that has a requestor and an analyst, next to each of the classes should I have a list of demands?
In th...
How do I make a select with sum and inner join to add a value x between 3 tables. A query return to the lowest possible number of results.
create table credit_card (
credit_card_id int primary key,
nome varchar...
I'm trying to install and configure PostgreSQL on my machine, but I'm having some questions and some problems.
I followed the following steps of the installation tutorial on the official site .
I'm using Linux Mint Cinnamon 18.2.
Here a...
I created the Address and Client table, as follows sql:
CREATE TABLE ENDERECO(
Logradouro VARCHAR (50) NOT NULL,
CEP VARCHAR(50) NOT NULL,
Numero INT NOT NULL,
Complemento VARCHAR(50),
Cidade VARCHAR (50) NOT NULL,
Bairro VARCHAR (50) NOT NULL...