Questions tagged [table]

A data structure that organizes information into rows and columns.

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

Does CREATE TABLE AS lock the table?

In Postgres, does this query lock films for reads and/or writes? CREATE TABLE films2 AS TABLE films;
1
vote
0answers
21 views

Set Maximum Tables In A Database [duplicate]

I need to set up a MySQL database with a maximum number of tables which can be created in it. For example, if I have my maximum at 5 tables for a single database, and someone attempts to create a 6th ...
0
votes
1answer
22 views

Creating a table in Oracle procedure [closed]

I am trying to create a table inside a procedure but getting some issues related to quote identifier or may be something else. BEGIN EXECUTE IMMEDIATE 'Create newTable as select * from oldTable'; END;...
6
votes
1answer
86 views

At what point is a (disk-based) table removed from memory after data is read from it?

Are (disk-based, so no Hekaton) tables persisted in memory for longer than the lifespan of the query that is reading data from them? If so, what determines how long they stay in memory for? Is there ...
2
votes
1answer
22 views

Importing a single large table in Azure

I have an existing DB called MyDb in Azure SQL Server. I have a bacpac of another DB with several tables in it. I'm interested in importing one single table (that table has no FK, it makes things ...
1
vote
2answers
39 views

How much storage space do indexes and keys take for an SQL Table?

I have a table which is predominantly filled with NULLS and takes up 10 GB which was shocking since probably 90 to 95% of the table is NULLS. I copied this table over to a new database on the same SQL ...
0
votes
0answers
5 views

Translations of names in profiles: [2 tables, one for names + one for profiles] or [one table for both, but with jsonb field for names]?

I am developing a profile module where company names could be translated (ie company may have the same name but in different languages, for example Eng/Rus for Microsoft/Майкрософт). Users may use a ...
0
votes
0answers
40 views

SQL query result table to an HTML table for email

please help me to figure this out. I need to send sql query results as html table. The challenge is that columns in this table are dynamic (most recent 5 dates). How can I replace literal column names ...
-3
votes
1answer
47 views

Transfer Mysql table data to client Server via TCP/IP by using Trigger [closed]

i Have Database on MySQL Server. I have one Table so called "log" in Database. Data has been insert in Database table automatic. I would like to transfer table via TCP/IP to the another Software. ...
0
votes
1answer
60 views

How to deny a user to access (select, insert, delete, update) to tables but grant (select) a few

i am trying to deny a user to access (select, insert, delete, update) to tables on my database but i also need him to grant only select to a few tables, to do this i created a user with login and gave ...
0
votes
2answers
88 views

Drop a 500 GB table, any consequences? [duplicate]

I need to drop a table that is 500 GB in size. It contains historical data that's not needed or used. There are no FK constraints. Any consequences of just dropping the table? I'm also using DB ...
0
votes
0answers
38 views

What's the best way to model similar tables with overlapping functionality?

I'm building a sports event/tournament/league management app for myself, and I'm stuck on the best way to model how Teams should relate to the different competition types. Some background regarding ...
0
votes
2answers
48 views

How to automate the detection of the column type of a csv file for a table creation script?

I am new to pgAdmin and Azure database. I have a huge csv file with around 220 columns and I want to create a table out of it in pgAdmin4 to push it to Azure. However I don't know how to detect ...
-1
votes
1answer
22 views

Is there a best practice design for handling different types of the same object which have different properties?

This may be a rather naive question and I am not even sure if I am asking it in the best way, so my apologies if not. I would like to know if there is a standard, or best way to handle cases where ...
0
votes
1answer
31 views

Delete comment - actually delete it, or create `deleted` column and update it?

I'm really not sure if this is the right community to ask it in, but it seemed like it fits here. But anyway, I'd like to know what's the usual approach of deleting a comment from database through ...
1
vote
3answers
77 views

Are there any reasons why a table wouldn't show in sys.dba_tables? (Oracle)

I have 2 queries SELECT * FROM sys.dba_indexes WHERE Table_Name = 'XDB$RESOURCE' and SELECT * FROM sys.dba_tables WHERE Table_Name = 'XDB$RESOURCE' Are there any reasons why a table wouldn'...
0
votes
1answer
34 views

How to count multiple occurences on the same date

my question is related to the table down below, where I have to count multiple occurences of "Hours" if they happen on the same "Date" by the same person. CREATE TABLE [dbo].[Time]( [GUIDTime] [...
1
vote
1answer
31 views

Database Model for Various Type of Sensors

I am planning to build a database that will store sensor value for various type of sensors in a factory building. Is there any best practice on how to do this? - Option 1 : should I integrate all ...
0
votes
1answer
38 views

Computed Column Operand type clash on Date Column When Checking For Null

This error is generated when trying to create a table with a computed column from a Date field. Operand type clash: int is incompatible with date If I comment out the computed column it works. [...
0
votes
2answers
56 views

Table function in oracle

I want to create a function that will return a table as a result. Now, I have written quite a big SQL that works, but as I need to push dates trough that SQL to the beginning, I need a funtion that ...
0
votes
2answers
77 views

Proper way to add new column in database

What is the proper approach when we add a new column into an existing table? For example, I already have columns like, Foo1, Foo2, Bar1, Bar2. Now I want to add a new column called Foo3. What is ...
0
votes
1answer
28 views

split big table into two joined view

i have a big postgres db with single table for product and attribute but i want two view of one with product and one with attribute. for example now i have tb_products iditem | name | attributes ---...
0
votes
1answer
94 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 ...
5
votes
2answers
944 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
52 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
23 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
77 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
45 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
77 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
19 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
497 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
36 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
35 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
416 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
46 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
37 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
380 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
30 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
38 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
86 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
10 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
282 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
30 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
155 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
51 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
43 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
541 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
26 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
90 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 ...