MMPS Record IP
MMPS Record IP
PROGRAM NO : 1
PROBLEM STATEMENT :
Write a program to calculate compound interest.
SOLUTION :
print('********COMPOUND INTEREST********')
p=float(input('enter the principal amount:'))
r=float(input('enter the rate of interest:'))
t=float(input('enter the time in years:'))
x=(1+r/100)**t
CI=p*x-p
print('='*40)
print('compound interest is:',round(CI,2))
print('total amount with interest is:',round(p+CI))
1
OUTPUT :1
2
DATE :
PROGRAM NO : 2
PROBLEM STATEMENT :
Write a program to calculate : Area of circle( A=3.14*r*r),Area of square(A=a*a),
Area of rectangle(A=l*b).
SOLUTION :
def circle(r):
return 3.14*r*r
def square(a):
return a*a
def rectangle(l,b):
return l*b
while 1:
print('='*40)
print('****************main menu***************')
print('='*40)
if n==1:
3
A=circle(r)
elif n==2:
A=square(a)
elif n==3:
A=rectangle(l,b)
else:
ch=input('y/n:')
4
OUTPUT :2
5
DATE :
PROGRAM NO : 3
PROBLEM STATEMENT :
Write a pandas program to show the attributes of series.
SOLUTION :
import pandas as pd
import numpy as np
s1=pd.Series([23,37,65,98],index=['a','b','c','d'])
s2=pd.Series([43,54,np.nan])
s3=pd.Series([])
print('************************Attributes Of
Series****************************')
print('='*72)
print('Attributes in series s1')
print('1.The value of series s1:',s1.values)
print('2.The index of series s1:',s1.index)
print('3.The shape of series s1:',s1.shape)
print('4.The size of series s1:',s1.size)
print('5.The datatype of the object in s1:',s1.dtype)
print('6.The no of bytes of series:',s1.nbytes)
print('7.check for emptyness in s1:',s1.empty)
print('8.check for Nans in s1:',s1.hasnans)
print('='*72)
print('Attributes in series s2')
6
print('1.The value of series s2:',s2.values)
print('2.The index of series s2:',s2.index)
print('3.The shape of series s2:',s2.shape)
print('4.The size of series s2:',s2.size)
print('5.The datatype of the object in s2:',s2.dtype)
print('6.The no of bytes of series s2:',s2.nbytes)
print('7.check for emptyness in s2:',s2.empty)
print('8.check for Nans in s2:',s2.hasnans)
print('='*72)
print('Attributes in series s3')
print('1.The value of series s3:',s3.values)
print('2.The index of series s3:',s3.index)
print('3.The shape of series s3:',s3.shape)
print('4.The size of series s3:',s3.size)
print('5.The datatype of the object in s3:',s3.dtype)
print('6.The no of bytes of series s3:',s3.nbytes)
print('7.check for emptyness in s3:',s3.empty)
print('8.check for Nans in s3:',s3.hasnans)
7
OUTPUT :3
8
DATE :
PROGRAM NO : 4
PROBLEM STATEMENT :
Write a pandas program to find out the biggest and smallest three areas from the
given series that stores the area of some state in kms.
SOLUTION :
import pandas as pd
s=pd.Series([342239,308252,307713,240928,196024,38863,44212,3702])
print('*******************AREA OF STATES********************')
print(s.values)
print('='*60)
print('The top three biggest area are:-')
print(s.sort_values().tail(3))
print('='*60)
print('The top three smallest area are:-')
print(s.sort_values().head(3))
print('='*60)
9
OUTPUT :4
10
DATE :
PROGRAM NO : 5
PROBLEM STATEMENT :
Create a pandas series from dictionary of values and ndarray.
SOLUTION :
import pandas as pd
import numpy as np
print('..............................')
print('***********SERIES************')
data=pd.Series({'rohan':30,'mohan':23,'reema':22,'soumya':18})
data.name='age'
data.index.name='names'
print(data)
print('='*30)
print('***********NDARRAY***********')
arr=np.array([101,102,103,104,105])
series=pd.Series(arr)
print(series)
print('='*30)
11
OUTPUT :5
12
DATE :
PROGRAM NO : 6
PROBLEM STATEMENT :
Write a pandas program to create a data series and then change the index of the
series in any random order.
SOLUTION :
import pandas as pd
s=pd.Series(data=[100,200,300,400,500],index=['a','b','c','d','e'])
print(s)
s1=s.reindex(['b','a','e','d','c'])
print(s1)
13
OUTPUT :6
14
DATE :
PROGRAM NO : 7
PROBLEM STATEMENT :
Create a Dataframe for examination result and display row labels, columns labels,
data type of each column, the dimensions and the shape.
SOLUTION :
import pandas as pd
data={'class':['I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII'],'pass_percentage':[40,40,
40,40,40,37,37,37,36,33,33,33]}
result=pd.DataFrame(data)
print(('='*35))
print('********EXAMINATION RESULT********')
print(('='*35))
print(result)
print('data type of the dataframe is:',result.dtypes)
print('dimension of the dataframe is:',result.ndim)
print('shape of the dataframe is:',result.shape)
15
OUTPUT :7
16
DATE :
PROGRAM NO : 8
PROBLEM STATEMENT :
Write a pandas program with object1 population stores the details of population of
four metro cities of India and object2 average income reported in the previous
year in each of these metro . Calculate the income percapita for each of these
metro cities.
SOLUTION :
import pandas as pd
population=pd.Series([11034555,8443675,12442373,4646732],index=['Delhi','Bang
alore','Mumbai','Chennai'])
avgincome=pd.Series([134432,154000,1227630,926271],index=['Delhi','Bangalore',
'Mumbai','Chennai'])
income_percapita=avgincome/population
print('='*40)
print("POPULATION OF EACH METRO CITIES:")
print(population)
print('='*40)
print("AVERAGE INCOME OF EACH METRO CITIES:")
print(avgincome)
print('='*40)
print("INCOME PERCAPITA OF EACH METRO CITIES:")
print(round(income_percapita,2))
print('='*40)
17
OUTPUT :8
18
DATE :
PROGRAM NO : 9
PROBLEM STATEMENT :
Write a python program to create the dataframe with the following values and
perform attributes of dataframe on it.
Name Year Score Catches
0 Jhanvi 2012 10 2
1 Meera 2012 22 2
2 Meethu 2013 11 3
3 Nidhi 2014 32 3
4 Sani 2014 23 3
SOLUTION :
import pandas as pd
data=pd.DataFrame({'Name':['Jhanvi','Meera','Meethu','Nidhi','Sani'],'Year':[2012,2
012,2013,2014,2014],'Score':[10,22,11,32,33],'Catches':[2,2,3,3,3,]})
print(data)
print(('='*70))
print("* shape of dataframe is:",data.shape)
print(('-'*70))
print("* size of dataframe is:",data.size)
print(('-'*70))
print("* index of dataframe is:",data.index)
print(('-'*70))
print("* columns of dataframe is:",data.columns)
print(('-'*70))
19
print("* data type of dataframe is:",data.dtypes)
print(('-'*70))
print("* dimension of dataframe is:",data.ndim)
print(('='*70))
20
OUTPUT :9
21
DATE :
PROGRAM NO : 10
PROBLEM STATEMENT :
Write a python program to create the dataframe and perform head() and tail()
function on it.
SOLUTION :
import pandas as pd
student={'Subject':['English','Maths','economics','Accountancy','Business'],'Marks':[
78,86,65,46,94]}
df=pd.DataFrame(student)
print(('*'*35))
print("Dataframe is:")
print(df)
print(('='*35))
print('First two rows of the dataframe is:')
print(df.head(2))
print(('='*35))
print('Last 2 rows of the dataframe is:')
print(df.tail(2))
print(('='*35))
22
OUTPUT :10
23
DATE :
PROGRAM NO : 11
PROBLEM STATEMENT :
Write a python program to create the dataframe and perform Boolean indexing on
it.
SOLUTION :
import pandas as pd
def index1():
print(df.loc[True])
def index2():
print(df.loc[False])
student={'ROLL_NO':[10,11,12,13,14,15],'NAME':['Rahul','Preethi','Samiya','Varun',
'Reshma','Sunitha']}
df=pd.DataFrame(student,index=[True,False,False,True,True,False])
print(df)
print(('='*37))
print('MAIN MENU')
print('1.Display all records with true value')
print('2.Display all record with false index')
print(('='*37))
while 1:
n=int(input('ENTER CHOICE 1 or 2:'))
if n==1:
print('Records with true index are:')
24
index1()
elif n==2:
print('Records with false index are:')
index2()
else:
print('WRONG CHOICE')
ch=input('Y/N :')
if ch =='n' or ch =='N': break
25
OUTPUT :11
26
DATE :
PROGRAM NO : 12
PROBLEM STATEMENT :
Write a python program to create the dataframe and select row(column using loc
and iloc function).
SOLUTION :
import pandas as pd
data={'STREAM':['Commerce','Science','Science','Commerce'],'AGE':[15,15,16,15],'
GENDER':['Male','Female','Female','Male']}
students=pd.DataFrame(data,index=['SHARON','MALAVIKA','RAHANA','RAHUL'])
print(('='*37))
print('Data Frame is:')
print(students)
print(('='*37))
print('USING iloc FUNCTION')
print(students.loc['MALAVIKA'])
print(('='*37))
print('USING loc FUNCTION')
print(students.iloc[0,2])
print(('='*37))
27
OUTPUT :12
28
DATE :
PROGRAM NO : 13
PROBLEM STATEMENT :
Write a python program to replace all negative values in a dataframe with 0.
SOLUTION :
import pandas as pd
data={'Data1':[10,-12,14,-16,-18,20],'Data2':[1,-3,-5,7,-9,-11]}
df=pd.DataFrame(data)
print(('='*37))
print(df)
print(('*'*37))
print('REPLACED NEGATIVE VALUE WITH 0')
df[df<0]=0
print(df)
print(('='*37))
29
OUTPUT :13
30
DATE :
PROGRAM NO : 14
PROBLEM STATEMENT :
Create a series to store the amount of sales made by a salesperson for the
last year (whole months).
a) Display the sales amount which is greater than 10000.
b) Display the sales amount in the first four months.
c) Display the sales amount in the last four months.
SOLUTION :
import pandas as pd
import numpy as np
month=['JANUARY','FEBRUARY','MARCH','APRIL','MAY','JUNE','JULY','AUGUST',
'SEPTEMBER','OCTOBER','NOVEMBER','DECEMBER']
s1=pd.Series(data=amount,index=month)
print(('='*75))
print(s1[s1>10000])
print(('='*37))
print(s1.head(4))
print(('='*37))
print(s1.tail(4))
31
OUTPUT :14
32
DATE :
PROGRAM NO : 15
PROBLEM STATEMENT :
Write a program to accept the name and mark obtained by 3 students for 2 terms
(using series). Find the total mark and percentage of each student.
SOLUTION :
import pandas as pd
mark1=[]
mark2=[]
names=[]
for i in range(1,4):
names.append(n)
mark1.append(m1)
mark2.append(m2)
series1=pd.Series(mark1,index=names)
series2=pd.Series(mark2,index=names)
33
ans='y'
while 1:
print("\n1.total mark")
print("\n2.percentage")
if choice==1:
print(series1+series2)
elif choice==2:
print((series1+series2)/200*100)
else:
print("wrong choice")
ch=input("Y/N")
34
OUTPUT :15
35
DATE :
PROGRAM NO : 16
PROBLEM STATEMENT :
Consider 3 series :
s1=[11,12,13,14] , index =[1,2,3,4]
s2=[21,22,23,24] , index=[1,2,3,4]
s3=[21,22,23,24], index=[101,102,103,104]
Perform all mathematical operations on them.
SOLUTION :
import pandas as pd
s1=pd.Series(data=[11,12,13,14],index=[1,2,3,4])
s2=pd.Series(data=[21,22,23,23],index=[1,2,3,4])
s3=pd.Series(data=[21,22,23,24],index=[101,102,103,104])
print(('='*15))
print("s1+s2\n",s1+s2)
print(('='*15))
print("s1*s2\n",s1*s2)
print(('='*15))
print("s1-s2\n",s1-s2)
print(('='*15))
print("s1/s2\n",s1/s2)
print(('='*15))
print("s1+s3\n",s1+s3)
print(('='*15))
36
OUTPUT :16
37
DATE :
PROGRAM NO : 17
PROBLEM STATEMENT :
Create a csv using the data about cars (name, price in lakhs and mileage) as given
below:
{‘car’:[‘BMW’,’Honda’,’Toyota’,’Hyundai’] , ‘price’:[100,8,45,7],
‘mileage’;[39,27,26,26]}
Read the above csv and plot a bar chart which represents car and its price.
SOLUTION :
import pandas as pd
dict={'car':['BMW','Honda','Toyota','Hyundai'],'price':[100,8,45,7],'mileage':[39,27,
26,26]}
df=pd.DataFrame(dict)
df.to_csv("cars.csv")
df2=pd.read_csv("cars.csv")
name=df2['car']
price=df2['price']
plt.bar(name,price,width=0.5,color='r')
plt.xlabel('CAR')
plt.ylabel('PRICE')
plt.show()
38
OUTPUT :17
39
DATE :
PROGRAM NO : 18
PROBLEM STATEMENT :
Write a program to draw line charts for the following:
i) Show the population of india v/s Pakistan from 1960 – 2010
Ind=[449.48, 553.57, 696.783, 870.133,1000.4, 1309.1]
Pak=[44.91, 58.06, 78.07, 107.7, 138.5, 170.6]
ii) Show the unemployment rate from 1920 to 2010
Year = [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]
Unemployment_Rate = [9.8, 12, 8, 7.2, 6.9, 7, 6.5, 6.2, 5.5, 6.3]
SOLUTION :
Import matplotlib.pyplot as plt
def population():
year=[1960,1970,1980,1990,2000,2010]
ind=[449.48,553.57,696.783,870.133,1000.4,1309.1]
pak=[44.91,58.06,78.07,107.7,138.5,170.6]
plt.plot(year,ind,label="india")
plt.plot(year,pak,label="pakistan")
plt.xlabel("year")
plt.ylabel("population")
plt.legend()
plt.show()
40
defunemployment_rate():
year=[1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]
unemployment_rate=[9.8,12,8,7.2,6.9,7,6.5,6.2,5.5,6.3]
plt.plot(year,unemployment_rate,"-",marker="*",markeredgecolor="r")
plt.xlabel("year")
plt.ylabel("unemployment_rate")
plt.show()
while 1:
print("="*60)
print('***********************MAIN MENU************************')
print('~~LINE CHART~~')
print("="*60)
if n==1:
population()
elif n==2:
unemployment_rate()
41
else:
ch=input("Y/N:")
42
OUTPUT :18
43
DA
TE :
PROGRAM NO : 19
PROBLEM STATEMENT :
Program to plot line chart to solve the following algebraic expressions.
i) 10X+14 ii) Y2=4X
SOLUTION :
Import matplotlib.pyplot as plt
Import numpy as np
def exp_1():
x=np.arange(12,20)
y=10*x+14
plt.plot(x,y)
plt.xlabel("x-axis")
plt.ylabel("y-axis")
plt.title("10X+14")
plt.show()
def exp_2():
x=np.arange(2,10)
y=np.sqrt(4*x)
44
plt.plot(x,y,":",linewidth=3)
plt.xlabel("x-axis")
plt.ylabel("y-axis")
plt.title("Y2=4X")
plt.show()
while 1:
print("="*40)
print('**************MAIN MENU*****************')
if n==1:
exp_1()
elif n==2:
exp_2()
else:
ch=input("Y/N:")
45
OUTPUT :19
46
DATE :
47
PROGRAM NO : 20
PROBLEM STATEMENT :
Create bar chart to show the following:
i)Represent the performance of programming languages:
python","c++","Java","Perl","Scala","lisp" given by different users as 10,8,6,4,2,1
respectively using horizontal bar chart .
ii) Represent class as [ "V","VI","VII","VIII","IX","X”] and strength
=[49,38,50,37,43,39] using a normal bar chart.
SOLUTION :
Import matplotlib.pyplot as plt
Import numpy as np
def languages():
objects=("python","C++","java","perl","scala","lisp")
ypos=np.arange(len(objects))
performance=[10,8,6,4,2,1]
plt.barh(ypos,performance,align="center",color="r")
plt.yticks(ypos,objects)
plt.xlabel("usage")
plt.show()
def classes():
48
classes=('V','VI','VII','VIII','IX','X')
strength=[49,38,50,37,43,39]
plt.bar(classes,strength,align="center",color="b")
plt.xlabel("class")
plt.ylabel("strength")
plt.show()
while 1:
print("="*60)
print('********************MAIN MENU****************************')
if n==1:
languages()
elif n==2:
classes()
else:
49
print("YOUR CHOICE IS WRONG")
ch=input("Y/N:")
OUTPUT :20
50
DATE :
51
PROGRAM NO : 21
PROBLEM STATEMENT :
Input the name and mark of 4 students in two lists. Represent their performance
using a bar chart.
SOLUTION :
Import matplotlib.pyplot as plt
names=[]
marks=[]
for i in range(1,5):
print("="*60)
print("="*60)
names.append(n)
marks.append(m)
plt.bar(names,marks,color="black")
plt.xlabel("students")
plt.ylabel("marks")
plt.show()
OUTPUT :21
52
DATE :
53
PROGRAM NO : 22
PROBLEM STATEMENT :
Create an array having 30 elements between 5 and 50. Plot the following having 10
bins.
i) Simple histogram
ii) Horizontal histogram
iii)Step-Type histogram
iv) Cumulative histogram
SOLUTION :
Import numpy as np
x=np.random.randint(5,50,30)
plt.hist(x,bins=10,color='y')
plt.title("SIMPLE HISTOGRAM")
plt.show()
plt.title("HORIZONTAL HISTOGRAM")
plt.show()
plt.title("STEP-TYPE HISTOGRAM")
plt.show()
54
plt.hist(x, bins=10,cumulative=True, color='g')
plt.title("CUMULATIVE HISTOGRAM")
plt.show()
OUTPUT :22
55
56
WORKSHOP NO – 1
DATE:
PROBLEM STATEMENT :1
Write SQL query to create a database employee.
SOLUTION:
create database employee;
OUTPUT :1
PROBLEM STATEMENT :2
Write SQL query to open database employee.
SOLUTION:
use employee;
OUTPUT :2
57
PROBLEM STATEMENT :3
Write SQL query to create following Table name empl.
empno Ename job mgr hiredate sal comm deptno
8369 SMITH CLERK 8902 1990-12-18 800.00 NULL 20
8499 ANYA SALESMAN 8698 1991-02-20 1600.00 300.00 30
8521 SETH SALESMAN 8698 1991-02-22 1250.00 500.00 30
8566 MAHADEVAN MANAGER 8839 1991-04-02 2985.00 NULL 20
8654 MOMIN SALESMAN 8698 1991-09-28 1250.00 1400.00 30
8698 BINA MANAGER 8839 1991-05-01 2850.00 NULL 30
8882 SHIAVNSH MANAGER 8839 1991-06-09 2450.00 NULL 10
8888 SCOTT ANALYST 8566 1992-12-09 3000.00 NULL 20
8839 AMIR PRESIDENT Null 1991-11-18 5000.00 NULL 10
8844 KULDEEP SALESMAN 8698 1991-09-08 1500.00 0.00 30
8886 ANOOP CLERK 8888 1993-01-12 1100.00 NULL 20
8900 JATIN CLERK 8698 1991-12-03 950.00 NULL 30
8902 FAKIR ANALYST 8566 1991-12-03 3000.00 NULL 20
8934 MITA CLERK 8882 1992-01-23 1300.00 NULL 10
SOLUTION:
create table empl(empno integer not null primary key,ename varchar(20),job
varchar(20),mgr integer,hiredate date,sal integer,comm decimal,deptno integer);
OUTPUT :3
58
PROBLEM STATEMENT:4
Write SQL query to show the structure of table.
SOLUTION:
desc empl;
OUTPUT :4
PROBLEM STATEMENT:5
Write SQL query to insert 10 records same as it is in the table.
SOLUTION:
insert into empl values(8369,'SMITH','CLERK',8902,'1990-12-18',800.00,null,20);
insert into empl values(8499,'ANYA','SALESMAN',8698,'1991-02-20', 1600.00,
300.00,30);
insert into empl values(8521,'SETH','SALESMAN',8698,'1991-02-22', 1250.00,
500.00,30);
insert into empl values(8566,'MAHADEVAN','MANAGER',8839,'1991-04-02',
2985.00, NULL,20);
insert into empl values(8654,'MOMIN','SALESMAN',8698,'1991-09-28', 1250.00,
1400.00,30);
insert into empl values(8698,'BINA','MANAGER',8839,'1991-05-01' , 2850.00,
NULL,30);
59
insert into empl values(8882,'SHIAVNSH','MANAGER',8839,'1991-06-09', 2450.00,
NULL,10);
insert into empl values(8888,'SCOTT','ANALYST',8566,'1992-12-09', 3000.00,
NULL,20)
insert into empl values(8839,'AMIR','PRESIDENT',NULL,'1991-11-18', 5000.00 ,
NULL,10);
insert into empl values(8844,'KULDEEP','SALESMAN',8698,'1991-09-08', 1500.00,
0.00,30);
OUTPUT :5
60
PROBLEM STATEMENT:6
Write SQL query to display all the records from table empl.
SOLUTION:
select * from empl;
OUTPUT :6
PROBLEM STATEMENT:7
Write SQL query to display empno and ename of all employees from the table
empl.
SOLUTION:
Select empno,ename from empl;
OUTPUT: 7
61
PROBLEM STATEMENT:8
Display the details of the employees whose name have only four letters.
SOLUTION:
select * from empl where ename like'_ _ _ _';
OUTPUT: 8
PROBLEM STATEMENT:9
Display the details of all the employee whose annual salary is between 2500 to
4000.
SOLUTION:
select * from empl where sal between 2500 and 4000;
OUTPUT: 9
PROBLEM STATEMENT:10
Display name, job title and salary of the employee who do not have manager.
SOLUTION:
Select ename, job, sal from empl where mgr is null;
62
OUTPUT:10
PROBLEM STATEMENT:11
Display the name of employee whose name contains “I” as third letter.
SOLUTION:
Select ename from empl where ename like'_ _I%';
OUTPUT:11
PROBLEM STATEMENT:12
Display the name of the employee whose name contains “L” as any letter.
SOLUTION:
Select ename from empl where ename like '%L%';
OUTPUT:12
63
PROBLEM STATEMENT:13
Display the department number. Each department number should displayed once.
SOLUTION:
select distinct deptno from empl;
OUTPUT:13
PROBLEM STATEMENT:14
Display all data of empl according to salary arranged by ascending order.
SOLUTION:
select * from empl order by sal;
OUTPUT:14
64
PROBLEM STATEMENT :15
Display department no ,job and no of employee in particular job group by
department no , job from empl.
SOLUTION:
Select deptno, job, empno from empl group by deptno, job;
OUTPUT:15
PROBLEM STATEMENT: 16
Display the jobs where the number of employee is less than 3.
SOLUTION:
Select job, count(*) from empl group by job having count(*)<3;
OUTPUT:16
65
PROBLEM STATEMENT:17
AGGREGATE FUNCTION
66
d. Find the total number of employee from empl table.
SOLUTION:
select count(*) from empl;
PROBLEM STATEMENT:18
TEXT FUNCTIONS:
67
b. Display the position of the string ‘LE’ in field job of table empl.
SOLUTION:
Select instr(job,'LE') as job from empl;
c. TRIM FUNCTION
1) select trim(" MYSQL ");
2) select ltrim(" MYSQL ");
3) select rtrim(" MYSQL ");
d. SUBSTR FUNCTION
select substr('ABCDEF',3,4)"subs";
68
e. LENGTH FUNCTION
select LENGTH('ABCDEF')"LENGTH OF STRING";
f. LEFT FUNCTION
select LEFT('ABCDEF',3);
g. RIGHT FUNCTION
select RIGHT('ABCDEF',3);
h. MID FUNCTION
select MID('ABCDEF',3,4);
69
PROBLEM STATEMENT:19
MATH FUNCTIONS:
a.MOD FUNCTION
select MOD(15,4)"modules";
b.POWER FUNCTION
select POW(2,3)"power";
c.ROUND FUNCTION
select ROUND(15.67,1)"ROUND";
70
e. TRUNCATE FUNCTION
select truncate(25.79,-1)"truncate";
PROBLEM STATEMENT:20
DATE/TIME FUNCTION
a. selectcurdate();
b. select month('2002-02-03');
c. select monthname('2002-02-03');
71
d. select day('2002-02-03');
e. select dayname('2002-02-03');
f. select year('2002-02-03');
g. select dayofmonth('2002-02-03');
72
h. select dayofweek('2002-02-03');
i. select dayofyear('2002-02-03');
73