Gbase8s练习题模拟题答案

本文提供了一系列关于GBase8s数据库的练习题目,包括Delete语句、创建表、删除数据库、创建视图、存储过程中的变量定义、数据迁移等方面的问题及正确答案,帮助用户熟悉GBase8s的SQL语法和操作。
摘要由CSDN通过智能技术生成

多选题
正确的Delete SQL语句是)
Aselect * from t_user where f_userid = 1;
Bdelete * from t_user where f_userid = 1;
C delete from t_user where f_userid = 1;
Ddelete t_user where f_userid = 1;
回答错误
正确答案:CD我的答案:BD解析:
Delete语法delete from <table_name | view_name lsynonym_name> [where condition]; from可以省略。

多选题
创建表正确的SQL语句是
Acreate table if not exists student(id int, name
varchar(20));
B create table if exists student(id int, name
varchar(20));
create table student(id int, name varchar(20));
new table student(id int, name varchar(20));
回答错误
正确答案:AC我的答案:AB C解析:
创建表语法create [standard | raw] table [if not exists]<table_name> (colname1 data_type1, colname2data_type2,...);

单选题
删除数据库正确的SQL语句是(
Adelete database courseware;
delete databases courseware;
C drop database if exists courseware;
drop database if exist courseware;
回答错误
正确答案:C我的答案:A解析:
删除数据库的语法drop database [lif exists] <db_name>;

创建视图正确的的SQL语句是()
Acreate view vTest as select * from student;
create view vTest select * from student;
C create view vTest ( select * from student );
create table vTest as ( select * from student );
回答错误
正确答案:A我的答案:C解析:
创建视图的语法create view [if not exists] <view_name>as <query_define>;。

Ⅰ多选题
在存储过程中定义变量正确的的语句是(
define x int;
define x, y int
Cint x
x int
回答错误
正确答案:AB我的答案:BC解析:
存储过程中定义变量需要有define关键字;支持系列定义。

多选题
GBase 8s rename database失败的原因有(()
database closed
B database不存在
C当前正在操作的database
D被更名的database处于打开状态。
回答正确
正确答案:BCD我的答案:BCD解析:
Cannot drop or rename the current database or anyopen database。

l单选题
create database 'CourseWare'产生的数据库名称()
A不敏感
B敏感
C需要明确使用nlscasesensitive 或nlscase insensitive
参数
回答错误
正确答案:A我的答案:C解析:
create database <db_name>产生的数据库名称不敏感。

l多选题
表中新增新列正确的SQL是(()
A alter table student add (Sex smallint);
Balter table student add (age int before Sex);
C alter table student add column(score int);
Dalter table student column add (score int);
回答错误
正确答案:AB我的答案:ABD解析:
新增列语法alter table <tableName | synonymName>add (newColumnName1 data_type1[,
newColumnName2 data_type2,..]) [beforeoldColumnName];。

Ⅰ单选题
重命名表中存在列正确的SQL语句是()
rename student.age to age1;
rename column student.age to age1;
C rename column 'student.age' to 'age1"';
rename column "student.age" to "age1";
回答正确
正确答案:B我的答案:B解析:
重命名表中存在列语法rename column <tableName>.<oldColumnName> to <newColumnName>;。


多选题
创建表正确的SQL语句是)
Acreate table if not exists student(id int, name
varchar(20));
Bcreate table if exists student(id int, name
varchar

  • 14
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cinderella-tzh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值