forked from CarlosAlexandre197/DataBase_SQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCadastro_Membros.py
25 lines (20 loc) · 1015 Bytes
/
Cadastro_Membros.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''Cadastro de Visitantes ADSAM 317 ano 2024'''
print('Vamos começar!!!')
id = input('Data: ')
nome = input('Nome: ')
endereco = input('Endereço: ')
cidade = input('Cidade: ')
telefone = input('Telefone: ')
whatsapp = input('Whatsapp: ')
visitas = input('Deseja receber visitas? ')
convertido = input('É novo convertido? ')
import sqlite3
conexao = sqlite3.connect('Cadastro_de_Membros.DB')
cursor = conexao.cursor()
cursor.execute("CREATE TABLE Cadastro_de_Membros (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, Data TEXT, Nome TEXT, Endereço TEXT, Cidade TEXT, Telefone TEXT, Whatsapp TEXT, Visitas TEXT, Convertido TEXT)")
planilha_de_dados = ("INSERT INTO Cadastro_de_Membros (id, Nome, Endereço, Cidade, Telefone, Whatsapp, Visitas, Convertido) VALUES(?, ?, ?, ?, ?, ?, ?, ?)")
valores = [id, nome, endereco, cidade, telefone, whatsapp, visitas, convertido]
cursor.execute(planilha_de_dados, valores)
conexao.commit()
print('<<<Dados inseridos com sucesso!>>>')
conexao.close