4. Creating and Manipulating your own Databases - upalr/Python-camp GitHub Wiki

1 Creating Databases and Tables

1.1 Creating Databases

1

1.2 Building a Table

2

1.3 Creating Tables

3

1.4 Creating Tables - Additional column options

4

1.5 Building a Table with Additional Options

5

2 Inserting Data into a Table

2.1 Adding data to a table

6

2.2 Inserting One Row

7

2.3 Inserting Multiple Rows

8 9

2.4 Exercise

https://campus.datacamp.com/courses/introduction-to-relational-databases-in-python/creating-and-manipulating-your-own-databases?ex=7

3 Updating Data in a Database

3.1 Updating Data in a Table

10

3.2 Updating One Row

11

3.3 Updating Multiple Rows

12

13

3.4 Correlated Updates

You can also update records with data from a select statement. This is called a correlated update. It works by defining a select statement that returns the value you want to update the record with and assigning that as the value in an update statement.

14 15

Example : for better understanding

https://campus.datacamp.com/courses/introduction-to-relational-databases-in-python/creating-and-manipulating-your-own-databases?ex=9

Example

https://campus.datacamp.com/courses/introduction-to-relational-databases-in-python/creating-and-manipulating-your-own-databases?ex=11

4 Removing Data From a Database

4.1 Deleting Data from Database

16

4.2 Deleting all data from a table

17

4.3 Deleting specific rows

18 19

4.4 Dropping a table completely

20 21

4.5 Dropping all the tables

22 23