SQL: Queries, Constraints and Triggers

This MCQ-format quiz is based on multiple SQL basics: set and null value operations, modifications, views and transactions, different types of integrity constraints, joins, nested subqueries and aggregate functions, schemas and data types, triggers, processes and procedures and different queries and aggregation features.

Start Quiz

Updates that violate __ are disallowed.

Integrity constraints

Transaction control

Authorization

DDL constraints

To remove a relation from an SQL database, we use the __ command.

Delete

Purge

Remove

Drop table

Which one of the following is used to define the structure of the relation, deleting relations and relating schemas?

DML(Data Manipulation Langauge) DDL(Data Definition Langauge) Query Relational Schema

The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.

Fixed, equal Equal, variable Fixed, variable Variable, equal

Which one of the following provides the ability to query information from the database and insert tuples into, delete tuples from, and modify tuples in the database?

DML (Data Manipulation Language)

DDL (Data Definition Language)

Query

Relational Schema

Which of the following is the syntax for views where v is view name?

Create view v as “query name”;

Create “query expression” as view;

Create view v as “query expression”;

Create view “query expression”;

Materialised views make sure that view __.

Definition is kept stable

Definition is kept up-to-date

Definition is verified for error

Is deleted after specified time

Which of the following creates a virtual relation for storing the query?

Function

View

Procedure

None of the mentioned

Under which of the following conditions, if satisfied by the query defining the view, is the SQL view updatable [inserts, updates, or deletes can be applied on the view]?

The from clause has only one database relation

The query does not have a group by or having clause

The select clause contains only attribute names of the relation and does not have any expressions, aggregates, or distinct specification

All of the mentioned

Which of the following rejects tuples that do not satisfy the where clause condition at the end of the view?

With

Check

With check

All of the mentioned

SQL stands for __.

Structured Query Language

Sequential Query Language

Structured Question Language

Sequential Question Language

The following are components of a database except for __.

User data

Metadata

Reports

Indexes

An application where only one user accesses the database at a given time is an example of __.

A single-user database application

A multiuser database application

An e-commerce database application

A data mining database application

One commercial DBMS that combines a DBMS and an application generator is __.

Microsoft's SQL Server

Microsoft's Access

IBM's DB2

Oracle Corporation's Oracle

You have run an SQL statement that asked the DBMS to display data in a table named USER_TABLES. The results include columns of data labelled “TableName”, ”NumberOfColumns”, and “PrimaryKey”. You are looking at __.

User data

Metadata

A report

Indexes

Quiz/Test Summary
Title: SQL: Queries, Constraints and Triggers
Questions: 15
Contributed by:
Ivan