Viva Questions For SQL & Java For STD 12 QUESTIONS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

VIVA QUESTIONS FOR SQL AND JAVA

Viva Questions for SQL:-

1. What is Database?
Ans:- A Database is a logical, consistent and organized collection of data
that it can easily be accessed, managed and updated. DBMS is used for
extraction of data from the database in the form of the queries.
2. What is DBMS?
Ans:- DBMS is a collection of programs that facilitates users to create and
maintain a database. There is the name of some popular Database
Management System- MySQL, Oracle, SQL Server, Amazon simple DB
(Cloud-based), etc.
3. What is RDBMS? How is it different from DBMS?
RDBMS is the acronym for the Relational Database Management
system. In DBMS, the data is stored as a file, whereas in RDBMS, data is
stored in the form of tables.

4.What are the advantages of DBMS?

o Redundancy control
o Restriction for unauthorized access
o Provides multiple user interfaces
o Provides backup and recovery
o Enforces integrity constraints
o Ensure data consistency
o Easy accessibility

5.What is SQL?

SQL is a standard language for accessing and manipulating databases.


What is SQL? SQL stands for Structured Query Language

6.What is the difference between SQL and MySQL?


1. SQL is a query programming language for managing RDBMS. In
contrast, MySQL is an RDBMS (Relational Database Management
System) that employs SQL.
2. So, the major difference between the two is that MySQL is
software, but SQL is a database language.

7.What are Tables and Fields?

A table has records (rows) and fields (columns). Fields have different
types of data, such as text, numbers, dates, and hyperlinks. A record:
Contains specific data, like information about a particular employee or a
product.
8.What are Constraints in SQL?
SQL constraints are used to specify rules for the data in a table
9.What is a Primary Key?
The primary key in SQL is a single, or a group of fields or columns that
can uniquely identify a row in a table.

10. How many types of database languages are?

There are four types of database languages:

o Data Definition Language (DDL) e.g., CREATE, ALTER, DROP, TRUNCATE,


RENAME, etc. All these commands are used for updating the data that?s
why they are known as Data Definition Language.
o Data Manipulation Language (DML) e.g., SELECT, UPDATE, INSERT,
DELETE, etc. These commands are used for the manipulation of already
updated data that's why they are the part of Data Manipulation
Language.
o DATA Control Language (DCL) e.g., GRANT and REVOKE. These
commands are used for giving and removing the user access on the
database. So, they are the part of Data Control Language.
o Transaction Control Language (TCL) e.g., COMMIT, ROLLBACK, and
SAVEPOINT. These are the commands used for managing transactions in
the database. TCL is used for managing the changes made by DML.

11.What is a Foreign Key?


A foreign key is a column or columns of data in one table that refers to
the unique data values -- often the primary key data -- in another table.
12.What is a Join? List its different types.
Join means Returns records that have matching values in both tables.
Types are INNER JOIN, OUTER JOIN, CROSS JOIN, and SELF JOIN.
13.What is a Self-Join?
A Self Join is a type of a JOIN query used to compare rows within the
same table

14.Define Aggregate Functions with 2 examples.

An aggregate function performs a calculation on a set of values, and returns a


single value. Except for COUNT(*) , aggregate functions ignore null
values.Examples COUNT,SUM,MAX,MIN,AVERAGE.

15. What is a Query?

the meaning of a query in database management is a request for data. If you


need to access, manipulate, delete, or retrieve data from your relational
database, you'll need a database query written using a specific syntax.

16. What is the SELECT statement?

The SELECT statement Instructs the Microsoft Access database engine to return
information from the database as a set of records.

17. What are some common clauses used with SELECT query in SQL?

SQL SELECT has different clauses to manage the data output. They are: FROM ,
AS , GROUP BY , HAVING , INTO , ORDER BY .

Viva Question on Java:-

1. What is Java?

Java is a widely-used programming language for coding web


applications. Java is a multi-platform, object-oriented, and network-
centric language that can be used as a platform in itself.

2. What are the features of Java?


It is a write-once, run-anywhere language. It is a software-based
platform that runs on top of other hardware-based platforms. Its code
can be executed on multiple platforms, including Windows,
Linux, Sun Solaris, and Mac/OS. The Java code is compiled by the
compiler and converted into bytecode.

3.What does an interface in Java refer to?

In Java, an interface specifies the behavior of a class by providing an


abstract type.

4.What are constructors in Java?

A constructor in Java Programming is a block of code that initializes


(constructs) the state and value during object creation.

4. Name and explain the types of constructors in Java.

5. What is JDK?
The Java Development Kit (JDK) is a cross-platformed software
development environment that offers a collection of tools and libraries
necessary for developing Java-based software applications and applets.
6. What is JVM?
JVM (Java Virtual Machine) is an abstract machine. It is a specification
that provides runtime environment in which java bytecode can be
executed.
7. What is JRE?
The JRE is the underlying technology that communicates between the
Java program and the operating system.

12. What is a package in Java?

A java package is a group of similar types of classes, interfaces and sub-


packages.
13. How can developers use packages in Java?

Packages in Java are used to group related classes, interfaces, and sub-
packages.

14. What are the advantages of packages in Java?

The benefits of using Packages in Java are as follows:


 The packages organize the group of classes into a single API unit.
 It will control the naming conflicts.
 The access protection will be easier. ...
 Easy to locate the related classes.
 Reuse the existing classes in packages.

15.What is an Array?
An array is a container object that holds a fixed number of values of a single
type. The length of an array is established when the array is created.

You might also like