You are on page 1of 51
What is DBMS? » A database management system (DBMS) is a collection of programs that manages the database structure and controls access to the data stored in the database. » Database management system is a software which is used to manage the database. For example: MySQL, Oracle etc. Advantages of DBMS » Data Independence Provides an abstract view of data that hide such details » Efficient Data Access To store & retrieve the data » Data Integrity & Security Access controls to different class of users » Minimize redundancy same data store at different place » Concurrent Access & crash Recovery data is updated correctly and appropriately when multiple transactions are concurrently executed Reduced Application Development Time Table » Table is a collection of data which is organized in terms of rows and columns. In DBMS, the table is known as relation and row as a tuple. » Table is a simple form of data storage. A table is also considered as a convenient representation of relations. Types of Relationship in DBMS » One to One relationship + One to many or many to one relationship » Many to many relationships One to One Relationship (1:1) » It is used to create a relationship between two tables in which a single row of the first table can only be related to one and only one records of a second table. Similarly, the row of a second table can also be related to anyone row of the first table. Following is the example to show a relational database, as shown below. Custeme(Table A) orés(Table B) One to Many Relationship » It is used to create a relationship between two tables. Any single rows of the first table can be related to one or more rows of the second tables, but the rows of second tables can only relate to the only row in the first table. It is also known as a many to one relationship. » Representation of One to Many relational databases: Person (Table AD Games( Table B) |__Hanry. Luna Beis Many to Many Relationship » It is many to many relationships that create a Petorsna between two tables. Each record of the first table can relate to any records (or no records) in the second table. Similarly, each record of the second table can also relate to more than one record of the first table. It is also represented an N:N relationship. For example, there are many people involved in each project, and every person can involve more than one project. » PHYSICAL VIEW deals with actual physical arrangement & location of data in the Direct Access Storage Devices. » Database Specialists use this view to make efficient use of storage & processing resources. Database Views » LOGICAL VIEW of a database represents data in a format that is meaningful to user & to the s/w program that process those data. It tells us to what is in the database. » Logical view refers to the way user views the data & Physical view refers to the way data are physically stored & processed. Types of attribute ~ ’ aa Sa v ¥ v Simple Attributes Composite Attributes Single Valued Attributes Multivalued Attributes ttributes Derived A tes Complex Attribu Key Attributes stored attributes Participation Constraint » Participation Constraint is applied to the entity participating in the relationship set. 1. Total Participation - Each entity in the entity set must participate in the relationship. If each student must enroll in a course, the participation of students will be total. Total participation is shown by a double line in the ER diagram. 2. Partial Participation - The entity in the entity set may or may NOT participate in the relationship. If some courses are not enrolled by any of the students, the participation in the course will be partial. Participation Constraint » The diagram depicts the ‘Enrolled in’ relationship set with Student Entity set having total participation and Course Entity set having partial participation. m ‘i ——_ Student Enrolled in Course Generalization » Generalization is like a bottom-up approach in which two or more entities of lower level combine to form a higher level entity if they have some attributes in common. In generalization, an entity of a higher level can also combine with the entities of the lower level to form a further higher level entity. Generalization is more like subclass and superclass system, but the only difference is the approach. Generalization uses the bottom-up approach. In generalization, entities are combined to forma more generalized entity, i.e., subclasses are combined to make a superclass. Example of Generalization Person Faculty Student | Specialization » Specialization is a top-down approach, and it is opposite to Generalization. In specialization, one higher level entity can be broken down into two lower level entities. » Specialization is used to identify the subset of an entity set that shares some distinguishing characteristics. » Normally, the superclass is defined first, the subclass and its related attributes are defined next, and relationship set are then added. Example of Specialization EMPLOYEE | TESTER DEVELOPER Aggregation » In aggregation, the relation between two entities is treated as a single entity. In aggregation, relationship with its corresponding entities is aggregated into a higher level entity. For example: Center entity offers the Course entity act as a single entity in the relationship which is in a relationship with another entity visitor. In the real world, if a visitor visits a coaching center then he will never enquiry about the Course only or just about the Center instead he will ask the enquiry about both. Center ~}———~<_ offer >——— Course enquire eo” @ &=& &=©#}§©=£ 2)—6rV... Examples of ER Diagram | _Z » Cardinality tells you the maximum number of times that an instance of an entity can be associated with instances of the other entity. Modality tells you the minimum number of times that the instance can be associated with instances of the other entity. Note that most of the time you can just use the word cardinality. These indicators are shown on both ends of the relationship line so that you can see how the entities relate to each other. Cardinality » One —____ + » Many ——_—__« You can see from this line just where the name “crow’s foot” came from. » Zero or many ————o« A zero or many relationship means that it is optional. There might not be any connection between the entities, or there might be one or more. Cardinality » One or many ee The “one” indicates that this is not an optional relationship, although there might be more than one. » One and only one ee No more than one relationship is possible between instances. » Zero or one —————————0+ Another optional relationship, with a maximum of one. Functional Dependency The functional dependency is a relationship that exists between two attributes. It typically exists between the primary key and non-key attribute within a table. x- ¥ The left side of FD is known as a determinant, the right side of the production is known as a dependent. For example: Assume we have an employee table with attributes: Emp_ld, Emp_Name, Emp_Address. » Here Emp_id attribute can uniquely identify the Emp_Name attribute of employee table because if we know the Emp_id, we can tell that employee name associated with it. Functional dependency can be written as: Emp_id — Emp_Name We can say that Emp_Name is functionally dependent on Emp_id. Normal Forms in DBMS Normalization is the process of minimizing redundancy from a relation or set of relations. Redundancy in relation may cause insertion, deletion, and update anomalies. So, it helps to minimize the redundancy in relations. Normal forms are used to eliminate or reduce redundancy in database tables. Normalization Process YNOWUAWNO » Relations can fall into one or more categories (or classes) called Norma/ Forms » Normal Form: A class of relations free from a certain set of modification anomalies. » Normal forms are given names such as: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) Boyce Codd normal form (BCNF) Fourth normal form (4NF) Fifth normal form (SNF) Domain Key normal form (DK/NF) These forms are cumulative. A relation in Third normal form is also in 2NF and INF. Normalization Advantages of Normalization » Normalization helps to minimize data redundancy. » Greater overall database organization. » Data consistency within the database. » Much more flexible database design. » Enforces the concept of relational integrity What do we need Normalization for? To solve these issues: Anomalies 1- Update Anomaly: Let say we have 10 columns in a table out of which 2 are called employee Name and employee address. Now if one employee changes it’s location then we would have to update the table. But the problem is, if the table is not normalized one employee can have multiple entries and while updating all of those entries one of them might get missed. 2- Insertion Anomaly: Let’s say we have a table that has 4 columns. Student ID, Student Name, Student Address and Student Grades. Now when a new student enroll in school, even though first three attributes can be filled but 4th attribute will have NULL value because he doesn't have any marks yet. 3- Deletion Anomaly: This anomaly indicates unnecessary deletion of important information from the table. Let’s say we have student’s information and courses they have taken as follows (student ID,Student Name, Course, address). If any student leaves the school then the entry related to that student will be deleted. However, that deletion will also delete the course information even though course depends upon the school and not the student. Sn RQ oo wees ¢ Data Storage Management © One of the most important tasks for DBMS is to create a database for complex data and manage the data. It gives relief to the user by creating a structure for the complex data sets so that users can access it and manipulate them very easily. © Modern database systems not only provide storage for the data but they store and manage the metadata (data of data) like data procedural rules, validation tules efc. DBMS also provides performance tuning. which makes accessing data faster and easier. 0 Security Management o Security is another aspect which is handled by the Database Management Systems. > Database systems provide a high level of security measures using various security algorithms to keep the data safe and ensure the data privacy. > There are certain security rules that ensure what data can be accessed from the database and which user can access it. o It also makes sure what operations (read, write, delete) can be performed on the specific data. It is very important for the organizations where multi- user databases are required. 0 Backup and Recovery Management To keep the data safe and ensure the integrity, the database system provides the features for backup and recovery management. 9 If the system fails due to some reason then it recovers the data and keeps the data safe. oe Database Access Language Programming Interface DBMS provides a database access language which is also called a query language. © Query languages are non-procedural languages used to access the database and manipulate the data. SQL is an example of a query language. The majority of DBMS vendors provide the support of various query languages to access the data. and Application I > Data Dictionary Management Data dictionary management is also useful functionality provided by the Database Management System In the data dictionary, it stores the data and its related information about ils relationship. $0, a data dictionary keeps the data structures and their relationships with other data, s0 thal g programmer is not responsible for storing the relationship in the database through complex coding DBMS provides the data abstraction and removes the dependency of the data from the system. Data Transformation and Presentation © DBMS provides the functionality of data transformation, which means programmers need not worry about the logical and physical representation of the data, DBMS stores the data in the determined data structure. For example, if a user asks for the date from a database and he tecelves it as 14 December 2022, bul in the database, It is stored in different columns of month, date and year. Multi User Access Control @ Multi User Access control is another feature which is provided by the modem Database Systems. © So, more than one user can access the database at the same time without any problem. This feature makes sure the integrity of the data present in the database. It also follows the ACID property, so the database will be consistent while multiple users are accessing it concurrently. 9 It is very useful for the database of organizations where multiple database engineers are working ‘Midian functionalities e Data Integrity Management © Database systems provide data integrity management by maximizing the data consistency and minimizing the data redundancy. © The data dictionary is the feature database system used to store the relationships of the data to keep the data integrity. Data integrity is needed where a transaction based database system is present. © Database Communication Interface o When a user requests data from the database, it uses some environments like browsers (Chrome or Firefox etc.) to get the data, © Anend user can access data in the following ways: |f he asks for the data through any form and sends the request. © He can get the data if DBMS publishes the data on any website without asking him. © He can get the data through a third party distribution network. ah atabase Memory Management Oracle [ © Memory management involves maintaining optimal sizes for the Oracle instance memory structures as demands on the database change. Oracle Database manages memory based on the settings of memory-related initialization parameters. © The basic options for memory management are as follows: © Automatic memory management > You specify the target size for the database instance memory. The instance automatically tunes to the target memory size, redistributing memory as needed between the SGA and the instance PGA. © Automatic shared memory management » This management mode is partialy automated. You set a target size for the SGA and then have the option of setting an aggregate target size for the PGA or managing PGA work areas individually. © Manual memory management Instead of setting the total memory size, you set many initialization parameters fo manage components of the SGA and instance PGA individually. If you create a database with Database Configuration Assistant (DBCA) and choose the basic installation option, then automatic memory management is the default. Basic Memory Structures Oracle Database includes several memory areas, each of which contains multiple subcomponents. The basic memory structures associated with Oracle Database include: System global area (SGA) © The SGA is a group of shared memory structures, known as SGA components, that contain data and contro} information for one Oracie Database instance. All server and background processes share the SGA, Program global area (PGA) © A PGA is a non shared memory region that contains dota and control information exclusively for use by an Oracle process, Oracle Database creates the PGA when an Oracle process starts. © One PGA exists for each server and background process. The collection ‘of individual PGAs is the fofal instance PGA. or ance PGA. Database initialization parameters set the size of the instance PGA, nof individual PGAs. User global area (UGA) © The UGA is memory associated with o user session. Software code areas © Software code areas are portions of memory used to store code that is being run orcan be run. © Oracle Database code is stored in a software area that is typically at a different location from user programs—a more exclusive or protected location. Views o Views are customized presentations of data in one or more tables or other views. 0 A view can also be considered a stored query. Views do not actually contain data. Rather, they derive their data from the tables on which they are based, referred to as the base tables of the views. 0 Like tables, views can be queried, updated, inserted into, and deleted from, with some restrictions. 0 All operations performed on a view actually affect the base tables of the view. Advantages of Views o Views provide an additional level of table security by restricting access to a predetermined set of rows and columns of a table. © They also hide data complexity and store complex queries. Schema e@ Aschema is a collection of database objects. © Aschema is owned by a database user and has the same name as that user. © Schema objects are the logical structures that directly refer to the database's data. © Schema objects include structures like tables, views, and indexes. PROCESS / CONNECTING DATABASE o Import JDBC Packages o Load and Register JDBC Driver o Establish connection o Create statement o Execute query o Process result o Close Connection » 8:52 s) IMportT JDBC PACKAGES CE Aree co Requires that you include the packages containing the JDBC classes needed for database programming, © import java.sql.*; or © import java.sql.Connection; © import java.sql.DriverManager; REGISTER JDBC DRIVER © The most common approach to register a driver is to use Java's Class.forName() method, to dynamically load the driver's class file into memory, which automaticall registers it © This method is preferable because it allows you to make the driver registration configurable and portable. © to register the Oracle driver ~ Class forName(‘oracle dhe driver OracleDriver") ) ceateh(ClasaNotFoundException ex) System.out.printin("Error: unable to load driver class!) vom-exlt) DATABASE URL FORMULATION / CREATE CONNECTION © After you've loaded the driver, you can establish a connection using the DriverManager.getConnection() method. For easy reference, let me list the three overloaded DriverManager.getConnectionQ methods - + getConnection(String url) + getConnection(String url, Properties prop) + getConnection(String ur password) String user, String CREATE CONNECTION OBJECT © Connection con = DriverManager.getConnection(String url); String uname = “s' String passwd = “manager"; String url="jdbe:mysql://172.21.170.15/sybea_dap"; Connection con = DriverManager.getConnection(url, uname, passwd); CLOSING JDBC CONNECTION o Explicitly closing a connection conserves DBMS resources, which will make your database administrator happy. o To close the above opened connection, you should call close() method as follows — con.close(); EXAMPLE TO CONNECT JAVA APPLICATION WITH ORACLE DATABASE import java.sql.*; class OracleCon{ public static void main(String args|]){ tryi Jistep1 load the driver class Class.forName("oracle.jdbe.driver.OracleDriver Jistep2 create the connection object Connection con=DriverManager.getConnection( ystem","orac racle:thin:@localhost: Istep3 create the statement object Statement stmt=con.createStatement(); Jistep4 exceute query ResultSet rs=stmt.executeQuery("select * from emp"); while(rs.nextQ) System,out.printIn(rs.getInt(+" "+rs.getString(2)+" "+rs.ge tString(3)): Hstep5 close the connection object con.close(); Jeateh(Exception e){ System.out.printin(e);} CONCURRENCY e Concurrency means more than one user: accessing same piece of data at the same time. are o Data anomalies are created on account of concurrency. © Oracle uses locking and multi version consistency model to resolve concurrency. READ CONSISTENCY © Guarantees that the set of data seen by a statement is consistent with respect to a single point in time and does not change during statement execution (statement-level read consistency). o Ensures that readers of database data do not wait for writers or other readers of the same data. o Ensures that writers of database data do not wait for readers of the same data. © Ensures that writers only wait for other writers if they attempt to update identical rows in concurrent transactions. o Fach user in oracle operates private copy of dat Hence the multi version consistency model. ée ANSIISO TRANSACTION ISOLATION LEVELS © These isolation levels are defined in terms of phenomena that must be prevented between concurrently executing transactions. The preventable phenomena are: © Dirty reads-A transaction reads data that has been written by another transaction that has not been committed yet. o Nonrepeatable (fuzzy) reads-A transaction rereads data it has previously read and finds that another committed transaction has modified or deleted the data. For example, a user queries a row and then later queries the same row, only to discover that the data has changed. o Phantom reads-A transaction reruns a query returning a set of rows that satisfies a search condition and finds tha another committed transaction has inserted additional oi that satisfy the condition. A process is a "thread of contro!" or a mechanism in an operating system that can run series of steps. Some operating systems use the terms job or task A process generally has its own private memory area in which it runs An Oracle database server has two general types of processes: User (Client) Processes Oracle Processes User processes are created and maintained to un the software code of an application program (such as an OCI or OCC! program) or an Oracle tool (such as Enterprise Manager Oracle C++ Call interface (OCC) is an Application Programming Interface (AP!) that provides C++ applications access fo data in an Oracle database. OCCl enables C++ programmers to utilize the full range of Oracle database operations, including SQL statement processing and object manipulation User processes also manage communication with the server process through the program interface. Oracle processes are invoked by other processes to perform functions on behalf of the invoking process Oracle creates server processes to handle requests from connected user processes. Aserver process communicates with the user process and interacts with Oracle to carry out requests from the associated user process. For example, if a user queries some data not already in the database buffers of the SGA, then the associated server process reads the proper data blocks from the data files into the SGA. Continued... © Oracle can be configured to vary the number of user processes for each server process. o In a dedicated server configuration, a server process handles requests for a single user process. oA shared server configuration Jets many user processes share a small number of server processes, minimizing the number of server processes and maximizing the use of available system resources. Continued... o On some systems, the user and server processes are separate, while on others they are combined into a single process. olf a system uses the shared server or if the user and server processes run on different computers, then the user and server processes must be separate. 0 Client/server systems separate the user and server processes and run them on different computers. XXXXXKKX- Types of DBMS Architecture There are mainly three types of DBMS architecture: © One Tier Architecture (Single Tier Architecture) © Two Tier Architecture e Three Tier Architecture 1-Tier Architecture 1 Tier Architecture in DBMS is the simplest architecture of Database in which the client, server, and Database all reside on the same machine. A simple one tier architecture example would be anytime you install a Database in your system and access it to practice SQL queries. But such architecture is rarely used in production. Single Ter Architecture 1 Tier Architecture Diagram 2-Tier Architecture A 2 Tier Architecture in DBMS is a Database architecture where the presentation layer runs on a client (PC, Mobile, Tablet, etc.), and data is stored ona server called the second tier. Two tier architecture provides added security to the DBMS as it is not exposed to the end-user directly. It also provides direct and faster communication. Client | Cllent 2 Client 3 aka a PC 2 Tier Architecture Diagram 3-Tier Architecture A3 Tier Architecture in DBMS is the most popular client server architecture in DBMS in which the development and maintenance of functional processes, logic, data access, data storage, and user interface is done independently as separate modules. Three Tier architecture contains a presentation layer, an application layer, and a database server. 3-Tier database Architecture design is an extension of the 2-tier client-server architecture. A3-tier architecture has the following layers: 1. Presentation layer (your PC, Tablet, Mobile, etc.) 2. Application layer (server) 3. Database Server Thvee Ter Architecture —_ ad Client Server Database © guni99.com 3 Tier Architecture Diagram TYPES OF SQL STATEMENTS DDL DML DCL TEL Create Insert Grant r- Commit Drmp Update Revoke Rollback Alter Delete /- Save point — Truncate © PL/SQL is integrated with Oracle database (since version 7). The functionalities of PL/SQL usually extended after each release of Oracle datab: Although PL/SQL is closely integrated with SQL. language, yet it adds some programming constraints that are not available in SQL. © PL/SQL program units generally are categorized as follows: * A PLISQL subprogram is a PL/SQL block that is stored in the database and can be called by name from an application. When you create a subprogram, the database parses the subprogram and stores ed representation in the database. You can declare a am as a procedure or a function. k is a PL/SQL block that appears in med or stored in the database. In many applications, PLISQL. blocks can appear wherever SQL a ) can appear. PL/SQL PROCEDURE -INSERT A ROW o CREATE OR REPLACE PROCEDURE insertEmployeeProcedure (lastname IN VARCHAR, firstname IN VARCHAR) AS BEGIN lastEmpId NUMBER := SELECT COUNT(*) INTO lastEmpId FROM Employees; INSERT INTO Employees(id, name, fname) VALUES(lastEmpld + 1, lastname, firstname); END insertEmployeeProcedure: o The PL/SQL compiler and interpreter are embedded in Oracle SQL Developer, giving developers a consistent and leveraged development model on both client and server. o Also, PL/SQL stored procedures can be called from ie) database clients, such as Pro*C, JDBC, ODBC, or OCI, a from Oracle Reports and Oracle Forms. stored procedure is a subroutine avaiable to applications that access a relational database system Stored procedures are similar to user-defined functions (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the CALL statement. oTypical use for stored procedures include data validation (integrated into the database) or acc’ control mechanisms. 5 STORED PROCEDURE o Furthermore, stored procedures can consolidate and centralize logic that was originally implemented in applications. o Extensive or complex processing that requires execution of several SQL statements is moved into stored procedures, and all applications call the procedures. o One can use nested stored procedures by executing one stored procedure from within another. STORED PROCEDURE © Syntax oCREATE PROCEDURE procedure name AS statement EXEC procedure name; o Eg. oCREATE PROCEDURE SelectAll Customers AS SELECT * FROM Customers GO; @ oFXEC Solect AllCust, WHAT IS SQL? © Structured Query Language is the core of the relational database which is used for accessing and managing the databases. o This language is used to manipulate and retrieve data from a structured data format in the form of tables and holds relationships between those tables. The relations could be as follows: WHAT IS NOSQL? o NoSQL, or most commonly known as Not only SQL database, provides a mechanism for storage and retrieval of unstructured data. o This type of database can handle a humongous amount of data and has a dynamic schema. oSo, a NoSQL database has no specific query language, no or a very few relationships, but has data stored in the format of collections and documents. BASE PROPERTIES o SQL databases are based on ACID properties ( Atomicity, Consistency, Isolation, and Durability) © NoSQL databases are based on the Brewers CAP theorem ( Consistency, Availability, and Partition tolerance ). o ACID properties : o Atomicity: Atomicity refers to the transactions that completely done or failed whe transaction refers to a single logical operation of a data. It means if one part of any transaction fails, the entire transaction fails and the database state is left unchanged. ACID CONTIN o Consistency: Consistency ensures that the data must meet all the validation rules. In simple words, you can say that your transaction never leaves the database without completing its state. olsolation: The main goal of isolation is concurrency control, © Durability: Durability means that if a transaction has been committed, it will occur whatever may come in between such as power loss, crash or any sort of error CAP THEOREM o Brewers CAP Theorem states that a database can only achieve at most two out of three guarantees: Consistency, Availability and Partition Tolerance. Here o Consistency: All the nodes see the same data at the same time. o Availability: Guarantees whether every request is successful in failed. o Partition Tolerance: Guarantees whether a system continues to operate despite message loss or failure of part of the system. DIFFERENCES FOR SQL AND NoSQL aod Type of database Relational Database Non-relational Database Schema Pre-defined Schema Dynamic Schema Document-based databases, Key valve stores, graph stores, wide Database Categories Table based Databases ‘column stores Complex Queries Good for complex queries _Not 2 good fit for complex queries Hierarchical Data Storage Not the best ft Fits better when compared to SQL Scalability Vertically Scalable Horizontally Scalable Language Structured Query language _ Unstructured Query language Online Processing Used for OLTP Used for OLAP Base Properties Based on ACID Properties Based on CAP Theorem Excellent support is provided by all . External Support sal veadets Rely on community support. EXAMPLES OF SQL AND NOSQL o The most popular databases from SQL and NoSQL are MySQL | and MongoDB = ORACLE Go| or “thegt ms! SOL Server aie HeRISE 202 casandra MONGODB OVERVIEW oMongoDB is an document database and leading NoSQL database. oMongoDB is written in C++. oMongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. oMongoDB works on concept of collection and document. DATABASE & COLLECTION o Database- is a phy container for collections. o Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases. © Collection- is a group of MongoDB documents. It is the equivalent of an RDBMS table. oA collection exists within a single database. Collections do not enforce a schema. © Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose MONGODB — ADVANTAGES oSchema less: » MongoDB is a document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another. o Structure of a single object is clear. o No complex joins. o Tuning. oEase of scale-out: MongoDB is easy to scale, ADVANTAGES CONTINUE.. o Deep query-ability. * MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL. o Conversion/mapping of application objects to database objects not needed. oUses internal memory for storing the (windowed) working set, enabling faster access of data. (ODBC) Adam Hughes Open Database Connectivity (ODBC) is an open standard application programming interface (API) that allows application programmers to access any database. Four Components of Open Database Connectivity (ODBC) Flowchart of the ODBC process The four different components of ODBC are: + Application: Processes and calls the ODBC functions and submits the SQL statements; * Driver manager: Loads drivers for each application; + Driver: Handles ODBC function calls, and then submits each SQL request to a data source; and + Data source: The data being accessed and its database management system (DBMS) OS. OBDC can also work with MySQL when its driver is called MyODBC. Sometimes, this is referred to as the MySQL Connecter/ODBC. ODBC drivers implements standard SQL syntax, following are the important features of ODBC: @ Inter-operability: Using ODBC driver you can develop applications which can communicate with different Database Management Systems and, you can switch/migrate your application from one database to other easily. e@ SQL Syntax: ODBC implements SQL syntax for easy understanding. Whenever an SQL statement passed to the ODBC driver it matches the given statement to the SQL 92 standard and writes the respective SQL statement that is accepted by an underlying database. e@ Rich metadata: ODBC provides rich support to metadata. It provides functions to get data about both functions and datatypes. e Attributes: ODBC also provides functions to get the details of the attributes and functions used in the drivers. @ Error codes: It supports error code mechanism to indicate the issues eccur while processing the SQL statements. What are the disadvantages of ODBC drivers? Java 8 Programming Object Oriented Programming ES PM iccsize your 3 thoughts: : Fremaahle ~ Beside its advantages, ODBC has several drawbacks. Following are the main drawbacks of ODBC. Keeps on changing: ODBC is provided by Microsoft and like other Microsoft products it keeps evolving and the companies using ODBC. should keep up with it. In addition to this, you need to pay to use ODBC SDK 8 and later versions. Usage of JNI libraries: Though ODBC solves vendor dependency problems by providing common API to interact with all the databases, at the end of the day ODBC is also a native API therefore, you need to use JNI in your Java applications which is not suggestable Uncertain: Since Microsoft has committed to provide support for OLE/DB which is more inclined to object-based programming rather than procedural. We cannot assume how it is going to be in the future. Complicated to build: ODBC is drivers are a bit complicated to build and maintain. Reliability depends on the underlying framework: Since ODBC specification specifies only the application protocol, the ODBC diver inherits the features of the framework it uses. Thus the reliability depends on the implementation of requestresponse protocol of the underlying framework, Severs not standardized: In ODBC since most of the work is done by clients, it is difficult to scale. In addition to this in ODBC driver servers are not sufficiently standardized. Therefore, clients maintain their ‘own drivers, naming tables, and macros, which complicates management at larger sites, Slow with large databases: Though it is easy to use when used with larger database management systems ODBC will be slow. Explain the PL/SQL Engine in DBMS PUSOL DBMS Database PUISQL is oracle’ s procedural language extension to SQL. PL/SQL allows you to mix SQL statements with procedural statements like IF statements. Looping structure etc, PL/SQL is the superset of SQL. It uses SQL for data retrieval and manipulation and uses its own statement for data processing, PV/SQL program units are generally categorized as follows — Anonymous block This is a PL/SQL block that appears within your application. In many applications PL/SQL blocks can appear where SQL statements can ‘appear. Such blocks are called Anonymous blocks. Stored procedures ‘This is a PL/SQL block that is stored in the database with a name. Application programs are executing these procedures using the name. Oracle allows you to create functions, which are the same as procedures but return a value, and packages, which are a collection of procedures and functions. PL/SQL Engine Every PLISQL block is first executed by the PUISQL engine. This is the engine that compiles and executes PVSAL blocks. PLISQL engine is available in oracle server and certain oracle tools ‘such as oracle forms and oracle reports. It executes all procedural statements of a PL/SQL of the block, but sends SQL commands to ‘SQL statement executors in the oracle RDBMS, ‘That means PL/SQL separates SQL commands from PL/SQL commands and executes PL/SQL commands using procedural statement executor, which is a part of the PL/SQL engine. FUE BLOCR PL/SQL ENGINE ee Pratl ov Desi mes manatee | | oe PLSOL statement } sos = EXCEPTION DATABASE SERVER scp anager SOL Sicnen END: Design issues of the distributed system — 1. Heterogeneity: Heterogeneity is applied to the network, computer hardware, operating system, and implementation of different developers. A key component of the heterogeneous distributed system client-server environment is middleware. Middleware is a set of services that enables applications and end-user to interact with each other across a heterogeneous distributed system. Openness: The openness of the distributed system is determined primarily by the degree to which new N resource-sharing services can be made available to the users. Open systems are characterized by the fact that their key interfaces are published. It is based on a uniform communication mechanism and published interface for access to shared resources. It can be constructed from heterogeneous hardware and software. Scalability: The scalability of the system should remain efficient even with a significant increase in o the number of users and resources connected. It shouldn’ t matter if a program has 10 or 100 nodes; performance shouldn’ t vary. A distributed system’ s scaling requires consideration of a number of elements, including size, geography, and management. 4. Security: The security of an information system has three components Confidentially, integrity, and availability. Encryption protects shared resources and keeps sensitive information secrets when transmitted.

You might also like