wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Database Concepts Quiz

Total questions: 102

Worksheet time: 2hrs 38mins

Name
Class
Date
1.

The number of attributes in a relation is called the ____________of a relation.

a)

Tuple

b)

Table

c)

Cardinality

d)

Degree

2.

In order to restrict the values of an attribute within a range, _________constraint to be used.

a)

Check

b)

NULL

c)

Default

d)

NOT NULL

3.

_______________ command is used to eliminate duplicate values of an attribute in the select query.

a)

Update

b)

Unique

c)

Distinct

d)

No Duplicate

4.

_____________ command is used to delete the structure of the table.

a)

Drop Table

b)

Drop Database

c)

Delete Table

d)

Alter Table

5.

Sana has given the following query but she is unable to execute it successfully. Write the correct query after rectifying the error.

Select Name, Marks From student Table Where Name =”P%

4 lines
6.

write any One DDL and one DML command.

4 lines
7.

(a)   is a collection of raw facts which have not been processed to reveal useful information.

8.

_______________command is used to modify the base table definition.

a)

Create Table

b)

Alter Table

c)

Update Table

d)

Modify Table

9.

List any four advantages of DBMS. [CBSE SQP]

a)

Reduction in Redundancy

b)

Improved Consistency

c)

Improved Availability

d)

Improved Security

e)

Not User Friendly

10.

Write any two Candidate Key from student table

4 lines
11.

Radha has given the following query, she is unable to run due to errors, rectify the errors and underline the correction made: [CBSE SQP]

Select unique department from employee:

4 lines
12.

______ command is used to modify the value of attribute of one or more tuple in a table. [CBSE SQP]

a)

Update

b)

Modify

c)

Alter

d)

Create

13.

Keyword used to display the structure of the table. [CBSE SQP]

a)

Describe

b)

Show

c)

Desc

d)

Display

14.

SELECT DISTINCT DEPT_NAME FROM DEPARTMENT; What does the above query do? [CBSE SQP]

a)

It gives all the tuples having dept_name

b)

It gives the dept_name attribute values of all tuples without repetition

c)

It gives all the dept_name attribute of all the tuples

d)

It gives all the dept_name attribute of all the tuples

15.

_________ is use to apply condition with GROUP BY [CBSE SQP]

a)

HAVING

b)

WHERE

c)

ORDER BY

d)

APPLY

16.

_________ is not an aggregate function. [CBSE SQP]

a)

Sum()

b)

Count()

c)

Round()

d)

Avg()

17.

____________ replaces zero or more number of random character, when used with Like keyword. [CBSE SQP]

a)

_

b)

%

c)

$

d)

@

18.

__________ command which displays list of databases available on the current server. [CBSE SQP]

a)

Show databases

b)

Show tables

c)

Create tables

d)

Display tables

19.
Write a query Display all records from Item table.
4 lines
20.

Write a query to remove column subject from student table

4 lines
21.

Write a query to add column subject varchar(20) in student table

4 lines
22.

What does "SQL" stand for?

a)

Structured Question Language

b)

Structured Query Language

c)

Simple Query Language

d)

Simple Question Language

23.

Which word is missing from the following SQL statement?


Select * table_name

a)

With

b)

Where

c)

From

d)

And

24.

How to select only NULL values?

a)

SELECT * FROM Products WHERE price = NULL

b)

SELECT * FROM Products WHERE price LIKE NULL

c)

SELECT * FROM Products WHERE price IS NULL

d)

SELECT * FROM Products WHERE price EQUALS NULL

25.

Correct command to create database school

a)

use school ;

b)

make database school ;

c)

create school;

d)

Create database school;

26.

Which SQL command is used to remove rows from the table customer?

a)

Drop from customer ;

b)

Update from customer;

c)

remove from customer ;

d)

Delete from customer where condition ;

27.

Which SQL keyword is used to sort the result-set?

a)

Sort by

b)

order by

c)

sort

d)

none of these

28.

In a table there are 3 rows and 5 columns. what is the degree of the table?

a)

5

b)

3

c)

0

d)

none of these

29.

Which operator test the column for absence of data?

a)

Not operator

b)

and operator

c)

is null operator

d)

None of these

30.

Which operator performs pattern matching?

a)

Between Operator

b)

Like Operator

c)

Exists Operator

d)

None of these

31.

Which of the following is the correct order of keywords for SQL SELECT statements?

a)

SELECT, FROM, WHERE

b)

FROM, WHERE, SELECT

c)

WHERE, FROM,SELECT

d)

SELECT,WHERE,FROM

32.

select all DML commands are:-

a)

INSERT

b)

UPDATE

c)

DELETE

d)

GRANT

33.

delete * from employee;

a)

Deletes all tuples.

b)

updates the table emp with null.

c)

Destroys the table.

d)

select all the record

34.

This symbol is placed immediately after the SELECT command to display all the fields.

a)

$

b)

%

c)

=

d)

*

35.

It is a DML command that is used to display record.

a)

DISPLAY

b)

STRUCTURE

c)

WHERE

d)

SELECT

36.

An SQL command used to add record in a table.

a)

Insert

b)

Create

c)

Update

d)

Add

37.

Duplication of record is called___________

a)

Deficiency

b)

Redundancy

c)

Lack

d)

Addition

38.

Which is the correct statement from the following :

Delete table book;

a)

Delete book;

b)

Delete table book;

c)

Drop table book;

d)

Drop book;

39.

_____ is a column that creates a relationship between two tables.

a)

Primary Key

b)

Candidate Key

c)

Super Key

d)

Foreign Key

40.

Non primary keys are called _________

a)

Primary Key

b)

Candidate Key

c)

Super Key

d)

Alternate Key

41.

---------- represents a “tuple” in a relational database?

a)

Table

b)

Row

c)

Column

d)

Object

42.

MySQL is freely available and is open source.

a)

True

b)

False

43.

---------- Command is used to delete a database.

a)

Delete database database_name

b)

Delete database_name

c)

drop database database_name

d)

drop database_name

44.

Which of the following is / are valid array declaration in Java?

a)

int arr[] = {1, 2, 3};

b)

int arr[] = new int[3];

c)

int arr[] = new int[] {1, 2, 3};

d)

All the above

45.

Which of the following is the correct one to find the length of an array in Java?

a)

size

b)

size()

c)

length()

d)

length

46.

Scanner is a class from _________ package.

a)

java.util

b)

java.lang

c)

java.io

d)

java.sql

47.

After successful compilation of ".java" file, ________ file will generate.

a)

.class

b)

.obj

c)

.exe

d)

None of the above

48.

Size of char data type in java?

a)

1

b)

2

c)

4

d)

8

49.

What does JDK stand for?

a)

Java Div Kit

b)

Java Document Kit

c)

Java Directory Kit

d)

Java Development Kit

50.

What does JVM stand for?

a)

Java VIRUS Machine

b)

Java Virtual Machine

c)

Java Virtual Machine

d)

None of the above

51.

What does JRE stand for?

a)

Java Runtime Environment

b)

Java Real Time Environment

c)

Java Real Environment

d)

None of the above

52.

Java is case sensitive langauge

a)

True

b)

False

53.

Java program processing always starts with main() method

a)

True

b)

False

54.

Which of these are Access Modifiers in java?

a)

default

b)

public

c)

protected

d)

All of these

55.

The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?

a)

True

b)

False

56.

The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?

a)

True

b)

False

57.

The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?

a)

True

b)

False

58.

Java supports both Primitive & Non-Primitive(User Defined) datatypes. Which one of the following is not a primitive datatype?

a)

byte

b)

short

c)

long

d)

class

59.

How many times 'Hello' is printed?


public class CppBuzz {

public static void main(String[] args){

for(int i = 0; i<5; i++)

{

System.out.println("Hello");

break;

}

}

}

a)

5

b)

4

c)

1

d)

0

60.

How many times 'Hello' is printed?


public class CppBuzz {

public static void main(String[] args){

for(int i = 0; i<5; i++)

{

System.out.println("Hello");

i++;

}

}

}

a)

5

b)

4

c)

3

d)

2

61.

Which statement about choosing variable names is FALSE?

a)

Variable names can contain letters, digits, underscores, and dollar signs.

b)

Variable names are NOT case sensitive

c)

Reserved words (like Java keywords, such as int or String) cannot be used as variable names

d)

Variable names can also begin with $ and _

62.

How do you start writing an if statement in Java?

a)

if (x > y)  

b)

if x > y then:

c)

if x > y:

d)

if (x>y):

63.

Which operator can be used to compare equality between two primitive values?

a)

><

b)

=

c)

==

d)

<>

64.

Which method can be used to return a string in upper case letters?

a)

touppercase()

b)

toUpperCase()  

c)

upperCase()

d)

toUppercase()

65.

The value of a string variable can be surrounded by single quotes.

a)

True

b)

False

66.

How do you insert COMMENTS in Java code?

a)

/* This is a comment

b)

# This is a comment

c)

// This is a comment  

d)

/* This is a comment */

67.

Find the output of,

int x =4;

while(x>5)

{

System.out.println(x);

x++;

}

a)

6

7

8... infinity

b)

1

2

3

4

c)

No Output

d)

4

5

68.

Absence of (a) ________ in switch..case leads to fallthrough

a)

switch

b)

case

c)

default

d)

break

69.

Function of the Scanner class to accept a float literal from the user is

a)

nextInt( )

b)

hasNext( )

c)

next( )

d)

nextFloat( )

70.

Consider the following code segment:


int var = 12;

var = var % 7;

var = var - 1;

System.out.println(var);


What is printed as a result of executing the code segment?

a)

1

b)

2

c)

4

d)

5

71.

What will be the output of the the block of code in the main() method?

a)

0 2 4

b)

0 2 4 5

c)

0 1 2 3 4

d)

Compilation fails.

72.

What will be the output of the the block of code in the main() method?

a)

i = 5 and j = 5

b)

i = 6 and j = 5

c)

i = 5 and j = 6

d)

i = 6 and j = 4

73.

What prints out "I love Java" successfully?

a)

System.out.println(I love Java);

b)

Systemoutprintln("I love Java);

c)

System.out.println("I love" + " Java");

d)

System.out.println("I love Java")

74.

How would you declare a variable storing a person's name?

a)

string name = "Jeff";

b)

name String = "Jeff";

c)

String name = Jeff;

d)

String name = "Jeff";

75.

Name the data type: '3'

a)

int

b)

char

c)

String

d)

None of the above

76.

Name the data type: 1.0

a)

double

b)

int

c)

char

d)

boolean

77.

Name the data type: "true"

a)

boolean

b)

char

c)

String

d)

double

78.

Which of the following pairs of declarations will cause an error message?

I.  double x = 14.7;      int y = x;

II.  double x = 14.7;       int y = (int) x;

III.  int x = 14;        double y = x;

a)

I only

b)

II only

c)

III only

d)

I and III only

79.

nextInt() is used to read user's numerical input

a)

True

b)

False

80.

The output of the following code is:

int[] array = {2,4,6,8,10};

for (int i=0; i < array.length;i++){

System.out.println(array[2]);

}

a)

2

4

6

8

10

b)

2,4,6,8,10

c)

6

6

6

6

6

d)

Nothing

81.

which statement is correct?

a)

int Var

b)

boolean 15;

c)

double var123;

d)

int min=0

82.

Repetition of data is called data ..............

a)

dependance

b)

redundancy

c)

inconsistency

d)

isolation

83.

Repetition of data is called data ..............

a)

dependance

b)

redundancy

c)

inconsistency

d)

isolation

84.

Which of the following is not a DML command?

a)

Update

b)

Insert into

c)

Delete

d)

Create Table

85.

A database table can have ____ no : of Foreign Keys.

a)

1

b)

2

c)

4

d)

any

86.

A database table can have __________ primary keys.

a)

any no: of

b)

exact one

c)

three

d)

two

87.

Which command is used to add a column to an existing table?

a)

Create

b)

Update

c)

Alter

d)

None of the above

88.

How many tuples are there in the relation?

a)

5

b)

6

c)

4

d)

3

89.
With regards to databases what is a domain?
a)
The address at which the database can be connection to
b)
A set of allowable values for one or more attributes
c)
The structure, connectivity and formation of the database
d)
The sheet on which the table lies
90.

The restrictions or conditions applied on data are known as ______________

a)

Constraints

b)

Key word

c)

Scheme

d)

Term

91.

Select DDL commands from among the options...

a)

SELECT

b)

ALTER

c)

DROP

d)

DELETE

92.

What will be the degree and cardinality of the cartesian product of two tables if the degree of first table is 3 and second table is 5. The cardinality of first table is 10 and cardinality of second table is 6.

a)

Degree 15, Cardinality 16

b)

Degree 8 Cardinality 16

c)

Degree 8 Cardinality 60

d)

Degree 15 cardinality 60

93.

Which of the following is NOT a type of SQL constraint?

a)

Primary Key

b)

Foreign Key

c)

Alternate Key

d)

NOT NULL

94.
With SQL, how can you insert a new record into the "Persons" table?
a)
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')  
b)
INSERT ('Jimmy', 'Jackson') INTO Persons
c)
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
d)
INSERT VALUES ('Jimmy, Jackson') INTO Persons
e)
INSERT ('Jimmy', 'Jackson') VALUES into Persons
95.

SQL is not case sensitive. SELECT is the same as select.

a)

TRUE

b)

FALSE

96.

INSERT________ Persons (FirstName,LastName) ________

('Lars','Monsen');

a)

VALUES, INTO

b)

INTO , VALUES

c)

TABLE , VALUES

d)

INTO TABLE, VALUE

97.

Which of the following not a valid keys

a)

Alternate Key

b)

Candidate Key

c)

Participant Key

d)

Foreign Key

98.

The _________ statement is used to delete a table.

a)

DROP TABLE

b)

DELETE TABLE

c)

DEL TABLE

d)

REMOVE TABLE

99.

When David try to create a database table STUDENT he is getting an error. He is not able to create it. It is because that database table is .......................

a)

already existing table

b)

Not a valid name

c)

primary key not set

d)

foreign key not set

100.

which of the following is true for the above table.

a)

EMPLOYEE has DEGREE 4 and FOREIGN KEY as EMP_ID

b)

DEPARTMENT has CARDINALITY 2 and DEGREE 6

c)

EMPLOYEE has DEGREE 8 and DEPARTMENT has CARDINALITY 2

d)

EMPLOYEE has DEGREE 4 and PRIMARY KEY as EMP_ID

101.

A primary key can be NULL in the table.

a)

TRUE

b)

FALSE

102.

Where does the CREATE Command belong?

a)

DML

b)

DDL

c)

DCL

d)

DQL