Questions tagged [table-structure]

59 questions
3
votes
2 answers

Single Inheritance or Polymorphic?

I'm programming a website that allows users to post classified ads with detailed fields for different types of items they are selling. However, I have a question about the best database schema. The site features many categories (eg. Cars,…
3
votes
2 answers

how to get table structure as an SQL query in phpmyadmin

I have many tables in my MySQL database & I want to know the table structure of all tables. When I type desc tableName in SQL Column I see the table structure in tabular format. How can I get the table structure in SQL query format as we normally…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
2
votes
1 answer

User Authentication and permissions table structure

I am creating a user authentication library (for the exercise). One of the things I am adding is is, a user can be assigned to multiple roles. Each role has set of permissions (think editUser, createUser etc). If a user is part of two groups if any…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
2
votes
4 answers

Is it efficient to have 90 percent of rows to have field set to NULL?

I have a table in my MySQL (InnoDB) full with user items. Basically each row has a user_id field and other item properties like color. Then there is one more field called a link which holds the id of some other user's item, but in most cases (90 %)…
Rihards
  • 10,241
  • 14
  • 58
  • 78
2
votes
1 answer

How can I retrieve the table structure from a sql database?

So basically I want a SQL Command that return every column in the table and the datatype that is in that column and whether is nullable.
Monocito
  • 117
  • 1
  • 12
2
votes
1 answer

Storing phone numbers in a SQL database

I have a table that stores mobile numbers it stores country network the rest so an example mobile, or masked is 64 21 8229918 CC NN XXXXXXX Now, Country makes sense to be called country Network to be called Network But what would you call the…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
2
votes
1 answer

Is it best to use multiple rows, or arrays to structure data

I am building a competition website and need to store multiple rounds of judges scoring for each entry. The 1st and 2nd rounds will have a score of either 0 or 1. If half of the judges give 0, it doesn't go through to the next round. Those that…
ccdavies
  • 1,576
  • 5
  • 19
  • 29
2
votes
1 answer

MySQL - Structure for Permissions to Objects

What would be an ideal structure for users > permissions of objects. I've seen many related posts for general permissions, or what sections a user can access, which consists of a users, userGroups and userGroupRelations or something of that…
Kerry Jones
  • 21,806
  • 12
  • 62
  • 89
2
votes
3 answers

Getting the table structure in ms access with SQL query?

How to get the table structure in MS Access with a SQL query? Using the following query: SELECT name FROM MSysObjects Results in the following exception: Exception: [Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read…
ess
  • 663
  • 3
  • 9
  • 17
2
votes
4 answers

Table structure for menus in mySQL

I need advices for a table structure. I need to create menus dynamically. There will be more than 3 menus. Some of menus will have multi-level structures. What is the best way to strucure the menu tables? All the menus are in one table Each table…
shin
  • 31,901
  • 69
  • 184
  • 271
2
votes
5 answers

Storing SAS data (including table structure) in a single flat file

I need to convert SAS data tables into flat files (or "ASCII files" as they were called once, as opposed to binary files). And only one flat file for each original SAS table. The challenging thing is that I want the flat file to contain some…
Martin Bøgelund
  • 1,681
  • 1
  • 17
  • 26
1
vote
1 answer

What would be the best table structure?

I'm developing an app that will store MLS (Multiple Listing Service) Property Listings from several different MLS's. The majority of my customers will only use one MLS, however, some will use mutliple MLS's. My question is: What is the best method…
Ricketts
  • 5,025
  • 4
  • 35
  • 48
1
vote
1 answer

Extensive Data Dictionary and ER Diagram

This is a question for an assignment. Can somebody please help me? Criteria Extensive data dictionary that contains appropriate data items and all relevant details of each data item. Extensive ER diagram that contains appropriate tables and…
Jibin John
  • 179
  • 1
  • 7
1
vote
0 answers

MySQL Keywords as column name

Scenario I have a MYSQL table with a column called text. I've only recently realized that TEXT is in fact a MYSQL keyword, but I haven't had any problems using that column name. Background I've already noticed from the MYSQL documentation that there…
E. Villiger
  • 876
  • 10
  • 27
1
vote
2 answers

Question regarding efficient table usage in MySQL

I want my users in my web app to be able to sign up for different "events". Each event has things describing it such as name, date of event, the description, and people describing the event. Should I create an individual table for each event? Or…
Austin Gayler
  • 4,038
  • 8
  • 37
  • 60