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
-
5
votes1
answer2036
viewsWhat type should I use to save only the time (no date) in a database?
I am in doubt which type I should use to work with hours on my system. I should use DateTime, Time or TimeStamp. I would like the hours to be saved in this format: HH:MM…
-
5
votes1
answer9051
viewsWhat are the SQL Server Express and Mysql limits?
What are the limits of SQL Server Express and Mysql? How many bases are possible? What is the size of each database? The size of the index files?
-
5
votes1
answer3246
viewsHow to define predefined types in Mysql?
In the site I’m developing I will, for example, a registration form where the user should define their gender in a combobox (male or female). The table users in the database will have all user…
-
5
votes4
answers6626
viewsWhat SQL command shows the maximum number of active connections to the Mysql database?
Which SQL command returns the number of active connections to the database?
-
5
votes5
answers3255
viewsCarrousel in php and mysql
I have an "upload of files" and I needed to show them on a Carousel. The image path is stored in the database and the images in a folder, of course. I have the following code: <div…
-
5
votes2
answers305
viewsHow to model plots when you don’t know how many there are?
Usually, when it comes to payments in instalments, comes the idea of 12 installments. Then you soon create a table with 12 fields, one for each portion. But I am faced with the situation that the…
-
5
votes3
answers747
viewsWorking with ID limit on large volumes
I have in mind some questions about large volumes of data on MYSQL, concerning the limit of ID. I will give as an example ID guy tinyint to simplify the explanation. In the example the field tinyint…
-
5
votes1
answer1630
viewsSaving a JSON in Database vs Relationship?
When I didn’t know much about the question of database structure and relationship between tables, I used to use JSON or comma-separated data in a given field of any table in the database. In fact, I…
-
5
votes3
answers472
viewsMER - Temporal confusion of cardinality
I’m having some doubts about the temporal aspect. Example: [FUNCIONÁRIO]------<PERTENCE>------[DEPARTAMENTO] In this case it is obvious: each official belongs to one department, and each…
-
5
votes2
answers263
viewsIn a MVC structure, can we create a model that represents a View (SQL)?
I was arguing with a friend of mine about using views (I mean Mysql, not Mysql Pattern MVC). Hence a doubt arose in the following sense: A Model is used to represent a data structure, and you can…
-
5
votes3
answers1978
viewsCreation of a database for each user
I’m putting together a web sales system with php and mysql, where we will have several registered companies, each company being a user who will control their sales. Our team has a question: create a…
-
5
votes1
answer8555
viewsDoubt in the relationship of Mysql Workbench tables
Hello, I have a small problem creating a database. My goal is to create a table to mark the attendance of people in the classes of the courses in which they are enrolled. The presecas table must…
-
5
votes1
answer151
viewsIs there a way to name the selected tables from a stored database to identify them in the Dataset?
I have a Store Procedure in SQL Server that projects various data. Example: CREATE PROCEDURE [dbo].[teste_sp] AS BEGIN select * from compra select * from cliente select * from fatura END However,…
-
5
votes3
answers1803
viewsTables/Temporary content in the database?
Situation I am wanting to manage a process using the resources that database offer, as INSERT, UPDATE, DELETE. However all this process is temporary, that is, I have to generate tables and data that…
-
5
votes1
answer902
viewsHow to use Javascript to manipulate data from a database?
I am now beginning to deal with web development in PHP. We know that to have an efficient and dynamic system, we recommend using Javascript, such as, Jquery, Angularjs, Backbone.js and others. But…
-
5
votes2
answers604
viewsRelationship on-to-one in auxiliary table using Laravel
In the application I am working the database is built on the part of users, as follows: user 1 -------> 1 user_address 1 <-------- 1 address In the user table there is no column referencing…
-
5
votes1
answer3875
viewsHow do I save an image to the database in Sqlite?
How do I save an image to Sqlite? I ask you to be as specific as possible because I don’t have much experience. In case I want to include a table row to save the image. import br.gestaoBd.Login;…
-
5
votes1
answer1177
viewsSpeed difference in HD Sata/SSD
I have Mongodb running on a 500GB SSD HD. But as the folder /date started to get too big, we put a HD slave 3TB, but this being SATA and not SSD as the first. But after changing the date folder to…
-
5
votes1
answer124
viewsIs it a good practice to have the same name with the column name of the bank?
Let’s say I have one input text de name="txtnome", it is a good practice to have a column of the same name as this input on my table? Being that I’m using PDO for CRUD $st…
-
5
votes2
answers380
viewsHow to transpose the result of a search using SQL Server?
Or better saying how to make the columns of a search result SQL Server, become lines of the result, as follows in the images below: A search result using the clause select whichever: Make the result…
-
5
votes1
answer433
viewsHow to detect Mysql changes in Nodejs?
Good night, someone has already used this package or knows a similar one that works? Link: https://www.npmjs.com/package/mysql-events Goal: launch an event when there is a change in the database.…
-
5
votes2
answers1731
viewsConceptual model
I was looking at the conceptual model diagrams, I saw some that contain the attributes and entities like this: And others who only have the Entity: Which model is correct? or are both? Is it…
-
5
votes1
answer624
viewsWhat kind of data do you use to store Uris in the database?
What kind of data to use to store Uris in the database, taking into account an indeterminate or very large URI length?
-
5
votes0
answers97
viewsDoubt implementation Database SQL
I’m creating a product control for a company, where we need to generate sequential codes for products as they register, sell digital products, so there’s no physical amount. At first I thought about…
-
5
votes3
answers428
viewsWhat is the relationship between ERI and relational databases?
What is the relationship between ERI and relational database?
-
5
votes2
answers228
viewsWhat’s wrong? BD + Laravel
I have a form in Lade taking the values of the database. In it I have a field date not required to be filled in. When you enter an empty date the results screen displays the date "01/01/1970". How…
-
5
votes2
answers1943
viewsUsing AND inside an INNER JOIN can?
I wonder if it is possible to use AND within a INNER JOIN, example: SELECT * FROM tab1 INNER JOIN tab2 ON tab2.id2 = tab1.id1 AND tab2.camp1 = 'valor' INNER JOIN tab3 ON tab3.id3 = tab2.id2; I gave…
-
5
votes2
answers726
viewsHow to rename the database (Rdata) in R?
I have the following situation: I need to merge two banks. The name of both the database files are: banco2.RData and banco2_2.rdata However, when I open the banks in the R they have the same name:…
-
5
votes1
answer3762
viewsPIVOT - Group Duplicate Records in a Single Line
I have a problem with a query, in which I need to turn rows into columns. In case I thought to use the function pivot, but it didn’t work very well, since mysql doesn’t provide me with such a…
-
5
votes1
answer217
viewsBetter BD structure with large number of data and filterable columns
I have a Mysql database with a table that is taking too long to complete a query. I would like to know what would be the best database structure indicated for a table with many fields that are…
-
5
votes2
answers1969
viewsHow to get the Primary key Identity of an inserted record?
I need to create a stored procedure to insert a game into my database. A game relates to a championship through the table campeonatoJogo. The tables are basically: create table jogo( codJogo int…
-
5
votes2
answers2991
viewsSQL for last month and last two months
Hi. I’d like a hand here. I need to get the records: Mysql bank 1) last month 2) last quarter 3) Current year SELECT id, data, lote, modelo, qtd FROM controle_diario WHERE modelo like ? The table is…
-
5
votes1
answer28
viewsI cannot return another field other than the primary key using $project
I’m starting in Mongodb and would like to perform a consultation in my database of type: Which animals got sick in the year 2016? Using $group and $project: db.animais.aggregate([ {$unwind :…
-
5
votes6
answers32941
viewsConvert varchar to date in SQL
You can convert dates into sweep for date. I’m having difficulties in performing searches between dates, due to this discrepancy in the database where I perform the query. When I enter my line of…
-
5
votes1
answer251
viewsDoes it make sense to store the salt of a password with the hash itself?
Looking at tables in a database of a certain product, I came across a structure similar to this: [LocalUsers] UserId Integer PasswordHash Byte[] Salt Byte[] If an intruder gets this list, it’s…
-
5
votes2
answers4353
viewsHadoop is a Database? What is Hadoop?
After all, what is Hadoop? Hadoop is a database? I have often heard "that company uses the Hadoop database". But when I started studying Big Data I saw that actually things weren’t quite like that.…
-
5
votes1
answer1268
viewsWhat is Crow’s Foot about the database?
In the database class the teacher mentioned a term called Crow’s Foot, and this term left me confused. I’d like to know what Crow’s Foot is about Database?
-
5
votes2
answers1573
viewsWhat is the advantage of a 1:1 relationship?
I have a database (Mysql), and in a table I’m having about 80 columns. I am thinking of separating this information into other tables, and maintaining a 1:1 relationship. But this can impact a…
-
5
votes1
answer1341
viewsHow can I list all invalid emails?
I ended up finding something like this due to the lack of validation that we didn’t have. teste@cliente calteste5@calteste5 calteste6@calteste6 vava@ius Pablo Fernandes xxx eduardostubbert 123456…
-
5
votes2
answers9906
viewsWhat is database redundancy?
Recently in my college database discipline came up this question from which I was left with much doubt.
databaseasked 6 years, 8 months ago Danillo Santtos 51 -
5
votes1
answer438
viewsHow to join 2 SQL queries into a single one (one is a mean value calculation and another search criteria with BETWEEN
I’m setting up a system that finds providers in a specific region, calculates the average value charged by them and brings this value. But before that he will only pick up the providers that are…
-
5
votes3
answers4418
viewsError in a simple SELECT with Group By - SQL Server
I’m trying to do the following SELECT: SELECT P.Nome,P.TipoId,P.QuantidadeMensal FROM StockPhotos.Pacote P GROUP BY P.QuantidadeMensal; But I’m getting this error message: Message 8120, Level 16,…
-
5
votes1
answer556
viewsCondition in Select - SQL
I have a table where we store the priorities of output of supplies per customer, for example: cliente | codigosuprimento | prioridade | quantidaestoque 1 | 500 | 1 | 20 1 | 501 | 2 | 10 1 | 502 | 3…
-
5
votes2
answers212
viewsUPDATE is a DELETE followed by an INSERT?
On another issue (In Trigger we have INSERTED, DELETED, but the "UPDATED"?) this doubt arose as to the form of the database execution, due to the form that the Trigger access an altered record.…
-
5
votes1
answer3432
viewsIs there any risk in using "SET FOREIGN_KEY_CHECKS = 0"?
According to what I read somewhere, the FOREIGN_KEY_CHECKS: ... specifies whether or not to check foreign key restrictions for Innodb tables. I mean, if the guy wants to disable the foreign key…
-
5
votes1
answer1200
viewsHow to create a database automatically in Laravel with all tables?
Well I need help in a problem, I am developing a system for the first time in Latin and I need to create a database for each user registered in my system, these databases should have the same tables…
php database sqlite laravel-eloquent laravel-5.3asked 5 years, 6 months ago Igor De Moraes Sampaio 79 -
5
votes2
answers200
viewsWhat’s the opposite of . equals in C#?
I’m doing a left Join where I want to pick up just what’s on the left table and there’s no right one. I’m using LINQ and Entityframework. I made a code that takes the similarities, follows below:…
-
5
votes3
answers727
viewsIs it bad practice to store CPF and CNPJ in the same column of the database?
In a flow that allows the registration of natural persons and legal persons I have seen the two approaches, but I’m not sure whether it is a good practice to store the two information in a column…
-
5
votes2
answers240
viewsSpecialization and generalization in databases and application development
I have a table Livros and I know that the specialization/generalization of books are Livros de Ficção, Livros de Drama and Livros de Suspense, for example. However, in the logical model, I don’t…
-
5
votes1
answer72
viewsWhat is Big Data and what is its relationship to the relational model?
I was reading about big data, However, I still can’t understand what the big data would actually be in its essence. I have always used the RDBMS model for data storage and manipulation and at this…