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
answer1140
viewsERROR: column Reference "Customer" is ambiguous
GOAL I’m holding an accountant in the host name column for every customer equal to BRASILFOODS, the only thing I wanted, was for next to the count to appear the name BRASILFOODS QUERY SELECT…
-
1
votes1
answer54
viewsdoubt sql database
i want to enter record in DS_ITEM and the mistake you give me is "Cannot insert explicit value for identity column in table 'SCD_ITEM_CONTR' when IDENTITY_INSERT is set to OFF". How can I make this…
-
1
votes2
answers43
viewsSearch for missing records within the same table
I have a table containing user information. it contains a field called competence. And when I want to pull information from some user I pull competence so: SELECT * FROM registro WHERE competencia =…
-
1
votes0
answers39
viewsError when displaying the number of records in a table
I’m using this code: /* Select Count de Ativos */ $tativos = "SELECT count(*) from ativos"; $lista_ativos = mysqli_query($tativos); if(!$lista_ativos) { die("Erro no Banco - CONTAR ATIVIDADES…
-
1
votes1
answer298
viewsHow to return the sequence of the week in the reported period?
Good morning, I need to return the sequence of the week of the month (of the reported period) in two fields, initial and final date. In PHP and MySQL. Currently returns the week number in the year,…
-
1
votes1
answer188
viewsError while initializing database on server in Asp Net Mvc!
I have a finished application developed in C# using Asp Net MVC. On my local server the application connects to the database that is on the server of the company that I work, so when putting the…
-
1
votes1
answer210
viewsNomethoderror: Undefined method `Production' for "Development":Activesupport::Stringinquirer
I don’t understand why you’re not migrating. deploy@vps8029:/var/www/maisonconvite$ rails db:drop db:create db:migrate db:seed rails aborted! NoMethodError: undefined method `production' for…
-
1
votes1
answer371
viewsProtection of sensitive data in your database
What is the most appropriate way to protect sensitive data such as: CPF, credit card number, cvv, expiration date, etc. I have never had to store this kind of data in my applications, because I use…
-
1
votes2
answers100
viewsRemaining minutes between field and dateAtual
I am trying to create a direct query in mysql where I must return some value if the time interval of the current date and my datareg field is 02 minutes. SELECT * FROM tabelax WHERE grade = 19 AND…
-
1
votes1
answer304
viewsOffset and limit Mysql problem
When performing a query using limit and offset the database returns a line less than it should. What’s the problem? Cache? Lock? Index? Dice? For example: select distinct(id_table1) from table_1…
-
1
votes1
answer38
viewsData return en JSON in an array , uploading the database ID by the respective Names. How can I do this?
I made this code, but it only returns me the ids, and I would like in the place of the ids he did a search by Ner Join in the database and returns in place of the ids the names. Php code: <?php…
-
1
votes1
answer113
views -
1
votes0
answers1256
viewsSQL Error [1064] [42000]: You have an error in your SQL syntax
When I add a new row to the table I can delete using the command: DELETE FROM ebdb.tb_categoria as tc WHERE id = 790; However, the lines that already exist cannot delete and returns the error: check…
-
1
votes1
answer78
viewsDelete Oracle - Web Api
I’m trying to make this springboot code, become a code in Webapi @RequestMapping("/deletarEvento") public String deletarEvento(long codigo) { Evento evento = er.findByCodigo(codigo);…
-
1
votes1
answer31
viewsDatabase data for web page
I needed help because I wanted to send the data from my database to the website BASE FIELDS: Id_Produto, NomeProduto, PrecoProduto,DescricaoProduto, QuantidadeProduto, CategoriaProduto - TABLE NAME:…
-
1
votes1
answer272
viewsConnect Sql Server 2014 to Django 2.2
I am trying to connect the Sql Server database to Django but am getting the following error(The connector I am using is Django-pyodbc-Azure): Django.db.utils.Interfaceerror: ('IM002', '[IM002]…
-
1
votes0
answers32
viewsConsult execution time of instructions conducted at the Bank
I’m doing a performance analysis job where I did a js script that performs the following steps: 1: run 1000 Inserts after 2000 and so on. 2: I update 500 Inserts after 1000, among other CRUD…
-
1
votes2
answers1305
viewsHow to store product lists of an order in a database table?
I have the following database modeling so far: I’m wondering how best to store the products in the order table. One string with Id of all products for each order in the table? I think very bad. What…
-
1
votes0
answers60
viewswpf application with Entity framework does not work on another machine
I have a wpf application with Entity framework and sql server express...works perfectly on my pc, but when I try to install it on another computer it does not work...the application does not create…
-
1
votes2
answers567
viewsInsert array into a database using PHP
On the site I’m creating I have a form where people can add various topics. My problem is at the moment where a second or more topics is created because only the first one goes to the bank and I…
-
1
votes1
answer87
viewsWhat is the best way to store data locally?
I need to develop a web system to run without a server, the system in question will only save client data and schedules. I would not like to use a database server, because it becomes annoying that…
-
1
votes1
answer559
viewsCardinality in Database - Relationship One to ONE
I’m studying databases, and at the moment beyond bank definitions, type of models I’m seeing Cardinality! I’m having doubts in this exercise below: My doubts are as follows How I identify the origem…
-
1
votes1
answer49
viewsTurn a query into a HIVE file. CSV
I need to extract information from HIVE or Hue by generating a CSV file, I have tried some commands for both Hive and the Hue application but without success. Has anyone ever done anything like…
-
1
votes0
answers81
viewsAccent mysql table
Good morning. I have a table in the database and I need to make 2 selects in it: For the first search I’m using this and is returning everything I need: SELECT * FROM wp_memoria WHERE memo_de IN…
-
1
votes0
answers18
viewsPerformance between Mysql Update types
Good evening, I need to update a table 'a' in the rows where there is no occurrence in table 'b', where table b has about 7 million records. I imagined two solutions but I can not say which would be…
-
1
votes1
answer439
viewsHow to return an object from a bank in QTL(Mongodb)?
I currently have some objects in a Mongodb database. The structure is as follows. { "_id" : ObjectId("55cb9c666c522cafdb053a68"), "geometry" : { "type" : "Polygon", "coordinates" : [ [ […
-
1
votes1
answer481
viewsSyntax error in with SQL Server
Tenh the following error in sql server: Incorrect syntax near the keyword 'with'. If this statement is a common table Expression, an xmlnamespaces clause or a change tracking context clause, the…
-
1
votes1
answer314
viewsSQL - How to override ambiguous external junction?
I’m trying to normalize a database for addresses and zip codes. However, there is a situation in which the Post Office assigns, for the same street, a ZIP code to the side with even numbers and the…
-
1
votes1
answer75
viewsCreate a table or several in SQL Server?
I have tables in my database: Orcamento, Maquinas, Veiculos and Acessorios. I need to record the costs of each of them, for example each table will be recorded a daily cost I create a table called…
-
1
votes1
answer54
viewsPayment details of installments of insurance policies
I am finding it difficult to model an "Payment Details" entity, where it contains the numbering of an insurance policy or endorsement, with information such as gross premium payable, IOF, total…
-
1
votes1
answer65
viewsFormat money value from database
I have an input with a mask where the user type the desired price and automatically is formatted. Before sending to the database, I transform this value so I can work with it with some arithmetic…
-
1
votes1
answer45
viewsProblem with BD (foreign key)
My script is as follows. It is giving foreign key error and I cannot solve. CREATE DATABASE teste; USE teste; CREATE TABLE horario ( id_horario int PRIMARY KEY NOT NULL AUTO_INCREMENT, horario time…
-
1
votes1
answer42
viewsIs there the possibility of data loss while converting text data types to nvarchar(max)?
I have a legacy database in production with data stored with the type text but there was a need to convert them to nvarchar(max) and by chance I saw that this was already a recommendation from…
-
1
votes1
answer861
viewsHow to list all Access table names?
Hi, I’m wanting to display the table names that are inside the Access file and play for a variable. How can I do this? Does the C# platform itself provide attributes for me to do this? I’m using the…
-
1
votes1
answer337
viewsIF condition with database
Guys I’m making a money transfer system via php with database, I have an option showing all database users and a text field to enter a value, how I do so that the user can not select himself and…
-
1
votes1
answer66
viewsWhile to Analyze Select Return
good afternoon! I’m having my first contact with Mysql, before I worked with Oracle, and I came across a problem that on Oracle, I had the following structure: for a in (select id, nome, salario…
-
1
votes1
answer71
viewsWhat is Mongodb and why should I, as a front-end dev, adopt it instead of good old Mysql?
I have heard comments from other devs to migrate to Mongodb to create my applications. How and why I should do this? There is an interface by which I can manipulate the data, etc.?…
-
1
votes1
answer33
viewsEfficiency in querys with different schemas [Mysql]
Is there any loss of efficiency making querys in different schemas? For example query 1 is more efficient than query 2? 1: SELECT * FROM SC1.T1 INNER JOIN SC1.T2 ON ... 2: SELECT * FROM SC1.T1 INNER…
-
1
votes1
answer364
viewsInner Join with like, Mysql and Datatable
Speak people, I have a problem at the time of searching a field in the datatable, i have a table of contributors, this is linked with the contributors_param, contributors_end and contributors_tel.…
-
1
votes1
answer1153
viewsOracle SQL Query - Subtract Hours
Hello, I’m a beginner in SQL, and I’m in mortal doubt. This query is to analyze an execution log on a basis of my company. The problem is that the time zone of the OS is +0.00 which creates…
-
1
votes0
answers68
viewsColumn number of supplied values does not Mach table Definition - SQL SERVER
I have the following problem in sql server when I put the CASE clause at the end of this line of code: DECLARE @RESULTADO TABLE ( Total INT, GrupoTitulo VARCHAR(255), GrupoChave VARCHAR(255),…
-
1
votes1
answer503
viewsIs foreign key correct with null field? Postgresql
I was building a relationship entity model (MER) from a database to a rual association, it is a work for TABD matter. But I came across an atypical situation for me, a 0.n to 0.1 relationship. As…
-
1
votes1
answer59
viewsQuestion about list(zip) command and converting dictionaries to dataframes?
I am filling some lists with strings and other numeric entries and using them to fill some dictionaries with information that I need to view alternately. Then I came to doubt, the command…
-
1
votes1
answer87
viewsSave form in database
I created a system in which there is a form that I want to save in the database and display it in another screen that I am developing but I do not know how to save the form although it receives the…
-
1
votes1
answer96
viewsMysql - Select in two databases comparing columns
I’m trying to make a select in two different databases by comparing the matrix column. select A.matricula, B.matricula from banco1.escolas A JOIN banco2.escola B ... The bank1 is the most complete.…
-
1
votes1
answer19
viewsRelate Products to duplicated EANS in a relation where 1 product has n EANS. sql language
How could I make the comparison with the EAN of another product without comparing it to the same product... in sql? CREATE TABLE `produto`( `idproduto` INT NOT NULL AUTO_INCREMENT, `nome`…
-
1
votes1
answer28
viewsQuery to insert into a Sqlserver table
Sqlserver, given a table with the fields: id (int), name (nvarchar) and birth (smallDateTime) How can I write a query to insert into this table and then query this data from all table records. Id:…
-
1
votes1
answer62
viewsPick a certain number from a string in select
I need to take a certain number that is inside a string (in case the return of a select). In the table is saved like this: CreditCash_Aderencia_AD_20180823;20180823;Arquivo convertido para CSV com…
-
1
votes1
answer66
viewsHow to join the select of these 3 tables that have no connection at all?
The image below shows 3 tables, united by Excel. The first is called customer, the second representative and the third is called channel. But I would like to join them in a single select in sql, and…
-
1
votes0
answers86
viewsProblem with the command Rails db:create Undefined Symbol: rb_enc_alias
Whenever I create a project (from scratch) then I give the command db:create Rails to create the database show me this error: LoadError: /var/lib/gems/2.3.0/gems/pg-1.1.0/lib/pg_ext.so: undefined…