Stack Exchange Network

Stack Exchange network consists of 174 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
38 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
18 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
13 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
37 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
30 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
79 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
46 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
26 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
29 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
44 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
31 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
23 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
24 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
49 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
68 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
129 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
144 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
69 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
24 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
62 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
123 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
52 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
217 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
56 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
468 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
219 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
37 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
27 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
288 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
1k 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
650 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
74 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
34 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
28 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 ...
3
votes
1answer
185 views

Why are there differences in data when comparing table to itself? TSQL

I'm comparing two tables that should have the same data. I've got a couple of different queries that are supposed to return rows that don't match. However, the queries return rows that DO match. I'...
0
votes
0answers
61 views

MySQL reusable results as table with parameters

I used to use MySQL but nothing more complicated than JOINs, then I worked for a year at a company that uses MSSQL, where I learnt how to program stored procedures. My current company uses MySQL. In ...
1
vote
1answer
25 views

Granting specific permissions on ALL tables

I have a tutorial that users need to type in PostgreSQL commands. I don't give the script to users simply because it's a learning experience. Everything in the script below is typed in except for the ...
2
votes
2answers
78 views

The table is full when insert records by php program (around 15m)

Error: INSERT INTO tbl_xxxxxx ( .........); The table 'tbl_invoice_detail_lesson' is full I have checked lots of article, most of them are noticed that it has to change the ...
2
votes
2answers
53 views

Stored Procedure to insert data

Table1 contains ServerName and a list of applications (from Application01 to Application20) installed on the server. Now I need to import data from Table1 to Table2. The final Table2 should look as ...
0
votes
0answers
61 views

postgresql NULL space cost

I have the following situation: I have about a thousand machines with a lot of sensor values (IoT devices). These devices have an ID and a value. This value can be an int, a float or a string. I ...
2
votes
0answers
40 views

How should I configure a table to optimize for frequent inserts and deletes?

I know about making the clustered index a steadily increment field, like a datetime field. So that will give me fast inserts. However, the deletes will be based on a consumer of the "queue". So the ...
0
votes
2answers
255 views

Table behind synonym does not exist

when I do select * from all_synonyms where synonym_name='SYNAAA' I can see synonym SYNAAA is public, and table behind it is TABAAA in schema A. Given SYNAA is public, I should be able to query it ...
0
votes
0answers
103 views

`SELECT` on `information_schema`.`tables` returns less rows if I `SELECT` the `CREATE_TIME`

Context We have a MySQL 5.6.28 server with a lot of schemas on it. After a crash, we have some schema where a table x exists, and other schemas where it's an orphan table. On a non-corrupted schema, ...
0
votes
1answer
30 views

Is it possible to allocate data free for certain table?

After deleted a large dataset (~50GB) and optimized tables, some tables have data free (~50GB) and parts of tables have only data free (~KB). As my understanding, the data free are reused and not ...
0
votes
2answers
32 views

Would CRUD operations get very slow on an mysql innodb table which got more than 50 million rows?

I'm about to design a DB for a finance institution and the last normalization of tables shows that the necessity of creating a single table for all the bank's transaction. As per the calculations, ...