sql面试题问答题_SQL面试问答

sql面试题问答题

SQL interview questions are asked in almost all interviews because database operations are very common in applications. SQL stands for Structured Query Language, which is a domain-specific programming language used for database communications and relational database management.

几乎所有采访中都会询问SQL采访问题,因为数据库操作在应用程序中非常常见。 SQL代表结构化查询语言,这是一种特定于域的编程语言,用于数据库通信和关系数据库管理。

SQL consists of standard commands for database interactions such as SELECT, INSERT, CREATE, DELETE, UPDATE, DROP etc. With these, it allows the user to retrieve and upload data from databases, create and delete table elements, and implement dynamic database interactions between servers and programs.

SQL由用于数据库交互的标准命令组成,例如SELECT,INSERT,CREATE,DELETE,UPDATE,DROP等。使用这些命令,用户可以从数据库中检索和上载数据,创建和删除表元素以及实现之间的动态数据库交互。服务器和程序。

SQL面试题 (SQL Interview Questions)

SQL Interview Questions and Answers

Listed below are various SQL interview questions and answers that reaffirms your knowledge about SQL and provide new insights and learning about the language. Go through these SQL interview questions to refresh your knowledge before any interview.


下面列出的是各种SQL访谈问题和答案,它们重申了您对SQL的知识,并提供了有关该语言的新见解和学习。 在进行任何面试之前,请仔细阅读这些SQL面试问题以刷新您的知识。

  1. 什么是SQL? (What is SQL?)

  2. SQL is a domain-specific programming language that allows you to query and manipulate data within database management systems arranged in an optimized manner and categorization. This is possible through implementing commands in SQL that allows you to read, write, select and delete entries or even columns of the same attribute or tables. SQL also provides a very efficient way of creating a dynamic accessway between your programs, websites, or mobile apps to a database. For example, by inputting your login details on a user website, these log information is passed on to a database by SQL for verification and user restriction.

    SQL是特定于域的编程语言,允许您查询和操作以优化方式和分类安排的数据库管理系统中的数据。 这可以通过在SQL中实现命令来实现,该命令允许您读取,写入,选择和删除条目或相同属性或表的列。 SQL还提供了一种非常有效的方式来创建程序,网站或移动应用程序与数据库之间的动态访问方式。 例如,通过在用户网站上输入您的登录详细信息,这些日志信息将通过SQL传递到数据库,以进行验证和用户限制。

  3. 数据库和关系数据库之间有什么区别? (What is the difference between a Database and a Relational Database?)

  4. Database or Database Management System(DBMS) and Relational Database Management System(DBMS) are both used by SQL to store data and structures. However, each type of Database Management System is preferred with respect to different uses. 

    SQL都使用数据库或数据库管理系统(DBMS)和关系数据库管理系统(DBMS)来存储数据和结构。 但是,就不同用途而言,每种类型的数据库管理系统都是首选的。

    The main difference between the two is that DBMS saves your information as files whereas RDMS saves your information in tabular form. Also, as the keyword Relational implies, RDMS allows different tables to have relationships with one another using Primary Keys, Foreign Keys etc. This creates a dynamic chain of hierarchy between tables which also offers helpful restriction on the tables.

    两者之间的主要区别是DBMS将您的信息保存为文件,而RDMS将您的信息保存为表格形式。 同样,正如关键字Relational所暗示的那样,RDMS允许使用主键,外键等使不同的表之间具有相互关系。这在表之间创建了动态的层次结构链,这也为表提供了有用的限制。

    DBMS sorts out its tables through a hierarchal manner or navigational manner. This is useful when it comes to storing data in tables that are independent of one another and you don’t wish to change other tables while a table is being filled or edited.

    DBMS通过分层方式或导航方式整理其表。 当要将数据存储在彼此独立的表中并且您不希望在填充或编辑表时更改其他表时,这很有用。

  5. SQL的基本结构是什么? (What is the Basic Structure of an SQL?)

  6. SQL is framed upon the structure of relational operations. It is based on certain modifications and enhancements.

    SQL基于关系操作的结构。 它基于某些修改和增强。

    A very basic SQL query form is:

    一个非常基本SQL查询形式是:

    select A1, A2, ..., An
    
    from R1, R2, ..., Rm
    
    where P

    Here An are attributes, Rm is the relations within the database and P is the predicate or filter.

    这里An是属性,Rm是数据库内的关系,P是谓词或过滤器。

  7. 什么是SQL命令的不同类别? (What are different categories of SQL commands?)

  8. SQL command falls into following four categories:

    SQL命令分为以下四类:

  • DML (Data Manipulation Language) which provides data manipulation features

    DML(数据处理语言),提供数据处理功能
  • DDL (Data Definition Language) which is used to manipulate database structures

    DDL(数据定义语言),用于处理数据库结构
  • TCL (Transaction Control Language) that takes in charge data transaction verification and error handling

    TCL(交易控制语言)负责数据交易验证和错误处理
  • DCL (Data Control Language) are security statements that feature user restrictions and data access permissions to promote security of your data.

    DCL(数据控制语言)是具有用户限制和数据访问权限的安全性声明,以提高数据的安全性。
  • SQL的作用是什么? ( What is SQL used for?)

  • SQL is used and is popular for server-side programmers for its ability to process a large number of entries in a database in a very fast and easy manner. This opens up to large improvements in data retrieval and manipulation. To expound on this, SQL provides the ability to execute, retrieve, insert, update, delete entries to and from a database. It also allows to create structures such as tables, views, and databases provided a unique name is given.

    使用SQL并在服务器端程序员中很流行,因为它能够以非常快速和容易的方式处理数据库中的大量条目。 这为数据检索和处理带来了巨大的改进。 对此,SQL提供了执行,检索,插入,更新,删除数据库条目的功能。 如果指定了唯一名称,它还允许创建诸如表,视图和数据库之类的结构。

  • 定义SELECT,INSERT,CREATE,DELETE,UPDATE,DROP关键字 (Define SELECT, INSERT, CREATE, DELETE, UPDATE, DROP keywords)

    • SELECT keyword is used to highlight and get entries in rows from tables or views. It can also be accompanied by AS keyword to provide an alias. To filter the SELECT statement, WHERE clause may be included to provide filter conditions and select only the wished entries that satisfy the condition.

      SELECT关键字用于突出显示并从表或视图中获取行中的条目。 它也可以与AS关键字一起提供别名。 为了过滤SELECT语句,可以包含WHERE子句以提供过滤条件,并仅选择满足条件的所需条目。
    • INSERT allows to add or insert a row or multiple rows in a database table. Accompanied by VALUES keyword lets you add a row with specific values. INSERT may also be accompanied with SELECT to insert the preselected row.

      INSERT允许在数据库表中添加或插入一行或多行。 伴随VALUES关键字,您可以添加具有特定值的行。 INSERT还可以与SELECT一起插入以插入预选的行。
    • CREATE is a keyword used to create elements in SQL. It is usually accompanied with the keyword to be created such as CREATE DATABASE, CREATE TABLE, CREATE VIEW, etc.

      CREATE是用于在SQL中创建元素的关键字。 它通常带有要创建的关键字,例如CREATE DATABASE,CREATE TABLE,CREATE VIEW等。
    • DELETE keyword is used to deletes record(s) in a database. You should always use it carefully to avoid unwanted data loss. You may delete records you didn’t want to delete. Use WHERE clause to specify the range of the records you wish to delete.

      DELETE关键字用于删除数据库中的记录。 您应始终谨慎使用它,以避免不必要的数据丢失。 您可以删除不想删除的记录。 使用WHERE子句指定您要删除的记录的范围。
    • UPDATE keyword updates or changes the existing data within an existing record. Be sure to note that the record must be existent.

      UPDATE关键字更新或更改现有记录中的现有数据。 请务必注意该记录必须存在。
    • DROP keyword drops or deletes a table within the database.

      DROP关键字删除或删除数据库中的表。
  • SQL和P / L SQL之间的主要区别是什么? (What are the key differences between SQL and P/L SQL?)

  • SQL or Structured Query Language is a language which is used to communicate with a relational database. It provides a way to manipulate and create databases. On the other hand, PL/SQL is a dialect of SQL which is used to enhance the capabilities of SQL. It was developed by Oracle Corporation in the early ’90s. It adds procedural features of programming languages in SQL.

    SQL或结构化查询语言是一种用于与关系数据库进行通信的语言。 它提供了一种操作和创建数据库的方法。 另一方面,PL / SQL是SQL的方言,用于增强SQL的功能。 它是由Oracle Corporation在90年代初期开发的。 它增加了SQL编程语言的过程功能。

  • 什么是数据定义语言? (What is data definition language?)

  • DDL or Data Definition Language pertains to the SQL commands directly affecting the database structure. DDL is a category of SQL command classifications that also include DML (Data Manipulation Language), Transactions, and Security. A particular attribute of DDL commands is statements that can manipulate indexes, objects, tables, views, triggers, etc.

    DDL或数据定义语言与直接影响数据库结构SQL命令有关。 DDL是SQL命令分类的类别,其中还包括DML(数据操作语言),事务和安全性。 DDL命令的特定属性是可以操纵索引,对象,表,视图,触发器等的语句。

    Three popular DDL keywords in SQL are:

    SQL中三个流行的DDL关键字是:

    1. CREATE – which is used to create a table
      CREATE TABLE tableName (name data_type);

      CREATE –用于创建表
    2. ALTER – used to modify entries or existing columns within a table.
      ALTER TABLE tableName [additional syntax such as ADD, DROP, MODIFY]

      ALTER –用于修改表中的条目或现有列。
    3. DROP – used to Delete or Drop an existing table along with its entries, constraints, triggers, indexes, and permissions. Essentially deletes the table.
      DROP TABLE tableName;

      DROP –用于删除或删除现有表及其条目,约束,触发器,索引和权限。 本质上是删除表。
  • 什么是数据处理语言? (What is Data Manipulation Language?)

  • DML or Data Manipulation Language is a set of commands that are classified pertaining to its capability to give users permission to change entries within the database. This may be through Inserting, Retrieving, Deleting or Updating data within tables. Popular DML statements arise from these core functionalities and are listed below:

    DML或数据操作语言是一组与其功能相关的命令,这些功能使用户可以更改数据库中的条目。 这可以通过在表中插入,检索,删除或更新数据来实现。 流行的DML语句源自这些核心功能,并在下面列出:

    • SELECT – used to highlight a row within a table and retrieve it.
      SELECT [columnName] FROM [tableName]

      SELECT –用于突出显示表中的一行并进行检索。
    • UPDATE – used to update entries from existing tables.
      UPDATE [tableName] SET [value]

      UPDATE –用于更新现有表中的条目。
    • INSERT – used to insert entries into an existing table.
      INSERT INTO [tableName]

      INSERT –用于将条目插入现有表中。
    • DELETE – used to delete entries from an existing table
      DELETE FROM [tableName]

      DELETE –用于从现有表中删除条目
  • 什么是事务控制语言(TCL)? (What is Transaction Control Language (TCL)?)

  • TCL is a category of SQL commands which primarily deals with the database transaction and save points. These keywords implement the SQL functions and logic defined by the developer into the database structure and behavior. Examples of these TCL commands are:

    TCL是一类SQL命令,主要处理数据库事务和保存点。 这些关键字将开发人员定义SQL功能和逻辑实现到数据库结构和行为中。 这些TCL命令的示例是:

    COMMIT – used to commit a transaction

    COMMIT –用于提交交易

    ROLLBACK – in any advent of errors, transaction rollback is invoked by this keyword.

    ROLLBACK –在出现任何错误时,都会通过此关键字调用事务回滚。

    SAVEPOINT – keyword representing the reverting point of rollback

    SAVEPOINT –表示回滚还原点的关键字

    SET TRANSACTION – sets the specifics of the transaction

    SET TRANSACTION –设置交易细节

  • 什么是数据控制语言(DCL)? (What is Data Control Language (DCL)?)

  • Data Control Language or DCL oversees the issuance of access and restrictions to users, including the rights and permissions required within the SQL statements.

    数据控制语言或DCL监督对用户的访问权限和限制的发布,包括SQL语句中所需的权限。

    Example DCL keywords are:

    DCL关键字示例为:

    GRANT – DCL keyword that provides access to certain databases to users.

    GRANT – DCL关键字,为用户提供对某些数据库的访问。

    REVOKE – opposite of the GRANT keyword. Revokes or withdraws the privileges given to the user.

    REVOKE –与GRANT关键字相反。 撤消或撤消授予用户的特权。

  • 在数据库中定义表和字段 (Define tables and fields in a database)

  • In terms of databases, a table is referred to as an arrangement of organized entries. It is further divided into cells which contain different fields of the table row.

    在数据库方面,表称为有组织条目的排列。 它进一步划分为包含表行不同字段的单元格。

    A field pertains to a data structure that represents a single piece of entry. They are then further organized to records. They practically hold a single piece of data. They are the basic unit of memory allocation for data and is accessible.

    字段与代表单个条目的数据结构有关。 然后将它们进一步组织成记录。 他们实际上只保存一条数据。 它们是数据的内存分配的基本单位,并且可以访问。

  • SQL中有哪些不同类型的键? (What are different types of keys in SQL?)

  • Keys are a vital feature in RDMS, they are essentially fields that link one table to another and promote fast data retrieval and logging through managing column indexes.

    键是RDMS中的重要功能,它们本质上是将一个表链接到另一个表并通过管理列索引促进快速数据检索和记录的字段。

    Different types of keys are:

    不同类型的键是:

    Primary Key – a unique key that identifies records in database tables. By unique it means that it must not be Null and must be unique in the table.

    主键–标识数据库表中记录的唯一键。 “唯一”表示它不能为Null,并且在表中必须唯一。

    Candidate Key – a unique field which identifies for column or group of columns independently, without any required reference to other fields.

    候选键–一个唯一的字段,用于独立标识一个列或一组列,而无需任何其他字段的引用。

    Alternate Key – can be substituted in use for Primary Keys but are considered as a secondary. The difference is that Alternate Keys can have a Null value, provided that the columns have data within them. A type of Candidate Key which is also required to be unique.

    备用键–可以代替主键使用,但被视为辅助键。 区别在于,如果列中包含数据,则备用键可以具有Null值。 一种候选关键字,也必须是唯一的。

    Unique Key – Keys that offer restriction to prevent duplicate data within rows except for null entries.

    唯一键–提供限制以防止行内重复数据(空条目除外)的键。

    The other keys available are Foreign Keys, Super Keys, and Composite Keys.

    可用的其他键是外键,超级键和复合键。

  • 在SQL中命名不同类型的索引并进行定义。 (Name the different types of indexes in SQL and define them.)

  • Unique Index: Prevents duplicate entries within uniquely indexed columns. They are automatically generated if a Primary Key is available.

    唯一索引:防止在唯一索引的列中出现重复条目​​。 如果有主键可用,它们将自动生成。

    Clustered Index: Used to organize or edit the arrangement within the table, with respect to the key value. Each table is only allowed to have a single clustered index only.

    聚集索引:用于组织或编辑表中与键值有关的排列。 每个表仅允许具有单个聚集索引。

    NonClustered Index: Conversely, NonClustered Index only manages the order of logic within entries. It does not manage the arrangement and tables can have multiple NonClustered Indexes.

    非聚集索引:相反,非聚集索引仅管理条目中逻辑的顺序。 它不管理安排,并且表可以具有多个非聚集索引。

  • SQL和MySQL有什么区别? (What is the difference between SQL and MySQL?)

  • SQL which stands for Standard Query Language is a server programming language that provides interaction to database fields and columns. While MySQL is a type of Database Management System, not an actual programming language, more specifically an RDMS or Relational Database Management System. However, MySQL also implements the SQL syntax.

    表示标准查询语言SQL是一种服务器编程语言,它提供与数据库字段和列的交互。 虽然MySQL是数据库管理系统的一种,而不是实际的编程语言,更具体地说是RDMS或关系数据库管理系统。 但是,MySQL还实现了SQL语法。

  • SQL中的UNION和UNION ALL关键字是什么,它们之间有什么区别? (What is UNION and UNION ALL keyword in SQL and what are their differences?)

  • The UNION operator in SQL combines multiple sets highlighted in the SELECT statements. The restrictions of the set are: (1) column number must be identical, (2) Data Types in the set must be the same, and (3) the order of the column highlighted in the SELECT statement must be the same. It automatically eliminates duplicate rows within the results highlighted in the SELECT statement.

    SQL中的UNION运算符组合了SELECT语句中突出显示的多个集合。 该集合的限制是:(1)列号必须相同,(2)集合中的数据类型必须相同,并且(3)SELECT语句中突出显示的列的顺序必须相同。 它会自动消除SELECT语句中突出显示的结果中的重复行。

    UNION ALL does the same function as the UNION, but it includes all, including the duplicate rows.

    UNION ALL的功能与UNION相同,但它包括所有内容,包括重复的行。

    SELECT C1, C2 FROM T1
    UNION
    SELECT Cx, Cy FROM T2;
  • SQL中的联接有哪些不同类型? (What are the different types of joins in SQL?)

  • The join keyword queries entries from multiple tables. It is used with different keys to find these entries and is conscious on the link between fields.

    join关键字查询来自多个表的条目。 它与不同的键一起使用以查找这些条目,并且注意字段之间的链接。

    1. Inner Join: Returns rows which are common between the tables

      内部联接:返回表之间共有的行
    2. Right Join: Returns rows of the right-hand side table, including the common rows.

      右连接:返回右侧表的行,包括公共行。
    3. Left Join: Returns rows of the left-hand side table, including the common rows.

      左联接:返回左侧表的行,包括公共行。
    4. Full Join: Returns all rows, regardless if common or not.

      完全连接:返回所有行,无论是否通用。
  • 什么是规范化和非规范化? (What is Normalization and Denormalization?)

  • Normalization arranges the existing tables and its fields within the database, resulting in minimum duplication. It is used to simplify a table as much as possible while retaining the unique fields.

    规范化将现有表及其字段安排在数据库内,从而减少了重复。 它用于尽可能简化表格,同时保留唯一字段。

    Denormalization allows the retrieval of fields from all normal forms within a database. With respect to normalization, it does the opposite and puts redundancies into the table.

    非规范化允许从数据库中的所有普通形式检索字段。 关于规范化,它做了相反的工作,并在表中放入了冗余。

  • 什么时候可以使用WHERE子句和HAVING子句? (When can we use the WHERE clause and the HAVING clause?)

  • Both clauses accept conditions that are used for the basis on retrieving fields. The difference is that the WHERE clause is only used for static non-aggregated columns while the HAVING clause is used for aggregated columns only.

    这两个子句都接受用于检索字段的基础的条件。 区别在于WHERE子句仅用于静态非聚合列,而HAVING子句仅用于聚合列。

    select order_id, SUM(sale_amount) as TotalSale 
    from SalesData 
    where quantity>1 
    group by order_id 
    having SUM(sale_amount) > 100;
  • UNION,MINUS和INTERSECT之间有什么区别? (What is the difference among UNION, MINUS and INTERSECT?)

  • The UNION keyword is used in SQL for combining multiple SELECT queries but deletes duplicates from the result set.

    SQL中使用UNION关键字来组合多个SELECT查询,但从结果集中删除重复项。

    The INTERSECT keyword is only used for retrieving common rows using SELECT queries between multiple tables.

    INTERSECT关键字仅用于在多个表之间使用SELECT查询来检索公共行。

    The MINUS keyword essentially subtracts between two SELECT queries. The result is the difference between the first query and the second query. Any row common across both the result set is removed from the final output.

    MINUS关键字实质上是两个SELECT查询之间的减法。 结果是第一个查询和第二个查询之间的差异。 两个结果集中的所有公共行将从最终输出中删除。

  • 如何从表中选择10条记录? (How to select 10 records from a table?)

  • MySQL: Using limit clause, example select * from Employee limit 10;

    MySQL:使用限制子句,示例select * from Employee limit 10;

    Oracle: Using ROWNUM clause, example SELECT * FROM Employee WHERE ROWNUM < 10;

    Oracle:使用ROWNUM子句,示例SELECT * FROM Employee WHERE ROWNUM < 10;

    SQL Server: Using TOP clause, example SELECT TOP 3 * FROM Employee;

    SQL Server:使用TOP子句,例如SELECT TOP 3 * FROM Employee;

  • 在实例中删除一个表中的元素会导致另一个表中的元素被删除的实例,如何维护数据库的完整性? (How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?)

  • This is possible by invoking an SQL trigger which listens for any elements that are deleted in Table A and deletes the corresponding linked elements from Table B.

    这可以通过调用SQL触发器来侦听,该触发器将侦听表A中删除的所有元素,然后从表B中删除相应的链接元素。

  • 将数据从表A复制到表B的过程是什么? (What is the process of copying data from Table A to Table B?)

  • INSERT INTO TableB (columnOne, columnTwo, columnThree, ...)
    
    SELECT columnOne, columnTwo, columnThree, ...
    
    FROM TableA
    
    WHERE added_condtion;
  • IN和EXISTS子句有什么区别? (What are the differences between IN and EXISTS clause?)

  • The apparent difference between the two is that the EXISTS keyword is relatively faster at execution compared to IN keyword. This is because the IN keyword must search all existing records while EXISTS keywords automatically stop when a matching record has been found.

    两者之间的明显区别在于,与IN关键字相比,EXISTS关键字在执行上相对较快。 这是因为IN关键字必须搜索所有现有记录,而EXISTS关键字在找到匹配记录时自动停止。

    Also, IN Statement operates within the ResultSet while EXISTS keyword operates on virtual tables. In this context, the IN Statement also does not operate on queries that associates with Virtual tables while the EXISTS keyword is used on linked queries.

    另外,IN语句在ResultSet中运行,而EXISTS关键字在虚拟表上运行。 在这种情况下,当EXISTS关键字用于链接查询时,IN语句也不适用于与虚拟表关联的查询。

  • 首字母缩写ACID在数据库管理中代表什么? (What does the acronym ACID stand for in Database Management?)

  • The ACID Acronym stands for Atomicity, Consistency, Isolation, and Durability. This property primarily takes charge of the process integrity of the database system. This means that whatever the user issues as a data transaction to the database must be done completely, accurately, and has withstanding property.

    ACID首字母缩写词代表原子性,一致性,隔离性和耐久性。 此属性主要负责数据库系统的进程完整性。 这意味着无论用户作为数据库的数据事务发出任何问题,都必须完全,准确地完成并具有承受的属性。

  • SQL中的触发器是什么? (What is a trigger in SQL?)

  • A database trigger is a program that automatically executes in response to some event on a table or view such as insert/update/delete of a record. Mainly, the database trigger helps us to maintain the integrity of the database.

    数据库触发器是响应于表或视图上的某些事件(例如记录的插入/更新/删除)而自动执行的程序。 主要是,数据库触发器可帮助我们维护数据库的完整性。

  • SQL中的自动增量功能是什么? (What is Auto Increment feature in SQL?)

  • Auto increment allows the user to create a unique number to be generated whenever a new record is inserted in the table. AUTO INCREMENT is the keyword for Oracle, AUTO_INCREMENT in MySQL and IDENTITY keyword can be used in SQL SERVER for auto-incrementing. Mostly this keyword is used to create the primary key for the table.

    自动递增允许用户创建一个唯一编号,只要在表中插入新记录就可以生成。 AUTO INCREMENT是Oracle的关键字,MySQL中的AUTO_INCREMENT和IDENTITY关键字可在SQL SERVER中用于自动递增。 通常,此关键字用于创建表的主键。

  • 什么是整理? (What is collation?)

  • Collation is basically a set of rules on how to compare and sort characters, extended to strings. Collation in MSSQL and MySQL works pretty much the same way, except on certain collation options such as UTF-8. Besides the normal character-wise comparison, collation can also sort and compare strings on an ASCII representation perspective.

    归类基本上是一组关于如何比较和排序字符的规则,并扩展到字符串。 MSSQL和MySQL中的排序规则工作方式几乎相同,除了某些排序规则选项(如UTF-8)外。 除了常规的按字符比较之外,排序规则还可以按ASCII表示方式对字符串进行排序和比较。

  • 什么是递归存储过程? (What is a recursive stored procedure?)

  • A stored procedure which calls by itself until it reaches some boundary condition. This recursive function or procedure helps programmers to use the same set of code any number of times.

    一个存储过程,它自身会一直调用直到达到某个边界条件。 此递归函数或过程可帮助程序员多次使用同一组代码。

  • SQL中的哪个查询运算符用于模式匹配? (Which query operators in SQL is used for pattern matching?)

  • The answer is the LIKE operator.

    答案是LIKE运算符。

    LIKE operator is used for pattern matching, and it can be used as -.

    LIKE运算符用于模式匹配,可以用作-。

    • % – Matches zero or more characters.

      %–匹配零个或多个字符。
    • _(Underscore) – Matching exactly one character.

      _(下划线)–完全匹配一个字符。
  • 什么是Hibernate及其与SQL的关系? (What is Hibernate and its relation to SQL?)

  • Hibernate is Object Relational Mapping tool in Java. Hibernate let's us write object-oriented code and internally converts them to native SQL queries to execute against a relational database.

    Hibernate是Java中的对象关系映射工具。 Hibernate让我们编写面向对象的代码,并将其内部转换为本机SQL查询,以针对关系数据库执行。

    Hibernate uses its own language like SQL which is called Hibernate Query Language(HQL). The difference is that HQL boasts on being able to query Hibernate’s entity objects.

    Hibernate使用自己的语言(例如SQL)称为Hibernate查询语言(HQL)。 区别在于HQL以能够查询Hibernate的实体对象而自豪。

    It also has an object-oriented query language in Hibernate which is called Criteria Query. It proves very beneficial and helpful to developers who primarily use objects in their front-end applications and Criteria Query can cater to those objects in even add SQL-like features such as security and restriction-access.

    它在Hibernate中也有一种面向对象的查询语言,称为标准查询。 对于主要在前端应用程序中使用对象的开发人员而言,它被证明是非常有益和有用的,并且Criteria Query可以迎合这些对象,甚至可以添加类似于SQL的功能(例如安全性和限制访问)。

  • 如何解决SQL错误:ORA-00904:无效的标识符? (How can we solve SQL Error: ORA-00904: invalid identifier?)

  • This error usually appears due to syntax errors on calling a column name in Oracle database, notice the ORA identifier in the error code. Make sure you typed in the correct column name. Also, take special note on the aliases as they are the one being referenced in the error as the invalid identifier.

    通常由于在Oracle数据库中调用列名时出现语法错误而出现此错误,请注意错误代码中的ORA标识符。 确保输入正确的列名。 另外,请特别注意别名,因为它们是错误中作为无效标识符引用的别名。

  • 什么是SQL事件探查器? (What is a SQL Profiler?)

  • The SQL Profiler is a Graphical User Interface that allows database developers to monitor and track their database engine activities. It features activity logging for every event occurring and provides analysis for malfunctions and discrepancies.

    SQL Profiler是一个图形用户界面,允许数据库开发人员监视和跟踪其数据库引擎活动。 它具有针对每个事件发生的活动日志记录,并提供对故障和差异的分析。

    It basically is a diagnostic feature in SQL that debugs performance issues and provides a more versatile way of seeing which part in your trace file is causing a clog in your SQL transactions.

    它基本上是SQL的诊断功能,可以调试性能问题,并提供一种更通用的方式来查看跟踪文件中的哪个部分导致SQL事务阻塞。

  • 我们如何将SQL数据库链接到现有的Android应用程序? (How can we link a SQL database to an existing Android App?)

  • It will require a JDBC (Java Database Connectivity) driver to link these two. Also, you must add the corresponding dependencies to your build.gradle file along with the permissions and grants.

    它将需要JDBC(Java数据库连接)驱动程序来链接这两个驱动程序。 另外,您还必须将相应的依赖项以及权限和授予添加到build.gradle文件中。

    Reference: Wikipedia

    参考: 维基百科

    翻译自: https://www.journaldev.com/17773/sql-interview-questions-answers

    sql面试题问答题

已标记关键词 清除标记
表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页