Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

Computer Science Database System


Question 1:What is a database?

A database is an organized collection of data that can be easily accessed, managed, and updated. Databases are used to store, retrieve, and manage data efficiently.

Question 2:What is a DBMS?

A Database Management System (DBMS) is software that interacts with end users, applications, and the database itself to capture and analyze data. It provides tools to define, manipulate, retrieve, and manage data in a database

Question 3:Explain the difference between SQL and NoSQL databases.

  • SQL Databases: Structured Query Language (SQL) databases are relational and use a fixed schema. They are suitable for complex queries and transactions, and examples include MySQL, PostgreSQL, and Oracle.
  • NoSQL Databases: NoSQL databases are non-relational and can handle unstructured data. They are schema-less, offering flexibility and scalability, and examples include MongoDB, Cassandra, and Redis.

Question 4:What is a JOIN in SQL, and what are its types?

A JOIN clause in SQL is used to combine rows from two or more tables based on a related column. The types of JOINs include:

  • INNER JOIN: Returns rows with matching values in both tables.
  • LEFT (OUTER) JOIN: Returns all rows from the left table and matched rows from the right table.
  • RIGHT (OUTER) JOIN: Returns all rows from the right table and matched rows from the left table.
  • FULL (OUTER) JOIN: Returns rows when there is a match in one of the tables.

Question 5:Write a SQL query to find the second highest salary from an Employee table.

SELECT MAX(salary)
FROM Employee
WHERE salary < (SELECT MAX(salary) FROM Employee);

Question 6:Explain the ACID properties in a database.

  • Atomicity: Ensures that all operations within a transaction are completed successfully; if not, the transaction is aborted.
  • Consistency: Ensures that the database transitions from one valid state to another valid state.
  • Isolation: Ensures that the operations of a transaction are isolated from other transactions.
  • Durability: Ensures that once a transaction has been committed, it remains so, even in the event of a system failure.

Question 7:What is normalization, and why is it important?

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It involves dividing a database into two or more tables and defining relationships between the tables. The main goal is to eliminate redundant data and ensure data dependencies make sense.

Question 8:Explain the different normal forms.

  • First Normal Form (1NF): Ensures each column contains atomic (indivisible) values and each entry in a column is of the same data type.
  • Second Normal Form (2NF): Achieved when the table is in 1NF and all non-key attributes are fully functional dependent on the primary key.
  • Third Normal Form (3NF): Achieved when the table is in 2NF and all non-key attributes are not dependent on other non-key attributes.
  • Boyce-Codd Normal Form (BCNF): A stricter version of 3NF where every determinant is a candidate key.

Question 9:What is indexing, and how does it improve database performance?

Indexing is a database optimization technique that allows for faster retrieval of records from a table. An index creates an entry for each value, which improves the speed of data retrieval operations. However, it can slow down data modification operations like INSERT, UPDATE, and DELETE.

Question 10:Describe a project where you optimized a database. What challenges did you face and how did you overcome them?

[Provide a detailed description of a project where you worked on database optimization, including the initial issues, the strategies you implemented (like indexing, query optimization, normalization, etc.), and the results achieved. Highlight the challenges, such as managing large datasets or minimizing downtime, and the solutions you applied.]




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML 5

Python

java

C++

C

JavaScript

Campus Learning

C

C#

java