Computer Knowledge

Database and SQL

4,213 Questions

Master structured query language commands, database joins, table constraints, and alias generation. This section covers relational database management concepts and query outputs essential for technical aptitude. These technical questions feature prominently in banking IT officer exams and computer knowledge sections.

SQL queries and aliasesDatabase table constraintsDatabase joins and transformationsStored procedures and functions

Database and SQL Questions

Multiple choice
  1. DELETE LOGIN login_name

  2. Truncate LOGIN login_name

  3. DROP LOGIN login_name

  4. DISABLE LOGIN login_name

  5. A login cannot be deleted but can only be disabled.

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

It is the actual syntax to drop a login.

Multiple choice
  1. CREATE LOGIN login_id USE password

  2. CREATE LOGIN login_id WITH USE password

  3. CREATE LOGIN login_id WITH PASSWORD password

  4. USE LOGIN login_id WITH PASSWORD password

  5. UPDATE LOGIN login_id WITH PASSWORD password

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

This is the correct syntax to create new login on SQL server.

Multiple choice
  1. System.exit()

    • Q
  2. an ‘enter key’ marker

  3. a semicolon(;)

  4. End

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

The sqlite3 program looks for a semicolon to know when your SQL command is complete.

Multiple choice
  1. The user had to have knowledge of the table and index structures.

  2. The same query can be written in many ways and varying internal execution plans.

  3. SQL syntax is too difficult.

  4. Independence of table relationships.

  5. The introduction of data redundancy.

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

the declarative nature of SQL makes it possible to write an individual query in many different forms, each with identical results. For example, a query he can be written with a standard join, a non-correlated sub-query or a correlated sub-query, each producing identical results but with widely varying internal execution plans.

Multiple choice
  1. UNIQUE

  2. NOT NULL

  3. CHECK

  4. PRIMARY KEY

  5. FOREIGN KEY

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

NOT NULL constraint restricts a column from having a NULL value. Once NOT NULL constraint is applied to a column, you cannot pass a null value to that column.

Multiple choice
  1. CUBE BY

  2. GROUP BY

  3. ROLLUP BY

  4. HAVING BY

  5. ORDER BY

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

SQL's ORDER BY clause organizes data in alphabetic or numeric order. Consequently, similar values sort together in what appear to be groups. However, the apparent groups are a result of the sort

Multiple choice
  1. using %ROWTYPE

  2. using a slash (/)at the end

  3. using comma and a blank space

  4. using a semi colon at the end

  5. using slash-asterisk (/*)

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

the executable block and place a forward slash (/) after the closing END.

Multiple choice
  1. Select customer_id, sum(price) from items_ordered group by customer_id

  2. Select customer_id, count(customer_id), price from items_ordered group by customer_id

  3. Select customer_id, count(customer_id), count(price) from items_ordered group by customer_id

  4. Select customer_id, count(customer_id), count(price) from items_ordered group by item

  5. None of the above

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

This will give the desired output.