database-design

large insert in two tables. First table will feed second table with its generated Id

Hi all, One question about how to t-sql program the following query: Table 1 I insert 400.000 mobilephonenumbers in a table with two columns. The number to insert and identity id. Table 2 The second table is called SendList. It is a list with 3columns, a identity id, a List id, and a phonenumberid. Table 3 Is called ListInfo and co...

Database design: Running totals of row counts

I have run into the following situation several times, and was wondering what best practices say about this situation: Rows are inserted into a table as users complete some action. For example, every time a user visits a specific portion of a website, a row is inserted indicating their IP address, username, and referring URL. Elsewhere,...

localization of dynamic data

Hi All, I'm looking for advice on best practices for localizing data stored in the database. I'm working on a web application in which all of the static text is localized using files. We have several options the administrator can configure using the UI which are stored in the database and need to localized these values. We have come ...

Atomicity of field for part numbers

In our internal inventory application, we store three values (in separate fields) that become the printed "part number" in this format: PPP-NNNNN-VVVV (P = Prefix, N = Number, V = version). So for example, if you have a part 010-00001-01 you know it's version 1 of a part of type "010" (which let's say is a printed circuit board). So, i...

BLOB or Normalized database with textual data?

I am planning to develop a web-application just to test my knowledge on JSP/Servlets. I am planning to create a very simple "Bug tracker" and I am in the process of designing the database. I am using MySql/JDBC. There are some minor insignificant data like user's DOB, Date of Joining, list of languages/technologies the user is comfortab...

which query is better and efficient - mysql

I came across writing the query in differnt ways like shown below Type-I SELECT JS.JobseekerID , JS.FirstName , JS.LastName , JS.Currency , JS.AccountRegDate , JS.LastUpdated , JS.NoticePeriod , JS.Availability , C.CountryName , S.SalaryAmount , DD...

Usage of IN Clause in a Database query

I have written query, I wanted to know the effect of usage of IN clause in Query. Query I Select * from khatapayment_track Where Property_ID IN (Select Property_id from khata_header where DIV_ID=2) Query II Select * from khatapayment_track KPT, khata_header KH Where kh.Property_id=KPT.Property_id and KH.DIV_Id=2 I would like to know ...

Information related to Node in a Database Structure for Tree Data Structure

Hello, Imagine you have a tree data Structure in a database like this: Level: id nextlevel desc 1 2 company 2 3 department 3 4 group Nodes: id level parentnode 0 1 null -> the company 1 2 0 -> dep 1 2 2 0 -> ...

Data Base Design solution advice

I am pretty new in data base design and I would like have your opinion :-). I need design a simple Data Base for a CMS, CMS will manage Articles and Blog Posts for my website. My Questions: A) Since fields in DB for Articles and Blog Posts are the same (ex: Title, Main content) expect "Type" (Posts or Full-Articles), I thought would be ...

db indexes application - best practice

When developing large systems (hundreds of tables) Do you create the indexes (and to lesser extend the other constraints in the DB) when you create the entities (tables), or wait for the system to be running (may be private Beta) to decide where to put the indexes? ...

Subsonic DB Schema Generation.

I was watching subsonic's simple repository demo. I came to know that DB schema can be generated from code. I think of code generation as usually domain layer from database. Where is this useful? ...

How to represent user paths through a web site in a database?

I want to be able to query a database so that I can find out which pages on a web site users visit before registering. I was planning on using a graph database - neo4j probably - but I can't decide how the data should be represented. Each user has an ID and can make multiple visits, each with their own ID. Obviously each page is identi...

MySQL: Two n:1 relations, but not both at once

Sorry for the title, it's difficult to explain. I need a data model similar to this: As you can see, a set can belong to both a user or a school. My problem: It should only be allowed to belong either to a user OR a school. But never both at the same time. How can I solve this problem? ...

Suggested DB Schema for Quotes

How would you save the quote products in a database? Serialize data? http://cl.ly/6419969e30cd26e2f32a They can create however many rows they want... It's for a quote system. Create a quote with however many products. I need to save X Product At X Qty and X Price foreach one. Serialize in the only thing I could come up with, but I hat...

Distributed db's or not?

INFORMIX-SQL 7.32 (SE) Linux Pawnshop App. I have some users who own several pawnshops within a 100-mile radius. Each pawnshop app runs with SE. The only functionality these owners need are: ability to remotely login to any store in order to view transactions, running totals and consolidate daily totals at end of business day. This can ...

Cassandra Transaction with ZooKeeper - Does this work?

I am trying to implement a transaction system for Cassandra with the help of ZooKeeper. Since I don't think I have enough experience in database implementation, I would like to know if my idea would work in principle, or is there any major flaw. Here is the high level description of the steps: identify all the rows(keys) and columns t...

Separate link/association tables for different data?

Which is a better design approach: Having separate link/association tables for each type of data within a database or incorporating a general identity into a common link/association table? Since this question really doesn't make sense without an example... Suppose I have a database which contains data for authors and books (to use an e...

Single session in two different domains

Hi Guys, I am proposing a design for my company in integrating 4 systems together and putting it into web. All the 4 systems are independent of each other but I am trying to integrate to have more automation. One of the system is as follows : I want to link my companies website (www.xyz.com) to another website (www.abc.com) with same lo...

Best way to store a many-to-many relationship in MySQL?

Let's say I have a simple database with tables 'posts' and 'tags'. Posts can have many tags and tags can belong to many posts. What is the best way to structure the database? I thought of using a list/serialize: tags idx tag_id, str tag_name posts idx post_id, str title, list tag_ids OR having another table with the associations. Pr...

How can I store an array of boolean values in a MySql database?

In my case, every "item" either has a property , or not. The properties can be some hundreds, so I will need , say, max 1000 true/false bits per item. Is there a way to store those bits in one field of the item ? ...