Designing tables

Hi,
I am building a Question bank application, in which I want to design the physical structure of the tables for now I need 2 tables
one is Question Bank and another one is the Answer table.
How we can design these tables as a single question will contain 4 answers in objective. Hence how we can design the relationship between
these tables also how we can create a ER diagram for these tables? What tool we can use? Open source tool is what we are looking for.
Please let me know your opinion.
Thanks.

797836 wrote:
Thanks.
I have created the below tables for category which determine the which categoty of questions, Java, DB, .NET,etc
Where i have QuestionBank and Answer table. With Answer does have a reference with QuestionBank Id.
CREATE TABLE t_category ( id BIGINT NOT NULL
, name VARCHAR(30) NOT NULL
ALTER TABLE t_category ADD CONSTRAINT catg_pk PRIMARY KEY (id);
ALTER TABLE t_category ADD CONSTRAINT catg_ui_name UNIQUE INDEX (name);
CREATE TABLE t_question_bank ( id BIGINT NOT NULL
, description VARCHAR(255) NOT NULL
, category BIGINT NOT NULL
CREATE TABLE t_answer ( id BIGINT NOT NULL
, question BIGINT NOT NULL
, user BIGINT NOT NULL
, score SMALLINT NOT NULL
, description VARCHAR(2000) NOT NULL
, date_of_answering TIMESTAMP DEFAULT CURRENT_TIMESTAMP
Please let me know your opinion on the above. Whether this looks fine or not?Where are the possible answers to the questions? Where to do you indicate which of the possible answers is the correct answer for a given question? Why the fascinations with BIGINT and SMALLINT instead of simply NUMBER?

Similar Messages

  • Designing table for client/server situation ....

    I am designing table that will be accessed by concurrent users. It's structure is given below:
    AccountID number(30) Primary Key
    AccountName text(50)
    I have a sequence named: "seqAccID" which increments AccountID and stores new ID.
    I want to know what changes must be done in the table so that if concurrent users are creating entering in the same table and press enter at the same time there is no possibility of error: "Primary Key violation".

    I have a sequence named: "seqAccID" which increments
    AccountID and stores new ID.
    I want to know what changes must be done in the table
    so that if concurrent users are creating entering in
    the same table and press enter at the same time there
    is no possibility of error: "Primary Key violation".You don't need anything, sequences guarantee the uniqueness (that's their purpose). See http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref883
    If you use your own counter instead, then the For Update suggestion is correct.

  • Ever used the Designer Table API (TAPI) with object type in the DB?

    Hi all,
    We are trying to generate the Oracle Designer table API of a table that has a column defined by an object type. It works without problems if that column always has a value (is instantiated in object term). The problem is when we update a row where the column is null (all attributes of the object are null thus the object is not instantiated).
    The "before update row" trigger of the Table API fails with error "ora-30625-method dispath on NULL SELF argument is disallowed".
    The code that fails is the following:
    cg$ind.TFO_DESCRIPTION :=(:new.TFO_DESCRIPTION IS NULL AND :old.TFO_DESCRIPTION IS NOT NULL )
    OR (:new.TFO_DESCRIPTION IS NOT NULL AND :old.TFO_DESCRIPTION IS NULL)
    OR NOT(:new.TFO_DESCRIPTION = :old.TFO_DESCRIPTION) ;
    In this example, cg$ind.TFO_DESCRIPTION is a boolean and the TFO_DESCRIPTION column is based on an object type.
    Thanks for any feedback or suggestions

    For a solution to this problem: I set down to write a relatively simple and small piece of code that we can use as post compiler or post generator. After we generated one or more TAPIs, we can run this post compiler to remedy the problem the TAPI has with Merge operations. The post compiler will fix the PL/SQL inside the database. It reads the TAPI objects using dbms_metadata, makes the simple change by manipulating the PL/SQL source and then recreates the objects using execute immediate. Using this post compiler, it takes but a few seconds to fix the merge flaw in all TAPIs in your application.
    http://technology.amis.nl/blog/index.php?p=842

  • Database design tables

    Hi,
    Iam working on small application it requires database tables .I don't know how to design tables.I have  design and fields depending upon this I need to create  tables.
    In design I have 3 tables
    Table1:
    projectname,type(efi,phase) radiobuttonlist,startdate enddate,empname
    Table2:
    efi type is radiobuttonlist field .If I click on efi  it shows 15 rows and 5  columns (Textboxes,dropdownn...).
    table 3:
    If I click on phase it shows 10rows and 5  columns (Textboxes,dropdownn...)
    columns(milestones(labels),StartDate,EndDate,walktesttatus,statuscomments,general comments)  in both types(efi  ,phase).In milstones columns there are different fields  for each type.
    Do I need to create EFI Table and Phase table separately ?

    As noted above, share more details with us like what is "efi".
    Typical project table design:
    CREATE TABLE Project(
    ProjectID INT IDENTITY(1,1) PRIMARY KEY,
    TypeID INT REFERENCES ProjectType NOT NULL,
    Code varchar(12) NOT NULL UNIQUE,
    Name nvarchar(255) NULL UNIQUE,
    ModifiedDate datetime default (CURRENT_TIMESTAMP) NOT NULL);
    TypeID is a FOREIGN KEY to the ProjectType table.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Sync up a database DDL to the Application designer table

    Hi All,
    Is there a way to sync up a database DDL to the Application designer table? We have a situation wherein these two do not match (in the nunmber of columns or fields).
    Edited by: user12102490 on Apr 5, 2010 12:14 PM

    A Record in Application Designer is like a blue print or a template to PeopleTools. PeopleTools also uses records to know what tables are in the database and what they look like. It does not use the database's meta-data or system catalog. Finally, the Records store some additional settings and properties to help with generating pages and loading the data into them.
    I think Application Designer's build feature is what you are looking for. That is where Application Designer will generate the SQL to create the tables that make the record structure you see in the record. You have to have the record open and in focus in Application Designer, and then, you can either click on the Build toolbar icon or the Build option in the menu. Once selected, you will see a Build dialog that asks you what you want to do. You choose the Create option if the table does not exist at all, and Application Designer will generate a Create Table statement. You can choose Alter table when the table exists but the number of columns is different. Finally, if it is a View, you would choose Create View and Application Designer will generate a Create View statement.
    It sounds like you need the Alter Table option because you already have a table in the database but the columns are different. What it will actually do is generate a Create Table statement with the new table structure. Then, it will write an Insert ... Select to copy the data from the original table to the new structure. Next, it will drop the old table. Finally, it will rename the new table structure to the original table name.
    When Altering tables, there are some settings that you may need to deal with. Mostly, they are in regard to dropping columns. If you have a column in the database that is not in the Application Designer, then Application Designer will skip building that record because it does not want you to loose the data in that column. You will have to change the setting to make sure that it will drop that column.
    Once the Build process is complete, you should check the output window at the bottom to see if it worked. You are looking for the line that hopefully says 0 errors. If not, you will probably see the SQL error statement that came from the database at the top of the output. Next, you should check the SQL. You can double click on the line that tells the SQL file that it generated. If the file is blank, that means Application Designer either thought the database matched the Record or there were columns that it should not drop.
    The Build dialog has options to run the SQL for you or let you run it. I always choose the "Build and Execute" option. That way Application Designer runs the SQL for me, but I can also review the SQL to make sure it did what I wanted it to do.
    There is a lot that could be said here, and I know I didn't cover it all. Does this help at all? Do you want me to elaborate more on any of it? Would it help if I posted screenshots on my blog of the Build process?

  • Design Tables in CS4

    Hi, I have just installed the design premium CS4 including the Dreamweaver. I can not insert neither a Design Table nor a Design Cell. I am in the DESIGN view everywhere. I set the insert point. I go to INSERT, then DESIGN OBJECTS. Here is shown another menu with Srpy and Div objetcs, but the option ¨Design Table¨ and ¨Design Cell¨ are like BLOCKED, INACTIVE, in GREY COLOR. Why? What did I do wrong? The REGULAR tables are working fine but what happened with the design ones? Thanks a lot.

    1. In below image: The feature "Draw table Layout" has been removed in DW CS4, CS5 (I think CS3 too) because lack of useless code.
    At right side. Image is captured from DW 8.
    2. If you want to design the table, see below.
    Hope this will helpful to you.
    -- Sag-e-Attar Junaid Atari

  • Designer Table APIs

    Hi All,
    Anybody has done projects using Designer Table APIs? We are currently in dilemma if we would implement the Table API or just create our own database triggers. We'll be deploying oure application thru 9iAS.
    What are the advantage and disadvantages with the Table APIs?
    Any feedback would be highly appreciated.
    TIA,
    Remar

    I have recently completed a large project for a government department using Design with the Table API (TAPI). While this approach has many advantages, there are some problem spots. The main one is that error handling performed by cg$errors package is not very intuitive. It can be difficult to troubleshoot code imbedded in the TAPI.
    That being said, I do like using the TAPI, I could not imagine coding for a large project that is Designer based without it now. It just may not be for everyone.
    Steve Brown

  • How to design tables for Apex applications?

    Hi,
    I am learning Apex . I have one question.
    Considering normal tables, I have primary key (some single column and some composite) for my tables.
    But I learnt that Apex works well when we have primary keys using sequences.
    So Should I do the following now.
    1) Add a new column to all my tables which gets populated from Apex directly and make that column as primary key
    2) Create a sequence to associate each such primary key
    3) Make the actual primary keys as Unique keys + Not null constraints
    Thank You

    Why are you designing your tables o suit the tool? What happenes when you change development products? You SHOULD develop based upon SOUND database design methods. Use of surrogate keys IS a prefered development method, since use of multi-key (Composite) keys is known to be a pain for multiple reasons..
    Take this small bit of knowledge.. Design you database properly for an interface and you will NOT have issues..
    Thank you,
    Tony Miller
    Raleigh, NC

  • Bug in ODT 11720 - indexed columns list in Design Table is disabled

    Start VS2008
    Server Explorer
    Expand any oracle db
    Expand Tables
    Design any existing table that has an existing index that indexes more than 3 columns
    Click Indexes tab
    Click the index name
    Try to scroll the list of indexed columns, because youre curious which columns are indexed and what order
    You cant, because the control is disabled

    Checks should be made to see if other controls (such as the text box for CHECK code, or the list for PKs) are similarly affected

  • Design table for performance (order - ordervisibility)

    I have tables like order, orderitem, etc. and requirements for order visibility:
    - One order can be seen by many users
    - One user can see many orders
    create table order (orderid number, ...);
    create table ordervisibility (orderid number, username varchar2(20));
    Order size is estimated to be >=500Mio. Application is a data warehouse with reporting.
    The relationship order - user will be skewed: some users will be allowed to see many orders while some will only see a small percentage.
    How should we design the system for performance?
    We think about creating table ordervisibility as index-organized table. Or are there better approaches like partitioning? Or is the approach with tables order na ordervisibility already suboptimal?

    <<<What is your 4 digit Oracle version (result of SELECT * FROM V$VERSION)?
    The system does not exist yet. Version will be derived from the requirements or most likely the latest version (e.g. 11.2.0.3 EE with partitioning option)
    <<<Are you wanting to prevent users from seeing other orders? You said one user can see many orders but are they NOT supposed to see other orders?
    Yes, you are right. We want to prevent other users to see orders that do not belong to them.
    <<<What determines which orders a user is allowed to see? A state code, a region code?
    The user in the OLTP system decides who can see orders (the user creating the order and maybe other users he selects)
    <<<Does this database, data and system already exist or is this a new design? Are there any other security mechanisms already in place? Is any of your data currently encrypted?
    The system does not exist yet. No other security mechanisms are planned (e.g. encryption).
    VPD is considered to implement the visibility (or alternatively views.)

  • Design Table with no of columns used for calculating the total

    Hello,
    I need to design a table/s for calculating the column values based on the operators provided. Like I have a table say
    TableID, Col1 , Col2 ,Col3 ... Total Value
    Total Value Column is calculating Col1 (operator value provided by the user) Col 2 (operator value provided by the user) Col3 etc
    Although I m thinking to create another table which stores operator values, however not sure how to calculate the total.
    like it can be COl 1 +Col2 -Col3 %Col4 etc.
    Please help.

    Can you show some data example+ desired result?
    DECLARE @t TABLE(a INT,b INT,c INT);
    INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
    SELECT *
    ,      (   SELECT  COUNT(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS  CountVal 
    FROM @t;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Designing table in Adobe

    Hi,
    I tried to design adobe in table format to get values from my context.but im getting only a single value.can any one please tell me how to get all row values in to my adobe.
    Regards,
    Divya

    Hi Divya,
    In my article below, I have also displayed a table inside the Adobe form.
    Step 7 in the article is especially useful.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/98a2c8a5-0701-0010-e8a5-df1b783e9c1a
    Regards,
    Sangeeta

  • In design table of Contents

    Can anyone help please?
    I have a problem with creating table of contents and changing the order of the from paragraph styles. For example, in the document I have the title and author set as style. In the TOC I want the author to come first followed by the title with a page number. I'm getting it to almost work but page numbers are off.
    Thanks

    In the TOC you have two options for order, page order or alphabetical. If you use page order, ID is going to list things in the order it finds them on the page, and it starts looking in the upper left corner and works down before moving to the right.
    You may be able to solve your problem by making sure the Author's name is in a frame that extends further to the left than the chapter title frame. A screen shot of the page in question would be a big help, with frame edges and invisible characters showing. Use the camera icon onthe editing page of the website to embed the image.

  • Database Design: table to enter product serial numbers

    Hi,
    I'm developing a database for invoice details. The data also includes product serial number. I have an Invoice table, Products table and InvoiceProducts table- to normalise the many to many relationship of Invoice and products. I can't enter the serial numbers in the InvoiceProducts table since this will mention the quantity of a particular product in the invoice. Please can you advise how/where I can enter the serial number details. what is the industry practise for storing invoice informatioin.
    Thanks in advance,
    Anand

    Thank you for the reply!
    Yes, that makes sense. I can call it InvoiceLineItem table. To clarify the problem...Invoice contains these relevant fields
    Invoice number
    55
    product number
    DV8654A
    number of units
    5
    serial numbers
    abcd
    acbd
    afgh
    abab
    ankn
    I'm not sure about adding serial numbers in products table since I want it to be a generic table for all products recorded from different invoices. I would want serial numbers to be invoice-product specific but again Im not sure how I can add serial numbers to the InvoiceLineItem table since invoiceID and productID cant be represented as composite Primary keys in that case. Also, I plan to have a column for number of units in the InvoiceLineItem table.
    Can I introduce a serial number column in the InvoiceLineItem table and separate all the serialnumbers using a separator like comma?Will I compromise on atomicity of the serial number?If I include serial number column in the InvoiceLIneItem table... I can have composite key for InvoiceID, ProductNumber and serialNumber or will it mean redundant invoice and product details for every row of serial number
    The application essentially records all the details from a printed copy of Invoice onto the database through manual entry.
    Please can you help me getover this...
    Thanks again in advance
    Anand

  • LiveCycle Designer - Table content overflow

    Hi all,
    I have created a table and checked the box "Allow Page Breaks within Content" for both Table and the Body Row. My table normally spread thru 2 pages, and I found that the first row in the 2nd page does not introduce page break even the row content run out of the page.
    Can anybody help?? Thanks

    There is no patch .....if it is fixed in 8.2 then you will have to use that.

Maybe you are looking for

  • Firefox does not open at all and crashes. What is wrong?

    Up until recently Firefox was working fine. When I try to open Firefox no window opens, no page loads, all I get it the crash reporter telling me that Firefox had a problem and crashed. I have un-installed and re-installed Firefox once thinking this

  • Invalid Drive G:/ error message when trying to download I-Tunes 9

    I have had problems trying to download the last two versions of I-Tunes but as my ipod classic was working wasn't bothering. I just recieved an Ipod Nano 5th Generation for Christmas and when I plug into computer states that it needs newer version of

  • How to save the retrieved data in a subscreen...

    Hi, I understand that the subscreen has to be created in transaction se51. However, i dont have any idea how to use it and incorporate it in my main program. Im trying to figure out how to place all the data retrieved in a subscreen where the user ha

  • RBS questions on sharepoint 2013

    I need some advice on RBS setup on sharepoint 2013.  I am following the microsoft article on setting RBS setup, on where you run some sql queries for the sql file stream on the content databases you want RBS to be setup on.  Then i download the RBS_a

  • Acrobat8.2 in Vista freezes with PDF version6

    I cannot open a small 443 kb PDF file made in 2005 possibly with Acrobat6 or earlier. These files are long colored banner files in the Y direction (logs) and Acrobat 8.2 Professional starts reading (recognizing) the text while there is little text bu