×
Yes studying sucks... But NO, NOT more than FAILURE.
--Your friends at LectureNotes
Close

Database Management System

by Md Wesh Karni
Type: PracticalInstitute: Biju Patnaik University of Technology BPUT Course: MCA Specialization: Master of Computer ApplicationsViews: 52Uploaded: 1 year agoAdd to Favourite

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

Md Wesh Karni
Md Wesh Karni
1​ ​table​ ​created Name CNAME CITY ADDRESS PHONE AFDATE Null? NOT​ ​NULL Type VARCHAR2(20) VARCHAR2(10) VARCHAR2(20) NUMBER(10) DATE 1​ ​table​ ​created Name SID SNAME SADDRESS CONTACTS 1​ ​table​ ​created Name Null? NOT​ ​NULL Null? SID CNAME DEPT DOJ POST SALARY 1. Type NUMBER(2) VARCHAR2(20) VARCHAR2(20) NUMBER(10) Type NUMBER(2) VARCHAR2(20) VARCHAR2(30) DATE VARCHAR(20) NUMBER(7,2) Using​ ​the​ ​following​ ​database: Colleges​ ​(​cname​,​ ​city,​ ​address,​ ​phone,​ ​afdate) 1
Staffs​ ​(​sid​,​ ​sname,​ ​saddress,​ ​contacts) StaffJoins​ ​(sid,​ ​cname,​ ​dept,​ ​DOJ,​ ​post,​ ​salary) Teachings​ ​(sid,​ ​class,​ ​paperid,​ ​fsession,​ ​tsession) Subjects​ ​(​paperid​,​ ​subject,​ ​paperno,​ ​papername) Write​ ​the​ ​following​ ​statements​ ​for​ ​the​ ​following:i. Create​ ​the​ ​above​ ​tables​ ​with​ ​the​ ​given​ ​specifications​ ​and constraints. CREATE​ ​TABLE​ ​Colleges ( cname​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(20)​ ​ ​ ​ ​ ​ ​ ​ ​primary​ ​key, city​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(10), address​ ​ ​ ​ ​ ​ ​ ​varchar2(20), phone​ ​ ​ ​ ​ ​ ​ ​ ​ ​number(10), afdate​ ​ ​ ​ ​ ​ ​ ​ ​ ​date ); DESC​ ​Colleges; CREATE​ ​ ​ ​TABLE​ ​ ​ ​Staffs ( sid​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​number(2)​ ​ ​ ​ ​ ​ ​ ​ ​primary​ ​key, sname​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(20), saddress​ ​ ​ ​ ​ ​ ​varchar2(20), contacts​ ​ ​ ​ ​ ​ ​ ​number(10) ); DESC​ ​Staffs; CREATE​ ​ ​ ​TABLE​ ​ ​ ​StaffJoins ( sid​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​number(2)​ ​ ​ ​ ​ ​references​ ​Staffs, cname​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(20)​ ​ ​ ​ ​ ​references​ ​Colleges, dept​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(30), DOJ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​date, post​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(20), salary​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​number(7,2) ); DESC​ ​StaffJoins; 2
1​ ​table​ ​created Name SID CLASS PAPERID FSESSION TSESSION Null? 1​ ​table​ ​created Name PAPERID SUBJECT PAPERNO PAPERNAME CNAME Disha​ ​college Durga​ ​college Daga​ ​college Central​ ​college Chanakya​ ​college Palloti​ ​college Harishankar​ ​college Mats​ ​college Degree​ ​Girls​ ​college RIT Null? NOT​ ​NULL CITY Raipur Raipur Bhilai Raipur Bhilai Raipur Raipur Raipur Bhilai Raipur ADDRESS Ram​ ​Nagar,​ ​Kota K.K​ ​Road Civil​ ​Lines Fafadih G.E​ ​Road Pandri Shankar​ ​Nagar Pandri G.E​ ​Road G.E​ ​Road 10​ ​rows​ ​inserted CREATE​ ​ ​TABLE​ ​ ​Teachings ( sid​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​number(2)​ ​ ​ ​ ​ ​references​ ​Staffs, class​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(10), 3 Type NUMBER(2) VARCHAR2(10) VARCHAR2(10) DATE DATE Type VARCHAR2(10) VARCHAR2(40) VARCHAR2(10) VARCHAR2(20) PHONE 4205553 4202253 4658457 9654821565 6548325 9853254185 2565486 4596658 6583245 4598544 AFDATE 30-JUN-00 30-JAN-75 30-AUG-95 15-MAY-04 02-JUL-03 03-SEP-90 04-OCT-65 05-NOV-04 06-DEC-92 07-FEB-96
paperid​ ​ ​ ​ ​ ​ ​varchar2(10), fsession​ ​ ​ ​ ​ ​date, tsession​ ​ ​ ​ ​ ​date ); DESC​ ​Teachings; CREATE​ ​TABLE​ ​Subjects ( paperid​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(10)​ ​ ​ ​ ​ ​ ​ ​ ​primary​ ​key, subject​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(40), paperno​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(10), papername​ ​ ​ ​ ​ ​ ​ ​ ​ ​varchar2(20) ); DESC​ ​Subjects; ii. Insert​ ​about​ ​10​ ​rows​ ​as​ ​appropriate​ ​to​ ​solve​ ​the​ ​following queries. INSERT​ ​INTO​ ​Colleges​ ​VALUES ( ‘&cname’, ‘&city’, ‘&address’, ‘&phone’, ‘&afdate’ ); SID 01 02 03 04 SNAME Mandeep Suyash Bhawana Bhoj SADDRESS Raipur Raipur Raipur Raigarh 4 CONTACTS 9301619104 9893180320 2564813 9986548521

Lecture Notes