Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Reto 1: Primera tabla | Introduction to SQLite
SQL in Python Projects

Reto 1: Primera tablaReto 1: Primera tabla

Completa todas las partes de la tarea en secuencia

  • 📁 Crear un nuevo proyecto en PyCharm.
  • 📝 Crea un nuevo archivo python.
  • 📚 Importar la librería sqlite3.
  • 🗄 Crear una nueva base de datos
  • 🤚 Crear un `cursor
  • 📄 Crea una tabla llamada articles con los siguientes campos: ``sql id INTEGER título TEXTO contenido TEXTO autor TEXTO
1. It is recommended to do ...
2. Some text It is how code looks like text again
3. Use such method.

    # Import the sqlite3 library
    import sqlite3
    
    # Create a new database (or connect to an existing one)
    connection = sqlite3.connect("my_database.db")
    
    # Create a cursor
    cursor = connection.cursor()
    
    # Create a table named "articles" with the specified fields
    cursor.execute('''
        CREATE TABLE articles (
            id INTEGER,
            title TEXT,
            content TEXT,
            author TEXT
        )
    ''')
    
    # Save the changes and close the database connection
    connection.commit()
    connection.close()
      

¿Todo estuvo claro?

Sección 2. Capítulo 5
course content

Contenido del Curso

SQL in Python Projects

Reto 1: Primera tablaReto 1: Primera tabla

Completa todas las partes de la tarea en secuencia

  • 📁 Crear un nuevo proyecto en PyCharm.
  • 📝 Crea un nuevo archivo python.
  • 📚 Importar la librería sqlite3.
  • 🗄 Crear una nueva base de datos
  • 🤚 Crear un `cursor
  • 📄 Crea una tabla llamada articles con los siguientes campos: ``sql id INTEGER título TEXTO contenido TEXTO autor TEXTO
1. It is recommended to do ...
2. Some text It is how code looks like text again
3. Use such method.

    # Import the sqlite3 library
    import sqlite3
    
    # Create a new database (or connect to an existing one)
    connection = sqlite3.connect("my_database.db")
    
    # Create a cursor
    cursor = connection.cursor()
    
    # Create a table named "articles" with the specified fields
    cursor.execute('''
        CREATE TABLE articles (
            id INTEGER,
            title TEXT,
            content TEXT,
            author TEXT
        )
    ''')
    
    # Save the changes and close the database connection
    connection.commit()
    connection.close()
      

¿Todo estuvo claro?

Sección 2. Capítulo 5
some-alt