alternative
  • Home (current)
  • About
  • Tutorial
    Technologies
    C#
    Deep Learning
    Statistics for AIML
    Natural Language Processing
    Machine Learning
    SQL -Structured Query Language
    Python
    Ethical Hacking
    Placement Preparation
    Quantitative Aptitude
    View All Tutorial
  • Quiz
    C#
    SQL -Structured Query Language
    Quantitative Aptitude
    Java
    View All Quiz Course
  • Q & A
    C#
    Quantitative Aptitude
    Java
    View All Q & A course
  • Programs
  • Articles
    Identity And Access Management
    Artificial Intelligence & Machine Learning Project
    How to publish your local website on github pages with a custom domain name?
    How to download and install Xampp on Window Operating System ?
    How To Download And Install MySql Workbench
    How to install Pycharm ?
    How to install Python ?
    How to download and install Visual Studio IDE taking an example of C# (C Sharp)
    View All Post
  • Tools
    Program Compiler
    Sql Compiler
    Replace Multiple Text
    Meta Data From Multiple Url
  • Contact
  • User
    Login
    Register

SQL -Structured Query Language - SQL Table - Alter - Add Column Quiz

#Quiz
1
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
2
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
3
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
4
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
5
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
6
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
7
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
#Quiz
Showing 1 to 7 of 7 entries
  • Previous
  • 1
  • Next
SQL -Structured Query Language

SQL -Structured Query Language

  • Introduction
  • Overview
    • How To Download And Install MySql Workbench
    • SQL Syntax
  • SQL Database
    • Create Database
    • Drop Database
    • Use / Select Database
  • SQL Table
    • Create Table
    • Alter - Rename Table
    • Alter - Add Column
    • Alter - Modify Column
    • Alter - Rename Column
    • Alter - Drop Column
    • Copy Table
    • Drop Table
  • SQL Insert
    • Insert Record
  • Sql Update
    • Update Record
  • Sql Select
    • Select Record
    • Select - Count
    • Select - Average
    • Select - Sum
    • Select - Min Max
    • Select - Distinct
    • Select - Limit
    • Select - First
    • Select - Last
  • Sql Clause
    • Like Clause
    • And Operator
    • Or Operator
    • Between & Not Between Operator
    • As or Alias
    • In Clause
    • Group By Clause
    • Having Clause
  • Sql Order By
    • Ascending
    • Descending
    • Random
    • Ascending Descending Multiple Column
  • SQL Joins
    • Joins and its type
    • Inner Join
    • Left Join
    • Right Join
    • Full Join
    • Cross Join
  • SQL View
    • Create View
    • Update View
    • Delete View
  • SQL Delete
    • Delete Table
    • Truncate Table
  • Sql Key & Constraint
    • Primary Key
    • Foreign Key
    • Unique Key
    • Not Null Constraint
    • Check Constraint
    • Default Constraint
  • Normalization
    • Overview
    • 1 NF
    • 2 NF
    • 3 NF
    • Boyce Codd normal form ( BCNF )

About Fresherbell

Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique

Important Links

Don't hesitate to give us a call or send us a contact form message

Terms & Conditions
Privacy Policy
Contact Us

Social Media

© Untitled. All rights reserved. Demo Images: Unsplash. Design: HTML5 UP.

Toggle