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
votes0
answers37
viewsDoubt about Session()
I have a question about the use of sectionals. I’m building a dynamic query system to get data from my database when I click on a link, each link passes an id through the URL. On the page where the…
-
0
votes0
answers109
viewsProblem with mysqli_insert_id - Class
I have a problem getting the last id inserted in a table, for the same is returning empty. I searched the stack but couldn’t find a solution. Script for inclusion of information in the BD: if (…
-
0
votes0
answers448
viewsImage Return Json Database
Initially for clarification, I’m trying to create a hybrid html, javascript and css app. objectively, my obstacle is to display on the user screen your avatar, which is in a Mysql database directory…
-
0
votes2
answers56
viewsCount Database output
hello. good night. I have a question I want to add up all the field values valor_reais of my table for example id 1 = 150 id 2 = 100 id 3 = 100 I want the obvious result, 350 I’ve tried something…
-
0
votes1
answer120
viewsDelete button function does not work
I’m developing a software for tcc I have already created the connection to the database and the function of entering data into the database when programming the following code to delete button, it…
-
0
votes1
answer166
viewsAdd and Remove Divs Function with PHP and jQuery
Good morning guys, I’m facing a problem and I’d like to know if anyone can help me. I have developed a code to add and remove Divs dynamically and with autoincrement and decrease of the index. The…
-
0
votes1
answer329
viewsError importing data from an Excel spreadsheet to mysql directly on the server
I am trying to import data from an Excel csv spreadsheet, however the following error appears: Invalid column count in CSV input on line 1. I imported directly to the root of the database (created…
-
0
votes1
answer107
viewsError trying to access JAVA WEB database
When I run the program the following error: HTTP Status 500 error - Internal Server Error. java.lang.Runtimeexception: java.sql.Sqlexception: No suitable driver found for…
-
0
votes2
answers104
viewsTraining ORACLE PL/SQL
Galley, I need to study PL/SQL but my notebook is not supporting Oracle Database Express. Is there a lighter tool or some website I can train? Thank you!
-
0
votes0
answers23
viewsSQL - Difference between Mandatorykey and Mandatoryfkey
I’m in my first internship since I started IT and the area I’m interning in is Databases. I have studied some old scripts and saw that some variables were declared, for example: @country AS…
-
0
votes3
answers2475
viewsReturn 0 if the value does not exist in the table
I am using select to check if there is SEQ_RESUMO in the table. If there is this returning me the value of SEQ_RESUMO, ate ai ok. But when the value does not exist in the table, according to the…
-
0
votes1
answer928
viewsListener refused the Connection with the following error: ORA-1251 JAVA ORACLE
Hello, I’m having an error when I try to connect to an oracle bank. someone I was able to help. code private static Connection ObterConexao() { Connection conexao = null; try {…
-
0
votes1
answer245
viewsInner Join is returning repeated results
I have three tables! One of them is a relation table! Are they: Person: Treating: Relationship Table between Person and Treatment: I would like that when passing the person’s ID, the query returns…
-
0
votes1
answer175
viewsIs there a command in sql server that returns the number of records in a table?
I have a table called client with several customers already registered and I want to filter all customers who are the same age and get an entire number of these records, in case the amount of…
-
0
votes0
answers65
viewsPython - Send csv to database
I’m writing a script that joins all files of the same format into a folder and creates a single CSV and I want to send that CSV to the database. As new files enter this folder, CSV will always…
-
0
votes0
answers202
viewsHow to pass the variable on postgres using dbblink
Oops, good morning! I have the following query in postgres: declare $1 VARCHAR; BEGIN IF (SELECT COUNT(*) FROM tempo2 WHERE looping IS NULL) > 0 THEN $1 = (SELECT banco FROM tempo2 WHERE looping…
-
0
votes1
answer337
viewsRecover user name and email in Navigationdrawer?
How do I recover the name and email of the logged-in user? I’m using Firebase BD. public class MenuActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {…
-
0
votes1
answer87
viewsBank modeling with classes with n relationship for n
Galera Good morning. I’m modeling a company that owns several branches. Basically I have information, of size, of the organization chart of each size, and of positions in the branches. For example…
-
0
votes0
answers59
viewsDoes Jparepository Saveall maintain the state of persistence in memory?
Jparepository offers us options save and saveAndFlush to persist the objects to the database. Unlike saveAndFlush, the save keeps the persistence state in memory, which ends up generating memory…
-
0
votes1
answer1814
viewsTake all data from an HTML table and insert it into the database
I have an editable table in html, when clicking save, I need to take all the data of the table, send by ajax to the page that makes the INSERT of all the lines in the database. My doubt would be:…
-
0
votes1
answer122
viewsDifficulty listing a invoice and products using PHP and Mysql
I’m having trouble with this page right below. My difficulty is in displaying the products of a specific invoice. Because in statment SELECT * FROM produtos WHERE = ? does not return anything! But…
-
0
votes0
answers46
viewsUPDATE between 2 SQL tables giving error
I am trying to perform an UPDATE and it brings me the following error: "Message 157, Level 15, Status 1, Line 40 - An Aggregate may not appear in the set list of an UPDATE statement." Follow the…
-
0
votes1
answer113
viewsSelect from all users with only one result from each user
Hey, good night, man. I think the title is a little fuzzy, I’ll try to explain better. I’m making a chat system and I want to list all user conversations, but only one message from each user.…
-
0
votes2
answers189
viewsIs dynamic HTML via BD bad practice in PHP?
I’m creating a platform where I need to change elements of the site by a control panel, and for example, it would be something very bad way insert into BD and pull via PHP? Let’s say I have a menu…
-
0
votes1
answer168
viewsIs there an equivalent to SQLSERVER’s @ROWCOUNT in Postgres?
I am migrating the Database of some applications, from Sqlserver to Postgres and several scripts use @@rowcount. There is a Postgres equivalent to @rowcount?
-
0
votes1
answer29
viewsSearches in mysql - Accented letters
Currently I do my search as follows: SELECT * FROM cadastro WHERE nome LIKE '%são%' This way does not return me a result, however, when I put only the ã capitalized à I get the result. That’s how it…
-
0
votes1
answer260
viewsFalse return when comparing two python identical strings
I’m trying to compare two strings, one comes from the database as an array, the other is written by hand: string = str(profile[1]) #Carlos Gimenes print(string == str('Carlos Gimenes')) #Retorna…
-
0
votes1
answer40
viewsReference between two tables by Heidisql
Friends, I am using Heidisql and I have a database: Mariadb created two tables and I want to reference client table id, with user_id of table posts. And I forgot how to reference, using the app…
-
0
votes3
answers34
viewsHow do I filter a time coming through a select
$query = "SELECT horario FROM tempo WHERE teste = $teste"; Way it returns: 2019-07-26 19:24:17 Way I want it to return:19:24:17
-
0
votes1
answer56
viewsCodeigniter - Retrieve bank categories
I have a table ''category'' in the database and it has the column 'id' and 'title', I am recovering the same in several menu’s dropdown, but loads all categories of the database but I would like to…
-
0
votes1
answer49
viewsColumn that receives a result if the condition is true
SELECT DISTINCT P.CD_PACIENTE , P.NM_PACIENTE , DECODE (P.TP_SEXO, 'M', 'MASCULINO', 'F', 'FEMININO', 'I', 'INDEFINIDO') SEXO , TRUNC(P.DT_NASCIMENTO) DT_NASCIMENTO , (SELECT FN_IDADE…
-
0
votes0
answers34
viewsDoubt Basic Relationship
Good evening guys, sorry to ask, this is the first database I’m creating, so... I have these 3 related tables, my question is whether I should keep the Customer and Employee Tables weak or leave…
-
0
votes1
answer78
viewsHow to configure Mysql for multiple connections?
Hello, I have a client with 3 points of sale, 1 office and 1 server. Such a server is Mysql. When a certain export routine is performed in the office, a query is executed that takes a while to…
-
0
votes2
answers136
viewsReplace a fixed CASE value with a SELECT and JOIN?
SELECT DISTINCT P.CD_PACIENTE , P.NM_PACIENTE , DECODE (P.TP_SEXO, 'M', 'MASCULINO', 'F', 'FEMININO', 'I', 'INDEFINIDO') SEXO , TRUNC(P.DT_NASCIMENTO) DT_NASCIMENTO , (SELECT FN_IDADE…
-
0
votes0
answers25
viewsDatabase does not receive querys by php script although it works
Guys with a problem in receiving the form in the database, it seems that although the script is correct it simply ignores it, using xampp, tried by Cloud9 also and the same thing happens. <?php…
-
0
votes0
answers163
viewsHelp with a MER
Well someone could help me with my MER I’m wondering if I’m using the correct logic in relationships and cardinalities: a report may have one or more services 1 - n a request has one or more reports…
-
0
votes0
answers88
viewsSql Server Database Modeling
Good morning friends, I have a project that has basically two types of products, the simple products, such as market items, rice kg, beans 1 kg , etc.. and items composed as basic baskets , formed…
-
0
votes2
answers115
viewsHow do I call two models in one view?
Good morning people, I’m new to Asp so my knowledge is very low, could you help me with this question? I have a query view that already has a "BOOK" model, and in this same view I intend to leave a…
-
0
votes1
answer128
views -
0
votes1
answer1049
viewsHow to make a "scan" using SQL?
I have the following structure in my database: Table tgffin with the columns: CODNAT, AD_CODNAT_OLD Table tgfnat with the columns: CODNAT, AD_NAT_OLD I want to reclaim the value of tgfnat.CODNAT…
-
0
votes0
answers20
viewsWorking with Shifts in Dimension of Hours
I am structuring a new Datawarehouse that will in the future be consumed on a BI platform. Already created some dimensions for my database one of them was the Dates, in which I break the date into…
-
0
votes0
answers108
viewsRemove duplicate records from select php array
I cannot remove duplicate records in the array $query = $pdo->prepare("SELECT * FROM produtos order by Data asc"); $query -> execute(); $ContCampos = $query -> rowCount(); $consulArray =…
-
0
votes0
answers72
viewsHow to create function to "change" and "delete"?
I have a table where displays the "data" already registered, and for each data has the option "edit" and "delete". Now I am in doubt how to delete and change the chosen data. I would need a specific…
-
0
votes1
answer108
viewsSelect within another select using the LIKE operator
GOAL I need to make a select inside another select using the LIKE operator converting the value of the other select to LOWER, but it is returning error QUERY select * from tbl_client where "NODE"…
-
0
votes1
answer133
viewsCatch record with JDBC SQL specification
Hello, good afternoon, sir. I’m having to develop a Java system with Mysql. It’s simple, just the part of the backend, but I’m inciante and had not run querys with java before hehe. The system is…
-
0
votes0
answers370
viewsMVC Upload Image and send the database
Good evening I’m making an online shop for a discipline and I was wondering if someone could help me create the image upload to the Database. The purpose is to add in the admin page and appear in…
-
0
votes1
answer152
viewsPostgresql result filtering from lower one column value
It is a matter of logic and knowledge of Postgresql resources. I have the following result of a query: I need to do a filtering, grouping by [hour] so that only the nearest [real time] remains and,…
-
0
votes2
answers1473
viewsSearch the database and return the value - Laravel
I’m doing a search in my database, I want to take the value found and save it (are two different tables) but the value is not being saved, is being saved the number 0. I use this command in my…
-
0
votes3
answers113
viewsIs it possible to update to 1 table using another condition?
I have the following query: update ivr_contatos,ivr_campanha set ivr_contatos.tentativas = 0 where ivr_contatos.status = 0 and ivr_contatos.tentativas >= ivr_campanha.qtdtentativas the doubt is,…
-
0
votes1
answer77
viewsSqlite in memory with Dapper generates non-existent table error
I have the following code for table creation: string query = @"CREATE TABLE GVP_USERS_TAGS( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT, DATEINS datetime NOT NULL DEFAULT (DATETIME('now')), NAME…