ORACLE
Assignment-A
- What are exceptions? How they declared and used in PL/SQL block. What are the main differences between user defined exception system-defined exceptions. Write any five system-defined exceptions.
- How the various SQL statements are executed within a PL/SQL block. What are the advantages of Using SQL statements within PL/SQL block rather than executing them separately.
- Differentiate the procedures, Functions and Triggers. What are the advantages of having Subprogram’s rather than the normal PL/SQL blocks?
- What do you mean by Integrity constant? Explain in brief different integrity Constraints available in SQL?
- What is structured Query Language? Explain in brief different type of SQL Sub Language?
Assignment-B
CREATE SALESPEOPLE, CUSTOMER AND ORDER TABLE WITH FOLLOWING ATTRIBUTES AND INSERT VALUES IN THEM. SALESPEOPLE CUSTOMER ORDER SNUM CNUM ONUM CITY CITY O DATE COMM RATING CNUM SNUM SNUM |
3.What are cursors and for what purpose these are used in PL/SQL block. Explain various cursor attributes.
Assignment – 3
Which character function can be used to return a specified portion of a character string? |
||||
|
What does SQL stand for? |
||||
|
Ans – Structure Query Language
Question No: 3 |
||||
Which SQL statement is used to update data in a database? |
||||
|
Question No: 4
Which SQL statement is used to delete data from a database? |
||||
|
Ans -
Question No: 5 |
||||
With SQL, how do you select a column named "First Name" from a table named "Persons"? |
||||
|
Question No: 6 |
||||
With SQL, how do you select all the columns from a table named "Persons"? |
||||
|
Ans – SELECT * FROM Persons
Question No: 7 |
||||
With SQL, how do you select all the records from a table named "Persons" where the value of the column "First Name" is "Peter"? |
||||
|
||||
Ans –
Question No: 8 |
||||
How many columns are presented after executing this query: SELECT address1||','||address2||','||address2 "Adress" FROM employee; |
||||
|
||||
Ans – 1
Question No: 9 |
||||
Which Oracle access method is the fastest way for Oracle to retrieve a single row? |
||||
|
||||
Ans – Ta
Question No: 10 |
||||
Which of the following can be a valid column name? |
||||
|
||||
Ans – Catch_#22 Question No: 11 |
||||
Which command will delete all data from a table and will not write to the rollback segment? |
||||
|
||||
Ans – TRUNCATE
Question No: 12 |
||||
With SQL, how do you select all the records from a table named "Persons" where the value of the column "First Name" starts with an "a"? |
||||
|
||||
Ans –
Question No: 13 |
||||
The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true |
||||
|
Ans – True
Question No: 14 |
||||
With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "Last Name" is "Jackson"? |
||||
|
||||
Question No: 15 |
||||
Which SQL statement is used to return only different values? SELECT DIFFERENT |
||||
|
||||
Question No: 16 |
||||
Which SQL keyword is used to sort the result-set?` |
||||
|
||||
Question No: 17 |
||||
With SQL, how can you return all the records from a table named "Persons" sorted descending by "First Name"? |
||||
|
||||
Question No: 18 |
||||
With SQL, how can you insert "Olsen" as the "Last Name" in the "Persons" table? |
||||
|
||||
Question No: 19 |
||||
With SQL, how can you delete the records where the "First Name" is "Peter" in the Persons Table? |
||||
|
||||
Question No: 20 |
||||
With SQL, how can you return the number of records in the "Persons" table? |
||||
|
||||
Question No: 21 |
||||
You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use? |
||||
|
||||
|
||||
Question No: 22 |
||||
Which statement about views are true? |
||||
|
||||
Ans – A view can be created as read only
Question No: 23 |
||||
In which case would you use a FULL OUTER JOIN? |
||||
|
||||
Ans –None of the above
Question No: 24 |
||||
Which of the statement is true regarding the use of outer joins? |
||||
|
||||
Ans – You use an outer join to see only the rows that do not meet the join condition.
Question No: 25 |
||||
Examine the structure of the EMPLOYEES and DEPARTMENTS tables EMPLOYEES DEPARTMENTS |
||||
|
||||
Ans –SELECT e.last_name, d.department_name, d.location_id FROM employee e, department D WHERE e.department_id =d.department_id.
Question No: 26 |
||||
In which case would you use an outer join? |
||||
|
||||
Question No: 27 |
||||
The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO? |
||||
|
||||
Question No: 28 |
||||
To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a four-table join? |
||||
|
||||
Question No: 29 |
||||
which of the following SQL functions can operate on any datatype? |
||||
|
||||
Question No: 30 |
||||
What is a trigger |
||||
|
||||
Question No: 31 |
||||
POST-BLOCK trigger is a |
||||
|
||||
Question No: 32 |
||||
Databases overall structure is maintained in a file called |
||||
|
||||
Ans –Control file
Question No: 33 |
||||
It is very difficult to grant and manage common privileges needed by different groups of database users using the roles |
||||
|
||||
Ans – False
Question No: 34 |
||||
The command used to open a CURSOR FOR loop is |
||||
|
||||
Ans – None , cursor for loops handle cursor opening implicitly.
Question No: 35 |
||||
Can we invoke Triggers? |
||||
|
||||
Ans –Yes
Question No: 36 |
||||
Which clause specifies conditions that determine the |
||||
|
||||
Ans – Having Clause
Question No: 37 |
||||
Which clause returns only one copy of each set of duplicate rows selected? |
||||
|
||||
Ans – Distinct
Question No: 38 |
||||
Which command is used to set a set of privileges that can be granted to users or to others roles ? |
||||
|
||||
Ans –Create Role
Question No: 39 |
||||
Which operator is used in character strings comparison with pattern matching? |
||||
|
||||
Question No: 40 |
||||
Which three of the following are implicit cursor attributes? |
||||
|