This content originally appeared on DEV Community and was authored by Mark Mahoney
This is a short introduction to relational database design and the Structured Query Language (SQL). Many people organize their electronic data into spreadsheets. This works great if the data is simple, small, and not likely to be tracked for very long periods of time. However, when you have more sophisticated, larger, and long-lived data sets the spreadsheet approach breaks down. In these examples I discuss why this is the case and how to build and query relational databases.
I use a relational database management system called SQLite. SQLite is one of my favorite tools. It is an open-source, full-featured relational database management system where an entire database is stored in a single file. I also use an accompanying tool called 'DB Browser for SQLite' because it provides a nice user interface to interact with SQLite databases.
I start by discussing what makes a good database design. I explain entity-relationship diagrams and schemas. These modeling tools aide in the design of a database. I talk about one-to-many and many-to-many relationships and how to use them in a relational database. Perhaps most importantly, though, I cover the basics of SQL so that you can retrieve meaningful information from your databases.
Each of the three links below will take you to a 'playback' that shows how I wrote some SQL to build and query a database for a fictitious pet adoption center. There are some videos that go along with the changes in the editor window. I move pretty fast in these playbacks so it is important that you spend some time after each of my comments to try and fully understand the SQL in the editor window.
1.1 Database Design and Simple SQL
1.2 One-to-Many Relationships and More SQL
1.3 Many-to-Many Relationships and Even More SQL
If you are curious about how to use SQLite databases in different programming languages then check out my other 'book', Programming with SQLite. This shows how to use SQLite in a C/C++, Python, and Java programs. If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: @markm208 .
This content originally appeared on DEV Community and was authored by Mark Mahoney
Mark Mahoney | Sciencx (2021-06-01T22:02:51+00:00) Database Design and SQL for Beginners. Retrieved from https://www.scien.cx/2021/06/01/database-design-and-sql-for-beginners/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.