Guest User

Untitled

a guest
Nov 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. # Assingment 27
  2. from mysql.connector import (connection)
  3.  
  4. cnx = connection.MySQLConnection(user='vishal', password='12345',host='localhost',database='db1')
  5. mycursor = cnx.cursor()
  6. mycursor.execute("create table Users(Emailid varchar(20), pass varchar(20), usertype varchar(20))")
  7. mycursor.execute("create table job_Posted(Jobpostid varchar(20), companyid varchar(20), jobpostdate varchar(20), validityDate varchar(20), joblocation varchar(20), skillsets varchar(20), yrsofexp varchar(20), qualifyingtestscore varchar(20), jobpostedstatus varchar(20))")
  8. mycursor.execute("create table Jobseeker_Personal(firstname varchar(20), lastname varchar(20), dateofbirth varchar(20), emailid varchar(20), mobile varchar(20), city varchar(20), state varchar(20), country varchar(20), passportno varchar(20))")
  9. mycursor.execute("create table Jobseeker_Resume(jobseekerid varchar(20), emailid varchar(20), ug_qualification varchar(20), pg_qualification varchar(20), keyskills1 varchar(20), keyskills2 varchar(20), additionalskills varchar(20), yrsofexp varchar(20), curremployer varchar(20), designation varchar(20), curr_CTC varchar(20), exp_CTC varchar(20))")
  10. mycursor.execute("create table Employer(companyid varchar(20), companyname varchar(20), emailid varchar(20), mobile varchar(20), city varchar(20), industrytype varchar(20), functionalarea varchar(20), membershipplan varchar(20), dateofsignup varchar(20), dateofrenewal varchar(20), renewalstatus varchar(20))")
  11. mycursor.execute("create table Job_Applied(applicationid varchar(20), jobseekerid varchar(20), jobpostid varchar(20), applicationdate varchar(20), jobtestvalidityDate varchar(20), Attempt varchar(20), jobteststatus varchar(20), jobtestscore varchar(20), jobtestresult varchar(20))")
  12.  
  13. #(i)
  14. mycursor.execute("select 'firstname' from Jobseeker_Personal")
  15. # (ii)
  16. mycursor.execute("select * from Job_Posted where 'yrsofexp'<=2")
  17. mycursor.execute("select * from Job_Posted where 'yrsofexp'>=2 and 'yrsofexp'<8")
  18. mycursor.execute("select * from Job_Posted where 'yrsofexp'>=8")
  19. #(iii)
  20. mycursor.execute("select 'jobseekerid' from Jobseeker_Resume where ORDER BY 'designation' and 'exp_ctc'>1000000")
  21. #(iv)
  22. mycursor.execute("select 'jobpostid', MONTH('jobpostdate') from Job_Posted")
  23. #(v)
  24. mycursor.execute("select 'companyid' from Employer where MONTH('dateofrenewal')<='dec'")
  25. #(vi)
  26. mycursor.execute("select * from jobseeker_Resume where (('curr_CTC'/'exp_CTC')*100)>=30")
  27. myresult = mycursor.fetchall()
  28. for x in myresult:
  29. print(x)
  30. cnx.commit()
  31. mycursor.close()
  32. cnx.close()
Add Comment
Please, Sign In to add comment