Have you any member who have good command in sql query?

|
MasterZiv 2020-02-27 17:20:20
madno 2020-02-27 17:09:03
Ok I’ll send again

Probably this field is extra in the GROUP BY : t4.s17

2020-02-27 19:09:27
any one online here?
2020-02-27 19:09:43
i need your help
2020-02-27 19:16:27
have you any member who have good command in sql query???
smlkw 2020-02-27 19:22:06
2020-02-27 19:16:27
have you any member who have good command in sql query???

Please, ask the question

2020-02-27 19:28:09
solve the query 3, 4 and 5.
smlkw 2020-02-27 19:53:32
2020-02-27 19:28:09
solve the query 3, 4 and 5.

It’s a wrong place for such questions, really

2020-02-27 19:58:35
i need the solution bro
2020-02-27 19:58:44
thats why i sended
smlkw 2020-02-27 20:02:55
2020-02-27 19:58:35
i need the solution bro

We don’t do homeworks here.

smlkw 2020-02-27 20:04:16
The cat says right words
sandy9483 2020-02-27 20:39:13
Hi I have a query, I have used distinct in my select query ,for the same select I want to get the count,but I am getting count mismatch
sandy9483 2020-02-27 20:39:26
Pls help
ICUI4CUtwo 2020-02-28 08:37:29
sandy9483 2020-02-27 20:39:13
Hi I have a query, I have used distinct in my select query ,for the same select I want to get the count,but I am getting count mismatch

send me the query

Chetan V 2020-02-28 08:59:44
How to create users script in mysql with permissions
ICUI4CUtwo 2020-02-28 10:13:20
Chetan V 2020-02-28 08:59:44
How to create users script in mysql with permissions

what u meaan

Joshua Serry 2020-02-29 03:54:44
hi all – i’m having trouble with the logic for inserting data into two tables relating to stock prices. Table 1 symbol Table 2 price.

Table 1 has auto increment ID for symbol. Where I have trouble is inserting the prices into the second table. – Do you need to query the symbol table first to find the ID then..
insert into prices ‘1’,’$10′

Thanks

MasterZiv 2020-02-29 08:36:21
appreciate the english speaking group though this one has far more members. since sql is language agnostic would anyone be able to point in the right direction in terms of structure of the Symbol and Price tables for stock data.
MasterZiv 2020-02-29 08:49:49
Joshua Serry 2020-02-29 03:54:44
hi all – i’m having trouble with the logic for inserting data into two tables relating to stock prices. Table 1 symbol Table 2 price.

Table 1 has auto increment ID for symbol. Where I have trouble is inserting the prices into the second table. – Do you need to query the symbol table first to find the ID then..
insert into prices ‘1’,’$10′

Thanks

No you don’t need to query the first table.
There are two ways to get auto generated ids

— pseudo function mysql_insert_id()

— in the latest versions of myself, RETURNING clause of INSERT statement

Here is an article discussing this problem

https://dev.mysql.com/doc/refman/8.0/en/getting-unique-id.html

Joshua Serry 2020-02-29 10:06:15
MasterZiv 2020-02-29 08:49:49
No you don’t need to query the first table.
There are two ways to get auto generated ids

— pseudo function mysql_insert_id()

— in the latest versions of myself, RETURNING clause of INSERT statement

Here is an article discussing this problem

https://dev.mysql.com/doc/refman/8.0/en/getting-unique-id.html

Thanks! I look forward to reading that over dinner

Joshua Serry 2020-02-29 12:59:27
MasterZiv 2020-02-29 08:49:49
No you don’t need to query the first table.
There are two ways to get auto generated ids

— pseudo function mysql_insert_id()

— in the latest versions of myself, RETURNING clause of INSERT statement

Here is an article discussing this problem

https://dev.mysql.com/doc/refman/8.0/en/getting-unique-id.html

Thanks. After reading this… Does this mean that if you have one table Company with auto increment ID and another table which uses the the company_id as a primary key you should;

Insert one record into company table, then get the unique-id, then insert relevant rows into the prices table. Repeating sequentially for each company?

Fierceblood 2020-03-01 15:16:47
Hey guys,
I have doubt
“Write a query to input values and returning the records corresponding to those values from the table”
MasterZiv 2020-03-02 00:04:10
Joshua Serry 2020-02-29 12:59:27
Thanks. After reading this… Does this mean that if you have one table Company with auto increment ID and another table which uses the the company_id as a primary key you should;

Insert one record into company table, then get the unique-id, then insert relevant rows into the prices table. Repeating sequentially for each company?

Yes, kind of so

MasterZiv 2020-03-02 00:04:44
Fierceblood 2020-03-01 15:16:47
Hey guys,
I have doubt
“Write a query to input values and returning the records corresponding to those values from the table”

What is your doubt?

Joshua Serry 2020-03-02 00:19:45
MasterZiv 2020-03-02 00:04:10
Yes, kind of so

Either that or you know what the order of the data in both tables should be along with the values of the primary and foreign keys and write out the whole SQL script before hand.

Other than those two is there a third option? …because you said “kind of”and not “yes”. Thanks in advance.

MasterZiv 2020-03-02 00:30:29
Joshua Serry 2020-03-02 00:19:45
Either that or you know what the order of the data in both tables should be along with the values of the primary and foreign keys and write out the whole SQL script before hand.

Other than those two is there a third option? …because you said “kind of”and not “yes”. Thanks in advance.

Why is the order important?

MasterZiv 2020-03-02 00:32:21
Joshua Serry 2020-03-02 00:19:45
Either that or you know what the order of the data in both tables should be along with the values of the primary and foreign keys and write out the whole SQL script before hand.

Other than those two is there a third option? …because you said “kind of”and not “yes”. Thanks in advance.

It was strict “yes”, sorry.
I added “kind of” because this is supposed to be your application and you in theory can do it like you want

MasterZiv 2020-03-02 00:33:34
MasterZiv 2020-03-02 00:32:21
It was strict “yes”, sorry.
I added “kind of” because this is supposed to be your application and you in theory can do it like you want

There are other possible ways of creation of master/details records, this is the most common

Joshua Serry 2020-03-02 00:34:21
The order of the inserts is important if using the auto increment unique I’d to make sure you align the company id to the right price records.

If you know the IDs ahead of time the order of insert statements is not important, just the matching company id values.

Joshua Serry 2020-03-02 00:35:03
MasterZiv 2020-03-02 00:33:34
There are other possible ways of creation of master/details records, this is the most common

Can you describe what are some of the other ways…

MasterZiv 2020-03-02 00:37:58
Joshua Serry 2020-03-02 00:34:21
The order of the inserts is important if using the auto increment unique I’d to make sure you align the company id to the right price records.

If you know the IDs ahead of time the order of insert statements is not important, just the matching company id values.

Your application should not bother about concrete values of auto generated primary keys, it should not matter for the application what particular value is assigned for what company and in what order they are created

Joshua Serry 2020-03-02 00:42:06
I guess the actual key value and the order don’t matter what’s important and why I’m interested in other ways as well is to: make sure that the pk and fk in the two tables align.
MasterZiv 2020-03-02 00:42:27
Joshua Serry 2020-03-02 00:35:03
Can you describe what are some of the other ways…

The main what I meant was loading pre-defined data , not using generation of IDs by the database

Joshua Serry 2020-03-02 00:49:08
So far my method relies on knowing which record relates to which in advance and writing insert statements. Having predefined data is not always possible.

And yours inserts one record into the company table, then relevant records into the price table. And repeats this for each company record.

But I prefer your method to load predefined data.

MasterZiv 2020-03-02 00:50:55
Joshua Serry 2020-03-02 00:49:08
So far my method relies on knowing which record relates to which in advance and writing insert statements. Having predefined data is not always possible.

And yours inserts one record into the company table, then relevant records into the price table. And repeats this for each company record.

But I prefer your method to load predefined data.

It is just sequential processing, that is all

MasterZiv 2020-03-02 00:54:29
Joshua Serry 2020-03-02 00:49:08
So far my method relies on knowing which record relates to which in advance and writing insert statements. Having predefined data is not always possible.

And yours inserts one record into the company table, then relevant records into the price table. And repeats this for each company record.

But I prefer your method to load predefined data.

Pre-defined data means you already have all IDs and you don’t need Id generation from the DB

Joshua Serry 2020-03-02 00:56:25
I see so option 1. For auto_id is ore defined data and option 2 is sequential processing.
TheQuotidian 2020-03-02 04:39:36
_Is there any way other than using ‘text’ data type to bypass the 64KB row size limit?_
smlkw 2020-03-02 07:23:51
TheQuotidian 2020-03-02 04:39:36
_Is there any way other than using ‘text’ data type to bypass the 64KB row size limit?_

Longtext?

MasterZiv 2020-03-02 08:30:47
Joshua Serry 2020-03-02 00:56:25
I see so option 1. For auto_id is ore defined data and option 2 is sequential processing.

Tell us in details what is the problem you try to solve

TheQuotidian 2020-03-02 08:38:50
smlkw 2020-03-02 07:23:51
Longtext?

Text and longtext are philosophically same

Joshua Serry 2020-03-02 08:48:55
MasterZiv 2020-03-02 08:30:47
Tell us in details what is the problem you try to solve

I want to store in two tables some basic stock market data for the ASX (Australian market). 1. List of company names, code and industry and 2. Daily Price data for each of 2500 odd companies.

The problem I was trying to solve is structuring those tables and how to go about getting the data in.

I think pre defined data is ideal (from web scraping). Then the auto id sequential method is another way to solve for it.

After that I need to consider structure of tables to perform analysis of the stocks prices against various criteria.

In the end state I could query: show me all the stocks that met all the 10 criteria last week. Etc

piterden 2020-03-02 08:59:34
Joshua Serry 2020-03-02 08:48:55
I want to store in two tables some basic stock market data for the ASX (Australian market). 1. List of company names, code and industry and 2. Daily Price data for each of 2500 odd companies.

The problem I was trying to solve is structuring those tables and how to go about getting the data in.

I think pre defined data is ideal (from web scraping). Then the auto id sequential method is another way to solve for it.

After that I need to consider structure of tables to perform analysis of the stocks prices against various criteria.

In the end state I could query: show me all the stocks that met all the 10 criteria last week. Etc

How many prices could be related to one company?

piterden 2020-03-02 09:02:34
Or do you mean prices for each day?
Joshua Serry 2020-03-02 09:02:45
1x365x20 approx 7500 times Open, High Low Close adj close volume. Standard stock tick data
Joshua Serry 2020-03-02 09:03:02
Yes I mean a price for each day for each stock.
piterden 2020-03-02 09:03:32
Stock?
piterden 2020-03-02 09:03:48
Company?
piterden 2020-03-02 09:04:13
Joshua Serry 2020-03-02 09:03:02
Yes I mean a price for each day for each stock.

What do you mean stock?

piterden 2020-03-02 09:05:30
What problems with DB did you have?
|