Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [table]

A data structure that organizes information into rows and columns.

0
votes
1answer
20 views

Generate metadata file from PostgreSQL server [on hold]

Is there a way that I can make a metadata-sheet that lists all the available tables from a postgresql-database, so users can see documentation of the tables? I know that there are descriptions, ...
0
votes
1answer
37 views

Left join SQL Select Statement

Good day, Im trying to find a good way on my select statement Table1 AccountID AccountName Rate OldRate 01 Smith X X2 02 Providence X X2 03 ...
0
votes
2answers
38 views

How to create a table in a database on a different server

I need to create Table B in database B on SQL Server B by querying Table A in database A on SQL Server A. Table B does not exist in database B. SQL Server A and B are linked. I wonder how could this ...
0
votes
1answer
22 views

Combing two queries in one

I have two tables, e.g. "Locations" and "Connections" "Locations" has values Id | Dimension --------------- 1 | 4 2 | 8 3 | 2 "Connections" maintains attributes Origin | ...
0
votes
0answers
21 views

How to create multiple tables based on existing tables in postgreSQL?

I have several tables, and I need to create a matching _hist table for each one. For example if I have: CREATE TABLE public.test ( first text, middle text, "last" text, ...
-1
votes
1answer
31 views

Is the index created as soon as data is inserted into a table? [closed]

For example I have a table and I created an index on ID column which generates numbers every time I insert a row. If I only insert 5 rows does index tree start to be created or is there a threshold of ...
0
votes
0answers
23 views

How to group related information: Another table vs Same table

I have a table to store video information, like so: ----------------- video ----------------- video_id title description duration inserted_date ... Many times, i have videos that are directly ...
0
votes
1answer
25 views

schema of messaging system

in a web application where people talk to each other , there will be a lot of messages , suppose for simplicity that each row in a table is a message , do you think if a have 5 million messages that ...
0
votes
1answer
26 views

Questions on database table and index partitioning in SQL Server

I have developed Transact-SQL script to partition the table. To apply the partition, I am creating one non-clustered index for my partition key column and associating it to partition scheme. I have ...
0
votes
2answers
39 views

Should I create new table for each User to store their product List?

I'm creating a Web based billing and inventory management system. I need to store the product details such as name, price, stock left and also want to store details of every bill for each user ...
0
votes
1answer
19 views

External Table: VARCHAR in Create but CHAR in Access Parameters

Consider this SO Question UTF-8 And External Tables. A proposed solution contains VARCHAR2 columns in the CREATE section but those same columns get CHAR attributes in the ACCESS PARAMETERS section. ...
0
votes
2answers
64 views

Will frequent creation and deletion of TABLE (not indexes) cause fragmentation in database?

Does frequent creation and deletion of physical table in database causes fragmentation? I am frequently creating and deleting database for loading data warehouse load. I am using these table to hold ...
1
vote
1answer
27 views

SQL How to show information from others tables in select requet

There are my database user id | user_code | user_name 1 | 1x2d | Peter shops id | shop_code | shops_name 1 | 1234 | shop1 2 | 3456 | shop2 articles id | art_code | art_name 1 | ...
1
vote
0answers
16 views

Best practise for data dump 'entry point' in DB processing chain - PostgreSQL

I need to implement a process chain to transform and analyze potentially large sets of data, inserted both programmatically and manually (e.g. CSVs). In either way, the input data is standardized in ...
1
vote
2answers
44 views

database design for song position under play-list

I have a music streaming application where I have playlists. Each playlist has maximum 100 songs. I have a mapping table called PlaylistSongMapping which has the following schema +------+------------+...
1
vote
0answers
35 views

Statistics injection for calculating the cost of a query

I want to find out the cost of a query by "EXPLAIN" query in Postgres. As I know, Postgres calculate this cost by using the statistics of the table. (e.g: relpages, reltuples in pg_class or some ...
0
votes
0answers
7 views

Creating a database for due dates

In my current role I have to write down all my projects on pre-made grid on a dry erase board. As I finish a project I erase it but as the board reaches its capacity I have to manually shift ...
0
votes
2answers
88 views

Get Headers from SQL Table

I am looking for a way to dynamically get the headers from a table without having to write them (select 'header1' as "header1"...., 'header50' as "header50" from MyTable) It doesn't work above a ...
0
votes
1answer
40 views

SQL, creating a new table with auto generated passords from other tables

i have this sql below which i have retrieved from our student database. It retreives all that i need, but i would like to create a new table which includes all the tables plus one column with auto ...
1
vote
0answers
62 views

What are the advantages of using a Materialized View directly on a table?

Recently, in enterprise's Oracle database, I have seen some materialized views that filter directly columns of table without adding aggregate fields and without calling custom functions. Example: ...
1
vote
1answer
32 views

Pivot information - sql table

I was wondering if anyone could help me with pivoting data in sql? I am a newbies and need some help I want to pivot data based on "LastLogOn" column. Is it possible to do in SQL? From: To:
0
votes
1answer
31 views

How to LOCK/BLOCK selected row in table to be ReadOnly?

Is it possible to LOCK completely or make READ-ONLY where id = value in MariaDB? or add some trigger locking if someone is trying to update selected row ? Some people says: "Trigger is not a good way ...
-2
votes
1answer
46 views

Copy column rows to be the first rows in column

I have two database tables named vegan_ar_sheet1 (old) and vegan_en_sheet1 (new). Now I want to copy the column name and all of its contents from the vegan_ar_sheet1 table to the vegan_en_sheet1 ...
-1
votes
1answer
47 views

Is mysql using some kind of auto repair due to “check table” warnings?

Today i noticed a "strange" behaviour of MySQL when using "CHECK TABLE" on a crashed table. First i got a warning like "Size of datafile is: * ... Should be: *" but i could still "insert into / select ...
0
votes
1answer
24 views

In which context does a procedure run when called from another context?

Envisage: use databaseA; go exec databaseB.dbo.spProcedure(); go Does the procedure execute against databaseA - the context from which it is called, or databaseB - the context in which it exists? ...
0
votes
1answer
27 views

Update two tables, each on separate MySQL servers, on two different machines in one query?

Have two MySQL servers running on two different machines in a local network. Using PHP and accessing via IP. No problems there. The databases have identical schemas. One was an import from the other ...
0
votes
2answers
52 views

DB2 huge IREF and lots of scans

I received a task from one of my colleagues to check why he always receives high CPU load alerts. I don't have too much experience with databases and I need some clarifications. I created a script to ...
-2
votes
2answers
70 views

How to display null records/rows from table

For ex: I have a record with name = "sga_target", and no record exists where name = "_exafusion_enabled". I still want to display a row with "_exafusion_enabled" as name and NULL as value, without ...
3
votes
4answers
135 views

Representing lists in SQL

My database setup is modern (My)SQL. I've got a Content Table, including ids. Now, users should be able to comment on content. To achieve this, arrays have come to my mind. Now I see several options ...
1
vote
1answer
183 views

Trigger with a Variable Select and Order by

Is there a way to a set trigger that will activate once a new table is created and will get the new tables name? I was able to come up with the query below but it only gets the first query by ...
1
vote
2answers
142 views

Does SQL Server automatically update the foreign key relationships between tables when one of those tables is renamed?

What happens to the foreign key relationships on a table if that table is renamed?
2
votes
0answers
26 views

IDB file Maximum kb limit

I'm new in handling MySQL database, I made a tracking system I using the MySQL database incorporated on the xampp package as a database. Everything is running smoothly, however upon reaching 90,112 kb ...
3
votes
2answers
34 views

How can I instantly update a table in a database with the columns values from another database?

I have database_1 and database_2 both on the same server. How can I instantly update the USER table in database_2 when data is inserted into the USER table in database_1? Structure of both tables: ...
1
vote
3answers
116 views

InnoDB “holes” in large table 200 Million Rows?

I have a large MySql InnoDB table with about 200 million rows. One of the columns has some data in it that I really don't need any more, so I'm thinking about removing that column, or setting all the ...
0
votes
2answers
191 views

MySQL 5.1 - long running select locking the table and not allowing inserts

Platform - MySQL 5.1, MyISAM engine We reached max on int (id, auto increment) in our Prod system. Changed the type to BigInt. Even since this change was made, long running selects are locking the ...
3
votes
1answer
97 views

One generic mapping table VS many specific mapping tables

I'm trying to design database tables to track files uploaded by end users. Files can be uploaded under different contexts. Each context is a different table. As an example: An employee can upload ...
1
vote
0answers
257 views

Postgres pg_dump copy table to another database isn't copying columns

Goal: copy a single table including all columns from one database to another using psql on the command line, avoiding an issue with XML from QGIS layer styles. I am running the following on the ...
0
votes
2answers
59 views

Clustered Primary Key that is never used vs. Non-Clustered Primary Key on Multiple Columns

I am working on a table design for Customer Totals and trying to make a decision about the primary key. I was going to go with a surrogate identity column with a clustered index, but this column would ...
0
votes
1answer
612 views

Upload multiple csv file to multiple tables sqlServer

I have over than 200 csv files that each of them is diffrent table. I create now a new DB and want to upload them all so I will have all the table. I not accessable to old DB to backup in diffrent ...
1
vote
3answers
299 views

What can be best database schema for multiple project and one database? [closed]

I am working on multiple projects but the back-end will remain the same. I have a different server for auth, data, etc. and one database to store all the details. If one projects are creating any ...
0
votes
0answers
38 views

How think about column value decide to refer table in mysql

I'm designing table relationship. I have an one question. An Example) Some customer want to contract car or bike. Customer must contract an one only. I'm thinking for this case table relationship....
0
votes
0answers
31 views

Importing excel table to access in desired format

Excel table data is in following format: S.No. Book No. Book Description Author Location Quantity ----------------------------------------------------------------------- 1 N001 ...
5
votes
1answer
387 views

Same table alias for two different tables (Oracle)

This example has the same table alias used for two different tables. I don't understand why this is allowed by Oracle, and if allowed, how the results make any sense. create table Table_A (x number);...
1
vote
1answer
62 views

How create a table inside the selected database in PostgreSQL?

This is the command to create a new database, CREATE DATABASE mydb; This is the command to create a new table, CREATE TABLE IF NOT EXISTS mytable ( int a PRIMARY KEY ); But this does not add the ...
-2
votes
1answer
2k views

How do I CREATE a table only if it doesn't exist in PostgreSQL?

This is the way to create a new table in PostgreSQL, CREATE TABLE foo ( foo_id int PRIMARY KEY, bar text, ); How do I do this if it needs to check if the table already exists and to ...
0
votes
1answer
22 views

MS Access Query summarizing 2 tables doesn't produce expected output

I cannot successfully create a query in MS Access 2016 that correctly summarizes data from 2 tables with similar but not completely identical fields. I have a fruit market. I buy each type of fruit ...
3
votes
1answer
973 views

Check if table exists on a linked server

I've had a search, but can't find a post relating to this instance specifically. We have a linked production database that I'm trying to reference from our 'sandbox' server. I want to check if a ...
0
votes
4answers
80 views

Insert data from 1 column to many columns in another table (using 1 line) in sql

I have a table (table1) in which IDs of transactions, transaction state (there are 10 total states) and their time of entering that state are stored. I want to feed this data into another table which ...
0
votes
1answer
37 views

How do I combine rows in sql query and remove duplicates

I have a large database that is connected to a forms mapping program. In order for me to map results from SQL queries I have to put a single line field in for each result row. It defaults to row 0 and ...
1
vote
0answers
45 views

How to design databse for storing object states in mysql?

I have multiple objects with multiple states. I want to build a timeline for each object. For example: an object might have a created, submitted, processing and success state. I would like to store ...