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
-
2
votes1
answer541
viewsStorage of List-like variables in an SQL-Server database
Good Evening Everyone, I am developing an application that makes a relationship between a Player and one or more games(online games), the problem is that a game can have one more different skills, I…
-
2
votes1
answer140
viewsLimit the number of results of a real-time UNION sub-query for performance improvement
I need to search many values that need two query’s with different conditions. To do this I use one UNION, but I need to set a limit of results. Today this is working with a limit and offset as shown…
-
2
votes1
answer7523
views(Mysql) Insert or Update in the database
I need to perform one Insert in the database, if there is no Cpf of a person. if there is it has to do a Update. But all this through a single script on Mysql. I illustrated the example below as I…
-
2
votes1
answer118
viewsRelational databases and relational object
What are the differences between relational databases and object-relational databases?
-
2
votes2
answers6988
viewsQuery with SELECT and SUB SELECT in Mysql
I have a question about SQL, never worked with sub selects and ended up getting lost with it. My SQL: SELECT CLI.id, CLI.nome, CLI.senha, CLI.email, CLI.cpf, CLI.celular, CLI.data_nasc, CLI.genero,…
-
2
votes2
answers85
viewsAdd rows with the same ID in additional columns
I have the following Table scenario: +-------------------------------------------------------------+ | ID | DATA | PROFISSAO | SEQUENCIA | +-------|…
-
2
votes3
answers1447
viewsHelp select to bring field even if null
I need help to create a select, I have 4 tables (commission, person, request, pedidoitem). So I need to bring in all the people and their goal values even if they don’t have values yet. I made a…
-
2
votes0
answers1031
viewsFirebase - Relationship between documents
I know the firebase is Nosql/Norel, but I have this doubt and it is very relevant given to the project I am developing. In the traditional Mysql model, when we have a table of categorias, for…
-
2
votes1
answer210
viewsError Converting Image to String to Save in Database
I’m trying to save an image in my form at the bank, but I’m having difficulties in solving the error: Field error in object 'usuario' on field 'foto': rejected value…
-
2
votes1
answer32
viewsB.D error with application doors closed
I have an e-commerce and is staying at Configr and we never had problems with it. This week the site started to get overloaded, even without traffic or anything, coming down several times. The…
-
2
votes2
answers1389
viewsHow to avoid invalid date error in a sub-shipment
In the code below, subconsultation "D" returns only valid dates in the DIA column, however, when trying to filter this column using the WHERE clause, Oracle displays the following error message:…
-
2
votes1
answer162
viewsChange more than one value in the same column with an UPDATE
I have the following doubt.. I have the example table - reply in the following format *------------*--------------* |resposta_id | INT | |pergunta_id | INT | |resposta | VARCHAR(45) |…
-
2
votes2
answers493
viewsbelongs_to, has_many
Hello everyone all good? I’m starting on Rails and got a little problem to make a simple web application with: Customer registration (with name and address) Employee register (only with name) Work…
-
2
votes2
answers47
viewsProblem with SQL relational logic
Considering this scheme CREATE TABLE bra_ocorrencias ( estado varchar2(2), genero varchar2(1), ano number, nome varchar2(30), num_ocorrencia number ); I need to make a query that returns me the most…
-
2
votes3
answers69
viewsBreak query result in 2 lines
Good afternoon! I have the following question My query is returning a single line, but I would need it to return two lines, where the first line would be the return of "B" and the other the return…
-
2
votes1
answer25
viewsTest for the absence of duplicate tuples
I saw in a SQL book the following query: select T.course_id from course as T where unique (select R.course_id from section as R where T.course_id = R.course_id and R.year = 2009) I am unable to…
-
2
votes1
answer42
viewsI deleted old posts and the database was almost the same size
I have a database with news posted since 2015. I decided to delete the posts, leaving only the last 30 days. With this, I expected the database to reduce in size and this did not happen. Look how I…
-
2
votes5
answers412
viewsSave or not the commands used in Mysql
When you create a Mysql code and run, that code after running, do you need to save it or not? Or after running can you forget it? I’m talking about the commands that create table, update, insert,…
-
2
votes1
answer410
viewsNode.JS and Express Insert with problem
I am new as Node.JS Express programmer with Mysql, I created the implementation to save, but he create the registry with null in the table, see how I performed the test in Postman; This is my…
-
2
votes2
answers269
viewsUpdate tables using Trigger from a main table
I have the following structure: A main table X, where the "header" of the sale is stored. A Y table, where the sale items are stored. A Z table, where some sales data will be saved, from the…
-
2
votes1
answer25
viewsWhat best practice to create a user table?
I’m creating a web system in PHP, and I’m in doubt about how best to create the table that will receive user information (Speed, organization and etc). Beyond the nome, email and senha, need to…
-
2
votes4
answers450
viewsUPDATE WITH SELECT AS A CONDITION
I have an app that sends an email to the user to confirm their email as soon as they sign up. Then I have two tables in my internal database, being them USUÁRIOS and LOGIN. In the table of USUÁRIOS…
-
2
votes1
answer146
viewsPass database content from one page to another
It seems to be something simple to research, but I’m not getting it. I would like when clicked on a list item, to open a new page with the detailed information of that item, will be the same…
-
2
votes1
answer52
viewsI’m trying to make a rollback of my Querys only to give me a mistake in Executescalar
The code works perfectly without the btw rollback. SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString); con.Open(); SqlTransaction tran =…
-
2
votes1
answer3253
views(Pandas) - Group and summarise by date
Hello, I’m a beginner in pandas and I caught in a problem that I didn’t find/understand how to solve in the documentation or other topics. Briefly I need to group the days of the observations from…
-
2
votes1
answer133
viewsPassing a Connection string dynamically
Well my problem would be trying to pass a connection string from a txt. file which is also used to bring the items from my Combobox, the goal and bring a different database depending on the item…
-
2
votes1
answer528
viewsError: SQL Server String or Binary data would be truncated
I have the variable @numero1 which brings the following result: 020000000000720000018 But at the time of update gives error: SQL Server String or Binary data would be truncated declare @g1…
-
2
votes1
answer455
viewsHow to install Jupyter Notebook autocomplete?
How do I install the extension that suggests the following code for Jupyter Notebook? For VS Code there is this Code Runner that is very good, but my work is done in Jupyter. Does anyone know?…
-
2
votes1
answer7520
viewsQt SQL - ERROR (42601): syntax error at or near
I am currently developing a program to assist in the management of a barracks in my city, I am using Qt to create the graphical interface and other libraries needed as the manipulation of databases,…
-
2
votes2
answers113
viewsInner with 3 PHP/SQL tables
I have 3 tables and I want to compare their value, I can do with 2 using the JOIN but when I put JOIN in the third point php doesn’t work. Code in PHP: $agora = "select * from usuario u join…
-
2
votes2
answers44
viewsDoubt in Postgresql function
I am doing a function in Postgresql and I want to use it to check if a table already exists or not in a database and, if not, I want to create a table. The problem is in the function declaration,…
-
2
votes1
answer97
viewsAdd another sum result
I’m trying to make a sum of the result of another operation. Below is the code I’m trying to select distinct (SELECT(SUM(CAST(ROUND(ppre.Valor_Custo, 2) as decimal(18,2))) )) * (select…
-
2
votes1
answer201
viewsShow NULL SQL values
Good evening, I’m new to SQL and I have a question. I have the following database: My goal is to present the name of the employees, their function and the name of the department where they work…
-
2
votes1
answer149
viewsHow to do Insert 1 to 1, with four tables in Laravel
I am working with a database already populated. It has four tables (Aluno, clinico, Familia and TipoCompulsao), where Aluno receives foreignkey of the three tables; Student model class Aluno extends…
-
2
votes1
answer1210
viewsSelect with subquery to catch previous record
I have a user readout log structure by reference. As shown below. SELECT L.LeituraID, L.UsuarioID, L.Referencia, L.Leitura FROM Leituras AS L |-----------|-----------|------------|---------| |…
-
2
votes2
answers188
viewsHow to update only one column of the record?
I made a code to update some columns of my record when needed. There are 7 columns listed on array, but usually I will only update 1 or 2 columns. With this code I can update my record, but I have…
-
2
votes1
answer762
viewsFailed to connect database: Connection Lost to database - Firebird and Delphi application
I have a server with more than sixty client databases that currently operate with Firebird 3.0.3.32900 and an application in Delphi that is responsible for synchronizing logs from end to end. For…
-
2
votes2
answers1117
viewsCheck if a value exists in the Firebase Realtime Database
I have a database with this structure: what happens is that when creating a new user, I need to check if there is no longer a registered equal nickname, but I am not able to do this. Here’s the code…
-
2
votes1
answer75
viewsDoes it matter to delete and create new lines or update old ones?
Not taking into account the technical difficulty of doing one thing or another, but rather the consistency of the bank, the speed of subsequent operations and the professionalism. If I have a…
-
2
votes1
answer444
viewsError when running php Artisan migrate
I am trying to create the tables and this giving the following error: BadMethodCallException : Method Illuminate\Database\Schema\Blueprint::number does not exist. at…
-
2
votes1
answer57
viewsChanging tags automatically
I am creating a function for sending email via nodemailer, and our have some templates that are for specific cases. I need a function that once you receive the Welcome template for example,…
-
2
votes1
answer38
viewsError, php does not insert data into database
People php is returning that is entering the data but in the database it does not insert: // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); }…
databaseasked 5 years, 8 months ago Lorenzo Correa 21 -
2
votes1
answer72
viewsError in left Join Linq - Dbcomparisonexpression requires Arguments with comparable types
I have the following method: However, when I run the query in the Log, using the left Join I get the following message : Dbcomparisonexpression requires Arguments with comparable types [HttpGet]…
-
2
votes0
answers186
viewsC# application in visual Studio does not connect to Sql database via network
I’m facing a problem with my application. I made the application without any error, managed the installer, but when I run it, it does not connect to the bank via network, but in Visual Studio it…
-
2
votes1
answer32
viewsData is not going to Database Mysql/PHP
The page does not show any error, I already put the ini_set('display_errors', 1), but no errors appear, it loads, but it also does not redirect to my final page, it is only a blank page <?php if…
-
2
votes1
answer206
viewserror when connecting mysql with Node.js
am connecting mysql with Node but is giving this error: C:\E. S\dao.js:10 if (err) throw err ^ Error: getaddrinfo ENOTFOUND localhost:806 localhost:806:3306 at GetAddrInfoReqWrap.onlookup [as…
-
2
votes0
answers27
viewsProblems displaying data from an automatically generated table because of the relation n to n, Entity framework c#
I am using Entity Framework code first in C#, I have the following classes. Procedure (only the relevant part): public int Id { get; set; } public virtual ICollection<Produto> Produtos { get;…
-
2
votes2
answers432
viewsSelect from multiple tables with the same ID in Mysql
The intention of the query is to select all records of various tables when the ID is equal to the one passed in the parameter, echo of the SQL line displays the query below, the records exist, but…
-
2
votes0
answers83
viewsDatabase variables are not added in $_SESSION array
I am building a cart for an application. I want to add the name, quantity and price of the product inside the cart. For this, I do: In the header I include in the pages accessed by the client:…
-
2
votes0
answers187
viewsChange wordpress database Woocommerce
I made a system for the back-end of a wordpress store that uses the Woocommerce plugin. The client requested me to make a login system with custom registration, because well, I made the system with…