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
-
3
votes2
answers2934
viewsUpdate using values contained in another table
How can I update a table by setting the value of a field with the same value contained in another table for all records? I have a 'product' table and a 'movproduto' table. I want to update the…
-
3
votes0
answers47
viewsWhat are the cardinalities of the Indians?
Checking the Index using the following command: show indexes from tabela_exemplo; The column Cardinality left me in doubt. It holds an integer value for each index pointed to one or more columns…
-
3
votes1
answer2462
viewsSearch with accents and without accents Postgresql
Hello, I am trying to search through a field in the application, it searches the word in the database (postgres), however, has a lot of product registered in the bank, with and without accent, for…
-
3
votes0
answers80
viewsHow to maintain synchronized tables in different databases?
Problem I have a problem where I need to synchronize some tables from a legacy database to another simpler database that will be used by an external application. Attempts So I started to analyze…
-
3
votes1
answer90
viewsMerge different database queries
"It is possible to join information from tables of other databases?" This doubt arose when I needed to do a survey make a comparison of data in tables of different stores, Every store has its own…
-
3
votes0
answers445
viewsConnect Firebird via PHP
I have a BD in Firebird on a server other than the web server (PHP). I’m trying to make the connection between them, using the ibase_connect function, but nothing happens, my line in php is:…
-
3
votes2
answers44
viewsWhat is the "~*" operator for in a select in SQL?
I saw this line of code in some examples: SELECT * from produto where nome ~*'$texto_pesquisado';" But I don’t know what the function of ~*, I found no explanation. What is it for?…
-
3
votes1
answer43
viewsSort by month without repeating the year
I would like to add the total sales in the month, but without repeating the year. select EXTRACT(year FROM v.dataVenda), case when EXTRACT(MONTH FROM v.dataVenda) =1 then sum(v.valorvenda) else 0…
-
3
votes2
answers51
viewsAre Mongodb’s "id" unique among collections?
It is possible that the same ObjectId is generated for a document in two different collections in the same database?
-
3
votes1
answer1428
viewsHow to quote a variable for Mysql query
I’m doing a trial, I need to put a variable varchar in the query, but it doesn’t go with the simple quotes, I tried to concatenate like this or something but it’s no use: set @comando :=…
-
3
votes1
answer155
viewsUse multi-tenancy model or other types?
I am working on several systems for a single company. In some cases, the systems must integrate and in others not. For example, user access control must communicate with all other systems, since…
-
3
votes1
answer99
viewsError changing table in Postgresql. How do I change the type of an int column to the timestamp type?
I’m studying the Postgresql comic book for a recent book I acquired. When trying to change a tebela based on the command I learned in the book an error occurred, I used exactly the same command…
-
3
votes2
answers835
viewsHow to make an auto ID increment relative to another field in Postgresql "Postgresql"?
Personal it has been a long time since I look for a way to do this, what would be the correct way to make an auto increment that depends on another field as in the example below? id_empresa |…
-
3
votes3
answers1854
viewsSQL query to know the sales of a period (year), dividing by month and showing the total of each month and year
I work as a technical support in an automation system, a customer asked if there was a report in the system that showed the total sales of 2018 divided by month and showing the total of each month…
-
3
votes1
answer66
viewsIncomplete sum with JOINS in Mysql
I’ve had a doubt for a few days and I can’t find a solution. I own the tables: swing +------------+---------+------------+----------+ | id_balanco | id_loja | data | dinheiro |…
-
3
votes1
answer126
viewsPerformance according to box control modeling
I am making a system for daily box control, which allows launches/deletion of values. Below is the table that will store the values, filled with some data to exemplify. There are more fields, but…
-
3
votes2
answers245
viewsDoubts in the modeling of the Database
Guys, I have the Product, Ingredient and Sale table. The product contains several ingredients, e.g.: Suppose that the product is a mixture, it contains 1 bread and 2 Ingredient cheeses, this…
-
3
votes1
answer486
viewsIs it worth encrypting database?
Recently I’ve been having the curiosity about the utility of encrypting all fields of all tables in a database. The idea is this: Create two Crets (one in the bank and one in the application); The…
-
3
votes1
answer62
views -
3
votes3
answers216
viewsAs a search for any term removing spaces, traces and points with LIKE
I’m having a hard time changing a search that I have today by searching a code that has, for example this mask A 901.325.0744 the search is correct because the code is registered in this way and the…
-
3
votes1
answer779
viewsDatabase normalization in HR system
I am developing an HR application, in it I will have many forms in HTML that may or may not be very extensive, the employee table for example has 45 fields, some fields like company, function and…
-
3
votes1
answer91
viewsHow to use indexes beyond the primary key?
I have a question about that. Consider a table with the following columns: id (chave primaria), cliente, cidade, estado I already understood that a consultation with condition WHERE id = X would…
-
3
votes1
answer231
views -
3
votes2
answers146
viewsError concatenating string from path
In this program right at the beginning has a function that creates a folder in the user’s documents to save some information Giving a research I came to the conclusion that it should stay like this:…
-
3
votes1
answer23
viewsHow to count records in the Onetomane relation returning zero when there is no match
Friends, I am trying to make an app to control investments in shares. In DB of this app I have the table portfolio and active table. I need to make a select that returns to me the active portfolios…
-
3
votes2
answers921
viewsWhat is the difference between table, database and database?
Users of databases and tables that are not IT-related, especially researchers in the natural sciences and humanities, often use the terms "database", "database" and "tables" to refer to objects…
-
3
votes0
answers32
viewsWhat is it, Edgedb?
It’s quite common to see discussions like How to choose between Nosql and SQL? or even questions that question which bank is best. When reading more deeply we see that each type of bank seeks to…
-
3
votes3
answers75
viewsStore data in DB vertically or horizontally?
I recently posted a question about number of fields in a table here: Number of Columns X performance in tables Now I am curious about the standardization in the creation of the table below, I have…
-
3
votes1
answer68
viewsPrevent the insertion by the user of the same number of CPF in three different fields
In a table I carry the number of patient, doctor and attendant. I’m trying to stop the person from scheduling the 3 with the same values. Like: INSERT INTO agenda(cpf_atendente, cpf_paciente,…
-
2
votes3
answers10204
viewsHow to put a value that is saved in the database in a combobox?
I am using C# Windows Forms with . NET 3.5. I’ve inserted all Federation states into the property items of my combobox. When I search for a record saved from my comic book, the combobox does not…
-
2
votes4
answers1443
viewsSQL query that meets a parameter that is a set
I have the following situation: in a MEDICAL CONSULTATION I may have one or more SYMPTOMS. Then I have a CONSULTA_SINTOMA table, making the link between CONSULTATION and SYMPTOM. A disease can be…
-
2
votes5
answers1056
viewsHow do I connect Windows Phone to an SQL Server?
I’d like to know how to access and receive data from a server from Windows Phone. Put simply: I have a PC and want to access a document directly from the smartphone.
-
2
votes1
answer423
viewsError creating SQL Server 2005 database with compressed disk
When I try to create a database, the following error occurs: TITLE: Microsoft SQL Server Management Studio Express Create failed for Database 'based'. (Microsoft.SqlServer.Express.Smo) For help,…
-
2
votes1
answer159
viewsProblem with internal database
I’m trying to manipulate an internal database with the following code: sql = "CREATE TABLE IF NOT EXISTS tipo ([codigo] integer autoincrement,nome text not null);"; bancoDados.execSQL(sql); sql =…
-
2
votes2
answers2139
views -
2
votes1
answer1489
viewsDjango - Error saving to Database
The data is not being saved in the database and Django is not generating Error, but when I create an object of Livro and try to save by shell it returns me the following error: Valueerror: invalid…
-
2
votes1
answer434
viewsMvccheckboxlist, Radiobuttons and Text Inputs
I have a project where I’m using Mvccheckboxlist. My question is this:: Could I put a mvccheckboxlist together with radio Buttons and inputs ? Because I am in a project at a school that I have to…
-
2
votes1
answer2703
viewsWhat are the recommended values for Mysql database (id, user, password and email)?
I created a table user with the following values: Tipo = `MyISAM` ID = `int, PRIMARY, AI`; Usuário = `varchar, 16`; Senha = `varchar, 16`; Email = `varchar, 100`; Are these values recommended?…
-
2
votes1
answer361
viewsUnderstanding the Survey
Come on... I’m studying the Survey package I started studying this page http://www.ats.ucla.edu/stat/r/faq/svy_r_scpsu.htm but my questions are more basic I have already uploaded the following…
-
2
votes2
answers510
viewsOptimize operation with lambda
I have the following classes: public class Pedidos_Itens { public int ID { get; set; } public int Qtde { get; set; } public Pedidos _Pedido { get; set; } public int Pedido { get; set; } public…
-
2
votes1
answer659
viewsShow null results through LEFT JOIN with Linq!
I have an SQL query: SELECT A.Codplano, A.Secao, A.Setor,A.Subsetor,A.Contato, ISNULL(B.Subord,'NÃO LANÇADA')AS Situacao FROM vwPLANODIN A LEFT JOIN LANCADA B ON A.Codplano = B.Subord and B.Data =…
-
2
votes1
answer92
viewsDatabases in Oracle
I have Oracle 11g installed on my machine. In Oracle I have configured a local connection. In this local connection I have several tables. I would like in this same local connection, create another…
-
2
votes3
answers28024
viewsSUBSELECT vs. INNER JOIN
Is there any recommendation on which of the two is preferable in terms of performance? SELECT funcionarios.nome FROM funcionarios INNER JOIN empresas ON empresas.id = funcionarios.empresa_id WHERE…
-
2
votes1
answer142
viewsList grouped and filtered data
I’m performing a query in PUBS, the database that is used in MSDN tutorials for SQL Server, and I can’t find a way to do it. The two tables I use are the Publishers and the Titles who have the…
-
2
votes1
answer874
viewsType the product name in the Edit and take the database image in the Timage component
I’m making a system where I need to search the name of the product. Below Edit appears a grid for auto complete, then when I press Enter on the product name, on the grid, you need to appear on the…
-
2
votes3
answers162
viewsCreate tables randomly
My question is this:: I have a table containing 25 records of people’s names. But I need to divide it into 5 groups of 5 people randomly. Being a table 'Group A' with 5 people, another table 'Group…
-
2
votes1
answer72
viewsLocal Bank Storage Method
I have a local bank on my desktop, in it I developed an application using C# and Asp.Net MVC and thought it would only take the trouble to migrate to some MS SQL database when uploading the project.…
-
2
votes1
answer372
viewsProblems with RBAC permissions modeling
I’m developing a system where your user permissions will be based on the RBAC model, a user could be in several permissions rules that would give or not privileges to the system, when registering a…
-
2
votes2
answers455
viewsQuestions about database and Android
I am developing a project for college that is a multiplayer game for Android of questions and answers (style Asked). In the development of the game, I need to create a database to store the…
-
2
votes1
answer332
viewsInheritance in Database
I am developing an application, where I have 3 tables that have the same attributes, but as they had attributes in these tables that were mandatory for some, and not for others, I decided to…