• Non ci sono risultati.

Databases Sample theory questions

N/A
N/A
Protected

Academic year: 2021

Condividi "Databases Sample theory questions"

Copied!
1
0
0

Testo completo

(1)

Databases

Sample theory questions

Exercise 1. The SQL command

CREATE TABLE T1

(A1 CHAR(5) NOT NULL,

A2 INTEGER UNIQUE NOT NULL, A3 CHAR(5) NOT NULL,

PRIMARY KEY (A1));

A) is incorrect, because in this case UNIQUE and NOT NULL are conflicting with each other B) is correct provided that a single value is stored in A2

C) none of the answers is correct

D) is redundant since, in this case, UNIQUE and NOT NULL have the same meaning E) is correct

Exercise 2. In SQL, to check if an attribute contains a NULL value

A) none of the answers is correct

B) it is not possible to check this condition C) the LIKE operator should be used D) the IS operator should be used

E) the UNDEFINED keyword should be used

Exercise 3. The following sequence of instructions:

PreparedStatement prstmt=conn.prepareStatement("UPDATE FAP SET Q=Q+? WHERE IId=?");

int Q=20;

String IId="I1";

prstmt.setInt(1,Q);

prstmt.setString(2,IId);

int numRec=prstmt.executeUpdate();

A) is incorrect because parameters (symbol ?) may not be used in update statements B) none of the answers is correct

C) increments the quantity of all supplies of item I1 by the amount specified in program variable Q D) is incorrect because parameters (symbol ?) may not be used in the WHERE clause

E) the compilation phase for the update query occurs when the executeUpdate method is invoked

Exercise 4. A transaction is atomic if

A) all users share the same process

B) it is executed on the system at the same time as other transactions, as if it were the only one being executed

C) none of the answers is correct

D) it brings the system from a valid state to another valid state

E) it makes modifications permanent immediately after the transaction has ended

Riferimenti

Documenti correlati

Altri dati difficili da reperire sono stati quelli relativi agli assegnisti di ricerca, complessi da disaggregare per genere perché non gestiti a livello centralizzato, ma dai

The result is the logistic regression model // based on the best set of parameters (based on the results of the // cross-validation operation). CrossValidatorModel model

un repertorio pressoché inesauribile cui attingere anche in anni successivi ⁷⁵. Come Marinoni Canella fu influenzato dalla pittura fiamminga, che ebbe modo di studiare nei suoi

The intuition of the result of Proposition 3 lies in the type of selection operated in each institutional environment: under bad governance an honest but uninformed decision

Based on the power requirements in Phase 0 and A, only two solar panels were required in order to ensure a positive energy bal- ance, however in order to ensure that a minimum of

We know that Δ ℎ and Δ are mean values over a temperature range, and since the required temperature is inside such range, we consider both values as constant... We may split

Models based on intensity have been elaborated exploiting some stochastic differential equations, for example CIR-short rate models.. That

There- fore an important development of the present work would be represented by the implementation of the developed algorithms on GPU-base hardware, which would allow the