pl sql面试题_PL SQL面试问答

article/2025/10/3 14:04:43

pl sql面试题

If you have worked on Oracle database and going for an interview, you should go through PL SQL interview questions and answers.

如果您曾经在Oracle数据库上工作过并且要进行面试,则应该阅读PL SQL面试问题和答案。

PLSQL stands for Procedural Language extension to Structured Query Language. As the definition suggests it’s a Block Structured programming language that extends the capabilities of SQL to provide a more versatile query and update solutions regarding relational databases.

PLSQL代表对结构化查询语言的过程语言扩展。 顾名思义,它是一种块结构化编程语言,它扩展了SQL的功能,以提供有关关系数据库的更通用的查询和更新解决方案。

A few of the many key features that P/L SQL provides are procedures, functions, triggers, cursors etc. A portion of P/L SQL is framed from the SQL programming syntax with added procedural features. For prerequisites, it is highly recommended to have fundamental knowledge in SQL (Structured Query Language).

P / L SQL提供的许多关键功能中的一些是过程,函数,触发器,游标等。P/ L SQL的一部分由SQL编程语法构成,并带有附加的过程功能。 对于先决条件,强烈建议您具有SQL(结构化查询语言)的基础知识。

PL SQL面试问题 (PL SQL Interview Questions)

PL SQL Interview Questions and Answers, Oracle PL SQL interview questions

Listed below are various PL SQL interview questions that will help you in your upcoming interview. You should also go through SQL Interview Questions.


下面列出了各种PL SQL面试问题,这些问题将在您即将进行的面试中为您提供帮助。 您还应该阅读SQL面试问题 。

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

  2. PL SQL is a Block Structured programming language created by Oracle in the 1990s in hoping to provide additional procedural programming solutions to SQL.

    PL SQL是Oracle在1990年代创建的一种块结构编程语言,希望为SQL提供其他过程编程解决方案。

  3. SQL和PL SQL之间的主要区别是什么? (What are the key differences between SQL and PL SQL?)

  4. SQL is a Structured Query Language as opposed to P/L SQL which is a full procedural language. SQL code is processed one statement block at a time, while P/L SQL code is executed as a single program at one time. SQL can be within P/L SQL, but P/L SQL cannot be within SQL.

    SQL是一种结构化查询语言,而P / L SQL是一种完整的过程语言。 SQL代码一次处理一个语句块,而P / L SQL代码一次作为一个程序执行。 SQL可以在P / L SQL内,但P / L SQL不能在SQL内。

  5. PL / SQL的基本结构是什么? (What is the basic structure of PL/SQL?)

  6. PL SQL, as much as any other procedural language, contains blocks. These blocks which are the basic unit of sensible code are primarily categorized by two types: anonymous blocks and named blocks.

    与其他任何过程语言一样,PL SQL包含块。 这些块是明智代码的基本单元,主要分为两种类型:匿名块和命名块。

    [DECLARE]Declaration statements;
    BEGINExecution statements;[EXCEPTION]Exception handling statements;
    END;

    They are called anonymous because they have no names and are not saved in an Oracle Database.

    它们之所以称为匿名的,是因为它们没有名称并且没有保存在Oracle数据库中。

    The figure below shows a detailed PL SQL block structure:

    下图显示了详细的PL SQL块结构:

    PL SQL Program Structure

    Header Section is for naming/labeling named blocks. This may or may not be used.


    标题部分用于命名/标记命名块。 可能会或可能不会使用。

    Declaration Section is for declaring variables, cursors, or sub-blocks that will be used in the Execution Section and Exception Section. This may or may not be used.

    声明部分用于声明将在执行部分和异常部分中使用的变量,游标或子块。 可能会或可能不会使用。

    Execution Section block is where runtime code is placed. Statements in this section are required to exist for the structure to run.

    执行节块是放置运行时代码的位置。 要运行该结构,必须存在本节中的语句。

    Exception Section contains the exception and error handling of the code.

    异常部分包含代码的异常和错误处理。

    Essential keywords such as IS, BEGIN, EXCEPTION, and END are vital in the program for the runtime engine to distinguish each block sections.

    IS,BEGIN,EXCEPTION和END等基本关键字在程序中对于运行时引擎区分每个块节至关重要。

  7. 触发器及其用途是什么? (What are triggers and its uses?)

  8. Triggers are blocks of code which are run whenever the criteria for a specific event is satisfied. They are hardcoded within the PL SQL program and listens to events such as: DML(database manipulation), DDL(database definition), and database operation. They can be coded within a view, table, database, or scheme for which the mentioned event belongs.

    触发器是代码块,只要满足特定事件的条件,就会运行该代码块。 它们在PL SQL程序中进行了硬编码,并侦听以下事件:DML(数据库操作),DDL(数据库定义)和数据库操作。 它们可以在提到的事件所属的视图,表,数据库或方案中进行编码。

    There are many uses of triggers. They can be used to generate column values upon activating. For event logging within the table activities, auditing, and creating table duplicates. For security, they can implement security authorization, and handle invalid transactions.

    触发器有很多用途。 它们可用于在激活时生成列值。 对于表活动中的事件记录,审核和创建表重复项。 为了安全,他们可以实施安全授权,并处理无效的交易。

    General Structure of creating a Trigger:

    创建触发器的一般结构:

    CREATE [OR REPLACE ] TRIGGER triggerName  
    {BEFORE | AFTER | INSTEAD OF }  
    {INSERT [OR] | UPDATE [OR] | DELETE}  
    [OF colName]  
    ON tableName  
    [REFERENCING OLD AS o NEW AS n]  
    [FOR EACH ROW]  
    WHEN (condition)   
    DECLARE Declaration-statements 
    BEGIN  Executable-statements 
    EXCEPTION Exception-handling-statements 
    END;
  9. 如何编译PL / SQL代码? (How is a PL/SQL code compiled?)

  10. Firstly, PL/SQL code is transferred to the server and is compiled to byte code. This process takes place prior to program execution. To increase the performance of the procedural code, the procedures are converted to native code shared libraries which are conveniently linked to the kernel. Note that increase in performance still greatly depends on the code structure. This is independent to database calls, and affects performance only on loops, calculations, etc.

    首先,PL / SQL代码被传输到服务器并被编译为字节码。 该过程在程序执行之前进行。 为了提高过程代码的性能,将过程转换为方便地链接到内核的本机代码共享库。 请注意,性能的提高仍然很大程度上取决于代码结构。 这与数据库调用无关,并且仅影响循环,计算等性能。

  11. 使用PL / SQL创建的模式对象有哪些? (What are few of the schema objects that are created using PL/SQL?)

  12. A schema is a user-owned set of schema objects, or logical data structures. These schema objects types are as follows:

    模式是用户拥有的一组模式对象或逻辑数据结构。 这些架构对象类型如下:

  • Clusters

    集群
  • Database links

    数据库链接
  • Database triggers

    数据库触发器
  • Dimensions

    外型尺寸
  • External procedure libraries

    外部程序库
  • Indexes and index types

    索引和索引类型
  • Java classes, Java resources, and Java sources

    Java类,Java资源和Java源
  • Materialized views and materialized view logs

    物化视图和物化视图日志
  • Object tables, object types, and object views

    对象表,对象类型和对象视图
  • Operators

    经营者
  • Sequences

http://chatgpt.dhexx.cn/article/H667GY47.shtml

相关文章

常见的sql面试题

本章是SQL面试题的汇总,之后还会不断更新,文章的思维导图如下: 1.SQL初级查询 单表查询 -- 查询学生表中有几名学生的信息.显示学号 select distinct 学号 from student;查询条件 -- 查询学生表中性别为女的学生所有信息 SELECT * FROM student WHERE 性别女;结果排序 -- …

美团/得物sql面试题

解题思路: 1.找出uid不同的但是买过pro_id相同的商品的用户 [自连接] selecta.uid,b.pro_id fromtb_order ajoin tb_order bon a.pro_id b.pro_id where a.uid <> b.uid -- 找出uid不同的但是pro_id相同的商品2.对uid和pro_id进行分组 selecta.uid,a.pro_id fromtb…

Spark SQL面试题

1.RDD DataFrame DataSet的区别 &#xff08;1&#xff09; 三者之间的关系 DataFrame是特殊的RDD(它相当于RDDschema&#xff0c;即RDD表信息)&#xff0c;可以将他看成数据库中的一张数据表&#xff0c;但是只知道这个"表"中的各个字段&#xff0c;不知道各个字段…

SQL常见面试题

SQL常见面试题关系型数据库&#xff08;SQL&#xff09;非关系型数据库&#xff08;NoSQL&#xff09;数据库三大范式主键与外键CHAR与VRCHAR数据类型临时表数据库函数、触发过程与存储器 SQL语句SQL语言分类DROP、TRUNCATE、DELETE的区别sum、count(\*)、count(1)、count(colu…

常见的SQL面试题:经典50例

SQL基础知识整理 select 查询结果&#xff0c;如: [学号,平均成绩&#xff1a;组函数avg(成绩)] from 从哪张表中查找数据&#xff0c;如:[涉及到成绩&#xff1a;成绩表score] where 查询条件&#xff0c;如:[b.课程号0003 and b.成绩>80] group by 分组&#xff0c;如:…

5个必考的大厂SQL面试题

学Python的同学&#xff0c;SQL也一定要学习&#xff0c;SQL几乎是每个数据岗的必备题目&#xff0c;下面分享几个常见的大厂SQL习题。 &#xff08;1&#xff09;找出连续7天登陆&#xff0c;连续30天登陆的用户&#xff08;小红书笔试&#xff0c;电信云面试&#xff09;&am…

7 大开源数据库利弊全对比

1、CUBRID CUBRID 是一个很好的免费开源选择&#xff0c;专门针对 Web 应用程序进行优化&#xff0c;当复杂的 Web 服务需要处理大量数据并生成巨大的并发请求时&#xff0c;CUBRID 非常有用。这个解决方案是用 C 写的。 优点&#xff1a; 多粒度锁定 在线备份 用于开发语言…

还在用Navicat?这款开源的数据库管理工具界面更炫酷!

数据库管理工具&#xff0c;是后端程序员使用频率非常高的的工具。Navicat、DataGrip虽然很好用&#xff0c;但都是收费的。最近在逛Github的时候&#xff0c;无意间发现了一款开源的数据库管理工具Beekeeper Studio&#xff0c;界面非常炫酷推荐给大家&#xff01; Beekeeper…

开源数据库管理系统现在比商业产品更受欢迎

原文链接&#xff1a;https://db-engines.com/en/blog_post/86 2021年1月13日 作者&#xff1a;马蒂亚斯盖尔曼&#xff08;Matthias Gelbmann&#xff09; Matthias Gelbmann是奥地利维也纳Solid IT联合创始人&#xff0c;董事总经理兼顾问。 Matthias Gelbmann在维也纳学习了…

你了解世界上功能最强大的开源数据库吗?

如果不是领导强制要求&#xff0c;可能根本不会留意到这款号称世界上功能最强大的开源数据库——PostgreSQL。如果你不读这篇文章&#xff0c;或许也会错过一个跃跃欲试想挤进前三的优秀数据库。 为了能够熟练运用&#xff0c;特意买书研究&#xff0c;发现这款数据库还真有点…

开源数据库列表

转载于&#xff1a;http://database.csdn.net/subject/databaseopen.htm 编辑导语 开源数据库最初的诞生和发展大都依靠自由软件开发者&#xff0c;但是&#xff0c;现在越来越多的IT公司开始把触角伸向了开源数据库。而早期投身于其中的IT厂商早已获利&#xff0c;比如Sleepy…

TuGraph 开源数据库体验

TuGraph 开源数据库体验 文章目录 TuGraph 开源数据库体验1. 简单介绍2. 可视化界面体验&#xff1a;查询界面&#xff1a;数据建模&#xff1a;数据导入&#xff1a; 3. 体验心得&#xff1a; 1. 简单介绍 TuGraph 是蚂蚁集团自主研发的大规模图计算系统&#xff0c;提供图数…

数据库与开源的未来

大家好&#xff0c;社区的小伙伴可能已经发现CnosDB已经全面拥抱Rust。我们一直高度关注行业趋势的发展&#xff0c;拥抱新兴的语言和前沿的技术。本期Jesse就想跟大家聊聊数据库与开源的未来。 本文仅代表个人观点&#xff0c;如有偏颇之处&#xff0c;还请海涵&#xff5e; …

做了7年开源数据库开发,我学到了什么?

作者 | PHILIP OTOOLE&#xff0c;已获作者授权 译者 | 弯月 责编 | 欧阳姝黎 出品 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09; 2016年4月9日&#xff0c;第一版rqlite&#xff08;https://github.com/rqlite/rqlite/releases/tag/v1.0&#xff09;正式发布&a…

【数据库】什么是 PostgreSQL?开源数据库系统

文章目录 前言什么是 PostgreSQL&#xff1f;PostgreSQL 中的 SQL服务器管理接口 PostgreSQL 用途通用 OLTP&#xff1a;联合中心&#xff1a;地理空间&#xff1a;LAPP 堆栈&#xff1a; 使用 PostgreSQL 有什么好处&#xff1f;开源许可证&#xff1a;易于扩展&#xff1a;可…

这款免费开源的数据库工具,支持所有主流数据库!

Java技术栈 www.javastack.cn 关注阅读更多优质文章 DBeaver 是一个基于 Java 开发&#xff0c;免费开源的通用数据库管理和开发工具&#xff0c;使用非常友好的 ASL 协议。可以通过官方网站或者 Github 进行下载。 由于 DBeaver 基于 Java 开发&#xff0c;可以运行在各种操作…

开源数据库管理系统DBeaver

简介 DBeaver dbeaver是免费和开源&#xff08;GPL&#xff09;为开发人员和数据库管理员通用数据库工具。 易用性是该项目的主要目标&#xff0c;是经过精心设计和开发的数据库管理工具。免费、跨平台、基于开源框架和允许各种扩展写作&#xff08;插件&#xff09;。 它支持任…

开源数据库的国际化思考与实践

整理 | 小雨青年 出品 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09; 在全球开源技术掌门人高峰论坛上&#xff0c;PingCAP 联合创始人兼CTO 黄东旭分享了《开源数据库的国际化思考与实践》。 开源已死&#xff1f;不&#xff0c;还差得远 可能因为TiDB 是开源的&a…

一个比 ClickHouse 还快的开源数据库

开源分析数据库 ClickHouse 以快著称&#xff0c;真的如此吗&#xff1f;我们通过对比测试来验证一下。 ClickHouse vs Oracle 先用 ClickHouse&#xff08;简称 CH&#xff09;、Oracle 数据库&#xff08;简称 ORA&#xff09;一起在相同的软硬件环境下做对比测试。测试基准使…

Java开源数据库引擎,数据库计算封闭性的一站式解决方案

目录 前言引入一、数据库封闭性带来的问题&#xff1f;问题1: ETL变成ELT甚至LETETL&#xff1a;ELT&#xff1a; 问题2: 中间表带来的资源消耗和耦合问题3: 多样性数据源问题4: 存储过程带来的安全和耦合问题问题5: 大数据性能导致的尴尬 二、开放的SPL解决方式多样源直接计算…