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
-
4
votes2
answers2287
viewsRename table in Firebird
How to rename table in firebird 2.5? I’m using the query: ALTER TABLE cliente RENAME TO clientes;, but error appears: invalid Toke 'Rename'.…
-
4
votes1
answer75
viewsSql group records
I have the following appointment: select T1.dt_producao, T1.cod_turno, T1.cod_periodo, CASE WHEN T2.TP_PALLET = 'DZ' THEN sum(T1.QT_PROD* T2.QT_EMBALAGEM*12) ELSE sum(T1.QT_PROD* T2.QT_EMBALAGEM)…
-
4
votes1
answer100
views -
4
votes1
answer376
viewsWhat is Multi-version Concurrency Control in Postgresql?
What is Multi-version Concurrency Control (MVCC) in Postgresql and how it works?
-
4
votes1
answer698
views -
4
votes1
answer164
viewsRelationship (Database) (Sql)
kindly: I can’t understand the following case: My problem would be the syntax used in part (1,1) -- (1,N) In case it would be, 1 Department allots N employees and 1 Employee can be in only 1…
-
4
votes1
answer539
viewsWhat’s the difference when you use Inary in the Where clause?
What is Binary and what he does? What is the difference generated when using the Binary in a query in the Mysql and when it does not use the Binary? SELECT email, senha from login WHERE usuario = ?…
-
4
votes1
answer1524
viewsWhat is seeder and Migration?
When it comes to database updating in a project, I always understand the term Migrations being used to keep the bank update among those involved in a particular project. I’ve also come across the…
-
4
votes2
answers4792
viewsCheck if it already exists in the table before entering record
I need to include a record in a table, however before inclusion to avoid duplicity it is necessary to do a check. As I have a column ID with as property AUTO INCREMENT, I can’t use the INSERT IGNORE…
-
4
votes1
answer5011
viewsError Connection Database; "relation does not exist"
I am having Problem to Save Data from a Screen to my database I am getting the following error: "org.postgresql.util.PSQL.Exception: ERROR: column "name" of relation "product registration" does not…
-
4
votes2
answers742
viewsWhat is Python’s native support for database manipulation?
I found things about a module called mysqldb, but I couldn’t find documentation available on Docs.python.org Please disregard responding with frameworks such as Django.…
-
4
votes1
answer379
viewsFirebase: How to load random data into a Recyclerview?
I am using a Query to load only 6 items from the Firebase database in Recyclerview but so far I can only sort using the orderByChild, limitToFirst or last. Everything is working fine but... I want…
-
4
votes2
answers1634
viewsSelect records smaller than the current date and time
What is the best way to query the database where the data is smaller than the current date and time SELECT * FROM agenda WHERE agendamento < '".date('Y-m-d H:m:s')."'…
-
4
votes2
answers166
viewsTablespace and data files on Oracle
A tablespace is a data file that stores multiple tables, such as a zip file? What is the relationship between tablaspace and data file?
-
4
votes1
answer1998
viewsProduct modeling with various suppliers and different prices
In a stock control scenario where 1 product can be supplied by 1 or more suppliers and 1 supplier can contain 1 or more products, what to do on the following occasion: Product "X" has 2 items in…
-
4
votes1
answer1366
viewsLaravel 5 - How to connect multiple Bases at the same time?
I’ve researched several places, and they all end up leading to that link. But I could not work using the methods given in the link. The problem: I have 3 banks configured in config/database.php:…
-
4
votes2
answers1906
viewsCalculate Difference between 2 dates (has time in them)
Hello, I would like to make the following calculation. Starting Date = 11 September 2017 at 11:35 am Final Date = 11 September 2017 at 12:35 pm It should appear to me 1:10 am. Another example:…
-
4
votes1
answer229
viewsDoubts about Stored Function
What is a Stored Function, what is its basic syntax ? How and where to use a Stored Function
-
4
votes1
answer462
viewsWhat is the foreign key (SQL) for
For what I’ve been researching, when pulling the information of two tables in a database, JOIN is used, which has nothing to do with foreign key. So what’s the point of declaring a field as Foreign…
-
4
votes1
answer114
viewsBind by SQL Server position using JS Node (MSSQL)
I wonder if it is possible to bind the parameters by position instead of the name using mssql in Nodejs. Ex.: //Por nome return pool.request() .input('input_parameter1', sql.Int, 10)…
-
4
votes3
answers1298
viewsPerform table insertion with foreign key
include_once 'acesso_bd/conexao_bd.php'; class PropriedadeDAO { function inserirPropriedadeBD($propriedade) { $nome = $propriedade->getNome(); $endereco = $propriedade->getEndereco();…
-
4
votes1
answer166
viewsIf I have two servers (application and database) with different time zones, which one is better to use as a base?
I am working with the Mysql server of a hosting, I can not change the time zone of the same, I mean it uses the "Mountain Standard time (MST)", on the other hand, I am using the ASP.NET server and I…
-
4
votes1
answer884
viewsHow to fill out form from the combobox, with database information?
I used the code like this: <html lang="pt-pt"> <head> </head> <body> <?php $servername = "localhost"; $username = "isabelso_isabel"; $password = "password"; $dbname =…
-
4
votes1
answer699
viewsWhy use Drivermanager for connection to bank?
I am connecting to the Sqlite database with the following code: public SQLiteConnection conn() throws SQLException{ String path = System.getProperty("user.dir"); try { return new…
-
4
votes1
answer332
viewsWhat is the difference between Charset : DOS850 x ISO8859_1 x WIN1252?
What’s the difference between these Character Sets: DOS850 x ISO8859_1 x WIN1252 because I see it at the time of creating a database and do not understand right what their differences? I know it’s…
-
4
votes3
answers759
viewsThe null value automatically becomes 0
I’m doing a vehicle registration, I need it to register put that whenever a vehicle is registered the value zero instead of putting the value null, I tried by default, but it does not record the…
-
4
votes2
answers1052
viewsCannot pass a null Grantedauthority Collection Spring Security
I am developing a web application with Spring Boot, and I am trying to implement authentication using Spring Security. I am following the tutorial from Michelli, but I’m making the following…
-
4
votes1
answer688
viewsError in Plot.window(...) : need Finite 'ylim' values
I have a continuous variable whose n=15000 comments and 451 Als. When rotating the qqnorm For the evaluation of normality, I verified that it does not present normality and therefore I applied a…
-
4
votes3
answers3810
viewsWhat is the difference between a View and a Stored Procedure in SQL?
I have come across SQL Views and also stored procedures. I would like to understand better, what is the difference between a view and a stored Procedure and what are its purposes? It would be…
-
4
votes2
answers677
viewsIs it mandatory to open and close connection when entering data?
In a *loop* que fazInsert` in an Excel spreadsheet it is mandatory to open and close the connection ? I analyzed the following, depending on the amount of registration it may take up to 1:30 to do…
-
4
votes2
answers671
viewsFaster delete + Insert or select + update
I am building an app that will receive data from various different ERP’s every day. But I have the following problem, the next day the ERP can send me the same data that had or did not changes +…
-
4
votes2
answers684
viewsProblems assigning values to variables in an object
I need to pass variable data to another class called Fila.java. There I have a vector of the type that receives objects, so in the main class I created an object that I initialized as follows :…
-
4
votes1
answer681
viewsMutually exclusive relationship (MER)
I know there are several ways to implement this conceptual model, but I would like to know the best way (if there is one that stands out) Caption PK : Primary Key (primary key); FK : Foreign Key…
-
4
votes1
answer201
viewsWhy do normalized schematics up to 3FN not have N:N relationships?
Explanation of the concept I believe that by definition a database schema is found in 3FN, when it is in 1FN,2FN and nay has transitive dependency. Transitive dependence is when an attribute NONKEY,…
-
4
votes0
answers210
viewsExample of Scheme respecting the 3FN?
When studying about 3FN I came across 2 interesting examples and I wondered if when making a small change, the examples would continue to meet 3FN. Explanation about the concept of 3FN Explaining…
-
4
votes1
answer849
viewsFirebase database modeling: n:n relations
I’m studying firebase that uses Nosql and I came up with a question when watching this video: Converting SQL Structures into Firebase Structures - Firebase Database for SQL Developers #2 In it the…
-
4
votes3
answers1476
viewsIs it necessary to create a primary key with auto increment?
When I create a table that already has a field with an index unique, that will be referenced by other tables, can I leave it as primary key? Or is it good practice to create another field, with auto…
-
4
votes1
answer232
viewsUse of Generalization/Specialization in Data Modeling
I’ve read some articles about Generalization/Specialization in data modeling, but some questions have arisen: Is the primary key to generalization also the primary key to specializations - that is,…
-
4
votes1
answer1359
viewsPostgresql md5 encryption
I am creating a table using Postgresql and there will still be a password field with MD5 encryption. What would the syntax look like in it? Because I have more contact with Mysql than Postgresql.…
-
4
votes1
answer85
viewsDoes using CTE (Common Table Expression) create a type of "cache" in the database?
I have an appointment with several JOIN and queries, and when executed, it takes about 7 seconds to return. Getting the same result, using CTE’s, the query takes around 8 seconds of the first…
-
4
votes1
answer1340
viewsWhat are the differences between the HASH and BTREE algorithms used in an index?
I realized that I can create two types of indexes for one determining field in Heidisql, which use the algorithm HASH or BTREE, see below: See the CREATE code from an example table for the…
-
4
votes2
answers87
viewsUpdating OS packages from a Database container
I am redoing a Zabbix server here at the company, where I will upgrade from version 3.2 to 4.0 I’m thinking of using Docker to make life easier, since Dockerhub has images for Zabbix-Server, for…
-
4
votes1
answer618
viewsPicking Gaps in an SQL sequence
Hello, today I own a select that returns me the following result: I do another select that returns a value, 5 for example. I would need to know which numbers are not between number 1 and number 5.…
-
4
votes3
answers858
viewsHow to make a Union of two queries using Django Filter
I was racking my brain to do union of two darlings using Django Filter and I ended up doing it on hand (Model.objects.raw("SELECT....")). How could I union with Django’s ORM? Note: I have 2…
-
4
votes3
answers1657
viewsConvert string to blob and save to bank
I’m developing a mobile application that has a form where the user can attach an image, the image is being sent as string via Rest to the server and will be saved in the blob database, however, I’m…
-
4
votes1
answer197
viewsStructuring a Saas Database
Well, I’m studying a little bit about applications .NET as Service and not as a Product, so that a monthly subscription customer’s use of the application. As long as the database will be unique and…
-
4
votes6
answers6000
viewsHow to get the column properties of a table?
I am working with a table created by another person, and there is in it a field of CPF, would like to know what is the size of this field, how many characters it is able to support. I know that in…
-
4
votes1
answer212
viewsEntity Framework Query Many to Many
I’m starting to use the Entity Framework and I’m looking to make a query between two tables, Livroes and Autors, and their relationship is like Many to Many. I don’t know if it’s relevant but I’m…
-
4
votes1
answer654
viewsIs it possible to list 2 tables from 2 different banks?
I’m looking to relate 2 different database tables. I’m using SQL Server SSMS 17.9.1. TBL1 in DB1 TBL2 in DB2 Scenarios: Both banks are on the same server; Database 1 is on my server and database 2…
-
4
votes1
answer106
viewsData Manipulation
I wonder if it is possible, after converting the date and bringing only the time, to manipulate this result to return the closed time. The example below details better. CONVERT(VARCHAR(19),…