DBMS Interview Questions 2022 | MySQL Interview Questions 2022 | DBMS Most Asked Interview Questions

Ques: What is a database?

Ans: A information may be a logically coherent assortment of information with some inherent that means, representing some facet of the globe and that is meant, designed, and inhabited with information for a selected purpose.

Ques: What is DBMS?

Ans: It is a set of programs that permits users to form and maintain info. In alternative words it’s general computer code that has the users with the processes of shaping, constructing, and manipulating the info for numerous applications.

Ques: What is a Database system?

Ans: The database and DBMS software together is called a Database system.

Ques: What are the advantages of DBMS?

Ans:

  1. Redundancy is
  2. Unauthorized access is
  3. Providing multiple user
  4. Enforcing integrity
  5. Providing backup and

Ques: What are the disadvantages of a File Processing System?

Ans:

  • Data redundancy and
  • Difficult in accessing
  • Data  Data integrity.
  • Concurrent access is not
  • Security

Ques: Describe the three levels of data abstraction?

Ans: There are three levels of abstraction:

  1. Physical level: The lowest level of abstraction describes how data are
  2. Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data.
  3. View level: The highest level of abstraction describes only part of entire

Ques: Define the “integrity rules”?

Ans: There are two Integrity rules.

  1. Entity Integrity: States that “Primary key cannot have NULL value”
  2. Referential Integrity: States that “Foreign Key can be either a NULL value or should be Primary Key value of other relation.

Ques: What are extension and intention?

Ans:

  1. Extension: It is the number of tuples present in a table at any This is time dependent.
  2. Intension: It is a constant value that gives the name, structure of table and the constraints laid on

Ques: What is System R? What are its two major subsystems?

Ans: System R was designed and developed over the period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real-life environment to solve real-life problems, with a performance at least comparable to that of the existing system.

Its two subsystems are:

  • Research Storage
  • System Relational Data

Ques: How is the data structure of System R different from the relational structure?

Ans: Unlike Relational systems in System R:

  1. Domains are not supported
  2. Enforcement of candidate key uniqueness is optional
  3. Enforcement of entity integrity is optional
  4. Referential integrity is not enforced

Ques: What is Join?

Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.

Student Table

ENROLLNOSTUDENTNAMEADDRESS
1000geek1geeksquiz1
1001geek2geeksquiz2
1002geek3geeksquiz3

Student Course Table

COURSEIDENROLLNO
11000
21000
31000
11002
21003

Following is a join query that shows the names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName FROM StudentCourse INNER JOIN Customers ON StudentCourse.EnrollNo = Student.EnrollNo ORDER BY StudentCourse.CourseID;

The above query would produce the following result.

COURSEIDSTUDENTNAME
1geek1
1geek2
2geek1
2geek3
3geek1

Ques: What is a view in SQL? How to create one

Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.

CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition;

Ques. There is a table where only one row is fully repeated. Write a Query to find the repeated row

NameSection
abcCS1
bcdCS2
abcCS1

In the above table, we can find duplicate rows using the below query.

SELECT name, section FROM tbl GROUP BY name, section HAVING COUNT(*) > 1

Ques. What is the Query to find the 2nd highest salary of an employee?

Ans:

SELECT max(salary) FROM EMPLOYEES WHERE salary IN (SELECT salary FROM EMPLOYEEs MINUS SELECT max(salary) FROM EMPLOYEES);

OR

SELECT max(salary) FROM EMPLOYEES WHERE salary <> (SELECT max(salary) FROM EMPLOYEES);

Ques. Get employee details from employee table whose first name ends with ‘n’ and name contains 4 letters

Select * from EMPLOYEE where FIRST_NAME like '___n'; #(Underscores)

Ques. Get employee details from employee table whose first name starts with ‘J’ and name contains 4 letters

Select * from EMPLOYEE where FIRST_NAME like 'J___'; #(Underscores)

Ques. Get employee details from employee table whose Salary greater than 600000

Select * from EMPLOYEE where Salary >600000;

Ques. Get employee details from employee table whose Salary less than 800000

Select * from EMPLOYEE where Salary <  #800000

Ques. Get employee details from employee table whose Salary between 500000 and 800000.

Select * from EMPLOYEE where Salary between 500000 and 800000;

Leave a Comment

Ads Blocker Image Powered by Code Help Pro
Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Refresh