ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How to create a table using constraints...
IF i change the PARENT KEY value ,then CHILD KEY 
table will also to change in the another table...

plz reply ur answers @ mak2786@gmail.com

Arunkumar
 Question Submitted By :: Arun2786
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
Answer
# 1
RAISE AN INEGRITY CONSTAINT ERROR(ORA-02292)
 
Is This Answer Correct ?    0 Yes 0 No
Deepak Singh
 
  Re: How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
Answer
# 2
Hi,
You can use cascade as follows
1>
2> CREATE TABLE employee (emp_no    INTEGER NOT NULL  
CONSTRAINT prim_empl PRIMARY KEY,
3>                        emp_fname CHAR(20) NOT NULL,
4>                        emp_lname CHAR(20) NOT NULL,
5>                        dept_no   CHAR(4) NULL)
6>
7> CREATE TABLE project   (project_no   CHAR(4) NOT NULL  
CONSTRAINT prim_pro PRIMARY KEY,
8>                         project_name CHAR(15) NOT NULL,
9>                         budget FLOAT NULL)
10>
11> CREATE TABLE works_on1
12>             (emp_no INTEGER NOT NULL,
13>              project_no CHAR(4) NOT NULL,
14>              job CHAR (15) NULL,
15>              enter_date DATETIME NULL,
16>              CONSTRAINT prim_works1 PRIMARY KEY(emp_no, 
project_no),
17>              CONSTRAINT foreign1_works1 FOREIGN KEY
(emp_no) REFERENCES employee(emp_no) ON DELETE CASCADE,
18>              CONSTRAINT foreign2_works1 FOREIGN KEY
(project_no) REFERENCES project(project_no) ON UPDATE 
CASCADE)
19>
20> -- The creation of the works_on1 table that uses the ON 
DELETE CASCADE and ON UPDATE CASCADE options.
 
Is This Answer Correct ?    0 Yes 0 No
Rameshwari
 
 
 
  Re: How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
Answer
# 3
1>
2> CREATE TABLE employee (emp_no    INTEGER NOT NULL  
CONSTRAINT prim_empl PRIMARY KEY,
3>                        emp_fname CHAR(20) NOT NULL,
4>                        emp_lname CHAR(20) NOT NULL,
5>                        dept_no   CHAR(4) NULL)
6>
7> CREATE TABLE project   (project_no   CHAR(4) NOT NULL  
CONSTRAINT prim_pro PRIMARY KEY,
8>                         project_name CHAR(15) NOT NULL,
9>                         budget FLOAT NULL)
10>
11> CREATE TABLE works_on1
12>             (emp_no INTEGER NOT NULL,
13>              project_no CHAR(4) NOT NULL,
14>              job CHAR (15) NULL,
15>              enter_date DATETIME NULL,
16>              CONSTRAINT prim_works1 PRIMARY KEY(emp_no, 
project_no),
17>              CONSTRAINT foreign1_works1 FOREIGN KEY
(emp_no) REFERENCES employee(emp_no) ON DELETE CASCADE)
 
Is This Answer Correct ?    0 Yes 0 No
Alien
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
What is the difference between RDBMS and DBMS? Stag-Computers5
How many database objects (trigger, packages, sequence etc) uses a particular field in a given table. For ex: I want to know how many database object uses the ATTRIBUTE1 in the PO_VENDORS table. What query will give me the result showing the database object name(package, trigger etc), field_name used (in this case ATTRIBUTE1) and table_name (in this case PO_VENDORS). IBM1
what is global variable in pl/sql  1
What is a self join ? BirlaSoft5
what is variable in package specification  2
Delete the emps whose salaries are lowest sals of their own dept.  3
How can we overcome recursive triggers in SQL? iFlex1
what is the difference between implicit conversions and explicit conversions?  1
I have one Excel file with 1,50,000 Records. Now I need to load that whole file into Oracle Database with same columns in Excel sheet . I need PLSQL Procedure or used by SQL PLUS Polaris1
what is bulk bind TCS4
Difference between inline query and stored procedure? Microsoft1
What is the result, when NULL is compared with NULL? TCS10
With out using count() function. How to the find total number of rows in a table?  3
hi..........i m Accenture employee...Accenture is an IT company having itz branches in India at Mumbai, Pune,Delhi, Hyderabad, Chennai and Bangalore....Presently there are openings here for SAP, Testing, Oracle,Java,.NET,MAinframe and Peoplesoft...... I am a software engineer working with Accenture,Mumbai....u can mail me in your resume..i`ll forward it to our HR team...my mail id: pankit.lodaya@accenture.com Wipro2
what is the purpose of update command in oracle? MBT6
Can any one tell me how to increase the performance of a sql query ie what are the performance tips in creating or writing a sql query !!? eBay2
What are the advantages and disadvantages, compared to the standard SQL and SQL*plus ?  1
When the mutating error will comes? and how it will be resolved?  1
What is the difference between anonymous block and named blocks?  1
How will you a activate/deactivate integrity constraints?  1
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com