Font size
WorksheetsDatabase Concepts Quiz
Total questions: 102
Worksheet time: 2hrs 38mins
The number of attributes in a relation is called the ____________of a relation.
Tuple
Table
Cardinality
Degree
In order to restrict the values of an attribute within a range, _________constraint to be used.
Check
NULL
Default
NOT NULL
_______________ command is used to eliminate duplicate values of an attribute in the select query.
Update
Unique
Distinct
No Duplicate
_____________ command is used to delete the structure of the table.
Drop Table
Drop Database
Delete Table
Alter Table
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%
write any One DDL and one DML command.
(a) is a collection of raw facts which have not been processed to reveal useful information.
_______________command is used to modify the base table definition.
Create Table
Alter Table
Update Table
Modify Table
List any four advantages of DBMS. [CBSE SQP]
Reduction in Redundancy
Improved Consistency
Improved Availability
Improved Security
Not User Friendly
Write any two Candidate Key from student table
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:
______ command is used to modify the value of attribute of one or more tuple in a table. [CBSE SQP]
Update
Modify
Alter
Create
Keyword used to display the structure of the table. [CBSE SQP]
Describe
Show
Desc
Display
SELECT DISTINCT DEPT_NAME FROM DEPARTMENT; What does the above query do? [CBSE SQP]
It gives all the tuples having dept_name
It gives the dept_name attribute values of all tuples without repetition
It gives all the dept_name attribute of all the tuples
It gives all the dept_name attribute of all the tuples
_________ is use to apply condition with GROUP BY [CBSE SQP]
HAVING
WHERE
ORDER BY
APPLY
_________ is not an aggregate function. [CBSE SQP]
Sum()
Count()
Round()
Avg()
____________ replaces zero or more number of random character, when used with Like keyword. [CBSE SQP]
_
%
$
@
__________ command which displays list of databases available on the current server. [CBSE SQP]
Show databases
Show tables
Create tables
Display tables
Write a query Display all records from Item table.
Write a query to remove column subject from student table
Write a query to add column subject varchar(20) in student table
What does "SQL" stand for?
Structured Question Language
Structured Query Language
Simple Query Language
Simple Question Language
Which word is missing from the following SQL statement?
Select * table_name
With
Where
From
And
How to select only NULL values?
SELECT * FROM Products WHERE price = NULL
SELECT * FROM Products WHERE price LIKE NULL
SELECT * FROM Products WHERE price IS NULL
SELECT * FROM Products WHERE price EQUALS NULL
Correct command to create database school
use school ;
make database school ;
create school;
Create database school;
Which SQL command is used to remove rows from the table customer?
Drop from customer ;
Update from customer;
remove from customer ;
Delete from customer where condition ;
Which SQL keyword is used to sort the result-set?
Sort by
order by
sort
none of these
In a table there are 3 rows and 5 columns. what is the degree of the table?
5
3
0
none of these
Which operator test the column for absence of data?
Not operator
and operator
is null operator
None of these
Which operator performs pattern matching?
Between Operator
Like Operator
Exists Operator
None of these
Which of the following is the correct order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
FROM, WHERE, SELECT
WHERE, FROM,SELECT
SELECT,WHERE,FROM
select all DML commands are:-
INSERT
UPDATE
DELETE
GRANT
delete * from employee;
Deletes all tuples.
updates the table emp with null.
Destroys the table.
select all the record
This symbol is placed immediately after the SELECT command to display all the fields.
$
%
=
*
It is a DML command that is used to display record.
DISPLAY
STRUCTURE
WHERE
SELECT
An SQL command used to add record in a table.
Insert
Create
Update
Add
Duplication of record is called___________
Deficiency
Redundancy
Lack
Addition
Which is the correct statement from the following :
Delete table book;
Delete book;
Delete table book;
Drop table book;
Drop book;
_____ is a column that creates a relationship between two tables.
Primary Key
Candidate Key
Super Key
Foreign Key
Non primary keys are called _________
Primary Key
Candidate Key
Super Key
Alternate Key
---------- represents a “tuple” in a relational database?
Table
Row
Column
Object
MySQL is freely available and is open source.
True
False
---------- Command is used to delete a database.
Delete database database_name
Delete database_name
drop database database_name
drop database_name
Which of the following is / are valid array declaration in Java?
int arr[] = {1, 2, 3};
int arr[] = new int[3];
int arr[] = new int[] {1, 2, 3};
All the above
Which of the following is the correct one to find the length of an array in Java?
size
size()
length()
length
Scanner is a class from _________ package.
java.util
java.lang
java.io
java.sql
After successful compilation of ".java" file, ________ file will generate.
.class
.obj
.exe
None of the above
Size of char data type in java?
1
2
4
8
What does JDK stand for?
Java Div Kit
Java Document Kit
Java Directory Kit
Java Development Kit
What does JVM stand for?
Java VIRUS Machine
Java Virtual Machine
Java Virtual Machine
None of the above
What does JRE stand for?
Java Runtime Environment
Java Real Time Environment
Java Real Environment
None of the above
Java is case sensitive langauge
True
False
Java program processing always starts with main() method
True
False
Which of these are Access Modifiers in java?
default
public
protected
All of these
The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?
True
False
The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?
True
False
The main() method of an application has to be public. Otherwise, it could not be called by a Java interpreter. Is that true?
True
False
Java supports both Primitive & Non-Primitive(User Defined) datatypes. Which one of the following is not a primitive datatype?
byte
short
long
class
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;
}
}
}
5
4
1
0
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++;
}
}
}
5
4
3
2
Which statement about choosing variable names is FALSE?
Variable names can contain letters, digits, underscores, and dollar signs.
Variable names are NOT case sensitive
Reserved words (like Java keywords, such as int or String) cannot be used as variable names
Variable names can also begin with $ and _
How do you start writing an if statement in Java?
if (x > y)
if x > y then:
if x > y:
if (x>y):
Which operator can be used to compare equality between two primitive values?
><
=
==
<>
Which method can be used to return a string in upper case letters?
touppercase()
toUpperCase()
upperCase()
toUppercase()
The value of a string variable can be surrounded by single quotes.
True
False
How do you insert COMMENTS in Java code?
/* This is a comment
# This is a comment
// This is a comment
/* This is a comment */
Find the output of,
int x =4;
while(x>5)
{
System.out.println(x);
x++;
}
6
7
8... infinity
1
2
3
4
No Output
4
5
Absence of (a) ________ in switch..case leads to fallthrough
switch
case
default
break
Function of the Scanner class to accept a float literal from the user is
nextInt( )
hasNext( )
next( )
nextFloat( )
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?
1
2
4
5
What will be the output of the the block of code in the main() method?
0 2 4
0 2 4 5
0 1 2 3 4
Compilation fails.
What will be the output of the the block of code in the main() method?
i = 5 and j = 5
i = 6 and j = 5
i = 5 and j = 6
i = 6 and j = 4
What prints out "I love Java" successfully?
System.out.println(I love Java);
Systemoutprintln("I love Java);
System.out.println("I love" + " Java");
System.out.println("I love Java")
How would you declare a variable storing a person's name?
string name = "Jeff";
name String = "Jeff";
String name = Jeff;
String name = "Jeff";
Name the data type: '3'
int
char
String
None of the above
Name the data type: 1.0
double
int
char
boolean
Name the data type: "true"
boolean
char
String
double
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;
I only
II only
III only
I and III only
nextInt() is used to read user's numerical input
True
False
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]);
}
2
4
6
8
10
2,4,6,8,10
6
6
6
6
6
Nothing
which statement is correct?
int Var
boolean 15;
double var123;
int min=0
Repetition of data is called data ..............
dependance
redundancy
inconsistency
isolation
Repetition of data is called data ..............
dependance
redundancy
inconsistency
isolation
Which of the following is not a DML command?
Update
Insert into
Delete
Create Table
A database table can have ____ no : of Foreign Keys.
1
2
4
any
A database table can have __________ primary keys.
any no: of
exact one
three
two
Which command is used to add a column to an existing table?
Create
Update
Alter
None of the above
How many tuples are there in the relation?
5
6
4
3
The restrictions or conditions applied on data are known as ______________
Constraints
Key word
Scheme
Term
Select DDL commands from among the options...
SELECT
ALTER
DROP
DELETE
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.
Degree 15, Cardinality 16
Degree 8 Cardinality 16
Degree 8 Cardinality 60
Degree 15 cardinality 60
Which of the following is NOT a type of SQL constraint?
Primary Key
Foreign Key
Alternate Key
NOT NULL
SQL is not case sensitive. SELECT is the same as select.
TRUE
FALSE
INSERT________ Persons (FirstName,LastName) ________
('Lars','Monsen');
VALUES, INTO
INTO , VALUES
TABLE , VALUES
INTO TABLE, VALUE
Which of the following not a valid keys
Alternate Key
Candidate Key
Participant Key
Foreign Key
The _________ statement is used to delete a table.
DROP TABLE
DELETE TABLE
DEL TABLE
REMOVE TABLE
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 .......................
already existing table
Not a valid name
primary key not set
foreign key not set
which of the following is true for the above table.
EMPLOYEE has DEGREE 4 and FOREIGN KEY as EMP_ID
DEPARTMENT has CARDINALITY 2 and DEGREE 6
EMPLOYEE has DEGREE 8 and DEPARTMENT has CARDINALITY 2
EMPLOYEE has DEGREE 4 and PRIMARY KEY as EMP_ID
A primary key can be NULL in the table.
TRUE
FALSE
Where does the CREATE Command belong?
DML
DDL
DCL
DQL
