This is my 27 day of #100DayOfCode and #python. Today I did some code on class inheritance with the help of goggle and textbook of coursera. Learned Database on python. In database on python I learned to make simple database table with the help of DB Browser.
Here is some database today I learned from coursera.
A database is a file that is organized for storing data. Most databases are organized like a dictionary in the sense that they map from keys to values. The biggest difference is that the database is on disk (or other permanent storage), so it persists after the program ends. Because a database is stored on permanent storage, it can store far more data than a dictionary, which is limited to the size of the memory in the computer.
import sqlite3 conn = sqlite3.connect("example.db")
The code to create a database file and a table named Tracks with two columns in the database is given above. The connect operation makes a “connection” to the database stored in the file in the current directory.
c = conn.cursor() #create table c.execute("""CREATE TABLE Users (Name variable(128), sname, person)""")
A cursor is like a file handle that we can use to perform operations on the data stored in the database. Calling cursor() is very similar conceptually to calling open() when dealing with text files. In above code we can create table name Users having the two column with name and person.