SQL  interday_tick_qry1.sql

Appendix A: SQL Scripts for Sample Queries

Interday queries

Interday queries reflect price quotes and trade prices during multiple trading days. These queries examine both the tick data of the current day plus historical data and can provide an alert for changes to statistical models during the course of the trading day.

The Interday queries are optimized to run with the Risk Analytics Platform sample data in the RAP repository.

NoteThe Interday queries for the RAP repository all begin with a commit statement. This commit statement causes the data to refresh, so the query accesses the most recent data. When you write your own queries for the RAP repository, be sure to precede the query with a commit statement.

Script name

Description

interday_tick_qry1.sql

Determine the volume weighted price of a security considering only the ticks in a specified three day interval.

interday_tick_qry2.sql

Determine the top 10 percentage losers for the specified date on the specified exchanges sorted by percentage loss. The loss is calculated as a percentage of the last trade price of the previous day.

interday_tick_qry3.sql

Find the most active stocks in the “COMPUTER” industry for last three days.





Copyright © 2005. Sybase Inc. All rights reserved. interday_tick_qry1.sql

View this book as PDF