Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
115 views
15 pages
CH - 1 Introduction Relational Model
Uploaded by
jetoki6716
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Ch - 1 Introduction Relational Model For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
115 views
15 pages
CH - 1 Introduction Relational Model
Uploaded by
jetoki6716
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Ch - 1 Introduction Relational Model For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 15
Search
Fullscreen
Index Unit Content Page No No 1 Introduction of Relational model 1 1.1 Codd’s Rules 2 1.2 Relational operations Algebra 4 1.3 Transaction Control Language it 1.4 Data Control Language 32 2 ‘Advanced SQL 15 2.1 Data Types 16 2.2 ROWID pseudo column 18 2.3 DUAL table 19 2.4 Date Functions 19 2.5 Concepts of index 23 2.5.1Types of Index 24 2.5.2 Dropping index 27 2.6 Join Queries 28 2.6.1 Inner join 28 2.6.2 Outer(Left Right, Full) join 29 2.6.3 Cross join 33 2.6.4 Self join 34 2.7 Sub Queries or Nested Queries 34 3 PL/SQL and Conditional Statements 41 3.1 Introduction to PL/SQL (Definition & Block Structure) a 3.2 Variables, Constants and Data Type 4 3.3 Assigning Values to Variables BI 3.4 User Defined Record 52. 3.5 Conditional Statements 56 3.5.1 IF..THEN statement 56 3.5.2 IF...£lse statements 57 3.5.3 Multiple conditions 58 3.5.4 Nested IF statements 59 3.5.5 CASE statements 62 4 Iterative Statements 7, 4.1 Introduction 68 4.1.1 Loop... End Loop 69 4.1.2 For... Loop 4 4.1.3 While Loop 76 4.1.4 EXIT Loop 78 4.1.5 Continue 79" Cursors and Exception Handling 5.1 Concepts of Cursors a 5.1.1 Types of cursors (Implicit & Explicit ) = 5.1.2 Declare, open, fetch and close cursors 4 5.2 Cursor Attributes a 5.3 Exception Handling in PL/SQL 7 5.3.1 Types of Exceptions is 5.3.1.1 Named System Exceptions 7 5.3.1.2 Unnamed System Exceptions ar 5.3.1.3 User-defined Exceptions ca 5.3.2 Exception Handling 106Unit -1 Introduction of Relational model7? Unit-1 introduction of Relational mo 1 1.1 Codd’s Rules Dr. Edgar F. Codd was one popular computer scientist who designed the Relational mya Database management system. Dr. EF. Codd was proposed thirteen rules (zero to twee Database management system and if a Database Management System satisfies more than 7,9r codd rules that can be known as a Relational Database Management System. List of theee 15 Codd’s laws are as follow. for Zero Rule (The Foundation Rule) The database system must be suitable as relational database model. A database system tp become as a relational database management system (RDBMS) that must be uses complete relational abilities to manage data and database. The remain other twelve rules derive from this base rule and List of these 12 Codd’s laws are follow. -———>|_L The information rule [>| 2. Guaranteed access rule —1 3. Systematic treatment of null values -———F 4. Online catalog based on the relational model [1 5. Comprehensive data sub language rule —| nana 6. View undating rule - Af 7. High-level insert. undate. and delete ‘——+| 8. Physical data independence 9. Logical data independence >| 10. Intesritv independence a 11. Distribution independence —_] 12. The non-subversion rule Jump2Learn Publication [www.jump2learn.com]Unit-1 Introduction of Relational model 3 1) The information rule ‘The database holds various data and these data must be stored in a table in the form of rows and columns. For example: we can store the personal information (Name, Address, City, Mobile_No, ‘etc. of student in STUDENT table in the form of rows and columns. ~ 2) Guaranteed access rule = ‘The database holds various data and these data must be accessible with the help of table name, column name and primary key. 3) Systematic treatment of null values The database must allow each field to remain empty (or null). It supports the null value and null value is different from number with value zero as well as empty string. 4) Online catalog(structure) based on the relational model ‘The database must have provision of online and which should be accessible to authorized users using query language (sql). A relational database must be providing the access to database's structure (catalog) with the help of same query language that are used to access the database's data. 5) Comprehensive data sub language rule ‘The database must support at least one database language that consist of database functionality such as data definition, data manipulation, data integrity, data query and database transaction management operation (commit, rollback, Savepoint). 6) View updating rule Data can be presented in different logical combinations called view. All the view should support data manipulation (data insert, data update and data delete) in relational database, 7) High-level insert, update, and delete The relational database system must keep an eye on high-level relational operations such as insert, update, and delete on a multiple row across a multiple table. 8) Physical data independence Physical data independence is used to support for changing any hardware without affecting to database structure. All data stored in a relational database must be physically independent and it is also not affected when changing any hardware in system. Jump2Learn Publication [www,jump2learn.com]Unit-1 Introduction of Relations lel 9) Logical data independence Logical data independencies similar to physical data independence. If any changes happeneg the table structures (logical level), it must not affect the user's viewed data or application day 10)integrity independence The relational database must be supports integrity Independence when we are inserting dag into table's cells using the SQL query language. A database must be independent than thy application that uses it Allintegrty constraints can be individually modified without the affecting the application. 11)Distribution independence If portion of database exist in multiple location and then it must be possible to perform relations) operations (insert, update, delete, etc.) upon it that is known as Distribution independence, 12)The non-subversion rule The database structure (catalog) should not be modifying without use of database language such as SQL. 1.2 Relational operations Algebra Relational algebra is the procedural query language which takes relation as input and produce relation as output. It provides a step by step procedure to get the result of the query. There are two types of operator can be used such unary or binary. The primary operations that we can perform using relational algebra are as follow: Relational Select Project Union Iintersectio. | Rename | Cartesian Differences i ne Jump2Learn Publication [www.jump2learn.com]Unit-1 Introduction of Relational model 5 1) Select Operation The select operation selects number of rows based on given conditions. The select operation is denoted by sigma (0). Notation (syntax) of select operation is denoted by: o p(r). Where: iis used for selection statement (select). ris used for name of relation (table). p is used for logical formulas or conditions ( using logical operators such as AND, OR and NOT as well as relational operators such as =, #, 2, <,>, S.). Suppose we have one Employee relation(table) with data that are as follows: Emp_No | Emp_Name Emp_Age | Emp_ Mobile_No 101 Rajesh 36 Surat 9510103123 102 Vaibhav 38 Surat 19510104123 103 ‘Sonal 37 Vadodara {9510105123 104 ‘Swara 5 Bharuch 19510106123 105 Darshan 30 Vadodara 9510107123 Example 4: - Now we want to fetch data from Employee table with whose age more than 36. Gage >= 36 (Employee) This select operation will select the rows from Employee table, for which age will be greater than or equal 36. Output: Emp_No | Emp_Name Emp_Age __| Emp_City Mobile_No 102 Rajesh 36 Surat ‘9510103123 102 Vaibhav 38 Surat ‘9510104123 103 Sonal 7 Vadodara 9510105123 ‘we can also usethe logical operators to specify more than one conditions as follow. Example 2: © age >= 36 and city = ‘Surat’ (Employee) ‘This select operation will return rows from Employee table with information of Employee whose city name is Surat and age more than 36. Jump2Learn Publication [www.jump2learn.com]2) 3) Introduction of Relationa) el Output: - Emp_No | Emp_Name Emp_Age — | Emp_Ccity Mobile No 101 Rajesh 36 Surat 9510103193 102 Vaibhav 38 Surat 9510104133 Project Operation Project operation is used to display only selected attributes asa result and rest ofthe attributes are not included in result. Project operation is denoted by TI.Notation (syntax) of Proje, operation is denoted by: TT A1, A2,... An. (r) Where: TI is used for Project operation. used for name of relation (table). Al, A2, Anis used as an attribute name of relation (table) r. Example 4:- Now we want to fetch only two attribute Name and City from Employee table. TIEmp_Name, Emp_City (Employee) This select operation will select only two attributes with all rows from Employee table. Output: - Emp_Name Emp_Ccity Rajesh ‘Surat Vaibhav Surat ‘Sonal ‘Vadodara ‘Swara Bharuch Darshan Vadodara Union Operation The union operation contains all the rows that are either in R or S or both in R & S. Urion ‘operation removes the duplicate rows from R and S. It is denoted by U. Notation (syntax) of union operation is denoted by: RUS a a Se ee Jump2Learn Publication [www.jump2learn.com]ional model 1 ‘Aunion operation must hold the condition such as R and S must have the attribute of the same type and Duplicate rows are removed automatically. We have two relations as follow. Depositor table: Name ‘Account_No Rajesh Vaibhav ‘Sonal ‘Swara Darshan Borrower table: alsfolale Name. Loan_No Rajesh 10 Minesh 20 Foram 30 Example 1:- TI Name (Depositor) U TT Name (Borrower) Output: ~ Name Rajesh Vaibhav ‘Sonal ‘Swara Darshan FMinesh Foram 4) Intersection Operation ‘The intersection operation contains all the rows that are in both R or S. Intersection operation only retrieves the common rows from R and S. It is denoted by /. Notation (syntax) of _ intersection operation is denoted by: R 1 S. We have two relations as follow. Jump2Learn Publication [www.jump2learn.com]Unit-1 Introduction of Relational my q Depositor table: Name ‘Account_No Rajesh Vaibhav ‘Sonal ‘Swara Darshan alalelale Borrower table: Name Loan_No Rajesh 10 Minesh 20 Foram 30 Example TI Name (Depositor) n TT Name (Borrower) Output: - Name Rajesh 5) Differences Operation The set difference operation contains all tuples that are in R but not in S. It is denoted by intersection minus (-). Notation (syntax) of differences operation is denoted by: R~S. We have two relations as follow. Depositor table: Name ‘Account_No Rajesh ‘Vaibhav ‘Sonal ‘Swara Darshan alalelsfe EEE Jump2Learn Publication [www.jump2learn.com]6) Unit-1 Introduction of Relational model Borrower table: Name toan_No Rajesh 10 Minesh 20 Foram 30 Example 1: - TIName (Depositor) - T] Name (Borrower) Output: - Name Vaibhav ‘Sonal ‘Swara Darshan Rename Operation ‘The rename operation Is used to rename the output relation. It is denoted by p. Notation (syntax) of rename operation is denoted by: p(Name_of_New_Relation, Name_of_Old_Relstion) Example 1: We can use the rename operator to rename Employee relation to Emp. (Emp, Employee) Output: - Emp Relation(table) after rename operation. ‘Emp_No | Emp_Name Emp_Age Emp_City Mobile_No- [101 Rajesh 36 Surat {9510103123 102 | Vaibhav 38 Surat 9510104123 103 | Sonal 7 Vadodara 9510105123 10a ‘| Swara 25 Bharuch 9510106123 105 ‘| Darshan 30 Vadodara 9510107123, Jump2Learn Publication [www,jump2learn.com]5 Unit-t Introduction of Rey Cartesian product Operation ; ‘The Cartesian product operation fs used to combine each row in one table with egg, other table, Its also known asa cross product operation. It's denoted by X. Notation on Cartesian product operation is denoted by: EXD ‘We can use the Cartesian Product Operation with Employee Relation Dept_details Felatig Employee relation Emp_No | Emp_Name Emp_Age 101 Rajesh 36 102 Vaibhav 38 103 Sonal 37 Dept_Details relation Dept_Name Emp_Salary BCA 51000 BBA 52000 BCOM 53000 Example 1:- Employee X Dept_Details Output: - Emp_No | Emp_Name Dept_Name | Emp_Salary 101 Rajesh BCA 51000 101 Rajesh BBA 52000 101 Rajesh BCOM 53000 102 Vaibhav BCA ‘51000 102 Vaibhav BBA 52000 102 38 8COM 53000 103 37 BCA 51000 103 37 ‘BBA 52000 103 7 BCOM 53000 — ——— Jump2Learn Publication [www.jump2iearn.com]Unita Introduction of Relational model a .3Transaction control language ‘The series of operation perform on oracle table data is called oracle transaction. Transaction Control Language(TCL) commands are used to handle the transactions in the database. There are main three type of transactions. 4) COMMIT 2) SAVEPOINT 3) ROLLBACK 1) COMMIT sf ‘The commit ends the current transaction and save the changes made during the transaction. The commit is also used to save modification mad during the transaction. Syntax Commit; Example: Commit 2) SAVEPOINT Savepoint is used to create the point within oracle transactions and also save the all current transactions are done. We can rollback latter since specified savepoint. Syntax: - ‘Savepoint
; Exampl insert into Employee values(106,'sagar’,44,'surat’,9510108123); savepoint sp; insert into Employee values (107,'parth’,42,'vapi', 9510109123); rollback to savepoint sp; Output: (select * from Employee) _ Emp_No | Emp_Name Emp_Age | Emp_City ‘Mobile_No 101 Rajesh 36 Surat 9510103123 102, Vaibhav 38 Surat ‘9510104123 103 ‘Sonal EV Vadodara ‘9510105123 104 ‘Swara 25 =| Bharuch ‘9510106123, 105 Darshan 30 Vadodara 9510107123 106 Sagar 4a ‘Surat 9510108123 Jump2Learn Publication [www.jump2learn.com]1 Unit-1 Introduction of Relational mode) 3) ROLLBACK Rollback does exactly the opposite of commit. It ends the transaction but undoes(undo) any changes made during the transaction, Syntax: - Rollback [to {save point]
]; Example 1: Rollback; Example 2: Rollback to savepoint sp; 1.4 Data Control language: Oracle provides security features for data store in table Data Control Language(DCL) commands are used to handle the database security when we working on single database with multiple user environment. There are two types of DCL commands or privileges are as follow. 1) GRANT 2) REVOKE 1) GRANT GRANT command used to give the access permission or privileges on the database objects to the users based on object privileges given to particular user. ‘ON
TO
[WITH GRANT OPTION] Object Privileges, Object privilege name is the access right or privilege granted to the user. List of the privileges such as SELECT, INSERT, UPDATE, DELETE, ALTER, INDEX. Object Name Object name is the name of database object like TABLE, VIEW, STORED PROCEDURE and SEQUENCE. User Name User name is the name of the user to whom an access right or privilege is being granted. WITH GRANT OPTION Jump2Learn Publication [www,jump2learn.com]2) n of Relation: al mode| 2 IT " ‘The “WITH GRANT OPTION” allows a user to grant access rights or privilege to other users, Example: GRANT select, insert ON Employee TO system; REVOKE The REVOKE command is used to take back access rights or privileges from the user that is given by the GRANT command on the database objects. Syntax: - REVOKE
ON
FROM < User Name> Example: REVOKE select, insert ON Employee FROM system; In this example, REVOKE command is used to revoke the object privileges those are granted by the GRANT command such as the SELECT and INSERT privileges on Employee table from system. ‘When you REVOKE SELECT and INSERT privilege on a table from a user (system), the user will not be able to SELECT and INSERT data from that table Employee. The REVOKE command cannot be used to revoke the access right or privileges granted by the operating system. Jump2Learn Publication [www.jump2learn.com]
You might also like
CPPM - 104 PDF
PDF
100% (1)
CPPM - 104 PDF
7 pages
DBMS Practical Solution PDF
PDF
100% (1)
DBMS Practical Solution PDF
19 pages
SCDL - Data Mining
PDF
100% (3)
SCDL - Data Mining
89 pages
Mba Syllabus Telangana University
PDF
No ratings yet
Mba Syllabus Telangana University
33 pages
Dbms Lab Manual
PDF
No ratings yet
Dbms Lab Manual
43 pages
Mining Social Network Graphs
PDF
No ratings yet
Mining Social Network Graphs
35 pages
Query Processing and Optimization
PDF
No ratings yet
Query Processing and Optimization
42 pages
Object Oriented Programming (OOPs)
PDF
No ratings yet
Object Oriented Programming (OOPs)
4 pages
Practical Questions Mysql For Record 2023-24
PDF
0% (1)
Practical Questions Mysql For Record 2023-24
4 pages
CH-1 (I) Introduction To DBMS
PDF
No ratings yet
CH-1 (I) Introduction To DBMS
26 pages
Functional Dependency
PDF
No ratings yet
Functional Dependency
96 pages
DBMS Unit-5
PDF
No ratings yet
DBMS Unit-5
33 pages
System Analysis and Design Notes For Bca 2nd Semester Vbspu
PDF
No ratings yet
System Analysis and Design Notes For Bca 2nd Semester Vbspu
20 pages
DBMS Notes
PDF
No ratings yet
DBMS Notes
367 pages
Information Technology Management Practical Files
PDF
No ratings yet
Information Technology Management Practical Files
57 pages
Relational Algebra
PDF
No ratings yet
Relational Algebra
61 pages
Unit 3 Pre
PDF
No ratings yet
Unit 3 Pre
22 pages
CN Question Answers 2023 For BCA
PDF
No ratings yet
CN Question Answers 2023 For BCA
28 pages
Unit-Iv-Transaction Concept
PDF
No ratings yet
Unit-Iv-Transaction Concept
50 pages
DBMS Unit-6
PDF
No ratings yet
DBMS Unit-6
47 pages
Dbms Lab Manual RGPV
PDF
No ratings yet
Dbms Lab Manual RGPV
38 pages
SQL Notes by Apna College
PDF
No ratings yet
SQL Notes by Apna College
29 pages
Practical V - PYTHON
PDF
No ratings yet
Practical V - PYTHON
50 pages
SQL Practice EMPLOYEE Table Created
PDF
No ratings yet
SQL Practice EMPLOYEE Table Created
20 pages
Shubhangi0 PDF
PDF
100% (1)
Shubhangi0 PDF
68 pages
Database Concept
PDF
No ratings yet
Database Concept
11 pages
Keys in Rdbms With Examples
PDF
No ratings yet
Keys in Rdbms With Examples
11 pages
Adina Institute of Science & Technology: Department of Computer Science & Engg. M.Tech CSE-II Sem Lab Manuals MCSE - 203
PDF
100% (1)
Adina Institute of Science & Technology: Department of Computer Science & Engg. M.Tech CSE-II Sem Lab Manuals MCSE - 203
22 pages
Failure Classification in DBMS
PDF
No ratings yet
Failure Classification in DBMS
2 pages
Structured Programming Approach
PDF
No ratings yet
Structured Programming Approach
1 page
Chapter 1 Introduction To Databases and Transactions
PDF
No ratings yet
Chapter 1 Introduction To Databases and Transactions
47 pages
Unit-Iv-Mca-305-Advanced DBMS
PDF
No ratings yet
Unit-Iv-Mca-305-Advanced DBMS
15 pages
Normalization Notes by Mahendra Patil
PDF
100% (1)
Normalization Notes by Mahendra Patil
18 pages
Unit - V: Advanced Topics
PDF
No ratings yet
Unit - V: Advanced Topics
92 pages
Advanced Data Base Manegment: Assignment 1
PDF
No ratings yet
Advanced Data Base Manegment: Assignment 1
5 pages
Data Structure Previous Year Paper - B.C.A Study
PDF
No ratings yet
Data Structure Previous Year Paper - B.C.A Study
4 pages
Unit 1
PDF
No ratings yet
Unit 1
18 pages
BICTE Dbms Important Questions
PDF
No ratings yet
BICTE Dbms Important Questions
14 pages
Relational Algebra
PDF
No ratings yet
Relational Algebra
13 pages
BCA-302 - UNIT-II Notes
PDF
No ratings yet
BCA-302 - UNIT-II Notes
26 pages
LAB Set Questions Rdbms
PDF
No ratings yet
LAB Set Questions Rdbms
18 pages
BICTE Dbms Sol
PDF
No ratings yet
BICTE Dbms Sol
7 pages
Unit-5 Control Statements
PDF
No ratings yet
Unit-5 Control Statements
16 pages
Unit-3 Part 1 Normalization
PDF
No ratings yet
Unit-3 Part 1 Normalization
31 pages
Dbms Assignment 2 Subhamoy Ghosh 6035
PDF
No ratings yet
Dbms Assignment 2 Subhamoy Ghosh 6035
16 pages
DataWarehouseMining Complete Notes
PDF
No ratings yet
DataWarehouseMining Complete Notes
55 pages
Normal Forms
PDF
No ratings yet
Normal Forms
19 pages
ADBMS-UNIT-3 - Functional Dependency
PDF
No ratings yet
ADBMS-UNIT-3 - Functional Dependency
9 pages
Manual For DBMS LAB
PDF
No ratings yet
Manual For DBMS LAB
82 pages
RDBMS Notes
PDF
No ratings yet
RDBMS Notes
4 pages
Normalization and Functional Dependency
PDF
No ratings yet
Normalization and Functional Dependency
14 pages
Chapter 6: Integrity Constraints: Domain Constraints Referential Integrity Assertions Triggers Functional Dependencies
PDF
No ratings yet
Chapter 6: Integrity Constraints: Domain Constraints Referential Integrity Assertions Triggers Functional Dependencies
18 pages
BCA I Year Digital Computer Oragnisation Practice Questions
PDF
No ratings yet
BCA I Year Digital Computer Oragnisation Practice Questions
6 pages
Model Test Paper Dbms
PDF
No ratings yet
Model Test Paper Dbms
14 pages
Dbms Practical
PDF
0% (1)
Dbms Practical
2 pages
Database Management Systems
PDF
No ratings yet
Database Management Systems
2 pages
Dbms Lab Manual
PDF
No ratings yet
Dbms Lab Manual
19 pages
File Systems and Databases: Database Systems: Design, Implementation, and Management, 4th Edition
PDF
No ratings yet
File Systems and Databases: Database Systems: Design, Implementation, and Management, 4th Edition
50 pages
Practical List of DBMS
PDF
No ratings yet
Practical List of DBMS
19 pages
DBMS Kshitij Jain Nidhi Part 1
PDF
No ratings yet
DBMS Kshitij Jain Nidhi Part 1
106 pages