0

programming languages Online Quiz - 318

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

Which functions are available in SQL?

  1. string and date

  2. character and numeric

  3. integer and conversion

  4. calendar and date

  5. date and conversion

  6. translation and date


Correct Option: B,E
  1. A MERGE statement is used to merge the data of one table with data from another.

  2. A MERGE statement can be used to update existing rows in a table.

  3. A MERGE statement replaces the data of one table with that of another.

  4. A MERGE statement can be used to insert new rows into a table.


Correct Option: A,C,D
  1. The UNIQUE constraint does not permit a null value for the column.

  2. The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.

  3. The NOT NULL constraint ensures that null values are not permitted for the column.

  4. A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.


Correct Option: A,C
  1. A subquery should retrieve only one row.

  2. A subquery can retrieve zero or more rows.

  3. Subqueries CANNOT be nested by more than two levels.

  4. A subquery can be used only in SQL query statements.

  5. A subquery CANNOT be used in an SQL query statement that uses group functions.

  6. When a subquery is used with an inequality comparison operator in the outer SQL statement,


Correct Option: B,F
  1. GRANT select ON dept TO ALL_USERS;

  2. GRANT select ON dept TO ALL;

  3. GRANT QUERY ON dept TO ALL_USERS

  4. GRANT select ON dept TO PUBLIC;

  5. GRANT QUERY ON dept TO PUBLIC;


Correct Option: D
  1. The tables being joined have NOT NULL columns.

  2. The tables being joined have only matched data.

  3. The columns being joined have NULL values.

  4. The tables being joined have only unmatched data.

  5. The tables being joined have both matched and unmatched data.

  6. Only when the tables have a primary key/foreign key relationship.


Correct Option: C,E
  1. What do you call it when a chip manufacturer loses money? -- A cash miss.

  2. What do you call someone who has to use a dull web application? --Bored to tiers.

  3. What does a hungry vegetarian say? --"I´m so hungry, I could eat a tree."

  4. Always wear protective goggles when operating a weed-eater, working with a power tool, or teasing your wife.


Correct Option: C

Given: 11. public static void test(String str) { 12. int check = 4; 13. if (check = str.length()) { 14. System.out.print(str.charAt(check -= 1) +“, “); 15. } else { 16. System.out.print(str.charAt(0) + “, “); 17. } 18. } and the invocation: 21. test(”four”); 22. test(”tee”); 23. test(”to”); What is the result?

  1. r, t, t,

  2. r, e, o,

  3. Compilation fails.

  4. An exception is thrown at runtime.


Correct Option: C

What will this program print out ? class Base{ int value = 0; Base(){ addValue(); } void addValue(){ value += 10; } int getValue(){ return value; } } class Derived extends Base{ Derived(){ addValue(); } void addValue(){ value += 20; } } public class Test { public static void main(String[] args){ Base b = new Derived(); System.out.println(b.getValue()); } }

  1. 10

  2. 20

  3. 30

  4. 40


Correct Option: D

Given classes defined in two different files: 1. package util; 2. public class BitUtils { 3. public static void process(byte[]) { /* more code here */ } 4. } 1. package app; 2. public class SomeApp { 3. public static void main(String[] args) { 4. byte[] bytes = new byte[256]; 5. // insert code here 6. } 7. } What is required at line 5 in class SomeApp to use the process method of BitUtils?

  1. process(bytes);

  2. BitUtils.process(bytes);

  3. util.BitUtils.process(bytes);

  4. SomeApp cannot use methods in BitUtils.

  5. import util.BitUtils.*; process(bytes);


Correct Option: C
  1. Starting of Main block Static block In the Main block Display block

  2. Static block Display block Starting of Main block In the Main block Display block

  3. Error: Non static method cannot accessed from static context

  4. Starting of Main block In the Main block Display block


Correct Option: B
- Hide questions