Tagged Questions

A data structure that organizes information into rows and columns.

learn more… | top users | synonyms

0
votes
1answer
38 views

Work with table named Group [on hold]

I have a table named Group in my database , when I try to work on it it gave error : SELECT GroupID,GroupName FROM Group it said : Msg 102, Level 15, State 1, Line 1 Incorrect syntax ...
-2
votes
0answers
13 views

create table and insert to tablespaces

So, I have this statement CREATE TABLE JURUSAN ( ID_JURUSAN SMALLINT NOT NULL, ID_FAKULTAS SMALLINT NOT NULL, JURUSAN VARCHAR(60) NULL, PRIMARY KEY(ID_JURUSAN), INDEX ...
1
vote
4answers
236 views

How to determine the size of my tables in the SQL Server database

Is there any built-in function/stored procedure/query which is helpful to retrieve information about the size of MyTable in the SQL Server database?
0
votes
0answers
15 views

MySQL: #126 - Incorrect key file for table '/tmp/#sql_9dc_1.MYI'; try to repair it

I've been reading possible solutions to this problem but until this time, those solutions don't work with my case. Activity: In phpMyAdmin, the following error pops up while opening a View. Error: ...
0
votes
3answers
27 views

Mysql Create table shows ERROR 1005 errno 150

I am trying to make a junction table, but I getting a ERROR 1005 errno 150 CREATE TABLE 61furiousFistPokemon( cardNumber int NOT NULL PRIMARY KEY, pokemonName VARCHAR(12), type VARCHAR(10), stage ...
0
votes
1answer
21 views

postgresql replace table without losing dependancies

i want to replace an existing table with a new one, without losing foreign keys or inheritance relations. But I feel lazy to alter it to make it look like the new one. Is there a way to replace the ...
0
votes
2answers
34 views

Sync 8 tables of differents databases on same server

I will use eight wordpress websites and i need to sync ther wp-user tables so each single user can connect through all websites. All of these will be on the same server, using the same MySQL user, but ...
0
votes
0answers
24 views

Two types of rows with mutual fields and unique fields

I have a question about DB design. (MySQL) In my website, users can leave reviews for Stores and Products. Right now, there's a table for stores and a table for products. Each item ('item' = either ...
0
votes
0answers
25 views

MySQL moving large data from one schema to another

Good day, I have a DB schema that has a single table that grows about 30 million rows per week, or about 25GB. Every day we hit our limit of the data that can stay there so we move the data on to ...
0
votes
0answers
34 views

How to combine a default value with a new value?

I need to start the value of a column with CON, so when I insert a new value, it needs to "combine" both default and new value; for example: In the CONTACTO_ASP2_TAB table, the column NOMBRE has to ...
0
votes
1answer
19 views

Is it possible to run a trigger on Table Creation in MySQL

Simple Question. Is it possible to create a Trigger that runs everytime a Table is created. The goal is to create a metadata table for each table, but I can worry about dynamically passing the table ...
0
votes
1answer
10 views

Separate table creation at runtime or add column

I am planning to keep patient data in a patient table. I will have multiple Clients registered with me, and each client will have multiple doctors. Should I make patient table client wise or a single ...
0
votes
0answers
61 views

Suitable database to store GPS track data

I have a network of vehicles. Each vehicle is equipped with a GPS sensor sending data over 3G to my FTP server. As a first solution to test the sensors, each vehicle sensor sends a .csv file to the ...
0
votes
1answer
33 views

A lot of data in the table is only accessed for 4 days or so, how to handle it afterwards?

We have a table that accumulates messages from local air traffic. It's approximately 5k-20k data rows a day that will only be actively accessed for a week at most. Afterwards it's just a log in case ...
1
vote
2answers
192 views

Best practice database design - user rating tables

I want to create a table to store user ratings of items for collaborative filtering algorithms. So far my table looks like this: IID | UID | Rating i.e. item ID |user id |rating. From ...
0
votes
1answer
45 views

alternative to trigger. Cascade

I have 2 tables: table_a: id int, user_id int, job_id int and table_b: id int, user_id int, job_id int I would like achieve something like when I delete a row from table_a it also delete a row ...
0
votes
0answers
32 views

How to populate Oracle 10g tables related via foreign key?

As the title says, how do i fill random data in tables, which have foreign key references within each other. I want to then practice all the SQL commands, like, SELECT commands, JOINS, SET FUNCTIONS ...
0
votes
1answer
22 views

Update table inner join

I have two tables and i need to update one of them with respect to the id's of the second table first table success log Id pid shiftid 1 2 2 2 3 2 ...
0
votes
1answer
34 views

Best open source DB technology to store and query large, sparse matrices [closed]

I have a large vector space model, in which each point is a multi-variate observation. In other words, I have a large number of pretty large records, mostly of ints and floats. I started with ...
0
votes
2answers
114 views

ORA-02049 and ORA-02063 Errors

Select For UPDATE NOWAIT is Performed on Table by 20 process in Parallel Below error is returned by the 4 failed processes out of 20 (16 Processes are Successful) SQL_UPDATE_ERROR- : SQL update ...
0
votes
0answers
29 views

Minimize table joins in design

Probably didn't come up with the best title, but I'll explain what I'm trying to do. I need to be able to track gym members, trainers, workouts, and gym locations. I've created a simple example below. ...
0
votes
1answer
51 views

creating a 24 hours data table - Suggestions/improvements

I am planing to have a table to store the data based on every hour , in short I have a file with 24 hour data and I need to use this to populate a hourly bar/line graph. Below is a sample 24hr data ...
0
votes
1answer
34 views

Altering a table to add a New Column vs Create table with New Column

I have Table A which i'm tasked to add a new column is_fully_complete bit(1), and i'm thinking: Would it be better to a.) Create a new table Table_A_new like Table_A and add the new column there ...
2
votes
4answers
58 views

How to retrieve closest value based on look-up table?

I'm attempting to create a query that will find the closest value from one table and return its ID into the resulting table. Below is an example that should describe the situation better. Sample ...
0
votes
0answers
53 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 ...
0
votes
0answers
13 views

Database for large dynamic network graph - best practise?

I am constructing a MySql database which is to contain data for a large network graph. There will be thousands of nodes and ten thousands of edges. The nodes and edges will be assigned a category. ...
0
votes
0answers
96 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) ...
2
votes
1answer
133 views

Auto_increment value needs to be set as S1

Hi I need to set auto increment for a table as S1. I tried by altering the table and also by creating by new table I am aware how to set auto_increment but when i try to set auto increment as S1 i am ...
-1
votes
2answers
55 views

Get the table affected by the query

How I can get the table which is affected by the query? Example Update cust Set name = 'john' Where custid = '4001' Output: cust ___________________________ Insert into emp(fname, lname) ...
0
votes
1answer
199 views

Copying a table in SQL Server database to Oracle database

I am new to database management. I need to copy a particular table "Attendance" in SQL Server database to Oracle database. There is no connection between the two databases. Also, "Attendance" is ...
0
votes
0answers
6 views

How import cvs/excel data into myphp table with existing data, without overriding the existing data?

My first question. So thank you in advance for your answer. I am looking for any easy way, without too much coding, to import cvs/excel data into myphp table with existing data, without overriding the ...
0
votes
0answers
21 views

Storing IDs of strings instead of strings?

I store every visit of a user to our site. In the table describing users (not visits!) I store his device name, device type (desktop, mobile, tablet), device manufacturer, browser name and version, ...
-1
votes
3answers
106 views

Full table scan even after adding index

i have two tables in Oracle 11g server one is partitioned and another is having a 3GB of data. I've added a composite index on both the tables based on the where clause, in the order it appears. The ...
5
votes
3answers
386 views

Two tables with same name in MySQL

I got this weird issue today when I dropped a temporary table. I dropped the temporary table and desc the table just to verify. But, the table was not dropped. After some searching I found that: ...
2
votes
1answer
152 views

Create a new table (multiple columns) by selecting random values from an existing table

I am stuck on the following task (PostgreSQL 9.3). Let's say we have the following table1 (which has 10k rows): table1: id 754 800 330 4 59 My goal is to create another table2 with two columns ...
0
votes
0answers
16 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) ...
2
votes
1answer
66 views

Optimal table design for a medical center rental service and recurrent shifts

I'm trying to figure out the optimal design for the following situation I'm being presented. I'm developing a medical web application with MySQL as db engine. A medical center has 14-16 offices/rooms ...
0
votes
1answer
38 views

Transforming Huge Database table to Another Table

We are migrating lot of data from our old database to new database. Presently, both of them are actively[writing/reading] used based on flows/activity as migration is in progress. Here's the real ...
4
votes
1answer
131 views

Table Data Space Used Confusion

I have a heap table with around 700k rows. The rowsize is 34 bytes: (1x BIGINT, 2x SMALLINT, 2x BIT, 4X INT, 1x SMALLDATETIME). Why does Data Space Used say this table is taking up nearly 4000000KB ...
3
votes
1answer
102 views

3 table merge with some condition

I am new to this forum and I am learning mysql with the help of online resources, currently I am trying to compare and merge table with some conditions Fiddle These are my tables; ...
1
vote
1answer
19 views

CREATE TABLE not issued on other masters

Database is created on all multi masters. Why CREATE TABLE doesn't being replicated to other masters. some explanations?
4
votes
3answers
233 views

Is there a good way to link tables and sequences?

I'm pretty sure you can't do this like you can with foreign keys but I'd like to document at the database level (even if it's just as a bit of free text somewhere) these relationships. Is there some ...
0
votes
1answer
30 views

Table Not Created On All MySQL Masters

Here is the multi master setup. Table is not created on middle master. log-slave-updates is not enabled in my.cnf file. Master 1 mysql> create database replication; mysql> use replication; ...
1
vote
2answers
306 views

Building A SQL table horizontally VS vertically

What is a better design principle when designing SQL Server tables. One can either add columns (ie grow horizontally) or grow it vertically (ie rather adding rows) I have a situation when there are ...
0
votes
1answer
99 views

Implementing a simple ERD in MySQL: is the implementation below 100% compliant with the ERD?

ERD Consider the following ERD: Tables From it, I derived the following tables: Company ------------------ c_id c_name ------------------ CompanyEmail ------------------ c_id ...
0
votes
0answers
36 views

more queries vs storing results in database

Environment: Embedded (smartphones) Data Structures: Object Table A: id, field1, field2... Object Table B: id, field1, field2... Object Table C: id, field1, ... , Object A, Object B ... many ...
1
vote
1answer
182 views

How much the decision to use ternary or binary relationship influences the accuracy of the model with regards to a given business model?

The question title is very long, so here's a little bit of context to (try to) make it clear. I asked a question regarding ternary relationship. The question was Ternary relationship: what's the ...
2
votes
1answer
635 views

Ternary relationship: what's the difference between having single table and having multiple tables?

Consider the following ternary relationship: Suppose that all entities have only two attributes (PK and Name). Here are the tables I derived (5 tables): Sector ------------------------- ...
0
votes
1answer
148 views

Conversion of simple ERD to Table: is the solution below any good?

Consider the following ERD: Suppose that all entities only have two attributes: a PK plus a name/number. I want to convert that ERD to tables. Is it needed 4 tables (1 for each relationship ...
0
votes
1answer
52 views

How to check if several tables exist in database, and how to show it in Mysql

I would like to check if several tables exist in a database, and return a easy to understand return, I know you can check if a single table exists by running show tables like "foo"; but is there ...