I have a db with many tables. Some tables have unit price column, no tax, gst and such columns. What should i do now? Should i create GST table, HST table and PST table separately. In other words, what is the standard schema of designing the tax table?
...
Suppose I have the following tables:
Company Person Address
----------------------------------------------------------------------------
Id (PK) Id (PK) Id (PK)
Name CompanyId (FK) CompanyId (FK)
AccessType AddressType
Corresponding t...
Lets say I have a database similar to the following:
Table: People
id | name | age
---+------+-----
1 | dave | 78
Table: Likes
id | userid | like
---+--------+-------
1 | 1 | apples
---+--------+-------
2 | 1 | oranges
---+--------+-------
3 | 1 | women
What would be the best way to handle updating daves data? Cu...
I have a transaction log table that basically is inserting, reading, and writing new records many times a second.
It has about 5 rows with various ids in them. Aside from indexes/query modifications, is there anything specific to optimize a table like this? It's a MyISAM table type.
Thanks!
...
Just found out that I don't need content providers if I don't need to share data with other applications. But since the examples I've seen all use content providers, I'm not sure how to proceed without them and populate activities with data derived from accessing my application's database directly.
...
Hi,
I'm looking for a front-end that's very simple, to access a to-be-built MySQL Database. I actually need it for only one table. I was thinking that the user could search in a way that would ask for values for each field of that table, and give the option of leaving it blank. Then, it would return all the entries that match up with th...
I've been using order by rand() and it's becoming too much of a bottle neck.
I've tried this
SELECT id
FROM users
JOIN (
SELECT CEIL( RAND( ) * ( SELECT MAX( id ) FROM users ) ) AS id
) AS r2
USING ( id )
And it would work if all the id's were incremented, however with this particular table, they're not. The id's are fairly rando...
I am trying to connect to a IBM DB2 9 database on a Linux server from my Java application. I am using db2jcc.jar (DB2 Universal JDBC Driver). Establishing a connection takes a ridiculous amount of time? What could be wrong? I know there a lot of factors that could cause this, but I am willing to get down to the root cause. Please help me...
I've been wondering lately. Lets say we're doing a webapp with JSF+Spring+JPA/Hibernate (or well any other technologies) and lets say we have a "User" entity. We want the User to have a unique login. If we want to do it then we can put a @UniqueConstraint on the "Login" column, but still our application has to check during user registrat...
I have several csv files that I need to transfer over to mdb format. I tried the answer in this post as a starting point:
http://stackoverflow.com/questions/3094537/how-do-you-create-a-mdb-database-file-in-python
Source:
from comtypes.client import CreateObject
access = CreateObject('Access.Application')
from comtypes.gen import Acc...
I have to translate a datamodel i Visio from one language to another. This can be done by using Edit -> Replace, but it only modifies the visual representation. The values in the database properties are not changed. That becomes a problem when Visio updates the layout and writes the values from the properties to the ER diagram.
How can ...
I`m using this code to repopulate drop down list from the database :
$city_id = 15;
while($row = mysql_fetch_assoc($result)) {
$selected = ($row['city_id'] == $city_id) ? 'selected="selected" ' : NULL;
echo '<option value="'.$city_id .$selected . '">"'.$row['city_name'].'"</option>\n';
}
It`s work like ...
1. So if I search for the word ball inside the toys table where I have 5.000.000 entries does it search for all the 5 millions?
I think the answer is yes because how should it know else, but let me know please.
2. If yes: If I need more informations from that table isn't more logic to query just once and work with the results?
An exa...
I'm using Visio 2007 and strawed creating some flowchart diagrams. One on each page. For the same project I would also like to create class and entity relational diagrams. Is it possible for me to have multiple drawing types in a single vsd?
I tried creating an ERD by adding the Entity Relational shapes to my palette, but when I dragge...
Hey,
I have a table that has about 400,000+ rows. I am writing some pattern matching code but need to clean up a column before I do so. This boils down to doing a replace-like operation.
I tried listing them all out one at a time...
Update T_ADDRESS set ADDR_LINEONE = REPLACE(ADDR_LINEONE,' southeast ',' se ')
Update T_ADDRESS set A...
I have a DataSet consistint of a big number of tables of information.
Is it possible automaticly create SQL Server DataBase (mdf-file) from description of my DataSet?
Of course, I can do it manually, but may be there is a better way?
...
Hi,
I have a form that reveals user IDs to public. I was wondering that is this dangerous. Personally I do not see anything bad about it. The ID is just used to reference a single database record.
...
<Historic>
-----<ReturnData Year="2010">
----- -----<ReturnHistory>
----- -----<Return StoreDate="2010-07-31" Type="1">
----- -----<EndDate>2010-01-31</EndDate>
----- -----<ReturnDetail TimePeriod="1">
----- ----- -----<Value>2.83</Value>
-...
Hi,
I have a query using the Containable behaviors in cakephp thats looks like this :
$x = $this->find('first',array('contain'=>array(
'User' => array(
'SelectionsTeam' => array('conditions' => $conditionTeamSelection,
'Team' => array(
'fields' => array('name','city','id'),
...
I'm trying to create a generic extension method, that works on typed data tables :
public static class Extensions
{
public static TableType DoSomething<TableType, RowType>(this TableType table, param Expression<Func<RowType, bool>>[] predicates)
where TableType : TypedTableBase<RowType>
where RowType : DataRow
{
...