Questions tagged as 'sql'

2
answers

How to update only one column of the record?

I made a code to update some columns of my record when I need it. There are 7 columns listed in array , but generally I only update 1 or 2 columns. With this code I can update my registry, but I have to put data in all inputs , in ca...
asked by 21.11.2018 / 20:23
1
answer

Converting a SQL from Sql Server to LINQ from C #

I have an sql that looks something like this: SELECT coluna1, coluna2, coluna3 FROM ( SELECT coluna1, coluna2, coluna3, ROW_NUMBER() OVER(ORDER BY coluna1, coluna3 desc) as row FROM tabela1 WHERE coluna4 in ('a', 'b', 'c...
asked by 18.12.2014 / 14:41
1
answer

Recover Corrupted .gz file

I have a .gz file that is corrupted. Is it possible to extract the data from this file? Even if it's partially? This file is an sql database dump. Thanks.     
asked by 08.04.2014 / 21:56
1
answer

SQLite - count the primary keys that were not referenced as foreign keys

First, I am trying to count the primary keys of a table that were NOT referenced as foreign keys in another table. In addition, I want to filter the search by using the LIKE clause to display only those containing a certain letter of a give...
asked by 02.04.2014 / 22:30
3
answers

Is it worth putting two foreign keys in a table?

having the tables: Companies Customers company_id: foreign key Sales client_id: foreign key where the relations are: Companies and Clients = > 1: N Customers and Sales = > 1: N Considering that I will need to...
asked by 24.07.2018 / 22:28
1
answer

How to connect to SQLite database that already exists using PDO?

I want to connect to a database that already exists using PDO and sqlite in PHP, and here is the code I have: class Database extends PDO{ public function __construct(){ parent::__construct("sqlite: userquestion.db"); $th...
asked by 16.03.2015 / 02:42
3
answers

Compare 2 tables field by field

I have two tables with equal fields. Table A and B I need to compare the contents of the two tables field by field. I'm using the following code to find the records that have some different field, but I would like it to be shown in the record...
asked by 18.06.2018 / 19:17
1
answer

Search by date in mysql

Good evening, I have records in my table about phases of the moon 4089 Lua nova 1983-05-12 19:26:41 4090 Primeiro Trimestre 1983-05-19 14:18:16 4091 Lua cheia 1983-05-26 18:48:29 4092 Quarto Minguante...
asked by 24.10.2014 / 02:15
1
answer

How to update field in SQL table without blocking it?

I have a table with many records in production (almost 3 million), and I need to update a field with a very simple query: UPDATE tabela SET enviado = 1 WHERE enviado is null About 2.5 million will be upgraded. The problem is that it will...
asked by 06.06.2014 / 21:18
1
answer

Help! How does this select work?

Help me understand how this works please. It turns out that I'm starting the SQL studies and hackerhank has an exercise that needed this code: SELECT DISTINCT CITY FROM STATION WHERE REGEXP_LIKE(LOWER(CITY), '^[aeiou]') ; After a...
asked by 17.05.2018 / 16:02