Questions tagged [interview-question]

Good questions for interviews - should be open-ended with a number of possible answers, of which the best (or least-worst) depending on the situation, available resources, project requirements, etc, is the best one.

Good questions for interviews - should be open-ended with a number of possible answers, of which the best (or least-worst) depending on the situation, available resources, project requirements, etc, is the best one. The questions should be either ones you would ask, or ones you have been asked.

16 questions
18
votes
2 answers

Interview SQL question

Given a table 'employees' employee_id | salary | department_id -------------+--------+--------------- Only using SQL find all the variants of employee-transfers from one department to another, so that average salary in both 'departure' and…
Alexander
  • 343
  • 2
  • 6
16
votes
2 answers

What is a Clustered Index?

I need a short explaining of clustered index. What is a clustered index? What are best practices for using the clustered index?
Amir Rezaei
  • 643
  • 1
  • 7
  • 13
13
votes
3 answers

I Want to Become a Database Administrator - How Can I Start?

I just took a database course in my college and found it fascinating. I want to learn more in this field, but I feel a bit lost with how to start. How do I become a database administrator? What are some tips and tricks to get into the career field?…
user30622
  • 131
  • 1
  • 1
  • 3
11
votes
2 answers

Efficient way to join two tables with one to many relationship

This is interview question asked to me in interview and i was not able to answer. Please help.. What is the most efficient way to join two table with one to many relationship between them
user3678399
  • 113
  • 1
  • 1
  • 4
10
votes
4 answers

What should I ask at a MySQL DBA interview?

I am a software developer and am helping my team hire a MySQL DBA. The core challenges that we are facing are: Slower queries and performance due to Hibernate. Database management (backups, tuning, patches, security). Scalability due to increase in…
geoaxis
  • 1,807
  • 2
  • 13
  • 11
8
votes
6 answers

How can I display twice each stored row without using UNION ALL or a temporary table?

The relevant table, named emp, holds the following data: CREATE TEMPORARY TABLE emp AS SELECT * FROM ( VALUES (1,'A'), (2,'B'), (3,'C') ); ID Name -- ---- 1 A 2 B 3 C And the output or result-set of the data manipulation operation…
Anup
  • 89
  • 1
  • 1
  • 2
7
votes
1 answer

How do I write a query that places passengers on buses if there is capacity?

Buses and passengers arrive at a station. If a bus arrives at the station at a time tbus and a passenger arrives at a time tpassenger where tpassenger <= tbus, then the passenger will attempt to use the first available bus whose capacity has not…
Rishav Ghosh
  • 183
  • 9
6
votes
8 answers

What is Atomic Relation in First Normal Form

I have read the definition of 1NF which is, "If each attribute of relation is atomic". Please tell me what is Atomic.
Siddiqui
  • 171
  • 1
  • 1
  • 5
2
votes
3 answers

Recovering a lost datafile with no backup available

How do you recover a lost datafile if: the database is running in archivelog mode there is no backup is available
Javed Sayed
  • 41
  • 2
  • 5
2
votes
1 answer

Recovering from the loss of datafile in NOARCHIVELOG mode?

How do you recover from the loss of datafile if the database is running in NOARCHIVELOG mode?
Javed Sayed
  • 41
  • 2
  • 5
2
votes
1 answer

Performing SQL string manipulations on a single column

I recently came across a problem at an interview which I wasn't able to answer. The ask was to write some SQL fetch the first three number(s) after crossing two 2 decimals. For example: Input table: IP…
2
votes
1 answer

Recover Oracle database after drive loss Interview Question

How would you answer this as an interview question? The database crashed and you lost a drive containing one of your control files and another drive containing an entire redo log group. You have a level 0 backup from yesterday morning, a…
Leigh Riffel
  • 23,884
  • 17
  • 80
  • 155
2
votes
1 answer

Troubleshoot corruption in SQL Server Database

I have been asked by my interviewer "How do you troubleshoot corrupted data in SQL in SQL Server 2012?"
1
vote
0 answers

Disable the Task action button

How can I disable the "Tasks ->" button in SQL Server Management Studio? I need to prevent users scripting objects.
0
votes
1 answer

List population of provices (SQL Query)

I was asked this question in an interview and I could not get my mind around it, and now it is bothering me a lot! If you have a table CANADA(PROVINCE, CITY, POPULATION). - Population is correlated with the population of one city. - There are…
1
2