Posts

Showing posts from July, 2022

Packages

 A package can be defined as a collection of related program objects such as procedures, functions, and associated cursors and variables together as a unit in the database. In simpler term, a package is a group of related procedures and functions stored together and sharing common variables, as well as local procedures and functions. A package contains two separate parts: the package specification and the package body. The package specification and package body are compiled separately and stored in the data dictionary as two separate objects. The package body is optional and need not to be created if the package specification does not contain any procedures or functions. Applications or users can call packaged procedures and functions explicitly similar to standalone procedures and functions. Advantages of Packages Packages offer a lot of advantages. They are as follows. 1. Stored packages allow us to sum up (group logically) related stored procedures, variables, and data types, an...

PL/SQL

 Comments Comments are used in the PL/SQL program to improve the readability and understandability of a program. A comment can appear anywhere in the program code. The compiler ignores comments. Generally, comments are used to describe the purpose and use of each code segment. A PL/SQL comment may be a single-line or multiline. Single-Line Comments Single-line comments begin with a double hyphen (–) anywhere on a line and extend to the end of the line. Example – start calculations Multiline Comments Multiline comments begin with a slash-asterisk (/*) and end with an asteriskslash (*/), and can span multiple lines. Example /* Hello World! This is an example of multiline comments in PL/SQL */ Variables and Constants Variables and constants can be used within PL/SQL block, in procedural statements and in SQL statements. These are used to store the values. As the program executes, the values of variables can change, but the values of constants cannot. However, it is must to declare the...

Structured Query Language

 Structured Query Language SQL stands for “Structured Query Language.” The Structured Query Language is a relational database language. By itself, SQL does not make a DBMS. SQL is a medium which is used to communicate to the DBMS. SQL commands consist of English-like statements which are used to query, insert, update, and delete data. English-like statements mean that SQL commands resemble English language sentences in their construction and use and therefore are easy to learn and understand. SQL is referred to as nonprocedural database language. Here nonprocedural means that, when we want to retrieve data from the database it is enough to tell SQL what data to be retrieved, rather than how to retrieve it. The DBMS will take care of locating the information in the database. Commercial database management systems allow SQL to be used in two distinct ways. First, SQL commands can be typed at the command line directly. The DBMS interprets and processes the SQL commands immediately, an...

Advantages of ER Modeling

 An ER model is derived from business specifications. ER models separate the information required by a business from the activities performed within a business. Although business can change their activities, the type of information tends to remain constant. Therefore, the data structures also tend to be constant. The advantages of ER modeling are summarized later: 1. The ER modeling provides an easily understood pictorial map for the database design. 2. It is possible to represent the real world problems in a better manner in ER modeling. 3. The conversion of ER model to relational model is straightforward. 4. The enhanced ER model provides more flexibility in modeling real world problems. 5. The symbols used to represent entity and relationships between entities are simple and easy to follow. Summary This chapter has described the fundamentals of ER modeling of data. An ER model is a logical representation of data. The ER model was introduced Review Questions 61 by Peter Chen in 1...

Entity–Relationship Model

 2.1 Introduction Peter Chen first proposed modeling databases using a graphical technique that humans can relate to easily. Humans can easily perceive entities and their characteristics in the real world and represent any relationship with one another. The objective of modeling graphically is even more profound than simply representing these entities and relationship. The database designer can use tools to model these entities and their relationships and then generate database vendor-specific schema automatically. Entity–Relationship (ER) model gives the conceptual model of the world to be represented in the database. ER Model is based on a perception of a real world that consists of collection of basic objects called entities and relationships among these objects. The main motivation for defining the ER model is to provide a high level model for conceptual database design, which acts as an intermediate stage prior to mapping the enterprise being modeled onto a conceptual level. T...