CS50 Week 7: Manipulating Data with SQL

Week 7 SQL

Welcome to week-7, its been two months since I enrolled in the Harward University's introduction to the intellectual enterprises of computer science and the art of programming course, CS50. This week we learned about SQL, the structured query language used to manage relational databases. In today's world, there is lots and lots of data generated everyday and to get something out of it we need to manipulate it, and there comes a powerful tool to do the same "SQL".

Lecture

The lecture begins with a demonstration of data manipulation with a dataset named favourites.csv (csv stands for comma seperated values) with python which we learned the last week. Through python we learned to read data from a csv file with the help of a 'csv' library.

Then David introduced us with databases and SQL, basic concepts of SQL and how it differs from other programming languages. SQL is a declarative language that allows us to interact with databases by querying data. Then we learned the basic CRUD (create, read, update and delete) operations and how to implement them with sqlite3.

Lastly, we learned about tables, joining tables, indexes(used to decrease the implementation time for a query, but with a trade off with memory). Used sql in python with the help of cs50 library and learned about race conditions and sql injection attacks.

Conclusion

The ability to manipulate and query large datasets is a powerful skill in today's data-driven world. From understanding the basics of databases to implementing CRUD operations with SQLite3, we were able to gain a strong foundation in SQL.