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
-
1
votes1
answer393
viewsSave a field log only if it is Insert (Trigger SQL Server)
I have a Rigger that fires when it is Insert/update FOR UPDATE, INSERT I check if the field was changed with: if update (nome) --faça algo How do I know if I am entering a record in the table to…
-
1
votes1
answer465
viewsCompetition with thread and database inserting duplicates
I have the following problem with competition using Thread. The code below should take the last number of a column of a table and add +1 to save again in the database, the problem is that this…
-
1
votes2
answers141
viewsHow to rescue html text from database?
I’m using the editor TinyMCE, the data is saved correctly in the database, but I do not know how to rescue them and show them on the screen. It is returning me like this. Would anyone know how to…
-
1
votes1
answer215
viewsCEP database
I need a ZIP database for https server access, if possible free, you know any?
-
1
votes2
answers240
viewsIdentify database server (approval and production) in two different environments
As in most cases, I have two environments: approval and production, both for the server and for the database. I would like to know how to use the same address (host) of the database in the…
-
1
votes0
answers26
viewsCreate Partition
I’m sharing a table in my database, I created Function Partition and Scheme Partition. But when I go to Create Partition Wizard the Radiobutton Existing Partition Function gets disabled even with…
-
1
votes0
answers46
viewsComparison of tables using the title to join with LIKE and CONCAT?
I’m creating a book exchange page, I made two tables of wishes and mine. until the part of the logged-in user wish to find other’s books I was able to do, but I would also like the other users to…
-
1
votes1
answer1045
viewsInsert large amount of data into sql server
I downloaded a list of cities on the internet. There are more than 5,000 municipalities. I tried a simple Insert and could not. Exceeded the maximum number of 1000 records. Then I tried with Bulk,…
-
1
votes1
answer1578
viewsDelete record when a column date is reached
I have the tables: In anuncios got the spine expiracao which receives the amount of days that that notice is valid, I want each day that the database automatically decreases 1 in this column, a…
-
1
votes2
answers718
views -
1
votes2
answers382
viewsFilter SQL query
I own a field called emailMSG0 within a table in the database. This field contains various information. Is there any possibility in SQL I filter what I want to get inside this field emailMSG0 ?…
-
1
votes1
answer169
viewsDynamically Set Connection in Model Laravel 5.1
I saw that I can use different connections for my models by defining as follows: class Aparelho extends Model { protected $connection = 'minha_conexao'; protected $table = 'aparelhos'; } But how can…
-
1
votes1
answer44
viewsHow to Return Results with Integers and Nulls?
I’m trying to build a Query but they’re not succeeding, in my database I have 28 information with code 32, and 62 information with code 23, but there is information with null code, and I wanted to…
-
1
votes1
answer621
viewsModel E.R - Correct?
Hello, I will be developing a project for my computer technician course and I am having difficulty with a Model E.R. The thing is, this is the description of the project, but will I ignore the…
-
1
votes1
answer1031
viewsHow to set a maximum size for a BLOB field?
I want to insert images and I want each record to have at most 100M, if this value is exceeded should be returned an error in the database itself. For example illustration of the problem: (in the…
-
1
votes1
answer89
viewsHashbytes with different value when selecting and writing with update
SELECT HASHBYTES('MD5','123') This select above returns me the following result: 0x202CB962AC59075B964B07152D234B70 But when I update the table using the same hashbytes UPDATE USUARIOSLOGADOS SET…
-
1
votes1
answer38
viewsDoubt about entities Asp.net mvc
I have 4 tables: T1, T2, T3 and T4 and the table of Customers. What happens is that the tables T2 to T4 "should" be one. But as part of the data would be as if it were a table and its options, I…
-
1
votes1
answer45
viewsSelect accessing two tables
I have a Product table, with the fields Marker, model and type. A second table referring to laptops has its fields related to price, RAM, other fields and the model, which is the same as the Product…
-
1
votes2
answers85
viewsUnsaved relationships
Have that question where thanks to the help of colleagues I managed to resolve my situation. Well, at least in parts... After making the adjustments pointed out, the data is being saved. But the…
-
1
votes1
answer73
viewsIs it possible to obtain multi-valued results in a group by?
I have 3 tables in the bank: Teacher, Student and Discipline. All of them have N:M relationships with each other. Then decide to gather all relationships in a single class table, which stores the…
databaseasked 8 years, 5 months ago Adriano Luz 1,023 -
1
votes1
answer69
viewsError when bringing information from database
I’m having trouble bringing the information from the database and displaying it in a list, when executing the code to bring the information from the application BD to and the following error…
-
1
votes2
answers328
viewsSearch and display in a listview a single type of BD information
I’m having problems to search for a single type of BD information, I’ve created a list where I bring all the information in it present, but I want to pull only one, for example search only the names…
-
1
votes2
answers349
viewsselect_collection on Ruby on Rails
If I want to return the options of Active and Inactive so that I select, I use the following code in the view, then it returns the 2 status: <%= select(:student, :status, Situation.all.collect {…
-
1
votes3
answers982
viewsHow to verify encrypted passwords with user input passwords in the database?
I am creating a program in which the user will put the login and password before entering the system,and after he put his input,the passwords will be saved in the database,and then I will check if…
-
1
votes1
answer173
viewsPick arrays with php space
I have a php code that picked up information from two different columns of the same table in a local database, but the code doesn’t seem to work when one of the columns has information with space,…
-
1
votes1
answer273
viewsError (T_variable) in php, how to resolve?
I have an error when connecting in the database,php says it does not recognize the line. He makes the following mistake : Parse error: syntax error, Unexpected '$conexao' (T_VARIABLE) in C: xampp…
-
1
votes0
answers87
viewsConnections in web application
I am creating a J2EE, jsf project. They have multiple Beans and controller, and the Beans access the Database. I’m having doubts how to manage the Connection for the database, right now I only have…
-
1
votes0
answers69
viewsNew fields added after scaffold do not persist in the bank even though they are in Strong params
I have a little problem here that I haven’t been able to solve for 3 days. Very strange. It’s in the editing of a record. He’s just updating the first record, not the second. The curious thing is…
-
1
votes0
answers32
viewsHow to use Join in UPDATE?
This is my command: UPDATE address SET lat = :latitude, lng = :longitude WHERE menu_id = :menu Only that menu_id is not from the same table. How can I do?…
-
1
votes2
answers1151
viewsHow to compare database data and display to user
I’m developing a surf site. In it, there’s a section called My Ideal Surfboard. Where the user will enter their data (Nome, email, peso, altura and experiencia(beginner, intermediate or advanced)).…
-
1
votes0
answers33
viewsWhat is the ideal model for creating classes involving the database?
I have a very strong question about what is the best way to create classes to "interact" with the database (in PHP, in this case). For example: I need very specific validations of each table to be…
-
1
votes3
answers1779
viewsMany tables with little data or few tables with lots of data?
I have a bank that will receive a lot of data. I am in doubt whether it is better to organize the data into a few tables with a lot of data or further divide the data into several tables. In which…
-
1
votes1
answer41
viewsDoubt with Join
I have the table address where do I select: SELECT street, number, city_id,town FROM address WHERE address_id = :address And on the table city have the city_id and I have the link. I need to get…
databaseasked 8 years ago Ana Carolina Ribeiro 451 -
1
votes1
answer354
viewsHow to convert mysql search result into columns
Good evening guys, I do not know if someone has been through this, but I need to convert the result of a search in mysql in columns, is not to exchange the rows for the columns, but rather, make…
-
1
votes1
answer79
viewsPHP - JAVASCRIPT - Take a form obtained variable to another PHP page
Friends, CONTEXTUALIZING: I have a php file with an HTML form, which I will call "arquivo1.php" where I pass an id variable via post to the same one where I handle the data. In this file1, I perform…
-
1
votes2
answers55
viewsReturning only one select at a time multiuser
I have several clients connected to a bunch of data. These customers make inquiries, almost at the same time, causing me headache, when 2 customers catch the same result of a select. How do I know…
-
1
votes3
answers1607
viewsHow can I view data using JOIN?
I am making a section on my site called "My Ideal Board", in it the user inserts his data (weight, height, etc), a comparison is made in the bank (join) and is returned to the user the ideal board…
-
1
votes2
answers348
viewsCheck the number of people per age
How does the consultation to know the total number of people in the age range from 0 to 5 years, and if you do not have any child with a certain age, enter 0; select idade, count(*) as qtd from…
-
1
votes1
answer110
viewsDynamic insertion according to date and days of the week
I’m creating an application using webservice in PHP. Within the application the user will set specific days to generate an alert, for example: second fourth sixth In this way, I would like my bank…
-
1
votes1
answer959
viewsHow I list the Packages in the oracle
How do I query(PL/SQL) to list a specific Package existing in the database(Oracle)?
-
1
votes1
answer196
viewsRelation N x N in Java objects
I have an item table (item_id (pk), descrição, ...), A supplier table (fornecedor_id (pk), nome, ...) and for being an Nxn relation I have an item_vendor intermediate table (item_id (fk),…
-
1
votes1
answer375
viewsCalculate average with Pivot result
I have a query that returns the grades of students in certain tests. The amount of test may vary. I use the Pivot command to transform test names into columns and so organize test/note, as shown in…
-
1
votes1
answer263
viewsBD modeling for "multi-level marketing"
Personal talk, I’m working on an app that consists of people referral, same as so-called multi-level marketing. The general idea consists of: Person A indicates person B (LEVEL 1) if person B…
-
1
votes2
answers3152
viewsremove mask to save to database
I am using Maskmoney to create a mask in the field for the user to type. wanted to remove the mask, saving only the numbers and the comma (2 decimal places) in the bank. R$ 1.300.000,00 saving only…
-
1
votes2
answers1514
viewsCalculate length of a Sqlserver field
Hello, I have a table in SQL with the word column and a column sizeDaPalavra, I was wondering if you have any way to register the word in the database and execute a function that calculates the…
-
1
votes1
answer114
viewsPass CSV content to an Sqlite table
I have a CSV file with student records. I would like to upload these records to a table aluno in the Sqlite. How can I perform this operation?
-
1
votes1
answer431
viewsQuery to turn columns into records
I have a query that involves several tables in Oracle, and returns a large number of columns. I wanted instead of returning the records of this query, return me the columns of select as records. An…
-
1
votes1
answer1040
viewshow to take data from one mysql table and insert it into another :?
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),…
-
1
votes2
answers1159
viewsTranslate website automatically according to the country of the internet user
I wonder if there is a php or JS function that through the visitor’s IP makes it possible to translate the site automatically according to the country of the internet user without needing him to…
-
1
votes1
answer1291
viewsDynamic access column oracle cursor
I have a situation where I need to access the attributes of a cursor differently. I have a cursor that returns me a list of records, with columns like col_1, col_nova, col_teste (illustrative…