Fundamentos de las Bases de Datos, grados I. Informática e I. Multimedia 

SB EXERCISES

SB02

1)      Candidates keys cannot store NULLs because...

 

2)      Oracle Database, MySQL, etc.,  being relational database management systems (DBMS)

a)      Will never allow tables without primary key.

b)      If we define a table without primary key, they will automatically use all the columns in order to define the key.

 

3)      Having tablaX (A, B, C, D)

If we define Primary key (A, B, C) then, which of the following set of attributes are possible alternative keys? Each option is defined independently of the others.

a)      (A)

b)      (B)

c)       (C)

d)      (D)

e)       (A, B)

f)       (A, C)

g)      (A,D)

h)      (B, C)

i)        (B,D)

j)        (C,D)

k)      (A,B,D)

l)        (A,C,D)

m)    (B,C,D)

n)      (A,B,C,D)

 

4)      Being a table R(A, B, C, D). Assuming that the identification property would be fulfilled independently of which identification key we choose and if  we want to obtain the maximum number of candidate keys, namely, choosing sets of attributes in which all columns are used and none of them are a  subset of another, how many CC could R potentially have?

 

5)      Given the schema and being the following script of orders performed, which of the following operations will never be performed (the engine of the database will return a runtime error)?

 

T1(a,b,c) PK(a)

a)      insert(1,10,100)

b)      insert(NULL,20,NULL)

c)       insert(2,20,NULL)

d)      insert(3,NULL,300)

e)      insert(2,NULL,NULL)

f)       insert(2,20,NULL)

g)      insert(1,20,200)

 

6)      Given the schema and being the following script of orders performed, which of the following operations will never be performed (the engine of the database will return a runtime error)?

 

T1(a,b,c) PK(b,c)

a)      insert(1,10,100)

b)      insert(NULL,20,NULL)

c)       insert(2,20,NULL)

d)      insert(3,NULL,300)

e)      insert(2,NULL,NULL)

f)       insert(2,20,NULL)

g)      insert(1,10,200)

h)      insert(1,20,200)

i)        insert(1,20,100)

j)        insert(2,10,100)

 

7)      Given the schema and being the following script of orders performed, which of the following operations will never be performed (the engine of the database will return a runtime error)?

 

T1(a,b,c) PK(b,c)

a)      insert(1,10,100)

b)      insert(2,20,200)

c)       update(1,10,100) to (1,20,100)

d)      update(1,20,100) to (1,20,200)

e)      insert(1,10,10)

f)       insert(2,20,100)

g)      delete(1,20,100)

h)      insert(2,20,100)

i)        insert(3,30,300)

j)        update(2,20,100) to (1,20,200)

k)      update(3,30,300) to (2,30,300)

SB Ejercicios por BDgite se encuentra bajo una Licencia Creative Commons Atribución-CompartirIgual 3.0 Unported. Basada en una obra en http://fbddocs.dlsi.ua.es. Permisos que vayan más allá de lo cubierto por esta licencia pueden encontrarse en http://fbddocs.dlsi.ua.es/autores.