请读明白下面的指令完成任务:CREATE TABLE "XS" ( "SNO" CHAR(6)primary key, "SNAME" VARCHAR2(12), "DEPT" VARCHAR2primary key(20), "SEX" VARCHAR2(3), "BIRTHDAY" DATE, "TOTALCREDIT" NUMBER(3), "REMARKS" VARCHAR2(50) ) ;1.创建的关系表名是:( )2.表中含有的字段分别是:( )( )( )( )( )( )( )3.指令中的primary key选项含义是定义该字段为( )键
举一反三
- 下来定义表的约束语法,错误的是() A: create table t1(id number primary key,name varchar2(10)) B: create table t1(id number constraint p_k primary key(id),name varchar2(10)) C: create table t1(id number constraint p_k primary key,name varchar2(10)) D: create table t1(id number,name varchar2(10),primary key(id))
- 创建学生表:CREATE TABLE Student([br][/br]Sno char(6),[br][/br]Sname varchar(8),[br][/br]Ssex char(2),[br][/br]Sbirth DATE,[br][/br]Sdept varchar(30)[br][/br]);[br][/br]现在要添加主键的代码正确的是( )。 A: ALTER TABLE student ADD PRIMARY KEY(Sno); B: ALTER TABLE student ADD PRIMARY KEY Sno ; C: ALTER TABLE student ADD unique (Sno); D: ALTER TABLE student PRIMARY KEY(Sno);
- 关于以下语句,叙述正确的是 mysql > CREATE TABLE is ->( -> stuID VARCHAR(11) PRIMARY KEY, -> stuName VARCHAR(30) NOT NULL, -> stuSex VARCHAR(2) NOT NULL, -> stuBirth DATE, -> stuSchool VARCHAR(30))
- 下列关于主键约束的语句哪个不正确 A: CREATE TABLE STU(no INT PRIMARY KEY,name VARCHAR2(20)) B: CREATE TABLE STU(no INT,name VARCHAR2(20),PRIMARY KEY(no)) C: CREATE TABLE SCORE(sno INT,cno INT,score INT,PRIMARY KEY(sno,cno)) D: CREATE TABLE SCORE(sno INT PRIMARY KEY,cno INT PRIMARY KEY,score INT)
- 【单选题】以下哪个 sql 语句表示在 mysql 中创建 book 表,并添加 id 字段和 title 字段? A. create table book{ id varchar(32), title varchar(50) }; B. create table book( id varchar2(32), title varchar2(50) ); C. create table book( id varchar(32), title varchar(50) ); D. create table book[ id varchar(32), title varchar(50) ];