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
-
8
votes1
answer564
viewsCardinality of the index does not update
I am creating a program that connects to a Mysql database online, and when starting it it creates a table with an index if it does not exist. To check if everything is ok I am analyzing the database…
-
8
votes3
answers241
viewsBest way to keep data that depends on a condition
Hypothetically I have a table publicação that has, by default, attributes autores (derives from a relationship table),titulo, edição, editora and ano. However, depending on the type of publication…
-
8
votes1
answer206
viewsWhy do Dbms use their own paging when the operating system already has one?
I’m studying databases and I’ve come to the subject of replacing pages like LRU and MRU. The operating system already does this normally, because DB needs to make its own paging?
-
8
votes1
answer69
viewsHow do serial numbers work in a system?
You know when you buy a game online and you get the CD-KEY, and then you open an app and you record that CD-KEY for you? Or else you bought your new Operating System and will register and insert a…
-
8
votes1
answer299
viewsPrepared statements with Mysqli does not require validation of data entry?
I was studying here about security in PHP & Mysqli, and I was left with a question: if I am using prepared statments, still need to validate data entry? For example, I have a field in the form:…
-
8
votes2
answers184
viewsHave images in the tables where they will be used or table with image repository?
It is good practice to create a table to record all images from a database, or I can create columns that save image information for each specific need? For example, let’s assume that I want to…
-
8
votes1
answer558
viewsIs it possible to define a connection pool for each user of an oracle database?
I searched the oracle documentation and only find ways to change this image, but nothing about creating another. Does anyone there know if it is possible what I am ordering? And how to proceed?…
-
8
votes1
answer1481
viewsWhat are "generated columns" in Mysql and what would your applications be?
I downloaded the new version of Mysql Workbench and when I was creating a table I noticed a new property of the field that is called Generated Column. On the Mysql website it says that this is a new…
-
8
votes3
answers1491
viewsIs it good practice to use composite keys as the primary key?
I don’t have much knowledge in database structuring. I have been trying to improve myself and I am seeking best practices on how to create and structure tables. Currently I usually create link…
-
8
votes4
answers835
viewsAssembling updates at runtime
When riding SELECTS at runtime we always have the problem of knowing what may or may not be coming depending on the choices made by the user. When mounting the clause WHERE we come across the…
-
8
votes1
answer7625
viewsDifference between Triggers and Stored Procedures
What are the differences between Triggers and Stored Procedures?
-
8
votes1
answer705
viewsWhat is WRAP and UNWRAP?
Studying a bit of tuples I could not understand WRAP and UNWRAP because the explanation was not very concise. So what is WRAP and UNWRAP?
-
8
votes3
answers15292
viewsVARCHAR2 field boundary size in Oracle
I got a column with the guy VARCHAR2 (4000 CHAR) and I’m testing the field boundary size VARCHAR2 in the Oracle. I thought there was a limit to 4000 bytes in the field, even if specifying the value…
-
8
votes1
answer583
viewsUse "Fieldbyname" or the associated variable?
When I have a ClientDataset, one MemoryTable or a Query, what’s the difference if I take the value of a field using FieldByName() or the variable associated with the field? In the example below, I…
-
8
votes2
answers540
viewsHow does an index improve the performance of a query?
Why does creating an index improve the performance of a query? Is any change made to the table structure? Is the data structure for disk storage modified? Is the algorithm used to perform the search…
-
8
votes3
answers3452
viewsWhat is an absolute value?
Viewing the Mysql documentation you can find the mathematical function ABS(x), to which the absolute value of x. mysql> SELECT ABS(2); -> 2 mysql> SELECT ABS(-32); -> 32 What exactly is…
-
8
votes2
answers10963
viewsWhat is the difference between SET and ENUM in Mysql?
What are the differences between SET and ENUM in Mysql? And in what situations both are best applied?
-
8
votes2
answers21372
viewsWhat is a database database?
For some time I have been following issues involving the term procedure in database, then doubts: What is procedure? Where to use it, what’s the point? If possible examples of use clear the mind of…
-
8
votes2
answers1132
viewsInsert sequence Oracle
Folks good night I’m wanting to insert data into a table , which has a sequence created, but when trying to insert data with nextval it presents the following error Error SQL Error: ORA-00911:…
-
8
votes3
answers948
viewsWhat makes a JOIN bad in a database?
Where I currently work I had to make some queries in the database to generate a report or take emails from students who did not do remakes in other courses. However, I was given the idea of making…
-
8
votes2
answers430
viewsDeadlock at Conceptual Design Level, Entity-Relationship Modeling (MER)
At conceptual design level we can use the approach (relationship entity modeling (MER)) to describe the behavior of future tables that will appear in the logical project. Within that context a doubt…
-
8
votes2
answers1800
viewsIn which table is the foreign key in a ratio 1 to 1?
In an SQL relationship of two tables 1 to 1, there is some rule that defines which table the foreign key will be in?
-
8
votes1
answer10401
viewsDifferent timezones in an application with Postgresql
We have a system that serves several distribution centers. A distribution center is a physical location that can be located anywhere in the country. A single customer can have several centers. Our…
-
8
votes3
answers971
viewsLine with NULL value is disregarded by the SUM function?
I participated in the IFNMG competition, a test prepared by the CEFET Foundation. I solved the following question and marked the letter C, but the feedback says that the correct is the letter A.…
-
8
votes1
answer170
viewsWould it be bad practice to insert monetary symbols directly into the bank?
In a system I had to tamper with wage values and commissions, perform calculations on them and the like. However I went to analyze that the monetary symbols are being inserted directly in the…
-
7
votes6
answers5683
viewsCopy Wordpress database without using Phpmyadmin
I need to migrate a Wordpress site from one server to another. One of the necessary steps is to export the database used on the current site, edit some data if necessary (such as the site address…
-
7
votes2
answers20732
viewsStatic search list using Javascript instead of PHP
In my work, I created pages as a static phone book to facilitate the search for them, but since there are many names, I would like to create a search field, but it is not possible to do this without…
-
7
votes3
answers176
viewsLogin system
I made a website on which I have implemented this file that belongs to login but does not work for me <script type="text/javascript"> function loginsuccessufully(){…
-
7
votes3
answers7634
viewsError importing CSV into phpMyAdmin
I need to import a file .csv for phpMyAdmin, but the special characters do not appear, nor the text that follows them. What may be the problem?…
-
7
votes2
answers577
viewsIs it good practice to keep foreign key columns redundant?
Consider that we have the models A, B, C and D, each one referencing to the above, ie, A has many Bs, B has many Cs and C has many Ds: Redundancy-free A | id | ... | ------------ | ... | ... | B |…
-
7
votes2
answers511
viewsFilters or Sort, which should be the first when creating an index in the database
Given, for example, the following Query: SELECT ClienteId, Nome, DataNascimento, Cidade, Estado, DataCadastro FROM Cliente WHERE Estado = :Estado AND Cidade = :Cidade ORDER BY DataCadastro,…
-
7
votes2
answers59
viewsAdditional field in a Database table for removal
I created a database, in which I have some problems when I remove some data from the table. Example Sales stand: I have a salesman who’s been fired and I want to remove him from the comic book but I…
-
7
votes2
answers1017
viewsPrevent DROP TABLE
I would like to prevent deletions on a table in Sqlite. CREATE TRIGGER nao_deletar_tabela BEFORE DELETE ON tabela BEGIN SELECT RAISE(IGNORE); END; It worked! Whenever one runs DELETE, nothing…
-
7
votes1
answer1275
viewsHow to save formatted text to database
I’m using Tinymce to edit texts on my website. However, I am doubtful to save the formatted text in the database and then display it the way the user typed it. (paragraphs, font color, etc.). Is…
-
7
votes2
answers1014
viewsSetting up a database, how do I make this relationship?
I’m assembling the EER diagram of an ERP. Almost all tables have a column called "id_company" that relates to the "Companies" table. This is because the user will be able to manage one or more…
-
7
votes2
answers344
viewsSplit column into multiple tables
I want to save a set of information about movies in a database but I have a question, I must organize the genres in column (example below). Database: Mysql 5.6.21 Engine: innoDB or organize gender…
-
7
votes1
answer104
viewsGeneric CRUD or Sqls specifics
In a system that tends to grow in number of classes and users, what would be the best approach to work with access to the database? create a generic CRUD? or create specific methods to insert and…
-
7
votes2
answers249
viewsComparison with Postgresql database using C#
I created a Login application, made the connection to the database, I can get the user and password registered in my database. But what I want, is, if the user tries more than three times to enter…
-
7
votes2
answers975
viewsDatabase connection error
I’m having a problem connecting to Mysql database with PHP I’m using WAMP created a database in my Phpmyadmin made my connection via PHP but this error appears when I click to send in my form: These…
-
7
votes1
answer1273
viewsIf the field has DEFAULT it must be NOT NULL?
Situation I was adding a few more columns to a table and falls from this thought. By default here we leave all fields can have value NULL, however if he has a DEFAULT he will insert the DEFAULT in…
-
7
votes2
answers140
viewsWhat are numbers for when creating columns in databases?
Everyone who has ever worked with databases has noticed that, during the data modeling of a table, we can define a number between parentheses. Examples: INT(20) TINYINT(4) BIGINT(10) VARCHAR(8) If…
databaseasked 9 years ago Rodrigo Rigotti 12,139 -
7
votes2
answers585
viewsListing error in paginated search system
When I do the query I get the following result [imagem1] By clicking to go to page 2, I get the following result [imagem2] That is, on page "1" everything working with the total results displayed…
-
7
votes1
answer815
viewsHow to set the maximum disk size of a database?
How to set the maximum disk size of a Mysql, Oracle, Postgresql or DB2 database? This is how I do in SQL Server: Create Database MyDatabase on (Name='MyDatabase_Data',…
-
7
votes1
answer5885
viewsWhat are INDEX, B-Tree, hash, Gist, and GIN?
In the the Postgresql Manual has the following excerpt : Postgresql provides the index methods B-Tree, hash, Gist, and GIN. Postgresql provides the B-Tree, hash, Gist and GIN index methods. But…
-
7
votes2
answers4071
views -
7
votes2
answers749
viewsTable does not appear in EDMX models
I have a problem in an application I am developing, I created the models using the ADO.NET Entity Data Model. However a specific table is not appearing follows below the script I am using to create…
-
7
votes1
answer251
viewsProblem with logic when using LEFT JOIN
In my system, there is a system of posts and another of friendships. It follows the structure of tables: posts: id | usuario | conteudo | data | hora friendships: id | usuario1 | usuario2 | status…
-
7
votes4
answers19788
viewsHow do I update with a Join?
Hello, I’m new to the forum and I need some help with SGBD Postgresql. My doubt 'and the following, in the following code used in DBMS Mysql the execution happens perfectly, by'em in Postgresql…
-
7
votes1
answer776
viewsMysql very slow sorting for results with many records
I have two tables, the first is used to group the data of the second with some information about the set, in order to facilitate the pagination of the contents. Table 1: - id INT(11) NOT NULL…
-
7
votes2
answers566
viewsInsert into multiple input fields in different tables
I have the date fields, CNPJ, latitude, longitude, site, facebook, on the same screen, only are 3 different tables, how do I give the insert in them from the same button?? What do I use to save the…