A data structure that organizes information into rows and columns.

learn more… | top users | synonyms

0
votes
1answer
31 views

Table/database design question

Suppose you have these fields to keep track of in records: (first_name, last_name, state_id, stateid_status, day, month, year, id_status, id, criminal_status, charge, plea, sentence, create_time, ...
0
votes
3answers
66 views

Difference between a schema and a database in db2

I can not figure out what is the difference between schema and database in db2 I find this SQL so confusing for example : CREATE TABLE schema1.table1 .... .... .... IN database1.tabspace1 Can ...
3
votes
0answers
51 views

What is the difference between a field and a column? [duplicate]

Although I have always regarded the terms as interchangeable, I have read somewhere that they’re not the same. I suppose this means that a record is not exactly the same as a row either. I teach that ...
1
vote
2answers
41 views

UPDATE from subquery updates rows that shouldn't be updated

Using PostgreSQL, I want to update a column. The information how to update is in another table. My try was this, but it also updates rows I don't want to update: update table_1 set column_x = ( ...
0
votes
1answer
23 views

Performance penalty for using thousands of tables in MySQL

Background I'm using wordpress multisite in which each user will have separate blog. For each blog, additional 15 tables are created. The website will be used by thousands of users. That means that ...
0
votes
1answer
52 views

ORA-00942: table or view does not exist- Can it be solved by granting privileges to user?

I am creating a Java application that connects to an Oracle Database. In the application I connect to the DB as User A, which works as intended. I then try to access tables in Schema 1 and Schema ...
-4
votes
1answer
27 views

SQL Server Table Creation Help [closed]

I'm a newbie, taking University course on DBA with Microsoft SQL Server and trying to write my first manual create table table but I keep getting errors in query or in using SQL Fiddle My attempt is ...
0
votes
1answer
31 views

MySQL BETWEEN command - performance (order)

I want to create a table which will contain approx 20,000 records of three fields each. Two of the fields will contain numeric values. I want to be able to issue a SELECT BETWEEN command. One record ...
0
votes
1answer
42 views

Don't know why MySQL is not creating table with primary key constraint [closed]

I can't understand why MySQL showing this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...
0
votes
0answers
23 views

How can I partition a table in DB2 luw

I want to know if there is an option that substitute "PARTITION BY SIZE" in DB2 luw , it works in DB2 zOS, but it is not supported by luw
0
votes
1answer
45 views

Should a TeamMembers table have a relationship with the Student Table or the Enrolment Table?

I'll keep it nice and short and simply link to the ERD: Users can be assigned a role, one of those is student. So for the sake of this, Students are the same as Users! A Student can be enrolled in ...
1
vote
2answers
45 views

Find times when table is least frequently used

I would like to analyse performance of one of the big tables in the database. There are only two types of operations on it. Inserts and reads. Once data is entered it is never updated. I need to ...
0
votes
1answer
32 views

want to import exported xml file in wamp phpmyadmin

I have exported single table from wamp phpmyadmin as xml file for data verification and want to import it again into database as mysql table. Please give me guidance, how its possible?
0
votes
1answer
39 views

MySQL ADD KEY meaning

This code below is creating a primary key on table User, but Im not understanding the second ADD KEY (C_NATIONKEY), do you know what is doing? Its something about foreign keys? ALTER TABLE USER ADD ...
0
votes
0answers
16 views

How can i delete an orphaned table from AWS RDS database?

Info: Database is an RDS instance (MySql) Yesterday i tried to add a field to a table and did an Alter table command. There is probably some millions of records in that table. After a while it just ...
0
votes
0answers
20 views

XML to Database with XMLSpy

I am using XML Spy to take a XML file (looks like this) and create a database structure after it. I then import the data from my XML file to fill in the rows, etc. I find that some , about 1/4 of the ...
0
votes
0answers
52 views
1
vote
1answer
35 views

Two tables with same field

QUESTION: I have QUOTATION table and SOA table quotation - table is for pending and not approve quotation. SOA- table for approve quotation. i will just transfer the data from quotation table to ...
1
vote
0answers
11 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 ...
1
vote
0answers
52 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 ...
1
vote
0answers
18 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 ...
1
vote
1answer
39 views

Query that compares dates

I'm trying to create a query that shows if students are mature or not, based on their date of birth. However when the query is executed it returns all students as not mature. Any students that are ...
0
votes
0answers
38 views

MYISAM can't create table: Row size too large

We are having database in MySQL 5.1, we have taken the DB backup from MySQL 5.1 and trying to restore in MySQL 5.6. We are getting below error: ERROR 1118 (42000) at line 603: Row size too large. ...
3
votes
4answers
108 views

In a one-to-one relationship, where should the foreign key be placed?

I am currently designing an ERD for a project management system. I am unable to choose between two workable solutions as the best solution as I wish to embrace the best standards. The two entities ...
1
vote
2answers
157 views

novice-design: Are FOREIGN KEYs always necessary? Joins on columns which are not PK

I've been wondering if following approach is bad or really very bad:). Question#1: can we use indicator_id to combine data from indicator_values and indicator_details tables (without using FOREIGN ...
0
votes
0answers
43 views

MySQL Table Structure for Group User Permissions

I could use some assistance in restructuring the schema on mysql for more granular permissions. We have a website where for example there is data for site 1, 2, and 3. There are users A, B, and C. ...
4
votes
3answers
163 views

SQL - Many-to-Many relationship with same table and with relationship constraint

I have a SellerProduct table. Each row within the table represents product information as offered by a seller. The SellerProduct table has the following columns: id (serial, pk) productName ...
2
votes
2answers
35 views

List all articles with their amounts at a certain date+time

I've got a table with articles, and their stock amount changes: TABLE stock_history: +------------+---------------------+--------+ | article_id | amount_at | amount | ...
0
votes
0answers
46 views

DB table design for attributes with multiple entries (eg: Person -> Social Media)

I am trying to decide the structure of a DB table to store Employee data. I am bit confused on how to design attributes such as Address, Social Media etc. There should be provision for multiple Social ...
2
votes
0answers
65 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 ...
1
vote
2answers
56 views

Table design: how to store denormalized Excel data

I have following data stored in Excel which I would like to transfer to SQL DB. There will be a new value every year for every indicator. Indicator | 2001 | 2002 | 2003 ...
2
votes
1answer
87 views

Fill Database With Recursive Factorial Function

I want to calculate table's all of the rows's factorials value. And then i want to insert to each row's factorial value in table. so that i create table like as below: TABLE:FACTORIALS ...
0
votes
1answer
29 views

MySQL conditional trigger delete

I have a few tables (6 to be exact) and I want to make a trigger that will delete a row from a table based on a value from the main table. To elaborate, Let's say I have a main table called "main" ...
0
votes
2answers
411 views

mysql won't start, it says Table mysql.plugin doesn't exist

I've had this problem for several hours, and now I'm just tired.. When I try to start MySql from terminal (mac), i get ERROR! The server quit without updating PID file ...
1
vote
1answer
70 views

T-SQL Check another table rows if match delete them

I am creating a script in SSIS where I want table A to check if rows exist in table B. If they exist, they must be deleted. Table A is an archive table named Customer_archive Table B is a table that ...
0
votes
1answer
42 views

How move MySql table to another disk?

According to this it is impossible to use alter table for moving tables. So if I understand correctlly - to move table it is neccessary to do: Create new table Copy all row from old one drop old ...
0
votes
1answer
104 views

counting the number of a specific word in one SQL column

I'm trying to make a survey like a referundum to know if my neighboors in my small building are for or against a colectif compost to reduce the organics wastes. For this tool vote I'm using PHP and ...
0
votes
0answers
36 views

Generate N x M random sample table from normal distribution in MySQL

Is there an easy way to produce a table of, say 10000 (rows) by 500 (columns) of numbers from normal distribution with parameters mu = 1, std.dev = 5 ?
1
vote
1answer
96 views

How can I select records which are between 2 dates based on a date in a field in PostgresSQL?

I have two tables: 1 with an Unique ID with the first time they visited (in date format) and a historical addresses table with the same Unique ID, a start field (date field), an end field (date ...
0
votes
1answer
99 views

Update all rows from a table with random foreign key from another table

I have four tables: (show on image below) Topic whit columns: ID primary key int CategoryID references to table Category int UserID references to table User nvarchar(128) User with ...
0
votes
2answers
63 views

SQL data deletion alert

I want to know if some data has just been deleted from my database and receive an e-mail alert with the table names which have been affected by the deletion . I have set up SQL SERVER to send ...
-3
votes
1answer
26 views

i am not able to create the last table in my database,Help? [closed]

CREATE DATABASE DIVIGN; USE DIVIGN; CREATE TABLE CUSTOMER (CUSTOMER_ID INTEGER (10) PRIMARY KEY, FIRST_NAME VARCHAR (32), LAST_NAME VARCHAR (32), PASSWORD VARCHAR (16), ADDRESS VARCHAR ...
0
votes
1answer
40 views

table design for display content

In my previous work station, I saw them have a table design across all website they have worked on displaying editor content like this: column|page_id| title |content_1|... |content_n| lang ...
1
vote
2answers
70 views

How do I create a table whose values are based on queries of same table?

This is something that interests me, but I can't seem to find an answer as to how to do it. Basically, if I have a table and I want a column of that table to be based on a query, particularly when ...
3
votes
1answer
70 views

Designing Contacts

I've to create a DB structure which involves users, contacts, organizations and vendors. To break it down: We have a system with users (employees who use the the system). then these users add ...
0
votes
1answer
26 views

Filter Data to different data files on SQL server

I'm sure this is possible but I have no idea how or where to find the information on how to do it. Scenario: I have a reporting database (on SQL2008R2) which is split up into multiple file groups ...
1
vote
1answer
25 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 ...
1
vote
1answer
67 views

Search all columns in list of tables for particular string [duplicate]

I have a list of market data tables in one of our environments and need to search every column in the list for a certain string. Can anyone point me in the right direction. 1> select @@version ...
3
votes
2answers
150 views

How to read an excel file from a network machine using SQL?

I am trying to import some excel file data into a SQL table. I thought of using OPENROWSET for this. The issue is that the csv file is location in a different machine in the same network. How do I ...
0
votes
0answers
13 views

Organizing Educational Material

I worked with MC Access almost 10 years ago and not once since. Right now, I teach English and don't know any database lingo. I need some help in plain English. I've read some Q&A's here and it is ...