Easy way to get 15 free YouTube views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

Database Constraints - What they are and How to use them

Follow
Q Visible

Once you've gotten used to setting up tables and relating them together using primary and foreign keys you've reached a major milestone.

However if you share your database with colleagues or users without any safety measures, you're leaving your database open to problems. Especially when it comes to managing your data and keeping the integrity of your database intact!

In this tutorial we get into parent and child relationships and how you don't want to leave any children in a database as orphans by deleting the parent record! We can prevent this form happening by putting rules or database constraints in place.

After I've gone through the theory I then move onto create a constraint in a sample database through phpMyAdmin. I also show the SQL statement needed if you're working with another relational database.

posted by reinaemily6h