How do you add, drop, and rename constraints in SQL? In this video, we'll take a look at how to use ADD CONSTRAINT, DROP CONSTRAINT, and RENAME CONSTRAINT. We'll also take a look at how to replace SQL constraints in your schema by using SQL transactions to execute the drop and add statements together.
(See below for the links mentioned in the video to get additional help working with your database schema, and to learn how to make schema changes without downtime.)
00:00 What are SQL constraints?
00:21 What is the basic syntax for adding a SQL constraint? (Primary key)
00:45 How to add a foreign key
01:19 How to add a check constraint
01:39 How to drop a constraint
02:12 How to rename constraints
02:24 The impact of schema changes on downtime
02:54 How CockroachDB lets you perform schema changes with no downtime
Additional resources:
💻 Blog: How to use ADD CONSTRAINT in SQL (with examples): https://cockroa.ch/3u592DR
⏯️ Video: What is a Foreign Key Constraint? Understanding Primary & Foreign Keys • What is a Foreign Key Constraint? Und...
⏯️ Video: How to change your Foreign Keys: • Terror free online schema changes | H...
⏯️ Video: How to perform zero downtime online schema changes
• How to perform zero downtime online s...
🪳 Learn more about CockroachDB: https://cockroa.ch/48Caywx
Follow Cockroach Labs
✔️ Website: https://cockroachlabs.com/
✔️ Twitter (X): / cockroachdb
✔️ Linkedin: / cockroach-labs
✔️ Facebook: / cockroachlabs
✔️ Instagram: instagram.com/cockroachdb
✔️ Threads: https://www.threads.net/@cockroachdb
#sql #sqlforbeginners #database #distributedsql #cockroachdb
Смотрите видео How to use ADD CONSTRAINT in SQL (with examples) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь CockroachDB 18 Январь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,463 раз и оно понравилось 19 людям.