Questions tagged [database-table]

In a relational database management system (RDBMS) a table organizes the information in rows and columns. Each table has a defined number of columns, each of which is identified by its name, but the number of rows is variable, consisting of one for each line of data.

In a relational database management system (RDBMS) a table organizes the information in rows and columns. Each table has a defined number of columns, each of which is identified by its name, but the number of rows is variable, consisting of one for each line of data.

More Information:

  1. The wiki entry on database tables is a good source of information.
  2. Microsoft provides an intuitive definition of a table
313 questions
3
votes
4 answers

PHP MySQL search with multiple criteria

I have a search form in a website and would like to have several search terms which is input by the user to perform db search, terms as below: Keywords Property For (Sale, Rent...) Property Type (Apartment, Terrace House...) State Min Price Max…
conmen
  • 2,377
  • 18
  • 68
  • 98
3
votes
5 answers

Is it necessary to have a Primary key which is sequence generated even though I may not use it for DB operations

Hi I had parent table which has ID and some other columns and a child table which have many values based on this ID(foreign Key). I wanted to create the table with a Primary Key which is sequence and this Parent table ID as Foreign Key but later I…
GustyWind
  • 3,026
  • 3
  • 41
  • 50
3
votes
1 answer

Django: Failing at creating tables

I can't change my models and create new tables if the old ones are deleted. I am using south and when I just added a new model to my models and created a new one, I used python manage.py migrate logins --fake Running migrations for logins: -…
lulu
  • 261
  • 1
  • 4
  • 16
2
votes
2 answers

sql left join 2 tables

I have a SQL query with a left join which works fine: SELECT book.* FROM book LEFT JOIN purchase ON book.book_id = purchase.book_id WHERE purchase.user_id = 3 ORDER BY purchase.purchase_date But I need also infos from purchase table, so I…
defacto
  • 359
  • 1
  • 5
  • 18
2
votes
1 answer

web2py: How to rename a table?

How do I rename a database table in web2py? If there is not a direct way, what is the best workaround to do this? All I found was this thread http://groups.google.com/group/web2py/browse_thread/thread/ef724508324347e2/7966a423c293bdec where the…
User
  • 62,498
  • 72
  • 186
  • 247
2
votes
3 answers

Display empty value when there is no data on the table

I have table and query to select data from row to column like this: id | type | data ----------------------- 1 | Name | John 1 | Gender | Male 1 | Code | 1782 2 | Name | Dave 2 | Gender | Male Query: select…
Reus ellmy
  • 81
  • 6
2
votes
3 answers

How to join two tables on three conditions?

hope someone can figure out what I'm doing wrong here. The task seems quite simple, but is apparently beyond me. I have two tables and I am trying to append precipitation data. Three conditions need to match in the two tables to get the correct…
velvetmonster
  • 87
  • 3
  • 10
2
votes
2 answers

Linq left outer join

I ultimately what I needed is generic function which would take two datatable and and 2 tablekeys and return Joined datatable. So here is my first step to solve it. How Can I write Linq example of following T-SQL example in VB? SELECT *…
Gubi
  • 415
  • 2
  • 10
  • 20
2
votes
2 answers

Attributes of object with multiple types in one table

I have a situation like this: I have multiple objects in one table and generally my columns depend on the type of object like crane, excavator etc. My problem is that crane has other params than excavator so a few columns have null value. I thought…
2
votes
2 answers

Is there a "best practice" in microservice development for versioning a database table?

A system is being implemented using microservices. In order to decrease interactions between microservices implemented "at the same level" in an architecture, some microservices will locally cache copies of tables managed by other services. The…
SoCal
  • 801
  • 1
  • 10
  • 23
2
votes
1 answer

One table column for many fk tables?

What is the best solution/practice for situation like this? I have a table, that can reference to multiple tables (objects)? Here is an example for a table UserCalendar. It's a table where user saves his event, but also system inserts in this table…
2
votes
1 answer

approximate count of rows in postgresql django

I have a postgresql database connected to with django. In database there is lots of big tables which I want their row count. Because of large size of tables this takes a lot of time to execute. I founded that the approximate count could be retrieved…
mohammad
  • 2,232
  • 1
  • 18
  • 38
2
votes
2 answers

oracle 11g impdp returns invalid operation and object was not found

I wanted to transfer an oracle table between two users using expdp and impdp commands. First of all, I created a directory and granted proper privileges to source and destination users: SQL> CREATE OR REPLACE DIRECTORY TEST_DIR AS…
Zeinab Abbasimazar
  • 9,835
  • 23
  • 82
  • 131
2
votes
0 answers

Correct way to organize my DynamoDB tables

This is the first time I use DynamoDB. I have a question about how to organize my tables. I own a table containing users, I will have words associated with those users. Should I create a property with an array in the user or a new table? I will also…
user7308733
2
votes
1 answer

Detect queried field via greatest()

I'm using the mysql GREATEST() function to select the highest integer value from either column (apples or peaches). +----+------------------+ | id | apples | peaches | +----+------------------+ | 1 | 8 | 4 | | 2 | 2 | 6 | | …
Noob
  • 541
  • 1
  • 8
  • 12