Questions tagged as 'sql'

1
answer

Select with users who most sent messages

I'm making a system and I have to know which user sent the most messages. My tables look something like this: User id|nome|sobrenome|email| ... Messages id|uid|nome|email|assunto|msg| ... I just need to know which user sent more...
asked by 12.08.2017 / 21:56
1
answer

Delete database record [closed]

I'm trying to run the following line: $sqld = "delete FROM ata where convocatoria.nome_entidade='$ent' and convocatoria.cod_convocatoria=ata.cod_convocatoria"; mysql_query($sqld); I tried phpmyadmin directly and gave the following error...
asked by 12.04.2016 / 02:17
1
answer

Call procedure inside another

I need to create a procedure enviar_email_servidores that calls another pr_envia_email . The procedure to be called ( pr_envia_email ) has the function of sending e-mail, and I need the message sent to this email to be the...
asked by 14.04.2016 / 19:41
1
answer

How to have more than one value referring to another table?

Good people, I come with a doubt that has been chasing me for a long time. Let's go to what I have: I have the table X but values from the table X I get in the Y table . How to store more than one value in the Y table for X table...
asked by 31.03.2016 / 04:32
1
answer

Erase rows in multiple tables

I'm trying to delete information from 2 tables simultaneously that are linked to each other but I'm not getting it, give me this error: Anybody help me please?     
asked by 30.06.2016 / 20:44
1
answer

How to update table with foreign key

I have table discipline and teacher table. The teacher contains discipline. How do I change the name of the course and automatically change the tb teachers? I'm kind of confused about using On update cascade and delete Casdade .. It deletes a...
asked by 05.07.2016 / 20:24
1
answer

I am creating a school system, I want together a list of linked teachers and materials Bank (MySql)

I am creating a school system, I want to list a list of teachers linked to subjects and come and go. I use Mysql Bank Example: Professor 1 - Materia 1 Professor 1 - Materia 2 Professor 1 - Materia 3 Professor 2 - Materia 1 Professor 2 - Mat...
asked by 02.09.2017 / 20:21
1
answer

You can disable the primary key of a table

I wanted to know if it is possible to disable a primary key in a table. I will explain the reason for disabling the primary key. I have a table B that has a foregein for table A, plus I need to delete table A without having to delete the foregei...
asked by 07.12.2015 / 19:54
1
answer

Consultation with pause? [closed]

I'm doing a dynamic php menu where I would not use a query inside another, I'm currently looking at the CATEGORY table of the category name and inside it I'm searching in another table for the results that I have in the category field, in the CA...
asked by 03.01.2018 / 22:24
1
answer

Search by age in field of date of birth

Hello, I have a patient table and I need a query in which the user informs an age and returns the existing records. However I do not have the age field in the table but rather date of birth.     
asked by 11.05.2015 / 20:00