Questions tagged [table]

A data structure that organizes information into rows and columns.

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

Changing Column Data Type with FKs

I want to change my column data type from "Datetime" to "Datetime2(7)". If I try to do it with the GUI SQL Server 2014 asks to save all FKs table dependencies and then I get a lock timeout because ...
0
votes
1answer
20 views

Postgres/PostGIS is returning data from a table that doesn't exist (I'm a newbie — show me why I am wrong)

Ok, so I am following a tutorial (here) for PostGIS. I have uploaded all the example datasets (all shapefiles) into a postgres db, although I have modified the names so they do not all match the names ...
4
votes
2answers
87 views

Unable to output data from tables in pgAdmin4 due to missing oid operator

I am currently running Postgresql 10.6 locally which I interface with using PgAdmin 4.12, up until today everything was running fine. However today I ran the following query in the pgAdmin query ...
1
vote
2answers
47 views

Correct data types for my database

I have to make Movies database with the following tables: • Directors (Id, DirectorName, Notes) • Genres (Id, GenreName, Notes) • Categories (Id, CategoryName, Notes) • Movies (Id, Title, ...
0
votes
0answers
22 views

How to Track Table Usage

I need to track usage for 1 table, and log how this table is accessed (select, insert, etc.) and by which logins What is the proper way to do it using SQL Server Audit and Extended Events ? If there ...
0
votes
1answer
44 views

insert results from store procedure with parameters into table

I have a stored procedure that I want to insert into a table, the stored procedure however has parameters I have to pass, how can I do this? DECLARE @RC int DECLARE @startweek varchar(20) DECLARE @...
1
vote
0answers
30 views

Database design for a customer and payment system

I need help with database schema design. Business rules We have users, each user can have listings. Each listing has one or more license. There are n type of licenses (products) Each listing can ...
0
votes
2answers
52 views

How to display the dates without DUPLICATE and ORDER by MAX DATE

I just want to ask that how can I display the null values along with the MAX date. SELECT MEMB.MEMB_N, MEMB.LAST_M, PrintDate FROM MEMB INNER JOIN tblPrint ON MEMB.MEMB_N = tblPrint....
0
votes
0answers
15 views

Major DB operations like table drop, Shrink etc on AWS SQL Server 2014 SE with Multi-AZ switched on

Are there any issues if Major DB operations like table truncation, big amount of data delete or Shrink are performed on AWS SQL Server 2014 SE with Multi-AZ switched on? Should the Multi-AZ switched ...
0
votes
1answer
36 views

Entity Framework 6: How can I add new column to existing table and at the same time update view (add column) in same migration file [closed]

Example in the EF6 migration file Up method. I wish to add a new column B in existing table Country. Sql("ALTER TABLE [dbo].[Country] ADD [B] INT DEFAULT((0)) NOT NULL;") Then I will need to ...
0
votes
1answer
32 views

How can I find the longest record (in characters) for each column in a table in PostgreSQL

I couldn't find the answer to this on here so sorry if repeated. I'm looking to query a table to find the longest record in characters for each column in a specific table. I have a table which is ...
0
votes
2answers
33 views

SQL Server: Join all tables from a table listing their names [duplicate]

I have a table that contains a list of metrics and their IDs in the format: L6Metrics | ID | Name | -------------------------- | 734 | L6A_Velocity | | 736 | L6B_Velocity | | 738 ...
2
votes
4answers
78 views

Copy table from one server to another including keys and indexes

I have been working on a small project for about two weeks. We want to consolidate a few tables from several remote server databases in order to run queries and reports on separate from the live ...
1
vote
1answer
33 views

How to deal with a table that exists in the ALL_OBJECTS table but cannot be selected

I am seeing a weird behaviour in my Oracle DB schema around a 'missing' table. The end goal is to gather statistics for all the tables that our team uses. All those tables have a common prefix - rca. ...
0
votes
0answers
22 views

Possibility of using self-referential foreign key to create hierarchical comments

I am an accidental DBA and have a question regarding the table structure of a website I maintain (postgresql 9.6 backend). Imagine a typical content website (let's call it 'Links'), where users post ...
0
votes
0answers
68 views

Unpivot in MYSQL?

Please I need help on how I can transform the data that appears in the attached photo. Maybe Unpivot SQL?
0
votes
1answer
19 views

join a lookup table with a data table

I have the following schema in my database Neighbors: ( central_id, neighbor_id) Data: (central_id, value) This schema is for a convolution algorithm which for each central_id I have 6 neighbors(it ...
0
votes
0answers
36 views

Common way to handle a changing reference in dependency of status

I am new to SQL an SQLite, so this is probably a silly question. I am designing the data model for a commercial application. While documents (like quotes) are being created, I need to reference to ...
1
vote
2answers
72 views

SQL Server - Physical Table Design - Column Order - Null and Non Null Columns

We are in the process of building out a database for a new application. I got some feedback from the architect that he read somewhere there is a memory utilization benefit for having all of the non-...
0
votes
0answers
9 views

Table level replication in Mysql [duplicate]

I want to change the config file(my.ini) to replicate particular table. The following statement is working fine for particular database replication "binlog-do-db=databasename" and the same way i need ...
0
votes
1answer
82 views

How to replicate particular table in MySQL master-slave configuration?

How do I replicate a particular table in a MySQL master-slave configuration? I have tried replicate-do-table and replicate-wild-do-table. I tried in my.ini file; is there any alternative to replicate ...
0
votes
1answer
29 views

Insert iterated values from one table to another in OracleDB

I'm pretty new in Oracle universe and I need help. I have to iterate through Users Table and insert these 3 specific rows into Task_Group Table. The hard thing to do is to check if these rows even ...
0
votes
1answer
57 views

dynamic or static database tables

I am creating a little mulitplayer game. The game creates a session where players can join in. Then the session has to store some data provided in the game. Should I create a new session table ...
1
vote
1answer
42 views

Weird error on creating table and selecting rows from table

I have db and I am trying to create table called "sales_invoice_grid" I am having bellow scenarios: error 1: while creating the table "sales_invoice_grid" manually, it gives the message that it ...
0
votes
1answer
42 views

The simplest way to copy sql tables from one database to another?

So I have been logged into two different database. I want to copy one table from the first database to the other one with its content. I want to overwrite the content of the destination one (Because I ...
2
votes
1answer
336 views

Why am I receiving the identity insert error even after explicitly setting IDENTITY_INSERT ON and using a column list? [closed]

My code: SET IDENTITY_INSERT SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn ON INSERT INTO SomeCoolDatabase.BoringOldSchema.TableWithIdentityColumn SELECT ColumnWithIdentity, ...
0
votes
0answers
25 views

How to effeciently save this kind of text into database?

I have this kind of text and want to save it to database: I. Master Text I <<<Parent I.A. Sub Master Text I &...
0
votes
0answers
25 views

How to add values matching from table B to table A?

I've been struggling for a while now. Can someone help me? I have 2 tables. I have a table 'SKUS_info' with SKUS(a number assigned to a product), approximately about 30k rows. And the second table ...
0
votes
0answers
35 views

Does having unused columns effect the indexing of the table

I have a table where there are some columns which are empty and they are not used. That table has to be indexed multiple times based on the application. Does having these empty columns in my table ...
0
votes
1answer
24 views

How to store data in look-up tables when some of it may be semantically different, but logically the same?

I am working on a system that receives communications from various laboratories. Each laboratory has two separate, independently operated data services which means that Laboratory A and Laboratory B ...
0
votes
1answer
34 views

Combine many table into one table in mysql table design

I'm grappling to design table relation. Version is Mysql 5.6.10. My case is like below bill table, payment table, contract table, recruitment tables... are existing. Currently we're considering new ...
1
vote
1answer
46 views

MySQL, operation DELETE

I have: DELETE FROM songs WHERE songs.id_album = album.id AND album.id_band =16` Error: #1054 - Unbekanntes Tabellenfeld 'album.id' in where clause. Table album exists, field id too, 100%. ...
0
votes
1answer
28 views

select number that isn't in the table

So I have a table named reserveringen. inside the table there are (Reserveringsnummer(auto_increment and Unique), Voorstellingsnummer, Stoelnummer). I also have a table named voorstelling in that ...
0
votes
0answers
22 views

Can you insert a value from a range in mysql?

So basically I have one auto incrementing column which is increments every time a ticket has been sold. However I also have 50 chairs inside the room. since I can't use auto_increment 2 times is there ...
1
vote
1answer
65 views

How to count records from different tables [closed]

So I'm trying to filter some records out of my select inside a form on my website. Problem is that I currently have this setup: Database Table1 time Number Table2 Number Something I'...
0
votes
1answer
56 views

Generate metadata file from PostgreSQL server [closed]

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
43 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
49 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
37 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
40 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
38 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
1answer
102 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
38 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
69 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
94 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
88 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
28 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
17 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
77 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
39 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 ...