DBMS is a software used to create a database, and to manipulate and retrieve information stored in a database. 2. Define database. A database is a collection of logically related files. 3. What is redundancy? Redundancy means repetition. It means storing a data item many times at many places. 4. What is inconsistency? If multiple copies of a data item exist in a database, and if they do not agree, then we say that the database is inconsistent. 5. Define atomicity. Atomicity means either a transaction should happen in its entirety or not at all. 6. Define abstraction. The database system hides certain details of how the data are stored and maintained. This is called as abstraction. 7. What is an instance of a database? The collection of information stored in the database at a particular point of time is called an instance. 8. What is a schema? A schema is the overall design of the database. 9. What is data independence? Data independence is the immunity of application programs to changes made at the conceptual level or internal level. 10. Define physical data independence. Physical data independence means the application programs should not be affected by the changes made to the internal schema. a) Change of index b) Change of the physical media c) all the above 11. Define logical independence. Logical data independence means the application programs should not be affected by the changes made to the conceptual schema. What type of changes can be done at the logical level a) Merging of two tables b) Splitting large table into two or more tables c) Adding more attributes to a table d) All the above 12. What is a data model? A data model is a collection of conceptual tools for designing data, data relationships, data semantics, and consistency constraints. 13. Mention various groups of data models. Object-based logical models: These are used in describing data at the logical and view levels and provide flexible structuring capabilities and allow data constraints to be specified explicitly. Record-based logical models: These are used in describing data at the logical and view levels and these are used to specify the overall logical structure of the database and to provide a higher-level description of the implementation. Physical models: These are used to describe data at the lowest level. Unifying and Frame-Memory are the two physical models. 14. Define ER model. ER model is based on a perception of a real world that consists of a collection of basic objects called entities and of relationships among these objects. 15. What is an entity? What is a relationship? What is ER Diagram?

An entity is a thing or object in the real world that is distinguishable from other objects. A relationship is an association among several entities. An ER diagram is a pictorial representation of the logical structure of the database. 16. What is DDL? DDL is a language to specify the database schema. 17. What is DML? DML is a language that enables users to access or manipulate data as organized by the appropriate data model. 18. What are the two types of DML? Procedural DML and Non-procedural DML. 19. What is data dictionary? Data dictionary is data about data. 20. What is a transaction? A transaction is a collection of operations that perform a single logical function in a database application. 21. What is the role of transaction manager? The transaction manager is responsible for ensuring that the database remains in a consistent state despite system failures. 22. What is the role of storage manager? A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. 23. What is an entity set? An entity set is a set of entities of the same type that share the same attributes. 24. What is a relationship set? A relationship set is a set of relationships of the same type. 25. What are the various types of attributes? Single and composite attributes. Single-valued and multi-valued attributes. Null attributes. Derived attributes. 26. What is the significance of a null value? A null value is used when an attribute does not have a value for an attribute. An attribute whose value is “not known” or “not applicable” is assumed to have a null value. 27. What are the various mapping cardinalities? One to one One to many Many to many 28. What is a super key? A super key is a set of one or more attributes that taken collectively, uniquely identifies an entity in the entity set. 29. What is a candidate key? A candidate key is minimal super key. 30. What is a primary key? A primary key is a candidate key that is chosen by the database designer as the principal means of identifying entities with in an entity set. Eg. Student( Snno, Sname, Smark) (Assume that all the names are unique) Super Keys: • Snno, Sname,Smark

• Snno, Sname • Snno, Smark • Sname Smark Candidate Keys: Snno Sname Primary Key: Snno (or) Sname 31. What is a strong entity? What is a weak entity? A strong entity set is an entity set that has a primary key. A weak entity set is an entity set that does not have enough attributes to form a primary key. 32. What is specialization? What is generalization? Specialization and Generalization define containment relationship between a higher-level entity set and one or more lower level entity sets. Specialization is the result of taking a subset of a higher-level entity set to form a lower level entity set. Generalization is the result of taking the union of two or more disjoint (lower level) entity sets to produce a higher-level entity set. 33. What is a relation? A relation is a subset of Cartesian product of domains. (or) A relation is a two dimensional structure where each row denotes an entity and each column denotes an attributes. 34. What is a query? A query is a statement requesting the retrieval of information. 35. What is a query language? A query language is a language in which a user requests information from the database. 36. Distinguish between procedural and non-procedural query languages. In a procedural query language, we specify not only what to do but also how to do. In a non-procedural language, we specify only what to do but not how to do. 37. What is the primary distinction between relational algebra and relational calculus? Relational algebra is procedural query language. Tuple relational calculus and Domain relational calculus are nonprocedural languages. 38. What are the various operations in relational algebra? select difference project Cartesian product rename join union division intersect assignment 39. Compare SQL, QBE and Quel. SQL is based on relational algebra. QBE is based on domain relational calculus. Quel is based on tuple relational calculus. 40. What is a view? A view is a virtual relation; i.e., a view does not have a physical existence. 41. What are the advantages of using views? Views facilitate security. Views support data independence. 42. What is a materialized view? Usually, the result of a view is not physically stored. However, certain database systems allow a view to be stored. Such a stored view is called materialized view.

43. What is the need for a condition box in QBE? At times, it is either inconvenient or impossible to express all the constraints on the domain variables within the skeleton tables. To overcome this drawback, the condition box is used. 44. What is meant by domain constraint? All attributes must have a domain of possible values. Such a constraint helps to avoid the use of null values for particular attributes. 45. State entity integrity. No component of a primary key can be null. 46. What is meant by referential integrity? Referential integrity constrain ensures that a value appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation. 47. What is assertion? An assertion is a condition that we wish the database always satisfy. 48. What is a trigger? A trigger is a procedure that is executed automatically by the system as a side effect of a modification to the database. 49. Define functional dependency. Let α R and β R. The functional dependency α → β hold on R if in any legal relation r(R), for all pairs of tuples t1 and t2 in r such that t1[α ] = t2[α ], it is also the case that t1[β ] = t2[β ].

50. When do we say a FD is trivial? The FD α → β is trivial if β ⊆ α . 51. List all FDs satisfied by the following relation. A B C A1 B1 C1 A2 B2 C2 A3 B3 C3 A4 B4 C4 The four functional dependencies are A → B ,C → B, B

→ A and B → C

52. What is a closure of a set of FDs? Let F be a set of functional dependencies. The closure of F is the set of all functional dependencies that are logically implied by F. It is denoted by F+. 53. What are Armstrong’s axioms? Reflexivity rule. Augmentation rule. Transitivity rule. 54. Define the closure of a set of attributes? Let A be a set of attributes and F be a set of functional dependencies. The closure of A under F is the set of attributes functionally determined by A. It is denoted by A+. 55. What is a canonical cover? A canonical cover Fc for F is a set of functional dependencies such that F logically implies all dependencies in F c and Fc logically implies all dependencies in F. In addition Fc must satisfy the following properties: • No functional dependency in Fc contains an extraneous attribute. • Each left side of a functional dependency in Fc is unique. 56. What are the pitfalls in a poor database design? Repetition of information.

Inability to represent certain information. 57. Define 1NF. A relation is said to be in 1NF iff all underlying domains are atomic. 58. Define 2NF. A relation is said to be in 2NF iff it is in 1NF and all nonprime keys are fully functionally dependent on the primary key. 59. Define 3NF. A relation is said to be in 3NF iff it is in 2NF and all nonprime keys are nontransitively dependent on the primary key. 60. Define BCNF. A relation is said to be in BCNF if all determinants are candidate keys. 61. Define 4NF. A relation is said to be in 4NF iff it is in 3NF and all multivalued dependencies are implied by the candidate keys. 62. What is multivalued dependency. Let R be a relation schema and let α ⊂ R and β ⊂ R. The multivalued dependency α → β holds on R if, in any legal relation r(R), for all pairs of tuples t1 and t2 such that t1[α ] = t2[α ], there exists tuples t3 and t4 in R such that t1[α ] = t2[α ] = t3[α ] = t4[α ]. t3[β ] = t1[β ]. t3[R-β ] = t2[R-β ]. t4[β ] = t2[β ]. t4[R-β ] = t1[R-β ].

63. What is a join dependency? If R=R1  R2 ….  Rn, we say that a relation r(R) satisfies the join dependency *(R1,R2,R3,..,Rn) if R = π π R2(r) … π Rn(r).



64. Define PJNF. A relation is said to be in PJNF (5NF) iff it is in 4NF and all join dependencies are implied by the candidate keys. 65. State which of the following are true or false. Every relation which is in 3NF is in BCNF. FALSE Every relation which is in BCNF is in 3NF. TRUE Every relation which is in BCNF is in 4NF. FALSE Every relation which is in 4NF is in BCNF. TRUE 66. Mention three desirable properties of a good database design. Lossless decomposition. Dependency preservation. Lack of redundancy. 67. Define lossless decomposition. Let R be a relation schema and let F be a set of functional dependencies on R. Let R 1 and R2 form a decomposition of R. this decomposition of R into R 1 and R2 is lossless if at least one of the following functional dependencies are in F+. R1  R2 → R1 R1  R2 → R2 68. Define dependency preserving decomposition.

Let R be a relation scheme and F be the set of functional dependencies on R. let the decomposition of R be R 1, R2, …..,Rn. Let F1,F2,…. Fn be the sets of functional dependencies in each of Ri. This decomposition is said to be dependency preserving if F+ = (F1  F2 ….  Fn)+. 69. What is a dense index? An index is dense if an index entry appears for every search-key value in the file. 70. What is a sparse index? An index is sparse if one index entry appears for a group of records in the file. 71. What is a primary index and a secondary index? If the file containing the records is sequentially ordered, the index whose search key specifies the sequential order of the file is called primary index. A primary index is also called clustering index. Indices whose search key specifies an order different from the sequential order of the file are called secondary indices. Secondary indices are also called non-clustering indices. 72. What is a B+ tree? A B+ tree index takes the form of a balanced tree, in which every path from the root of the tree to a leaf of the tree is of same length. 73. What is a B tree? A B tree index is similar to a B+ tree index except that a B tree eliminates the redundant storage of search-key values. 74. What is a hash function? Let K denote the set of all search-key values, and let B denote the set of all bucket addresses. A hash function h is a function from K to B. Division method is best methodology. 75. What is an overflow? What is a synonym? If a record is hashed into a full bucket, we say that an overflow has occurred. Two records are said to be synonyms if they are hashed into the same bucket. 76. What is a dynamic hashing technique? Static hashing uses hash functions in which the set of bucket addresses is fixed. Such hash functions cannot easily accommodate databases that grow larger over time. In a dynamic hashing technique, the hash functions can be modified. 77. Define query processing. Query processing refers to various activities involved in extracting data from a database. 78. What is query optimization? Query optimization is the process of selecting the most efficient query evaluation plan for a query. 79. Mention four properties of a transaction. (ACID Properties) Atomicity: Either all operations of the transaction are reflected properly in the database, or none are. Consistency: Execution of a transaction in isolation (i.e., with no other transaction executing concurrently) preserves the consistency of the database. Isolation: Each transaction is unaware of other transactions executing concurrently in the system. Even though multiple transactions may execute concurrently, the system guarantees that, for every pair of transactions Ti and Tj, it appears to Ti that either Tj finished execution before Ti started, or Tj started execution after Ti finished. Durability: After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures. 80. What is meant by two-phase locking scheme? Two phase locking protocol allows a transaction to lock a new data item only if that transaction has not yet unlocked any data item. 81. Define the term security. Security refers to the protection of the database from unauthorized access, and malicious destruction.

82. What is a spatial database? Spatial databases store information related to spatial locations and provides support for efficient querying and indexing based on spatial locations. 83. What are the two important types of spatial databases? Design databases and geographical databases. 84. What is a GIS? A GIS is a spatial database that is used to store geographical information such as maps. 85. What is data mining? Data mining is discovering knowledge from a large volume of data. 86. What is data warehousing? A data warehouse is a repository of information gathered from multiple sources, stored under a unified schema, at a single site. 87. What is a multimedia database? A multimedia database is used to store data such as image, audio or video data. Such data are called continuous media data. 88. Define parallel database. Parallel database systems consist of multiple processors and multiple disks connected by a fast interconnection network. 89. Define distributed database. A distributed database system consists of a collection of sites, each of which maintains a local database system. Each site is able to process local transactions. In addition, a site may participate in the execution of global transactions.

ORACLE & SQL 1. What is data dictionary? Data dictionary is a system catalog, which stores data about everything it holds, such as names, structures, locations and types. This data is also referred to as metadata. 2. What are tables? Tables are the database segments that hold your data. Each table is composed of one or more columns, each of which is assigned a name and a data type. 3. What are the valid data types in Oracle? DATA TYPE DESCRIPTION Fixed-length character field, padded with trailing CHAR blanks VARCHAR Variable-length character field VARCHAR2 Variable-length character field LONG Variable-length character data NUMBER Variable-length numeric data DATE Fixed-length date and time field RAW Variable-length raw binary data LONG RAW Variable-length raw binary data ROWID Row id variable type National language fixed-length character field with NCHAR trailing blanks NVARCHAR2 National language variable-length character field CLOB Variable-length single byte character data NCLOB Single or multi byte character data BLOB Binary data field BFILE Pointer to binary data stored in an external file MAX SIZE 255 bytes 4 KB 4 KB 2 GB 1 x 10-130 to 9.99 x 10125 N/A 255 bytes 2 GB N/A 255 bytes 2 KB 4 GB 4 GB 4 GB N/A

4. What are the advantages of SQL? • Provides a greater degree of abstraction than procedural languages • Applications written in SQL can be easily ported across systems • SQL as a language is independent of the way it is implemented internally • A query returns the same result regardless of whether optimization is done with indexes or not. This is because SQL specifies what is required and not how it should be done. • Simple and easy to learn; Can handle complex situations 5. What is embedded SQL? Embedded SQL statements are those that are embedded inside a high level programming language. In embedded SQL, the program flow is handled by the procedural language and database access is handled through SQL statements within the program. 6. What are the components of the database? We can group the pieces of the database into two distinct categories: i) Objects used internally by the RDBMS, which we call system database objects. ii) Objects that can be accessed by any process, which is called user database objects. 7. What are the system database objects available? The initialization Parameter file(s), which is nothing more than a collection of configuration keys and values, each of which controls or modifies one aspect of the operation of a database and instance. The control file, which contains information on what data files and redo log files belong to the database, what character set the data should be stored as in the database, the status and revision of each data file in the database, and other critical information. Online Redo Log Files, which stores all the change information for the database and are used by Oracle during database recovery. The Trace File(s), which is the file in which all system messages, errors and major events are logged. The ROWID, which is a two-byte value that stores the physical location for a row in the database. Oracle Blocks, which is the smallest unit of storage that the server can address.

8. What are the user database objects available? Data files, which are allocated to one table space and holds the actual data stored in that table space. Extents, which is a unit of storage made up of one or more contiguous blocks. Table spaces, which is a logical structure used to group similarly accessed data. 9. What are the categories of SQL statements? a) DDL (Data Definition Language): DDL is used to create, alter and delete database objects. b) DML (Data Manipulation Language): DML commands let users enter data into the database, modify and delete the data in the database. c) DQL (Data Query Language): This statement enables the user to query one or more table to get the information they want. d) DCL (Data control Language): DCL consists of commands that control the user access to the database object. e) DAS (Data Administration Statements): This allows the user to perform audits and analysis on operations within the database. f) TCS (Transaction Control Statements): These are statements that manage all the changes made by the DML statements. 10. What are the commands under DDL? • CREATE TABLE • CREATE VIEW • CREATE INDEX • ALTER TABLE • DROP TABLE • DROP VIEW • DROP INDEX 11. What are the commands under DML? • INSERT • UPDATE • DELETE 12. Give the command under DQL. SELECT 13. Give the commands under DCL. • GRANT • REVOKE 14. Give the commands under DAS. • START AUDIT • STOP AUDIT 15. What are the commands under TCS? • COMMIT • ROLLBACK • SAVEPOINT • SET TRANSACTION 16. What is an index? An index is a data segment created to speed access to specific table data. An index holds the value for one or more columns of a table and the ROWID for the corresponding column values. 17. What are the different types of indices? Composite Index – Indexes that involve more than one column are called composite indexes Unique Index – Indexes that prevent duplication of data are called unique indexes. Clustered Index – Indexes that are sorted both logically and physically are called clustered indexes. 18. What are rollback segments?

Rollback segments are the database objects that store the “before images” or original data blocks that are changed in database transactions. 19. What are table clusters? A table cluster is a database object that physically groups tables that are often used within the same data blocks. 20. What is a hash cluster? In a hash cluster, tables are organized based upon a hash value derived by applying the hash function to the primary key values of the tables. 21. What are views and why are they used? Views are stored SQL statements that can be queried. A view is used for security reasons to hide certain data, and to make complicated queries easy to understand and use. Views can also be used to hide distributed database objects by creating views on remote database tables. 22. What are sequences? Sequences are used to generate unique numbers. The most common usage of sequences is to provide unique numbers for primary key columns of tables. 23. Define triggers. Triggers are stored procedures that fire when certain actions occur against a table. Triggers are most often used to enforce data integrity constraints and business rules that are too complicated for the built-in Oracle referential integrity constraints. 24. Define synonyms. A synonym is an alias for a table, view, sequence, or other schema object that you store in the database. 25. What are database links? Database links are stored definitions of connections to remote databases. They are used to query remote tables in a distributed database environment. 26. What are packages, stored procedures and functions? A stored procedure is a code unit that does work, can be passed arguments, and can return values. A stored function is a code unit that is passed an argument and returns one value. A package is a collection of procedures, variables and functions, logically grouped by function. 27. Define null value. A null value is an implementation dependent special value that is distinct from all null values and there is effectively only one and only one null value. 28. What is an aggregate function? An aggregate function takes an entire column of data as its argument and produces a single data item that summarizes the column. The aggregate functions that are provided by SQL are: • COUNT() • COUNT(*) • SUM() • AVG() • MAX() • MIN() 29. Explain the different clauses that can be used with the SELECT statement. FROM clause specifies the table or tables, from where the data has to be retrieved. WHERE clause tells SQL to include only certain rows of data in the result set. GROUP BY clause specifies a summary query. They are usually used with aggregate functions. HAVING clause tells SQL to include only certain groups produced by the GROUP BY clause in the query result set. ORDER BY clause sorts or orders the results based on the data in one or more columns in the ascending or descending order. 30. Define subqueries. Subqueries are nested SELECT statements. Subqueries enable the user to base the search criteria of one SELECT statement on the results of another SELECT statement.

31. What are the two types of subqueries? Nested subqueries, where the subquery is executed first and its results are inserted into the WHERE clause of the main query. Correlated subqueries, where the main query is executed first and the subquery is executed for every row returned by the main query. 32. What are parallel subqueries? Parallel subqueries include more than one subquery in a query. 33. Define joins. Join is a query in which data is retrieved from more than one table. A join matches data from two or more tables based on the values of one or more columns in each table. All matches are combined to create a resulting row that is the concatenation of columns from each table, where specified columns match.

35. What are equijoins and non-equijoins? If the comparison operator is equality, then the join is called an equijoin. If the comparison operator is not the equality sign, then the join is called a non-equijoin. 36. What is natural join? The equijoin must produce a result, containing two identical columns. If one of these columns is eliminated, then that join is called the natural join. 37. What is outer join? When tables are joined, rows, which contain matching values in the join predicates, are returned. Sometimes, you may want both matching and non-matching rows returned for the tables that are being joined. This kind of an operation is called an outer join. 38. What is a self-join? In a self-join, a table is joined with itself. It compares values with a column of a single table. 39. What is a union? The union operation combines two sets of rows into a single set, composed of all the rows in either or both of the two original sets, provided the two original sets are union compatible. 40. What are the conditions that must be satisfied for two tables to be union compatible? • The two sets must contain the same number of columns. • Each column of the first set must be either the same data type as the corresponding column of the second set or convertible to the same data type as corresponding column of the second set. 41. What is the difference between UNION and UNION ALL? UNION verb eliminates duplicates but UNION ALL retains them. 42. What are the commands for giving privileges and taking them away? GRANT is the command for assigning database privileges and REVOKE is the command for taking them away. 43. What is data integrity? The term data integrity refers to the correctness and completeness of the data in a database. 44. What are the different types of integrity constraints? Integrity constraints are classified as – general constraints, domain constraints and base table constraints. General constraints are constraints that apply to combinations of columns in combinations of base tables. These are created using the CREATE ASSERTION statement. Domain constraints are associated with a particular domain and apply to every column that is defined on that domain. These are created using the CREATE DOMAIN statements. Base table constraints are constraints associated with some specific base table. 45. What are the different types of locks? They can be classified into two categories: a) Locks to enable the reading of data

b) Locks to enable the updating of data 46. What are the two levels of locks? • Row level lock – In row level lock, a row is locked exclusively so that other users cannot modify the row until the transaction holding the lock is committed or rolled back. • Table level lock – A table level lock will protect table data thereby guaranteeing data integrity when data is being accessed concurrently by multiple users. 47. What is the difference between an exclusive lock and a shared lock? A share lock locks the table allowing other users to only query but not insert, update or delete rows in a table. Multiple users can place shared locks on the same table at the same time. When an exclusive lock is in place, no other transaction can acquire any kind of access on that data until the original lock is released at the end of update operations. Only one user can place an exclusive lock on a table at a time. 48. What are snapshots? Snapshot is a table that contains the result of a query of one or more tables, called master tables or views that are typically located on a remote mode. 49. What is PL/SQL? PL/SQL stands for Procedural Language/SQL. PL/SQL extends SQL by adding control structures found in other procedural languages. 50. Give the three parts of a PL/SQL block. • Declarative • Executable • Exceptional handling 51. What are the data types in PL/SQL? • Scalar – Boolean, Binary_integer, Number ( decimal, integer, real), Character (varchar2, char, long), raw, rowid. • Composite – LOB (BLOB, CLOB, BFILE) 52. What are exceptions? Exceptions are designed for runtime error handling rather than compile time error handling. 53. What is context area? Oracle allocates an area of memory known as context area for processing of SQL statements. It contains information necessary to complete the processing, including the number of rows processed by the statement, a pointer to the parsed representation of the statement. 54. Define cursors. A cursor is a handle or pointer to the context area. Through the cursor, a PL/SQL program can control the context area and see what happens to it as the statement is processed. 55. What are the types of cursors? • Static cursor – It’s definition are those whose select statements are known at compile time. It is further classified into: i) Explicit cursor: It is one in which the cursor name is explicitly assigned to the select statement. ii) Implicit Cursor: It is used for all other SQL statements. • Dynamic cursors: It is made possible in PL/SQL only through the use of DBMS_SQL built-in package. • REF Cursor: A cursor variable is a reference type. A reference type is similar to a pointer. It can name different storage locations as the program runs. In order to use the reference type, the variable has to be declared and the storage has to be allocated. REF cursors are further classified based on the return type: i) Strong Cursor: It is a cursor whose return type is specified. ii) Weak Cursor: It is a cursor whose return type is not specified. 56. What is the difference between a procedures and a function? A procedure is a subprogram that performs any specific action. A function is a subprogram that computes a value. 57. What are nested tables?

Nested tables are similar to PL/SQL tables. PL/SQL tables are known as index – by tables. Nested tables extend the functionality of index – by tables by adding extra collection methods. They further extend the functionality of index – by tables by adding the ability to store nested tables within a database table. 58. What are Varrays? A varray is a data type similar to an array in C or Pascal. A varray is accessed in a way that closely resembles that of a nested or index – by table. Rather than being a sparse data structure with no upper bound, elements are inserted into a varray starting at index 1, upto the maximum length declared in the varray type. 59. What are the types of Segments available in Oracle Database? • Data Segment – Data are stored • Index Segment – index stores its data here • LOB Segment – CLOB, BLOB, NCLOB data types are stored here. • Overflow Segment – To store rows that do not fit into the original index segment. • Rollback Segment – transaction rollback information are stored. • Temporary Segment – stores intermediate data. 60. Where can be data stored? Data can be stored in one of the following: • Regular Tables • Partitioned Tables • Index-Organized Tables • Clustered Tables 61. What are Regular Tables? A Regular table is the most commonly used form of storing user data. 62. What are Partitioned Tables? A partitioned table has one or more partitions, each of which stores rows that have a specified range of key values and each partition in a Partitioned table is a segment and can be located in different table spaces. 63. What are Index-Organized Tables? An Index-Organized table keeps all data for a table within a B-tree structure. The B-tree Index, which is based on the Primary key of the table, is organized like an Index. 64. What are Clustered Tables? Clusters offer some degree of control over how rows are stored. When a cluster is used, the Oracle Server stores all rows that have the same key value in the same block. 65. What is Table space? A table space is a logical organization of data within an Oracle database that corresponds to one or more physical data files on disk. 66. How can we categorize Table spaces? • Online & Offline Table spaces • Permanent and Temporary Table spaces • Dictionary-managed and Locally Managed Table spaces • Read-Only and Read-Write Table spaces 67. What is Table space Quotas? A table space quota limits how much space a user’s database objects can consume in the table space. 68. What is the syntax of CREATE TABLE clause? CREATE TABLE [schema.]table( {column datatype [DEFAULT expression] [CONSTRAINT constraint] { [NOT] NULL | {UNIQUE | PRIMARY KEY } | REFERENCES [schema.]table[(column)] [ON DELETE CASCADE ] | CHECK (condition) } [ another constraint specification ]

| [CONSTRAINT constraint ] {{UNIQUE|PRIMARYKEY}(column [,column].) | FOREIGN KEY(column[,column]…) REFERENCES [schema.]table[(column[,column]..)] [ ON DELETE {CASCADE|SET NULL}] | CHECK (condition)} [,…. Other columns/constraint or constraints ] ) 69. What is the syntax of ALTER TABLE clause? ALTER TABLE [schema.]table ADD (column [datatype] [DEFAULT expression] [ [ CONSTRAINT constraint ] { {UNIQUE|PRIMARY KEY} (column[,column]…) | FOREIGN KEY(column [,column]…) REFERENCES [schema.]table[(column[,column]…)] [ON DELETE {CASCADE|SET NULL}] | CHECK (condition) } ) 70. What is the syntax of CREATE VIEW clause? CREATE [OR REPLACE] VIEW [schema.]view AS subquery [WITH READ ONLY] 71. What is the syntax of CREATE SEQUENCE clause? CREATE SEQUENCE [schema.] sequence [START WITH integer ] [INCREMENT BY integer ] [MAXVALUE integer | NOMAXVALUE] [MINVALUE integer | NOMINVALUE] [CYCLE | NOCYCLE ] [CACHE integer | NOCACHE ] [ ORDER | NOORDER ] 72. What is a public synonym? A public synonym is an object alias(another name) that is available to every user in a database. 73. What is a private synonym? A private synonym is a synonym within the schema of a specific user who has control over its use by others. 74. What is the syntax for creating a synonym? CREATE [PUBLIC] SYNONYM [schema.]synonym FOR [schema.]object 75. Which is the default index data structure used in Oracle? B-Tree Indexes are the default index used. It is also termed as normal index. 76. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables? Data Definition Language (DDL) 77. What operator performs pattern matching? LIKE operator 78. What operator tests column for the absence of data? IS NULL operator 79. Which command executes the contents of a specified file? START <filename> or @<filename> 80. What is the parameter substitution symbol used with INSERT INTO command? &

81. Which command displays the SQL command in the SQL buffer, and then executes it? RUN 82. What are the wildcards used for pattern matching? _ for single character substitution and % for multi-character substitution 83. State true or false. EXISTS, SOME, ANY are operators in SQL. True 84. State true or false. !=, <>, ^= all denote the same operation. True 85. What are the privileges that can be granted on a table by a user to others? Insert, update, delete, select, references, index, execute, alter, all 86. What command is used to get back the privileges offered by the GRANT command? REVOKE 87. Which system tables contain information on privileges granted and privileges obtained? USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD 88. Which system table contains information on constraints on all the tables created? USER_CONSTRAINTS 89. TRUNCATE TABLE EMP; DELETE FROM EMP; Will the outputs of the above two commands differ? Both will result in deleting all the rows in the table EMP. 90. What is the difference between TRUNCATE and DELETE commands? TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE. 91. What command is used to create a table by copying the structure of another table? CREATE TABLE .. AS SELECT command To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following. CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2; 92. Which date function is used to find the difference between two dates? MONTHS_BETWEEN 93. What is the advantage of specifying WITH GRANT OPTION in the GRANT command? The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user. 94. What is the use of the DROP option in the ALTER TABLE command? It is used to drop constraints specified on the table. 95. What is the value of ‘comm’ and ‘sal’ after executing the following query if the initial value of ‘sal’ is 10000? UPDATE EMP SET SAL = SAL + 1000, COMM = SAL*0.1; sal = 11000, comm = 1000 96. What is the use of CASCADE CONSTRAINTS? When this clause is used with the DROP command, a parent table can be dropped even when a child table exists. 97. What is the difference between 'count' and 'count(*)' ? 'count': Counts the number of non-null values. 'count(*)': Counts the number of rows in the table, including null values and duplicates.

Give an example of normalization. Write about ACID properties. s Give an ER diagram for an online bookstore. s Example of Correlated subquery. g Example of outer join. Draw a B Tree of order 3 for the following data. v Armstrong rules. g What is the need for normalization? Types of cursors. s