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
votes1
answer919
viewsModeling Categories and Subcategories
I am modeling a database related to e-commerce and I have a question in the modeling of the tables of categories and subcategories of products. At first I created two tables one of Categoria and…
-
3
votes2
answers139
viewsReturn record with highest number of appearances
Well, I would like to know how to return the record with the field with the highest number of appearances in a phpMyAdmin database table. See the following image: I would like to get "Joao". I tried…
-
3
votes2
answers109
viewsHow to show latest date data?
I have a Tabela1: ID Auto_increment; varchar; date; I would like to show only the data with the latest date. How do I?
-
3
votes2
answers763
viewsTrigger in Mysql VS logic in PHP application?
I am doing inventory control system, and I would like to know the advantages and disadvantages between two forms of implementation to subtract the number in stock after a sale/output. 1) Carrying…
-
3
votes1
answer754
viewsWhat is the difference between the various JOIN types of SQL?
In SQL there are several types of JOIN, what is the difference between INNER JOIN, LEFT JOIN, CROSS JOIN, RIGHT JOIN and FULL JOIN?…
-
3
votes1
answer457
viewsSave information to an Sqlite and then go up to a JSON with webserive
I read several tutorials on how to take a JSON and pass the information to an Sqlite, but as I do the reverse, I take the application data already saved in Sqlite and then transfer them to a…
-
3
votes1
answer35
viewsstore the formatted value of my created_at date in the ID
I have one question: A column called shoe_id on my table, I’d like that id is automatically generated when I register a product, and I would also like it to be in the format without dividers from…
-
3
votes1
answer3294
views -
3
votes1
answer107
viewsIs there a distinction between software that has a database or not?
A doubt that came to me while I was studying and that I still haven’t found anything about it. We know what a software, here a brief definition: A program (software) is a sequence of instructions…
-
3
votes0
answers161
viewsSearch in sql server 2014 with php
I am using Sql Server Express, I have an instance installed individually on two virtual machines on the server, one of the instances installed is the Sql Server 2008, and the other is Sql Server…
-
3
votes1
answer269
viewsPIVOT - SELECT reversing row and column
I have a table like this: codigo ano quant 100 2014 15 100 2015 13 100 2016 20 101 2015 15 102 2016 22 102 2014 05 I want to create a query that lists me the code like this: codigo 2014 2015 2016…
-
3
votes3
answers2181
views -
3
votes2
answers1472
viewsDatabase for mobile devices
I’m creating a mobile app and need to use a database to store user data. I’ve thought about Sqlite, but it is not recommended to use it on sites with more than 100 thousand requests per day, and if…
-
3
votes2
answers4336
viewsClear button radio button
Good morning I would like to know how to clean what was clicked on the radio button, because in the textbox I use the name. Clear(); I wonder how I do on the radio button Thank you.
-
3
votes1
answer2845
viewsSQL Server - How to guarantee permission from SELECT to View without giving permission in the base tables?
I need help with a problem involving permissioning of objects in the database. I have the following scenario: 1 Database 4 Schemes different with the following owners: schemaA; proprietary dbo…
-
3
votes2
answers100
viewsDelete sectors and their descendants - PHP
I have the following structure table: CREATE TABLE IF NOT EXISTS `setores` ( `set_cod` int(10) NOT NULL AUTO_INCREMENT, `set_base` int(10) NOT NULL, `set_setor` varchar(50) NOT NULL, `set_data`…
-
3
votes1
answer674
viewsSP2-0552: Unstated Bind variable "19"
I am using Oracle SQL Developer to finish a project, when I was popular the database, the software accused an error in the following line: INSERT INTO musica (cod_musica, data_composicao, titulo,…
-
3
votes0
answers418
viewsWhat database structure should I use for a process (business Rules) that is dynamic?
When we are developing software we always come across this question: "Is software forged by processes or are processes forged by Sofwtare? Or both?" Case Study - I work at a company where business…
-
3
votes2
answers66
viewsStoring data that can be accessed outside the database itself, goes against the 1st Normal Form?
For example, I have an invoice, which I can consult in another database (but not of my property), an example would be Pagseguro. I store only the invoice identification number to be able to consult.…
-
3
votes1
answer188
viewsReading of csv with Django
Well, I’m working with an open database, and it’s in CSV, I’m using DJANGO to read the CSV and so entering into the database... However is giving a flaw in the insertion of the first year,I’m trying…
-
3
votes2
answers2197
viewsIs encrypting the database an efficient measure? How to protect data against leaks?
With the recent problems of password leaks and personal information from the most diverse sites, there is evidence of a lack of zeal regarding the storage of such information by certain companies,…
-
3
votes1
answer164
viewsManytomany mapping. Bean problem
After doing the Manytomany relationship between tables I don’t know how to save on my bean. I have a class schedule that has one or more lawyers taken care of this term. The lawyer can also be…
-
3
votes1
answer35
viewsControl daily image views
I don’t want the script ready, just know the best strategy. Guys, I’m having a hard time figuring out how best to control the amount of daily banner views. For example: I have a comic with 500…
-
3
votes2
answers4128
viewsHow do I search (SELECT and WHERE) in the firebase database?
I have a database like this: { "message" : "Hello, World!", "reserva" : [ null, { "codreserva" : 123, "email" : "[email protected]", "status" : "check in" }, { "codreserva" : 124, "email" :…
-
3
votes1
answer231
viewsFile download from filling a form
I’m trying to access a site, fill out your form and download the file, but I’m encountering some difficulties. That’s my code so far: #library's require(rvest) #website url <-…
-
3
votes2
answers855
viewsModeling launches using customers and suppliers
Contextualization: Initially I am developing a launch module (accounts payable and receivable). Every release must be related to a supplier or customer. As I wish to model both customer and supplier…
-
3
votes1
answer80
viewsFull Text Index for Database facing Ecommerce!
I read several posts here on SOPT about creating índices which left me with many doubts I had, but my main one is about FULL TEXT! In a database that is exclusively aimed at ecommerce, where there…
-
3
votes5
answers628
views -
3
votes4
answers1202
viewsWhat kind of data to use for sale ID
I have a Windows Form application developed in C# and with SQL database. One of the functions of the system is to carry out SALE for several different COMPANIES and in several different POS (point…
-
3
votes1
answer2281
viewsSelect a part of the database in R
I’m doing an evaluation of the database of the transparency portal that can be obtained in this link, The problem is that I would like to select only one part of the database, my assessment is only…
-
3
votes1
answer229
viewsIpv4 and/or IPV6 record in the database
The Internet works through protocols like Ipv4 and Ipv6, possessing 32 bits and 128bits, which are numerical combinations that establish connections between computers. I have a device table,…
-
3
votes1
answer45
viewsRelationship Database
I’m having doubts about the relationship in the following case: I have the Question table and the Answer table. 1 Question may have N Answers. 1 Answer may be for N Questions. Can it be said that…
-
3
votes1
answer689
viewsAcademic ER "system" modeling
Guys, can someone help me? I’m doing a database job where I have to do an academic "system", I developed this photo ER, I have doubts of type: How do I make the teacher store the notes and…
-
3
votes2
answers878
viewsLimit record occurrences for each type
I need to limit the number of occurrences of each type of material I have in my database. Follow the query below with what I want to do: SELECT TOP 10 ID, NOME, TIPO FROM TB_MATERIAIS WHERE TIPO = 1…
-
3
votes0
answers76
viewsHow to make pincode activator via serial?
I’m trying to do brush validator (serial), but I don’t know how to do it. I have two tables: "validation" and "maturity". In the "validation" table, you have the following fields: id(int),…
-
3
votes1
answer49
views -
3
votes1
answer103
viewsDelete select value by comparing to another table
Good morning, I am developing a scheduling site, however, I am having a huge difficulty trying to display only the schedules that are available. Explaining: There is the table Agendamento´, onde…
-
3
votes2
answers142
viewshow to query data in a table that is not related to the other table?
I have the following tables: CREATE TABLE IF NOT EXISTS `categoria` ( `id` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(25) NOT NULL, `descricao` VARCHAR(100) NULL, PRIMARY KEY (`id`)) ENGINE =…
-
3
votes2
answers247
viewsUpdate two tables with condition
I have the following scenario Two Tables Source Table - Destination Table Both with the same fields [ID] [name] [CPF] The query must go in the [CPF] columns of the two tables, when the [CPF] of the…
-
3
votes0
answers108
viewsError when connecting external database
The following error appears E/MYSQL: Erro: java.lang.ClassNotFoundException: org.sqlite.JDBC.Driver E/MYSQL: Erro: java.sql.SQLException: No suitable driver E/MYSQL: Erro:…
-
3
votes1
answer82
viewsHow to insert a variable into an array?
I want to enter data in my database I’m using mysqli, I need to know how to indicate inside an array a variable, here and my code I want to know if this is the correct way to do it require…
-
3
votes1
answer1722
viewsWhat is the real difference between the operator '=' and LIKE?
Doing another test (rs) in a database I have in Mysql, I realized that: SELECT * From client WHERE uuid = '1kvsg4oracxq' returned the same result as: SELECT * From client WHERE uuid LIKE…
-
3
votes1
answer510
views -
3
votes2
answers97
viewsBest practice for deleted data
I am in doubt as to how best to deal with deleted data. In the system should appear to the client the option, "delete given", but the fact that deletion of this data would have to erase several…
databaseasked 7 years, 4 months ago Mateus Carvalho 1,494 -
3
votes2
answers614
viewsIt takes time to count records the first time
I’m doing a stress test on an app I’m developing. I added a few million records to a table, which is what it will have in about 5 years of use. I use Entity Framework. By counting the records of a…
-
3
votes2
answers13959
viewsWhat is the difference between Associative Entity and the Intermediate Table of relationships N for N?
What’s the difference between Associative Entity and the Intermediate relationship table N to N? Is there any notable difference in the model translation ER to the relational model? In the ER model…
-
3
votes3
answers150
viewsDatabase modeling, when it is possible to denormalize
I’m modeling a database (MSSQL) and a question has arisen. In every business rule of the clients the data is visualized vertically ex: Product, Original Price, Concurrent Price 01, Concurrent Price…
-
3
votes2
answers4957
viewsHow to search records from the previous month?
I need to get the data from the 1st to the 30th of the previous month, I’m using this syntax. someone could help me? SELECT SUM(DIFERENÇA)as Mesanterior FROM TOTALIZADOR WHERE NID = 252 AND DATAHORA…
-
3
votes4
answers342
viewsLaravel 5.3 - Model that can be created by multiple Controllers
Good afternoon, use Laravel 5.3 as back-end of a project and I will try to explain in the most succinct way the problem. Problem: In my project I have the Duplicate model and the Contract. A…
-
3
votes2
answers83
viewsDatabase connection problem
I am building an application from Netbeans IDE 8.1 and accessing the database developed in Sql server further when running the application this generates error: Connection error The port number…