-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript_one.sh
99 lines (91 loc) · 2.83 KB
/
script_one.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
clear
echo " FINANCIAL STATEMENT"
echo""
echo "Press 1 to see all records"
echo "Press 2 to see records of specific company"
echo "Press 3 to see all records on date between selected date"
echo "Press 4 to see records of of first week"
echo "Press 5 to see all name of the comapnies having highest position"
echo "Press 6 to see all name of all the companies having minimum postion"
echo "Press 7 to see closing statement of selected companies"
echo "press 8 to see all the opening status"
echo "Press 9 to see records of the company with highest opening"
echo "Press 10 to see names and max profit of a comapny"
echo "Press 11 to see all records for the comapnies with highest and lowest opening"
echo "press 12 to see name closing of company having max volume"
echo "Press 13 to see all records of the company having highest shares in the market"
echo "Press 14 to see records of ebay"
echo "Press X to GO TO MAIN MENU"
read var
case $var in
1) mysql -u"root" -p"root" "market" <<EOF
select * from record;
EOF
;;
2) echo "Enter the name of the company"
read com
mysql -u"root" -p"root" "market" <<EOF
select * from record where name="$com";
EOF
;;
3) echo "Enter the dates in two parts for analysis of data"
read date
read date1
mysql -u"root" -p"root" "market" <<EOF
select * from record where date between "$data" and "$date1";
EOF
;;
4) echo "Enter the month"
read mon
mysql -u"root" -p"root" "market" <<EOF
select * from record where date="Ebay";
EOF
;;
5) mysql -u"root" -p"root" "market" <<EOF
select name from record where open-close<2;
EOF
;;
6) mysql -u"root" -p"root" "market" <<EOF
select name from record where open-close>15;
EOF
;;
7) echo "Enter the name of the company"
read nam
mysql -u"root" -p"root" "market" <<EOF
select close from record where name="$nam";
EOF
;;
8) echo "Enter the month"
read mon
mysql -u"root" -p"root" "market" <<EOF
select open from record;
EOF
;;
9) mysql -u"root" -p"root" "market" <<EOF
select * from record where open>3000 ;
EOF
;;
10) mysql -u"root" -p"root" "market" <<EOF
select name,(select max(adjusted_close) from record where open>2000) AS "Adjust" from record;
EOF
;;
11)mysql -u"root" -p"root" "market" <<EOF
select * from record where open>2000 or close<1500;
EOF
;;
12)
mysql -u"root" -p"root" "market" <<EOF
select name, close,(select max(volume) from record) AS "Maxvol" from record;
EOF
;;
13)
mysql -u"root" -p"root" "market" <<EOF
select * from record;
EOF
;;
14) mysql -u"root" -p"root" "market" <<EOF
select name from record where open-close<2;
EOF
;;
X) ./main_script.sh;;
esac