Reputation
16,059
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
3 29 58
Newest
 Copy Editor
Impact
~1.1m people reached

Jul
27
comment Is it reasonable to mark all columns but one as primary key?
Btw: adding the title to the PK or a unique constraint won't really help that much. Because you won't catch duplicates that differ in case or spelling e.g. The Fifth Element and The fifth element will be considered different titles (or think of numbers in sequels, Part 2 vs. Part II) Same goes for the genre: SF vs ScienceFiction vs. Science Fiction (for genre I would probably create a lookup table and reference that from the movies table)
Jul
27
comment Is it reasonable to mark all columns but one as primary key?
From my point of view: yes. Because you can easily create FK constraints pointing to that table. And you can change the conditions for uniqueness without affecting the PK
Jul
27
comment Is it reasonable to mark all columns but one as primary key?
I'd go for the second solution (add additional unique indexes to enforce uniqueness).
Jul
26
comment Why seq-scan can be much faster than index-scan and index-only-scan in this simple query?
Post the output of explain (analyze, buffers, verbose) for both executions
Jul
26
comment Why seq-scan can be much faster than index-scan and index-only-scan in this simple query?
5k is small
Jul
25
comment Foreign key default value
I added the tag because the question stated MySQL ;)
Jul
25
comment Foreign key default value
MySQL will silently ignore the foreign keys the way you defined them. You need to define them as a separate constraint, not inline with the column.
Jul
25
comment How can I specify the DDL of the index that is implicitly created when creating a materialized view log?
Another workaround could be to change the tablespace of the index after the mview log was created - but of course the required index rebuild might take a while
Jul
24
comment Two columns into three and add rows automatically
You should rather fix your data model. This is horrible
Jul
24
comment “Cut” records from one table into another in one oracle sql statement
The delete part of a merge statement will delete rows in the target table - in your case T2. It will not delete rows from the "source" table. There is no way you can do that with a single statement in Oracle. You will need two statements.
Jul
22
comment Oracle instant client
The JDBC driver does not need any installation at all. And it also does not need an Oracle client. All you need to do is to copy the driver's jar file to the client where the Java program is running.
Jul
22
comment PostgreSQL - what do tms and mt mean in a SELECT query?
For future reference: the relevant chapter in the manual is in "Chapter 7 - Queries". In there it's in the section "Select lists/Column labels": postgresql.org/docs/current/static/…
Jul
21
comment Oracle ODBC Driver, Tables and Columns Remarks
I don't know about ODBC, but the JDBC driver needs to be explicitly told to return column remarks (using a connection property named remarksReporting)
Jul
21
comment PostgreSQL visibility of records changes from other transaction inside the current one
What you are seeing is the result of the "READ COMMITTED" isolation level. It seems that you want the isolation level REPEATABLE READ (or even SERIALIZABLE)
Jul
21
comment How to name a new table storing location at which transaction occurred
I just wanted to point out that for some DBMS (especially those that follow the SQL standard) FooBar will be stored as FOOBAR and thus the camel casing doesn't really make sense because it's lost
Jul
20
comment How to name a new table storing location at which transaction occurred
"Pascal casing" is not such a good idea FooBar and FOOBAR are the same names in (standard) SQL. snake_case should be preferred.
Jul
20
comment Limiting read access in postgres to few rows
This will be possible with the upcoming 9.5 through "row level security": postgresql.org/docs/9.5/static/sql-createpolicy.html
Jul
20
comment Using an UPDATE trigger to populate Eastings and Northings in PostgreSQL
Yes, that's possible - but you need to provide more details. At least the create table statement for your table.
Jul
20
comment How to full text search worked with special character like “of”?
Added sql-server tag based on the usage of [..]
Jul
17
comment Sending a database dump
@Vérace: because the real problem is to send a large amount of sensitive data to someone. The fact that this is a database dump is not relevant for this question and thus it has nothing to do database administration. The problem would be the same if the data was a 1.5 GB list of credit card numbers or other personal information.