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
answers33
viewsSystem using Java and Mysql Database does not recognize user and login even while in the database
I am making a Java Services Order System in Netbeans based in this course. I created the database in Mysql Workworkbench, created the user table, connected to the server in XAMP and made the…
-
0
votes1
answer51
viewsSet age from date of birth in another table
I’m trying to create a Trigger to set the table age attribute funcionario: ```sql CREATE TABLE IF NOT EXISTS `funcionario`( `cpf_funcionario` INT(11) NOT NULL, `idade` SMALLINT(10) DEFAULT NULL,…
-
0
votes0
answers35
viewsReturn names that have no registered workshop
Good afternoon, I would like a help to return names that do not contain the workshop'2' in the registered case. The way I rode, it brings me different from (''), I need that besides different, bring…
-
0
votes0
answers20
viewsManipulating data and dates in oracle
I am developing a report with a view with Oracle database, and I need to make a function where the output value will be the running days since the last product drive, ie basically present day less…
-
0
votes1
answer39
viewsError while running migrate
Schema::create('filiais', function (Blueprint $table) { $table->id(); $table->string('filial', 30); $table->timestamps(); }); Schema::create('produto_filiais', function (Blueprint $table) {…
-
0
votes0
answers13
viewsError when synchronizing data from local database implemented with watermelonDB in APP React-Native
I was recently developing an app that simulated car rental. In one of the steps of the app, I should implement a local database that every time the user was online, it would take the API data and…
-
0
votes2
answers37
viewsHow can I apply increase and percentage reduction over unit value
The script below calculates the consumption value for materials and medicines , grouping by patient. select coalesce( sum ( ( (L.QTDE) - coalesce( sum( ( select sum(QTDE) from GECADDEV CD inner join…
-
0
votes0
answers13
viewsHelp with UPDATE considering foreign keys in MYSQL
Hello, good afternoon. I’m trying to make a data change on a table that needs to work as follows: I need to write a Query that UPDATE table 1, with the ID of table 2, but first, make sure to only do…
-
0
votes2
answers40
viewsConsultation with Count
I have the following table : Product status SELECT id_produto_status_history, status, description, create_date, id_produto FROM produto_status_history; where I store product history status There is…
-
0
votes0
answers13
viewsWhy does the sequelize id auto-increment even without adding the data?
Hello, I have a table that has[id, user, password, level] following these settings: id: { type:sequelize.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false }, user: { type:…
-
0
votes0
answers17
viewsSQL - Using COUNT doubt
Hello, I have the following question: Select the id and the total number of rentals (rental) of the ((a) client (Customer) that made the largest number of rentals. (tip: use COUNT, MAX, nested…
-
0
votes1
answer37
viewsHow to use SUM in a multi-return code?
I did it in a code where it makes a sum of data entered in the months, but I don’t know how to make the AS become a array. The Code I made: DECLARE @I INT = 1; WHILE @I < 12 BEGIN SELECT…
-
0
votes0
answers23
viewsQuery mysql UPDATE is doing the INSERT function
I created a function to modify the data of a DB regarding a particular product: public function editarProjeto(int $id, int $categoriaID, string $titulo, string $ano, string $descricao, string…
-
0
votes1
answer34
viewsAdd Count to a query
Good morning, I’m trying to sum up a Count in a query that returns three columns in the oracle the total diet column being the event count for that group! NM_DIETA TOTAL_DIETA DS_SETOR Extra: fruit…
-
0
votes0
answers12
viewsOracle XE 18c database size limitation
According to official documentation from Oracle available in https://www.oracle.com/br/database/technologies/appdev/xe/faq.html has the limitations: What are the resource limits of Oracle Database…
-
0
votes0
answers28
viewsTrigger with mutant error even using Pragma Autonomous_transaction;
I’m a beginner and I’m having trouble solving a simple problem: I created Trigger below: AFTER INSERT OR UPDATE ON CARRO FOR EACH ROW DECLARE Pragma Autonomous_Transaction; V_REFERENCIA INT; BEGIN…
-
-1
votes1
answer146
viewsError while collecting database information
I’m having a problem getting information from a database, the code I tried was this: require_once "config.php"; // database $sql = mysql_query("SELECT conteudo FROM home NULL NULL NULL") or…
-
-1
votes1
answer1823
viewsBinding Tables with Code Igniter
I have the following problem, I have a table of customers that stores personal data, login, password among others, and another table of invoices, which has all invoices of all customers, but I need…
-
-1
votes3
answers4045
viewsDBMS to Sqlite
Can anyone recommend me a good SGBD Sqlite as I am using the sqlitebrowser to manage the databases of my Android applications, but I can’t do almost anything on it.
-
-1
votes1
answer625
viewsProblems filtering field with LIKE in Mysql
I have a table that has more than 1 million data that I want to filter through an acronym that can be anywhere in the String field. It has BTREE index in Mysql. I’m doing it this way: select…
-
-1
votes3
answers8261
viewsHow to recover the ID of the last record inserted in the bank?
How do I recover the id of the last record made in a table in the database? I’m using Laravel. Before using a framework I used LASTINSERT.
-
-1
votes1
answer228
viewsHow can I put submenu inside a menu from a database
I have the tables in the database well done, but then when I do the code, the content doesn’t even appear, I wish I had help sff the code I have is this: $resultado = mysql_query("SELECT titulo FROM…
-
-1
votes1
answer767
viewsUpdate Android Database
I’m creating a database on Android that has a column called status where is saving (0 or 1) 0 for when you are without internet and 1 for when you have internet, I want to do the update from the…
-
-1
votes2
answers167
viewsIs there incompatibility and errors between Internet explorer and Postgresql?
In my work we use Postgresql version 9.0 as a database for several systems. Some customers inform us that sometimes they cannot find certain search data using Internet Explorer 9, 10 and 11. I as a…
-
-1
votes1
answer1577
viewsCheck if information already exists in the database
Good people try to help me out here Html part <form method="post" id="formulario" action="dados.php"> <p><label>Nome</label><input type="text" class="nome" name="nome"…
-
-1
votes1
answer475
viewsAndroid - What data technologies, SQL? , noSQL? , local database + server database?
What good practices are used for the provision, storage, data flow, in an application Android? For example, the app Easytaxi, iFood, among others: What is the need/advantage of a local database…
-
-1
votes1
answer187
viewsWhat’s worse a "Where" or "Join"? Which is more expensive?
What’s worse a where or join? Which is more expensive?
-
-1
votes1
answer40
viewsALTER TO - SQL SERVER
in my Bank I have 2 stored procedures ,dbo. A and dbo. B . in the database. A there are the parameters @name , @street in the process dbo. B there are the parameters @cep , @phone however I also…
-
-1
votes1
answer78
viewsmysql_query() does not execute
I am trying to test if my database has connected correctly from a query, but apparently mysql_query() does not execute and changes my table. This is my code: <?php //conecta a base de dados $dbc…
-
-1
votes1
answer638
views -
-1
votes2
answers241
viewsPHP - SQL: show the user’s email from the database
Guys, here’s the deal: Made the user registration on the site, it saves in the database (obvious). This is the code of the connection to the database (this is correct?): <?php echo $sql= "select…
-
-1
votes1
answer1899
viewsCall Procedure inside another
I need to create a precedent enviar_email_servidores call in another pr_envia_email. The term to be called (pr_envia_email) has the function of sending email, and I need the message sent to this…
-
-1
votes2
answers46
viewsError using Inner Join in MYSQL
I’m using the INNER JOIN mysql to merge and display data. Tables and data insertion: CREATE TABLE EXPERIENCIA( exp_pri INT NOT NULL AUTO_INCREMENT, experiencia VARCHAR(100), PRIMARY KEY(exp_pri) );…
-
-1
votes1
answer392
views -
-1
votes2
answers524
viewsHow to remove the decimal separator from a result?
In the sql query I have a total order value multiplied by 1000: Total value: 195.41 Value Viewed: 195410.00 How could I remove the separator? SELECT CAST(CONVERT(varchar, CAST(195410.00 AS money),…
-
-1
votes1
answer19
viewsReturn of values from a column of table X that has 1 code in common
I need to solve a big problem. I have a table of answers of a poll where the answers made with checkboxes are in different lines with a common code, that of the answered question, example:…
-
-1
votes2
answers79
viewsWhen giving the result of a query, this inserting only the first line
I am bringing a query from one bank and I will insert in another,this running the question and that is only inserting the first line and not all the results,see my script below: <?php…
-
-1
votes1
answer82
viewsQuery with a specified date - PHP
Hello, I have an order query, where I just wanted to show the orders of the current day and also the orders of the next day, where the orders of the next day would only appear those that would have…
-
-1
votes1
answer55
viewsProblem with Database Connection
Could you help me figure out why you’re making this mistake? Code: using (_connection = new MySqlConnection("Database=test;Data Source=localhost;User Id=root;Password=teste;SslMode=None;")) {…
-
-1
votes1
answer3120
viewsSQL database structure of a library
I need to write and populate a Mysql database relative to the control of a library. This involves: 3 tables: | publisher | book | author | The 'publisher' table must have: id, name, city, state,…
-
-1
votes1
answer2632
viewsHow to resolve "Can’t connect to Mysql server on" error?
Error: Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'mysql.hostinger.com.br' (111 "Connection refused") in /home/u307075603/public_html/db.php on line 8 this error I…
-
-1
votes1
answer33
viewsSql calculates date instead of inserting
I’m trying to insert date in my BD but sql calculates the result is always 1997 in the fields I tested as "date" and did not insert "varchar e text" resulted in a subtraction calculation of the…
-
-1
votes1
answer362
viewsUsing subselect in oracle. Why is the error occurring?
I’m trying to use this code below, but the oracle returns me the following error: ORA-00907: right parenthesis not found 00907. 00000 - "Missing right parenthesis" *Cause: *Action: Line error: 30…
-
-1
votes2
answers3555
viewsDelete record by ID in PHP
Good night, you guys! I’m having a GIANT difficulty to delete a BD line by PHP, I imagined the following by the code below: the $line would receive the array with all the BD records,and from it…
-
-1
votes1
answer30
viewsDelete period without tag Between
Good afternoon, Is there any way to delete a period without using the BETWEEN? x NOT BETWEEN HorFim AND HorIni and y NOT BETWEEN HorFim AND HorIni Where: x = hora inicial digita pelo usuario. y =…
-
-1
votes1
answer531
viewsAndroid Application and Mysql Database
I have an application developed on Android and need to connect to a Mysql database that is local on a Desktop. I can easily get the IP address of the machine where the bank is. How can I connect the…
-
-1
votes1
answer74
viewsDoubt about alternative to decrease code size and make fewer queries
I have a question regarding a certain part of a system that I am developing. The system is for management of a higher education institution and has a page that is to administer the courses of the…
-
-1
votes3
answers103
viewsUse BETWEEN together with IN()
I would like to compare several dates within a range of dates. I tried to perform the query below but I cannot find a proper logic. Consultation with Array + BETWEEN in Mysql, or rather use the IN()…
-
-1
votes2
answers53
viewsDelete data from Database
I am working with a database that has 2 tables, processes and processes, need to delete a data from the processes table, but the ID field of the process table is a foreing key in the processes…
-
-1
votes1
answer273
viewsCannot add Foreign key Constraint! but syntax and pks are correct
I’m trying to create a FK for a table, I don’t understand syntax error, but the TOAD returns the message that cannot create FK. Tables are created in the database, and Pks are right. ALTER TABLE…