Quiz Discussion

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

Course Name: SQL -Structured Query Language

  • 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
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

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
2
Discuss

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
3
Discuss

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
4
Discuss

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
5
Discuss

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

  • 1]

    Function

  • 2]

    View

  • 3]

    Procedure

  • 4]

    None of the mentioned

Solution
6
Discuss

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
7
Discuss

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
8
Discuss
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
9
Discuss

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
# Quiz