Skip to main content

Posts

Showing posts with the label DBMS

Wipro DBMS Sample Interview Questions

Question 1 (In DBMS like Oracle) Which of the following allow null values ? A Unique Key or Primary Key ? Answer : Primary Key constraint does not allow null values to be inserted while it is legal in case of Unique key. Question 2 Considering an Oracle database as an example, can NULL values be used in arithmetic operations ? Explain your answer ? Answer : No, NULL value cannot be used in arithmetic operation. This is because a NULL just denotes an 'absence' of information rather than 'empty' or 'zero' value. Question 3 How you can delete a duplicate row from Unique key column? Answer : This necessity does not arise. First of all Unique key column will not allow duplicate rows to be inserted. Question 4 Tell any one advantage of using stored procedures in applications? Answer : Stored Procedures abstract complex SQL queries from application code. For example, a task involving multiple lines of complex SQL queries can be simpli...

Some of Top Sql Aptitude Questions for

Top Sql Aptitude Questions for Aptitude Some SQL Aptitude questions for Aptitude Preparations Q  Which  is  the  subset  of  SQL  commands  used  to  manipulate  Oracle  Database structures, including tables? Data Definition Language (DDL) Q  What operator performs pattern matching? LIKE operator Q  What operator tests column for the absence of data? IS NULL operator Q  Which command executes the contents of a specified file?    START <filename> or @<filename> Q  What is the parameter substitution symbol used with INSERT INTO command?    &amp; Q  Which command displays the SQL command in the SQL buffer, and then executes it?.    RUN Q.  What are the wildcards used for pattern matching?    _ for single character substitution and % for multi-character substitution Q  State true or false. EXISTS, SOME, ANY are operators in SQL.   ...

PL/SQL to Create or Replace Triggers, Varray and nested tables

Question: 1) Create orreplace trigger trig_msg after update ordelete or insert on customer for each row Code: declare oper varchar2(10); begin if updating then DBMS_OUTPUT.PUT_LINE('UPDATING'); end if; if deleting then DBMS_OUTPUT.PUT_LINE('DELETING'); end if; if inserting then DBMS_OUTPUT.PUT_LINE('INSERTING'); end if; end; SQL> set serveroutput on; SQL> insert into customer values(1,'vish','delhi',500,'21-jan-2001'); INSERTING 1 row created. SQL> delete from customer where loanno = 1; DELETING 1 row deleted. Question 2) create or replace trigger trig_nodml after update orinsert or delete on loan for each row Code: declare m varchar2(15); begin if updating then RAISE_APPLICATION_ERROR(-20000,'NO UPDATE ALLOWED'); end if; if deleting then RAISE_APPLICATION_ERROR(-20000,'NO DELETING ALLOWED'); end if; if inserting then m:=TO_CHAR(sysdate,'DAY'); if (upper(m)<...

Advanced Database Techniques Practical - Experiment No.1

PRACTICAL NO. 1 Create tables as per following definitions. Deposit3 : Actno Cname Brname Amount Date SQL> create table deposit3 (actno number(5),cname varchar(20),brname varchar2(20),amount number(10,2),dt date); Table created. Branch3 : Brid Brname City Ins_date Update_date SQL> create table branch3 (brid varchar2(20), brname varchar2(20),city varchar2(20),insdate date,update_date date); Table created. Customer3 : Custid Cname City ins_date update_date SQL> create table customer3           (custid varchar2(20), cname varchar2(20),city varchar2(20),insdate date,update_date date); Table created. Borrow3 : loanno custname brname amount ins_date SQL> create table borrow3           (loanno number(10), custname varchar2(20),brname varchar2(20),amount number(10,2),insdate date); Table created. Describe all tables. SQL> desc depo...