Oracle CREATE ANDROID RATINGS TABLE Example with primary key

Jyotishgher Astrology
By -
0

 Oracle CREATE RATINGS TABLE Example with primary key

What is the best approach to storing product or complaint ratings in a database?

In Oracle, CREATE TABLE statement is used to create a new table in the database.

To create a table, you have to name that table and define its columns and datatype for each column.

What is Primary key

A primary key is a single field or combination of fields that contains a unique record. It must be filled. None of the field of primary key can contain a null value. A table can have only one primary key.

A different table for ratings is highly recommended to keep things dynamic. Don't worry about hundreds (or thousands or tens of thousands) of entries, that's all peanuts for databases.

CREATE TABLE ratings  

( complaint_no varchar2(50) NOT NULL,  

  customer_name varchar2(50) NOT NULL,  

  rating number,  

  remark varchar2(50) NULL, 

  complaint_category varchar2(10) NULL,

  CONSTRAINT ratings_pk PRIMARY KEY (complaint_no)  

);  

commit;



Post a Comment

0Comments

Post a Comment (0)