0

programming languages Online Quiz - 125

Description: programming languages Online Quiz - 125
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

C++ provides facility to specify that the compiler should match function calls with the correct definition at the run time. This process is called as

  1. Static binding

  2. Dynamic binding

  3. -

  4. --


Correct Option: B

C++ is normally compiled directly to machine code which is then executed directly by the operating system

  1. True

  2. False


Correct Option: A

A Cartesian product is returned when

  1. join conditions are not specified in a PROC SQL join.

  2. join conditions are not specified in a PROC SQL set operatio

  3. more than two tables are specified in a PROC SQL join.

  4. the keyword ALL is used with the OUTER UNION operator.


Correct Option: A

Consider this PROC SQL query: proc sql; select flightnumber, count(*) as Flights, avg(boarded) label="Average Boarded" format=3. from sasuser.internationalflights group by flightnumber having avg(boarded) > 150; The table Sasuser.Internationalflights contains 201 rows, 7 unique values of FlightNumber, 115 unique values of Boarded, and 4 different flight numbers that have an average value of Boarded that is greater than 150. How many rows of output will the query generate?

  1. 150

  2. 7

  3. 4

  4. 1


Correct Option: C

Which statement about the following PROC SQL query is false? proc sql; validate select name label=’Country’, rate label=’Literacy Rate’ from world.literacy where ’Asia’ = (select continent from world.continents where literacy.name = continents.country) order by 2;

  1. The query syntax is not valid.

  2. The outer query must pass values to the subquery before the subquery can return values to the outer query.

  3. PROC SQL will not execute this query when it is submitted.

  4. After the query is submitted, the SAS log will indicate whether the query has valid syntax.


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The query syntax is not valid - This option is correct because the given PROC SQL query contains invalid syntax. The issue lies with the use of single quotes around the column labels in the SELECT statement. In PROC SQL, column labels should be enclosed in double quotes, not single quotes. Therefore, this statement is false.

Option B) The outer query must pass values to the subquery before the subquery can return values to the outer query - This option is incorrect. In the given query, the subquery is used to retrieve the continent value based on the condition literacy.name = continents.country. The outer query then uses this value to filter the records from the world.literacy table. The subquery does not depend on the outer query for values.

Option C) PROC SQL will not execute this query when it is submitted - This option is incorrect. PROC SQL will execute the query when it is submitted, regardless of whether the syntax is valid or not. However, if there are syntax errors, the query may not produce the desired results.

Option D) After the query is submitted, the SAS log will indicate whether the query has valid syntax - This option is correct. After submitting the query, the SAS log will display information about the execution, including any syntax errors that may be present.

The correct answer is A) The query syntax is not valid because the single quotes around the column labels in the SELECT statement are incorrect.

  1. the tables being joined must contain the same number of columns.

  2. the tables must be sorted before they are joined

  3. the columns that are specified in a join condition in the WHERE clause must have the same data type.

  4. the columns that are specified in a join condition in the WHERE clause must have the same name.


Correct Option: C

A PROC SQL inner join can combine

  1. a maximum of 2 tables or in-line views, but multiple joins can be chained together.

  2. a maximum of 32 tables or 2 in-line views.

  3. a maximum of 32 tables, which includes any tables referenced by an in-line view.

  4. a maximum of 2 tables and 32 columns.


Correct Option: C
  1. proc sql nodup; select membertype from sasuser.frequentflyers;

  2. proc sql; select distinct(membertype) as MemberType from sasuser.frequentflyers;

  3. proc sql; select unique membertype from sasuser.frequentflyers group by membertype;

  4. proc sql; select distinct membertype from sasuser.frequentflyers;


Correct Option: D
  1. ID Salary Bonus 123 70000 5000 456 80000 7000 978 55000 3500

  2. ID Salary Bonus 123 70000 5000 456 80000 7000 744 . 3500

  3. ID Salary Bonus 123 70000 5000 456 80000 7000 744 55000 3500

  4. ID Salary Bonus 123 70000 5000 456 80000 7000 978 55000 .


Correct Option: D

Which statement about the use of table aliases is false?

  1. Table aliases must be used when referencing identical table names from different libraries.

  2. Table aliases can be referenced by using the keyword AS.

  3. Table aliases (or full table names) must be used when referencing a column name that is the same in two or more tables.

  4. Table aliases must be used when using summary functions.


Correct Option: D
  1. WHERE address is missing

  2. WHERE address not exists

  3. WHERE address is null

  4. both a and c


Correct Option: D
  1. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where balance <= 0;

  2. proc sql; select name, spent, 120-spent as Balance from Company.Absences where calculated balance <= 0;

  3. proc sql; select name, spent, 120-spent as Balance from Company.Absences where balance <= 0;

  4. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where calculated balance <= 0;


Correct Option: B
  1. df

  2. def

  3. deef

  4. deeef

  5. all the above


Correct Option: E

To copy entire matched sequence

  1. $&

  2. $%

  3. $_

  4. $@

  5. $^


Correct Option: A

$input = “abdce” =~ tr/abc/123 print $input;

  1. 123

  2. 123ce

  3. Cant modify constant item in translation

  4. 12d3e

  5. None of the above


Correct Option: C

$string = “\uhello world!”; print $string; $string = “\Uhello world!”; print $string;

  1. Hello world HELLO WORLD.

  2. Hello World HELLO WORLD.

  3. Hello world HELLO world.

  4. hello world HELLO WORLD.


Correct Option: A

package A; sub new { return bless {}, shift; } sub DESTROY { print ref(shift); } package B; use base 'A'; sub DESTROY { my $self = shift; print ref($self); bless $self, 'A'; } package main; my $obj = B->new();

  1. BA

  2. AB

  3. Compilation Error

  4. Null point reference error


Correct Option: A
- Hide questions