SQL_FAQ

Embed Size (px)

Citation preview

  • 8/3/2019 SQL_FAQ

    1/3

    FAQs

    (1) How do I list all of my tables?

    (2) How do I list all the indexes created for a particular table (say EMP)?

    (3) How do I list all constraints created for a particular table (say EMP)?

    (4) Create one table from another table without copying the data from the first table.

    (5) How do I select from different users tables?

    (6) What is the default format of date in Oracle? How can I change my default dateformat?

    (7) Difference between

    a) ROLLBACK & SAVEPOINTb) ROLLBACK & COMMIT

    c) Truncate & Delete

    d) Truncate & Drope) Delete & Dropf) PK and (UNIQUE + Not Null)

    g) ROUND & TRUNCh) ROWID & ROWNUM

    i) Alternate Key & Candidate Keyj) Simple Key & Composite Key

    k) Stored Procedure and Functionl) Stored Procedure and Trigger

    m) Equi-Join and Outer Joinn) CHAR & VARCHAR2

    o) CASE Statements & DECODE

    p) UNION and UNION ALL

    8) What is a view? What are its advantages?

    9) What is a synonym?

    10) What is PL/SQL?

    11) What is an Index? Why it is useful?

    12) What is a Package? What are its uses?

    13) Mention some features of Oracle 9i database.

    14) Mention some features of Oracle 10g database.

    15) What is the meaning of i and g in 9i & 10g respectively?

    16) What is the purpose of joining the tables? Explain different types of Joins.

    17) What are the data types available in Oracle? Explain.

  • 8/3/2019 SQL_FAQ

    2/3

    (18) What is Database Link?

    (19) What is Tuning? Explain.

    (20) What is DDL? Give examples.

    (21) What is DML? Give examples.

    (22) What are exceptions?

    (23) What is the difference between DBMS & RDBMS?

    (24) State some of the Codd Rules.

    (25) What is normalization? Explain.

    (26) Few differences between Oracle and SQL Server databases.

    (27) What is a Sequence?

    (28) Write a query to eliminate duplicates rows from a table?

    (29) How does one implement IF-THEN-ELSE in a select statement?

    (30) How we can send the query output to a file?

    (31) Display the Department Names that are having more than 4 employees in it?

    (31) What is SQL* Loader?

    (32) What is Export & Import?

    (33) Increase the salaries of all the employees by 10% for the departments that are

    common in both of these tables.

    Table1

    Deptno Empno Sal

    10 1 1000

    10 2 3000

    20 3 2000

    30 4 6000

    20 5 1000

    60 6 9000

    10 7 1000

    Table2

    Deptno

    10

    40

  • 8/3/2019 SQL_FAQ

    3/3

    (34) Write the syntax to add Foreign Key?

    (35) Write the syntax to create Composite Primary Key?

    (36) How to run the SQL statements from a file?

    (37) What is a schema?

    (38) What are DCLs?

    (39) What are roles & privileges?

    1. How does one get the time difference between two date columns?

    2. How does one generate primary key values for a table?

    3. How does one add a day/hour/minute/second to a date value?

    4. How does one count different data values in a column?

    5. How does one count/sum RANGES of data values in a column?

    6. Can one retrieve only the Nth row from a table?

    7. Can one retrieve only rows X to Y from a table?

    8. How does one select EVERY Nth row from a table?

    9. How does one select the TOP N rows from a table?

    10.Can one drop a column from a table?

    11.Can one rename a column in a table?

    12.How can I change my Oracle password?

    Refer http://orafaq.com/faqsql.htm for answers

    To know brief knowledge of Oracle Terms visit http://orafaq.com/and

    navigate to Glossary.

    http://orafaq.com/faqsql.htmhttp://orafaq.com/http://orafaq.com/faqsql.htmhttp://orafaq.com/