CREATE TABLE skill
(
  id BIGINT(20),
  description VARCHAR(255) DEFAULT NULL,
  name VARCHAR(255),
  PRIMARY KEY(id)
);

The portal says wrong answer. I don't understand what is wrong in this code. After execution, it says'0 rows affected'.

3

There are 3 answers

1
Mureinik On

DDL statements do not affect any records, they affect objects, so a successful execution of a DDL statement is expected to return "0 rows affected".

Your DDL seems correct, although explicitly stating default null is a tad overly robust. Many (most?) DBAs I've worked with would omit it and simply use something like this:

CREATE TABLE skill
(
  id BIGINT(20),
  description VARCHAR(255),
  name VARCHAR(255),
  PRIMARY KEY(id)
);
0
itzmebibin On

Try this.

CREATE TABLE skill
(
    id BIGINT(20) NOT NULL,
    description VARCHAR(255),
    name VARCHAR(255),
    PRIMARY KEY(id)
);
0
Karthik Manohar On
CREATE table skill
(
 id           BIGINT(20),
 description  varchar(255) NULL,
 name         varchar(255) NOT NULL,
 primary key(id)
);

Please use the above query.