Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /usr/bin/python2.7
- __author__ = 'Mertcan Gokgoz'
- import random
- import decimal
- from faker import Factory
- fake = Factory.create('tr_TR')
- uret_random = raw_input("Kac Adet Kayit Gerekiyor: ")
- def mysql_random_employees():
- for _ in range(0, int(uret_random)):
- name = "'" + fake.first_name() + "'"
- surname = "'" + fake.last_name() + "'"
- email = "'" + fake.email() + "'"
- phone = str(fake.phone_number())
- hire_date = "'" + str(fake.date_time()) + "'"
- job_id = str(random.randint(0, 9))
- salary = str(decimal.Decimal(random.randrange(1000)) / 8)
- comission = str(decimal.Decimal(random.randrange(100)) / 4)
- manager_id = str(random.randint(0, 9))
- department_id = str(random.randint(0, 9))
- print "INSERT INTO EMPLOYEES VALUES(NULL," + name + "," + surname + "," + email + "," + phone + "," + hire_date + "," + job_id + "," + salary + "," + comission + "," + manager_id + "," + department_id + ");"
- mysql_random_employees()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement