Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishabht5 authored Jan 13, 2024
0 parents commit 3c0e434
Show file tree
Hide file tree
Showing 14 changed files with 5,747 additions and 0 deletions.
Binary file added SQL Query 1.xlsx
Binary file not shown.
Binary file added SQL Query 2.xlsx
Binary file not shown.
Binary file added SQL Query 3.xlsx
Binary file not shown.
Binary file added SQL Query 4.xlsx
Binary file not shown.
Binary file added SQL Query 6.xlsx
Binary file not shown.
Binary file added SQl Query 5.xlsx
Binary file not shown.
86 changes: 86 additions & 0 deletions SQl Querys for visualization.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
USE [TCS stocks]

SELECT *
FROM TCS_corrected

-- Add a new column DayName to store the day of the date column

ALTER TABLE TCS_corrected ADD DayName Varchar(20);

UPDATE TCS_corrected
SET DayName = DATENAME(DW, Date)

-- Add a new column Year to store the year of the date column

ALTER TABLE TCS_corrected ADD Year int

UPDATE TCS_corrected
SET Year = YEAR(Date)

SELECT *
FROM TCS_corrected

-- 1.) looking at the Average_price, Average_Change and Average_volume of the stock

SELECT
AVG([Price]) AS Average_Price,
AVG(TRY_CAST(Change AS decimal(5,2))) AS Average_Change,
AVG(cast(Volume as bigint)) as Averaage_volume
FROM
TCS_corrected

-- 2.) looking at the Average_price, Average_Change and Average_volume of the stock per year

SELECT
YEAR,
AVG([Price]) AS Average_Price,
AVG(TRY_CAST(Change AS decimal(5,2))) AS Average_Change,
AVG(cast(Volume as bigint)) as Averaage_volume
FROM
TCS_corrected
Group by
Year
Order By
Year

-- 3.) Looking at the price of the stock per date

SELECT
date,
price
from
TCS_corrected
order by
Price Desc

-- 4.) Looking at the Average_Open and Avegae_low price of the stock per year

Select year,
AVG([Open]) as Average_Open,
AVG(low) as Average_low
From
TCS_corrected
Group by
Year
Order by
Year


-- 5.) Looking at the high price and low price of the stock per date

SELECT Date,
High,
Low
FROM
TCS_corrected
order by
Date Desc

-- 6.) looking at the change of the stock per day in a week


SELECT DayName, SUM(TRY_CAST(Change AS decimal(5,2))) AS TotalChange
FROM
TCS_corrected
GROUP BY
DayName
Binary file added TCS Dashboard 1.twbx
Binary file not shown.
Binary file added TCS Dashboard 2.twbx
Binary file not shown.
Binary file added TCS Dashboard 3.twbx
Binary file not shown.
Binary file added TCS Dashboard 4.twbx
Binary file not shown.
Loading

0 comments on commit 3c0e434

Please sign in to comment.