Consider the following database table :

Create table test(

one integer,

two integer,

primary key(one),

unique(two),

check(one≥1 and ≤10),

check(two≥1 and ≤5) );

How many data records/tuples atmost can this table contain ? 

(A) 5 (B) 10 (C) 15 (D) 50

1 Answer

Answer :

(A) 5 

Related questions

Description : In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

Description : Consider the following two commands C1 and C2 on the relation R from an SQL database:  C1: drop table R; C2: delete from R; Which of the following statements is TRUE? I. Both C1 and C2 delete the schema for R. II. C2 ... R. (A) I only (B) I and II only (C) II and III only (D) I, II and III

Last Answer : (C) II and III only

Description : Which of the following statements is FALSE about weak entity set ? (A) Weak entities can be deleted automatically when their strong entity is deleted. (B) Weak entity set avoids the data ... weak entity set are not partitioned according to their relationship with tuples in a strong entity set.

Last Answer : (D) Tuples in a weak entity set are not partitioned according to their relationship with tuples in a strong entity set.

Description : Given an open address hash table with load factor a < 1, the expected number of probes in a successful search is (A) Atmost 1/α ln (1-α/α) (B) Atmost 1/α ln (1/1-α) (C) Atleast 1/α ln (1/1-α) (D) Atleast 1/α ln (α/1-α)

Last Answer : (B) Atmost 1/α ln (1/1-α)

Description : Consider the following database table having A, B, C and D as its four attributes and four possible candidate keys (I, II, III and IV) for this table: I: {B} II: {B, C} III: {A, D} IV: {C, D} If ... the database table? (A) I and III only (B) III and IV only (C) II only (D) I only

Last Answer : (C) II only

Description : Suppose ORACLE relation R(A, B) currently has tuples {(1, 2), (1, 3), (3, 4)} and relation S(B, C) currently has {(2, 5), (4, 6), (7, 8)}. Consider the following two SQL queries SQ1 and SQ2 ... (A) 2 and 6 respectively (B) 6 and 2 respectively (C) 2 and 4 respectively (D) 4 and 2 respectively

Last Answer : (D) 4 and 2 respectively

Description : What is the output of the following piece of code when executed in Python shell? >>> a=("Check")*3 >>> a a) (‘Check’,’Check’,’Check’) b) * Operator not valid for tuples c) (‘CheckCheckCheck’) d) Syntax erro

Last Answer : c) (‘CheckCheckCheck’)

Description : What type of data is: a=[(1,1),(2,4),(3,9)]? a) Array of tuples b) List of tuples c) Tuples of lists d) Invalid type

Last Answer : b) List of tuples

Description : An Assertion is a predicate expressing a condition we wish database to always satisfy. The correct syntax for Assertion is : (A) CREATE ASSERTION ‘ASSERTION Name’ CHECK ‘Predicate’ (B) CREATE ASSERTION ‘ASSERTION NAME’ (C) CREATE ASSERTION, CHECK Predicate (D) SELECT ASSERTION

Last Answer : (A) CREATE ASSERTION ‘ASSERTION Name’ CHECK ‘Predicate’ 

Description : Consider a CUSTOMERS database table having a column CITY filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have GAR somewhere in its name, ... *from customers where city like %GAR%'; (D) Select *from customers where city as '%GAR';

Last Answer : Answer: C

Description : Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ? (A) SELECT A FROM R; (B) SELECT A, COUNT(*) FROM R; (C) SELECT A, COUNT(*) FROM R GROUP BY A; (D) SELECT A, B, COUNT(*) FROM R GROUP BY A, B;

Last Answer : (B) SELECT A, COUNT(*) FROM R;

Description : Which of the following statements concerning Object-Oriented databases is FALSE? (A) Objects in an object-oriented database contain not only data but also methods for processing the data. (B ... Object-oriented databases store more types of data than relational databases and access that data faster.

Last Answer : (C) Object-oriented databases are more adapt at handling structures (analytical) data than relational databases.

Description : Consider a hash table of size m=100 and the hash function h(k) = floor(m(kA mod 1)) for A = (√5 − 1)/2 = 0.618033. Compute the location to which the key k = 123456 is placed in hash table. (A) 77 (B) 82 (C) 88 (D) 89

Last Answer : (C) 88

Description : GO BOTTOM and SKIP-3 commands are given one after another in a database file of 30 records. It shifts the control to (A) 28th record (B) 27th record (C) 3rd record (D) 4th record

Last Answer : (B) 27th record

Description : Drop Table cannot be used to drop a table referenced by a …………… constraint. A) Local Key B) Primary Key C) Composite Key D) Foreign Key

Last Answer : D) Foreign Key

Description : Drop Table cannot be used to drop a Table referenced by .................. constraint. (a) Primary key (b) Sub key (c) Super key (d) Foreign key (A) (a) (B) (a), (b) and (c) (C) (d) (D) (a) and (d)

Last Answer : (C) (d)

Description : The number of attributes in relation is called as its ..................... A) Cardinality B) Degree C) Tuples D) Entity

Last Answer : B) Degree

Description : An instance of a relation is a time varying set of …………………. A) Tuples B) Rows C) Both of them D) None of them

Last Answer : C) Both of them

Description : The number of tuples in a relation is called its …………. While the number of attributes in a relation is called it’s ……………….. A) Degree, Cardinality B) Cardinality, Degree C) Rows, Columns

Last Answer : B) Cardinality, Degree

Description : In a relational model, relations are termed as (A) Tuples. (B) Attributes (C) Tables. (D) Rows.

Last Answer : (C) Tables

Description : In the relational modes, cardinality is termed as: (A) Number of tuples. (B) Number of attributes. (C) Number of tables. (D) Number of constraints

Last Answer : (A) Number of tuples

Description : What is the output of the following code? >>> a=(2,3,4) >>> sum(a,3) a) Too many arguments for sum() method b) The method sum() doesn’t exist for tuples c) 12 d) 9

Last Answer : c) 12

Description : The one guideline to be followed while designing the database is A) A database design may be ambiguous. B) Unrelated data should be in the same table so that updating the data will be easy. C) It should avoid/reduce the redundancy. D) An entity should not have attributes.

Last Answer : C) It should avoid/reduce the redundancy.

Description : Consider the following three SQL queries (Assume the data in the people table) : (a) Select Name from people where Age>21; (b) Select Name from people where Height>180; (c) Select Name from people where (Age>21) or (Height ... number of rows returned by the SQL query (c) ? (A) 3 (B) 7 (C) 10 (D) 21

Last Answer : (C) 10

Description : The Unix Kernel maintains two key data structures related to processes, the process table and the user structure. Which of following information is not the part of user structure? (A) File descriptor table (B) System call state (C) Scheduling parameters (D) Kernel stack

Last Answer : (C) Scheduling parameters

Description : What is the data type of (1)? a) Tuple b) Integer c) List d) Both tuple and integer

Last Answer : b) Integer

Description : Consider the following two statements : (a) Data scrubling is a process to upgrade the quality of data, before it is moved into Data warehouse. (b) Data scrubling is a process of rejecting data from data warehouse to create ... true (C) Both (a) and (b) are false (D) Both (a) and (b) are true

Last Answer : (A) (a) is true, (b) is false

Description : A computer program selects an integer in the set {k : 1 ≤ k ≤ 10,00,000} at random and prints out the result. This process is repeated 1 million times. What is the probability that the value k = 1 appears in the printout atleast once ? (A) 0.5 (B) 0.704 (C) 0.632121 (D) 0.68

Last Answer : (C) 0.632121

Description : …………….. is used to determine whether of a table contains duplicate rows. A) Unique predicate B) Like Predicate C) Null predicate D) In predicate

Last Answer : A) Unique predicate

Description : …………… table store information about database or about the system. A) SQL B) Nested C) System D) None of these

Last Answer : C) System

Description : Consider a subnet with 720 routers. If a three-level hierarchy is choosen with eight clusters, each containing 9 regions of 10 routers, then total number of entries in the routing table is ................... (A) 25 (B) 27 (C) 53 (D) 72

Last Answer : Answer: A  Explanation: Each router needs 10 entries for local routers, 8 entries for routing to other regions within its own cluster, and 7 entries for distant clusters, for a total of 25 entries.

Description : The relational model is based on the concept that data is organized and stored in two-dimensional tables called ………………………A) Fields B) Records C) Relations D) Keys

Last Answer : C) Relations

Description : If a is an integer variable, a=7/3; will return a value A) 2.5 B) 3 C) 0 D) 2

Last Answer : D) 2

Description : The correct way to round off a floating number x to an integer value is (A) y = (int)(x+0.5) (B) y = int(x+0.5) (C) y = (int)x+0.5 (D) y = (int)((int)x+0.5)

Last Answer : (A) y = (int)(x+0.5)

Description : Suppose the function y and a fuzzy integer number around -4 for x are given as y=(x-3)2+2 Around -4={(2,0.3), (3,0.6), (4,1), (5,0.6), (6,0.3)} respectively. Then f(Around - 4) is given by: (A) {(2,0.6), (3,0.3), ... 6), (3,1), (6,0.6), (11,0.3)} (D) {(2,0.6), (3,0.3), (6,0.6), (11,0.3)}

Last Answer : (C) {(2,0.6), (3,1), (6,0.6), (11,0.3)}

Description : ............. is a combination of two of more attributes used as a primary key A) Composite Key B) Alternate Key C) Candidate Key D) Foreign Key

Last Answer : A) Composite Key

Description : Let pk(R) denotes primary key of relation R. A many-to-one relationship that exists between two relations R1 and R2 can be expressed as follows: (1) pk(R2)→pk(R1) (2) pk(R1)→pk(R2) (3) pk(R2)→R1∩R2 (4) pk(R1)→R1∩R2

Last Answer : Answer: 2

Description : A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( ); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b);

Last Answer : B) public void myMethod(int a, int

Description : The candidate key is that you choose to identify each row uniquely is called …………….. A) Alternet Key B) Primary Key C) Foreign Key D) None of the above

Last Answer : B) Primary Key

Description : ey to represent relationship between tables is called (A) Primary key (B) Secondary Key (C) Foreign Key (D) None of these

Last Answer : (C) Foreign Key

Description : Which one is correct w.r.t. RDBMS? (1) primary key ⊆ super key ⊆ candidate key (2) primary key ⊆ candidate key ⊆ super key (3) super key ⊆ candidate key ⊆ primary key (4) super key ⊆ primary key ⊆ candidate key

Last Answer : Answer: 2

Description : If h is chosen from a universal collection of hash functions and is used to hash n keys into a table of size m, where n ≤ m, the expected number of collisions involving a particular key K is (A) less than 1 (B) less than lg n (C) greater than 1 (D) greater than lg n

Last Answer : (A) less than 1

Description : If h is chosen from a universal collection of hash functions and is used to hash n keys into a table of size m, where n≤m, the expected number of collisions involving a particular key x is less than ................... (1) 1 (2) 1/n (3) 1/m (4) n/m

Last Answer : Answer: 1

Description : Why do you write ‘Integer.parseInt(br.readLine())’?

Last Answer : A: The inputs in a java program comes in the form of String objects which are read using the br.readLine() function. Now if we want the input in integer form, we have to convert it into integer using the parseInt() function of the Integer wrapper class.