cancel
Showing results for 
Search instead for 
Did you mean: 

Fundamentals Capstone 1.3

CD7253
New Contributor II

Hello,

May someone explain whether I am on the right track for question 1.3.

My Answer:  uniqueOpts: select distinct option_id from trade

Have I completely missed the point of the question? 

1 ACCEPTED SOLUTION

megan_mcp
Community Manager Community Manager
Community Manager

Hi @CD7253,

Yes @kdbguru is correct you should use 'exec' instead of 'select' - however this is the syntax for the statement you need:

exec … from select … from …

exec keyword | Reference | kdb+ and q documentation - Kdb+ and q documentation (kx.com)

If you have any questions please let me know,

Megan 🙂

View solution in original post

6 REPLIES 6

kdbguru
New Contributor II
New Contributor II

Hi,

As the question asks to extract "symbol list" of all the unique options, you should use "exec" rather than "select". While "select" returns the result of a table type, "exec" for a single column would return a list of values.

  uniqueOpts: exec distinct option_id from trade

CD7253
New Contributor II

Hello @kdbguru, when I put in that code I get a message saying nyi: Not yet implemented.

I am unsure where I have gone wrong.

 

megan_mcp
Community Manager Community Manager
Community Manager

Hi @CD7253,

Yes @kdbguru is correct you should use 'exec' instead of 'select' - however this is the syntax for the statement you need:

exec … from select … from …

exec keyword | Reference | kdb+ and q documentation - Kdb+ and q documentation (kx.com)

If you have any questions please let me know,

Megan 🙂

kdbguru
New Contributor II
New Contributor II

If it is in-memory table, exec .... from ..... should work.

CD7253
New Contributor II

Hello Megan, 

I am somehow more confused, I get an answer but it appears to be wrong.

 

Is there a tutorial that you could recommend to me? I am very new to coding. 

Laura
Community Manager Community Manager
Community Manager

Hi @CD7253 ,

You can use "select from" to extract the column from the trade table on disk, and then use "exec from" to extract the data from that column as a list. 

To help you complete the capstone project you should first go through the course materials on KX Academy, specifically Fundamentals: qSQL queries will help with this question, or check out the link that Megan sent previously exec keyword | kdb+ and q documentation.

Hope this helps, 

Laura