Skip to main content

Questions tagged [table]

A data structure that organizes information into rows and columns.

131 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
2 answers
251 views

Alert on Table size

I need to create an alert on my application table when it reaches 98% of its threshold. I wrote an SP which checks the rows and logs the information into a log file which was monitored by alert system ...
Sakshi Sharma's user avatar
4 votes
2 answers
67 views

Snooping-safe Vote tables

I have a table with both user_id and vote. They are stored together so each user can only give one vote. However it's also problematic because admins can simply read who voted what. Is there a way to ...
aacom's user avatar
  • 57
4 votes
0 answers
1k views

Dynamic MySQL partitioning based on Unix Time

My DB design includes multiple MYISAM tables with measurements collected online, Each row record contains auto-incremented id, some data and an integer representing Unix time. I am designing an ...
Michael's user avatar
  • 173
2 votes
1 answer
699 views

Mysql - Table structure to hold history log without any primary key

I have mysql table that holds log data for some products, this data are deleted and inserted by a service every 5 minutes. This is the table: | id | product_id | dev_stage_id | production_order | log |...
SilentRage47's user avatar
2 votes
0 answers
66 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 ...
Le Duong's user avatar
2 votes
0 answers
183 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 ...
Yani's user avatar
  • 21
2 votes
1 answer
167 views

One status table for all models?

lets say I have a users,posts and categories tables .. users table would have statuses like ( active, expired .. etc ) posts table would have statuses like ( published, draft, archived .. etc ) ...
rook99's user avatar
  • 151
2 votes
0 answers
169 views

How to check wether a DB2 source table and their MySQL MyISAM duplicate are identical?

I want to compare two big tables if they are identical. If I update/insert one table into the other the process takes about 11 hours. What I am looking for is like a sum function which sum ups a key ...
Robi Wan Kenobi's user avatar
1 vote
0 answers
39 views

MySQL InnoDB Stored Procedure locks table?

MySQL 8.0 InnoDB I have some sql statement like SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION; INSERT INTO MyTable SELECT Name FROM MyTable ...
onets's user avatar
  • 11
1 vote
0 answers
44 views

Database Design for Tickets: Single Table with Conditional Fields or Separate Tables

I'm working on designing a database for a ticket management system, and I'm looking for guidance on the best database schema for my use case. The system allows tickets to be created by either a ...
pi3o1416's user avatar
1 vote
1 answer
152 views

Column containing keys from columns of another table

I have two csv files, countries and birth_rate_stat with the following data: ISO ISO3 ISO_CODE FIPS Display Name Currency Name Phone_Code Region Code AF AFG 4 AF Afghanistan Afghani 93 Asia AX ALA ...
Red Tornado's user avatar
1 vote
1 answer
24 views

Table Schema problem, column with multiple dependencies

I have a product table shown below: CREATE TABLE( Id_Product INT PRIMARY KEY, Product_SKU INT NOT NULL UNIQUE, Product_Name nvarchar(100) NOT NULL, Product_Section ...
VVT's user avatar
  • 11
1 vote
0 answers
114 views

Auto Increment ID based on 2 columns

I have table called Logs. it has 4 columns ID, USER_ID, USER_TYPE, USER_ACTION where USER_ID is unique USER_TYPE is unique for every USER_ID and USER_ACTION can be anything 1,2,3 or A to Z. USER_ID ...
Zoheb Patel's user avatar
1 vote
0 answers
51 views

Table for an Appointment App

experts, I am building out an appointment scheduler application. I am seeking advice on how best to tackle this issue. I am building out my ERD and I am the point where I will be creating a ...
Isaiah Melendez's user avatar
1 vote
1 answer
7k views

Linked server error- The table either does not exist or the current user does not have permissions on that table

There is a view that is being called from Server A (SQL 2016) and this view needs to read data from Server B (SQL 2014). There is a linked server set up between these two servers and the connection ...
sqllover2020's user avatar
1 vote
0 answers
416 views

How to log changed table fields in SQLite?

I have a table that looks like this CREATE TABLE IF NOT EXISTS "ebooks" ( "id" INTEGER PRIMARY KEY, "name" TEXT NOT NULL, "author"...
Attitude12136's user avatar
1 vote
0 answers
47 views

How to design a table schema to optimize insert and updates for a unique numeric column

Suppose there is a table with 3 columns id, name, score Name and score are both unique columns. The use case is that, The table is pre-populated with 10 rows. Scores are set from 1-9. A user can ...
MrKickass's user avatar
1 vote
0 answers
41 views

In Interactive SQL 12.0.1, How do I declare a temporary table and then run a compound statement in a single SQL Statement?

I am trying to load a csv file into a temporary table and then run a compound SQL Statement on that table. I can get the DECLARE LOCAL TEMPORARY TABLE ... INPUT INTO ... FROM [filename] to work on its ...
aquasheep's user avatar
1 vote
0 answers
685 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 have ...
find it now's user avatar
1 vote
1 answer
166 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 ...
1990rk4's user avatar
  • 111
1 vote
0 answers
28 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 ...
t.ry's user avatar
  • 21
1 vote
0 answers
837 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: ...
schlebe's user avatar
  • 191
1 vote
0 answers
895 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 ...
Chris Meder's user avatar
1 vote
0 answers
443 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 ...
Anand Hegde's user avatar
1 vote
1 answer
1k 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 ...
Michael Steele's user avatar
1 vote
2 answers
70 views

Queries gaining by adding a new index

How would i be able to find out which queries would gain by adding a new index. Ex: Lets assume i add a new NCI on a table , how would i be able to find out which queries would benefit from adding ...
user avatar
1 vote
0 answers
383 views

MySQL 5.6 trigger replication to slave locking the table

Heyo good sirs. I have a master to slave replication using Row-based replication. The master gets a few simple and fast reads but the majority of read load is directed at the slave. They sometimes ...
alu's user avatar
  • 11
1 vote
0 answers
61 views

The efficiency of an hierarchical table and query

I have this hierarchical table that will end up containing 5 or 600 unique names, many of which will be assigned to multiple parents, such as "Hunt" below... +-------------+----------------------+----...
glenn nall's user avatar
1 vote
0 answers
48 views

Trying to understand if annotations are necessary or not in ORMs

My previous thread was here https://softwareengineering.stackexchange.com/questions/328793/can-anyone-explain-this-one-to-one-one-to-many-many-to-one-many-to-many-conce but honestly I think it ...
The 29th Saltshaker's user avatar
1 vote
0 answers
2k views

Dynamic table name in Insert query

I have asked a question about dynamic table name in a prepared statement here , but I want to know if Mysql server support dynamic table name like this : SET @tbl = 'Dawin'; INSERT INTO @tbl (col1,...
mmad's user avatar
  • 31
1 vote
1 answer
817 views

How to handle id's referring to multiple tables in an SQL database

I'm working on an MySQL Database for my website but I'm not sure on how to proceed now. I get to the point where actions have requirements in multiple other tables, but also have influences in ...
user avatar
1 vote
0 answers
24 views

Need advice on storing pincode system (Zip code) and Shipping company Service Details

I am in the process of creating a system that could identify shipping companies (Fedex, UPS, etc.) from a given pincode (zip code) for a e-commerce platform. The shipping companies will provide a ...
Schrödinger's Cat's user avatar
1 vote
0 answers
451 views

Cardinality of an index in a MySQL table is equal to table's row size

I have just included an index to a MyISAM table and the cardinality appears to be 1 million something which is exactly the number of rows in the table. In fact it needed to be 315 because distinct ...
ilhan's user avatar
  • 3,049
1 vote
0 answers
1k views

Question on comparing two fields in Access

I'm not sure if the title is fitting as I am not 100% sure if what I am doing is correct but here goes. Here is my enrolment table, I have added a field called pass/fail as you can see which is a ...
ceefax12's user avatar
  • 125
1 vote
1 answer
38 views

Foreign key: in which table?

I made the tables blood_types and persons. Should the foreign key be created in the blood_types or in the persons table like I did? A person can have 1 blood type. A blood type can be assigned to ...
Roby Sottini's user avatar
1 vote
0 answers
2k views

Quotation and invoice mysql table

I am trying to develop a small business web application for my friends business. I do have some php,html experience so I have done the interface and all. Now I am trying to work on the database. The ...
jinsoul's user avatar
  • 11
1 vote
0 answers
124 views

Table metadata auto_increment value for table modification

if table X is modified(DELETE, INSERT, UPDATE) then table X's metadata value should get incremented. I can write trigger for the same. But inbuilt solution will be better. This way I can stop ...
Nilesh's user avatar
  • 111
1 vote
0 answers
49 views

Design optimization

I'm designing a database for a crm like software. Actually it's my first project so i'm learning on the run on this one. I have customer and employee tables. I also have a history table for tracking ...
theo's user avatar
  • 31
1 vote
0 answers
82 views

What are my options in creating this Location table?

Say I have an Items table. Each item has a location associated to it. This location can either be a city, a state or a country. I believe this could normally be solved with a column Type in the ...
Gust M.'s user avatar
  • 11
1 vote
0 answers
992 views

Copying a table with its structure, indexes, and associated triggers?

I have studied this post on Stack Overflow: Fastest way to copy a table in MySQL. But no answer is copying everything like the table's structure, data, indexes as well as associated triggers. Is it ...
ursitesion's user avatar
  • 2,071
1 vote
0 answers
1k views

Updating +150,000 rows using .sql file causes ERROR 2013 Lost connection to MySQL server during query

I am using ubuntu 12.04. I have a .sql file that is around 5 megabytes. When I use the command: mysql -u -p -v database query.sql The server prints out the content of the file (because of --verbose) ...
masterhon's user avatar
1 vote
1 answer
45 views

Trying to get BCNF out of this relation

The table is: Employee ( EID, Ename, PID, ProjectName, MID, ManagerName ) For the functional dependencies I got: EID==>(Ename) PID==>(ProjectName) MID==>(...
Nexgenexl's user avatar
1 vote
2 answers
568 views

Is it possible to COPY tables into PostgreSQL without setting structure first?

I'm just getting to grips with PostgreSQL 9.6. I'm wondering if there is a simple way to add a .csv table to a database without first creating the table structure in psql or pgAdmin? Or...I've not ...
Mat G's user avatar
  • 11
1 vote
1 answer
711 views

Improve query speed for large, wide table

I have created a medical claims database using PostgreSQL 9.4.1 and pgAdmin III. There is one table with ~61 million rows and 103 columns. The table has the structure given below. It is static and ...
user avatar
0 votes
0 answers
36 views

Creating table for inventory in existing database

Good afternoon. Let me preface this by saying I am not a DBA, I know just enough to get by and possibly get myself into trouble. I am being tasked with getting equipment inventory into an existing ...
Chris Kessler's user avatar
0 votes
0 answers
29 views

How can I attempt to row-compress a table type?

The documentation for row compression states that it has "No effect." on table types. This suggests that it's possible to attempt it, but ineffective. How can it be attempted? I find it ...
J. Mini's user avatar
  • 501
0 votes
1 answer
35 views

How to COPY table privileges dba_sys_privs into different table in Oracle

i want to copy table privileges dba_sys_privs in table A to new table B. i have create table B. What left now was it's table privileges'. Kindly advice. Thanks
Ahmad Hasanul Ishraf Shuib's user avatar
0 votes
0 answers
46 views

SPLIT RANGE ON A TABLE

I'm trying to create a job that executed automatically the rotation of partitions on a table. I executed the next script but the ranges are not rotating successfully DECLARE @PARTITION_FUNCATION_NAME ...
Carolina's user avatar
0 votes
1 answer
56 views

Json or separate column?

I'm developing a table structure to store the physical activity data and users can save their progress. The activities belong to multiple programs. like beginner program suppose be like having 1000 ...
Vidya L's user avatar
  • 101
0 votes
0 answers
59 views

how to create a duplicate table with the same constraints as the original in Oracle

I usually create a duplicate table like this: CREATE TABLE TEST_NEW AS SELECT * FROM TEST; This does create a replica of the original table, however, the constraints aren't replicated. is there a way ...
datascinalyst's user avatar