Concurso:
TCM-SP
Disciplina:
Banco de Dados
Considere a tabela relacional criada pelo comando
create table xx
(a int null, b int null, c int null)
Depois de instanciada com um conjunto de registros, os seguintes comandos foram executados:
select count(*) from XX
select count(distinct A) from XX
select count(distinct B) from XX
select count(*) from XX where C>10
select count(*) from XX where not C>10
Sabendo-se que esses comandos produziram como resultado, respectivamente, os números 10,10,0,0 e 5, analise as quatro alternativas para a definição da tabela XX:
I.
CREATE TABLE XX(
A int NULL,
B int NULL,
C int NULL )
II. CREATE TABLE XX(
A int primary key,
B int NULL,
C int NULL )
III.
CREATE TABLE XX(
A int NULL,
B int NULL,
C int )
IV.
CREATE TABLE XX(
A int,
B int primary key,
C int NULL )
A lista com todos os comandos que são válidos e compatíveis com a instância corrente da tabela é:
create table xx
(a int null, b int null, c int null)
Depois de instanciada com um conjunto de registros, os seguintes comandos foram executados:
select count(*) from XX
select count(distinct A) from XX
select count(distinct B) from XX
select count(*) from XX where C>10
select count(*) from XX where not C>10
Sabendo-se que esses comandos produziram como resultado, respectivamente, os números 10,10,0,0 e 5, analise as quatro alternativas para a definição da tabela XX:
I.
CREATE TABLE XX(
A int NULL,
B int NULL,
C int NULL )
II. CREATE TABLE XX(
A int primary key,
B int NULL,
C int NULL )
III.
CREATE TABLE XX(
A int NULL,
B int NULL,
C int )
IV.
CREATE TABLE XX(
A int,
B int primary key,
C int NULL )
A lista com todos os comandos que são válidos e compatíveis com a instância corrente da tabela é: