Computer Knowledge

Programming Languages and Compilers

2,284 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice technology web 2.0
  1. xml

  2. xhtml

  3. perl

  4. javascript

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

PHP's syntax is most similar to JavaScript and C-like languages. Both PHP and JavaScript share similar control structures (if/else, loops), function definitions, and statement syntax ending with semicolons. XML and XHTML are markup languages, not programming languages with procedural syntax. Perl is influential but PHP's C-style syntax is closer to JavaScript.

Multiple choice technology programming languages
  1. Initialization

  2. Start of Selection.

  3. At Selection-screen output

  4. At Selection-screen.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In ABAP executable programs, if no event keyword is explicitly specified, any processing blocks written before the first event keyword are automatically assigned to the START-OF-SELECTION event. Thus, it acts as the default event block.

Multiple choice technology databases
  1. SQL%ROWCOUNT, SQL%ISFOUND,SQL%NOTFOUND,SQL%ISOPEN

  2. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%OPEN

  3. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%ISOPEN

  4. All of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The four standard implicit cursor attributes in Oracle PL/SQL are SQL%FOUND, SQL%NOTFOUND, SQL%ROWCOUNT, and SQL%ISOPEN. SQL%ISFOUND and SQL%OPEN do not exist in PL/SQL. Therefore, the option containing SQL%ROWCOUNT, SQL%FOUND, SQL%NOTFOUND, SQL%ISOPEN is correct.

Multiple choice technology databases
  1. A stored procedure uses the DELCLARE keyword in the procedure specification to declare formal parameters

  2. A stored procedure is named PL/SQL block with at least one parameter declaration in the procedure specification.

  3. A stored procedure must have at least one executable statement in the procedure body.

  4. A stored procedure uses the DECLARE keyword in the procedure body to declare formal parameters.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A stored procedure must have at least one executable statement in its body (even NULL). It need not have parameters (B wrong). Parameters are declared in the specification, not with DECLARE keyword (A, D wrong).

Multiple choice technology databases
  1. Row level DML trigger

  2. Row level system trigger

  3. Statement level DML trigger

  4. Row level application trigger

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To answer this question, the user needs to have a basic understanding of SQL triggers and the difference between row level and statement level triggers.

The OLD and NEW qualifiers are used in row level DML triggers. These qualifiers refer to the old and new values of the row being modified by the DML statement.

A row level trigger is executed once for every row affected by the triggering DML statement. This means that if a DML statement modifies multiple rows, the row level trigger will be executed multiple times, once for each affected row.

Option A is correct because row level DML triggers are the only type of trigger that can use the OLD and NEW qualifiers to reference the old and new values of the row being modified.

Option B is incorrect because row level system triggers do not use the OLD and NEW qualifiers. System triggers are used to perform administrative tasks related to the database system, such as logging database activity.

Option C is incorrect because statement level DML triggers do not use the OLD and NEW qualifiers. Statement level triggers are executed once for each triggering DML statement, rather than once for each affected row.

Option D is incorrect because row level application triggers do not exist.

Therefore, the answer is: A. Row level DML trigger.

Multiple choice technology databases
  1. %ROWTYPE allows you to associate a variable with an entire table row

  2. %ROWTYPE associates a variable with a single column type

  3. Both of the above

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In PL/SQL, %ROWTYPE provides a record type that represents a row in a database table. The record fields have the same names and data types as the columns of the table, allowing you to associate a variable with an entire row.

Multiple choice technology databases
  1. SQL%ROWCOUNT, SQL%ISFOUND,SQL%NOTFOUND,SQL%ISOPEN

  2. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%OPEN

  3. SQL%ROWCOUNT, SQL%FOUND,SQL%NOTFOUND,SQL%ISOPEN

  4. All of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The correct SQL cursor attributes in PL/SQL are: SQL%ROWCOUNT (number of rows affected), SQL%FOUND (boolean, true if at least one row affected), SQL%NOTFOUND (boolean, true if no rows affected), and SQL%ISOPEN (boolean, always false for implicit cursors). Option B incorrectly uses SQL%OPEN, and Option A incorrectly uses SQL%ISFOUND.

Multiple choice technology databases
  1. DELCARE and BEGIN

  2. DECALRE and EXCEPTION

  3. EXCEPTION and END

  4. BEGIN and END

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In a PL/SQL block, only the DECLARE and EXCEPTION sections are optional. Every PL/SQL block must have BEGIN and END keywords to define the executable section. The DECLARE section (for declarations) and EXCEPTION section (for error handlers) can be omitted if not needed.

Multiple choice technology programming languages
  1. 3rd generation programming language

  2. 4th generation programming language

  3. 5th generation programming language

  4. All of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SAS (Statistical Analysis System) is a 4th generation programming language (4GL). 4GLs are designed to be closer to human language and more domain-specific than 3GLs like C or Java. SAS provides high-level declarative syntax for data analysis.