Quiz Time
SQL -Structured Query Language

No Short Description Present

Course Related Quiz

# Quiz
1
Discuss
SQL Syntax

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

  • 1]

    DML(Data Manipulation Langauge)

  • 2]

    DDL(Data Definition Langauge)

  • 3]

    Query

  • 4]

    Relational Schema

Solution
2
Discuss
SQL Syntax

Updates that violate __________ are disallowed.

  • 1]

    Integrity constraints

  • 2]

    Transaction control

  • 3]

    Authorization

  • 4]

    DDL constraints

Solution
3
Discuss
SQL Syntax
INSERT INTO instructor VALUES (10211, ’Smith’, ’Biology’, 66000);

What type of statement is this?

  • 1]

    Query

  • 2]

    DML

  • 3]

    Relational

  • 4]

    DDL

Solution
4
Discuss
SQL Syntax
DELETE FROM r;   /* r - relation  */

This command performs which of the following action?

  • 1]

    Remove relation

  • 2]

    Clear relation entries

  • 3]

    Delete fields

  • 4]

    Delete rows

Solution
5
Discuss
SQL Syntax

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

  • 1]

    Delete

  • 2]

    Purge

  • 3]

    Remove

  • 4]

    Drop table

Solution
6
Discuss
SQL Syntax

An attribute A of datatype varchar(20) has the value “Avi”. The attribute B of datatype char(20) has value ”Reed”. Here attribute A has ____ spaces and attribute B has ____ spaces.

  • 1]

    3, 20

  • 2]

    20, 4

  • 3]

    20, 20

  • 4]

    3, 4

Solution
7
Discuss
SQL Syntax

The basic datatype char (n) is a _______ length character string and varchar (n) is _______ length character.

  • 1]

    Fixed, equal

  • 2]

    Equal, variable

  • 3]

    Fixed, variable

  • 4]

    Variable, equal

Solution
8
Discuss
SQL Syntax
SELECT * FROM employee

What type of statement is this?

  • 1]

    DML

  • 2]

    DDL

  • 3]

    View

  • 4]

    Integrity constraint

Solution
9
Discuss
SQL Syntax
CREATE TABLE employee (name VARCHAR, id INTEGER)

What type of statement is this?

  • 1]

    DML

  • 2]

    DDL

  • 3]

    View

  • 4]

    Integrity constraint

Solution
10
Discuss
SQL Syntax

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

  • 1]

    DML(Data Manipulation Langauge)

  • 2]

    DDL(Data Definition Langauge)

  • 3]

    Query

  • 4]

    Relational Schema

Solution
11
Discuss
SQL Syntax

The database administrator who authorizes all the new users, modifies the database and takes grants privilege is

  • 1]

    Operator of operating system

  • 2]

    Administrator

  • 3]

    Super user

  • 4]

    All of the mentioned

Solution
12
Discuss
SQL Syntax

Which of the following is used to provide privilege to only a particular attribute?

  • 1]

    Grant update(budget,salary,Rate) on department to Raj

  • 2]

    Grant update(budget) on department to Raj

  • 3]

    Grant select on employee to Amit

  • 4]

    Grant delete to Amit

Solution
13
Discuss
SQL Syntax

Which of the following statement is used to remove the privilege from the user Amir?

  • 1]

    Remove update on department from Amir

  • 2]

    Revoke update on employee from Amir

  • 3]

    Delete select on department from Raj

  • 4]

    Grant update on employee from Amir

Solution
14
Discuss
SQL Syntax

Which of the following is used to provide delete authorization to instructor?

  • 1]
    CREATE ROLE instructor ;
    GRANT DELETE TO instructor;

     

  • 2]
    CREATE ROLE instructor;
    GRANT SELECT ON takes
    TO instructor;

     

  • 3]
    CREATE ROLE instructor;
    GRANT DELETE ON takes
    TO instructor;

     

  • 4]

    All of the mentioned

Solution
15
Discuss
SQL Syntax

Which of the following is true regarding views?

  • 1]

    The user who creates a view cannot be given update authorization on a view without having update authorization on the relations used to define the view

  • 2]

    The user who creates a view cannot be given update authorization on a view without having update authorization on the relations used to define the view

  • 3]

    If a user creates a view on which no authorization can be granted, the system will allow the view creation request

  • 4]

    A user who creates a view receives all privileges on that view

Solution
16
Discuss
SQL Syntax

If we wish to grant a privilege and to allow the recipient to pass the privilege on to other users, we append the __________ clause to the appropriate grant command.

  • 1]

    With grant

  • 2]

    Grant user

  • 3]

    Grant pass privilege

  • 4]

    With grant option

Solution
17
Discuss
SQL Syntax

In the authorization graph, if DBA provides authorization to u1 which in turn gives to u2 which of the following is correct?

  • 1]

    If DBA revokes authorization from u1 then u2 authorization is also revoked

  • 2]

    If u1 revokes authorization from u2 then u2 authorization is revoked

  • 3]

    If DBA & u1 revokes authorization from u1 then u2 authorization is also revoked

  • 4]

    If u2 revokes authorization then u1 authorization is revoked

Solution
18
Discuss
SQL Syntax

Which of the following is used to avoid cascading of authorizations from the user?

  • 1]

    Granted by the current role

  • 2]

    Revoke select on the department from Amit, Satoshi restrict;

  • 3]

    Revoke grant option for select on the department from Amit;

  • 4]

    Revoke select on the department from Amit, Satoshi cascade;

Solution
19
Discuss
SQL Datatype

Which of the following statements creates a new table temp instructor that has the same schema as an instructor?

  • 1]
    Create table temp_instructor;

     

  • 2]
    Create table temp_instructor like instructor;

     

  • 3]
    Create Table as temp_instructor;

     

  • 4]
    Create table like temp_instructor;

     

Solution
20
Discuss
SQL Datatype

In contemporary databases, the top level of the hierarchy consists of _______ each of which can contain ______

  • 1]

    Catalogs, schemas

  • 2]

    Schemas, catalogs

  • 3]

    Environment, schemas

  • 4]

    Schemas, Environment

Solution
21
Discuss
SQL Datatype

Which of the following closely resembles Create view?

  • 1]

    Create table . . .like

  • 2]

    Create table . . . as

  • 3]

    With data

  • 4]

    Create view as

Solution
22
Discuss
SQL Datatype

In order to ensure that an instructor’s salary domain allows only values greater than a specified value use:

CREATE DOMAIN YearlySalary NUMERIC(8,2)
CONSTRAINT salary VALUE test __________;

 

  • 1]

    Value>=30000.00

  • 2]

    Not null;

  • 3]

    Check(value >= 29000.00);

  • 4]

    Check(value)

Solution
23
Discuss
SQL Datatype

Values of one type can be converted to another domain using which of the following?

  • 1]

    Cast

  • 2]

    Drop type

  • 3]

    Alter type

  • 4]

    Convert

Solution
24
Discuss
SQL Datatype

The user-defined data type can be created using

  • 1]

    Create datatype

  • 2]

    Create data

  • 3]

    Create definetype

  • 4]

    Create type

Solution
25
Discuss
SQL Datatype

Which of the following is used to store movie and image files?

  • 1]

    Clob

  • 2]

    Blob

  • 3]

    Binary

  • 4]

    Image

Solution
26
Discuss
SQL Datatype

Here which one denotes the relation for which index is created?

Create index studentID_index on student(ID);

 

  • 1]

    StudentID_index

  • 2]

    ID

  • 3]

    StudentID

  • 4]

    Student

Solution
27
Discuss
SQL Datatype

An ________ on an attribute of a relation is a data structure that allows the database system to find those tuples in the relation that have a specified value for that attribute efficiently, without scanning through all the tuples of the relation.

  • 1]

    Index

  • 2]

    Reference

  • 3]

    Assertion

  • 4]

    Timestamp

Solution
28
Discuss
SQL Datatype

Dates must be specified in the format

  • 1]

    mm/dd/yy

  • 2]

    yyyy/mm/dd

  • 3]

    dd/mm/yy

  • 4]

    yy/dd/mm

Solution
29
Discuss
SQL Datatype

The SQL database language includes statements for:

  • 1]

    Database definition

  • 2]

    Database manipulation

  • 3]

    Database control

  • 4]

    All of the above

Solution
30
Discuss
SQL Datatype

Which SQL Query is used to remove a table and all its data from the database?

  • 1]

    Create Table

  • 2]

    Alter Table

  • 3]

    Drop Table

  • 4]

    None of these

Solution
31
Discuss
SQL Datatype

A type of query that is placed within a WHERE or HAVING clause of another query is called

  • 1]

    Super query

  • 2]

    Multi-query

  • 3]

    Subquery

  • 4]

    Master query

Solution
32
Discuss
How To Download And Install MySql Workbench

To relate one table to another, a _____ in one table is used to point to the primary key in another table

  • 1]

    primary key

  • 2]

    foreign key

Solution
33
Discuss
How To Download And Install MySql Workbench

What does SQL stand for?

  • 1]

    Structured Query Language

  • 2]

    Sequential Query Language

  • 3]

    Structured Question Language

  • 4]

    Sequential Question Language

Solution
34
Discuss
Drop Database

Fact tables are which of the following?

  • 1]

    Completely demoralized

  • 2]

    Completely normalized

  • 3]

    Partially demoralized

  • 4]

    Partially normalized

Solution
35
Discuss
Drop Database

A snowflake schema is which of the following types of tables?

  • 1]

    Fact

  • 2]

    Dimension

  • 3]

    Helper

  • 4]

    All of the above

Solution
36
Discuss
Drop Database

A goal of data mining includes which of the following?

  • 1]

    To explain some observed event or condition

  • 2]

    To confirm that data exists

  • 3]

    To analyze data for expected relationships

  • 4]

    To create a new data warehouse

Solution
37
Discuss
Drop Database

Primitive operations common to all record management systems include

  • 1]

    Print

  • 2]

    Sort

  • 3]

    Look-up

  • 4]

    All of the above

Solution
38
Discuss
Drop Database

Each of the data files has a ______ that describe the way the data is stored in the file

  • 1]

    File structure

  • 2]

    Records

  • 3]

    Database

  • 4]

    Fields

Solution
39
Discuss
Drop Database

After you ______ a record, many data management environments require you to issue a command to save the changes you made

  • 1]

    Delete

  • 2]

    Update

  • 3]

    Sort key

  • 4]

    Index

Solution
40
Discuss
Drop Database

Sort/report generators

  • 1]

    are faster than index/report generators

  • 2]

    require more disk space than index/report generators

  • 3]

    do not need to sort before generating a report

  • 4]

    both (a) and (b)

Solution
41
Discuss
Drop Database

An-owner-member set in the CODASYL specifications may have

  • 1]

    only one owner but many owner occurrences

  • 2]

    only one member but many member occurrences

  • 3]

    more than one member but only one occurrence per member

  • 4]

    All of the above

Solution
42
Discuss
Drop Database

Which of the following hardware components is the most important to the operation of a database management system?

  • 1]

    high-resolution video display

  • 2]

    printer

  • 3]

    high speed, large-capacity disk

  • 4]

    plotter

Solution
43
Discuss
Use / Select Database

A database application can perform which of the following activities?

  • 1]

    Add records

  • 2]

    Update records

  • 3]

    Read records

  • 4]

    All of the above

Solution
44
Discuss
Use / Select Database

An enterprise database is which of the following?

  • 1]

    A database designed to support only users external to an organization

  • 2]

    A database designed to support an entire organization

  • 3]

    A database designed to support a single PC

  • 4]

    A database designed to support a relatively small group

Solution
45
Discuss
Use / Select Database

Legacy data is which of the following?

  • 1]

    Data contained in a newly-installed system

  • 2]

    Data contained in a file system

  • 3]

    Data rejected during the installation of a new system

  • 4]

    Data contained by a system used prior to the installation of a new system

Solution
46
Discuss
Use / Select Database

Which of the following is true for a relational database?

  • 1]

    Data is represented by tables

  • 2]

    Complex programs have to be written for simple queries

  • 3]

    It is difficult to access data

  • 4]

    All of the above

Solution
47
Discuss
Use / Select Database

A shared database should

  • 1]

    be accurate and available

  • 2]

    be secure

  • 3]

    provide for backup and recovery

  • 4]

    All of the above

Solution
48
Discuss
Use / Select Database

A data warehouse uses

  • 1]

    partial operational data

  • 2]

    future operational data

  • 3]

    historical operational data

  • 4]

    health care data

Solution
49
Discuss
Use / Select Database

A database management system (DBMS) is a

  • 1]

    hardware system used to create, maintain and provide controlled access to a database

  • 2]

    a software system used to create, maintain and provide controlled access to a database

  • 3]

    hardware system used to create, maintain, and provide uncontrolled access to a database

  • 4]

    a software system used to create, maintain, and provide uncontrolled access to a database

Solution
50
Discuss
Use / Select Database

An enterprise data model is

  • 1]

    a graphical model that shows the high-level entities for an organization

  • 2]

    a graphical model that shows all entities for an organization

  • 3]

    a non-graphical model that shows the high-level entities for an organization

  • 4]

    a non-graphical model that shows all entities for an organization

Solution
51
Discuss
Use / Select Database

A data warehouse is which of the following?

  • 1]

    Can be updated by end users

  • 2]

    Contains numerous naming conventions and formats

  • 3]

    Organized around important subject areas

  • 4]

    Contains only current data

Solution
52
Discuss
Use / Select Database

An operational system is which of the following?

  • 1]

    A system that is used to run the business in real-time and is based on historical data

  • 2]

    A system that is used to run the business in real-time and is based on current data

  • 3]

    A system that is used to support decision making and is based on current data

  • 4]

    A system that is used to support decision making and is based on historical data

Solution
53
Discuss
Use / Select Database

The generic two-level data warehouse architecture includes which of the following?

  • 1]

    At least one data mart

  • 2]

    Data that can be extracted from numerous internal and external sources

  • 3]

    Near real-time updates

  • 4]

    All of the above

Solution
54
Discuss
Use / Select Database

The active data warehouse architecture includes which of the following?

  • 1]

    At least one data mart

  • 2]

    Data that can extracted from numerous internal and external sources

  • 3]

    Near real-time updates

  • 4]

    All of the above

Solution
55
Discuss
Use / Select Database

Reconciled data is which of the following?

  • 1]

    Data stored in the various operational systems throughout the organization

  • 2]

    Current data intended to be the single source for all decision support systems

  • 3]

    Data stored in one operational system in the organization

  • 4]

    Data that has been selected and formatted for end-user support applications

Solution
56
Discuss
Use / Select Database

Transient data is which of the following?

  • 1]

    Data in which changes to existing records cause the previous version of the records to be eliminated

  • 2]

    Data in which changes to existing records do not cause the previous version of the records to be eliminated

  • 3]

    Data that are never altered or deleted once they have been added

  • 4]

    Data that are never deleted once they have been added

Solution
57
Discuss
Use / Select Database

The extract process is which of the following?

  • 1]

    Capturing all of the data contained in various operational systems

  • 2]

    Capturing a subset of the data contained in various operational systems

  • 3]

    Capturing a subset of the data contained in various decision support systems

  • 4]

    Capturing all of the data contained in various decision support systems

Solution
58
Discuss
Use / Select Database

Data scrubbing is which of the following?

  • 1]

    A process to reject data from the data warehouse and to create the necessary indexes

  • 2]

    A process to load the data in the data warehouse and to create the necessary indexes

  • 3]

    A process to upgrade the quality of data after it is moved into a data warehouse

  • 4]

    A process to upgrade the quality of data before it is moved into a data warehouse

Solution
59
Discuss
Use / Select Database

The load and index are which of the following?

  • 1]

    A process to reject data from the data warehouse and to create the necessary indexes

  • 2]

    A process to load the data in the data warehouse and to create the necessary indexes

  • 3]

    A process to upgrade the quality of data before it is moved into a data warehouse

  • 4]

    A process to upgrade the quality of data after it is moved into a data warehouse

Solution
60
Discuss
Use / Select Database

Data transformation includes which of the following?

  • 1]

    A process to change data from a detailed level to a summary level

  • 2]

    Joining data from one source into various sources of data

  • 3]

    A process to change data from a summary level to a detailed level

  • 4]

    Separating data from one source into various sources of data

Solution
61
Discuss
Use / Select Database

A multifield transformation does which of the following?

  • 1]

    Converts data from one field into multiple fields

  • 2]

    Converts data from multiple fields into one field

  • 3]

    Converts data from multiple fields into multiple fields

  • 4]

    All of the above

Solution
62
Discuss
Use / Select Database

A star schema has what type of relationship between a dimension and fact table?

  • 1]

    One-to-one

  • 2]

    Many-to-many

  • 3]

    One-to-many

  • 4]

    All of the above

Solution
63
Discuss
Alter - Rename Table
Name
Annie
Bob
Callie
Derek

Which of these queries will display the table given above?

  • 1]

    Select employee from name

  • 2]

    Select name

  • 3]

    Select name from employee

  • 4]

    Select employee

Solution
64
Discuss
Alter - Rename Table

Here which of the following displays the unique values of the column?

SELECT ________ dept_name 
FROM instructor;

 

  • 1]

    All

  • 2]

    From

  • 3]

    Distinct

  • 4]

    Name

Solution
65
Discuss
Alter - Rename Table

The query given below will not give an error. Which one of the following has to be replaced to get the desired output?

SELECT ID, name, dept name, salary * 1.1
WHERE instructor;

 

  • 1]

    Salary*1.1

  • 2]

    ID

  • 3]

    Where

  • 4]

    Instructor

Solution
66
Discuss
Alter - Rename Table

This Query can be replaced by which one of the following?

SELECT name, course_id
FROM instructor, teaches
WHERE instructor_ID= teaches_ID;

 

  • 1]

    Select name,course_id from teaches,instructor where instructor_id=course_id;

  • 2]

    Select name, course_id from instructor natural join teaches;

  • 3]

    Select name, course_id from instructor;

  • 4]

    Select course_id from instructor join teaches;

Solution
67
Discuss
Alter - Rename Table
SELECT * FROM employee WHERE salary>10000 AND dept_id=101;

Which of the following fields are displayed as output?

  • 1]

    Salary, dept_id

  • 2]

    Employee

  • 3]

    Salary

  • 4]

    All the field of employee relation

Solution
68
Discuss
Alter - Rename Table
Employee_id Name Salary
1001 Annie 6000
1009 Ross 4500
1018 Zeith 7000

This is the Employee table.
Which of the following employee_id will be displayed for the given query?

SELECT * FROM employee WHERE employee_id>1009;

 

  • 1]

    1009, 1001, 1018

  • 2]

    1009, 1018

  • 3]

    1001

  • 4]

    1018

Solution
69
Discuss
Alter - Rename Table

Which of the following statements contains an error?

  • 1]

    Select * from emp where empid = 10003;

  • 2]

    Select empid from emp where empid = 10006;

  • 3]

    Select empid from emp;

  • 4]

    Select empid where empid = 1009 and lastname = ‘GELLER’;

Solution
70
Discuss
Alter - Rename Table

In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

 

  • 1]
    Table
  • 2]

    Values

  • 3]

    Relation

  • 4]

    Field

Solution
71
Discuss
Alter - Rename Table

A Delete command operates on ______ relation.

  • 1]

    One

  • 2]

    Two

  • 3]

    Several

  • 4]

    Null

Solution
72
Discuss
Alter - Rename Table
Delete from r where P;

The above command

  • 1]

    Deletes a particular tuple from the relation

  • 2]

    Deletes the relation

  • 3]

    Clears all entries from the relation

  • 4]

    All of the mentioned

Solution
73
Discuss
Alter - Rename Table

Which one of the following deletes all the entries but keeps the structure of the relation.

  • 1]
    Delete from r where P;

     

  • 2]
    Delete from instructor where dept name= ’Finance’;

     

  • 3]
    Delete from instructor where salary between 13000 and 15000;

     

  • 4]
    Delete from instructor;

     

Solution
74
Discuss
Alter - Add Column

Which of the following is used to insert a tuple from another relation?

  • 1]
    INSERT INTO course (course id, title, dept name, credits)
    VALUES (’CS-437’, ’DATABASE Systems’, ’Comp. Sci.’, 4);

     

  • 2]
    INSERT INTO instructor
    SELECT ID, name, dept name, 18000
    FROM student
    WHERE dept name = ’Music’ AND tot cred > 144;

     

  • 3]
    INSERT INTO course VALUES (’CS-437’, ’DATABASE Systems’, ’Comp. Sci.’, 4);

     

  • 4]

    Not possible

Solution
75
Discuss
Alter - Add Column

Which of the following deletes all tuples in the instructor relation for those instructors associated with a department located in the Watson building which is in department relation.

  • 1]
    DELETE FROM instructor
    WHERE dept_name IN 'Watson';

     

  • 2]
    DELETE FROM department 
    WHERE building='Watson';

     

  • 3]
    DELETE FROM instructor
    WHERE dept_name IN (
    SELECT dept name FROM department
    WHERE building = ’Watson’);

     

  • 4]

     None of the mentioned

Solution
76
Discuss
Alter - Add Column

Fill in with correct keyword to update the instructor relation.

UPDATE instructor
_____ salary= salary * 1.05;

 

  • 1]

    Where

  • 2]

    Set

  • 3]

    In

  • 4]

    Select

Solution
77
Discuss
Alter - Add Column

 _________ are useful in SQL update statements, where they can be used in the set clause.

  • 1]

    Multiple queries

  • 2]

    Sub queries

  • 3]

    Update

  • 4]

    Scalar subqueries

Solution
78
Discuss
Alter - Add Column

The problem of ordering the update in multiple updates is avoided using

  • 1]

    Set

  • 2]

    Where

  • 3]

    Case

  • 4]

    When

Solution
79
Discuss
Alter - Add Column

Which of the following is the correct format for case statements.

  • 1]
    CASE
    WHEN pred1 ... result1
    WHEN pred2 ... result2
    . . .
    WHEN predn ... resultn
    ELSE result0
    END

     

  • 2]
    CASE
    WHEN pred1 THEN result1
    WHEN pred2 THEN result2
    . . .
    WHEN predn THEN resultn
    ELSE result0
    END

     

  • 3]
    CASE
    WHEN pred1 THEN result1
    WHEN pred2 THEN result2
    . . .
    WHEN predn THEN resultn
    ELSE result0

     

  • 4]

    All of the mentioned

Solution
80
Discuss
Alter - Add Column

Which of the following relation updates all instructors with salary over $100,000 receive a 3 percent raise, whereas all others receive a 5 percent raise.

  • 1]
    UPDATE instructor
    SET salary = salary * 1.03
    WHERE salary > 100000;
    UPDATE instructor
    SET salary = salary * 1.05
    WHERE salary <= 100000;

     

  • 2]
    UPDATE instructor
    SET salary = salary * 1.05
    WHERE salary < (SELECT avg (salary)
    FROM instructor);

     

  • 3]
    UPDATE instructor
    SET salary = CASE
    WHEN salary <= 100000 THEN salary * 1.03
    ELSE salary * 1.05
    END

     

  • 4]

    None of the mentioned

Solution
81
Discuss
Drop Table

What is not an advantage of stored procedures?

  • 1]

    Greater security

  • 2]

    SQL can be optimized

  • 3]

    Code sharing

  • 4]

    Increased network traffic

Solution
82
Discuss
Drop Table

A reason for using an SQL view to hide columns is

  • 1]

    to simplify a result only

  • 2]

    to prevent the display of sensitive data only

  • 3]

    to accomplish both of the above

  • 4]

    None of the above

Solution
83
Discuss
Drop Table

Which of the following is an SQL trigger supported by Oracle?

  • 1]

    BEFORE

  • 2]

    AFTER

  • 3]

    INSTEAD OF

  • 4]

    All of the above

Solution
84
Discuss
Drop Table

The SQL ALTER statement can be used to

  • 1]

    Change the table structure

  • 2]

    Change the table data

  • 3]

    Add rows to the table

  • 4]

    Delete rows from the table

Solution
85
Discuss
Drop Table

What SQL structure is used to limit column values of a table?

  • 1]

    The LIMIT constraint

  • 2]

    The CHECK constraint

  • 3]

    The VALUE constraint

  • 4]

    None of the above

Solution
86
Discuss
Drop Table

Which is NOT one of the most common types of SQL CHECK constraints?

  • 1]

    System date

  • 2]

    Range checks

  • 3]

    Lists of values

  • 4]

    Comparing one column value to another within the same table

Solution
87
Discuss
Drop Table

What is an advantage of placing computations in SQL views

  • 1]

    To save users from having to write an expression

  • 2]

    To ensure that the results are consistent

  • 3]

    To accomplish both of the above

  • 4]

    None of the above

Solution
88
Discuss
Drop Table

Views constructed from SQL SELECT statements that conform to the SQL-92 standard may not contain

  • 1]

    GROUP BY

  • 2]

    WHERE

  • 3]

    ORDER BY

  • 4]

    FROM

Solution
89
Discuss
Drop Table

‘AS’ clause is used in SQL for

  • 1]

    Selection operation

  • 2]

    Rename operation

  • 3]

    Join operation

  • 4]

    Projection operation

Solution
90
Discuss
Drop Table

The language which has recently become the defacto standard for interfacing application programs with relational database system is

  • 1]

    Oracle

  • 2]

    SQL

  • 3]

    DBase

  • 4]

    4GL

Solution
91
Discuss
Drop Table

A report generator is used to

  • 1]

    update files

  • 2]

    print files on paper

  • 3]

    data entry

  • 4]

    delete files

Solution
92
Discuss
Drop Table

Count function in SQL returns the number of

  • 1]

    Values

  • 2]

    Distinct values

  • 3]

    Groups

  • 4]

    Columns

Solution
93
Discuss
Drop Table

The statement in SQL which allows changing the definition of a table is

  • 1]

    Alter

  • 2]

    Update

  • 3]

    Create

  • 4]

    Select

Solution
94
Discuss
Drop Table

Which of the following is correct

  • 1]

    a SQL query automatically eliminates duplicates

  • 2]

    SQL permits attribute names to be repeated in the same relation

  • 3]

    a SQL query will not work if there are no indexes on the relations

  • 4]

    None of these

Solution
95
Discuss
Drop Table

Which of the following is a valid SQL type?

  • 1]

    CHARACTER

  • 2]

    NUMERIC

  • 3]

    FLOAT

  • 4]

    All of the above

Solution
96
Discuss
Drop Table

Which of the following is an advantage of view?

  • 1]

    Data security

  • 2]

    Derived columns

  • 3]

    Hiding of complex queries

  • 4]

    All of the above

Solution
97
Discuss
Drop Table

Which of the following is a legal expression in SQL?

  • 1]
    SELECT NULL FROM EMPLOYEE;

     

  • 2]
    SELECT NAME FROM EMPLOYEE;

     

  • 3]
    SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL;

     

  • 4]
    None of the above

     

Solution
98
Discuss
Drop Table

Which of the following is a comparison operator in SQL?

  • 1]

    =

  • 2]

    LIKE

  • 3]

    BETWEEN

  • 4]

    All of the above

Solution
99
Discuss
Drop Table

Which one of the following is not true for a view

  • 1]

    View is derived from other tables

  • 2]

    View is a virtual table

  • 3]

    A view definition is permanently stored as part of the database

  • 4]

    View never contains derived columns

Solution
100
Discuss
Drop Table

To delete a particular column in a relation the command used is

  • 1]

    UPDATE

  • 2]

    DROP

  • 3]

    ALTER

  • 4]

    DELETE

Solution
101
Discuss
Insert Record

The granting and revoking of roles by the user may cause some confusion when that user role is revoked. To overcome the above situation

  • 1]

    By restricting the user access to the roles

  • 2]

    The privilege must be granted only by roles

  • 3]

    The privilege is granted by roles and users

  • 4]

    The user role cannot be removed once given

Solution
102
Discuss
Insert Record

Which join condition contains an equality operator:

  • 1]

    Equijoins

  • 2]

    Cartesian

  • 3]

    Natural

  • 4]

    Left

Solution
103
Discuss
Insert Record

A __________ is a special kind of a store procedure that executes in response to certain action on the table like insertion, deletion or updation of data.

  • 1]

    Procedures

  • 2]

    Triggers

  • 3]

    Functions

  • 4]

    None of the mentioned

Solution
104
Discuss
Insert Record

The CREATE TRIGGER statement is used to create the trigger. THE _____ clause specifies the table name on which the trigger is to be attached. The ______ specifies that this is an AFTER INSERT trigger.

  • 1]

    For insert, on

  • 2]

    Both a and c

  • 3]

    For, insert

  • 4]

    On, for insert

Solution
105
Discuss
Insert Record

What are the after triggers?

  • 1]

    Triggers generated after a particular operation

  • 2]

    These triggers run after an insert, update or delete on a table

  • 3]

    These triggers run after an insert, views, update, or delete on a table

  • 4]

    Both b and c

Solution
106
Discuss
Insert Record

The variables in the triggers are declared using

  • 1]

    -

  • 2]

    @

  • 3]

    /

  • 4]

    /@

Solution
107
Discuss
Select Record

The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.

  • 1]

    Where, from

  • 2]

    From, select

  • 3]

    Select, from

  • 4]

    From, where

Solution
108
Discuss
Select Record

The ________ clause is used to list the attributes desired in the result of a query.

  • 1]

    Where

  • 2]

    Select

  • 3]

    From

  • 4]

    Distinct

Solution
109
Discuss
Select Record

A relational database consists of a collection of

  • 1]

    Tables

  • 2]

    Fields

  • 3]

    Records

  • 4]

    Keys

Solution
110
Discuss
Select Record

A ________ in a table represents a relationship among a set of values.

  • 1]

    Column

  • 2]

    Key

  • 3]

    Row

  • 4]

    Entry

Solution
111
Discuss
Select Record

The term _______ is used to refer to a row.

  • 1]

    Attribute

  • 2]

    Tuple

  • 3]

    Field

  • 4]

    Instance

Solution
112
Discuss
Select Record

The term attribute refers to a ___________ of a table.

  • 1]

    Record

  • 2]

    Column

  • 3]

    Tuple

  • 4]

    Key

Solution
113
Discuss
Select Record

For each attribute of a relation, there is a set of permitted values, called the ________ of that attribute.

  • 1]

    Domain

  • 2]

    Relation

  • 3]

    Set

  • 4]

    Schema

Solution
114
Discuss
Select Record

Database __________ which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time.

  • 1]

    Instance, Schema

  • 2]

    Relation, Schema

  • 3]

    Relation, Domain

  • 4]

    Schema, Instance

Solution
115
Discuss
Select Record

Course(course_id,sec_id,semester)

Here the course_id,sec_id and semester are __________ and course is a _________

  • 1]

    Relations, Attribute

  • 2]

    Attributes, Relation

  • 3]

    Tuple, Relation

  • 4]

    Tuple, Attributes

Solution
116
Discuss
Select Record

Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary)
Here the dept_name attribute appears in both the relations. Here using common attributes in relation schema is one way of relating ___________ relations.

  • 1]

    Attributes of common

  • 2]

    Tuple of common

  • 3]

    Tuple of distinct

  • 4]

    Attributes of distinct

Solution
117
Discuss
Select Record

A domain is atomic if elements of the domain are considered to be ____________ units.

  • 1]

    Different

  • 2]

    Indivisbile

  • 3]

    Constant

  • 4]

    Divisible

Solution
118
Discuss
Select Record

The tuples of the relations can be of ________ order.

  • 1]

    Any

  • 2]

    Same

  • 3]

    Sorted

  • 4]

    Constant

Solution
119
Discuss
Select Record

The _________ provides a set of operations that take one or more relations as input and return a relation as an output.

  • 1]

    Schematic representation

  • 2]

    Relational algebra

  • 3]

    Scheme diagram

  • 4]

    Relation flow

Solution
120
Discuss
Select Record

A ________ is a pictorial depiction of the schema of a database that shows the relations in the database, their attributes, and primary keys and foreign keys.

  • 1]

    Schema diagram

  • 2]

    Relational algebra

  • 3]

    Database diagram

  • 4]

    Schema flow

Solution
121
Discuss
Select Record

The _______ operator takes the results of two queries and returns only rows that appear in both result sets.

  • 1]

    Union

  • 2]

    Intersect

  • 3]

    Difference

  • 4]

    Projection

Solution
122
Discuss
Select Record

The most commonly used operation in relational algebra for projecting a set of tuple from a relation is

  • 1]

    Join

  • 2]

    Projection

  • 3]

    Select

  • 4]

    Union

Solution
123
Discuss
Select Record

The _______operation performs a set union of two “similarly structured” tables

  • 1]

    Union

  • 2]

    Join

  • 3]

    Product

  • 4]

    Intersect

Solution
124
Discuss
Select Record

The result which the operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match.

  • 1]

    Join

  • 2]

    Cartesian product

  • 3]

    Intersection

  • 4]

    Set difference

Solution
125
Discuss
Select Record

The_____ operation allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple.

  • 1]

    Select

  • 2]

    Join

  • 3]

    Union

  • 4]

    Intersection

Solution
126
Discuss
Select Record

Which one of the following is procedural language?

  • 1]

    Domain relational calculus

  • 2]

    Tuple relational calculus

  • 3]

    Relational algebra

  • 4]

    Query language

Solution
127
Discuss
Select Record

Student(ID, name, dept name, tot_cred)
In this query which attributes form the primary key?

  • 1]

    Name

  • 2]

    Dept

  • 3]

    Tot_cred

  • 4]

    ID

Solution
128
Discuss
Select Record

Using which language can a user request information from a database?

  • 1]

    Query

  • 2]

    Relational

  • 3]

    Structural

  • 4]

    Compiler

Solution
129
Discuss
Select Record
SELECT name ____ instructor name, course id
FROM instructor, teaches
WHERE instructor.ID= teaches.ID;

Which keyword must be used here to rename the field name?

  • 1]

    From

  • 2]

    Rename

  • 3]

    As

  • 4]

    Join

Solution
130
Discuss
Select Record
SELECT * FROM employee WHERE dept_name="Comp Sci";

In the SQL given above there is an error . Identify the error.

  • 1]

    Dept_name

  • 2]

    Employee

  • 3]

    “Comp Sci”

  • 4]

    From

Solution
131
Discuss
Select Record
SELECT emp_name
FROM department
WHERE dept_name LIKE ’ _____ Computer Science’;

Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its ending string?

  • 1]

    %

  • 2]

    _

  • 3]

    ||

  • 4]

    $

Solution
132
Discuss
Select Record

’_____’ matches any string of ______ three characters. ’_____%’ matches any string of at ______ three characters.

  • 1]

    Atleast, Exactly

  • 2]

    Exactly, Atleast

  • 3]

    Atleast, All

  • 4]

    All, Exactly

Solution
133
Discuss
Select Record
SELECT name
FROM instructor
WHERE dept name = ’Physics’
ORDER BY name;

By default, the order by clause lists items in ______ order.

  • 1]

    Descending

  • 2]

    Any

  • 3]

    Same

  • 4]

    Ascending

Solution
134
Discuss
Select Record
SELECT *
FROM instructor
ORDER BY salary ____, name ___;

To display the salary from greater to smaller and name in ascending order which of the following options should be used?

  • 1]

    Ascending, Descending

  • 2]

    Asc, Desc

  • 3]

    Desc, Asc

  • 4]

    Descending, Ascending

Solution
135
Discuss
Select Record
SELECT name
FROM instructor
WHERE salary <= 100000 AND salary >= 90000;

This query can be replaced by which of the following ?

  • 1]
    SELECT name
    FROM instructor
    WHERE salary BETWEEN 90000 AND 100000;

     

  • 2]
    SELECT name
    FROM employee
    WHERE salary <= 90000 AND salary>=100000;

     

  • 3]
    SELECT name
    FROM employee
    WHERE salary BETWEEN 90000 AND 100000;

     

  • 4]
    SELECT name
    FROM instructor
    WHERE salary BETWEEN 100000 AND 90000;

     

Solution
136
Discuss
Select Record
SELECT instructor.*
FROM instructor, teaches
WHERE instructor.ID= teaches.ID;

This query does which of the following operation?

  • 1]

    All attributes of instructor and teaches are selected

  • 2]

    All attributes of instructor are selected on the given condition

  • 3]

    All attributes of teaches are selected on given condition

  • 4]

    Only the some attributes from instructed and teaches are selected

Solution
137
Discuss
Select Record

In SQL the spaces at the end of the string are removed by _______ function.

  • 1]

    Upper

  • 2]

    String

  • 3]

    Trim

  • 4]

    Lower

Solution
138
Discuss
Select Record

_____ operator is used for appending two strings.

  • 1]

    &

  • 2]

    %

  • 3]

    ||

  • 4]

    _

Solution
139
Discuss
Select - Count

Which SQL function is used to count the total number of rows in a SQL query?

  • 1]

    SUM()

  • 2]

    COUNT()

  • 3]

    AVG()

  • 4]

    COUNT(*)

Solution

COUNT(*) is used to count the total no. of row including null.

140
Discuss
Select - Average

Aggregate functions are functions that take a ___________ as input and return a single value.

  • 1]

    Collection of values

  • 2]

    Single value

  • 3]

    Aggregate value

  • 4]

    Both Collection of values & Single value

Solution
141
Discuss
Select - Average
SELECT __________
FROM instructor
WHERE dept name= ’Comp. Sci.’;

Which of the following should be used to find the mean of the salary ?

  • 1]

    Mean(salary)

  • 2]

    Avg(salary)

  • 3]

    Sum(salary)

  • 4]

    Count(salary)

Solution
142
Discuss
Select - Average
SELECT COUNT (____ ID)
FROM teaches
WHERE semester = ’Spring’ AND YEAR = 2010;

If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.

  • 1]

    Distinct

  • 2]

    Count

  • 3]

    Avg

  • 4]

    Primary key

Solution
143
Discuss
Select - Average

All aggregate functions except _____ ignore null values in their input collection.

  • 1]

    Count(attribute)

  • 2]

    Count(*)

  • 3]

    Avg

  • 4]

    Sum

Solution
144
Discuss
Select - Average

A Boolean data type that can take values true, false, and________

  • 1]

    1

  • 2]

    0

  • 3]

    Null

  • 4]

    Unknown

Solution
145
Discuss
Select - Average

The ____ connective tests for set membership, where the set is a collection of values produced by a select clause. The ____ connective tests for the absence of set membership.

  • 1]

    Or, in

  • 2]

    Not in, in

  • 3]

    In, not in

  • 4]

    In, or

Solution
146
Discuss
Select - Average

Which of the following should be used to find all the courses taught in the Fall 2009 semester but not in the Spring 2010 semester.

  • 1]
    SELECT DISTINCT course id
    FROM SECTION
    WHERE semester = ’Fall’ AND YEAR= 2009 AND
    course id NOT IN (SELECT course id
    FROM SECTION
    WHERE semester = ’Spring’ AND YEAR= 2010);

     

  • 2]
    SELECT DISTINCT course_id
    FROM instructor
    WHERE name NOT IN (’Fall’, ’Spring’);

     

  • 3]
    (SELECT course id
    FROM SECTION
    WHERE semester = ’Spring’ AND YEAR= 2010)

     

  • 4]
    SELECT COUNT (DISTINCT ID)
    FROM takes
    WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
    FROM teaches
    WHERE teaches.ID= 10101);

     

Solution
147
Discuss
Select - Average

The phrase “greater than at least one” is represented in SQL by _____

  • 1]

    < all

  • 2]

    < some

  • 3]

    > all

  • 4]

    > some

Solution
148
Discuss
Select - Average

Which of the following is used to find all courses taught in both the Fall 2009 semester and in the Spring 2010 semester .

  • 1]
    SELECT course id
    FROM SECTION AS S
    WHERE semester = ’Fall’ AND YEAR= 2009 AND
    EXISTS (SELECT *
    FROM SECTION AS T
    WHERE semester = ’Spring’ AND YEAR= 2010 AND
    S.course id= T.course id);

     

  • 2]
    SELECT name
    FROM instructor
    WHERE salary > SOME (SELECT salary
    FROM instructor
    WHERE dept name = ’Biology’);

     

  • 3]
    SELECT COUNT (DISTINCT ID)
    FROM takes
    WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR
    FROM teaches
    WHERE teaches.ID= 10101);

     

  • 4]
    (SELECT course id
    FROM SECTION
    WHERE semester = ’Spring’ AND YEAR= 2010)

     

Solution
149
Discuss
Select - Average

We can test for the nonexistence of tuples in a subquery by using the _____ construct.

  • 1]

    Not exist

  • 2]

    Not exists

  • 3]

    Exists

  • 4]

    Exist

Solution
150
Discuss
And Operator

The union operation is represented by

  • 1]

  • 2]

    U

  • 3]

    -

  • 4]

    *

Solution
151
Discuss
And Operator

The intersection operator is used to get the _____ tuples.

  • 1]

    Different

  • 2]

    Common

  • 3]

    All

  • 4]

    Repeating

Solution
152
Discuss
And Operator

The union operation automatically __________ unlike the select clause.

  • 1]

    Adds tuples

  • 2]

    Eliminates unique tuples

  • 3]

    Adds common tuples

  • 4]

    Eliminates duplicate

Solution
153
Discuss
And Operator

If we want to retain all duplicates, we must write ________ in place of union.

  • 1]

    Union all

  • 2]

    Union some

  • 3]

    Intersect all

  • 4]

    Intersect some

Solution
154
Discuss
And Operator
(SELECT course id
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009)
EXCEPT
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);

This query display

  • 1]

    Only tuples from second part

  • 2]

    Only tuples from the first part which has the tuples from second part

  • 3]

    Tuples from both the parts

  • 4]

    Tuples from first part which do not have second part

Solution
155
Discuss
And Operator

For like predicate which of the following is true.

i) % matches zero OF more characters.
ii) _ matches exactly one CHARACTER.

 

  • 1]

    i-only

  • 2]

    ii-only

  • 3]

    i & ii

  • 4]

    None of the mentioned

Solution
156
Discuss
And Operator

The number of attributes in relation is called as its

  • 1]

    Cardinality

  • 2]

    Degree

  • 3]

    Tuples

  • 4]

    Entity

Solution
157
Discuss
And Operator

_____ clause is an additional filter that is applied to the result.

  • 1]

    Select

  • 2]

    Group-by

  • 3]

    Having

  • 4]

    Order by

Solution
158
Discuss
And Operator

_________ joins are SQL server default

  • 1]

    Outer

  • 2]

    Inner

  • 3]

    Equi

  • 4]

    None of the mentioned

Solution
159
Discuss
And Operator

The _____________ is essentially used to search for patterns in target string.

  • 1]

    Like Predicate

  • 2]

    Null Predicate

  • 3]

    In Predicate

  • 4]

    Out Predicate

Solution
160
Discuss
In Clause
SELECT dept_name, ID, avg (salary)
FROM instructor
GROUP BY dept_name;
This statement IS erroneous because

 

  • 1]

    Avg(salary) should not be selected

  • 2]

    Dept_id should not be used in group by clause

  • 3]

    Misplaced group by clause

  • 4]

    Group by clause is not valid in this query

Solution
161
Discuss
In Clause

SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions may be used.

  • 1]

    Group by

  • 2]

    With

  • 3]

    Where

  • 4]

    Having

Solution
162
Discuss
In Clause

Aggregate functions can be used in the select list or the_______clause of a select statement or subquery. They cannot be used in a ______ clause.

  • 1]

    Where, having

  • 2]

    Having, where

  • 3]

    Group by, having

  • 4]

    Group by, where

Solution
163
Discuss
In Clause

The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.

  • 1]

    In

  • 2]

    Lateral

  • 3]

    Having

  • 4]

    With

Solution
164
Discuss
In Clause

Which of the following creates a temporary relation for the query on which it is defined?

  • 1]

    With

  • 2]

    From

  • 3]

    Where

  • 4]

    Select

Solution
165
Discuss
In Clause

In the query given above which one of the following is a temporary relation?

WITH max_budget (VALUE) AS
(SELECT MAX(budget)
FROM department)
SELECT budget
FROM department, max_budget
WHERE department.budget = MAX budget.value;

 

  • 1]

    Budget

  • 2]

    Department

  • 3]

    Value

  • 4]

    Max_budget

Solution
166
Discuss
In Clause

Subqueries cannot:

  • 1]

    Use group by or group functions

  • 2]

    Retrieve data from a table different from the one in the outer query

  • 3]

    Join tables

  • 4]

    Appear in select, update, delete, insert statements.

Solution
167
Discuss
In Clause

Which of the following is not an aggregate function?

  • 1]

    Avg

  • 2]

    Sum

  • 3]

    With

  • 4]

    Min

Solution
168
Discuss
In Clause

The EXISTS keyword will be true if:

  • 1]

    Any row in the subquery meets the condition only

  • 2]

    All rows in the subquery fail the condition only

  • 3]

    Both of these two conditions are met

  • 4]

    Neither of these two conditions is met

Solution
169
Discuss
In Clause

How can you find rows that do not match some specified condition?

  • 1]

    EXISTS

  • 2]

    Double use of NOT EXISTS

  • 3]

    NOT EXISTS

  • 4]

    None of the mentioned

Solution
170
Discuss
Joins and its type

The____condition allows a general predicate over the relations being joined.

  • 1]

    On

  • 2]

    Using

  • 3]

    Set

  • 4]

    Where

Solution
171
Discuss
Joins and its type

Which of the join operations do not preserve non-matched tuples?

  • 1]

    Left outer join

  • 2]

    Right outer join

  • 3]

    Inner join

  • 4]

    Natural join

Solution
172
Discuss
Joins and its type
SELECT * FROM student JOIN takes USING (ID);

The above query is equivalent to

  • 1]
    SELECT *
    FROM student INNER JOIN takes USING (ID);

     

  • 2]
    SELECT *
    FROM student OUTER JOIN takes USING (ID);

     

  • 3]
    SELECT *
    FROM student LEFT OUTER JOIN takes USING (ID);

     

  • 4]

    None of the mentioned

Solution
173
Discuss
Joins and its type

What type of join is needed when you wish to include rows that do not have matching values?

  • 1]

    Equi-join

  • 2]

    Natural join

  • 3]

    Outer join

  • 4]

    All of the mentioned

Solution
174
Discuss
Joins and its type

How many tables may be included with a join?

  • 1]

    One

  • 2]

    Two

  • 3]

    Three

  • 4]

    All of the mentioned

Solution
175
Discuss
Joins and its type

Which are the join types in join condition:

  • 1]

    Cross join

  • 2]

    Natural join

  • 3]

    Join with USING clause

  • 4]

    All of the mentioned

Solution
176
Discuss
Joins and its type

How many join types in join condition:

  • 1]

    2

  • 2]

    3

  • 3]

    4

  • 4]

    5

Solution
177
Discuss
Joins and its type

Which join refers to join records from the right table that have no matching key in the left table are include in the result set:

  • 1]

    Left outer join

  • 2]

    Right outer join

  • 3]

    Full outer join

  • 4]

    Half outer join

Solution
178
Discuss
Joins and its type

The operation which is not considered a basic operation of relational algebra is

  • 1]

    Join

  • 2]

    Selection

  • 3]

    Union

  • 4]

    Cross product

Solution
179
Discuss
Joins and its type

In SQL the statement select * from R, S is equivalent to

  • 1]

    Select * from R natural join S

  • 2]

    Select * from R cross join S

  • 3]

    Select * from R union join S

  • 4]

    Select * from R inner join

Solution
180
Discuss
Cross Join

The default extension for an Oracle SQL*Plus file is:

  • 1]

    .txt

  • 2]

    .ora

  • 3]

    .pls

  • 4]

    .sql

Solution
181
Discuss
Cross Join

Triggers __________ enabled or disabled.

  • 1]

    Cannot be

  • 2]

    Can be

  • 3]

    Ought to be

  • 4]

    Always

Solution
182
Discuss
Cross Join

To include integrity constraint in a existing relation use :

  • 1]

    Create table

  • 2]

    Alter table

  • 3]

    Modify table

  • 4]

    Any of the above

Solution
183
Discuss
Cross Join

A _________ is a stored program that is attached to a table or a view.

  • 1]

    pseudofile

  • 2]

    trigger

  • 3]

    embedded SELECT statement

  • 4]

    None of the above is correct.

Solution
184
Discuss
Cross Join

The DROP TABLE statement:

  • 1]

    deletes the table structure only

  • 2]

    deletes the table structure along with the table data

  • 3]

    works whether or not referential integrity constraints would be violated

  • 4]

    is not an SQL statement

Solution
185
Discuss
Cross Join

SQL views can be used to hide

  • 1]

    columns and rows only

  • 2]

    complicated SQL syntax only

  • 3]

    both of the above can be hidden by an SQL view

  • 4]

    None of the above is correct

Solution
186
Discuss
Cross Join

The SQL statement to create a view is

  • 1]

    CREATE VIEW

  • 2]

    MAKE VIEW

  • 3]

    SELECT VIEW

  • 4]

    INSERT VIEW

Solution
187
Discuss
Cross Join

To update an SQL view, the DBMS must be able to associate the column(s) to be updated with

  • 1]

    a particular column in a particular underlying table

  • 2]

    a particular column in a particular row

  • 3]

    a particular row in a particular underlying table

  • 4]

    None of the above is correct

Solution
188
Discuss
Cross Join

Which of the following is NOT a type of SQL constraint?

  • 1]

    PRIMARY KEY

  • 2]

    ALTERNATE KEY

  • 3]

    UNIQUE

  • 4]

    FOREIGN KEY

Solution
189
Discuss
Cross Join

A _________ is a program that performs some common action on database data and that is stored in the database

  • 1]

    trigger

  • 2]

    stored procedure

  • 3]

    pseudofile

  • 4]

    None of the above

Solution
190
Discuss
Cross Join

For what purposes are views used?

  • 1]

    To hide columns only

  • 2]

    To hide rows only

  • 3]

    To hide complicated SQL statements only

  • 4]

    All of the above

Solution
191
Discuss
Cross Join

What is an SQL virtual table that is constructed from other tables?

  • 1]

    Just another table

  • 2]

    View

  • 3]

    Relation

  • 4]

    Query results

Solution
192
Discuss
Cross Join

When using the SQL INSERT statement

  • 1]

    rows can be modified according to criteria only

  • 2]

    rows cannot be copied in mass from one table to another only

  • 3]

    rows can be inserted into a table only one at a time only

  • 4]

    rows can either be inserted into a table one at a time or in groups

Solution
193
Discuss
Primary Key

To include integrity constraint in an existing relation use :

  • 1]

    Create table

  • 2]

    Modify table

  • 3]

    Alter table

  • 4]

    Any of the above

Solution
194
Discuss
Primary Key

Which of the following is not an integrity constraint?

  • 1]

    Not null

  • 2]

    Positive

  • 3]

    Unique

  • 4]

    Check ‘predicate’

Solution
195
Discuss
Primary Key

Which of the following is the right syntax for assertion?

  • 1]

    Create assertion 'assertion-name' check 'predicate';

  • 2]

    Create assertion check 'predicate' 'assertion-name';

  • 3]

    Create assertions 'predicates';

  • 4]

    All of the mentioned

Solution
196
Discuss
Primary Key

Which of the following can be addressed by enforcing a referential integrity constraint?

  • 1]

    All phone numbers must include the area code

  • 2]

    Certain fields are required (such as the email address, or phone number) before the record is accepted

  • 3]

    Information on the customer must be known before anything can be sold to that custome

  • 4]

    When entering an order quantity, the user must input a number and not some text (i.e., 12 rather than ‘a dozen’)

Solution
197
Discuss
Primary Key

Drop Table cannot be used to drop a table referenced by a _________ constraint.

  • 1]

    Local Key

  • 2]

    Primary Key

  • 3]

    Composite Key

  • 4]

    Foreign Key

Solution
198
Discuss
Primary Key

____________ is preferred method for enforcing data integrity.

  • 1]

    Constraints

  • 2]

    Stored Procedure

  • 3]

    Triggers

  • 4]

    Cursors

Solution
199
Discuss
Primary Key
CREATE TABLE Employee(Empid NUMERIC NOT NULL, Name VARCHAR(20) , dept_name VARCHAR(20), Salary NUMERIC UNIQUE(Empid,Name));
INSERT INTO Employee VALUES(1002, Ross, CSE, 10000)
INSERT INTO Employee VALUES(1006,Ted,Finance, );
INSERT INTO Employee VALUES(1002,Rita,Sales,20000);

What will be the result of the query?

  • 1]

    All statements executed

  • 2]

    Error in create a statement

  • 3]

    Error in insert into Employee values(1006,Ted,Finance, );

  • 4]

    Error in insert into Employee values(1008,Ross,Sales,20000);

Solution
200
Discuss
Primary Key

In order to ensure that the value of the budget is non-negative which of the following should be used? 

CREATE TABLE Manager(ID NUMERIC,Name VARCHAR(20),budget NUMERIC,Details VARCHAR(30));

 

  • 1]

    Check(budget>0)

  • 2]

    Check(budget<0)

  • 3]

    Alter(budget>0)

  • 4]

    Alter(budget<0)

Solution
201
Discuss
Primary Key

A foreign key is the one in which the ________ of one relation is referenced in another relation.

  • 1]

    Foreign key

  • 2]

    Primary key

  • 3]

    References

  • 4]

    Check constraint

Solution
202
Discuss
Primary Key

Which of the following is used to delete the entries in the referenced table when the tuple is deleted in the course table?

CREATE TABLE course
( ...
FOREIGN KEY (dept name) REFERENCES department
... );

 

  • 1]

    Delete

  • 2]

    Delete cascade

  • 3]

    Set null

  • 4]

    All of the mentioned

Solution
203
Discuss
Primary Key

Domain constraints, functional dependency and referential integrity are special forms of  _______

  • 1]

    Foreign key

  • 2]

    Primary key

  • 3]

    Assertion

  • 4]

    Referential constraint

Solution
204
Discuss
Primary Key

Which of the following is the right syntax for the assertion?

  • 1]

    Create assertion ‘assertion-name’ check ‘predicate’;

  • 2]

    Create assertion check ‘predicate’ ‘assertion-name’;

  • 3]

    Create assertions ‘predicates’;

  • 4]

    All of the mentioned

Solution
205
Discuss
Primary Key

Data integrity constraints are used to

  • 1]

    Control who is allowed access to the data

  • 2]

    Ensure that duplicate records are not entered into the table

  • 3]

    Improve the quality of data entered for a specific property (i.e., table column)

  • 4]

    Prevent users from changing the values stored in the table

Solution
206
Discuss
Not Null Constraint

A _____ indicates an absent value that may exist but be unknown or that may not exist at all.

  • 1]

    Empty tuple

  • 2]

    New value

  • 3]

    Null value

  • 4]

    Old value

Solution
207
Discuss
Not Null Constraint

If the attribute phone number is included in the relation all the values need not be entered into the phone number column. This type of entry is given as

  • 1]

    0

  • 2]

    -

  • 3]

    Null

  • 4]

    Empty space

Solution
208
Discuss
Not Null Constraint

The predicate in a where clause can involve Boolean operations such as and. The result of true and unknown is_______ false and unknown is _____ while unknown and unknown is _____

  • 1]

    Unknown, unknown, false

  • 2]

    True, false, unknown

  • 3]

    True, unknown, unknown

  • 4]

    Unknown, false, unknown

Solution
209
Discuss
Not Null Constraint
SELECT name
FROM instructor
WHERE salary IS NOT NULL;
Selects
  • 1]

    Tuples with null value

  • 2]

    Tuples with no null values

  • 3]

    Tuples with any salary

  • 4]

    All of the mentioned

Solution
210
Discuss
Not Null Constraint

In an employee table to include the attributes whose value always have some value which of the following constraint must be used?

  • 1]

    Null

  • 2]

    Not null

  • 3]

    Unique

  • 4]

    Distinct

Solution
211
Discuss
Not Null Constraint

Using the ______ clause retains only one copy of such identical tuples.

  • 1]

    Null

  • 2]

    Unique

  • 3]

    Not null

  • 4]

    Distinct

Solution
212
Discuss
Not Null Constraint
CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);
INSERT INTO employee VALUES (1005,Rach,0);
INSERT INTO employee VALUES (1007,Ross, );
INSERT INTO employee VALUES (1002,Joey,335);

Some of these insert statements will produce an error. Identify the statement.

  • 1]

    Insert into employee values (1005,Rach,0)

  • 2]

    Insert into employee values (1002,Joey,335);

  • 3]

    Insert into employee values (1007,Ross, );

  • 4]

    None of the mentioned

Solution
213
Discuss
Not Null Constraint

The primary key must be

  • 1]

    Unique

  • 2]

    Not null

  • 3]

    Both Unique and Not null

  • 4]

    Either Unique or Not null

Solution
214
Discuss
Not Null Constraint

You attempt to query the database with this command:

 SELECT nvl (100 / quantity, NONE)
 FROM inventory;

Why does this statement cause an error when QUANTITY values are null?

  • 1]

    The expression attempts to divide by a null value

  • 2]

    The data types in the conversion function are incompatible

  • 3]

    The character string none should be enclosed in single quotes (‘ ‘)

  • 4]

    A null value used in an expression cannot be converted to an actual value

Solution
215
Discuss
Not Null Constraint

The result of _____unknown is unknown.

  • 1]

    Xor

  • 2]

    Or

  • 3]

    And

  • 4]

    Not

Solution
216
Discuss
Delete Table

Which of the following is used to access the database server at the time of executing the program and get the data from the server accordingly?

  • 1]

    Embedded SQL

  • 2]

    Dynamic SQL

  • 3]

    SQL declarations

  • 4]

    SQL data analysis

Solution
217
Discuss
Delete Table

If DBA modify the structure of the data record then this modification do not affect other application is called as _____________.

  • 1]

    Data Independence

  • 2]

    Data Integrity

  • 3]

    Data Isolation

  • 4]

    Data Security

Solution
218
Discuss
Delete Table

Collection of information stored in database at particular instance of time is called as __________.

  • 1]

    Data Structure

  • 2]

    Database Schema

  • 3]

    Instance of Database

  • 4]

    Objects in Database

Solution
219
Discuss
Delete Table

Overall design of the database is called as _________.

  • 1]

    Database Instance

  • 2]

    Database Abstraction

  • 3]

    Database Schema

  • 4]

    None of these

Solution
220
Discuss
Delete Table

__________ is collection of operations that performs a single logical function in database application.

  • 1]

    Interaction

  • 2]

    Operation

  • 3]

    Transaction

  • 4]

    None of these

Solution
221
Discuss
Delete Table

Database Manager Performs following query related operation

  • 1]

    Drop Table

  • 2]

    Creating Schema

  • 3]

    Retrieving Record

  • 4]

    Creating View

Solution
222
Discuss
Delete Table

User which interact with the system using database query language is called as ___________

  • 1]

    Application Programmer

  • 2]

    Sophisticated User

  • 3]

    Naive User

  • 4]

    Specialized User

Solution
223
Discuss
Delete Table

Which of the user write programs in the host language and embed the DML statements into it?

  • 1]

    Specialized User

  • 2]

    Sophisticated User

  • 3]

    Application Programmer

  • 4]

    Naive User

Solution
224
Discuss
Delete Table

Database Manager is also known as _________

  • 1]

    Sophisticated User

  • 2]

    System Manager

  • 3]

    Application Programmer

  • 4]

    Storage Manager

Solution
225
Discuss
Delete Table

Granting and Authorization for data access is provided by _____________

  • 1]

    DBA

  • 2]

    Application Developer

  • 3]

    Storage Manager

  • 4]

    Database Manager

Solution
226
Discuss
Delete Table

Duty of Database manager is to enforce integrity and _________ checks.

  • 1]

    Complexity

  • 2]

    Security

  • 3]

    Multiplicity

  • 4]

    None of these

Solution
227
Discuss
Delete Table

Farmer goes to ATM Center to withdraw an amount of Rs.300/-. Which type of user farmer is?

  • 1]

    Unsophisticated User

  • 2]

    Sophisticated User

  • 3]

    Application Programmer

  • 4]

    Specialized User

Solution
228
Discuss
Delete Table

Schema Definition is written by ___________.

  • 1]

    Application Programmer

  • 2]

    Naive User

  • 3]

    Database Administrator

  • 4]

    Sophisticated user

Solution
229
Discuss
Delete Table

Person A is Java Developer interacts with Person D to understand the complete database schema
written by him.
Person B knows the database Schema and he is able to hit complex queries.
Unlike Person B, Person C does not use traditional database processing frameworks.
Who among the 4 users will be called as Sophisticated User.

  • 1]

    Person B

  • 2]

    Person A

  • 3]

    Person C

  • 4]

    Person D

Solution
230
Discuss
Delete Table

An extranet is which of the following?

  • 1]

    The use of Internet protocols with limited access to company data by the company's customers and suppliers.

  • 2]

    The use of Internet protocols with unlimited access to company data by the company's customers and suppliers.

  • 3]

    The use of Internet protocols with limited access to company data by people within an organization.

  • 4]

    The use of Internet protocols with unlimited access to company data by people within an organization.

Solution
231
Discuss
Delete Table

Data administrators are responsible for

  • 1]

    physical database design

  • 2]

    managing technical issues in the database environment

  • 3]

    overall management of data resources in an organization

  • 4]

    writing application programs

Solution
232
Discuss
Delete Table

Some advantages of the database approach include all, but

  • 1]

    minimal data redundancy

  • 2]

    improved data consistency

  • 3]

    improved data sharing

  • 4]

    program-data dependency

Solution
233
Discuss
Delete Table

Which of the following types of databases are the most common?

  • 1]

    Personal

  • 2]

    Workgroup

  • 3]

    Department

  • 4]

    Enterprise

Solution
234
Discuss
Delete Table

Duplicate data often results in loss of data integrity because

  • 1]

    the data formats may be inconsistent

  • 2]

    data values may not agree

  • 3]

    Both A & B

  • 4]

    Neither A & B

Solution
235
Discuss
Delete Table

Metadata enables database designers and users to do all of the following except

  • 1]

    sample data

  • 2]

    understand what data exist

  • 3]

    what the fine distinctions are between similar data items

  • 4]

    what the data mean

Solution
236
Discuss
Delete Table

Structured data may include which of the following?

  • 1]

    Photo image

  • 2]

    Video clip

  • 3]

    Dates

  • 4]

    None of the above

Solution
237
Discuss
Create View

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

  • 1]

    Function

  • 2]

    View

  • 3]

    Procedure

  • 4]

    None of the mentioned

Solution
238
Discuss
Create View

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

  • 1]

    Create view v as “query name”;

  • 2]

    Create “query expression” as view;

  • 3]

    Create view v as “query expression”;

  • 4]

    Create view “query expression”;

Solution
239
Discuss
Create View
SELECT course_id
FROM physics_fall_2009
WHERE building= ’Watson’;

Here the tuples are selected from the view.Which one denotes the view.

  • 1]

    Course_id

  • 2]

    Watson

  • 3]

    Building

  • 4]

    physics_fall_2009

Solution
240
Discuss
Create View

Materialized views make sure that

  • 1]

    View definition is kept stable

  • 2]

    View definition is kept up-to-date

  • 3]

    View definition is verified for error

  • 4]

    View is deleted after specified time

Solution
241
Discuss
Create View

Updating the value of the view

  • 1]

    Will affect the relation from which it is defined

  • 2]

    Will not change the view definition

  • 3]

    Will not affect the relation from which it is defined

  • 4]

    Cannot determine

Solution
242
Discuss
Create View

SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on the view) if which of the following conditions are satisfied by the query defining the view?

  • 1]

    The from clause has only one database relation

  • 2]

    The query does not have a group by or having clause

  • 3]

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

  • 4]

    All of the mentioned

Solution
243
Discuss
Create View

Which of the following is used at the end of the view to reject the tuples which do not satisfy the condition in where clause?

  • 1]

    With

  • 2]

    Check

  • 3]

    With check

  • 4]

    All of the mentioned

Solution
244
Discuss
Create View

Consider the two relations instructor and department
Instructor:

ID Name Dept_name Salary
1001 Ted Finance 10000
1002 Bob Music 20000
1003 Ron Physics 50000

Department:

Dept_name Building Budget
Biology Watson 40000
Chemistry Painter 30000
Music Taylor 50000

 

Which of the following is used to create view for these relations together?

  • 1]
    CREATE VIEW instructor_info AS
    SELECT ID, name, building
    FROM instructor, department
    WHERE instructor.dept name= department.dept name;

     

  • 2]
    CREATE VIEW instructor_info 
    SELECT ID, name, building
    FROM instructor, department;

     

  • 3]
    CREATE VIEW instructor_info AS
    SELECT ID, name, building
    FROM instructor;

     

  • 4]
    CREATE VIEW instructor_info AS
    SELECT ID, name, building
    FROM department;

     

Solution
245
Discuss
Create View

For the view Create view instructor_info as

SELECT ID, name, building
FROM instructor, department
WHERE instructor.dept name= department.dept name;

If we insert tuple into the view as insert into instructor info values (’69987’, ’White’, ’Taylor’);
What will be the values of the other attributes in instructor and department relations?

  • 1]

    Default value

  • 2]

    Null

  • 3]

    Error statement

  • 4]

    0

Solution
246
Discuss
Create View

Find the error in this query. 

CREATE VIEW faculty AS
SELECT ID, name, dept name
FROM instructor;

 

  • 1]

    Instructor

  • 2]

    Select

  • 3]

    View …as

  • 4]

    None of the mentioned

Solution
247
Discuss
Delete View

A _________ consists of a sequence of query and/or update statements.

  • 1]

    Transaction

  • 2]

    Commit

  • 3]

    Rollback

  • 4]

    Flashback

Solution
248
Discuss
Delete View

Which of the following makes the transaction permanent in the database?

  • 1]

    View

  • 2]

    Commit

  • 3]

    Rollback

  • 4]

    Flashback

Solution
249
Discuss
Delete View

In order to undo the work of transaction after last commit which one should be used?

  • 1]

    View

  • 2]

    Commit

  • 3]

    Rollback

  • 4]

    Flashback

Solution
250
Discuss
Delete View

Consider the following action:

TRANSACTION.....
Commit;
ROLLBACK;

What does Rollback do?

  • 1]

    Undoes the transactions before commit

  • 2]

    Clears all transactions

  • 3]

    Redoes the transactions before commit

  • 4]

    No action

Solution
251
Discuss
Delete View

In case of any shut down during transaction before commit which of the following statement is done automatically?

  • 1]

    View

  • 2]

    Commit

  • 3]

    Rollback

  • 4]

    Flashback

Solution
252
Discuss
Delete View

In order to maintain the consistency during transactions, database provides

  • 1]

    Commit

  • 2]

    Atomic

  • 3]

    Flashback

  • 4]

    Retain

Solution
253
Discuss
Delete View

Transaction processing is associated with everything below except

  • 1]

    Conforming an action or triggering a response

  • 2]

    Producing detail summary or exception report

  • 3]

    Recording a business activity

  • 4]

    Maintaining a data

Solution
254
Discuss
Delete View

A transaction completes its execution is said to be

  • 1]

    Committed

  • 2]

    Aborted

  • 3]

    Rolled back

  • 4]

    Failed

Solution
255
Discuss
Delete View

Which of the following is used to get back all the transactions back after rollback?

  • 1]

    Commit

  • 2]

    Rollback

  • 3]

    Flashback

  • 4]

    Redo

Solution
256
Discuss
Delete View

______ will undo all statements up to commit?

  • 1]

    Transaction

  • 2]

    Flashback

  • 3]

    Rollback

  • 4]

    Abort

Solution
# Quiz