Database interview questions

Source: Internet
Author: User
Tags what sql in domain

1) which statement shows the maximum salary paid in each job category of each department? _______

A. Select dept_id, job_cat, max (salary) from employees where salary> MAX (salary );

B. Select dept_id, job_cat, max (salary) from employees group by dept_id, job_cat;

C. Select dept_id, job_cat, max (salary) from employees;

D. Select dept_id, job_cat, max (salary) from employees group by dept_id;

E. Select dept_id, job_cat, max (salary) from employees group by dept_id, job_cat, salary;

 

2) Description of the Students table:

Sid_id number

Start_date date

End_date date

Which two function are valid on the start_date column? _________.

A. sum (start_date)

B. AVG (start_date)

C. Count (start_date)

D. AVG (start_date, end_date)

E. Min (start_date)

F. Maximum (start_date)

 

3) for which two constraints does the Oracle server implicitly create a unique index? ______.

A. Not null

B. Primary

C. Foreign key

D. Check

E. Unique

 

4) In a SELECT statement that includes des A where clause, where is the group by clause placed in the SELECT statement? ______.

A. Immediately after the select clause

B. Before the WHERE clause

C. Before the from clause

D. After the order by clause

E. After the WHERE clause

 

5) in a select statement that includes des A where clause, where is the order by clause placed in the SELECT statement? ______.

A. Immediately after the select clause

B. Before the WHERE clause

C. After all clause

D. After the WHERE clause

E. Before the from clause

 

6) Evaluate there two SQL statements ______.

Select last_name, salary from employees order by salary;

Select last_name, salary from employees order by 2 ASC;

A. The same result B. Different Result c. The second statement returns a syntax error

 

7) You wowould like to display the system date in the format "20051110 14:44:17 ". Which SELECT statement shocould you use? ______.

A. Select to_date (sydate, 'yearmmdd hh: mm: ss') from dual;

B. Select to_char (sydate, 'earmonthday hh: MI: ss') from dual;

C. Select to_date (sydate, 'yyyymmdd hh24: MI: ss') from dual;

D. Select to_char (sydate, 'yyyymmdd hh24: MI: ss') from dual;

E. Select to_char (sydate, 'yy-mm-dd hh24: MI: ss') from dual;

 

8) which select statement will the result 'Ello world' from the string 'Hello world '? ______.

A. Select substr ('Hello world', 1) from dual;

B. Select substr (TRIM ('Hello world', 1,1) from dual;

C. Select lower (substr ('Hello world', 1) from dual;

D. Select lower (TRIM ('H' from 'Hello World') from dual;

 

9) which are DML statements (choose all that apply )______.

A. Commit B. Merge C. Update D. Delete E. creat F. Drop

 

10) in the SELECT statement, the character used to connect strings is ______.

A. "+" B. "&" C. "|" D. "|"

 

Q: What is a clustered index, what is a non-clustered index, and what is a primary key?

 

Database questions

Name: Date:

 

1. What is a transaction?

 

 

2. What is the difference between the truncate and delete commands in Oracle?

 

 

3. What are the differences between char and varchar2 in Oracle? The data "test" is stored in char (10) and varchar2 (10) fields respectively. What is the difference between the storage length and type?

 

 

4. See the following table structure.

Press:

Press Code char (2 ),

Press name varchar2 (32)

 

Books:

Book No. Char (8 ),

Book name varchar2 (128 ),

Press Code char (2 ),

Author code: Char (4 ),

Book introduction varchar2 (128)

 

Author:

Author code: Char (4 ),

Author name varchar2 (10 ),

Gender char (1 ),

Age number (3 ),

Literature direction varchar2 (64)

 

Winners:

Award date,

Winner char (4)

 

Write an SQL statement to find out the SQL statement that does not show all the author information in the "winners" database. (Note: Use the not in, not exists, and external association methods, and explains which method is optimal.

 

 

 

5. The Oracle database table has a pseudo-column rowid. Use rowid to write an SQL statement, find the unique record from the following record, and update its flag column to y.

 

No name sex flag

1 Zhang San 1 N

1 Zhang San 1 N

1 Zhang San 1 N

 

 

 

6. in Oracle, the null value (null) needs to be output to 0 in the query statement. How can this problem be solved?

 

 

 

7. See the "winners" table in question 4 and write SQL statements to query the winners of the previous month.

 

 

 

8. See the "books" table in the fourth question. The table creates a composite index for the book name, publisher code, and author code. Will the index be used when the following statement is executed.

Select * from book where book name = 'xxxx'

Select * from book where book name = 'xxxx' and press code = 'bb'

Select * from book where book name = 'xxxx' and author code = 'ddd'

Select * from book where Publishing House code = 'yyy'

 

 

 

9. Write a simple Oracle stored procedure. One output parameter must be a result set.

 

 

 

Expert analysis of this exam:

First, this examination paper belongs to the basic knowledge class from the examination points of the question;

Second, the difficulty analysis is moderate;

Third, from the perspective of question setup, the company's main intention is to examine the work experience and project experience of the tester. Although it is basic knowledge, as long as it has not done any development work, it is not easy to answer;

Fourth, there are only 4th questions in the whole article. The last question involves the "optimization" problem. Therefore, the company determines that this question is mainly for development positions.

 

For each interview questions, we hope to provide the corresponding questions, but also hope that more users to participate in: http://bbs.database.ccidnet.com/thread.php? FID = 27

Oracle DBA interview questions by B G

 

1. How many memory layers are in the shared pool?

 

2. How do you find out from the RMAN catalog if a participant archive log has been backed-up?

 

3. How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?

 

4. Define the SGA and:

 

? How you wowould configure SGA for a mid-sized OLTP environment?

 

? What is involved in tuning the SGA?

 

5. What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuningit?

 

6. other than making use of the statspack utility, what wocould you check when you are monitoring or running a health check on an Oracle 8i or 9i Database?

 

7. How do you tell what your machine name is and what is its IP address?

 

8. How wocould you go about verifying the network name that the local_listener is currently using?

 

9. You have 4 instances running on the same Unix box. How can you determine which shared memory and semaphores are associated with which instance?

 

10. What view (s) do you use to associate a user's sqlplus session with his o/s process?

 

11. What is the recommended interval at which to run statspack snapshots, and why?

 

12. what spfile/init. ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?

 

13. assuming Today is Monday, how wocould you use the dbms_job package to schedule the execution of a given procedure owned by Scott to start Wednesday at 9 am and to run subsequently every other day at 2 am.

 

14. How wocould you edit your crontab to schedule the running of/test. Sh to run every other day at 2?

 

15. What do the 9i dbms_standard. SQL _txt () and dbms_standard. SQL _text () procedures do?

 

16. In which dictionary table or view wocould you look to determine at which time a snapshot or mview last successfully refreshed?

 

17. How wocould you best determine why your mview couldn't fast refresh?

 

18. How does propagation differ between Advanced Replication and snapshot replication (readonly )?

 

19. Which dictionary view (s) wocould you first look at to understand or get a high-level idea of a given Advanced Replication environment?

 

20. How wocould you begin to troubleshoot an ORA-3113 error?

 

21. Which dictionary tables and/or views wocould you look at to diagnose a locking issue?

 

22. An automatic job running via dbms_job has failed. knowing only that "it's failed", how do you approach troubleshooting this issue?

 

23. How wocould you extract DDL of a table without using a GUI tool?

 

24. You're getting high "busy buffer waits"-how can you find what's causing it?

 

25. What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?

 

26. database is hung. Old and new user connections alike hang on impact. What do you do? Your sys sqlplus session is able to connect.

 

27. database crashes. snapshot uption is found scattered among the file system neither of your doing nor of Oracle's. What database recovery options are available? Database is in archive log mode.

 

28. Explain strate how to determine the amount of physical CPUs a Unix box possesses (Linux and/or Solaris ).

 

29. How do you increase the OS limitation for open files (Linux and/or Solaris )?

 

30. provide an example of a shell script which logs into sqlplus as sys, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.

 

31. Explain how you wowould restore a database using RMAN to point in time?

 

32. How Does Oracle guarantee data integrity of data changes?

 

33. Which environment variables are absolutely critical in order to run the oui?

 

34. What SQL query from V $ session can you run to show how many sessions are logged in as a special user account?

 

35. Why does Oracle not permit the use of pctused with indexes?

 

36. What wocould you use to improve performance on an insert statement that places millions of rows into that table?

 

37. What wocould you do with an "in-Doubt" distributed transaction?

 

38. What are the commands you 'd issue to show the explain Plan for "select * from dual "?

 

39. In what script is "snap $" created? In what script is the "Scott/tiger" schema created?

 

40. if you're unsure in which script a sys or system-owned object is created, but you know it's in a script from a specific directory, what Unix Command from that directory structure can you run to find your answer?

 

41. How wocould you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?

 

42. You create a private database link and upon connection, fails with: ORA-2085: connects to. What is the problem? How wocould you go about resolving this error?

 

43. I have my backup RMAN script called "backup_rman.sh ". I am on the target database. my catalog username/password is RMAN/RMAN. my catalog dB is called RMAN. how wocould you run this shell script from the o/s such that it wocould run as a background process?

 

44. Explain the concept of the dual table.

 

45. What are the ways tablespaces can be managed and how do they differ?

 

46. From the database level, how can you tell under which time zone A database is operating?

 

47. What's the benefit of "dbms_stats" over "analyze "?

 

48. Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

 

49. you have found upload uption in a tablespace that contains static tables that are part of a database that is in noarchive log mode. how wocould you restore the tablespace without losing new data in the other tablespaces?

 

50. How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.