Select chapter



Basics (2.papers)
Data Types (2.papers)
Table-designing (1.papers)
Queries-Commands (3.papers)
String functions (2.papers)
Subqueries (1.papers)
Joins (1.papers)
Constraints (1.papers)
Triggers (1.papers)
Hide

Sponsored Links


  

sql basics interview questions and answers

1
what is SQL Server?
  1. SQL Server is a database which can store data.
  2. SQL Server is a DBMS software.
  3. SQL Server is a Relational data base management system.
  4. SQL Server is an editor or IDE used for writing queries.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
3
What is T-SQL?
  1. T-SQL is procedural language which is an extension of SQL  and is used in SQL Server.
  2. T-SQL is a structural language which is an extension of sql and is used in SQL Server.
  3. T-SQL is a programming language used in SQL Server.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
4
What is the difference between T-SQL and SQL?
  1. No difference.
  2. T-SQL is a procedural language and SQL is a structured language.
  3. SQL is a procedural language and T-SQL is a structured language.
  4. SQL is a language used in MYSQL and T-SQL is used in SQL Server. Both are extensions of PL/SQL language.
Show Answer
Share Facebook gmail Twitter
5
What is the difference between PL/SQL and T-SQL?
  1. PL/SQL language is used in oracle.
  2. T-SQL is used in SQL Server.
  3. PL/SQL and T-SQL are extensions of SQL language .
  4. All the options are correct.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
9
How to create a database in SQL Server?
  1. create database database-name()
  2. create database any-database-name
  3. Add database database-name
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
10
Which of the following files are usually created while creating a database in the hard disk?
  1. master data file & transaction log data file (with extensions .mdf and .ldf)
  2. database file and log file are created (with extensions .db and .ldf)
  3. only database file created with extension (.sql)
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
11
How to create a table in SQL Server (identify the correct syntax)?
  1. create tablename ( columnname data-type [size] [constraint] [null/not null] ,…...) 
    Note: items placed in square brackets are optional .
  2. create table table-name (columnname data-type[size] [constraint] [null/not null],….)
    Note: items placed in square brackets are optional .
  3. create table table-name()
  4. create table [databasename].tablename()
Show Answer
Share Facebook gmail Twitter
12
How to create a temporary table in sql server ( local temporary table ) ?
  1. Create table temp_tablename
    (
      col1 datatype [(size)] constraint ,
    col2 datatype [(size)] constraint
    )
  2. create table #tablename(
      columname1 datatype [(size)] constraint ,
    columname2 datatype [(size)] constraint 
    )
  3. create table ##tablename(
      columname1 datatype [(size)] constraint ,
    columname2 datatype [(size)] constraint 
    )
  4. None of the 
    above.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
How to create a global temporary tables in SQL Server?
  1. use globaltemp keyword before 
    table name .
  2. use hash [#] symbol before 
    table name.
  3. use double hash [##] 
    symbol before table name.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
15
What is the difference between local temporary table and global temporary table?
  1. There is no difference between local and global temporary tables.
  2. local temporary tables  are session specific and global temporary tables are common for all the sessions .
  3. Local temporary tables are destroyed immediately after closing the client session. But Global temporary tables are destroyed when all the client sessions are destroyed.
  4. Both second and third statements are correct.
Show Answer
Share Facebook gmail Twitter
16
How to declare a local variable in SQL(identify the correct syntax)?
  1. declare @variablename datatype[size];
  2. declare @@variablename datatype[size]
  3. datatype[size] @variablename=value;
  4. datatype[size] @variablename;
Show Answer
Share Facebook gmail Twitter
17
What is a global variable in sql ?
  1. A global variable is a variable which is having double [at] before variable name.
    For example in the following syntax the declared variable is global variable.
    declare @@variablename datatype[size] ; 
  2. There is no concept of global variables in SQL Server.
Show Answer
Share Facebook gmail Twitter
18
How to change default date format to dd-mm-yyyy format ?
  1. set dateformat dd-mm-yyyy
  2. set dateformat d-m-y
  3. set dateformat dmy
  4. set dateformat ymd
Show Answer
Share Facebook gmail Twitter
19
What is the use of use statement in SQL?
  1. use statement is used for selecting a table in SQL.
  2. use statement is used for selecting a database in SQL.
  3. use statement is used for selecting a view in SQL.
  4. use statement is used for using a built in function or built in stored procedure in SQL.
Show Answer
Share Facebook gmail Twitter
20
What is the use of a table variable?
  1. table variable is used as an alternative for temporary tables. Table is created using table variable.
    
  2. table variable acts as a normal table and is created in RAM memory and will be deleted after executing the scope in which it is declared.
  3. Both the options are 
    correct.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
Read more papers :