A data structure that organizes information into rows and columns.

learn more… | top users | synonyms

-2
votes
0answers
21 views

Need Help verifying tables and creating the the junction tables needed for a Bank project

I am trying to create a mock system in MS Access for a Project (not homework). The 1st db I need to write is a Banking application. (in which I do not need to do transactions...just log in users and ...
0
votes
0answers
17 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
19 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
21 views

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

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
1answer
27 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
23 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
40 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
25 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 ...
1
vote
0answers
39 views

Efficient query involving union and virtual/derived table [migrated]

Both of these mysql queries produce exactly the same result but query A is a simple union and it has the where postType clause embedded inside individual queries whereas query B has the same where ...
2
votes
4answers
50 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
40 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
8 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
47 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
60 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 ...
0
votes
2answers
35 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
69 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
4 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
17 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
72 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 ...
6
votes
3answers
273 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
56 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
13 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
46 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
31 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
117 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
0answers
74 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
17 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
223 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
25 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
170 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
80 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
35 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
115 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
195 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
123 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
45 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 ...
0
votes
0answers
32 views

Access 2013 compare changes made to table

I am currently working on an Access 2013 database and trying to find the best solution to a problem I am having creating it (I am fairly new to databases so bear with me). Situation: Data is imported ...
0
votes
1answer
121 views

How to generate create table script without primary and foreign key in Oracle [duplicate]

I have lots of schemas and tables. I want to generate create script of all of my tables. I am using below statement and it is working pretty well. SELECT ...
1
vote
1answer
238 views

How to generate create table script without primary and foreign key in Oracle

I have lots of schemas and tables. I want to generate create script of all of my tables. I am using below statement and it is working pretty well. SELECT ...
0
votes
1answer
48 views

Last used index from specific table

how can i take last used index from a specific table and add a +1 to it? database login, table cars I think i need to add it here #### $sql = 'INSERT INTO '.$this->options['db_table'] ...
1
vote
1answer
192 views

When tables are locked does MySQL queue queries?

I have a small production website, but it's live 24/7. When running the Optimize, Analyze or Repair commands, MySQL locks the table it is working on. QUESTIONS How would this effect users trying ...
1
vote
1answer
64 views

Will a specific denormalization increase performance in a specific scenario?

Suppose I have a table with fields | a | b | c | d | ... | z | which contains millions of records and which will serve millions of queries a day. And the field z holds the id of some parameter which ...
0
votes
0answers
27 views

Database tables to store all old relations between them (SQL)

i have a main table with lines that never update, and i need relate each line from table 0 to one line from table1, one line from table2 and one line from table3. But the 3 relations change every ...
0
votes
1answer
55 views

autonumber and one-to-many relationship

I have a main table with an autonumber key. I need to introduce a new table, related to the main table in a one-to-many relationship (i.e. a record in the main table could conceivably link to several ...
1
vote
1answer
28 views

Methods for identifying differences in accumulating history table?

This question will probably be elementary to most DBAs. I'm doing light DB work which isn't my specialty and I'd like to create some kind of "change log" for a table that is copy/appended to a ...
0
votes
1answer
159 views

How to organize the tables of a MySQL database with several statistics data of several years?

I am developing an app that must provide statistics information about the distribution of the money that a person spends each year in taxes in the city where he lives. The user should select the ...
0
votes
1answer
74 views

Beginner table design

I have been coding in C# for a couple of years where I usually try to follow the 'single responsibility principle' which states that each class should ideally be responsible for only 1 goal. Now I ...
0
votes
1answer
79 views

Recommendations for how I should create my table based on data given?

I'm asking this as I'm kinda overwhelmed by the data presented to me (I'm still fairly new in programming and SQL). Basically I need to create a database to store warehouse equipment information, and ...
2
votes
2answers
49 views

Table Transformation with SQL?

I got a set of tables which have been imported into a database by transforming them like shown in the following picture: Now it is necessary to get the former tables back. Unfortunately the guy who ...
5
votes
1answer
213 views

changing mysql table comment

i know that: mysql table comment can be defined while creating it: create table (...)comment='table_comment'; and how to display it: show table status where name='table_name'; and i know how to ...