Encerrado

Write SQL statement (1309128)

This project is to write a simple SQL statement.? The data (and database structure) for the SQL statement is in the attached. Basically, the SQL statement needs to return the signalid from the tradesignals database.? The only variable that is passed in from the outside is the acct_id filed.? It needs to have the following criteria: 1.? The lowest signalid needs to be found for a given account id where the cmd is less than 6 and the same signalid is not already inserted into the usersignalx table for the given account id and there is no associated signal (found by associating the signalid field in the first record with the assoc_signalid field in the second record) where the cmd in the second record is equal to 6 or 7.? 2.? The lowest signalid needs to be found where the cmd is 9 and the signalid is not already inserted into the usersignalx table for the given account id. 3.? The lowest signalid is found where the cmd = 6, 7, or 8 and there exists a corresponding record (linked by signalid = assoc_signalid) where the record for the assoc_signalid is in the usersignalx for the passed in acct_id.? However, if the there exists a cmd = 6 or 7 for the same assoc_signalid, the cmd = 6 or 7 should be returned (lowest of them first is fine). The lowest of 1, 2 and 3 should be returned in the statement, if possible. In other words - some of the tradesignals are records on their own, and some later ones are associated to an earlier signalid (based on the assoc_signalid).? The goal is to find the lowest standalone one (with a cmd of less than 6) that is not already recorded by the user (thus in the usersignalx) or find the > 6 < 9 signalid records that the user already recorded. The goal is to write efficient SQL, but if the SQL statements need to be broken up, then that is okay. Speed is important as well as utilizing the proper keys.? Make sure the database structure has the keys defined to optimize the SQL statement.

## Deliverables

1) Complete and fully-functional SQL code.

## Platform

Used MySQL, but any SQL-based server

Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: goal engineering, find the words and write, sql less than, php less than or equal to, write some sql for a project, structure engineering, Sql code, sql based, statement structure sql, php sql code, optimize server speed, write simple php database, sql optimize, mysql broken database, php code write, sql server linked server, simple sql statements, write code mysql, data data sql, standalone database, optimize sql server table, php mysql statement, mysql statement, project based sql, simple sql

Acerca do Empregador:
( 149 comentários ) Platte City, United States

ID do Projeto: #3019293

12 freelancers estão ofertando em média $48 para este trabalho

ngscoder

See private message.

$73.1 USD in 2 dias
(132 Comentários)
7.0
gkalish

See private message.

$63.75 USD in 2 dias
(244 Comentários)
6.3
electriccoder

See private message.

$42.5 USD in 2 dias
(30 Comentários)
5.6
dinamicsoftvw

See private message.

$22.1 USD in 2 dias
(31 Comentários)
4.9
vw7258315vw

See private message.

$59.5 USD in 2 dias
(48 Comentários)
4.7
code2success

See private message.

$51 USD in 2 dias
(19 Comentários)
4.4
kanhashriinc

See private message.

$85 USD in 2 dias
(9 Comentários)
2.9
mkhalidm

See private message.

$63.75 USD in 2 dias
(1 Comentário)
1.9
vw7425778vw

See private message.

$17 USD in 2 dias
(0 Comentários)
0.0
dmontgomery741

See private message.

$63.75 USD in 2 dias
(0 Comentários)
0.0
cengineers001

See private message.

$21.25 USD in 2 dias
(1 Comentário)
0.0
mctrials23

See private message.

$17 USD in 2 dias
(0 Comentários)
0.0