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
2
votes
3 answers

Oracle: Combine Two Tables with Different Columns

This is table 1: col_1 col_2 date_1 ----- ----- ------ 1 3 2016 2 4 2015 And this is table 2: col_3 col_4 date_2 ----- ----- ------ 5 8 2014 6 9 2012 I want a result like this: col_1 col_2 col_3 …
Vahid
  • 3,384
  • 2
  • 35
  • 69
2
votes
2 answers

How to Change SQL select query As new table in SQL Server CE?

This is my current SQL query: SELECT SUM(CASE WHEN (DATEDIFF(day, tbl_debit.purchasedate, GETDATE()) >= 45) THEN tbl_invoices.pendingamount ELSE 0 END) AS morethan45, SUM(CASE WHEN (DATEDIFF(day, tbl_debit.purchasedate,…
Sachith
  • 191
  • 1
  • 7
  • 15
2
votes
2 answers

sql cross join query

I have more tables that I want to cross join them and I want to show each table with fields like this: tb1.filed1 tb1.filed2 tb2.filed1 ..... What should I do? How can i select fields with details like it's table's name. thanks....
Farna
  • 1,157
  • 6
  • 26
  • 45
2
votes
1 answer

ORMLite does not know how to store class

Item @DatabaseTable public class Item { @DatabaseField(generatedId = true, canBeNull = false, columnName = "id") public int id; @DatabaseField(canBeNull = true, foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true) …
NickUnuchek
  • 11,794
  • 12
  • 98
  • 138
2
votes
0 answers

What will be better to use: Multiple Databases or Multiple Tables (android)?

I am working on a diet app project. I went through different diet apps available on play store like myfitnesspal. In the case of myfitnesspal, the app has a primary database of food for the Calorie and nutritional information of different kind of…
user4857611
2
votes
2 answers

Saving lists in django models

I'm working on a web project, and I'm still really new to Django and the idea behind models. Basically, I want to create accounts that allow each user to save a group of locations. Currently, I've created models for each location (which must be…
2
votes
3 answers

Mysql convert table from long format to wide format

I have a MySQL table like this: And I want to convert it from long format to wide format like this Sorry. I'm new and don't know how to post a table
Luvias
  • 563
  • 1
  • 7
  • 19
2
votes
1 answer

How to join the results of a subquery to a table in PostgreSQL?

hello i'm newbie in sql (postgresql) i have 2 tables as result of 2 differen selects all calls our customer contacts number contact_id and contact_id name 3213 12 12 jonh …
Falcon
  • 1,461
  • 3
  • 15
  • 29
2
votes
0 answers

Prevent this code (Datatables PHP Server-side) from SQL Injection

I'm using JQuery Datatables with PHP server-side script which fetches data from MySQL. I took PHP script example from Datatables site and changed it a bit in order to change it from old mysql to mysqli. The script accepts several papameters such as…
user164863
  • 580
  • 1
  • 12
  • 29
2
votes
2 answers

Excel Table Data Connection Removes Cell Reference Upon Refresh

I have a Data Connection within my Excel Workbook (2007) which references a table within another Excel workbook. I have a cell that is referencing a date value within the last column header of the table. Each time the external workbook is updated…
2
votes
1 answer

how to create a list about my tables from sql server?

I have a lot of tables in my database (Microsoft Sql Server), and I want to create some kind of list, about my tables. I don't want to write all of the tables' names, I thought there is a way, to create a list about the names of the tables in…
victorio
  • 6,224
  • 24
  • 77
  • 113
2
votes
1 answer

May a 6NF Table contain a foreign key?

Does a table satisfy 6NF when it's domain is a foreign key? E.g.: CREATE TABLE authors( author_id serial NOT NULL PRIMARY KEY ); -- other author attributes CREATE TABLE books( book_id serial NOT NULL PRIMARY KEY ); CREATE TABLE…
2
votes
1 answer

kohana with data tables

I want to use Data Tables in Kohana 3.0, but in all examples they core PHP code and normal queries. Is there any tutorial or example on how to use Kohana with data tables ?? Example: $sQuery = "SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ",…
Clarence
  • 896
  • 1
  • 9
  • 27
2
votes
2 answers

Generate connection table from table with duplicates

I have a SQL Server database table (DuplicateIds) that contains the ID's of duplicate words from another table (Words). Here's and example of the data in the table DuplicateIds: word_id | word ---------------------------------- 244…
tkahn
  • 1,407
  • 2
  • 21
  • 37
2
votes
1 answer

Using multiple joins and group_concat() in MySQL?

I need to use Joins for a project but I have forgot how to use it. It's all just messing with my head now, I can't quite figure it out. I have five tables, all of which I need to join: categories - id, name movies_categories - movie_id,…
qwerty
  • 5,166
  • 17
  • 56
  • 77