mardi 8 mars 2016

Database design and python in SQLite

Im looking to take network scan data such as hostname, IP address, ports, company name and store it in a database. I will then be comparing new scan data with old, looking for variations (additions). I thought its a great oppertunity to get my hands dirty with some db design and in turn a better understanding of DBs.

Ive had a think about the design and from what I understand (from reading around) I have come up with the below, now I am by no means a DBA so I am still a little confused around the use of the primary key. I will of course need to be able to tie up all the tables with the relevant data.

Is my understanding correct in that I have a PK for each table and join the tables using those PKs when doing select statements?

So for instance if I want to get all the hosts and ports for CompanyA:

select CompanyA from Company, Hosts, Ports

Im sure the syntax is incorrect however I am just trying to confirm my understand of the PKs and how they work. Of course any help on what a correct statement should look like would be welcome.

If you feel this post deserves a down vote, please at least let me know why.

Design

Aucun commentaire:

Enregistrer un commentaire