0% found this document useful (0 votes)
42 views44 pages

Okay

Uploaded by

bhuvimongia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views44 pages

Okay

Uploaded by

bhuvimongia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 44

INDEX

・Create a Pandas Series from a dictionary and array.


・Given a Series, print all the elements that are above the 75th
percentile.
・Create a Data Frame quarterly sales where each row contains
the item category, item name, and expenditure. Group the rows
by the category.
・Create a data frame based on ecommerce data and generate
descriptive statistics (mean, median, mode, quartile, and
variance).
・Create a data frame for examination result and display row
labels, column labels data types of each column and the
dimensions.
・Filter out rows based on different criteria such as duplicate rows.
・Find the sum of each column, or find the column with the lowest
mean.
1 Create a pandas series from a dictionary of values,array.
#2. Given a Series, print all the elements that are above the 75th percentile.
#3 Create a Data Frame quarterly sales where each row contains the item
category, item name, and expenditure. Group the rows by the category,
and
#4. Create a data frame based on ecommerce data and generate descriptive
statistics (mean, median, mode, quartile, and variance).
#5. Create a data frame for examination result and display row labels, column
labels data types of each column and the dimensions
#6. Filter out rows based on different criteria such as duplicate rows.
#7. Find the sum of each column, or find the column with the lowest mean.
#8. Locate the 3 largest values in a data frame.
#9. Subtract the mean of a row from each element of the row in a Data Frame.
#10. Replace all negative values in a data frame with a 0.
#11. Replace all missing values in a data frame with a 999.
#12. Importing and exporting data between pandas and CSV file
#13. Importing and exporting data between pandas and MySQL database.

Importing Data from MySQL to Data Frame.


Exporting data from Data Frame to MYSQL.
#14. Given the school result data, analyse the performance of the students on
different parameters, e.g subject wise or class wise.
#15. For the Data frames created above, analyze and plot appropriate charts
with title and legend.
#16. Take data of your interest from an open source (e.g. data.gov.in), aggregate
and summarize it. Then plot it using different plotting functions of the Matplotlib
#17. Create a student table with the student id, name, and marks as attributes
where the student id is the primary key.

#18. Insert the details of a new student in the above table.

#19. Delete the details of a particular student in the above table.


#20. Use the select command to get the details of the students with marks
more than 80.

#21. Create a new table (order ID, customer Name, and order Date) by joining
two tables (order ID, customer ID, and order Date) and (customer ID, customer
#22. Create a foreign key in one of the two tables mentioned above

#23. Find the min, max, sum, and average of the marks in a student marks table.

#24. Find the total number of customers from each country in the table
(customer ID, customer Name, country) using group by.
#25. Create a new table (name, date of birth) by joining two tables (student id,
name) and (student id, date of birth).

#26. Write a SQL query to order the (student ID, marks) table in descending order
of the marks.
ASSIGNMENT -1
Q1) Create the database loans.

Q2)Use database Loans.

Q3) Create the table_ACCOUNTS and insert tuples in it.

Q4) display the details of account


Q5) Display the accno,cust_name,and loan_amount of all the loans.

Q6) Display the details of all the loans with less than 40 installment.

Q7) Display the accno. and loan amount of all the loans started before 01-04-
2009
Q8) Display the Int_rate of all the loans started after 01-04-2009.

Q9) Display the details of the loans whose rate of interest is null.

Q10)Display the details of all the loans whose rate of interest is not null.

Q11)Display the number of installment of various loans from the table account.
A loan should be appear only once.
Q12) Display the number of installment of various loans from the table account.
An installment should be appear only once

Q13)Display the details of all the loans started after


31-12-2008 for which number of installment are more than 36.

Q14)Display the cust_name and loan_amount for all the loans which donot have
number of installment 36

Q15)Display the cust_name and loan_amount of all the loans for which the loan
amount is less than 500000 or int_rate is more than 12
Q16)Display the details of loans which started in the year 2009.

Q17)Display the details of all the loans whose loan_amount is in the range
400000 to 500000

Q18) Display the details of all the loans whose int_rate is in the range 11% to
12%

Q19) Display the cust_name and loan_amount of all the loans for which the
number of installments are 24,36,48
Q20) Display the details of all the loans whose loan_amount is in the range
400000 to 500000.

Q21) ) Display the details of all the loans whose int_rate is in the range 11% to
12%.

Q22) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name ends with “Sharma”

Q23) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name ends with “a”.
Q24) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name contain with “a”.

Q25) Display the accno,cust_name,and loan_amount of all


the loans for which cust_name does not contain with “p”.
Q26) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name contains a as the second last character.

Q27)Display the details of all the loans in ascending order of their loan amount.

Q28) Display the details of all the loans in descending order of their start date.
Q29) Display the details of all the loans in ascending order of their loan amount
and within loan amount in the descending order of the start date.

Q30) Put the intrest rate 11.5% for all the loans for which intrest rate is null.

Q31) Increase intrest rate by 0.5% for all the loans for which the loan amount is
more the 400000.

Q32) For each loan replace intrest (loan amount*int rate *installment)12*100.

Q33) Delete the record of all the loans who start date is before 2007.
Q34) delete the record of all the loans of k.p. jain.

Q35)Add another column category of type CHAR(1) in the loan table

Q36)Display the sum of loan amount whose int rate is greater than 10 .

Q37)Display the max. interest from loan table.

Q38)Display the count of all loan holder whose name ends with Sharma.
Q39) Display the count of all loan holder whose int.rate is null

Q40)Display the interest wise detail of loan account holder.

Q41) Display the interest wise detail of loan account with atleast 10 installment
remaining
ASSIGNMENT-2

Q)Consider the following table homework and write answers for below given
questions:

1)select lcase(pname) from products where pname=’LED TV’;

2) select sqrt(price) from products where price>5000;


3) select mod(qty,3) from homework;

4) select substr(company,1,4) from homework;

5) select concat(concat(pname,”-“),qty)from homework where


company=’Apple’;
6) select pname,truncate(mod(price,103)) from homework where qty>100;

ASSIGNMENT 3
Q) Consider the following table named GYM with details about fitness products
being sold in the store.

a) Display the names of all the products in the store.


Ans)

b) Display the names of all the products with unit price less than Rs.20000.

c) Display the details of all the products with unitprice in range 20000 to
30000.

d) Display the names of all the products by the manufacturer “avon


fitness” in descending order of unit price.

e)
f) Change the unit price data of all the rows by applying a 10% increased
on all the products.
Ans)

g) Remove all the products rows manufactured by avon fitness.

h) Display the details of all the products with manufacturer name starting
with A.

You might also like