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
-
0
votes1
answer74
viewsHow to use aggregation functions in a WHERE?
I’m doing a college paper on databases, and one of the Query what I must do is this: Show all creditors who had a larger purchase total than that R$ 5000,00; I tried to: SELECT NomeCredor,…
-
0
votes1
answer292
viewsItem composition from the same SQL table
Well, I started studying Mysql recently and found a question that I couldn’t solve: An ITEM table has the columns (PK)cd_item, nm_item, ds_item, cd_tipo_item, the problem in this case is that an…
-
0
votes2
answers150
viewsInner Join Database
Staff I am using this command on sqlserver: SELECT ALUNOS.NOME, DISCIPLINAS.NOME AS DISCIPLINA, MAX(NOTAS.NOTA) AS MEDIA FROM NOTAS INNER JOIN ALUNO_DISCIPLINA ON ALUNO_DISCIPLINA.identificacao =…
-
0
votes1
answer299
viewsHow to select multiple data from related tables
I created three tables in the student database, book and loan, I would like to list all the books that were loaned to each student, however, when the student borrows more than one book the command I…
-
0
votes2
answers600
viewsRecover image in SQL SERVER and put in a REPEATER list
Today I recover information from a database and I list in a REPEATER, until then all blz. But I also need to take an image from the database and show on this REPEATER. Follow below as I show the…
-
0
votes2
answers33
viewsConcatenate data from a table
I have the following sql statement: SELECT a.alunonome AS aluno, m.materianome AS disciplina, AVG(CASE n.notabimestre WHEN 1 THEN n.nota ELSE null END) AS bim1, AVG(CASE n.notabimestre WHEN 2 THEN…
-
0
votes1
answer283
viewsSession vs Database Query
Guys, I’m in doubt here. Inside my control panel, I will need to get user id, email, password (only to change password) name, over name, etc... The ideal would be to save all this in a session at…
-
0
votes0
answers58
viewsRegister in table if query returns result (Oracle)
I’m developing a call panel. I have a query that results in the client call (name/password/Guiche), this query shows the result for 10 seconds, after that it is empty until the next call. I need…
-
0
votes1
answer506
viewschange data type ntext to text, SQL Server
I need to change the data type of a field that is in "ntext" to "text". The reason is that I’m having trouble pulling this value from the database and generating a PDF with the php DOMPDF component.…
-
0
votes1
answer6479
viewsGenerate MER from a Database
I have a Database backup and for lack of documentation I need to generate his MER. I remember reading somewhere that there are programs that do this reverse engineering and generate the MER. Could…
-
0
votes0
answers18
viewsTwo BD connections in a single file
Good afternoon guys, I wonder if there’s a way I can make two database confilations, in case I’m with the Dreamweaver connected to my online site and would like to follow with it on the localhost as…
-
0
votes1
answer234
viewsEmail as Primary key
I created a database, and in the courses I did we always used id as Primary key,has problem using the email as the primary key, because that way would prevent the registration of a similar email!…
databaseasked 6 years, 11 months ago Arthur Oliveira 147 -
0
votes0
answers79
viewsHow to update object using Entity manager?
to create I used: public void adiciona(Produto produto) { em.getTransaction().begin(); em.persist(produto); em.getTransaction().commit(); } to remove I used: public void remove(Produto produto) {…
-
0
votes3
answers43
viewsProhibit lines from being exactly the same in the database
I have a system that integrates data from three different banks, more specifically the registration of the companies of these three banks, I created a table where are stored the integrations that…
-
0
votes2
answers168
viewsGrouping invoices in php mysql delay
Hello, I’m beginner, I’m learning to select, and would like to receive help from this wonderful community. I need to take only the invoices that are with the a_winning status of each student, would…
-
0
votes1
answer908
viewsConvert image size before saving to BD
I would like to increase my processing code: // Local onde imagem vai ser salva $_UP['pasta'] = '../../media/'; // Tamanho da imagem $_UP['tamanho'] = 1024*250; // 250Kb // Exrensões permitidas…
-
0
votes1
answer365
viewsHow to create an SQL function that calls a script in python?
I need to create a software that at each insertion in a table a python script detects that there has been a change in this table and execute certain commands. I have done an implementation that is…
-
0
votes1
answer3383
viewsSQL AS COMMAND
Good night! So guys, I have a table where it has some columns, among these: data_current and data_validity, as soon as a record is made an auxiliary column is generated through the AS command of…
-
0
votes3
answers68
viewsSelect on a date and return cannot be null
I need the return of a date, if it is "Null" in the BD return another date or other data that is not "Null".
-
0
votes1
answer569
viewsHow to create a JOB in ORACLE for backup?
Good afternoon, you guys! I am still novice in the subject when it comes to sql, I would like to know how to create a JOB (or other operation that does the same) that performs a data extraction from…
-
0
votes0
answers507
viewsEncrypt in php and decrypt in javascript
Want to store in a text file, at the root of my application, a key generated by PHP, as a salt. That key would help encrypt passwords, database access information. That is, such information would be…
-
0
votes0
answers76
viewsWhat’s wrong with Foreign key?
I am working out a database, but at the time of generating the diagram in reverse engineering Workbench no table linked with another, and does not appear the FK, I wonder if I did something wrong,…
-
0
votes0
answers250
viewsauto_increment command for Id does not work after erasing data and rewriting it
When I create a table with the column "Id int not null auto_increment" and enter values in the table, after deleting the values and reinserting them, the Id does not part of 1, and sometimes with a…
-
0
votes1
answer1635
viewsPassword Validation Android Studio
On one screen I register the password (sign up button) and on the other screen I need it to be validated for the application to turn off (turn off button). I have tried several ways, but I can not…
-
0
votes1
answer395
viewsSave the information of a variable in Codeigniter to the database
I’m getting a lot of product information from the Cosmos API and storing it in variables, but how do I save the information from these variables in the database? VIEW $curl = curl_init($url);…
-
0
votes1
answer53
viewsSyntax SQL query
Can someone help produce the syntax of the SQL query to get the result below? I need all values of the "Budgets" table to be listed, but at the same time all categories should be listed as well…
-
0
votes1
answer44
viewsWhy can’t I create a tablespace?
I’m trying to create a tablespace on oracle 11g but I can’t get it to point out the error that is in this image: I wanted to understand why I can’t create!…
-
0
votes1
answer48
viewsChange automatic database field after a given time
Well I have a field in my table that is called status, I need to have my bank update this field automatically if the visitor does not leave the company after 18:00. Does anyone know how I start? I’m…
-
0
votes1
answer48
viewsHow to make several separate selects with the 4.2 Standard?
Hello I need to make a select on a table, however if I do not receive the month by the parameter I must do the SUM method to sum all months if($month != 0){ $dbRegister =…
-
0
votes1
answer230
viewsHow to pass information chosen in the combobox to the database?
I have a database that is filled with data coming from the database and I wanted that after pressing the button, that chosen information to go to the database. Whenever I try to send the data I have…
-
0
votes1
answer402
viewsMysql - Update column with Brazilian date value
I am updating a table in a bank with more than 100 thousand records to be able to perform future SELECTS to generate a statistical report. The table currently has a 'Birth' column of type…
-
0
votes0
answers304
viewsDuplicate values in column that is foreign key
When trying to insert a new data into a given table (employee), I have a column called "manager ID" which is FK from the table itself "employee". During the registration I send the ID of another…
-
0
votes0
answers170
viewsHow to create method to print a report - java
How do I create a way to print a DB report. Follow my method below. public void printReport (Date initialDate, Date endDate){ list<Sale> sales = getSales (initialDate, endDate); for (Sale…
-
0
votes0
answers26
viewsWarning: mysqli_select_db() expects Exactly 2 Parameters (did not find answer in the other topics)
I’m new to this programming business so I’m kind of stuck in this code, so I’d appreciate it if someone could help me. The following warning appears: Warning: mysqli_select_db() expects Exactly 2…
-
0
votes3
answers1169
viewsHow to store the data in a variable and then use a query?
I have a combobox filled with data from the database (doctor’s name), where I choose a name, but I wanted to record in another table of the database the id_medico and not the name. I thought I’d use…
-
0
votes0
answers41
viewsDatabase Connection with Php
Good, Someone who understands php and a bit of database that can help me? I can’t connect the database to the website with php.
-
0
votes1
answer4475
viewsMysql error : #1265 - Truncated data for 'value' column in row 1
Good afternoon, you guys. I gave the following command in Mysql: UPDATE procedimentos SET valor = '2.400.00' WHERE procedimentos.id_proced = 1 the value field is a double, I’ve tried with float and…
-
0
votes1
answer181
viewsCreate query to return the smallest possible value
Good night. I need to do a sales report grouped by period and by card. But I do not know how to enter a store and horizontally of it appear the values of each card. Example of how the output should…
-
0
votes2
answers35
viewsQuery returning divergent result
I have two tables: Table accounts with column value with two records totaling 1100; Table receipts with column value with a record totaling 500 I want to perform a query where I receive the sum of…
-
0
votes1
answer164
viewsWhy use dice type and not just use Varchar?
I am manipulating some databases in which the vast majority of columns are with the data type VARCHAR for fields such as Date, Price, Total Value, Birth, Date/Time and etc. Briefly, practically…
-
0
votes1
answer638
viewsHow to make a global variable in PHP?
I have a login, and if the credentials are correct it opens another PHP file and wanted the name of the person associated with the credentials used in the login to appear on a label. All the…
-
0
votes0
answers56
viewsSave background and text to a database
My project is simple, a grid view, with several buttons, and at the click of them opens a popup with 3 options and at the click of them, arrow a text and a background on the button, but when I leave…
-
0
votes2
answers157
viewsHow to delete data from database?
I have this code to erase the data from the database where the name is the same as the one chosen on the combobox, whose code and the second. But for some reason I can’t figure out which one isn’t…
-
0
votes1
answer436
viewsSum a summed field - PL/SQL
I need to make the sum of a field to which a sum was made as the example below: SELECT A.*, B.* FROM (SELECT DTAGENDA, AG.CODITPROD, CD, ROW_NUMBER() OVER(PARTITION BY AG.CODITPROD, CD ORDER BY…
-
0
votes0
answers235
viewsHow to do an exclusive specialization in sql?
Well, I finished the entity relationship diagram of the database I’m creating and in it there is a service entity, which has two exclusionary specializations (one or the other, can’t be both),…
-
0
votes1
answer318
viewsI can’t change my column collate in mysql to utf8_general_ci
Good morning Personal. I have a problem with changing the collate of a column in my database. An example of how I am running: ALTER TABLE `minhaTabela` CHANGE COLUMN `nome` `nome` VARCHAR(50) NULL…
-
0
votes1
answer52
viewsHelp with database schema
I am developing an order control system, and I am finalizing, but now I came across a problem in the payment part scheme: I’m linking the id_pedido with the payments, however, when the request costs…
-
0
votes3
answers118
viewsLogic for using foreign key - a user’s notes
I am aware of a problem in the use of foreign key. I cannot find the logic for a system: The problem: the user gives a note for each question, each one being a table field, and at the end the…
-
0
votes1
answer280
viewsChange the status (online/offline) in the bank when closing the page
I’m making a chat system for a panel, and I already have it ready practically, everything connected to the database, when it login changes to online and when it comes out(click the button) it…
-
0
votes2
answers1404
viewsHow to give permissions to user groups in Postgresql?
*All registered users who are members of the "ACCESS SITE" will have the same permissions. I created a group of users (Group Roles) in Postgresql called "SITE ACCESS" to put all users (Login Roles)…