Skip to content
Magenaut

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

unique-constraint

Unique constraint by 2 columns where one has a specific value

November 26, 2022 by Magenaut

I have a problem with UNIQUE CONSTRAINT.

Categories MySQL, Q&A Tags mysql, unique-constraint Leave a comment

How do I specify unique constraint for multiple columns in MySQL?

November 24, 2022 by Magenaut

I have a table:

Categories MySQL, Q&A Tags composite-key, database-table, mysql, unique-constraint Leave a comment

How can I do ‘insert if not exists’ in MySQL?

November 24, 2022 by Magenaut

I started by googling and found the article How to write INSERT if NOT EXISTS queries in standard SQL which talks about mutex tables.

Categories MySQL, Q&A Tags mysql, primary-key, sql, sql-insert, unique-constraint Leave a comment

Does MySQL ignore null values on unique constraints?

November 23, 2022 by Magenaut

I have an email column that I want to be unique. But I also want it to accept null values. Can my database have 2 null emails that way?

Categories MySQL, Q&A Tags database, mysql, unique-constraint Leave a comment

MySQL – Make an existing Field Unique

November 23, 2022 by Magenaut

I have an already existing table with a field that should be unique but is not. I only know this because an entry was made into the table that had the same value as another, already existing, entry and this caused problems.

Categories MySQL, Q&A Tags mysql, unique-constraint Leave a comment

MySQL: ALTER IGNORE TABLE gives “Integrity constraint violation”

November 22, 2022 by Magenaut

I’m trying to remove duplicates from a MySQL table using ALTER IGNORE TABLE + an UNIQUE KEY. The MySQL documentation says:

Categories MySQL, Q&A Tags mysql, unique-constraint Leave a comment

SQL unique varchar case sensitivity question

November 22, 2022 by Magenaut

I’m trying to populate a SQL table with a list of words. The table itself it pretty simple:

Categories MySQL, Q&A Tags case-sensitive, mysql, sql, unique-constraint, varchar Leave a comment

MySQL delete multiple rows in one query conditions unique to each row

November 21, 2022 by Magenaut

So I know in MySQL it’s possible to insert multiple rows in one query like so:

Categories MySQL, Q&A Tags multiple-records, mysql, unique-constraint Leave a comment

Quickest way to check for pre-existing record before insert [mysql_errno()]

November 17, 2022 by Magenaut

My question will use emails as an example, but this could apply to anything.

Categories MySQL, Q&A Tags error-handling, insert, mysql, php, unique-constraint Leave a comment

Unique constraint replaces existing foreign key

September 6, 2022 by Magenaut

I have two tables, parent and child, the child table has a FK on the parent table using the parent_id column. When adding this FK I can see that the child table has both the FK and an index to represent that FK.

Categories Database Administrators, Q&A Tags foreign-key, index, mysql, unique-constraint Leave a comment
Older posts
Page1 Page2 Next →

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress