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
answer3935
viewsORA-01704: too long string literal
I have a CLOB type field in the BD, but when I give an INSERT it returns me an error saying that exceeded the field size that is 4000 characters. Relatório de erros - Erro de SQL: ORA-01704: literal…
-
1
votes1
answer201
viewsSubstitution of Oracle character
I have a field in my table with a string as follows: 80,82,45,80,82,79,88,73,77,79,32,65,32 I want to replace the comma (,) comma between single quotes (','), to stay:…
-
1
votes1
answer2093
viewsHow to format numbers directly by SQL
Gentlemen, my numbers are coming out without formatting when I perform the select directly at the bank, they are coming out as follows: REALIZADO META 61274436,2090003 80000000,00 How can I make…
-
1
votes1
answer68
viewsSQL Server Doubt 2012 - Query
I am having a hard time. In the consultation below, you are bringing in this way. Tarefa_Inclusao Tarefa 167909 167920 SELECT TarIDInclusao [Tarefa_Inclusao],tarid [Tarefa] FROM Tarefa WHERE TarID =…
-
1
votes2
answers1447
viewsWhy do I need WAMP (example) for Mysql to work?
When I started studying programming with database access, I had to install software like Mysql and WAMP. I know what WAMP is about, I know it’s a package of tools needed when programming, but I…
-
1
votes0
answers30
viewsBD Mysql Sync
Good morning, About Mysql data synchronization where you have the Master server and the Slave server, I would like to know if it is possible for me to have several master for a single slave, where…
-
1
votes0
answers59
viewsProblem with $_POST
Well I’m learning to program php and I have a lot of difficulties in making the junction of it with other language, right now I’m doing a job and I have a problem: When I click on one div the image…
-
1
votes1
answer223
viewsDatabase Structure - Php and Mysql - Marketplace
good evening, I have a store system. A database in Mysql for all, I am re-structuring, however I am with a dilemma to solve. Customer registration! Because I have only one bank, I have only one…
-
1
votes3
answers203
viewsProblem to send PHP data to database
I’m starting with PHP and I’m having trouble sending to the database, unfortunately I can’t find the error, if anyone can help, grateful. The HTML is like this: <form method="post"…
-
1
votes0
answers344
viewsSend selected data in an External Json list to email (Fipe Table Query)
$(document).ready(function() { var urlBase = "http://fipeapi.appspot.com/api/1/carros/"; $.getJSON(urlBase + "marcas.json", function(data) { var items = ["<option value=\"\">ESCOLHA UMA…
-
1
votes0
answers103
viewsHow to name constraints in Mysql?
I’m trying to name constraints in the MySQL but unsuccessfully, I’m doing it this way: create table if not exists pessoas ( id int auto_increment, nome varchar(30) not null, data_nascimento date,…
-
1
votes2
answers275
viewsForeign key FK, is each identification number on a table?
Example: - CLIENTE(Num_cliente, Nome_cliente, Cidade) - PEDIDO(Num_pedido, Data_pedido, Num_cliente, Preco_total) - ITEM_PEDIDO(Num_pedido, Num_item, Quantidade) - ITEM(Num_item, Preco_unitario) -…
-
1
votes1
answer98
viewsConsult the names of the pilots sponsored by a Team
I want to consult pilots sponsored by the 'A' team' I’m doing like this: SELECT piloto.nome AS NomePiloto FROM equipe INNER JOIN piloto ON equipe.idequipe = piloto.idequipe INNER JOIN patrocinador…
-
1
votes1
answer106
viewsHow to convert JSON to XML in ORACLE 11g?
Good afternoon, I have a problem at work. Need to create a Function in oracle that performs the conversion of json to xml and show the result as table. I know version 12 of oracle does this easily,…
-
1
votes1
answer177
viewsselect part of the JSON that was filtered in Where
In the database I have a field called resources, in it I save the permissions of a user, in Json format: [ { "rota":"reserva", "sref":"oQueFazer", "ordem":"1", "recursos":[ "index", "show", "store",…
-
1
votes1
answer624
views -
1
votes1
answer70
viewsAdd table B row to table A based on conditions
I have two tables of data, being them: table A and table B. I want to join the rows of table B with A under the following conditions: If a line occurs in B and not in A, add it to A. If a line…
-
1
votes1
answer75
viewsReturn database data in table
Good morning, my people. I’m starting in PHP and I did this function below in order to return the data of two tables of my database in a table, I just can not make it work in any way. Can someone…
-
1
votes3
answers951
viewsTable normalization for 2nd Normal Form
A relation is in 2FN if and only if it is in 1FN and not contains partial dependencies. From this definition I am normalizing a BD to 2FN. This BD has 2 tables, which illustrates the figure with…
-
1
votes1
answer724
viewsExample and illustration about redundant relationships (MER)
Context Consider the sentence below: It is claimed: Relationships that are the result of a combination of other relationships between the same entities are called: redundant relationships Doubt…
-
1
votes0
answers36
viewsForeign key transaction in C# and Entity-
Guys, in my application I have the Context class that has the Dbset of Shopping and Dbset of Products. It turns out that in my BD table, Shopping has a FK that picks up the Product ID in the column…
-
1
votes1
answer44
viewsSelect a list of values and from that list, select the lowest value
I want to select the last 10 inserts of a table and among these 10, return the lowest value. It is possible to do this in a single query? Selecting the last 10 values: SELECT id_relevo FROM relevo…
-
1
votes0
answers820
viewsWhat is the significance of Overhead in physical database design?
I just read about physical design and database adjustment and could not understand the concept of overhead, and consequently could not understand what the author of the book wanted to explain. I…
-
1
votes2
answers291
viewsHow to post date and time using datatime type in sql
PHP: $date = new DateTime(); print_r ($date); outworking: DateTime Object ( [date] => 2017-11-07 15:51:26.000000 [timezone_type] => 3 [timezone] => America/Sao_Paulo ) OK so far. Database…
-
1
votes1
answer31
viewsSQL Filter to not display some items from a table
Good morning! All right? On the website I’m working on, it displays a list of countries that come from the database. However, there was a requirement that the countries sanctioned by OFAC. It calls…
-
1
votes3
answers134
viewsI’m having trouble summing up the column
I want to sum up the column Value, I know that to use SUM() I also have to use GROUP BY, only I’m not able to make the sum. I don’t know which fields I have to put on GROUP BY. SELECT DISTINCT…
-
1
votes0
answers341
viewsSelect in Millions of SQL Server Records
Good morning, I have a database with more than 11 million records, when I make a select on top of the two tables to bring the records the query takes a lot, I wonder how I could improve these…
-
1
votes2
answers1722
viewsSelect and delete duplicate records by last update date?
Among the fields in the table there is the name field, the dt_add field which is the date that the record was inserted and dt_update which is the date of the last update of the record. I would like…
-
1
votes0
answers430
viewsIndentation and line breaking in sql data for html
In short, I created a table with type text in sql so that the user can save some content. However when pulling it back into HTML the formatting is lost. To remedy this I thought of using the tag…
-
1
votes1
answer70
viewsIs Data Warehouse Transaction Oriented or Query Oriented?
Context of the Problem Reading on the subject Data Warehouse, I have drawn some distinct conclusions about what the text book says. Note what the author explains regarding transaction-oriented DW: I…
databaseasked 7 years ago Jonathas B. C. 883 -
1
votes1
answer4666
viewsHTTP (Post) Bad Request 400 - How to resolve?
I am making a pole, but my server is not emitting an error(400). Below follows the server code. const express = require('express'); const app = express(); const bodyParser = require('body-parser');…
-
1
votes1
answer35
viewsError in SQL query
Hello I have a table in the database that in it are stored several times. I am making a query only that this giving error. Consultation: select proximo from (select localizacao.horario as proximo…
-
1
votes1
answer169
viewsHow to insert values into a select when inserting them into the bank
I need to enter data into the database, I’m taking data from an old database, I had some attributes that have a certain value, I created these attributes on the site so I can receive the data…
-
1
votes1
answer114
viewsError trying to insert data into Mysql database
I’m trying to input a promotion into the database Mysql through a Web Service REST in Java, but when trying to insert me returns the following error: Grave: ERRO ao Inserir Promocao -…
-
1
votes2
answers715
viewsWith limit Select output on Oracle
I’m making a bank select and it’s returning me 15 lines. I used ROWNUM to pick up the first 8 lines, only I want to do another select and pick up from line 9 to 15. SELECT * FROM (SELECT DISTINCT…
-
1
votes0
answers29
viewsExport BD content to a WORD table
Well, I was doing a job and I came across this situation: I need to export certain content to Word, but this content must be in a table of the same. How could I do a While to create the Rows and…
-
1
votes0
answers49
viewsMysql Procedure query error
Because only the stmt2 doesn’t work? DELIMITER $$ CREATE PROCEDURE abc_produtos_total_geral( OUT v_total_geral decimal(14,2), IN v_dt_inicial date, IN v_dt_final date, IN v_table_name varchar(40),…
-
1
votes0
answers515
viewsShow View output in PHP
Good night, I need to show the result of a view I created in Postgres, but I get no return. View in Postrgres: CREATE VIEW VW_RELATORIO03 AS SELECT EXTRACT (MONTH FROM DATSOLPED) AS MES, COUNT(*) AS…
-
1
votes1
answer1955
viewsRoll-Up or Drill-Down, which has the most Detail in Data Warehouse?
Context Studying on data Warehouse(DW) I came across the content regarding the types of OLAP servers and the types of operations that can be done, within this context I was confused regarding the…
databaseasked 7 years ago Jonathas B. C. 883 -
1
votes2
answers230
viewsQuery returns "Invalid column name 'result'. " where 'result' is a column generated by select (SQL SERVER)
SELECT cte, (CONVERT(VARCHAR, manifesto) + ' ' + TIPO) as result FROM coleta WHERE result = '567 TRUCK SIDER'
-
1
votes1
answer218
viewsSearch mysql by record creation date
I want to do a mysql search by date of creation of all records, IE, I want to show the record and the date it was registered. I’ve researched but what it always shows is the between but that’s not…
-
1
votes2
answers275
viewsHow to access the database directly from my model class in an ASP.NET Core project?
In ASP.NET Core Mvc I can access Dbcontext in the Controller through the property _context represented by my class MvcNotaContext see: private readonly MvcNotaContext _context; This way I can…
-
1
votes1
answer132
viewsHow to relate tables
Good afternoon. I have three tables: tbl_students, tbl_financial responsibility, tbl_responsavel_pedagogico. The idea is that a student has a financial manager and a teacher. But there are three…
-
1
votes2
answers42
viewsForeign SQL key
I have two tables in SQL and I need to perform a search. The tables and fields are: Employees: code and employee name Team: 'codigoEquipe' and 'functionRegistered', where 'functionRegistered' is…
-
1
votes2
answers48
viewsI’m having trouble creating a database and relating 3 tables
I’m having difficulty creating a database and relating 3 tables : return the name and surname of the customer, his neighborhood, and the values of his movements,the date ordering the movements for…
-
1
votes1
answer142
viewsInsert in Mariadb giving timeout
What are the reasons that the simple Insert described below would take so long that it even gives timeout on the server? INSERT INTO wkvmk_postmeta (post_id, meta_key, meta_value) VALUES(904,…
-
1
votes1
answer242
viewsError at agupar Mysql subquery
I have a select to display 4 fields, but a field that is the valor_pago is from another table, but I cannot use JOIN otherwise the return of the records conflicts So I created a Subquery but my…
-
1
votes1
answer72
viewsSELECT in auto-relational table
I have a table funcionario, with attributes: ID(PK) and IDCHEFE (FK from the table itself). Each employee(a) has one idchefe which refers to another official (who is his boss(a)). How to make a…
-
1
votes1
answer212
viewsOptimize module 10 SQL Server
I have a database created by apróx. a decade, this same bank has several records and obviously, by being in production, can not be changed from day to night. The problem is: The products registered…
-
1
votes1
answer1898
viewsDifference and use between Primary Key and Foreign Key
I did a database modeling relating some tables and at the end of everything I was told that I was wrong for not having PK and FK keys. The question is, how do I differentiate a Primary Key from a…