Database Interview Questions
- 0of 0 votes
AnswersEMP (empno, name, deptno, salary)
- Anil December 23, 2012 in United States for AWS
DEPT (deptno, name)
Write a SQL query that tells me the average salary by department name.| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Database - 0of 0 votes
AnswersHow to improve query performance?
- Survivor November 20, 2012 in United States| Report Duplicate | Flag | PURGE
Overstock.com Software Engineer / Developer Database - 0of 0 votes
AnswersWhat are different isolation level?
- Survivor November 20, 2012 in United States| Report Duplicate | Flag | PURGE
Qualcomm Applications Developer Database - 0of 0 votes
AnswersTable: persons id first_name last_name favorite_ride_id
Table: rides id name
Write a query that will return the names and votes for the top 10 most popular rides in order from most to least popular.
- anonymouse September 18, 2012 in United States| Report Duplicate | Flag | PURGE
SignPost Software Engineer / Developer Database - 0of 0 votes
AnswersHow will you provide security to DB?
- kaustubh deshmukh September 18, 2012 in India| Report Duplicate | Flag | PURGE
Symantec Associate Database - 0of 0 votes
AnswersHow will you search efficiently in DB?
- kaustubh deshmukh September 18, 2012 in India| Report Duplicate | Flag | PURGE
Symantec Associate Database - 0of 0 votes
AnswersHow to Achieve atomicity in Database given you are a database designer
- Moiz Arsiwala August 29, 2012 in India| Report Duplicate | Flag | PURGE
MAQ Applications Developer Database - 0of 0 votes
Answersif you have 10 records in table , you run query and got answer and next day data is inserted into table it becomes 12 records now i want to operation on only updated records (means 11th and 12 th records )
- sonia upadhaya August 22, 2012 in United States| Report Duplicate | Flag | PURGE
Database - 0of 0 votes
AnswersYou have a database table Emp with data as follows:
- kavitha July 31, 2012 in United States
EmpId FirstName LastName
1 Bob Lync
2 Sarah John
3 Bob Lync
4 John Doe
5 Stanly Jeff
6 Sarah John
With a single sql query, how will you cleanup the database (eliminate redundant data from above table)| Report Duplicate | Flag | PURGE
Adobe Software Engineer in Test Database - 2of 2 votes
AnswersYou have one table with a single column having three values a,b and c.
- Black Stallion July 26, 2012 in India
Current snapshot of the table is
Table :- tblTest
Values :-
tblColumn
a
a
a
b
b
b
b
c
c
We need and output in SQL Server in the format:-
Acount BCount CCount
3 4 2
Do not use temporarytable/variables/multiple queries in a single query.
Values are restricted to be a, b and c only but the count may vary and output will change accordingly.| Report Duplicate | Flag | PURGE
Oracle Applications Developer Database - 0of 0 votes
Answerswhat is the difference between IN , ANY and ALL in oracle?
- cobra July 22, 2012 in India
can anyone explain with an example?| Report Duplicate | Flag | PURGE
Database - 1of 1 vote
AnswersQuestion Number 1
- sushilk.1991 July 19, 2012 in India
Consider a table "Student" consisting of columns (Student ID, Student Address, Course).
Every student is allowed to enroll in multiple courses and every course is allowed to enroll more than one student. Also every time a student changes address, all his relevant records must be changed to reflect the new address.
What would be the Normal form required to avoid this redundancy?
2nd NF
4th NF
3rd NF
1st NF| Report Duplicate | Flag | PURGE
Oracle Database - 0of 0 votes
AnswersSystem that can have 10K requests in a second. We need to save only the number of queries in a table. After 5 year user may want to see 5 years old history. user may want to see monthly history, history per yer, or per minute, per second(zoom in, zoom out). How would you design database.
- kamoliddin June 21, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Database - 0of 0 votes
AnswersHow do we decide which column we should partition on and which column to index on
- AD April 18, 2012 in United States| Report Duplicate | Flag | PURGE
Database - 0of 0 votes
AnswersTable TEAM( TEAM_ID, TEAM_NAME).
- AD April 18, 2012 in United States
This table has all the football team names.
Say entries are
1 France
2 Germany
3 Spain
Write a SQL to generate match Fixtures between the teams. No hard coding. No repeation.
Sample out put will be
C1 C2
France Germany
France Spain
Spain Germany| Report Duplicate | Flag | PURGE
Database - -1of 1 vote
AnswersWhat is the SQL statement to query two tables at once?
- apple-maybe? April 08, 2012 in United States for Data Mining| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Database - 0of 0 votes
AnswersWhat is Inner Join, Left outer join. What is a view
- axoaxo March 26, 2012 in United States| Report Duplicate | Flag | PURGE
Citigroup Analyst Database - 0of 0 votes
AnswersWrite a sql query to select duplicates in a Table.
- axoaxo March 26, 2012 in United States| Report Duplicate | Flag | PURGE
Citigroup Analyst Database - 0of 0 votes
Answerswhat is normalization
- jdicky March 22, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Database - 0of 0 votes
Answercreate a database schema for...
- zkolhz March 06, 2012 in United States
an application that tracks a bunch of users. the application has a list of races and users can sign up to run for races.
the application also keeps track of if the user has completed their race
give me queries for the following use cases:
1. all the users in the app
2. all the races that a user has signed up for
3. all the races that a user has finished racing
4. all the races that a has signed up for but not raced (meaning they signed up for a race but the race is over and they didn't run in it)
5. find the races that any two users share| Report Duplicate | Flag | PURGE
Software Engineer / Developer Database - 0of 0 votes
AnswersA student is very fond of linux and likes Linux Words a lot. A Linux Word is a word that consists of only the letters L, I, N, U, and X in that exact relative order. There must be exactly one L, exactly one I, one or more Ns, exactly one U and exactly one X. Case does not matter. For example, "Linux", "Linnnux" are Linux Words, whereas "Llinux", "Linuxx" are not.
- srcrocks123 February 03, 2012 in India
You are given a String Word which you must turn into a Linux Word. For each character in word, you can either replace it with a different letter or leave it unchanged. No other operations, like inserting new characters or deleting existing characters, are allowed. Print the minimal number of characters you must replace to get a Linux Word. If it's impossible, return -1.
Input Format
First line will be the number of testcases N, the following N lines will contain N words without any space.
Output Format
N lines printing the desired output.
Example
Input
4
Linux
LinnnnnUx
LNux
Codecrackers
Output
0
0
-1
12| Report Duplicate | Flag | PURGE
Software Engineer / Developer Database - 0of 0 votes
AnswersSeveral Sql Queries.
- priyankajaggi4 January 24, 2012 in India
eg. relation student -> Student Name| Subject 1| Subject 2| Subject 3 | Subject 4 | Subject 5|
Q- Now find all those students whose subjects are DS or Networking.| Report Duplicate | Flag | PURGE
Yatra.com Software Engineer / Developer Database - 0of 0 votes
AnswersThe columns that I get in a table after a clustering process is not specific but varies from 150 to 210. I need to get the column name that has the max value for each row and add that column name to a target column..
- amruth.s@flipkart.com January 17, 2012 in India
Schema looks like this
cluster_name ---> varchar(20)
col1 ----> decimal
col2 ----> decimal
...
coln ----> decimal
The result of the query should look like this
cluster_name -----> varchar(20)
col_name(that had the max value for that row)------> varchar(20)
col_max(max value across all columns for that row)-------->decimal
should use only mysql query..| Report Duplicate | Flag | PURGE
Flipkart Developer Program Engineer Database - 0of 0 votes
AnswersYou have two relation variables: RelV1 and RelV2. They are NOT necessarily distinct. You
- jarvisalbert January 04, 2012 in India
have a set K as a key for RelV1. Consider that FK is a subset of the heading of RelV2 that
involves exactly the same attributes as K.
From the following options, select the option that correctly depicts a scenario where FK can be
considered as a foreign key.
-Every tuple in RelV1 has a K value that is equal to the FK value in some tuple in RelV2
-Every tuple in RelV1 has a FK value that is equal to the K value in some tuple in RelV2
-Every tuple in RelV2 has a K value that is equal to the FK value in some tuple in RelV1
-Every tuple in RelV2 has a FK value that is equal to the K value in some tuple in RelV1| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Database - 0of 0 votes
AnswersSelect the option that correctly describes the database replication concept where two or more
- jarvisalbert January 04, 2012 in India
replicas synchronize each other through a transaction identifier.
-Quorum
-Multimasterslave
-Master-Slave
-Multimaster| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Database - 0of 0 votes
Answers(MYSQL question)
- Jason Fried January 04, 2012 in United States
I need to compare 2 columns in a table and give 3 things:
1. Count of rows checked.
2. Count of rows matching.
3. Count of rows different.
I've been able to get just rows matching using a join on itself, but I'm unsure how to get the others all at once. The importance of getting all of the information at the same time is because this is a very active table and the data changes with great frequency.| Report Duplicate | Flag | PURGE
Database - 0of 0 votes
AnswersWhat is the disadvantage of normalization ?
- lipun4u December 03, 2011 in India
Why can't we follow normalization always ?| Report Duplicate | Flag | PURGE
Manhattan associates Developer Program Engineer Database - 0of 0 votes
AnswerDifference between MYISAM and NoDB Mysql
- anshulzunke September 08, 2011 in India| Report Duplicate | Flag | PURGE
Urban Touch Software Engineer / Developer Database - 0of 0 votes
Answersresult of this:
- me August 07, 2011select * from A, B;
| Report Duplicate | Flag | PURGE
Database - 0of 0 votes
Answerswhat is triggering in sql
- b.srinivas July 29, 2011| Report Duplicate | Flag | PURGE
Symantec Technical Support Engineer Database