Python for Databases

Key syntaxes

  1. Creating a table
    • CREATE TABLE Users (name TEXT, age INTEGER, email TEXT)
  2. Inserting an instance
    • INSERT INTO Users VALUES (‘Charles’, 20, ‘charles@abc.df’)
  3. Deleting an instance
    • DELETE FROM Users WHERE email=’charles@abc.df’
  4. Selecting an instance
    • SELECT * FROM users WHERE email=’charles@abc.df’ ORDER BY name
  5. Updating an instance
    • UPDATE Users SET name=’mike’ WHERE email = ‘charles@abc.df’

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s