Most voted "database" questions
A database (its abbreviation is BD, DB, database) is an organized collection of data typically used to model certain situations. Use this tag if you have questions about designing a database. If this is a specific database management system, like Mysql, for example, use this tag instead.
Learn more…3,414 questions
Sort by count of
-
0
votes0
answers26
viewsData migration postgresql reformulate table
The title may imply that I am recreating a table with similar attributes, but the term is as follows:: I have a database currently running in my application for study purposes, there is a class…
-
0
votes1
answer49
viewsProblems declaring a foreign key using Ibernate
Hello.I need help declaring a foreign key using Hibernate in a project with JSF, I consulted several websites and handouts and could not find a solution. Where I have the classes already mapped…
-
0
votes1
answer80
viewsError when executing an INSERT in a view
I have this chart +---------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------+------+-----+---------+-------+ |…
-
0
votes1
answer84
viewsWebsite and database on the same machine, localhost or ip?
I have a website and database running on the same machine. And I use the following connection string: <add name="cs_name" connectionString="server=227.117.126.60;User…
-
0
votes1
answer69
viewsSelect different conditions for the same column
I have the following table with my current query. Data | PesoTotal 01/04/2019 | 500 02/04/2019 | 800 And I would like to add a new column (Pesohorario), which would be the Peso on the date, but…
-
0
votes1
answer24
viewsAdaptation of csv columns with DB fields other than hard code?
Boom day :) I’m doing a python script that reads a file. csv that takes a few columns (not all columns, just a few) and saves it in the database. As the columns of csv and the name of the database…
-
0
votes1
answer60
viewsPDO - Showing bank information
While trying to connect to Database without internet connection the program shows me this error message: Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Network is unreachable in…
-
0
votes0
answers63
viewsPrimary key transfer to foreign key - PHP
I am having a problem entering data into my database. I have two connected tables, company and information. STRUCTURE OF THE COMPANY TABLE CREATE TABLE IF NOT EXISTS `empresa` ( `empresa_id` int(11)…
-
0
votes1
answer373
viewsRemove partition from table
Using the mysql documentation, I created the partition based on a year field. ALTER TABLE minhatabela PARTITION BY HASH (ano_referencia) PARTITIONS 10 To make a possible rollback, how I would drop…
-
0
votes1
answer39
viewsNotice: Undefined variable: list_book
<form class="form" method="POST"action="processa_livro.php"> <table class="table table-bordered"> <thead> <tr> <th>Nome</th> <th>Autor</th>…
-
0
votes0
answers150
viewshow to make javascript take an n number of elements from a database
I would like to take for example all the names of a database table and save in an array(or matrix) and then list in an html table how can I create a new method BS: I have that part ready: var mysql…
-
0
votes1
answer103
viewsTake Database info from the array element
I’m making a cart in php. What I want is to get the name of the product (which is in the database) from its id, which is the value of each position of the array. However, since there are multiple…
-
0
votes1
answer31
viewsProblems in PHP cart
It follows the code of my cart. I wanted it not to repeat the products but add up the amount of them in the cart. I’m having a hard time with this part. <?php include 'conexao.php';…
-
0
votes1
answer191
viewsProcess of completing PHP purchase
I have the code below and I can "register the purchase" in the order table by entering date, total purchase value and the id of the customer who bought however how do I add the id’s of the products…
-
0
votes1
answer28
viewsDo I upload all the data directly into the HTML page or access the database more often?
I’m developing a web project for real estate. On the page is the mirror of sales or the floor plan of the condominium of houses to be sold. When the user clicks on one of the plant houses, the…
javascript c# html database web-applicationasked 5 years, 6 months ago Luis Fernando Martinelli Ramos 23 -
0
votes0
answers52
viewsInsert with lastInsertId() error
The code below only inserts in the requested table, already in the requested product has_does not insert. What error ? public function criarPedido(){ $consulta = 'INSERT into pedido(data,…
-
0
votes1
answer100
viewsMultiple references to a FK in the same column/row
Good afternoon colleagues, I would like a help to model a comic, the doubt is as follows: Is it possible to have more than one FK ID on a tuple? EX: tabela teste1 |id_teste1|id_teste2|teste|teste01|…
-
0
votes1
answer145
viewsError while trying to create a Migration in the Laravel
I just created a new project in Laravel, but when creating a Migration, there is an error in the database. I have tried to create a new database or use an existing one, but the problem remains.…
-
0
votes1
answer58
viewsUse an html tag that is in a Mysql database on a page
I inserted the following direct tag into the bank <iframe width="962" height="541" src="https://www.youtube.com/embed/w2Ov5jzm3j8" frameborder="0" allow="accelerometer; autoplay; encrypted-media;…
-
0
votes1
answer59
viewsError in autocomplete search field - PHP / AJAX
Good afternoon guys, today I managed to make a progress in my code and I got to the point where I must be missing something stupid but I can’t find it. I am making an input field with search and…
-
0
votes1
answer24
viewsCount quantities of a given attribute within a table
all right? I have the following question, I created a database for a card game in the style of Magic. I have a table that shows the skills and another that shows the cards and, another one that I…
-
0
votes1
answer207
viewsCase When with Leftjoin
Can someone give me a hand, I’ve spent hours trying to make this query work: SELECT p.id as idPedido, p.*, i.*, e.*, f.*, m.id AS idEmpresa, m.razao_social, l.id AS idFilial, l.razao_social AS rsf,…
-
0
votes1
answer19
viewsQuery problems in Apache Phoenix
Hi. My team and I are having an Apache Phoenix-related problem. I wonder if anyone has come across this problem before or if we’re doing something wrong. First, we create the following table: create…
-
0
votes1
answer57
viewsSend input content to database
I’m having a problem trying to get the values of these inputs to be sent to a database, my knowledge of php is very basic, I tried searching in various forums to see if I found something but I was…
-
0
votes2
answers106
viewsAWS lambda - cannot connect to RDS database, only locally
I am trying to connect to a RDS instance from a lambda. I made and tested the lambda locally, it worked perfectly. However, when I deploy to AWS the code is normally executed until the part where…
-
0
votes1
answer33
viewsHow do I pull the previously selected data from the register for a combobox in the issue?
I have a customer registration that is done by the user and after that has the part q the user can edit this information. I’m having problems to pull data already selected for the combobox according…
-
0
votes1
answer31
viewsError message if e-mail already exists in the database
I have a user registration and I need an error message to appear if the user tries to register an email that already exists in the Bank. I wanted a message in the field itself. How can I do??…
-
0
votes1
answer27
viewsProcedure in oracle
I can not very well create procedures with the output values, how to receive a value, and return it after the call, someone could help me with an exercise that I am doubtful Create a procedure that…
-
0
votes1
answer81
viewsUpdate with two tables at the same time
I’m doing an update to edit window and it’s not giving error, but it’s only working the address part, the beekeeper information part is not updating Beekeeper table <?php session_start();…
-
0
votes1
answer226
viewsInterbase database connection error
Good afternoon, I’m having trouble configuring the database connection in Delphi 10.3 Community Edition. I am trying to connect to Interbase by Firedac and gives the error below when testing the…
-
0
votes0
answers40
viewsIncrease the number of vehicles with Trigger
I have the table pessoa who has the spine qtd_veiculos, every time I give one insert with a new vehicle, which has the CPF foreign_key same as some person at the table pessoa, this column should be…
-
0
votes1
answer157
viewsMysql, SELECT according to the specialisation of the generic entity occurrence
In my database I have a generic entity "user", such entity is specialized in two other "store" and "service_provider", this specialization has total and exclusive characteristic, so that, an…
-
0
votes1
answer363
viewsImport JSON to Mysql table
I am trying to import a JSON into Mysql, but without success EDIT: JSON has the structure below, it is return of this wikidata sparql query. The query created a document for each tuple { "_id" :…
-
0
votes1
answer316
viewsMinimum and maximum cardinality - Relational Model
Guys, I’m very much in doubt of these 2 tables... Right, I asked 2 questions for my tables: User, you can register how many courses? A: None or N courses Course, for you to be registered, you need…
-
0
votes2
answers83
views -
0
votes2
answers299
viewsHow to use a variable to delete with like? SQL Server
I’m having trouble developing the T-SQL below: DECLARE @NOME_FILIAL VARCHAR(25); DECLARE @DATA_AJUSTE DATETIME; SET @NOME_FILIAL = (SELECT FILIAL FROM FILIAIS WHERE COD_FILIAL='125518'); SET…
-
0
votes1
answer375
viewsHow to do 2 Insert at the same time with PHP in MYSQL Database?
Database: DROP DATABASE IF EXISTS mydb; CREATE DATABASE IF NOT EXISTS mydb; USE mydb; CREATE TABLE clientes ( cod_clientes INT UNSIGNED NOT NULL AUTO_INCREMENT, nome VARCHAR (20) NOT NULL, PRIMARY…
-
0
votes0
answers144
viewsHow to save data from a column and then overwrite it again? SQL Server
I need to save data from a table to a database command and return that data to the same table after a while... I thought I’d do something like this: DECLARE @NOME_FILIAL VARCHAR(25); DECLARE…
-
0
votes2
answers972
viewsHow to Use an UPDATE within IF ELSE SQL Server
I’m trying to verify if a column exists within a certain table. When checking if it exists, I want to update the column with the value 1, if not, create and update. However, every time I run the…
-
0
votes2
answers75
viewsList only if the other table does not have a dismissal
Good afternoon. I need to make a list of employees per year. For example. Active employees 2018, However I’m having problems, because in 2019 some were fired there not list the same, and use the…
-
0
votes1
answer238
viewsQuery in two Oracle tables
How do I query two tables at once? I have two table structures as follows. TGFCAB ___________________ |NUNOTA| DTMOV | ------------------| | 1 |01/06/2019| | 2 |02/06/2019| | 3 |03/06/2019| and…
-
0
votes0
answers171
viewsTotal results by products in oracle table
I have two tables similar to the tables below: TGFCAB |NUNOTA| DTMOV | ------------------| | 1 |01/06/2019| | 2 |02/06/2019| | 3 |03/06/2019| TGFITE |NUNOTA|CODPROD|QTDNEG|VLRUNIT |VLRTOTAL|…
-
0
votes0
answers41
viewsForeign key in phpMyAdmin brings duplicate record
Problem I have a table called "entidades_category-script" (let’s call 'A') that has the following keys: It turns out that it references another table called entidades_category-script-type (let’s…
-
0
votes1
answer785
viewsHow to insert foreign keys in PHP, so I can have a control when pulling the VIEW
I am doing a project, where employees registered on the site (corporate), can register: Errors and Customers who had these errors (In case it is a support company). I need PHP to do the Foreign Key…
-
0
votes1
answer112
viewsADO fails to connect
I have a project in Excel where I am trying to make a connection to SQL Server database. I am working on a virtual machine and the database is on another machine, however they are all on the…
-
0
votes1
answer427
viewsSeparate results from an SQL query by date
I am creating an SQL query that will be used in a system/report and came across the following problem. It has two results, one that displays the total time between the days searched and the other…
-
0
votes1
answer32
viewsIssue on redirect of Edit and Delete pages in PHP
All right, guys, I’ve got a weird problem, I’ve developed a simple scheduling system. git repository: https://github.com/guischpor/sistemacadastrophp I deployed the project on my hosting site at…
-
0
votes0
answers132
viewsHow to update to change a table-specific row
How do I change this table? I’m a beginner in PHP/MYSQL and I’m not sure how to change it. Once the person clicks on the "change" icon, they should be routed to a page, which should pull the id of…
-
0
votes2
answers46
viewsmysql query that groups the distances travelled each day
Hello, I started a query from a mysql database where the distance of each commute of a driver is saved along with the time: DATE_FORMAT(l.dateGenerated,'%d/%m/%Y %H:%i') AS Day , d.name AS…
-
0
votes0
answers25
viewsSet a Datefields Arrayfield
I need to store several dates in a Django model (I’m using version 2.1), I was able to create several fields, thus: date1 = models.DateField(null=True, blank=True, verbose_name="Data da parcela 1")…