Microsoft SQL Server Quiz For Beginners!

10 Questions | Total Attempts: 782

SettingsSettingsSettings
Please wait...
SQL Server Quizzes & Trivia

SQL Server is a Relational Database Management system(DBMS) software which is developed by Microsoft and offers a wide variety of transaction processing, business intelligence and analytics applications. This quiz has been designed to test your basic SQL skills and is targetted at software developers who are required to work on SQL. So, let's try out the quiz. All the best!


Related Topics
Questions and Answers
  • 1. 
    You are designing for a large grocery store chain. The partial database schema is shown in the Partial Database Schema Exhibit. The script that was used to create the Customers table is shown in the Script for Customers Table Exhibit. The store managers want to track customer demographics so they can target advertisements and coupon promotions to customers. These advertisements and promotions will be based on the past purchases of existing customers. The advertisements and promotions will target buying patterns by one or more of these demographics: gender, age, postal code, and region. Most of the promotions will be based on gender and age. Queries will be used to retrieve the customer demographics information. You want the query response time to be as fast as possible. What should you do?
    • A. 

      Add indexes on the PostalCode, State, and DateOfBirth columns of the Customers table.

    • B. 

      Denormalize the Customers table

    • C. 

      Create a view on the Customers, SalesLineItem, State, and Product tables.

    • D. 

      Create a function to return the required data from the Customers table.

  • 2. 
    Which of the following is a proprietary extension of SQL for Microsoft SQL Server?
    • A. 

      PL-SQL

    • B. 

      T-SQL

    • C. 

      PG-SQL

    • D. 

      P-SQL

  • 3. 
    Applications that can generate Transact-SQL can be :
    • A. 

      General office productivity applications

    • B. 

      Applications that use a graphical user interface (GUI) to let users select the tables and columns from which they want to see data

    • C. 

      Applications that use general language sentences to determine what data a user wants to see

    • D. 

      All of the mentioned

  • 4. 
    Which of the following is not a SERVICE BROKER statement?
    • A. 

      BEGIN CONVERSATION TIMER

    • B. 

      END CONVERSATION

    • C. 

      CREATE USERS

    • D. 

      None of the mentioned

  • 5. 
    Purpose of GET_TRANSMISSION_STATUS is :
    • A. 

      Returns the status for the first transmission for end side of a conversation

    • B. 

      Returns the status for the first transmission for one side of a conversation

    • C. 

      Returns the status for the last transmission for end side of a conversation

    • D. 

      Returns the status for the last transmission for one side of a conversation

  • 6. 
    Point out the correct statement :
    • A. 

      T-SQL is SQL language for SYBASE

    • B. 

      GET_TRANSMISSION_STATUS does provide information for messages that do not have a conversation endpoint in the current instance

    • C. 

      CREATE USER transfers a securable between schemas

    • D. 

      CREATE LOGIN modifies the login details

  • 7. 
    Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
    • A. 

      P and R

    • B. 

      P and S

    • C. 

      Q and R

    • D. 

      Q and S

  • 8. 
    Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X=1, Y=1) is inserted in the table. Let MX and My denote the respective maximum values of X and Y among all records in the table at any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values of MX and MY change. What will be the output of the following SQL query after the steps mentioned above are carried out?
    • A. 

      127

    • B. 

      255

    • C. 

      129

    • D. 

      257

  • 9. 
    Consider the table employee(empId, name, department, salary) and the two queries Q1, Q2 below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements is TRUE for any arbitrary employee table? Q1 : Select e.empId      From employee e      Where not exists         (Select * From employee s where s.department = “5” and                                          s.salary >=e.salary) Q2 : Select e.empId      From employee e      Where e.salary > Any     (Select distinct salary From employee s Where s.department = “5”)
    • A. 

      Q1 is the correct query

    • B. 

      Q2 is the correct query

    • C. 

      Both Q1 and Q2 produce the same answer

    • D. 

      Neither Q1 nor Q2 is the correct query

  • 10. 
    S1: A foreign key declaration can always          be replaced by an equivalent check         the assertion in SQL.     S2: Given the table R(a,b,c) where a and         b together form the primary key, the          following is a valid table definition.         CREATE TABLE S (             an INTEGER,             d INTEGER,             e INTEGER,             PRIMARY KEY (d),             FOREIGN KEY (a) references R) 
    • A. 

      S1 is TRUE and S2 is FALSE.

    • B. 

      Both S1 and S2 are TRUE.

    • C. 

      S1 is FALSE and S2 is TRUE

    • D. 

      Both S1 and S2 are FALSE