Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ONLINE RECRUITMENT
SYSTEM.COM
........WE CARE FOR U
From:-
CERTIFICATE
Subject-in-charge:
Date:
ADBS Theory
DBS:
Data Models:
The ER model employs three basic structures: entity sets, relationship sets, and
attributes.
Entities And Entity Sets:
An entity is an object in the real world that is distinguishable from all other
objects.
Examples: a person, a football club.
Mapping Cardinalities:
Participation Constraints:
A super key is a set of one or more attributes that, taken collectively, uniquely
identify an entity in an entity set.
A super key for which no proper subset is a super key is called a candidate key.
The primary key is the candidate key that is chosen by the designer to uniquely
identify an entity.
An entity set that does not have sufficient attributes to form a primary key is
called a weak entity set.
It must be associated with another entity set, called the identifying or owner
entity set. A weak entity set is said to be existence dependent on the identifying
set.
The relationship associating the weak entity set with the identifying entity set is
called the identifying relationship.
Specialization:
Generalization:
Aggregation:
MEMBER FUNCTIONS:
Type – Date_ty
CREATE TYPES:
1. View - Skills
create or replace type skills as varray(5) of varchar(20) not final;
desc personaldet;
Name Null? Type
----------------------------------------- -------- ----------------------------
GENDER VARCHAR2(5)
MSTATUS VARCHAR2(6)
DOB DATE_TY
3. View – Qualification
create or replace type qualification as object(degree varchar(5), year varchar(4),
univ varchar(20)) not final;
desc qualification
Name Null? Type
----------------------------------------- -------- ----------------------------
DEGREE VARCHAR2(5)
YEAR VARCHAR2(4)
UNIV VARCHAR2(20)
4. View – Qualific
create or replace type qualific as varray(3) of qualification not final;
desc qualific
qualific VARRAY(3) OF QUALIFICATION
Name Null? Type
----------------------------------------- -------- ----------------------------
DEGREE VARCHAR2(5)
YEAR VARCHAR2(4)
UNIV VARCHAR2(20)
5. View – Jobdettemp
create or replace type jobdettemp as object(post varchar(10), jyear number,
area
varchar(10), company varchar(10), exp number) not final;
desc jobdettemp
jobdettemp is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
POST VARCHAR2(10)
JYEAR NUMBER
AREA VARCHAR2(10)
COMPANY VARCHAR2(10)
EXP NUMBER
6. View - Jobdet
create or replace type jobdet as varray(3) of jobdettemp not final;
desc jobdet
jobdet VARRAY(3) OF JOBDETTEMP
JOBDETTEMP is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
POST VARCHAR2(10)
JYEAR NUMBER
AREA VARCHAR2(10)
COMPANY VARCHAR2(10)
EXP NUMBER
7. View - Account
create or replace type account as object(email varchar(40), username
varchar(20), pass
varchar(20)) not final;
desc account
account is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
EMAIL VARCHAR2(40)
USERNAME VARCHAR2(20)
PASS VARCHAR2(20)
8. View - Phone
create or replace type phone as varray(3) of number(10) not final;
desc phone
phone VARRAY(3) OF NUMBER(10)
9. View - Comp
create or replace type comp under account(coid number, cname varchar(20),
cperson
varchar(20), area varchar(20), phoneno phone) not final;
desc comp
comp extends SYSTEM.ACCOUNT
Name Null? Type
----------------------------------------- -------- ----------------------------
EMAIL VARCHAR2(40)
USERNAME VARCHAR2(20)
PASS VARCHAR2(20)
COID NUMBER
CNAME VARCHAR2(20)
CPERSON VARCHAR2(20)
AREA VARCHAR2(20)
PHONENO PHONE
10. View - Name
create or replace type name as object(first varchar(20), middle varchar(20), last
varchar(20)) not final;
desc name
Name Null? Type
----------------------------------------- -------- ----------------------------
FIRST VARCHAR2(20)
MIDDLE VARCHAR2(20)
LAST VARCHAR2(20)
desc cresume
cresume extends SYSTEM.ACCOUNT
Name Null? Type
----------------------------------------- -------- ----------------------------
EMAIL VARCHAR2(40)
USERNAME VARCHAR2(20)
PASS VARCHAR2(20)
CID NUMBER
CNAME NAME
ADDR VARCHAR2(20)
PHONNO PHONE
PDETAILS PERSONALDET
QDETAILS QUALIFIC
JDETAILS JOBDET
SKILL SKILLS
desc jobtemp
jobtemp is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
JID NUMBER
DESCRIPTION VARCHAR2(20)
AREA VARCHAR2(10)
LOCATION VARCHAR2(20)
13. View - Elig
create or replace type elig under jobtemp(degree varchar(5),exp number,skill
skills)
not final;
desc elig
elig extends SYSTEM.JOBTEMP
elig is NOT FINAL
Name Null? Type
----------------------------------------- -------- ----------------------------
JID NUMBER
DESCRIPTION VARCHAR2(20)
AREA VARCHAR2(10)
LOCATION VARCHAR2(20)
DEGREE VARCHAR2(5)
EXP NUMBER
SKILL SKILLS
desc inter
inter extends SYSTEM.JOBTEMP
Name Null? Type
----------------------------------------- -------- ----------------------------
JID NUMBER
DESCRIPTION VARCHAR2(20)
AREA VARCHAR2(10)
LOCATION VARCHAR2(20)
VDATE DATE
VENU VARCHAR2(10)
CREATE TABLES:
1. Table - Acc
create table acc of account(primary key(email,username));
desc acc
Name Null? Type
----------------------------------------- -------- ----------------------------
2. Table - Company
create table company of comp(primary key(coid));
desc company
Name Null? Type
----------------------------------------- -------- ----------------------------
EMAIL VARCHAR2(40)
USERNAME NOT NULL VARCHAR2(20)
PASS VARCHAR2(20)
COID NOT NULL NUMBER
CNAME VARCHAR2(20)
CPERSON VARCHAR2(20)
AREA VARCHAR2(20)
PHONENO PHONE
3. Table - Candidate
create table candidate of cresume(primary key(cid));
desc candidate
Name Null? Type
----------------------------------------- -------- ----------------------------
EMAIL VARCHAR2(40)
USERNAME NOT NULL VARCHAR2(20)
PASS VARCHAR2(20)
CID NOT NULL NUMBER
CNAME NAME
ADDR VARCHAR2(20)
PHONNO PHONE
PDETAILS PERSONALDET
QDETAILS QUALIFIC
JDETAILS JOBDET
SKILL SKILLS
4. Table - Jobs
create table jobs of jobtemp(primary key(jid));
desc jobs
Name Null? Type
----------------------------------------- -------- ----------------------------
5. Table - Interview
create table interview of inter(jid references jobs(jid), primary key(jid));
desc interview
Name Null? Type
----------------------------------------- -------- ----------------------------
6. Table - Eligibility
create table eligiblity of elig(jid references jobs(jid), primary key(jid));
desc eligiblity
Name Null? Type
----------------------------------------- -------- ----------------------------
1. Relation - Posts
create table posts(coid number references company(coid), jid number references
jobs(jid), primary key(coid,jid))
2. Relation - Calls
create table calls(cid number references candidate(cid), jid number references
interview(jid), primary key(cid,jid))
CREATE SEQUENCE:
1. Sequence - setcoid
create sequence setcoid
2 increment by 1
3 start with 100
4 ;
2. Sequence - setcid
create sequence setcid
2 increment by 1
3 start with 1
4 ;
3. Sequence - setjid
create sequence setjid
2 increment by 1
3 start with 1
4 ;
CREATE SYNONYMS :
CREATE VIEWS
desc user_indexes;
desc user_segments;
CREATE TRIGGRS
1 row created.
1 row created.
SQL> insert into posts values ('&coid', '&jid');
Enter value for coid: 120
Enter value for jid: 1
old 1: insert into posts values ('&coid', '&jid')
new 1: insert into posts values ('120', '1')
1 row created.
SQL Queries
1. Account
SQL> select * from acc;
11 rows selected.
2. Candidate
SQL> select * from candidate;
---------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------
viraj JOBDET(JOBDETTEMP('Trainee', 2011, 'IT', 'TCS', 1),
JOBDETTEMP('Manager', 2012, 'IT', 'TCS', 3))
resha JOBDET(JOBDETTEMP('Trainee', 2010, 'Finance', 'TCS', 1),
JOBDETTEMP('Manager', 2011, 'Finance', 'AIRTEL', 2))
namrata JOBDET(JOBDETTEMP('Accountant', 2010, 'Finance', 'INFOSYS', 1),
JOBDETTEMP('Accountant', 2011, 'Finance', 'TCS', 2))
nishad JOBDET(JOBDETTEMP('Trainee', 2011, 'IT', 'AIRTEL', 1),
JOBDETTEMP('Manager', 2012, 'Finance', 'TCS', 2))
pranav JOBDET(JOBDETTEMP('Trainee', 2011, 'Finance', 'INFOSYS', 1),
JOBDETTEMP('Accountant', 2012, 'Finance', 'TCS', 2))
urvish JOBDET(JOBDETTEMP('Trainee', 2011, 'IT', 'PATNI', 1),
JOBDETTEMP('Manager', 2012, 'IT', 'TCS', 2))
USERNAME SKILLS
----------------------- ---------------
viraj SKILLS('Java', 'C')
resha SKILLS('Accounts', 'Java')
namrata SKILLS('Java', 'Accounts')
nishad SKILLS('Java', 'Accounts')
pranav SKILLS('C', 'C++')
urvish SKILLS('Oracle', 'HTML')
6 rows selected.
3. Calls
CID JID
---------- ----------
8 1
8 2
8 4
8 5
15 1
14 2
13 5
13 6
12 4
11 4
11 2
11 rows selected.
4. Company
5. Eligibility
7. Jobs
6 rows selected.