- Which of the following has the highest order of precedence?
- Functions and Parenthesis
- Multiplication, Division and Exponents
- Addition and Subtraction
- Logical Operations
- When designing a database table, how do you avoid missing column values for non-primary key columns?
- Use UNIQUE constraints
- Use PRIMARY KEY constraints
- Use DEFAULT and NOT NULL constraints
- Use FOREIGN KEY constraints
- Use SET constraints
- Which of the following is the syntax for creating an Index?
- CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
- CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
- CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
- CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
- Which of the following is not a valid character datatype in SQL Server?
- BLOB
- CHAR
- VARCHAR
- TEXT
- VARTEXT
- Which of the following statements about SQL Server comments is false?
- /* … */ are used for multiline comments
- // is used for single line comments
- – is used for single line comments
- Nested comments are allowed i.e. /* comment 1 /* comment 2 */ comment 1*/
- ‘ is used for single line comments
- Consider the following transaction code:
Begin Transaction Update names_table set employee_name = "Ramesh" where employee_name = "Mahesh" Save Transaction SAVE_POINT Update salaries set salary=salary + 900 where employee_job = "Engineer" Rollback transaction Commit transaction What will be the result produced by this transaction?
- “Ramesh” will be updated to “Mahesh”, but salaries of engineers will not be updated
- Neither “Ramesh” will be updated to “Mahesh”, nor the salary of engineers will be updated.
- “Ramesh” will be updated to “Mahesh” and salary of engineers will also be updated.
- Which of the following constraints can be used to enforce the uniqueness of rows in a table?
- DEFAULT and NOT NULL constraints
- FOREIGN KEY constraints
- PRIMARY KEY and UNIQUE constraints
- IDENTITY columns
- CHECK constraints
- Which of the following are not date parts?
- quarter
- dayofweek
- dayofyear
- weekday
- The IF UPDATE (column_name) parameter in a trigger definition will return TRUE in case of an INSERT statement being executed on the triggered table:
- Yes
- No
- It returns TRUE only if an UPDATE query is executed
- Both b and c
- Which one of the following must be specified in every DELETE statement?
- Table Name
- Database name
- LIMIT clause
- WHERE clause
- Column Names
- Which one of the following correctly selects rows from the table myTable that have null in column column1?
- SELECT * FROM myTable WHERE column1 is null
- SELECT * FROM myTable WHERE column1 = null
- SELECT * FROM myTable WHERE column1 EQUALS null
- SELECT * FROM myTable WHERE column1 NOT null
- SELECT * FROM myTable WHERE column1 CONTAINS null
- Is this statement true or false: A cursor is a pointer that identifies a specific working row within a set
- True
- False
- Which of the following commands is used to change the structure of table?
- CHANGE TABLE
- MODIFY TABLE
- ALTER TABLE
- UPDATE TABLE
-
Job Interview Question Articles
- C# Interview Questions and Answers
- QTP Interview Questions and Answers
- C++ Interview Questions and Answers
- PHP Interview Questions and Answers
- XML Interview Questions and Answers
- JavaScript Interview Questions and Answers
- Asp.Net Interview Questions and Answers
- J2EE Interview Questions and Answers
- ABAP Interview Questions and Answers
- Perl Interview Questions and Answers
- Java Interview Questions and Answers
-
Resources
- Technology Question and Answer Website
- How to dance around the salary-expectation question
- 10 mistakes managers make during job interviews
- ID Maker
- Stupid interview questions
- How to Answer These Tricky Interview Questions
- Seven tips for writing an online profile for LinkedIn, MySpace or Facebook
- Video surveillance
- Ink cartridges
- Laptop computers
- Affordable life insurance
- Ink cartridges
-
Tutorials
-
RSS Feeds

25 Comments on Database developer interview questions
2. When designing a database table, how do you avoid missing column values for non-primary key columns?
Use DEFAULT and NOT NULL constraints
3. Which of the following is the syntax for creating an Index?
CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
7. Which of the following constraints can be used to enforce the uniqueness of rows in a table?
PRIMARY KEY and UNIQUE constraints
10. Which one of the following must be specified in every DELETE statement?
Table Name
12. Is this statement true or false: A cursor is a pointer that identifies a specific working row within a set
True
13. Which of the following commands is used to change the structure of table?
ALTER TABLE
1. 2
4. 1
6. 2
8.1
11. 1
5. 3
if a cursor fetches a ‘null’ record, what value will we have for its respective %found? Will it return true or false?
What are the avantages of stored procedure over triggers?
Distinguish stored procedure and trigger?
how to make function return more than one value?
Difference between function and procedure?
Are triggers Precompiled?
What is the difference between Inner join and self join
Display Duplicate Values of a single Table?
For Q7:Primary key and unique constraints
For Q1:Functions and paranthesis
For Q8:Quarter
Dear All,
I feel nice after looking the simple but useful questions on SQL.
I have tried to solve these questions on my best level.. Some answers may be incorrect.. Please correct any ans is wrong.
Thnaks..
Baliram
1. Functions and Parenthesis
2. Use DEFAULT and NOT NULL constraints
3. CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
7. IDENTITY columns
8. quarter is not a date part
10. Table name must be specified in every DELETE statement.
11. ” SELECT * FROM myTable WHERE column1 is null ”
will selects rows from the table myTable that have null in column column1
12. True
13. ALTER TABLE command is used to change the structure of table
Q4. Text
#6,
Ans:
“Ramesh†will be updated to “Maheshâ€Â, but salaries of engineers will not be updated
please find the correct answers
Q.1 :- a
Q.2 :- c
Q.3 :- d
Q.4 :- e
Q.5 :- e
Q.6 :-a
Q.7 :- c
Q.8 :-a
Q.9 :- d
Q.10:-a
Q.11:-a
Q.12:-a
Q.13:-c
Answers:-
1 -> 1
2 -> 3
3 -> 3
4 -> 5
5 -> There are more thn one false statements in the question
6 -> 1 (The rollback will be done starting from the save point)
7 -> 3
8 -> 1
10 -> 1
11 -> 1
12 -> 1
13 -> 3
Question:-
Display Duplicate Values of a single Table?
Answer:-
The following SQL Command will display all the values which are stored more than once in the column COL1 in table TBL1
select COL1,count(COL1) as No_of_Times
from TBL1
group by COL1
having count(COL1)>1
If you want to check for the combination of more than one column then add the same in select clause and group clause.
Question:-
What is the difference between Inner join and self join?
Answer:-
Inner Join - With an inner join, column values from one row of a table are combined with column values from another row of another (or the same) table to form a single row of data based on join condition
Self Join - A self-join is a query in which a table is joined (compared) to itself. Self-joins are used to compare values in a column with other values in the same column in the same table
————-
2.(2 and 3);
———–
4.(4);
———-
—————
6 .(1);
—————–
7.(3)
—————–
10.(1)
—————————————
11–Which one of the following correctly selects rows from the table myTable that have null in column column1?
SELECT * FROM myTable WHERE column1 is null ..
———————————-
12 Is this statement true or false: A cursor is a pointer that identifies a specific working row within a set
ans true
———————————
13Which of the following commands is used to change the structure of table?
ans ALTER TABLE
Distinguish stored procedure and trigger?
ans the main Diffrence between is that the trriger is execute implicitly where as procudere is executed explicitly..
triger is fired on a particula event ..
like insert update delete
whereas Procuedure can be executed with or without event
1 -> 1
2 -> 3
3 -> 4
4 -> 5
5 -> 4,5
6 -> 2
7 -> 3
8 ->
9) -> 4
10 -> 1
11 -> 1
12 -> 2
13 -> 3
Q. 6 ans is –> 1
Q. 10 ans is –> a
1. Functions and Parenthesis
3. CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns
4. Blob
TEXT
VARTEXT
5. // is used for single line comments
– is used for single line comments
Nested comments are allowedi.e. /*comment 1 /* comment 2 */ comment 1*/