Questions tagged as 'sql'

1
answer

Problem reading database words with accent or cedilla

I'm reading my table database categories and when I have words with cedilla or accents, they appear in my project with strange characters. For example, in the categories I have a Ratings title, in my project this title appears as: AVALIA...
asked by 07.06.2014 / 20:58
1
answer

Using hexadecimal as ID in the database

From the navigation bar, we notice that Google uses hexadecimal values to identify records:    print above has been removed from GMail, but the same is true for other services like Google Drive. What is the advantage of using hex...
asked by 08.07.2014 / 17:56
2
answers

Firebird SQL auto-increment

I'm doing a SQL / Modeling course in mysql the creation of a composite table would look like this: USE banco; CREATE TABLE clientes( cli_id integer not null auto_increment, cli_nome varchar(20) not null, cli_email varchar(30) not null...
asked by 21.11.2014 / 16:54
2
answers

Doubt about using the inner join

I have 4 tables in my database Tabela Cadastro - idCadastro(PK) - IP Tabela Porta - idPorta(PK) - numero porta - idSwitch(FK) Tabela Porta_has_Cadastro - idCadastro(FK) - idPorta(PK) //Observação: Relaçao...
asked by 23.10.2015 / 13:51
1
answer

Select brings different results

I'm having a problem with a SELECT: SELECT * FROM documento WHERE idAdministrador = '1' AND modulo = 'funcionario' OR modulo = 'atestado' I need to know if the module is an OR certificate, which does the correct search ... However, it does...
asked by 24.09.2015 / 14:06
4
answers

Get the highest value by category by also loading the ID

The table is in the format below ID | CATEGORIA | QUANTIDADE 1 | A | 23 2 | A | 12 3 | A | 11 1 | B | 15 2 | B | 10 I want a query to return the following table ID | CATEGORIA | QUANTIDAD...
asked by 21.10.2015 / 23:10
1
answer

How to calculate the age of a person in Oracle SQL?

I need an sql command that returns the person's age. I have the date of birth of the person in the bank, I need to calculate their age by SQL.     
asked by 12.06.2017 / 19:59
3
answers

Doubts about the count sql command

When I write the command select count(carga > 40) from cursos; what is the count logic that the count command is running? This command worked in mysql however it returned me a result that I could not identify the source. I co...
asked by 16.09.2018 / 03:25
1
answer

Select the first row of each group in MySQL

Suppose I have a table like this: item | group -------+-------- item a | group x item b | group y item c | group y item d | group x item e | group z And I want to select a single item to represent each group. Now, you should be thinkin...
asked by 27.08.2018 / 04:03
2
answers

Returning a case sensitive record

I have a constraint in the bank that is all with its capitalized name. How do I count find it using UPPER ? Because I want to pass where a lowercase name to return. This my query is not working. select count(*) fr...
asked by 31.08.2017 / 20:17