Finalproject 1 1
Finalproject 1 1
(ENo integer,
Name varchar(40),
OpeningPrice float,
ClosingPrice float);
2)
3)
4)
5)
6)
7)
9)
10)
11)
12)
13)
14)
table: nseper
create table nseper
Category varchar(40));
insert into nseper values('Network 18 Media and Investments', 'Media Entertainment and Publications');
def company():
st="select nse.name,closingprice, opening price, from nse, nseper where nse.name=nseper.name and nse.name='%s';"%c
return st
def category():
cat=input('Category')
return st
nsecon=sqltor.connect(host='localhost', user='root',password='vaids@0123',database='project')
nsecur=nsecon.cursor()
ch=input('enter c for company and b for bullbear and cat for category')
if ch.upper()=='C':
st=company()
nsecur.execute(st)
data=nsecur.fetchall()
print('Details of the company are as follows: NAME , CLOSING PRICE, CHANGES, BULLBEAR')
print(row[0],row[1],row[1]-row[2],end=' ')
if row[1]>row[2]:
print('BULLISH')
else:
print('BEARISH')
if ch.upper()=='B':
st=bullbear()
nsecur.execute(st)
data=nsecur.fetchall()
if row[1]>row[2]:
print('BULLISH')
else:
print('BEARISH')
elif ch.upper()=='CAT':
st=category()
nsecur.execute(st)
data=nsecur.fetchall()
print(row)
nsecon.close()