Homechevron_rightEngineeringchevron_rightRPSC Programmerchevron_rightProgrammer DBMSchevron_rightDBMS ALL

DBMS ALL MCQs

  • 1. Which of the following command is used to add attributes to an existing relation?
  • filter_dramaExplanation
    Answer is : D

    The alter table command to add attributes to an existing relation. All tuples in the relation are assigned null as the value for the new attribute. The form of the alter table command is

    alter table r add A D;

    where r is the name of an existing relation, A is the name of the attribute to be added, and D is the type of the added attribute.
  • 2. Assume that AB → C, C  → D and D → A are simultaneously satisfied by a relation r(R). What are the candidate keys of this relation?
  • filter_dramaExplanation
    Answer is : C

    If closure defined the complete relation then become the candidate key.

    • Closure of AB =  (AB)+ = {A,B,C,D}         //candidate key
    • Closure of BC =  (BC)+ = {A,B,C,D}        //candidate key
    • Closure of CD = (CD)+ = {C,D,A} 
    • Closure of DB = (DB)+= {B,C,D,A}         //candidate key
    • Closure of ABCD = (ABCD)+= {A,B,C,D}    //super key
    • Closure of AD = (AD)+ = {A,B,D}

    The candidate keys are AB. BC, BD

  • 3. Which of the following PL/SQL component stores data?
  • filter_dramaExplanation
    Answer is : C

    PL/SQL block has the actual PL/SQL code.

    PL/SQL engine is the component where the actual processing of the codes takes place.

    Database server is the most important component of Pl/SQL unit which stores the data.
  • 4.

    Given an instance of the EMPLOYEES relation as shown below:

    E_ID

    E_Name

    E_Age

    E_Mail

    Salary_in_Lakhs

    XE005

    Nitesh

    24

    nitestSE@123

    9

    XE010

    Vishnu

    27

    vishnu.MG@123

    10

    XE007

    Arya

    23

    arya.TET@07

    8

    XE003

    Satya

    28

    satyaME@01

    11

    XE023

    Nitesh

    24

    nitestCE@123

    R

    XE012

    Vipul

    24

    vipul@321

    9.5

     

    For this instance (E_Name, Salary_in_Lakhs) is the primary key, the value R should not be equal to _____

  • filter_dramaExplanation
    Answer is : C

    (E_Name, Salary_in_Lakhs) is the key

    (E_Name, Salary_in_Lakhs) → {E_ID, E_Age, E_mail}

    E_Name: Nitesh is repeated

    Check only for Nitesh

    (Nitesh, 9) → (XE005, 24, nitestSE@123)

    (Nitesh, R) → (XE023, 24, nitestCE@123)

    Since right hand side is not same

    Therefore, R cannot be equal to 9

    If R is equal to 9 then (E_Name, Salary_in_Lakhs) is not a key.
  • 5.

    Consider the following statements regarding database normal forms:

    1. Any relation with two attributes is BCNF.

    2. Lossless, dependency - preserving decomposition into BCNF is always possible.

    3. Lossless, dependency - preserving decomposition into 3NF is always possible.

    4. BCNF is stricter than 3NF.

    Which of the above statements are correct?
  • filter_dramaExplanation
    Answer is : B

    Statement 1: Correct

    Any relation with two attributes will always in BCNF

    Example:

    Relation R = {x, y} non trivial FD’s of this relation is x - > y and y - > x and these both FD’s are in BCNF so this statement is true.

    Statement 2: Incorrect

     It is not always possible to decompose a table in BCNF and preserve FD’s and lossless decomposition will always be possible in BCNF.

    Example:

    XY - > Z and Z - > Y cannot be decomposed in BCNF

    Statement 3: Correct

    Lossless, dependency - preserving decomposition into 3NF is always possible this statement is true.

    Statement 4: correct

    BCNF is stricter form of normalization than 3NF because it eliminates the second condition of 3NF.

    Hence option 2 is the correct answer.
  • 6.

    Which of the following objects is/are contained in database?

  • filter_dramaExplanation
    Answer is : D

    The correct answer is All of these

    Key Points

    • Any piece of information can be referred to as a data and the place where this data is stored in a way that it is easily accessible and can also be modified whenever required is known as a Database.
    • DBMS is actually a tool or collection of programs that enable us to perform any kind of operation on data stored in a database. Database Management System allows you to store, modify, and extract information whenever required. It comprises of 4 essential components namely -
    1. User: A user may be of any kind like a DB administrator, system developer, and an end-user.
    2. Database Applications: It may be a departmental, personal computer, or an enterprise.
    3. DBMS: software that allows us to manage the data stored in the database.
    4. Database.

    Additional Information​ 

    • A database object is any defined object in a database that is used to store or reference data. Some examples of database objects include tables, views, clusters, sequences, indexes, and synonyms. The table is this hour's focus because it is the primary and simplest form of data storage in a relational database.
  • 7. Which of the following operators cannot be used in between main query and subquery:
  • filter_dramaExplanation
    Answer is : A

    The following operators cannot be used in between main query and subquery:

    • BETWEEN and NOT BETWEEN operator
    • LIKE and NOT LIKE operator
    • IS NULL and IS NOT NULL operator
  • 8.

    Consider a relation R(ABCDE) and the primary key is A E. In the given relational schema which of the following is not a superkey?

  • filter_dramaExplanation
    Answer is : C

    Concept:

    A superkey is a set of attributes within a table whose values can be used to uniquely identify a tuple. A candidate key is a minimal superkey.

    A superkey is a superset of candidate key or primary key.

    Explanation:

    Primary key is AE. (given)

    All superkeys must contain this primary key AE. From the given keys, key, which doesn’t contain

    the AE.

    Here, option 3: DACB

    “DACB” doesn’t contain the primary key AE. So, it is not a superkey.
  • 9. Which is the reverse process of Specialization?
  • filter_dramaExplanation
    Answer is : A

    Generalization is a abstracting process of viewing sets of objects as a single general class by concentrating on the general characteristics of the constituent sets while suppressing or ignoring their differences.In simple terms, Generalization is a process of extracting common characteristics from two or more classes and combining them into a generalized superclass. So, it is a bottom up approach as two or more lower lever entities are combined to form a higher level entity.

    Specialization may be seen as the reverse process of Generalization. Specialization is the abstracting process of introducing new characteristics to an existing class of objects to create one or more new classes of objects.In simple terms, a group of entities in specialization can be categorized into sub - groups based on their characteristics. So it is a top - down approach in which one higher level entity can be broken down into two lower level entity. It defines one or more subtypes of the supertypes and forming supertype/subtype relationships.

  • 10. Point out the correct statement. ?
  • filter_dramaExplanation
    Answer is : D

    The correct option is (4)

    Explanation:- 

    • Documents can contain many different key-value pairs, or key-array pairs, or even nested documents, because of these advantages, document databases are general-purpose databases that can be used in a variety of use cases and industries.
    • When compared to relational databases, NoSQL databases are more scalable and provide superior performance. Most SQL databases are vertically scalable, Which means that you can increase the load on a single server by increasing components like RAM, SSD, or CPU.
    • NoSQL databases are horizontally scalable, which means that they can handle increased traffic simply by adding more servers to the database.
    • MongoDB has official drivers for a variety of popular programming languages and development environments. Language supported by MongoDB: js, Perl, PHP, Python, Ruby, Scala, Go, and Erlang.
    • MongoDB is written in C++, JavaScript, Python programming languages.
leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points