Sybase Quiz :: 2

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Nbans
N
Nbans
Community Contributor
Quizzes Created: 4 | Total Attempts: 7,077
Questions: 10 | Attempts: 412

SettingsSettingsSettings
Software Quizzes & Trivia

Sybase SQL , T-SQL Quiz


Questions and Answers
  • 1. 

    Which SQL command is used to extract data from tables?

    • A.

      EXTRACT

    • B.

      SELECT

    • C.

      FIND

    • D.

      None of above

    Correct Answer
    B. SELECT
    Explanation
    The SELECT command is used in SQL to extract data from tables. It allows you to specify the columns you want to retrieve and apply filters or conditions to narrow down the results. This command is fundamental in retrieving specific data from a database and is widely used in querying and analyzing data. The other options, EXTRACT and FIND, are not SQL commands used for extracting data from tables.

    Rate this question:

  • 2. 

    Which SQL keyword is used to sort the result set?

    • A.

      ORDER

    • B.

      SORT

    • C.

      ORDER BY

    • D.

      SORT BY

    Correct Answer
    C. ORDER BY
    Explanation
    The SQL keyword used to sort the result set is "ORDER BY". This keyword is followed by the column or columns that you want to sort the result set by. It arranges the rows in ascending or descending order based on the specified column(s).

    Rate this question:

  • 3. 

    The AND operator displays a record if ANY of the conditions listed are true.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The AND operator displays a record if ALL of the conditions listed are true, not just any of them.

    Rate this question:

  • 4. 

    Stored procedures can be execute on remote Adaptive Servers.

    • A.

      YES

    • B.

      NO

    Correct Answer
    A. YES
    Explanation
    Stored procedures can be executed on remote Adaptive Servers. This means that a stored procedure, which is a set of pre-compiled SQL statements, can be run on a different server from where it is stored. This allows for greater flexibility and scalability in managing and executing database operations. By enabling the execution of stored procedures on remote servers, organizations can distribute their workload and resources more effectively, improving overall performance and efficiency.

    Rate this question:

  • 5. 

    In Create stored procedure, the Parameter names can be a maximum of 30 bytes long, including the @ sign.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In the context of creating a stored procedure, the parameter names can have a maximum length of 30 bytes, which includes the "@" sign. This means that the names assigned to the parameters within the stored procedure cannot exceed this limit. Therefore, the statement is true.

    Rate this question:

  • 6. 

    Which of the following command will be used for execute a Stored procedure? A) exec procedure_name B) execute procedure_name C) procedure_name

    • A.

      A and B

    • B.

      Only A

    • C.

      Only B

    • D.

      All A, B and C

    Correct Answer
    D. All A, B and C
    Explanation
    The correct answer is All A, B and C. This is because all three options (A, B, and C) can be used to execute a stored procedure. The "exec" and "execute" keywords are both valid ways to execute a stored procedure in SQL, and in some cases, the procedure name can be executed directly without using any keyword. Therefore, all three options are correct.

    Rate this question:

  • 7. 

    Count(*) returns the total number of non-NULL values in the column.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because count(*) actually returns the total number of rows in a table, regardless of whether the values in the column are NULL or not. If you want to count only the non-NULL values in a column, you should use count(column_name) instead.

    Rate this question:

  • 8. 

    Assume that today's is monday and today's date is 11 apr 2011. Result of the following query: select datename(dw,getdate())

    • A.

      11 apr 2011 monday

    • B.

      11 apr 2011

    • C.

      Monday

    • D.

      Error

    Correct Answer
    C. Monday
    Explanation
    The query "select datename(dw,getdate())" is asking for the name of the day of the week for the current date. Since today is Monday, the result of the query is "monday".

    Rate this question:

  • 9. 

    Assume that today's is monday and today's date is 11 apr 2011. Result of the following query: select datepart(dw,getdate())

    • A.

      Monday

    • B.

      Apr

    • C.

      11

    • D.

      2

    Correct Answer
    D. 2
    Explanation
    The query "select datepart(dw,getdate())" is used to retrieve the day of the week for the current date. In this case, the current date is April 11, 2011, which falls on a Monday. The datepart(dw) function returns the day of the week as a number, where Sunday is represented by 1 and Saturday is represented by 7. Therefore, the result of the query is 2, indicating that it is Monday.

    Rate this question:

  • 10. 

    We can define primary key and foreign key on views.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Primary keys and foreign keys can be defined on tables to establish relationships between them. However, it is not possible to define primary keys and foreign keys directly on views. Views are virtual tables that are generated based on the underlying tables and do not have their own physical storage. Therefore, primary keys and foreign keys can only be defined on the actual tables, not on views.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 16, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 10, 2011
    Quiz Created by
    Nbans
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.