database

Should I use an index column in a many to many "link" table?

I have two tables, products and categories which have a many to many relationship, so I'm adding a products_categories table which will contain category_id and product_id. Should I add another (autoincrementing) index column or use the two existing ones as primary key? ...

Database on file server (Windows)

I am working for a company and I need to create a program really fast. My program will run with 100 users and they will make approximately 100 transactions each per day. As I am under time pressure, and various other constraints it is not possible to set up a proper database running on a server. I am therefore looking for alternatives th...

SQL inserts and stored procedures

Hi all, Are there any performance gains in using stored procedures for simple SQL inserts into tables over using direct SQL from java / JDBC? in my case I am using sybase but this could be a more general question. Thanks ...

Which database should I use for home project use?

I've looked through all the "related questions" with two or three different titles and didn't see anything, so here goes. I've used SQL Server and Oracle in the recent past at work. I want to futz around at home, mostly with Java, perhaps with Ruby on Rails or Python. I'm running Windows 7. I usually make web applications, might like...

Order of index on multiple columns

Just a simple question, but does the order of your index matter when it spans over multiple columns? For example, taking the query: SELECT * FROM my_table WHERE (column_1 = 1 AND column_2 = 2) If I want to add an index for a query like this, does it matter if my index is created like this: CREATE INDEX my_index ON my_table (column...

is it better to store platform configuration in database or a file?

currently we are developing an app in which we use database table to store platform settings, like maximum file size, maximum users number, support email, etc. it means that each time we add a platform setting we have to add a column to this table. in my previous projects i am used to store such information in file. what is better/fa...

More efficient to store text as file or in DB?

Imagine you're dealing with many strings of text that are about 10,000 characters long entered by users. Would it be more efficient to write those automatically onto pages or input them onto a table in a database? I hope that question is clear enough... ...

Match a Query to a Regular Expression in SQL?

Hi! I'm trying to find a way to match a query to a regular expression in a database. As far as I can tell (although I'm no expert), while most DBMS like MySQL have a regex option for searching, you can only do something like: Find all rows in Column 1 that match the regex in my query. What I want to be able to do is the opposite, i.e.:...

how to echo special characters like åäö with utf8

specialcharacters åöö in the database cant be shown when i retrieve the rows and echo it. what can i do to have them shown propertly? ...

show new lines and spaces?

im coding a guestbook and i want new lines and spaces to be shown when i show the posts? when i post a thread now everything is shown on one line. help! ...

inserting rows from one table to another, which sql is more efficient (outer join vs sequential scan)

I need to copy over rows from Table B to Table A. The requirement is to only insert rows that are not already in A. My question is, which is of the the following two is more efficient: A) INSERT INTO A (x, y, z) SELECT x, y, z FROM B b WHERE b.id NOT IN (SELECT id FROM A); B) INSERT INTO A (x, y, z) SELECT b.x, b....

Currency modeling in database

Hi, A very naive question. I need to store currency in the database. Both the value and the code. To solve this, do people generally make 2 columns, one storing the value and other the code? Or is there an inbuilt type I can use? -thanks ...

Indexing boolean fields

This is probably a really stupid question, but is there going to be much benefit in indexing a boolean field in a database table? Given a common situation, like "soft-delete" records which are flagged as inactive, and hence most queries include WHERE deleted = 0, would it help to have that field indexed on its own, or should it be combi...

Entity names vs table names

We are going to develop a new system over a legacy database(using .NET C#).There are approximately 500 tables. We have choosen to use an ORM tool for our data access layer. The problem is with namig convention for the entities. The tables in the database have names like TB_CUST - table with customer data, or TP_COMP_CARS - company cars....

Showing many tables in many dropdown lists. c#, asp.net-mvc, linq2sql

Hi, all I want to use an example to explain what I want. Assume I've following DB design: Item (id, name, categoryID); Category (id, name); When user wants to create an Item (fill in form), I'll give a list of categories in a dropdownlist, and when user chooses one of the categories ASP.NET MVC will automatically bind categoryID, to...

Preparing Mysql Database for Joomla or PHP Website.

I have a Mysql database of 500+ Real Estate Listings which I am looking to load into an empty Joomla Extension (this may apply to any PHP Script). I have copied the structure and convention of each table the extension uses - with the idea of either exporting or simply deleting the original tables and replacing them with mine. Upon test...

Using Java ApplicationModule to connect to Oracle Database

I'm working in JDeveloper and I need to connect to Oracle Database using the ApplicationModule interface. So I set up the connection, imported the table and created a view. Then I created a new ApplicationModuleImpl that connects to that view. Now, how do I get to the data through the ApplicationModule object? I read the documentation ...

Java DB Table inheritance?

Is it possible to do Table Inheritance in Java DB? We have a complex code model that uses inheritance and would also benefit from DB inheritance. Is it possible? It doesn't seem possible from a quick google or a poke around in netbeans. Cheers ...

size of B+ tree

Hai I am preparing for DBMS exam where i want to calculate the memory size (in bytes) occupied by the B+tree. thank u. ...

Efficient implementation of faceted search in relational databases

I am trying to implement a Faceted search or tagging with multiple-tag filtering. In the faceted navigation, only not-empty categories are displayed and the number of items in the category that are also matching already applied criteria is presented in parenthesis. I can get all items having assigned categories using INNER JOINs and ge...