05 Aug 2023
UNIT 1 - Database operations
Practical 1
Name Roll no. Marks Marks 2
Priya 2 88 55 143
Daniel 5 56 45 101 157
Neha 1 91 33 124 248
Riya 3 44 98 142
Raj 4 76 34 110
355 265
Max 91 MAX(C2:C6)
Min 44 MIN(C2:C6)
Count 5 COUNT(C2:C6)
Average 71 AVERAGE(C2:C6)
Formulas
1. Sorting - The sorting feature allows arranging the data in a spreadsheet in
a particular order based on one or more criteria. The major criteria offered
are in descending and ascending order. The sorting feature is available in
the editing tab.
2. Filtering - The filtering feature helps to easily manage and analyze data
by displaying only specific rows that meet certain criteria. This feature is
particularly useful when dealing with large datasets, as it helps to focus
on the data that are relevant to the analysis.
3. Max - The MAX formula is used to find the maximum value from a
range of numbers or a set of values. The syntax for MAX is =MAX
(Number1, Number2….)
4. Min - The MIN formula is used to find the minimum value among a
range of numbers or a set of values. The syntax for MIN is =MIN
(Number1, Number2….)
5. Count - The COUNT formula is used to count the number of cells within
a specified range that contains numeric values. The syntax for COUNT is
=COUNT (Range)
6. Average - The AVERAGE formula is used to calculate the arithmetic
mean of a range of numbers. It provides the average value of the numbers
within the specified range. The syntax for AVERAGE is =AVERAGE
(Number1, Number2….)
11 Aug 2023
Practical 2
DCOUNT
Product Rating Size
B52 7.5 5
A50 8.5 4.5
X20 9 10
Size L45 9 8
>5 N7 8 7
Rating
<8
Find rating of product whose size is greater than 5
3 DCOUNT(D4:F9,"Rating",B8:B9)
Find the number of Sizes where rating is <8
1 DCOUNT(D4:F9,"SIZE",B12:B13)
Formulas
DCOUNT - The DCOUNT function in Excel is used to count the number of
cells within a range that meet specific criteria. It stands for "Database COUNT."
This function is often used when we have a list or database of information and
we want to count the number of entries that match certain conditions. The
syntax of the DCOUNT function is as follows: =DCOUNT (Database, field,
criteria)
database: This is the range of cells that makes the database, including headers.
The headers are used to identify the columns and their names.
field: This refers to the column in the database that we want to sum.
criteria: This is a range of cells containing the criteria you want to apply to filter
the database.
11 Aug 2023
DSUM
Ite
DSUM Formula to SUM Item m
Compan Ball
Item y price Quantity Total Mouse pen
Ball Pen A 50 2 100
Mouse A 250 4 1000
Ball Pen A 110 1 110 Item
Laptop
Bag D 1050 10 10500 Laptop Bag
Mouse A 1250 5 6250
Laptop
Bag D 650 4 2600
DSUM(A3:E9,E3,G2:
Formula 7250 G3)
DSUM(A3:E9,E3,I2:I3
210 )
1310 DSUM(A3:E9,E3,G6:
0 G7)
Formulas
DSUM - The DSUM function is used to calculate the sum of values from a
database that matches specific criteria. It stands for "Database SUM." This
function is often used when we have a list of data that want to filter based on
certain conditions and then sum up the values from a specific column. The The
syntax of the DCOUNT function is as follows: =DSUM (Database, field,
criteria)
database: This is the range of cells that makes the database, including headers.
The headers are used to identify the columns and their names.
field: This refers to the column in the database that we want to sum.
criteria: This is a range of cells containing the criteria you want to apply to filter
the database.
18 Aug 2023
Practical 3
STRINGS
Name UPPER LOWER RIGHT LEFT SEARCH FIND
Ria Singh RIA SINGH ria singh h R 1 1
Ajeet jain AJEET JAIN ajeet jain ain Aje 8 8
PRIYANSHU priyanshu
Priyanshu Jha JHA jha Jha Priy 10 10
Samiksha SAMIKSHA samiksha
shrivastava SHRIVASTAVA shrivastava stava Samik 16 16
RAJESH rajesh
Rajesh kumar KUMAR kumar kumar Rajesh 7 7
Bandita BANDITA bandita
Shrivastav SHRIVASTAV shrivastav v B 13 13
RASHI rashi
Rashi sharan SHARAN sharan n R 12 12
LOWER
Formulas UPPER(text) (text) Right(text) Left(text) SEARCH(D5,A5) FIND(E4,A4)
1. Upper - The Upper function converts all characters in a specified text
string to uppercase. The SYNTAX for upper case is =UPPER (Text)
2. Lower - The lower function converts all characters in a specified text
string to lowercase. The SYNTAX for lower case is =LOWER (Text)
3. Right - The right function is used to extract a specified number of
characters from the right side of a text string. The SYNTAX for right is
=RIGHT (text, num chars)
text: This is the text string from which you want to extract characters.
num_chars: This is the number of characters you want to extract from the
right side of the text.
4. Left - The left function is used to extract a specified number of characters
from the left side of a text string. The SYNTAX for LEFT is =LEFT (text,
num chars)
text: This is the text string from which you want to extract characters.
num_chars: This is the number of characters you want to extract from the
left side of the text.
5. Search – The Search function in Excel is used to find the starting position
of a specific substring within a given text string. The Syntax for Search is
=SEARCH(find_text, within_text, [start_num]).
6. Find – The find function in Excel is used to locate a specific substring
within a text string, and it returns the starting position of that substring.
The syntax of the FIND function is as follow = FIND (find_text,
within_text, [start_num]).
18-Aug-23 Practical 3
STRINGS
LEN +
Name LEN SUBSTITUTE Substitute IS NUMBER ISTEXT MID
Ria Singh 9 RiaSingh 8 FALSE TRUE FALSE
Ajeet jain 10 Ajeetjain 9 FALSE TRUE FALSE
Priyanshu Jha 13 PriyanshuJha 12 FALSE TRUE FALSE
Samiksha
shrivastava 20 Samikshashrivastava 19 FALSE TRUE FALSE
Rajesh kumar 12 Rajeshkumar 11 FALSE TRUE FALSE
Bandita
Shrivastav 18 BanditaShrivastav 17 FALSE TRUE FALSE
Rashi sharan 12 Rashisharan 11 FALSE TRUE FALSE
SUBSTITUTE(A4,"
Formulas LEN(text) ","") LEN(I4) ISNUMBER(A4) ISTEXT(I4) L6=MID(I6,H6,J6)
1. Len - The LEN formula is used to calculate the length (number of
characters) of a given text string. The syntax of the LEN formula is as
follows =LEN(text).
2. Substitute - The SUBSTITUTE function is used to replace occurrences of
a specified substring within a larger string with another substring. Its
syntax is as follows: =SUBSTITUTE(text, old_text, new_text)
text: The original text in which you want to replace occurrences.
old_text: The substring you want to replace.
new_text: The substring you want to replace old_text
3. IS Number - The ISNUMBER formula in Excel is a logical function that
checks whether a given value is a number. It returns TRUE if the value is
a number and FALSE if it's not. This function is particularly useful when
you want to determine if a cell contains a numeric value or not.
The syntax of the ISNUMBER function is as follows
=ISNUMBER(value)
4. IS Text- The "ISTEXT" function is a built-in function in Microsoft Excel
that checks whether a given value is text or not. It returns TRUE if the
value is text and FALSE if it is not. The syntax of the ISTEXT function is
=ISTEXT(value)
5. MID - The MID function in Excel is used to extract a substring from a
text string. It stands for "middle" and is used to extract a specified
number of characters from a given text string, starting from a specified
position.
The syntax of the MID function is as follows: MID (text, start_num,
num_chars)
20 Aug 2023
Practical 4
Wildcards
Part Lookup
#asc-1 Find 11
Wildcar #VALUE
#asc?1 d !
Text Search 11
This part #asc-1 is Wildcar
missing. d 11
This part #asc/1 is
missing.
Wildcards
match any
* character
match any
single
? character
match * or ?
Exactly like
~ "~*" or "~?"
Wildcards in Excel are special characters that can be used in functions and
formulas to perform pattern matching within text data. They are particularly
useful when you need to search for or manipulate data based on a specific
pattern or part of a text string.
Asterisk (*) wildcard - The asterisk (*) represents zero or more characters.
Question mark (?) wildcard - The question mark (?) represents a single
character.
Tilde (~) wildcard (escape character) - The tilde (~) is used as an escape
character to search for literal occurrences of asterisks (*) and question marks
(?).
25 Aug 2023
UNIT 2 – Stastistical finction
in Excel
Practical 5
Students Marks
Kanishka 87
1. Average Akant 54 -
Priyanka 63
Anurag 23
Prabhat 63
Jahnvi 64
Niharika 89
Aakash 80
Shruti 33
Riya 37
Abhijeet 64
Adhiraj 62
Mean 59.91666667 AVERAGE(B4:B15)
Median 63 MEDIAN(B4:B15)
Mode 63 MODE(B4:B15)
Standard deviation 20.6417861 STDEV(B4:B15)
range of numbers. It provides the average value of the numbers within the
specified range. The syntax for AVERAGE is =AVERAGE (Number1,
Number2….).
2. Median - The median is the middle value in a set of numbers when they
are arranged in ascending order. If there is an even number of values, the
median is the average of the two middle values. The syntax for MEDIAN
is =MEDIAN (number1, [number2], ...)
3. Mode - In Excel, the MODE function is used to find the most frequently
occurring value or values (mode) in a dataset. It can be used with both
numerical and text data. The syntax for the MODE function is as follows:
= MODE (number1, [number2], ...)
4. Standard deviation - The STDEV function calculates the standard
deviation based on a sample of data. If you want to calculate the
25 Aug 2023
standard deviation for a population, you can use STDEV function. Here's
the syntax for the STDEV function = STDEV(number1, [number2], ...)
Practical 6
Financial formulas in Excel
Data Description
$-70,000.00 Initial cost of a business
$ 12,000.00 Net income for the first year
$15,000.00 Net income for the Second year
$ 18,000.00 Net income for the third year
$ 21,000.00 Net income for the Fourth year
$ 26,000.00 Net income for the Fifth year
Formula Description
-2% Investment internal rate of return after four years IRR(A3:A7)
9% internal rate of return after five years IRR(A3:A8)
To calculate the internal rate of return after two years, you
-44% need to include a guess (in this example ,-10%) IRR(A3:A5,-10%)
IRR - The IRR function to calculate the internal rate of return for a series of
cash flows. The IRR is the discount rate that makes the net present value (NPV)
of these cash flows equal to zero. The syntax for IRR is IRR(values, [guess])
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10
Estimate
d 1000 2000 3000 3500 3600 2000 3400 5000 4500 3000
Expenses 0 0 0 0 0 0 0 0 0 0 310000
Present
value $2,18,516.09
Discount
Rate 6%
NPV(B5,B3:K3
NPV )
NPV - The NPV (Net Present Value) function to calculate the present value of a
series of cash flows at a specific discount rate. The NPV represents the
difference between the present value of cash inflows and the present value of
01 Sep 2023
cash outflows over a given time period. The syntax for NPV is NPV(rate,
value1, [value2], ...)
Practical 7
PMT, IPMT, PPMT
Loan Amount 10,00,000
Interest rate 14%
Loan Period in Years 4
PMT ₹ -27,326.48 PMT(B4/12,B5*12,B3)
IPMT ₹ -11,666.67 IPMT(B4/12,1,B5*12,B3)
PPMT ₹ -15,659.81 PPMT(B4/12,1,B5*12,B3)
PMT - The PMT function to calculate the monthly payment for a loan or
investment based on a constant interest rate and regular payments. The
function calculates the payment required to pay off a loan with a fixed interest
rate over a specified number of periods.The syntax for the PMT function:
PMT(rate, nper, pv, [fv], [type])
IPMT - The IPMT function in Excel is used to calculate the interest payment
for a specific period within a loan or investment. The syntax for IPMT function:
IPMT(rate, per, nper, pv, [fv], [type])
PPMT - The PPMT function in Excel is used to calculate the principal payment
for a specific period within a loan or investment term. The syntax for PPMT
function: PPMT(rate, period, nper, pv, [fv], [type])
Product Code Product Name Price
A101 Pen 20000
A102 Pencil 900
A103 Eraser 1200
B103 Marker 30000 A101
B105 Printer 45000
C102 Computer 32000
D120 Mouse 23000
VLOOKUP(F16,A12:C19,3,FALSE
Vlookup 20000 )
Vlookup - The VLOOKUP function in Excel is used to search for a value in the
first column of a table or range of data (known as the "lookup table") and return
a corresponding value in the same row from a specified column. The syntax for
Vlookup:VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup])
Product Code A101 A102 A103 B103 B105 C102 D120
Erase Marke Printe Compute Mous
Product Name Pen Pencil r r r r e
Price 20000 900 1200 30000 45000 32000 23000
HLOOKUP(F16,A24:H26,2,FALS
Hlookup Pen E)
Hlookup - The HLOOKUP function in Excel is used to perform a horizontal
lookup, which means it searches for a specific value in the header row of a table
or range and returns the corresponding value from a row below it. The syntax
for hlookup: HLOOKUP(lookup_value,table_array,row_index_num,
[range_lookup])
02 Sep 2023
Practical 8
Index, Match
02-09-
2023 Practical-7
First
ID name last name Salary
72 Emily Smith $64,901.00 ID 53
$ Salar 5833
66 James Anderson 70,855.00 y 9
14 Mia Clark $ 188657
$
30 John Lewis 97,566.00 ID 14
$
53 Jessica Walker 58,339.00
56 Mark Reed $ 125180
$
79 Richard Lopez 91,632.00
Index Clark INDEX(A2:D9,4,3)
Match 4 MATCH(H6,A2:A9,)
Match-
Index 58339 INDEX(D3:D9,MATCH(H3,A3:A9))
Index - The INDEX function in Excel is used to retrieve a value from a specific
location within a table or range of data. The Syntax for Index is INDEX(array,
row_num, [column_num])
Match - The MATCH function in Excel is used to find the relative position of a
specified value within a range or an array. It can be useful for tasks like
searching for a specific item in a list or determining the position of a value
within a sorted range. The Syntax for match is MATCH(lookup_value,
lookup_array, [match_type])
Index- Match - It is used to search for a value in one column (or row) and then
return a corresponding value from another column (or row) within the same
table.
08 Sep 2023
Practical 9
If, And, Or, Nested if
Name Score Result
Lin 56 Good
Kanishka 98 Bad
Eve 58 Good
Shruti 87 Bad
Riya 88 Bad
Jeetende
r 36 Good
Anurag 79 Bad
IF IF(B3>70,"Bad","Good")
If - the IF function to perform conditional logic and make decisions based on
specified criteria. The IF function has the following syntax: =IF(logical_test,
[value_if_true], [value_if_false])
Name Test 1 Test 2 Result
Riya 68 67 Pass
Siya 53 58 Fail
Kanishka 34 87 Fail
Ashutosh 89 54 Fail
Priyanka 36 90 Fail
Priyansh
u 89 77 Pass
Kartik 57 79 Fail
Keara 66 67 Pass
Kaira 79 77 Pass
IF(AND(B14>60,C14>60),"Pass","Fail"
IF + And )
If + And - The IF function in combination with the AND function to perform
conditional checks with multiple criteria. This allows you to create more
complex logical tests. The AND function checks if all specified conditions are
true and returns TRUE if they are or FALSE if any of them are not true. The
Syntax is =IF(AND(condition1, condition2, ...), value_if_true, value_if_false)
Roll
No. Name Science SST Maths Result
1 Jai 45 67 63 Pass
2 Sia 78 23 51 fail
3 Ria 78 12 49 fail
4 Preeti 56 34 89 fail
5 Abhijeet 68 57 78 Pass
6 Harsh 43 23 15 fail
Shashan
7 k 65 24 76 fail
8 Rimjim 79 25 56 fail
9 Shruti 67 89 93 Pass
10 Ritesh 46 34 35 fail
IF+And+O IF(OR(AND(H3>50,I3>50),AND(I3>50,J3>50),AND(J3>50,I3>50)),"Pass","
r fail")
If+And+Or - The crux of both of the functions is IF function can test only one
condition at a time. And, OR function can test multiple conditions but only
return true/false. And, if we combine these two functions we can test multiple
conditions with OR & return a specific value with IF.
Final
Name Score Result
Luke 89 Distinction
Azad 65 first class
Leo 34 Fail
Klein 87 Distinction
second
Nayan 55 class
Kittu 78 Distinction
Nested IF(G17>=70,"Distinction",IF(G17>=60,"first
Formula class",IF(G17>=50,"second class","Fail")))
22 Sep 2023
Nestedif - Nested IF statements allow you to test multiple conditions in a
sequence, and the result depends on the outcome of the previous condition.
Practical 10
Query 1 – Write a query to create table in SQL Database.
CREATE TABLE SUPSS (
SN VARCHAR (3),
SNAME VARCHAR (15),
STATUS NUMBER (2),
CITY VARCHAR (10));
Query 2 –
DESC SUPSS;
The DESC command is short for "DESCRIBE" and is used to retrieve
information about the columns in a table. To have a table named "SUPSS," we
can use DESC SUPSS.
The output includes information about each column in the "SUPSS" table, such
as SN, SNAME, STATUS and CITY.
Query 3 – Write a query to insert the value in the SUPPS
table?
INSERT INTO SUPSS (SN, SNAME, STATUS, CITY)
VALUES ('S1','RIYA',20,'DELHI');
INSERT INTO SUPSS (SN, SNAME, STATUS, CITY)
VALUES ('S2','PRIYA',10,'PUNE');
INSERT INTO SUPSS (SN, SNAME, STATUS, CITY)
VALUES ('S3','TINA',30,'RAIPUR');
INSERT INTO SUPSS (SN, SNAME, STATUS, CITY)
VALUES ('S4','HAPPY',20,'CHANDIGARH');
INSERT INTO SUPSS (SN, SNAME, STATUS, CITY)
VALUES ('S5','KANISHKA',30,'GURUGRAM');
SELECT * FROM SUPSS;
29 Sep 2023
Practical 11
Query 4 -
SELECT * FROM AD.AD_ACADEMIC_SESSION;
Query 5 -
SELECT MIN (SESSION_ID) FROM AD.AD_ACADEMIC_SESSION;
Query 6 -
SELECT MAX (SESSION_ID) FROM AD.AD_ACADEMIC_SESSION;
Query 7 - Create a table named 'STUDENT' with the
following columns: 'ROLL_NO', 'NAME', and 'DEPT'.
CREATE TABLE STUDENT (
ROLL_NO INT,
NAME VARCHAR (15),
DEPT VARCHAR (20));
DESC STUDENT;
Query 8 - Insert the given values into the table created in
the earlier query.
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('1','SMITH','ANALYTICS');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('2','JONES','IT');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('3','BLAKE','ANALYTICS');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('4','CLARK','FINANCE');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('5','ADAMS','MARKETING');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('6','SAM','ANALYTICS');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('7','ANA','IT');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('8','MARRY','HR');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('9','JOHN','OPERATIONS');
INSERT INTO STUDENT (ROLL_NO, NAME, DEPT)
VALUES ('10','HARRY','MARKETING');
SELECT * FROM STUDENT;
QUERY 9 – Write a query to give the count of departments.
SELECT COUNT(ROLL_NO), DEPT
FROM STUDENT
GROUP BY DEPT;
06 Oct 2023
UNIT 4 – An Introduction to Python Programming Language
Practical 12
Query 1 - Print your name roll no. college name in same line.
print("AKASH 004 JK BUSINESS SCHOOL")
Query 2 - Print your name, roll no., and college name in
multiple line.
print("AKASH\n 004\n JK BUSINESS SCHOOL")
Query 3 -
a=b=10
print(type(a))
print(id(a))
print(type(b))
print(id(b))
Query 4 –
a=10
print(type(a))
print(id(a))
a=10.2
print(type(a))
print(id(a))
a="Hello"
print(type(a))
print(id(a))
a=True
print(type(a))
print(id(a))
Query 5 –
#list
p=[]
print(type(p))
print(id(p))
p=[1,1.2,"Hello"]
print(p)
#TUPLE
p=()
print(type(p))
print(id(p))
p=[1,1.2,"Hello"]
print(p)
#DICTIONARY
p={}
print(type(p))
print(id(p))
p=[1,1.2,"Hello"]
print(p)
Query 6 –
a=10
if(a>10):
print("num is >10")
elif(a<10):
print("num is <10")
else:
print("num is =10")
Query 7 –
x=20
y=6
print("x+y+", x+y)
print("x-y+", x-y)
print("x*y+", x*y)
print("x/y+", x/y)
print("x//y+", x//y)
print("x%y+", x%y)
print("x**y+", x**y)
Query 8 –
marks= 85
if(marks >90 and marks <=100):
print("A")
elif(90>=marks >80):
print("B")
else:
print("fail")
Practical 13
Query 1 –
for x in range(0,10):
print(x,end=" ")
Query 2 -
for x in range(0,10):
print(x)
Query 3 –
for x in range(0,10,3):
print(x,end=" ")
Query 4 -
for x in range(2,51,2):
print(x,end=" ")
Query 5 -
for x in range(10,0,-1):
print(x,end=" ")
Query 6 –
#list
l=[1,3,5,7]
for x in l:
print(x)
Query 7 -
#tuple
l=(1,2,3,4,6,7,8)
for x in l:
print(x)
Practical 14
Query 1 -
x=1
while x <= (10):
print(x)
x += 1
Query 2 -
x=1
while x <= (10):
print(x,end=" ")
x += 1
Query 3 –
#list
l=[1,2,3,4,5]
x=0
while x<len(l):
print(l[x])
x+=1
Query 4 -
#tupple
l=(1,2,3,4,5)
x=0
while x<len(l):
print(l[x])
x+=1
Query 5 -
x = 10
while x >= 1:
print(x, end=" ")
x -= 1
Query 6 -
while x < 10:
print(x, end=" ")
x += 3
Query 7 -
x=2
while x <= 50:
print(x, end=" ")
x += 2