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
answers38
viewsModel Entity Relationship Dynamic form
I created a code where the user is able to drag components and make their own form. I want to save the data coming from the user but I have no way to define how many fields he will insert in the…
-
0
votes1
answer279
views -
0
votes0
answers26
viewsParameter by name in the query
I have the following appointment SELECT * FROM myTable WHERE ip = 192.168.1.2 I would like to make a query by sending parameter by name using DB::raw() $dados = DB::raw("SELECT * FROM myTable WHERE…
-
0
votes1
answer1060
viewsHow to add columns from different tables?
I am trying to assemble an SQL command for my virtual store that returns the total order value, a table of items (pedidoitemaux) and an additional one for the items (pedidoitemadaux). I built a…
-
0
votes1
answer21
viewsTrigger executes if a column value is 'Database I'
Create a trigger that automatically enrolls a student in "BD Laboratory I" as soon as it is registered in "Database I". use Universidade; insert into Realiza_matricula (RGAacad, Nomedisc)…
-
0
votes0
answers65
viewsDisplay an image if the value "7" is in the "Code" Row
I appreciate the help you will offer me. I have tried many things, but now I am not moving forward at all. I managed to put this code but it doesn’t show me any picture. Up on top of me $results =…
-
0
votes1
answer698
viewsHow to improve select performance
I have to use Firebird, but I do not get along very well with database, I selected the following way: select first 5 skip ((1 - 1) * 10) distinct PRO.CODIGO, PRO.NIVEL_INTERESSE, PRO.DATA_RETORNO,…
-
0
votes2
answers92
viewsJDBC code fails with exception
I’m trying to perform a database search through java. I am using this code, but this entering the exception: public ArrayList<Pessoas> pesquisar(String nome) { ArrayList<Pessoas> lista =…
-
0
votes0
answers27
viewsDelete line according to date difference in Mysql
I am trying to delete lines from a table using as a reference the difference between the current date and the date the line was registered. Here is my code: DELETE FROM lixeira WHERE diferenca >…
-
0
votes1
answer417
viewsError When Updating Database with Entity Framework Core Code First
I have my Domain created with N objects and these objects are converted into table in the database, in Entity Framemework Core with Code First. If I create the database with the tables it creates…
-
0
votes1
answer49
viewsPostgresql - use custom select return in loop
I have a function that makes a select like that: SELECT a.nome, b.email into nome, email FROM tabela1 a INNER JOIN tabela2 b ON b.fk = a.fk Is there any way to create a "temporary table" that I can…
-
0
votes0
answers51
viewsPagination query with LIKE function
good afternoon. I have an error in paging query when I pass a search parameter. Here’s the problem: When I’m on page 2 and I do a search for an item on page 20 of mine sql returns nothing. Follows…
-
0
votes1
answer62
viewsHow to make an appointment to know the averages of people a day of a week
Hello, I would like to know how to make a query (Query) in the Oracle database to know: What is the average number of guests per day of any week. Below is the bank script: CREATE TABLE…
-
0
votes1
answer50
viewsLoop loop in Listview
Can someone help me? In a listview where the data comes from an internet database I can’t let it be automatic so that all values coming are included, the only way is to add one by one, but when as…
-
0
votes1
answer87
viewsMultiple SQL query
I’m not very experienced with SQL language, as I could make a query work this way: SELECT *, ( SELECT marca.* FROM marca WHERE marca.id = produtos.id ) AS nome_marca FROM produtos WHERE id = 5 What…
-
0
votes0
answers81
viewsIntegration between two databases
I have an idea to integrate two databases, at one point I have the database Postgressql with system A and on the other side a bank Firebird in system B. For example: I recorded a client on system A…
-
0
votes0
answers74
viewsUpdate with PHP and MYSQL division
How do I make a UPDATE for all users of a database? For example: UPDATE usuarios SET juros=investimento + investimento * 30 /100 WHERE id='89' The bank will take the investment data and add 30%, but…
-
0
votes0
answers34
viewsError with mysql BD
I have an error in my comic that I can’t fix I already used the CHECK TABLE command with the EXTENDED function and it says that there are no errors in the tables. the problem is this: I made some…
-
0
votes1
answer37
viewsError in selection query about social network requests
Hello, in my project I need to list the people and requests received by the user, but when listing people, I need to list only those who did not submit or that the user did not submit requests, in…
-
0
votes1
answer48
viewsConsulting cities without repetition and with different "WHERE"
When trying to resolve a platform bank issue hackerrank I could not understand the answer after having found in the discussion wing. The question says: Query a list of CITY Names from STATION with…
-
0
votes1
answer48
viewsHow to get from last record to first
I have these names on my chart: nome ----- A B C D E F If I do: SELECT nome FROM tabela he will return me "A, B, C, D, E, F". I’d like you to return me backwards, from the last record to the first.…
-
0
votes1
answer60
viewsHow to access a DB in an AWS EC2 port, using Datagrip or Pgadmin locally
I have an instance on AWS EC2 that has a Database on Postgres (not on Amazon RDS). I would like to access it using some tool like Datagrip or Pgadmin on my local computer. Is it possible? How to do?…
-
0
votes1
answer53
viewsPHP - Display correctly entered data message
I’m having difficulty putting a message saying : Data entered successfully and then send to another page. <?php include 'ligacao_pdo.php'; $condutor = $_POST['condutor']; $carro =…
-
0
votes1
answer187
viewsError creating a table in mysql
CREATE TABLE EPI ( CODIGO__EPI INTEGER NOT NULL, USUARIO_CODIGO_USUARIO INTEGER NOT NULL, TIPO_EPI_CODIGO_TIPO_EPI INTEGER NOT NULL, EPC_EPI VARCHAR (255) NOT NULL, DATA_CADASTRO_EPI DATE NOT NULL,…
-
0
votes2
answers43
viewsselect search in database with repeated records
I’m making a select in my bank, whatever, Postgres, and more records are coming.. For example, id_pessoa comes a 10 more record than should come.. SELECT pac.cns, pac.cns_responsavel,…
-
0
votes2
answers64
viewsWhat kind of database to use and how not to create many activities?
I intend to create an application, which will use barcode recognition, this barcode will lead to a screen on the medicine, the part of the database do not know which to use, because I never used,…
-
0
votes2
answers31
viewsError in searching the register in the comic
I made a registration page on my website, which to register needs Cpf and email. I made a SELECT to see if it already exists, if yes, do not enter, otherwise do not enter. I left Cpf as pk and email…
-
0
votes0
answers35
viewsDisplay the same metric for Prometheus but with different timestamps
I want to expose several metrics with their respective timestamps for Prometheus, for example: test5{job_name="test05"} 15 1512982800000 test5{job_name="test05"} 10 1512986400000…
-
0
votes1
answer1060
viewsERROR CODE 1215 - You cannot add foreign key
Table 1: Table 2: Commando: ALTER TABLE extras ADD FOREIGN KEY (login) REFERENCES usuario(login); Answer: Error Code: 1215. Cannot add foreign key constraint Cannot find an index in the referenced…
-
0
votes1
answer62
viewsplay login data in API parameter
In the login I ask the user to put the email and Cpf, then I have an api that plays data in a table that I created, then I need to take the parameters Cpf and email to put in the api. Ex:…
-
0
votes1
answer97
viewsHow to compare two Child values in Firebase
I have two types of users: Vendedores and Usuarios. Applicants can display their data if the Ids are the same (already functional). Users should see Sellers' values if their child ("City") has the…
-
0
votes0
answers40
viewsShow images registered in the database
I am beginner, do not know how to show pictures saved by name in the database // function function cadastraUsuario($conn, $nome_topper, $email_topper, $senha_topper, $data_nasc_topper, $sexo_topper)…
-
0
votes1
answer153
viewsPlay variables to be parameters in the API
I have a website and to enter it you need to log in, and the data are: Cpf and email. And I have an API that I need to play the variables Cpf and email to be parameters in the api, but I don’t have…
-
0
votes1
answer816
viewsHow to reference another collection in Firebase’s Cloud Firestore
I’m starting to learn Firebase using Cloud Firestore. And I have a question: How can I relate collections? I see the collections as tables, so I would have a collection of Products, and a Category.…
-
0
votes1
answer278
viewsError adding ON DELETE CASCADE two Foreign Keys from the same table
I am deploying a table to save the messages, in this table I have source users (sender) and destination user(recipient) from the same table: user. When trying to add the constraints to the message…
-
0
votes1
answer656
viewsp:graphicImage does not display image
Guys I’m having trouble displaying an image within my project in a Data Table. Simply the image is blank. The system makes a query in the mysql database of the image directory to know which image…
-
0
votes1
answer184
viewsChanging field type Mariadb(Mysql)
Staff created a table called entries in a test database. In it was inserting data from a.txt register file. until then the id primary key when I created it was not auto_increment so for testing…
-
0
votes0
answers28
viewsRestore database in sql server 2008 R2
I have a file . Bak and while trying to restore I am using the following command: use [master] RESTORE DATABASE Teste FROM DISK='C:\Teste.BAK' But sql returns me the following message: Msg 3241,…
-
0
votes1
answer89
viewsHow to remove the special character that forms inside a String in SQL?
I am using the excerpt below in my code, but when inserting > inside a String, it returns the result as > ;, the same is converting to HTML entity, as I can use '>', without problems?…
-
0
votes1
answer154
viewsShared use of databases
A Mysql database can have shared use, that is, more than one CMS can use the same database, changing only the table name? Are there limits? Are there contraindications? I’m asking because I’m…
-
0
votes1
answer49
views -
0
votes0
answers145
viewsUpdate on Cascade Oracle with composite primary key
create or replace TRIGGER cascade_update AFTER UPDATE OF project_name ON PROJECT FOR EACH ROW BEGIN UPDATE VEHICLE SET project_name = :new.project_name WHERE project_name = :old.project_name; UPDATE…
-
0
votes1
answer271
viewsGroup Month according to Between
I created a statement in Mysql to display a graphic report, I wanted the months to be displayed from the month informed by the initial date to the month of the final date. But in my SELECT it groups…
-
0
votes0
answers177
viewsGenerate random number with repeat rule
I need an SQL command that generates a random number between 1 and 11, and that for number 1 is generated more often than others. Currently I use the following command: FLOOR(1 + (RAND() * 11)) It…
-
0
votes0
answers42
viewsMYSQL does not list when running the command 'netstat -ntlp'
Apparently my MYSQL is working normal, but when I run the command: netstat -ntlp The result is this: As if MYSQL is not running.…
-
0
votes1
answer40
viewsNumeric data type with Access characters
I have a bank in Ae I have several fields that are essentially numerical. Only that the numbers can contain the sign of < or >. These fields can be used for calculations so I didn’t want to…
-
0
votes1
answer26
viewsMy codeigniter is using another database instead of the one I selected
I have 2 projects, one is the copy of the other, one I want to leave online and the other test for me to program on top, so I copied the database and copied the project, changed the name, changed…
-
0
votes1
answer720
viewsSqlite error: Foreign key Mismatch (fk incompatibils) when trying to make an insert
I’m trying to create a Associative Entity (N:N) in Sqlite like this: [ Pet --< Vacinapet >--- Vaccine ] And, here is the code of my Associative Entity CREATE TABLE VACINAPET ( vp_data TEXT NOT…
-
0
votes1
answer51
viewsHow to organise data
Good. I have a question, not so much about code with data organization. I have a small automatic backup application and the idea was to have "a task programmer", where I indicated the time, the type…
-
0
votes1
answer42
viewsHow to delete the records of several tables by scoring the ones that should not be deleted in sql server 2014?
I would like to delete all the records from the tables of my database, but some tables cannot be deleted, here in my case for example I have an average of 20 tables of which 6 cannot be erased the…