Interview Questions and Answers for 'Database' - 120 question(s) found - Order By Rating Q1. What is the main difference between unique key and primary key ? Database
Ans. Primary key will not accept NULL values whereas Unique key can accept one NULL value.
A table can have only primary key whereas there can be multiple unique key on a table.
A Clustered index automatically created when a primary key is defined whereas Unique key generates the non-clustered index. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Unique Key  Primary Key Asked in 1 Companies Q2. How would you design the database schema for an event? Database
Ans. Broad question, but if the company need velocity, think about use a NO SQL instead of regular SQL databases.
Also prefers materialized views instead of joins to fetch data quickly.
Regarding the database design, there are very good design tools for professional database (to develop proper indexes and good database design) one of the best is QuickDBD Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database design  database schema Asked in 1 Companies Q3. differences between drop , delete and truncate Database
This question was recently asked at 'HCL Technologies'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q4. What is a composite primary key and foreign key ? Database
Ans. The combination of values from multiple columns in the composite primary key must be unique for each row in the table.
A foreign key, on the other hand, is a field or set of fields in one table that refers to the primary key in another table. It establishes a relationship between two tables based on the values of the foreign key and the primary key. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q5. How can we increase the speed of SQL queries ? Database
Ans. Using -
1. Prepared Statements
2. Using Indices
3. Using whereby clause only on indexed columns Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q6. Explain Working of joins in sql. Database
This question was recently asked at 'InfoGain'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies This question was recently asked at 'Eurofins IT Solutions'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q8. Write SQL query to join 2 tables ? SQL
Ans. Select * from table1 join Select * from table2 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database Asked in 1 Companies Q9. Differences between MongoDB and mysql. Database
This question was recently asked at 'RiseSmart'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q10. Create DB schema for Employee, Department. Database
This question was recently asked at 'RiseSmart India,RiseSmart'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  db schema  database schema  database design Asked in 2 Companies Q11. Sort an Employee Object based on Name or Age Database
Ans. Use Comparable or Comparator interface Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql query Asked in 1 Companies Q12. What is the minimum number of tables required to perform a SQL join? Database
Ans. 1 , We can do self join
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql join Asked in 1 Companies Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws dynamodb  aws nosql database  amazon cloud nosql database Q14. Difference between composite , primary and unique key ? Database
This question was recently asked at 'Thomson reuters'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q15. create an SQL query across multiple tables involving outer joins Database
Ans. Select * from table1 t1Left outer join table2 t2 on t1.tid = t2.id Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql query  database  outer joins Asked in 2 Companies Ans. Compute Node Hours
Backup
Data Transfer Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws data warehouse  aws database  aws redshiftAns. Fast reads
Much more reads than writes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws dynamodb  aws nosql database  amazon cloud nosql databaseAns. 5 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws rds  aws database  amazon cloud database  aws rds  aws database  amazon cloud database read replicaAns. Multi AZ RDS is for disaster recovery and failover whereas Read replicas are for scaling. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws rds  aws database  amazon cloud database multi az  aws rds  aws database  amazon cloud database read replicaAns. Automated Backups are deleted automatically whereas Snapshots are preserved. Upon terminating RDS instance , AWS gives a warning about that and requests to create a final snapshot before terminating the instance. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws rds  aws database  amazon cloud database This question was recently asked at 'Cognizant (C?TS),Overstock'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws rds  aws database  amazon cloud database Asked in 2 Companies Q22. Difference between indexing and partioning Database
Ans. Creating an index creates a separate table. ... Indexes are used to speed the search of data within tables. Partitions provide segregation of the data at the hdfs level, creating sub-directories for each partition. Partitioning allows the number of files read and amount of data searched in a query to be limited Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  indexing  partitioning Asked in 3 Companies Q23. Have you heard of volatile Table in Teradata ? Teradata
Ans. If you create table with VOLATILE option, the life of the table will be only for the current session.
It will be automatically dropped by Teradata manager once session expires. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  teradata  database  volatile table Q24. Given an Employee Table with Salary Column, Find 2nd and 5th highest salary in a particular department. SQL
Ans. Select salary from (select salary from employee where department = order by salary desc limit 5) emp order by salary limit 1 AND Select salary from (select salary from employee where department = order by salary desc limit 2) emp2 order by salary limit 1 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql  database   find 2nd highest salary sql database Asked in 1 Companies Q25. Write SQL to get all members and the count of books they have checked out , even the ones that haven't checked out anything. SQL
This question was recently asked at 'Canopy Tax'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql Asked in 1 Companies Library Management System has always been the favorite question. This questions is asked irrespective of level. Q26. Write data models and service end points for Library Management System ? Architecture
Ans. Following could be the business sub domains or database schemas in such a system
1. Users / Members
2. Sourcing
3. Inventory Management
4. Operations
Following services end points could be there
1. Users - addNewUser ( put ), removeUser ( post )
2. Sourcing - addSupplier ( put ), removeSupplier ( post )
3. Inventory Management - getInventory ( get )
4. Operations - checkIn ( post ), checkout ( post )
There could be following Tables in Database
1. Users / Members - MEMBER, MEMBERSHIP_TYPE
2. Sourcing - SUPPLIER, SUPPLIER_PRODUCT, PRODUCT_REORDER_LEVELS
3. Inventory Management - INVENTORY,PRODUCTS
4. Operations - TRANSACTION Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  architecture  design Asked in 1 Companies Q27. Design database schema for Facebook like application. Database
This question was recently asked at 'Symantec'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database design Asked in 1 Companies expert Q28. What are different in memory data structures that are used in No Sql Database ? NoSql Database
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q29. What are the components of Data Warehousing ? Database
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q30. What are scrollable ResultSet? Database
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve