Provided by: Noteshub.co.in | Download Android App
Provided by: Noteshub.co.in | Download Android App
Provided by: Noteshub.co.in | Download Android App
What is the the need for Complex Data Type?
Provided by: Noteshub.co.in | Download Android App
Provided by: Noteshub.co.in | Download Android App
Provided by: Noteshub.co.in | Download Android App
What is a DTD?
A DTD is a Document Type Definition.
A DTD defines the structure and the legal elements and attributes of an XML
document.
Why Use a DTD?
With a DTD, independent groups of people can agree on a standard DTD for
interchanging data.
An application can use a DTD to verify that XML data is valid.
Provided by: Noteshub.co.in | Download Android App
An Internal DTD Declaration
If the DTD is declared inside the XML file, it must be wrapped inside the
<!DOCTYPE> definition:
XML document with an internal DTD
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
An External DTD Declaration
If the DTD is declared in an external file, the <!DOCTYPE> definition must
contain a reference to the DTD file:
XML document with a reference to an external DTD
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
And here is the file "note.dtd", which contains the DTD:
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
Provided by: Noteshub.co.in | Download Android App
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
XML Namespaces - The xmlns Attribute
When using prefixes in XML, a namespace for the prefix must be defined.
The namespace can be defined by an xmlns attribute in the start tag of an
element.
The namespace declaration has the following syntax. xmlns:prefix="URI".
<root>
<h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table xmlns:f="http://www.w3schools.com/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
</root>
Provided by: Noteshub.co.in | Download Android App
Provided by: Noteshub.co.in | Download Android App
SAX (Simple API for XML)
SAX (Simple API for XML) is an application program interface (API) that
allows a programmer to interpret a Web file that uses the Extensible Markup
Language (XML) - that is, a Web file that describes a collection of data. SAX
is an alternative to using the Document Object Model (DOM) to interpret the
XML file. As its name suggests, it's a simpler interface than DOM and is
appropriate where many or very large files are to be processed, but it contains
fewer capabilities for manipulating the data content.
SAX is an event-driven interface. The programmer specifies an event that
may happen and, if it does, SAX gets control and handles the situation. SAX
works directly with an XML parser.
SAX was developed collaboratively by members of the XML-DEV mailing list
(currently hosted by OASIS). The original version of SAX, which was specific
to Java, was the first API for XML in Java to gain broad industry support.
Provided by: Noteshub.co.in | Download Android App
PostgreSQL is a powerful, open source object-relational database
system(ORDBMS). It has more than 15 years of active development and a
proven architecture that has earned it a strong reputation for reliability,
data integrity, and correctness.
It is used to store data securely; supporting best practices and allow retrieving them when
request is processed.
PostgreSQL (also pronounced as Post-gress-Q-L) is developed by the PostgreSQL Global
Development Group (a worldwide team of volunteers). It is not controlled by any
corporation or other private entity. It is open source and its source code is available free of
charge.
PostgreSQL is cross platform and runs on many operating systems such as Linux, FreeBSD,
OS X, Solaris, and Microsoft Windows etc.
Provided by: Noteshub.co.in | Download Android App
PostgreSQL Features
o PostgreSQL runs on all major operating systems i.e. Linux, UNIX (AIX, BSD, HP-UX,
SGI IRIX, Mac OS X, Solaris, Tru64), and Windows etc.
o PostgreSQL supports text, images, sounds, and video, and includes programming
interfaces for C / C++, Java, Perl, Python, Ruby, Tcl and Open Database Connectivity
(ODBC).
o PostgreSQL supports a lot of features of SQL like Complex SQL queries, SQL Sub-
selects, Foreign keys, Trigger, Views, Transactions, Multiversion concurrency control
(MVCC), Streaming Replication (as of 9.0), Hot Standby (as of 9.0).
o In PostgreSQL, table can be set to inherit their characteristics from a "parent" table.
o You can install several extensions to add additional functionality to PostgreSQL.
PostgreSQL Data Types
A datatype specifies, what kind of data you want to store in the table field. While creating
table, for each column, you have to use a datatype.
There are mainly three types of datatypes in PotgreSQL. Besides this, users can also create
their own custom datatypes using CREATE TYPE SQL command.
Following are the mainly three types of datatypes in PostgreSQL:
o Numeric datatype
o String datatype
o Date/time datatype
Numeric Data Type
Numeric datatype is used to specify the numeric data into the table.
name description storage range
size
smallint stores whole numbers, 2 bytes -32768 to +32767
integer small range. -2147483648 to +2147483647
stores whole 4 bytes
numbers.use this when
Provided by: Noteshub.co.in | Download Android App
you want to store typical
integers.
bigint stores whole numbers, 8 bytes -9223372036854775808 to
large range. 9223372036854775807
decimal user-specified precision, variable up to 131072 digits before the
exact decimal point; up to 16383 digits
after the decimal point.
numeric user-specified precision, variable up to 131072 digits before the
exact decimal point; up to 16383 digits
after the decimal point.
real variable-precision, 4 bytes 6 decimal digits precision.
inexact
double variable-precision, 8 bytes 15 decimal digits precision
precision inexact
serial auto incrementing 4 bytes 1 to 2147483647
integer
bigserial large auto incrementing 8 bytes 1 to 9223372036854775807
integer
String Data Type
String datatype is used to represent the string type values.
Datatype Explanation
char(size) Here size is the number of characters to store. Fixed-length strings.
Space padded on right to equal size characters.
character(size) Here size is the number of characters to store. Fixed-length strings.
Provided by: Noteshub.co.in | Download Android App
varchar(size) Space padded on right to equal size characters.
Here size is the number of characters to store. Variable-length string.
character Here size is the number of characters to store. Variable-length string.
varying(size)
Variable-length string.
text
Date/Time Data Type
The date/time datatype is used to represent the columns using date and time values.
Name Description Storage Minimum value Maximum Resolution
size value
timestamp both 8 4713 bc 294276 ad 1
[ (p) ] [ date and bytes microsecond
without time (no / 14 digits
time zone ] time
zone)
timestamp both 8 4713 bc 294276 ad 1
[ (p) ] with date and bytes microsecond
time zone time, / 14 digits
with time
zone
date date (no 4 4713 bc 5874897 1 day
time of bytes ad
day)
time [ (p) ] time of 8 00:00:00 24:00:00 1
[ without day (no bytes microsecond
time zone ] date) / 14 digits
Provided by: Noteshub.co.in | Download Android App
time [ (p) ] times of 12 00:00:00+1459 24:00:00- 1
with time day only, bytes 1459 microsecond
zone with time / 14 digits
zone
interval [ time 12 -178000000 178000000 1
fields ] [ interval bytes years years microsecond
(p) ] / 14 digits
Some other data Types
Boolean type:
Name Description Storage size
boolean it specifies the state of true or false. 1 byte
Monetary type: Storage Range
size
Name Description
money currency 8 bytes -92233720368547758.08 to
amount +92233720368547758.07
Geometric Type:
Geometric data types represent two-dimensional spatial objects. The most fundamental
type, the point, forms the basis for all of the other types.
Name Storage size Representation Description
point 16 bytes point on a plane (x,y)
line 32 bytes
infinite line (not fully ((x1,y1),(x2,y2))
Provided by: Noteshub.co.in | Download Android App
implemented)
lseg 32 bytes finite line segment ((x1,y1),(x2,y2))
box 32 bytes rectangular box ((x1,y1),(x2,y2))
path 16+16n closed path (similar to ((x1,y1),...)
bytes polygon)
path 16+16n open path [(x1,y1),...]
bytes
polygon 40+16n polygon (similar to closed ((x1,y1),...)
path)
circle 24 bytes circle <(x,y),r> (center point and
radius)
Oracle database (Oracle DB)is a relational database management system
(RDBMS) from the Oracle Corporation. Originally developed in 1977 by Lawrence Ellison and other
developers, Oracle DB is one of the most trusted and widely-used relational database engines.
The system is built around a relational database framework in which data objects may be directly
accessed by users (or an application front end) through structured query language (SQL). Oracle is
a fully scalable relational database architecture and is often used by global enterprises, which
manage and process data across wide and local area networks. The Oracle database has its own
network component to allow communications across networks. Oracle DB is also known as Oracle
RDBMS and, sometimes, just Oracle.
IBM DB2is a database product from IBM. It is a Relational Database
Management System (RDBMS). DB2 is designed to store, analyze and retrieve
the data efficiently. DB2 product is extended with the support of Object-
Oriented features and non-relational structures with XML.
Initially, IBM had developed DB2 product for their specific platform. Since year
1990, it decided to develop a Universal Database (UDB) DB2 Server, which can
run on any authoritative operating systems such as Linux, UNIX, and Windows.
Provided by: Noteshub.co.in | Download Android App
SQL Standards
Oracle strives to comply with industry-accepted standards and participates actively in SQL
standards committees. Industry-accepted committees are the American National Standards
Institute (ANSI) and the International Standards Organization (ISO), which is affiliated with the
International Electrotechnical Commission (IEC). Both ANSI and the ISO/IEC have accepted
SQL as the standard language for relational databases. When a new SQL standard is
simultaneously published by these organizations, the names of the standards conform to
conventions used by the organization, but the standards are technically identical.
The latest SQL standard was adopted in July 1999 and is often called SQL:99. The formal names
of this standard are:
ANSI X3.135-1999, "Database Language SQL", Parts 1 ("Framework"), 2
("Foundation"), and 5 ("Bindings")
ISO/IEC 9075:1999, "Database Language SQL", Parts 1 ("Framework"),
2 ("Foundation"), and 5 ("Bindings")
SQL/CLI : an updated definition of the extension Call Level Interface, originally published in
1995, also known as CLI-95 ISO/IEC 9075-3:1999
SQL/PSM : an updated definition of the extension Persistent Stored Modules, originally
published in 1996, also known as PSM-96 ISO/IEC 9075-4:1999
The SQL:2003 standard makes minor modifications to all parts of SQL:1999 (also known as SQL3),
and officially introduces a few new features such as:[1]
XML-related features (SQL/XML)
Window functions
the sequence generator, which allows standardized sequences
two new column types: auto-generated values and identity-columns
the new MERGE statement
extensions to the CREATE TABLE statement, to allow "CREATE TABLE AS" and "CREATE
TABLE LIKE"
removal of the poorly implemented "BIT" and "BIT VARYING" data types
OLAP capabilities (initially added in SQL:1999) were extended with a window function.[2]
Provided by: Noteshub.co.in | Download Android App
.
What is XQuery?
XQuery is the language for querying XML data
XQuery for XML is like SQL for databases
XQuery is built on XPath expressions
XQuery is supported by all major databases
XQuery is a W3C Recommendation
XQuery Example
for $x in doc("books.xml")/bookstore/book
where $x/price>30
Provided by: Noteshub.co.in | Download Android App
order by $x/title
return $x/title
What is XPath?
XPath is a major element in the XSLT standard.
XPath can be used to navigate through elements and attributes in an XML
document.
XPath is a syntax for defining parts of an XML document
XPath uses path expressions to navigate in XML documents
XPath contains a library of standard functions
XPath is a major element in the XSLT standard
XPath is a W3C recommendation
XPath
XPath standards for XML Path language. XPATH is a major element in XSLT. It is used for selection
and addressing elements and attributes in an XML document. It is basically a syntax used to describe
parts of an XML document. The root node is the XPath node that contains the entire document. The
root node also contains comments or processing instructions that are outside the document element.
Every element in the original XML document is represented by an XPath element node. At a
minimum, an element node is the parent of one attribute node for each attribute in the XML source
document. XPath is in fact a subset of XQuery.
XQuery
XQuery stands for XML query. It was designed to query collections of XML data. XQuery supports XPath
natively therefore it can do everything that XPath can do. It supplements this with a SQL-like
FLWOR(FOR, LET, WHERE, ORDER BY, RETURN) expression. Its capabilities overlap with XSLT.
XSLT was primarily conceived as a stylesheet language to render XML for the human reader on screen,
XQuery was conceived as a database query language.XSLT therefore is better in its handling of
narrative documents with more flexible structure, while XQuery is stronger in its data handling.
XPointer
Provided by: Noteshub.co.in | Download Android App
XPointer stands for XML Pointer language. The XPointer Framework is defined at
http://www.w3.org/TR/xptrframework/. It is closely related to XPath and uses XPath expressions to
find points inside parsed entities. It could be used to create a link from one document to an element
inside another. It is similar to fragment identifier in HTML but more versatile.
WHAT IS WEB SERVICES?
A Web Service is can be defined by following ways:
o is a client server application or application component for communication.
o method of communication between two devices over network.
o is a software system for interoperable machine to machine communication.
o is a collection of standards or protocols for exchanging information between two
devices or application.
Let's understand it by the figure given below:
As you can see in the figure, java, .net or PHP applications can communicate with other
applications through web service over the network. For example, java application can
interact with Java, .Net and PHP applications. So web service is a language independent way
of communication.
SOAP Web Services
SOAP (Simple Object Access Protocol) is a protocol specification for exchanging structured
information in the implementation of web services in computer networks. Its purpose is to induce
extensibility, neutrality and independence.
Provided by: Noteshub.co.in | Download Android App
It is a XML-based protocol for accessing web services.
SOAP is a W3C recommendation for communication between two applications.
SOAP is XML based protocol. It is platform independent and language independent. By using
SOAP, you will be able to interact with other programming language applications.
Advantages of Soap Web Services
WS Security: SOAP defines its own security known as WS Security.
Language and Platform independent: SOAP web services can be written in any
programming language and executed in any platform.
Disadvantages of Soap Web Services
Slow: SOAP uses XML format that must be parsed to be read. It defines many standards
that must be followed while developing the SOAP applications. So it is slow and consumes
more bandwidth and resource.
WSDL dependent: SOAP uses WSDL and doesn't have any other mechanism to discover
the service.
WHAT IS WSDL?
The Web Services Description Language (WSDL /ˈwɪzdəl/) is an XML-based interface definition
language that is used for describing the functionality offered by a web service.
Provided by: Noteshub.co.in | Download Android App
Other Diagrams for Web services:-
Web services play a complementary and dominant role in building global IS for
today's dynamic business world. Web services are self-contained, modular
applications that can be described, published, located and invoked over a network.
Provided by: Noteshub.co.in | Download Android App
Web services perform functions ranging from simple requests to complicated
business processes. Once a web service is developed, other applications and other
web services can discover and invoke the deployed service through universal
description, discovery and integration. The idea of web service is to leverage the
advantages of the web as a platform to apply it to the application services. We use
them, not just to the static information.