COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
create table shopper(shopperid number(4) primary key, shopperName varchar(20) not null, gender varchar(6), Mobileno number not null, Address varchar(50), GENDER in (’Male’, ‘Female’));
|
|
create table shopper(shopperid number(4) primary key, shopperName varchar(20) not null, gender varchar(10), Mobileno number not null, Address varchar(50), check(GENDER in (’Male’, ‘Female’)));
|
|
create table shopper(shopperid number(4) primary key, shopperName varchar(25) not null, gender varchar(10), Mobileno number not null, Address varchar(50), check(GENDER in (’Male’, ‘Female’)));
|
|
create table shopper(shopperid number(4) primary key, shopperName varchar(20) not null, gender varchar(6), Mobileno number not null, Address varchar(50), CONSTRAINT CHK ____ Gender check(GENDER in (’Male’, ‘Female’)));
|
Detailed explanation-1: -Create the Shopper table with appropriate data types for the attributes described below. create table shopper(shopperid integer primary key, shoppername varchar2(20) not null, gender varchar2(6) check (gender in (’Male’, ‘Female’)), mobileno number(10) not null, address varchar2(50));
Detailed explanation-2: -Use the view table constraints in the information schema schema. The column table name gives you the name of the table in which the constraint is defined, and the column constraint name contains the name of the constraint.
Detailed explanation-3: -The CREATE TABLE statement defines a table. The definition must include its name and the names and attributes of its columns. The definition can include other attributes of the table, such as its primary key or check constraints. To create a created temporary table, use the CREATE GLOBAL TEMPORARY TABLE statement.