Project 2
answers are given below
in the 5 th answers once i uploaded but not showing my data thats way i have to run and take screenshots for that question check it once
4.
i have to run on jupitor and save my code and while submitted my file was not uploading im trying so many times but not uploaded so im joined for mentoring session and that mentor was give a suggestion as take a screenshots and code also uploaded .thats way i have to paste my code as im running . so check it my code
import mysql.connector
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_a_hs limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_a_hs are:")
for b in a:
print(b)
print('-'*100)
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_a_se limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_a_se are:")
for b in a:
print(b)
print('-'*100)
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_a_sj limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_a_sj are:")
for b in a:
print(b)
print('-'*100)
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_b_hs limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_b_hs are:")
for b in a:
print(b)
print('-'*100)
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_b_se limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_b_se are:")
for b in a:
print(b)
print('-'*100)
collegedb=mysql.connector.connect(host="localhost",user="root",password="Padma@72",database="alumni")
collegecursor=collegedb.cursor()
collegecursor.execute("select*from college_b_sj limit 1000")
a=collegecursor.fetchall()
print("the first 1000 rows in the table college_b_sj are:")
for b in a:
print(b)
print('-'*100)