AI-Mock-Interviewer/PDF_Extracted_Data huggingface dataset:
Question: 6. Why does the Euclidean Distance metric dominate in k-Means Clustering?
Answer: The construction  of k-means is not reliant on distances, and Within-cluster variance is decreased using K-means. When you examine the variancedefinition, you'l l notice that it's the sum of squared Euclidea n distances from the center . The goal of k-means is to reduce squared errors. There is no such thing as "distance" in this case. Pairwise distances between data points are not explicitly used in the k-means process. It entails assigning points to the nearest centroid  over and over again, based on the Euclide an distance between data points and a centroid. Euclidean geom etry is the origin  of the term "centroid." In Euclidean space, it is a multivariate mean. Euclidean distances are the subject of Euclidean space. In most cases, non-Euclidean distances will not cross Euclidean space, which is why K-Means is only used for Euclidean distances. Using arbitrary distances is incorrect because k-means may stop conver ging with other distance functions.
Question: 1. What exactly is SQL?
Answer: SQL is an acronym for the structured query language. It is a database management system that allows you to access and manipulate data. In 1986, the American National Standards Institute (ANSI) approved  SQL as a standard.
Question: 2. What Can SQL do for you?
Answer: SQL is capable of running queries against a database. •SQL may be used to get information from a database. •SQL may be used to create new records in a database. •SQL may be used to update data in a database. •SQL can delete records from a database. •SQL can build new databases. •SQL can create new tables in a database. •In a database, SQL may build stored procedures. •In a database, SQL may be used to generate views. •Permissions can be established on tables, methods, and views in SQL.
Question: 1. How do you distinguish between SQL and MySQL?
Answer: SQL is a standard language based on English. MySQL is a relational database management system (RDBMS). SQL is the foundation of a relational database, and it is used to retrieve and manage data. MySQL is arelational database management system (RDMS), similar to SQL Server and Informix.
Question: 2. What are the various SQL subsets?
Answer: Data Definition Language (DDL) lets you do things like CREATE, ALTER, and DELETE items on the database. Data Manipulation Language (DML) allows you to alter and access data. It aids in inserting, updating, deleting, and retrieving data from a database. Data Control Language (DCL) allows you to manage database access, grant and revoke access permissions.
Question: 3. What do you mean by database management system (DBMS)? What are the many sorts of it?
Answer: A Datab ase Management System (DBMS) is a software program that captures and analyzes data through interacting with the user, applications, and the database itself. A database is a collection of data that is or ganized. A database management system (DBMS) allows users to interface. The database's data may be edited, retrieved, and destroyed, and it can be of any type, including strings, integers, and pictures. There are two types of database management systems (DBMS): •Relational Data base Managem ent System (RDBMS): Inform ation is organized into relationships (tables). MySQL is a good example. •Non-Relational Database Management System: This system has no relations, tuples, or attributes. A good example is MongoDB.
Question: 4. In SQL, how do you define a table and a field?
Answer: A table is a logically organized collection of data in rows and columns. The number of columns in a table is referred to as a field. Consider the following scenario: Fields: Student ID, Student Name, and Student Marks
Question: 5. How do we define joins in SQL?
Answer: A join clause joins rows from two or more tables based on a common column. It's used to join two tables together or derive data from them. As seen below , there are four dif ferent types of joins: •Inner join: The most frequent join in SQL is the inner join. It's used to get all the rows from various tables that satisfy the joining requirement. •Full Join: When there is a matc h in any table, a full join return s all the records. As a result, all rows from the left-hand side table and all rows from the right-hand side table are returned. •Right Join: In SQL, a “right join” returns all rows from the right table but only matche s records from the left table when the join condition is met. •Left Join: In SQL, a left join returns all of the data from the left table, but only the matching rows from the right table when the join condition is met.
Question: 6. What is the difference between the SQL data types CHAR and VARCHAR2?
Answer: Both Char and Varchar2 are used for character strings. However , Varchar2 is used for variable-length strings, and Char is used for fixed-length strings. For instance, char (10) can only hold 10 characters and cannot store a string of any other length, but varchar2 (10) may store any length, i.e. 6, 8, 2.
Question: 7. What are constraints?
Answer: In SQL, constraints are used to establish the table's data type limit. It may be supplied when the table statement is created or changed. The following are some examples of constraints:UNIQUE, NOT NULL, FOREIGN KEY, DEFAULT, CHECK, PRIMARY KEY.
Question: 8. What is a foreign key?
Answer: A foreign key ensures referential integrity by connecting the data in two tables. The foreign key as defined in the child table references the primary key in the parent table. The foreign key constraint obstructs actions to terminate links between the child and parent tables.
Question: 9. What is"data integrity"?
Answer: Data integrity refers to the consistency and correctness of data kept in a database. It also specifies integrity constraints, which are used to impose business rules on data when input into an application or database.
Question: What is the difference between a clustered and a non-clustered index?
Answer: The following are the distinctions between a clustered and non-clustered index in SQL: •Clustered indexes are utilized for quicker data retrieval from databases, whereas reading from non-clustered indexes takes longer . •A cluste red index changes the way records are stored in a database by sorting rows by the clustered index column. A non-clustered index does not chan ge the way records are stored but instead creates a separate object within a table that points back to the original table rows after searching. There can only be one clustered index per table, although there can be numerous non clustered indexes.
Question: 11. How would you write a SQL query to show the current date?
Answer: A built-in method in SQL called GetDate() returns the current timestamp/date.
Question: 12. What exactly do you mean when you say "query optimization"?
Answer: Query optimization is the step in which a plan for evaluating a query that has the lowest projected cost is identified. The following are some of the benefits of query optimization: •The result is delivered more quickly . •In less time, a higher number of queries may be run. •Reduces the complexity of time and space
Question: 13. What is "denormalization"?
Answer: Denormalization is a technique for retrieving data from higher to lower levels of a datab ase. It aids datab ase administrators in improving  the overall performance of the infrastructur e by introducing redundancy into a table. It incorporates database queries that merge data from many tables into a single table to add redundant data to a table.
Question: 14. What are the differences between entities and relationships?
Answer: Entities are real-world people, places, and things whose data may be kept in a database. Tables are used to contain information about a single type of object. A customer table, for example, is used to hold customer information in a bank datab ase. Each client's information is stored in the customer database as a collection of characteristics (columns inside the table). Relationships are connections or connections between things that have something in common. The customer name, for example, is linked to the customer accoun t number and contact information, which may be stored in the same database. There may also be connections between different tables (for example, customer to accounts).
Question: 15. What is an index?
Answer: An index is a performance optimization strategy for retrieving records from a table quickly . Because an index makes an entry for each value, retrieving data is faster .
Question: 16. Describe the various types of indexes in SQL.
Answer: In SQL, there are three types of indexes: •Unique Index: If the column is unique indexed, this index prevents duplicate values in the field. A unique index can be applied automatically if the main key is provided. •Clustered Index: This index reorders the table's physical order and searches based on key values. There can only be one clustered index per table. •Non-Clustered Index: Non-clustered indexes do not change the physical order of the database and keep the data in a logical order . There might be a lot of nonclustered indexes in a table.
Question: 17. What is normalization, and what are its benefits?
Answer: The practice of structuring data in SQL to prevent duplication and redundancy is known as normalization. The following are some of the benefits: •Improved database management •Tables with smaller rows are added to the mix. •Efficient data access •Greater queries flexibility •Locate the information quickly . •Security is easier to implement. •Allows for easy customization/customization •Data duplication and redundancy are reduced. •More compact database. •Ensure that data is consistent after it has been modified.
Question: 18. Describe the various forms of normalization.
Answer: There are several levels of normalization to choose from. These  are referred to as normal forms. Each subsequent normal form is dependent  on the one before it. In most cases, the first three normal forms are suf ficient. First Normal Form (1NF) – There are no repeating groups in between rows Second Normal Form (2NF) – Every non-key (supporting) column value relies on the primary key . Third Normal Form (3NF) – Dependent solely on the primary key and no other non-key (supporting) column value.
Question: 19. In a database, what is the ACID property?
Answer: Atomicity , Consistency , Isolation, and Durability (ACID) is used to verify that data transactions in a database system are processed reliably . Atomicity: Atomicity relates to completed or failed transactions. A transaction refers to a single logical data operation. It means that if one portion of a transaction fails, the full transaction fails as well, leaving the database state unaltered. Consistency: Consistency guarantees that the data adheres to all validation standards. In basic terms, your transaction never leaves the database before it has completed its state. Isolation: The main purpose of isolation is concurrency control. Durability: Durability refers to the fact that once a transaction has been  committed, it will occur regardless of what happens in the meantime, such as a power outage, a crash, or any other type of mistake.
Question: 20. What is "Trigger" in SQL?
Answer: Triggers are a stored procedure in SQL that is configured to execute automatically in situ or after data changes. When an insert, update, or other query is run against a specified table, it allows you to run a batch of code.
Question: 21. What are the different types of SQL operators?
Answer: Logical Operators, Arithmetic Operators, Comparison Operators
Question: 22. Do NULL values have the same meaning as zero or a blank space?
Answer: A null value is not confused with a value of zero or a blank space. A null value denotes an unavailable, unknown, assigned, or not applicable value, whereas a zero denotes a number and a blank space denotes a character .
Question: 23. What is the differ ence between a natural join and a cross join?
Answer: The natural join is dependent on all columns in both tables having the same name and data types, whereas the cross join creates the cross product or Cartesian product of two tables.
Question: 24. What is a subquery in SQL?
Answer: A subquery is a query defined inside another query to get data or information from  the database. The outer query of a subquery is referred to as the main query. In contrast, the inner query is referred to as the subquery . Subqueries are always processed first, and the subquery's result is then passed on to the main query . It may be nested within any query , including SELECT , UPDATE, and OTHER. Any comparison operators, such as >, or =, can be used in a subquery .
Question: 25. What are the various forms of subqueries?
Answer: Correlated and Non-Correlated  subqueries are the two forms of the subquery . Correlated subqu eries: These queries pick data from a table that the outer query refers to. It is not considered an independent query because it refers to another table and column. Non-Correlated subquery: This query is a stand-alone query in which a subquery's output is used to replace the main queryresults.
Question: 1. What is a database management system (DBMS), and what is its purpose? Use examples to explain RDBMS.
Answer: The database management system, or DBMS, is a collection of applications or programs that allow users to construct and maintain databases. A database management system (DBMS) offers a tool or interface for executing different database activities such as adding, removing, updating, etc. It is software that allows data to be stored more compactly and securely than a file-based  system. A database management system (DBMS) assists a user in overcoming issues such as data inconsistency , data redundancy , and other issues in a database, making it more comfortable and or ganized to use. Examples of prominent DBM S systems are file systems, XML, the Windows Registry , and other DBMS systems. RDBMS stands for Relational Database Management System, and it was first introduced in the 1970s to make it easier to access and store data than DBMS. In contrast to DBMS, which stores data as files, RDBMS stores data as tables. Unlike DBMS, storing data in rows and columns makes it easier to locate specific values in the database and more ef ficient. MySQL, Oracle DB, are good examples of RDBMS systems.
Question: 2. What is a database?
Answer: A database is a collection of well-organized, consistent, and logical data and can be readily updated, accessed, and controlled. Most databases are made up of tables or object s (everything generated with the create command is a database object) that include entries and fields. A tuple or row represents a single entry in a table. The main components of data storage are attributes and columns, which carry information about a specific element of the database. A database management system (DBMS) pulls data from a database using queries submitted by the user .
Question: 3. What  drawbacks of traditional file-based systems make a database management system (DBS) a superior option?
Answer: The lack of indexing in a typic al file-based system leaves us little choice but to scan the whole page, making content access time-consuming and sluggish. The other issue is redundancy and inconsistency , as files often include duplicat e and redundant data, and updating one causes  all of them to become inconsistent. Traditional file-based systems make it more difficult to access data since it is disor ganized. Another drawback is the absence of concurrency management, which causes one action to lock the entire page, unlike DBMS, which allows several operations to operate on the same file simultaneously . Integrity checking, data isolation, atomicity , security , and other difficulties with traditional file-based systems have all been addressed by DBMSs.
Question: 4. Desc ribe some of the benefits of a database management system (DBS).
Answer: The following are some of the benefits of employing a database management system (DBS).  Data Sharing: Data from a single database may be shared by several users simultaneously . End-users can also respond fast to changes in the database environment because of this sharing. Integrity restrict ions: The presence of such limitations allows for the ordered and refined storage of data. Controlling database redundancy: Provides a means for integrating all data in a single database, eliminating redundancy in a database. Data Independence: This allows you to change the data structure without affecting the composi tion of any of the application programs that are currently running. Provides backup  and recovery facility: It may be configured to automatically generate a backup  of the data and restore the data in a database when needed.Data Security: A database management system (DBMS) provides the capabilities needed to make data storage and transmission more dependable  and secure. Some common technologies used to safeguard data in a DBMS include authentication (the act of granting restricted access to a user) and encryption (encrypting sensitive data such as OTP, credit card information, and so on).
Question: 5. Describe the differ ent DBMS languages.
Answer: The following are some of the DBMS languages: DDL (Data Definition Language) is a language that includes commands for defining databases. CREA TE, AL TER, DROP , TRUNCA TE, RENAME, and so on. DML (Data Manipulation Langu age) is a set of instructions that may alter data in a database. SELECT , UPDA TE, INSER T, DELETE, and so on. DCL (Data Control Language): It offers instructions for dealing with the database system's user permissions and controls. GRANT and REVOKE, for example. TCL (Transaction Control Language) is a programming language that offers instructio ns for dealing with database transactions. COMMIT , ROLLB ACK, and SAVEPOINT are a few examples.
Question: 6. Wha t does it mean to have ACID qualities in a databasemanagement system (DBMS)?
Answer: In a database management system, ACID stands for Atomicity , Consistency , Isolation, and Durability . These features enable a safe and secure exchange of data among dif ferent users. Atomicity: This attribute supports the notion of either running the whole query or doing nothing at all, which means that if a database update occurs, it should either be reflected across the entire database or not at all.Consistency: This feature guarantees that data is consistent before and after a transaction in a database. Isolation: This characteristic assures that each transaction is separate from the others, and this suggests that the status of one ongoing transaction has no bearing on the condition. Durability: This attribute guarantees that data is not destroyed in the event of a system failure or restart and that it is available in the same condition as before the failure or restart.
Question: 7. Are NULL values in a database the same as blank space or zero?
Answer: No, a null value  is different from zero and blank space. It denotes a value that is assigned , unknown, unavailable, or not applicable, as opposed to blank space, which denotes a character , and zero, which denotes a number . For instance, a null value in the "number of courses" taken by a student indicates that the value is unknown, but a value of 0 indicates that the student has not taken any courses.
Question: 8. What does Data W arehousing mean?
Answer: Data warehousing is the process of gathering, extracting, processing, and importing data from numerous sources and storing it in a single database. A data warehouse may be conside red a central repository for data analytics that receives data from transactional systems and other relational databases. A data warehouse is a collection of historical data from an organization that aids in decision-making.
Question: 9. Desc ribe the various data abstraction layers in a database management system (DBMS).
Answer: Data abstraction  is the process  of concealing extraneous elements from consumers. There are three degrees of data abstraction: Physical Level:  This is the lowest level, and the database management system maintains it. The contents of this level are often concealed from system admins, developers, and users, and it comprises data storage descriptions.Conceptual or logical level: Developers and system administrators operate at the conceptual or logical level, which specifies what data is kept in the database and how the data points are related. External or View level: This level only depicts a portion of the database and keeps the table structure and actual storage specifics hidden from users. The result of a query is an example of data abstracti on at the View level. A view is a virtual table formed by choosing fields from multiple database tables.
Question: 10. What does an entity-r elationship (E-R) model mean? Define an entity , entity type, and entity set in a database management system.
Answer: A diagrammatic approach to database architecture in which real-world things are represented as entities and connections between them are indicated is known as an entity-relationship model. Entity: A real-world object with attributes that indicate the item's qualities is defined as an entity . A student, an employee, or a teacher , for example, symbolizes an entity . Entity Type: This is a group of entities with the same properties. An entity type is represented by one or more linked tables in a database. Entity  type or attribut es may be thought of as a trait that distinguishes the entity from others. A student, for example, is an entity with properties such as student id, student name, and so on. Entity Set: An entity set is a collection of all the entities in a database that belongs to a given entity type. An entity set, for example, is a collection of all students, employees, teachers, and other individuals.
Question: 11. What is the differ ence between intension and extension in a database?
Answer: The main distinction between intension and extension in a database is as follows:Intension: Intension, also known  as database schema, describes the database's description. It is specified throughout the database's construction and typically remains unmodified. Extension, on the other hand, is a measurement of the number of tuples in a database at any particular moment in time. The snapshot of a database is also known as the extension of a database. The value of the extension changes when tuples are created, modified, or deleted in the database.
Question: 12. Describe the differ ences between the DELETE and TRUNCA TE commands in a database management system.
Answer: DELETE command: this comm and is used to delete rows from a table based on the WHERE clause's condition. It just deletes the rows that the WHERE clause specifies. If necessary , it can be rolled back. It keeps  a record to lock the table row before removing it, making it sluggish. The TRUNCA TE command is used to delete all data from a table in a database. Consequently , making it similar to a DELETE command without a WHERE clause. It deletes all of the data from a database table. It may be rolled back if necessary . (Truncate can be rolled back, but it's hard and can result in data loss depending on the database version.) It doesn't keep a log and deletes the entire table at once, so it's quick.
Question: 13. Define lock. Explain the significant differences between a shared lock and an exclusive lock in a database transaction.
Answer: A database lock is a method that prevents two or more database  users from updating the same piece of data at the same time. When a single database user or session obtains a lock, no other database user or session may edit the data until the lock is released.Shared lock: A shared lock is necessary for reading a data item, and in a shared lock, many transactions can hold a lock on the same data item. A shared lock allows many transactions to read the data items. Exclusive lock: A lock on any transaction that will conduct a write operation is an exclusive lock. This form of lock avoids inconsistency in the database by allowing only one transaction at a time.